diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 9585175e..b5c27577 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -92,6 +92,10 @@ export const actionsSchema = z.array(z.union([ z.object({ type: z.literal("scrape"), }), + z.object({ + type: z.literal("executeJavascript"), + script: z.string() + }), ])); export const scrapeOptions = z.object({ diff --git a/apps/api/src/lib/entities.ts b/apps/api/src/lib/entities.ts index 2c8f376d..c382c186 100644 --- a/apps/api/src/lib/entities.ts +++ b/apps/api/src/lib/entities.ts @@ -31,6 +31,9 @@ export type Action = { direction: "up" | "down" } | { type: "scrape", +} | { + type: "executeJavascript", + script: string, } export type PageOptions = { diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts index 7ad5a5f0..bcf9d5b7 100644 --- a/apps/js-sdk/firecrawl/src/index.ts +++ b/apps/js-sdk/firecrawl/src/index.ts @@ -109,6 +109,9 @@ export type Action = { direction: "up" | "down", } | { type: "scrape", +} | { + type: "executeJavascript", + script: string, }; export interface ScrapeParams extends CrawlScrapeOptions {