web / lib/jobs/handlers/url-fetch-job
lib/jobs/handlers/url-fetch-job
URL Fetch Job Handler.
This job handles fetching data from URLs for URL-based and scheduled imports. It downloads the data, saves it to the file system, and updates the import-files record to trigger the existing dataset-detection pipeline.
Interfaces
UrlFetchJobInput
Properties
scheduledImportId?
optionalscheduledImportId:string
sourceUrl
sourceUrl:
string
authConfig?
optionalauthConfig:object
type?
optionaltype:"none"|"api-key"|"bearer"|"basic"|null
apiKey?
optionalapiKey:string|null
API key to include in request header
apiKeyHeader?
optionalapiKeyHeader:string|null
Header name for API key
bearerToken?
optionalbearerToken:string|null
Bearer token for Authorization header
username?
optionalusername:string|null
Username for basic authentication
password?
optionalpassword:string|null
Password for basic authentication
customHeaders?
optionalcustomHeaders:string|number|boolean|unknown[] |{ \[k: string\]: unknown; }|null
Additional custom headers as JSON object
catalogId?
optionalcatalogId:string|number
originalName
originalName:
string
userId?
optionaluserId:string|number
triggeredBy?
optionaltriggeredBy:"schedule"|"webhook"|"manual"
Variables
urlFetchJob
consturlFetchJob:object
Type Declaration
slug
slug:
string="url-fetch"
handler()
handler: (
context) =>Promise<{ output: \{ success: boolean; importFileId: string \| number; filename: string; contentHash: string; isDuplicate: boolean; contentType: string; fileSize: number \| undefined; skippedReason?: string; }; } |{ output: \{ success: boolean; error: string; errorDetails: \{ name: string; stack: string \| undefined; }; }; } |{ output: \{ success: boolean; error: string; }; }>
Parameters
context
Returns
Promise<{ output: \{ success: boolean; importFileId: string \| number; filename: string; contentHash: string; isDuplicate: boolean; contentType: string; fileSize: number \| undefined; skippedReason?: string; }; } | { output: \{ success: boolean; error: string; errorDetails: \{ name: string; stack: string \| undefined; }; }; } | { output: \{ success: boolean; error: string; }; }>