@hunt-labs/bytekit-sdk 0.11.7 → 0.11.9

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.9] - 2026-10-02
14
+
15
+ ### Changed
16
+
17
+ - **Terms-version doc comments describe the new onboarding contract (#5055).** Bootstrap no
18
+ longer records Terms acceptance: the internal `POST /v1/account/bootstrap` `terms_version` body
19
+ is now documented as a version guard, with acceptance recorded by
20
+ `POST /v1/account/accept-terms`. The account `terms_version` description now says an empty
21
+ string means the account has not accepted the Terms yet. Regenerated `src/generated/api.d.ts`;
22
+ description text only, no type or SDK method signature moves.
23
+
24
+ ## [0.11.8] - 2026-09-30
25
+
26
+ ### Changed
27
+
28
+ - **Bulk job types add `total_billed_bytes` and deprecate the bulk credit fields (#5021).** Every
29
+ bulk job body (`POST`/`GET`/`DELETE /v1/bulk`, `/v1/scrape/bulk`, `/v1/fetch/bulk`, and the
30
+ `GET /v1/bulk` list) gains `total_billed_bytes: number | null`: the bandwidth billed for the job,
31
+ in bytes, after multipliers. It is `null` on the create response and for a bulk that predates
32
+ the field. `total_credits_charged` and the bulk item `credits_charged` are marked
33
+ `@deprecated`; they report `0` under the `dual` and `bytes` billing modes. Regenerated
34
+ `src/generated/api.d.ts`; no SDK method signature moves.
35
+
13
36
  ## [0.11.7] - 2026-09-29
14
37
 
15
38
  ### Changed
@@ -644,9 +644,6 @@ export interface paths {
644
644
  * endpoint factor (a 100 KiB estimate is pre-charged, then reconciled). The
645
645
  * bandwidth is still billed when the scrape succeeds but extraction later
646
646
  * fails; both axes are refunded only when the scrape itself never runs.
647
- *
648
- * Availability is gated by a server-side feature flag; when disabled the
649
- * endpoint returns `404`.
650
647
  */
651
648
  post: operations["createSchemaExtraction"];
652
649
  delete?: never;
@@ -1517,7 +1514,13 @@ export interface components {
1517
1514
  total: number;
1518
1515
  completed: number;
1519
1516
  failed: number;
1517
+ /**
1518
+ * @deprecated
1519
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job.
1520
+ */
1520
1521
  total_credits_charged: number;
1522
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` (not raw wire bytes). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
1523
+ total_billed_bytes: number | null;
1521
1524
  /** Format: uri */
1522
1525
  webhook_url: string;
1523
1526
  /** @description Complete item records included before the 500-item or 1-MiB manifest bound. Every record carries a stable `id`, a `type`, and a terminal `status`. */
@@ -2724,7 +2727,7 @@ export interface components {
2724
2727
  /** @description Whether the account admin wants an email when bandwidth reaches 100 % of the plan limit. */
2725
2728
  bandwidth_100_enabled: boolean;
2726
2729
  };
2727
- /** @description The Terms of Service version this account has accepted. An empty string means the account predates clickwrap acceptance (issue #1025). The dashboard diffs this against the published current version to decide whether to show the re-acceptance prompt. */
2730
+ /** @description The Terms of Service version this account has accepted. An empty string means the account has not accepted the Terms yet; acceptance is recorded only by `POST /v1/account/accept-terms`, never by bootstrap (issue #5055). The dashboard diffs this against the published current version to decide whether to show the re-acceptance prompt. */
2728
2731
  terms_version: string;
2729
2732
  /** Format: date-time */
2730
2733
  created_at: string;
@@ -2762,7 +2765,7 @@ export interface components {
2762
2765
  /** @description Whether the account admin wants an email when bandwidth reaches 100 % of the plan limit. */
2763
2766
  bandwidth_100_enabled: boolean;
2764
2767
  };
2765
- /** @description The Terms of Service version this account has accepted. An empty string means the account predates clickwrap acceptance (issue #1025). The dashboard diffs this against the published current version to decide whether to show the re-acceptance prompt. */
2768
+ /** @description The Terms of Service version this account has accepted. An empty string means the account has not accepted the Terms yet; acceptance is recorded only by `POST /v1/account/accept-terms`, never by bootstrap (issue #5055). The dashboard diffs this against the published current version to decide whether to show the re-acceptance prompt. */
2766
2769
  terms_version: string;
2767
2770
  /** @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. */
2768
2771
  has_subscription: boolean;
@@ -3931,8 +3934,13 @@ export interface operations {
3931
3934
  created_at: string;
3932
3935
  /** Format: date-time */
3933
3936
  completed_at: string | null;
3934
- /** @description Always null on the create response — the job has not been billed yet (routes/scrape-bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
3937
+ /**
3938
+ * @deprecated
3939
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is always null on the create response — the job has not been billed yet (routes/scrape-bulk.ts builds the 202 body from a partial job row).
3940
+ */
3935
3941
  total_credits_charged: number | null;
3942
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Always null on the create response — nothing has settled yet. */
3943
+ total_billed_bytes: number | null;
3936
3944
  /** @description Estimated credits at submission time. Null in GET responses. Fetch-bulk items use the raw fetch bandwidth billing factor. */
3937
3945
  estimated_credits: number | null;
3938
3946
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4017,8 +4025,13 @@ export interface operations {
4017
4025
  created_at: string;
4018
4026
  /** Format: date-time */
4019
4027
  completed_at: string | null;
4020
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4028
+ /**
4029
+ * @deprecated
4030
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
4031
+ */
4021
4032
  total_credits_charged: number | null;
4033
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
4034
+ total_billed_bytes: number | null;
4022
4035
  /** @description Null in GET responses (computed at submission time only). */
4023
4036
  estimated_credits: number | null;
4024
4037
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4056,8 +4069,13 @@ export interface operations {
4056
4069
  created_at: string;
4057
4070
  /** Format: date-time */
4058
4071
  completed_at: string | null;
4059
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4072
+ /**
4073
+ * @deprecated
4074
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
4075
+ */
4060
4076
  total_credits_charged: number | null;
4077
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
4078
+ total_billed_bytes: number | null;
4061
4079
  /** @description Null in GET responses (computed at submission time only). */
4062
4080
  estimated_credits: number | null;
4063
4081
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4405,8 +4423,13 @@ export interface operations {
4405
4423
  created_at: string;
4406
4424
  /** Format: date-time */
4407
4425
  completed_at: string | null;
4408
- /** @description Always null on the create response — the job has not been billed yet (routes/fetch-bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
4426
+ /**
4427
+ * @deprecated
4428
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is always null on the create response — the job has not been billed yet (routes/fetch-bulk.ts builds the 202 body from a partial job row).
4429
+ */
4409
4430
  total_credits_charged: number | null;
4431
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Always null on the create response — nothing has settled yet. */
4432
+ total_billed_bytes: number | null;
4410
4433
  /** @description Estimated credits at submission time. Null in GET responses. Fetch items are raw passthrough requests and use the raw fetch bandwidth billing factor. */
4411
4434
  estimated_credits: number | null;
4412
4435
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4485,8 +4508,13 @@ export interface operations {
4485
4508
  created_at: string;
4486
4509
  /** Format: date-time */
4487
4510
  completed_at: string | null;
4488
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4511
+ /**
4512
+ * @deprecated
4513
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
4514
+ */
4489
4515
  total_credits_charged: number | null;
4516
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
4517
+ total_billed_bytes: number | null;
4490
4518
  /** @description Null in GET responses (computed at submission time only). */
4491
4519
  estimated_credits: number | null;
4492
4520
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4577,8 +4605,13 @@ export interface operations {
4577
4605
  created_at: string;
4578
4606
  /** Format: date-time */
4579
4607
  completed_at: string | null;
4580
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4608
+ /**
4609
+ * @deprecated
4610
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
4611
+ */
4581
4612
  total_credits_charged: number | null;
4613
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
4614
+ total_billed_bytes: number | null;
4582
4615
  /** @description Null in GET responses (computed at submission time only). */
4583
4616
  estimated_credits: number | null;
4584
4617
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4687,8 +4720,13 @@ export interface operations {
4687
4720
  created_at: string;
4688
4721
  /** Format: date-time */
4689
4722
  completed_at: string | null;
4690
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
4723
+ /**
4724
+ * @deprecated
4725
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
4726
+ */
4691
4727
  total_credits_charged: number | null;
4728
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
4729
+ total_billed_bytes: number | null;
4692
4730
  /** @description Null in GET responses (computed at submission time only). */
4693
4731
  estimated_credits: number | null;
4694
4732
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4899,8 +4937,13 @@ export interface operations {
4899
4937
  created_at: string;
4900
4938
  /** Format: date-time */
4901
4939
  completed_at: string | null;
4902
- /** @description Always null on the create response — the job has not been billed yet (routes/bulk.ts builds the 202 body from a partial job row). Fractional when populated (credits are NUMERIC(10,2)); the numeric branch is unreachable on this path and exists only so the 202 and 200 bodies share one shape. */
4940
+ /**
4941
+ * @deprecated
4942
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is always null on the create response — the job has not been billed yet (routes/bulk.ts builds the 202 body from a partial job row).
4943
+ */
4903
4944
  total_credits_charged: number | null;
4945
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Always null on the create response — nothing has settled yet. */
4946
+ total_billed_bytes: number | null;
4904
4947
  /** @description Estimated credits at submission time. Null in GET responses. Fetch-bulk items use the raw fetch bandwidth billing factor. */
4905
4948
  estimated_credits: number | null;
4906
4949
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -4982,8 +5025,13 @@ export interface operations {
4982
5025
  created_at: string;
4983
5026
  /** Format: date-time */
4984
5027
  completed_at: string | null;
4985
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
5028
+ /**
5029
+ * @deprecated
5030
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
5031
+ */
4986
5032
  total_credits_charged: number | null;
5033
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
5034
+ total_billed_bytes: number | null;
4987
5035
  /** @description Null in GET responses (computed at submission time only). */
4988
5036
  estimated_credits: number | null;
4989
5037
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -5014,8 +5062,13 @@ export interface operations {
5014
5062
  created_at: string;
5015
5063
  /** Format: date-time */
5016
5064
  completed_at: string | null;
5017
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
5065
+ /**
5066
+ * @deprecated
5067
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
5068
+ */
5018
5069
  total_credits_charged: number | null;
5070
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
5071
+ total_billed_bytes: number | null;
5019
5072
  /** @description Null in GET responses (computed at submission time only). */
5020
5073
  estimated_credits: number | null;
5021
5074
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -5063,8 +5116,13 @@ export interface operations {
5063
5116
  created_at: string;
5064
5117
  /** Format: date-time */
5065
5118
  completed_at: string | null;
5066
- /** @description Total credits billed for the job. Null until the job is billed. Fractional — credits are NUMERIC(10,2). */
5119
+ /**
5120
+ * @deprecated
5121
+ * @description Deprecated: bulk jobs are billed on bandwidth — read `total_billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the total credits billed for the job, null until the job is billed; fractional — credits are NUMERIC(10,2).
5122
+ */
5067
5123
  total_credits_charged: number | null;
5124
+ /** @description Bandwidth billed for the job, in bytes: the settled amount after multipliers, summed over every settled child's `billing.billed_bytes` across the whole job (not raw wire bytes, not just this page). Null for a bulk with a completed child missing from the sum (completed before this field, or with no settled amount) — never a partial sum. */
5125
+ total_billed_bytes: number | null;
5068
5126
  /** @description Null in cancel responses (computed at submission time only). */
5069
5127
  estimated_credits: number | null;
5070
5128
  /** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
@@ -5127,6 +5185,10 @@ export interface operations {
5127
5185
  status: "pending" | "processing" | "completed" | "failed" | "cancelled";
5128
5186
  /** Format: uri */
5129
5187
  url: string;
5188
+ /**
5189
+ * @deprecated
5190
+ * @description Deprecated: bulk jobs are billed on bandwidth — read this item's `billing.billed_bytes`. Reports `0` under the `dual` and `bytes` billing modes, where no credits are drawn. Under `credits` it is the credits billed for the item, null until it is billed; fractional (NUMERIC(10,2), 0.5 cache-hit credits).
5191
+ */
5130
5192
  credits_charged?: number | null;
5131
5193
  /**
5132
5194
  * @description Itemised account of this item's charge — the basis, the named factors
@@ -5855,15 +5917,6 @@ export interface operations {
5855
5917
  };
5856
5918
  };
5857
5919
  402: components["responses"]["PaymentRequired"];
5858
- /** @description Endpoint not available (feature flag disabled). */
5859
- 404: {
5860
- headers: {
5861
- [name: string]: unknown;
5862
- };
5863
- content: {
5864
- "application/json": components["schemas"]["Error"];
5865
- };
5866
- };
5867
5920
  /** @description Validation error (`validation_error`) or non-normalizable schema (`schema_incompatible`). */
5868
5921
  422: {
5869
5922
  headers: {
@@ -7045,11 +7098,11 @@ export interface operations {
7045
7098
  path?: never;
7046
7099
  cookie?: never;
7047
7100
  };
7048
- /** @description Optional clickwrap acceptance signal (issue #1025). When present, terms_version MUST equal the published current version or the request is rejected with 400 terms_version_mismatch. When absent, the server stamps the current version server-side (back-compatible). */
7101
+ /** @description Optional Terms version guard (issue #1025). When present, terms_version MUST equal the published current version or the request is rejected with 400 terms_version_mismatch. It is never recorded as acceptance: a new account starts with an empty terms_version, and acceptance is recorded only by POST /v1/account/accept-terms. When absent, the guard is skipped (back-compatible). */
7049
7102
  requestBody?: {
7050
7103
  content: {
7051
7104
  "application/json": {
7052
- /** @description The Terms of Service version the user is accepting. */
7105
+ /** @description The Terms of Service version the client was built against. Checked against the current version, never recorded as acceptance. */
7053
7106
  terms_version?: string;
7054
7107
  };
7055
7108
  };
@@ -7073,7 +7126,7 @@ export interface operations {
7073
7126
  "application/json": components["schemas"]["Account"];
7074
7127
  };
7075
7128
  };
7076
- /** @description terms_version does not match the published current version. */
7129
+ /** @description terms_version does not match the published current version (version guard only; acceptance is recorded by POST /v1/account/accept-terms). */
7077
7130
  400: {
7078
7131
  headers: {
7079
7132
  [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.7";
8
+ export declare const SDK_VERSION = "0.11.9";
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.7';
12
+ export const SDK_VERSION = '0.11.9';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hunt-labs/bytekit-sdk",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "description": "Official TypeScript SDK for the ByteKit API",
5
5
  "license": "MIT",
6
6
  "type": "module",