firecrawl 4.20.1 → 4.21.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.
@@ -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.20.1",
11
+ version: "4.21.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
@@ -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.20.1",
38
+ version: "4.21.1",
39
39
  description: "JavaScript SDK for Firecrawl API",
40
40
  main: "dist/index.js",
41
41
  types: "dist/index.d.ts",
@@ -625,11 +625,17 @@ function prepareSearchPayload(req) {
625
625
  throw new Error("limit must be positive");
626
626
  if (req.timeout != null && req.timeout <= 0)
627
627
  throw new Error("timeout must be positive");
628
+ if (req.includeDomains?.length && req.excludeDomains?.length)
629
+ throw new Error(
630
+ "includeDomains and excludeDomains cannot both be specified"
631
+ );
628
632
  const payload = {
629
633
  query: req.query
630
634
  };
631
635
  if (req.sources) payload.sources = req.sources;
632
636
  if (req.categories) payload.categories = req.categories;
637
+ if (req.includeDomains) payload.includeDomains = req.includeDomains;
638
+ if (req.excludeDomains) payload.excludeDomains = req.excludeDomains;
633
639
  if (req.limit != null) payload.limit = req.limit;
634
640
  if (req.tbs != null) payload.tbs = req.tbs;
635
641
  if (req.location != null) payload.location = req.location;
package/dist/index.d.cts CHANGED
@@ -43,6 +43,7 @@ interface AttributesFormat extends Format {
43
43
  interface QueryFormat {
44
44
  type: 'query';
45
45
  prompt: string;
46
+ mode?: 'freeform' | 'directQuote';
46
47
  }
47
48
  type FormatOption = FormatString | Format | JsonFormat | ChangeTrackingFormat | ScreenshotFormat | AttributesFormat | QueryFormat;
48
49
  type ParseFormatString = Exclude<FormatString, 'screenshot' | 'changeTracking' | 'branding'>;
@@ -395,6 +396,8 @@ interface SearchRequest {
395
396
  type: 'web' | 'news' | 'images';
396
397
  }>;
397
398
  categories?: Array<'github' | 'research' | 'pdf' | CategoryOption>;
399
+ includeDomains?: string[];
400
+ excludeDomains?: string[];
398
401
  limit?: number;
399
402
  tbs?: string;
400
403
  location?: string;
package/dist/index.d.ts CHANGED
@@ -43,6 +43,7 @@ interface AttributesFormat extends Format {
43
43
  interface QueryFormat {
44
44
  type: 'query';
45
45
  prompt: string;
46
+ mode?: 'freeform' | 'directQuote';
46
47
  }
47
48
  type FormatOption = FormatString | Format | JsonFormat | ChangeTrackingFormat | ScreenshotFormat | AttributesFormat | QueryFormat;
48
49
  type ParseFormatString = Exclude<FormatString, 'screenshot' | 'changeTracking' | 'branding'>;
@@ -395,6 +396,8 @@ interface SearchRequest {
395
396
  type: 'web' | 'news' | 'images';
396
397
  }>;
397
398
  categories?: Array<'github' | 'research' | 'pdf' | CategoryOption>;
399
+ includeDomains?: string[];
400
+ excludeDomains?: string[];
398
401
  limit?: number;
399
402
  tbs?: string;
400
403
  location?: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  require_package
3
- } from "./chunk-OVLAEYRZ.js";
3
+ } from "./chunk-EH7NHUN5.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -501,11 +501,17 @@ function prepareSearchPayload(req) {
501
501
  throw new Error("limit must be positive");
502
502
  if (req.timeout != null && req.timeout <= 0)
503
503
  throw new Error("timeout must be positive");
504
+ if (req.includeDomains?.length && req.excludeDomains?.length)
505
+ throw new Error(
506
+ "includeDomains and excludeDomains cannot both be specified"
507
+ );
504
508
  const payload = {
505
509
  query: req.query
506
510
  };
507
511
  if (req.sources) payload.sources = req.sources;
508
512
  if (req.categories) payload.categories = req.categories;
513
+ if (req.includeDomains) payload.includeDomains = req.includeDomains;
514
+ if (req.excludeDomains) payload.excludeDomains = req.excludeDomains;
509
515
  if (req.limit != null) payload.limit = req.limit;
510
516
  if (req.tbs != null) payload.tbs = req.tbs;
511
517
  if (req.location != null) payload.location = req.location;
@@ -1803,7 +1809,7 @@ var FirecrawlApp = class {
1803
1809
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
1804
1810
  return process.env.npm_package_version;
1805
1811
  }
1806
- const packageJson = await import("./package-4Q7WA3UI.js");
1812
+ const packageJson = await import("./package-7423KYJY.js");
1807
1813
  return packageJson.default.version;
1808
1814
  } catch (error) {
1809
1815
  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-OVLAEYRZ.js";
3
+ } from "./chunk-EH7NHUN5.js";
4
4
  export default require_package();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firecrawl",
3
- "version": "4.20.1",
3
+ "version": "4.21.1",
4
4
  "description": "JavaScript SDK for Firecrawl API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,11 +20,17 @@ function prepareSearchPayload(req: SearchRequest): Record<string, unknown> {
20
20
  throw new Error("limit must be positive");
21
21
  if (req.timeout != null && req.timeout <= 0)
22
22
  throw new Error("timeout must be positive");
23
+ if (req.includeDomains?.length && req.excludeDomains?.length)
24
+ throw new Error(
25
+ "includeDomains and excludeDomains cannot both be specified",
26
+ );
23
27
  const payload: Record<string, unknown> = {
24
28
  query: req.query,
25
29
  };
26
30
  if (req.sources) payload.sources = req.sources;
27
31
  if (req.categories) payload.categories = req.categories;
32
+ if (req.includeDomains) payload.includeDomains = req.includeDomains;
33
+ if (req.excludeDomains) payload.excludeDomains = req.excludeDomains;
28
34
  if (req.limit != null) payload.limit = req.limit;
29
35
  if (req.tbs != null) payload.tbs = req.tbs;
30
36
  if (req.location != null) payload.location = req.location;
package/src/v2/types.ts CHANGED
@@ -55,6 +55,7 @@ export interface AttributesFormat extends Format {
55
55
  export interface QueryFormat {
56
56
  type: 'query';
57
57
  prompt: string;
58
+ mode?: 'freeform' | 'directQuote';
58
59
  }
59
60
 
60
61
  export type FormatOption =
@@ -508,6 +509,8 @@ export interface SearchRequest {
508
509
  'web' | 'news' | 'images' | { type: 'web' | 'news' | 'images' }
509
510
  >;
510
511
  categories?: Array<'github' | 'research' | 'pdf' | CategoryOption>;
512
+ includeDomains?: string[];
513
+ excludeDomains?: string[];
511
514
  limit?: number;
512
515
  tbs?: string;
513
516
  location?: string;