@mestra-dev/contract 0.0.208 → 0.0.209

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 +1147 -173
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { ApplyGlobalResponse } from 'hono/client';
2
2
  import type { JwtVariables } from 'hono/jwt';
3
3
 
4
4
  type GrowthDirection = "positive" | "negative" | "none";
5
+ type FinanceCurrency = "ruble" | "dollar" | "euro";
5
6
  type Variables = JwtVariables;
6
7
  /** Shared error body for middleware / HTTPException responses (typed into AppType). */
7
8
  export type ApiError = {
@@ -28,7 +29,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
28
29
  readonly info: {
29
30
  readonly title: "Auth Service API";
30
31
  readonly version: "1.5.12";
31
- readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Analytics, Tasks, Templates, Tags, Failure Reasons, 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).";
32
+ readonly description: "OpenAPI specification for the Auth, Integrations, Workspace, Payments, Analytics, Tasks, Templates, Tags, Failure Reasons, Comments, Assignees, Chat, Events, Billings, CInvoices, Customer History, Files, Finance, 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).";
32
33
  };
33
34
  readonly servers: readonly [
34
35
  {
@@ -124,6 +125,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
124
125
  {
125
126
  readonly name: "Notifications";
126
127
  readonly description: "Cursor-based incremental notification sync, plus mark-read / archive (single or all). Clients store the sync cursor and pass it on the next call; mutations bump updated_at so changes propagate via sync.";
128
+ },
129
+ {
130
+ readonly name: "Finance";
131
+ readonly description: "Workspace finance accounts (ordered cards with name, color, currency, and opening balance) and a numbers-visibility toggle for the default finance view. Requires workspace access and crm::finance read or write.";
127
132
  }
128
133
  ];
129
134
  readonly components: {
@@ -5793,6 +5798,115 @@ declare const routes: import("hono/hono-base").HonoBase<{
5793
5798
  };
5794
5799
  };
5795
5800
  };
5801
+ readonly FinanceAccount: {
5802
+ readonly type: "object";
5803
+ readonly required: readonly [
5804
+ "id",
5805
+ "workspaceId",
5806
+ "order",
5807
+ "name",
5808
+ "cardColor",
5809
+ "currency",
5810
+ "openingBalance",
5811
+ "created_at"
5812
+ ];
5813
+ readonly properties: {
5814
+ readonly id: {
5815
+ readonly type: "string";
5816
+ readonly format: "uuid";
5817
+ };
5818
+ readonly workspaceId: {
5819
+ readonly type: "string";
5820
+ readonly format: "uuid";
5821
+ };
5822
+ readonly order: {
5823
+ readonly type: "integer";
5824
+ readonly minimum: 1;
5825
+ readonly description: "1-based display order for the frontend account list.";
5826
+ };
5827
+ readonly name: {
5828
+ readonly type: "string";
5829
+ };
5830
+ readonly cardColor: {
5831
+ readonly type: "string";
5832
+ readonly example: "#A1B2C3";
5833
+ readonly description: "Normalized 6-digit hex color including #.";
5834
+ };
5835
+ readonly currency: {
5836
+ readonly type: "string";
5837
+ readonly enum: readonly [
5838
+ "ruble",
5839
+ "dollar",
5840
+ "euro"
5841
+ ];
5842
+ };
5843
+ readonly openingBalance: {
5844
+ readonly type: "number";
5845
+ readonly description: "Opening balance in the account currency.";
5846
+ };
5847
+ readonly created_at: {
5848
+ readonly type: "string";
5849
+ readonly format: "date-time";
5850
+ };
5851
+ readonly updated_at: {
5852
+ readonly type: "string";
5853
+ readonly format: "date-time";
5854
+ readonly nullable: true;
5855
+ };
5856
+ };
5857
+ };
5858
+ readonly FinanceAccountSuccess: {
5859
+ readonly type: "object";
5860
+ readonly required: readonly [
5861
+ "success",
5862
+ "account"
5863
+ ];
5864
+ readonly properties: {
5865
+ readonly success: {
5866
+ readonly type: "boolean";
5867
+ readonly const: true;
5868
+ };
5869
+ readonly account: {
5870
+ readonly $ref: "#/components/schemas/FinanceAccount";
5871
+ };
5872
+ };
5873
+ };
5874
+ readonly ListFinanceAccountsSuccess: {
5875
+ readonly type: "object";
5876
+ readonly required: readonly [
5877
+ "success",
5878
+ "accounts"
5879
+ ];
5880
+ readonly properties: {
5881
+ readonly success: {
5882
+ readonly type: "boolean";
5883
+ readonly const: true;
5884
+ };
5885
+ readonly accounts: {
5886
+ readonly type: "array";
5887
+ readonly items: {
5888
+ readonly $ref: "#/components/schemas/FinanceAccount";
5889
+ };
5890
+ };
5891
+ };
5892
+ };
5893
+ readonly FinanceVisibilitySuccess: {
5894
+ readonly type: "object";
5895
+ readonly required: readonly [
5896
+ "success",
5897
+ "visibility"
5898
+ ];
5899
+ readonly properties: {
5900
+ readonly success: {
5901
+ readonly type: "boolean";
5902
+ readonly const: true;
5903
+ };
5904
+ readonly visibility: {
5905
+ readonly type: "boolean";
5906
+ readonly description: "When true, the frontend should disclose account numbers in the default finance view.";
5907
+ };
5908
+ };
5909
+ };
5796
5910
  };
5797
5911
  };
5798
5912
  readonly paths: {
@@ -19471,176 +19585,807 @@ declare const routes: import("hono/hono-base").HonoBase<{
19471
19585
  };
19472
19586
  };
19473
19587
  };
19474
- };
19475
- };
19476
- outputFormat: "json";
19477
- status: import("hono/utils/http-status").ContentfulStatusCode;
19478
- };
19479
- };
19480
- } & {
19481
- "/docs": {
19482
- $get: {
19483
- input: {};
19484
- output: {};
19485
- outputFormat: string;
19486
- status: import("hono/utils/http-status").StatusCode;
19487
- };
19488
- };
19489
- } & {
19490
- "/health": {
19491
- $get: {
19492
- input: {};
19493
- output: {
19494
- status: string;
19495
- };
19496
- outputFormat: "json";
19497
- status: import("hono/utils/http-status").ContentfulStatusCode;
19498
- };
19499
- };
19500
- } & {
19501
- "/": {
19502
- $get: {
19503
- input: {};
19504
- output: {
19505
- message: string;
19506
- link: string;
19507
- };
19508
- outputFormat: "json";
19509
- status: import("hono/utils/http-status").ContentfulStatusCode;
19510
- };
19511
- };
19512
- }) | import("hono/types").MergeSchemaPath<{
19513
- "/stream": {
19514
- $get: {
19515
- input: {};
19516
- output: {};
19517
- outputFormat: string;
19518
- status: import("hono/utils/http-status").StatusCode;
19519
- };
19520
- };
19521
- }, "/event"> | import("hono/types").MergeSchemaPath<{
19522
- "/vk": {
19523
- $get: {
19524
- input: {};
19525
- output: undefined;
19526
- outputFormat: "redirect";
19527
- status: 302;
19528
- };
19529
- };
19530
- } & {
19531
- "/vk/callback": {
19532
- $get: {
19533
- input: {};
19534
- output: undefined;
19535
- outputFormat: "redirect";
19536
- status: 302;
19537
- } | {
19538
- input: {};
19539
- output: {
19540
- success: false;
19541
- error: string;
19542
- };
19543
- outputFormat: "json";
19544
- status: 400;
19545
- } | {
19546
- input: {};
19547
- output: {
19548
- success: false;
19549
- error: string;
19550
- };
19551
- outputFormat: "json";
19552
- status: 500;
19553
- };
19554
- };
19555
- } & {
19556
- "/google": {
19557
- $get: {
19558
- input: {};
19559
- output: undefined;
19560
- outputFormat: "redirect";
19561
- status: 302;
19562
- };
19563
- };
19564
- } & {
19565
- "/google/callback": {
19566
- $get: {
19567
- input: {};
19568
- output: undefined;
19569
- outputFormat: "redirect";
19570
- status: 302;
19571
- } | {
19572
- input: {};
19573
- output: {
19574
- success: false;
19575
- error: string;
19576
- };
19577
- outputFormat: "json";
19578
- status: 400;
19579
- } | {
19580
- input: {};
19581
- output: {
19582
- success: false;
19583
- error: string;
19584
- };
19585
- outputFormat: "json";
19586
- status: 500;
19587
- };
19588
- };
19589
- } & {
19590
- "/request-otp": {
19591
- $post: {
19592
- input: {};
19593
- output: {
19594
- success: false;
19595
- error: never;
19596
- };
19597
- outputFormat: "json";
19598
- status: 400;
19599
- } | {
19600
- input: {};
19601
- output: {
19602
- success: boolean;
19603
- expiresAt: any;
19604
- };
19605
- outputFormat: "json";
19606
- status: 200 | 400;
19607
- };
19608
- };
19609
- } & {
19610
- "/verify-otp": {
19611
- $post: {
19612
- input: {};
19613
- output: {
19614
- success: boolean;
19615
- error: string | undefined;
19616
- };
19617
- outputFormat: "json";
19618
- status: 200 | 400;
19619
- } | {
19620
- input: {};
19621
- output: {
19622
- success: boolean;
19623
- accessToken: string | null;
19624
- refreshToken: string | null;
19625
- };
19626
- outputFormat: "json";
19627
- status: 200 | 400;
19628
- };
19629
- };
19630
- } & {
19631
- "/request-sms-otp": {
19632
- $post: {
19633
- input: {};
19634
- output: {
19635
- success: false;
19636
- error: never;
19637
- };
19638
- outputFormat: "json";
19639
- status: 400;
19640
- } | {
19641
- input: {};
19642
- output: {
19643
- success: boolean;
19588
+ readonly "/finance/accounts/list/{workspace}": {
19589
+ readonly get: {
19590
+ readonly tags: readonly [
19591
+ "Finance"
19592
+ ];
19593
+ readonly summary: "List finance accounts";
19594
+ readonly description: "Returns workspace finance accounts ordered by display order. Requires crm::finance read access.";
19595
+ readonly security: readonly [
19596
+ never
19597
+ ];
19598
+ readonly parameters: readonly [
19599
+ {
19600
+ readonly name: "workspace";
19601
+ readonly in: "path";
19602
+ readonly required: true;
19603
+ readonly schema: {
19604
+ readonly type: "string";
19605
+ readonly format: "uuid";
19606
+ };
19607
+ }
19608
+ ];
19609
+ readonly responses: {
19610
+ readonly 200: {
19611
+ readonly description: "Accounts fetched successfully.";
19612
+ readonly content: {
19613
+ readonly "application/json": {
19614
+ readonly schema: {
19615
+ readonly $ref: "#/components/schemas/ListFinanceAccountsSuccess";
19616
+ };
19617
+ };
19618
+ };
19619
+ };
19620
+ readonly 401: {
19621
+ readonly description: "Unauthorized.";
19622
+ readonly content: {
19623
+ readonly "application/json": {
19624
+ readonly schema: {
19625
+ readonly $ref: "#/components/schemas/ErrorResponse";
19626
+ };
19627
+ };
19628
+ };
19629
+ };
19630
+ readonly 403: {
19631
+ readonly description: "Forbidden - missing workspace or crm::finance access.";
19632
+ readonly content: {
19633
+ readonly "application/json": {
19634
+ readonly schema: {
19635
+ readonly $ref: "#/components/schemas/ErrorResponse";
19636
+ };
19637
+ };
19638
+ };
19639
+ };
19640
+ };
19641
+ };
19642
+ };
19643
+ readonly "/finance/accounts/get/{workspace}/{accountId}": {
19644
+ readonly get: {
19645
+ readonly tags: readonly [
19646
+ "Finance"
19647
+ ];
19648
+ readonly summary: "Get a finance account";
19649
+ readonly description: "Returns a single finance account. Requires crm::finance read access.";
19650
+ readonly security: readonly [
19651
+ never
19652
+ ];
19653
+ readonly parameters: readonly [
19654
+ {
19655
+ readonly name: "workspace";
19656
+ readonly in: "path";
19657
+ readonly required: true;
19658
+ readonly schema: {
19659
+ readonly type: "string";
19660
+ readonly format: "uuid";
19661
+ };
19662
+ },
19663
+ {
19664
+ readonly name: "accountId";
19665
+ readonly in: "path";
19666
+ readonly required: true;
19667
+ readonly schema: {
19668
+ readonly type: "string";
19669
+ readonly format: "uuid";
19670
+ };
19671
+ }
19672
+ ];
19673
+ readonly responses: {
19674
+ readonly 200: {
19675
+ readonly description: "Account fetched successfully.";
19676
+ readonly content: {
19677
+ readonly "application/json": {
19678
+ readonly schema: {
19679
+ readonly $ref: "#/components/schemas/FinanceAccountSuccess";
19680
+ };
19681
+ };
19682
+ };
19683
+ };
19684
+ readonly 401: {
19685
+ readonly description: "Unauthorized.";
19686
+ readonly content: {
19687
+ readonly "application/json": {
19688
+ readonly schema: {
19689
+ readonly $ref: "#/components/schemas/ErrorResponse";
19690
+ };
19691
+ };
19692
+ };
19693
+ };
19694
+ readonly 403: {
19695
+ readonly description: "Forbidden - missing workspace or crm::finance access.";
19696
+ readonly content: {
19697
+ readonly "application/json": {
19698
+ readonly schema: {
19699
+ readonly $ref: "#/components/schemas/ErrorResponse";
19700
+ };
19701
+ };
19702
+ };
19703
+ };
19704
+ readonly 404: {
19705
+ readonly description: "Account not found.";
19706
+ readonly content: {
19707
+ readonly "application/json": {
19708
+ readonly schema: {
19709
+ readonly $ref: "#/components/schemas/ErrorResponse";
19710
+ };
19711
+ };
19712
+ };
19713
+ };
19714
+ };
19715
+ };
19716
+ };
19717
+ readonly "/finance/accounts/create": {
19718
+ readonly post: {
19719
+ readonly tags: readonly [
19720
+ "Finance"
19721
+ ];
19722
+ readonly summary: "Create a finance account";
19723
+ readonly description: "Creates an account and assigns the next display order (1, 2, 3, \u2026). Requires crm::finance write access.";
19724
+ readonly security: readonly [
19725
+ never
19726
+ ];
19727
+ readonly requestBody: {
19728
+ readonly required: true;
19729
+ readonly content: {
19730
+ readonly "application/json": {
19731
+ readonly schema: {
19732
+ readonly type: "object";
19733
+ readonly required: readonly [
19734
+ "workspace",
19735
+ "name",
19736
+ "cardColor",
19737
+ "currency",
19738
+ "openingBalance"
19739
+ ];
19740
+ readonly properties: {
19741
+ readonly workspace: {
19742
+ readonly type: "string";
19743
+ readonly format: "uuid";
19744
+ };
19745
+ readonly name: {
19746
+ readonly type: "string";
19747
+ };
19748
+ readonly cardColor: {
19749
+ readonly type: "string";
19750
+ readonly description: "6-digit hex color, with or without #.";
19751
+ };
19752
+ readonly currency: {
19753
+ readonly type: "string";
19754
+ readonly enum: readonly [
19755
+ "ruble",
19756
+ "dollar",
19757
+ "euro"
19758
+ ];
19759
+ };
19760
+ readonly openingBalance: {
19761
+ readonly type: "number";
19762
+ };
19763
+ };
19764
+ };
19765
+ };
19766
+ };
19767
+ };
19768
+ readonly responses: {
19769
+ readonly 201: {
19770
+ readonly description: "Account created successfully.";
19771
+ readonly content: {
19772
+ readonly "application/json": {
19773
+ readonly schema: {
19774
+ readonly $ref: "#/components/schemas/FinanceAccountSuccess";
19775
+ };
19776
+ };
19777
+ };
19778
+ };
19779
+ readonly 400: {
19780
+ readonly description: "Invalid request payload.";
19781
+ readonly content: {
19782
+ readonly "application/json": {
19783
+ readonly schema: {
19784
+ readonly $ref: "#/components/schemas/ErrorResponse";
19785
+ };
19786
+ };
19787
+ };
19788
+ };
19789
+ readonly 401: {
19790
+ readonly description: "Unauthorized.";
19791
+ readonly content: {
19792
+ readonly "application/json": {
19793
+ readonly schema: {
19794
+ readonly $ref: "#/components/schemas/ErrorResponse";
19795
+ };
19796
+ };
19797
+ };
19798
+ };
19799
+ readonly 403: {
19800
+ readonly description: "Forbidden - missing workspace or crm::finance write access.";
19801
+ readonly content: {
19802
+ readonly "application/json": {
19803
+ readonly schema: {
19804
+ readonly $ref: "#/components/schemas/ErrorResponse";
19805
+ };
19806
+ };
19807
+ };
19808
+ };
19809
+ };
19810
+ };
19811
+ };
19812
+ readonly "/finance/accounts/update": {
19813
+ readonly post: {
19814
+ readonly tags: readonly [
19815
+ "Finance"
19816
+ ];
19817
+ readonly summary: "Update a finance account";
19818
+ readonly description: "Updates name, card color, currency, and/or opening balance. Requires crm::finance write access.";
19819
+ readonly security: readonly [
19820
+ never
19821
+ ];
19822
+ readonly requestBody: {
19823
+ readonly required: true;
19824
+ readonly content: {
19825
+ readonly "application/json": {
19826
+ readonly schema: {
19827
+ readonly type: "object";
19828
+ readonly required: readonly [
19829
+ "accountId",
19830
+ "workspace"
19831
+ ];
19832
+ readonly properties: {
19833
+ readonly accountId: {
19834
+ readonly type: "string";
19835
+ readonly format: "uuid";
19836
+ };
19837
+ readonly workspace: {
19838
+ readonly type: "string";
19839
+ readonly format: "uuid";
19840
+ };
19841
+ readonly name: {
19842
+ readonly type: "string";
19843
+ };
19844
+ readonly cardColor: {
19845
+ readonly type: "string";
19846
+ };
19847
+ readonly currency: {
19848
+ readonly type: "string";
19849
+ readonly enum: readonly [
19850
+ "ruble",
19851
+ "dollar",
19852
+ "euro"
19853
+ ];
19854
+ };
19855
+ readonly openingBalance: {
19856
+ readonly type: "number";
19857
+ };
19858
+ };
19859
+ };
19860
+ };
19861
+ };
19862
+ };
19863
+ readonly responses: {
19864
+ readonly 200: {
19865
+ readonly description: "Account updated successfully.";
19866
+ readonly content: {
19867
+ readonly "application/json": {
19868
+ readonly schema: {
19869
+ readonly $ref: "#/components/schemas/FinanceAccountSuccess";
19870
+ };
19871
+ };
19872
+ };
19873
+ };
19874
+ readonly 400: {
19875
+ readonly description: "Invalid request payload.";
19876
+ readonly content: {
19877
+ readonly "application/json": {
19878
+ readonly schema: {
19879
+ readonly $ref: "#/components/schemas/ErrorResponse";
19880
+ };
19881
+ };
19882
+ };
19883
+ };
19884
+ readonly 401: {
19885
+ readonly description: "Unauthorized.";
19886
+ readonly content: {
19887
+ readonly "application/json": {
19888
+ readonly schema: {
19889
+ readonly $ref: "#/components/schemas/ErrorResponse";
19890
+ };
19891
+ };
19892
+ };
19893
+ };
19894
+ readonly 403: {
19895
+ readonly description: "Forbidden - missing workspace or crm::finance write access.";
19896
+ readonly content: {
19897
+ readonly "application/json": {
19898
+ readonly schema: {
19899
+ readonly $ref: "#/components/schemas/ErrorResponse";
19900
+ };
19901
+ };
19902
+ };
19903
+ };
19904
+ readonly 404: {
19905
+ readonly description: "Account not found.";
19906
+ readonly content: {
19907
+ readonly "application/json": {
19908
+ readonly schema: {
19909
+ readonly $ref: "#/components/schemas/ErrorResponse";
19910
+ };
19911
+ };
19912
+ };
19913
+ };
19914
+ };
19915
+ };
19916
+ };
19917
+ readonly "/finance/accounts/reorder": {
19918
+ readonly post: {
19919
+ readonly tags: readonly [
19920
+ "Finance"
19921
+ ];
19922
+ readonly summary: "Reorder finance accounts";
19923
+ readonly description: "Sets display order to 1..n from the given accountIds list. The list must contain every workspace account exactly once. Requires crm::finance write access.";
19924
+ readonly security: readonly [
19925
+ never
19926
+ ];
19927
+ readonly requestBody: {
19928
+ readonly required: true;
19929
+ readonly content: {
19930
+ readonly "application/json": {
19931
+ readonly schema: {
19932
+ readonly type: "object";
19933
+ readonly required: readonly [
19934
+ "workspace",
19935
+ "accountIds"
19936
+ ];
19937
+ readonly properties: {
19938
+ readonly workspace: {
19939
+ readonly type: "string";
19940
+ readonly format: "uuid";
19941
+ };
19942
+ readonly accountIds: {
19943
+ readonly type: "array";
19944
+ readonly items: {
19945
+ readonly type: "string";
19946
+ readonly format: "uuid";
19947
+ };
19948
+ readonly minItems: 1;
19949
+ };
19950
+ };
19951
+ };
19952
+ };
19953
+ };
19954
+ };
19955
+ readonly responses: {
19956
+ readonly 200: {
19957
+ readonly description: "Accounts reordered successfully.";
19958
+ readonly content: {
19959
+ readonly "application/json": {
19960
+ readonly schema: {
19961
+ readonly $ref: "#/components/schemas/ListFinanceAccountsSuccess";
19962
+ };
19963
+ };
19964
+ };
19965
+ };
19966
+ readonly 400: {
19967
+ readonly description: "Invalid request payload or incomplete accountIds list.";
19968
+ readonly content: {
19969
+ readonly "application/json": {
19970
+ readonly schema: {
19971
+ readonly $ref: "#/components/schemas/ErrorResponse";
19972
+ };
19973
+ };
19974
+ };
19975
+ };
19976
+ readonly 401: {
19977
+ readonly description: "Unauthorized.";
19978
+ readonly content: {
19979
+ readonly "application/json": {
19980
+ readonly schema: {
19981
+ readonly $ref: "#/components/schemas/ErrorResponse";
19982
+ };
19983
+ };
19984
+ };
19985
+ };
19986
+ readonly 403: {
19987
+ readonly description: "Forbidden - missing workspace or crm::finance write access.";
19988
+ readonly content: {
19989
+ readonly "application/json": {
19990
+ readonly schema: {
19991
+ readonly $ref: "#/components/schemas/ErrorResponse";
19992
+ };
19993
+ };
19994
+ };
19995
+ };
19996
+ };
19997
+ };
19998
+ };
19999
+ readonly "/finance/accounts/delete": {
20000
+ readonly post: {
20001
+ readonly tags: readonly [
20002
+ "Finance"
20003
+ ];
20004
+ readonly summary: "Delete a finance account";
20005
+ readonly description: "Deletes an account and compact remaining display orders. Requires crm::finance write access. Available in frozen Free-trial workspaces.";
20006
+ readonly security: readonly [
20007
+ never
20008
+ ];
20009
+ readonly requestBody: {
20010
+ readonly required: true;
20011
+ readonly content: {
20012
+ readonly "application/json": {
20013
+ readonly schema: {
20014
+ readonly type: "object";
20015
+ readonly required: readonly [
20016
+ "accountId",
20017
+ "workspace"
20018
+ ];
20019
+ readonly properties: {
20020
+ readonly accountId: {
20021
+ readonly type: "string";
20022
+ readonly format: "uuid";
20023
+ };
20024
+ readonly workspace: {
20025
+ readonly type: "string";
20026
+ readonly format: "uuid";
20027
+ };
20028
+ };
20029
+ };
20030
+ };
20031
+ };
20032
+ };
20033
+ readonly responses: {
20034
+ readonly 200: {
20035
+ readonly description: "Account deleted successfully.";
20036
+ readonly content: {
20037
+ readonly "application/json": {
20038
+ readonly schema: {
20039
+ readonly $ref: "#/components/schemas/SimpleSuccess";
20040
+ };
20041
+ };
20042
+ };
20043
+ };
20044
+ readonly 400: {
20045
+ readonly description: "Invalid request payload.";
20046
+ readonly content: {
20047
+ readonly "application/json": {
20048
+ readonly schema: {
20049
+ readonly $ref: "#/components/schemas/ErrorResponse";
20050
+ };
20051
+ };
20052
+ };
20053
+ };
20054
+ readonly 401: {
20055
+ readonly description: "Unauthorized.";
20056
+ readonly content: {
20057
+ readonly "application/json": {
20058
+ readonly schema: {
20059
+ readonly $ref: "#/components/schemas/ErrorResponse";
20060
+ };
20061
+ };
20062
+ };
20063
+ };
20064
+ readonly 403: {
20065
+ readonly description: "Forbidden - missing workspace or crm::finance write access.";
20066
+ readonly content: {
20067
+ readonly "application/json": {
20068
+ readonly schema: {
20069
+ readonly $ref: "#/components/schemas/ErrorResponse";
20070
+ };
20071
+ };
20072
+ };
20073
+ };
20074
+ readonly 404: {
20075
+ readonly description: "Account not found.";
20076
+ readonly content: {
20077
+ readonly "application/json": {
20078
+ readonly schema: {
20079
+ readonly $ref: "#/components/schemas/ErrorResponse";
20080
+ };
20081
+ };
20082
+ };
20083
+ };
20084
+ };
20085
+ };
20086
+ };
20087
+ readonly "/finance/visibility/{workspace}": {
20088
+ readonly get: {
20089
+ readonly tags: readonly [
20090
+ "Finance"
20091
+ ];
20092
+ readonly summary: "Get finance numbers visibility";
20093
+ readonly description: "Returns whether the frontend should disclose account numbers in the default finance view. Defaults to true when unset. Requires crm::finance read access.";
20094
+ readonly security: readonly [
20095
+ never
20096
+ ];
20097
+ readonly parameters: readonly [
20098
+ {
20099
+ readonly name: "workspace";
20100
+ readonly in: "path";
20101
+ readonly required: true;
20102
+ readonly schema: {
20103
+ readonly type: "string";
20104
+ readonly format: "uuid";
20105
+ };
20106
+ }
20107
+ ];
20108
+ readonly responses: {
20109
+ readonly 200: {
20110
+ readonly description: "Visibility fetched successfully.";
20111
+ readonly content: {
20112
+ readonly "application/json": {
20113
+ readonly schema: {
20114
+ readonly $ref: "#/components/schemas/FinanceVisibilitySuccess";
20115
+ };
20116
+ };
20117
+ };
20118
+ };
20119
+ readonly 401: {
20120
+ readonly description: "Unauthorized.";
20121
+ readonly content: {
20122
+ readonly "application/json": {
20123
+ readonly schema: {
20124
+ readonly $ref: "#/components/schemas/ErrorResponse";
20125
+ };
20126
+ };
20127
+ };
20128
+ };
20129
+ readonly 403: {
20130
+ readonly description: "Forbidden - missing workspace or crm::finance access.";
20131
+ readonly content: {
20132
+ readonly "application/json": {
20133
+ readonly schema: {
20134
+ readonly $ref: "#/components/schemas/ErrorResponse";
20135
+ };
20136
+ };
20137
+ };
20138
+ };
20139
+ };
20140
+ };
20141
+ };
20142
+ readonly "/finance/visibility": {
20143
+ readonly post: {
20144
+ readonly tags: readonly [
20145
+ "Finance"
20146
+ ];
20147
+ readonly summary: "Set finance numbers visibility";
20148
+ readonly description: "Sets whether the frontend should disclose account numbers in the default finance view. Requires crm::finance write access.";
20149
+ readonly security: readonly [
20150
+ never
20151
+ ];
20152
+ readonly requestBody: {
20153
+ readonly required: true;
20154
+ readonly content: {
20155
+ readonly "application/json": {
20156
+ readonly schema: {
20157
+ readonly type: "object";
20158
+ readonly required: readonly [
20159
+ "workspace",
20160
+ "visibility"
20161
+ ];
20162
+ readonly properties: {
20163
+ readonly workspace: {
20164
+ readonly type: "string";
20165
+ readonly format: "uuid";
20166
+ };
20167
+ readonly visibility: {
20168
+ readonly type: "boolean";
20169
+ };
20170
+ };
20171
+ };
20172
+ };
20173
+ };
20174
+ };
20175
+ readonly responses: {
20176
+ readonly 200: {
20177
+ readonly description: "Visibility updated successfully.";
20178
+ readonly content: {
20179
+ readonly "application/json": {
20180
+ readonly schema: {
20181
+ readonly $ref: "#/components/schemas/FinanceVisibilitySuccess";
20182
+ };
20183
+ };
20184
+ };
20185
+ };
20186
+ readonly 400: {
20187
+ readonly description: "Invalid request payload.";
20188
+ readonly content: {
20189
+ readonly "application/json": {
20190
+ readonly schema: {
20191
+ readonly $ref: "#/components/schemas/ErrorResponse";
20192
+ };
20193
+ };
20194
+ };
20195
+ };
20196
+ readonly 401: {
20197
+ readonly description: "Unauthorized.";
20198
+ readonly content: {
20199
+ readonly "application/json": {
20200
+ readonly schema: {
20201
+ readonly $ref: "#/components/schemas/ErrorResponse";
20202
+ };
20203
+ };
20204
+ };
20205
+ };
20206
+ readonly 403: {
20207
+ readonly description: "Forbidden - missing workspace or crm::finance write access.";
20208
+ readonly content: {
20209
+ readonly "application/json": {
20210
+ readonly schema: {
20211
+ readonly $ref: "#/components/schemas/ErrorResponse";
20212
+ };
20213
+ };
20214
+ };
20215
+ };
20216
+ };
20217
+ };
20218
+ };
20219
+ };
20220
+ };
20221
+ outputFormat: "json";
20222
+ status: import("hono/utils/http-status").ContentfulStatusCode;
20223
+ };
20224
+ };
20225
+ } & {
20226
+ "/docs": {
20227
+ $get: {
20228
+ input: {};
20229
+ output: {};
20230
+ outputFormat: string;
20231
+ status: import("hono/utils/http-status").StatusCode;
20232
+ };
20233
+ };
20234
+ } & {
20235
+ "/health": {
20236
+ $get: {
20237
+ input: {};
20238
+ output: {
20239
+ status: string;
20240
+ };
20241
+ outputFormat: "json";
20242
+ status: import("hono/utils/http-status").ContentfulStatusCode;
20243
+ };
20244
+ };
20245
+ } & {
20246
+ "/": {
20247
+ $get: {
20248
+ input: {};
20249
+ output: {
20250
+ message: string;
20251
+ link: string;
20252
+ };
20253
+ outputFormat: "json";
20254
+ status: import("hono/utils/http-status").ContentfulStatusCode;
20255
+ };
20256
+ };
20257
+ }) | import("hono/types").MergeSchemaPath<{
20258
+ "/stream": {
20259
+ $get: {
20260
+ input: {};
20261
+ output: {};
20262
+ outputFormat: string;
20263
+ status: import("hono/utils/http-status").StatusCode;
20264
+ };
20265
+ };
20266
+ }, "/event"> | import("hono/types").MergeSchemaPath<{
20267
+ "/vk": {
20268
+ $get: {
20269
+ input: {};
20270
+ output: undefined;
20271
+ outputFormat: "redirect";
20272
+ status: 302;
20273
+ };
20274
+ };
20275
+ } & {
20276
+ "/vk/callback": {
20277
+ $get: {
20278
+ input: {};
20279
+ output: undefined;
20280
+ outputFormat: "redirect";
20281
+ status: 302;
20282
+ } | {
20283
+ input: {};
20284
+ output: {
20285
+ success: false;
20286
+ error: string;
20287
+ };
20288
+ outputFormat: "json";
20289
+ status: 400;
20290
+ } | {
20291
+ input: {};
20292
+ output: {
20293
+ success: false;
20294
+ error: string;
20295
+ };
20296
+ outputFormat: "json";
20297
+ status: 500;
20298
+ };
20299
+ };
20300
+ } & {
20301
+ "/google": {
20302
+ $get: {
20303
+ input: {};
20304
+ output: undefined;
20305
+ outputFormat: "redirect";
20306
+ status: 302;
20307
+ };
20308
+ };
20309
+ } & {
20310
+ "/google/callback": {
20311
+ $get: {
20312
+ input: {};
20313
+ output: undefined;
20314
+ outputFormat: "redirect";
20315
+ status: 302;
20316
+ } | {
20317
+ input: {};
20318
+ output: {
20319
+ success: false;
20320
+ error: string;
20321
+ };
20322
+ outputFormat: "json";
20323
+ status: 400;
20324
+ } | {
20325
+ input: {};
20326
+ output: {
20327
+ success: false;
20328
+ error: string;
20329
+ };
20330
+ outputFormat: "json";
20331
+ status: 500;
20332
+ };
20333
+ };
20334
+ } & {
20335
+ "/request-otp": {
20336
+ $post: {
20337
+ input: {};
20338
+ output: {
20339
+ success: false;
20340
+ error: never;
20341
+ };
20342
+ outputFormat: "json";
20343
+ status: 400;
20344
+ } | {
20345
+ input: {};
20346
+ output: {
20347
+ success: boolean;
20348
+ expiresAt: any;
20349
+ };
20350
+ outputFormat: "json";
20351
+ status: 200 | 400;
20352
+ };
20353
+ };
20354
+ } & {
20355
+ "/verify-otp": {
20356
+ $post: {
20357
+ input: {};
20358
+ output: {
20359
+ success: boolean;
20360
+ error: string | undefined;
20361
+ };
20362
+ outputFormat: "json";
20363
+ status: 200 | 400;
20364
+ } | {
20365
+ input: {};
20366
+ output: {
20367
+ success: boolean;
20368
+ accessToken: string | null;
20369
+ refreshToken: string | null;
20370
+ };
20371
+ outputFormat: "json";
20372
+ status: 200 | 400;
20373
+ };
20374
+ };
20375
+ } & {
20376
+ "/request-sms-otp": {
20377
+ $post: {
20378
+ input: {};
20379
+ output: {
20380
+ success: false;
20381
+ error: never;
20382
+ };
20383
+ outputFormat: "json";
20384
+ status: 400;
20385
+ } | {
20386
+ input: {};
20387
+ output: {
20388
+ success: boolean;
19644
20389
  expiresAt: any;
19645
20390
  };
19646
20391
  outputFormat: "json";
@@ -20827,12 +21572,12 @@ declare const routes: import("hono/hono-base").HonoBase<{
20827
21572
  created_by: string;
20828
21573
  customerId: string | null;
20829
21574
  phaseId: string | null;
21575
+ visibility: string | null;
20830
21576
  updated_at: string | null;
20831
21577
  deleted_at: string | null;
20832
21578
  verified_at: string | null;
20833
21579
  suspended_at: string | null;
20834
21580
  priority: string | null;
20835
- visibility: string | null;
20836
21581
  };
20837
21582
  };
20838
21583
  outputFormat: "json";
@@ -28292,7 +29037,236 @@ declare const routes: import("hono/hono-base").HonoBase<{
28292
29037
  status: 200;
28293
29038
  };
28294
29039
  };
28295
- }, "/analytics">, "/", "/">;
29040
+ }, "/analytics"> | import("hono/types").MergeSchemaPath<{
29041
+ "/accounts/list/:workspace": {
29042
+ $get: {
29043
+ input: {
29044
+ param: {
29045
+ workspace: string;
29046
+ };
29047
+ };
29048
+ output: {
29049
+ success: true;
29050
+ accounts: {
29051
+ id: string;
29052
+ workspaceId: string;
29053
+ order: number;
29054
+ name: string;
29055
+ cardColor: string;
29056
+ currency: FinanceCurrency;
29057
+ openingBalance: number;
29058
+ created_at: string;
29059
+ updated_at: string | null;
29060
+ }[];
29061
+ };
29062
+ outputFormat: "json";
29063
+ status: 200;
29064
+ };
29065
+ };
29066
+ } & {
29067
+ "/accounts/get/:workspace/:accountId": {
29068
+ $get: {
29069
+ input: {
29070
+ param: {
29071
+ workspace: string;
29072
+ } & {
29073
+ accountId: string;
29074
+ };
29075
+ };
29076
+ output: {
29077
+ success: false;
29078
+ error: string;
29079
+ };
29080
+ outputFormat: "json";
29081
+ status: 404;
29082
+ } | {
29083
+ input: {
29084
+ param: {
29085
+ workspace: string;
29086
+ } & {
29087
+ accountId: string;
29088
+ };
29089
+ };
29090
+ output: {
29091
+ success: true;
29092
+ account: {
29093
+ id: string;
29094
+ workspaceId: string;
29095
+ order: number;
29096
+ name: string;
29097
+ cardColor: string;
29098
+ currency: FinanceCurrency;
29099
+ openingBalance: number;
29100
+ created_at: string;
29101
+ updated_at: string | null;
29102
+ };
29103
+ };
29104
+ outputFormat: "json";
29105
+ status: 200;
29106
+ };
29107
+ };
29108
+ } & {
29109
+ "/accounts/create": {
29110
+ $post: {
29111
+ input: {};
29112
+ output: {
29113
+ success: false;
29114
+ error: never;
29115
+ };
29116
+ outputFormat: "json";
29117
+ status: 400;
29118
+ } | {
29119
+ input: {};
29120
+ output: {
29121
+ success: true;
29122
+ account: {
29123
+ id: string;
29124
+ workspaceId: string;
29125
+ order: number;
29126
+ name: string;
29127
+ cardColor: string;
29128
+ currency: FinanceCurrency;
29129
+ openingBalance: number;
29130
+ created_at: string;
29131
+ updated_at: string | null;
29132
+ };
29133
+ };
29134
+ outputFormat: "json";
29135
+ status: 201;
29136
+ };
29137
+ };
29138
+ } & {
29139
+ "/accounts/update": {
29140
+ $post: {
29141
+ input: {};
29142
+ output: {
29143
+ success: false;
29144
+ error: never;
29145
+ };
29146
+ outputFormat: "json";
29147
+ status: 400;
29148
+ } | {
29149
+ input: {};
29150
+ output: {
29151
+ success: false;
29152
+ error: string;
29153
+ };
29154
+ outputFormat: "json";
29155
+ status: 404;
29156
+ } | {
29157
+ input: {};
29158
+ output: {
29159
+ success: true;
29160
+ account: {
29161
+ id: string;
29162
+ workspaceId: string;
29163
+ order: number;
29164
+ name: string;
29165
+ cardColor: string;
29166
+ currency: FinanceCurrency;
29167
+ openingBalance: number;
29168
+ created_at: string;
29169
+ updated_at: string | null;
29170
+ };
29171
+ };
29172
+ outputFormat: "json";
29173
+ status: 200;
29174
+ };
29175
+ };
29176
+ } & {
29177
+ "/accounts/reorder": {
29178
+ $post: {
29179
+ input: {};
29180
+ output: {
29181
+ success: false;
29182
+ error: string;
29183
+ };
29184
+ outputFormat: "json";
29185
+ status: 400;
29186
+ } | {
29187
+ input: {};
29188
+ output: {
29189
+ success: true;
29190
+ accounts: {
29191
+ id: string;
29192
+ workspaceId: string;
29193
+ order: number;
29194
+ name: string;
29195
+ cardColor: string;
29196
+ currency: FinanceCurrency;
29197
+ openingBalance: number;
29198
+ created_at: string;
29199
+ updated_at: string | null;
29200
+ }[];
29201
+ };
29202
+ outputFormat: "json";
29203
+ status: 200;
29204
+ };
29205
+ };
29206
+ } & {
29207
+ "/accounts/delete": {
29208
+ $post: {
29209
+ input: {};
29210
+ output: {
29211
+ success: false;
29212
+ error: never;
29213
+ };
29214
+ outputFormat: "json";
29215
+ status: 400;
29216
+ } | {
29217
+ input: {};
29218
+ output: {
29219
+ success: false;
29220
+ error: string;
29221
+ };
29222
+ outputFormat: "json";
29223
+ status: 404;
29224
+ } | {
29225
+ input: {};
29226
+ output: {
29227
+ success: true;
29228
+ };
29229
+ outputFormat: "json";
29230
+ status: 200;
29231
+ };
29232
+ };
29233
+ } & {
29234
+ "/visibility/:workspace": {
29235
+ $get: {
29236
+ input: {
29237
+ param: {
29238
+ workspace: string;
29239
+ };
29240
+ };
29241
+ output: {
29242
+ success: true;
29243
+ visibility: boolean;
29244
+ };
29245
+ outputFormat: "json";
29246
+ status: 200;
29247
+ };
29248
+ };
29249
+ } & {
29250
+ "/visibility": {
29251
+ $post: {
29252
+ input: {};
29253
+ output: {
29254
+ success: false;
29255
+ error: never;
29256
+ };
29257
+ outputFormat: "json";
29258
+ status: 400;
29259
+ } | {
29260
+ input: {};
29261
+ output: {
29262
+ success: true;
29263
+ visibility: boolean;
29264
+ };
29265
+ outputFormat: "json";
29266
+ status: 200;
29267
+ };
29268
+ };
29269
+ }, "/finance">, "/", "/">;
28296
29270
  type GlobalErrorResponses = {
28297
29271
  400: {
28298
29272
  json: ApiError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.208",
3
+ "version": "0.0.209",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,