@hunt-labs/bytekit-sdk 0.11.2 → 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,20 @@ 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
+
13
27
  ## [0.11.2] - 2026-09-18
14
28
 
15
29
  ### Changed
@@ -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: {
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.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.2';
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.2",
3
+ "version": "0.11.3",
4
4
  "description": "Official TypeScript SDK for the ByteKit API",
5
5
  "license": "MIT",
6
6
  "type": "module",