@mendable/firecrawl 4.11.4 → 4.11.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/{chunk-UMVTH3OK.js → chunk-QMFPXJCS.js} +1 -1
- package/dist/index.cjs +4 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/{package-4JFABD5Y.js → package-WCQMBCSR.js} +1 -1
- package/package.json +1 -1
- package/src/__tests__/e2e/v2/scrape.test.ts +4 -4
- package/src/__tests__/e2e/v2/search.test.ts +6 -6
- package/src/__tests__/e2e/v2/usage.test.ts +9 -10
- package/src/index.ts +2 -0
|
@@ -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.11.
|
|
11
|
+
version: "4.11.5",
|
|
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.11.
|
|
38
|
+
version: "4.11.5",
|
|
39
39
|
description: "JavaScript SDK for Firecrawl API",
|
|
40
40
|
main: "dist/index.js",
|
|
41
41
|
types: "dist/index.d.ts",
|
|
@@ -117,6 +117,7 @@ __export(index_exports, {
|
|
|
117
117
|
FirecrawlClient: () => FirecrawlClient,
|
|
118
118
|
JobTimeoutError: () => JobTimeoutError,
|
|
119
119
|
SdkError: () => SdkError,
|
|
120
|
+
Watcher: () => Watcher,
|
|
120
121
|
default: () => index_default
|
|
121
122
|
});
|
|
122
123
|
module.exports = __toCommonJS(index_exports);
|
|
@@ -2871,5 +2872,6 @@ var index_default = Firecrawl;
|
|
|
2871
2872
|
FirecrawlAppV1,
|
|
2872
2873
|
FirecrawlClient,
|
|
2873
2874
|
JobTimeoutError,
|
|
2874
|
-
SdkError
|
|
2875
|
+
SdkError,
|
|
2876
|
+
Watcher
|
|
2875
2877
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1736,4 +1736,4 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
1736
1736
|
get v1(): FirecrawlApp;
|
|
1737
1737
|
}
|
|
1738
1738
|
|
|
1739
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
1739
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1736,4 +1736,4 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
1736
1736
|
get v1(): FirecrawlApp;
|
|
1737
1737
|
}
|
|
1738
1738
|
|
|
1739
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
1739
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type PressAction, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-QMFPXJCS.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -1374,7 +1374,7 @@ var FirecrawlApp = class {
|
|
|
1374
1374
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
1375
1375
|
return process.env.npm_package_version;
|
|
1376
1376
|
}
|
|
1377
|
-
const packageJson = await import("./package-
|
|
1377
|
+
const packageJson = await import("./package-WCQMBCSR.js");
|
|
1378
1378
|
return packageJson.default.version;
|
|
1379
1379
|
} catch (error) {
|
|
1380
1380
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
|
@@ -2752,5 +2752,6 @@ export {
|
|
|
2752
2752
|
FirecrawlClient,
|
|
2753
2753
|
JobTimeoutError,
|
|
2754
2754
|
SdkError,
|
|
2755
|
+
Watcher,
|
|
2755
2756
|
index_default as default
|
|
2756
2757
|
};
|
package/package.json
CHANGED
|
@@ -128,9 +128,9 @@ describe("v2.scrape e2e", () => {
|
|
|
128
128
|
});
|
|
129
129
|
expect(doc.images).toBeTruthy();
|
|
130
130
|
expect(Array.isArray(doc.images)).toBe(true);
|
|
131
|
-
expect(doc.images
|
|
131
|
+
expect(doc.images?.length).toBeGreaterThan(0);
|
|
132
132
|
// Should find firecrawl logo/branding images
|
|
133
|
-
expect(doc.images
|
|
133
|
+
expect(doc.images?.some(img => img.includes("firecrawl") || img.includes("logo"))).toBe(true);
|
|
134
134
|
}, 60_000);
|
|
135
135
|
|
|
136
136
|
test("images format: works with multiple formats", async () => {
|
|
@@ -142,7 +142,7 @@ describe("v2.scrape e2e", () => {
|
|
|
142
142
|
expect(doc.links).toBeTruthy();
|
|
143
143
|
expect(doc.images).toBeTruthy();
|
|
144
144
|
expect(Array.isArray(doc.images)).toBe(true);
|
|
145
|
-
expect(doc.images
|
|
145
|
+
expect(doc.images?.length).toBeGreaterThan(0);
|
|
146
146
|
|
|
147
147
|
// Images should find things not available in links format
|
|
148
148
|
const imageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.svg', '.ico'];
|
|
@@ -151,7 +151,7 @@ describe("v2.scrape e2e", () => {
|
|
|
151
151
|
) || [];
|
|
152
152
|
|
|
153
153
|
// Should discover additional images beyond those with obvious extensions
|
|
154
|
-
expect(doc.images
|
|
154
|
+
expect(doc.images?.length).toBeGreaterThanOrEqual(linkImages.length);
|
|
155
155
|
}, 60_000);
|
|
156
156
|
|
|
157
157
|
test("invalid url should throw", async () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* E2E tests for v2 search (translated from Python tests)
|
|
3
3
|
*/
|
|
4
4
|
import Firecrawl from "../../../index";
|
|
5
|
-
import type { Document,
|
|
5
|
+
import type { Document, SearchResultWeb, SearchResultNews, SearchResultImages } from "../../../index";
|
|
6
6
|
import { config } from "dotenv";
|
|
7
7
|
import { getIdentity, getApiUrl } from "./utils/idmux";
|
|
8
8
|
import { describe, test, expect, beforeAll } from "@jest/globals";
|
|
@@ -28,7 +28,7 @@ function collectTexts(entries: any[] | undefined): string[] {
|
|
|
28
28
|
return texts;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
function isDocument(entry: Document |
|
|
31
|
+
function isDocument(entry: Document | SearchResultWeb | SearchResultNews | SearchResultImages | undefined | null): entry is Document {
|
|
32
32
|
if (!entry) return false;
|
|
33
33
|
const d = entry as Document;
|
|
34
34
|
return (
|
|
@@ -86,10 +86,10 @@ describe("v2.search e2e", () => {
|
|
|
86
86
|
expect(results.images == null).toBe(true);
|
|
87
87
|
|
|
88
88
|
const webTitles = (results.web || [])
|
|
89
|
-
.filter((r): r is
|
|
89
|
+
.filter((r): r is SearchResultWeb => !isDocument(r))
|
|
90
90
|
.map(r => (r.title || "").toString().toLowerCase());
|
|
91
91
|
const webDescriptions = (results.web || [])
|
|
92
|
-
.filter((r): r is
|
|
92
|
+
.filter((r): r is SearchResultWeb => !isDocument(r))
|
|
93
93
|
.map(r => (r.description || "").toString().toLowerCase());
|
|
94
94
|
const allWebText = (webTitles.concat(webDescriptions)).join(" ");
|
|
95
95
|
expect(allWebText.includes("firecrawl")).toBe(true);
|
|
@@ -183,7 +183,7 @@ describe("v2.search e2e", () => {
|
|
|
183
183
|
expect(Boolean(result.markdown) || Boolean(result.html)).toBe(true);
|
|
184
184
|
} else {
|
|
185
185
|
expect(typeof result.url).toBe("string");
|
|
186
|
-
expect(result.url
|
|
186
|
+
expect(result.url?.startsWith("http")).toBe(true);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -193,7 +193,7 @@ describe("v2.search e2e", () => {
|
|
|
193
193
|
for (const result of results.images || []) {
|
|
194
194
|
if (!isDocument(result)) {
|
|
195
195
|
expect(typeof result.url).toBe("string");
|
|
196
|
-
expect(result.url
|
|
196
|
+
expect(result.url?.startsWith("http")).toBe(true);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
}, 120_000);
|
|
@@ -23,16 +23,15 @@ describe("v2.usage e2e", () => {
|
|
|
23
23
|
expect(typeof resp.maxConcurrency).toBe("number");
|
|
24
24
|
}, 60_000);
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
// }, 60_000);
|
|
26
|
+
test("get_credit_usage", async () => {
|
|
27
|
+
const resp = await client.getCreditUsage();
|
|
28
|
+
expect(typeof resp.remainingCredits).toBe("number");
|
|
29
|
+
}, 60_000);
|
|
30
|
+
|
|
31
|
+
test("get_token_usage", async () => {
|
|
32
|
+
const resp = await client.getTokenUsage();
|
|
33
|
+
expect(typeof resp.remainingTokens).toBe("number");
|
|
34
|
+
}, 60_000);
|
|
36
35
|
|
|
37
36
|
test("get_queue_status", async () => {
|
|
38
37
|
const resp = await client.getQueueStatus();
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
export { FirecrawlClient } from "./v2/client";
|
|
10
10
|
/** Public v2 request/response types. */
|
|
11
11
|
export * from "./v2/types";
|
|
12
|
+
/** Watcher class and options for crawl/batch job monitoring. */
|
|
13
|
+
export { Watcher, type WatcherOptions } from "./v2/watcher";
|
|
12
14
|
/** Legacy v1 client (feature‑frozen). */
|
|
13
15
|
export { default as FirecrawlAppV1 } from "./v1";
|
|
14
16
|
|