@mestra-dev/contract 0.0.140 → 0.0.142

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 +937 -29
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -26,8 +26,8 @@ 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.10";
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).";
29
+ readonly version: "1.5.11";
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).";
31
31
  };
32
32
  readonly servers: readonly [
33
33
  {
@@ -96,6 +96,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
96
96
  readonly name: "Billings";
97
97
  readonly description: "Billing/requisite management endpoints";
98
98
  },
99
+ {
100
+ readonly name: "CInvoices";
101
+ readonly description: "Customer invoice create for real-estate workspaces. Requires workspace access and write access to crm::customers. Seller billing, customer, and service must belong to the workspace.";
102
+ },
99
103
  {
100
104
  readonly name: "Files";
101
105
  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.";
@@ -4025,6 +4029,191 @@ declare const routes: import("hono/hono-base").HonoBase<{
4025
4029
  };
4026
4030
  };
4027
4031
  };
4032
+ readonly CInvoice: {
4033
+ readonly type: "object";
4034
+ readonly required: readonly [
4035
+ "id",
4036
+ "workspaceId",
4037
+ "invoiceId",
4038
+ "serviceId",
4039
+ "SellerBillingId",
4040
+ "customerId",
4041
+ "date",
4042
+ "language",
4043
+ "currency",
4044
+ "vatOption",
4045
+ "unitName",
4046
+ "unitPrice",
4047
+ "unitQuantity",
4048
+ "created_by"
4049
+ ];
4050
+ readonly properties: {
4051
+ readonly id: {
4052
+ readonly type: "string";
4053
+ readonly format: "uuid";
4054
+ };
4055
+ readonly workspaceId: {
4056
+ readonly type: "string";
4057
+ readonly format: "uuid";
4058
+ };
4059
+ readonly invoiceId: {
4060
+ readonly type: "string";
4061
+ readonly description: "User-facing invoice number.";
4062
+ };
4063
+ readonly serviceId: {
4064
+ readonly type: "string";
4065
+ readonly format: "uuid";
4066
+ readonly description: "Real-estate service identifier (service_real_estates).";
4067
+ };
4068
+ readonly SellerBillingId: {
4069
+ readonly type: "string";
4070
+ readonly format: "uuid";
4071
+ readonly description: "Seller billing/requisites identifier.";
4072
+ };
4073
+ readonly customerId: {
4074
+ readonly type: "string";
4075
+ readonly format: "uuid";
4076
+ readonly description: "Real-estate customer identifier (customer_real_estates).";
4077
+ };
4078
+ readonly date: {
4079
+ readonly type: "string";
4080
+ readonly format: "date-time";
4081
+ };
4082
+ readonly language: {
4083
+ readonly type: "string";
4084
+ readonly enum: readonly [
4085
+ "ru",
4086
+ "en"
4087
+ ];
4088
+ };
4089
+ readonly currency: {
4090
+ readonly type: "string";
4091
+ readonly enum: readonly [
4092
+ "RUB",
4093
+ "USD",
4094
+ "EUR"
4095
+ ];
4096
+ };
4097
+ readonly vatOption: {
4098
+ readonly type: "string";
4099
+ readonly enum: readonly [
4100
+ "vat_included",
4101
+ "vat_excluded"
4102
+ ];
4103
+ };
4104
+ readonly vatRate: {
4105
+ readonly type: "integer";
4106
+ readonly nullable: true;
4107
+ readonly minimum: 0;
4108
+ readonly maximum: 100;
4109
+ };
4110
+ readonly buyerInn: {
4111
+ readonly type: "string";
4112
+ readonly nullable: true;
4113
+ };
4114
+ readonly buyerKpp: {
4115
+ readonly type: "string";
4116
+ readonly nullable: true;
4117
+ };
4118
+ readonly unitName: {
4119
+ readonly type: "string";
4120
+ };
4121
+ readonly unitPrice: {
4122
+ readonly type: "integer";
4123
+ readonly minimum: 0;
4124
+ };
4125
+ readonly unitQuantity: {
4126
+ readonly type: "integer";
4127
+ readonly minimum: 1;
4128
+ };
4129
+ readonly notes: {
4130
+ readonly type: "string";
4131
+ readonly nullable: true;
4132
+ };
4133
+ readonly discount: {
4134
+ readonly type: "integer";
4135
+ readonly nullable: true;
4136
+ readonly minimum: 0;
4137
+ };
4138
+ readonly created_by: {
4139
+ readonly type: "string";
4140
+ readonly format: "uuid";
4141
+ };
4142
+ readonly created_at: {
4143
+ readonly type: "string";
4144
+ readonly format: "date-time";
4145
+ readonly nullable: true;
4146
+ };
4147
+ readonly updated_at: {
4148
+ readonly type: "string";
4149
+ readonly format: "date-time";
4150
+ readonly nullable: true;
4151
+ };
4152
+ readonly deleted_at: {
4153
+ readonly type: "string";
4154
+ readonly format: "date-time";
4155
+ readonly nullable: true;
4156
+ };
4157
+ };
4158
+ };
4159
+ readonly CreateCInvoiceSuccess: {
4160
+ readonly type: "object";
4161
+ readonly required: readonly [
4162
+ "success",
4163
+ "cinvoice"
4164
+ ];
4165
+ readonly properties: {
4166
+ readonly success: {
4167
+ readonly type: "boolean";
4168
+ readonly const: true;
4169
+ };
4170
+ readonly cinvoice: {
4171
+ readonly type: "array";
4172
+ readonly items: {
4173
+ readonly $ref: "#/components/schemas/CInvoice";
4174
+ };
4175
+ readonly description: "Created invoice(s) from insert returning.";
4176
+ };
4177
+ };
4178
+ };
4179
+ readonly ListCInvoicesSuccess: {
4180
+ readonly type: "object";
4181
+ readonly required: readonly [
4182
+ "success",
4183
+ "cinvoices"
4184
+ ];
4185
+ readonly properties: {
4186
+ readonly success: {
4187
+ readonly type: "boolean";
4188
+ readonly const: true;
4189
+ };
4190
+ readonly cinvoices: {
4191
+ readonly type: "array";
4192
+ readonly items: {
4193
+ readonly $ref: "#/components/schemas/CInvoice";
4194
+ };
4195
+ };
4196
+ };
4197
+ };
4198
+ readonly UpdateCInvoiceSuccess: {
4199
+ readonly type: "object";
4200
+ readonly required: readonly [
4201
+ "success",
4202
+ "cinvoice"
4203
+ ];
4204
+ readonly properties: {
4205
+ readonly success: {
4206
+ readonly type: "boolean";
4207
+ readonly const: true;
4208
+ };
4209
+ readonly cinvoice: {
4210
+ readonly type: "array";
4211
+ readonly items: {
4212
+ readonly $ref: "#/components/schemas/CInvoice";
4213
+ };
4214
+ };
4215
+ };
4216
+ };
4028
4217
  readonly BillingInterval: {
4029
4218
  readonly type: "string";
4030
4219
  readonly enum: readonly [
@@ -12084,35 +12273,144 @@ declare const routes: import("hono/hono-base").HonoBase<{
12084
12273
  };
12085
12274
  };
12086
12275
  };
12087
- readonly "/tags/list/{workspace}": {
12088
- readonly get: {
12276
+ readonly "/cinvoices/create": {
12277
+ readonly post: {
12089
12278
  readonly tags: readonly [
12090
- "Tags"
12279
+ "CInvoices"
12091
12280
  ];
12092
- readonly summary: "List tags by workspace";
12093
- readonly description: "Returns all tags for the given workspace. Requires workspace access and read access to crm::tasks or crm::customers.";
12281
+ readonly summary: "Create a customer invoice";
12282
+ readonly description: "Creates a customer invoice in the specified workspace. Real-estate workspaces require an existing seller billing, customer_real_estates lead, and service_real_estates listing in the same workspace. created_by is taken from the access token. Requires workspace access and write access to crm::customers. Other workspace categories return 400.";
12094
12283
  readonly security: readonly [
12095
12284
  never
12096
12285
  ];
12097
- readonly parameters: readonly [
12098
- {
12099
- readonly name: "workspace";
12100
- readonly in: "path";
12101
- readonly required: true;
12102
- readonly schema: {
12103
- readonly type: "string";
12104
- readonly format: "uuid";
12286
+ readonly requestBody: {
12287
+ readonly required: true;
12288
+ readonly content: {
12289
+ readonly "application/json": {
12290
+ readonly schema: {
12291
+ readonly type: "object";
12292
+ readonly required: readonly [
12293
+ "workspace",
12294
+ "invoiceId",
12295
+ "serviceId",
12296
+ "SellerBillingId",
12297
+ "customerId",
12298
+ "date",
12299
+ "language",
12300
+ "currency",
12301
+ "vatOption",
12302
+ "unitName",
12303
+ "unitPrice",
12304
+ "unitQuantity"
12305
+ ];
12306
+ readonly properties: {
12307
+ readonly workspace: {
12308
+ readonly type: "string";
12309
+ readonly format: "uuid";
12310
+ readonly description: "Workspace identifier where the invoice is created.";
12311
+ };
12312
+ readonly invoiceId: {
12313
+ readonly type: "string";
12314
+ readonly description: "User-facing invoice number.";
12315
+ };
12316
+ readonly serviceId: {
12317
+ readonly type: "string";
12318
+ readonly format: "uuid";
12319
+ readonly description: "Real-estate service identifier.";
12320
+ };
12321
+ readonly SellerBillingId: {
12322
+ readonly type: "string";
12323
+ readonly format: "uuid";
12324
+ readonly description: "Seller billing/requisites identifier.";
12325
+ };
12326
+ readonly customerId: {
12327
+ readonly type: "string";
12328
+ readonly format: "uuid";
12329
+ readonly description: "Real-estate customer identifier.";
12330
+ };
12331
+ readonly date: {
12332
+ readonly type: "string";
12333
+ readonly format: "date-time";
12334
+ readonly description: "Invoice date.";
12335
+ };
12336
+ readonly language: {
12337
+ readonly type: "string";
12338
+ readonly enum: readonly [
12339
+ "ru",
12340
+ "en"
12341
+ ];
12342
+ };
12343
+ readonly currency: {
12344
+ readonly type: "string";
12345
+ readonly enum: readonly [
12346
+ "RUB",
12347
+ "USD",
12348
+ "EUR"
12349
+ ];
12350
+ };
12351
+ readonly vatOption: {
12352
+ readonly type: "string";
12353
+ readonly enum: readonly [
12354
+ "vat_included",
12355
+ "vat_excluded"
12356
+ ];
12357
+ };
12358
+ readonly vatRate: {
12359
+ readonly type: "integer";
12360
+ readonly minimum: 0;
12361
+ readonly maximum: 100;
12362
+ readonly description: "VAT rate (0-100).";
12363
+ };
12364
+ readonly buyerInn: {
12365
+ readonly type: "string";
12366
+ readonly description: "Buyer INN (tax ID).";
12367
+ };
12368
+ readonly buyerKpp: {
12369
+ readonly type: "string";
12370
+ readonly description: "Buyer KPP.";
12371
+ };
12372
+ readonly unitName: {
12373
+ readonly type: "string";
12374
+ readonly description: "Line-item name.";
12375
+ };
12376
+ readonly unitPrice: {
12377
+ readonly type: "integer";
12378
+ readonly minimum: 0;
12379
+ readonly description: "Unit price in the invoice currency's minor units.";
12380
+ };
12381
+ readonly unitQuantity: {
12382
+ readonly type: "integer";
12383
+ readonly minimum: 1;
12384
+ };
12385
+ readonly notes: {
12386
+ readonly type: "string";
12387
+ };
12388
+ readonly discount: {
12389
+ readonly type: "integer";
12390
+ readonly minimum: 0;
12391
+ };
12392
+ };
12393
+ };
12105
12394
  };
12106
- readonly description: "Workspace identifier.";
12107
- }
12108
- ];
12395
+ };
12396
+ };
12109
12397
  readonly responses: {
12110
- readonly 200: {
12111
- readonly description: "Tags fetched successfully.";
12398
+ readonly 201: {
12399
+ readonly description: "Invoice created successfully.";
12112
12400
  readonly content: {
12113
12401
  readonly "application/json": {
12114
12402
  readonly schema: {
12115
- readonly $ref: "#/components/schemas/ListTagsSuccess";
12403
+ readonly $ref: "#/components/schemas/CreateCInvoiceSuccess";
12404
+ };
12405
+ };
12406
+ };
12407
+ };
12408
+ readonly 400: {
12409
+ readonly description: "Invalid request payload or unsupported workspace category.";
12410
+ readonly content: {
12411
+ readonly "application/json": {
12412
+ readonly schema: {
12413
+ readonly $ref: "#/components/schemas/ErrorResponse";
12116
12414
  };
12117
12415
  };
12118
12416
  };
@@ -12128,7 +12426,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
12128
12426
  };
12129
12427
  };
12130
12428
  readonly 403: {
12131
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to both crm::tasks and crm::customers.";
12429
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
12132
12430
  readonly content: {
12133
12431
  readonly "application/json": {
12134
12432
  readonly schema: {
@@ -12137,13 +12435,419 @@ declare const routes: import("hono/hono-base").HonoBase<{
12137
12435
  };
12138
12436
  };
12139
12437
  };
12140
- };
12141
- };
12142
- };
12143
- readonly "/tags/create": {
12144
- readonly post: {
12145
- readonly tags: readonly [
12146
- "Tags"
12438
+ readonly 404: {
12439
+ readonly description: "Workspace, billing, customer, or service not found.";
12440
+ readonly content: {
12441
+ readonly "application/json": {
12442
+ readonly schema: {
12443
+ readonly $ref: "#/components/schemas/ErrorResponse";
12444
+ };
12445
+ };
12446
+ };
12447
+ };
12448
+ };
12449
+ };
12450
+ };
12451
+ readonly "/cinvoices/list/{workspace}/{customerId}": {
12452
+ readonly get: {
12453
+ readonly tags: readonly [
12454
+ "CInvoices"
12455
+ ];
12456
+ readonly summary: "List a real-estate customer's invoices";
12457
+ readonly description: "Returns all invoices for a customer_real_estates lead in the specified real-estate workspace. Requires workspace access and read access to crm::customers.";
12458
+ readonly security: readonly [
12459
+ never
12460
+ ];
12461
+ readonly parameters: readonly [
12462
+ {
12463
+ readonly name: "workspace";
12464
+ readonly in: "path";
12465
+ readonly required: true;
12466
+ readonly schema: {
12467
+ readonly type: "string";
12468
+ readonly format: "uuid";
12469
+ };
12470
+ readonly description: "Workspace identifier.";
12471
+ },
12472
+ {
12473
+ readonly name: "customerId";
12474
+ readonly in: "path";
12475
+ readonly required: true;
12476
+ readonly schema: {
12477
+ readonly type: "string";
12478
+ readonly format: "uuid";
12479
+ };
12480
+ readonly description: "Real-estate customer identifier.";
12481
+ }
12482
+ ];
12483
+ readonly responses: {
12484
+ readonly 200: {
12485
+ readonly description: "Invoices fetched successfully.";
12486
+ readonly content: {
12487
+ readonly "application/json": {
12488
+ readonly schema: {
12489
+ readonly $ref: "#/components/schemas/ListCInvoicesSuccess";
12490
+ };
12491
+ };
12492
+ };
12493
+ };
12494
+ readonly 400: {
12495
+ readonly description: "Unsupported workspace category.";
12496
+ readonly content: {
12497
+ readonly "application/json": {
12498
+ readonly schema: {
12499
+ readonly $ref: "#/components/schemas/ErrorResponse";
12500
+ };
12501
+ };
12502
+ };
12503
+ };
12504
+ readonly 401: {
12505
+ readonly description: "Unauthorized - Missing or invalid access token.";
12506
+ readonly content: {
12507
+ readonly "application/json": {
12508
+ readonly schema: {
12509
+ readonly $ref: "#/components/schemas/ErrorResponse";
12510
+ };
12511
+ };
12512
+ };
12513
+ };
12514
+ readonly 403: {
12515
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to crm::customers resource.";
12516
+ readonly content: {
12517
+ readonly "application/json": {
12518
+ readonly schema: {
12519
+ readonly $ref: "#/components/schemas/ErrorResponse";
12520
+ };
12521
+ };
12522
+ };
12523
+ };
12524
+ readonly 404: {
12525
+ readonly description: "Workspace or customer not found.";
12526
+ readonly content: {
12527
+ readonly "application/json": {
12528
+ readonly schema: {
12529
+ readonly $ref: "#/components/schemas/ErrorResponse";
12530
+ };
12531
+ };
12532
+ };
12533
+ };
12534
+ };
12535
+ };
12536
+ };
12537
+ readonly "/cinvoices/update": {
12538
+ readonly post: {
12539
+ readonly tags: readonly [
12540
+ "CInvoices"
12541
+ ];
12542
+ readonly summary: "Update a customer invoice";
12543
+ readonly description: "Updates specified fields of an invoice in a real-estate workspace. Any replacement seller billing, customer, or service must belong to the workspace. Requires workspace access and write access to crm::customers.";
12544
+ readonly security: readonly [
12545
+ never
12546
+ ];
12547
+ readonly requestBody: {
12548
+ readonly required: true;
12549
+ readonly content: {
12550
+ readonly "application/json": {
12551
+ readonly schema: {
12552
+ readonly type: "object";
12553
+ readonly required: readonly [
12554
+ "cinvoiceId",
12555
+ "workspace"
12556
+ ];
12557
+ readonly properties: {
12558
+ readonly cinvoiceId: {
12559
+ readonly type: "string";
12560
+ readonly format: "uuid";
12561
+ readonly description: "Invoice identifier.";
12562
+ };
12563
+ readonly workspace: {
12564
+ readonly type: "string";
12565
+ readonly format: "uuid";
12566
+ readonly description: "Workspace identifier.";
12567
+ };
12568
+ readonly invoiceId: {
12569
+ readonly type: "string";
12570
+ readonly description: "User-facing invoice number.";
12571
+ };
12572
+ readonly serviceId: {
12573
+ readonly type: "string";
12574
+ readonly format: "uuid";
12575
+ readonly description: "Replacement real-estate service identifier.";
12576
+ };
12577
+ readonly SellerBillingId: {
12578
+ readonly type: "string";
12579
+ readonly format: "uuid";
12580
+ readonly description: "Replacement seller billing/requisites identifier.";
12581
+ };
12582
+ readonly customerId: {
12583
+ readonly type: "string";
12584
+ readonly format: "uuid";
12585
+ readonly description: "Replacement real-estate customer identifier.";
12586
+ };
12587
+ readonly date: {
12588
+ readonly type: "string";
12589
+ readonly format: "date-time";
12590
+ };
12591
+ readonly language: {
12592
+ readonly type: "string";
12593
+ readonly enum: readonly [
12594
+ "ru",
12595
+ "en"
12596
+ ];
12597
+ };
12598
+ readonly currency: {
12599
+ readonly type: "string";
12600
+ readonly enum: readonly [
12601
+ "RUB",
12602
+ "USD",
12603
+ "EUR"
12604
+ ];
12605
+ };
12606
+ readonly vatOption: {
12607
+ readonly type: "string";
12608
+ readonly enum: readonly [
12609
+ "vat_included",
12610
+ "vat_excluded"
12611
+ ];
12612
+ };
12613
+ readonly vatRate: {
12614
+ readonly type: "integer";
12615
+ readonly minimum: 0;
12616
+ readonly maximum: 100;
12617
+ };
12618
+ readonly buyerInn: {
12619
+ readonly type: "string";
12620
+ };
12621
+ readonly buyerKpp: {
12622
+ readonly type: "string";
12623
+ };
12624
+ readonly unitName: {
12625
+ readonly type: "string";
12626
+ };
12627
+ readonly unitPrice: {
12628
+ readonly type: "integer";
12629
+ readonly minimum: 0;
12630
+ };
12631
+ readonly unitQuantity: {
12632
+ readonly type: "integer";
12633
+ readonly minimum: 1;
12634
+ };
12635
+ readonly notes: {
12636
+ readonly type: "string";
12637
+ };
12638
+ readonly discount: {
12639
+ readonly type: "integer";
12640
+ readonly minimum: 0;
12641
+ };
12642
+ };
12643
+ };
12644
+ };
12645
+ };
12646
+ };
12647
+ readonly responses: {
12648
+ readonly 200: {
12649
+ readonly description: "Invoice updated successfully.";
12650
+ readonly content: {
12651
+ readonly "application/json": {
12652
+ readonly schema: {
12653
+ readonly $ref: "#/components/schemas/UpdateCInvoiceSuccess";
12654
+ };
12655
+ };
12656
+ };
12657
+ };
12658
+ readonly 400: {
12659
+ readonly description: "Invalid request payload or unsupported workspace category.";
12660
+ readonly content: {
12661
+ readonly "application/json": {
12662
+ readonly schema: {
12663
+ readonly $ref: "#/components/schemas/ErrorResponse";
12664
+ };
12665
+ };
12666
+ };
12667
+ };
12668
+ readonly 401: {
12669
+ readonly description: "Unauthorized - Missing or invalid access token.";
12670
+ readonly content: {
12671
+ readonly "application/json": {
12672
+ readonly schema: {
12673
+ readonly $ref: "#/components/schemas/ErrorResponse";
12674
+ };
12675
+ };
12676
+ };
12677
+ };
12678
+ readonly 403: {
12679
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
12680
+ readonly content: {
12681
+ readonly "application/json": {
12682
+ readonly schema: {
12683
+ readonly $ref: "#/components/schemas/ErrorResponse";
12684
+ };
12685
+ };
12686
+ };
12687
+ };
12688
+ readonly 404: {
12689
+ readonly description: "Workspace, invoice, billing, customer, or service not found.";
12690
+ readonly content: {
12691
+ readonly "application/json": {
12692
+ readonly schema: {
12693
+ readonly $ref: "#/components/schemas/ErrorResponse";
12694
+ };
12695
+ };
12696
+ };
12697
+ };
12698
+ };
12699
+ };
12700
+ };
12701
+ readonly "/cinvoices/delete": {
12702
+ readonly post: {
12703
+ readonly tags: readonly [
12704
+ "CInvoices"
12705
+ ];
12706
+ readonly summary: "Delete a customer invoice";
12707
+ readonly description: "Deletes an invoice from a real-estate workspace. Requires workspace access and write access to crm::customers.";
12708
+ readonly security: readonly [
12709
+ never
12710
+ ];
12711
+ readonly requestBody: {
12712
+ readonly required: true;
12713
+ readonly content: {
12714
+ readonly "application/json": {
12715
+ readonly schema: {
12716
+ readonly type: "object";
12717
+ readonly required: readonly [
12718
+ "cinvoiceId",
12719
+ "workspace"
12720
+ ];
12721
+ readonly properties: {
12722
+ readonly cinvoiceId: {
12723
+ readonly type: "string";
12724
+ readonly format: "uuid";
12725
+ readonly description: "Invoice identifier.";
12726
+ };
12727
+ readonly workspace: {
12728
+ readonly type: "string";
12729
+ readonly format: "uuid";
12730
+ readonly description: "Workspace identifier.";
12731
+ };
12732
+ };
12733
+ };
12734
+ };
12735
+ };
12736
+ };
12737
+ readonly responses: {
12738
+ readonly 200: {
12739
+ readonly description: "Invoice deleted successfully.";
12740
+ readonly content: {
12741
+ readonly "application/json": {
12742
+ readonly schema: {
12743
+ readonly $ref: "#/components/schemas/SimpleSuccess";
12744
+ };
12745
+ };
12746
+ };
12747
+ };
12748
+ readonly 400: {
12749
+ readonly description: "Invalid request payload or unsupported workspace category.";
12750
+ readonly content: {
12751
+ readonly "application/json": {
12752
+ readonly schema: {
12753
+ readonly $ref: "#/components/schemas/ErrorResponse";
12754
+ };
12755
+ };
12756
+ };
12757
+ };
12758
+ readonly 401: {
12759
+ readonly description: "Unauthorized - Missing or invalid access token.";
12760
+ readonly content: {
12761
+ readonly "application/json": {
12762
+ readonly schema: {
12763
+ readonly $ref: "#/components/schemas/ErrorResponse";
12764
+ };
12765
+ };
12766
+ };
12767
+ };
12768
+ readonly 403: {
12769
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks write access to crm::customers resource.";
12770
+ readonly content: {
12771
+ readonly "application/json": {
12772
+ readonly schema: {
12773
+ readonly $ref: "#/components/schemas/ErrorResponse";
12774
+ };
12775
+ };
12776
+ };
12777
+ };
12778
+ readonly 404: {
12779
+ readonly description: "Workspace or invoice not found.";
12780
+ readonly content: {
12781
+ readonly "application/json": {
12782
+ readonly schema: {
12783
+ readonly $ref: "#/components/schemas/ErrorResponse";
12784
+ };
12785
+ };
12786
+ };
12787
+ };
12788
+ };
12789
+ };
12790
+ };
12791
+ readonly "/tags/list/{workspace}": {
12792
+ readonly get: {
12793
+ readonly tags: readonly [
12794
+ "Tags"
12795
+ ];
12796
+ readonly summary: "List tags by workspace";
12797
+ readonly description: "Returns all tags for the given workspace. Requires workspace access and read access to crm::tasks or crm::customers.";
12798
+ readonly security: readonly [
12799
+ never
12800
+ ];
12801
+ readonly parameters: readonly [
12802
+ {
12803
+ readonly name: "workspace";
12804
+ readonly in: "path";
12805
+ readonly required: true;
12806
+ readonly schema: {
12807
+ readonly type: "string";
12808
+ readonly format: "uuid";
12809
+ };
12810
+ readonly description: "Workspace identifier.";
12811
+ }
12812
+ ];
12813
+ readonly responses: {
12814
+ readonly 200: {
12815
+ readonly description: "Tags fetched successfully.";
12816
+ readonly content: {
12817
+ readonly "application/json": {
12818
+ readonly schema: {
12819
+ readonly $ref: "#/components/schemas/ListTagsSuccess";
12820
+ };
12821
+ };
12822
+ };
12823
+ };
12824
+ readonly 401: {
12825
+ readonly description: "Unauthorized - Missing or invalid access token.";
12826
+ readonly content: {
12827
+ readonly "application/json": {
12828
+ readonly schema: {
12829
+ readonly $ref: "#/components/schemas/ErrorResponse";
12830
+ };
12831
+ };
12832
+ };
12833
+ };
12834
+ readonly 403: {
12835
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or user lacks read access to both crm::tasks and crm::customers.";
12836
+ readonly content: {
12837
+ readonly "application/json": {
12838
+ readonly schema: {
12839
+ readonly $ref: "#/components/schemas/ErrorResponse";
12840
+ };
12841
+ };
12842
+ };
12843
+ };
12844
+ };
12845
+ };
12846
+ };
12847
+ readonly "/tags/create": {
12848
+ readonly post: {
12849
+ readonly tags: readonly [
12850
+ "Tags"
12147
12851
  ];
12148
12852
  readonly summary: "Create a tag";
12149
12853
  readonly description: "Creates a tag in the specified workspace. Requires workspace access and write access to crm::tasks or crm::customers.";
@@ -17694,6 +18398,210 @@ declare const routes: import("hono/hono-base").HonoBase<{
17694
18398
  };
17695
18399
  };
17696
18400
  }, "/billings"> | import("hono/types").MergeSchemaPath<{
18401
+ "/create": {
18402
+ $post: {
18403
+ input: {};
18404
+ output: {
18405
+ success: false;
18406
+ error: string;
18407
+ };
18408
+ outputFormat: "json";
18409
+ status: 404;
18410
+ } | {
18411
+ input: {};
18412
+ output: {
18413
+ success: false;
18414
+ error: string;
18415
+ };
18416
+ outputFormat: "json";
18417
+ status: 400;
18418
+ } | {
18419
+ input: {};
18420
+ output: {
18421
+ success: true;
18422
+ cinvoice: {
18423
+ id: string;
18424
+ created_at: string;
18425
+ invoiceId: string;
18426
+ workspaceId: string;
18427
+ created_by: string;
18428
+ customerId: string;
18429
+ serviceId: string;
18430
+ vatRate: number | null;
18431
+ SellerBillingId: string;
18432
+ date: string;
18433
+ language: string;
18434
+ currency: string;
18435
+ vatOption: string;
18436
+ unitName: string;
18437
+ unitPrice: number;
18438
+ unitQuantity: number;
18439
+ updated_at: string | null;
18440
+ deleted_at: string | null;
18441
+ verified_at: string | null;
18442
+ suspended_at: string | null;
18443
+ notes: string | null;
18444
+ buyerInn: string | null;
18445
+ buyerKpp: string | null;
18446
+ discount: number | null;
18447
+ }[];
18448
+ };
18449
+ outputFormat: "json";
18450
+ status: 201;
18451
+ };
18452
+ };
18453
+ } & {
18454
+ "/list/:workspace/:customerId": {
18455
+ $get: {
18456
+ input: {
18457
+ param: {
18458
+ workspace: string;
18459
+ } & {
18460
+ customerId: string;
18461
+ };
18462
+ };
18463
+ output: {
18464
+ success: false;
18465
+ error: string;
18466
+ };
18467
+ outputFormat: "json";
18468
+ status: 404;
18469
+ } | {
18470
+ input: {
18471
+ param: {
18472
+ workspace: string;
18473
+ } & {
18474
+ customerId: string;
18475
+ };
18476
+ };
18477
+ output: {
18478
+ success: false;
18479
+ error: string;
18480
+ };
18481
+ outputFormat: "json";
18482
+ status: 400;
18483
+ } | {
18484
+ input: {
18485
+ param: {
18486
+ workspace: string;
18487
+ } & {
18488
+ customerId: string;
18489
+ };
18490
+ };
18491
+ output: {
18492
+ success: true;
18493
+ cinvoices: {
18494
+ updated_at: string | null;
18495
+ deleted_at: string | null;
18496
+ verified_at: string | null;
18497
+ suspended_at: string | null;
18498
+ created_at: string;
18499
+ id: string;
18500
+ workspaceId: string;
18501
+ invoiceId: string;
18502
+ serviceId: string;
18503
+ SellerBillingId: string;
18504
+ customerId: string;
18505
+ date: string;
18506
+ language: string;
18507
+ currency: string;
18508
+ vatOption: string;
18509
+ vatRate: number | null;
18510
+ buyerInn: string | null;
18511
+ buyerKpp: string | null;
18512
+ unitName: string;
18513
+ unitPrice: number;
18514
+ unitQuantity: number;
18515
+ notes: string | null;
18516
+ discount: number | null;
18517
+ created_by: string;
18518
+ }[];
18519
+ };
18520
+ outputFormat: "json";
18521
+ status: 200;
18522
+ };
18523
+ };
18524
+ } & {
18525
+ "/update": {
18526
+ $post: {
18527
+ input: {};
18528
+ output: {
18529
+ success: false;
18530
+ error: string;
18531
+ };
18532
+ outputFormat: "json";
18533
+ status: 404;
18534
+ } | {
18535
+ input: {};
18536
+ output: {
18537
+ success: false;
18538
+ error: string;
18539
+ };
18540
+ outputFormat: "json";
18541
+ status: 400;
18542
+ } | {
18543
+ input: {};
18544
+ output: {
18545
+ success: true;
18546
+ cinvoice: {
18547
+ updated_at: string | null;
18548
+ deleted_at: string | null;
18549
+ verified_at: string | null;
18550
+ suspended_at: string | null;
18551
+ created_at: string;
18552
+ id: string;
18553
+ workspaceId: string;
18554
+ invoiceId: string;
18555
+ serviceId: string;
18556
+ SellerBillingId: string;
18557
+ customerId: string;
18558
+ date: string;
18559
+ language: string;
18560
+ currency: string;
18561
+ vatOption: string;
18562
+ vatRate: number | null;
18563
+ buyerInn: string | null;
18564
+ buyerKpp: string | null;
18565
+ unitName: string;
18566
+ unitPrice: number;
18567
+ unitQuantity: number;
18568
+ notes: string | null;
18569
+ discount: number | null;
18570
+ created_by: string;
18571
+ }[];
18572
+ };
18573
+ outputFormat: "json";
18574
+ status: 200;
18575
+ };
18576
+ };
18577
+ } & {
18578
+ "/delete": {
18579
+ $post: {
18580
+ input: {};
18581
+ output: {
18582
+ success: false;
18583
+ error: string;
18584
+ };
18585
+ outputFormat: "json";
18586
+ status: 404;
18587
+ } | {
18588
+ input: {};
18589
+ output: {
18590
+ success: false;
18591
+ error: string;
18592
+ };
18593
+ outputFormat: "json";
18594
+ status: 400;
18595
+ } | {
18596
+ input: {};
18597
+ output: {
18598
+ success: true;
18599
+ };
18600
+ outputFormat: "json";
18601
+ status: 200;
18602
+ };
18603
+ };
18604
+ }, "/cinvoices"> | import("hono/types").MergeSchemaPath<{
17697
18605
  "/list/:workspace": {
17698
18606
  $get: {
17699
18607
  input: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.140",
3
+ "version": "0.0.142",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,