@crawlbrulee/sdk 0.7.0 → 0.8.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/index.d.cts CHANGED
@@ -1,30 +1,31 @@
1
+ //#region src/http.d.ts
1
2
  /** HTTP methods used by the SDK. */
2
3
  type HttpMethod = 'GET' | 'POST';
3
4
  /** Options the SDK accepts at construction time for the HTTP layer. */
4
5
  interface HttpClientOptions {
5
- /** API key sent as `Authorization: Bearer <key>`. */
6
- apiKey: string;
7
- /**
8
- * Override the base URL. Trailing slashes are stripped. Falls back to
9
- * {@link CwblInstrumentation.getBaseUrl} (which resolves to the production
10
- * host) when unset.
11
- */
12
- baseUrl?: string;
13
- /**
14
- * Per-request timeout in milliseconds. Pass `0` (or omit) to disable the
15
- * timeout entirely.
16
- */
17
- timeoutMs?: number;
6
+ /** API key sent as `Authorization: Bearer <key>`. */
7
+ apiKey: string;
8
+ /**
9
+ * Override the base URL. Trailing slashes are stripped. Falls back to
10
+ * {@link CwblInstrumentation.getBaseUrl} (which resolves to the production
11
+ * host) when unset.
12
+ */
13
+ baseUrl?: string;
14
+ /**
15
+ * Per-request timeout in milliseconds. Pass `0` (or omit) to disable the
16
+ * timeout entirely.
17
+ */
18
+ timeoutMs?: number;
18
19
  }
19
20
  /** Per-call overrides accepted on every resource method. */
20
21
  interface RequestOptions {
21
- /** Abort the request when this signal fires. Composable with the timeout. */
22
- signal?: AbortSignal;
23
- /**
24
- * Override the constructor-level `timeoutMs` for this call. Pass `0` to
25
- * disable the timeout for this call.
26
- */
27
- timeoutMs?: number;
22
+ /** Abort the request when this signal fires. Composable with the timeout. */
23
+ signal?: AbortSignal;
24
+ /**
25
+ * Override the constructor-level `timeoutMs` for this call. Pass `0` to
26
+ * disable the timeout for this call.
27
+ */
28
+ timeoutMs?: number;
28
29
  }
29
30
  /**
30
31
  * Minimal `fetch`-based HTTP layer used by {@link Crawlbrulee}. Handles:
@@ -43,27 +44,28 @@ interface RequestOptions {
43
44
  * module.
44
45
  */
45
46
  declare class HttpClient {
46
- readonly baseUrl: string;
47
- private readonly apiKey;
48
- private readonly fetch;
49
- private readonly timeoutMs;
50
- constructor(options: HttpClientOptions);
51
- /** Send a `GET` request and parse the response as `T`. */
52
- get<T>(path: string, options?: RequestOptions): Promise<T>;
53
- /** Send a `POST` request with a JSON body and parse the response as `T`. */
54
- post<T>(path: string, body: unknown, options?: RequestOptions): Promise<T>;
55
- private send;
56
- private buildUrl;
57
- private buildHeaders;
58
- /**
59
- * Build a single `AbortSignal` that fires when either the caller-supplied
60
- * signal aborts OR the per-request timeout elapses. The returned `cleanup`
61
- * callback MUST be invoked on every exit path so we don't leak timers or
62
- * dead listeners on long-lived caller signals.
63
- */
64
- private composeSignal;
47
+ readonly baseUrl: string;
48
+ private readonly apiKey;
49
+ private readonly fetch;
50
+ private readonly timeoutMs;
51
+ constructor(options: HttpClientOptions);
52
+ /** Send a `GET` request and parse the response as `T`. */
53
+ get<T>(path: string, options?: RequestOptions): Promise<T>;
54
+ /** Send a `POST` request with a JSON body and parse the response as `T`. */
55
+ post<T>(path: string, body: unknown, options?: RequestOptions): Promise<T>;
56
+ private send;
57
+ private buildUrl;
58
+ private buildHeaders;
59
+ /**
60
+ * Build a single `AbortSignal` that fires when either the caller-supplied
61
+ * signal aborts OR the per-request timeout elapses. The returned `cleanup`
62
+ * callback MUST be invoked on every exit path so we don't leak timers or
63
+ * dead listeners on long-lived caller signals.
64
+ */
65
+ private composeSignal;
65
66
  }
66
-
67
+ //#endregion
68
+ //#region src/types/common.d.ts
67
69
  /**
68
70
  * Shared primitive types used across crawlbrulee request and response shapes.
69
71
  */
@@ -89,15 +91,15 @@ type ResolvedProxyTier = 'basic' | 'advanced';
89
91
  * responses report this on `response_meta.usage`.
90
92
  */
91
93
  interface Usage {
92
- /**
93
- * Credits charged for this operation. `0` on a cache hit (no fresh fetch was
94
- * performed).
95
- */
96
- credits: number;
97
- /** The proxy tier the server resolved and used (never `auto`). */
98
- proxy: ResolvedProxyTier;
99
- /** Whether the result was served from cache (no fresh fetch). */
100
- cache_hit: boolean;
94
+ /**
95
+ * Credits charged for this operation. `0` on a cache hit (no fresh fetch was
96
+ * performed).
97
+ */
98
+ credits: number;
99
+ /** The proxy tier the server resolved and used (never `auto`). */
100
+ proxy: ResolvedProxyTier;
101
+ /** Whether the result was served from cache (no fresh fetch). */
102
+ cache_hit: boolean;
101
103
  }
102
104
  /**
103
105
  * Response envelope `response_meta` carried by scrape responses and async-status
@@ -105,8 +107,8 @@ interface Usage {
105
107
  * responses extend this shape with `pagination` + `truncation`.
106
108
  */
107
109
  interface ResponseMeta {
108
- /** Usage accounting for the operation. */
109
- usage: Usage;
110
+ /** Usage accounting for the operation. */
111
+ usage: Usage;
110
112
  }
111
113
  /** Screenshot capture mode: visible viewport or the full scrollable page. */
112
114
  type ScreenshotType = 'viewport' | 'full_page';
@@ -114,23 +116,23 @@ type ScreenshotType = 'viewport' | 'full_page';
114
116
  type ScreenshotDeviceMode = 'desktop' | 'mobile';
115
117
  /** Pre-capture cleanup options applied to the page before the screenshot. */
116
118
  interface ScreenshotCleanup {
117
- /**
118
- * Remove ads, cookie banners, and popups before capturing. Defaults to
119
- * `true` server-side.
120
- */
121
- ads_and_popups?: boolean;
119
+ /**
120
+ * Remove ads, cookie banners, and popups before capturing. Defaults to
121
+ * `true` server-side.
122
+ */
123
+ ads_and_popups?: boolean;
122
124
  }
123
125
  /** A `wait` action: pause for `ms` milliseconds before the next step. */
124
126
  interface ScreenshotWaitAction {
125
- type: 'wait';
126
- /** Milliseconds to wait. Must be a non-negative integer. */
127
- ms: number;
127
+ type: 'wait';
128
+ /** Milliseconds to wait. Must be a non-negative integer. */
129
+ ms: number;
128
130
  }
129
131
  /** A `scroll` action: scroll the page by `pixels` (positive = down). */
130
132
  interface ScreenshotScrollAction {
131
- type: 'scroll';
132
- /** Pixels to scroll. Positive scrolls down, negative scrolls up. */
133
- pixels: number;
133
+ type: 'scroll';
134
+ /** Pixels to scroll. Positive scrolls down, negative scrolls up. */
135
+ pixels: number;
134
136
  }
135
137
  /**
136
138
  * Actions performed before the screenshot is taken. The server caps the total
@@ -143,37 +145,37 @@ type ScreenshotBeforeAction = ScreenshotWaitAction | ScreenshotScrollAction;
143
145
  * supported — it cuts the screenshot into horizontal tiles of `height` px.
144
146
  */
145
147
  interface ScreenshotSliceAction {
146
- type: 'slice';
147
- /** Tile height in pixels. Minimum 500. */
148
- height: number;
148
+ type: 'slice';
149
+ /** Tile height in pixels. Minimum 500. */
150
+ height: number;
149
151
  }
150
152
  type ScreenshotAfterAction = ScreenshotSliceAction;
151
153
  /** Custom browser viewport dimensions used during a screenshot capture. */
152
154
  interface ScreenshotViewport {
153
- /** Viewport width in pixels. Integer in `[16, 10000]`; out-of-range values are rejected with a 400. */
154
- width: number;
155
- /** Viewport height in pixels. Integer in `[16, 10000]`; out-of-range values are rejected with a 400. */
156
- height: number;
157
- /**
158
- * Device pixel ratio (e.g. 2 for retina). Fractional values are allowed;
159
- * must be in `[1, 4]`. Defaults to 1 server-side.
160
- */
161
- device_scale_factor?: number;
155
+ /** Viewport width in pixels. Integer in `[16, 10000]`; out-of-range values are rejected with a 400. */
156
+ width: number;
157
+ /** Viewport height in pixels. Integer in `[16, 10000]`; out-of-range values are rejected with a 400. */
158
+ height: number;
159
+ /**
160
+ * Device pixel ratio (e.g. 2 for retina). Fractional values are allowed;
161
+ * must be in `[1, 4]`. Defaults to 1 server-side.
162
+ */
163
+ device_scale_factor?: number;
162
164
  }
163
165
  /** Screenshot capture configuration. Pass this on `extract.screenshot`. */
164
166
  interface ScreenshotRequest {
165
- /** Capture mode: `viewport` (visible only) or `full_page`. */
166
- type: ScreenshotType;
167
- /** Custom viewport. If omitted, the `device_mode` defaults are used. */
168
- viewport?: ScreenshotViewport;
169
- /** Emulate desktop or mobile. Defaults to `desktop`. */
170
- device_mode?: ScreenshotDeviceMode;
171
- /** Page cleanup applied before capture. */
172
- cleanup?: ScreenshotCleanup;
173
- /** Pre-capture actions (waits and scrolls). Maximum 5 entries. */
174
- actions_before?: ScreenshotBeforeAction[];
175
- /** Post-capture actions (e.g. slice into tiles). Maximum 1 entry. */
176
- actions_after?: ScreenshotAfterAction[];
167
+ /** Capture mode: `viewport` (visible only) or `full_page`. */
168
+ type: ScreenshotType;
169
+ /** Custom viewport. If omitted, the `device_mode` defaults are used. */
170
+ viewport?: ScreenshotViewport;
171
+ /** Emulate desktop or mobile. Defaults to `desktop`. */
172
+ device_mode?: ScreenshotDeviceMode;
173
+ /** Page cleanup applied before capture. */
174
+ cleanup?: ScreenshotCleanup;
175
+ /** Pre-capture actions (waits and scrolls). Maximum 5 entries. */
176
+ actions_before?: ScreenshotBeforeAction[];
177
+ /** Post-capture actions (e.g. slice into tiles). Maximum 1 entry. */
178
+ actions_after?: ScreenshotAfterAction[];
177
179
  }
178
180
  /**
179
181
  * Machine-readable error names returned by the crawlbrulee API. Stable
@@ -184,117 +186,118 @@ type ApiErrorName = 'usage_allocation_error' | 'request_timeout' | 'invalid_url'
184
186
  type UsageAllocationReason = 'credit_limit' | 'concurrency_limit' | 'overage_hard_cap' | 'duplicate_reservation' | 'internal_error';
185
187
  /** Snapshot of the org's current usage at the moment the error was raised. */
186
188
  interface UsageLimitDetails {
187
- /** Current credit usage in the billing period. */
188
- current_usage?: number;
189
- /** Credits currently reserved by in-flight jobs. */
190
- current_reserved?: number;
191
- /** Maximum credits allowed in the billing period. */
192
- max_credits?: number;
193
- /** Number of currently running concurrent jobs. */
194
- current_concurrent?: number;
195
- /** Maximum concurrent jobs allowed. */
196
- max_concurrent?: number;
189
+ /** Current credit usage in the billing period. */
190
+ current_usage?: number;
191
+ /** Credits currently reserved by in-flight jobs. */
192
+ current_reserved?: number;
193
+ /** Maximum credits allowed in the billing period. */
194
+ max_credits?: number;
195
+ /** Number of currently running concurrent jobs. */
196
+ current_concurrent?: number;
197
+ /** Maximum concurrent jobs allowed. */
198
+ max_concurrent?: number;
197
199
  }
198
200
  /** Discriminated detail for `error_name = usage_allocation_error`. */
199
201
  interface UsageAllocationErrorDetails {
200
- error_name: 'usage_allocation_error';
201
- reason: UsageAllocationReason;
202
- details?: UsageLimitDetails;
202
+ error_name: 'usage_allocation_error';
203
+ reason: UsageAllocationReason;
204
+ details?: UsageLimitDetails;
203
205
  }
204
206
  /** Discriminated detail for `error_name = too_many_requests`. */
205
207
  interface RateLimitErrorDetails {
206
- error_name: 'too_many_requests';
207
- /** Suggested wait time before retrying. */
208
- retry_after_ms?: number;
209
- /** Which rate limit was exceeded (e.g. `org`, `ip`). */
210
- limited_by?: string;
208
+ error_name: 'too_many_requests';
209
+ /** Suggested wait time before retrying. */
210
+ retry_after_ms?: number;
211
+ /** Which rate limit was exceeded (e.g. `org`, `ip`). */
212
+ limited_by?: string;
211
213
  }
212
214
  /** Union of all known `details` payloads on an `ApiErrorResponse`. */
213
215
  type ApiErrorDetails = UsageAllocationErrorDetails | RateLimitErrorDetails;
214
216
  /** Standard JSON error shape returned for any non-2xx response. */
215
217
  interface ApiErrorResponse {
216
- /** Machine-readable identifier — safe to switch on. */
217
- name: ApiErrorName;
218
- /** Human-readable error message. */
219
- message: string;
220
- /** Error-specific structured detail; only present for some `name`s. */
221
- details?: ApiErrorDetails;
218
+ /** Machine-readable identifier — safe to switch on. */
219
+ name: ApiErrorName;
220
+ /** Human-readable error message. */
221
+ message: string;
222
+ /** Error-specific structured detail; only present for some `name`s. */
223
+ details?: ApiErrorDetails;
222
224
  }
223
-
225
+ //#endregion
226
+ //#region src/types/scrape.d.ts
224
227
  /**
225
228
  * Which content formats to extract from the scraped page. Every field is
226
229
  * optional; the server defaults are noted on each field. The default request
227
230
  * extracts `{ metadata: true, cleaned_html: true }`.
228
231
  */
229
232
  interface ScrapeExtract {
230
- /** Extract page metadata (title, description, OG/Twitter tags, etc.). Default `true`. */
231
- metadata?: boolean;
232
- /** Extract cleaned HTML (main content only). Default `true`. */
233
- cleaned_html?: boolean;
234
- /** Extract the page as clean Markdown. Default `false`. */
235
- markdown?: boolean;
236
- /** Return the raw, unprocessed HTML. Default `false`. */
237
- raw_html?: boolean;
238
- /** Extract all links found on the page. Default `false`. */
239
- links?: boolean;
240
- /**
241
- * Extract all inline images found on the page. Default `false`. Image URLs
242
- * preserve their query string, and document-relative `src`s are resolved
243
- * against the full page URL (browser parity) — same rules as `links`.
244
- */
245
- images?: boolean;
246
- /** Capture a screenshot. Omit to skip; set to a `ScreenshotRequest` to enable. */
247
- screenshot?: ScreenshotRequest;
233
+ /** Extract page metadata (title, description, OG/Twitter tags, etc.). Default `true`. */
234
+ metadata?: boolean;
235
+ /** Extract cleaned HTML (main content only). Default `true`. */
236
+ cleaned_html?: boolean;
237
+ /** Extract the page as clean Markdown. Default `false`. */
238
+ markdown?: boolean;
239
+ /** Return the raw, unprocessed HTML. Default `false`. */
240
+ raw_html?: boolean;
241
+ /** Extract all links found on the page. Default `false`. */
242
+ links?: boolean;
243
+ /**
244
+ * Extract all inline images found on the page. Default `false`. Image URLs
245
+ * preserve their query string, and document-relative `src`s are resolved
246
+ * against the full page URL (browser parity) — same rules as `links`.
247
+ */
248
+ images?: boolean;
249
+ /** Capture a screenshot. Omit to skip; set to a `ScreenshotRequest` to enable. */
250
+ screenshot?: ScreenshotRequest;
248
251
  }
249
252
  /** Cache settings for a scrape request. */
250
253
  interface ScrapeCache {
251
- /**
252
- * Maximum cache age. Either a number of seconds (non-negative integer) or
253
- * an ISO-8601 datetime cutoff — cached entries older than this are skipped.
254
- * Defaults to 2 days when omitted.
255
- */
256
- max_age?: number | string;
257
- /**
258
- * Treat URLs with different query parameters as the same cache entry.
259
- * Defaults to `false`.
260
- */
261
- ignore_query_params?: boolean;
254
+ /**
255
+ * Maximum cache age. Either a number of seconds (non-negative integer) or
256
+ * an ISO-8601 datetime cutoff — cached entries older than this are skipped.
257
+ * Defaults to 2 days when omitted.
258
+ */
259
+ max_age?: number | string;
262
260
  }
263
261
  /** Optional locale + country emulation for the scrape. */
264
262
  interface ScrapeLocation {
265
- /**
266
- * BCP-47 locale (e.g. `en-US`, `de-DE`, `pt-BR`). Sent as `Accept-Language`
267
- * and reflected in `navigator.language` when JS rendering is requested.
268
- */
269
- locale?: string;
270
- /**
271
- * ISO 3166-1 alpha-2 country code (e.g. `US`, `DE`, `BR`). Drives the
272
- * emulated browser timezone. Case-insensitive.
273
- */
274
- country?: string;
263
+ /**
264
+ * BCP-47 locale (e.g. `en-US`, `de-DE`, `pt-BR`). Sent as `Accept-Language`
265
+ * and reflected in `navigator.language` when JS rendering is requested.
266
+ */
267
+ locale?: string;
268
+ /**
269
+ * ISO 3166-1 alpha-2 country code (e.g. `US`, `DE`, `BR`). Drives the
270
+ * emulated browser timezone. Case-insensitive.
271
+ */
272
+ country?: string;
275
273
  }
276
274
  /** Request body for `POST /api/scrape` (and `POST /api/scrape/async`). */
277
275
  interface ScrapeRequest {
278
- /** The URL to scrape. */
279
- url: string;
280
- /** Which content formats to extract. Defaults to `metadata + cleaned_html`. */
281
- extract?: ScrapeExtract;
282
- /** Cache settings for this request. */
283
- cache?: ScrapeCache;
284
- /**
285
- * Use a headless browser to render JavaScript before scraping. Adds latency
286
- * and credits — only enable when the page requires it. Default `false`.
287
- */
288
- require_js?: boolean;
289
- /** CSS selectors to strip from the extracted content. */
290
- exclude_selectors?: string[];
291
- /**
292
- * Proxy tier to use for fetching. Defaults to `auto` (tries the basic tier
293
- * first, escalates to advanced on failure; billed at the delivered tier).
294
- */
295
- proxy?: ProxyTier;
296
- /** Optional locale + country emulation. */
297
- location?: ScrapeLocation;
276
+ /**
277
+ * The URL to scrape. Known tracking parameters (`utm_*`, `mtm_*`, `ga_*`, `pk_*`, `gclid`,
278
+ * `fbclid`, `msclkid`, and more) are removed before the page is fetched, so they reach
279
+ * neither the target site nor the cache key. Every other query parameter is kept verbatim
280
+ * and is part of the cache key.
281
+ */
282
+ url: string;
283
+ /** Which content formats to extract. Defaults to `metadata + cleaned_html`. */
284
+ extract?: ScrapeExtract;
285
+ /** Cache settings for this request. */
286
+ cache?: ScrapeCache;
287
+ /**
288
+ * Use a headless browser to render JavaScript before scraping. Adds latency
289
+ * and credits — only enable when the page requires it. Default `false`.
290
+ */
291
+ require_js?: boolean;
292
+ /** CSS selectors to strip from the extracted content. */
293
+ exclude_selectors?: string[];
294
+ /**
295
+ * Proxy tier to use for fetching. Defaults to `auto` (tries the basic tier
296
+ * first, escalates to advanced on failure; billed at the delivered tier).
297
+ */
298
+ proxy?: ProxyTier;
299
+ /** Optional locale + country emulation. */
300
+ location?: ScrapeLocation;
298
301
  }
299
302
  /**
300
303
  * Per-job completion webhook, attached when submitting an ASYNC scrape via
@@ -306,20 +309,20 @@ interface ScrapeRequest {
306
309
  * (Account → Webhooks) — there is no per-request secret.
307
310
  */
308
311
  interface AsyncScrapeWebhook {
309
- /**
310
- * Endpoint that receives a single signed `POST` when the job reaches a
311
- * terminal state. Must be an `http`/`https` URL (HTTPS is required in
312
- * production) of at most 2048 characters. The body is a
313
- * `scrape.complete` envelope signed with your organization webhook secret
314
- * on the `X-Cwbl-Signature` header — verify it with `verifyWebhookSignature`.
315
- */
316
- url: string;
317
- /**
318
- * Opaque correlation object echoed verbatim in the webhook payload's
319
- * `data.metadata`. Must serialize to at most 2048 bytes (UTF-8 JSON). Use it
320
- * to route deliveries without keeping your own `job_id` mapping.
321
- */
322
- metadata?: Record<string, unknown>;
312
+ /**
313
+ * Endpoint that receives a single signed `POST` when the job reaches a
314
+ * terminal state. Must be an `http`/`https` URL (HTTPS is required in
315
+ * production) of at most 2048 characters. The body is a
316
+ * `scrape.complete` envelope signed with your organization webhook secret
317
+ * on the `X-Cwbl-Signature` header — verify it with `verifyWebhookSignature`.
318
+ */
319
+ url: string;
320
+ /**
321
+ * Opaque correlation object echoed verbatim in the webhook payload's
322
+ * `data.metadata`. Must serialize to at most 2048 bytes (UTF-8 JSON). Use it
323
+ * to route deliveries without keeping your own `job_id` mapping.
324
+ */
325
+ metadata?: Record<string, unknown>;
323
326
  }
324
327
  /**
325
328
  * Request body for `POST /api/scrape/async`: a {@link ScrapeRequest} plus an
@@ -327,384 +330,365 @@ interface AsyncScrapeWebhook {
327
330
  * is async-only and is not accepted by the synchronous `scrape()` endpoint.
328
331
  */
329
332
  interface AsyncScrapeRequest extends ScrapeRequest {
330
- /** Optional completion webhook delivered when this job finishes. */
331
- webhook?: AsyncScrapeWebhook;
333
+ /** Optional completion webhook delivered when this job finishes. */
334
+ webhook?: AsyncScrapeWebhook;
332
335
  }
333
336
  /** Viewport metadata returned alongside a captured screenshot. */
334
337
  interface ScreenshotViewportInfo {
335
- width: number;
336
- height: number;
337
- device_scale_factor: number;
338
+ width: number;
339
+ height: number;
340
+ device_scale_factor: number;
338
341
  }
339
342
  /** Image-level properties of a captured screenshot (or tile). */
340
343
  interface ScreenshotProperties {
341
- /** File name of the image asset. */
342
- file_name: string;
343
- /** MIME type (e.g. `image/png`). */
344
- mime: string;
345
- /** Image width in pixels. */
346
- width: number;
347
- /** Image height in pixels. */
348
- height: number;
349
- /** Viewport dimensions used during capture. */
350
- viewport: ScreenshotViewportInfo;
344
+ /** File name of the image asset. */
345
+ file_name: string;
346
+ /** MIME type (e.g. `image/png`). */
347
+ mime: string;
348
+ /** Image width in pixels. */
349
+ width: number;
350
+ /** Image height in pixels. */
351
+ height: number;
352
+ /** Viewport dimensions used during capture. */
353
+ viewport: ScreenshotViewportInfo;
351
354
  }
352
355
  /** One horizontal tile of a sliced full-page screenshot. */
353
356
  interface ScreenshotSlice {
354
- /** 0-based row index of this slice. */
355
- row_nr: number;
356
- /** Signed URL to download this slice image. */
357
- url: string;
358
- type: 'slice';
359
- /** Image-level properties of this slice. */
360
- properties: ScreenshotProperties;
357
+ /** 0-based row index of this slice. */
358
+ row_nr: number;
359
+ /** Signed URL to download this slice image. */
360
+ url: string;
361
+ type: 'slice';
362
+ /** Image-level properties of this slice. */
363
+ properties: ScreenshotProperties;
361
364
  }
362
365
  /** Result block returned when a screenshot was requested. */
363
366
  interface ScreenshotResult {
364
- /** Signed URL to download the full screenshot image. */
365
- url: string;
366
- /** Capture mode that was used. */
367
- type: ScreenshotType;
368
- /** Image-level properties of the full screenshot. */
369
- properties: ScreenshotProperties;
370
- /** Tile slices, present only when the `slice` `actions_after` was requested. */
371
- slices?: ScreenshotSlice[];
367
+ /** Signed URL to download the full screenshot image. */
368
+ url: string;
369
+ /** Capture mode that was used. */
370
+ type: ScreenshotType;
371
+ /** Image-level properties of the full screenshot. */
372
+ properties: ScreenshotProperties;
373
+ /** Tile slices, present only when the `slice` `actions_after` was requested. */
374
+ slices?: ScreenshotSlice[];
372
375
  }
373
376
  /** A single inline image discovered on the page. */
374
377
  interface PageInlineImage {
375
- /**
376
- * Absolute URL of the image, query string preserved. Document-relative
377
- * `src`s are resolved against the full page URL (browser parity).
378
- */
379
- url: string;
380
- /** Alt text of the image, or `null` if not set. */
381
- alt: string | null;
378
+ /**
379
+ * Absolute URL of the image, query string preserved. Document-relative
380
+ * `src`s are resolved against the full page URL (browser parity).
381
+ */
382
+ url: string;
383
+ /** Alt text of the image, or `null` if not set. */
384
+ alt: string | null;
382
385
  }
383
386
  /** A single link discovered on the page. */
384
387
  interface PageLink {
385
- /** Anchor text of the link. */
386
- text: string;
387
- /** The link URL as it appears on the page (absolute or relative). */
388
- href: string;
389
- /** Whether the link points to the same domain as the scraped page. */
390
- internal: boolean;
388
+ /** Anchor text of the link. */
389
+ text: string;
390
+ /** The link URL as it appears on the page (absolute or relative). */
391
+ href: string;
392
+ /** Whether the link points to the same domain as the scraped page. */
393
+ internal: boolean;
391
394
  }
392
395
  /** Structured page metadata extracted from `<head>`. */
393
396
  interface ScrapeMetadata {
394
- title?: string;
395
- description?: string;
396
- keywords?: string[];
397
- canonical?: string;
398
- og_url?: string;
399
- og_title?: string;
400
- og_description?: string;
401
- og_type?: string;
402
- og_site_name?: string;
403
- og_locale?: string;
404
- og_locale_alternate?: string[];
405
- og_image?: string;
406
- author?: string;
407
- date_modified?: string;
408
- date_published?: string;
409
- twitter_site?: string;
410
- twitter_card?: string;
411
- twitter_description?: string;
412
- twitter_title?: string;
413
- twitter_image?: string;
414
- robots?: string;
415
- favicon_url?: string | null;
397
+ title?: string;
398
+ description?: string;
399
+ keywords?: string[];
400
+ canonical?: string;
401
+ og_url?: string;
402
+ og_title?: string;
403
+ og_description?: string;
404
+ og_type?: string;
405
+ og_site_name?: string;
406
+ og_locale?: string;
407
+ og_locale_alternate?: string[];
408
+ og_image?: string;
409
+ author?: string;
410
+ date_modified?: string;
411
+ date_published?: string;
412
+ twitter_site?: string;
413
+ twitter_card?: string;
414
+ twitter_description?: string;
415
+ twitter_title?: string;
416
+ twitter_image?: string;
417
+ robots?: string;
418
+ favicon_url?: string | null;
416
419
  }
417
420
  /** Successful response from `POST /api/scrape` and `GET /api/scrape/result/:jobId`. */
418
421
  interface ScrapeResponse {
419
- /** The URL that was actually scraped (after any redirects). */
420
- url: string;
421
- /** `Content-Type` header returned by the origin. */
422
- content_type?: string;
423
- /**
424
- * Extract fields that were requested but aren't supported for this
425
- * content type (e.g. asking for `markdown` of a PDF).
426
- */
427
- unsupported_fields?: string[];
428
- /** Page content converted to clean Markdown (when `extract.markdown`). */
429
- markdown?: string;
430
- /** Cleaned HTML of the main page content (when `extract.cleaned_html`). */
431
- cleaned_html?: string;
432
- /** Raw, unprocessed HTML (when `extract.raw_html`). */
433
- raw_html?: string;
434
- /** Inline images discovered on the page (when `extract.images`). */
435
- images?: PageInlineImage[];
436
- /** Links discovered on the page (when `extract.links`). */
437
- links?: PageLink[];
438
- /**
439
- * Captured screenshot (when `extract.screenshot`). In rare cases a screenshot
440
- * can't be captured; when that happens the rest of your requested outputs are
441
- * still returned and this field is simply left out (so it reads back as
442
- * `undefined`). Guard with `page.screenshot?.url`.
443
- */
444
- screenshot?: ScreenshotResult;
445
- /** Extracted page metadata (when `extract.metadata`, on by default). */
446
- metadata?: ScrapeMetadata;
447
- /**
448
- * Non-error notices about the scrape (e.g. `screenshot_truncated` when a
449
- * long page exceeded the scrolling-screenshot height cap). Stable codes —
450
- * safe to switch on. Currently surfaced only on fresh scrapes; cache hits
451
- * omit warnings.
452
- */
453
- warnings?: string[];
454
- /**
455
- * Response envelope metadata. Carries `usage` (credits charged, resolved
456
- * proxy tier, and whether the result was a cache hit).
457
- */
458
- response_meta: ResponseMeta;
422
+ /** The URL that was actually scraped (after any redirects). */
423
+ url: string;
424
+ /** `Content-Type` header returned by the origin. */
425
+ content_type?: string;
426
+ /**
427
+ * Extract fields that were requested but aren't supported for this
428
+ * content type (e.g. asking for `markdown` of a PDF).
429
+ */
430
+ unsupported_fields?: string[];
431
+ /** Page content converted to clean Markdown (when `extract.markdown`). */
432
+ markdown?: string;
433
+ /** Cleaned HTML of the main page content (when `extract.cleaned_html`). */
434
+ cleaned_html?: string;
435
+ /** Raw, unprocessed HTML (when `extract.raw_html`). */
436
+ raw_html?: string;
437
+ /** Inline images discovered on the page (when `extract.images`). */
438
+ images?: PageInlineImage[];
439
+ /** Links discovered on the page (when `extract.links`). */
440
+ links?: PageLink[];
441
+ /**
442
+ * Captured screenshot (when `extract.screenshot`). In rare cases a screenshot
443
+ * can't be captured; when that happens the rest of your requested outputs are
444
+ * still returned and this field is simply left out (so it reads back as
445
+ * `undefined`). Guard with `page.screenshot?.url`.
446
+ */
447
+ screenshot?: ScreenshotResult;
448
+ /** Extracted page metadata (when `extract.metadata`, on by default). */
449
+ metadata?: ScrapeMetadata;
450
+ /**
451
+ * Non-error notices about the scrape (e.g. `screenshot_truncated` when a
452
+ * long page exceeded the scrolling-screenshot height cap). Stable codes —
453
+ * safe to switch on. Currently surfaced only on fresh scrapes; cache hits
454
+ * omit warnings.
455
+ */
456
+ warnings?: string[];
457
+ /**
458
+ * Response envelope metadata. Carries `usage` (credits charged, resolved
459
+ * proxy tier, and whether the result was a cache hit).
460
+ */
461
+ response_meta: ResponseMeta;
459
462
  }
460
-
463
+ //#endregion
464
+ //#region src/types/map.d.ts
461
465
  /** Filter which link types appear in the map result. */
462
466
  interface MapTypes {
463
- /** Include internal links (same domain). Default `true`. */
464
- internal?: boolean;
465
- /** Include links to subdomains of the target. Default `true`. */
466
- internal_subdomains?: boolean;
467
- /** Include external links (different domains). Default `true`. */
468
- external?: boolean;
467
+ /** Include internal links (same domain). Default `true`. */
468
+ internal?: boolean;
469
+ /** Include links to subdomains of the target. Default `true`. */
470
+ internal_subdomains?: boolean;
471
+ /** Include external links (different domains). Default `true`. */
472
+ external?: boolean;
469
473
  }
470
474
  /** Cache settings for a map request. */
471
475
  interface MapCache {
472
- /**
473
- * Maximum cache age — either seconds or an ISO-8601 datetime cutoff.
474
- * Defaults to 7 days when omitted.
475
- */
476
- max_age?: number | string;
476
+ /**
477
+ * Maximum cache age — either seconds or an ISO-8601 datetime cutoff.
478
+ * Defaults to 7 days when omitted.
479
+ */
480
+ max_age?: number | string;
477
481
  }
478
482
  /** Country-only egress emulation (map requests have no locale knob). */
479
483
  interface MapLocation {
480
- /** ISO 3166-1 alpha-2 country code (e.g. `US`). Case-insensitive. */
481
- country?: string;
484
+ /** ISO 3166-1 alpha-2 country code (e.g. `US`). Case-insensitive. */
485
+ country?: string;
482
486
  }
483
487
  /** Request body for `POST /api/map`. */
484
488
  interface MapRequest {
485
- /** The website URL to map. */
486
- url: string;
487
- /**
488
- * Proxy tier to use for fetching. Defaults to `auto` (tries the basic tier
489
- * first, escalates to advanced on failure; billed at the delivered tier).
490
- */
491
- proxy?: ProxyTier;
492
- /** Only use sitemap.xml — skip homepage link extraction. Default `false`. */
493
- sitemap_only?: boolean;
494
- /** Filter which link types to include. */
495
- types?: MapTypes;
496
- /** Cache settings for this request. */
497
- cache?: MapCache;
498
- /**
499
- * Maximum number of URLs to store in the map. Must be in `(0, 100 000]`.
500
- * Defaults to 100 000.
501
- */
502
- max_urls?: number;
503
- /** 1-based page number for paginated results. Defaults to 1. */
504
- page?: number;
505
- /**
506
- * Number of URLs per page. Must be in `(0, 10 000]`. Defaults to 10 000.
507
- */
508
- limit?: number;
509
- /** Optional country emulation. */
510
- location?: MapLocation;
489
+ /** The website URL to map. */
490
+ url: string;
491
+ /**
492
+ * Proxy tier to use for fetching. Defaults to `auto` (tries the basic tier
493
+ * first, escalates to advanced on failure; billed at the delivered tier).
494
+ */
495
+ proxy?: ProxyTier;
496
+ /** Only use sitemap.xml — skip homepage link extraction. Default `false`. */
497
+ sitemap_only?: boolean;
498
+ /** Filter which link types to include. */
499
+ types?: MapTypes;
500
+ /** Cache settings for this request. */
501
+ cache?: MapCache;
502
+ /**
503
+ * Maximum number of URLs to store in the map. Must be in `(0, 100 000]`.
504
+ * Defaults to 100 000.
505
+ */
506
+ max_urls?: number;
507
+ /** 1-based page number for paginated results. Defaults to 1. */
508
+ page?: number;
509
+ /**
510
+ * Number of URLs per page. Must be in `(0, 10 000]`. Defaults to 10 000.
511
+ */
512
+ limit?: number;
513
+ /** Optional country emulation. */
514
+ location?: MapLocation;
511
515
  }
512
516
  /** Single discovered URL in a map result. */
513
517
  interface MapLinkItem {
514
- /** The discovered URL. */
515
- url: string;
518
+ /** The discovered URL. */
519
+ url: string;
516
520
  }
517
521
  /** Pagination details on a map response. */
518
522
  interface MapPagination {
519
- page: number;
520
- limit: number;
521
- /** Total number of URLs in the stored map. */
522
- total: number;
523
- total_pages: number;
524
- has_more: boolean;
523
+ page: number;
524
+ limit: number;
525
+ /** Total number of URLs in the stored map. */
526
+ total: number;
527
+ total_pages: number;
528
+ has_more: boolean;
525
529
  }
526
530
  /** Information about whether the stored or returned map was truncated. */
527
531
  interface MapTruncation {
528
- /** Whether the stored map was capped by `max_urls`. */
529
- storage_capped: boolean;
530
- /** Whether the response was capped by pagination. */
531
- response_capped: boolean;
532
- /** Total URLs found before the `max_urls` cap was applied. */
533
- total_before_max_urls: number;
534
- /** Total URLs detected during discovery before the storage cap was applied. */
535
- total_detected_before_storage_cap: number;
532
+ /** Whether the stored map was capped by `max_urls`. */
533
+ storage_capped: boolean;
534
+ /** Whether the response was capped by pagination. */
535
+ response_capped: boolean;
536
+ /** Total URLs found before the `max_urls` cap was applied. */
537
+ total_before_max_urls: number;
538
+ /** Total URLs detected during discovery before the storage cap was applied. */
539
+ total_detected_before_storage_cap: number;
536
540
  }
537
541
  /**
538
542
  * Response envelope for a map result: the shared {@link ResponseMeta} (`usage`)
539
543
  * plus the map-specific `pagination` and `truncation`.
540
544
  */
541
545
  interface MapResponseMeta extends ResponseMeta {
542
- pagination: MapPagination;
543
- truncation: MapTruncation;
546
+ pagination: MapPagination;
547
+ truncation: MapTruncation;
544
548
  }
545
549
  /** Success response from `POST /api/map`. */
546
550
  interface MapResponse {
547
- /** The current page of discovered URLs. */
548
- links: MapLinkItem[];
549
- /** Usage, pagination, and truncation metadata for the result set. */
550
- response_meta: MapResponseMeta;
551
+ /** The current page of discovered URLs. */
552
+ links: MapLinkItem[];
553
+ /** Usage, pagination, and truncation metadata for the result set. */
554
+ response_meta: MapResponseMeta;
551
555
  }
552
-
556
+ //#endregion
557
+ //#region src/types/async.d.ts
553
558
  /** Job lifecycle states for an async scrape. */
554
559
  type AsyncJobStatus = 'pending' | 'running' | 'done' | 'failed';
555
560
  /** Response body of `POST /api/scrape/async`. */
556
561
  interface AsyncScrapeResponse {
557
- /** Job identifier — pass it to `getScrapeStatus` / `getScrapeResult`. */
558
- job_id: string;
562
+ /** Job identifier — pass it to `getScrapeStatus` / `getScrapeResult`. */
563
+ job_id: string;
559
564
  }
560
565
  /** Response body of `GET /api/scrape/status/:jobId`. */
561
566
  interface AsyncJobStatusResponse {
562
- /** The job identifier. */
563
- job_id: string;
564
- /** Current state of the job. */
565
- status: AsyncJobStatus;
566
- /** ISO-8601 UTC timestamp when the job was created. */
567
- created_at: string;
568
- /** Error message if the job ended in `failed`. */
569
- error?: string;
570
- /**
571
- * Response envelope metadata — present only when the job has reached the
572
- * terminal `done` state. Carries `usage` (credits charged, resolved proxy
573
- * tier, and whether the result was a cache hit).
574
- */
575
- response_meta?: ResponseMeta;
567
+ /** The job identifier. */
568
+ job_id: string;
569
+ /** Current state of the job. */
570
+ status: AsyncJobStatus;
571
+ /** ISO-8601 UTC timestamp when the job was created. */
572
+ created_at: string;
573
+ /** Error message if the job ended in `failed`. */
574
+ error?: string;
575
+ /**
576
+ * Response envelope metadata — present only when the job has reached the
577
+ * terminal `done` state. Carries `usage` (credits charged, resolved proxy
578
+ * tier, and whether the result was a cache hit).
579
+ */
580
+ response_meta?: ResponseMeta;
576
581
  }
577
-
582
+ //#endregion
583
+ //#region src/types/account.d.ts
578
584
  /** Response from `GET /api/usage`. Current billing-cycle snapshot. */
579
585
  interface UsageResponse {
580
- /**
581
- * Total credits available for the current billing cycle
582
- * (plan base + purchased + gifted).
583
- */
584
- total_credits: number;
585
- /**
586
- * Credits spent so far in the current billing cycle. May exceed
587
- * `total_credits` on plans that allow overages.
588
- */
589
- used_credits: number;
590
- /**
591
- * Remaining credits, `max(0, total_credits - used_credits)`. Clamped to 0
592
- * while in overage.
593
- */
594
- available_credits: number;
595
- /**
596
- * Percentage of `total_credits` used in the current cycle, rounded to one
597
- * decimal. Not capped — values above 100 indicate overage.
598
- */
599
- used_quota_percent: number;
600
- /**
601
- * Maximum number of concurrent jobs allowed for the org
602
- * (plan base + purchased + gifted extras).
603
- */
604
- max_concurrency: number;
605
- /**
606
- * ISO-8601 UTC timestamp when the current billing cycle ends and
607
- * `used_credits` resets to 0.
608
- */
609
- usage_reset: string;
586
+ /**
587
+ * Total credits available for the current billing cycle
588
+ * (plan base + purchased + gifted).
589
+ */
590
+ total_credits: number;
591
+ /**
592
+ * Credits spent so far in the current billing cycle. May exceed
593
+ * `total_credits` on plans that allow overages.
594
+ */
595
+ used_credits: number;
596
+ /**
597
+ * Remaining credits, `max(0, total_credits - used_credits)`. Clamped to 0
598
+ * while in overage.
599
+ */
600
+ available_credits: number;
601
+ /**
602
+ * Percentage of `total_credits` used in the current cycle, rounded to one
603
+ * decimal. Not capped — values above 100 indicate overage.
604
+ */
605
+ used_quota_percent: number;
606
+ /**
607
+ * Maximum number of concurrent jobs allowed for the org
608
+ * (plan base + purchased + gifted extras).
609
+ */
610
+ max_concurrency: number;
611
+ /**
612
+ * ISO-8601 UTC timestamp when the current billing cycle ends and
613
+ * `used_credits` resets to 0.
614
+ */
615
+ usage_reset: string;
610
616
  }
611
617
  /** Response from `GET /api/whoami`. Identifies the calling API token. */
612
618
  interface WhoamiResponse {
613
- /** Display name of the organization that owns the token. */
614
- organization_name: string;
615
- /** User-assigned name of the API token. */
616
- token_name: string;
617
- /** Truncated preview of the API token (e.g. `cwbl_…xyz`). Safe to display. */
618
- token_preview: string;
619
+ /** Display name of the organization that owns the token. */
620
+ organization_name: string;
621
+ /** User-assigned name of the API token. */
622
+ token_name: string;
623
+ /** Truncated preview of the API token (e.g. `cwbl_…xyz`). Safe to display. */
624
+ token_preview: string;
619
625
  }
620
-
621
- /**
622
- * Async scrape completion webhooks.
623
- *
624
- * When you submit a job with {@link Crawlbrulee.scrapeAsync} the API can deliver
625
- * a `scrape.complete` webhook to your configured endpoint once the job reaches a
626
- * terminal state. The envelope on the wire is exactly:
627
- *
628
- * ```json
629
- * {
630
- * "event_id": "evt_…",
631
- * "timestamp": "2026-06-13T12:00:00.000Z",
632
- * "event": "scrape.complete",
633
- * "data": {
634
- * "job_id": "job_…",
635
- * "status": "success",
636
- * "url": "https://…",
637
- * "completed_at": "…",
638
- * "metadata": { "tenant": "acme" },
639
- * "response_meta": { "usage": { "credits": 1, "proxy": "basic", "cache_hit": false } }
640
- * }
641
- * }
642
- * ```
643
- */
644
-
626
+ //#endregion
627
+ //#region src/types/webhooks.d.ts
645
628
  /** Terminal status carried by a {@link ScrapeCompleteWebhook}. */
646
629
  type ScrapeWebhookStatus = 'success' | 'failed' | 'cancelled';
647
630
  /** `data` block of a {@link ScrapeCompleteWebhook}. */
648
631
  interface ScrapeCompleteWebhookData {
649
- /** The async job identifier — pass it to `getScrapeResult`. */
650
- job_id: string;
651
- /** Terminal state of the job. */
652
- status: ScrapeWebhookStatus;
653
- /** The URL that was scraped. */
654
- url: string;
655
- /** ISO-8601 UTC timestamp when the job reached its terminal state. */
656
- completed_at: string;
657
- /** Failure message — present only when `status === 'failed'`. */
658
- error?: string;
659
- /**
660
- * Correlation data echoed back from the original scrape request's
661
- * `webhook.metadata`, if any.
662
- */
663
- metadata?: Record<string, unknown>;
664
- /**
665
- * Response envelope metadata — `usage` (credits charged, resolved proxy tier,
666
- * and whether the result was a cache hit). Present only on `status: 'success'`
667
- * deliveries; omitted for `failed` / `cancelled` (no usage was charged).
668
- */
669
- response_meta?: ResponseMeta;
632
+ /** The async job identifier — pass it to `getScrapeResult`. */
633
+ job_id: string;
634
+ /** Terminal state of the job. */
635
+ status: ScrapeWebhookStatus;
636
+ /** The URL that was scraped. */
637
+ url: string;
638
+ /** ISO-8601 UTC timestamp when the job reached its terminal state. */
639
+ completed_at: string;
640
+ /** Failure message — present only when `status === 'failed'`. */
641
+ error?: string;
642
+ /**
643
+ * Correlation data echoed back from the original scrape request's
644
+ * `webhook.metadata`, if any.
645
+ */
646
+ metadata?: Record<string, unknown>;
647
+ /**
648
+ * Response envelope metadata — `usage` (credits charged, resolved proxy tier,
649
+ * and whether the result was a cache hit). Present only on `status: 'success'`
650
+ * deliveries; omitted for `failed` / `cancelled` (no usage was charged).
651
+ */
652
+ response_meta?: ResponseMeta;
670
653
  }
671
654
  /**
672
655
  * Webhook envelope delivered when an async scrape job completes. The `event`
673
656
  * discriminator is always the literal `'scrape.complete'`.
674
657
  */
675
658
  interface ScrapeCompleteWebhook {
676
- /** Unique event identifier — also delivered in the `X-Cwbl-Event-Id` header. */
677
- event_id: string;
678
- /** ISO-8601 UTC timestamp when the event was emitted. */
679
- timestamp: string;
680
- /** Event type discriminator. */
681
- event: 'scrape.complete';
682
- /** Event payload. */
683
- data: ScrapeCompleteWebhookData;
659
+ /** Unique event identifier — also delivered in the `X-Cwbl-Event-Id` header. */
660
+ event_id: string;
661
+ /** ISO-8601 UTC timestamp when the event was emitted. */
662
+ timestamp: string;
663
+ /** Event type discriminator. */
664
+ event: 'scrape.complete';
665
+ /** Event payload. */
666
+ data: ScrapeCompleteWebhookData;
684
667
  }
685
-
668
+ //#endregion
669
+ //#region src/client.d.ts
686
670
  /** Options accepted by the {@link Crawlbrulee} constructor. */
687
671
  interface CrawlbruleeOptions {
688
- /**
689
- * API key sent as `Authorization: Bearer <key>`. Required — to read from the
690
- * environment instead, use {@link Crawlbrulee.fromEnv}. Leading and trailing
691
- * whitespace is stripped; an empty / whitespace-only value is rejected.
692
- */
693
- apiKey: string;
694
- /**
695
- * Override the base URL the SDK targets. Defaults to the production host
696
- * ({@link DEFAULT_BASE_URL}). Intended for local development and staging
697
- * (e.g. `https://api.staging.crawlbrulee.com`) — production callers should
698
- * leave it unset. Trailing slashes are stripped.
699
- */
700
- baseUrl?: string;
701
- /**
702
- * Per-request timeout in milliseconds. Defaults to `0` (no timeout). Set to a
703
- * positive number to abort slow requests; a per-call `timeoutMs` override
704
- * takes precedence. The timeout covers the WHOLE request, including the
705
- * response body read.
706
- */
707
- timeoutMs?: number;
672
+ /**
673
+ * API key sent as `Authorization: Bearer <key>`. Required — to read from the
674
+ * environment instead, use {@link Crawlbrulee.fromEnv}. Leading and trailing
675
+ * whitespace is stripped; an empty / whitespace-only value is rejected.
676
+ */
677
+ apiKey: string;
678
+ /**
679
+ * Override the base URL the SDK targets. Defaults to the production host
680
+ * ({@link DEFAULT_BASE_URL}). Intended for local development and staging
681
+ * (e.g. `https://api.staging.crawlbrulee.com`) — production callers should
682
+ * leave it unset. Trailing slashes are stripped.
683
+ */
684
+ baseUrl?: string;
685
+ /**
686
+ * Per-request timeout in milliseconds. Defaults to `0` (no timeout). Set to a
687
+ * positive number to abort slow requests; a per-call `timeoutMs` override
688
+ * takes precedence. The timeout covers the WHOLE request, including the
689
+ * response body read.
690
+ */
691
+ timeoutMs?: number;
708
692
  }
709
693
  /**
710
694
  * Options accepted by {@link Crawlbrulee.waitForScrape}.
@@ -715,13 +699,13 @@ interface CrawlbruleeOptions {
715
699
  * the client with `timeoutMs` set.
716
700
  */
717
701
  interface WaitForScrapeOptions extends Omit<RequestOptions, 'timeoutMs'> {
718
- /** Time between status polls in milliseconds. Default `2000`. */
719
- intervalMs?: number;
720
- /**
721
- * Maximum total time to wait before giving up, in milliseconds. Default
722
- * `300_000` (5 minutes). Pass `0` to wait indefinitely.
723
- */
724
- timeoutMs?: number;
702
+ /** Time between status polls in milliseconds. Default `2000`. */
703
+ intervalMs?: number;
704
+ /**
705
+ * Maximum total time to wait before giving up, in milliseconds. Default
706
+ * `300_000` (5 minutes). Pass `0` to wait indefinitely.
707
+ */
708
+ timeoutMs?: number;
725
709
  }
726
710
  /**
727
711
  * Official client for the crawlbrulee API.
@@ -742,102 +726,103 @@ interface WaitForScrapeOptions extends Omit<RequestOptions, 'timeoutMs'> {
742
726
  * ```
743
727
  */
744
728
  declare class Crawlbrulee {
745
- /** Resolved base URL — trailing slash already stripped. */
746
- readonly baseUrl: string;
747
- /** Underlying HTTP layer. Exposed for advanced use cases (custom endpoints). */
748
- readonly http: HttpClient;
749
- constructor(options: CrawlbruleeOptions);
750
- /**
751
- * Build a {@link Crawlbrulee} reading the API key from
752
- * `process.env.CRAWLBRULEE_API_KEY`. Throws if the variable is unset, empty,
753
- * or whitespace.
754
- *
755
- * Any other constructor option can be passed via `overrides`.
756
- *
757
- * @example
758
- * ```ts
759
- * const crawlbrulee = Crawlbrulee.fromEnv()
760
- * const crawlbrulee = Crawlbrulee.fromEnv({ timeoutMs: 30_000 })
761
- * ```
762
- */
763
- static fromEnv(overrides?: Omit<CrawlbruleeOptions, 'apiKey'>): Crawlbrulee;
764
- /**
765
- * Scrape a URL synchronously and return the extracted content.
766
- *
767
- * The request blocks until the scrape is finished. For long-running jobs
768
- * (heavy JS rendering, screenshots of long pages) prefer
769
- * {@link Crawlbrulee.scrapeAsync} so the connection isn't held open.
770
- *
771
- * @param request — body for `POST /api/scrape`.
772
- * @param options — per-call timeout and abort signal.
773
- */
774
- scrape(request: ScrapeRequest, options?: RequestOptions): Promise<ScrapeResponse>;
775
- /**
776
- * Submit an asynchronous scrape job and return its `job_id`. Poll the job
777
- * with {@link Crawlbrulee.getScrapeStatus} or wait for completion with
778
- * {@link Crawlbrulee.waitForScrape}.
779
- *
780
- * Pass an optional `webhook` to have the API deliver a signed
781
- * `scrape.complete` `POST` to your endpoint when the job finishes (see
782
- * {@link AsyncScrapeWebhook}). This field is async-only.
783
- */
784
- scrapeAsync(request: AsyncScrapeRequest, options?: RequestOptions): Promise<AsyncScrapeResponse>;
785
- /** Look up the current status of an async scrape job. */
786
- getScrapeStatus(jobId: string, options?: RequestOptions): Promise<AsyncJobStatusResponse>;
787
- /**
788
- * Fetch the result of a completed async scrape job. Throws if the job is
789
- * still pending/running — call {@link Crawlbrulee.getScrapeStatus}
790
- * first, or use {@link Crawlbrulee.waitForScrape} to poll-then-fetch.
791
- */
792
- getScrapeResult(jobId: string, options?: RequestOptions): Promise<ScrapeResponse>;
793
- /**
794
- * Fetch the scrape result referenced by a `scrape.complete` webhook body.
795
- *
796
- * Always verify the webhook signature with `verifyWebhookSignature` before
797
- * acting on it; this method trusts the parsed body it is handed.
798
- *
799
- * Behavior by `data.status`:
800
- * - `success` — delegates to {@link Crawlbrulee.getScrapeResult} for the
801
- * webhook's `job_id` and returns the parsed result.
802
- * - `failed` — throws a {@link CrawlbruleeError} carrying `data.error`
803
- * (`errorName: 'job_failed'`); there is no result to fetch.
804
- * - `cancelled` — throws a {@link CrawlbruleeError}
805
- * (`errorName: 'client_closed_request'`).
806
- *
807
- * A non-`scrape.complete` envelope throws a {@link CrawlbruleeError}
808
- * defensively. Any HTTP error from the underlying fetch propagates as the
809
- * usual typed `CrawlbruleeError` subclass.
810
- */
811
- fetchScrapeResultFromWebhook(webhook: ScrapeCompleteWebhook, options?: RequestOptions): Promise<ScrapeResponse>;
812
- /**
813
- * Poll an async scrape job until it reaches a terminal state, then return
814
- * the scrape result.
815
- *
816
- * Throws a {@link CrawlbruleeError} when:
817
- * - the job ends in `failed` (`errorName: 'job_failed'`),
818
- * - the server reports an unexpected status (`errorName: 'job_failed'`),
819
- * - the overall wait exceeds `timeoutMs` (`errorName: 'request_timeout'`),
820
- * - the caller's `signal` aborts (`errorName: 'client_closed_request'`).
821
- */
822
- waitForScrape(jobId: string, options?: WaitForScrapeOptions): Promise<ScrapeResponse>;
823
- /**
824
- * Build (or return a cached) site link-map for a domain. Combines sitemap
825
- * discovery with the freshest cached homepage scrape when available.
826
- */
827
- map(request: MapRequest, options?: RequestOptions): Promise<MapResponse>;
828
- /**
829
- * Return the current billing-cycle usage: total/used/available credits,
830
- * used quota percentage, max concurrency, and when the cycle resets.
831
- */
832
- usage(options?: RequestOptions): Promise<UsageResponse>;
833
- /**
834
- * Return the organization name and identifying details of the API token
835
- * used to authenticate this request. Useful for confirming which key is in
836
- * use before performing destructive operations.
837
- */
838
- whoami(options?: RequestOptions): Promise<WhoamiResponse>;
729
+ /** Resolved base URL — trailing slash already stripped. */
730
+ readonly baseUrl: string;
731
+ /** Underlying HTTP layer. Exposed for advanced use cases (custom endpoints). */
732
+ readonly http: HttpClient;
733
+ constructor(options: CrawlbruleeOptions);
734
+ /**
735
+ * Build a {@link Crawlbrulee} reading the API key from
736
+ * `process.env.CRAWLBRULEE_API_KEY`. Throws if the variable is unset, empty,
737
+ * or whitespace.
738
+ *
739
+ * Any other constructor option can be passed via `overrides`.
740
+ *
741
+ * @example
742
+ * ```ts
743
+ * const crawlbrulee = Crawlbrulee.fromEnv()
744
+ * const crawlbrulee = Crawlbrulee.fromEnv({ timeoutMs: 30_000 })
745
+ * ```
746
+ */
747
+ static fromEnv(overrides?: Omit<CrawlbruleeOptions, 'apiKey'>): Crawlbrulee;
748
+ /**
749
+ * Scrape a URL synchronously and return the extracted content.
750
+ *
751
+ * The request blocks until the scrape is finished. For long-running jobs
752
+ * (heavy JS rendering, screenshots of long pages) prefer
753
+ * {@link Crawlbrulee.scrapeAsync} so the connection isn't held open.
754
+ *
755
+ * @param request — body for `POST /api/scrape`.
756
+ * @param options — per-call timeout and abort signal.
757
+ */
758
+ scrape(request: ScrapeRequest, options?: RequestOptions): Promise<ScrapeResponse>;
759
+ /**
760
+ * Submit an asynchronous scrape job and return its `job_id`. Poll the job
761
+ * with {@link Crawlbrulee.getScrapeStatus} or wait for completion with
762
+ * {@link Crawlbrulee.waitForScrape}.
763
+ *
764
+ * Pass an optional `webhook` to have the API deliver a signed
765
+ * `scrape.complete` `POST` to your endpoint when the job finishes (see
766
+ * {@link AsyncScrapeWebhook}). This field is async-only.
767
+ */
768
+ scrapeAsync(request: AsyncScrapeRequest, options?: RequestOptions): Promise<AsyncScrapeResponse>;
769
+ /** Look up the current status of an async scrape job. */
770
+ getScrapeStatus(jobId: string, options?: RequestOptions): Promise<AsyncJobStatusResponse>;
771
+ /**
772
+ * Fetch the result of a completed async scrape job. Throws if the job is
773
+ * still pending/running — call {@link Crawlbrulee.getScrapeStatus}
774
+ * first, or use {@link Crawlbrulee.waitForScrape} to poll-then-fetch.
775
+ */
776
+ getScrapeResult(jobId: string, options?: RequestOptions): Promise<ScrapeResponse>;
777
+ /**
778
+ * Fetch the scrape result referenced by a `scrape.complete` webhook body.
779
+ *
780
+ * Always verify the webhook signature with `verifyWebhookSignature` before
781
+ * acting on it; this method trusts the parsed body it is handed.
782
+ *
783
+ * Behavior by `data.status`:
784
+ * - `success` — delegates to {@link Crawlbrulee.getScrapeResult} for the
785
+ * webhook's `job_id` and returns the parsed result.
786
+ * - `failed` — throws a {@link CrawlbruleeError} carrying `data.error`
787
+ * (`errorName: 'job_failed'`); there is no result to fetch.
788
+ * - `cancelled` — throws a {@link CrawlbruleeError}
789
+ * (`errorName: 'client_closed_request'`).
790
+ *
791
+ * A non-`scrape.complete` envelope throws a {@link CrawlbruleeError}
792
+ * defensively. Any HTTP error from the underlying fetch propagates as the
793
+ * usual typed `CrawlbruleeError` subclass.
794
+ */
795
+ fetchScrapeResultFromWebhook(webhook: ScrapeCompleteWebhook, options?: RequestOptions): Promise<ScrapeResponse>;
796
+ /**
797
+ * Poll an async scrape job until it reaches a terminal state, then return
798
+ * the scrape result.
799
+ *
800
+ * Throws a {@link CrawlbruleeError} when:
801
+ * - the job ends in `failed` (`errorName: 'job_failed'`),
802
+ * - the server reports an unexpected status (`errorName: 'job_failed'`),
803
+ * - the overall wait exceeds `timeoutMs` (`errorName: 'request_timeout'`),
804
+ * - the caller's `signal` aborts (`errorName: 'client_closed_request'`).
805
+ */
806
+ waitForScrape(jobId: string, options?: WaitForScrapeOptions): Promise<ScrapeResponse>;
807
+ /**
808
+ * Build (or return a cached) site link-map for a domain. Combines sitemap
809
+ * discovery with the freshest cached homepage scrape when available.
810
+ */
811
+ map(request: MapRequest, options?: RequestOptions): Promise<MapResponse>;
812
+ /**
813
+ * Return the current billing-cycle usage: total/used/available credits,
814
+ * used quota percentage, max concurrency, and when the cycle resets.
815
+ */
816
+ usage(options?: RequestOptions): Promise<UsageResponse>;
817
+ /**
818
+ * Return the organization name and identifying details of the API token
819
+ * used to authenticate this request. Useful for confirming which key is in
820
+ * use before performing destructive operations.
821
+ */
822
+ whoami(options?: RequestOptions): Promise<WhoamiResponse>;
839
823
  }
840
-
824
+ //#endregion
825
+ //#region src/errors.d.ts
841
826
  /**
842
827
  * Base error class for every failure raised by the SDK.
843
828
  *
@@ -856,29 +841,29 @@ declare class Crawlbrulee {
856
841
  * {@link isCrawlbruleeError} helper.
857
842
  */
858
843
  declare class CrawlbruleeError extends Error {
859
- /** HTTP status code; `0` for transport-level failures with no response. */
860
- readonly status: number;
861
- /** The `name` field from the API error body, or `null` for transport errors. */
862
- readonly errorName: ApiErrorName | null;
863
- /** Structured detail block from the API error body, if any. */
864
- readonly details?: ApiErrorDetails;
865
- /** The original parsed error body, when one was received. */
866
- readonly response?: ApiErrorResponse;
867
- constructor(message: string, options: {
868
- status: number;
869
- errorName: ApiErrorName | null;
870
- details?: ApiErrorDetails;
871
- response?: ApiErrorResponse;
872
- cause?: unknown;
873
- });
844
+ /** HTTP status code; `0` for transport-level failures with no response. */
845
+ readonly status: number;
846
+ /** The `name` field from the API error body, or `null` for transport errors. */
847
+ readonly errorName: ApiErrorName | null;
848
+ /** Structured detail block from the API error body, if any. */
849
+ readonly details?: ApiErrorDetails;
850
+ /** The original parsed error body, when one was received. */
851
+ readonly response?: ApiErrorResponse;
852
+ constructor(message: string, options: {
853
+ status: number;
854
+ errorName: ApiErrorName | null;
855
+ details?: ApiErrorDetails;
856
+ response?: ApiErrorResponse;
857
+ cause?: unknown;
858
+ });
874
859
  }
875
860
  /** Raised for 401 / 403 responses (missing, invalid, or unauthorized API key). */
876
861
  declare class AuthenticationError extends CrawlbruleeError {
877
- constructor(message: string, options: {
878
- status: number;
879
- errorName: ApiErrorName;
880
- response?: ApiErrorResponse;
881
- });
862
+ constructor(message: string, options: {
863
+ status: number;
864
+ errorName: ApiErrorName;
865
+ response?: ApiErrorResponse;
866
+ });
882
867
  }
883
868
  /**
884
869
  * Raised for HTTP 429 responses. When the server included a `retry_after_ms`
@@ -890,16 +875,16 @@ declare class AuthenticationError extends CrawlbruleeError {
890
875
  * available on `response`.
891
876
  */
892
877
  declare class RateLimitError extends CrawlbruleeError {
893
- readonly errorName: 'too_many_requests';
894
- /** Suggested delay (ms) before retrying, when the server provided one. */
895
- readonly retryAfterMs?: number;
896
- /** Which rate limit was tripped (e.g. `org`, `ip`), when provided. */
897
- readonly limitedBy?: string;
898
- constructor(message: string, options: {
899
- status: number;
900
- details?: RateLimitErrorDetails;
901
- response?: ApiErrorResponse;
902
- });
878
+ readonly errorName: 'too_many_requests';
879
+ /** Suggested delay (ms) before retrying, when the server provided one. */
880
+ readonly retryAfterMs?: number;
881
+ /** Which rate limit was tripped (e.g. `org`, `ip`), when provided. */
882
+ readonly limitedBy?: string;
883
+ constructor(message: string, options: {
884
+ status: number;
885
+ details?: RateLimitErrorDetails;
886
+ response?: ApiErrorResponse;
887
+ });
903
888
  }
904
889
  /**
905
890
  * Raised when the API rejects a request because the org's plan limits would
@@ -908,32 +893,32 @@ declare class RateLimitError extends CrawlbruleeError {
908
893
  * `errorName` is always the literal `'usage_allocation_error'`.
909
894
  */
910
895
  declare class UsageAllocationError extends CrawlbruleeError {
911
- readonly errorName: 'usage_allocation_error';
912
- /** Specific reason the allocation was denied. */
913
- readonly reason: UsageAllocationErrorDetails['reason'];
914
- /** Current usage / limit snapshot at the time of the rejection. */
915
- readonly usage?: UsageAllocationErrorDetails['details'];
916
- constructor(message: string, options: {
917
- status: number;
918
- details: UsageAllocationErrorDetails;
919
- response?: ApiErrorResponse;
920
- });
896
+ readonly errorName: 'usage_allocation_error';
897
+ /** Specific reason the allocation was denied. */
898
+ readonly reason: UsageAllocationErrorDetails['reason'];
899
+ /** Current usage / limit snapshot at the time of the rejection. */
900
+ readonly usage?: UsageAllocationErrorDetails['details'];
901
+ constructor(message: string, options: {
902
+ status: number;
903
+ details: UsageAllocationErrorDetails;
904
+ response?: ApiErrorResponse;
905
+ });
921
906
  }
922
907
  /** Raised for 4xx responses caused by an invalid request shape or arguments. */
923
908
  declare class ValidationError extends CrawlbruleeError {
924
- constructor(message: string, options: {
925
- status: number;
926
- errorName: ApiErrorName;
927
- response?: ApiErrorResponse;
928
- });
909
+ constructor(message: string, options: {
910
+ status: number;
911
+ errorName: ApiErrorName;
912
+ response?: ApiErrorResponse;
913
+ });
929
914
  }
930
915
  /** Raised for 404 responses (e.g. unknown async job ID). */
931
916
  declare class NotFoundError extends CrawlbruleeError {
932
- constructor(message: string, options: {
933
- status: number;
934
- errorName: ApiErrorName;
935
- response?: ApiErrorResponse;
936
- });
917
+ constructor(message: string, options: {
918
+ status: number;
919
+ errorName: ApiErrorName;
920
+ response?: ApiErrorResponse;
921
+ });
937
922
  }
938
923
  /**
939
924
  * Raised when a request cannot be sent or no structured response is parsed.
@@ -944,15 +929,16 @@ declare class NotFoundError extends CrawlbruleeError {
944
929
  * - `null` — generic transport failure (network error, non-JSON body, etc.).
945
930
  */
946
931
  declare class TransportError extends CrawlbruleeError {
947
- constructor(message: string, options?: {
948
- status?: number;
949
- errorName?: 'request_timeout' | 'client_closed_request' | null;
950
- cause?: unknown;
951
- });
932
+ constructor(message: string, options?: {
933
+ status?: number;
934
+ errorName?: 'request_timeout' | 'client_closed_request' | null;
935
+ cause?: unknown;
936
+ });
952
937
  }
953
938
  /** Narrow `unknown` to the SDK's base error type. */
954
939
  declare function isCrawlbruleeError(err: unknown): err is CrawlbruleeError;
955
-
940
+ //#endregion
941
+ //#region src/config.d.ts
956
942
  /**
957
943
  * Production base URL of the crawlbrulee API. Used by default when the caller
958
944
  * doesn't pass a `baseUrl` to {@link Crawlbrulee}. Local development and
@@ -963,7 +949,8 @@ declare const DEFAULT_BASE_URL = "https://api.crawlbrulee.com";
963
949
  declare const DEFAULT_REQUEST_TIMEOUT_MS = 0;
964
950
  /** Environment variable read by `Crawlbrulee.fromEnv()` to source the API key. */
965
951
  declare const ENV_API_KEY = "CRAWLBRULEE_API_KEY";
966
-
952
+ //#endregion
953
+ //#region src/webhooks.d.ts
967
954
  /**
968
955
  * Verification for async scrape completion webhooks.
969
956
  *
@@ -999,33 +986,33 @@ type WebhookSignatureSource = 'primary' | 'rotated';
999
986
  type WebhookVerificationFailureReason = 'missing_signature' | 'malformed_signature' | 'timestamp_out_of_tolerance' | 'signature_mismatch';
1000
987
  /** Result of {@link verifyWebhookSignature}. Verification failure is returned, not thrown. */
1001
988
  type WebhookVerificationResult = {
1002
- verified: true;
1003
- signedWith: WebhookSignatureSource;
989
+ verified: true;
990
+ signedWith: WebhookSignatureSource;
1004
991
  } | {
1005
- verified: false;
1006
- reason: WebhookVerificationFailureReason;
992
+ verified: false;
993
+ reason: WebhookVerificationFailureReason;
1007
994
  };
1008
995
  /** Options for {@link verifyWebhookSignature}. */
1009
996
  interface VerifyWebhookSignatureOptions {
1010
- /**
1011
- * The raw request body, exactly as received. Pass the bytes/string the server
1012
- * signed — do NOT re-serialize parsed JSON, or the signature will not match.
1013
- */
1014
- payload: string | Uint8Array;
1015
- /**
1016
- * The request headers. Accepts a fetch `Headers` instance or a plain object
1017
- * (Express/Node give lowercased keys, values possibly arrays). Lookup is
1018
- * case-insensitive.
1019
- */
1020
- headers: Headers | Record<string, string | string[] | undefined>;
1021
- /** The current signing secret (`whsec_…`). */
1022
- secret: string;
1023
- /**
1024
- * Replay-protection window in seconds. Defaults to
1025
- * {@link DEFAULT_WEBHOOK_TOLERANCE_SECONDS} (300). Pass `0` (or any falsy
1026
- * value) to disable the timestamp check entirely.
1027
- */
1028
- toleranceSeconds?: number;
997
+ /**
998
+ * The raw request body, exactly as received. Pass the bytes/string the server
999
+ * signed — do NOT re-serialize parsed JSON, or the signature will not match.
1000
+ */
1001
+ payload: string | Uint8Array;
1002
+ /**
1003
+ * The request headers. Accepts a fetch `Headers` instance or a plain object
1004
+ * (Express/Node give lowercased keys, values possibly arrays). Lookup is
1005
+ * case-insensitive.
1006
+ */
1007
+ headers: Headers | Record<string, string | string[] | undefined>;
1008
+ /** The current signing secret (`whsec_…`). */
1009
+ secret: string;
1010
+ /**
1011
+ * Replay-protection window in seconds. Defaults to
1012
+ * {@link DEFAULT_WEBHOOK_TOLERANCE_SECONDS} (300). Pass `0` (or any falsy
1013
+ * value) to disable the timestamp check entirely.
1014
+ */
1015
+ toleranceSeconds?: number;
1029
1016
  }
1030
1017
  /**
1031
1018
  * Verify a crawlbrulee webhook signature against the primary and rotated
@@ -1055,5 +1042,6 @@ interface VerifyWebhookSignatureOptions {
1055
1042
  * ```
1056
1043
  */
1057
1044
  declare function verifyWebhookSignature(options: VerifyWebhookSignatureOptions): Promise<WebhookVerificationResult>;
1058
-
1059
- export { type ApiErrorDetails, type ApiErrorName, type ApiErrorResponse, type AsyncJobStatus, type AsyncJobStatusResponse, type AsyncScrapeRequest, type AsyncScrapeResponse, type AsyncScrapeWebhook, AuthenticationError, Crawlbrulee, CrawlbruleeError, type CrawlbruleeOptions, DEFAULT_BASE_URL, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, ENV_API_KEY, type HttpMethod, type MapCache, type MapLinkItem, type MapLocation, type MapPagination, type MapRequest, type MapResponse, type MapResponseMeta, type MapTruncation, type MapTypes, NotFoundError, type PageInlineImage, type PageLink, type ProxyTier, RateLimitError, type RateLimitErrorDetails, type RequestOptions, type ResolvedProxyTier, type ResponseMeta, type ScrapeCache, type ScrapeCompleteWebhook, type ScrapeCompleteWebhookData, type ScrapeExtract, type ScrapeLocation, type ScrapeMetadata, type ScrapeRequest, type ScrapeResponse, type ScrapeWebhookStatus, type ScreenshotAfterAction, type ScreenshotBeforeAction, type ScreenshotCleanup, type ScreenshotDeviceMode, type ScreenshotProperties, type ScreenshotRequest, type ScreenshotResult, type ScreenshotScrollAction, type ScreenshotSlice, type ScreenshotSliceAction, type ScreenshotType, type ScreenshotViewport, type ScreenshotViewportInfo, type ScreenshotWaitAction, TransportError, type Usage, UsageAllocationError, type UsageAllocationErrorDetails, type UsageAllocationReason, type UsageLimitDetails, type UsageResponse, ValidationError, type VerifyWebhookSignatureOptions, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_ROTATED_HEADER, type WaitForScrapeOptions, type WebhookSignatureSource, type WebhookVerificationFailureReason, type WebhookVerificationResult, type WhoamiResponse, isCrawlbruleeError, verifyWebhookSignature };
1045
+ //#endregion
1046
+ export { ApiErrorDetails, ApiErrorName, ApiErrorResponse, AsyncJobStatus, AsyncJobStatusResponse, AsyncScrapeRequest, AsyncScrapeResponse, AsyncScrapeWebhook, AuthenticationError, Crawlbrulee, CrawlbruleeError, type CrawlbruleeOptions, DEFAULT_BASE_URL, DEFAULT_REQUEST_TIMEOUT_MS, DEFAULT_WEBHOOK_TOLERANCE_SECONDS, ENV_API_KEY, type HttpMethod, MapCache, MapLinkItem, MapLocation, MapPagination, MapRequest, MapResponse, MapResponseMeta, MapTruncation, MapTypes, NotFoundError, PageInlineImage, PageLink, ProxyTier, RateLimitError, RateLimitErrorDetails, type RequestOptions, ResolvedProxyTier, ResponseMeta, ScrapeCache, ScrapeCompleteWebhook, ScrapeCompleteWebhookData, ScrapeExtract, ScrapeLocation, ScrapeMetadata, ScrapeRequest, ScrapeResponse, ScrapeWebhookStatus, ScreenshotAfterAction, ScreenshotBeforeAction, ScreenshotCleanup, ScreenshotDeviceMode, ScreenshotProperties, ScreenshotRequest, ScreenshotResult, ScreenshotScrollAction, ScreenshotSlice, ScreenshotSliceAction, ScreenshotType, ScreenshotViewport, ScreenshotViewportInfo, ScreenshotWaitAction, TransportError, Usage, UsageAllocationError, UsageAllocationErrorDetails, UsageAllocationReason, UsageLimitDetails, UsageResponse, ValidationError, type VerifyWebhookSignatureOptions, WEBHOOK_EVENT_ID_HEADER, WEBHOOK_SIGNATURE_HEADER, WEBHOOK_SIGNATURE_ROTATED_HEADER, type WaitForScrapeOptions, type WebhookSignatureSource, type WebhookVerificationFailureReason, type WebhookVerificationResult, WhoamiResponse, isCrawlbruleeError, verifyWebhookSignature };
1047
+ //# sourceMappingURL=index.d.cts.map