@mestra-dev/contract 0.0.141 → 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 +529 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -4176,6 +4176,44 @@ declare const routes: import("hono/hono-base").HonoBase<{
4176
4176
  };
4177
4177
  };
4178
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
+ };
4179
4217
  readonly BillingInterval: {
4180
4218
  readonly type: "string";
4181
4219
  readonly enum: readonly [
@@ -12410,6 +12448,346 @@ declare const routes: import("hono/hono-base").HonoBase<{
12410
12448
  };
12411
12449
  };
12412
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
+ };
12413
12791
  readonly "/tags/list/{workspace}": {
12414
12792
  readonly get: {
12415
12793
  readonly tags: readonly [
@@ -18072,6 +18450,157 @@ declare const routes: import("hono/hono-base").HonoBase<{
18072
18450
  status: 201;
18073
18451
  };
18074
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
+ };
18075
18604
  }, "/cinvoices"> | import("hono/types").MergeSchemaPath<{
18076
18605
  "/list/:workspace": {
18077
18606
  $get: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.141",
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,