@archildata/api-types 0.0.83 → 0.0.84

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 +155 -0
  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";
@@ -4010,6 +4084,87 @@ export interface operations {
4010
4084
  };
4011
4085
  };
4012
4086
  };
4087
+ previewBillingCode: {
4088
+ parameters: {
4089
+ query?: never;
4090
+ header?: never;
4091
+ path?: never;
4092
+ cookie?: never;
4093
+ };
4094
+ requestBody: {
4095
+ content: {
4096
+ "application/json": components["schemas"]["BillingRedeemRequest"];
4097
+ };
4098
+ };
4099
+ responses: {
4100
+ /** @description The reward the code belongs to */
4101
+ 200: {
4102
+ headers: {
4103
+ [name: string]: unknown;
4104
+ };
4105
+ content: {
4106
+ "application/json": components["schemas"]["ApiResponse_BillingRedeemPreview"];
4107
+ };
4108
+ };
4109
+ /** @description The request is malformed (`invalid_billing_request`) or no reward has the code (`invalid_code`) */
4110
+ 400: {
4111
+ headers: {
4112
+ [name: string]: unknown;
4113
+ };
4114
+ content: {
4115
+ "application/json": components["schemas"]["ErrorResponse"];
4116
+ };
4117
+ };
4118
+ 401: components["responses"]["Unauthorized"];
4119
+ 404: components["responses"]["NotFound"];
4120
+ 502: components["responses"]["InternalError"];
4121
+ };
4122
+ };
4123
+ redeemBillingCode: {
4124
+ parameters: {
4125
+ query?: never;
4126
+ header?: never;
4127
+ path?: never;
4128
+ cookie?: never;
4129
+ };
4130
+ requestBody: {
4131
+ content: {
4132
+ "application/json": components["schemas"]["BillingRedeemRequest"];
4133
+ };
4134
+ };
4135
+ responses: {
4136
+ /** @description The reward the code granted */
4137
+ 200: {
4138
+ headers: {
4139
+ [name: string]: unknown;
4140
+ };
4141
+ content: {
4142
+ "application/json": components["schemas"]["ApiResponse_BillingRedeemResult"];
4143
+ };
4144
+ };
4145
+ /** @description The request is malformed (`invalid_billing_request`) or no reward has the code (`invalid_code`) */
4146
+ 400: {
4147
+ headers: {
4148
+ [name: string]: unknown;
4149
+ };
4150
+ content: {
4151
+ "application/json": components["schemas"]["ErrorResponse"];
4152
+ };
4153
+ };
4154
+ 401: components["responses"]["Unauthorized"];
4155
+ 404: components["responses"]["NotFound"];
4156
+ /** @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`) */
4157
+ 409: {
4158
+ headers: {
4159
+ [name: string]: unknown;
4160
+ };
4161
+ content: {
4162
+ "application/json": components["schemas"]["ErrorResponse"];
4163
+ };
4164
+ };
4165
+ 502: components["responses"]["InternalError"];
4166
+ };
4167
+ };
4013
4168
  changeBillingSubscription: {
4014
4169
  parameters: {
4015
4170
  query?: never;
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.84",
4
4
  "description": "API types for the Archil control plane",
5
5
  "type": "module",
6
6
  "types": "index.d.ts",