@mendable/firecrawl-js 4.44.0 → 4.44.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.
|
@@ -12,7 +12,7 @@ var require_package = __commonJS({
|
|
|
12
12
|
"package.json"(exports, module) {
|
|
13
13
|
module.exports = {
|
|
14
14
|
name: "@mendable/firecrawl-js",
|
|
15
|
-
version: "4.44.
|
|
15
|
+
version: "4.44.1",
|
|
16
16
|
description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
|
|
17
17
|
main: "dist/index.js",
|
|
18
18
|
types: "dist/index.d.ts",
|
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ var require_package = __commonJS({
|
|
|
39
39
|
"package.json"(exports2, module2) {
|
|
40
40
|
module2.exports = {
|
|
41
41
|
name: "@mendable/firecrawl-js",
|
|
42
|
-
version: "4.44.
|
|
42
|
+
version: "4.44.1",
|
|
43
43
|
description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
|
|
44
44
|
main: "dist/index.js",
|
|
45
45
|
types: "dist/index.d.ts",
|
|
@@ -897,6 +897,8 @@ async function search(http, request) {
|
|
|
897
897
|
|
|
898
898
|
// src/v2/methods/tools.ts
|
|
899
899
|
var ALEXANDRIA_MAX_CALLS = 10;
|
|
900
|
+
var ALEXANDRIA_MAX_TIMEOUT_MS = 12e4;
|
|
901
|
+
var ALEXANDRIA_RESPONSE_MARGIN_MS = 3e4;
|
|
900
902
|
function prepareAlexandriaPayload(calls, opts) {
|
|
901
903
|
if (!Array.isArray(calls) || calls.length === 0) {
|
|
902
904
|
throw new Error("alexandria requires at least one call");
|
|
@@ -946,7 +948,10 @@ async function scrapeAlexandria(http, calls, opts = {}) {
|
|
|
946
948
|
const res = await http.post("/v2/scrape", payload, {
|
|
947
949
|
headers: { "x-request-id": requestId },
|
|
948
950
|
// Allow response delivery after the API's capped execution deadline.
|
|
949
|
-
timeoutMs: Math.min(
|
|
951
|
+
timeoutMs: Math.min(
|
|
952
|
+
opts.timeout ?? ALEXANDRIA_MAX_TIMEOUT_MS,
|
|
953
|
+
ALEXANDRIA_MAX_TIMEOUT_MS
|
|
954
|
+
) + ALEXANDRIA_RESPONSE_MARGIN_MS
|
|
950
955
|
});
|
|
951
956
|
if (res.status !== 200 || !res.data?.success) {
|
|
952
957
|
throwForBadResponse(res, "alexandria");
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JU6NENYM.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -765,6 +765,8 @@ async function search(http, request) {
|
|
|
765
765
|
|
|
766
766
|
// src/v2/methods/tools.ts
|
|
767
767
|
var ALEXANDRIA_MAX_CALLS = 10;
|
|
768
|
+
var ALEXANDRIA_MAX_TIMEOUT_MS = 12e4;
|
|
769
|
+
var ALEXANDRIA_RESPONSE_MARGIN_MS = 3e4;
|
|
768
770
|
function prepareAlexandriaPayload(calls, opts) {
|
|
769
771
|
if (!Array.isArray(calls) || calls.length === 0) {
|
|
770
772
|
throw new Error("alexandria requires at least one call");
|
|
@@ -814,7 +816,10 @@ async function scrapeAlexandria(http, calls, opts = {}) {
|
|
|
814
816
|
const res = await http.post("/v2/scrape", payload, {
|
|
815
817
|
headers: { "x-request-id": requestId },
|
|
816
818
|
// Allow response delivery after the API's capped execution deadline.
|
|
817
|
-
timeoutMs: Math.min(
|
|
819
|
+
timeoutMs: Math.min(
|
|
820
|
+
opts.timeout ?? ALEXANDRIA_MAX_TIMEOUT_MS,
|
|
821
|
+
ALEXANDRIA_MAX_TIMEOUT_MS
|
|
822
|
+
) + ALEXANDRIA_RESPONSE_MARGIN_MS
|
|
818
823
|
});
|
|
819
824
|
if (res.status !== 200 || !res.data?.success) {
|
|
820
825
|
throwForBadResponse(res, "alexandria");
|
|
@@ -2735,7 +2740,7 @@ var FirecrawlApp = class {
|
|
|
2735
2740
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
2736
2741
|
return process.env.npm_package_version;
|
|
2737
2742
|
}
|
|
2738
|
-
const packageJson = await import("./package-
|
|
2743
|
+
const packageJson = await import("./package-FEZU4ANT.js");
|
|
2739
2744
|
return packageJson.default.version;
|
|
2740
2745
|
} catch (error) {
|
|
2741
2746
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mendable/firecrawl-js",
|
|
3
|
-
"version": "4.44.
|
|
3
|
+
"version": "4.44.1",
|
|
4
4
|
"description": "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -272,9 +272,11 @@ describe("Alexandria contracts and execution", () => {
|
|
|
272
272
|
});
|
|
273
273
|
|
|
274
274
|
test.each([
|
|
275
|
-
[undefined,
|
|
275
|
+
[undefined, 150000],
|
|
276
276
|
[1000, 31000],
|
|
277
|
-
[100000,
|
|
277
|
+
[100000, 130000],
|
|
278
|
+
[120000, 150000],
|
|
279
|
+
[300000, 150000],
|
|
278
280
|
])(
|
|
279
281
|
"Alexandria timeout %s allows response delivery (%s ms)",
|
|
280
282
|
async (timeout, timeoutMs) => {
|
package/src/v2/methods/tools.ts
CHANGED
|
@@ -14,6 +14,10 @@ import {
|
|
|
14
14
|
} from "../utils/errorHandler";
|
|
15
15
|
|
|
16
16
|
const ALEXANDRIA_MAX_CALLS = 10;
|
|
17
|
+
// Matches the API's default and maximum execution timeout for Alexandria calls.
|
|
18
|
+
const ALEXANDRIA_MAX_TIMEOUT_MS = 120_000;
|
|
19
|
+
// Extra time for the API to deliver a response after its execution deadline.
|
|
20
|
+
const ALEXANDRIA_RESPONSE_MARGIN_MS = 30_000;
|
|
17
21
|
|
|
18
22
|
function prepareAlexandriaPayload(
|
|
19
23
|
calls: AlexandriaCall[],
|
|
@@ -82,7 +86,11 @@ export async function scrapeAlexandria(
|
|
|
82
86
|
}>("/v2/scrape", payload, {
|
|
83
87
|
headers: { "x-request-id": requestId },
|
|
84
88
|
// Allow response delivery after the API's capped execution deadline.
|
|
85
|
-
timeoutMs:
|
|
89
|
+
timeoutMs:
|
|
90
|
+
Math.min(
|
|
91
|
+
opts.timeout ?? ALEXANDRIA_MAX_TIMEOUT_MS,
|
|
92
|
+
ALEXANDRIA_MAX_TIMEOUT_MS,
|
|
93
|
+
) + ALEXANDRIA_RESPONSE_MARGIN_MS,
|
|
86
94
|
});
|
|
87
95
|
if (res.status !== 200 || !res.data?.success) {
|
|
88
96
|
throwForBadResponse(res, "alexandria");
|