@mendable/firecrawl-js 4.33.0 → 4.34.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.
@@ -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.33.0",
15
+ version: "4.34.1",
16
16
  description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
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.33.0",
42
+ version: "4.34.1",
43
43
  description: "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
44
44
  main: "dist/index.js",
45
45
  types: "dist/index.d.ts",
package/dist/index.d.cts CHANGED
@@ -121,11 +121,19 @@ type PDFParser = {
121
121
  type: "pdf";
122
122
  mode?: "fast" | "auto" | "ocr";
123
123
  maxPages?: number;
124
- /** Include physical per-page markdown alongside document markdown. */
124
+ /** Include physical per-page markdown alongside document markdown. Populates `document.pages`. */
125
+ pages?: boolean;
126
+ /**
127
+ * @deprecated Renamed to `pages`. The API still accepts this as a silent alias.
128
+ */
125
129
  pageMarkdown?: boolean;
126
130
  /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
127
131
  blocks?: boolean;
128
132
  };
133
+ interface PdfPage {
134
+ pageNumber: number;
135
+ markdown: string;
136
+ }
129
137
  interface PdfBlockConfidence {
130
138
  layout: number | null;
131
139
  ocr: number | null;
@@ -528,6 +536,8 @@ interface Document {
528
536
  branding?: BrandingProfile;
529
537
  product?: ProductProfile;
530
538
  menu?: MenuProfile;
539
+ /** Physical PDF pages, present only when `parsers[].pages` is true. */
540
+ pages?: PdfPage[];
531
541
  /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
532
542
  blocks?: PdfPageBlocks[];
533
543
  }
@@ -1014,7 +1024,12 @@ interface AgentStatusResponse {
1014
1024
  status: "processing" | "completed" | "failed";
1015
1025
  error?: string;
1016
1026
  data?: unknown;
1017
- model?: "spark-1-pro" | "spark-1-mini";
1027
+ /**
1028
+ * Server-provided model name. Widened past the request-side union on
1029
+ * purpose: new models ship without an SDK release, so pinning this to known
1030
+ * names makes every future model a type error at the call site.
1031
+ */
1032
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2" | (string & {});
1018
1033
  expiresAt: string;
1019
1034
  creditsUsed?: number;
1020
1035
  }
@@ -1377,7 +1392,7 @@ declare function prepareAgentPayload(args: {
1377
1392
  origin?: string;
1378
1393
  maxCredits?: number;
1379
1394
  strictConstrainToURLs?: boolean;
1380
- model?: "spark-1-pro" | "spark-1-mini";
1395
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2";
1381
1396
  webhook?: string | AgentWebhookConfig;
1382
1397
  threatProtection?: ThreatProtectionOptions;
1383
1398
  auditMetadata?: AuditMetadata$1;
@@ -2791,4 +2806,4 @@ declare class Firecrawl extends FirecrawlClient {
2791
2806
  get v1(): FirecrawlApp;
2792
2807
  }
2793
2808
 
2794
- 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 PDFParser, 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 PdfBlockConfidence, type PdfBlockItem, type PdfPageBlocks, 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 };
2809
+ 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 PDFParser, 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 PdfBlockConfidence, type PdfBlockItem, type PdfPage, type PdfPageBlocks, 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
@@ -121,11 +121,19 @@ type PDFParser = {
121
121
  type: "pdf";
122
122
  mode?: "fast" | "auto" | "ocr";
123
123
  maxPages?: number;
124
- /** Include physical per-page markdown alongside document markdown. */
124
+ /** Include physical per-page markdown alongside document markdown. Populates `document.pages`. */
125
+ pages?: boolean;
126
+ /**
127
+ * @deprecated Renamed to `pages`. The API still accepts this as a silent alias.
128
+ */
125
129
  pageMarkdown?: boolean;
126
130
  /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
127
131
  blocks?: boolean;
128
132
  };
133
+ interface PdfPage {
134
+ pageNumber: number;
135
+ markdown: string;
136
+ }
129
137
  interface PdfBlockConfidence {
130
138
  layout: number | null;
131
139
  ocr: number | null;
@@ -528,6 +536,8 @@ interface Document {
528
536
  branding?: BrandingProfile;
529
537
  product?: ProductProfile;
530
538
  menu?: MenuProfile;
539
+ /** Physical PDF pages, present only when `parsers[].pages` is true. */
540
+ pages?: PdfPage[];
531
541
  /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
532
542
  blocks?: PdfPageBlocks[];
533
543
  }
@@ -1014,7 +1024,12 @@ interface AgentStatusResponse {
1014
1024
  status: "processing" | "completed" | "failed";
1015
1025
  error?: string;
1016
1026
  data?: unknown;
1017
- model?: "spark-1-pro" | "spark-1-mini";
1027
+ /**
1028
+ * Server-provided model name. Widened past the request-side union on
1029
+ * purpose: new models ship without an SDK release, so pinning this to known
1030
+ * names makes every future model a type error at the call site.
1031
+ */
1032
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2" | (string & {});
1018
1033
  expiresAt: string;
1019
1034
  creditsUsed?: number;
1020
1035
  }
@@ -1377,7 +1392,7 @@ declare function prepareAgentPayload(args: {
1377
1392
  origin?: string;
1378
1393
  maxCredits?: number;
1379
1394
  strictConstrainToURLs?: boolean;
1380
- model?: "spark-1-pro" | "spark-1-mini";
1395
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2";
1381
1396
  webhook?: string | AgentWebhookConfig;
1382
1397
  threatProtection?: ThreatProtectionOptions;
1383
1398
  auditMetadata?: AuditMetadata$1;
@@ -2791,4 +2806,4 @@ declare class Firecrawl extends FirecrawlClient {
2791
2806
  get v1(): FirecrawlApp;
2792
2807
  }
2793
2808
 
2794
- 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 PDFParser, 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 PdfBlockConfidence, type PdfBlockItem, type PdfPageBlocks, 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 };
2809
+ 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 PDFParser, 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 PdfBlockConfidence, type PdfBlockItem, type PdfPage, type PdfPageBlocks, 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-NMQZNWRC.js";
3
+ } from "./chunk-DWBMD5N5.js";
4
4
 
5
5
  // src/v2/utils/httpClient.ts
6
6
  import axios from "axios";
@@ -2342,7 +2342,7 @@ var FirecrawlApp = class {
2342
2342
  if (typeof process !== "undefined" && process.env && process.env.npm_package_version) {
2343
2343
  return process.env.npm_package_version;
2344
2344
  }
2345
- const packageJson = await import("./package-GTMZIRAE.js");
2345
+ const packageJson = await import("./package-XAWX5C5Y.js");
2346
2346
  return packageJson.default.version;
2347
2347
  } catch (error) {
2348
2348
  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-NMQZNWRC.js";
3
+ } from "./chunk-DWBMD5N5.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.33.0",
3
+ "version": "4.34.1",
4
4
  "description": "JavaScript SDK for the Firecrawl API: web scraping, crawling, web search, and scientific literature search over a research paper index of PubMed, bioRxiv, medRxiv and arXiv abstracts",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -89,16 +89,16 @@ describe("v2 utils: validation", () => {
89
89
  expect(options.parsers).toEqual(before);
90
90
  });
91
91
 
92
- test("ensureValidScrapeOptions: leaves PDF parser blocks option untouched", () => {
92
+ test("ensureValidScrapeOptions: leaves PDF parser pages and blocks options untouched", () => {
93
93
  const options = {
94
- parsers: [{ type: "pdf", mode: "auto", blocks: true, pageMarkdown: true }],
94
+ parsers: [{ type: "pdf", mode: "auto", blocks: true, pages: true }],
95
95
  } as any;
96
96
  expect(() => ensureValidScrapeOptions(options)).not.toThrow();
97
97
  expect(options.parsers[0]).toEqual({
98
98
  type: "pdf",
99
99
  mode: "auto",
100
100
  blocks: true,
101
- pageMarkdown: true,
101
+ pages: true,
102
102
  });
103
103
  });
104
104
 
@@ -12,7 +12,7 @@ function prepareAgentPayload(args: {
12
12
  origin?: string;
13
13
  maxCredits?: number;
14
14
  strictConstrainToURLs?: boolean;
15
- model?: "spark-1-pro" | "spark-1-mini";
15
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2";
16
16
  webhook?: string | AgentWebhookConfig;
17
17
  threatProtection?: ThreatProtectionOptions;
18
18
  auditMetadata?: AuditMetadata;
package/src/v2/types.ts CHANGED
@@ -191,12 +191,21 @@ export type PDFParser = {
191
191
  type: "pdf";
192
192
  mode?: "fast" | "auto" | "ocr";
193
193
  maxPages?: number;
194
- /** Include physical per-page markdown alongside document markdown. */
194
+ /** Include physical per-page markdown alongside document markdown. Populates `document.pages`. */
195
+ pages?: boolean;
196
+ /**
197
+ * @deprecated Renamed to `pages`. The API still accepts this as a silent alias.
198
+ */
195
199
  pageMarkdown?: boolean;
196
200
  /** Include per-page typed layout blocks (bounding boxes, block types, reading order). */
197
201
  blocks?: boolean;
198
202
  };
199
203
 
204
+ export interface PdfPage {
205
+ pageNumber: number;
206
+ markdown: string;
207
+ }
208
+
200
209
  export interface PdfBlockConfidence {
201
210
  layout: number | null;
202
211
  ocr: number | null;
@@ -680,6 +689,8 @@ export interface Document {
680
689
  branding?: BrandingProfile;
681
690
  product?: ProductProfile;
682
691
  menu?: MenuProfile;
692
+ /** Physical PDF pages, present only when `parsers[].pages` is true. */
693
+ pages?: PdfPage[];
683
694
  /** Typed PDF layout blocks, present only when `parsers[].blocks` is true. */
684
695
  blocks?: PdfPageBlocks[];
685
696
  }
@@ -1233,7 +1244,12 @@ export interface AgentStatusResponse {
1233
1244
  status: "processing" | "completed" | "failed";
1234
1245
  error?: string;
1235
1246
  data?: unknown;
1236
- model?: "spark-1-pro" | "spark-1-mini";
1247
+ /**
1248
+ * Server-provided model name. Widened past the request-side union on
1249
+ * purpose: new models ship without an SDK release, so pinning this to known
1250
+ * names makes every future model a type error at the call site.
1251
+ */
1252
+ model?: "spark-1-pro" | "spark-1-mini" | "spark-2" | (string & {});
1237
1253
  expiresAt: string;
1238
1254
  creditsUsed?: number;
1239
1255
  }