firecrawl 4.3.0 → 4.3.1

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.
@@ -8,7 +8,7 @@ var require_package = __commonJS({
8
8
  "package.json"(exports, module) {
9
9
  module.exports = {
10
10
  name: "@mendable/firecrawl-js",
11
- version: "4.3.0",
11
+ version: "4.3.1",
12
12
  description: "JavaScript SDK for Firecrawl API",
13
13
  main: "dist/index.js",
14
14
  types: "dist/index.d.ts",
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: "4.3.0",
38
+ version: "4.3.1",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -227,7 +227,7 @@ var SdkError = class extends Error {
227
227
  };
228
228
 
229
229
  // src/v2/utils/validation.ts
230
- var import_zod_to_json_schema = __toESM(require("zod-to-json-schema"), 1);
230
+ var import_zod_to_json_schema = require("zod-to-json-schema");
231
231
  function ensureValidFormats(formats) {
232
232
  if (!formats) return;
233
233
  for (const fmt of formats) {
@@ -246,7 +246,19 @@ function ensureValidFormats(formats) {
246
246
  const isZod = !!maybeSchema && (typeof maybeSchema.safeParse === "function" || typeof maybeSchema.parse === "function") && !!maybeSchema._def;
247
247
  if (isZod) {
248
248
  try {
249
- j.schema = (0, import_zod_to_json_schema.default)(maybeSchema);
249
+ j.schema = (0, import_zod_to_json_schema.zodToJsonSchema)(maybeSchema);
250
+ } catch {
251
+ }
252
+ }
253
+ continue;
254
+ }
255
+ if (fmt.type === "changeTracking") {
256
+ const ct = fmt;
257
+ const maybeSchema = ct.schema;
258
+ const isZod = !!maybeSchema && (typeof maybeSchema.safeParse === "function" || typeof maybeSchema.parse === "function") && !!maybeSchema._def;
259
+ if (isZod) {
260
+ try {
261
+ ct.schema = (0, import_zod_to_json_schema.zodToJsonSchema)(maybeSchema);
250
262
  } catch {
251
263
  }
252
264
  }
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-KCQFB5LN.js";
3
+ } from "./chunk-VFP5PS5Z.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -111,7 +111,7 @@ var SdkError = class extends Error {
111
111
  };
112
112
 
113
113
  // src/v2/utils/validation.ts
114
- import zodToJsonSchema from "zod-to-json-schema";
114
+ import { zodToJsonSchema } from "zod-to-json-schema";
115
115
  function ensureValidFormats(formats) {
116
116
  if (!formats) return;
117
117
  for (const fmt of formats) {
@@ -136,6 +136,18 @@ function ensureValidFormats(formats) {
136
136
  }
137
137
  continue;
138
138
  }
139
+ if (fmt.type === "changeTracking") {
140
+ const ct = fmt;
141
+ const maybeSchema = ct.schema;
142
+ const isZod = !!maybeSchema && (typeof maybeSchema.safeParse === "function" || typeof maybeSchema.parse === "function") && !!maybeSchema._def;
143
+ if (isZod) {
144
+ try {
145
+ ct.schema = zodToJsonSchema(maybeSchema);
146
+ } catch {
147
+ }
148
+ }
149
+ continue;
150
+ }
139
151
  if (fmt.type === "screenshot") {
140
152
  const s = fmt;
141
153
  if (s.quality != null && (typeof s.quality !== "number" || s.quality < 0)) {
@@ -1047,7 +1059,7 @@ var FirecrawlApp = class {
1047
1059
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
1048
1060
  return process.env.npm_package_version;
1049
1061
  }
1050
- const packageJson = await import("./package-QFGMHRQZ.js");
1062
+ const packageJson = await import("./package-ZQ5CJHCA.js");
1051
1063
  return packageJson.default.version;
1052
1064
  } catch (error) {
1053
1065
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-KCQFB5LN.js";
3
+ } from "./chunk-VFP5PS5Z.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,5 @@
1
- import { type FormatOption, type JsonFormat, type ScrapeOptions, type ScreenshotFormat } from "../types";
2
- import zodToJsonSchema from "zod-to-json-schema";
1
+ import { type FormatOption, type JsonFormat, type ScrapeOptions, type ScreenshotFormat, type ChangeTrackingFormat } from "../types";
2
+ import { zodToJsonSchema } from "zod-to-json-schema";
3
3
 
4
4
  export function ensureValidFormats(formats?: FormatOption[]): void {
5
5
  if (!formats) return;
@@ -27,6 +27,19 @@ export function ensureValidFormats(formats?: FormatOption[]): void {
27
27
  }
28
28
  continue;
29
29
  }
30
+ if ((fmt as ChangeTrackingFormat).type === "changeTracking") {
31
+ const ct = fmt as ChangeTrackingFormat;
32
+ const maybeSchema: any = ct.schema as any;
33
+ const isZod = !!maybeSchema && (typeof maybeSchema.safeParse === "function" || typeof maybeSchema.parse === "function") && !!maybeSchema._def;
34
+ if (isZod) {
35
+ try {
36
+ (ct as any).schema = zodToJsonSchema(maybeSchema);
37
+ } catch {
38
+ // Best-effort conversion; if it fails, leave original value
39
+ }
40
+ }
41
+ continue;
42
+ }
30
43
  if ((fmt as ScreenshotFormat).type === "screenshot") {
31
44
  // no-op; already camelCase; validate numeric fields if present
32
45
  const s = fmt as ScreenshotFormat;