@mestra-dev/contract 0.0.295 → 0.0.296

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 +755 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -700,6 +700,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
700
700
  createdBy: string;
701
701
  sourceInvoiceId: string | null;
702
702
  notifiedAt: string | null;
703
+ partnerId: string | null;
704
+ partnerRole: string | null;
703
705
  };
704
706
  };
705
707
  outputFormat: "json";
@@ -780,6 +782,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
780
782
  restrictedToUserId: string | null;
781
783
  sourceInvoiceId: string | null;
782
784
  notifiedAt: string | null;
785
+ partnerId: string | null;
786
+ partnerRole: string | null;
783
787
  };
784
788
  };
785
789
  outputFormat: "json";
@@ -6556,6 +6560,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6556
6560
  method: "email" | "popup";
6557
6561
  minutes: number;
6558
6562
  }[] | undefined;
6563
+ recurrence?: string[] | undefined;
6559
6564
  };
6560
6565
  };
6561
6566
  output: {
@@ -6963,6 +6968,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6963
6968
  method: "email" | "popup";
6964
6969
  minutes: number;
6965
6970
  }[] | undefined;
6971
+ recurrence?: string[] | undefined;
6966
6972
  startDate?: string | number | undefined;
6967
6973
  endDate?: string | number | undefined;
6968
6974
  timeZone?: string | undefined;
@@ -6991,6 +6997,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6991
6997
  method: "email" | "popup";
6992
6998
  minutes: number;
6993
6999
  }[] | undefined;
7000
+ recurrence?: string[] | undefined;
6994
7001
  startDate?: string | number | undefined;
6995
7002
  endDate?: string | number | undefined;
6996
7003
  timeZone?: string | undefined;
@@ -11489,7 +11496,754 @@ declare const routes: import("hono/hono-base").HonoBase<{
11489
11496
  status: 201;
11490
11497
  };
11491
11498
  };
11492
- }, "/resources">, "/", "/">;
11499
+ }, "/resources"> | import("hono/types").MergeSchemaPath<{
11500
+ "/me": {
11501
+ $get: {
11502
+ input: {};
11503
+ output: {
11504
+ success: true;
11505
+ partner: {
11506
+ status: "none";
11507
+ suspensionReason: null;
11508
+ promoCode: null;
11509
+ referralUrl: null;
11510
+ teamPromoCode: null;
11511
+ clientDiscountPercent: number;
11512
+ teamDiscountPercent: number;
11513
+ } | {
11514
+ status: "pending" | "active" | "suspended";
11515
+ suspensionReason: string | null;
11516
+ promoCode: string | null;
11517
+ referralUrl: string | null;
11518
+ teamPromoCode: string | null;
11519
+ clientDiscountPercent: number;
11520
+ teamDiscountPercent: number;
11521
+ };
11522
+ };
11523
+ outputFormat: "json";
11524
+ status: 200;
11525
+ };
11526
+ };
11527
+ } & {
11528
+ "/apply": {
11529
+ $post: {
11530
+ input: {
11531
+ json: {
11532
+ name: string;
11533
+ company: string;
11534
+ email: string;
11535
+ phone: string;
11536
+ };
11537
+ };
11538
+ output: {
11539
+ success: true;
11540
+ partner: {
11541
+ status: "none";
11542
+ suspensionReason: null;
11543
+ promoCode: null;
11544
+ referralUrl: null;
11545
+ teamPromoCode: null;
11546
+ clientDiscountPercent: number;
11547
+ teamDiscountPercent: number;
11548
+ } | {
11549
+ status: "pending" | "active" | "suspended";
11550
+ suspensionReason: string | null;
11551
+ promoCode: string | null;
11552
+ referralUrl: string | null;
11553
+ teamPromoCode: string | null;
11554
+ clientDiscountPercent: number;
11555
+ teamDiscountPercent: number;
11556
+ };
11557
+ };
11558
+ outputFormat: "json";
11559
+ status: 200;
11560
+ };
11561
+ };
11562
+ } & {
11563
+ "/overview": {
11564
+ $get: {
11565
+ input: {};
11566
+ output: {
11567
+ success: true;
11568
+ overview: {
11569
+ tier: {
11570
+ readonly id: "bronze";
11571
+ readonly percent: 20;
11572
+ readonly minClients: 1;
11573
+ } | {
11574
+ readonly id: "silver";
11575
+ readonly percent: 30;
11576
+ readonly minClients: 5;
11577
+ } | {
11578
+ readonly id: "gold";
11579
+ readonly percent: 40;
11580
+ readonly minClients: 15;
11581
+ };
11582
+ nextTier: {
11583
+ readonly id: "bronze";
11584
+ readonly percent: 20;
11585
+ readonly minClients: 1;
11586
+ } | {
11587
+ readonly id: "silver";
11588
+ readonly percent: 30;
11589
+ readonly minClients: 5;
11590
+ } | {
11591
+ readonly id: "gold";
11592
+ readonly percent: 40;
11593
+ readonly minClients: 15;
11594
+ } | null;
11595
+ paidClients: number;
11596
+ signedUpClients: number;
11597
+ nextPayout: {
11598
+ paidAt: string | null;
11599
+ lines: {
11600
+ id: string;
11601
+ kind: "refund" | "commission";
11602
+ workspaceName: string;
11603
+ interval: "monthly" | "yearly";
11604
+ commissionPercent: number;
11605
+ amountKopecks: number;
11606
+ }[];
11607
+ act: {
11608
+ status: "signed" | "unsigned";
11609
+ signedAt: string | null;
11610
+ } | null;
11611
+ payoutFrom: string;
11612
+ payoutTo: string;
11613
+ id: string;
11614
+ period: string;
11615
+ clients: number;
11616
+ amountKopecks: number;
11617
+ status: "paid" | "accruing" | "scheduled";
11618
+ } | null;
11619
+ awaitingClients: {
11620
+ id: string;
11621
+ workspaceName: string;
11622
+ promoCode: string;
11623
+ signedUpAt: string;
11624
+ status: "registered";
11625
+ planName: string;
11626
+ seats: number;
11627
+ interval: "monthly" | "yearly";
11628
+ paidAt: string | null;
11629
+ paymentKopecks: number | null;
11630
+ commissionPercent: number | null;
11631
+ commissionKopecks: number | null;
11632
+ potentialCommissionKopecks: number | null;
11633
+ trialEndsAt: string | null;
11634
+ }[];
11635
+ months: {
11636
+ month: string;
11637
+ commissionKopecks: number;
11638
+ signedUp: number;
11639
+ paid: number;
11640
+ }[];
11641
+ tasks: ({
11642
+ id: string;
11643
+ kind: "payoutDetails";
11644
+ payoutFrom: string;
11645
+ } | {
11646
+ id: string;
11647
+ kind: "signAct";
11648
+ period: string;
11649
+ amountKopecks: number;
11650
+ } | {
11651
+ id: string;
11652
+ kind: "reversed";
11653
+ workspaceName: string;
11654
+ amountKopecks: number;
11655
+ })[];
11656
+ };
11657
+ };
11658
+ outputFormat: "json";
11659
+ status: 200;
11660
+ };
11661
+ };
11662
+ } & {
11663
+ "/clients": {
11664
+ $get: {
11665
+ input: {};
11666
+ output: {
11667
+ success: true;
11668
+ clients: ({
11669
+ id: string;
11670
+ workspaceName: string;
11671
+ promoCode: string;
11672
+ signedUpAt: string;
11673
+ status: "registered";
11674
+ planName: string;
11675
+ seats: number;
11676
+ interval: "monthly" | "yearly";
11677
+ paidAt: string | null;
11678
+ paymentKopecks: number | null;
11679
+ commissionPercent: number | null;
11680
+ commissionKopecks: number | null;
11681
+ potentialCommissionKopecks: number | null;
11682
+ trialEndsAt: string | null;
11683
+ } | {
11684
+ id: string;
11685
+ workspaceName: string;
11686
+ promoCode: string;
11687
+ signedUpAt: string;
11688
+ status: "paid" | "refunded";
11689
+ planName: string;
11690
+ seats: number;
11691
+ interval: "monthly" | "yearly";
11692
+ paidAt: string;
11693
+ paymentKopecks: number;
11694
+ commissionPercent: number;
11695
+ commissionKopecks: number;
11696
+ potentialCommissionKopecks: number | null;
11697
+ trialEndsAt: string | null;
11698
+ })[];
11699
+ };
11700
+ outputFormat: "json";
11701
+ status: 200;
11702
+ };
11703
+ };
11704
+ } & {
11705
+ "/payouts": {
11706
+ $get: {
11707
+ input: {};
11708
+ output: {
11709
+ success: true;
11710
+ payouts: {
11711
+ paidAt: string | null;
11712
+ lines: {
11713
+ id: string;
11714
+ kind: "refund" | "commission";
11715
+ workspaceName: string;
11716
+ interval: "monthly" | "yearly";
11717
+ commissionPercent: number;
11718
+ amountKopecks: number;
11719
+ }[];
11720
+ act: {
11721
+ status: "signed" | "unsigned";
11722
+ signedAt: string | null;
11723
+ } | null;
11724
+ payoutFrom: string;
11725
+ payoutTo: string;
11726
+ id: string;
11727
+ period: string;
11728
+ clients: number;
11729
+ amountKopecks: number;
11730
+ status: "paid" | "accruing" | "scheduled";
11731
+ }[];
11732
+ };
11733
+ outputFormat: "json";
11734
+ status: 200;
11735
+ };
11736
+ };
11737
+ } & {
11738
+ "/payout-details": {
11739
+ $get: {
11740
+ input: {};
11741
+ output: {
11742
+ success: true;
11743
+ details: {
11744
+ legalForm: "ip" | "ooo";
11745
+ name: string;
11746
+ inn: string;
11747
+ bik: string;
11748
+ bankName: string;
11749
+ accountNumber: string;
11750
+ } | null;
11751
+ };
11752
+ outputFormat: "json";
11753
+ status: 200;
11754
+ };
11755
+ };
11756
+ } & {
11757
+ "/payout-details": {
11758
+ $put: {
11759
+ input: {
11760
+ json: {
11761
+ legalForm: "ip" | "ooo";
11762
+ name: string;
11763
+ inn: string;
11764
+ bik: string;
11765
+ accountNumber: string;
11766
+ };
11767
+ };
11768
+ output: {
11769
+ success: true;
11770
+ details: {
11771
+ legalForm: "ip" | "ooo";
11772
+ name: string;
11773
+ inn: string;
11774
+ bik: string;
11775
+ bankName: string;
11776
+ accountNumber: string;
11777
+ } | null;
11778
+ };
11779
+ outputFormat: "json";
11780
+ status: 200;
11781
+ };
11782
+ };
11783
+ } & {
11784
+ "/promo-codes": {
11785
+ $get: {
11786
+ input: {};
11787
+ output: {
11788
+ codes: {
11789
+ id: string;
11790
+ code: string;
11791
+ kind: "main" | "custom" | "team";
11792
+ discountPercent: number;
11793
+ isActive: boolean;
11794
+ clients: number;
11795
+ }[];
11796
+ requests: {
11797
+ id: string;
11798
+ code: string;
11799
+ discountPercent: number;
11800
+ note: string | null;
11801
+ status: "pending" | "approved" | "rejected";
11802
+ reviewNote: string | null;
11803
+ createdAt: string;
11804
+ }[];
11805
+ success: true;
11806
+ };
11807
+ outputFormat: "json";
11808
+ status: 200;
11809
+ };
11810
+ };
11811
+ } & {
11812
+ "/promo-codes": {
11813
+ $post: {
11814
+ input: {
11815
+ json: {
11816
+ code: string;
11817
+ percent: number;
11818
+ note?: string | undefined;
11819
+ };
11820
+ };
11821
+ output: {
11822
+ success: true;
11823
+ request: {
11824
+ id: string;
11825
+ code: string;
11826
+ discountPercent: number;
11827
+ note: string | null;
11828
+ status: "pending";
11829
+ reviewNote: null;
11830
+ createdAt: string;
11831
+ };
11832
+ };
11833
+ outputFormat: "json";
11834
+ status: 201;
11835
+ };
11836
+ };
11837
+ } & {
11838
+ "/acts/:period/code": {
11839
+ $post: {
11840
+ input: {
11841
+ param: {
11842
+ period: string;
11843
+ };
11844
+ };
11845
+ output: {
11846
+ phone: string;
11847
+ success: true;
11848
+ };
11849
+ outputFormat: "json";
11850
+ status: 200;
11851
+ };
11852
+ };
11853
+ } & {
11854
+ "/acts/:period/sign": {
11855
+ $post: {
11856
+ input: {
11857
+ json: {
11858
+ code: string;
11859
+ };
11860
+ } & {
11861
+ param: {
11862
+ period: string;
11863
+ };
11864
+ };
11865
+ output: {
11866
+ success: true;
11867
+ };
11868
+ outputFormat: "json";
11869
+ status: 200;
11870
+ };
11871
+ };
11872
+ } & {
11873
+ "/admin/promo-requests": {
11874
+ $get: {
11875
+ input: {};
11876
+ output: {
11877
+ success: false;
11878
+ error: string;
11879
+ };
11880
+ outputFormat: "json";
11881
+ status: 401;
11882
+ } | {
11883
+ input: {};
11884
+ output: {
11885
+ success: true;
11886
+ requests: {
11887
+ id: string;
11888
+ partnerId: string;
11889
+ partnerName: string;
11890
+ company: string;
11891
+ code: string;
11892
+ percent: number;
11893
+ note: string | null;
11894
+ createdAt: string;
11895
+ }[];
11896
+ };
11897
+ outputFormat: "json";
11898
+ status: 200;
11899
+ };
11900
+ };
11901
+ } & {
11902
+ "/admin/promo-requests/:requestId/approve": {
11903
+ $post: {
11904
+ input: {
11905
+ json: {
11906
+ percent?: number | undefined;
11907
+ };
11908
+ } & {
11909
+ param: {
11910
+ requestId: string;
11911
+ };
11912
+ };
11913
+ output: {
11914
+ success: false;
11915
+ error: string;
11916
+ };
11917
+ outputFormat: "json";
11918
+ status: 401;
11919
+ } | {
11920
+ input: {
11921
+ json: {
11922
+ percent?: number | undefined;
11923
+ };
11924
+ } & {
11925
+ param: {
11926
+ requestId: string;
11927
+ };
11928
+ };
11929
+ output: {
11930
+ success: true;
11931
+ };
11932
+ outputFormat: "json";
11933
+ status: 200;
11934
+ };
11935
+ };
11936
+ } & {
11937
+ "/admin/promo-requests/:requestId/reject": {
11938
+ $post: {
11939
+ input: {
11940
+ json: {
11941
+ reason: string;
11942
+ };
11943
+ } & {
11944
+ param: {
11945
+ requestId: string;
11946
+ };
11947
+ };
11948
+ output: {
11949
+ success: false;
11950
+ error: string;
11951
+ };
11952
+ outputFormat: "json";
11953
+ status: 401;
11954
+ } | {
11955
+ input: {
11956
+ json: {
11957
+ reason: string;
11958
+ };
11959
+ } & {
11960
+ param: {
11961
+ requestId: string;
11962
+ };
11963
+ };
11964
+ output: {
11965
+ success: true;
11966
+ };
11967
+ outputFormat: "json";
11968
+ status: 200;
11969
+ };
11970
+ };
11971
+ } & {
11972
+ "/admin/payouts": {
11973
+ $get: {
11974
+ input: {};
11975
+ output: {
11976
+ success: false;
11977
+ error: string;
11978
+ };
11979
+ outputFormat: "json";
11980
+ status: 401;
11981
+ } | {
11982
+ input: {};
11983
+ output: {
11984
+ success: true;
11985
+ payouts: {
11986
+ amountKopecks: number;
11987
+ clients: number;
11988
+ payoutDetails: {
11989
+ legalForm: "ip" | "ooo";
11990
+ name: string;
11991
+ inn: string;
11992
+ bik: string;
11993
+ bankName: string;
11994
+ accountNumber: string;
11995
+ } | null;
11996
+ payoutFrom: string;
11997
+ payoutTo: string;
11998
+ partnerId: string;
11999
+ partnerName: string;
12000
+ company: string;
12001
+ period: string;
12002
+ }[];
12003
+ };
12004
+ outputFormat: "json";
12005
+ status: 200;
12006
+ };
12007
+ };
12008
+ } & {
12009
+ "/admin/commissions/:entryId/reverse": {
12010
+ $post: {
12011
+ input: {
12012
+ param: {
12013
+ entryId: string;
12014
+ };
12015
+ };
12016
+ output: {
12017
+ success: false;
12018
+ error: string;
12019
+ };
12020
+ outputFormat: "json";
12021
+ status: 401;
12022
+ } | {
12023
+ input: {
12024
+ param: {
12025
+ entryId: string;
12026
+ };
12027
+ };
12028
+ output: {
12029
+ success: true;
12030
+ refund: {
12031
+ id: string;
12032
+ amountKopecks: number;
12033
+ };
12034
+ };
12035
+ outputFormat: "json";
12036
+ status: 200;
12037
+ };
12038
+ };
12039
+ } & {
12040
+ "/admin": {
12041
+ $get: {
12042
+ input: {
12043
+ query: {
12044
+ status?: "pending" | "active" | "suspended" | undefined;
12045
+ };
12046
+ };
12047
+ output: {
12048
+ success: false;
12049
+ error: string;
12050
+ };
12051
+ outputFormat: "json";
12052
+ status: 401;
12053
+ } | {
12054
+ input: {
12055
+ query: {
12056
+ status?: "pending" | "active" | "suspended" | undefined;
12057
+ };
12058
+ };
12059
+ output: {
12060
+ success: true;
12061
+ partners: {
12062
+ id: string;
12063
+ userId: string;
12064
+ status: string;
12065
+ name: string;
12066
+ company: string;
12067
+ email: string;
12068
+ phone: string;
12069
+ suspensionReason: string | null;
12070
+ appliedAt: string;
12071
+ activatedAt: string | null;
12072
+ payoutDetails: {
12073
+ legalForm: "ip" | "ooo";
12074
+ name: string;
12075
+ inn: string;
12076
+ bik: string;
12077
+ bankName: string;
12078
+ accountNumber: string;
12079
+ } | null;
12080
+ }[];
12081
+ };
12082
+ outputFormat: "json";
12083
+ status: 200;
12084
+ };
12085
+ };
12086
+ } & {
12087
+ "/admin/:partnerId/activate": {
12088
+ $post: {
12089
+ input: {
12090
+ json: {
12091
+ promoCode: string;
12092
+ };
12093
+ } & {
12094
+ param: {
12095
+ partnerId: string;
12096
+ };
12097
+ };
12098
+ output: {
12099
+ success: false;
12100
+ error: string;
12101
+ };
12102
+ outputFormat: "json";
12103
+ status: 401;
12104
+ } | {
12105
+ input: {
12106
+ json: {
12107
+ promoCode: string;
12108
+ };
12109
+ } & {
12110
+ param: {
12111
+ partnerId: string;
12112
+ };
12113
+ };
12114
+ output: {
12115
+ success: true;
12116
+ };
12117
+ outputFormat: "json";
12118
+ status: 200;
12119
+ };
12120
+ };
12121
+ } & {
12122
+ "/admin/:partnerId/reject": {
12123
+ $post: {
12124
+ input: {
12125
+ param: {
12126
+ partnerId: string;
12127
+ };
12128
+ };
12129
+ output: {
12130
+ success: false;
12131
+ error: string;
12132
+ };
12133
+ outputFormat: "json";
12134
+ status: 401;
12135
+ } | {
12136
+ input: {
12137
+ param: {
12138
+ partnerId: string;
12139
+ };
12140
+ };
12141
+ output: {
12142
+ success: true;
12143
+ };
12144
+ outputFormat: "json";
12145
+ status: 200;
12146
+ };
12147
+ };
12148
+ } & {
12149
+ "/admin/:partnerId/suspend": {
12150
+ $post: {
12151
+ input: {
12152
+ json: {
12153
+ reason: string;
12154
+ };
12155
+ } & {
12156
+ param: {
12157
+ partnerId: string;
12158
+ };
12159
+ };
12160
+ output: {
12161
+ success: false;
12162
+ error: string;
12163
+ };
12164
+ outputFormat: "json";
12165
+ status: 401;
12166
+ } | {
12167
+ input: {
12168
+ json: {
12169
+ reason: string;
12170
+ };
12171
+ } & {
12172
+ param: {
12173
+ partnerId: string;
12174
+ };
12175
+ };
12176
+ output: {
12177
+ success: true;
12178
+ };
12179
+ outputFormat: "json";
12180
+ status: 200;
12181
+ };
12182
+ };
12183
+ } & {
12184
+ "/admin/:partnerId/reactivate": {
12185
+ $post: {
12186
+ input: {
12187
+ param: {
12188
+ partnerId: string;
12189
+ };
12190
+ };
12191
+ output: {
12192
+ success: false;
12193
+ error: string;
12194
+ };
12195
+ outputFormat: "json";
12196
+ status: 401;
12197
+ } | {
12198
+ input: {
12199
+ param: {
12200
+ partnerId: string;
12201
+ };
12202
+ };
12203
+ output: {
12204
+ success: true;
12205
+ };
12206
+ outputFormat: "json";
12207
+ status: 200;
12208
+ };
12209
+ };
12210
+ } & {
12211
+ "/admin/:partnerId/payouts/:period/paid": {
12212
+ $post: {
12213
+ input: {
12214
+ param: {
12215
+ period: string;
12216
+ } & {
12217
+ partnerId: string;
12218
+ };
12219
+ };
12220
+ output: {
12221
+ success: false;
12222
+ error: string;
12223
+ };
12224
+ outputFormat: "json";
12225
+ status: 401;
12226
+ } | {
12227
+ input: {
12228
+ param: {
12229
+ period: string;
12230
+ } & {
12231
+ partnerId: string;
12232
+ };
12233
+ };
12234
+ output: {
12235
+ success: true;
12236
+ payout: {
12237
+ period: string;
12238
+ amountKopecks: number;
12239
+ paidAt: string;
12240
+ };
12241
+ };
12242
+ outputFormat: "json";
12243
+ status: 200;
12244
+ };
12245
+ };
12246
+ }, "/partners">, "/", "/">;
11493
12247
  type GlobalErrorResponses = {
11494
12248
  400: {
11495
12249
  json: ApiError;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.295",
3
+ "version": "0.0.296",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,