@hunt-labs/bytekit-sdk 0.11.13 → 0.11.15
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/CHANGELOG.md +32 -0
- package/dist/generated/api.d.ts +155 -17
- package/dist/resources/scrape.d.ts +4 -4
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,38 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.11.15] - 2026-11-04
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **New internal `GET /v1/bulk/concurrency` operation (#3718).** The generated `getBulkConcurrency`
|
|
18
|
+
types record a read-only operation that returns `{ active, limit }`: the account's in-use bulk
|
|
19
|
+
concurrency slots (`null` when the slot count cannot be read) and the plan cap, for the dashboard's
|
|
20
|
+
bulk playground. It is `x-sdk-scope: internal` and adds no SDK method, so no published method
|
|
21
|
+
signature moves; `GET /v1/bulk` is unchanged.
|
|
22
|
+
- **`device_scale_factor` accepts only `1` (#5630).** The generated `ScreenshotRequest` and the bulk
|
|
23
|
+
`defaults` types narrow `device_scale_factor` from `1 | 2 | null` to `1 | null`. The API now answers
|
|
24
|
+
`2` (or any other value) with a 422 `validation_error`; omitting the field still means `null`.
|
|
25
|
+
Regenerated `src/generated/api.d.ts`.
|
|
26
|
+
|
|
27
|
+
## [0.11.14] - 2026-10-27
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **`'outline'` is now a `scrape` format (#5473).** `formats: ['outline']` on `scrape.create` (and the
|
|
32
|
+
bulk entry points) returns `formats.outline`, an indented text accessibility tree of the
|
|
33
|
+
browser-rendered page with no element IDs. Experimental; it forces the browser path and adds no
|
|
34
|
+
credits. Regenerated `src/generated/api.d.ts`.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- **`solve_challenge` is documented as a held browser render that can return the 202 receipt
|
|
39
|
+
(#5541).** Since #5532 a synchronous `scrape.create` with `solve_challenge: true` is routed to the
|
|
40
|
+
browser render and held up to the hold window (28 s by default); a solve that outlasts it resolves
|
|
41
|
+
to the `queued` receipt. The `ScrapeCreateResponse` and `solve_challenge` JSDoc and the regenerated
|
|
42
|
+
`src/generated/api.d.ts` say so, and the routing triggers now list `solve_challenge` and `outline`
|
|
43
|
+
next to `delay_ms`. Description text only; no SDK method signature moves.
|
|
44
|
+
|
|
13
45
|
## [0.11.13] - 2026-10-21
|
|
14
46
|
|
|
15
47
|
### Changed
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ export interface paths {
|
|
|
201
201
|
* **The response shape is decided by your request, not by how we route it.** In precedence order:
|
|
202
202
|
*
|
|
203
203
|
* 1. `async: true` in the body, or `?async=true` in the query string (either one is enough; `false` in one never cancels `true` in the other) → **202** with a `ScrapeQueuedEnvelope` receipt, returned immediately. Poll `GET /v1/scrape/{id}` for the result.
|
|
204
|
-
* 2. Otherwise, a request that needs a full page render — today that is `delay_ms > 0` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background.
|
|
204
|
+
* 2. Otherwise, a request that needs a full page render — today that is any of `delay_ms > 0`, `solve_challenge: true`, or `outline` in `formats` — is **held open** until the render reaches a terminal state, then returns **200** with the content envelope (`success` or `failed`). If the render is still running when the hold window expires (28 seconds by default), the request returns the **202** receipt instead and the job continues in the background. A `solve_challenge` render can outlast the hold window, so expect the 202 receipt from such a request.
|
|
205
205
|
* 3. Otherwise the request is served by the fast HTTP path and returns **200** with the content envelope, typically in under a second.
|
|
206
206
|
*
|
|
207
207
|
* **A failed fetch is a result, not a transport error.** An unreachable host, a refused connection, or a target whose bot protection defeats every proxy tier all come back on the same **200** as a `failed` envelope — never a 5xx. Narrow on the envelope's `status` before reading the body. A failure the fast path decides inline is recorded as a failed job, so its envelope normally carries that job's `id` and `GET /v1/scrape/{id}` returns the same envelope; if recording the failed job itself fails, the envelope still arrives on the same 200 with `id` set to `null` and there is nothing to poll. A failure a held render reaches carries that render's real `id`. Either way the request transfers no billable bytes and is charged nothing.
|
|
@@ -465,6 +465,33 @@ export interface paths {
|
|
|
465
465
|
patch?: never;
|
|
466
466
|
trace?: never;
|
|
467
467
|
};
|
|
468
|
+
"/v1/bulk/concurrency": {
|
|
469
|
+
parameters: {
|
|
470
|
+
query?: never;
|
|
471
|
+
header?: never;
|
|
472
|
+
path?: never;
|
|
473
|
+
cookie?: never;
|
|
474
|
+
};
|
|
475
|
+
/**
|
|
476
|
+
* Get bulk concurrency usage
|
|
477
|
+
* @description Returns how many of the account's bulk concurrency slots are in use and
|
|
478
|
+
* the plan cap they count against, so a dashboard can tell a bulk job that
|
|
479
|
+
* is waiting on the cap from one that is stalled. `active` is a live
|
|
480
|
+
* approximation of dispatched bulk children: a slot whose release never
|
|
481
|
+
* arrived drops out of the count after 5 minutes. It is for display only
|
|
482
|
+
* and never decides a job's state or progress, which come from the job's
|
|
483
|
+
* own counters, nor enforcement or billing. Authenticates with an API key
|
|
484
|
+
* or a dashboard session, like the other `/v1/bulk` operations.
|
|
485
|
+
*/
|
|
486
|
+
get: operations["getBulkConcurrency"];
|
|
487
|
+
put?: never;
|
|
488
|
+
post?: never;
|
|
489
|
+
delete?: never;
|
|
490
|
+
options?: never;
|
|
491
|
+
head?: never;
|
|
492
|
+
patch?: never;
|
|
493
|
+
trace?: never;
|
|
494
|
+
};
|
|
468
495
|
"/v1/bulk/{id}": {
|
|
469
496
|
parameters: {
|
|
470
497
|
query?: never;
|
|
@@ -1859,7 +1886,7 @@ export interface components {
|
|
|
1859
1886
|
*/
|
|
1860
1887
|
mobile: boolean;
|
|
1861
1888
|
/**
|
|
1862
|
-
* @description Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render.
|
|
1889
|
+
* @description Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. On a synchronous `POST /v1/scrape` this routes the request to the held browser render; a solve can outlast the hold window (28 seconds by default), and the request then returns the 202 receipt while the job continues in the background. With `async: true` the 202 receipt is returned immediately.
|
|
1863
1890
|
* @default false
|
|
1864
1891
|
*/
|
|
1865
1892
|
solve_challenge: boolean;
|
|
@@ -1905,7 +1932,7 @@ export interface components {
|
|
|
1905
1932
|
* @description A string entry of `ScrapeRequest.formats`.
|
|
1906
1933
|
* @enum {string}
|
|
1907
1934
|
*/
|
|
1908
|
-
ScrapeRequestFormatsItem: "raw" | "markdown" | "links" | "images";
|
|
1935
|
+
ScrapeRequestFormatsItem: "raw" | "markdown" | "links" | "images" | "outline";
|
|
1909
1936
|
/**
|
|
1910
1937
|
* @description The `json` entry of `ScrapeRequest.formats`: structured extraction over the scraped
|
|
1911
1938
|
* page, using the same extractor as `POST /v1/schema`.
|
|
@@ -2017,6 +2044,14 @@ export interface components {
|
|
|
2017
2044
|
/** @description The extraction model that ran. */
|
|
2018
2045
|
model: string;
|
|
2019
2046
|
};
|
|
2047
|
+
/**
|
|
2048
|
+
* @description Experimental. An indented text accessibility tree of the browser-rendered page, one
|
|
2049
|
+
* `- role: name = value` line per node, with no element IDs. Requesting `outline`
|
|
2050
|
+
* forces the slow (browser) path and adds no credits. Omitted, with an
|
|
2051
|
+
* `artifact_unavailable` warning, when the page cannot be rendered or captured. Not
|
|
2052
|
+
* accepted on `/v1/monitors`.
|
|
2053
|
+
*/
|
|
2054
|
+
outline?: string;
|
|
2020
2055
|
};
|
|
2021
2056
|
ScrapeMetadata: {
|
|
2022
2057
|
title: string | null;
|
|
@@ -2204,7 +2239,7 @@ export interface components {
|
|
|
2204
2239
|
code: "validation_error" | "invalid_url" | "request_too_large" | "payload_too_large" | "unsupported_content_type" | "rate_limited" | "upstream_error" | "blocked" | "target_rate_limited" | "timeout" | "internal_error";
|
|
2205
2240
|
message: string;
|
|
2206
2241
|
http_status?: number;
|
|
2207
|
-
/** @description Whole seconds the target site asked us to wait before the next request. Present only with `code: target_rate_limited`, only on the inline `POST /v1/scrape` failure the fast path decides, and only when the target sent a usable `Retry-After` (delta-seconds, or an HTTP-date still in the future, converted to seconds; values above 2147483647 are reported as 2147483647). Informational: ByteKit never enforces it on your next request. A held render (`delay_ms > 0`), `GET /v1/scrape/{id}` and webhooks omit it, because the value is relative to the moment the target answered. */
|
|
2242
|
+
/** @description Whole seconds the target site asked us to wait before the next request. Present only with `code: target_rate_limited`, only on the inline `POST /v1/scrape` failure the fast path decides, and only when the target sent a usable `Retry-After` (delta-seconds, or an HTTP-date still in the future, converted to seconds; values above 2147483647 are reported as 2147483647). Informational: ByteKit never enforces it on your next request. A held render (`delay_ms > 0`, `solve_challenge: true`, or `outline` in `formats`), `GET /v1/scrape/{id}` and webhooks omit it, because the value is relative to the moment the target answered. */
|
|
2208
2243
|
retry_after_seconds?: number;
|
|
2209
2244
|
/** Format: date-time */
|
|
2210
2245
|
failed_at: string;
|
|
@@ -2310,10 +2345,11 @@ export interface components {
|
|
|
2310
2345
|
/** @default false */
|
|
2311
2346
|
dark_mode: boolean;
|
|
2312
2347
|
/**
|
|
2348
|
+
* @description Pixel density. Only `1` is supported; any other value is a 422 `validation_error`.
|
|
2313
2349
|
* @default null
|
|
2314
2350
|
* @enum {integer|null}
|
|
2315
2351
|
*/
|
|
2316
|
-
device_scale_factor: 1 |
|
|
2352
|
+
device_scale_factor: 1 | null;
|
|
2317
2353
|
/** @default false */
|
|
2318
2354
|
include_html: boolean;
|
|
2319
2355
|
/** @default US */
|
|
@@ -3705,7 +3741,7 @@ export interface operations {
|
|
|
3705
3741
|
"X-Screenshot-Status"?: string;
|
|
3706
3742
|
/** @description The originally requested URL. */
|
|
3707
3743
|
"X-Screenshot-URL"?: string;
|
|
3708
|
-
/** @description Legacy credit weight for this capture (1, 2 or 4, doubling for `full_page` and again for
|
|
3744
|
+
/** @description Legacy credit weight for this capture (1, 2 or 4, doubling for `full_page` and again for mobile). It is recorded for reporting only — screenshots are billed on bandwidth, not credits: the charge is the Phase 1 wire bytes x 1.5, and zero when Phase 1 is skipped or fails. */
|
|
3709
3745
|
"X-Screenshot-Credits-Charged"?: number;
|
|
3710
3746
|
/** @description Handler elapsed time in milliseconds. */
|
|
3711
3747
|
"X-Screenshot-Duration-Ms"?: number;
|
|
@@ -3746,7 +3782,7 @@ export interface operations {
|
|
|
3746
3782
|
"X-Screenshot-Status"?: string;
|
|
3747
3783
|
/** @description The originally requested URL. */
|
|
3748
3784
|
"X-Screenshot-URL"?: string;
|
|
3749
|
-
/** @description Legacy credit weight for this capture (1, 2 or 4, doubling for `full_page` and again for
|
|
3785
|
+
/** @description Legacy credit weight for this capture (1, 2 or 4, doubling for `full_page` and again for mobile). It is recorded for reporting only — screenshots are billed on bandwidth, not credits: the charge is the Phase 1 wire bytes x 1.5, and zero when Phase 1 is skipped or fails. */
|
|
3750
3786
|
"X-Screenshot-Credits-Charged"?: number;
|
|
3751
3787
|
/** @description Handler elapsed time in milliseconds. */
|
|
3752
3788
|
"X-Screenshot-Duration-Ms"?: number;
|
|
@@ -4049,6 +4085,22 @@ export interface operations {
|
|
|
4049
4085
|
};
|
|
4050
4086
|
401: components["responses"]["Unauthorized"];
|
|
4051
4087
|
402: components["responses"]["PaymentRequired"];
|
|
4088
|
+
/**
|
|
4089
|
+
* @description `unsupported_content_type`, in two cases:
|
|
4090
|
+
* - The `url` path ends in `.pdf`: the path, lowercased, ends in `.pdf`; the query string and
|
|
4091
|
+
* fragment are not looked at. It is refused before anything is drawn. A PDF served from
|
|
4092
|
+
* another path, or reached through a redirect, is not caught by this check.
|
|
4093
|
+
* - The page was fetched (or served from cache) and its content type cannot produce the
|
|
4094
|
+
* requested formats. The charge is refunded.
|
|
4095
|
+
*/
|
|
4096
|
+
415: {
|
|
4097
|
+
headers: {
|
|
4098
|
+
[name: string]: unknown;
|
|
4099
|
+
};
|
|
4100
|
+
content: {
|
|
4101
|
+
"application/json": components["schemas"]["Error"];
|
|
4102
|
+
};
|
|
4103
|
+
};
|
|
4052
4104
|
/**
|
|
4053
4105
|
* @description Validation error. A `json` format entry whose `schema` the extractor cannot take is
|
|
4054
4106
|
* refused with `schema_incompatible`, before anything is drawn.
|
|
@@ -4208,7 +4260,7 @@ export interface operations {
|
|
|
4208
4260
|
items?: {
|
|
4209
4261
|
/** Format: uri */
|
|
4210
4262
|
url: string;
|
|
4211
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4263
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4212
4264
|
country?: string;
|
|
4213
4265
|
delay_ms?: number;
|
|
4214
4266
|
timeout_ms?: number;
|
|
@@ -4241,7 +4293,7 @@ export interface operations {
|
|
|
4241
4293
|
* "raw"
|
|
4242
4294
|
* ]
|
|
4243
4295
|
*/
|
|
4244
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4296
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4245
4297
|
/** @default US */
|
|
4246
4298
|
country?: string;
|
|
4247
4299
|
/** @default 0 */
|
|
@@ -4317,6 +4369,20 @@ export interface operations {
|
|
|
4317
4369
|
estimated_credits: number | null;
|
|
4318
4370
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
4319
4371
|
webhook_url: string;
|
|
4372
|
+
/**
|
|
4373
|
+
* @description Items refused at intake and not queued, by their index in `items` or `urls`.
|
|
4374
|
+
* An item is refused with `unsupported_content_type` when its URL path, lowercased,
|
|
4375
|
+
* ends in `.pdf` (the query string and fragment are not looked at). Refused items
|
|
4376
|
+
* are not counted in `total` and nothing is reserved for them. Empty when every
|
|
4377
|
+
* item was accepted.
|
|
4378
|
+
*/
|
|
4379
|
+
rejected: {
|
|
4380
|
+
index: number;
|
|
4381
|
+
url: string;
|
|
4382
|
+
/** @enum {string} */
|
|
4383
|
+
code: "unsupported_content_type";
|
|
4384
|
+
message: string;
|
|
4385
|
+
}[];
|
|
4320
4386
|
};
|
|
4321
4387
|
};
|
|
4322
4388
|
};
|
|
@@ -4372,9 +4438,25 @@ export interface operations {
|
|
|
4372
4438
|
};
|
|
4373
4439
|
};
|
|
4374
4440
|
/**
|
|
4375
|
-
* @description
|
|
4376
|
-
*
|
|
4377
|
-
* `
|
|
4441
|
+
* @description `unsupported_content_type`: every item in the batch was refused because its URL path ends in
|
|
4442
|
+
* `.pdf` (the path, lowercased; the query string and fragment are not looked at). Nothing is
|
|
4443
|
+
* queued or billed. `details.rejected` lists each item as `{ index, url, code, message }`.
|
|
4444
|
+
* When only some items are refused the batch is accepted with `202` and those items are
|
|
4445
|
+
* listed in `rejected` instead.
|
|
4446
|
+
*/
|
|
4447
|
+
415: {
|
|
4448
|
+
headers: {
|
|
4449
|
+
[name: string]: unknown;
|
|
4450
|
+
};
|
|
4451
|
+
content: {
|
|
4452
|
+
"application/json": components["schemas"]["Error"];
|
|
4453
|
+
};
|
|
4454
|
+
};
|
|
4455
|
+
/**
|
|
4456
|
+
* @description Validation error. `bulk_too_large` is returned when the count of
|
|
4457
|
+
* accepted items exceeds the account plan's `max_bulk_size` cap (also
|
|
4458
|
+
* surfaced as `max_bulk_size` on `GET /v1/account`). Items refused
|
|
4459
|
+
* for a `.pdf` path are listed in `rejected` and do not count.
|
|
4378
4460
|
*/
|
|
4379
4461
|
422: {
|
|
4380
4462
|
headers: {
|
|
@@ -5253,8 +5335,7 @@ export interface operations {
|
|
|
5253
5335
|
* "country": "US",
|
|
5254
5336
|
* "formats": [
|
|
5255
5337
|
* "raw"
|
|
5256
|
-
* ]
|
|
5257
|
-
* "device_scale_factor": 2
|
|
5338
|
+
* ]
|
|
5258
5339
|
* },
|
|
5259
5340
|
* "metadata": {
|
|
5260
5341
|
* "campaign": "q3"
|
|
@@ -5289,7 +5370,7 @@ export interface operations {
|
|
|
5289
5370
|
language?: string | null;
|
|
5290
5371
|
dark_mode?: boolean;
|
|
5291
5372
|
/** @description Scrape output formats (scrape entries). */
|
|
5292
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5373
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5293
5374
|
/** @enum {string} */
|
|
5294
5375
|
wait_until?: "load" | "domcontentloaded" | "networkidle";
|
|
5295
5376
|
wait_for_selector?: string | null;
|
|
@@ -5342,7 +5423,7 @@ export interface operations {
|
|
|
5342
5423
|
language?: string | null;
|
|
5343
5424
|
/** @default false */
|
|
5344
5425
|
dark_mode?: boolean;
|
|
5345
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5426
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5346
5427
|
/**
|
|
5347
5428
|
* @default load
|
|
5348
5429
|
* @enum {string}
|
|
@@ -5358,10 +5439,11 @@ export interface operations {
|
|
|
5358
5439
|
height: number;
|
|
5359
5440
|
} | null;
|
|
5360
5441
|
/**
|
|
5442
|
+
* @description Pixel density. Only `1` is supported; any other value is a 422 `validation_error`.
|
|
5361
5443
|
* @default null
|
|
5362
5444
|
* @enum {integer|null}
|
|
5363
5445
|
*/
|
|
5364
|
-
device_scale_factor?: 1 |
|
|
5446
|
+
device_scale_factor?: 1 | null;
|
|
5365
5447
|
};
|
|
5366
5448
|
/**
|
|
5367
5449
|
* Format: uri
|
|
@@ -5487,6 +5569,32 @@ export interface operations {
|
|
|
5487
5569
|
};
|
|
5488
5570
|
};
|
|
5489
5571
|
};
|
|
5572
|
+
getBulkConcurrency: {
|
|
5573
|
+
parameters: {
|
|
5574
|
+
query?: never;
|
|
5575
|
+
header?: never;
|
|
5576
|
+
path?: never;
|
|
5577
|
+
cookie?: never;
|
|
5578
|
+
};
|
|
5579
|
+
requestBody?: never;
|
|
5580
|
+
responses: {
|
|
5581
|
+
/** @description Successful response. */
|
|
5582
|
+
200: {
|
|
5583
|
+
headers: {
|
|
5584
|
+
[name: string]: unknown;
|
|
5585
|
+
};
|
|
5586
|
+
content: {
|
|
5587
|
+
"application/json": {
|
|
5588
|
+
/** @description Bulk slots in use right now. `0` is a real zero (nothing running). `null` means the slot count could not be read right now; it is not zero. */
|
|
5589
|
+
active: number | null;
|
|
5590
|
+
/** @description The plan's maximum concurrency, the cap `active` counts against. */
|
|
5591
|
+
limit: number;
|
|
5592
|
+
};
|
|
5593
|
+
};
|
|
5594
|
+
};
|
|
5595
|
+
401: components["responses"]["Unauthorized"];
|
|
5596
|
+
};
|
|
5597
|
+
};
|
|
5490
5598
|
getBulk: {
|
|
5491
5599
|
parameters: {
|
|
5492
5600
|
query?: never;
|
|
@@ -5833,6 +5941,21 @@ export interface operations {
|
|
|
5833
5941
|
"application/json": components["schemas"]["Error"];
|
|
5834
5942
|
};
|
|
5835
5943
|
};
|
|
5944
|
+
/**
|
|
5945
|
+
* @description `unsupported_content_type`: a `scrape` monitor whose `url` path ends in `.pdf` is refused
|
|
5946
|
+
* before it is stored. The check is on the URL only: the path, lowercased, ends in `.pdf`;
|
|
5947
|
+
* the query string and fragment are not looked at. A PDF served from another path, or reached
|
|
5948
|
+
* through a redirect, is not caught here — its polls fail as `unsupported_content_type` and
|
|
5949
|
+
* count toward auto-suspension. A `screenshot` monitor is not affected.
|
|
5950
|
+
*/
|
|
5951
|
+
415: {
|
|
5952
|
+
headers: {
|
|
5953
|
+
[name: string]: unknown;
|
|
5954
|
+
};
|
|
5955
|
+
content: {
|
|
5956
|
+
"application/json": components["schemas"]["Error"];
|
|
5957
|
+
};
|
|
5958
|
+
};
|
|
5836
5959
|
/** @description Validation error. */
|
|
5837
5960
|
422: {
|
|
5838
5961
|
headers: {
|
|
@@ -5969,6 +6092,21 @@ export interface operations {
|
|
|
5969
6092
|
"application/json": components["schemas"]["Error"];
|
|
5970
6093
|
};
|
|
5971
6094
|
};
|
|
6095
|
+
/**
|
|
6096
|
+
* @description `unsupported_content_type`: a `scrape` monitor whose `url` path ends in `.pdf` is refused
|
|
6097
|
+
* before it is stored. The check is on the URL only: the path, lowercased, ends in `.pdf`;
|
|
6098
|
+
* the query string and fragment are not looked at. A PDF served from another path, or reached
|
|
6099
|
+
* through a redirect, is not caught here — its polls fail as `unsupported_content_type` and
|
|
6100
|
+
* count toward auto-suspension. A `screenshot` monitor is not affected.
|
|
6101
|
+
*/
|
|
6102
|
+
415: {
|
|
6103
|
+
headers: {
|
|
6104
|
+
[name: string]: unknown;
|
|
6105
|
+
};
|
|
6106
|
+
content: {
|
|
6107
|
+
"application/json": components["schemas"]["Error"];
|
|
6108
|
+
};
|
|
6109
|
+
};
|
|
5972
6110
|
/** @description Validation error. */
|
|
5973
6111
|
422: {
|
|
5974
6112
|
headers: {
|
|
@@ -13,8 +13,8 @@ import type { ScrapeId, BulkId } from '../types.js';
|
|
|
13
13
|
* The shape follows from the request, in this order:
|
|
14
14
|
*
|
|
15
15
|
* 1. `async: true` → 202 receipt, immediately. Poll `scrape.get(id)`.
|
|
16
|
-
* 2. Otherwise a request that needs a full page render — today that is
|
|
17
|
-
* `delay_ms > 0` — is held open until the render reaches a terminal state
|
|
16
|
+
* 2. Otherwise a request that needs a full page render — today that is any of
|
|
17
|
+
* `delay_ms > 0`, `solve_challenge: true`, or `outline` in `formats` — is held open until the render reaches a terminal state
|
|
18
18
|
* and returns 200 with that state: the content envelope on success, or the
|
|
19
19
|
* `failed` error envelope when the render itself failed. If the render is
|
|
20
20
|
* still running when the server's hold window expires (28 s by default), it
|
|
@@ -54,7 +54,7 @@ export type ScrapeJsonFormat = components['schemas']['ScrapeRequestJsonFormat'];
|
|
|
54
54
|
export interface ScrapeOpts {
|
|
55
55
|
url: string;
|
|
56
56
|
/** String formats, plus at most one `{ type: 'json', schema }` entry for structured extraction (the entry's result is `formats.json`). */
|
|
57
|
-
formats?: Array<'raw' | 'markdown' | 'links' | 'images' | ScrapeJsonFormat>;
|
|
57
|
+
formats?: Array<'raw' | 'markdown' | 'links' | 'images' | 'outline' | ScrapeJsonFormat>;
|
|
58
58
|
country?: string;
|
|
59
59
|
delay_ms?: number;
|
|
60
60
|
/** SERVER-side scrape budget in ms — how long the server may spend on the scrape itself. For the CLIENT-side abort budget (when this SDK gives up on the wire), see `RequestOptions.requestTimeoutMs`. */
|
|
@@ -88,7 +88,7 @@ export interface ScrapeOpts {
|
|
|
88
88
|
token_budget?: number;
|
|
89
89
|
/** Tokenizer encoding hint for `token_budget`. `cl100k_base` (default) matches GPT-4/4o; `o200k_base` matches GPT-4o-mini / o-series. */
|
|
90
90
|
token_encoding?: TokenEncoding;
|
|
91
|
-
/** Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. */
|
|
91
|
+
/** Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render. On a synchronous scrape this routes the request to the held browser render; a solve can outlast the hold window (28 seconds by default), and the request then returns the 202 receipt while the job continues in the background. With `async: true` the 202 receipt is returned immediately. */
|
|
92
92
|
solve_challenge?: boolean;
|
|
93
93
|
/** When true, emulate a mobile device (mobile UA + viewport). Default false (desktop). Part of the cache key, so mobile and desktop responses cache independently. */
|
|
94
94
|
mobile?: boolean;
|
package/dist/version.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* outbound request carries — see the emit site in `client.ts`. The header name is spelled
|
|
6
6
|
* only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
|
|
7
7
|
*/
|
|
8
|
-
export declare const SDK_VERSION = "0.11.
|
|
8
|
+
export declare const SDK_VERSION = "0.11.15";
|
package/dist/version.js
CHANGED