firecrawl 4.30.0 → 4.30.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/dist/{chunk-OZ7DDARD.js → chunk-2LUWTM44.js} +1 -1
- package/dist/index.cjs +2 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -2
- package/dist/{package-ZZWOLTXM.js → package-2VNCXFNY.js} +1 -1
- package/package.json +1 -1
- package/src/__tests__/unit/v2/search-highlights.unit.test.ts +18 -0
- package/src/v2/methods/search.ts +1 -0
- package/src/v2/types.ts +2 -0
|
@@ -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.30.
|
|
15
|
+
version: "4.30.1",
|
|
16
16
|
description: "JavaScript SDK for Firecrawl API",
|
|
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.30.
|
|
42
|
+
version: "4.30.1",
|
|
43
43
|
description: "JavaScript SDK for Firecrawl API",
|
|
44
44
|
main: "dist/index.js",
|
|
45
45
|
types: "dist/index.d.ts",
|
|
@@ -717,6 +717,7 @@ function prepareSearchPayload(req) {
|
|
|
717
717
|
if (req.ignoreInvalidURLs != null)
|
|
718
718
|
payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
719
719
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
720
|
+
if (req.highlights != null) payload.highlights = req.highlights;
|
|
720
721
|
if (req.integration && req.integration.trim())
|
|
721
722
|
payload.integration = req.integration.trim();
|
|
722
723
|
if (req.origin) payload.origin = req.origin;
|
package/dist/index.d.cts
CHANGED
|
@@ -544,6 +544,8 @@ interface SearchRequest {
|
|
|
544
544
|
location?: string;
|
|
545
545
|
ignoreInvalidURLs?: boolean;
|
|
546
546
|
timeout?: number;
|
|
547
|
+
/** Generate query-relevant highlights for search results. Defaults to true. */
|
|
548
|
+
highlights?: boolean;
|
|
547
549
|
scrapeOptions?: ScrapeOptions;
|
|
548
550
|
/**
|
|
549
551
|
* Enterprise search options. Use `["zdr"]` for end-to-end Zero Data
|
package/dist/index.d.ts
CHANGED
|
@@ -544,6 +544,8 @@ interface SearchRequest {
|
|
|
544
544
|
location?: string;
|
|
545
545
|
ignoreInvalidURLs?: boolean;
|
|
546
546
|
timeout?: number;
|
|
547
|
+
/** Generate query-relevant highlights for search results. Defaults to true. */
|
|
548
|
+
highlights?: boolean;
|
|
547
549
|
scrapeOptions?: ScrapeOptions;
|
|
548
550
|
/**
|
|
549
551
|
* Enterprise search options. Use `["zdr"]` for end-to-end Zero Data
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2LUWTM44.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -584,6 +584,7 @@ function prepareSearchPayload(req) {
|
|
|
584
584
|
if (req.ignoreInvalidURLs != null)
|
|
585
585
|
payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
586
586
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
587
|
+
if (req.highlights != null) payload.highlights = req.highlights;
|
|
587
588
|
if (req.integration && req.integration.trim())
|
|
588
589
|
payload.integration = req.integration.trim();
|
|
589
590
|
if (req.origin) payload.origin = req.origin;
|
|
@@ -2311,7 +2312,7 @@ var FirecrawlApp = class {
|
|
|
2311
2312
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
2312
2313
|
return process.env.npm_package_version;
|
|
2313
2314
|
}
|
|
2314
|
-
const packageJson = await import("./package-
|
|
2315
|
+
const packageJson = await import("./package-2VNCXFNY.js");
|
|
2315
2316
|
return packageJson.default.version;
|
|
2316
2317
|
} catch (error) {
|
|
2317
2318
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
package/package.json
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { describe, expect, jest, test } from "@jest/globals";
|
|
2
|
+
import { search } from "../../../v2/methods/search";
|
|
3
|
+
|
|
4
|
+
describe("v2 search highlights", () => {
|
|
5
|
+
test("forwards the highlights option", async () => {
|
|
6
|
+
const http = {
|
|
7
|
+
post: jest.fn(async () => ({ status: 200, data: { success: true } })),
|
|
8
|
+
} as any;
|
|
9
|
+
|
|
10
|
+
await search(http, { query: "firecrawl", highlights: false });
|
|
11
|
+
|
|
12
|
+
expect(http.post).toHaveBeenCalledWith(
|
|
13
|
+
"/v2/search",
|
|
14
|
+
{ query: "firecrawl", highlights: false },
|
|
15
|
+
{},
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
});
|
package/src/v2/methods/search.ts
CHANGED
|
@@ -37,6 +37,7 @@ function prepareSearchPayload(req: SearchRequest): Record<string, unknown> {
|
|
|
37
37
|
if (req.ignoreInvalidURLs != null)
|
|
38
38
|
payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
39
39
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
40
|
+
if (req.highlights != null) payload.highlights = req.highlights;
|
|
40
41
|
if (req.integration && req.integration.trim())
|
|
41
42
|
payload.integration = req.integration.trim();
|
|
42
43
|
if (req.origin) payload.origin = req.origin;
|
package/src/v2/types.ts
CHANGED
|
@@ -697,6 +697,8 @@ export interface SearchRequest {
|
|
|
697
697
|
location?: string;
|
|
698
698
|
ignoreInvalidURLs?: boolean;
|
|
699
699
|
timeout?: number; // ms
|
|
700
|
+
/** Generate query-relevant highlights for search results. Defaults to true. */
|
|
701
|
+
highlights?: boolean;
|
|
700
702
|
scrapeOptions?: ScrapeOptions;
|
|
701
703
|
/**
|
|
702
704
|
* Enterprise search options. Use `["zdr"]` for end-to-end Zero Data
|