@mestra-dev/contract 0.0.219 → 0.0.221

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/dist/index.d.ts +142 -2
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -9992,7 +9992,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
9992
9992
  "Payments"
9993
9993
  ];
9994
9994
  readonly summary: "Apply a coupon to a pending invoice";
9995
- readonly description: "Workspace owner only. Applies a fixed or percentage coupon. If the invoice has a live YooKassa checkout, it is replaced with a discounted invoice and this response includes a new checkout link. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
9995
+ readonly description: "Workspace owner only. Applies a fixed or percentage coupon. A coupon issued for a paid Professional workspace applies only to that owner, the Professional plan, and the exact seat count and subscription term of the original purchase. If the invoice has a live YooKassa checkout, it is replaced with a discounted invoice and this response includes a new checkout link. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
9996
9996
  readonly security: readonly [
9997
9997
  never
9998
9998
  ];
@@ -10173,13 +10173,100 @@ declare const routes: import("hono/hono-base").HonoBase<{
10173
10173
  };
10174
10174
  };
10175
10175
  };
10176
+ readonly "/payments/invoice/{invoiceId}/cancel": {
10177
+ readonly post: {
10178
+ readonly tags: readonly [
10179
+ "Payments"
10180
+ ];
10181
+ readonly summary: "Cancel an unpaid upgrade and restore the paid workspace";
10182
+ readonly description: "Workspace owner only. Cancels a pending upgrade invoice and leaves the plan, seats, and billing period that were already paid. While the paid term is still open, the subscription returns to active and writes are allowed again. If that term has already ended, the upgrade is replaced by a renewal invoice and the subscription returns to past_due. A YooKassa payment that already succeeded is applied instead. A payment waiting for capture cannot be canceled. An open redirect checkout is abandoned; completing that old link does not change the workspace. Initial and renewal invoices cannot be canceled here.";
10183
+ readonly security: readonly [
10184
+ never
10185
+ ];
10186
+ readonly parameters: readonly [
10187
+ {
10188
+ readonly name: "invoiceId";
10189
+ readonly in: "path";
10190
+ readonly required: true;
10191
+ readonly schema: {
10192
+ readonly type: "string";
10193
+ readonly format: "uuid";
10194
+ };
10195
+ }
10196
+ ];
10197
+ readonly responses: {
10198
+ readonly 200: {
10199
+ readonly description: "Upgrade canceled. subscriptionStatus is active when the paid term is still open, or past_due when it has ended and a renewal invoice was created.";
10200
+ readonly content: {
10201
+ readonly "application/json": {
10202
+ readonly schema: {
10203
+ readonly type: "object";
10204
+ readonly required: readonly [
10205
+ "success",
10206
+ "invoiceId",
10207
+ "subscriptionStatus"
10208
+ ];
10209
+ readonly properties: {
10210
+ readonly success: {
10211
+ readonly type: "boolean";
10212
+ readonly const: true;
10213
+ };
10214
+ readonly invoiceId: {
10215
+ readonly type: "string";
10216
+ readonly format: "uuid";
10217
+ };
10218
+ readonly subscriptionStatus: {
10219
+ readonly type: "string";
10220
+ readonly enum: readonly [
10221
+ "active",
10222
+ "past_due"
10223
+ ];
10224
+ };
10225
+ };
10226
+ };
10227
+ };
10228
+ };
10229
+ };
10230
+ readonly 404: {
10231
+ readonly description: "Invoice not found.";
10232
+ readonly content: {
10233
+ readonly "application/json": {
10234
+ readonly schema: {
10235
+ readonly $ref: "#/components/schemas/ErrorResponse";
10236
+ };
10237
+ };
10238
+ };
10239
+ };
10240
+ readonly 409: {
10241
+ readonly description: "Invoice is not an unpaid upgrade, is already paid, or a YooKassa payment is being processed.";
10242
+ readonly content: {
10243
+ readonly "application/json": {
10244
+ readonly schema: {
10245
+ readonly $ref: "#/components/schemas/ErrorResponse";
10246
+ };
10247
+ };
10248
+ };
10249
+ };
10250
+ readonly 503: {
10251
+ readonly description: "YooKassa configuration is missing.";
10252
+ readonly content: {
10253
+ readonly "application/json": {
10254
+ readonly schema: {
10255
+ readonly $ref: "#/components/schemas/ErrorResponse";
10256
+ };
10257
+ };
10258
+ };
10259
+ };
10260
+ };
10261
+ };
10262
+ };
10176
10263
  readonly "/payments/upgrade": {
10177
10264
  readonly post: {
10178
10265
  readonly tags: readonly [
10179
10266
  "Payments"
10180
10267
  ];
10181
10268
  readonly summary: "Create a plan-change or seat-change invoice";
10182
- readonly description: "Before the first payment, owners can correct a plan or seat count up or down. After any payment, only a higher plan and/or more seats is accepted. The selected plan must fit the workspace's current tasks, comments, customers, services, storage usage, and active collaborator count; otherwise delete data or select a larger plan before retrying. The selected change takes effect only after the new invoice is paid.";
10269
+ readonly description: "Before the first payment, owners can correct a plan or seat count up or down. After any payment, only a higher plan and/or more seats is accepted. The selected plan must fit the workspace's current tasks, comments, customers, services, storage usage, and active collaborator count; otherwise delete data or select a larger plan before retrying. The selected change takes effect only after the new invoice is paid. Until then the subscription is pending and writes are blocked. Cancel that unpaid upgrade with POST /payments/invoice/{invoiceId}/cancel to return to the plan already paid for.";
10183
10270
  readonly security: readonly [
10184
10271
  never
10185
10272
  ];
@@ -22491,6 +22578,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
22491
22578
  expiresAt: string | null;
22492
22579
  maxRedemptions: number | null;
22493
22580
  redemptionCount: number;
22581
+ planId: string | null;
22582
+ seats: number | null;
22583
+ interval: string | null;
22584
+ billingCycles: number | null;
22585
+ restrictedToUserId: string | null;
22494
22586
  createdAt: string;
22495
22587
  }[];
22496
22588
  };
@@ -22518,6 +22610,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
22518
22610
  created_at: string;
22519
22611
  active: boolean;
22520
22612
  code: string;
22613
+ seats: number | null;
22614
+ planId: string | null;
22615
+ interval: string | null;
22616
+ billingCycles: number | null;
22521
22617
  updated_at: string | null;
22522
22618
  deleted_at: string | null;
22523
22619
  verified_at: string | null;
@@ -22528,6 +22624,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
22528
22624
  maxRedemptions: number | null;
22529
22625
  redemptionCount: number;
22530
22626
  createdBy: string;
22627
+ restrictedToUserId: string | null;
22628
+ sourceInvoiceId: string | null;
22629
+ notifiedAt: string | null;
22531
22630
  };
22532
22631
  };
22533
22632
  outputFormat: "json";
@@ -22580,6 +22679,13 @@ declare const routes: import("hono/hono-base").HonoBase<{
22580
22679
  maxRedemptions: number | null;
22581
22680
  redemptionCount: number;
22582
22681
  createdBy: string;
22682
+ planId: string | null;
22683
+ seats: number | null;
22684
+ interval: string | null;
22685
+ billingCycles: number | null;
22686
+ restrictedToUserId: string | null;
22687
+ sourceInvoiceId: string | null;
22688
+ notifiedAt: string | null;
22583
22689
  };
22584
22690
  };
22585
22691
  outputFormat: "json";
@@ -30598,6 +30704,40 @@ declare const routes: import("hono/hono-base").HonoBase<{
30598
30704
  status: 400 | 403 | 404 | 409;
30599
30705
  };
30600
30706
  };
30707
+ } & {
30708
+ "/invoice/:invoiceId/cancel": {
30709
+ $post: {
30710
+ input: {
30711
+ param: {
30712
+ invoiceId: string;
30713
+ };
30714
+ };
30715
+ output: {
30716
+ invoiceId: string;
30717
+ subscriptionStatus: "active";
30718
+ success: true;
30719
+ } | {
30720
+ invoiceId: string;
30721
+ subscriptionStatus: "past_due";
30722
+ success: true;
30723
+ };
30724
+ outputFormat: "json";
30725
+ status: 200;
30726
+ } | {
30727
+ input: {
30728
+ param: {
30729
+ invoiceId: string;
30730
+ };
30731
+ };
30732
+ output: {
30733
+ success: false;
30734
+ error: string;
30735
+ code: string | undefined;
30736
+ };
30737
+ outputFormat: "json";
30738
+ status: 400 | 403 | 404 | 409 | 502 | 503;
30739
+ };
30740
+ };
30601
30741
  } & {
30602
30742
  "/upgrade": {
30603
30743
  $post: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.219",
3
+ "version": "0.0.221",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,