@mestra-dev/contract 0.0.150 → 0.0.152

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 +30 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -470,6 +470,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
470
470
  }
471
471
  ];
472
472
  };
473
+ readonly code: {
474
+ readonly type: "string";
475
+ readonly description: "Optional stable machine-readable error code.";
476
+ readonly example: "CHECKOUT_PENDING";
477
+ };
473
478
  readonly link: {
474
479
  readonly type: "string";
475
480
  readonly format: "uri";
@@ -7887,7 +7892,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
7887
7892
  "Workspace"
7888
7893
  ];
7889
7894
  readonly summary: "Delete a workspace";
7890
- readonly description: "Soft-deletes a workspace: sets deleted_at, revokes collaborator access, and purges CRM content (policies, assignees, chat tenants, comments, tasks, customers, services, tags, templates). Billing subscriptions and invoices are retained for audit/history (pending invoices are canceled; the subscription is marked canceled). Free trial workspaces cannot be deleted. Only the owner can delete. Requires write access to crm::general. Also allowed when the workspace was never paid and still has an unpaid invoice: any open YooKassa checkout is canceled first, then the workspace is deleted. If the payment already succeeded, delete returns 409. Past-due paid workspaces and Free trials cannot.";
7895
+ readonly description: "Soft-deletes a workspace: sets deleted_at, revokes collaborator access, and purges CRM content (policies, assignees, chat tenants, comments, tasks, customers, services, tags, templates). Billing subscriptions and invoices are retained for audit/history (pending invoices are canceled; the subscription is marked canceled). Free trial workspaces cannot be deleted. Only the owner can delete. Requires write access to crm::general. A YooKassa payment can be canceled only after it reaches waiting_for_capture; deletion is blocked while a checkout is pending, paid, or unresolved. Past-due paid workspaces and Free trials cannot.";
7891
7896
  readonly security: readonly [
7892
7897
  never
7893
7898
  ];
@@ -8153,7 +8158,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
8153
8158
  "Payments"
8154
8159
  ];
8155
8160
  readonly summary: "Create or retrieve YooKassa checkout";
8156
- readonly description: "Workspace owner only. Starts a two-stage YooKassa checkout for a pending invoice and returns a redirect URL. Redirect the browser to paymentUrl. The backend captures the authorized payment only after YooKassa confirms it, so an unpaid checkout can be canceled before a coupon change. If a previous session expired or was canceled, this creates a fresh payment URL.";
8161
+ readonly description: "Workspace owner only. Starts a two-stage YooKassa checkout for a pending invoice and returns a redirect URL. Redirect the browser to paymentUrl. The backend captures an authorized payment only after YooKassa confirms it. A checkout is cancelable only after it reaches waiting_for_capture; a pending checkout must expire or complete.";
8157
8162
  readonly security: readonly [
8158
8163
  never
8159
8164
  ];
@@ -8246,7 +8251,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
8246
8251
  "Payments"
8247
8252
  ];
8248
8253
  readonly summary: "Apply a coupon to a pending invoice";
8249
- readonly description: "Workspace owner only. Applies a fixed or percentage coupon. If an unpaid YooKassa checkout exists, it is canceled and replaced with the discounted invoice amount; paid or unresolved provider payments remain blocked. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
8254
+ readonly description: "Workspace owner only. Applies a fixed or percentage coupon. If YooKassa has authorized an unpaid checkout (waiting_for_capture), it is canceled and replaced with the discounted invoice amount. A pending checkout expires after up to 5 minutes and must expire or complete before a coupon can be applied. Coupon attempts are rate limited; invalid codes intentionally return the same response.";
8250
8255
  readonly security: readonly [
8251
8256
  never
8252
8257
  ];
@@ -17245,6 +17250,15 @@ declare const routes: import("hono/hono-base").HonoBase<{
17245
17250
  error: string;
17246
17251
  };
17247
17252
  outputFormat: "json";
17253
+ status: 400;
17254
+ } | {
17255
+ input: {};
17256
+ output: {
17257
+ success: false;
17258
+ error: string;
17259
+ code: string | undefined;
17260
+ };
17261
+ outputFormat: "json";
17248
17262
  status: 400 | 403 | 404 | 409 | 502 | 503;
17249
17263
  } | {
17250
17264
  input: {};
@@ -23582,6 +23596,18 @@ declare const routes: import("hono/hono-base").HonoBase<{
23582
23596
  } & {
23583
23597
  "/invoice/:invoiceId/coupon": {
23584
23598
  $post: {
23599
+ input: {
23600
+ param: {
23601
+ invoiceId: string;
23602
+ };
23603
+ };
23604
+ output: {
23605
+ success: false;
23606
+ error: never;
23607
+ };
23608
+ outputFormat: "json";
23609
+ status: 400;
23610
+ } | {
23585
23611
  input: {
23586
23612
  param: {
23587
23613
  invoiceId: string;
@@ -23609,6 +23635,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
23609
23635
  output: {
23610
23636
  success: false;
23611
23637
  error: string;
23638
+ code: string | undefined;
23612
23639
  };
23613
23640
  outputFormat: "json";
23614
23641
  status: 400 | 403 | 404 | 409;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.150",
3
+ "version": "0.0.152",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,