export interface ICreateBrowser { session_name?: string; session_ttl?: number; session_recording?: boolean; proxy_country?: string; proxy_url?: string; fingerprint?: object; } export interface ScrapingCrawlConfig { apiKey?: string; baseUrl?: string; timeout?: number; } export interface ScrapingCrawlDocumentMetadata { title?: string; description?: string; language?: string; keywords?: string; robots?: string; ogTitle?: string; ogDescription?: string; ogUrl?: string; ogImage?: string; ogAudio?: string; ogDeterminer?: string; ogLocale?: string; ogLocaleAlternate?: string[]; ogSiteName?: string; ogVideo?: string; dctermsCreated?: string; dcDateCreated?: string; dcDate?: string; dctermsType?: string; dcType?: string; dctermsAudience?: string; dctermsSubject?: string; dcSubject?: string; dcDescription?: string; dctermsKeywords?: string; modifiedTime?: string; publishedTime?: string; articleTag?: string; articleSection?: string; sourceURL?: string; statusCode?: number; error?: string; [key: string]: any; } export interface ScrapingCrawlDocument { markdown?: string; html?: string; rawHtml?: string; links?: string[]; extract?: T; screenshot?: string; metadata?: ScrapingCrawlDocumentMetadata; } export interface CrawlScrapeOptions { formats?: ('markdown' | 'html' | 'rawHtml' | 'content' | 'links' | 'screenshot' | 'screenshot@fullPage')[]; headers?: Record; includeTags?: string[]; excludeTags?: string[]; onlyMainContent?: boolean; waitFor?: number; timeout?: number; } export interface ScrapeParams extends CrawlScrapeOptions { browserOptions?: ICreateBrowser; } export interface ScrapeStatusResponse { success: true; error?: string; status: 'scraping' | 'completed' | 'failed' | 'cancelled'; data: ScrapingCrawlDocument; } export interface CrawlParams { includePaths?: string[]; excludePaths?: string[]; maxDepth?: number; maxDiscoveryDepth?: number; limit?: number; allowBackwardLinks?: boolean; allowExternalLinks?: boolean; ignoreSitemap?: boolean; scrapeOptions?: CrawlScrapeOptions; deduplicateSimilarURLs?: boolean; ignoreQueryParameters?: boolean; regexOnFullURL?: boolean; delay?: number; browserOptions?: ICreateBrowser; } export interface ScrapeResponse { id?: string; success: true; error?: string; } export interface BatchScrapeResponse { id?: string; success: true; error?: string; invalidURLs?: string[]; } export interface CrawlResponse { id?: string; success: true; error?: string; } export interface CrawlStatusResponse { success: boolean; status: 'scraping' | 'completed' | 'failed' | 'cancelled'; completed: number; total: number; data: ScrapingCrawlDocument[]; error?: string; } export interface BatchScrapeStatusResponse { success: true; status: 'scraping' | 'completed' | 'failed' | 'cancelled'; completed: number; total: number; data: ScrapingCrawlDocument[]; error?: string; } export interface ErrorResponse { success: false; error: string; } export interface CrawlErrorsResponse { errors: { id: string; timestamp?: string; error: string; }[]; robotsBlocked: string[]; } export interface CrawlScrapeParams extends CrawlScrapeOptions { browserOptions?: ICreateBrowser; }