@mestra-dev/contract 0.0.295 → 0.0.297

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 +617 -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,616 @@ 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
+ isAdmin: boolean;
11514
+ } | {
11515
+ status: "pending" | "active" | "suspended";
11516
+ suspensionReason: string | null;
11517
+ promoCode: string | null;
11518
+ referralUrl: string | null;
11519
+ teamPromoCode: string | null;
11520
+ clientDiscountPercent: number;
11521
+ teamDiscountPercent: number;
11522
+ isAdmin: boolean;
11523
+ };
11524
+ };
11525
+ outputFormat: "json";
11526
+ status: 200;
11527
+ };
11528
+ };
11529
+ } & {
11530
+ "/apply": {
11531
+ $post: {
11532
+ input: {
11533
+ json: {
11534
+ name: string;
11535
+ company: string;
11536
+ email: string;
11537
+ phone: string;
11538
+ };
11539
+ };
11540
+ output: {
11541
+ success: true;
11542
+ partner: {
11543
+ status: "none";
11544
+ suspensionReason: null;
11545
+ promoCode: null;
11546
+ referralUrl: null;
11547
+ teamPromoCode: null;
11548
+ clientDiscountPercent: number;
11549
+ teamDiscountPercent: number;
11550
+ isAdmin: boolean;
11551
+ } | {
11552
+ status: "pending" | "active" | "suspended";
11553
+ suspensionReason: string | null;
11554
+ promoCode: string | null;
11555
+ referralUrl: string | null;
11556
+ teamPromoCode: string | null;
11557
+ clientDiscountPercent: number;
11558
+ teamDiscountPercent: number;
11559
+ isAdmin: boolean;
11560
+ };
11561
+ };
11562
+ outputFormat: "json";
11563
+ status: 200;
11564
+ };
11565
+ };
11566
+ } & {
11567
+ "/overview": {
11568
+ $get: {
11569
+ input: {};
11570
+ output: {
11571
+ success: true;
11572
+ overview: {
11573
+ tier: {
11574
+ readonly id: "bronze";
11575
+ readonly percent: 20;
11576
+ readonly minClients: 1;
11577
+ } | {
11578
+ readonly id: "silver";
11579
+ readonly percent: 30;
11580
+ readonly minClients: 5;
11581
+ } | {
11582
+ readonly id: "gold";
11583
+ readonly percent: 40;
11584
+ readonly minClients: 15;
11585
+ };
11586
+ nextTier: {
11587
+ readonly id: "bronze";
11588
+ readonly percent: 20;
11589
+ readonly minClients: 1;
11590
+ } | {
11591
+ readonly id: "silver";
11592
+ readonly percent: 30;
11593
+ readonly minClients: 5;
11594
+ } | {
11595
+ readonly id: "gold";
11596
+ readonly percent: 40;
11597
+ readonly minClients: 15;
11598
+ } | null;
11599
+ paidClients: number;
11600
+ signedUpClients: number;
11601
+ nextPayout: {
11602
+ paidAt: string | null;
11603
+ lines: {
11604
+ id: string;
11605
+ kind: "refund" | "commission";
11606
+ workspaceName: string;
11607
+ interval: "monthly" | "yearly";
11608
+ commissionPercent: number;
11609
+ amountKopecks: number;
11610
+ }[];
11611
+ act: {
11612
+ status: "signed" | "unsigned";
11613
+ signedAt: string | null;
11614
+ } | null;
11615
+ payoutFrom: string;
11616
+ payoutTo: string;
11617
+ id: string;
11618
+ period: string;
11619
+ clients: number;
11620
+ amountKopecks: number;
11621
+ status: "paid" | "accruing" | "scheduled";
11622
+ } | null;
11623
+ awaitingClients: {
11624
+ id: string;
11625
+ workspaceName: string;
11626
+ promoCode: string;
11627
+ signedUpAt: string;
11628
+ status: "registered";
11629
+ planName: string;
11630
+ seats: number;
11631
+ interval: "monthly" | "yearly";
11632
+ paidAt: string | null;
11633
+ paymentKopecks: number | null;
11634
+ commissionPercent: number | null;
11635
+ commissionKopecks: number | null;
11636
+ potentialCommissionKopecks: number | null;
11637
+ trialEndsAt: string | null;
11638
+ }[];
11639
+ months: {
11640
+ month: string;
11641
+ commissionKopecks: number;
11642
+ signedUp: number;
11643
+ paid: number;
11644
+ }[];
11645
+ tasks: ({
11646
+ id: string;
11647
+ kind: "payoutDetails";
11648
+ payoutFrom: string;
11649
+ } | {
11650
+ id: string;
11651
+ kind: "signAct";
11652
+ period: string;
11653
+ amountKopecks: number;
11654
+ } | {
11655
+ id: string;
11656
+ kind: "reversed";
11657
+ workspaceName: string;
11658
+ amountKopecks: number;
11659
+ })[];
11660
+ };
11661
+ };
11662
+ outputFormat: "json";
11663
+ status: 200;
11664
+ };
11665
+ };
11666
+ } & {
11667
+ "/clients": {
11668
+ $get: {
11669
+ input: {};
11670
+ output: {
11671
+ success: true;
11672
+ clients: ({
11673
+ id: string;
11674
+ workspaceName: string;
11675
+ promoCode: string;
11676
+ signedUpAt: string;
11677
+ status: "registered";
11678
+ planName: string;
11679
+ seats: number;
11680
+ interval: "monthly" | "yearly";
11681
+ paidAt: string | null;
11682
+ paymentKopecks: number | null;
11683
+ commissionPercent: number | null;
11684
+ commissionKopecks: number | null;
11685
+ potentialCommissionKopecks: number | null;
11686
+ trialEndsAt: string | null;
11687
+ } | {
11688
+ id: string;
11689
+ workspaceName: string;
11690
+ promoCode: string;
11691
+ signedUpAt: string;
11692
+ status: "paid" | "refunded";
11693
+ planName: string;
11694
+ seats: number;
11695
+ interval: "monthly" | "yearly";
11696
+ paidAt: string;
11697
+ paymentKopecks: number;
11698
+ commissionPercent: number;
11699
+ commissionKopecks: number;
11700
+ potentialCommissionKopecks: number | null;
11701
+ trialEndsAt: string | null;
11702
+ })[];
11703
+ };
11704
+ outputFormat: "json";
11705
+ status: 200;
11706
+ };
11707
+ };
11708
+ } & {
11709
+ "/payouts": {
11710
+ $get: {
11711
+ input: {};
11712
+ output: {
11713
+ success: true;
11714
+ payouts: {
11715
+ paidAt: string | null;
11716
+ lines: {
11717
+ id: string;
11718
+ kind: "refund" | "commission";
11719
+ workspaceName: string;
11720
+ interval: "monthly" | "yearly";
11721
+ commissionPercent: number;
11722
+ amountKopecks: number;
11723
+ }[];
11724
+ act: {
11725
+ status: "signed" | "unsigned";
11726
+ signedAt: string | null;
11727
+ } | null;
11728
+ payoutFrom: string;
11729
+ payoutTo: string;
11730
+ id: string;
11731
+ period: string;
11732
+ clients: number;
11733
+ amountKopecks: number;
11734
+ status: "paid" | "accruing" | "scheduled";
11735
+ }[];
11736
+ };
11737
+ outputFormat: "json";
11738
+ status: 200;
11739
+ };
11740
+ };
11741
+ } & {
11742
+ "/payout-details": {
11743
+ $get: {
11744
+ input: {};
11745
+ output: {
11746
+ success: true;
11747
+ details: {
11748
+ legalForm: "ip" | "ooo";
11749
+ name: string;
11750
+ inn: string;
11751
+ bik: string;
11752
+ bankName: string;
11753
+ accountNumber: string;
11754
+ } | null;
11755
+ };
11756
+ outputFormat: "json";
11757
+ status: 200;
11758
+ };
11759
+ };
11760
+ } & {
11761
+ "/payout-details": {
11762
+ $put: {
11763
+ input: {
11764
+ json: {
11765
+ legalForm: "ip" | "ooo";
11766
+ name: string;
11767
+ inn: string;
11768
+ bik: string;
11769
+ accountNumber: string;
11770
+ };
11771
+ };
11772
+ output: {
11773
+ success: true;
11774
+ details: {
11775
+ legalForm: "ip" | "ooo";
11776
+ name: string;
11777
+ inn: string;
11778
+ bik: string;
11779
+ bankName: string;
11780
+ accountNumber: string;
11781
+ } | null;
11782
+ };
11783
+ outputFormat: "json";
11784
+ status: 200;
11785
+ };
11786
+ };
11787
+ } & {
11788
+ "/promo-codes": {
11789
+ $get: {
11790
+ input: {};
11791
+ output: {
11792
+ codes: {
11793
+ id: string;
11794
+ code: string;
11795
+ kind: "main" | "custom" | "team";
11796
+ discountPercent: number;
11797
+ isActive: boolean;
11798
+ clients: number;
11799
+ }[];
11800
+ requests: {
11801
+ id: string;
11802
+ code: string;
11803
+ discountPercent: number;
11804
+ note: string | null;
11805
+ status: "pending" | "approved" | "rejected";
11806
+ reviewNote: string | null;
11807
+ createdAt: string;
11808
+ }[];
11809
+ success: true;
11810
+ };
11811
+ outputFormat: "json";
11812
+ status: 200;
11813
+ };
11814
+ };
11815
+ } & {
11816
+ "/promo-codes": {
11817
+ $post: {
11818
+ input: {
11819
+ json: {
11820
+ code: string;
11821
+ percent: number;
11822
+ note?: string | undefined;
11823
+ };
11824
+ };
11825
+ output: {
11826
+ success: true;
11827
+ request: {
11828
+ id: string;
11829
+ code: string;
11830
+ discountPercent: number;
11831
+ note: string | null;
11832
+ status: "pending";
11833
+ reviewNote: null;
11834
+ createdAt: string;
11835
+ };
11836
+ };
11837
+ outputFormat: "json";
11838
+ status: 201;
11839
+ };
11840
+ };
11841
+ } & {
11842
+ "/acts/:period/code": {
11843
+ $post: {
11844
+ input: {
11845
+ param: {
11846
+ period: string;
11847
+ };
11848
+ };
11849
+ output: {
11850
+ phone: string;
11851
+ success: true;
11852
+ };
11853
+ outputFormat: "json";
11854
+ status: 200;
11855
+ };
11856
+ };
11857
+ } & {
11858
+ "/acts/:period/sign": {
11859
+ $post: {
11860
+ input: {
11861
+ json: {
11862
+ code: string;
11863
+ };
11864
+ } & {
11865
+ param: {
11866
+ period: string;
11867
+ };
11868
+ };
11869
+ output: {
11870
+ success: true;
11871
+ };
11872
+ outputFormat: "json";
11873
+ status: 200;
11874
+ };
11875
+ };
11876
+ } & {
11877
+ "/admin/promo-requests": {
11878
+ $get: {
11879
+ input: {};
11880
+ output: {
11881
+ success: true;
11882
+ requests: {
11883
+ id: string;
11884
+ partnerId: string;
11885
+ partnerName: string;
11886
+ company: string;
11887
+ code: string;
11888
+ percent: number;
11889
+ note: string | null;
11890
+ createdAt: string;
11891
+ }[];
11892
+ };
11893
+ outputFormat: "json";
11894
+ status: 200;
11895
+ };
11896
+ };
11897
+ } & {
11898
+ "/admin/promo-requests/:requestId/approve": {
11899
+ $post: {
11900
+ input: {
11901
+ json: {
11902
+ percent?: number | undefined;
11903
+ };
11904
+ } & {
11905
+ param: {
11906
+ requestId: string;
11907
+ };
11908
+ };
11909
+ output: {
11910
+ success: true;
11911
+ };
11912
+ outputFormat: "json";
11913
+ status: 200;
11914
+ };
11915
+ };
11916
+ } & {
11917
+ "/admin/promo-requests/:requestId/reject": {
11918
+ $post: {
11919
+ input: {
11920
+ json: {
11921
+ reason: string;
11922
+ };
11923
+ } & {
11924
+ param: {
11925
+ requestId: string;
11926
+ };
11927
+ };
11928
+ output: {
11929
+ success: true;
11930
+ };
11931
+ outputFormat: "json";
11932
+ status: 200;
11933
+ };
11934
+ };
11935
+ } & {
11936
+ "/admin/payouts": {
11937
+ $get: {
11938
+ input: {};
11939
+ output: {
11940
+ success: true;
11941
+ payouts: {
11942
+ amountKopecks: number;
11943
+ clients: number;
11944
+ payoutDetails: {
11945
+ legalForm: "ip" | "ooo";
11946
+ name: string;
11947
+ inn: string;
11948
+ bik: string;
11949
+ bankName: string;
11950
+ accountNumber: string;
11951
+ } | null;
11952
+ payoutFrom: string;
11953
+ payoutTo: string;
11954
+ partnerId: string;
11955
+ partnerName: string;
11956
+ company: string;
11957
+ period: string;
11958
+ }[];
11959
+ };
11960
+ outputFormat: "json";
11961
+ status: 200;
11962
+ };
11963
+ };
11964
+ } & {
11965
+ "/admin/commissions/:entryId/reverse": {
11966
+ $post: {
11967
+ input: {
11968
+ param: {
11969
+ entryId: string;
11970
+ };
11971
+ };
11972
+ output: {
11973
+ success: true;
11974
+ refund: {
11975
+ id: string;
11976
+ amountKopecks: number;
11977
+ };
11978
+ };
11979
+ outputFormat: "json";
11980
+ status: 200;
11981
+ };
11982
+ };
11983
+ } & {
11984
+ "/admin": {
11985
+ $get: {
11986
+ input: {
11987
+ query: {
11988
+ status?: "pending" | "active" | "suspended" | undefined;
11989
+ };
11990
+ };
11991
+ output: {
11992
+ success: true;
11993
+ partners: {
11994
+ id: string;
11995
+ userId: string;
11996
+ status: string;
11997
+ name: string;
11998
+ company: string;
11999
+ email: string;
12000
+ phone: string;
12001
+ suspensionReason: string | null;
12002
+ appliedAt: string;
12003
+ activatedAt: string | null;
12004
+ payoutDetails: {
12005
+ legalForm: "ip" | "ooo";
12006
+ name: string;
12007
+ inn: string;
12008
+ bik: string;
12009
+ bankName: string;
12010
+ accountNumber: string;
12011
+ } | null;
12012
+ }[];
12013
+ };
12014
+ outputFormat: "json";
12015
+ status: 200;
12016
+ };
12017
+ };
12018
+ } & {
12019
+ "/admin/:partnerId/activate": {
12020
+ $post: {
12021
+ input: {
12022
+ json: {
12023
+ promoCode: string;
12024
+ };
12025
+ } & {
12026
+ param: {
12027
+ partnerId: string;
12028
+ };
12029
+ };
12030
+ output: {
12031
+ success: true;
12032
+ };
12033
+ outputFormat: "json";
12034
+ status: 200;
12035
+ };
12036
+ };
12037
+ } & {
12038
+ "/admin/:partnerId/reject": {
12039
+ $post: {
12040
+ input: {
12041
+ param: {
12042
+ partnerId: string;
12043
+ };
12044
+ };
12045
+ output: {
12046
+ success: true;
12047
+ };
12048
+ outputFormat: "json";
12049
+ status: 200;
12050
+ };
12051
+ };
12052
+ } & {
12053
+ "/admin/:partnerId/suspend": {
12054
+ $post: {
12055
+ input: {
12056
+ json: {
12057
+ reason: string;
12058
+ };
12059
+ } & {
12060
+ param: {
12061
+ partnerId: string;
12062
+ };
12063
+ };
12064
+ output: {
12065
+ success: true;
12066
+ };
12067
+ outputFormat: "json";
12068
+ status: 200;
12069
+ };
12070
+ };
12071
+ } & {
12072
+ "/admin/:partnerId/reactivate": {
12073
+ $post: {
12074
+ input: {
12075
+ param: {
12076
+ partnerId: string;
12077
+ };
12078
+ };
12079
+ output: {
12080
+ success: true;
12081
+ };
12082
+ outputFormat: "json";
12083
+ status: 200;
12084
+ };
12085
+ };
12086
+ } & {
12087
+ "/admin/:partnerId/payouts/:period/paid": {
12088
+ $post: {
12089
+ input: {
12090
+ param: {
12091
+ period: string;
12092
+ } & {
12093
+ partnerId: string;
12094
+ };
12095
+ };
12096
+ output: {
12097
+ success: true;
12098
+ payout: {
12099
+ period: string;
12100
+ amountKopecks: number;
12101
+ paidAt: string;
12102
+ };
12103
+ };
12104
+ outputFormat: "json";
12105
+ status: 200;
12106
+ };
12107
+ };
12108
+ }, "/partners">, "/", "/">;
11493
12109
  type GlobalErrorResponses = {
11494
12110
  400: {
11495
12111
  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.297",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,