Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
add some types
Jeff Pereira199cbe8bcb3f
diff --git a/apps/api/src/main/runWebScraper.ts b/apps/api/src/main/runWebScraper.tsindex dee89bc4b..e97e14139 100644--- a/apps/api/src/main/runWebScraper.ts+++ b/apps/api/src/main/runWebScraper.ts@@ -1,5 +1,5 @@import { Job } from "bull";-import { CrawlResult, WebScraperOptions } from "../types";+import { CrawlResult, WebScraperOptions, RunWebScraperParams, RunWebScraperResult } from "../types";import { WebScraperDataProvider } from "../scraper/WebScraper";import { DocumentUrl, Progress } from "../lib/entities";import { billTeam } from "../services/billing/credit_billing";@@ -45,21 +45,7 @@ export async function runWebScraper({onError,team_id,bull_job_id,-}: {- url: string;- mode: "crawl" | "single_urls" | "sitemap";- crawlerOptions: any;- pageOptions?: any;- inProgress: (progress: any) => void;- onSuccess: (result: any) => void;- onError: (error: any) => void;- team_id: string;- bull_job_id: string;-}): Promise<{- success: boolean;- message: string;- docs: Document[] | DocumentUrl[];-}> {+}: RunWebScraperParams): Promise<RunWebScraperResult> {try {const provider = new WebScraperDataProvider();if (mode === "crawl") {diff --git a/apps/api/src/types.ts b/apps/api/src/types.tsindex 971cc18ad..e69353b65 100644--- a/apps/api/src/types.ts+++ b/apps/api/src/types.ts@@ -1,4 +1,6 @@-import { ExtractorOptions, Document } from "./lib/entities";+import { ExtractorOptions, Document, DocumentUrl } from "./lib/entities";++type Mode = "crawl" | "single_urls" | "sitemap";export interface CrawlResult {source: string;@@ -20,13 +22,31 @@ export interface IngestResult {export interface WebScraperOptions {url: string;- mode: "crawl" | "single_urls" | "sitemap";+ mode: Mode;crawlerOptions: any;pageOptions: any;team_id: string;origin?: string;}+export interface RunWebScraperParams {+ url: string;+ mode: Mode;+ crawlerOptions: any;+ pageOptions?: any;+ inProgress: (progress: any) => void;+ onSuccess: (result: any) => void;+ onError: (error: Error) => void;+ team_id: string;+ bull_job_id: string;+}++export interface RunWebScraperResult {+ success: boolean;+ message: string;+ docs: Document[] | DocumentUrl[];+}+export interface FirecrawlJob {success: boolean;message: string;