@archildata/api-types 0.0.83 → 0.0.85

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 +164 -5
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -242,6 +242,46 @@ export interface paths {
242
242
  patch?: never;
243
243
  trace?: never;
244
244
  };
245
+ "/api/billing/redeem/preview": {
246
+ parameters: {
247
+ query?: never;
248
+ header?: never;
249
+ path?: never;
250
+ cookie?: never;
251
+ };
252
+ get?: never;
253
+ put?: never;
254
+ /**
255
+ * Describe the reward a promo code belongs to
256
+ * @description Looks up the Autumn reward that owns a promo code, so the console can describe it before redeeming: its name, whether it is a feature grant or a plan discount (coupon), how long a grant lasts, and whether it must be redeemed in a team workspace. Codes are compared exactly, case included. Whether this account may still redeem the code is answered by POST /api/billing/redeem.
257
+ */
258
+ post: operations["previewBillingCode"];
259
+ delete?: never;
260
+ options?: never;
261
+ head?: never;
262
+ patch?: never;
263
+ trace?: never;
264
+ };
265
+ "/api/billing/redeem": {
266
+ parameters: {
267
+ query?: never;
268
+ header?: never;
269
+ path?: never;
270
+ cookie?: never;
271
+ };
272
+ get?: never;
273
+ put?: never;
274
+ /**
275
+ * Redeem a promo code
276
+ * @description Redeems an Autumn feature-grant promo code for the selected account: Autumn checks the code and grants the reward's features on top of the account's plan until they lapse. A grant that includes workspaces is redeemed in a team workspace. Codes are compared exactly, case included, and an account redeems a code once. A plan discount (coupon) code is applied when buying a plan instead.
277
+ */
278
+ post: operations["redeemBillingCode"];
279
+ delete?: never;
280
+ options?: never;
281
+ head?: never;
282
+ patch?: never;
283
+ trace?: never;
284
+ };
245
285
  "/api/billing/subscription/change": {
246
286
  parameters: {
247
287
  query?: never;
@@ -1732,6 +1772,40 @@ export interface components {
1732
1772
  /** @description Preview the purchase with the intro offer, as BillingSubscribeRequest. */
1733
1773
  introOffer?: boolean;
1734
1774
  };
1775
+ BillingRedeemRequest: {
1776
+ /** @description The promo code, exactly as issued. */
1777
+ code: string;
1778
+ };
1779
+ ApiResponse_BillingRedeemPreview: {
1780
+ /** @example true */
1781
+ success: boolean;
1782
+ data: {
1783
+ rewardId: string;
1784
+ /** @description The reward's name in the catalog, shown to the customer. */
1785
+ name: string;
1786
+ /**
1787
+ * @description A feature grant redeemed on its own, or a discount on a plan purchase.
1788
+ * @enum {string}
1789
+ */
1790
+ kind: "grant" | "coupon";
1791
+ /** @description How long a grant's features last; absent when none lapse, and for a coupon. */
1792
+ lasts?: {
1793
+ /** @enum {string} */
1794
+ unit: "day" | "week" | "month" | "year";
1795
+ count: number;
1796
+ };
1797
+ /** @description The grant includes workspaces, so it is redeemed in a team workspace. */
1798
+ requiresWorkspace: boolean;
1799
+ };
1800
+ };
1801
+ ApiResponse_BillingRedeemResult: {
1802
+ /** @example true */
1803
+ success: boolean;
1804
+ data: {
1805
+ /** @description The Autumn reward the code redeemed. */
1806
+ rewardId: string;
1807
+ };
1808
+ };
1735
1809
  BillingSubscribeRequest: {
1736
1810
  /** @enum {string} */
1737
1811
  plan: "developer" | "team";
@@ -3439,8 +3513,10 @@ export interface components {
3439
3513
  * `feature`, the `limit` the plan grants, the `remaining` balance and
3440
3514
  * `nextResetAt` (Unix seconds). An exec larger than the plan allows is
3441
3515
  * refused with `tool_call_size_limit_exceeded`; `data.limit` is the
3442
- * largest size in calls and `data.requested` the size asked for. Paid
3443
- * plans are never refused.
3516
+ * largest size in calls and `data.requested` the size asked for. Every
3517
+ * refusal's `data` also carries `upgradeUrl`, the console's billing
3518
+ * page, and `remaining` is never below zero. Paid plans are never
3519
+ * refused.
3444
3520
  */
3445
3521
  ToolCallAllowanceExhausted: {
3446
3522
  headers: {
@@ -3461,8 +3537,9 @@ export interface components {
3461
3537
  * allowance is used up). A timeout the caller did not choose is
3462
3538
  * lowered to fit the plan rather than refused; a fork is judged as
3463
3539
  * one launch of the source's shape, and the fitted timeout applies to
3464
- * the child and to the resumed source alike. Paid plans are never
3465
- * refused.
3540
+ * the child and to the resumed source alike. `data.upgradeUrl` is the
3541
+ * console's billing page, and `remaining` is never below zero. Paid
3542
+ * plans are never refused.
3466
3543
  */
3467
3544
  SandboxPlanLimit: {
3468
3545
  headers: {
@@ -4010,6 +4087,87 @@ export interface operations {
4010
4087
  };
4011
4088
  };
4012
4089
  };
4090
+ previewBillingCode: {
4091
+ parameters: {
4092
+ query?: never;
4093
+ header?: never;
4094
+ path?: never;
4095
+ cookie?: never;
4096
+ };
4097
+ requestBody: {
4098
+ content: {
4099
+ "application/json": components["schemas"]["BillingRedeemRequest"];
4100
+ };
4101
+ };
4102
+ responses: {
4103
+ /** @description The reward the code belongs to */
4104
+ 200: {
4105
+ headers: {
4106
+ [name: string]: unknown;
4107
+ };
4108
+ content: {
4109
+ "application/json": components["schemas"]["ApiResponse_BillingRedeemPreview"];
4110
+ };
4111
+ };
4112
+ /** @description The request is malformed (`invalid_billing_request`) or no reward has the code (`invalid_code`) */
4113
+ 400: {
4114
+ headers: {
4115
+ [name: string]: unknown;
4116
+ };
4117
+ content: {
4118
+ "application/json": components["schemas"]["ErrorResponse"];
4119
+ };
4120
+ };
4121
+ 401: components["responses"]["Unauthorized"];
4122
+ 404: components["responses"]["NotFound"];
4123
+ 502: components["responses"]["InternalError"];
4124
+ };
4125
+ };
4126
+ redeemBillingCode: {
4127
+ parameters: {
4128
+ query?: never;
4129
+ header?: never;
4130
+ path?: never;
4131
+ cookie?: never;
4132
+ };
4133
+ requestBody: {
4134
+ content: {
4135
+ "application/json": components["schemas"]["BillingRedeemRequest"];
4136
+ };
4137
+ };
4138
+ responses: {
4139
+ /** @description The reward the code granted */
4140
+ 200: {
4141
+ headers: {
4142
+ [name: string]: unknown;
4143
+ };
4144
+ content: {
4145
+ "application/json": components["schemas"]["ApiResponse_BillingRedeemResult"];
4146
+ };
4147
+ };
4148
+ /** @description The request is malformed (`invalid_billing_request`) or no reward has the code (`invalid_code`) */
4149
+ 400: {
4150
+ headers: {
4151
+ [name: string]: unknown;
4152
+ };
4153
+ content: {
4154
+ "application/json": components["schemas"]["ErrorResponse"];
4155
+ };
4156
+ };
4157
+ 401: components["responses"]["Unauthorized"];
4158
+ 404: components["responses"]["NotFound"];
4159
+ /** @description The grant needs a team workspace (`workspace_required`), the account has redeemed this code before (`already_redeemed`), the code's uses are spent (`code_used_up`), or the code is a plan discount (`checkout_required`) */
4160
+ 409: {
4161
+ headers: {
4162
+ [name: string]: unknown;
4163
+ };
4164
+ content: {
4165
+ "application/json": components["schemas"]["ErrorResponse"];
4166
+ };
4167
+ };
4168
+ 502: components["responses"]["InternalError"];
4169
+ };
4170
+ };
4013
4171
  changeBillingSubscription: {
4014
4172
  parameters: {
4015
4173
  query?: never;
@@ -5877,7 +6035,8 @@ export interface operations {
5877
6035
  * the sandbox's allocation over it exceeds what is left of the
5878
6036
  * month's allowance (`allowance_insufficient`, `allowance_exhausted`).
5879
6037
  * `data` carries the `feature`, `limit`, `remaining` and
5880
- * `nextResetAt`. Paid plans are never refused.
6038
+ * `nextResetAt`, and `upgradeUrl` (the console's billing page).
6039
+ * Paid plans are never refused.
5881
6040
  */
5882
6041
  403: {
5883
6042
  headers: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@archildata/api-types",
3
- "version": "0.0.83",
3
+ "version": "0.0.85",
4
4
  "description": "API types for the Archil control plane",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",