firecrawl 1.15.2 → 1.15.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
@@ -276,7 +276,7 @@ var FirecrawlApp = class {
276
276
  targetURL.searchParams.set("skip", skip.toString());
277
277
  }
278
278
  if (limit !== void 0) {
279
- targetURL.searchParams.set("skip", limit.toString());
279
+ targetURL.searchParams.set("limit", limit.toString());
280
280
  }
281
281
  try {
282
282
  const response = await this.getRequest(
@@ -530,7 +530,7 @@ var FirecrawlApp = class {
530
530
  targetURL.searchParams.set("skip", skip.toString());
531
531
  }
532
532
  if (limit !== void 0) {
533
- targetURL.searchParams.set("skip", limit.toString());
533
+ targetURL.searchParams.set("limit", limit.toString());
534
534
  }
535
535
  try {
536
536
  const response = await this.getRequest(
@@ -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) {
@@ -835,11 +835,13 @@ var FirecrawlApp = class {
835
835
  * @param {string} action - The action being performed when the error occurred.
836
836
  */
837
837
  handleError(response, action) {
838
- if ([402, 408, 409, 500].includes(response.status)) {
838
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
839
839
  const errorMessage = response.data.error || "Unknown error occurred";
840
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : "";
840
841
  throw new FirecrawlError(
841
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
842
- response.status
842
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
843
+ response.status,
844
+ response?.data?.details
843
845
  );
844
846
  } else {
845
847
  throw new FirecrawlError(
package/dist/index.d.cts CHANGED
@@ -238,7 +238,9 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
238
238
  schema?: LLMSchema | object;
239
239
  systemPrompt?: string;
240
240
  allowExternalLinks?: boolean;
241
+ enableWebSearch?: boolean;
241
242
  includeSubdomains?: boolean;
243
+ origin?: string;
242
244
  }
243
245
  /**
244
246
  * Response interface for extracting information from URLs.
package/dist/index.d.ts CHANGED
@@ -238,7 +238,9 @@ interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
238
238
  schema?: LLMSchema | object;
239
239
  systemPrompt?: string;
240
240
  allowExternalLinks?: boolean;
241
+ enableWebSearch?: boolean;
241
242
  includeSubdomains?: boolean;
243
+ origin?: string;
242
244
  }
243
245
  /**
244
246
  * Response interface for extracting information from URLs.
package/dist/index.js CHANGED
@@ -240,7 +240,7 @@ var FirecrawlApp = class {
240
240
  targetURL.searchParams.set("skip", skip.toString());
241
241
  }
242
242
  if (limit !== void 0) {
243
- targetURL.searchParams.set("skip", limit.toString());
243
+ targetURL.searchParams.set("limit", limit.toString());
244
244
  }
245
245
  try {
246
246
  const response = await this.getRequest(
@@ -494,7 +494,7 @@ var FirecrawlApp = class {
494
494
  targetURL.searchParams.set("skip", skip.toString());
495
495
  }
496
496
  if (limit !== void 0) {
497
- targetURL.searchParams.set("skip", limit.toString());
497
+ targetURL.searchParams.set("limit", limit.toString());
498
498
  }
499
499
  try {
500
500
  const response = await this.getRequest(
@@ -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) {
@@ -799,11 +799,13 @@ var FirecrawlApp = class {
799
799
  * @param {string} action - The action being performed when the error occurred.
800
800
  */
801
801
  handleError(response, action) {
802
- if ([402, 408, 409, 500].includes(response.status)) {
802
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
803
803
  const errorMessage = response.data.error || "Unknown error occurred";
804
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : "";
804
805
  throw new FirecrawlError(
805
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
806
- response.status
806
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
807
+ response.status,
808
+ response?.data?.details
807
809
  );
808
810
  } else {
809
811
  throw new FirecrawlError(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "1.15.2",
3
+ "version": "1.15.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
@@ -256,7 +256,9 @@ export interface ExtractParams<LLMSchema extends zt.ZodSchema = any> {
256
256
  schema?: LLMSchema | object;
257
257
  systemPrompt?: string;
258
258
  allowExternalLinks?: boolean;
259
+ enableWebSearch?: boolean;
259
260
  includeSubdomains?: boolean;
261
+ origin?: string;
260
262
  }
261
263
 
262
264
  /**
@@ -606,7 +608,7 @@ export default class FirecrawlApp {
606
608
  targetURL.searchParams.set("skip", skip.toString());
607
609
  }
608
610
  if (limit !== undefined) {
609
- targetURL.searchParams.set("skip", limit.toString());
611
+ targetURL.searchParams.set("limit", limit.toString());
610
612
  }
611
613
 
612
614
  try {
@@ -908,7 +910,7 @@ export default class FirecrawlApp {
908
910
  targetURL.searchParams.set("skip", skip.toString());
909
911
  }
910
912
  if (limit !== undefined) {
911
- targetURL.searchParams.set("skip", limit.toString());
913
+ targetURL.searchParams.set("limit", limit.toString());
912
914
  }
913
915
 
914
916
  try {
@@ -1013,10 +1015,11 @@ export default class FirecrawlApp {
1013
1015
  throw new FirecrawlError("Invalid schema. Schema must be either a valid Zod schema or JSON schema object.", 400);
1014
1016
  }
1015
1017
 
1018
+
1016
1019
  try {
1017
1020
  const response: AxiosResponse = await this.postRequest(
1018
1021
  this.apiUrl + `/v1/extract`,
1019
- { ...jsonData, schema: jsonSchema, origin: "api-sdk" },
1022
+ { ...jsonData, schema: jsonSchema, origin: params?.origin || "api-sdk" },
1020
1023
  headers
1021
1024
  );
1022
1025
 
@@ -1255,12 +1258,14 @@ export default class FirecrawlApp {
1255
1258
  * @param {string} action - The action being performed when the error occurred.
1256
1259
  */
1257
1260
  handleError(response: AxiosResponse, action: string): void {
1258
- if ([402, 408, 409, 500].includes(response.status)) {
1261
+ if ([400, 402, 408, 409, 500].includes(response.status)) {
1259
1262
  const errorMessage: string =
1260
1263
  response.data.error || "Unknown error occurred";
1264
+ const details = response.data.details ? ` - ${JSON.stringify(response.data.details)}` : '';
1261
1265
  throw new FirecrawlError(
1262
- `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}`,
1263
- response.status
1266
+ `Failed to ${action}. Status code: ${response.status}. Error: ${errorMessage}${details}`,
1267
+ response.status,
1268
+ response?.data?.details
1264
1269
  );
1265
1270
  } else {
1266
1271
  throw new FirecrawlError(