@hunt-labs/bytekit-sdk 0.11.2 → 0.11.4

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,29 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
10
10
 
11
11
  ## [Unreleased]
12
12
 
13
+ ## [0.11.4] - 2026-09-21
14
+
15
+ ### Changed
16
+
17
+ - Regenerated `src/generated/api.d.ts` (#4732): the `422` responses of `GET /v1/fetch` and
18
+ `POST /v1/fetch` declare the optional `X-Fetch-ID` header, present when the failed request was
19
+ recorded and naming its row in Logs (`sc_<hex>` for the header's `ft_<hex>`). Doc comments
20
+ only; no SDK signature moves.
21
+
22
+ ## [0.11.3] - 2026-09-21
23
+
24
+ ### Changed
25
+
26
+ - Regenerated `src/generated/api.d.ts` (#4669): `GET /v1/fetch` and `POST /v1/fetch` document a
27
+ second `422` condition. A fetch whose retries were exhausted against the target used to answer
28
+ `503` with code `internal_error` and the message "Fetch service unavailable.", which read as an
29
+ outage of the API; it now answers `422` with code `blocked` when the target's bot protection
30
+ refused every attempt and `upstream_error` (message "Failed to fetch URL.") otherwise, and it is
31
+ still charged nothing. A client that matched that `503` must match `422` and the code instead;
32
+ the `503` `internal_error` remains only for a deployment whose fetch service endpoint or
33
+ internal token is not configured.
34
+ Doc comments only; no SDK signature moves.
35
+
13
36
  ## [0.11.2] - 2026-09-18
14
37
 
15
38
  ### Changed
@@ -4110,9 +4110,31 @@ 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: {
4132
+ /**
4133
+ * @description Optional; present only when the failed request was recorded. Names the failed
4134
+ * row: it appears in Logs under the same hex, rendered `sc_<hex>` (`ft_` in this
4135
+ * header, `sc_` in Logs).
4136
+ */
4137
+ "X-Fetch-ID": components["headers"]["XFetchID"];
4116
4138
  [name: string]: unknown;
4117
4139
  };
4118
4140
  content: {
@@ -4157,10 +4179,12 @@ export interface operations {
4157
4179
  * the **true upstream status**, `502` — not `503` — and is the only surviving
4158
4180
  * record of what the target answered, so the body rather than the HTTP status is
4159
4181
  * 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).
4182
+ * - **`internal_error`** (message `Fetch service unavailable.`) — no fetch service
4183
+ * endpoint could be resolved on this deployment, a fault of this API and not of the
4184
+ * target. There is no upstream status to preserve: the `503` is this API's own
4185
+ * choice of wire status, so the body's `error.http_status` reports `503`, mirroring
4186
+ * what was served (#3373). A fetch that ran and failed for a target-side reason
4187
+ * answers `422` instead (#4669).
4164
4188
  */
4165
4189
  503: {
4166
4190
  headers: {
@@ -4236,9 +4260,31 @@ export interface operations {
4236
4260
  };
4237
4261
  };
4238
4262
  402: components["responses"]["PaymentRequired"];
4239
- /** @description Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only field). */
4263
+ /**
4264
+ * @description Validation error (e.g. malformed JSON, unsupported fetch format, or slow-path-only
4265
+ * field), or a fetch that failed for a target-side reason.
4266
+ *
4267
+ * Two distinct conditions answer `422`. Read `error.code` to tell them apart.
4268
+ *
4269
+ * - **`validation_error`** — the request itself was rejected.
4270
+ * - **`blocked`** or **`upstream_error`** — the fetch ran and the target could not
4271
+ * be read. `blocked` means the target's bot protection refused every attempt;
4272
+ * `upstream_error` (message `Failed to fetch URL.`) is any other exhausted-retries
4273
+ * failure, such as a host that does not resolve. This is a result about the URL,
4274
+ * not an outage of this API, so it is a `4xx` rather than `502` or `503`. No
4275
+ * upstream HTTP status was received, so `error.http_status` reports `422`,
4276
+ * mirroring what was served — unlike the relayed `upstream_error` under `502`
4277
+ * below, whose status is the target's own. The request transfers no billable
4278
+ * bytes and is charged nothing (#4669).
4279
+ */
4240
4280
  422: {
4241
4281
  headers: {
4282
+ /**
4283
+ * @description Optional; present only when the failed request was recorded. Names the failed
4284
+ * row: it appears in Logs under the same hex, rendered `sc_<hex>` (`ft_` in this
4285
+ * header, `sc_` in Logs).
4286
+ */
4287
+ "X-Fetch-ID": components["headers"]["XFetchID"];
4242
4288
  [name: string]: unknown;
4243
4289
  };
4244
4290
  content: {
@@ -4283,10 +4329,12 @@ export interface operations {
4283
4329
  * the **true upstream status**, `502` — not `503` — and is the only surviving
4284
4330
  * record of what the target answered, so the body rather than the HTTP status is
4285
4331
  * 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).
4332
+ * - **`internal_error`** (message `Fetch service unavailable.`) — no fetch service
4333
+ * endpoint could be resolved on this deployment, a fault of this API and not of the
4334
+ * target. There is no upstream status to preserve: the `503` is this API's own
4335
+ * choice of wire status, so the body's `error.http_status` reports `503`, mirroring
4336
+ * what was served (#3373). A fetch that ran and failed for a target-side reason
4337
+ * answers `422` instead (#4669).
4290
4338
  */
4291
4339
  503: {
4292
4340
  headers: {
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.2";
8
+ export declare const SDK_VERSION = "0.11.4";
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.2';
12
+ export const SDK_VERSION = '0.11.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-sdk",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "description": "Official TypeScript SDK for the ByteKit API",
5
5
  "license": "MIT",
6
6
  "type": "module",