@mendable/firecrawl-js 4.31.0 → 4.32.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.
- package/dist/{chunk-PSTSUWZW.js → chunk-DBXKWZGC.js} +1 -17
- package/dist/index.cjs +5 -17
- package/dist/index.d.cts +16 -8
- package/dist/index.d.ts +16 -8
- package/dist/index.js +6 -2
- package/dist/{package-Q3WPQZ6Q.js → package-L37ZVTF4.js} +1 -1
- package/package.json +1 -1
- package/pnpm-workspace.yaml +13 -0
- package/src/__tests__/unit/v2/audit-metadata.unit.test.ts +1 -1
- package/src/__tests__/unit/v2/search-developer.unit.test.ts +65 -0
- package/src/v1/index.ts +6 -2
- package/src/v2/methods/agent.ts +2 -2
- package/src/v2/methods/search.ts +4 -0
- package/src/v2/types.ts +12 -4
|
@@ -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.
|
|
15
|
+
version: "4.32.0",
|
|
16
16
|
description: "JavaScript SDK for Firecrawl API",
|
|
17
17
|
main: "dist/index.js",
|
|
18
18
|
types: "dist/index.d.ts",
|
|
@@ -73,22 +73,6 @@ var require_package = __commonJS({
|
|
|
73
73
|
],
|
|
74
74
|
engines: {
|
|
75
75
|
node: ">=22.0.0"
|
|
76
|
-
},
|
|
77
|
-
pnpm: {
|
|
78
|
-
overrides: {
|
|
79
|
-
"@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
|
|
80
|
-
"minimatch@<10.2.3": ">=10.2.3",
|
|
81
|
-
"rollup@<4.59.0": ">=4.59.0",
|
|
82
|
-
"picomatch@<4.0.4": ">=4.0.4",
|
|
83
|
-
handlebars: ">=4.7.9",
|
|
84
|
-
"brace-expansion@>=5.0.0 <5.0.7": "5.0.7",
|
|
85
|
-
"js-yaml@>=3.0.0 <3.15.0": "3.15.0",
|
|
86
|
-
"axios@>=1.0.0 <1.16.0": "1.16.1",
|
|
87
|
-
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0",
|
|
88
|
-
"form-data@>=4.0.0 <4.0.6": "4.0.6",
|
|
89
|
-
"@babel/core@>=7.0.0 <7.29.6": "7.29.7",
|
|
90
|
-
"esbuild@>=0.17.0 <0.28.1": "0.28.1"
|
|
91
|
-
}
|
|
92
76
|
}
|
|
93
77
|
};
|
|
94
78
|
}
|
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.
|
|
42
|
+
version: "4.32.0",
|
|
43
43
|
description: "JavaScript SDK for Firecrawl API",
|
|
44
44
|
main: "dist/index.js",
|
|
45
45
|
types: "dist/index.d.ts",
|
|
@@ -100,22 +100,6 @@ var require_package = __commonJS({
|
|
|
100
100
|
],
|
|
101
101
|
engines: {
|
|
102
102
|
node: ">=22.0.0"
|
|
103
|
-
},
|
|
104
|
-
pnpm: {
|
|
105
|
-
overrides: {
|
|
106
|
-
"@isaacs/brace-expansion@<=5.0.0": ">=5.0.1",
|
|
107
|
-
"minimatch@<10.2.3": ">=10.2.3",
|
|
108
|
-
"rollup@<4.59.0": ">=4.59.0",
|
|
109
|
-
"picomatch@<4.0.4": ">=4.0.4",
|
|
110
|
-
handlebars: ">=4.7.9",
|
|
111
|
-
"brace-expansion@>=5.0.0 <5.0.7": "5.0.7",
|
|
112
|
-
"js-yaml@>=3.0.0 <3.15.0": "3.15.0",
|
|
113
|
-
"axios@>=1.0.0 <1.16.0": "1.16.1",
|
|
114
|
-
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0",
|
|
115
|
-
"form-data@>=4.0.0 <4.0.6": "4.0.6",
|
|
116
|
-
"@babel/core@>=7.0.0 <7.29.6": "7.29.7",
|
|
117
|
-
"esbuild@>=0.17.0 <0.28.1": "0.28.1"
|
|
118
|
-
}
|
|
119
103
|
}
|
|
120
104
|
};
|
|
121
105
|
}
|
|
@@ -762,12 +746,16 @@ async function search(http, request) {
|
|
|
762
746
|
if (data.news) out.news = transformArray(data.news);
|
|
763
747
|
if (data.images)
|
|
764
748
|
out.images = transformArray(data.images);
|
|
749
|
+
if (data.developer)
|
|
750
|
+
out.developer = transformArray(data.developer);
|
|
765
751
|
Object.defineProperty(out, "data", {
|
|
766
752
|
get() {
|
|
767
753
|
const parts = [];
|
|
768
754
|
if (out.web?.length) parts.push(`.web (${out.web.length} results)`);
|
|
769
755
|
if (out.news?.length) parts.push(`.news (${out.news.length} results)`);
|
|
770
756
|
if (out.images?.length) parts.push(`.images (${out.images.length} results)`);
|
|
757
|
+
if (out.developer?.length)
|
|
758
|
+
parts.push(`.developer (${out.developer.length} results)`);
|
|
771
759
|
const available = parts.length ? parts.join(", ") : ".web, .news, or .images";
|
|
772
760
|
throw new Error(
|
|
773
761
|
`SearchData has no '.data'. Results are grouped by source: ${available}`
|
package/dist/index.d.cts
CHANGED
|
@@ -114,6 +114,9 @@ interface PDFAction {
|
|
|
114
114
|
scale?: number;
|
|
115
115
|
}
|
|
116
116
|
type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction | PressAction | ScrollAction | ScrapeAction | ExecuteJavascriptAction | PDFAction;
|
|
117
|
+
interface AuditMetadata$1 {
|
|
118
|
+
username: string;
|
|
119
|
+
}
|
|
117
120
|
interface ScrapeOptions {
|
|
118
121
|
formats?: FormatOption[];
|
|
119
122
|
headers?: Record<string, string>;
|
|
@@ -142,7 +145,7 @@ interface ScrapeOptions {
|
|
|
142
145
|
lockdown?: boolean;
|
|
143
146
|
redactPII?: boolean | RedactPIIOptions;
|
|
144
147
|
threatProtection?: ThreatProtectionOptions;
|
|
145
|
-
auditMetadata?:
|
|
148
|
+
auditMetadata?: AuditMetadata$1;
|
|
146
149
|
profile?: {
|
|
147
150
|
name: string;
|
|
148
151
|
saveChanges?: boolean;
|
|
@@ -505,6 +508,7 @@ interface SearchResultWeb {
|
|
|
505
508
|
url: string;
|
|
506
509
|
title?: string;
|
|
507
510
|
description?: string;
|
|
511
|
+
position?: number;
|
|
508
512
|
category?: string;
|
|
509
513
|
}
|
|
510
514
|
interface SearchResultNews {
|
|
@@ -528,16 +532,17 @@ interface SearchData {
|
|
|
528
532
|
web?: Array<SearchResultWeb | Document>;
|
|
529
533
|
news?: Array<SearchResultNews | Document>;
|
|
530
534
|
images?: Array<SearchResultImages | Document>;
|
|
535
|
+
developer?: Array<SearchResultWeb | Document>;
|
|
531
536
|
}
|
|
532
537
|
interface CategoryOption {
|
|
533
|
-
type: "github" | "research" | "pdf";
|
|
538
|
+
type: "github" | "research" | "pdf" | "developer";
|
|
534
539
|
}
|
|
535
540
|
interface SearchRequest {
|
|
536
541
|
query: string;
|
|
537
542
|
sources?: Array<"web" | "news" | "images" | {
|
|
538
543
|
type: "web" | "news" | "images";
|
|
539
544
|
}>;
|
|
540
|
-
categories?: Array<"github" | "research" | "pdf" | CategoryOption>;
|
|
545
|
+
categories?: Array<"github" | "research" | "pdf" | "developer" | CategoryOption>;
|
|
541
546
|
includeDomains?: string[];
|
|
542
547
|
excludeDomains?: string[];
|
|
543
548
|
limit?: number;
|
|
@@ -636,7 +641,7 @@ interface MapOptions {
|
|
|
636
641
|
origin?: string;
|
|
637
642
|
location?: LocationConfig$1;
|
|
638
643
|
threatProtection?: ThreatProtectionOptions;
|
|
639
|
-
auditMetadata?:
|
|
644
|
+
auditMetadata?: AuditMetadata$1;
|
|
640
645
|
}
|
|
641
646
|
type FeedbackRating = "good" | "partial" | "bad";
|
|
642
647
|
type EndpointFeedbackEndpoint = "search" | "scrape" | "parse" | "map";
|
|
@@ -1296,7 +1301,7 @@ declare function prepareAgentPayload(args: {
|
|
|
1296
1301
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
1297
1302
|
webhook?: string | AgentWebhookConfig;
|
|
1298
1303
|
threatProtection?: ThreatProtectionOptions;
|
|
1299
|
-
auditMetadata?:
|
|
1304
|
+
auditMetadata?: AuditMetadata$1;
|
|
1300
1305
|
}): Record<string, unknown>;
|
|
1301
1306
|
declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
|
|
1302
1307
|
|
|
@@ -1839,6 +1844,9 @@ interface LocationConfig {
|
|
|
1839
1844
|
country?: string;
|
|
1840
1845
|
languages?: string[];
|
|
1841
1846
|
}
|
|
1847
|
+
interface AuditMetadata {
|
|
1848
|
+
username: string;
|
|
1849
|
+
}
|
|
1842
1850
|
/**
|
|
1843
1851
|
* Parameters for scraping operations.
|
|
1844
1852
|
* Defines the options and configurations available for scraping web content.
|
|
@@ -1860,7 +1868,7 @@ interface CrawlScrapeOptions {
|
|
|
1860
1868
|
storeInCache?: boolean;
|
|
1861
1869
|
maxAge?: number;
|
|
1862
1870
|
parsePDF?: boolean;
|
|
1863
|
-
auditMetadata?:
|
|
1871
|
+
auditMetadata?: AuditMetadata;
|
|
1864
1872
|
}
|
|
1865
1873
|
type Action = {
|
|
1866
1874
|
type: "wait";
|
|
@@ -2026,7 +2034,7 @@ interface MapParams {
|
|
|
2026
2034
|
timeout?: number;
|
|
2027
2035
|
useIndex?: boolean;
|
|
2028
2036
|
location?: LocationConfig;
|
|
2029
|
-
auditMetadata?:
|
|
2037
|
+
auditMetadata?: AuditMetadata;
|
|
2030
2038
|
}
|
|
2031
2039
|
/**
|
|
2032
2040
|
* Response interface for mapping operations.
|
|
@@ -2661,4 +2669,4 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
2661
2669
|
get v1(): FirecrawlApp;
|
|
2662
2670
|
}
|
|
2663
2671
|
|
|
2664
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
2672
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -114,6 +114,9 @@ interface PDFAction {
|
|
|
114
114
|
scale?: number;
|
|
115
115
|
}
|
|
116
116
|
type ActionOption = WaitAction | ScreenshotAction | ClickAction | WriteAction | PressAction | ScrollAction | ScrapeAction | ExecuteJavascriptAction | PDFAction;
|
|
117
|
+
interface AuditMetadata$1 {
|
|
118
|
+
username: string;
|
|
119
|
+
}
|
|
117
120
|
interface ScrapeOptions {
|
|
118
121
|
formats?: FormatOption[];
|
|
119
122
|
headers?: Record<string, string>;
|
|
@@ -142,7 +145,7 @@ interface ScrapeOptions {
|
|
|
142
145
|
lockdown?: boolean;
|
|
143
146
|
redactPII?: boolean | RedactPIIOptions;
|
|
144
147
|
threatProtection?: ThreatProtectionOptions;
|
|
145
|
-
auditMetadata?:
|
|
148
|
+
auditMetadata?: AuditMetadata$1;
|
|
146
149
|
profile?: {
|
|
147
150
|
name: string;
|
|
148
151
|
saveChanges?: boolean;
|
|
@@ -505,6 +508,7 @@ interface SearchResultWeb {
|
|
|
505
508
|
url: string;
|
|
506
509
|
title?: string;
|
|
507
510
|
description?: string;
|
|
511
|
+
position?: number;
|
|
508
512
|
category?: string;
|
|
509
513
|
}
|
|
510
514
|
interface SearchResultNews {
|
|
@@ -528,16 +532,17 @@ interface SearchData {
|
|
|
528
532
|
web?: Array<SearchResultWeb | Document>;
|
|
529
533
|
news?: Array<SearchResultNews | Document>;
|
|
530
534
|
images?: Array<SearchResultImages | Document>;
|
|
535
|
+
developer?: Array<SearchResultWeb | Document>;
|
|
531
536
|
}
|
|
532
537
|
interface CategoryOption {
|
|
533
|
-
type: "github" | "research" | "pdf";
|
|
538
|
+
type: "github" | "research" | "pdf" | "developer";
|
|
534
539
|
}
|
|
535
540
|
interface SearchRequest {
|
|
536
541
|
query: string;
|
|
537
542
|
sources?: Array<"web" | "news" | "images" | {
|
|
538
543
|
type: "web" | "news" | "images";
|
|
539
544
|
}>;
|
|
540
|
-
categories?: Array<"github" | "research" | "pdf" | CategoryOption>;
|
|
545
|
+
categories?: Array<"github" | "research" | "pdf" | "developer" | CategoryOption>;
|
|
541
546
|
includeDomains?: string[];
|
|
542
547
|
excludeDomains?: string[];
|
|
543
548
|
limit?: number;
|
|
@@ -636,7 +641,7 @@ interface MapOptions {
|
|
|
636
641
|
origin?: string;
|
|
637
642
|
location?: LocationConfig$1;
|
|
638
643
|
threatProtection?: ThreatProtectionOptions;
|
|
639
|
-
auditMetadata?:
|
|
644
|
+
auditMetadata?: AuditMetadata$1;
|
|
640
645
|
}
|
|
641
646
|
type FeedbackRating = "good" | "partial" | "bad";
|
|
642
647
|
type EndpointFeedbackEndpoint = "search" | "scrape" | "parse" | "map";
|
|
@@ -1296,7 +1301,7 @@ declare function prepareAgentPayload(args: {
|
|
|
1296
1301
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
1297
1302
|
webhook?: string | AgentWebhookConfig;
|
|
1298
1303
|
threatProtection?: ThreatProtectionOptions;
|
|
1299
|
-
auditMetadata?:
|
|
1304
|
+
auditMetadata?: AuditMetadata$1;
|
|
1300
1305
|
}): Record<string, unknown>;
|
|
1301
1306
|
declare function startAgent(http: HttpClient, args: Parameters<typeof prepareAgentPayload>[0]): Promise<AgentResponse>;
|
|
1302
1307
|
|
|
@@ -1839,6 +1844,9 @@ interface LocationConfig {
|
|
|
1839
1844
|
country?: string;
|
|
1840
1845
|
languages?: string[];
|
|
1841
1846
|
}
|
|
1847
|
+
interface AuditMetadata {
|
|
1848
|
+
username: string;
|
|
1849
|
+
}
|
|
1842
1850
|
/**
|
|
1843
1851
|
* Parameters for scraping operations.
|
|
1844
1852
|
* Defines the options and configurations available for scraping web content.
|
|
@@ -1860,7 +1868,7 @@ interface CrawlScrapeOptions {
|
|
|
1860
1868
|
storeInCache?: boolean;
|
|
1861
1869
|
maxAge?: number;
|
|
1862
1870
|
parsePDF?: boolean;
|
|
1863
|
-
auditMetadata?:
|
|
1871
|
+
auditMetadata?: AuditMetadata;
|
|
1864
1872
|
}
|
|
1865
1873
|
type Action = {
|
|
1866
1874
|
type: "wait";
|
|
@@ -2026,7 +2034,7 @@ interface MapParams {
|
|
|
2026
2034
|
timeout?: number;
|
|
2027
2035
|
useIndex?: boolean;
|
|
2028
2036
|
location?: LocationConfig;
|
|
2029
|
-
auditMetadata?:
|
|
2037
|
+
auditMetadata?: AuditMetadata;
|
|
2030
2038
|
}
|
|
2031
2039
|
/**
|
|
2032
2040
|
* Response interface for mapping operations.
|
|
@@ -2661,4 +2669,4 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
2661
2669
|
get v1(): FirecrawlApp;
|
|
2662
2670
|
}
|
|
2663
2671
|
|
|
2664
|
-
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
2672
|
+
export { type ActionOption, type ActiveCrawl, type ActiveCrawlsResponse, type AgentOptions$1 as AgentOptions, type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AgentWebhookEvent, type AttributesFormat, type AuditMetadata$1 as AuditMetadata, type BatchScrapeJob, type BatchScrapeOptions, type BatchScrapeResponse$1 as BatchScrapeResponse, type BrandingProfile, type BrowserCreateResponse, type BrowserDeleteResponse, type BrowserExecuteResponse, type BrowserListResponse, type BrowserSession, type CategoryOption, type ChangeTrackingFormat, type ClickAction, type ConcurrencyCheck, type CrawlErrorsResponse$1 as CrawlErrorsResponse, type CrawlJob, type CrawlOptions, type CrawlResponse$1 as CrawlResponse, type CreateMonitorRequest, type CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type EndpointFeedbackEndpoint, type EndpointFeedbackRequest, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, type FeedbackMissingContent, type FeedbackRating, type FeedbackResponse, type FeedbackValuableSource, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientInput, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type GetPaperOptions, type GitHubScoreBreakdown, type GitHubSearchItem, type GitHubSearchResponse, type HighlightsFormat, type IdMap, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type MenuAvailability, type MenuImage, type MenuItem, type MenuItemIdentifiers, type MenuMerchant, type MenuPrice, type MenuProfile, type MenuSection, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorCrawlTargetResult, type MonitorEmailNotification, type MonitorEmailRecipientSubscription, type MonitorJsonFieldDiff, type MonitorNotification, type MonitorPageDiff, type MonitorPageJudgment, type MonitorPageSnapshot, type MonitorSchedule, type MonitorScrapeTarget, type MonitorScrapeTargetResult, type MonitorSearchTarget, type MonitorSearchTargetResult, type MonitorSummary, type MonitorTarget, type MonitorTargetResult, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type PaperMetadata, type PaperMetadataResponse, type PaperResult, type PaperSignals, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type Passage, type PressAction, type ProductAvailability, type ProductImage, type ProductPrice, type ProductProfile, type ProductSale, type ProductVariant, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ReadPaperResponse, type RedactPIIEntity, type RedactPIIOptions, ResearchClient, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchFeedbackRequest, type SearchGithubOptions, type SearchPapersOptions, type SearchPapersResponse, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type SimilarPapersOptions, type SimilarPapersResponse, type ThreatProtectionOptions, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, 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-DBXKWZGC.js";
|
|
4
4
|
|
|
5
5
|
// src/v2/utils/httpClient.ts
|
|
6
6
|
import axios from "axios";
|
|
@@ -629,12 +629,16 @@ async function search(http, request) {
|
|
|
629
629
|
if (data.news) out.news = transformArray(data.news);
|
|
630
630
|
if (data.images)
|
|
631
631
|
out.images = transformArray(data.images);
|
|
632
|
+
if (data.developer)
|
|
633
|
+
out.developer = transformArray(data.developer);
|
|
632
634
|
Object.defineProperty(out, "data", {
|
|
633
635
|
get() {
|
|
634
636
|
const parts = [];
|
|
635
637
|
if (out.web?.length) parts.push(`.web (${out.web.length} results)`);
|
|
636
638
|
if (out.news?.length) parts.push(`.news (${out.news.length} results)`);
|
|
637
639
|
if (out.images?.length) parts.push(`.images (${out.images.length} results)`);
|
|
640
|
+
if (out.developer?.length)
|
|
641
|
+
parts.push(`.developer (${out.developer.length} results)`);
|
|
638
642
|
const available = parts.length ? parts.join(", ") : ".web, .news, or .images";
|
|
639
643
|
throw new Error(
|
|
640
644
|
`SearchData has no '.data'. Results are grouped by source: ${available}`
|
|
@@ -2316,7 +2320,7 @@ var FirecrawlApp = class {
|
|
|
2316
2320
|
if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
|
|
2317
2321
|
return process.env.npm_package_version;
|
|
2318
2322
|
}
|
|
2319
|
-
const packageJson = await import("./package-
|
|
2323
|
+
const packageJson = await import("./package-L37ZVTF4.js");
|
|
2320
2324
|
return packageJson.default.version;
|
|
2321
2325
|
} catch (error) {
|
|
2322
2326
|
const isTest = typeof process !== "undefined" && (process.env.JEST_WORKER_ID != null || false);
|
package/package.json
CHANGED
package/pnpm-workspace.yaml
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
allowBuilds:
|
|
2
2
|
esbuild: true
|
|
3
3
|
unrs-resolver: true
|
|
4
|
+
overrides:
|
|
5
|
+
"@isaacs/brace-expansion@<=5.0.0": ">=5.0.1"
|
|
6
|
+
"minimatch@<10.2.3": ">=10.2.3"
|
|
7
|
+
"rollup@<4.59.0": ">=4.59.0"
|
|
8
|
+
"picomatch@<4.0.4": ">=4.0.4"
|
|
9
|
+
handlebars: ">=4.7.9"
|
|
10
|
+
"brace-expansion@>=5.0.0 <5.0.8": "5.0.8"
|
|
11
|
+
"js-yaml@>=3.0.0 <3.15.0": "3.15.0"
|
|
12
|
+
"axios@>=1.0.0 <1.16.0": "1.16.1"
|
|
13
|
+
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0"
|
|
14
|
+
"form-data@>=4.0.0 <4.0.6": "4.0.6"
|
|
15
|
+
"@babel/core@>=7.0.0 <7.29.6": "7.29.7"
|
|
16
|
+
"esbuild@>=0.17.0 <0.28.1": "0.28.1"
|
|
@@ -7,7 +7,7 @@ import { map } from "../../../v2/methods/map";
|
|
|
7
7
|
import { startExtract } from "../../../v2/methods/extract";
|
|
8
8
|
import { startAgent } from "../../../v2/methods/agent";
|
|
9
9
|
|
|
10
|
-
const auditMetadata = {
|
|
10
|
+
const auditMetadata = { username: "alice@example.com" };
|
|
11
11
|
|
|
12
12
|
function makeHttp(data: Record<string, unknown>) {
|
|
13
13
|
const post = jest.fn(async () => ({ status: 200, data }));
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { describe, expect, jest, test } from "@jest/globals";
|
|
2
|
+
import { search } from "../../../v2/methods/search";
|
|
3
|
+
|
|
4
|
+
const developerResult = {
|
|
5
|
+
title: "https://github.com/firecrawl/firecrawl/issues/1",
|
|
6
|
+
url: "https://github.com/firecrawl/firecrawl/issues/1",
|
|
7
|
+
description: "passage",
|
|
8
|
+
position: 1,
|
|
9
|
+
category: "developer",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
function httpWith(data: Record<string, unknown>) {
|
|
13
|
+
return {
|
|
14
|
+
post: jest.fn(async () => ({ status: 200, data: { success: true, data } })),
|
|
15
|
+
} as any;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe("v2 search developer category", () => {
|
|
19
|
+
test("forwards the developer category", async () => {
|
|
20
|
+
const http = httpWith({});
|
|
21
|
+
|
|
22
|
+
await search(http, { query: "firecrawl", categories: ["developer"] });
|
|
23
|
+
|
|
24
|
+
expect(http.post).toHaveBeenCalledWith(
|
|
25
|
+
"/v2/search",
|
|
26
|
+
{ query: "firecrawl", categories: ["developer"] },
|
|
27
|
+
{},
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test("returns developer results", async () => {
|
|
32
|
+
const http = httpWith({
|
|
33
|
+
web: [{ title: "W", url: "http://a.com" }],
|
|
34
|
+
developer: [developerResult],
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const result = await search(http, {
|
|
38
|
+
query: "firecrawl",
|
|
39
|
+
categories: [{ type: "developer" }],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
expect(result.web).toHaveLength(1);
|
|
43
|
+
expect(result.developer).toHaveLength(1);
|
|
44
|
+
expect(result.developer?.[0]).toEqual(developerResult);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("omits developer when the response has none", async () => {
|
|
48
|
+
const http = httpWith({ web: [] });
|
|
49
|
+
|
|
50
|
+
const result = await search(http, { query: "firecrawl" });
|
|
51
|
+
|
|
52
|
+
expect(result.developer).toBeUndefined();
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
test("lists developer in the .data error", async () => {
|
|
56
|
+
const http = httpWith({ developer: [developerResult] });
|
|
57
|
+
|
|
58
|
+
const result = await search(http, {
|
|
59
|
+
query: "firecrawl",
|
|
60
|
+
categories: ["developer"],
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
expect(() => (result as any).data).toThrow(/\.developer \(1 results\)/);
|
|
64
|
+
});
|
|
65
|
+
});
|
package/src/v1/index.ts
CHANGED
|
@@ -114,6 +114,10 @@ export interface LocationConfig {
|
|
|
114
114
|
languages?: string[];
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
export interface AuditMetadata {
|
|
118
|
+
username: string;
|
|
119
|
+
}
|
|
120
|
+
|
|
117
121
|
/**
|
|
118
122
|
* Parameters for scraping operations.
|
|
119
123
|
* Defines the options and configurations available for scraping web content.
|
|
@@ -135,7 +139,7 @@ export interface CrawlScrapeOptions {
|
|
|
135
139
|
storeInCache?: boolean;
|
|
136
140
|
maxAge?: number;
|
|
137
141
|
parsePDF?: boolean;
|
|
138
|
-
auditMetadata?:
|
|
142
|
+
auditMetadata?: AuditMetadata;
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
export type Action = {
|
|
@@ -311,7 +315,7 @@ export interface MapParams {
|
|
|
311
315
|
timeout?: number;
|
|
312
316
|
useIndex?: boolean;
|
|
313
317
|
location?: LocationConfig;
|
|
314
|
-
auditMetadata?:
|
|
318
|
+
auditMetadata?: AuditMetadata;
|
|
315
319
|
}
|
|
316
320
|
|
|
317
321
|
/**
|
package/src/v2/methods/agent.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type ThreatProtectionOptions } from "../types";
|
|
1
|
+
import { type AgentResponse, type AgentStatusResponse, type AgentWebhookConfig, type AuditMetadata, type ThreatProtectionOptions } from "../types";
|
|
2
2
|
import { HttpClient } from "../utils/httpClient";
|
|
3
3
|
import { normalizeAxiosError, throwForBadResponse } from "../utils/errorHandler";
|
|
4
4
|
import { isZodSchema, zodSchemaToJsonSchema } from "../../utils/zodSchemaToJson";
|
|
@@ -15,7 +15,7 @@ function prepareAgentPayload(args: {
|
|
|
15
15
|
model?: "spark-1-pro" | "spark-1-mini";
|
|
16
16
|
webhook?: string | AgentWebhookConfig;
|
|
17
17
|
threatProtection?: ThreatProtectionOptions;
|
|
18
|
-
auditMetadata?:
|
|
18
|
+
auditMetadata?: AuditMetadata;
|
|
19
19
|
}): Record<string, unknown> {
|
|
20
20
|
const body: Record<string, unknown> = {};
|
|
21
21
|
if (args.urls) body.urls = args.urls;
|
package/src/v2/methods/search.ts
CHANGED
|
@@ -102,12 +102,16 @@ export async function search(
|
|
|
102
102
|
if (data.news) out.news = transformArray<SearchResultNews>(data.news);
|
|
103
103
|
if (data.images)
|
|
104
104
|
out.images = transformArray<SearchResultImages>(data.images);
|
|
105
|
+
if (data.developer)
|
|
106
|
+
out.developer = transformArray<SearchResultWeb>(data.developer);
|
|
105
107
|
Object.defineProperty(out, "data", {
|
|
106
108
|
get() {
|
|
107
109
|
const parts: string[] = [];
|
|
108
110
|
if (out.web?.length) parts.push(`.web (${out.web.length} results)`);
|
|
109
111
|
if (out.news?.length) parts.push(`.news (${out.news.length} results)`);
|
|
110
112
|
if (out.images?.length) parts.push(`.images (${out.images.length} results)`);
|
|
113
|
+
if (out.developer?.length)
|
|
114
|
+
parts.push(`.developer (${out.developer.length} results)`);
|
|
111
115
|
const available = parts.length ? parts.join(", ") : ".web, .news, or .images";
|
|
112
116
|
throw new Error(
|
|
113
117
|
`SearchData has no '.data'. Results are grouped by source: ${available}`,
|
package/src/v2/types.ts
CHANGED
|
@@ -183,6 +183,10 @@ export type ActionOption =
|
|
|
183
183
|
| ExecuteJavascriptAction
|
|
184
184
|
| PDFAction;
|
|
185
185
|
|
|
186
|
+
export interface AuditMetadata {
|
|
187
|
+
username: string;
|
|
188
|
+
}
|
|
189
|
+
|
|
186
190
|
export interface ScrapeOptions {
|
|
187
191
|
formats?: FormatOption[];
|
|
188
192
|
headers?: Record<string, string>;
|
|
@@ -209,7 +213,7 @@ export interface ScrapeOptions {
|
|
|
209
213
|
lockdown?: boolean;
|
|
210
214
|
redactPII?: boolean | RedactPIIOptions;
|
|
211
215
|
threatProtection?: ThreatProtectionOptions;
|
|
212
|
-
auditMetadata?:
|
|
216
|
+
auditMetadata?: AuditMetadata;
|
|
213
217
|
profile?: {
|
|
214
218
|
name: string;
|
|
215
219
|
saveChanges?: boolean;
|
|
@@ -653,6 +657,7 @@ export interface SearchResultWeb {
|
|
|
653
657
|
url: string;
|
|
654
658
|
title?: string;
|
|
655
659
|
description?: string;
|
|
660
|
+
position?: number;
|
|
656
661
|
category?: string;
|
|
657
662
|
}
|
|
658
663
|
|
|
@@ -679,10 +684,11 @@ export interface SearchData {
|
|
|
679
684
|
web?: Array<SearchResultWeb | Document>;
|
|
680
685
|
news?: Array<SearchResultNews | Document>;
|
|
681
686
|
images?: Array<SearchResultImages | Document>;
|
|
687
|
+
developer?: Array<SearchResultWeb | Document>;
|
|
682
688
|
}
|
|
683
689
|
|
|
684
690
|
export interface CategoryOption {
|
|
685
|
-
type: "github" | "research" | "pdf";
|
|
691
|
+
type: "github" | "research" | "pdf" | "developer";
|
|
686
692
|
}
|
|
687
693
|
|
|
688
694
|
export interface SearchRequest {
|
|
@@ -690,7 +696,9 @@ export interface SearchRequest {
|
|
|
690
696
|
sources?: Array<
|
|
691
697
|
"web" | "news" | "images" | { type: "web" | "news" | "images" }
|
|
692
698
|
>;
|
|
693
|
-
categories?: Array<
|
|
699
|
+
categories?: Array<
|
|
700
|
+
"github" | "research" | "pdf" | "developer" | CategoryOption
|
|
701
|
+
>;
|
|
694
702
|
includeDomains?: string[];
|
|
695
703
|
excludeDomains?: string[];
|
|
696
704
|
limit?: number;
|
|
@@ -797,7 +805,7 @@ export interface MapOptions {
|
|
|
797
805
|
origin?: string;
|
|
798
806
|
location?: LocationConfig;
|
|
799
807
|
threatProtection?: ThreatProtectionOptions;
|
|
800
|
-
auditMetadata?:
|
|
808
|
+
auditMetadata?: AuditMetadata;
|
|
801
809
|
}
|
|
802
810
|
|
|
803
811
|
export type FeedbackRating = "good" | "partial" | "bad";
|