@mestra-dev/contract 0.0.220 → 0.0.222

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 +136 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4152,6 +4152,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
4152
4152
  readonly type: "string";
4153
4153
  readonly nullable: true;
4154
4154
  };
4155
+ readonly housingType: {
4156
+ readonly type: "string";
4157
+ readonly nullable: true;
4158
+ };
4155
4159
  readonly commercialType: {
4156
4160
  readonly type: "string";
4157
4161
  readonly nullable: true;
@@ -10173,13 +10177,100 @@ declare const routes: import("hono/hono-base").HonoBase<{
10173
10177
  };
10174
10178
  };
10175
10179
  };
10180
+ readonly "/payments/invoice/{invoiceId}/cancel": {
10181
+ readonly post: {
10182
+ readonly tags: readonly [
10183
+ "Payments"
10184
+ ];
10185
+ readonly summary: "Cancel an unpaid upgrade and restore the paid workspace";
10186
+ 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.";
10187
+ readonly security: readonly [
10188
+ never
10189
+ ];
10190
+ readonly parameters: readonly [
10191
+ {
10192
+ readonly name: "invoiceId";
10193
+ readonly in: "path";
10194
+ readonly required: true;
10195
+ readonly schema: {
10196
+ readonly type: "string";
10197
+ readonly format: "uuid";
10198
+ };
10199
+ }
10200
+ ];
10201
+ readonly responses: {
10202
+ readonly 200: {
10203
+ 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.";
10204
+ readonly content: {
10205
+ readonly "application/json": {
10206
+ readonly schema: {
10207
+ readonly type: "object";
10208
+ readonly required: readonly [
10209
+ "success",
10210
+ "invoiceId",
10211
+ "subscriptionStatus"
10212
+ ];
10213
+ readonly properties: {
10214
+ readonly success: {
10215
+ readonly type: "boolean";
10216
+ readonly const: true;
10217
+ };
10218
+ readonly invoiceId: {
10219
+ readonly type: "string";
10220
+ readonly format: "uuid";
10221
+ };
10222
+ readonly subscriptionStatus: {
10223
+ readonly type: "string";
10224
+ readonly enum: readonly [
10225
+ "active",
10226
+ "past_due"
10227
+ ];
10228
+ };
10229
+ };
10230
+ };
10231
+ };
10232
+ };
10233
+ };
10234
+ readonly 404: {
10235
+ readonly description: "Invoice not found.";
10236
+ readonly content: {
10237
+ readonly "application/json": {
10238
+ readonly schema: {
10239
+ readonly $ref: "#/components/schemas/ErrorResponse";
10240
+ };
10241
+ };
10242
+ };
10243
+ };
10244
+ readonly 409: {
10245
+ readonly description: "Invoice is not an unpaid upgrade, is already paid, or a YooKassa payment is being processed.";
10246
+ readonly content: {
10247
+ readonly "application/json": {
10248
+ readonly schema: {
10249
+ readonly $ref: "#/components/schemas/ErrorResponse";
10250
+ };
10251
+ };
10252
+ };
10253
+ };
10254
+ readonly 503: {
10255
+ readonly description: "YooKassa configuration is missing.";
10256
+ readonly content: {
10257
+ readonly "application/json": {
10258
+ readonly schema: {
10259
+ readonly $ref: "#/components/schemas/ErrorResponse";
10260
+ };
10261
+ };
10262
+ };
10263
+ };
10264
+ };
10265
+ };
10266
+ };
10176
10267
  readonly "/payments/upgrade": {
10177
10268
  readonly post: {
10178
10269
  readonly tags: readonly [
10179
10270
  "Payments"
10180
10271
  ];
10181
10272
  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.";
10273
+ 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
10274
  readonly security: readonly [
10184
10275
  never
10185
10276
  ];
@@ -13063,6 +13154,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
13063
13154
  readonly propertyStatus: {
13064
13155
  readonly type: "string";
13065
13156
  };
13157
+ readonly housingType: {
13158
+ readonly type: "string";
13159
+ };
13066
13160
  readonly commercialType: {
13067
13161
  readonly type: "string";
13068
13162
  };
@@ -13314,6 +13408,9 @@ declare const routes: import("hono/hono-base").HonoBase<{
13314
13408
  readonly propertyStatus: {
13315
13409
  readonly type: "string";
13316
13410
  };
13411
+ readonly housingType: {
13412
+ readonly type: "string";
13413
+ };
13317
13414
  readonly commercialType: {
13318
13415
  readonly type: "string";
13319
13416
  };
@@ -24012,6 +24109,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
24012
24109
  installmentPaymentAmount: number | null;
24013
24110
  roomsCount: number | null;
24014
24111
  propertyType: string | null;
24112
+ housingType: string | null;
24015
24113
  commercialType: string | null;
24016
24114
  landType: string | null;
24017
24115
  propertyStatus: string | null;
@@ -24097,6 +24195,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
24097
24195
  price: number | null;
24098
24196
  propertyType: string | null;
24099
24197
  propertyStatus: string | null;
24198
+ housingType: string | null;
24100
24199
  commercialType: string | null;
24101
24200
  commercialClass: string | null;
24102
24201
  landType: string | null;
@@ -24199,6 +24298,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
24199
24298
  price: number | null;
24200
24299
  propertyType: string | null;
24201
24300
  propertyStatus: string | null;
24301
+ housingType: string | null;
24202
24302
  commercialType: string | null;
24203
24303
  commercialClass: string | null;
24204
24304
  landType: string | null;
@@ -24319,6 +24419,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
24319
24419
  price: number | null;
24320
24420
  propertyType: string | null;
24321
24421
  propertyStatus: string | null;
24422
+ housingType: string | null;
24322
24423
  commercialType: string | null;
24323
24424
  commercialClass: string | null;
24324
24425
  landType: string | null;
@@ -30617,6 +30718,40 @@ declare const routes: import("hono/hono-base").HonoBase<{
30617
30718
  status: 400 | 403 | 404 | 409;
30618
30719
  };
30619
30720
  };
30721
+ } & {
30722
+ "/invoice/:invoiceId/cancel": {
30723
+ $post: {
30724
+ input: {
30725
+ param: {
30726
+ invoiceId: string;
30727
+ };
30728
+ };
30729
+ output: {
30730
+ invoiceId: string;
30731
+ subscriptionStatus: "active";
30732
+ success: true;
30733
+ } | {
30734
+ invoiceId: string;
30735
+ subscriptionStatus: "past_due";
30736
+ success: true;
30737
+ };
30738
+ outputFormat: "json";
30739
+ status: 200;
30740
+ } | {
30741
+ input: {
30742
+ param: {
30743
+ invoiceId: string;
30744
+ };
30745
+ };
30746
+ output: {
30747
+ success: false;
30748
+ error: string;
30749
+ code: string | undefined;
30750
+ };
30751
+ outputFormat: "json";
30752
+ status: 400 | 403 | 404 | 409 | 502 | 503;
30753
+ };
30754
+ };
30620
30755
  } & {
30621
30756
  "/upgrade": {
30622
30757
  $post: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.220",
3
+ "version": "0.0.222",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,