firecrawl 3.2.0 → 3.2.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.
- package/LICENSE +0 -0
- package/dist/{chunk-NVTWBXZM.js → chunk-QPAPMZLC.js} +2 -2
- package/dist/index.cjs +11 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -5
- package/dist/{package-TM3XCIRK.js → package-VNFDXLYR.js} +1 -1
- package/jest.config.js +0 -0
- package/package.json +1 -1
- package/src/__tests__/unit/v2/clientOptions.test.ts +55 -0
- package/src/index.ts +10 -4
- package/tsup.config.ts +0 -0
- package/dump.rdb +0 -0
package/LICENSE
CHANGED
|
File without changes
|
|
@@ -7,8 +7,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
7
7
|
var require_package = __commonJS({
|
|
8
8
|
"package.json"(exports, module) {
|
|
9
9
|
module.exports = {
|
|
10
|
-
name: "firecrawl",
|
|
11
|
-
version: "3.2.
|
|
10
|
+
name: "@mendable/firecrawl-js",
|
|
11
|
+
version: "3.2.1",
|
|
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
|
@@ -34,8 +34,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
34
34
|
var require_package = __commonJS({
|
|
35
35
|
"package.json"(exports2, module2) {
|
|
36
36
|
module2.exports = {
|
|
37
|
-
name: "firecrawl",
|
|
38
|
-
version: "3.2.
|
|
37
|
+
name: "@mendable/firecrawl-js",
|
|
38
|
+
version: "3.2.1",
|
|
39
39
|
description: "JavaScript SDK for Firecrawl API",
|
|
40
40
|
main: "dist/index.js",
|
|
41
41
|
types: "dist/index.d.ts",
|
|
@@ -108,15 +108,15 @@ var require_package = __commonJS({
|
|
|
108
108
|
});
|
|
109
109
|
|
|
110
110
|
// src/index.ts
|
|
111
|
-
var
|
|
112
|
-
__export(
|
|
111
|
+
var index_exports = {};
|
|
112
|
+
__export(index_exports, {
|
|
113
113
|
Firecrawl: () => Firecrawl,
|
|
114
114
|
FirecrawlAppV1: () => FirecrawlApp,
|
|
115
115
|
FirecrawlClient: () => FirecrawlClient,
|
|
116
116
|
SdkError: () => SdkError,
|
|
117
|
-
default: () =>
|
|
117
|
+
default: () => index_default
|
|
118
118
|
});
|
|
119
|
-
module.exports = __toCommonJS(
|
|
119
|
+
module.exports = __toCommonJS(index_exports);
|
|
120
120
|
|
|
121
121
|
// src/v2/utils/httpClient.ts
|
|
122
122
|
var import_axios = __toESM(require("axios"), 1);
|
|
@@ -2348,7 +2348,10 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2348
2348
|
/** @param opts API credentials and base URL. */
|
|
2349
2349
|
constructor(opts = {}) {
|
|
2350
2350
|
super(opts);
|
|
2351
|
-
this._v1Opts =
|
|
2351
|
+
this._v1Opts = {
|
|
2352
|
+
apiKey: opts.apiKey,
|
|
2353
|
+
apiUrl: opts.apiUrl
|
|
2354
|
+
};
|
|
2352
2355
|
}
|
|
2353
2356
|
/** Access the legacy v1 client (instantiated on first access). */
|
|
2354
2357
|
get v1() {
|
|
@@ -2356,7 +2359,7 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2356
2359
|
return this._v1;
|
|
2357
2360
|
}
|
|
2358
2361
|
};
|
|
2359
|
-
var
|
|
2362
|
+
var index_default = Firecrawl;
|
|
2360
2363
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2361
2364
|
0 && (module.exports = {
|
|
2362
2365
|
Firecrawl,
|
package/dist/index.d.cts
CHANGED
|
@@ -1343,9 +1343,9 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
1343
1343
|
private _v1?;
|
|
1344
1344
|
private _v1Opts;
|
|
1345
1345
|
/** @param opts API credentials and base URL. */
|
|
1346
|
-
constructor(opts?:
|
|
1346
|
+
constructor(opts?: FirecrawlClientOptions);
|
|
1347
1347
|
/** Access the legacy v1 client (instantiated on first access). */
|
|
1348
1348
|
get v1(): FirecrawlApp;
|
|
1349
1349
|
}
|
|
1350
1350
|
|
|
1351
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, 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 Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type Format, type FormatOption, type FormatString, type JsonFormat, type LocationConfig, type MapData, type MapOptions, type PDFAction, type PressAction, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
1351
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, 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 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, type JsonFormat, type LocationConfig, type MapData, type MapOptions, type PDFAction, type PressAction, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1343,9 +1343,9 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
1343
1343
|
private _v1?;
|
|
1344
1344
|
private _v1Opts;
|
|
1345
1345
|
/** @param opts API credentials and base URL. */
|
|
1346
|
-
constructor(opts?:
|
|
1346
|
+
constructor(opts?: FirecrawlClientOptions);
|
|
1347
1347
|
/** Access the legacy v1 client (instantiated on first access). */
|
|
1348
1348
|
get v1(): FirecrawlApp;
|
|
1349
1349
|
}
|
|
1350
1350
|
|
|
1351
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, 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 Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type Format, type FormatOption, type FormatString, type JsonFormat, type LocationConfig, type MapData, type MapOptions, type PDFAction, type PressAction, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type Viewport, type WaitAction, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
1351
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, 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 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, type JsonFormat, type LocationConfig, type MapData, type MapOptions, type PDFAction, type PressAction, type ScrapeAction, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type Viewport, type WaitAction, 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-QPAPMZLC.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -933,7 +933,7 @@ var FirecrawlApp = class {
|
|
|
933
933
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
934
934
|
return process.env.npm_package_version;
|
|
935
935
|
}
|
|
936
|
-
const packageJson = await import("./package-
|
|
936
|
+
const packageJson = await import("./package-VNFDXLYR.js");
|
|
937
937
|
return packageJson.default.version;
|
|
938
938
|
} catch (error) {
|
|
939
939
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
|
@@ -2232,7 +2232,10 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2232
2232
|
/** @param opts API credentials and base URL. */
|
|
2233
2233
|
constructor(opts = {}) {
|
|
2234
2234
|
super(opts);
|
|
2235
|
-
this._v1Opts =
|
|
2235
|
+
this._v1Opts = {
|
|
2236
|
+
apiKey: opts.apiKey,
|
|
2237
|
+
apiUrl: opts.apiUrl
|
|
2238
|
+
};
|
|
2236
2239
|
}
|
|
2237
2240
|
/** Access the legacy v1 client (instantiated on first access). */
|
|
2238
2241
|
get v1() {
|
|
@@ -2240,11 +2243,11 @@ var Firecrawl = class extends FirecrawlClient {
|
|
|
2240
2243
|
return this._v1;
|
|
2241
2244
|
}
|
|
2242
2245
|
};
|
|
2243
|
-
var
|
|
2246
|
+
var index_default = Firecrawl;
|
|
2244
2247
|
export {
|
|
2245
2248
|
Firecrawl,
|
|
2246
2249
|
FirecrawlApp as FirecrawlAppV1,
|
|
2247
2250
|
FirecrawlClient,
|
|
2248
2251
|
SdkError,
|
|
2249
|
-
|
|
2252
|
+
index_default as default
|
|
2250
2253
|
};
|
package/jest.config.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Firecrawl, type FirecrawlClientOptions } from '../../../index';
|
|
2
|
+
|
|
3
|
+
describe('Firecrawl v2 Client Options', () => {
|
|
4
|
+
it('should accept v2 options including timeoutMs, maxRetries, and backoffFactor', () => {
|
|
5
|
+
const options: FirecrawlClientOptions = {
|
|
6
|
+
apiKey: 'test-key',
|
|
7
|
+
timeoutMs: 300,
|
|
8
|
+
maxRetries: 5,
|
|
9
|
+
backoffFactor: 0.5,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Should not throw any type errors
|
|
13
|
+
const client = new Firecrawl(options);
|
|
14
|
+
|
|
15
|
+
expect(client).toBeDefined();
|
|
16
|
+
expect(client).toBeInstanceOf(Firecrawl);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should work with minimal options', () => {
|
|
20
|
+
const options: FirecrawlClientOptions = {
|
|
21
|
+
apiKey: 'test-key',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const client = new Firecrawl(options);
|
|
25
|
+
|
|
26
|
+
expect(client).toBeDefined();
|
|
27
|
+
expect(client).toBeInstanceOf(Firecrawl);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should work with all v2 options', () => {
|
|
31
|
+
const options: FirecrawlClientOptions = {
|
|
32
|
+
apiKey: 'test-key',
|
|
33
|
+
apiUrl: 'https://custom-api.firecrawl.dev',
|
|
34
|
+
timeoutMs: 60000,
|
|
35
|
+
maxRetries: 3,
|
|
36
|
+
backoffFactor: 1.0,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const client = new Firecrawl(options);
|
|
40
|
+
|
|
41
|
+
expect(client).toBeDefined();
|
|
42
|
+
expect(client).toBeInstanceOf(Firecrawl);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should export FirecrawlClientOptions type', () => {
|
|
46
|
+
// This test ensures the type is properly exported
|
|
47
|
+
const options: FirecrawlClientOptions = {
|
|
48
|
+
apiKey: 'test-key',
|
|
49
|
+
timeoutMs: 300,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
expect(options.timeoutMs).toBe(300);
|
|
53
|
+
expect(options.apiKey).toBe('test-key');
|
|
54
|
+
});
|
|
55
|
+
});
|
package/src/index.ts
CHANGED
|
@@ -13,9 +13,12 @@ export * from "./v2/types";
|
|
|
13
13
|
export { default as FirecrawlAppV1 } from "./v1";
|
|
14
14
|
|
|
15
15
|
import V1 from "./v1";
|
|
16
|
-
import { FirecrawlClient as V2 } from "./v2/client";
|
|
16
|
+
import { FirecrawlClient as V2, type FirecrawlClientOptions } from "./v2/client";
|
|
17
17
|
import type { FirecrawlAppConfig } from "./v1";
|
|
18
18
|
|
|
19
|
+
// Re-export v2 client options for convenience
|
|
20
|
+
export type { FirecrawlClientOptions } from "./v2/client";
|
|
21
|
+
|
|
19
22
|
/** Unified client: extends v2 and adds `.v1` for backward compatibility. */
|
|
20
23
|
export class Firecrawl extends V2 {
|
|
21
24
|
/** Feature‑frozen v1 client (lazy). */
|
|
@@ -23,9 +26,12 @@ export class Firecrawl extends V2 {
|
|
|
23
26
|
private _v1Opts: FirecrawlAppConfig;
|
|
24
27
|
|
|
25
28
|
/** @param opts API credentials and base URL. */
|
|
26
|
-
constructor(opts:
|
|
27
|
-
super(opts
|
|
28
|
-
this._v1Opts =
|
|
29
|
+
constructor(opts: FirecrawlClientOptions = {}) {
|
|
30
|
+
super(opts);
|
|
31
|
+
this._v1Opts = {
|
|
32
|
+
apiKey: opts.apiKey,
|
|
33
|
+
apiUrl: opts.apiUrl,
|
|
34
|
+
};
|
|
29
35
|
}
|
|
30
36
|
|
|
31
37
|
/** Access the legacy v1 client (instantiated on first access). */
|
package/tsup.config.ts
CHANGED
|
File without changes
|
package/dump.rdb
DELETED
|
Binary file
|