@mendable/firecrawl-js 4.18.5 → 4.19.0

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.
@@ -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.18.5",
11
+ version: "4.19.0",
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.18.5",
38
+ version: "4.19.0",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -433,7 +433,7 @@ function ensureValidParseOptions(options) {
433
433
  if (raw.mobile !== void 0) {
434
434
  throw new Error("parse does not support mobile rendering");
435
435
  }
436
- if (raw.maxAge !== void 0 || raw.minAge !== void 0 || raw.storeInCache !== void 0) {
436
+ if (raw.maxAge !== void 0 || raw.minAge !== void 0 || raw.storeInCache !== void 0 || raw.lockdown !== void 0) {
437
437
  throw new Error("parse does not support cache/index options");
438
438
  }
439
439
  if (raw.proxy !== void 0 && raw.proxy !== "basic" && raw.proxy !== "auto") {
package/dist/index.d.cts CHANGED
@@ -124,6 +124,7 @@ interface ScrapeOptions {
124
124
  maxAge?: number;
125
125
  minAge?: number;
126
126
  storeInCache?: boolean;
127
+ lockdown?: boolean;
127
128
  profile?: {
128
129
  name: string;
129
130
  saveChanges?: boolean;
@@ -137,7 +138,7 @@ interface ParseFile {
137
138
  filename: string;
138
139
  contentType?: string;
139
140
  }
140
- type ParseOptions = Omit<ScrapeOptions, 'formats' | 'waitFor' | 'mobile' | 'actions' | 'location' | 'maxAge' | 'minAge' | 'storeInCache' | 'proxy'> & {
141
+ type ParseOptions = Omit<ScrapeOptions, 'formats' | 'waitFor' | 'mobile' | 'actions' | 'location' | 'maxAge' | 'minAge' | 'storeInCache' | 'lockdown' | 'proxy'> & {
141
142
  formats?: ParseFormatOption[];
142
143
  proxy?: 'basic' | 'auto';
143
144
  };
package/dist/index.d.ts CHANGED
@@ -124,6 +124,7 @@ interface ScrapeOptions {
124
124
  maxAge?: number;
125
125
  minAge?: number;
126
126
  storeInCache?: boolean;
127
+ lockdown?: boolean;
127
128
  profile?: {
128
129
  name: string;
129
130
  saveChanges?: boolean;
@@ -137,7 +138,7 @@ interface ParseFile {
137
138
  filename: string;
138
139
  contentType?: string;
139
140
  }
140
- type ParseOptions = Omit<ScrapeOptions, 'formats' | 'waitFor' | 'mobile' | 'actions' | 'location' | 'maxAge' | 'minAge' | 'storeInCache' | 'proxy'> & {
141
+ type ParseOptions = Omit<ScrapeOptions, 'formats' | 'waitFor' | 'mobile' | 'actions' | 'location' | 'maxAge' | 'minAge' | 'storeInCache' | 'lockdown' | 'proxy'> & {
141
142
  formats?: ParseFormatOption[];
142
143
  proxy?: 'basic' | 'auto';
143
144
  };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-SEIHZPTI.js";
3
+ } from "./chunk-JJY4NJXL.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -309,7 +309,7 @@ function ensureValidParseOptions(options) {
309
309
  if (raw.mobile !== void 0) {
310
310
  throw new Error("parse does not support mobile rendering");
311
311
  }
312
- if (raw.maxAge !== void 0 || raw.minAge !== void 0 || raw.storeInCache !== void 0) {
312
+ if (raw.maxAge !== void 0 || raw.minAge !== void 0 || raw.storeInCache !== void 0 || raw.lockdown !== void 0) {
313
313
  throw new Error("parse does not support cache/index options");
314
314
  }
315
315
  if (raw.proxy !== void 0 && raw.proxy !== "basic" && raw.proxy !== "auto") {
@@ -1707,7 +1707,7 @@ var FirecrawlApp = class {
1707
1707
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
1708
1708
  return process.env.npm_package_version;
1709
1709
  }
1710
- const packageJson = await import("./package-ASKBBK6V.js");
1710
+ const packageJson = await import("./package-HMEPZJ3J.js");
1711
1711
  return packageJson.default.version;
1712
1712
  } catch (error) {
1713
1713
  const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
@@ -1,4 +1,4 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-SEIHZPTI.js";
3
+ } from "./chunk-JJY4NJXL.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mendable/firecrawl-js",
3
- "version": "4.18.5",
3
+ "version": "4.19.0",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -37,4 +37,22 @@ describe("v2.parse unit", () => {
37
37
  ),
38
38
  ).rejects.toThrow("parse does not support changeTracking format");
39
39
  });
40
+
41
+ test("rejects lockdown option before making requests", async () => {
42
+ const client = new FirecrawlClient({
43
+ apiKey: "test-key",
44
+ apiUrl: "https://localhost:3002",
45
+ });
46
+
47
+ await expect(
48
+ client.parse(
49
+ {
50
+ data: "<html><body>test</body></html>",
51
+ filename: "upload.html",
52
+ contentType: "text/html",
53
+ },
54
+ { formats: ["markdown"], lockdown: true } as any,
55
+ ),
56
+ ).rejects.toThrow("parse does not support cache/index options");
57
+ });
40
58
  });
package/src/v2/types.ts CHANGED
@@ -180,6 +180,7 @@ export interface ScrapeOptions {
180
180
  maxAge?: number;
181
181
  minAge?: number;
182
182
  storeInCache?: boolean;
183
+ lockdown?: boolean;
183
184
  profile?: {
184
185
  name: string;
185
186
  saveChanges?: boolean;
@@ -212,6 +213,7 @@ export type ParseOptions = Omit<
212
213
  | 'maxAge'
213
214
  | 'minAge'
214
215
  | 'storeInCache'
216
+ | 'lockdown'
215
217
  | 'proxy'
216
218
  > & {
217
219
  formats?: ParseFormatOption[];
@@ -139,7 +139,12 @@ export function ensureValidParseOptions(options?: ParseOptions): void {
139
139
  if (raw.mobile !== undefined) {
140
140
  throw new Error("parse does not support mobile rendering");
141
141
  }
142
- if (raw.maxAge !== undefined || raw.minAge !== undefined || raw.storeInCache !== undefined) {
142
+ if (
143
+ raw.maxAge !== undefined ||
144
+ raw.minAge !== undefined ||
145
+ raw.storeInCache !== undefined ||
146
+ raw.lockdown !== undefined
147
+ ) {
143
148
  throw new Error("parse does not support cache/index options");
144
149
  }
145
150
  if (raw.proxy !== undefined && raw.proxy !== "basic" && raw.proxy !== "auto") {