diff --git a/apps/api/src/controllers/v1/crawl.ts b/apps/api/src/controllers/v1/crawl.ts index 78d1a986..7d526e90 100644 --- a/apps/api/src/controllers/v1/crawl.ts +++ b/apps/api/src/controllers/v1/crawl.ts @@ -117,7 +117,7 @@ export async function crawlController( crawl_id: id, sitemapped: true, webhook: req.body.webhook, - verification_token: req.body.verification_token, + verificationToken: req.body.verificationToken, v1: true, }, opts: { @@ -149,7 +149,7 @@ export async function crawlController( origin: "api", crawl_id: id, webhook: req.body.webhook, - verification_token: req.body.verification_token, + verificationToken: req.body.verificationToken, v1: true, }, { @@ -160,7 +160,7 @@ export async function crawlController( } if(req.body.webhook) { - await callWebhook(req.auth.team_id, id, null, req.body.webhook, req.body.verification_token, true, "crawl.started"); + await callWebhook(req.auth.team_id, id, null, req.body.webhook, req.body.verificationToken, true, "crawl.started"); } const protocol = process.env.ENV === "local" ? req.protocol : "https"; diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 592f1c9b..d6a438ef 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -192,7 +192,7 @@ export const crawlRequestSchema = crawlerOptions.extend({ origin: z.string().optional().default("api"), scrapeOptions: scrapeOptions.omit({ timeout: true }).default({}), webhook: z.string().url().optional(), - verification_token: z + verificationToken: z .string() .optional(), limit: z.number().default(10000), diff --git a/apps/api/src/services/queue-worker.ts b/apps/api/src/services/queue-worker.ts index 32a8d2bc..10dba319 100644 --- a/apps/api/src/services/queue-worker.ts +++ b/apps/api/src/services/queue-worker.ts @@ -329,7 +329,7 @@ async function processJob(job: Job, token: string) { job.id as string, data, job.data.webhook, - job.data.verification_token, + job.data.verificationToken, job.data.v1, job.data.crawlerOptions !== null ? "crawl.page" : "batch_scrape.page", ); @@ -340,7 +340,7 @@ async function processJob(job: Job, token: string) { job.data.crawl_id, data, job.data.webhook, - job.data.verification_token, + job.data.verificationToken, job.data.v1, job.data.crawlerOptions !== null ? "crawl.page" : "batch_scrape.page", true @@ -404,7 +404,7 @@ async function processJob(job: Job, token: string) { origin: job.data.origin, crawl_id: job.data.crawl_id, webhook: job.data.webhook, - verification_token: job.data.verification_token, + verificationToken: job.data.verificationToken, v1: job.data.v1, }, {}, @@ -470,7 +470,7 @@ async function processJob(job: Job, token: string) { job.data.crawl_id, data, job.data.webhook, - job.data.verification_token, + job.data.verificationToken, job.data.v1, job.data.crawlerOptions !== null ? "crawl.completed" : "batch_scrape.completed" ); @@ -489,7 +489,7 @@ async function processJob(job: Job, token: string) { job.data.crawl_id, [], job.data.webhook, - job.data.verification_token, + job.data.verificationToken, job.data.v1, job.data.crawlerOptions !== null ? "crawl.completed" : "batch_scrape.completed" ); @@ -560,7 +560,7 @@ async function processJob(job: Job, token: string) { job.data.crawl_id ?? (job.id as string), data, job.data.webhook, - job.data.verification_token, + job.data.verificationToken, job.data.v1, job.data.crawlerOptions !== null ? "crawl.page" : "batch_scrape.page", ); diff --git a/apps/api/src/services/webhook.ts b/apps/api/src/services/webhook.ts index b40b5333..11737b5e 100644 --- a/apps/api/src/services/webhook.ts +++ b/apps/api/src/services/webhook.ts @@ -12,7 +12,7 @@ export const callWebhook = async ( id: string, data: any | null, specified?: string, - verification_token?: string, + verificationToken?: string, v1 = false, eventType: WebhookEventType = "crawl.page", awaitWebhook: boolean = false @@ -24,7 +24,7 @@ export const callWebhook = async ( ); const useDbAuthentication = process.env.USE_DB_AUTHENTICATION === "true"; let webhookUrl = specified ?? selfHostedUrl; - verification_token = verification_token ?? process.env.SELF_HOSTED_WEBHOOK_VERIFICATION_TOKEN + verificationToken = verificationToken ?? process.env.SELF_HOSTED_WEBHOOK_VERIFICATION_TOKEN // Only fetch the webhook URL from the database if the self-hosted webhook URL and specified webhook are not set // and the USE_DB_AUTHENTICATION environment variable is set to true @@ -79,7 +79,7 @@ export const callWebhook = async ( type: eventType, [v1 ? "id" : "jobId"]: id, data: dataToSend, - verification_token, + verificationToken, error: !v1 ? data?.error || undefined : eventType === "crawl.page" diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts index f5e4ddbe..434fbf0c 100644 --- a/apps/api/src/types.ts +++ b/apps/api/src/types.ts @@ -33,7 +33,7 @@ export interface WebScraperOptions { crawl_id?: string; sitemapped?: boolean; webhook?: string; - verification_token?: string, + verificationToken?: string, v1?: boolean; is_scrape?: boolean; } diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts index 8b64b3f1..61d4af64 100644 --- a/apps/js-sdk/firecrawl/src/index.ts +++ b/apps/js-sdk/firecrawl/src/index.ts @@ -141,7 +141,7 @@ export interface CrawlParams { ignoreSitemap?: boolean; scrapeOptions?: CrawlScrapeOptions; webhook?: string; - verification_token?: string; + verificationToken?: string; } /**