@hunt-labs/bytekit-sdk 0.11.13 → 0.11.14
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 +18 -0
- package/dist/generated/api.d.ts +16 -8
- 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,24 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.11.14] - 2026-10-27
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **`'outline'` is now a `scrape` format (#5473).** `formats: ['outline']` on `scrape.create` (and the
|
|
18
|
+
bulk entry points) returns `formats.outline`, an indented text accessibility tree of the
|
|
19
|
+
browser-rendered page with no element IDs. Experimental; it forces the browser path and adds no
|
|
20
|
+
credits. Regenerated `src/generated/api.d.ts`.
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **`solve_challenge` is documented as a held browser render that can return the 202 receipt
|
|
25
|
+
(#5541).** Since #5532 a synchronous `scrape.create` with `solve_challenge: true` is routed to the
|
|
26
|
+
browser render and held up to the hold window (28 s by default); a solve that outlasts it resolves
|
|
27
|
+
to the `queued` receipt. The `ScrapeCreateResponse` and `solve_challenge` JSDoc and the regenerated
|
|
28
|
+
`src/generated/api.d.ts` say so, and the routing triggers now list `solve_challenge` and `outline`
|
|
29
|
+
next to `delay_ms`. Description text only; no SDK method signature moves.
|
|
30
|
+
|
|
13
31
|
## [0.11.13] - 2026-10-21
|
|
14
32
|
|
|
15
33
|
### 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.
|
|
@@ -1859,7 +1859,7 @@ export interface components {
|
|
|
1859
1859
|
*/
|
|
1860
1860
|
mobile: boolean;
|
|
1861
1861
|
/**
|
|
1862
|
-
* @description Attempts to clear a Cloudflare challenge; success is not guaranteed. Billed as a normal browser render.
|
|
1862
|
+
* @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
1863
|
* @default false
|
|
1864
1864
|
*/
|
|
1865
1865
|
solve_challenge: boolean;
|
|
@@ -1905,7 +1905,7 @@ export interface components {
|
|
|
1905
1905
|
* @description A string entry of `ScrapeRequest.formats`.
|
|
1906
1906
|
* @enum {string}
|
|
1907
1907
|
*/
|
|
1908
|
-
ScrapeRequestFormatsItem: "raw" | "markdown" | "links" | "images";
|
|
1908
|
+
ScrapeRequestFormatsItem: "raw" | "markdown" | "links" | "images" | "outline";
|
|
1909
1909
|
/**
|
|
1910
1910
|
* @description The `json` entry of `ScrapeRequest.formats`: structured extraction over the scraped
|
|
1911
1911
|
* page, using the same extractor as `POST /v1/schema`.
|
|
@@ -2017,6 +2017,14 @@ export interface components {
|
|
|
2017
2017
|
/** @description The extraction model that ran. */
|
|
2018
2018
|
model: string;
|
|
2019
2019
|
};
|
|
2020
|
+
/**
|
|
2021
|
+
* @description Experimental. An indented text accessibility tree of the browser-rendered page, one
|
|
2022
|
+
* `- role: name = value` line per node, with no element IDs. Requesting `outline`
|
|
2023
|
+
* forces the slow (browser) path and adds no credits. Omitted, with an
|
|
2024
|
+
* `artifact_unavailable` warning, when the page cannot be rendered or captured. Not
|
|
2025
|
+
* accepted on `/v1/monitors`.
|
|
2026
|
+
*/
|
|
2027
|
+
outline?: string;
|
|
2020
2028
|
};
|
|
2021
2029
|
ScrapeMetadata: {
|
|
2022
2030
|
title: string | null;
|
|
@@ -2204,7 +2212,7 @@ export interface components {
|
|
|
2204
2212
|
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
2213
|
message: string;
|
|
2206
2214
|
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. */
|
|
2215
|
+
/** @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
2216
|
retry_after_seconds?: number;
|
|
2209
2217
|
/** Format: date-time */
|
|
2210
2218
|
failed_at: string;
|
|
@@ -4208,7 +4216,7 @@ export interface operations {
|
|
|
4208
4216
|
items?: {
|
|
4209
4217
|
/** Format: uri */
|
|
4210
4218
|
url: string;
|
|
4211
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4219
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4212
4220
|
country?: string;
|
|
4213
4221
|
delay_ms?: number;
|
|
4214
4222
|
timeout_ms?: number;
|
|
@@ -4241,7 +4249,7 @@ export interface operations {
|
|
|
4241
4249
|
* "raw"
|
|
4242
4250
|
* ]
|
|
4243
4251
|
*/
|
|
4244
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4252
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
4245
4253
|
/** @default US */
|
|
4246
4254
|
country?: string;
|
|
4247
4255
|
/** @default 0 */
|
|
@@ -5289,7 +5297,7 @@ export interface operations {
|
|
|
5289
5297
|
language?: string | null;
|
|
5290
5298
|
dark_mode?: boolean;
|
|
5291
5299
|
/** @description Scrape output formats (scrape entries). */
|
|
5292
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5300
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5293
5301
|
/** @enum {string} */
|
|
5294
5302
|
wait_until?: "load" | "domcontentloaded" | "networkidle";
|
|
5295
5303
|
wait_for_selector?: string | null;
|
|
@@ -5342,7 +5350,7 @@ export interface operations {
|
|
|
5342
5350
|
language?: string | null;
|
|
5343
5351
|
/** @default false */
|
|
5344
5352
|
dark_mode?: boolean;
|
|
5345
|
-
formats?: (("raw" | "markdown" | "links" | "images") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5353
|
+
formats?: (("raw" | "markdown" | "links" | "images" | "outline") | components["schemas"]["ScrapeRequestJsonFormat"])[];
|
|
5346
5354
|
/**
|
|
5347
5355
|
* @default load
|
|
5348
5356
|
* @enum {string}
|
|
@@ -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.14";
|
package/dist/version.js
CHANGED