@mestra-dev/contract 0.0.162 → 0.0.164

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 +510 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
27
27
  readonly info: {
28
28
  readonly title: "Auth Service API";
29
29
  readonly version: "1.5.12";
30
- readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Tasks, Templates, Tags, Comments, Assignees, Chat, Events, Billings, CInvoices, 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).";
30
+ readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Tasks, Templates, Tags, Comments, Assignees, Chat, Events, Billings, CInvoices, Customer History, 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 [
33
33
  {
@@ -100,6 +100,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
100
100
  readonly name: "CInvoices";
101
101
  readonly description: "Customer invoice management for real-estate workspaces. Requires workspace access and crm::customers access. Seller billing, customer, and service must belong to the workspace.";
102
102
  },
103
+ {
104
+ readonly name: "Customer History";
105
+ readonly description: "Customer service-history CRUD for real-estate workspaces. Requires workspace access and crm::customers access. Customer and service must belong to the workspace.";
106
+ },
103
107
  {
104
108
  readonly name: "Files";
105
109
  readonly description: "S3 file upload (presigned POST to a temporary `.tmp` key), confirm (magic-byte validation then promote to final key), optional nested folder destination under `{workspace}/folders/{path}/`, profile and workspace picture upload/confirm/delete, comment attachment upload/confirm, list task comment files with download URLs, service file upload/confirm/delete, list service files with download URLs, folder create/delete (nested paths), list (includes pin metadata; excludes `.tmp` objects), storage usage, pin/unpin, download by relative path, move, and file delete. General uploads accept JPEG/PNG/WebP/PDF; profile/workspace pictures accept JPEG/PNG only (0.5 MB). Workspace file routes require active collaborator status and crm::files access; comment attachments require crm::tasks write/read; service files require crm::services write/read.";
@@ -4251,6 +4255,123 @@ declare const routes: import("hono/hono-base").HonoBase<{
4251
4255
  };
4252
4256
  };
4253
4257
  };
4258
+ readonly CHistory: {
4259
+ readonly type: "object";
4260
+ readonly required: readonly [
4261
+ "id",
4262
+ "workspaceId",
4263
+ "customerId",
4264
+ "serviceId",
4265
+ "date",
4266
+ "created_by"
4267
+ ];
4268
+ readonly properties: {
4269
+ readonly id: {
4270
+ readonly type: "string";
4271
+ readonly format: "uuid";
4272
+ };
4273
+ readonly workspaceId: {
4274
+ readonly type: "string";
4275
+ readonly format: "uuid";
4276
+ };
4277
+ readonly customerId: {
4278
+ readonly type: "string";
4279
+ readonly format: "uuid";
4280
+ readonly description: "Real-estate customer identifier.";
4281
+ };
4282
+ readonly serviceId: {
4283
+ readonly type: "string";
4284
+ readonly format: "uuid";
4285
+ readonly description: "Real-estate service identifier.";
4286
+ };
4287
+ readonly notes: {
4288
+ readonly type: "string";
4289
+ readonly nullable: true;
4290
+ readonly maxLength: 256;
4291
+ };
4292
+ readonly date: {
4293
+ readonly type: "string";
4294
+ readonly format: "date-time";
4295
+ };
4296
+ readonly created_by: {
4297
+ readonly type: "string";
4298
+ readonly format: "uuid";
4299
+ };
4300
+ readonly created_at: {
4301
+ readonly type: "string";
4302
+ readonly format: "date-time";
4303
+ readonly nullable: true;
4304
+ };
4305
+ readonly updated_at: {
4306
+ readonly type: "string";
4307
+ readonly format: "date-time";
4308
+ readonly nullable: true;
4309
+ };
4310
+ readonly deleted_at: {
4311
+ readonly type: "string";
4312
+ readonly format: "date-time";
4313
+ readonly nullable: true;
4314
+ };
4315
+ };
4316
+ };
4317
+ readonly CreateCHistorySuccess: {
4318
+ readonly type: "object";
4319
+ readonly required: readonly [
4320
+ "success",
4321
+ "history"
4322
+ ];
4323
+ readonly properties: {
4324
+ readonly success: {
4325
+ readonly type: "boolean";
4326
+ readonly const: true;
4327
+ };
4328
+ readonly history: {
4329
+ readonly type: "array";
4330
+ readonly items: {
4331
+ readonly $ref: "#/components/schemas/CHistory";
4332
+ };
4333
+ readonly description: "Created history entry returned from the insert.";
4334
+ };
4335
+ };
4336
+ };
4337
+ readonly ListCHistorySuccess: {
4338
+ readonly type: "object";
4339
+ readonly required: readonly [
4340
+ "success",
4341
+ "history"
4342
+ ];
4343
+ readonly properties: {
4344
+ readonly success: {
4345
+ readonly type: "boolean";
4346
+ readonly const: true;
4347
+ };
4348
+ readonly history: {
4349
+ readonly type: "array";
4350
+ readonly items: {
4351
+ readonly $ref: "#/components/schemas/CHistory";
4352
+ };
4353
+ };
4354
+ };
4355
+ };
4356
+ readonly UpdateCHistorySuccess: {
4357
+ readonly type: "object";
4358
+ readonly required: readonly [
4359
+ "success",
4360
+ "history"
4361
+ ];
4362
+ readonly properties: {
4363
+ readonly success: {
4364
+ readonly type: "boolean";
4365
+ readonly const: true;
4366
+ };
4367
+ readonly history: {
4368
+ readonly type: "array";
4369
+ readonly items: {
4370
+ readonly $ref: "#/components/schemas/CHistory";
4371
+ };
4372
+ };
4373
+ };
4374
+ };
4254
4375
  readonly BillingInterval: {
4255
4376
  readonly type: "string";
4256
4377
  readonly enum: readonly [
@@ -7428,7 +7549,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
7428
7549
  "Workspace"
7429
7550
  ];
7430
7551
  readonly summary: "Cancel a pending workspace invitation";
7431
- readonly description: "Cancels a pending invite. Send `collaboratorId` from GET /workspace/policies/{workspace}: that field is `invitations.id` for an unregistered email, or `collaborators.id` for a registered user who has not accepted yet. Email-only invites are marked canceled (seat is freed; the token can no longer be used after signup). Pending collaborators are removed the same way as /workspace/settings/remove-collaborator. Already-accepted members cannot be canceled here. Requires write access to crm::general.";
7552
+ readonly description: "Cancels a pending invite. Send `collaboratorId` from GET /workspace/policies/{workspace}: that field is `invitations.id` for an unregistered email, or `collaborators.id` for a registered user who has not accepted yet. Email-only invites are marked canceled (seat is freed; the token can no longer be used after signup). Pending collaborators are removed the same way as /workspace/settings/remove-collaborator. Already-accepted members cannot be canceled here. Requires write access to crm::general. This cleanup action remains available in frozen Free-trial workspaces.";
7432
7553
  readonly security: readonly [
7433
7554
  never
7434
7555
  ];
@@ -7824,7 +7945,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
7824
7945
  "Workspace"
7825
7946
  ];
7826
7947
  readonly summary: "Remove a collaborator from workspace";
7827
- readonly description: "Removes a collaborator from the workspace. Requires write access to crm::general resource.";
7948
+ readonly description: "Removes a non-owner collaborator from the workspace. Requires write access to crm::general resource. This cleanup action remains available in frozen Free-trial workspaces.";
7828
7949
  readonly security: readonly [
7829
7950
  never
7830
7951
  ];
@@ -13093,6 +13214,392 @@ declare const routes: import("hono/hono-base").HonoBase<{
13093
13214
  };
13094
13215
  };
13095
13216
  };
13217
+ readonly "/chistory/create": {
13218
+ readonly post: {
13219
+ readonly tags: readonly [
13220
+ "Customer History"
13221
+ ];
13222
+ readonly summary: "Create a customer history entry";
13223
+ readonly description: "Records a service-history entry for a real-estate customer. The customer and service must exist in the specified workspace. created_by is taken from the access token. Requires workspace access and write access to crm::customers.";
13224
+ readonly security: readonly [
13225
+ never
13226
+ ];
13227
+ readonly requestBody: {
13228
+ readonly required: true;
13229
+ readonly content: {
13230
+ readonly "application/json": {
13231
+ readonly schema: {
13232
+ readonly type: "object";
13233
+ readonly required: readonly [
13234
+ "workspace",
13235
+ "customerId",
13236
+ "serviceId",
13237
+ "date"
13238
+ ];
13239
+ readonly properties: {
13240
+ readonly workspace: {
13241
+ readonly type: "string";
13242
+ readonly format: "uuid";
13243
+ };
13244
+ readonly customerId: {
13245
+ readonly type: "string";
13246
+ readonly format: "uuid";
13247
+ readonly description: "Real-estate customer identifier.";
13248
+ };
13249
+ readonly serviceId: {
13250
+ readonly type: "string";
13251
+ readonly format: "uuid";
13252
+ readonly description: "Real-estate service identifier.";
13253
+ };
13254
+ readonly notes: {
13255
+ readonly type: "string";
13256
+ readonly maxLength: 256;
13257
+ };
13258
+ readonly date: {
13259
+ readonly type: "string";
13260
+ readonly format: "date-time";
13261
+ };
13262
+ };
13263
+ };
13264
+ };
13265
+ };
13266
+ };
13267
+ readonly responses: {
13268
+ readonly 201: {
13269
+ readonly description: "History entry created successfully.";
13270
+ readonly content: {
13271
+ readonly "application/json": {
13272
+ readonly schema: {
13273
+ readonly $ref: "#/components/schemas/CreateCHistorySuccess";
13274
+ };
13275
+ };
13276
+ };
13277
+ };
13278
+ readonly 400: {
13279
+ readonly description: "Invalid request payload or unsupported workspace category.";
13280
+ readonly content: {
13281
+ readonly "application/json": {
13282
+ readonly schema: {
13283
+ readonly $ref: "#/components/schemas/ErrorResponse";
13284
+ };
13285
+ };
13286
+ };
13287
+ };
13288
+ readonly 401: {
13289
+ readonly description: "Unauthorized - Missing or invalid access token.";
13290
+ readonly content: {
13291
+ readonly "application/json": {
13292
+ readonly schema: {
13293
+ readonly $ref: "#/components/schemas/ErrorResponse";
13294
+ };
13295
+ };
13296
+ };
13297
+ };
13298
+ readonly 403: {
13299
+ readonly description: "Forbidden - User lacks workspace access or write access to crm::customers.";
13300
+ readonly content: {
13301
+ readonly "application/json": {
13302
+ readonly schema: {
13303
+ readonly $ref: "#/components/schemas/ErrorResponse";
13304
+ };
13305
+ };
13306
+ };
13307
+ };
13308
+ readonly 404: {
13309
+ readonly description: "Workspace, customer, or service not found.";
13310
+ readonly content: {
13311
+ readonly "application/json": {
13312
+ readonly schema: {
13313
+ readonly $ref: "#/components/schemas/ErrorResponse";
13314
+ };
13315
+ };
13316
+ };
13317
+ };
13318
+ };
13319
+ };
13320
+ };
13321
+ readonly "/chistory/list/{workspace}/{customerId}": {
13322
+ readonly get: {
13323
+ readonly tags: readonly [
13324
+ "Customer History"
13325
+ ];
13326
+ readonly summary: "List a customer's service history";
13327
+ readonly description: "Returns all service-history entries for a real-estate customer in the specified workspace. Requires workspace access and read access to crm::customers.";
13328
+ readonly security: readonly [
13329
+ never
13330
+ ];
13331
+ readonly parameters: readonly [
13332
+ {
13333
+ readonly name: "workspace";
13334
+ readonly in: "path";
13335
+ readonly required: true;
13336
+ readonly schema: {
13337
+ readonly type: "string";
13338
+ readonly format: "uuid";
13339
+ };
13340
+ readonly description: "Workspace identifier.";
13341
+ },
13342
+ {
13343
+ readonly name: "customerId";
13344
+ readonly in: "path";
13345
+ readonly required: true;
13346
+ readonly schema: {
13347
+ readonly type: "string";
13348
+ readonly format: "uuid";
13349
+ };
13350
+ readonly description: "Real-estate customer identifier.";
13351
+ }
13352
+ ];
13353
+ readonly responses: {
13354
+ readonly 200: {
13355
+ readonly description: "History entries fetched successfully.";
13356
+ readonly content: {
13357
+ readonly "application/json": {
13358
+ readonly schema: {
13359
+ readonly $ref: "#/components/schemas/ListCHistorySuccess";
13360
+ };
13361
+ };
13362
+ };
13363
+ };
13364
+ readonly 400: {
13365
+ readonly description: "Unsupported workspace category.";
13366
+ readonly content: {
13367
+ readonly "application/json": {
13368
+ readonly schema: {
13369
+ readonly $ref: "#/components/schemas/ErrorResponse";
13370
+ };
13371
+ };
13372
+ };
13373
+ };
13374
+ readonly 401: {
13375
+ readonly description: "Unauthorized - Missing or invalid access token.";
13376
+ readonly content: {
13377
+ readonly "application/json": {
13378
+ readonly schema: {
13379
+ readonly $ref: "#/components/schemas/ErrorResponse";
13380
+ };
13381
+ };
13382
+ };
13383
+ };
13384
+ readonly 403: {
13385
+ readonly description: "Forbidden - User lacks workspace access or read access to crm::customers.";
13386
+ readonly content: {
13387
+ readonly "application/json": {
13388
+ readonly schema: {
13389
+ readonly $ref: "#/components/schemas/ErrorResponse";
13390
+ };
13391
+ };
13392
+ };
13393
+ };
13394
+ readonly 404: {
13395
+ readonly description: "Workspace or customer not found.";
13396
+ readonly content: {
13397
+ readonly "application/json": {
13398
+ readonly schema: {
13399
+ readonly $ref: "#/components/schemas/ErrorResponse";
13400
+ };
13401
+ };
13402
+ };
13403
+ };
13404
+ };
13405
+ };
13406
+ };
13407
+ readonly "/chistory/update": {
13408
+ readonly post: {
13409
+ readonly tags: readonly [
13410
+ "Customer History"
13411
+ ];
13412
+ readonly summary: "Update a customer history entry";
13413
+ readonly description: "Updates specified fields of a customer service-history entry in a real-estate workspace. Any replacement customer or service must belong to the workspace. Requires workspace access and write access to crm::customers.";
13414
+ readonly security: readonly [
13415
+ never
13416
+ ];
13417
+ readonly requestBody: {
13418
+ readonly required: true;
13419
+ readonly content: {
13420
+ readonly "application/json": {
13421
+ readonly schema: {
13422
+ readonly type: "object";
13423
+ readonly required: readonly [
13424
+ "chistoryId",
13425
+ "workspace"
13426
+ ];
13427
+ readonly properties: {
13428
+ readonly chistoryId: {
13429
+ readonly type: "string";
13430
+ readonly format: "uuid";
13431
+ readonly description: "Customer history entry identifier.";
13432
+ };
13433
+ readonly workspace: {
13434
+ readonly type: "string";
13435
+ readonly format: "uuid";
13436
+ };
13437
+ readonly customerId: {
13438
+ readonly type: "string";
13439
+ readonly format: "uuid";
13440
+ readonly description: "Replacement real-estate customer identifier.";
13441
+ };
13442
+ readonly serviceId: {
13443
+ readonly type: "string";
13444
+ readonly format: "uuid";
13445
+ readonly description: "Replacement real-estate service identifier.";
13446
+ };
13447
+ readonly notes: {
13448
+ readonly type: "string";
13449
+ readonly maxLength: 256;
13450
+ };
13451
+ readonly date: {
13452
+ readonly type: "string";
13453
+ readonly format: "date-time";
13454
+ };
13455
+ };
13456
+ };
13457
+ };
13458
+ };
13459
+ };
13460
+ readonly responses: {
13461
+ readonly 200: {
13462
+ readonly description: "History entry updated successfully.";
13463
+ readonly content: {
13464
+ readonly "application/json": {
13465
+ readonly schema: {
13466
+ readonly $ref: "#/components/schemas/UpdateCHistorySuccess";
13467
+ };
13468
+ };
13469
+ };
13470
+ };
13471
+ readonly 400: {
13472
+ readonly description: "Invalid request payload or unsupported workspace category.";
13473
+ readonly content: {
13474
+ readonly "application/json": {
13475
+ readonly schema: {
13476
+ readonly $ref: "#/components/schemas/ErrorResponse";
13477
+ };
13478
+ };
13479
+ };
13480
+ };
13481
+ readonly 401: {
13482
+ readonly description: "Unauthorized - Missing or invalid access token.";
13483
+ readonly content: {
13484
+ readonly "application/json": {
13485
+ readonly schema: {
13486
+ readonly $ref: "#/components/schemas/ErrorResponse";
13487
+ };
13488
+ };
13489
+ };
13490
+ };
13491
+ readonly 403: {
13492
+ readonly description: "Forbidden - User lacks workspace access or write access to crm::customers.";
13493
+ readonly content: {
13494
+ readonly "application/json": {
13495
+ readonly schema: {
13496
+ readonly $ref: "#/components/schemas/ErrorResponse";
13497
+ };
13498
+ };
13499
+ };
13500
+ };
13501
+ readonly 404: {
13502
+ readonly description: "Workspace, history entry, customer, or service not found.";
13503
+ readonly content: {
13504
+ readonly "application/json": {
13505
+ readonly schema: {
13506
+ readonly $ref: "#/components/schemas/ErrorResponse";
13507
+ };
13508
+ };
13509
+ };
13510
+ };
13511
+ };
13512
+ };
13513
+ };
13514
+ readonly "/chistory/delete": {
13515
+ readonly post: {
13516
+ readonly tags: readonly [
13517
+ "Customer History"
13518
+ ];
13519
+ readonly summary: "Delete a customer history entry";
13520
+ readonly description: "Deletes a customer service-history entry from a real-estate workspace. Requires workspace access and write access to crm::customers.";
13521
+ readonly security: readonly [
13522
+ never
13523
+ ];
13524
+ readonly requestBody: {
13525
+ readonly required: true;
13526
+ readonly content: {
13527
+ readonly "application/json": {
13528
+ readonly schema: {
13529
+ readonly type: "object";
13530
+ readonly required: readonly [
13531
+ "chistoryId",
13532
+ "workspace"
13533
+ ];
13534
+ readonly properties: {
13535
+ readonly chistoryId: {
13536
+ readonly type: "string";
13537
+ readonly format: "uuid";
13538
+ readonly description: "Customer history entry identifier.";
13539
+ };
13540
+ readonly workspace: {
13541
+ readonly type: "string";
13542
+ readonly format: "uuid";
13543
+ };
13544
+ };
13545
+ };
13546
+ };
13547
+ };
13548
+ };
13549
+ readonly responses: {
13550
+ readonly 200: {
13551
+ readonly description: "History entry deleted successfully.";
13552
+ readonly content: {
13553
+ readonly "application/json": {
13554
+ readonly schema: {
13555
+ readonly $ref: "#/components/schemas/SimpleSuccess";
13556
+ };
13557
+ };
13558
+ };
13559
+ };
13560
+ readonly 400: {
13561
+ readonly description: "Invalid request payload or unsupported workspace category.";
13562
+ readonly content: {
13563
+ readonly "application/json": {
13564
+ readonly schema: {
13565
+ readonly $ref: "#/components/schemas/ErrorResponse";
13566
+ };
13567
+ };
13568
+ };
13569
+ };
13570
+ readonly 401: {
13571
+ readonly description: "Unauthorized - Missing or invalid access token.";
13572
+ readonly content: {
13573
+ readonly "application/json": {
13574
+ readonly schema: {
13575
+ readonly $ref: "#/components/schemas/ErrorResponse";
13576
+ };
13577
+ };
13578
+ };
13579
+ };
13580
+ readonly 403: {
13581
+ readonly description: "Forbidden - User lacks workspace access or write access to crm::customers.";
13582
+ readonly content: {
13583
+ readonly "application/json": {
13584
+ readonly schema: {
13585
+ readonly $ref: "#/components/schemas/ErrorResponse";
13586
+ };
13587
+ };
13588
+ };
13589
+ };
13590
+ readonly 404: {
13591
+ readonly description: "Workspace or history entry not found.";
13592
+ readonly content: {
13593
+ readonly "application/json": {
13594
+ readonly schema: {
13595
+ readonly $ref: "#/components/schemas/ErrorResponse";
13596
+ };
13597
+ };
13598
+ };
13599
+ };
13600
+ };
13601
+ };
13602
+ };
13096
13603
  readonly "/tags/list/{workspace}": {
13097
13604
  readonly get: {
13098
13605
  readonly tags: readonly [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.162",
3
+ "version": "0.0.164",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,