@hunt-labs/bytekit-sdk 0.11.3 → 0.11.5
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 +17 -0
- package/dist/generated/api.d.ts +98 -19
- 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,23 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.11.5] - 2026-09-22
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Internal `GET /v1/logs` types list schema rows (#2373).** Both `endpoint` enums add `schema`,
|
|
18
|
+
for `/v1/schema` structured-extraction requests, whose row ids carry the new `sch_` prefix.
|
|
19
|
+
No SDK method calls it.
|
|
20
|
+
|
|
21
|
+
## [0.11.4] - 2026-09-21
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
|
|
25
|
+
- Regenerated `src/generated/api.d.ts` (#4732): the `422` responses of `GET /v1/fetch` and
|
|
26
|
+
`POST /v1/fetch` declare the optional `X-Fetch-ID` header, present when the failed request was
|
|
27
|
+
recorded and naming its row in Logs (`sc_<hex>` for the header's `ft_<hex>`). Doc comments
|
|
28
|
+
only; no SDK signature moves.
|
|
29
|
+
|
|
13
30
|
## [0.11.3] - 2026-09-21
|
|
14
31
|
|
|
15
32
|
### Changed
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -720,7 +720,7 @@ export interface paths {
|
|
|
720
720
|
};
|
|
721
721
|
/**
|
|
722
722
|
* Get the unified request log feed
|
|
723
|
-
* @description Returns a unified, newest-first feed of the account's requests across scrape, fetch, screenshots, recordings and
|
|
723
|
+
* @description Returns a unified, newest-first feed of the account's requests across scrape, fetch, screenshots, recordings, search and schema, plus webhook delivery attempts, for the dashboard /logs screen. Monitor runs are listed as the scrape and screenshots rows they produce (`source: monitor`). Cursor-paginated; default range is the last 30 days, max 366 days.
|
|
724
724
|
*/
|
|
725
725
|
get: operations["getLogs"];
|
|
726
726
|
put?: never;
|
|
@@ -1160,6 +1160,29 @@ export interface paths {
|
|
|
1160
1160
|
patch?: never;
|
|
1161
1161
|
trace?: never;
|
|
1162
1162
|
};
|
|
1163
|
+
"/v1/account/complete-onboarding": {
|
|
1164
|
+
parameters: {
|
|
1165
|
+
query?: never;
|
|
1166
|
+
header?: never;
|
|
1167
|
+
path?: never;
|
|
1168
|
+
cookie?: never;
|
|
1169
|
+
};
|
|
1170
|
+
get?: never;
|
|
1171
|
+
put?: never;
|
|
1172
|
+
/**
|
|
1173
|
+
* Mark onboarding as finished
|
|
1174
|
+
* @description Records that the account left the dashboard's onboarding flow through one
|
|
1175
|
+
* of its exits, so `onboarding_completed` on GET /v1/account reads true from
|
|
1176
|
+
* then on. Idempotent: a repeat call keeps the first timestamp and still
|
|
1177
|
+
* answers 200. Requires an active membership (admin or member).
|
|
1178
|
+
*/
|
|
1179
|
+
post: operations["completeOnboarding"];
|
|
1180
|
+
delete?: never;
|
|
1181
|
+
options?: never;
|
|
1182
|
+
head?: never;
|
|
1183
|
+
patch?: never;
|
|
1184
|
+
trace?: never;
|
|
1185
|
+
};
|
|
1163
1186
|
"/v1/me": {
|
|
1164
1187
|
parameters: {
|
|
1165
1188
|
query?: never;
|
|
@@ -2704,8 +2727,10 @@ export interface components {
|
|
|
2704
2727
|
terms_version: string;
|
|
2705
2728
|
/** Format: date-time */
|
|
2706
2729
|
created_at: string;
|
|
2707
|
-
/** @description True once the account has SUCCESSFULLY COMPLETED at least one billable request (a scrape/screenshot/fetch/… that settled and was charged credits), regardless of whether it was authenticated with a Clerk session or an API key. All-time — never windowed. A request that failed does not flip it, even when its bandwidth was billed: the monitor terminal-preflight-failure path records bytes without credits, and only the credited settlement counts here. Powers the dashboard onboarding gate — the app shows the guided onboarding flow until this is true, then the dashboard. Lags by up to one usage rollup: the completion service writes the row after the response is returned, so a just-completed first request may still read false for a moment. Treat that as "not visible yet", never as "this account has never made a request". */
|
|
2730
|
+
/** @description True once the account has SUCCESSFULLY COMPLETED at least one billable request (a scrape/screenshot/fetch/… that settled and was charged credits), regardless of whether it was authenticated with a Clerk session or an API key. All-time — never windowed. A request that failed does not flip it, even when its bandwidth was billed: the monitor terminal-preflight-failure path records bytes without credits, and only the credited settlement counts here. Powers the dashboard onboarding gate — the app shows the guided onboarding flow until this or `onboarding_completed` is true, then the dashboard. Lags by up to one usage rollup: the completion service writes the row after the response is returned, so a just-completed first request may still read false for a moment. Treat that as "not visible yet", never as "this account has never made a request". */
|
|
2708
2731
|
has_activity: boolean;
|
|
2732
|
+
/** @description True once a member of the account left onboarding through one of its exits (POST /v1/account/complete-onboarding). Never reset. With `has_activity` it gates the dashboard: the app shows the guided onboarding flow until either one is true, so a user whose first request failed can still reach the dashboard. */
|
|
2733
|
+
onboarding_completed: boolean;
|
|
2709
2734
|
/** @description True when the account has a Stripe subscription, keyed on the same `stripe_subscription_id` column that GET /v1/billing/change-plan's `no_subscription` guard tests — so a client can use it to decide whether that endpoint will answer at all. Stays TRUE while a subscription is mid-cancellation (cancelled but running to the period end): the subscription still exists and a booked plan change is still revocable. It is a boolean, not the bearer path's `subscription` object: this response has no role-dependent fields, so a non-admin member receives it too, and plan pricing does not belong there. */
|
|
2710
2735
|
has_subscription: boolean;
|
|
2711
2736
|
};
|
|
@@ -4129,6 +4154,12 @@ export interface operations {
|
|
|
4129
4154
|
*/
|
|
4130
4155
|
422: {
|
|
4131
4156
|
headers: {
|
|
4157
|
+
/**
|
|
4158
|
+
* @description Optional; present only when the failed request was recorded. Names the failed
|
|
4159
|
+
* row: it appears in Logs under the same hex, rendered `sc_<hex>` (`ft_` in this
|
|
4160
|
+
* header, `sc_` in Logs).
|
|
4161
|
+
*/
|
|
4162
|
+
"X-Fetch-ID": components["headers"]["XFetchID"];
|
|
4132
4163
|
[name: string]: unknown;
|
|
4133
4164
|
};
|
|
4134
4165
|
content: {
|
|
@@ -4273,6 +4304,12 @@ export interface operations {
|
|
|
4273
4304
|
*/
|
|
4274
4305
|
422: {
|
|
4275
4306
|
headers: {
|
|
4307
|
+
/**
|
|
4308
|
+
* @description Optional; present only when the failed request was recorded. Names the failed
|
|
4309
|
+
* row: it appears in Logs under the same hex, rendered `sc_<hex>` (`ft_` in this
|
|
4310
|
+
* header, `sc_` in Logs).
|
|
4311
|
+
*/
|
|
4312
|
+
"X-Fetch-ID": components["headers"]["XFetchID"];
|
|
4276
4313
|
[name: string]: unknown;
|
|
4277
4314
|
};
|
|
4278
4315
|
content: {
|
|
@@ -4462,7 +4499,7 @@ export interface operations {
|
|
|
4462
4499
|
/** @example bulk_01j9abc123 */
|
|
4463
4500
|
id: string;
|
|
4464
4501
|
/** @enum {string} */
|
|
4465
|
-
status: "processing" | "completed" | "failed";
|
|
4502
|
+
status: "processing" | "completed" | "failed" | "cancelled";
|
|
4466
4503
|
total: number;
|
|
4467
4504
|
completed: number;
|
|
4468
4505
|
failed: number;
|
|
@@ -4535,11 +4572,12 @@ export interface operations {
|
|
|
4535
4572
|
};
|
|
4536
4573
|
};
|
|
4537
4574
|
/**
|
|
4538
|
-
* @description Bulk job still processing.
|
|
4539
|
-
*
|
|
4540
|
-
*
|
|
4541
|
-
*
|
|
4542
|
-
*
|
|
4575
|
+
* @description Bulk job still processing. The poll answers 200 for a job in
|
|
4576
|
+
* `BULK_TERMINAL_STATUSES` (`completed`, `failed`, `cancelled`) and 202
|
|
4577
|
+
* otherwise, over an identical body, so this is the SAME envelope the 200
|
|
4578
|
+
* documents — only the status code and the reachable `status` values
|
|
4579
|
+
* differ. Keep polling until you get a 200; a **cancelled** job is served
|
|
4580
|
+
* 200, not 202 (issues #3533, #4754).
|
|
4543
4581
|
*
|
|
4544
4582
|
* Item `content_url` values are pre-signed exactly as on the 200 — a fresh
|
|
4545
4583
|
* 600-second signature on every poll.
|
|
@@ -4553,7 +4591,7 @@ export interface operations {
|
|
|
4553
4591
|
/** @example bulk_01j9abc123 */
|
|
4554
4592
|
id: string;
|
|
4555
4593
|
/** @enum {string} */
|
|
4556
|
-
status: "processing"
|
|
4594
|
+
status: "processing";
|
|
4557
4595
|
total: number;
|
|
4558
4596
|
completed: number;
|
|
4559
4597
|
failed: number;
|
|
@@ -6094,7 +6132,7 @@ export interface operations {
|
|
|
6094
6132
|
/** @description End date (YYYY-MM-DD), inclusive. Default today. */
|
|
6095
6133
|
to?: string;
|
|
6096
6134
|
/** @description Filter to a single endpoint kind. */
|
|
6097
|
-
endpoint?: "scrape" | "fetch" | "screenshots" | "recordings" | "search" | "webhook";
|
|
6135
|
+
endpoint?: "scrape" | "fetch" | "screenshots" | "recordings" | "search" | "webhook" | "schema";
|
|
6098
6136
|
/** @description Filter by job outcome. */
|
|
6099
6137
|
status?: "pending" | "processing" | "completed" | "failed";
|
|
6100
6138
|
/** @description Case-insensitive substring match on the request URL — the search query on search rows and the target URL on webhook rows. */
|
|
@@ -6120,13 +6158,13 @@ export interface operations {
|
|
|
6120
6158
|
content: {
|
|
6121
6159
|
"application/json": {
|
|
6122
6160
|
data: {
|
|
6123
|
-
/** @description Prefixed request id (sc_/ss_/rec_/sr_/wh_). */
|
|
6161
|
+
/** @description Prefixed request id (sc_/ss_/rec_/sr_/wh_/sch_). */
|
|
6124
6162
|
id: string;
|
|
6125
6163
|
/**
|
|
6126
|
-
* @description The request kind. `webhook` rows are webhook delivery attempts ByteKit sent to your endpoint, not requests you made.
|
|
6164
|
+
* @description The request kind. `webhook` rows are webhook delivery attempts ByteKit sent to your endpoint, not requests you made. `schema` rows are /v1/schema structured-extraction requests.
|
|
6127
6165
|
* @enum {string}
|
|
6128
6166
|
*/
|
|
6129
|
-
endpoint: "scrape" | "fetch" | "screenshots" | "recordings" | "search" | "webhook";
|
|
6167
|
+
endpoint: "scrape" | "fetch" | "screenshots" | "recordings" | "search" | "webhook" | "schema";
|
|
6130
6168
|
/** @description HTTP method. Not persisted; capture and search endpoints are POST, and webhook deliveries are sent as POST (so this is always "POST"). /v1/fetch also accepts GET, but the stored row cannot distinguish it. */
|
|
6131
6169
|
method: string;
|
|
6132
6170
|
/** @description The request URL. On a search row this is the search query (empty once the retention window has redacted it); on a webhook row it is the delivery target URL. */
|
|
@@ -6137,17 +6175,17 @@ export interface operations {
|
|
|
6137
6175
|
* @enum {string}
|
|
6138
6176
|
*/
|
|
6139
6177
|
status: "pending" | "processing" | "completed" | "failed";
|
|
6140
|
-
/** @description Upstream target HTTP status on scrape/fetch rows; the HTTP status your endpoint answered on webhook rows. null on every other row. */
|
|
6178
|
+
/** @description Upstream target HTTP status on scrape/fetch rows, and the target site's HTTP status on completed schema and screenshot rows (null when none was recorded); the HTTP status your endpoint answered on webhook rows. null on every other row. */
|
|
6141
6179
|
status_code?: number | null;
|
|
6142
|
-
/** @description Raw upstream bytes the request carried (the billing base before the multiplier). null while pending/failed. */
|
|
6180
|
+
/** @description Raw upstream bytes the request carried (the billing base before the multiplier). null while pending/failed, and always null on search, webhook and schema rows. */
|
|
6143
6181
|
raw_bytes?: number | null;
|
|
6144
|
-
/** @description The bytes this request was BILLED — the same amount its own response reported in `X-Billable-Bytes`. For a scrape or fetch request this is the settled decomposition replayed as it was recorded at completion, so it already carries every factor that applied: the endpoint factor (`scrape` 1.0, `scrape_md` 1.5, `fetch` 1.0, `fetch_md` 1.5, a monitor run 1.0), the cache-hit ×0.5, and the clean-markdown ×3. Screenshots and recordings are `raw_bytes` × the fixed 1.5 Phase-1 render factor whatever capture options they carried — capture billing composes no discount factor, so that product is exact. This is the settled amount itself, never a product reconstructed from another field: `billing_multiplier` below is DERIVED from it (that field is this value over `raw_bytes`), so the dependency runs this way and not the other. One residual: a scrape or fetch row completed before the decomposition was recorded is reconstructed from its endpoint and cache-hit factors, which leaves a markdown `/v1/fetch` request of that vintage reported at 1.0 rather than 1.5 — nothing on such a row distinguishes it. That population ages out of this feed's retention window and is not backfilled. null while pending/failed (the row has no byte basis yet). */
|
|
6182
|
+
/** @description The bytes this request was BILLED — the same amount its own response reported in `X-Billable-Bytes`. For a scrape or fetch request this is the settled decomposition replayed as it was recorded at completion, so it already carries every factor that applied: the endpoint factor (`scrape` 1.0, `scrape_md` 1.5, `fetch` 1.0, `fetch_md` 1.5, a monitor run 1.0), the cache-hit ×0.5, and the clean-markdown ×3. Screenshots and recordings are `raw_bytes` × the fixed 1.5 Phase-1 render factor whatever capture options they carried — capture billing composes no discount factor, so that product is exact. This is the settled amount itself, never a product reconstructed from another field: `billing_multiplier` below is DERIVED from it (that field is this value over `raw_bytes`), so the dependency runs this way and not the other. One residual: a scrape or fetch row completed before the decomposition was recorded is reconstructed from its endpoint and cache-hit factors, which leaves a markdown `/v1/fetch` request of that vintage reported at 1.0 rather than 1.5 — nothing on such a row distinguishes it. That population ages out of this feed's retention window and is not backfilled. null while pending/failed (the row has no byte basis yet). On a schema row this is the byte amount the request settled at, recorded when it ended: 0 where the charge was refunded, null where it is unknown. */
|
|
6145
6183
|
billable_bytes?: number | null;
|
|
6146
|
-
/** @description The bandwidth factor this request settled at, DERIVED from the two fields above as `billable_bytes` / `raw_bytes`, ROUNDED TO 2 DECIMAL PLACES. It carries every factor that applied to the settled amount, composed: the endpoint factor, the cache-hit ×0.5 and the clean-markdown ×3 on a scrape or fetch row, and the flat 1.5 Phase-1 render factor on every screenshot and recording row whatever capture options it carried. Every factor reachable that way is a multiple of 0.25 (0.5, 0.75, 1, 1.5, 2.25, 3, 4.5), so 2 places reports each of them exactly on any basis of 100 bytes or more. The rounding is there because `billable_bytes` is itself rounded, which on an odd basis would otherwise surface here as 1.500001943158721 rather than 1.5. `raw_bytes` × `billing_multiplier`, rounded to the nearest byte, reproduces `billable_bytes` at every basis. CHANGED: this field used to report the row's persisted `credits_charged` — an account CREDIT count on a per-endpoint scale, not a bandwidth factor. On a screenshot that count is charged per capture option (`full_page`, `mobile`), so two captures billed at the same 1.5 factor reported different multipliers. See https://bytekit.com/docs/billing/credits for the credit counts each endpoint charges, which this field no longer reports. This is a LOGS ROW field and is NOT the scrape response envelope field — the envelope carries no flat `billing_multiplier` at all; its billing surface is the `billing` node (see BillingNode). It reports the same composed value as `billing.multiplier` and the X-Billing-Multiplier response header wherever `billable_bytes` is exact, which is every row but one: the residual described above for `billable_bytes`, a markdown `/v1/fetch` request completed before the decomposition was recorded, is reconstructed at 1.0 where settlement charged 1.5, and this field reports that same 1.0. null where the row has no factor to report: while pending/failed; on a search or
|
|
6184
|
+
/** @description The bandwidth factor this request settled at, DERIVED from the two fields above as `billable_bytes` / `raw_bytes`, ROUNDED TO 2 DECIMAL PLACES. It carries every factor that applied to the settled amount, composed: the endpoint factor, the cache-hit ×0.5 and the clean-markdown ×3 on a scrape or fetch row, and the flat 1.5 Phase-1 render factor on every screenshot and recording row whatever capture options it carried. Every factor reachable that way is a multiple of 0.25 (0.5, 0.75, 1, 1.5, 2.25, 3, 4.5), so 2 places reports each of them exactly on any basis of 100 bytes or more. The rounding is there because `billable_bytes` is itself rounded, which on an odd basis would otherwise surface here as 1.500001943158721 rather than 1.5. `raw_bytes` × `billing_multiplier`, rounded to the nearest byte, reproduces `billable_bytes` at every basis. CHANGED: this field used to report the row's persisted `credits_charged` — an account CREDIT count on a per-endpoint scale, not a bandwidth factor. On a screenshot that count is charged per capture option (`full_page`, `mobile`), so two captures billed at the same 1.5 factor reported different multipliers. See https://bytekit.com/docs/billing/credits for the credit counts each endpoint charges, which this field no longer reports. This is a LOGS ROW field and is NOT the scrape response envelope field — the envelope carries no flat `billing_multiplier` at all; its billing surface is the `billing` node (see BillingNode). It reports the same composed value as `billing.multiplier` and the X-Billing-Multiplier response header wherever `billable_bytes` is exact, which is every row but one: the residual described above for `billable_bytes`, a markdown `/v1/fetch` request completed before the decomposition was recorded, is reconstructed at 1.0 where settlement charged 1.5, and this field reports that same 1.0. null where the row has no factor to report: while pending/failed; on a search, webhook or schema row (none has a raw byte basis); where the basis is zero because Phase 1 was skipped or failed and the request billed nothing; and on a completed screenshot or recording old enough that no Phase-1 basis was ever recorded for it, which reports null rather than claiming a real past charge was nothing. */
|
|
6147
6185
|
billing_multiplier?: number | null;
|
|
6148
6186
|
/** @description Request duration in milliseconds; on a webhook row, how long your endpoint took to answer the latest attempt. */
|
|
6149
6187
|
duration_ms?: number | null;
|
|
6150
|
-
/** @description How the request originated (single/bulk/monitor). null on search and
|
|
6188
|
+
/** @description How the request originated (single/bulk/monitor). null on search, webhook and schema rows. */
|
|
6151
6189
|
source?: string | null;
|
|
6152
6190
|
error_code?: string | null;
|
|
6153
6191
|
error_message?: string | null;
|
|
@@ -6155,7 +6193,7 @@ export interface operations {
|
|
|
6155
6193
|
api_key_id?: string | null;
|
|
6156
6194
|
/** @description Stored content, image or video URL. For a `completed` row with a non-empty storage key this is a **pre-signed** download URL, minted fresh on every read of this endpoint and valid for **600 seconds (10 minutes)** — the same signing lifetime as `content_url` on `GET /v1/fetch/bulk/{id}` and `image_url` on `GET /v1/bulk/{id}/screenshots`. Download inside that window, or re-poll this endpoint for a fresh signature. For every other row the stored value is returned unchanged — `null` while no object has been stored, and otherwise a private, unsigned storage URL that returns 401 on download. That covers rows that are not `completed`, completed rows with no storage key, and completed rows whose object could not be signed; this endpoint raises no `artifact_unavailable` signal for any of them. */
|
|
6157
6195
|
artifact_url?: string | null;
|
|
6158
|
-
/** @description The original request options. */
|
|
6196
|
+
/** @description The original request options. Empty on schema rows: the schema, prompt and extraction result are not stored. */
|
|
6159
6197
|
options?: {
|
|
6160
6198
|
[key: string]: unknown;
|
|
6161
6199
|
} | null;
|
|
@@ -7130,6 +7168,47 @@ export interface operations {
|
|
|
7130
7168
|
};
|
|
7131
7169
|
};
|
|
7132
7170
|
};
|
|
7171
|
+
completeOnboarding: {
|
|
7172
|
+
parameters: {
|
|
7173
|
+
query?: never;
|
|
7174
|
+
header?: never;
|
|
7175
|
+
path?: never;
|
|
7176
|
+
cookie?: never;
|
|
7177
|
+
};
|
|
7178
|
+
requestBody?: never;
|
|
7179
|
+
responses: {
|
|
7180
|
+
/** @description Onboarding marked as finished. */
|
|
7181
|
+
200: {
|
|
7182
|
+
headers: {
|
|
7183
|
+
[name: string]: unknown;
|
|
7184
|
+
};
|
|
7185
|
+
content: {
|
|
7186
|
+
"application/json": {
|
|
7187
|
+
/** @enum {boolean} */
|
|
7188
|
+
onboarding_completed: true;
|
|
7189
|
+
};
|
|
7190
|
+
};
|
|
7191
|
+
};
|
|
7192
|
+
/** @description Missing or invalid Clerk JWT. */
|
|
7193
|
+
401: {
|
|
7194
|
+
headers: {
|
|
7195
|
+
[name: string]: unknown;
|
|
7196
|
+
};
|
|
7197
|
+
content: {
|
|
7198
|
+
"application/json": components["schemas"]["Error"];
|
|
7199
|
+
};
|
|
7200
|
+
};
|
|
7201
|
+
/** @description Session has no active account membership. */
|
|
7202
|
+
403: {
|
|
7203
|
+
headers: {
|
|
7204
|
+
[name: string]: unknown;
|
|
7205
|
+
};
|
|
7206
|
+
content: {
|
|
7207
|
+
"application/json": components["schemas"]["Error"];
|
|
7208
|
+
};
|
|
7209
|
+
};
|
|
7210
|
+
};
|
|
7211
|
+
};
|
|
7133
7212
|
getMe: {
|
|
7134
7213
|
parameters: {
|
|
7135
7214
|
query?: never;
|
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.5";
|
package/dist/version.js
CHANGED