@zinn-digital/sdk 0.1.1638 → 0.1.1640

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.
@@ -3409,6 +3409,86 @@ export interface paths {
3409
3409
  patch: operations["updateAdminCannedReply"];
3410
3410
  trace?: never;
3411
3411
  };
3412
+ "/v1/admin/cdn-spend": {
3413
+ parameters: {
3414
+ query?: never;
3415
+ header?: never;
3416
+ path?: never;
3417
+ cookie?: never;
3418
+ };
3419
+ /**
3420
+ * The CDN cost cap - policy, vendor switches and budgets, site meters, events (staff).
3421
+ * @description docs/1302 §5 (CDNOVERAGE). The one `edge_cdn_spend_policy` row, each pool vendor's enforce switch and account budget, the top-up tiers, metered sites (paused first, then by spend; `total_sites` counts every row the filter matches, `paused_sites` every paused one) and the latest 100 events. Amounts are integer USD micros. Requires `billing.view`.
3422
+ */
3423
+ get: operations["getAdminCdnSpend"];
3424
+ put?: never;
3425
+ post?: never;
3426
+ delete?: never;
3427
+ options?: never;
3428
+ head?: never;
3429
+ patch?: never;
3430
+ trace?: never;
3431
+ };
3432
+ "/v1/admin/cdn-spend/policy": {
3433
+ parameters: {
3434
+ query?: never;
3435
+ header?: never;
3436
+ path?: never;
3437
+ cookie?: never;
3438
+ };
3439
+ get?: never;
3440
+ put?: never;
3441
+ post?: never;
3442
+ delete?: never;
3443
+ options?: never;
3444
+ head?: never;
3445
+ /**
3446
+ * Switch the CDN cost cap between observe and enforce, or change the default cap (staff, audit-logged).
3447
+ * @description Requires `billing.entitlement.manage`. Send only the fields to change; the audit row (`cdn_spend.policy`) records each field's before and after. `422` when nothing is sent.
3448
+ */
3449
+ patch: operations["updateAdminCdnSpendPolicy"];
3450
+ trace?: never;
3451
+ };
3452
+ "/v1/admin/cdn-spend/sites/{siteId}": {
3453
+ parameters: {
3454
+ query?: never;
3455
+ header?: never;
3456
+ path?: never;
3457
+ cookie?: never;
3458
+ };
3459
+ get?: never;
3460
+ put?: never;
3461
+ post?: never;
3462
+ delete?: never;
3463
+ options?: never;
3464
+ head?: never;
3465
+ /**
3466
+ * Set or clear one site's CDN cap or enforce override (staff, audit-logged).
3467
+ * @description Requires `billing.entitlement.manage`. `null` clears an override (the site follows the policy cap and its vendor's switch again); the next pass re-evaluates the site. Audit action `cdn_spend.site_override` on the site's org. `404` for a site with no meter row.
3468
+ */
3469
+ patch: operations["updateAdminCdnSpendSite"];
3470
+ trace?: never;
3471
+ };
3472
+ "/v1/admin/cdn-spend/vendors/{vendor}": {
3473
+ parameters: {
3474
+ query?: never;
3475
+ header?: never;
3476
+ path?: never;
3477
+ cookie?: never;
3478
+ };
3479
+ get?: never;
3480
+ put?: never;
3481
+ post?: never;
3482
+ delete?: never;
3483
+ options?: never;
3484
+ head?: never;
3485
+ /**
3486
+ * Change one pool vendor's enforce switch or account budget (staff, audit-logged).
3487
+ * @description Requires `billing.entitlement.manage`. Audit action `cdn_spend.vendor`. `404` for a vendor with no budget row; `422` when nothing is sent.
3488
+ */
3489
+ patch: operations["updateAdminCdnSpendVendor"];
3490
+ trace?: never;
3491
+ };
3412
3492
  "/v1/admin/cdn/suspensions": {
3413
3493
  parameters: {
3414
3494
  query?: never;
@@ -50204,6 +50284,52 @@ export interface paths {
50204
50284
  patch?: never;
50205
50285
  trace?: never;
50206
50286
  };
50287
+ "/v1/sites/{siteId}/cdn/usage": {
50288
+ parameters: {
50289
+ query?: never;
50290
+ header?: never;
50291
+ path: {
50292
+ /** @description Site ID (UUIDv7). */
50293
+ siteId: components["parameters"]["SiteId"];
50294
+ };
50295
+ cookie?: never;
50296
+ };
50297
+ /**
50298
+ * This month's CDN allowance on a pool CDN, and how much of it the site has used.
50299
+ * @description Every site served by one of our pooled CDNs includes a monthly CDN allowance (the provider's cost of serving it, `cap_micros`, $0.25 by default, plus any top-ups bought this month). The customer is warned at `warn_low_pct` and `warn_high_pct`; at 100% the site's CDN is paused (`status: paused`) until the month ends or a top-up is added. A site on an unmetered CDN reads `metered: false` and `status: unmetered` (included, no cap). `tiers` are the one-off top-ups on sale, priced in integer minor units with their ISO currency. Requires `sites.view`.
50300
+ */
50301
+ get: operations["getSiteCdnUsage"];
50302
+ put?: never;
50303
+ post?: never;
50304
+ delete?: never;
50305
+ options?: never;
50306
+ head?: never;
50307
+ patch?: never;
50308
+ trace?: never;
50309
+ };
50310
+ "/v1/sites/{siteId}/cdn/usage/top-ups": {
50311
+ parameters: {
50312
+ query?: never;
50313
+ header?: never;
50314
+ path: {
50315
+ /** @description Site ID (UUIDv7). */
50316
+ siteId: components["parameters"]["SiteId"];
50317
+ };
50318
+ cookie?: never;
50319
+ };
50320
+ get?: never;
50321
+ put?: never;
50322
+ /**
50323
+ * Add a one-off CDN top-up to this site for the rest of the month.
50324
+ * @description Paid from the organization's Zinn® credit — never a card charge, and nothing renews. Idempotent on `request_id`: a retry with the same id returns the same top-up and debits nothing more. A paused site whose new allowance covers its spend is switched back on in the same call. Refused (422) for a site with no allowance, an unknown tier, an account not in good standing, or credit that does not cover the price. Requires `hosting.cdn.manage`.
50325
+ */
50326
+ post: operations["createSiteCdnUsageTopUp"];
50327
+ delete?: never;
50328
+ options?: never;
50329
+ head?: never;
50330
+ patch?: never;
50331
+ trace?: never;
50332
+ };
50207
50333
  "/v1/sites/{siteId}/certificate": {
50208
50334
  parameters: {
50209
50335
  query?: never;
@@ -60434,6 +60560,123 @@ export interface components {
60434
60560
  shortcut: string;
60435
60561
  title?: string;
60436
60562
  };
60563
+ AdminCdnSpendEnvelope: {
60564
+ data: {
60565
+ events: components["schemas"]["AdminCdnSpendEvent"][];
60566
+ paused_sites: number;
60567
+ policy: components["schemas"]["AdminCdnSpendPolicy"];
60568
+ protected_org_ids: string[];
60569
+ sites: components["schemas"]["AdminCdnSpendSite"][];
60570
+ tiers: {
60571
+ active: boolean;
60572
+ code: string;
60573
+ currency: string;
60574
+ /** Format: int64 */
60575
+ extra_micros: number;
60576
+ name: string;
60577
+ price_minor: number;
60578
+ }[];
60579
+ total_sites: number;
60580
+ vendors: components["schemas"]["AdminCdnSpendVendor"][];
60581
+ };
60582
+ };
60583
+ AdminCdnSpendEvent: {
60584
+ actor: string;
60585
+ /** Format: int64 */
60586
+ cap_micros: number;
60587
+ /** Format: date-time */
60588
+ created_at: string | null;
60589
+ /** Format: uuid */
60590
+ id: string;
60591
+ /** @enum {string} */
60592
+ kind: "warn" | "pause" | "restore" | "error" | "upgrade";
60593
+ /** Format: uuid */
60594
+ org_id: string;
60595
+ pct: number;
60596
+ period: string;
60597
+ /** Format: uuid */
60598
+ site_id: string;
60599
+ /** Format: int64 */
60600
+ spend_micros: number;
60601
+ vendor: string;
60602
+ };
60603
+ AdminCdnSpendPolicy: {
60604
+ observe_only: boolean;
60605
+ /** Format: int64 */
60606
+ site_cap_micros: number;
60607
+ /** Format: date-time */
60608
+ updated_at: string | null;
60609
+ updated_by: string;
60610
+ warn_high_pct: number;
60611
+ warn_low_pct: number;
60612
+ };
60613
+ AdminCdnSpendPolicyEnvelope: {
60614
+ data: components["schemas"]["AdminCdnSpendPolicy"];
60615
+ };
60616
+ AdminCdnSpendPolicyUpdate: {
60617
+ note?: string;
60618
+ observe_only?: boolean;
60619
+ /** Format: int64 */
60620
+ site_cap_micros?: number;
60621
+ };
60622
+ AdminCdnSpendSite: {
60623
+ /** Format: int64 */
60624
+ cap_micros: number;
60625
+ /** Format: int64 */
60626
+ cap_override_micros: number | null;
60627
+ cap_source: string;
60628
+ domain: string;
60629
+ enforce_override: boolean | null;
60630
+ /** Format: date-time */
60631
+ last_checked_at: string | null;
60632
+ last_error: string;
60633
+ notified_pct: number;
60634
+ /** Format: uuid */
60635
+ org_id: string;
60636
+ pct: number;
60637
+ /** @description YYYY-MM, UTC */
60638
+ period: string;
60639
+ /** @description The site's org is never paused (docs/1302 §3). */
60640
+ protected: boolean;
60641
+ /** Format: uuid */
60642
+ site_id: string;
60643
+ /** Format: int64 */
60644
+ spend_micros: number;
60645
+ /** @enum {string} */
60646
+ status: "ok" | "warned" | "paused" | "failed";
60647
+ vendor: string;
60648
+ };
60649
+ AdminCdnSpendSiteEnvelope: {
60650
+ data: components["schemas"]["AdminCdnSpendSite"];
60651
+ };
60652
+ AdminCdnSpendSiteUpdate: {
60653
+ /** Format: int64 */
60654
+ cap_override_micros?: number | null;
60655
+ enforce_override?: boolean | null;
60656
+ note?: string;
60657
+ };
60658
+ AdminCdnSpendVendor: {
60659
+ /** Format: int64 */
60660
+ account_budget_micros: number;
60661
+ account_warn_pct: number;
60662
+ budget_basis: string;
60663
+ enforce: boolean;
60664
+ /** Format: date-time */
60665
+ updated_at: string | null;
60666
+ updated_by: string;
60667
+ vendor: string;
60668
+ };
60669
+ AdminCdnSpendVendorEnvelope: {
60670
+ data: components["schemas"]["AdminCdnSpendVendor"];
60671
+ };
60672
+ AdminCdnSpendVendorUpdate: {
60673
+ /** Format: int64 */
60674
+ account_budget_micros?: number;
60675
+ account_warn_pct?: number;
60676
+ budget_basis?: string;
60677
+ enforce?: boolean;
60678
+ note?: string;
60679
+ };
60437
60680
  /** @description One CDN provider-suspension episode and its automatic move (s1014 L04). */
60438
60681
  AdminCdnSuspension: {
60439
60682
  automove_detail?: string;
@@ -103966,6 +104209,63 @@ export interface components {
103966
104209
  SiteCdnTieredCacheUpdate: {
103967
104210
  enabled: boolean;
103968
104211
  };
104212
+ SiteCdnUsage: {
104213
+ /**
104214
+ * Format: int64
104215
+ * @description This month's allowance (default or override, plus top-ups), in micro-USD.
104216
+ */
104217
+ cap_micros: number;
104218
+ /** @enum {string} */
104219
+ cap_source: "default" | "override" | "upgraded";
104220
+ /** Format: date-time */
104221
+ last_checked_at: string | null;
104222
+ /** @description False on an unmetered CDN (included, no allowance, never paused). */
104223
+ metered: boolean;
104224
+ percent: number;
104225
+ /**
104226
+ * @description The UTC month, `YYYY-MM`.
104227
+ * @example 2026-11
104228
+ */
104229
+ period: string;
104230
+ /**
104231
+ * Format: int64
104232
+ * @description Provider cost of serving the site this month, in micro-USD.
104233
+ */
104234
+ spend_micros: number;
104235
+ /** @enum {string} */
104236
+ status: "ok" | "warned" | "paused" | "failed" | "unmetered";
104237
+ tiers: components["schemas"]["SiteCdnUsageTier"][];
104238
+ warn_high_pct: number;
104239
+ warn_low_pct: number;
104240
+ };
104241
+ SiteCdnUsageTier: {
104242
+ /** @example small */
104243
+ code: string;
104244
+ /** @example USD */
104245
+ currency: string;
104246
+ /**
104247
+ * Format: int64
104248
+ * @description Extra allowance this top-up adds for the rest of the month, in micro-USD.
104249
+ */
104250
+ extra_micros: number;
104251
+ name: string;
104252
+ /** @description Price in integer minor units of `currency`. */
104253
+ price_minor: number;
104254
+ };
104255
+ SiteCdnUsageTopUp: {
104256
+ currency: string;
104257
+ /** Format: int64 */
104258
+ extra_micros: number;
104259
+ period: string;
104260
+ price_minor: number;
104261
+ tier: string;
104262
+ usage: components["schemas"]["SiteCdnUsage"];
104263
+ };
104264
+ SiteCdnUsageTopUpRequest: {
104265
+ /** @description Client-generated idempotency key; a retry with the same id is a no-op. */
104266
+ request_id: string;
104267
+ tier: string;
104268
+ };
103969
104269
  /** @description The TLS certificate serving one site (#5711, `docs/537`). */
103970
104270
  SiteCertificateStatus: {
103971
104271
  /** @description A certificate authority has signed a certificate for this site. */
@@ -122057,6 +122357,123 @@ export interface operations {
122057
122357
  429: components["responses"]["TooManyRequests"];
122058
122358
  };
122059
122359
  };
122360
+ getAdminCdnSpend: {
122361
+ parameters: {
122362
+ query?: {
122363
+ limit?: number;
122364
+ status?: "ok" | "warned" | "paused" | "failed";
122365
+ };
122366
+ header?: never;
122367
+ path?: never;
122368
+ cookie?: never;
122369
+ };
122370
+ requestBody?: never;
122371
+ responses: {
122372
+ /** @description The cost cap's state. */
122373
+ 200: {
122374
+ headers: {
122375
+ "RateLimit-Remaining": components["headers"]["RateLimitRemaining"];
122376
+ [name: string]: unknown;
122377
+ };
122378
+ content: {
122379
+ "application/json": components["schemas"]["AdminCdnSpendEnvelope"];
122380
+ };
122381
+ };
122382
+ 401: components["responses"]["Unauthorized"];
122383
+ 403: components["responses"]["Forbidden"];
122384
+ 429: components["responses"]["TooManyRequests"];
122385
+ };
122386
+ };
122387
+ updateAdminCdnSpendPolicy: {
122388
+ parameters: {
122389
+ query?: never;
122390
+ header?: never;
122391
+ path?: never;
122392
+ cookie?: never;
122393
+ };
122394
+ requestBody: {
122395
+ content: {
122396
+ "application/json": components["schemas"]["AdminCdnSpendPolicyUpdate"];
122397
+ };
122398
+ };
122399
+ responses: {
122400
+ /** @description The policy after the change. */
122401
+ 200: {
122402
+ headers: {
122403
+ [name: string]: unknown;
122404
+ };
122405
+ content: {
122406
+ "application/json": components["schemas"]["AdminCdnSpendPolicyEnvelope"];
122407
+ };
122408
+ };
122409
+ 401: components["responses"]["Unauthorized"];
122410
+ 403: components["responses"]["Forbidden"];
122411
+ 422: components["responses"]["UnprocessableEntity"];
122412
+ 429: components["responses"]["TooManyRequests"];
122413
+ };
122414
+ };
122415
+ updateAdminCdnSpendSite: {
122416
+ parameters: {
122417
+ query?: never;
122418
+ header?: never;
122419
+ path: {
122420
+ siteId: string;
122421
+ };
122422
+ cookie?: never;
122423
+ };
122424
+ requestBody: {
122425
+ content: {
122426
+ "application/json": components["schemas"]["AdminCdnSpendSiteUpdate"];
122427
+ };
122428
+ };
122429
+ responses: {
122430
+ /** @description The site's meter after the change. */
122431
+ 200: {
122432
+ headers: {
122433
+ [name: string]: unknown;
122434
+ };
122435
+ content: {
122436
+ "application/json": components["schemas"]["AdminCdnSpendSiteEnvelope"];
122437
+ };
122438
+ };
122439
+ 401: components["responses"]["Unauthorized"];
122440
+ 403: components["responses"]["Forbidden"];
122441
+ 404: components["responses"]["NotFound"];
122442
+ 422: components["responses"]["UnprocessableEntity"];
122443
+ 429: components["responses"]["TooManyRequests"];
122444
+ };
122445
+ };
122446
+ updateAdminCdnSpendVendor: {
122447
+ parameters: {
122448
+ query?: never;
122449
+ header?: never;
122450
+ path: {
122451
+ vendor: string;
122452
+ };
122453
+ cookie?: never;
122454
+ };
122455
+ requestBody: {
122456
+ content: {
122457
+ "application/json": components["schemas"]["AdminCdnSpendVendorUpdate"];
122458
+ };
122459
+ };
122460
+ responses: {
122461
+ /** @description The vendor row after the change. */
122462
+ 200: {
122463
+ headers: {
122464
+ [name: string]: unknown;
122465
+ };
122466
+ content: {
122467
+ "application/json": components["schemas"]["AdminCdnSpendVendorEnvelope"];
122468
+ };
122469
+ };
122470
+ 401: components["responses"]["Unauthorized"];
122471
+ 403: components["responses"]["Forbidden"];
122472
+ 404: components["responses"]["NotFound"];
122473
+ 422: components["responses"]["UnprocessableEntity"];
122474
+ 429: components["responses"]["TooManyRequests"];
122475
+ };
122476
+ };
122060
122477
  listAdminCdnSuspensions: {
122061
122478
  parameters: {
122062
122479
  query?: {
@@ -199722,6 +200139,65 @@ export interface operations {
199722
200139
  503: components["responses"]["ProviderNotConfigured"];
199723
200140
  };
199724
200141
  };
200142
+ getSiteCdnUsage: {
200143
+ parameters: {
200144
+ query?: never;
200145
+ header?: never;
200146
+ path: {
200147
+ /** @description Site ID (UUIDv7). */
200148
+ siteId: components["parameters"]["SiteId"];
200149
+ };
200150
+ cookie?: never;
200151
+ };
200152
+ requestBody?: never;
200153
+ responses: {
200154
+ /** @description The site's CDN usage this month. */
200155
+ 200: {
200156
+ headers: {
200157
+ [name: string]: unknown;
200158
+ };
200159
+ content: {
200160
+ "application/json": components["schemas"]["SiteCdnUsage"];
200161
+ };
200162
+ };
200163
+ 401: components["responses"]["Unauthorized"];
200164
+ 403: components["responses"]["Forbidden"];
200165
+ 404: components["responses"]["NotFound"];
200166
+ 429: components["responses"]["TooManyRequests"];
200167
+ };
200168
+ };
200169
+ createSiteCdnUsageTopUp: {
200170
+ parameters: {
200171
+ query?: never;
200172
+ header?: never;
200173
+ path: {
200174
+ /** @description Site ID (UUIDv7). */
200175
+ siteId: components["parameters"]["SiteId"];
200176
+ };
200177
+ cookie?: never;
200178
+ };
200179
+ requestBody: {
200180
+ content: {
200181
+ "application/json": components["schemas"]["SiteCdnUsageTopUpRequest"];
200182
+ };
200183
+ };
200184
+ responses: {
200185
+ /** @description The top-up was added (or had already been added for this request id). */
200186
+ 201: {
200187
+ headers: {
200188
+ [name: string]: unknown;
200189
+ };
200190
+ content: {
200191
+ "application/json": components["schemas"]["SiteCdnUsageTopUp"];
200192
+ };
200193
+ };
200194
+ 401: components["responses"]["Unauthorized"];
200195
+ 403: components["responses"]["Forbidden"];
200196
+ 404: components["responses"]["NotFound"];
200197
+ 422: components["responses"]["UnprocessableEntity"];
200198
+ 429: components["responses"]["TooManyRequests"];
200199
+ };
200200
+ };
199725
200201
  getSiteCertificate: {
199726
200202
  parameters: {
199727
200203
  query?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zinn-digital/sdk",
3
- "version": "0.1.1638",
3
+ "version": "0.1.1640",
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>",