firecrawl 1.9.4 → 1.9.6

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
@@ -589,8 +589,10 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
589
589
  ws;
590
590
  data;
591
591
  status;
592
+ id;
592
593
  constructor(id, app) {
593
594
  super();
595
+ this.id = id;
594
596
  this.ws = new import_isows.WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
595
597
  this.status = "scraping";
596
598
  this.data = [];
@@ -600,7 +602,8 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
600
602
  this.dispatchTypedEvent("done", new CustomEvent("done", {
601
603
  detail: {
602
604
  status: this.status,
603
- data: this.data
605
+ data: this.data,
606
+ id: this.id
604
607
  }
605
608
  }));
606
609
  } else if (msg.type === "error") {
@@ -609,7 +612,8 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
609
612
  detail: {
610
613
  status: this.status,
611
614
  data: this.data,
612
- error: msg.error
615
+ error: msg.error,
616
+ id: this.id
613
617
  }
614
618
  }));
615
619
  } else if (msg.type === "catchup") {
@@ -617,12 +621,18 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
617
621
  this.data.push(...msg.data.data ?? []);
618
622
  for (const doc of this.data) {
619
623
  this.dispatchTypedEvent("document", new CustomEvent("document", {
620
- detail: doc
624
+ detail: {
625
+ ...doc,
626
+ id: this.id
627
+ }
621
628
  }));
622
629
  }
623
630
  } else if (msg.type === "document") {
624
631
  this.dispatchTypedEvent("document", new CustomEvent("document", {
625
- detail: msg.data
632
+ detail: {
633
+ ...msg.data,
634
+ id: this.id
635
+ }
626
636
  }));
627
637
  }
628
638
  };
@@ -644,7 +654,8 @@ var CrawlWatcher = class extends import_typescript_event_target.TypedEventTarget
644
654
  detail: {
645
655
  status: this.status,
646
656
  data: this.data,
647
- error: "WebSocket error"
657
+ error: "WebSocket error",
658
+ id: this.id
648
659
  }
649
660
  }));
650
661
  }).bind(this);
package/dist/index.d.cts CHANGED
@@ -230,6 +230,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
230
230
  schema?: LLMSchema;
231
231
  systemPrompt?: string;
232
232
  allowExternalLinks?: boolean;
233
+ includeSubdomains?: boolean;
233
234
  }
234
235
  /**
235
236
  * Response interface for extracting information from URLs.
@@ -415,6 +416,7 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
415
416
  private ws;
416
417
  data: FirecrawlDocument<undefined>[];
417
418
  status: CrawlStatusResponse["status"];
419
+ id: string;
418
420
  constructor(id: string, app: FirecrawlApp);
419
421
  close(): void;
420
422
  }
package/dist/index.d.ts CHANGED
@@ -230,6 +230,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
230
230
  schema?: LLMSchema;
231
231
  systemPrompt?: string;
232
232
  allowExternalLinks?: boolean;
233
+ includeSubdomains?: boolean;
233
234
  }
234
235
  /**
235
236
  * Response interface for extracting information from URLs.
@@ -415,6 +416,7 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
415
416
  private ws;
416
417
  data: FirecrawlDocument<undefined>[];
417
418
  status: CrawlStatusResponse["status"];
419
+ id: string;
418
420
  constructor(id: string, app: FirecrawlApp);
419
421
  close(): void;
420
422
  }
package/dist/index.js CHANGED
@@ -553,8 +553,10 @@ var CrawlWatcher = class extends TypedEventTarget {
553
553
  ws;
554
554
  data;
555
555
  status;
556
+ id;
556
557
  constructor(id, app) {
557
558
  super();
559
+ this.id = id;
558
560
  this.ws = new WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
559
561
  this.status = "scraping";
560
562
  this.data = [];
@@ -564,7 +566,8 @@ var CrawlWatcher = class extends TypedEventTarget {
564
566
  this.dispatchTypedEvent("done", new CustomEvent("done", {
565
567
  detail: {
566
568
  status: this.status,
567
- data: this.data
569
+ data: this.data,
570
+ id: this.id
568
571
  }
569
572
  }));
570
573
  } else if (msg.type === "error") {
@@ -573,7 +576,8 @@ var CrawlWatcher = class extends TypedEventTarget {
573
576
  detail: {
574
577
  status: this.status,
575
578
  data: this.data,
576
- error: msg.error
579
+ error: msg.error,
580
+ id: this.id
577
581
  }
578
582
  }));
579
583
  } else if (msg.type === "catchup") {
@@ -581,12 +585,18 @@ var CrawlWatcher = class extends TypedEventTarget {
581
585
  this.data.push(...msg.data.data ?? []);
582
586
  for (const doc of this.data) {
583
587
  this.dispatchTypedEvent("document", new CustomEvent("document", {
584
- detail: doc
588
+ detail: {
589
+ ...doc,
590
+ id: this.id
591
+ }
585
592
  }));
586
593
  }
587
594
  } else if (msg.type === "document") {
588
595
  this.dispatchTypedEvent("document", new CustomEvent("document", {
589
- detail: msg.data
596
+ detail: {
597
+ ...msg.data,
598
+ id: this.id
599
+ }
590
600
  }));
591
601
  }
592
602
  };
@@ -608,7 +618,8 @@ var CrawlWatcher = class extends TypedEventTarget {
608
618
  detail: {
609
619
  status: this.status,
610
620
  data: this.data,
611
- error: "WebSocket error"
621
+ error: "WebSocket error",
622
+ id: this.id
612
623
  }
613
624
  }));
614
625
  }).bind(this);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "1.9.4",
3
+ "version": "1.9.6",
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
@@ -247,6 +247,7 @@ export interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
247
247
  schema?: LLMSchema;
248
248
  systemPrompt?: string;
249
249
  allowExternalLinks?: boolean;
250
+ includeSubdomains?: boolean;
250
251
  }
251
252
 
252
253
  /**
@@ -934,9 +935,11 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
934
935
  private ws: WebSocket;
935
936
  public data: FirecrawlDocument<undefined>[];
936
937
  public status: CrawlStatusResponse["status"];
938
+ public id: string;
937
939
 
938
940
  constructor(id: string, app: FirecrawlApp) {
939
941
  super();
942
+ this.id = id;
940
943
  this.ws = new WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
941
944
  this.status = "scraping";
942
945
  this.data = [];
@@ -967,6 +970,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
967
970
  detail: {
968
971
  status: this.status,
969
972
  data: this.data,
973
+ id: this.id,
970
974
  },
971
975
  }));
972
976
  } else if (msg.type === "error") {
@@ -976,6 +980,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
976
980
  status: this.status,
977
981
  data: this.data,
978
982
  error: msg.error,
983
+ id: this.id,
979
984
  },
980
985
  }));
981
986
  } else if (msg.type === "catchup") {
@@ -983,12 +988,18 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
983
988
  this.data.push(...(msg.data.data ?? []));
984
989
  for (const doc of this.data) {
985
990
  this.dispatchTypedEvent("document", new CustomEvent("document", {
986
- detail: doc,
991
+ detail: {
992
+ ...doc,
993
+ id: this.id,
994
+ },
987
995
  }));
988
996
  }
989
997
  } else if (msg.type === "document") {
990
998
  this.dispatchTypedEvent("document", new CustomEvent("document", {
991
- detail: msg.data,
999
+ detail: {
1000
+ ...msg.data,
1001
+ id: this.id,
1002
+ },
992
1003
  }));
993
1004
  }
994
1005
  }
@@ -1015,6 +1026,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
1015
1026
  status: this.status,
1016
1027
  data: this.data,
1017
1028
  error: "WebSocket error",
1029
+ id: this.id,
1018
1030
  },
1019
1031
  }));
1020
1032
  }).bind(this);