firecrawl 1.9.5 → 1.9.7

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
@@ -226,7 +226,7 @@ interface MapResponse {
226
226
  * Defines options for extracting information from URLs.
227
227
  */
228
228
  interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
229
- prompt: string;
229
+ prompt?: string;
230
230
  schema?: LLMSchema;
231
231
  systemPrompt?: string;
232
232
  allowExternalLinks?: boolean;
@@ -416,6 +416,7 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
416
416
  private ws;
417
417
  data: FirecrawlDocument<undefined>[];
418
418
  status: CrawlStatusResponse["status"];
419
+ id: string;
419
420
  constructor(id: string, app: FirecrawlApp);
420
421
  close(): void;
421
422
  }
package/dist/index.d.ts CHANGED
@@ -226,7 +226,7 @@ interface MapResponse {
226
226
  * Defines options for extracting information from URLs.
227
227
  */
228
228
  interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
229
- prompt: string;
229
+ prompt?: string;
230
230
  schema?: LLMSchema;
231
231
  systemPrompt?: string;
232
232
  allowExternalLinks?: boolean;
@@ -416,6 +416,7 @@ declare class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
416
416
  private ws;
417
417
  data: FirecrawlDocument<undefined>[];
418
418
  status: CrawlStatusResponse["status"];
419
+ id: string;
419
420
  constructor(id: string, app: FirecrawlApp);
420
421
  close(): void;
421
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.5",
3
+ "version": "1.9.7",
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
@@ -243,7 +243,7 @@ export interface MapResponse {
243
243
  * Defines options for extracting information from URLs.
244
244
  */
245
245
  export interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
246
- prompt: string;
246
+ prompt?: string;
247
247
  schema?: LLMSchema;
248
248
  systemPrompt?: string;
249
249
  allowExternalLinks?: boolean;
@@ -935,9 +935,11 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
935
935
  private ws: WebSocket;
936
936
  public data: FirecrawlDocument<undefined>[];
937
937
  public status: CrawlStatusResponse["status"];
938
+ public id: string;
938
939
 
939
940
  constructor(id: string, app: FirecrawlApp) {
940
941
  super();
942
+ this.id = id;
941
943
  this.ws = new WebSocket(`${app.apiUrl}/v1/crawl/${id}`, app.apiKey);
942
944
  this.status = "scraping";
943
945
  this.data = [];
@@ -968,6 +970,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
968
970
  detail: {
969
971
  status: this.status,
970
972
  data: this.data,
973
+ id: this.id,
971
974
  },
972
975
  }));
973
976
  } else if (msg.type === "error") {
@@ -977,6 +980,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
977
980
  status: this.status,
978
981
  data: this.data,
979
982
  error: msg.error,
983
+ id: this.id,
980
984
  },
981
985
  }));
982
986
  } else if (msg.type === "catchup") {
@@ -984,12 +988,18 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
984
988
  this.data.push(...(msg.data.data ?? []));
985
989
  for (const doc of this.data) {
986
990
  this.dispatchTypedEvent("document", new CustomEvent("document", {
987
- detail: doc,
991
+ detail: {
992
+ ...doc,
993
+ id: this.id,
994
+ },
988
995
  }));
989
996
  }
990
997
  } else if (msg.type === "document") {
991
998
  this.dispatchTypedEvent("document", new CustomEvent("document", {
992
- detail: msg.data,
999
+ detail: {
1000
+ ...msg.data,
1001
+ id: this.id,
1002
+ },
993
1003
  }));
994
1004
  }
995
1005
  }
@@ -1016,6 +1026,7 @@ export class CrawlWatcher extends TypedEventTarget<CrawlWatcherEvents> {
1016
1026
  status: this.status,
1017
1027
  data: this.data,
1018
1028
  error: "WebSocket error",
1029
+ id: this.id,
1019
1030
  },
1020
1031
  }));
1021
1032
  }).bind(this);