@hunt-labs/bytekit-sdk 0.11.1 → 0.11.3

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 CHANGED
@@ -10,6 +10,31 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.11.3] - 2026-09-21
14
+
15
+ ### Changed
16
+
17
+ - Regenerated `src/generated/api.d.ts` (#4669): `GET /v1/fetch` and `POST /v1/fetch` document a
18
+ second `422` condition. A fetch whose retries were exhausted against the target used to answer
19
+ `503` with code `internal_error` and the message "Fetch service unavailable.", which read as an
20
+ outage of the API; it now answers `422` with code `blocked` when the target's bot protection
21
+ refused every attempt and `upstream_error` (message "Failed to fetch URL.") otherwise, and it is
22
+ still charged nothing. A client that matched that `503` must match `422` and the code instead;
23
+ the `503` `internal_error` remains only for a deployment whose fetch service endpoint or
24
+ internal token is not configured.
25
+ Doc comments only; no SDK signature moves.
26
+
27
+ ## [0.11.2] - 2026-09-18
28
+
29
+ ### Changed
30
+
31
+ - Regenerated `src/generated/api.d.ts` (#4582): bulk item `billing` is `BillingNode | null`.
32
+ - Regenerated `src/generated/api.d.ts` (#4584): `POST /v1/schema` now rejects slow-path
33
+ rendering options (`wait_until=networkidle`, `delay_ms`, `wait_for_selector`, cookies, custom
34
+ headers) with error code `unsupported_option` instead of `unsupported_url`, still HTTP 400.
35
+ `unsupported_url` is removed from the API and has no other emitter; a client matching on it
36
+ must match `unsupported_option` for this case. Doc comments only; no SDK signature moves.
37
+
13
38
  ## [0.11.1] - 2026-09-17
14
39
 
15
40
  ### Changed
@@ -637,7 +637,7 @@ export interface paths {
637
637
  * @description Fetches `url` and extracts structured JSON conforming to the supplied
638
638
  * JSON Schema (draft 2020-12) using an LLM. Fast-path only — slow-path
639
639
  * rendering options (`wait_until=networkidle`, `delay_ms`,
640
- * `wait_for_selector`) cause a `400 unsupported_url`.
640
+ * `wait_for_selector`) cause a `400 unsupported_option`.
641
641
  *
642
642
  * Dual-axis billing: a fixed per-request credit charge **plus** the
643
643
  * underlying page's bandwidth, billed exactly like `/v1/scrape`. The
@@ -4110,7 +4110,23 @@ export interface operations {
4110
4110
  };
4111
4111
  };
4112
4112
  402: components["responses"]["PaymentRequired"];
4113
- /** @description Validation error (e.g. slow-path-only field). */
4113
+ /**
4114
+ * @description Validation error (e.g. slow-path-only field), or a fetch that failed for a
4115
+ * target-side reason.
4116
+ *
4117
+ * Two distinct conditions answer `422`. Read `error.code` to tell them apart.
4118
+ *
4119
+ * - **`validation_error`** — the request itself was rejected.
4120
+ * - **`blocked`** or **`upstream_error`** — the fetch ran and the target could not
4121
+ * be read. `blocked` means the target's bot protection refused every attempt;
4122
+ * `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries
4123
+ * failure, such as a host that does not resolve. This is a result about the URL,
4124
+ * not an outage of this API, so it is a `4xx` rather than `502` or `503`. No
4125
+ * upstream HTTP status was received, so `error.http_status` reports `422`,
4126
+ * mirroring what was served — unlike the relayed `upstream_error` under `502`
4127
+ * below, whose status is the target's own. The request transfers no billable
4128
+ * bytes and is charged nothing (#4669).
4129
+ */
4114
4130
  422: {
4115
4131
  headers: {
4116
4132
  [name: string]: unknown;
@@ -4157,10 +4173,12 @@ export interface operations {
4157
4173
  * the **true upstream status**, `502` — not `503` — and is the only surviving
4158
4174
  * record of what the target answered, so the body rather than the HTTP status is
4159
4175
  * authoritative here (#3355).
4160
- * - **`internal_error`** (message `Fetch service unavailable.`) — the fetch service
4161
- * could not be reached at all. There is no upstream status to preserve: the `503`
4162
- * is this API's own choice of wire status, so the body's `error.http_status`
4163
- * reports `503`, mirroring what was served (#3373).
4176
+ * - **`internal_error`** (message `Fetch service unavailable.`) — no fetch service
4177
+ * endpoint could be resolved on this deployment, a fault of this API and not of the
4178
+ * target. There is no upstream status to preserve: the `503` is this API's own
4179
+ * choice of wire status, so the body's `error.http_status` reports `503`, mirroring
4180
+ * what was served (#3373). A fetch that ran and failed for a target-side reason
4181
+ * answers `422` instead (#4669).
4164
4182
  */
4165
4183
  503: {
4166
4184
  headers: {
@@ -4236,7 +4254,23 @@ export interface operations {
4236
4254
  };
4237
4255
  };
4238
4256
  402: components["responses"]["PaymentRequired"];
4239
- /** @description Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only field). */
4257
+ /**
4258
+ * @description Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only
4259
+ * field), or a fetch that failed for a target-side reason.
4260
+ *
4261
+ * Two distinct conditions answer `422`. Read `error.code` to tell them apart.
4262
+ *
4263
+ * - **`validation_error`** — the request itself was rejected.
4264
+ * - **`blocked`** or **`upstream_error`** — the fetch ran and the target could not
4265
+ * be read. `blocked` means the target's bot protection refused every attempt;
4266
+ * `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries
4267
+ * failure, such as a host that does not resolve. This is a result about the URL,
4268
+ * not an outage of this API, so it is a `4xx` rather than `502` or `503`. No
4269
+ * upstream HTTP status was received, so `error.http_status` reports `422`,
4270
+ * mirroring what was served — unlike the relayed `upstream_error` under `502`
4271
+ * below, whose status is the target's own. The request transfers no billable
4272
+ * bytes and is charged nothing (#4669).
4273
+ */
4240
4274
  422: {
4241
4275
  headers: {
4242
4276
  [name: string]: unknown;
@@ -4283,10 +4317,12 @@ export interface operations {
4283
4317
  * the **true upstream status**, `502` — not `503` — and is the only surviving
4284
4318
  * record of what the target answered, so the body rather than the HTTP status is
4285
4319
  * authoritative here (#3355).
4286
- * - **`internal_error`** (message `Fetch service unavailable.`) — the fetch service
4287
- * could not be reached at all. There is no upstream status to preserve: the `503`
4288
- * is this API's own choice of wire status, so the body's `error.http_status`
4289
- * reports `503`, mirroring what was served (#3373).
4320
+ * - **`internal_error`** (message `Fetch service unavailable.`) — no fetch service
4321
+ * endpoint could be resolved on this deployment, a fault of this API and not of the
4322
+ * target. There is no upstream status to preserve: the `503` is this API's own
4323
+ * choice of wire status, so the body's `error.http_status` reports `503`, mirroring
4324
+ * what was served (#3373). A fetch that ran and failed for a target-side reason
4325
+ * answers `422` instead (#4669).
4290
4326
  */
4291
4327
  503: {
4292
4328
  headers: {
@@ -5078,10 +5114,12 @@ export interface operations {
5078
5114
  credits_charged?: number | null;
5079
5115
  /**
5080
5116
  * @description Itemised account of this item's charge — the basis, the named factors
5081
- * that composed the multiplier, and the resulting billed bytes. Omitted
5082
- * for rows that completed before the billing node was persisted.
5117
+ * that composed the multiplier, and the resulting billed bytes. `null`
5118
+ * while `status` is not `completed` — the charge is not final yet, and
5119
+ * the key is present so an item keeps the same shape on every poll.
5120
+ * Omitted for rows that completed before the billing node was persisted.
5083
5121
  */
5084
- billing?: components["schemas"]["BillingNode"];
5122
+ billing?: components["schemas"]["BillingNode"] | null;
5085
5123
  error_code: string | null;
5086
5124
  /** @description Bounded human-readable failure detail. */
5087
5125
  error_message: string | null;
@@ -5781,7 +5819,7 @@ export interface operations {
5781
5819
  };
5782
5820
  };
5783
5821
  };
5784
- /** @description Invalid URL (`invalid_url`), unsupported model (`unsupported_model`), or slow-path URL (`unsupported_url`). */
5822
+ /** @description Invalid URL (`invalid_url`), unsupported model (`unsupported_model`), or unsupported slow-path option (`unsupported_option`). */
5785
5823
  400: {
5786
5824
  headers: {
5787
5825
  [name: string]: unknown;
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.1";
8
+ export declare const SDK_VERSION = "0.11.3";
package/dist/version.js CHANGED
@@ -9,4 +9,4 @@
9
9
  * outbound request carries — see the emit site in `client.ts`. The header name is spelled
10
10
  * only there, so issue #2905's pre-merge gate 1 counts exactly one occurrence in `src/`.
11
11
  */
12
- export const SDK_VERSION = '0.11.1';
12
+ export const SDK_VERSION = '0.11.3';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-sdk",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "description": "Official TypeScript SDK for the ByteKit API",
5
5
  "license": "MIT",
6
6
  "type": "module",