@archildata/api-types 0.0.55 → 0.0.57

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.
Files changed (2) hide show
  1. package/index.d.ts +849 -98
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -162,6 +162,180 @@ export interface paths {
162
162
  patch?: never;
163
163
  trace?: never;
164
164
  };
165
+ "/api/billing/subscription-preview": {
166
+ parameters: {
167
+ query?: never;
168
+ header?: never;
169
+ path?: never;
170
+ cookie?: never;
171
+ };
172
+ get?: never;
173
+ put?: never;
174
+ /**
175
+ * Preview a purchase, plan change, or the next invoice
176
+ * @description With a plan, previews subscribing to it (no subscription yet), an immediate upgrade, or a downgrade at the end of the current period. Prices are resolved server-side. Without a plan, previews the current subscription's next invoice, which includes only usage already reported to the payment processor. Read-only: confirming is a separate request that charges current prices. Enterprise is sales-only.
177
+ */
178
+ post: operations["previewBillingSubscription"];
179
+ delete?: never;
180
+ options?: never;
181
+ head?: never;
182
+ patch?: never;
183
+ trace?: never;
184
+ };
185
+ "/api/billing/subscriptions": {
186
+ parameters: {
187
+ query?: never;
188
+ header?: never;
189
+ path?: never;
190
+ cookie?: never;
191
+ };
192
+ get?: never;
193
+ put?: never;
194
+ /**
195
+ * Subscribe to a previewed plan
196
+ * @description Subscribes to a plan at current prices. Pass a saved paymentMethodId or a completed setupIntentId to charge it; omit both to receive a confirmation secret for entering a new payment method. Retrying with the same operationId returns the same operation instead of starting another purchase, and an unfinished purchase for the same plan is resumed. Accounts that already have a subscription use POST /api/billing/subscription/change.
197
+ */
198
+ post: operations["createBillingSubscription"];
199
+ delete?: never;
200
+ options?: never;
201
+ head?: never;
202
+ patch?: never;
203
+ trace?: never;
204
+ };
205
+ "/api/billing/subscription/change": {
206
+ parameters: {
207
+ query?: never;
208
+ header?: never;
209
+ path?: never;
210
+ cookie?: never;
211
+ };
212
+ get?: never;
213
+ put?: never;
214
+ /**
215
+ * Change plan
216
+ * @description Applies an upgrade immediately, charging the prorated base price, or schedules a downgrade for the end of the current period. The existing subscription is updated; no second subscription is created. An upgrade whose payment needs authentication stays pending until the confirmation secret is confirmed, and is discarded by the payment processor if it is not completed in time. Retrying with the same operationId returns the same operation.
217
+ */
218
+ post: operations["changeBillingSubscription"];
219
+ delete?: never;
220
+ options?: never;
221
+ head?: never;
222
+ patch?: never;
223
+ trace?: never;
224
+ };
225
+ "/api/billing/subscription/scheduled-change": {
226
+ parameters: {
227
+ query?: never;
228
+ header?: never;
229
+ path?: never;
230
+ cookie?: never;
231
+ };
232
+ get?: never;
233
+ put?: never;
234
+ post?: never;
235
+ /** Withdraw a scheduled plan change */
236
+ delete: operations["withdrawBillingScheduledChange"];
237
+ options?: never;
238
+ head?: never;
239
+ patch?: never;
240
+ trace?: never;
241
+ };
242
+ "/api/billing/subscription/cancel": {
243
+ parameters: {
244
+ query?: never;
245
+ header?: never;
246
+ path?: never;
247
+ cookie?: never;
248
+ };
249
+ get?: never;
250
+ put?: never;
251
+ /**
252
+ * Cancel renewal at the end of the current period
253
+ * @description The subscription stays active until effectiveEndAt. Usage for the final period is billed on the final invoice at that time. Cancelling an already-cancelling subscription returns its current state. Subscribing again after the subscription ends uses the purchase flow.
254
+ */
255
+ post: operations["cancelBillingSubscription"];
256
+ delete?: never;
257
+ options?: never;
258
+ head?: never;
259
+ patch?: never;
260
+ trace?: never;
261
+ };
262
+ "/api/billing/subscription/keep": {
263
+ parameters: {
264
+ query?: never;
265
+ header?: never;
266
+ path?: never;
267
+ cookie?: never;
268
+ };
269
+ get?: never;
270
+ put?: never;
271
+ /** Undo a scheduled cancellation */
272
+ post: operations["keepBillingSubscription"];
273
+ delete?: never;
274
+ options?: never;
275
+ head?: never;
276
+ patch?: never;
277
+ trace?: never;
278
+ };
279
+ "/api/billing/invoices/{invoiceID}/pay": {
280
+ parameters: {
281
+ query?: never;
282
+ header?: never;
283
+ path?: never;
284
+ cookie?: never;
285
+ };
286
+ get?: never;
287
+ put?: never;
288
+ /**
289
+ * Pay an open invoice
290
+ * @description Charges a saved paymentMethodId, or, when it is omitted, returns the invoice's confirmation secret for entering a new payment method. Paying does not change the default payment method. When the charge needs authentication, the response carries the confirmation secret. Retrying with the same operationId does not charge twice.
291
+ */
292
+ post: operations["payBillingInvoice"];
293
+ delete?: never;
294
+ options?: never;
295
+ head?: never;
296
+ patch?: never;
297
+ trace?: never;
298
+ };
299
+ "/api/billing/operations/{operationID}": {
300
+ parameters: {
301
+ query?: never;
302
+ header?: never;
303
+ path?: never;
304
+ cookie?: never;
305
+ };
306
+ /**
307
+ * Get the state of a billing operation
308
+ * @description Recovers an operation after a refresh, timeout, or closed tab. The operation ID is the `id` returned by subscribe, change, or pay. State is read live from the payment processor. If the original request's response never arrived, retry that request with the same operationId instead.
309
+ */
310
+ get: operations["getBillingOperation"];
311
+ put?: never;
312
+ post?: never;
313
+ delete?: never;
314
+ options?: never;
315
+ head?: never;
316
+ patch?: never;
317
+ trace?: never;
318
+ };
319
+ "/api/billing/credits": {
320
+ parameters: {
321
+ query?: never;
322
+ header?: never;
323
+ path?: never;
324
+ cookie?: never;
325
+ };
326
+ /**
327
+ * Get the account credit balance
328
+ * @description Returns the customer credit balance and one page of balance transactions, newest first, such as credit notes applied to the balance. Pass nextCursor as cursor to continue.
329
+ */
330
+ get: operations["getBillingCredits"];
331
+ put?: never;
332
+ post?: never;
333
+ delete?: never;
334
+ options?: never;
335
+ head?: never;
336
+ patch?: never;
337
+ trace?: never;
338
+ };
165
339
  "/api/activity": {
166
340
  parameters: {
167
341
  query?: never;
@@ -1040,6 +1214,15 @@ export interface components {
1040
1214
  /** Format: int64 */
1041
1215
  amountRemainingCents?: number;
1042
1216
  openInvoiceCurrency?: string;
1217
+ /** Format: int64 */
1218
+ openInvoiceDueDate?: number;
1219
+ /**
1220
+ * Format: int64
1221
+ * @description When the payment processor retries automatically, if scheduled.
1222
+ */
1223
+ openInvoiceNextPaymentAttempt?: number;
1224
+ /** @description Unfinished purchase or plan change awaiting payment; resume it with GET /api/billing/operations/{operationID}. */
1225
+ pendingOperationId?: string;
1043
1226
  };
1044
1227
  BillingSummaryActions: {
1045
1228
  canStartCheckout: boolean;
@@ -1050,6 +1233,7 @@ export interface components {
1050
1233
  canCancel: boolean;
1051
1234
  canKeepSubscription: boolean;
1052
1235
  canPayOpenInvoice: boolean;
1236
+ canWithdrawScheduledChange: boolean;
1053
1237
  };
1054
1238
  BillingSummary: {
1055
1239
  billingOwner: components["schemas"]["BillingOwner"];
@@ -1180,6 +1364,17 @@ export interface components {
1180
1364
  amountPaidCents: number;
1181
1365
  /** Format: int64 */
1182
1366
  amountRemainingCents: number;
1367
+ /** Format: int64 */
1368
+ dueDate?: number;
1369
+ /**
1370
+ * Format: int64
1371
+ * @description When the payment processor retries automatically, if scheduled.
1372
+ */
1373
+ nextPaymentAttempt?: number;
1374
+ /** Format: int64 */
1375
+ attemptCount: number;
1376
+ /** @description Open with an amount remaining; pay with POST /api/billing/invoices/{invoiceID}/pay. */
1377
+ payable: boolean;
1183
1378
  };
1184
1379
  ApiResponse_BillingInvoices: {
1185
1380
  success: boolean;
@@ -1246,120 +1441,354 @@ export interface components {
1246
1441
  success: boolean;
1247
1442
  data: components["schemas"]["BillingInvoiceDetail"];
1248
1443
  };
1249
- ActivityEvent: {
1250
- accountId: string;
1444
+ /** @description Client-generated ID for one user action, reused verbatim on retries so the action is applied at most once. */
1445
+ BillingOperationId: string;
1446
+ BillingPreviewRequest: {
1251
1447
  /**
1252
- * Format: uuid
1253
- * @description Unique, time-ordered event id.
1448
+ * @description Omit to preview the next invoice of the current subscription.
1449
+ * @enum {string}
1254
1450
  */
1255
- eventId: string;
1256
- /** @example dsk-0123456789abcdef */
1257
- diskId: string;
1258
- /** @example disk.created */
1259
- eventType: string;
1451
+ plan?: "developer" | "team";
1260
1452
  /**
1261
- * @description Event severity.
1262
- * @example error
1453
+ * @description Defaults to immediate for purchases and upgrades and period_end for downgrades; other combinations are rejected.
1263
1454
  * @enum {string}
1264
1455
  */
1265
- level: "info" | "warning" | "error";
1266
- /** Format: date-time */
1267
- createdAt: string;
1268
- /** @description Event-specific attributes (e.g. diskName on disk.created; containerId, outcome, exitCode, failureClass on disk.exec). */
1269
- details: {
1270
- [key: string]: string;
1271
- };
1272
- };
1273
- ApiResponse_ActivityList: {
1274
- /** @example true */
1275
- success: boolean;
1276
- data: components["schemas"]["ActivityEvent"][];
1277
- /** @description Set when more events remain beyond this page. Pass it back as the `cursor` query parameter to fetch the next page. Absent on the last page. */
1278
- nextCursor?: string;
1279
- };
1280
- ApiResponse_Empty: {
1281
- /** @example true */
1282
- success: boolean;
1283
- };
1284
- ApiResponse_Message: {
1285
- /** @example true */
1286
- success: boolean;
1287
- data: {
1288
- message?: string;
1289
- };
1456
+ timing?: "immediate" | "period_end";
1290
1457
  };
1291
- /** @enum {string} */
1292
- SandboxState: "pending" | "running" | "pausing" | "paused" | "stopping" | "stopped" | "exited" | "failed" | "deleting" | "deleted";
1293
- /** @enum {string} */
1294
- SandboxNetworkAction: "allow" | "deny";
1295
- /** @description Deny targets take precedence when an address or domain matches both lists. When domain rules or drain selectors are present, TCP port 80 is restricted to HTTP/1.1 or HTTP/2 and plaintext HTTP authority is enforced, but requests matching a transformation rule are rejected unless the rule also forwards. Port 443 is relayed without TLS termination. With domain rules, it is evaluated by TLS SNI and connects to an address the runtime resolves for that name, never the address the guest dialed; names need a matching domain rule or default allow, and connections without a hostname SNI are denied. Only rules with header transformations or forwarding, and drain selectors, terminate TLS, which requires clients to trust the sandbox egress CA unless the region serves its sandbox port domain's certificate to egress and the name is exactly one label below that domain; for those, both TLS SNI and HTTP authority are evaluated, and the HTTP authority selects the upstream, any request transformations, and any request forwarding. DNS to the sandbox's configured resolvers is allowed and UDP port 443 is denied. */
1296
- SandboxEgressPolicy: {
1297
- default: components["schemas"]["SandboxNetworkAction"];
1298
- /** @description Allowed IPv4 addresses, CIDR ranges, exact domains, wildcard domains beginning with `*.`, or target objects with optional outbound HTTPS request transformations. A wildcard matches subdomains but not the apex domain, including when applying transformations. */
1299
- allow?: (string | components["schemas"]["SandboxEgressRule"])[];
1300
- /** @description Denied IPv4 addresses, CIDR ranges, exact domains, or wildcard domains beginning with `*.`. A wildcard matches subdomains but not the apex domain. */
1301
- deny?: string[];
1302
- /** @description Optional hosts whose HTTP(S) requests should finish before pausing, regardless of URL path. Pausing gates new matching requests and waits up to ten minutes by default for active responses, including streams, before taking a snapshot. Errors stop counting, and expiry proceeds with the snapshot. This does not limit requests during normal operation. Selectors do not grant network access. Matching uses the original request host before transformations or forwarding. Only TCP ports 80 and 443 are supported. Connections may need to be retried after resume. */
1303
- drain_on_pause?: string[];
1458
+ BillingSubscribeRequest: {
1459
+ /** @enum {string} */
1460
+ plan: "developer" | "team";
1461
+ operationId: components["schemas"]["BillingOperationId"];
1462
+ /**
1463
+ * @description The customer accepted the plan's terms.
1464
+ * @enum {boolean}
1465
+ */
1466
+ consent: true;
1467
+ paymentMethodId?: string;
1468
+ setupIntentId?: string;
1304
1469
  };
1305
- SandboxEgressRule: {
1306
- /** @description Target allowed by this rule. Effective transformations and forwarding require an exact or wildcard lowercase domain. */
1307
- target: string;
1308
- transform?: components["schemas"]["SandboxEgressTransform"];
1470
+ BillingChangeRequest: {
1471
+ /** @enum {string} */
1472
+ plan: "developer" | "team";
1309
1473
  /**
1310
- * Format: uri
1311
- * @description Absolute public HTTPS URL that receives this rule's permitted HTTP and HTTPS requests instead of their original upstream. The original path is appended to this URL, and Archil overwrites the archil-forwarded-host, archil-forwarded-scheme, archil-forwarded-port, archil-forwarded-path, and archil-sandbox-id headers with request metadata. A transform on the same rule is applied before forwarding, so the forwarded request carries the transformed headers. URLs containing credentials, a query, or a fragment are rejected. In regions that serve their sandbox port domain's certificate to egress, a target exactly one label below that domain is presented with that publicly trusted certificate, so clients that do not trust the Archil egress CA can use it as a provider base URL.
1474
+ * @description Defaults to immediate for upgrades and period_end for downgrades; other combinations are rejected.
1475
+ * @enum {string}
1312
1476
  */
1313
- forward_url?: string;
1477
+ timing?: "immediate" | "period_end";
1478
+ operationId: components["schemas"]["BillingOperationId"];
1479
+ /** @enum {boolean} */
1480
+ consent: true;
1314
1481
  };
1315
- /** @description Optional outbound HTTPS request transformations. An omitted or empty transform leaves the rule as an ordinary allow without request mutations. */
1316
- SandboxEgressTransform: {
1317
- /** @description Outbound HTTPS request headers to set, overwriting values supplied by the sandbox. */
1318
- headers?: {
1319
- [key: string]: string;
1482
+ BillingCancelRequest: {
1483
+ operationId: components["schemas"]["BillingOperationId"];
1484
+ /** @enum {string} */
1485
+ timing?: "period_end";
1486
+ reason?: {
1487
+ /** @enum {string} */
1488
+ feedback?: "customer_service" | "low_quality" | "missing_features" | "other" | "switched_service" | "too_complex" | "too_expensive" | "unused";
1489
+ comment?: string;
1320
1490
  };
1321
1491
  };
1322
- /**
1323
- * @description Sandbox network policy. New sandboxes on free plans receive deny-all
1324
- * egress with no allowlist exceptions. Start/resume and forks retain the
1325
- * stored policy. For paid accounts, egress is unrestricted when omitted.
1326
- */
1327
- SandboxNetwork: {
1328
- egress?: components["schemas"]["SandboxEgressPolicy"];
1492
+ BillingKeepRequest: {
1493
+ operationId: components["schemas"]["BillingOperationId"];
1329
1494
  };
1330
- SandboxTimeoutRequest: {
1331
- /** @description Seconds from now until a running sandbox expires, capped at 24 hours after its session started, and the lifetime budget for its next powered-on session. */
1332
- timeout?: number;
1333
- /** @description Seconds without a direct process connection before the sandbox pauses. Zero disables idle expiry. */
1334
- idle_ttl_seconds?: number;
1495
+ BillingPayInvoiceRequest: {
1496
+ operationId: components["schemas"]["BillingOperationId"];
1497
+ paymentMethodId?: string;
1335
1498
  };
1336
- Sandbox: {
1337
- /** Format: uuid */
1338
- sandbox_id: string;
1339
- /** @description Sandbox name. */
1340
- name: string;
1341
- status: components["schemas"]["SandboxState"];
1342
- vcpu_count: number;
1343
- mem_size_mib: number;
1344
- /** @description Lifetime budget applied independently to each powered-on session. Expiry pauses the sandbox, preserving memory and processes for resume. Defaults to 24 hours. The timeout endpoint can move the deadline, but no session runs longer than 24 hours. */
1345
- max_ttl_seconds: number;
1346
- /** @description Seconds without a direct process connection before the sandbox pauses, preserving memory and processes for resume. Zero disables idle expiry. */
1347
- idle_ttl_seconds: number;
1348
- /** @description Maximum number of concurrently attached process sessions. Detached processes and one-shot process controls do not count. */
1349
- max_concurrent_execs: number;
1350
- /** @description OCI reference requested when the sandbox was created. Empty for a sandbox created from `image_id`. */
1351
- base_image: string;
1352
- /** @description Image digest the sandbox was created from, if any. */
1353
- image_digest?: string;
1499
+ BillingRecurringPrice: {
1500
+ /** @enum {string} */
1501
+ component: "base" | "usage";
1502
+ currency: string;
1354
1503
  /**
1355
- * @description Sandbox CPU architecture.
1356
- * @enum {string}
1504
+ * Format: int64
1505
+ * @description Omitted when the price is only expressible in fractional cents.
1357
1506
  */
1358
- platform?: "arm64" | "amd64";
1359
- /** @description Public hostnames published by enabled sandbox services. */
1360
- endpoints?: components["schemas"]["SandboxEndpoint"][];
1361
- /**
1362
- * @description Whether services inside the sandbox can expose ingress. Explicit API port exposure remains available regardless of this setting.
1507
+ unitAmountCents?: number;
1508
+ /** @description Price per unit in cents, as a decimal string. */
1509
+ unitAmountDecimal: string;
1510
+ interval: string;
1511
+ /** Format: int64 */
1512
+ intervalCount: number;
1513
+ /** @enum {string} */
1514
+ usageType: "licensed" | "metered";
1515
+ };
1516
+ BillingPreviewLine: {
1517
+ description: string;
1518
+ /** Format: int64 */
1519
+ amountCents: number;
1520
+ currency: string;
1521
+ proration: boolean;
1522
+ period?: components["schemas"]["BillingPeriod"];
1523
+ };
1524
+ BillingSubscriptionPreview: {
1525
+ /** @enum {string} */
1526
+ kind: "subscribe" | "upgrade" | "downgrade" | "next_invoice";
1527
+ /** @enum {string} */
1528
+ currentPlan: "none" | "developer" | "team" | "enterprise" | "unknown";
1529
+ /** @enum {string} */
1530
+ targetPlan?: "developer" | "team";
1531
+ /** @enum {string} */
1532
+ timing: "immediate" | "period_end";
1533
+ /** Format: int64 */
1534
+ effectiveAt: number;
1535
+ currency: string;
1536
+ /**
1537
+ * Format: int64
1538
+ * @description Charged if confirmed now. Usage is billed in arrears and never included.
1539
+ */
1540
+ dueNowCents: number;
1541
+ /** Format: int64 */
1542
+ subtotalCents: number;
1543
+ /** Format: int64 */
1544
+ totalCents: number;
1545
+ /** Format: int64 */
1546
+ taxCents: number;
1547
+ /** Format: int64 */
1548
+ discountCents: number;
1549
+ /**
1550
+ * Format: int64
1551
+ * @description Account credit (negative) or debit (positive) applied to the amount due.
1552
+ */
1553
+ appliedBalanceCents: number;
1554
+ lines: components["schemas"]["BillingPreviewLine"][];
1555
+ recurringPrices: components["schemas"]["BillingRecurringPrice"][];
1556
+ usagePeriod?: components["schemas"]["BillingPeriod"];
1557
+ /** @description Reasons the estimate may differ from the final invoice. */
1558
+ qualifications: ("usage_billed_in_arrears" | "usage_reported_to_date" | "tax_may_change" | "proration_time_sensitive" | "no_charge_until_effective")[];
1559
+ };
1560
+ ApiResponse_BillingSubscriptionPreview: {
1561
+ success: boolean;
1562
+ data: components["schemas"]["BillingSubscriptionPreview"];
1563
+ };
1564
+ BillingSubscriptionState: {
1565
+ /** @enum {string} */
1566
+ plan: "developer" | "team" | "enterprise" | "unknown";
1567
+ /** @description Current subscription status, or `none`. */
1568
+ subscriptionStatus: string;
1569
+ billingPeriod?: components["schemas"]["BillingPeriod"];
1570
+ /** Format: int64 */
1571
+ scheduledCancellationAt?: number;
1572
+ scheduledChange?: components["schemas"]["BillingScheduledChange"];
1573
+ };
1574
+ ApiResponse_BillingSubscriptionState: {
1575
+ success: boolean;
1576
+ data: components["schemas"]["BillingSubscriptionState"];
1577
+ };
1578
+ BillingStateConflict: components["schemas"]["ErrorResponse"] & {
1579
+ data?: components["schemas"]["BillingSubscriptionState"];
1580
+ };
1581
+ BillingNextAction: {
1582
+ /**
1583
+ * @description confirm_payment means confirm confirmationSecret with the payment form (authentication or a new payment method); confirm_setup means confirm the setup client secret to save a payment method for usage billed later; wait means poll the operation.
1584
+ * @enum {string}
1585
+ */
1586
+ type: "confirm_payment" | "confirm_setup" | "wait";
1587
+ confirmationSecret?: string;
1588
+ invoiceId?: string;
1589
+ };
1590
+ BillingOperation: {
1591
+ /** @description Pass to GET /api/billing/operations/{operationID}. */
1592
+ id: string;
1593
+ /** @enum {string} */
1594
+ type: "subscription" | "invoice_payment";
1595
+ /** @enum {string} */
1596
+ status: "pending" | "requires_action" | "processing" | "succeeded" | "failed" | "expired";
1597
+ /**
1598
+ * @description For subscription operations, whether the plan change is in effect.
1599
+ * @enum {string}
1600
+ */
1601
+ state?: "applied" | "pending" | "scheduled";
1602
+ /** @enum {string} */
1603
+ plan?: "developer" | "team" | "enterprise" | "unknown";
1604
+ subscriptionStatus?: string;
1605
+ scheduledChange?: components["schemas"]["BillingScheduledChange"];
1606
+ nextAction?: components["schemas"]["BillingNextAction"];
1607
+ /** @description Payment succeeded but Archil has not yet applied the plan; poll again. */
1608
+ planUpdatePending: boolean;
1609
+ invoice?: {
1610
+ id: string;
1611
+ status: string;
1612
+ currency: string;
1613
+ /** Format: int64 */
1614
+ amountRemainingCents: number;
1615
+ };
1616
+ failure?: {
1617
+ code: string;
1618
+ declineCode?: string;
1619
+ };
1620
+ };
1621
+ ApiResponse_BillingOperation: {
1622
+ success: boolean;
1623
+ data: components["schemas"]["BillingOperation"];
1624
+ };
1625
+ BillingCancellation: {
1626
+ /** Format: int64 */
1627
+ effectiveEndAt: number;
1628
+ subscription: components["schemas"]["BillingSubscriptionState"];
1629
+ settlement: {
1630
+ /** @enum {string} */
1631
+ method: "final_invoice_at_period_end";
1632
+ /** Format: int64 */
1633
+ finalInvoiceAt: number;
1634
+ usagePeriod?: components["schemas"]["BillingPeriod"];
1635
+ openInvoiceId?: string;
1636
+ /** Format: int64 */
1637
+ amountRemainingCents?: number;
1638
+ };
1639
+ };
1640
+ ApiResponse_BillingCancellation: {
1641
+ success: boolean;
1642
+ data: components["schemas"]["BillingCancellation"];
1643
+ };
1644
+ BillingBalanceTransaction: {
1645
+ id: string;
1646
+ type: string;
1647
+ /**
1648
+ * Format: int64
1649
+ * @description Negative values credit the account.
1650
+ */
1651
+ amountCents: number;
1652
+ currency: string;
1653
+ /** Format: int64 */
1654
+ created: number;
1655
+ description: string;
1656
+ invoiceId?: string;
1657
+ creditNoteId?: string;
1658
+ };
1659
+ BillingCredits: {
1660
+ currency: string;
1661
+ /**
1662
+ * Format: int64
1663
+ * @description Credit applied to future invoices.
1664
+ */
1665
+ creditBalanceCents: number;
1666
+ /**
1667
+ * Format: int64
1668
+ * @description Debit balance added to the next invoice.
1669
+ */
1670
+ amountOwedCents: number;
1671
+ transactions: components["schemas"]["BillingBalanceTransaction"][];
1672
+ };
1673
+ ApiResponse_BillingCredits: {
1674
+ success: boolean;
1675
+ data: components["schemas"]["BillingCredits"];
1676
+ nextCursor?: string;
1677
+ };
1678
+ ActivityEvent: {
1679
+ accountId: string;
1680
+ /**
1681
+ * Format: uuid
1682
+ * @description Unique, time-ordered event id.
1683
+ */
1684
+ eventId: string;
1685
+ /** @example dsk-0123456789abcdef */
1686
+ diskId: string;
1687
+ /** @example disk.created */
1688
+ eventType: string;
1689
+ /**
1690
+ * @description Event severity.
1691
+ * @example error
1692
+ * @enum {string}
1693
+ */
1694
+ level: "info" | "warning" | "error";
1695
+ /** Format: date-time */
1696
+ createdAt: string;
1697
+ /** @description Event-specific attributes (e.g. diskName on disk.created; containerId, outcome, exitCode, failureClass on disk.exec). */
1698
+ details: {
1699
+ [key: string]: string;
1700
+ };
1701
+ };
1702
+ ApiResponse_ActivityList: {
1703
+ /** @example true */
1704
+ success: boolean;
1705
+ data: components["schemas"]["ActivityEvent"][];
1706
+ /** @description Set when more events remain beyond this page. Pass it back as the `cursor` query parameter to fetch the next page. Absent on the last page. */
1707
+ nextCursor?: string;
1708
+ };
1709
+ ApiResponse_Empty: {
1710
+ /** @example true */
1711
+ success: boolean;
1712
+ };
1713
+ ApiResponse_Message: {
1714
+ /** @example true */
1715
+ success: boolean;
1716
+ data: {
1717
+ message?: string;
1718
+ };
1719
+ };
1720
+ /** @enum {string} */
1721
+ SandboxState: "pending" | "running" | "pausing" | "paused" | "stopping" | "stopped" | "exited" | "failed" | "deleting" | "deleted";
1722
+ /** @enum {string} */
1723
+ SandboxNetworkAction: "allow" | "deny";
1724
+ /** @description Denied addresses block all traffic to them, and allowed addresses admit all traffic to them regardless of domain rules. Other connections are matched by TLS SNI, or HTTP Host on any port, against domain denies, then domain allows, then the default. When domain rules are present, TCP connections without a hostname are denied; UDP follows the address rules and the default, except that UDP port 443 is denied. Header transforms, forwarding, and drain selectors apply to plaintext HTTP on any port, and to TLS on any port whose handshake offers HTTP through ALPN (or, on port 443, offers no ALPN). */
1725
+ SandboxEgressPolicy: {
1726
+ default: components["schemas"]["SandboxNetworkAction"];
1727
+ /** @description Allowed IPv4 addresses, CIDR ranges, exact domains, wildcard domains beginning with `*.`, or target objects with optional outbound HTTPS request transformations. A wildcard matches subdomains but not the apex domain, including when applying transformations. */
1728
+ allow?: (string | components["schemas"]["SandboxEgressRule"])[];
1729
+ /** @description Denied IPv4 addresses, CIDR ranges, exact domains, or wildcard domains beginning with `*.`. A wildcard matches subdomains but not the apex domain. */
1730
+ deny?: string[];
1731
+ /** @description Optional hosts whose HTTP(S) requests should finish before pausing, regardless of URL path. Pausing gates new matching requests and waits up to ten minutes by default for active responses, including streams, before taking a snapshot. Errors stop counting, and expiry proceeds with the snapshot. This does not limit requests during normal operation. Selectors do not grant network access. Matching uses the original request host before transformations or forwarding. Policies with domain rules apply selectors on any port; policies with only selectors apply them on TCP ports 80 and 443. Connections may need to be retried after resume. */
1732
+ drain_on_pause?: string[];
1733
+ };
1734
+ SandboxEgressRule: {
1735
+ /** @description Target allowed by this rule. Effective transformations and forwarding require an exact or wildcard lowercase domain. */
1736
+ target: string;
1737
+ transform?: components["schemas"]["SandboxEgressTransform"];
1738
+ /**
1739
+ * Format: uri
1740
+ * @description Absolute public HTTPS URL that receives this rule's permitted HTTP and HTTPS requests instead of their original upstream. The original path is appended to this URL, and Archil overwrites the archil-forwarded-host, archil-forwarded-scheme, archil-forwarded-port, archil-forwarded-path, and archil-sandbox-id headers with request metadata. A transform on the same rule is applied before forwarding, so the forwarded request carries the transformed headers. URLs containing credentials, a query, or a fragment are rejected. In regions that serve their sandbox port domain's certificate to egress, a target exactly one label below that domain is presented with that publicly trusted certificate, so clients that do not trust the Archil egress CA can use it as a provider base URL.
1741
+ */
1742
+ forward_url?: string;
1743
+ };
1744
+ /** @description Optional outbound HTTPS request transformations. An omitted or empty transform leaves the rule as an ordinary allow without request mutations. */
1745
+ SandboxEgressTransform: {
1746
+ /** @description Outbound HTTPS request headers to set, overwriting values supplied by the sandbox. */
1747
+ headers?: {
1748
+ [key: string]: string;
1749
+ };
1750
+ };
1751
+ /**
1752
+ * @description Sandbox network policy. New sandboxes on free plans receive deny-all
1753
+ * egress with no allowlist exceptions. Start/resume and forks retain the
1754
+ * stored policy. For paid accounts, egress is unrestricted when omitted.
1755
+ */
1756
+ SandboxNetwork: {
1757
+ egress?: components["schemas"]["SandboxEgressPolicy"];
1758
+ };
1759
+ SandboxTimeoutRequest: {
1760
+ /** @description Seconds from now until a running sandbox expires, capped at 24 hours after its session started, and the lifetime budget for its next powered-on session. */
1761
+ timeout?: number;
1762
+ /** @description Seconds without a direct process connection before the sandbox pauses. Zero disables idle expiry. */
1763
+ idle_ttl_seconds?: number;
1764
+ };
1765
+ Sandbox: {
1766
+ /** Format: uuid */
1767
+ sandbox_id: string;
1768
+ /** @description Sandbox name. */
1769
+ name: string;
1770
+ status: components["schemas"]["SandboxState"];
1771
+ vcpu_count: number;
1772
+ mem_size_mib: number;
1773
+ /** @description Lifetime budget applied independently to each powered-on session. Expiry pauses the sandbox, preserving memory and processes for resume. Defaults to 24 hours. The timeout endpoint can move the deadline, but no session runs longer than 24 hours. */
1774
+ max_ttl_seconds: number;
1775
+ /** @description Seconds without a direct process connection before the sandbox pauses, preserving memory and processes for resume. Zero disables idle expiry. */
1776
+ idle_ttl_seconds: number;
1777
+ /** @description Maximum number of concurrently attached process sessions. Detached processes and one-shot process controls do not count. */
1778
+ max_concurrent_execs: number;
1779
+ /** @description OCI reference requested when the sandbox was created. Empty for a sandbox created from `image_id`. */
1780
+ base_image: string;
1781
+ /** @description Image digest the sandbox was created from, if any. */
1782
+ image_digest?: string;
1783
+ /**
1784
+ * @description Sandbox CPU architecture.
1785
+ * @enum {string}
1786
+ */
1787
+ platform?: "arm64" | "amd64";
1788
+ /** @description Public hostnames published by enabled sandbox services. */
1789
+ endpoints?: components["schemas"]["SandboxEndpoint"][];
1790
+ /**
1791
+ * @description Whether services inside the sandbox can expose ingress. Explicit API port exposure remains available regardless of this setting.
1363
1792
  * @default false
1364
1793
  */
1365
1794
  enable_service_ingress: boolean;
@@ -2855,6 +3284,328 @@ export interface operations {
2855
3284
  502: components["responses"]["InternalError"];
2856
3285
  };
2857
3286
  };
3287
+ previewBillingSubscription: {
3288
+ parameters: {
3289
+ query?: never;
3290
+ header?: never;
3291
+ path?: never;
3292
+ cookie?: never;
3293
+ };
3294
+ requestBody?: {
3295
+ content: {
3296
+ "application/json": components["schemas"]["BillingPreviewRequest"];
3297
+ };
3298
+ };
3299
+ responses: {
3300
+ /** @description Previewed amounts, prices, and timing */
3301
+ 200: {
3302
+ headers: {
3303
+ [name: string]: unknown;
3304
+ };
3305
+ content: {
3306
+ "application/json": components["schemas"]["ApiResponse_BillingSubscriptionPreview"];
3307
+ };
3308
+ };
3309
+ 400: components["responses"]["ValidationError"];
3310
+ 401: components["responses"]["Unauthorized"];
3311
+ /** @description Billing is not served by this region (`billing_unavailable`) */
3312
+ 404: {
3313
+ headers: {
3314
+ [name: string]: unknown;
3315
+ };
3316
+ content: {
3317
+ "application/json": components["schemas"]["ErrorResponse"];
3318
+ };
3319
+ };
3320
+ /** @description The requested change does not apply to the current subscription, with the current state in data (`already_on_plan`, `change_not_allowed`, `sales_managed_plan`, `no_subscription`, `multiple_subscriptions`, `managed_billing`) */
3321
+ 409: {
3322
+ headers: {
3323
+ [name: string]: unknown;
3324
+ };
3325
+ content: {
3326
+ "application/json": components["schemas"]["BillingStateConflict"];
3327
+ };
3328
+ };
3329
+ 502: components["responses"]["InternalError"];
3330
+ };
3331
+ };
3332
+ createBillingSubscription: {
3333
+ parameters: {
3334
+ query?: never;
3335
+ header?: never;
3336
+ path?: never;
3337
+ cookie?: never;
3338
+ };
3339
+ requestBody: {
3340
+ content: {
3341
+ "application/json": components["schemas"]["BillingSubscribeRequest"];
3342
+ };
3343
+ };
3344
+ responses: {
3345
+ /** @description Purchase operation state */
3346
+ 200: {
3347
+ headers: {
3348
+ [name: string]: unknown;
3349
+ };
3350
+ content: {
3351
+ "application/json": components["schemas"]["ApiResponse_BillingOperation"];
3352
+ };
3353
+ };
3354
+ 400: components["responses"]["ValidationError"];
3355
+ 401: components["responses"]["Unauthorized"];
3356
+ 404: components["responses"]["NotFound"];
3357
+ /** @description The account already has a subscription (`already_subscribed`), the operationId was used for a different request (`operation_conflict`), or the setup is incomplete (`setup_incomplete`); the current state is in data */
3358
+ 409: {
3359
+ headers: {
3360
+ [name: string]: unknown;
3361
+ };
3362
+ content: {
3363
+ "application/json": components["schemas"]["BillingStateConflict"];
3364
+ };
3365
+ };
3366
+ 502: components["responses"]["InternalError"];
3367
+ };
3368
+ };
3369
+ changeBillingSubscription: {
3370
+ parameters: {
3371
+ query?: never;
3372
+ header?: never;
3373
+ path?: never;
3374
+ cookie?: never;
3375
+ };
3376
+ requestBody: {
3377
+ content: {
3378
+ "application/json": components["schemas"]["BillingChangeRequest"];
3379
+ };
3380
+ };
3381
+ responses: {
3382
+ /** @description Plan change operation state */
3383
+ 200: {
3384
+ headers: {
3385
+ [name: string]: unknown;
3386
+ };
3387
+ content: {
3388
+ "application/json": components["schemas"]["ApiResponse_BillingOperation"];
3389
+ };
3390
+ };
3391
+ 400: components["responses"]["ValidationError"];
3392
+ 401: components["responses"]["Unauthorized"];
3393
+ /** @description The subscription cannot change plan now (`already_on_plan`, `change_not_allowed`, `sales_managed_plan`, `no_subscription`), or the operationId was used for a different request (`operation_conflict`); the current state is in data */
3394
+ 409: {
3395
+ headers: {
3396
+ [name: string]: unknown;
3397
+ };
3398
+ content: {
3399
+ "application/json": components["schemas"]["BillingStateConflict"];
3400
+ };
3401
+ };
3402
+ 502: components["responses"]["InternalError"];
3403
+ };
3404
+ };
3405
+ withdrawBillingScheduledChange: {
3406
+ parameters: {
3407
+ query?: never;
3408
+ header?: never;
3409
+ path?: never;
3410
+ cookie?: never;
3411
+ };
3412
+ requestBody?: never;
3413
+ responses: {
3414
+ /** @description Remaining plan and schedule */
3415
+ 200: {
3416
+ headers: {
3417
+ [name: string]: unknown;
3418
+ };
3419
+ content: {
3420
+ "application/json": components["schemas"]["ApiResponse_BillingSubscriptionState"];
3421
+ };
3422
+ };
3423
+ 401: components["responses"]["Unauthorized"];
3424
+ /** @description No scheduled change remains, for example because it already took effect (`no_scheduled_change`), or the schedule was not created from the console (`schedule_not_self_serve`); the current state is in data */
3425
+ 409: {
3426
+ headers: {
3427
+ [name: string]: unknown;
3428
+ };
3429
+ content: {
3430
+ "application/json": components["schemas"]["BillingStateConflict"];
3431
+ };
3432
+ };
3433
+ 502: components["responses"]["InternalError"];
3434
+ };
3435
+ };
3436
+ cancelBillingSubscription: {
3437
+ parameters: {
3438
+ query?: never;
3439
+ header?: never;
3440
+ path?: never;
3441
+ cookie?: never;
3442
+ };
3443
+ requestBody: {
3444
+ content: {
3445
+ "application/json": components["schemas"]["BillingCancelRequest"];
3446
+ };
3447
+ };
3448
+ responses: {
3449
+ /** @description Cancellation and final settlement state */
3450
+ 200: {
3451
+ headers: {
3452
+ [name: string]: unknown;
3453
+ };
3454
+ content: {
3455
+ "application/json": components["schemas"]["ApiResponse_BillingCancellation"];
3456
+ };
3457
+ };
3458
+ 400: components["responses"]["ValidationError"];
3459
+ 401: components["responses"]["Unauthorized"];
3460
+ /** @description The subscription already ended (`subscription_ended`), a plan change is scheduled (`scheduled_change_pending`), or the subscription is managed by a schedule (`schedule_managed`); the current state is in data */
3461
+ 409: {
3462
+ headers: {
3463
+ [name: string]: unknown;
3464
+ };
3465
+ content: {
3466
+ "application/json": components["schemas"]["BillingStateConflict"];
3467
+ };
3468
+ };
3469
+ 502: components["responses"]["InternalError"];
3470
+ };
3471
+ };
3472
+ keepBillingSubscription: {
3473
+ parameters: {
3474
+ query?: never;
3475
+ header?: never;
3476
+ path?: never;
3477
+ cookie?: never;
3478
+ };
3479
+ requestBody: {
3480
+ content: {
3481
+ "application/json": components["schemas"]["BillingKeepRequest"];
3482
+ };
3483
+ };
3484
+ responses: {
3485
+ /** @description Subscription state after keeping it */
3486
+ 200: {
3487
+ headers: {
3488
+ [name: string]: unknown;
3489
+ };
3490
+ content: {
3491
+ "application/json": components["schemas"]["ApiResponse_BillingSubscriptionState"];
3492
+ };
3493
+ };
3494
+ 400: components["responses"]["ValidationError"];
3495
+ 401: components["responses"]["Unauthorized"];
3496
+ /** @description The subscription already ended (`subscription_ended`) or its cancellation is managed by a schedule (`schedule_managed`); the current state is in data */
3497
+ 409: {
3498
+ headers: {
3499
+ [name: string]: unknown;
3500
+ };
3501
+ content: {
3502
+ "application/json": components["schemas"]["BillingStateConflict"];
3503
+ };
3504
+ };
3505
+ 502: components["responses"]["InternalError"];
3506
+ };
3507
+ };
3508
+ payBillingInvoice: {
3509
+ parameters: {
3510
+ query?: never;
3511
+ header?: never;
3512
+ path: {
3513
+ invoiceID: string;
3514
+ };
3515
+ cookie?: never;
3516
+ };
3517
+ requestBody: {
3518
+ content: {
3519
+ "application/json": components["schemas"]["BillingPayInvoiceRequest"];
3520
+ };
3521
+ };
3522
+ responses: {
3523
+ /** @description Payment operation state with the verified remaining amount. A declined charge returns status `failed` with the decline code. */
3524
+ 200: {
3525
+ headers: {
3526
+ [name: string]: unknown;
3527
+ };
3528
+ content: {
3529
+ "application/json": components["schemas"]["ApiResponse_BillingOperation"];
3530
+ };
3531
+ };
3532
+ 400: components["responses"]["ValidationError"];
3533
+ 401: components["responses"]["Unauthorized"];
3534
+ 404: components["responses"]["NotFound"];
3535
+ /** @description The invoice cannot be paid (`invoice_not_payable`) */
3536
+ 409: {
3537
+ headers: {
3538
+ [name: string]: unknown;
3539
+ };
3540
+ content: {
3541
+ "application/json": components["schemas"]["ErrorResponse"];
3542
+ };
3543
+ };
3544
+ 502: components["responses"]["InternalError"];
3545
+ };
3546
+ };
3547
+ getBillingOperation: {
3548
+ parameters: {
3549
+ query?: never;
3550
+ header?: never;
3551
+ path: {
3552
+ operationID: string;
3553
+ };
3554
+ cookie?: never;
3555
+ };
3556
+ requestBody?: never;
3557
+ responses: {
3558
+ /** @description Current operation state */
3559
+ 200: {
3560
+ headers: {
3561
+ [name: string]: unknown;
3562
+ };
3563
+ content: {
3564
+ "application/json": components["schemas"]["ApiResponse_BillingOperation"];
3565
+ };
3566
+ };
3567
+ 400: components["responses"]["ValidationError"];
3568
+ 401: components["responses"]["Unauthorized"];
3569
+ 404: components["responses"]["NotFound"];
3570
+ 502: components["responses"]["InternalError"];
3571
+ };
3572
+ };
3573
+ getBillingCredits: {
3574
+ parameters: {
3575
+ query?: {
3576
+ limit?: number;
3577
+ /** @description Pagination cursor from a previous response */
3578
+ cursor?: components["parameters"]["Cursor"];
3579
+ };
3580
+ header?: never;
3581
+ path?: never;
3582
+ cookie?: never;
3583
+ };
3584
+ requestBody?: never;
3585
+ responses: {
3586
+ /** @description Credit balance and balance transactions */
3587
+ 200: {
3588
+ headers: {
3589
+ [name: string]: unknown;
3590
+ };
3591
+ content: {
3592
+ "application/json": components["schemas"]["ApiResponse_BillingCredits"];
3593
+ };
3594
+ };
3595
+ 400: components["responses"]["ValidationError"];
3596
+ 401: components["responses"]["Unauthorized"];
3597
+ /** @description Billing is managed by Archil (`managed_billing`) */
3598
+ 409: {
3599
+ headers: {
3600
+ [name: string]: unknown;
3601
+ };
3602
+ content: {
3603
+ "application/json": components["schemas"]["ErrorResponse"];
3604
+ };
3605
+ };
3606
+ 502: components["responses"]["InternalError"];
3607
+ };
3608
+ };
2858
3609
  listActivity: {
2859
3610
  parameters: {
2860
3611
  query?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "API types for the Archil control plane",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",