From d663bbf0cacfcd3bf0ba8757279fc3cd61494e48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20M=C3=B3ricz?= Date: Fri, 20 Sep 2024 21:41:53 +0200 Subject: [PATCH] feat(actions): add scroll --- apps/api/src/controllers/v1/types.ts | 4 ++++ apps/api/src/lib/entities.ts | 3 +++ apps/js-sdk/firecrawl/src/index.ts | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/api/src/controllers/v1/types.ts b/apps/api/src/controllers/v1/types.ts index 67d66742..b7ca551b 100644 --- a/apps/api/src/controllers/v1/types.ts +++ b/apps/api/src/controllers/v1/types.ts @@ -78,6 +78,10 @@ export const actionsSchema = z.array(z.union([ type: z.literal("pressKey"), key: z.string(), }), + z.object({ + type: z.literal("scroll"), + direction: z.enum(["up", "down"]), + }), ])); export const scrapeOptions = z.object({ diff --git a/apps/api/src/lib/entities.ts b/apps/api/src/lib/entities.ts index 1186583a..7723f0f2 100644 --- a/apps/api/src/lib/entities.ts +++ b/apps/api/src/lib/entities.ts @@ -25,6 +25,9 @@ export type Action = { } | { type: "pressKey", key: string, +} | { + type: "scroll", + direction: "up" | "down" }; export type PageOptions = { diff --git a/apps/js-sdk/firecrawl/src/index.ts b/apps/js-sdk/firecrawl/src/index.ts index 23241a5d..7004d86f 100644 --- a/apps/js-sdk/firecrawl/src/index.ts +++ b/apps/js-sdk/firecrawl/src/index.ts @@ -99,7 +99,10 @@ export type Action = { } | { type: "pressKey", key: string, -};; +} | { + type: "scroll", + direction: "up" | "down", +}; export interface ScrapeParams extends CrawlScrapeOptions { extract?: {