@mendable/firecrawl-js 0.0.17 → 0.0.18

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/build/index.js CHANGED
@@ -38,7 +38,10 @@ export default class FirecrawlApp {
38
38
  };
39
39
  let jsonData = Object.assign({ url }, params);
40
40
  if ((_a = params === null || params === void 0 ? void 0 : params.extractorOptions) === null || _a === void 0 ? void 0 : _a.extractionSchema) {
41
- const schema = zodToJsonSchema(params.extractorOptions.extractionSchema);
41
+ let schema = params.extractorOptions.extractionSchema;
42
+ if (typeof schema !== 'object') {
43
+ schema = zodToJsonSchema(schema);
44
+ }
42
45
  jsonData = Object.assign(Object.assign({}, jsonData), { extractorOptions: Object.assign(Object.assign({}, params.extractorOptions), { extractionSchema: schema, mode: params.extractorOptions.mode || "llm-extraction" }) });
43
46
  }
44
47
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "build/index.js",
6
6
  "types": "types/index.d.ts",
package/src/index.ts CHANGED
@@ -91,9 +91,10 @@ export default class FirecrawlApp {
91
91
  } as AxiosRequestHeaders;
92
92
  let jsonData: Params = { url, ...params };
93
93
  if (params?.extractorOptions?.extractionSchema) {
94
- const schema = zodToJsonSchema(
95
- params.extractorOptions.extractionSchema as z.ZodSchema
96
- );
94
+ let schema = params.extractorOptions.extractionSchema;
95
+ if (typeof schema !== 'object') {
96
+ schema = zodToJsonSchema(schema as z.ZodSchema);
97
+ }
97
98
  jsonData = {
98
99
  ...jsonData,
99
100
  extractorOptions: {