firecrawl 1.15.7 → 1.16.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 CHANGED
@@ -859,7 +859,8 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
859
859
  constructor(id, app) {
860
860
  super();
861
861
  this.id = id;
862
- this.ws = new import_isows.WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
862
+ const wsUrl = app.apiUrl.replace(/^http/, "ws");
863
+ this.ws = new import_isows.WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
863
864
  this.status = "scraping";
864
865
  this.data = [];
865
866
  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.
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.
package/dist/index.js CHANGED
@@ -823,7 +823,8 @@ var CrawlWatcher = class extends TypedEventTarget {
823
823
  constructor(id, app) {
824
824
  super();
825
825
  this.id = id;
826
- this.ws = new WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
826
+ const wsUrl = app.apiUrl.replace(/^http/, "ws");
827
+ this.ws = new WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
827
828
  this.status = "scraping";
828
829
  this.data = [];
829
830
  const messageHandler = (msg) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "1.15.7",
3
+ "version": "1.16.0",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
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
  /**
@@ -1298,7 +1301,9 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
1298
1301
  constructor(id: string, app: FirecrawlApp) {
1299
1302
  super();
1300
1303
  this.id = id;
1301
- this.ws = new WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
1304
+ // replace `http` with `ws` (`http://` -> `ws://` and `https://` -> `wss://`)
1305
+ const wsUrl = app.apiUrl.replace(/^http/, "ws");
1306
+ this.ws = new WebSocket(`${wsUrl}/v1/crawl/${id}`, app.apiKey);
1302
1307
  this.status = "scraping";
1303
1308
  this.data = [];
1304
1309