@mendable/firecrawl-js 1.7.0-beta.1 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +3 -13
- package/dist/index.d.ts +3 -13
- package/package.json +1 -1
- package/src/index.ts +2 -13
package/dist/index.d.cts
CHANGED
|
@@ -142,16 +142,6 @@ interface CrawlResponse {
|
|
|
142
142
|
success: true;
|
|
143
143
|
error?: string;
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Response interface for crawling operations.
|
|
147
|
-
* Defines the structure of the response received after initiating a crawl.
|
|
148
|
-
*/
|
|
149
|
-
interface BatchScrapeResponse {
|
|
150
|
-
id?: string;
|
|
151
|
-
url?: string;
|
|
152
|
-
success: true;
|
|
153
|
-
error?: string;
|
|
154
|
-
}
|
|
155
145
|
/**
|
|
156
146
|
* Response interface for job status checks.
|
|
157
147
|
* Provides detailed status of a crawl job including progress and results.
|
|
@@ -273,8 +263,8 @@ declare class FirecrawlApp {
|
|
|
273
263
|
* @param idempotencyKey - Optional idempotency key for the request.
|
|
274
264
|
* @returns The response from the crawl operation.
|
|
275
265
|
*/
|
|
276
|
-
batchScrapeUrls(urls: string[], params?: ScrapeParams, pollInterval?: number, idempotencyKey?: string): Promise<
|
|
277
|
-
asyncBatchScrapeUrls(urls: string[], params?: ScrapeParams, idempotencyKey?: string): Promise<
|
|
266
|
+
batchScrapeUrls(urls: string[], params?: ScrapeParams, pollInterval?: number, idempotencyKey?: string): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
267
|
+
asyncBatchScrapeUrls(urls: string[], params?: ScrapeParams, idempotencyKey?: string): Promise<CrawlResponse | ErrorResponse>;
|
|
278
268
|
/**
|
|
279
269
|
* Initiates a batch scrape job and returns a CrawlWatcher to monitor the job via WebSocket.
|
|
280
270
|
* @param urls - The URL to scrape.
|
|
@@ -354,4 +344,4 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
|
|
|
354
344
|
close(): void;
|
|
355
345
|
}
|
|
356
346
|
|
|
357
|
-
export { type Action, type ActionsResult, type
|
|
347
|
+
export { type Action, type ActionsResult, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type ErrorResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, FirecrawlApp as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -142,16 +142,6 @@ interface CrawlResponse {
|
|
|
142
142
|
success: true;
|
|
143
143
|
error?: string;
|
|
144
144
|
}
|
|
145
|
-
/**
|
|
146
|
-
* Response interface for crawling operations.
|
|
147
|
-
* Defines the structure of the response received after initiating a crawl.
|
|
148
|
-
*/
|
|
149
|
-
interface BatchScrapeResponse {
|
|
150
|
-
id?: string;
|
|
151
|
-
url?: string;
|
|
152
|
-
success: true;
|
|
153
|
-
error?: string;
|
|
154
|
-
}
|
|
155
145
|
/**
|
|
156
146
|
* Response interface for job status checks.
|
|
157
147
|
* Provides detailed status of a crawl job including progress and results.
|
|
@@ -273,8 +263,8 @@ declare class FirecrawlApp {
|
|
|
273
263
|
* @param idempotencyKey - Optional idempotency key for the request.
|
|
274
264
|
* @returns The response from the crawl operation.
|
|
275
265
|
*/
|
|
276
|
-
batchScrapeUrls(urls: string[], params?: ScrapeParams, pollInterval?: number, idempotencyKey?: string): Promise<
|
|
277
|
-
asyncBatchScrapeUrls(urls: string[], params?: ScrapeParams, idempotencyKey?: string): Promise<
|
|
266
|
+
batchScrapeUrls(urls: string[], params?: ScrapeParams, pollInterval?: number, idempotencyKey?: string): Promise<CrawlStatusResponse | ErrorResponse>;
|
|
267
|
+
asyncBatchScrapeUrls(urls: string[], params?: ScrapeParams, idempotencyKey?: string): Promise<CrawlResponse | ErrorResponse>;
|
|
278
268
|
/**
|
|
279
269
|
* Initiates a batch scrape job and returns a CrawlWatcher to monitor the job via WebSocket.
|
|
280
270
|
* @param urls - The URL to scrape.
|
|
@@ -354,4 +344,4 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
|
|
|
354
344
|
close(): void;
|
|
355
345
|
}
|
|
356
346
|
|
|
357
|
-
export { type Action, type ActionsResult, type
|
|
347
|
+
export { type Action, type ActionsResult, type CrawlParams, type CrawlResponse, type CrawlScrapeOptions, type CrawlStatusResponse, CrawlWatcher, type ErrorResponse, type FirecrawlAppConfig, type FirecrawlDocument, type FirecrawlDocumentMetadata, FirecrawlError, type MapParams, type MapResponse, type ScrapeParams, type ScrapeResponse, FirecrawlApp as default };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -154,17 +154,6 @@ export interface CrawlResponse {
|
|
|
154
154
|
error?: string;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
/**
|
|
158
|
-
* Response interface for crawling operations.
|
|
159
|
-
* Defines the structure of the response received after initiating a crawl.
|
|
160
|
-
*/
|
|
161
|
-
export interface BatchScrapeResponse {
|
|
162
|
-
id?: string;
|
|
163
|
-
url?: string;
|
|
164
|
-
success: true;
|
|
165
|
-
error?: string;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
157
|
/**
|
|
169
158
|
* Response interface for job status checks.
|
|
170
159
|
* Provides detailed status of a crawl job including progress and results.
|
|
@@ -517,7 +506,7 @@ export default class FirecrawlApp {
|
|
|
517
506
|
params?: ScrapeParams,
|
|
518
507
|
pollInterval: number = 2,
|
|
519
508
|
idempotencyKey?: string
|
|
520
|
-
): Promise<
|
|
509
|
+
): Promise<CrawlStatusResponse | ErrorResponse> {
|
|
521
510
|
const headers = this.prepareHeaders(idempotencyKey);
|
|
522
511
|
let jsonData: any = { urls, ...(params ?? {}) };
|
|
523
512
|
try {
|
|
@@ -546,7 +535,7 @@ export default class FirecrawlApp {
|
|
|
546
535
|
urls: string[],
|
|
547
536
|
params?: ScrapeParams,
|
|
548
537
|
idempotencyKey?: string
|
|
549
|
-
): Promise<
|
|
538
|
+
): Promise<CrawlResponse | ErrorResponse> {
|
|
550
539
|
const headers = this.prepareHeaders(idempotencyKey);
|
|
551
540
|
let jsonData: any = { urls, ...(params ?? {}) };
|
|
552
541
|
try {
|