scrapfly-sdk 0.10.4 → 0.10.5
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/esm/browserconfig.d.ts +70 -1
- package/esm/browserconfig.d.ts.map +1 -1
- package/esm/browserconfig.js +44 -1
- package/esm/client.d.ts +33 -0
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js +33 -5
- package/esm/crawl.d.ts +4 -0
- package/esm/crawl.d.ts.map +1 -1
- package/esm/crawl.js +4 -0
- package/esm/crawlerresult.d.ts +7 -0
- package/esm/crawlerresult.d.ts.map +1 -1
- package/esm/errors.d.ts +43 -0
- package/esm/errors.d.ts.map +1 -1
- package/esm/errors.js +43 -16
- package/esm/extractionconfig.d.ts +54 -9
- package/esm/extractionconfig.d.ts.map +1 -1
- package/esm/extractionconfig.js +37 -13
- package/esm/logger.d.ts +1 -0
- package/esm/logger.d.ts.map +1 -1
- package/esm/logger.js +1 -0
- package/esm/main.d.ts +27 -0
- package/esm/main.d.ts.map +1 -1
- package/esm/main.js +27 -0
- package/esm/monitoringconfig.d.ts +48 -11
- package/esm/monitoringconfig.d.ts.map +1 -1
- package/esm/monitoringconfig.js +14 -0
- package/esm/result.d.ts +2 -0
- package/esm/result.d.ts.map +1 -1
- package/esm/scrapeconfig.d.ts +10 -8
- package/esm/scrapeconfig.d.ts.map +1 -1
- package/esm/scrapeconfig.js +10 -8
- package/esm/screenshotconfig.d.ts +59 -26
- package/esm/screenshotconfig.d.ts.map +1 -1
- package/esm/screenshotconfig.js +38 -26
- package/esm/webhookserver.d.ts +24 -0
- package/esm/webhookserver.d.ts.map +1 -1
- package/esm/webhookserver.js +24 -0
- package/package.json +1 -1
- package/script/browserconfig.d.ts +70 -1
- package/script/browserconfig.d.ts.map +1 -1
- package/script/browserconfig.js +44 -1
- package/script/client.d.ts +33 -0
- package/script/client.d.ts.map +1 -1
- package/script/client.js +33 -5
- package/script/crawl.d.ts +4 -0
- package/script/crawl.d.ts.map +1 -1
- package/script/crawl.js +4 -0
- package/script/crawlerresult.d.ts +7 -0
- package/script/crawlerresult.d.ts.map +1 -1
- package/script/errors.d.ts +43 -0
- package/script/errors.d.ts.map +1 -1
- package/script/errors.js +43 -16
- package/script/extractionconfig.d.ts +54 -9
- package/script/extractionconfig.d.ts.map +1 -1
- package/script/extractionconfig.js +37 -13
- package/script/logger.d.ts +1 -0
- package/script/logger.d.ts.map +1 -1
- package/script/logger.js +1 -0
- package/script/main.d.ts +27 -0
- package/script/main.d.ts.map +1 -1
- package/script/main.js +27 -0
- package/script/monitoringconfig.d.ts +48 -11
- package/script/monitoringconfig.d.ts.map +1 -1
- package/script/monitoringconfig.js +14 -0
- package/script/result.d.ts +2 -0
- package/script/result.d.ts.map +1 -1
- package/script/scrapeconfig.d.ts +10 -8
- package/script/scrapeconfig.d.ts.map +1 -1
- package/script/scrapeconfig.js +10 -8
- package/script/screenshotconfig.d.ts +59 -26
- package/script/screenshotconfig.d.ts.map +1 -1
- package/script/screenshotconfig.js +38 -26
- package/script/webhookserver.d.ts +24 -0
- package/script/webhookserver.d.ts.map +1 -1
- package/script/webhookserver.js +24 -0
- package/src/browserconfig.ts +70 -1
- package/src/client.ts +34 -6
- package/src/crawl.ts +4 -0
- package/src/crawlerresult.ts +7 -0
- package/src/errors.ts +43 -16
- package/src/extractionconfig.ts +58 -16
- package/src/logger.ts +2 -0
- package/src/main.ts +27 -0
- package/src/monitoringconfig.ts +49 -11
- package/src/result.ts +2 -0
- package/src/scrapeconfig.ts +10 -8
- package/src/screenshotconfig.ts +59 -26
- package/src/webhookserver.ts +24 -0
|
@@ -1,60 +1,129 @@
|
|
|
1
|
+
/** Proxy pool to use for the Cloud Browser session. */
|
|
1
2
|
export declare enum ProxyPool {
|
|
3
|
+
/** Datacenter proxies — fast and cheap; best for non-protected targets. */
|
|
2
4
|
DATACENTER = "datacenter",
|
|
5
|
+
/** Residential proxies — real ISP IPs; required by most anti-bot protections. */
|
|
3
6
|
RESIDENTIAL = "residential"
|
|
4
7
|
}
|
|
8
|
+
/** Operating system to emulate for the Cloud Browser session fingerprint. */
|
|
5
9
|
export declare enum OperatingSystem {
|
|
10
|
+
/** Emulate a Linux browser fingerprint. */
|
|
6
11
|
LINUX = "linux",
|
|
12
|
+
/** Emulate a Windows browser fingerprint. */
|
|
7
13
|
WINDOWS = "windows",
|
|
14
|
+
/** Emulate a macOS browser fingerprint. */
|
|
8
15
|
MACOS = "macos"
|
|
9
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* User-facing options accepted by {@link BrowserConfig}. All fields are
|
|
19
|
+
* optional; any field left undefined falls back to the Scrapfly Cloud
|
|
20
|
+
* Browser defaults.
|
|
21
|
+
*/
|
|
10
22
|
export type BrowserConfigOptions = {
|
|
23
|
+
/** Proxy pool to route the session through. */
|
|
11
24
|
proxy_pool?: ProxyPool | string;
|
|
25
|
+
/** Operating system fingerprint to emulate. */
|
|
12
26
|
os?: OperatingSystem | string;
|
|
27
|
+
/** Session ID for sticky sessions (IP + cookies reused across scrapes). */
|
|
13
28
|
session?: string;
|
|
29
|
+
/** ISO country code for geo-targeting. */
|
|
14
30
|
country?: string;
|
|
31
|
+
/** Close the browser automatically when the connection drops. */
|
|
15
32
|
auto_close?: boolean;
|
|
33
|
+
/** Session timeout in seconds (max 1800 = 30 minutes). */
|
|
16
34
|
timeout?: number;
|
|
35
|
+
/** Enable debug trace for the session. */
|
|
17
36
|
debug?: boolean;
|
|
37
|
+
/** Browser extensions to load (by ID). */
|
|
18
38
|
extensions?: string[];
|
|
39
|
+
/** Block image requests to speed up navigation. */
|
|
19
40
|
block_images?: boolean;
|
|
41
|
+
/** Block stylesheet requests. */
|
|
20
42
|
block_styles?: boolean;
|
|
43
|
+
/** Block font requests. */
|
|
21
44
|
block_fonts?: boolean;
|
|
45
|
+
/** Block media (video/audio) requests. */
|
|
22
46
|
block_media?: boolean;
|
|
47
|
+
/** Capture a screenshot at session end. */
|
|
23
48
|
screenshot?: boolean;
|
|
49
|
+
/** Viewport resolution, formatted as "widthxheight" (e.g. "1920x1080"). */
|
|
24
50
|
resolution?: string;
|
|
51
|
+
/** URL to navigate to after session start. */
|
|
25
52
|
target_url?: string;
|
|
53
|
+
/** Reuse cached responses where possible. */
|
|
26
54
|
cache?: boolean;
|
|
55
|
+
/** Apply Scrapfly's abuse blacklist. */
|
|
27
56
|
blacklist?: boolean;
|
|
57
|
+
/** Enable anti-scraping-protection bypass. */
|
|
28
58
|
unblock?: boolean;
|
|
59
|
+
/** Timeout in seconds for the unblock step. */
|
|
29
60
|
unblock_timeout?: number;
|
|
61
|
+
/** Browser brand to emulate (e.g. "chrome", "firefox"). */
|
|
30
62
|
browser_brand?: string;
|
|
63
|
+
/** Enable the MCP (Model Context Protocol) bridge. */
|
|
31
64
|
enable_mcp?: boolean;
|
|
32
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Configuration for a Scrapfly Cloud Browser session. Builds the
|
|
68
|
+
* WebSocket URL that clients such as Puppeteer or Playwright can
|
|
69
|
+
* connect to via CDP.
|
|
70
|
+
*/
|
|
33
71
|
export declare class BrowserConfig {
|
|
72
|
+
/** See {@link BrowserConfigOptions.proxy_pool}. */
|
|
34
73
|
proxy_pool?: string;
|
|
74
|
+
/** See {@link BrowserConfigOptions.os}. */
|
|
35
75
|
os?: string;
|
|
76
|
+
/** See {@link BrowserConfigOptions.session}. */
|
|
36
77
|
session?: string;
|
|
78
|
+
/** See {@link BrowserConfigOptions.country}. */
|
|
37
79
|
country?: string;
|
|
80
|
+
/** See {@link BrowserConfigOptions.auto_close}. */
|
|
38
81
|
auto_close?: boolean;
|
|
82
|
+
/** See {@link BrowserConfigOptions.timeout}. */
|
|
39
83
|
timeout?: number;
|
|
84
|
+
/** See {@link BrowserConfigOptions.debug}. */
|
|
40
85
|
debug?: boolean;
|
|
86
|
+
/** See {@link BrowserConfigOptions.extensions}. */
|
|
41
87
|
extensions?: string[];
|
|
88
|
+
/** See {@link BrowserConfigOptions.block_images}. */
|
|
42
89
|
block_images?: boolean;
|
|
90
|
+
/** See {@link BrowserConfigOptions.block_styles}. */
|
|
43
91
|
block_styles?: boolean;
|
|
92
|
+
/** See {@link BrowserConfigOptions.block_fonts}. */
|
|
44
93
|
block_fonts?: boolean;
|
|
94
|
+
/** See {@link BrowserConfigOptions.block_media}. */
|
|
45
95
|
block_media?: boolean;
|
|
96
|
+
/** See {@link BrowserConfigOptions.screenshot}. */
|
|
46
97
|
screenshot?: boolean;
|
|
98
|
+
/** See {@link BrowserConfigOptions.resolution}. */
|
|
47
99
|
resolution?: string;
|
|
100
|
+
/** See {@link BrowserConfigOptions.target_url}. */
|
|
48
101
|
target_url?: string;
|
|
102
|
+
/** See {@link BrowserConfigOptions.cache}. */
|
|
49
103
|
cache?: boolean;
|
|
104
|
+
/** See {@link BrowserConfigOptions.blacklist}. */
|
|
50
105
|
blacklist?: boolean;
|
|
106
|
+
/** See {@link BrowserConfigOptions.unblock}. */
|
|
51
107
|
unblock?: boolean;
|
|
108
|
+
/** See {@link BrowserConfigOptions.unblock_timeout}. */
|
|
52
109
|
unblock_timeout?: number;
|
|
110
|
+
/** See {@link BrowserConfigOptions.browser_brand}. */
|
|
53
111
|
browser_brand?: string;
|
|
112
|
+
/** See {@link BrowserConfigOptions.enable_mcp}. */
|
|
54
113
|
enable_mcp?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* @param options Session options. See {@link BrowserConfigOptions}.
|
|
116
|
+
* @throws `Error` if `timeout` exceeds the upper bound of 1800 seconds.
|
|
117
|
+
*/
|
|
55
118
|
constructor(options?: BrowserConfigOptions);
|
|
56
119
|
/**
|
|
57
|
-
*
|
|
120
|
+
* Build the WebSocket URL clients use to connect to the Cloud Browser
|
|
121
|
+
* session (compatible with Puppeteer `browserWSEndpoint` and the
|
|
122
|
+
* Playwright `connectOverCDP` API).
|
|
123
|
+
*
|
|
124
|
+
* @param apiKey Scrapfly API key.
|
|
125
|
+
* @param host Optional override for the Cloud Browser host (defaults to `wss://browser.scrapfly.io`).
|
|
126
|
+
* @returns A fully-qualified `wss://…` URL with all options encoded as query parameters.
|
|
58
127
|
*/
|
|
59
128
|
websocketUrl(apiKey: string, host?: string): string;
|
|
60
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browserconfig.d.ts","sourceRoot":"","sources":["../src/browserconfig.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,UAAU,eAAe;IACzB,WAAW,gBAAgB;CAC5B;AAED,oBAAY,eAAe;IACzB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC,EAAE,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,qBAAa,aAAa;IACxB,UAAU,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O,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qDAAqD;IACrD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oDAAoD;IACpD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mDAAmD;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,sDAAsD;IACtD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mDAAmD;IACnD,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;OAGG;gBACS,OAAO,GAAE,oBAAyB;IA2B9C;;;;;;;;OAQG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM;CA6BpD"}
|
package/script/browserconfig.js
CHANGED
|
@@ -1,139 +1,176 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BrowserConfig = exports.OperatingSystem = exports.ProxyPool = void 0;
|
|
4
|
+
/** Proxy pool to use for the Cloud Browser session. */
|
|
4
5
|
var ProxyPool;
|
|
5
6
|
(function (ProxyPool) {
|
|
7
|
+
/** Datacenter proxies — fast and cheap; best for non-protected targets. */
|
|
6
8
|
ProxyPool["DATACENTER"] = "datacenter";
|
|
9
|
+
/** Residential proxies — real ISP IPs; required by most anti-bot protections. */
|
|
7
10
|
ProxyPool["RESIDENTIAL"] = "residential";
|
|
8
11
|
})(ProxyPool || (exports.ProxyPool = ProxyPool = {}));
|
|
12
|
+
/** Operating system to emulate for the Cloud Browser session fingerprint. */
|
|
9
13
|
var OperatingSystem;
|
|
10
14
|
(function (OperatingSystem) {
|
|
15
|
+
/** Emulate a Linux browser fingerprint. */
|
|
11
16
|
OperatingSystem["LINUX"] = "linux";
|
|
17
|
+
/** Emulate a Windows browser fingerprint. */
|
|
12
18
|
OperatingSystem["WINDOWS"] = "windows";
|
|
19
|
+
/** Emulate a macOS browser fingerprint. */
|
|
13
20
|
OperatingSystem["MACOS"] = "macos";
|
|
14
21
|
})(OperatingSystem || (exports.OperatingSystem = OperatingSystem = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Configuration for a Scrapfly Cloud Browser session. Builds the
|
|
24
|
+
* WebSocket URL that clients such as Puppeteer or Playwright can
|
|
25
|
+
* connect to via CDP.
|
|
26
|
+
*/
|
|
15
27
|
class BrowserConfig {
|
|
28
|
+
/**
|
|
29
|
+
* @param options Session options. See {@link BrowserConfigOptions}.
|
|
30
|
+
* @throws `Error` if `timeout` exceeds the upper bound of 1800 seconds.
|
|
31
|
+
*/
|
|
16
32
|
constructor(options = {}) {
|
|
33
|
+
/** See {@link BrowserConfigOptions.proxy_pool}. */
|
|
17
34
|
Object.defineProperty(this, "proxy_pool", {
|
|
18
35
|
enumerable: true,
|
|
19
36
|
configurable: true,
|
|
20
37
|
writable: true,
|
|
21
38
|
value: void 0
|
|
22
39
|
});
|
|
40
|
+
/** See {@link BrowserConfigOptions.os}. */
|
|
23
41
|
Object.defineProperty(this, "os", {
|
|
24
42
|
enumerable: true,
|
|
25
43
|
configurable: true,
|
|
26
44
|
writable: true,
|
|
27
45
|
value: void 0
|
|
28
46
|
});
|
|
47
|
+
/** See {@link BrowserConfigOptions.session}. */
|
|
29
48
|
Object.defineProperty(this, "session", {
|
|
30
49
|
enumerable: true,
|
|
31
50
|
configurable: true,
|
|
32
51
|
writable: true,
|
|
33
52
|
value: void 0
|
|
34
53
|
});
|
|
54
|
+
/** See {@link BrowserConfigOptions.country}. */
|
|
35
55
|
Object.defineProperty(this, "country", {
|
|
36
56
|
enumerable: true,
|
|
37
57
|
configurable: true,
|
|
38
58
|
writable: true,
|
|
39
59
|
value: void 0
|
|
40
60
|
});
|
|
61
|
+
/** See {@link BrowserConfigOptions.auto_close}. */
|
|
41
62
|
Object.defineProperty(this, "auto_close", {
|
|
42
63
|
enumerable: true,
|
|
43
64
|
configurable: true,
|
|
44
65
|
writable: true,
|
|
45
66
|
value: void 0
|
|
46
67
|
});
|
|
68
|
+
/** See {@link BrowserConfigOptions.timeout}. */
|
|
47
69
|
Object.defineProperty(this, "timeout", {
|
|
48
70
|
enumerable: true,
|
|
49
71
|
configurable: true,
|
|
50
72
|
writable: true,
|
|
51
73
|
value: void 0
|
|
52
74
|
});
|
|
75
|
+
/** See {@link BrowserConfigOptions.debug}. */
|
|
53
76
|
Object.defineProperty(this, "debug", {
|
|
54
77
|
enumerable: true,
|
|
55
78
|
configurable: true,
|
|
56
79
|
writable: true,
|
|
57
80
|
value: void 0
|
|
58
81
|
});
|
|
82
|
+
/** See {@link BrowserConfigOptions.extensions}. */
|
|
59
83
|
Object.defineProperty(this, "extensions", {
|
|
60
84
|
enumerable: true,
|
|
61
85
|
configurable: true,
|
|
62
86
|
writable: true,
|
|
63
87
|
value: void 0
|
|
64
88
|
});
|
|
89
|
+
/** See {@link BrowserConfigOptions.block_images}. */
|
|
65
90
|
Object.defineProperty(this, "block_images", {
|
|
66
91
|
enumerable: true,
|
|
67
92
|
configurable: true,
|
|
68
93
|
writable: true,
|
|
69
94
|
value: void 0
|
|
70
95
|
});
|
|
96
|
+
/** See {@link BrowserConfigOptions.block_styles}. */
|
|
71
97
|
Object.defineProperty(this, "block_styles", {
|
|
72
98
|
enumerable: true,
|
|
73
99
|
configurable: true,
|
|
74
100
|
writable: true,
|
|
75
101
|
value: void 0
|
|
76
102
|
});
|
|
103
|
+
/** See {@link BrowserConfigOptions.block_fonts}. */
|
|
77
104
|
Object.defineProperty(this, "block_fonts", {
|
|
78
105
|
enumerable: true,
|
|
79
106
|
configurable: true,
|
|
80
107
|
writable: true,
|
|
81
108
|
value: void 0
|
|
82
109
|
});
|
|
110
|
+
/** See {@link BrowserConfigOptions.block_media}. */
|
|
83
111
|
Object.defineProperty(this, "block_media", {
|
|
84
112
|
enumerable: true,
|
|
85
113
|
configurable: true,
|
|
86
114
|
writable: true,
|
|
87
115
|
value: void 0
|
|
88
116
|
});
|
|
117
|
+
/** See {@link BrowserConfigOptions.screenshot}. */
|
|
89
118
|
Object.defineProperty(this, "screenshot", {
|
|
90
119
|
enumerable: true,
|
|
91
120
|
configurable: true,
|
|
92
121
|
writable: true,
|
|
93
122
|
value: void 0
|
|
94
123
|
});
|
|
124
|
+
/** See {@link BrowserConfigOptions.resolution}. */
|
|
95
125
|
Object.defineProperty(this, "resolution", {
|
|
96
126
|
enumerable: true,
|
|
97
127
|
configurable: true,
|
|
98
128
|
writable: true,
|
|
99
129
|
value: void 0
|
|
100
130
|
});
|
|
131
|
+
/** See {@link BrowserConfigOptions.target_url}. */
|
|
101
132
|
Object.defineProperty(this, "target_url", {
|
|
102
133
|
enumerable: true,
|
|
103
134
|
configurable: true,
|
|
104
135
|
writable: true,
|
|
105
136
|
value: void 0
|
|
106
137
|
});
|
|
138
|
+
/** See {@link BrowserConfigOptions.cache}. */
|
|
107
139
|
Object.defineProperty(this, "cache", {
|
|
108
140
|
enumerable: true,
|
|
109
141
|
configurable: true,
|
|
110
142
|
writable: true,
|
|
111
143
|
value: void 0
|
|
112
144
|
});
|
|
145
|
+
/** See {@link BrowserConfigOptions.blacklist}. */
|
|
113
146
|
Object.defineProperty(this, "blacklist", {
|
|
114
147
|
enumerable: true,
|
|
115
148
|
configurable: true,
|
|
116
149
|
writable: true,
|
|
117
150
|
value: void 0
|
|
118
151
|
});
|
|
152
|
+
/** See {@link BrowserConfigOptions.unblock}. */
|
|
119
153
|
Object.defineProperty(this, "unblock", {
|
|
120
154
|
enumerable: true,
|
|
121
155
|
configurable: true,
|
|
122
156
|
writable: true,
|
|
123
157
|
value: void 0
|
|
124
158
|
});
|
|
159
|
+
/** See {@link BrowserConfigOptions.unblock_timeout}. */
|
|
125
160
|
Object.defineProperty(this, "unblock_timeout", {
|
|
126
161
|
enumerable: true,
|
|
127
162
|
configurable: true,
|
|
128
163
|
writable: true,
|
|
129
164
|
value: void 0
|
|
130
165
|
});
|
|
166
|
+
/** See {@link BrowserConfigOptions.browser_brand}. */
|
|
131
167
|
Object.defineProperty(this, "browser_brand", {
|
|
132
168
|
enumerable: true,
|
|
133
169
|
configurable: true,
|
|
134
170
|
writable: true,
|
|
135
171
|
value: void 0
|
|
136
172
|
});
|
|
173
|
+
/** See {@link BrowserConfigOptions.enable_mcp}. */
|
|
137
174
|
Object.defineProperty(this, "enable_mcp", {
|
|
138
175
|
enumerable: true,
|
|
139
176
|
configurable: true,
|
|
@@ -166,7 +203,13 @@ class BrowserConfig {
|
|
|
166
203
|
this.enable_mcp = options.enable_mcp;
|
|
167
204
|
}
|
|
168
205
|
/**
|
|
169
|
-
*
|
|
206
|
+
* Build the WebSocket URL clients use to connect to the Cloud Browser
|
|
207
|
+
* session (compatible with Puppeteer `browserWSEndpoint` and the
|
|
208
|
+
* Playwright `connectOverCDP` API).
|
|
209
|
+
*
|
|
210
|
+
* @param apiKey Scrapfly API key.
|
|
211
|
+
* @param host Optional override for the Cloud Browser host (defaults to `wss://browser.scrapfly.io`).
|
|
212
|
+
* @returns A fully-qualified `wss://…` URL with all options encoded as query parameters.
|
|
170
213
|
*/
|
|
171
214
|
websocketUrl(apiKey, host) {
|
|
172
215
|
const params = new URLSearchParams();
|
package/script/client.d.ts
CHANGED
|
@@ -9,15 +9,34 @@ import type { Rec } from './types.js';
|
|
|
9
9
|
import type { CrawlerConfig, CrawlerContentFormat } from './crawlerconfig.js';
|
|
10
10
|
import { CrawlerArtifact, type CrawlerArtifactType, CrawlerContents, CrawlerStatus, CrawlerUrls } from './crawlerresult.js';
|
|
11
11
|
import { type CloudBrowserMonitoringOptions, type MonitoringMetricsOptions, type MonitoringTargetMetricsOptions } from './monitoringconfig.js';
|
|
12
|
+
/**
|
|
13
|
+
* Main entry point for the Scrapfly SDK.
|
|
14
|
+
*
|
|
15
|
+
* A single `ScrapflyClient` can be used to call every Scrapfly API
|
|
16
|
+
* (scrape, screenshot, extraction, crawler, monitoring, cloud browser).
|
|
17
|
+
* It is safe to share one instance across concurrent calls.
|
|
18
|
+
*/
|
|
12
19
|
export declare class ScrapflyClient {
|
|
20
|
+
/** Base URL of the Scrapfly REST API. */
|
|
13
21
|
HOST: string;
|
|
22
|
+
/** Default Cloud Browser WebSocket host. */
|
|
14
23
|
CLOUD_BROWSER_HOST: string;
|
|
24
|
+
/** Default Cloud Browser REST host (derived from the WS host). */
|
|
15
25
|
CLOUD_BROWSER_API_HOST: string;
|
|
16
26
|
private key;
|
|
17
27
|
private ua;
|
|
18
28
|
private cloudBrowserHost;
|
|
19
29
|
private cloudBrowserApiHost;
|
|
30
|
+
/** `fetch` implementation used by the client. Override for custom retries/tracing. */
|
|
20
31
|
fetch: typeof fetchRetry;
|
|
32
|
+
/**
|
|
33
|
+
* Create a Scrapfly client.
|
|
34
|
+
*
|
|
35
|
+
* @param options.key Scrapfly API key.
|
|
36
|
+
* @param options.host Optional override for the REST API host.
|
|
37
|
+
* @param options.cloudBrowserHost Optional override for the Cloud Browser WS host.
|
|
38
|
+
* @throws {@link errors.BadApiKeyError} if `options.key` is not a non-empty string.
|
|
39
|
+
*/
|
|
21
40
|
constructor(options: {
|
|
22
41
|
key: string;
|
|
23
42
|
host?: string;
|
|
@@ -48,19 +67,33 @@ export declare class ScrapflyClient {
|
|
|
48
67
|
* https://scrapfly.io/docs/scrape-api/classify for the full contract.
|
|
49
68
|
*/
|
|
50
69
|
classify(options: ClassifyOptions): Promise<ClassifyResult>;
|
|
70
|
+
/** Dispatch an HTTP GET against a Monitoring API path with the given query params, parsing errors. */
|
|
51
71
|
private monitoringRequest;
|
|
72
|
+
/** Build the query string for a request-based Monitoring API metrics endpoint. */
|
|
52
73
|
private buildMetricsParams;
|
|
74
|
+
/** Build the query string for a per-target Monitoring API endpoint. */
|
|
53
75
|
private buildTargetParams;
|
|
76
|
+
/** Fetch Web Scraping API monitoring metrics (aggregate). */
|
|
54
77
|
getMonitoringMetrics(options?: MonitoringMetricsOptions): Promise<Rec<any>>;
|
|
78
|
+
/** Fetch Web Scraping API monitoring metrics for a single target domain. */
|
|
55
79
|
getMonitoringTargetMetrics(options: MonitoringTargetMetricsOptions): Promise<Rec<any>>;
|
|
80
|
+
/** Fetch Screenshot API monitoring metrics (aggregate). */
|
|
56
81
|
getScreenshotMonitoringMetrics(options?: MonitoringMetricsOptions): Promise<Rec<any>>;
|
|
82
|
+
/** Fetch Screenshot API monitoring metrics for a single target domain. */
|
|
57
83
|
getScreenshotMonitoringTargetMetrics(options: MonitoringTargetMetricsOptions): Promise<Rec<any>>;
|
|
84
|
+
/** Fetch Extraction API monitoring metrics (aggregate). */
|
|
58
85
|
getExtractionMonitoringMetrics(options?: MonitoringMetricsOptions): Promise<Rec<any>>;
|
|
86
|
+
/** Fetch Extraction API monitoring metrics for a single target domain. */
|
|
59
87
|
getExtractionMonitoringTargetMetrics(options: MonitoringTargetMetricsOptions): Promise<Rec<any>>;
|
|
88
|
+
/** Fetch Crawler API monitoring metrics (aggregate). */
|
|
60
89
|
getCrawlerMonitoringMetrics(options?: MonitoringMetricsOptions): Promise<Rec<any>>;
|
|
90
|
+
/** Fetch Crawler API monitoring metrics for a single target domain. */
|
|
61
91
|
getCrawlerMonitoringTargetMetrics(options: MonitoringTargetMetricsOptions): Promise<Rec<any>>;
|
|
92
|
+
/** Fetch Cloud Browser monitoring metrics (session-based aggregate). */
|
|
62
93
|
getBrowserMonitoringMetrics(options?: CloudBrowserMonitoringOptions): Promise<Rec<any>>;
|
|
94
|
+
/** Fetch Cloud Browser monitoring timeseries (per-minute session usage). */
|
|
63
95
|
getBrowserMonitoringTimeseries(options?: CloudBrowserMonitoringOptions): Promise<Rec<any>>;
|
|
96
|
+
/** Build the query string for the session-based Cloud Browser Monitoring endpoints. */
|
|
64
97
|
private buildBrowserParams;
|
|
65
98
|
/**
|
|
66
99
|
* Issue a single scrape command from a given scrape configuration
|
package/script/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,KAAK,cAAc,EAAE,gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE5I,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;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
|
|
|
33
33
|
const logger_js_1 = require("./logger.js");
|
|
34
34
|
const crawlerresult_js_1 = require("./crawlerresult.js");
|
|
35
35
|
const monitoringconfig_js_1 = require("./monitoringconfig.js");
|
|
36
|
+
/**
|
|
37
|
+
* Main entry point for the Scrapfly SDK.
|
|
38
|
+
*
|
|
39
|
+
* A single `ScrapflyClient` can be used to call every Scrapfly API
|
|
40
|
+
* (scrape, screenshot, extraction, crawler, monitoring, cloud browser).
|
|
41
|
+
* It is safe to share one instance across concurrent calls.
|
|
42
|
+
*/
|
|
36
43
|
class ScrapflyClient {
|
|
44
|
+
/**
|
|
45
|
+
* Create a Scrapfly client.
|
|
46
|
+
*
|
|
47
|
+
* @param options.key Scrapfly API key.
|
|
48
|
+
* @param options.host Optional override for the REST API host.
|
|
49
|
+
* @param options.cloudBrowserHost Optional override for the Cloud Browser WS host.
|
|
50
|
+
* @throws {@link errors.BadApiKeyError} if `options.key` is not a non-empty string.
|
|
51
|
+
*/
|
|
37
52
|
constructor(options) {
|
|
53
|
+
/** Base URL of the Scrapfly REST API. */
|
|
38
54
|
Object.defineProperty(this, "HOST", {
|
|
39
55
|
enumerable: true,
|
|
40
56
|
configurable: true,
|
|
41
57
|
writable: true,
|
|
42
58
|
value: 'https://api.scrapfly.io'
|
|
43
59
|
});
|
|
60
|
+
/** Default Cloud Browser WebSocket host. */
|
|
44
61
|
Object.defineProperty(this, "CLOUD_BROWSER_HOST", {
|
|
45
62
|
enumerable: true,
|
|
46
63
|
configurable: true,
|
|
47
64
|
writable: true,
|
|
48
65
|
value: 'wss://browser.scrapfly.io'
|
|
49
66
|
});
|
|
67
|
+
/** Default Cloud Browser REST host (derived from the WS host). */
|
|
50
68
|
Object.defineProperty(this, "CLOUD_BROWSER_API_HOST", {
|
|
51
69
|
enumerable: true,
|
|
52
70
|
configurable: true,
|
|
@@ -77,6 +95,7 @@ class ScrapflyClient {
|
|
|
77
95
|
writable: true,
|
|
78
96
|
value: void 0
|
|
79
97
|
});
|
|
98
|
+
/** `fetch` implementation used by the client. Override for custom retries/tracing. */
|
|
80
99
|
Object.defineProperty(this, "fetch", {
|
|
81
100
|
enumerable: true,
|
|
82
101
|
configurable: true,
|
|
@@ -320,6 +339,7 @@ class ScrapflyClient {
|
|
|
320
339
|
// one shape (request-based) but live under different URL prefixes;
|
|
321
340
|
// Cloud Browser is session-based and exposes a distinct shape.
|
|
322
341
|
// See https://scrapfly.io/docs/monitoring#api
|
|
342
|
+
/** Dispatch an HTTP GET against a Monitoring API path with the given query params, parsing errors. */
|
|
323
343
|
async monitoringRequest(path, params) {
|
|
324
344
|
const url = new URL(this.HOST + path);
|
|
325
345
|
url.search = new URLSearchParams(params).toString();
|
|
@@ -341,6 +361,7 @@ class ScrapflyClient {
|
|
|
341
361
|
}
|
|
342
362
|
return data;
|
|
343
363
|
}
|
|
364
|
+
/** Build the query string for a request-based Monitoring API metrics endpoint. */
|
|
344
365
|
buildMetricsParams(options) {
|
|
345
366
|
const params = {
|
|
346
367
|
key: this.key,
|
|
@@ -355,6 +376,7 @@ class ScrapflyClient {
|
|
|
355
376
|
params.include_webhook = 'true';
|
|
356
377
|
return params;
|
|
357
378
|
}
|
|
379
|
+
/** Build the query string for a per-target Monitoring API endpoint. */
|
|
358
380
|
buildTargetParams(options) {
|
|
359
381
|
if ((options.start && !options.end) || (!options.start && options.end)) {
|
|
360
382
|
throw new Error('You must provide both start and end date');
|
|
@@ -378,41 +400,47 @@ class ScrapflyClient {
|
|
|
378
400
|
params.include_webhook = 'true';
|
|
379
401
|
return params;
|
|
380
402
|
}
|
|
381
|
-
|
|
403
|
+
/** Fetch Web Scraping API monitoring metrics (aggregate). */
|
|
382
404
|
async getMonitoringMetrics(options = {}) {
|
|
383
405
|
return this.monitoringRequest('/scrape/monitoring/metrics', this.buildMetricsParams(options));
|
|
384
406
|
}
|
|
407
|
+
/** Fetch Web Scraping API monitoring metrics for a single target domain. */
|
|
385
408
|
async getMonitoringTargetMetrics(options) {
|
|
386
409
|
return this.monitoringRequest('/scrape/monitoring/metrics/target', this.buildTargetParams(options));
|
|
387
410
|
}
|
|
388
|
-
|
|
411
|
+
/** Fetch Screenshot API monitoring metrics (aggregate). */
|
|
389
412
|
async getScreenshotMonitoringMetrics(options = {}) {
|
|
390
413
|
return this.monitoringRequest('/screenshot/monitoring/metrics', this.buildMetricsParams(options));
|
|
391
414
|
}
|
|
415
|
+
/** Fetch Screenshot API monitoring metrics for a single target domain. */
|
|
392
416
|
async getScreenshotMonitoringTargetMetrics(options) {
|
|
393
417
|
return this.monitoringRequest('/screenshot/monitoring/metrics/target', this.buildTargetParams(options));
|
|
394
418
|
}
|
|
395
|
-
|
|
419
|
+
/** Fetch Extraction API monitoring metrics (aggregate). */
|
|
396
420
|
async getExtractionMonitoringMetrics(options = {}) {
|
|
397
421
|
return this.monitoringRequest('/extraction/monitoring/metrics', this.buildMetricsParams(options));
|
|
398
422
|
}
|
|
423
|
+
/** Fetch Extraction API monitoring metrics for a single target domain. */
|
|
399
424
|
async getExtractionMonitoringTargetMetrics(options) {
|
|
400
425
|
return this.monitoringRequest('/extraction/monitoring/metrics/target', this.buildTargetParams(options));
|
|
401
426
|
}
|
|
402
|
-
|
|
427
|
+
/** Fetch Crawler API monitoring metrics (aggregate). */
|
|
403
428
|
async getCrawlerMonitoringMetrics(options = {}) {
|
|
404
429
|
return this.monitoringRequest('/crawl/monitoring/metrics', this.buildMetricsParams(options));
|
|
405
430
|
}
|
|
431
|
+
/** Fetch Crawler API monitoring metrics for a single target domain. */
|
|
406
432
|
async getCrawlerMonitoringTargetMetrics(options) {
|
|
407
433
|
return this.monitoringRequest('/crawl/monitoring/metrics/target', this.buildTargetParams(options));
|
|
408
434
|
}
|
|
409
|
-
|
|
435
|
+
/** Fetch Cloud Browser monitoring metrics (session-based aggregate). */
|
|
410
436
|
async getBrowserMonitoringMetrics(options = {}) {
|
|
411
437
|
return this.monitoringRequest('/browser/monitoring/metrics', this.buildBrowserParams(options));
|
|
412
438
|
}
|
|
439
|
+
/** Fetch Cloud Browser monitoring timeseries (per-minute session usage). */
|
|
413
440
|
async getBrowserMonitoringTimeseries(options = {}) {
|
|
414
441
|
return this.monitoringRequest('/browser/monitoring/metrics/timeseries', this.buildBrowserParams(options));
|
|
415
442
|
}
|
|
443
|
+
/** Build the query string for the session-based Cloud Browser Monitoring endpoints. */
|
|
416
444
|
buildBrowserParams(options) {
|
|
417
445
|
if ((options.start && !options.end) || (!options.start && options.end)) {
|
|
418
446
|
throw new Error('You must provide both start and end date');
|
package/script/crawl.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export declare class Crawl {
|
|
|
38
38
|
private _uuid?;
|
|
39
39
|
private _status?;
|
|
40
40
|
private readonly _artifactCache;
|
|
41
|
+
/**
|
|
42
|
+
* @param client Configured {@link ScrapflyClient} that performs the HTTP calls.
|
|
43
|
+
* @param config Crawler configuration to submit on {@link Crawl.start}.
|
|
44
|
+
*/
|
|
41
45
|
constructor(client: ScrapflyClient, config: CrawlerConfig);
|
|
42
46
|
/** The crawler UUID returned by the API after `start()`, or undefined before. */
|
|
43
47
|
get uuid(): string | undefined;
|
package/script/crawl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../src/crawl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EACV,eAAe,EAGf,aAAa,EACb,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,KAAK;
|
|
1
|
+
{"version":3,"file":"crawl.d.ts","sourceRoot":"","sources":["../src/crawl.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAA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AAG,OAAO,CAAC,WAAW,CAAC;IAKxB;;;;;;OAMG;IACG,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,oBAA6B,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAetF;;;;OAIG;IACG,SAAS,CACb,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,oBAAoB,EAAa,GACzC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAKlD;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,eAAe,CAAC;IAStC;;OAEG;IACG,GAAG,IAAI,OAAO,CAAC,eAAe,CAAC;CAQtC"}
|
package/script/crawl.js
CHANGED
|
@@ -58,6 +58,10 @@ const logger_js_1 = require("./logger.js");
|
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
60
|
class Crawl {
|
|
61
|
+
/**
|
|
62
|
+
* @param client Configured {@link ScrapflyClient} that performs the HTTP calls.
|
|
63
|
+
* @param config Crawler configuration to submit on {@link Crawl.start}.
|
|
64
|
+
*/
|
|
61
65
|
constructor(client, config) {
|
|
62
66
|
Object.defineProperty(this, "client", {
|
|
63
67
|
enumerable: true,
|
|
@@ -19,12 +19,19 @@ export type CrawlerStopReason = 'no_more_urls' | 'page_limit' | 'max_duration' |
|
|
|
19
19
|
* `duration` is always a number (0 when nothing has happened yet).
|
|
20
20
|
*/
|
|
21
21
|
export interface CrawlerState {
|
|
22
|
+
/** Number of URLs the crawler has fetched. */
|
|
22
23
|
urls_visited: number;
|
|
24
|
+
/** Number of URLs from which content or links were extracted. */
|
|
23
25
|
urls_extracted: number;
|
|
26
|
+
/** Number of URLs that failed to fetch. */
|
|
24
27
|
urls_failed: number;
|
|
28
|
+
/** Number of URLs skipped (filtered out, duplicate, limit hit, ...). */
|
|
25
29
|
urls_skipped: number;
|
|
30
|
+
/** Number of URLs queued for future fetch. */
|
|
26
31
|
urls_to_crawl: number;
|
|
32
|
+
/** API credits consumed so far. */
|
|
27
33
|
api_credit_used: number;
|
|
34
|
+
/** Elapsed time in seconds since the crawl started (0 while PENDING). */
|
|
28
35
|
duration: number;
|
|
29
36
|
/** `null` until the crawler stops. */
|
|
30
37
|
stop_reason: CrawlerStopReason | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crawlerresult.d.ts","sourceRoot":"","sources":["../src/crawlerresult.ts"],"names":[],"mappings":"AAoDA;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,cAAc,GACd,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,iBAAiB,GACjB,gBAAgB,GAChB,eAAe,GACf,oBAAoB,GACpB,eAAe,CAAC;AAEpB;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtC,2EAA2E;IAC3E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,sCAAsC;IACtC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,qEAAqE;IACrE,UAAU,EAAE,OAAO,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,YAAY,CAAC;gBAER,IAAI,EAAE,MAAM,CAA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