@mendable/firecrawl-js 1.15.3 → 1.15.5

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
@@ -629,7 +629,7 @@ var FirecrawlApp = class {
629
629
  try {
630
630
  const response = await this.postRequest(
631
631
  this.apiUrl + `/v1/extract`,
632
- { ...jsonData, schema: jsonSchema, origin: "api-sdk" },
632
+ { ...jsonData, schema: jsonSchema, origin: params?.origin || "api-sdk" },
633
633
  headers
634
634
  );
635
635
  if (response.status === 200) {
@@ -841,7 +841,7 @@ var FirecrawlApp = class {
841
841
  throw new FirecrawlError(
842
842
  `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
843
843
  response.status,
844
- response.data.details
844
+ response?.data?.details
845
845
  );
846
846
  } else {
847
847
  throw new FirecrawlError(
package/dist/index.d.cts CHANGED
@@ -239,6 +239,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
239
239
  systemPrompt?: string;
240
240
  allowExternalLinks?: boolean;
241
241
  includeSubdomains?: boolean;
242
+ origin?: string;
242
243
  }
243
244
  /**
244
245
  * Response interface for extracting information from URLs.
package/dist/index.d.ts CHANGED
@@ -239,6 +239,7 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
239
239
  systemPrompt?: string;
240
240
  allowExternalLinks?: boolean;
241
241
  includeSubdomains?: boolean;
242
+ origin?: string;
242
243
  }
243
244
  /**
244
245
  * Response interface for extracting information from URLs.
package/dist/index.js CHANGED
@@ -593,7 +593,7 @@ var FirecrawlApp = class {
593
593
  try {
594
594
  const response = await this.postRequest(
595
595
  this.apiUrl + `/v1/extract`,
596
- { ...jsonData, schema: jsonSchema, origin: "api-sdk" },
596
+ { ...jsonData, schema: jsonSchema, origin: params?.origin || "api-sdk" },
597
597
  headers
598
598
  );
599
599
  if (response.status === 200) {
@@ -805,7 +805,7 @@ var FirecrawlApp = class {
805
805
  throw new FirecrawlError(
806
806
  `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
807
807
  response.status,
808
- response.data.details
808
+ response?.data?.details
809
809
  );
810
810
  } else {
811
811
  throw new FirecrawlError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "1.15.3",
3
+ "version": "1.15.5",
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
@@ -257,6 +257,7 @@ export interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
257
257
  systemPrompt?: string;
258
258
  allowExternalLinks?: boolean;
259
259
  includeSubdomains?: boolean;
260
+ origin?: string;
260
261
  }
261
262
 
262
263
  /**
@@ -1016,7 +1017,7 @@ export default class FirecrawlApp {
1016
1017
  try {
1017
1018
  const response: AxiosResponse = await this.postRequest(
1018
1019
  this.apiUrl + `/v1/extract`,
1019
- { ...jsonData, schema: jsonSchema, origin: "api-sdk" },
1020
+ { ...jsonData, schema: jsonSchema, origin: params?.origin || "api-sdk" },
1020
1021
  headers
1021
1022
  );
1022
1023
 
@@ -1262,7 +1263,7 @@ export default class FirecrawlApp {
1262
1263
  throw new FirecrawlError(
1263
1264
  `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
1264
1265
  response.status,
1265
- response.data.details
1266
+ response?.data?.details
1266
1267
  );
1267
1268
  } else {
1268
1269
  throw new FirecrawlError(