@hunt-labs/bytekit-sdk 0.11.6 → 0.11.8
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 +21 -0
- package/dist/generated/api.d.ts +90 -16
- 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,27 @@ today, see [README.md](./README.md), which remains the authoritative usage guide
|
|
|
10
10
|
|
|
11
11
|
## [Unreleased]
|
|
12
12
|
|
|
13
|
+
## [0.11.8] - 2026-09-30
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- **Bulk job types add `total_billed_bytes` and deprecate the bulk credit fields (#5021).** Every
|
|
18
|
+
bulk job body (`POST`/`GET`/`DELETE /v1/bulk`, `/v1/scrape/bulk`, `/v1/fetch/bulk`, and the
|
|
19
|
+
`GET /v1/bulk` list) gains `total_billed_bytes: number | null`: the bandwidth billed for the job,
|
|
20
|
+
in bytes, after multipliers. It is `null` on the create response and for a bulk that predates
|
|
21
|
+
the field. `total_credits_charged` and the bulk item `credits_charged` are marked
|
|
22
|
+
`@deprecated`; they report `0` under the `dual` and `bytes` billing modes. Regenerated
|
|
23
|
+
`src/generated/api.d.ts`; no SDK method signature moves.
|
|
24
|
+
|
|
25
|
+
## [0.11.7] - 2026-09-29
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
|
|
29
|
+
- **Internal `GET /v1/billing/topup-balance` types add `bandwidth.debt_bytes` (#4960, #4975).**
|
|
30
|
+
The bytes the account still owes for bandwidth a finished request used beyond everything it
|
|
31
|
+
could pay for, net of any repaid. Declared on that endpoint only, not on the shared
|
|
32
|
+
`BandwidthBalance` schema `GET /v1/usage` returns. No SDK method calls it.
|
|
33
|
+
|
|
13
34
|
## [0.11.6] - 2026-09-24
|
|
14
35
|
|
|
15
36
|
### Changed
|
package/dist/generated/api.d.ts
CHANGED
|
@@ -1517,7 +1517,13 @@ export interface components {
|
|
|
1517
1517
|
total: number;
|
|
1518
1518
|
completed: number;
|
|
1519
1519
|
failed: number;
|
|
1520
|
+
/**
|
|
1521
|
+
* @deprecated
|
|
1522
|
+
* @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.
|
|
1523
|
+
*/
|
|
1520
1524
|
total_credits_charged: number;
|
|
1525
|
+
/** @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. */
|
|
1526
|
+
total_billed_bytes: number | null;
|
|
1521
1527
|
/** Format: uri */
|
|
1522
1528
|
webhook_url: string;
|
|
1523
1529
|
/** @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`. */
|
|
@@ -2838,10 +2844,13 @@ export interface components {
|
|
|
2838
2844
|
* performed. The unified `Error` envelope carries one of the billing codes
|
|
2839
2845
|
* below in `error.code`; match on the code, never on the prose.
|
|
2840
2846
|
*
|
|
2841
|
-
* - `quota_exceeded` — the enforced balance for this request's meter
|
|
2842
|
-
*
|
|
2847
|
+
* - `quota_exceeded` — the enforced balance for this request's meter
|
|
2848
|
+
* cannot fund it. Capture endpoints (`/v1/scrape`, `/v1/fetch`,
|
|
2843
2849
|
* `/v1/screenshots`, `/v1/sitemap` and the bulk siblings) meter
|
|
2844
|
-
* bandwidth
|
|
2850
|
+
* bandwidth: they reject when the balance cannot fund the request's
|
|
2851
|
+
* byte reservation, and `error.details.required_bytes` and
|
|
2852
|
+
* `error.details.available_bytes` report the bytes the request reserves
|
|
2853
|
+
* and the bytes available. `/v1/search` meters credits.
|
|
2845
2854
|
* - `spending_cap_reached` — the request would push overage spend past the
|
|
2846
2855
|
* account's configured cap. Only reachable on a custom overage-enabled
|
|
2847
2856
|
* plan; standard plans stop at `quota_exceeded`.
|
|
@@ -2864,9 +2873,13 @@ export interface components {
|
|
|
2864
2873
|
* "status": "failed",
|
|
2865
2874
|
* "error": {
|
|
2866
2875
|
* "code": "quota_exceeded",
|
|
2867
|
-
* "message": "
|
|
2876
|
+
* "message": "Insufficient bandwidth balance: this request reserves 102400 bytes and 4321 are available.",
|
|
2868
2877
|
* "http_status": 402,
|
|
2869
|
-
* "failed_at": "2026-01-15T12:00:00Z"
|
|
2878
|
+
* "failed_at": "2026-01-15T12:00:00Z",
|
|
2879
|
+
* "details": {
|
|
2880
|
+
* "required_bytes": 102400,
|
|
2881
|
+
* "available_bytes": 4321
|
|
2882
|
+
* }
|
|
2870
2883
|
* }
|
|
2871
2884
|
* }
|
|
2872
2885
|
*/
|
|
@@ -3924,8 +3937,13 @@ export interface operations {
|
|
|
3924
3937
|
created_at: string;
|
|
3925
3938
|
/** Format: date-time */
|
|
3926
3939
|
completed_at: string | null;
|
|
3927
|
-
/**
|
|
3940
|
+
/**
|
|
3941
|
+
* @deprecated
|
|
3942
|
+
* @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).
|
|
3943
|
+
*/
|
|
3928
3944
|
total_credits_charged: number | null;
|
|
3945
|
+
/** @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. */
|
|
3946
|
+
total_billed_bytes: number | null;
|
|
3929
3947
|
/** @description Estimated credits at submission time. Null in GET responses. Fetch-bulk items use the raw fetch bandwidth billing factor. */
|
|
3930
3948
|
estimated_credits: number | null;
|
|
3931
3949
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4010,8 +4028,13 @@ export interface operations {
|
|
|
4010
4028
|
created_at: string;
|
|
4011
4029
|
/** Format: date-time */
|
|
4012
4030
|
completed_at: string | null;
|
|
4013
|
-
/**
|
|
4031
|
+
/**
|
|
4032
|
+
* @deprecated
|
|
4033
|
+
* @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).
|
|
4034
|
+
*/
|
|
4014
4035
|
total_credits_charged: number | null;
|
|
4036
|
+
/** @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. */
|
|
4037
|
+
total_billed_bytes: number | null;
|
|
4015
4038
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4016
4039
|
estimated_credits: number | null;
|
|
4017
4040
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4049,8 +4072,13 @@ export interface operations {
|
|
|
4049
4072
|
created_at: string;
|
|
4050
4073
|
/** Format: date-time */
|
|
4051
4074
|
completed_at: string | null;
|
|
4052
|
-
/**
|
|
4075
|
+
/**
|
|
4076
|
+
* @deprecated
|
|
4077
|
+
* @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).
|
|
4078
|
+
*/
|
|
4053
4079
|
total_credits_charged: number | null;
|
|
4080
|
+
/** @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. */
|
|
4081
|
+
total_billed_bytes: number | null;
|
|
4054
4082
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4055
4083
|
estimated_credits: number | null;
|
|
4056
4084
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4398,8 +4426,13 @@ export interface operations {
|
|
|
4398
4426
|
created_at: string;
|
|
4399
4427
|
/** Format: date-time */
|
|
4400
4428
|
completed_at: string | null;
|
|
4401
|
-
/**
|
|
4429
|
+
/**
|
|
4430
|
+
* @deprecated
|
|
4431
|
+
* @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).
|
|
4432
|
+
*/
|
|
4402
4433
|
total_credits_charged: number | null;
|
|
4434
|
+
/** @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. */
|
|
4435
|
+
total_billed_bytes: number | null;
|
|
4403
4436
|
/** @description Estimated credits at submission time. Null in GET responses. Fetch items are raw passthrough requests and use the raw fetch bandwidth billing factor. */
|
|
4404
4437
|
estimated_credits: number | null;
|
|
4405
4438
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4478,8 +4511,13 @@ export interface operations {
|
|
|
4478
4511
|
created_at: string;
|
|
4479
4512
|
/** Format: date-time */
|
|
4480
4513
|
completed_at: string | null;
|
|
4481
|
-
/**
|
|
4514
|
+
/**
|
|
4515
|
+
* @deprecated
|
|
4516
|
+
* @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).
|
|
4517
|
+
*/
|
|
4482
4518
|
total_credits_charged: number | null;
|
|
4519
|
+
/** @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. */
|
|
4520
|
+
total_billed_bytes: number | null;
|
|
4483
4521
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4484
4522
|
estimated_credits: number | null;
|
|
4485
4523
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4570,8 +4608,13 @@ export interface operations {
|
|
|
4570
4608
|
created_at: string;
|
|
4571
4609
|
/** Format: date-time */
|
|
4572
4610
|
completed_at: string | null;
|
|
4573
|
-
/**
|
|
4611
|
+
/**
|
|
4612
|
+
* @deprecated
|
|
4613
|
+
* @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).
|
|
4614
|
+
*/
|
|
4574
4615
|
total_credits_charged: number | null;
|
|
4616
|
+
/** @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. */
|
|
4617
|
+
total_billed_bytes: number | null;
|
|
4575
4618
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4576
4619
|
estimated_credits: number | null;
|
|
4577
4620
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4680,8 +4723,13 @@ export interface operations {
|
|
|
4680
4723
|
created_at: string;
|
|
4681
4724
|
/** Format: date-time */
|
|
4682
4725
|
completed_at: string | null;
|
|
4683
|
-
/**
|
|
4726
|
+
/**
|
|
4727
|
+
* @deprecated
|
|
4728
|
+
* @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).
|
|
4729
|
+
*/
|
|
4684
4730
|
total_credits_charged: number | null;
|
|
4731
|
+
/** @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. */
|
|
4732
|
+
total_billed_bytes: number | null;
|
|
4685
4733
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4686
4734
|
estimated_credits: number | null;
|
|
4687
4735
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4892,8 +4940,13 @@ export interface operations {
|
|
|
4892
4940
|
created_at: string;
|
|
4893
4941
|
/** Format: date-time */
|
|
4894
4942
|
completed_at: string | null;
|
|
4895
|
-
/**
|
|
4943
|
+
/**
|
|
4944
|
+
* @deprecated
|
|
4945
|
+
* @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).
|
|
4946
|
+
*/
|
|
4896
4947
|
total_credits_charged: number | null;
|
|
4948
|
+
/** @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. */
|
|
4949
|
+
total_billed_bytes: number | null;
|
|
4897
4950
|
/** @description Estimated credits at submission time. Null in GET responses. Fetch-bulk items use the raw fetch bandwidth billing factor. */
|
|
4898
4951
|
estimated_credits: number | null;
|
|
4899
4952
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -4975,8 +5028,13 @@ export interface operations {
|
|
|
4975
5028
|
created_at: string;
|
|
4976
5029
|
/** Format: date-time */
|
|
4977
5030
|
completed_at: string | null;
|
|
4978
|
-
/**
|
|
5031
|
+
/**
|
|
5032
|
+
* @deprecated
|
|
5033
|
+
* @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).
|
|
5034
|
+
*/
|
|
4979
5035
|
total_credits_charged: number | null;
|
|
5036
|
+
/** @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. */
|
|
5037
|
+
total_billed_bytes: number | null;
|
|
4980
5038
|
/** @description Null in GET responses (computed at submission time only). */
|
|
4981
5039
|
estimated_credits: number | null;
|
|
4982
5040
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -5007,8 +5065,13 @@ export interface operations {
|
|
|
5007
5065
|
created_at: string;
|
|
5008
5066
|
/** Format: date-time */
|
|
5009
5067
|
completed_at: string | null;
|
|
5010
|
-
/**
|
|
5068
|
+
/**
|
|
5069
|
+
* @deprecated
|
|
5070
|
+
* @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).
|
|
5071
|
+
*/
|
|
5011
5072
|
total_credits_charged: number | null;
|
|
5073
|
+
/** @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. */
|
|
5074
|
+
total_billed_bytes: number | null;
|
|
5012
5075
|
/** @description Null in GET responses (computed at submission time only). */
|
|
5013
5076
|
estimated_credits: number | null;
|
|
5014
5077
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -5056,8 +5119,13 @@ export interface operations {
|
|
|
5056
5119
|
created_at: string;
|
|
5057
5120
|
/** Format: date-time */
|
|
5058
5121
|
completed_at: string | null;
|
|
5059
|
-
/**
|
|
5122
|
+
/**
|
|
5123
|
+
* @deprecated
|
|
5124
|
+
* @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).
|
|
5125
|
+
*/
|
|
5060
5126
|
total_credits_charged: number | null;
|
|
5127
|
+
/** @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. */
|
|
5128
|
+
total_billed_bytes: number | null;
|
|
5061
5129
|
/** @description Null in cancel responses (computed at submission time only). */
|
|
5062
5130
|
estimated_credits: number | null;
|
|
5063
5131
|
/** @description Webhook endpoint URL (HTTPS only; http:// rejected with 400 invalid_url, reason scheme_unsupported) */
|
|
@@ -5120,6 +5188,10 @@ export interface operations {
|
|
|
5120
5188
|
status: "pending" | "processing" | "completed" | "failed" | "cancelled";
|
|
5121
5189
|
/** Format: uri */
|
|
5122
5190
|
url: string;
|
|
5191
|
+
/**
|
|
5192
|
+
* @deprecated
|
|
5193
|
+
* @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).
|
|
5194
|
+
*/
|
|
5123
5195
|
credits_charged?: number | null;
|
|
5124
5196
|
/**
|
|
5125
5197
|
* @description Itemised account of this item's charge — the basis, the named factors
|
|
@@ -6597,6 +6669,8 @@ export interface operations {
|
|
|
6597
6669
|
bandwidth: components["schemas"]["BandwidthBalance"] & {
|
|
6598
6670
|
/** @description Remaining balance of your subscription allowance: bytes still unspent across all allowance lots, the current period's and any rolled over from earlier periods alike, after active refund reservations. This is a remaining balance and falls to zero as the allowance is drawn down. It is not `included_bytes`, which is the plan's configured grant for a period and does not move as it is spent; do not subtract one from the other. `rollover_bytes` is a subset of this figure. */
|
|
6599
6671
|
remaining_allowance_bytes: number;
|
|
6672
|
+
/** @description Bytes you still owe: bandwidth your finished requests used beyond everything your account could pay for, net of any already paid back. It is reported beside the other bandwidth figures and is not subtracted from `remaining_bytes` or `remaining_allowance_bytes`. 0 when nothing is owed. */
|
|
6673
|
+
debt_bytes: number;
|
|
6600
6674
|
};
|
|
6601
6675
|
credits: components["schemas"]["CreditBalance"];
|
|
6602
6676
|
rates: {
|
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.8";
|
package/dist/version.js
CHANGED