firecrawl 1.15.7 → 1.17.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.cjs +4 -2
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/src/index.ts +10 -2
package/dist/index.cjs
CHANGED
|
@@ -647,7 +647,8 @@ var FirecrawlApp = class {
|
|
|
647
647
|
success: true,
|
|
648
648
|
data: extractStatus.data,
|
|
649
649
|
warning: extractStatus.warning,
|
|
650
|
-
error: extractStatus.error
|
|
650
|
+
error: extractStatus.error,
|
|
651
|
+
sources: extractStatus?.sources || void 0
|
|
651
652
|
};
|
|
652
653
|
} else {
|
|
653
654
|
throw new FirecrawlError(`Failed to extract data. Error: ${extractStatus.error}`, statusResponse.status);
|
|
@@ -859,7 +860,8 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
|
|
|
859
860
|
constructor(id, app) {
|
|
860
861
|
super();
|
|
861
862
|
this.id = id;
|
|
862
|
-
|
|
863
|
+
const wsUrl = app.apiUrl.replace(/^http/, "ws");
|
|
864
|
+
this.ws = new import_isows.WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
|
|
863
865
|
this.status = "scraping";
|
|
864
866
|
this.data = [];
|
|
865
867
|
const messageHandler = (msg) => {
|
package/dist/index.d.cts
CHANGED
|
@@ -87,6 +87,7 @@ interface CrawlScrapeOptions {
|
|
|
87
87
|
mobile?: boolean;
|
|
88
88
|
skipTlsVerification?: boolean;
|
|
89
89
|
removeBase64Images?: boolean;
|
|
90
|
+
blockAds?: boolean;
|
|
90
91
|
}
|
|
91
92
|
type Action = {
|
|
92
93
|
type: "wait";
|
|
@@ -156,6 +157,7 @@ interface CrawlParams {
|
|
|
156
157
|
url: string;
|
|
157
158
|
headers?: Record<string, string>;
|
|
158
159
|
metadata?: Record<string, string>;
|
|
160
|
+
events?: ["completed", "failed", "page", "started"][number][];
|
|
159
161
|
};
|
|
160
162
|
deduplicateSimilarURLs?: boolean;
|
|
161
163
|
ignoreQueryParameters?: boolean;
|
|
@@ -219,6 +221,7 @@ interface MapParams {
|
|
|
219
221
|
includeSubdomains?: boolean;
|
|
220
222
|
sitemapOnly?: boolean;
|
|
221
223
|
limit?: number;
|
|
224
|
+
timeout?: number;
|
|
222
225
|
}
|
|
223
226
|
/**
|
|
224
227
|
* Response interface for mapping operations.
|
|
@@ -241,6 +244,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
|
|
|
241
244
|
enableWebSearch?: boolean;
|
|
242
245
|
includeSubdomains?: boolean;
|
|
243
246
|
origin?: string;
|
|
247
|
+
showSources?: boolean;
|
|
244
248
|
}
|
|
245
249
|
/**
|
|
246
250
|
* Response interface for extracting information from URLs.
|
|
@@ -251,6 +255,7 @@ interface ExtractResponse<LLMSchema extends zt.ZodSchema = any> {
|
|
|
251
255
|
data: LLMSchema;
|
|
252
256
|
error?: string;
|
|
253
257
|
warning?: string;
|
|
258
|
+
sources?: string[];
|
|
254
259
|
}
|
|
255
260
|
/**
|
|
256
261
|
* Error response interface.
|
package/dist/index.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ interface CrawlScrapeOptions {
|
|
|
87
87
|
mobile?: boolean;
|
|
88
88
|
skipTlsVerification?: boolean;
|
|
89
89
|
removeBase64Images?: boolean;
|
|
90
|
+
blockAds?: boolean;
|
|
90
91
|
}
|
|
91
92
|
type Action = {
|
|
92
93
|
type: "wait";
|
|
@@ -156,6 +157,7 @@ interface CrawlParams {
|
|
|
156
157
|
url: string;
|
|
157
158
|
headers?: Record<string, string>;
|
|
158
159
|
metadata?: Record<string, string>;
|
|
160
|
+
events?: ["completed", "failed", "page", "started"][number][];
|
|
159
161
|
};
|
|
160
162
|
deduplicateSimilarURLs?: boolean;
|
|
161
163
|
ignoreQueryParameters?: boolean;
|
|
@@ -219,6 +221,7 @@ interface MapParams {
|
|
|
219
221
|
includeSubdomains?: boolean;
|
|
220
222
|
sitemapOnly?: boolean;
|
|
221
223
|
limit?: number;
|
|
224
|
+
timeout?: number;
|
|
222
225
|
}
|
|
223
226
|
/**
|
|
224
227
|
* Response interface for mapping operations.
|
|
@@ -241,6 +244,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
|
|
|
241
244
|
enableWebSearch?: boolean;
|
|
242
245
|
includeSubdomains?: boolean;
|
|
243
246
|
origin?: string;
|
|
247
|
+
showSources?: boolean;
|
|
244
248
|
}
|
|
245
249
|
/**
|
|
246
250
|
* Response interface for extracting information from URLs.
|
|
@@ -251,6 +255,7 @@ interface ExtractResponse<LLMSchema extends zt.ZodSchema = any> {
|
|
|
251
255
|
data: LLMSchema;
|
|
252
256
|
error?: string;
|
|
253
257
|
warning?: string;
|
|
258
|
+
sources?: string[];
|
|
254
259
|
}
|
|
255
260
|
/**
|
|
256
261
|
* Error response interface.
|
package/dist/index.js
CHANGED
|
@@ -611,7 +611,8 @@ var FirecrawlApp = class {
|
|
|
611
611
|
success: true,
|
|
612
612
|
data: extractStatus.data,
|
|
613
613
|
warning: extractStatus.warning,
|
|
614
|
-
error: extractStatus.error
|
|
614
|
+
error: extractStatus.error,
|
|
615
|
+
sources: extractStatus?.sources || void 0
|
|
615
616
|
};
|
|
616
617
|
} else {
|
|
617
618
|
throw new FirecrawlError(`Failed to extract data. Error: ${extractStatus.error}`, statusResponse.status);
|
|
@@ -823,7 +824,8 @@ var CrawlWatcher = class extends TypedEventTarget {
|
|
|
823
824
|
constructor(id, app) {
|
|
824
825
|
super();
|
|
825
826
|
this.id = id;
|
|
826
|
-
|
|
827
|
+
const wsUrl = app.apiUrl.replace(/^http/, "ws");
|
|
828
|
+
this.ws = new WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
|
|
827
829
|
this.status = "scraping";
|
|
828
830
|
this.data = [];
|
|
829
831
|
const messageHandler = (msg) => {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -93,6 +93,7 @@ export interface CrawlScrapeOptions {
|
|
|
93
93
|
mobile?: boolean;
|
|
94
94
|
skipTlsVerification?: boolean;
|
|
95
95
|
removeBase64Images?: boolean;
|
|
96
|
+
blockAds?: boolean;
|
|
96
97
|
}
|
|
97
98
|
|
|
98
99
|
export type Action = {
|
|
@@ -167,6 +168,7 @@ export interface CrawlParams {
|
|
|
167
168
|
url: string;
|
|
168
169
|
headers?: Record<string, string>;
|
|
169
170
|
metadata?: Record<string, string>;
|
|
171
|
+
events?: ["completed", "failed", "page", "started"][number][];
|
|
170
172
|
};
|
|
171
173
|
deduplicateSimilarURLs?: boolean;
|
|
172
174
|
ignoreQueryParameters?: boolean;
|
|
@@ -235,6 +237,7 @@ export interface MapParams {
|
|
|
235
237
|
includeSubdomains?: boolean;
|
|
236
238
|
sitemapOnly?: boolean;
|
|
237
239
|
limit?: number;
|
|
240
|
+
timeout?: number;
|
|
238
241
|
}
|
|
239
242
|
|
|
240
243
|
/**
|
|
@@ -259,6 +262,7 @@ export interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
|
|
|
259
262
|
enableWebSearch?: boolean;
|
|
260
263
|
includeSubdomains?: boolean;
|
|
261
264
|
origin?: string;
|
|
265
|
+
showSources?: boolean;
|
|
262
266
|
}
|
|
263
267
|
|
|
264
268
|
/**
|
|
@@ -270,6 +274,7 @@ export interface ExtractResponse<LLMSchema extends zt.ZodSchema = any> {
|
|
|
270
274
|
data: LLMSchema;
|
|
271
275
|
error?: string;
|
|
272
276
|
warning?: string;
|
|
277
|
+
sources?: string[];
|
|
273
278
|
}
|
|
274
279
|
|
|
275
280
|
/**
|
|
@@ -1038,7 +1043,8 @@ export default class FirecrawlApp {
|
|
|
1038
1043
|
success: true,
|
|
1039
1044
|
data: extractStatus.data,
|
|
1040
1045
|
warning: extractStatus.warning,
|
|
1041
|
-
error: extractStatus.error
|
|
1046
|
+
error: extractStatus.error,
|
|
1047
|
+
sources: extractStatus?.sources || undefined,
|
|
1042
1048
|
};
|
|
1043
1049
|
} else {
|
|
1044
1050
|
throw new FirecrawlError(`Failed to extract data. Error: ${extractStatus.error}`, statusResponse.status);
|
|
@@ -1298,7 +1304,9 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
|
|
|
1298
1304
|
constructor(id: string, app: FirecrawlApp) {
|
|
1299
1305
|
super();
|
|
1300
1306
|
this.id = id;
|
|
1301
|
-
|
|
1307
|
+
// replace `http` with `ws` (`http://` -> `ws://` and `https://` -> `wss://`)
|
|
1308
|
+
const wsUrl = app.apiUrl.replace(/^http/, "ws");
|
|
1309
|
+
this.ws = new WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
|
|
1302
1310
|
this.status = "scraping";
|
|
1303
1311
|
this.data = [];
|
|
1304
1312
|
|