@zinn-digital/sdk 0.1.2027 → 0.1.2031

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.
@@ -4225,6 +4225,26 @@ export interface paths {
4225
4225
  patch?: never;
4226
4226
  trace?: never;
4227
4227
  };
4228
+ "/v1/admin/compute/traffic-packs": {
4229
+ parameters: {
4230
+ query?: never;
4231
+ header?: never;
4232
+ path?: never;
4233
+ cookie?: never;
4234
+ };
4235
+ /**
4236
+ * Every prepaid traffic pack across the estate, newest first.
4237
+ * @description TRAFFICCAP car 4b (docs/687 section 9). Which org bought how many TB for which server and month, at what price, and whether it is still awaiting payment. `?status=` narrows to one status (anything else is `422 refusal.adminTransfer.unknownStatus`); `?period=` narrows to one `YYYY-MM` month. Read only. Requires staff `customer.view`.
4238
+ */
4239
+ get: operations["listAdminComputeTrafficPacks"];
4240
+ put?: never;
4241
+ post?: never;
4242
+ delete?: never;
4243
+ options?: never;
4244
+ head?: never;
4245
+ patch?: never;
4246
+ trace?: never;
4247
+ };
4228
4248
  "/v1/admin/conversions": {
4229
4249
  parameters: {
4230
4250
  query?: never;
@@ -32500,6 +32520,56 @@ export interface paths {
32500
32520
  patch?: never;
32501
32521
  trace?: never;
32502
32522
  };
32523
+ "/v1/compute/servers/{serverId}/traffic-packs": {
32524
+ parameters: {
32525
+ query?: never;
32526
+ header?: never;
32527
+ path: {
32528
+ /** @description The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. */
32529
+ serverId: components["parameters"]["ComputeServerId"];
32530
+ };
32531
+ cookie?: never;
32532
+ };
32533
+ /**
32534
+ * A server's traffic packs and its traffic against the cap this month.
32535
+ * @description TRAFFICCAP car 4. The packs bought for this machine (newest first, at most 100) and what the meter last read this month: usage, the plan allowance, the GB active packs add, and the cap they raise it to. A usage or allowance of `null` means the meter has no reading yet, never "nothing used". Requires `sites.view`.
32536
+ */
32537
+ get: operations["listComputeServerTrafficPacks"];
32538
+ put?: never;
32539
+ /**
32540
+ * Order a prepaid traffic pack for a server.
32541
+ * @description ⛔ **Chargeable, once paid.** Writes a pending pack and a taxed order for `tb` whole TB (unit price x TB, in the machine's billing currency). Nothing is charged here: pay the returned order with `payOrder` (wallet first, then any payment method). Paying activates the pack, which raises this month's cap at once and restarts a machine the cap stopped. Unused traffic expires when the allowance resets next month. A repeated `idempotency_key` (body or `Idempotency-Key` header) returns the same order. Refused (422) when the location sells no packs or the account is not in good standing. Requires `billing.payment.manage`.
32542
+ */
32543
+ post: operations["orderComputeServerTrafficPack"];
32544
+ delete?: never;
32545
+ options?: never;
32546
+ head?: never;
32547
+ patch?: never;
32548
+ trace?: never;
32549
+ };
32550
+ "/v1/compute/servers/{serverId}/traffic-packs/quote": {
32551
+ parameters: {
32552
+ query?: never;
32553
+ header?: never;
32554
+ path: {
32555
+ /** @description The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. */
32556
+ serverId: components["parameters"]["ComputeServerId"];
32557
+ };
32558
+ cookie?: never;
32559
+ };
32560
+ get?: never;
32561
+ put?: never;
32562
+ /**
32563
+ * What `tb` TB of extra traffic costs on this server.
32564
+ * @description A POST that changes nothing: the pre-tax price of `tb` packs in the machine's billing currency, with the expiry note every purchase surface shows. Requires `sites.view`.
32565
+ */
32566
+ post: operations["quoteComputeServerTrafficPack"];
32567
+ delete?: never;
32568
+ options?: never;
32569
+ head?: never;
32570
+ patch?: never;
32571
+ trace?: never;
32572
+ };
32503
32573
  "/v1/compute/servers/{serverId}/usage": {
32504
32574
  parameters: {
32505
32575
  query?: never;
@@ -62467,7 +62537,7 @@ export interface paths {
62467
62537
  put?: never;
62468
62538
  /**
62469
62539
  * Add credit to your balance.
62470
- * @description Charged on **your provider's own** payment account when you are a reseller's client, and on Zinn®'s when you buy directly. The credit is written when the payment **captures**: a crypto invoice awaiting confirmation (`pending`), a card awaiting 3-D Secure or a PayPal payment awaiting your approval at `action_url` (`requires_action`) returns 201 with that status and **no** balance change, because the money has not arrived. An approved PayPal top-up is captured and credited when PayPal reports the approval. 422 when your provider has not finished connecting a payment account — the charge is refused rather than settled somewhere else. 422 `PAYMENT_METHOD_REQUIRED` (refusal `refusal.wallet.topUpPaymentStep`) when a card top-up is bought from Zinn® with no saved card: nothing is written and no gateway is asked. Show the customer a choice of card, PayPal or crypto for the same amount, then repeat the request on the chosen `gateway` (1108#13).
62540
+ * @description Charged on **your provider's own** payment account when you are a reseller's client, and on Zinn®'s when you buy directly. The credit is written when the payment **captures**: a crypto invoice awaiting confirmation (`pending`), a card awaiting 3-D Secure or a PayPal payment awaiting your approval at `action_url` (`requires_action`) returns 201 with that status and **no** balance change, because the money has not arrived. An approved PayPal top-up is captured and credited when the buyer returns (`POST /v1/wallet/top-ups/{topUpId}/paypal/capture`) or when PayPal reports the approval, whichever comes first, and only once. 422 when your provider has not finished connecting a payment account — the charge is refused rather than settled somewhere else. 422 `PAYMENT_METHOD_REQUIRED` (refusal `refusal.wallet.topUpPaymentStep`) when a card top-up is bought from Zinn® with no saved card: nothing is written and no gateway is asked. Show the customer a choice of card, PayPal or crypto for the same amount, then repeat the request on the chosen `gateway` (1108#13).
62471
62541
  *
62472
62542
  * ⚖️ **Credit bought from Zinn® is never refundable, including on account closure, and never expires** (owner ruling 2026-08-22). Call `GET /v1/wallet/top-ups/estimate` first and show the customer what they will receive. ⚖️ We absorb the top-up fee on every rail (owner ruling 2026-11-21, "top up 50, get 50"): a top-up paid in full credits the full amount; a crypto invoice paid only in part credits what was sent. Requires `billing.payment.manage`.
62473
62543
  */
@@ -62478,6 +62548,26 @@ export interface paths {
62478
62548
  patch?: never;
62479
62549
  trace?: never;
62480
62550
  };
62551
+ "/v1/wallet/top-ups/{topUpId}/paypal/capture": {
62552
+ parameters: {
62553
+ query?: never;
62554
+ header?: never;
62555
+ path?: never;
62556
+ cookie?: never;
62557
+ };
62558
+ get?: never;
62559
+ put?: never;
62560
+ /**
62561
+ * Capture a PayPal credit top-up when the buyer returns from PayPal.
62562
+ * @description Call it from the PayPal return page with the `token` PayPal put on the return URL (the PayPal order id). The top-up is captured and credited once, however this call and PayPal's own approval webhook race: both go through one capture under one `PayPal-Request-Id` and one row lock. 200 with the top-up as it now stands (`captured`, `failed`, or `pending` while PayPal is still clearing it); a top-up that is already settled or failed is returned as it is and nothing is asked of PayPal, so a reload is safe. 202 when the capture is running right now on another request: read `GET /v1/wallet/top-ups` again shortly. 404 for a top-up that is not yours, is not a PayPal top-up bought from Zinn®, or does not match the PayPal order id while it is still pending. Requires `billing.payment.manage`.
62563
+ */
62564
+ post: operations["captureClientWalletTopUpPayPal"];
62565
+ delete?: never;
62566
+ options?: never;
62567
+ head?: never;
62568
+ patch?: never;
62569
+ trace?: never;
62570
+ };
62481
62571
  "/v1/wallet/top-ups/estimate": {
62482
62572
  parameters: {
62483
62573
  query?: never;
@@ -65245,6 +65335,28 @@ export interface components {
65245
65335
  /** @description Why. ⛔ Required, and shown to the customer verbatim: a suspension with no reason is a support ticket we have already lost, and an operator who cannot remember why either. */
65246
65336
  reason: string;
65247
65337
  };
65338
+ /** @description A traffic pack as staff see it, with the org and server it belongs to. */
65339
+ AdminComputeTrafficPack: {
65340
+ /** Format: date-time */
65341
+ activated_at: string | null;
65342
+ /** Format: date-time */
65343
+ created_at: string;
65344
+ currency: string;
65345
+ id: components["schemas"]["Uuid"];
65346
+ net_minor: number;
65347
+ /** Format: uuid */
65348
+ order_id: string | null;
65349
+ /** Format: uuid */
65350
+ org_id: string;
65351
+ period: string;
65352
+ /** Format: uuid */
65353
+ server_id: string;
65354
+ server_label: string;
65355
+ /** @enum {string} */
65356
+ status: "pending" | "active" | "void";
65357
+ tb: number;
65358
+ unit_price_minor: number;
65359
+ };
65248
65360
  AdminComputeTrustWaiver: {
65249
65361
  /** Format: date-time */
65250
65362
  granted_at: string;
@@ -86129,6 +86241,66 @@ export interface components {
86129
86241
  /** @description The cadence. Sent straight back as `CartLineCreate.interval` to buy at it. */
86130
86242
  interval: components["schemas"]["BillingInterval"];
86131
86243
  };
86244
+ ComputeTrafficPack: {
86245
+ /** Format: date-time */
86246
+ activated_at: string | null;
86247
+ /** Format: date-time */
86248
+ created_at: string;
86249
+ currency: string;
86250
+ id: components["schemas"]["Uuid"];
86251
+ net_minor: number;
86252
+ /** Format: uuid */
86253
+ order_id: string | null;
86254
+ period: string;
86255
+ /** @enum {string} */
86256
+ status: "pending" | "active" | "void";
86257
+ tb: number;
86258
+ unit_price_minor: number;
86259
+ };
86260
+ ComputeTrafficPackList: {
86261
+ data: components["schemas"]["ComputeTrafficPack"][];
86262
+ expiry_note: string;
86263
+ status: components["schemas"]["ComputeTrafficStatus"];
86264
+ };
86265
+ ComputeTrafficPackOrder: {
86266
+ currency: string;
86267
+ expiry_note: string;
86268
+ order_id: components["schemas"]["Uuid"];
86269
+ pack: components["schemas"]["ComputeTrafficPack"];
86270
+ subtotal_minor: number;
86271
+ tax_minor: number;
86272
+ total_minor: number;
86273
+ };
86274
+ ComputeTrafficPackOrderRequest: {
86275
+ idempotency_key?: string;
86276
+ /** @description Whole TB to buy; no upper limit. */
86277
+ tb: number;
86278
+ };
86279
+ ComputeTrafficPackQuote: {
86280
+ currency: string;
86281
+ expiry_note: string;
86282
+ /** @description unit_price_minor x tb */
86283
+ net_minor: number;
86284
+ /** @description The month the pack counts in (YYYY-MM). */
86285
+ period: string;
86286
+ tb: number;
86287
+ /** @description Price of one TB in minor units. */
86288
+ unit_price_minor: number;
86289
+ };
86290
+ ComputeTrafficPackQuoteRequest: {
86291
+ /** @description Whole TB to buy; no upper limit. */
86292
+ tb: number;
86293
+ };
86294
+ ComputeTrafficStatus: {
86295
+ /** @description -1 = unlimited; null = no reading yet. */
86296
+ allowance_gb_milli: number | null;
86297
+ cap_gb_milli: number | null;
86298
+ packs_gb: number;
86299
+ packs_sold: boolean;
86300
+ period: string;
86301
+ /** @description Thousandths of a GB; null = no reading yet. */
86302
+ used_gb_milli: number | null;
86303
+ };
86132
86304
  ComputeTrialCredit: {
86133
86305
  claimed: boolean;
86134
86306
  currency: string;
@@ -131750,6 +131922,40 @@ export interface operations {
131750
131922
  503: components["responses"]["ServiceUnavailable"];
131751
131923
  };
131752
131924
  };
131925
+ listAdminComputeTrafficPacks: {
131926
+ parameters: {
131927
+ query?: {
131928
+ /** @description Opaque cursor from a previous page's `page.next_cursor`. */
131929
+ cursor?: components["parameters"]["Cursor"];
131930
+ /** @description Maximum items to return (page size). */
131931
+ limit?: components["parameters"]["Limit"];
131932
+ period?: string;
131933
+ status?: "pending" | "active" | "void";
131934
+ };
131935
+ header?: never;
131936
+ path?: never;
131937
+ cookie?: never;
131938
+ };
131939
+ requestBody?: never;
131940
+ responses: {
131941
+ /** @description One page of traffic packs. */
131942
+ 200: {
131943
+ headers: {
131944
+ [name: string]: unknown;
131945
+ };
131946
+ content: {
131947
+ "application/json": {
131948
+ data: components["schemas"]["AdminComputeTrafficPack"][];
131949
+ page: components["schemas"]["PageMeta"];
131950
+ };
131951
+ };
131952
+ };
131953
+ 401: components["responses"]["Unauthorized"];
131954
+ 403: components["responses"]["Forbidden"];
131955
+ 422: components["responses"]["UnprocessableEntity"];
131956
+ 429: components["responses"]["TooManyRequests"];
131957
+ };
131958
+ };
131753
131959
  getAdminConversions: {
131754
131960
  parameters: {
131755
131961
  query?: {
@@ -179594,6 +179800,107 @@ export interface operations {
179594
179800
  429: components["responses"]["TooManyRequests"];
179595
179801
  };
179596
179802
  };
179803
+ listComputeServerTrafficPacks: {
179804
+ parameters: {
179805
+ query?: never;
179806
+ header?: never;
179807
+ path: {
179808
+ /** @description The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. */
179809
+ serverId: components["parameters"]["ComputeServerId"];
179810
+ };
179811
+ cookie?: never;
179812
+ };
179813
+ requestBody?: never;
179814
+ responses: {
179815
+ /** @description The machine's packs and traffic status. */
179816
+ 200: {
179817
+ headers: {
179818
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
179819
+ [name: string]: unknown;
179820
+ };
179821
+ content: {
179822
+ "application/json": components["schemas"]["ComputeTrafficPackList"];
179823
+ };
179824
+ };
179825
+ 401: components["responses"]["Unauthorized"];
179826
+ 403: components["responses"]["Forbidden"];
179827
+ 404: components["responses"]["NotFound"];
179828
+ 422: components["responses"]["UnprocessableEntity"];
179829
+ 429: components["responses"]["TooManyRequests"];
179830
+ 503: components["responses"]["ServiceUnavailable"];
179831
+ };
179832
+ };
179833
+ orderComputeServerTrafficPack: {
179834
+ parameters: {
179835
+ query?: never;
179836
+ header?: {
179837
+ /** @description Client-generated key that makes an unsafe request replay-safe: the server stores the first response and returns it verbatim for repeats. */
179838
+ "Idempotency-Key"?: components["parameters"]["IdempotencyKey"];
179839
+ };
179840
+ path: {
179841
+ /** @description The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. */
179842
+ serverId: components["parameters"]["ComputeServerId"];
179843
+ };
179844
+ cookie?: never;
179845
+ };
179846
+ requestBody: {
179847
+ content: {
179848
+ "application/json": components["schemas"]["ComputeTrafficPackOrderRequest"];
179849
+ };
179850
+ };
179851
+ responses: {
179852
+ /** @description The pending pack and the order that pays it. */
179853
+ 201: {
179854
+ headers: {
179855
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
179856
+ [name: string]: unknown;
179857
+ };
179858
+ content: {
179859
+ "application/json": components["schemas"]["ComputeTrafficPackOrder"];
179860
+ };
179861
+ };
179862
+ 401: components["responses"]["Unauthorized"];
179863
+ 403: components["responses"]["Forbidden"];
179864
+ 404: components["responses"]["NotFound"];
179865
+ 422: components["responses"]["UnprocessableEntity"];
179866
+ 429: components["responses"]["TooManyRequests"];
179867
+ 503: components["responses"]["ServiceUnavailable"];
179868
+ };
179869
+ };
179870
+ quoteComputeServerTrafficPack: {
179871
+ parameters: {
179872
+ query?: never;
179873
+ header?: never;
179874
+ path: {
179875
+ /** @description The server's id, as `listComputeServers` reports it. **Ours** (UUIDv7), minted when the order row was written — never the provider's own identifier for the machine. */
179876
+ serverId: components["parameters"]["ComputeServerId"];
179877
+ };
179878
+ cookie?: never;
179879
+ };
179880
+ requestBody: {
179881
+ content: {
179882
+ "application/json": components["schemas"]["ComputeTrafficPackQuoteRequest"];
179883
+ };
179884
+ };
179885
+ responses: {
179886
+ /** @description The price. */
179887
+ 200: {
179888
+ headers: {
179889
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
179890
+ [name: string]: unknown;
179891
+ };
179892
+ content: {
179893
+ "application/json": components["schemas"]["ComputeTrafficPackQuote"];
179894
+ };
179895
+ };
179896
+ 401: components["responses"]["Unauthorized"];
179897
+ 403: components["responses"]["Forbidden"];
179898
+ 404: components["responses"]["NotFound"];
179899
+ 422: components["responses"]["UnprocessableEntity"];
179900
+ 429: components["responses"]["TooManyRequests"];
179901
+ 503: components["responses"]["ServiceUnavailable"];
179902
+ };
179903
+ };
179597
179904
  getComputeServerUsage: {
179598
179905
  parameters: {
179599
179906
  query?: {
@@ -228327,6 +228634,53 @@ export interface operations {
228327
228634
  429: components["responses"]["TooManyRequests"];
228328
228635
  };
228329
228636
  };
228637
+ captureClientWalletTopUpPayPal: {
228638
+ parameters: {
228639
+ query?: {
228640
+ /** @description Which of your organizations this applies to. Required only when you belong to more than one here — otherwise it is inferred, and an id outside your direct memberships is a 404 rather than a 403, so this can never widen scope. */
228641
+ org_id?: components["schemas"]["Uuid"];
228642
+ };
228643
+ header?: never;
228644
+ path: {
228645
+ topUpId: components["schemas"]["Uuid"];
228646
+ };
228647
+ cookie?: never;
228648
+ };
228649
+ requestBody: {
228650
+ content: {
228651
+ "application/json": {
228652
+ /** @description The PayPal order id (`token` on the PayPal return URL). */
228653
+ paypal_order_id: string;
228654
+ };
228655
+ };
228656
+ };
228657
+ responses: {
228658
+ /** @description The top-up as it now stands. */
228659
+ 200: {
228660
+ headers: {
228661
+ [name: string]: unknown;
228662
+ };
228663
+ content: {
228664
+ "application/json": components["schemas"]["ClientWalletTopUp"];
228665
+ };
228666
+ };
228667
+ /** @description Another request is capturing this top-up right now; it is still pending. */
228668
+ 202: {
228669
+ headers: {
228670
+ [name: string]: unknown;
228671
+ };
228672
+ content: {
228673
+ "application/json": components["schemas"]["ClientWalletTopUp"];
228674
+ };
228675
+ };
228676
+ 400: components["responses"]["UnprocessableEntity"];
228677
+ 401: components["responses"]["Unauthorized"];
228678
+ 403: components["responses"]["Forbidden"];
228679
+ 404: components["responses"]["NotFound"];
228680
+ 422: components["responses"]["UnprocessableEntity"];
228681
+ 429: components["responses"]["TooManyRequests"];
228682
+ };
228683
+ };
228330
228684
  estimateWalletTopUp: {
228331
228685
  parameters: {
228332
228686
  query: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.2027",
3
+ "version": "0.1.2031",
4
4
  "description": "Typed TypeScript client for the Zinn Digital Platform API, generated from its OpenAPI spec.",
5
5
  "license": "MIT",
6
6
  "author": "Neil Lock \u2014 CEO, Zinn Digital\u00ae Ltd <office@zinndigital.com>",