firecrawl 1.25.6 → 1.27.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
@@ -35,7 +35,7 @@ var require_package = __commonJS({
35
35
  "package.json"(exports2, module2) {
36
36
  module2.exports = {
37
37
  name: "@mendable/firecrawl-js",
38
- version: "1.25.6",
38
+ version: "1.27.0",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -109,7 +109,7 @@ __export(src_exports, {
109
109
  });
110
110
  module.exports = __toCommonJS(src_exports);
111
111
  var import_axios = __toESM(require("axios"), 1);
112
- var zt = __toESM(require("zod"), 1);
112
+ var zt = require("zod");
113
113
  var import_zod_to_json_schema = require("zod-to-json-schema");
114
114
 
115
115
  // node_modules/typescript-event-target/dist/index.mjs
@@ -713,10 +713,12 @@ var FirecrawlApp = class {
713
713
  try {
714
714
  if (!params?.schema) {
715
715
  jsonSchema = void 0;
716
- } else if (typeof params.schema === "object" && params.schema !== null && Object.getPrototypeOf(params.schema)?.constructor?.name?.startsWith("Zod")) {
717
- jsonSchema = (0, import_zod_to_json_schema.zodToJsonSchema)(params.schema);
718
716
  } else {
719
- jsonSchema = params.schema;
717
+ try {
718
+ jsonSchema = (0, import_zod_to_json_schema.zodToJsonSchema)(params.schema);
719
+ } catch (_) {
720
+ jsonSchema = params.schema;
721
+ }
720
722
  }
721
723
  } catch (error) {
722
724
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
@@ -773,10 +775,14 @@ var FirecrawlApp = class {
773
775
  let jsonData = { urls, ...params };
774
776
  let jsonSchema;
775
777
  try {
776
- if (params?.schema instanceof zt.ZodType) {
777
- jsonSchema = (0, import_zod_to_json_schema.zodToJsonSchema)(params.schema);
778
+ if (!params?.schema) {
779
+ jsonSchema = void 0;
778
780
  } else {
779
- jsonSchema = params?.schema;
781
+ try {
782
+ jsonSchema = (0, import_zod_to_json_schema.zodToJsonSchema)(params.schema);
783
+ } catch (_) {
784
+ jsonSchema = params.schema;
785
+ }
780
786
  }
781
787
  } catch (error) {
782
788
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
package/dist/index.d.cts CHANGED
@@ -199,6 +199,7 @@ interface CrawlParams {
199
199
  maxDiscoveryDepth?: number;
200
200
  limit?: number;
201
201
  allowBackwardLinks?: boolean;
202
+ crawlEntireDomain?: boolean;
202
203
  allowExternalLinks?: boolean;
203
204
  ignoreSitemap?: boolean;
204
205
  scrapeOptions?: CrawlScrapeOptions;
package/dist/index.d.ts CHANGED
@@ -199,6 +199,7 @@ interface CrawlParams {
199
199
  maxDiscoveryDepth?: number;
200
200
  limit?: number;
201
201
  allowBackwardLinks?: boolean;
202
+ crawlEntireDomain?: boolean;
202
203
  allowExternalLinks?: boolean;
203
204
  ignoreSitemap?: boolean;
204
205
  scrapeOptions?: CrawlScrapeOptions;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // src/index.ts
2
2
  import axios, { AxiosError } from "axios";
3
- import * as zt from "zod";
3
+ import "zod";
4
4
  import { zodToJsonSchema } from "zod-to-json-schema";
5
5
 
6
6
  // node_modules/typescript-event-target/dist/index.mjs
@@ -29,7 +29,7 @@ var FirecrawlApp = class {
29
29
  }
30
30
  async getVersion() {
31
31
  try {
32
- const packageJson = await import("./package-AP4AUZKP.js");
32
+ const packageJson = await import("./package-STCQBHTG.js");
33
33
  return packageJson.default.version;
34
34
  } catch (error) {
35
35
  console.error("Error getting version:", error);
@@ -604,10 +604,12 @@ var FirecrawlApp = class {
604
604
  try {
605
605
  if (!params?.schema) {
606
606
  jsonSchema = void 0;
607
- } else if (typeof params.schema === "object" && params.schema !== null && Object.getPrototypeOf(params.schema)?.constructor?.name?.startsWith("Zod")) {
608
- jsonSchema = zodToJsonSchema(params.schema);
609
607
  } else {
610
- jsonSchema = params.schema;
608
+ try {
609
+ jsonSchema = zodToJsonSchema(params.schema);
610
+ } catch (_) {
611
+ jsonSchema = params.schema;
612
+ }
611
613
  }
612
614
  } catch (error) {
613
615
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
@@ -664,10 +666,14 @@ var FirecrawlApp = class {
664
666
  let jsonData = { urls, ...params };
665
667
  let jsonSchema;
666
668
  try {
667
- if (params?.schema instanceof zt.ZodType) {
668
- jsonSchema = zodToJsonSchema(params.schema);
669
+ if (!params?.schema) {
670
+ jsonSchema = void 0;
669
671
  } else {
670
- jsonSchema = params?.schema;
672
+ try {
673
+ jsonSchema = zodToJsonSchema(params.schema);
674
+ } catch (_) {
675
+ jsonSchema = params.schema;
676
+ }
671
677
  }
672
678
  } catch (error) {
673
679
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@mendable/firecrawl-js";
3
- var version = "1.25.6";
3
+ var version = "1.27.0";
4
4
  var description = "JavaScript SDK for Firecrawl API";
5
5
  var main = "dist/index.js";
6
6
  var types = "dist/index.d.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "1.25.6",
3
+ "version": "1.27.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
@@ -209,6 +209,7 @@ export interface CrawlParams {
209
209
  maxDiscoveryDepth?: number;
210
210
  limit?: number;
211
211
  allowBackwardLinks?: boolean;
212
+ crawlEntireDomain?: boolean;
212
213
  allowExternalLinks?: boolean;
213
214
  ignoreSitemap?: boolean;
214
215
  scrapeOptions?: CrawlScrapeOptions;
@@ -1243,10 +1244,12 @@ export default class FirecrawlApp {
1243
1244
  try {
1244
1245
  if (!params?.schema) {
1245
1246
  jsonSchema = undefined;
1246
- } else if (typeof params.schema === "object" && params.schema !== null && Object.getPrototypeOf(params.schema)?.constructor?.name?.startsWith("Zod")) {
1247
- jsonSchema = zodToJsonSchema(params.schema as zt.ZodType);
1248
1247
  } else {
1249
- jsonSchema = params.schema;
1248
+ try {
1249
+ jsonSchema = zodToJsonSchema(params.schema as zt.ZodType);
1250
+ } catch (_) {
1251
+ jsonSchema = params.schema;
1252
+ }
1250
1253
  }
1251
1254
  } catch (error: any) {
1252
1255
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
@@ -1311,10 +1314,14 @@ export default class FirecrawlApp {
1311
1314
  let jsonSchema: any;
1312
1315
 
1313
1316
  try {
1314
- if (params?.schema instanceof zt.ZodType) {
1315
- jsonSchema = zodToJsonSchema(params.schema);
1317
+ if (!params?.schema) {
1318
+ jsonSchema = undefined;
1316
1319
  } else {
1317
- jsonSchema = params?.schema;
1320
+ try {
1321
+ jsonSchema = zodToJsonSchema(params.schema as zt.ZodType);
1322
+ } catch (_) {
1323
+ jsonSchema = params.schema;
1324
+ }
1318
1325
  }
1319
1326
  } catch (error: any) {
1320
1327
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);