firecrawl 4.21.1 → 4.22.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-EH7NHUN5.js → chunk-WTZQ5IMF.js} +3 -3
- package/dist/index.cjs +232 -5
- package/dist/index.d.cts +166 -3
- package/dist/index.d.ts +166 -3
- package/dist/index.js +231 -4
- package/dist/{package-7423KYJY.js → package-YDTOLYXI.js} +1 -1
- package/package.json +2 -2
- package/src/__tests__/unit/v2/pagination.test.ts +21 -0
- package/src/__tests__/unit/v2/validation.test.ts +21 -0
- package/src/v2/client.ts +85 -0
- package/src/v2/methods/monitor.ts +181 -0
- package/src/v2/types.ts +164 -0
- package/src/v2/utils/httpClient.ts +14 -0
- package/src/v2/utils/pagination.ts +12 -9
- package/src/v2/utils/validation.ts +52 -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.
|
|
11
|
+
version: "4.22.1",
|
|
12
12
|
description: "JavaScript SDK for Firecrawl API",
|
|
13
13
|
main: "dist/index.js",
|
|
14
14
|
types: "dist/index.d.ts",
|
|
@@ -34,7 +34,7 @@ var require_package = __commonJS({
|
|
|
34
34
|
author: "Mendable.ai",
|
|
35
35
|
license: "MIT",
|
|
36
36
|
dependencies: {
|
|
37
|
-
axios: "1.15.
|
|
37
|
+
axios: "1.15.2",
|
|
38
38
|
firecrawl: "4.16.0",
|
|
39
39
|
"typescript-event-target": "^1.1.1",
|
|
40
40
|
zod: "^3.23.8",
|
|
@@ -78,7 +78,7 @@ var require_package = __commonJS({
|
|
|
78
78
|
"picomatch@<4.0.4": ">=4.0.4",
|
|
79
79
|
handlebars: ">=4.7.9",
|
|
80
80
|
"brace-expansion": ">=5.0.5",
|
|
81
|
-
"axios@<1.15.
|
|
81
|
+
"axios@<1.15.2": "1.15.2",
|
|
82
82
|
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0"
|
|
83
83
|
}
|
|
84
84
|
}
|
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.
|
|
38
|
+
version: "4.22.1",
|
|
39
39
|
description: "JavaScript SDK for Firecrawl API",
|
|
40
40
|
main: "dist/index.js",
|
|
41
41
|
types: "dist/index.d.ts",
|
|
@@ -61,7 +61,7 @@ var require_package = __commonJS({
|
|
|
61
61
|
author: "Mendable.ai",
|
|
62
62
|
license: "MIT",
|
|
63
63
|
dependencies: {
|
|
64
|
-
axios: "1.15.
|
|
64
|
+
axios: "1.15.2",
|
|
65
65
|
firecrawl: "4.16.0",
|
|
66
66
|
"typescript-event-target": "^1.1.1",
|
|
67
67
|
zod: "^3.23.8",
|
|
@@ -105,7 +105,7 @@ var require_package = __commonJS({
|
|
|
105
105
|
"picomatch@<4.0.4": ">=4.0.4",
|
|
106
106
|
handlebars: ">=4.7.9",
|
|
107
107
|
"brace-expansion": ">=5.0.5",
|
|
108
|
-
"axios@<1.15.
|
|
108
|
+
"axios@<1.15.2": "1.15.2",
|
|
109
109
|
"follow-redirects@<1.16.0": ">=1.16.0 <2.0.0"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -237,6 +237,15 @@ var HttpClient = class {
|
|
|
237
237
|
delete(endpoint, headers) {
|
|
238
238
|
return this.request({ method: "delete", url: endpoint, headers });
|
|
239
239
|
}
|
|
240
|
+
patch(endpoint, body, options) {
|
|
241
|
+
return this.request({
|
|
242
|
+
method: "patch",
|
|
243
|
+
url: endpoint,
|
|
244
|
+
data: body,
|
|
245
|
+
headers: options?.headers,
|
|
246
|
+
timeout: options?.timeoutMs
|
|
247
|
+
});
|
|
248
|
+
}
|
|
240
249
|
prepareHeaders(idempotencyKey) {
|
|
241
250
|
const headers = {};
|
|
242
251
|
if (idempotencyKey) headers["x-idempotency-key"] = idempotencyKey;
|
|
@@ -359,6 +368,30 @@ function ensureValidFormats(formats) {
|
|
|
359
368
|
}
|
|
360
369
|
continue;
|
|
361
370
|
}
|
|
371
|
+
if (fmt.type === "question") {
|
|
372
|
+
const q = fmt;
|
|
373
|
+
if (typeof q.question !== "string" || q.question.trim().length === 0) {
|
|
374
|
+
throw new Error("question format requires a non-empty 'question' string");
|
|
375
|
+
}
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
if (fmt.type === "highlights") {
|
|
379
|
+
const h = fmt;
|
|
380
|
+
if (typeof h.query !== "string" || h.query.trim().length === 0) {
|
|
381
|
+
throw new Error("highlights format requires a non-empty 'query' string");
|
|
382
|
+
}
|
|
383
|
+
continue;
|
|
384
|
+
}
|
|
385
|
+
if (fmt.type === "query") {
|
|
386
|
+
const q = fmt;
|
|
387
|
+
if (typeof q.prompt !== "string" || q.prompt.trim().length === 0) {
|
|
388
|
+
throw new Error("query format requires a non-empty 'prompt' string");
|
|
389
|
+
}
|
|
390
|
+
if (q.mode != null && q.mode !== "freeform" && q.mode !== "directQuote") {
|
|
391
|
+
throw new Error("query format mode must be 'freeform' or 'directQuote'");
|
|
392
|
+
}
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
362
395
|
if (fmt.type === "screenshot") {
|
|
363
396
|
const s = fmt;
|
|
364
397
|
if (s.quality != null && (typeof s.quality !== "number" || s.quality < 0)) {
|
|
@@ -418,6 +451,30 @@ function ensureValidParseFormats(formats) {
|
|
|
418
451
|
"json format schema appears to be a Zod schema's .shape property. Pass the Zod schema directly (e.g., `schema: MySchema`) instead of `schema: MySchema.shape`. The SDK will automatically convert Zod schemas to JSON Schema format."
|
|
419
452
|
);
|
|
420
453
|
}
|
|
454
|
+
continue;
|
|
455
|
+
}
|
|
456
|
+
if (fmt.type === "question") {
|
|
457
|
+
const q = fmt;
|
|
458
|
+
if (typeof q.question !== "string" || q.question.trim().length === 0) {
|
|
459
|
+
throw new Error("question format requires a non-empty 'question' string");
|
|
460
|
+
}
|
|
461
|
+
continue;
|
|
462
|
+
}
|
|
463
|
+
if (fmt.type === "highlights") {
|
|
464
|
+
const h = fmt;
|
|
465
|
+
if (typeof h.query !== "string" || h.query.trim().length === 0) {
|
|
466
|
+
throw new Error("highlights format requires a non-empty 'query' string");
|
|
467
|
+
}
|
|
468
|
+
continue;
|
|
469
|
+
}
|
|
470
|
+
if (fmt.type === "query") {
|
|
471
|
+
const q = fmt;
|
|
472
|
+
if (typeof q.prompt !== "string" || q.prompt.trim().length === 0) {
|
|
473
|
+
throw new Error("query format requires a non-empty 'prompt' string");
|
|
474
|
+
}
|
|
475
|
+
if (q.mode != null && q.mode !== "freeform" && q.mode !== "directQuote") {
|
|
476
|
+
throw new Error("query format mode must be 'freeform' or 'directQuote'");
|
|
477
|
+
}
|
|
421
478
|
}
|
|
422
479
|
}
|
|
423
480
|
}
|
|
@@ -759,12 +816,13 @@ async function fetchAllPages(http, nextUrl, initial, pagination) {
|
|
|
759
816
|
break;
|
|
760
817
|
}
|
|
761
818
|
if (!payload?.success) break;
|
|
762
|
-
|
|
819
|
+
const pageData = Array.isArray(payload.data) ? payload.data : payload.data?.pages || [];
|
|
820
|
+
for (const d of pageData) {
|
|
763
821
|
if (maxResults != null && docs.length >= maxResults) break;
|
|
764
822
|
docs.push(d);
|
|
765
823
|
}
|
|
766
824
|
if (maxResults != null && docs.length >= maxResults) break;
|
|
767
|
-
current = payload.next ?? null;
|
|
825
|
+
current = payload.next ?? (Array.isArray(payload.data) ? null : payload.data?.next) ?? null;
|
|
768
826
|
pageCount += 1;
|
|
769
827
|
}
|
|
770
828
|
return docs;
|
|
@@ -1347,6 +1405,126 @@ async function getTokenUsageHistorical(http, byApiKey) {
|
|
|
1347
1405
|
}
|
|
1348
1406
|
}
|
|
1349
1407
|
|
|
1408
|
+
// src/v2/methods/monitor.ts
|
|
1409
|
+
function queryString(params) {
|
|
1410
|
+
if (!params) return "";
|
|
1411
|
+
const query = new URLSearchParams();
|
|
1412
|
+
for (const [key, value] of Object.entries(params)) {
|
|
1413
|
+
if (value !== void 0 && value !== null) query.set(key, String(value));
|
|
1414
|
+
}
|
|
1415
|
+
const str = query.toString();
|
|
1416
|
+
return str ? `?${str}` : "";
|
|
1417
|
+
}
|
|
1418
|
+
function dataOrThrow(res, action) {
|
|
1419
|
+
if (res.status !== 200 || !res.data?.success || res.data.data == null) {
|
|
1420
|
+
throwForBadResponse(res, action);
|
|
1421
|
+
}
|
|
1422
|
+
return res.data.data;
|
|
1423
|
+
}
|
|
1424
|
+
async function createMonitor(http, request) {
|
|
1425
|
+
try {
|
|
1426
|
+
const res = await http.post("/v2/monitor", request);
|
|
1427
|
+
return dataOrThrow(res, "create monitor");
|
|
1428
|
+
} catch (err) {
|
|
1429
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "create monitor");
|
|
1430
|
+
throw err;
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
async function listMonitors(http, options) {
|
|
1434
|
+
try {
|
|
1435
|
+
const res = await http.get(
|
|
1436
|
+
`/v2/monitor${queryString(options)}`
|
|
1437
|
+
);
|
|
1438
|
+
return dataOrThrow(res, "list monitors");
|
|
1439
|
+
} catch (err) {
|
|
1440
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "list monitors");
|
|
1441
|
+
throw err;
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
async function getMonitor(http, monitorId) {
|
|
1445
|
+
try {
|
|
1446
|
+
const res = await http.get(`/v2/monitor/${monitorId}`);
|
|
1447
|
+
return dataOrThrow(res, "get monitor");
|
|
1448
|
+
} catch (err) {
|
|
1449
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "get monitor");
|
|
1450
|
+
throw err;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
async function updateMonitor(http, monitorId, request) {
|
|
1454
|
+
try {
|
|
1455
|
+
const res = await http.patch(
|
|
1456
|
+
`/v2/monitor/${monitorId}`,
|
|
1457
|
+
request
|
|
1458
|
+
);
|
|
1459
|
+
return dataOrThrow(res, "update monitor");
|
|
1460
|
+
} catch (err) {
|
|
1461
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "update monitor");
|
|
1462
|
+
throw err;
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
async function deleteMonitor(http, monitorId) {
|
|
1466
|
+
try {
|
|
1467
|
+
const res = await http.delete(`/v2/monitor/${monitorId}`);
|
|
1468
|
+
if (res.status !== 200 || !res.data?.success) {
|
|
1469
|
+
throwForBadResponse(res, "delete monitor");
|
|
1470
|
+
}
|
|
1471
|
+
return true;
|
|
1472
|
+
} catch (err) {
|
|
1473
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "delete monitor");
|
|
1474
|
+
throw err;
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
async function runMonitor(http, monitorId) {
|
|
1478
|
+
try {
|
|
1479
|
+
const res = await http.post(
|
|
1480
|
+
`/v2/monitor/${monitorId}/run`,
|
|
1481
|
+
{}
|
|
1482
|
+
);
|
|
1483
|
+
return dataOrThrow(res, "run monitor");
|
|
1484
|
+
} catch (err) {
|
|
1485
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "run monitor");
|
|
1486
|
+
throw err;
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1489
|
+
async function listMonitorChecks(http, monitorId, options) {
|
|
1490
|
+
try {
|
|
1491
|
+
const res = await http.get(
|
|
1492
|
+
`/v2/monitor/${monitorId}/checks${queryString(options)}`
|
|
1493
|
+
);
|
|
1494
|
+
return dataOrThrow(res, "list monitor checks");
|
|
1495
|
+
} catch (err) {
|
|
1496
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "list monitor checks");
|
|
1497
|
+
throw err;
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
async function getMonitorCheck(http, monitorId, checkId, options) {
|
|
1501
|
+
try {
|
|
1502
|
+
const { autoPaginate: _autoPaginate, maxPages: _maxPages, maxResults: _maxResults, maxWaitTime: _maxWaitTime, ...query } = options ?? {};
|
|
1503
|
+
const res = await http.get(
|
|
1504
|
+
`/v2/monitor/${monitorId}/checks/${checkId}${queryString(query)}`
|
|
1505
|
+
);
|
|
1506
|
+
const detail = dataOrThrow(res, "get monitor check");
|
|
1507
|
+
const next = res.data?.next ?? detail.next ?? null;
|
|
1508
|
+
const auto = options?.autoPaginate ?? true;
|
|
1509
|
+
if (!auto || !next) {
|
|
1510
|
+
return { ...detail, next };
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
...detail,
|
|
1514
|
+
pages: await fetchAllPages(
|
|
1515
|
+
http,
|
|
1516
|
+
next,
|
|
1517
|
+
detail.pages || [],
|
|
1518
|
+
options
|
|
1519
|
+
),
|
|
1520
|
+
next: null
|
|
1521
|
+
};
|
|
1522
|
+
} catch (err) {
|
|
1523
|
+
if (err?.isAxiosError) return normalizeAxiosError(err, "get monitor check");
|
|
1524
|
+
throw err;
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1350
1528
|
// src/v2/watcher.ts
|
|
1351
1529
|
var import_events = require("events");
|
|
1352
1530
|
var hasGlobalWebSocket = () => {
|
|
@@ -1728,6 +1906,55 @@ var FirecrawlClient = class {
|
|
|
1728
1906
|
async crawlParamsPreview(url, prompt) {
|
|
1729
1907
|
return crawlParamsPreview(this.http, url, prompt);
|
|
1730
1908
|
}
|
|
1909
|
+
// Monitor
|
|
1910
|
+
/**
|
|
1911
|
+
* Create a scheduled monitor.
|
|
1912
|
+
*/
|
|
1913
|
+
async createMonitor(request) {
|
|
1914
|
+
return createMonitor(this.http, request);
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* List monitors for the authenticated team.
|
|
1918
|
+
*/
|
|
1919
|
+
async listMonitors(options) {
|
|
1920
|
+
return listMonitors(this.http, options);
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Get a monitor by id.
|
|
1924
|
+
*/
|
|
1925
|
+
async getMonitor(monitorId) {
|
|
1926
|
+
return getMonitor(this.http, monitorId);
|
|
1927
|
+
}
|
|
1928
|
+
/**
|
|
1929
|
+
* Update a monitor.
|
|
1930
|
+
*/
|
|
1931
|
+
async updateMonitor(monitorId, request) {
|
|
1932
|
+
return updateMonitor(this.http, monitorId, request);
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Delete a monitor.
|
|
1936
|
+
*/
|
|
1937
|
+
async deleteMonitor(monitorId) {
|
|
1938
|
+
return deleteMonitor(this.http, monitorId);
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Trigger a manual monitor check.
|
|
1942
|
+
*/
|
|
1943
|
+
async runMonitor(monitorId) {
|
|
1944
|
+
return runMonitor(this.http, monitorId);
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* List checks for a monitor.
|
|
1948
|
+
*/
|
|
1949
|
+
async listMonitorChecks(monitorId, options) {
|
|
1950
|
+
return listMonitorChecks(this.http, monitorId, options);
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* Get a monitor check with paginated page results and inline diffs.
|
|
1954
|
+
*/
|
|
1955
|
+
async getMonitorCheck(monitorId, checkId, options) {
|
|
1956
|
+
return getMonitorCheck(this.http, monitorId, checkId, options);
|
|
1957
|
+
}
|
|
1731
1958
|
// Batch
|
|
1732
1959
|
/**
|
|
1733
1960
|
* Start a batch scrape job for multiple URLs (async).
|
package/dist/index.d.cts
CHANGED
|
@@ -40,17 +40,26 @@ interface AttributesFormat extends Format {
|
|
|
40
40
|
attribute: string;
|
|
41
41
|
}>;
|
|
42
42
|
}
|
|
43
|
+
interface QuestionFormat {
|
|
44
|
+
type: 'question';
|
|
45
|
+
question: string;
|
|
46
|
+
}
|
|
47
|
+
interface HighlightsFormat {
|
|
48
|
+
type: 'highlights';
|
|
49
|
+
query: string;
|
|
50
|
+
}
|
|
51
|
+
/** @deprecated Use QuestionFormat or HighlightsFormat instead. */
|
|
43
52
|
interface QueryFormat {
|
|
44
53
|
type: 'query';
|
|
45
54
|
prompt: string;
|
|
46
55
|
mode?: 'freeform' | 'directQuote';
|
|
47
56
|
}
|
|
48
|
-
type FormatOption = FormatString | Format | JsonFormat | ChangeTrackingFormat | ScreenshotFormat | AttributesFormat | QueryFormat;
|
|
57
|
+
type FormatOption = FormatString | Format | JsonFormat | ChangeTrackingFormat | ScreenshotFormat | AttributesFormat | QuestionFormat | HighlightsFormat | QueryFormat;
|
|
49
58
|
type ParseFormatString = Exclude<FormatString, 'screenshot' | 'changeTracking' | 'branding'>;
|
|
50
59
|
interface ParseFormat {
|
|
51
60
|
type: ParseFormatString;
|
|
52
61
|
}
|
|
53
|
-
type ParseFormatOption = ParseFormatString | ParseFormat | JsonFormat | AttributesFormat | QueryFormat;
|
|
62
|
+
type ParseFormatOption = ParseFormatString | ParseFormat | JsonFormat | AttributesFormat | QuestionFormat | HighlightsFormat | QueryFormat;
|
|
54
63
|
interface LocationConfig$1 {
|
|
55
64
|
country?: string;
|
|
56
65
|
languages?: string[];
|
|
@@ -345,6 +354,7 @@ interface Document {
|
|
|
345
354
|
}>;
|
|
346
355
|
actions?: Record<string, unknown>;
|
|
347
356
|
answer?: string;
|
|
357
|
+
highlights?: string;
|
|
348
358
|
warning?: string;
|
|
349
359
|
changeTracking?: Record<string, unknown>;
|
|
350
360
|
branding?: BrandingProfile;
|
|
@@ -484,6 +494,126 @@ interface MapOptions {
|
|
|
484
494
|
origin?: string;
|
|
485
495
|
location?: LocationConfig$1;
|
|
486
496
|
}
|
|
497
|
+
interface MonitorSchedule {
|
|
498
|
+
cron: string;
|
|
499
|
+
timezone?: string;
|
|
500
|
+
}
|
|
501
|
+
interface MonitorEmailNotification {
|
|
502
|
+
enabled?: boolean;
|
|
503
|
+
recipients?: string[];
|
|
504
|
+
includeDiffs?: boolean;
|
|
505
|
+
}
|
|
506
|
+
interface MonitorNotification {
|
|
507
|
+
email?: MonitorEmailNotification;
|
|
508
|
+
}
|
|
509
|
+
interface MonitorWebhookConfig {
|
|
510
|
+
url: string;
|
|
511
|
+
headers?: Record<string, string>;
|
|
512
|
+
metadata?: Record<string, string>;
|
|
513
|
+
events?: string[];
|
|
514
|
+
}
|
|
515
|
+
interface MonitorScrapeTarget {
|
|
516
|
+
id?: string;
|
|
517
|
+
type: 'scrape';
|
|
518
|
+
urls: string[];
|
|
519
|
+
scrapeOptions?: ScrapeOptions;
|
|
520
|
+
}
|
|
521
|
+
interface MonitorCrawlTarget {
|
|
522
|
+
id?: string;
|
|
523
|
+
type: 'crawl';
|
|
524
|
+
url: string;
|
|
525
|
+
crawlOptions?: CrawlOptions;
|
|
526
|
+
scrapeOptions?: ScrapeOptions;
|
|
527
|
+
}
|
|
528
|
+
type MonitorTarget = MonitorScrapeTarget | MonitorCrawlTarget;
|
|
529
|
+
interface CreateMonitorRequest {
|
|
530
|
+
name: string;
|
|
531
|
+
schedule: MonitorSchedule;
|
|
532
|
+
webhook?: MonitorWebhookConfig;
|
|
533
|
+
notification?: MonitorNotification;
|
|
534
|
+
targets: MonitorTarget[];
|
|
535
|
+
retentionDays?: number;
|
|
536
|
+
}
|
|
537
|
+
interface UpdateMonitorRequest {
|
|
538
|
+
name?: string;
|
|
539
|
+
status?: 'active' | 'paused';
|
|
540
|
+
schedule?: MonitorSchedule;
|
|
541
|
+
webhook?: MonitorWebhookConfig | null;
|
|
542
|
+
notification?: MonitorNotification | null;
|
|
543
|
+
targets?: MonitorTarget[];
|
|
544
|
+
retentionDays?: number;
|
|
545
|
+
}
|
|
546
|
+
interface MonitorSummary {
|
|
547
|
+
totalPages: number;
|
|
548
|
+
same: number;
|
|
549
|
+
changed: number;
|
|
550
|
+
new: number;
|
|
551
|
+
removed: number;
|
|
552
|
+
error: number;
|
|
553
|
+
}
|
|
554
|
+
interface Monitor {
|
|
555
|
+
id: string;
|
|
556
|
+
name: string;
|
|
557
|
+
status: 'active' | 'paused' | 'deleted';
|
|
558
|
+
schedule: MonitorSchedule;
|
|
559
|
+
nextRunAt?: string | null;
|
|
560
|
+
lastRunAt?: string | null;
|
|
561
|
+
currentCheckId?: string | null;
|
|
562
|
+
targets: MonitorTarget[];
|
|
563
|
+
webhook?: MonitorWebhookConfig | null;
|
|
564
|
+
notification?: MonitorNotification | null;
|
|
565
|
+
retentionDays: number;
|
|
566
|
+
estimatedCreditsPerMonth?: number | null;
|
|
567
|
+
lastCheckSummary?: MonitorSummary | null;
|
|
568
|
+
createdAt: string;
|
|
569
|
+
updatedAt: string;
|
|
570
|
+
}
|
|
571
|
+
interface MonitorCheck {
|
|
572
|
+
id: string;
|
|
573
|
+
monitorId: string;
|
|
574
|
+
status: 'queued' | 'running' | 'completed' | 'failed' | 'partial' | 'skipped_overlap';
|
|
575
|
+
trigger: 'scheduled' | 'manual';
|
|
576
|
+
scheduledFor?: string | null;
|
|
577
|
+
startedAt?: string | null;
|
|
578
|
+
finishedAt?: string | null;
|
|
579
|
+
estimatedCredits?: number | null;
|
|
580
|
+
reservedCredits?: number | null;
|
|
581
|
+
actualCredits?: number | null;
|
|
582
|
+
billingStatus: 'not_applicable' | 'reserved' | 'confirmed' | 'released' | 'failed';
|
|
583
|
+
summary: MonitorSummary;
|
|
584
|
+
targetResults?: unknown;
|
|
585
|
+
notificationStatus?: unknown;
|
|
586
|
+
error?: string | null;
|
|
587
|
+
createdAt: string;
|
|
588
|
+
updatedAt: string;
|
|
589
|
+
}
|
|
590
|
+
interface MonitorCheckPage {
|
|
591
|
+
id: string;
|
|
592
|
+
targetId: string;
|
|
593
|
+
url: string;
|
|
594
|
+
status: 'same' | 'new' | 'changed' | 'removed' | 'error';
|
|
595
|
+
previousScrapeId?: string | null;
|
|
596
|
+
currentScrapeId?: string | null;
|
|
597
|
+
statusCode?: number | null;
|
|
598
|
+
error?: string | null;
|
|
599
|
+
metadata?: unknown;
|
|
600
|
+
diff?: unknown;
|
|
601
|
+
createdAt: string;
|
|
602
|
+
}
|
|
603
|
+
interface MonitorCheckDetail extends MonitorCheck {
|
|
604
|
+
pages: MonitorCheckPage[];
|
|
605
|
+
next?: string | null;
|
|
606
|
+
}
|
|
607
|
+
interface ListMonitorsOptions {
|
|
608
|
+
limit?: number;
|
|
609
|
+
offset?: number;
|
|
610
|
+
}
|
|
611
|
+
type ListMonitorChecksOptions = ListMonitorsOptions;
|
|
612
|
+
type GetMonitorCheckOptions = PaginationConfig & {
|
|
613
|
+
limit?: number;
|
|
614
|
+
skip?: number;
|
|
615
|
+
status?: MonitorCheckPage["status"];
|
|
616
|
+
};
|
|
487
617
|
interface ExtractResponse$1 {
|
|
488
618
|
success?: boolean;
|
|
489
619
|
id?: string;
|
|
@@ -671,6 +801,7 @@ declare class HttpClient {
|
|
|
671
801
|
postMultipart<T = any>(endpoint: string, formData: FormData, options?: RequestOptions): Promise<AxiosResponse<T, any, {}>>;
|
|
672
802
|
get<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
673
803
|
delete<T = any>(endpoint: string, headers?: Record<string, string>): Promise<AxiosResponse<T, any, {}>>;
|
|
804
|
+
patch<T = any>(endpoint: string, body: Record<string, unknown>, options?: RequestOptions): Promise<AxiosResponse<T, any, {}>>;
|
|
674
805
|
prepareHeaders(idempotencyKey?: string): Record<string, string>;
|
|
675
806
|
}
|
|
676
807
|
|
|
@@ -889,6 +1020,38 @@ declare class FirecrawlClient {
|
|
|
889
1020
|
* @param prompt Natural-language instruction.
|
|
890
1021
|
*/
|
|
891
1022
|
crawlParamsPreview(url: string, prompt: string): Promise<Record<string, unknown>>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Create a scheduled monitor.
|
|
1025
|
+
*/
|
|
1026
|
+
createMonitor(request: CreateMonitorRequest): Promise<Monitor>;
|
|
1027
|
+
/**
|
|
1028
|
+
* List monitors for the authenticated team.
|
|
1029
|
+
*/
|
|
1030
|
+
listMonitors(options?: ListMonitorsOptions): Promise<Monitor[]>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Get a monitor by id.
|
|
1033
|
+
*/
|
|
1034
|
+
getMonitor(monitorId: string): Promise<Monitor>;
|
|
1035
|
+
/**
|
|
1036
|
+
* Update a monitor.
|
|
1037
|
+
*/
|
|
1038
|
+
updateMonitor(monitorId: string, request: UpdateMonitorRequest): Promise<Monitor>;
|
|
1039
|
+
/**
|
|
1040
|
+
* Delete a monitor.
|
|
1041
|
+
*/
|
|
1042
|
+
deleteMonitor(monitorId: string): Promise<boolean>;
|
|
1043
|
+
/**
|
|
1044
|
+
* Trigger a manual monitor check.
|
|
1045
|
+
*/
|
|
1046
|
+
runMonitor(monitorId: string): Promise<MonitorCheck>;
|
|
1047
|
+
/**
|
|
1048
|
+
* List checks for a monitor.
|
|
1049
|
+
*/
|
|
1050
|
+
listMonitorChecks(monitorId: string, options?: ListMonitorChecksOptions): Promise<MonitorCheck[]>;
|
|
1051
|
+
/**
|
|
1052
|
+
* Get a monitor check with paginated page results and inline diffs.
|
|
1053
|
+
*/
|
|
1054
|
+
getMonitorCheck(monitorId: string, checkId: string, options?: GetMonitorCheckOptions): Promise<MonitorCheckDetail>;
|
|
892
1055
|
/**
|
|
893
1056
|
* Start a batch scrape job for multiple URLs (async).
|
|
894
1057
|
* @param urls URLs to scrape.
|
|
@@ -1928,4 +2091,4 @@ declare class Firecrawl extends FirecrawlClient {
|
|
|
1928
2091
|
get v1(): FirecrawlApp;
|
|
1929
2092
|
}
|
|
1930
2093
|
|
|
1931
|
-
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 CreditUsage, type CreditUsageHistoricalPeriod, type CreditUsageHistoricalResponse, type Document, type DocumentMetadata, type ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, JobTimeoutError, type JsonFormat, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type PDFAction, type PaginationConfig, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type PressAction, type QueryFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|
|
2094
|
+
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 ErrorDetails, type ExecuteJavascriptAction, type ExtractResponse$1 as ExtractResponse, Firecrawl, FirecrawlApp as FirecrawlAppV1, FirecrawlClient, type FirecrawlClientOptions, type Format, type FormatOption, type FormatString, type GetMonitorCheckOptions, type HighlightsFormat, JobTimeoutError, type JsonFormat, type ListMonitorChecksOptions, type ListMonitorsOptions, type LocationConfig$1 as LocationConfig, type MapData, type MapOptions, type Monitor, type MonitorCheck, type MonitorCheckDetail, type MonitorCheckPage, type MonitorCrawlTarget, type MonitorEmailNotification, type MonitorNotification, type MonitorSchedule, type MonitorScrapeTarget, type MonitorSummary, type MonitorTarget, type MonitorWebhookConfig, type PDFAction, type PaginationConfig, type ParseFile, type ParseFileData, type ParseFormat, type ParseFormatOption, type ParseFormatString, type ParseOptions, type PressAction, type QueryFormat, type QuestionFormat, type QueueStatusResponse$1 as QueueStatusResponse, type ScrapeAction, type ScrapeBrowserDeleteResponse, type ScrapeExecuteRequest, type ScrapeExecuteResponse, type ScrapeOptions, type ScreenshotAction, type ScreenshotFormat, type ScrollAction, SdkError, type SearchData, type SearchRequest, type SearchResultImages, type SearchResultNews, type SearchResultWeb, type TokenUsage, type TokenUsageHistoricalPeriod, type TokenUsageHistoricalResponse, type UpdateMonitorRequest, type Viewport, type WaitAction, Watcher, type WatcherOptions, type WebhookConfig, type WriteAction, Firecrawl as default };
|