@mestra-dev/contract 0.0.46 → 0.0.48

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 +20 -7
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -26,7 +26,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
26
26
  readonly openapi: "3.0.3";
27
27
  readonly info: {
28
28
  readonly title: "Auth Service API";
29
- readonly version: "1.5.4";
29
+ readonly version: "1.5.5";
30
30
  readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Tasks, Templates, Tags, Comments, Assignees, Chat, Events, Billings, Files, and Notifications endpoints exposed by the k3-core platform. Unhandled HTTPException and unexpected errors are normalized by the global error handler to `{ success: false, error: string }` (status preserved for HTTPException; 500 otherwise).";
31
31
  };
32
32
  readonly servers: readonly [
@@ -926,6 +926,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
926
926
  "maxCollaborators",
927
927
  "hasPaid",
928
928
  "status",
929
+ "planCode",
929
930
  "isOwner",
930
931
  "resources"
931
932
  ];
@@ -959,6 +960,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
959
960
  readonly type: "string";
960
961
  readonly description: "Collaborator status for the workspace (e.g., active, pending).";
961
962
  };
963
+ readonly planCode: {
964
+ readonly type: "string";
965
+ readonly description: "Current workspace plan code (e.g. free, economy, standard, professional, or a private enterprise code).";
966
+ readonly example: "free";
967
+ };
962
968
  readonly token: {
963
969
  readonly type: "string";
964
970
  readonly nullable: true;
@@ -4982,7 +4988,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
4982
4988
  "Workspace"
4983
4989
  ];
4984
4990
  readonly summary: "Create a new workspace";
4985
- readonly description: "Creates a workspace and its billing subscription atomically. Free starts a 15-day trial. Economy, Standard, and Professional create a pending invoice; use the returned invoiceId to start YooKassa checkout. Professional may create one complimentary workspace for an owner with an active paid Professional workspace.";
4991
+ readonly description: "Creates a workspace and its billing subscription atomically. Free starts a 15-day trial (default `TRIAL_WORKSPACE_LIMIT` is 1 Free trial per owner). Economy, Standard, and Professional create a pending invoice; use the returned invoiceId to start YooKassa checkout. An owner may have at most 5 pending unpaid invoices for those paid plans before creating another. Professional may create one complimentary workspace for an owner with an active paid Professional workspace.";
4986
4992
  readonly security: readonly [
4987
4993
  never
4988
4994
  ];
@@ -5047,7 +5053,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
5047
5053
  };
5048
5054
  };
5049
5055
  readonly 400: {
5050
- readonly description: "Invalid payload, an unavailable plan, or an attempt to exceed the five Free-trial workspace limit.";
5056
+ readonly description: "Invalid payload, unavailable plan, Free-trial limit exceeded (`Each user can create only {TRIAL_WORKSPACE_LIMIT} free trial workspaces`; default 1), or too many pending unpaid invoices for Economy/Standard/Professional (`Pay or cancel unpaid invoices before creating more workspaces (limit 5)`).";
5051
5057
  readonly content: {
5052
5058
  readonly "application/json": {
5053
5059
  readonly schema: {
@@ -5340,7 +5346,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
5340
5346
  "Workspace"
5341
5347
  ];
5342
5348
  readonly summary: "List workspaces for the authenticated user";
5343
- readonly description: "Returns workspaces the user collaborates on, each with category, role, billing flags, invitation state, workspace profile picture URL, and the resource grants effective for the caller.";
5349
+ readonly description: "Returns workspaces the user collaborates on, each with category, plan code, role, billing flags, invitation state, workspace profile picture URL, and the resource grants effective for the caller. Also returns `unpaidLimit` (5): the maximum pending unpaid Economy/Standard/Professional invoices an owner may hold before create is blocked.";
5344
5350
  readonly security: readonly [
5345
5351
  never
5346
5352
  ];
@@ -5353,7 +5359,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
5353
5359
  readonly type: "object";
5354
5360
  readonly required: readonly [
5355
5361
  "success",
5356
- "workspaces"
5362
+ "workspaces",
5363
+ "unpaidLimit"
5357
5364
  ];
5358
5365
  readonly properties: {
5359
5366
  readonly success: {
@@ -5364,6 +5371,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
5364
5371
  readonly type: "array";
5365
5372
  readonly items: any;
5366
5373
  };
5374
+ readonly unpaidLimit: {
5375
+ readonly type: "integer";
5376
+ readonly const: 5;
5377
+ readonly description: "Max pending unpaid invoices allowed when creating another Economy/Standard/Professional workspace. Create returns 400 once this many unpaid invoices already exist.";
5378
+ };
5367
5379
  };
5368
5380
  };
5369
5381
  };
@@ -6238,7 +6250,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6238
6250
  "Workspace"
6239
6251
  ];
6240
6252
  readonly summary: "Delete a workspace";
6241
- readonly description: "Deletes a workspace and cascades removal of related data (policies, assignees, chat tenants, collaborators, comments, task tags, tasks, customers, services, billings, subscription invoices, tags, templates). Only the owner can delete a workspace. Requires write access to crm::general. Also allowed when the workspace was never paid, still has its first unpaid initial invoice, and YooKassa checkout has not been started; frozen, past-due, or open-checkout workspaces cannot be deleted.";
6253
+ 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). Soft-deleted Free trials still count toward the free-trial workspace limit. Only the owner can delete. Requires write access to crm::general. Also allowed when the workspace was never paid, still has its first unpaid initial invoice, and YooKassa checkout has not been started; frozen, past-due, or open-checkout workspaces cannot be deleted.";
6242
6254
  readonly security: readonly [
6243
6255
  never
6244
6256
  ];
@@ -6269,7 +6281,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6269
6281
  };
6270
6282
  readonly responses: {
6271
6283
  readonly 200: {
6272
- readonly description: "Workspace deleted successfully.";
6284
+ readonly description: "Workspace soft-deleted successfully.";
6273
6285
  readonly content: {
6274
6286
  readonly "application/json": {
6275
6287
  readonly schema: {
@@ -13093,6 +13105,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
13093
13105
  maxCollaborators: number;
13094
13106
  hasPaid: boolean;
13095
13107
  status: string;
13108
+ planCode: string;
13096
13109
  token: string | null;
13097
13110
  isOwner: boolean;
13098
13111
  resources: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.46",
3
+ "version": "0.0.48",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,