@mendable/firecrawl-js 4.15.1 → 4.15.2
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-6GGUNT5D.js → chunk-YCZ3SV75.js} +1 -1
- package/dist/index.cjs +10 -2
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +11 -3
- package/dist/{package-QEFINGBK.js → package-WNYVARF4.js} +1 -1
- package/package.json +1 -1
- package/src/v2/methods/agent.ts +2 -0
- package/src/v2/methods/batch.ts +2 -0
- package/src/v2/methods/browser.ts +2 -0
- package/src/v2/methods/crawl.ts +1 -0
- package/src/v2/methods/extract.ts +2 -0
- package/src/v2/methods/map.ts +1 -0
- package/src/v2/methods/search.ts +1 -0
- package/src/v2/types.ts +5 -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.15.
|
|
11
|
+
version: "4.15.2",
|
|
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.15.
|
|
38
|
+
version: "4.15.2",
|
|
39
39
|
description: "JavaScript SDK for Firecrawl API",
|
|
40
40
|
main: "dist/index.js",
|
|
41
41
|
types: "dist/index.d.ts",
|
|
@@ -424,6 +424,7 @@ function prepareSearchPayload(req) {
|
|
|
424
424
|
if (req.ignoreInvalidURLs != null) payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
425
425
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
426
426
|
if (req.integration && req.integration.trim()) payload.integration = req.integration.trim();
|
|
427
|
+
if (req.origin) payload.origin = req.origin;
|
|
427
428
|
if (req.scrapeOptions) {
|
|
428
429
|
ensureValidScrapeOptions(req.scrapeOptions);
|
|
429
430
|
payload.scrapeOptions = req.scrapeOptions;
|
|
@@ -476,6 +477,7 @@ function prepareMapPayload(url, options) {
|
|
|
476
477
|
if (options.limit != null) payload.limit = options.limit;
|
|
477
478
|
if (options.timeout != null) payload.timeout = options.timeout;
|
|
478
479
|
if (options.integration != null && options.integration.trim()) payload.integration = options.integration.trim();
|
|
480
|
+
if (options.origin) payload.origin = options.origin;
|
|
479
481
|
if (options.location != null) payload.location = options.location;
|
|
480
482
|
}
|
|
481
483
|
return payload;
|
|
@@ -551,6 +553,7 @@ function prepareCrawlPayload(request) {
|
|
|
551
553
|
if (request.regexOnFullURL != null) data.regexOnFullURL = request.regexOnFullURL;
|
|
552
554
|
if (request.webhook != null) data.webhook = request.webhook;
|
|
553
555
|
if (request.integration != null && request.integration.trim()) data.integration = request.integration.trim();
|
|
556
|
+
if (request.origin) data.origin = request.origin;
|
|
554
557
|
if (request.scrapeOptions) {
|
|
555
558
|
ensureValidScrapeOptions(request.scrapeOptions);
|
|
556
559
|
data.scrapeOptions = request.scrapeOptions;
|
|
@@ -698,7 +701,8 @@ async function startBatchScrape(http, urls, {
|
|
|
698
701
|
maxConcurrency,
|
|
699
702
|
zeroDataRetention,
|
|
700
703
|
idempotencyKey,
|
|
701
|
-
integration
|
|
704
|
+
integration,
|
|
705
|
+
origin
|
|
702
706
|
} = {}) {
|
|
703
707
|
if (!Array.isArray(urls) || urls.length === 0) throw new Error("URLs list cannot be empty");
|
|
704
708
|
const payload = { urls };
|
|
@@ -712,6 +716,7 @@ async function startBatchScrape(http, urls, {
|
|
|
712
716
|
if (maxConcurrency != null) payload.maxConcurrency = maxConcurrency;
|
|
713
717
|
if (zeroDataRetention != null) payload.zeroDataRetention = zeroDataRetention;
|
|
714
718
|
if (integration != null && integration.trim()) payload.integration = integration.trim();
|
|
719
|
+
if (origin) payload.origin = origin;
|
|
715
720
|
try {
|
|
716
721
|
const headers = http.prepareHeaders(idempotencyKey);
|
|
717
722
|
const res = await http.post("/v2/batch/scrape", payload, headers);
|
|
@@ -826,6 +831,7 @@ function prepareExtractPayload(args) {
|
|
|
826
831
|
if (args.showSources != null) body.showSources = args.showSources;
|
|
827
832
|
if (args.ignoreInvalidURLs != null) body.ignoreInvalidURLs = args.ignoreInvalidURLs;
|
|
828
833
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
834
|
+
if (args.origin) body.origin = args.origin;
|
|
829
835
|
if (args.agent) body.agent = args.agent;
|
|
830
836
|
if (args.scrapeOptions) {
|
|
831
837
|
ensureValidScrapeOptions(args.scrapeOptions);
|
|
@@ -879,6 +885,7 @@ function prepareAgentPayload(args) {
|
|
|
879
885
|
body.schema = isZodSchema(args.schema) ? zodSchemaToJsonSchema(args.schema) : args.schema;
|
|
880
886
|
}
|
|
881
887
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
888
|
+
if (args.origin) body.origin = args.origin;
|
|
882
889
|
if (args.maxCredits !== null && args.maxCredits !== void 0) body.maxCredits = args.maxCredits;
|
|
883
890
|
if (args.strictConstrainToURLs !== null && args.strictConstrainToURLs !== void 0) body.strictConstrainToURLs = args.strictConstrainToURLs;
|
|
884
891
|
if (args.model !== null && args.model !== void 0) body.model = args.model;
|
|
@@ -940,6 +947,7 @@ async function browser(http, args = {}) {
|
|
|
940
947
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
941
948
|
if (args.profile != null) body.profile = args.profile;
|
|
942
949
|
if (args.integration != null) body.integration = args.integration;
|
|
950
|
+
if (args.origin) body.origin = args.origin;
|
|
943
951
|
try {
|
|
944
952
|
const res = await http.post("/v2/browser", body);
|
|
945
953
|
if (res.status !== 200) throwForBadResponse(res, "create browser session");
|
package/dist/index.d.cts
CHANGED
|
@@ -116,6 +116,7 @@ interface ScrapeOptions {
|
|
|
116
116
|
minAge?: number;
|
|
117
117
|
storeInCache?: boolean;
|
|
118
118
|
integration?: string;
|
|
119
|
+
origin?: string;
|
|
119
120
|
}
|
|
120
121
|
interface WebhookConfig {
|
|
121
122
|
url: string;
|
|
@@ -375,6 +376,7 @@ interface SearchRequest {
|
|
|
375
376
|
timeout?: number;
|
|
376
377
|
scrapeOptions?: ScrapeOptions;
|
|
377
378
|
integration?: string;
|
|
379
|
+
origin?: string;
|
|
378
380
|
}
|
|
379
381
|
interface CrawlOptions {
|
|
380
382
|
prompt?: string | null;
|
|
@@ -395,6 +397,7 @@ interface CrawlOptions {
|
|
|
395
397
|
regexOnFullURL?: boolean;
|
|
396
398
|
zeroDataRetention?: boolean;
|
|
397
399
|
integration?: string;
|
|
400
|
+
origin?: string;
|
|
398
401
|
}
|
|
399
402
|
interface CrawlResponse$1 {
|
|
400
403
|
id: string;
|
|
@@ -419,6 +422,7 @@ interface BatchScrapeOptions {
|
|
|
419
422
|
zeroDataRetention?: boolean;
|
|
420
423
|
idempotencyKey?: string;
|
|
421
424
|
integration?: string;
|
|
425
|
+
origin?: string;
|
|
422
426
|
}
|
|
423
427
|
interface BatchScrapeResponse$1 {
|
|
424
428
|
id: string;
|
|
@@ -446,6 +450,7 @@ interface MapOptions {
|
|
|
446
450
|
limit?: number;
|
|
447
451
|
timeout?: number;
|
|
448
452
|
integration?: string;
|
|
453
|
+
origin?: string;
|
|
449
454
|
location?: LocationConfig$1;
|
|
450
455
|
}
|
|
451
456
|
interface ExtractResponse$1 {
|
|
@@ -630,6 +635,7 @@ declare function prepareExtractPayload(args: {
|
|
|
630
635
|
scrapeOptions?: ScrapeOptions;
|
|
631
636
|
ignoreInvalidURLs?: boolean;
|
|
632
637
|
integration?: string;
|
|
638
|
+
origin?: string;
|
|
633
639
|
agent?: AgentOptions$1;
|
|
634
640
|
}): Record<string, unknown>;
|
|
635
641
|
/**
|
|
@@ -643,6 +649,7 @@ declare function prepareAgentPayload(args: {
|
|
|
643
649
|
prompt: string;
|
|
644
650
|
schema?: Record<string, unknown> | ZodTypeAny;
|
|
645
651
|
integration?: string;
|
|
652
|
+
origin?: string;
|
|
646
653
|
maxCredits?: number;
|
|
647
654
|
strictConstrainToURLs?: boolean;
|
|
648
655
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
@@ -659,6 +666,7 @@ declare function browser(http: HttpClient, args?: {
|
|
|
659
666
|
saveChanges?: boolean;
|
|
660
667
|
};
|
|
661
668
|
integration?: string;
|
|
669
|
+
origin?: string;
|
|
662
670
|
}): Promise<BrowserCreateResponse>;
|
|
663
671
|
declare function browserExecute(http: HttpClient, sessionId: string, args: {
|
|
664
672
|
code: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -116,6 +116,7 @@ interface ScrapeOptions {
|
|
|
116
116
|
minAge?: number;
|
|
117
117
|
storeInCache?: boolean;
|
|
118
118
|
integration?: string;
|
|
119
|
+
origin?: string;
|
|
119
120
|
}
|
|
120
121
|
interface WebhookConfig {
|
|
121
122
|
url: string;
|
|
@@ -375,6 +376,7 @@ interface SearchRequest {
|
|
|
375
376
|
timeout?: number;
|
|
376
377
|
scrapeOptions?: ScrapeOptions;
|
|
377
378
|
integration?: string;
|
|
379
|
+
origin?: string;
|
|
378
380
|
}
|
|
379
381
|
interface CrawlOptions {
|
|
380
382
|
prompt?: string | null;
|
|
@@ -395,6 +397,7 @@ interface CrawlOptions {
|
|
|
395
397
|
regexOnFullURL?: boolean;
|
|
396
398
|
zeroDataRetention?: boolean;
|
|
397
399
|
integration?: string;
|
|
400
|
+
origin?: string;
|
|
398
401
|
}
|
|
399
402
|
interface CrawlResponse$1 {
|
|
400
403
|
id: string;
|
|
@@ -419,6 +422,7 @@ interface BatchScrapeOptions {
|
|
|
419
422
|
zeroDataRetention?: boolean;
|
|
420
423
|
idempotencyKey?: string;
|
|
421
424
|
integration?: string;
|
|
425
|
+
origin?: string;
|
|
422
426
|
}
|
|
423
427
|
interface BatchScrapeResponse$1 {
|
|
424
428
|
id: string;
|
|
@@ -446,6 +450,7 @@ interface MapOptions {
|
|
|
446
450
|
limit?: number;
|
|
447
451
|
timeout?: number;
|
|
448
452
|
integration?: string;
|
|
453
|
+
origin?: string;
|
|
449
454
|
location?: LocationConfig$1;
|
|
450
455
|
}
|
|
451
456
|
interface ExtractResponse$1 {
|
|
@@ -630,6 +635,7 @@ declare function prepareExtractPayload(args: {
|
|
|
630
635
|
scrapeOptions?: ScrapeOptions;
|
|
631
636
|
ignoreInvalidURLs?: boolean;
|
|
632
637
|
integration?: string;
|
|
638
|
+
origin?: string;
|
|
633
639
|
agent?: AgentOptions$1;
|
|
634
640
|
}): Record<string, unknown>;
|
|
635
641
|
/**
|
|
@@ -643,6 +649,7 @@ declare function prepareAgentPayload(args: {
|
|
|
643
649
|
prompt: string;
|
|
644
650
|
schema?: Record<string, unknown> | ZodTypeAny;
|
|
645
651
|
integration?: string;
|
|
652
|
+
origin?: string;
|
|
646
653
|
maxCredits?: number;
|
|
647
654
|
strictConstrainToURLs?: boolean;
|
|
648
655
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
@@ -659,6 +666,7 @@ declare function browser(http: HttpClient, args?: {
|
|
|
659
666
|
saveChanges?: boolean;
|
|
660
667
|
};
|
|
661
668
|
integration?: string;
|
|
669
|
+
origin?: string;
|
|
662
670
|
}): Promise<BrowserCreateResponse>;
|
|
663
671
|
declare function browserExecute(http: HttpClient, sessionId: string, args: {
|
|
664
672
|
code: string;
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
require_package
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YCZ3SV75.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -306,6 +306,7 @@ function prepareSearchPayload(req) {
|
|
|
306
306
|
if (req.ignoreInvalidURLs != null) payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
307
307
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
308
308
|
if (req.integration && req.integration.trim()) payload.integration = req.integration.trim();
|
|
309
|
+
if (req.origin) payload.origin = req.origin;
|
|
309
310
|
if (req.scrapeOptions) {
|
|
310
311
|
ensureValidScrapeOptions(req.scrapeOptions);
|
|
311
312
|
payload.scrapeOptions = req.scrapeOptions;
|
|
@@ -358,6 +359,7 @@ function prepareMapPayload(url, options) {
|
|
|
358
359
|
if (options.limit != null) payload.limit = options.limit;
|
|
359
360
|
if (options.timeout != null) payload.timeout = options.timeout;
|
|
360
361
|
if (options.integration != null && options.integration.trim()) payload.integration = options.integration.trim();
|
|
362
|
+
if (options.origin) payload.origin = options.origin;
|
|
361
363
|
if (options.location != null) payload.location = options.location;
|
|
362
364
|
}
|
|
363
365
|
return payload;
|
|
@@ -433,6 +435,7 @@ function prepareCrawlPayload(request) {
|
|
|
433
435
|
if (request.regexOnFullURL != null) data.regexOnFullURL = request.regexOnFullURL;
|
|
434
436
|
if (request.webhook != null) data.webhook = request.webhook;
|
|
435
437
|
if (request.integration != null && request.integration.trim()) data.integration = request.integration.trim();
|
|
438
|
+
if (request.origin) data.origin = request.origin;
|
|
436
439
|
if (request.scrapeOptions) {
|
|
437
440
|
ensureValidScrapeOptions(request.scrapeOptions);
|
|
438
441
|
data.scrapeOptions = request.scrapeOptions;
|
|
@@ -580,7 +583,8 @@ async function startBatchScrape(http, urls, {
|
|
|
580
583
|
maxConcurrency,
|
|
581
584
|
zeroDataRetention,
|
|
582
585
|
idempotencyKey,
|
|
583
|
-
integration
|
|
586
|
+
integration,
|
|
587
|
+
origin
|
|
584
588
|
} = {}) {
|
|
585
589
|
if (!Array.isArray(urls) || urls.length === 0) throw new Error("URLs list cannot be empty");
|
|
586
590
|
const payload = { urls };
|
|
@@ -594,6 +598,7 @@ async function startBatchScrape(http, urls, {
|
|
|
594
598
|
if (maxConcurrency != null) payload.maxConcurrency = maxConcurrency;
|
|
595
599
|
if (zeroDataRetention != null) payload.zeroDataRetention = zeroDataRetention;
|
|
596
600
|
if (integration != null && integration.trim()) payload.integration = integration.trim();
|
|
601
|
+
if (origin) payload.origin = origin;
|
|
597
602
|
try {
|
|
598
603
|
const headers = http.prepareHeaders(idempotencyKey);
|
|
599
604
|
const res = await http.post("/v2/batch/scrape", payload, headers);
|
|
@@ -708,6 +713,7 @@ function prepareExtractPayload(args) {
|
|
|
708
713
|
if (args.showSources != null) body.showSources = args.showSources;
|
|
709
714
|
if (args.ignoreInvalidURLs != null) body.ignoreInvalidURLs = args.ignoreInvalidURLs;
|
|
710
715
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
716
|
+
if (args.origin) body.origin = args.origin;
|
|
711
717
|
if (args.agent) body.agent = args.agent;
|
|
712
718
|
if (args.scrapeOptions) {
|
|
713
719
|
ensureValidScrapeOptions(args.scrapeOptions);
|
|
@@ -761,6 +767,7 @@ function prepareAgentPayload(args) {
|
|
|
761
767
|
body.schema = isZodSchema(args.schema) ? zodSchemaToJsonSchema(args.schema) : args.schema;
|
|
762
768
|
}
|
|
763
769
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
770
|
+
if (args.origin) body.origin = args.origin;
|
|
764
771
|
if (args.maxCredits !== null && args.maxCredits !== void 0) body.maxCredits = args.maxCredits;
|
|
765
772
|
if (args.strictConstrainToURLs !== null && args.strictConstrainToURLs !== void 0) body.strictConstrainToURLs = args.strictConstrainToURLs;
|
|
766
773
|
if (args.model !== null && args.model !== void 0) body.model = args.model;
|
|
@@ -822,6 +829,7 @@ async function browser(http, args = {}) {
|
|
|
822
829
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
823
830
|
if (args.profile != null) body.profile = args.profile;
|
|
824
831
|
if (args.integration != null) body.integration = args.integration;
|
|
832
|
+
if (args.origin) body.origin = args.origin;
|
|
825
833
|
try {
|
|
826
834
|
const res = await http.post("/v2/browser", body);
|
|
827
835
|
if (res.status !== 200) throwForBadResponse(res, "create browser session");
|
|
@@ -1475,7 +1483,7 @@ var FirecrawlApp = class {
|
|
|
1475
1483
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
1476
1484
|
return process.env.npm_package_version;
|
|
1477
1485
|
}
|
|
1478
|
-
const packageJson = await import("./package-
|
|
1486
|
+
const packageJson = await import("./package-WNYVARF4.js");
|
|
1479
1487
|
return packageJson.default.version;
|
|
1480
1488
|
} catch (error) {
|
|
1481
1489
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
package/package.json
CHANGED
package/src/v2/methods/agent.ts
CHANGED
|
@@ -9,6 +9,7 @@ function prepareAgentPayload(args: {
|
|
|
9
9
|
prompt: string;
|
|
10
10
|
schema?: Record<string, unknown> | ZodTypeAny;
|
|
11
11
|
integration?: string;
|
|
12
|
+
origin?: string;
|
|
12
13
|
maxCredits?: number;
|
|
13
14
|
strictConstrainToURLs?: boolean;
|
|
14
15
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
@@ -21,6 +22,7 @@ function prepareAgentPayload(args: {
|
|
|
21
22
|
body.schema = isZodSchema(args.schema) ? zodSchemaToJsonSchema(args.schema) : args.schema;
|
|
22
23
|
}
|
|
23
24
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
25
|
+
if (args.origin) body.origin = args.origin;
|
|
24
26
|
if (args.maxCredits !== null && args.maxCredits !== undefined) body.maxCredits = args.maxCredits;
|
|
25
27
|
if (args.strictConstrainToURLs !== null && args.strictConstrainToURLs !== undefined) body.strictConstrainToURLs = args.strictConstrainToURLs;
|
|
26
28
|
if (args.model !== null && args.model !== undefined) body.model = args.model;
|
package/src/v2/methods/batch.ts
CHANGED
|
@@ -25,6 +25,7 @@ export async function startBatchScrape(
|
|
|
25
25
|
zeroDataRetention,
|
|
26
26
|
idempotencyKey,
|
|
27
27
|
integration,
|
|
28
|
+
origin,
|
|
28
29
|
}: BatchScrapeOptions = {}
|
|
29
30
|
): Promise<BatchScrapeResponse> {
|
|
30
31
|
if (!Array.isArray(urls) || urls.length === 0) throw new Error("URLs list cannot be empty");
|
|
@@ -39,6 +40,7 @@ export async function startBatchScrape(
|
|
|
39
40
|
if (maxConcurrency != null) payload.maxConcurrency = maxConcurrency;
|
|
40
41
|
if (zeroDataRetention != null) payload.zeroDataRetention = zeroDataRetention;
|
|
41
42
|
if (integration != null && integration.trim()) payload.integration = integration.trim();
|
|
43
|
+
if (origin) payload.origin = origin;
|
|
42
44
|
|
|
43
45
|
try {
|
|
44
46
|
const headers = http.prepareHeaders(idempotencyKey);
|
|
@@ -18,6 +18,7 @@ export async function browser(
|
|
|
18
18
|
saveChanges?: boolean;
|
|
19
19
|
};
|
|
20
20
|
integration?: string;
|
|
21
|
+
origin?: string;
|
|
21
22
|
} = {}
|
|
22
23
|
): Promise<BrowserCreateResponse> {
|
|
23
24
|
const body: Record<string, unknown> = {};
|
|
@@ -26,6 +27,7 @@ export async function browser(
|
|
|
26
27
|
if (args.streamWebView != null) body.streamWebView = args.streamWebView;
|
|
27
28
|
if (args.profile != null) body.profile = args.profile;
|
|
28
29
|
if (args.integration != null) body.integration = args.integration;
|
|
30
|
+
if (args.origin) body.origin = args.origin;
|
|
29
31
|
|
|
30
32
|
try {
|
|
31
33
|
const res = await http.post<BrowserCreateResponse>("/v2/browser", body);
|
package/src/v2/methods/crawl.ts
CHANGED
|
@@ -38,6 +38,7 @@ function prepareCrawlPayload(request: CrawlRequest): Record<string, unknown> {
|
|
|
38
38
|
if (request.regexOnFullURL != null) data.regexOnFullURL = request.regexOnFullURL;
|
|
39
39
|
if (request.webhook != null) data.webhook = request.webhook;
|
|
40
40
|
if (request.integration != null && request.integration.trim()) data.integration = request.integration.trim();
|
|
41
|
+
if (request.origin) data.origin = request.origin;
|
|
41
42
|
if (request.scrapeOptions) {
|
|
42
43
|
ensureValidScrapeOptions(request.scrapeOptions);
|
|
43
44
|
data.scrapeOptions = request.scrapeOptions;
|
|
@@ -16,6 +16,7 @@ function prepareExtractPayload(args: {
|
|
|
16
16
|
scrapeOptions?: ScrapeOptions;
|
|
17
17
|
ignoreInvalidURLs?: boolean;
|
|
18
18
|
integration?: string;
|
|
19
|
+
origin?: string;
|
|
19
20
|
agent?: AgentOptions;
|
|
20
21
|
}): Record<string, unknown> {
|
|
21
22
|
const body: Record<string, unknown> = {};
|
|
@@ -30,6 +31,7 @@ function prepareExtractPayload(args: {
|
|
|
30
31
|
if (args.showSources != null) body.showSources = args.showSources;
|
|
31
32
|
if (args.ignoreInvalidURLs != null) body.ignoreInvalidURLs = args.ignoreInvalidURLs;
|
|
32
33
|
if (args.integration && args.integration.trim()) body.integration = args.integration.trim();
|
|
34
|
+
if (args.origin) body.origin = args.origin;
|
|
33
35
|
if (args.agent) body.agent = args.agent;
|
|
34
36
|
if (args.scrapeOptions) {
|
|
35
37
|
ensureValidScrapeOptions(args.scrapeOptions);
|
package/src/v2/methods/map.ts
CHANGED
|
@@ -13,6 +13,7 @@ function prepareMapPayload(url: string, options?: MapOptions): Record<string, un
|
|
|
13
13
|
if (options.limit != null) payload.limit = options.limit;
|
|
14
14
|
if (options.timeout != null) payload.timeout = options.timeout;
|
|
15
15
|
if (options.integration != null && options.integration.trim()) payload.integration = options.integration.trim();
|
|
16
|
+
if (options.origin) payload.origin = options.origin;
|
|
16
17
|
if (options.location != null) payload.location = options.location;
|
|
17
18
|
}
|
|
18
19
|
return payload;
|
package/src/v2/methods/search.ts
CHANGED
|
@@ -18,6 +18,7 @@ function prepareSearchPayload(req: SearchRequest): Record<string, unknown> {
|
|
|
18
18
|
if (req.ignoreInvalidURLs != null) payload.ignoreInvalidURLs = req.ignoreInvalidURLs;
|
|
19
19
|
if (req.timeout != null) payload.timeout = req.timeout;
|
|
20
20
|
if (req.integration && req.integration.trim()) payload.integration = req.integration.trim();
|
|
21
|
+
if (req.origin) payload.origin = req.origin;
|
|
21
22
|
if (req.scrapeOptions) {
|
|
22
23
|
ensureValidScrapeOptions(req.scrapeOptions as ScrapeOptions);
|
|
23
24
|
payload.scrapeOptions = req.scrapeOptions;
|
package/src/v2/types.ts
CHANGED
|
@@ -158,6 +158,7 @@ export interface ScrapeOptions {
|
|
|
158
158
|
minAge?: number;
|
|
159
159
|
storeInCache?: boolean;
|
|
160
160
|
integration?: string;
|
|
161
|
+
origin?: string;
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
export interface WebhookConfig {
|
|
@@ -453,6 +454,7 @@ export interface SearchRequest {
|
|
|
453
454
|
timeout?: number; // ms
|
|
454
455
|
scrapeOptions?: ScrapeOptions;
|
|
455
456
|
integration?: string;
|
|
457
|
+
origin?: string;
|
|
456
458
|
}
|
|
457
459
|
|
|
458
460
|
export interface CrawlOptions {
|
|
@@ -474,6 +476,7 @@ export interface CrawlOptions {
|
|
|
474
476
|
regexOnFullURL?: boolean;
|
|
475
477
|
zeroDataRetention?: boolean;
|
|
476
478
|
integration?: string;
|
|
479
|
+
origin?: string;
|
|
477
480
|
}
|
|
478
481
|
|
|
479
482
|
export interface CrawlResponse {
|
|
@@ -501,6 +504,7 @@ export interface BatchScrapeOptions {
|
|
|
501
504
|
zeroDataRetention?: boolean;
|
|
502
505
|
idempotencyKey?: string;
|
|
503
506
|
integration?: string;
|
|
507
|
+
origin?: string;
|
|
504
508
|
}
|
|
505
509
|
|
|
506
510
|
export interface BatchScrapeResponse {
|
|
@@ -532,6 +536,7 @@ export interface MapOptions {
|
|
|
532
536
|
limit?: number;
|
|
533
537
|
timeout?: number;
|
|
534
538
|
integration?: string;
|
|
539
|
+
origin?: string;
|
|
535
540
|
location?: LocationConfig;
|
|
536
541
|
}
|
|
537
542
|
|