@mestra-dev/contract 0.0.61 → 0.0.63
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.
- package/dist/index.d.ts +234 -6
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -785,7 +785,8 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
785
785
|
readonly type: "object";
|
|
786
786
|
readonly required: readonly [
|
|
787
787
|
"id",
|
|
788
|
-
"
|
|
788
|
+
"emailVerified",
|
|
789
|
+
"phoneVerified"
|
|
789
790
|
];
|
|
790
791
|
readonly properties: {
|
|
791
792
|
readonly id: {
|
|
@@ -795,6 +796,17 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
795
796
|
readonly email: {
|
|
796
797
|
readonly type: "string";
|
|
797
798
|
readonly format: "email";
|
|
799
|
+
readonly nullable: true;
|
|
800
|
+
};
|
|
801
|
+
readonly phone: {
|
|
802
|
+
readonly type: "string";
|
|
803
|
+
readonly nullable: true;
|
|
804
|
+
};
|
|
805
|
+
readonly emailVerified: {
|
|
806
|
+
readonly type: "boolean";
|
|
807
|
+
};
|
|
808
|
+
readonly phoneVerified: {
|
|
809
|
+
readonly type: "boolean";
|
|
798
810
|
};
|
|
799
811
|
readonly firstName: {
|
|
800
812
|
readonly type: "string";
|
|
@@ -4512,6 +4524,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4512
4524
|
"Auth"
|
|
4513
4525
|
];
|
|
4514
4526
|
readonly summary: "Request a one-time password";
|
|
4527
|
+
readonly description: "Without a bearer token this starts email login/signup. With an access token it links an email to the current account (for users who signed in with SMS).";
|
|
4528
|
+
readonly security: readonly [
|
|
4529
|
+
never
|
|
4530
|
+
];
|
|
4515
4531
|
readonly requestBody: {
|
|
4516
4532
|
readonly required: true;
|
|
4517
4533
|
readonly content: {
|
|
@@ -4562,6 +4578,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4562
4578
|
"Auth"
|
|
4563
4579
|
];
|
|
4564
4580
|
readonly summary: "Verify a one-time password";
|
|
4581
|
+
readonly description: "Without a bearer token this completes email login/signup and returns tokens. With an access token it verifies and attaches an email to the current account.";
|
|
4582
|
+
readonly security: readonly [
|
|
4583
|
+
never
|
|
4584
|
+
];
|
|
4565
4585
|
readonly requestBody: {
|
|
4566
4586
|
readonly required: true;
|
|
4567
4587
|
readonly content: {
|
|
@@ -4626,6 +4646,156 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4626
4646
|
};
|
|
4627
4647
|
};
|
|
4628
4648
|
};
|
|
4649
|
+
readonly "/auth/request-sms-otp": {
|
|
4650
|
+
readonly post: {
|
|
4651
|
+
readonly tags: readonly [
|
|
4652
|
+
"Auth"
|
|
4653
|
+
];
|
|
4654
|
+
readonly summary: "Request a one-time password by SMS";
|
|
4655
|
+
readonly description: "Without a bearer token this starts SMS login/signup. With an access token it links a phone to the current account (for users who signed in with email). SMS is sent via Kod.mobi only when dialCode is +7.";
|
|
4656
|
+
readonly security: readonly [
|
|
4657
|
+
never
|
|
4658
|
+
];
|
|
4659
|
+
readonly requestBody: {
|
|
4660
|
+
readonly required: true;
|
|
4661
|
+
readonly content: {
|
|
4662
|
+
readonly "application/json": {
|
|
4663
|
+
readonly schema: {
|
|
4664
|
+
readonly type: "object";
|
|
4665
|
+
readonly required: readonly [
|
|
4666
|
+
"dialCode",
|
|
4667
|
+
"number"
|
|
4668
|
+
];
|
|
4669
|
+
readonly properties: {
|
|
4670
|
+
readonly dialCode: {
|
|
4671
|
+
readonly type: "string";
|
|
4672
|
+
readonly description: "International dial code, with or without a leading +.";
|
|
4673
|
+
readonly example: "+7";
|
|
4674
|
+
};
|
|
4675
|
+
readonly number: {
|
|
4676
|
+
readonly type: "string";
|
|
4677
|
+
readonly description: "National phone number without the dial code.";
|
|
4678
|
+
readonly example: "9197286223";
|
|
4679
|
+
};
|
|
4680
|
+
};
|
|
4681
|
+
};
|
|
4682
|
+
};
|
|
4683
|
+
};
|
|
4684
|
+
};
|
|
4685
|
+
readonly responses: {
|
|
4686
|
+
readonly 200: {
|
|
4687
|
+
readonly description: "OTP generated and sent successfully.";
|
|
4688
|
+
readonly content: {
|
|
4689
|
+
readonly "application/json": {
|
|
4690
|
+
readonly schema: {
|
|
4691
|
+
readonly $ref: "#/components/schemas/OtpRequestSuccess";
|
|
4692
|
+
};
|
|
4693
|
+
};
|
|
4694
|
+
};
|
|
4695
|
+
};
|
|
4696
|
+
readonly 400: {
|
|
4697
|
+
readonly description: "Validation failed or an active OTP already exists.";
|
|
4698
|
+
readonly content: {
|
|
4699
|
+
readonly "application/json": {
|
|
4700
|
+
readonly schema: {
|
|
4701
|
+
readonly $ref: "#/components/schemas/OtpRequestFailure";
|
|
4702
|
+
};
|
|
4703
|
+
};
|
|
4704
|
+
};
|
|
4705
|
+
};
|
|
4706
|
+
readonly 429: {
|
|
4707
|
+
readonly description: "Too Many Requests - Rate limit exceeded.";
|
|
4708
|
+
readonly content: {
|
|
4709
|
+
readonly "application/json": {
|
|
4710
|
+
readonly schema: {
|
|
4711
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
4712
|
+
};
|
|
4713
|
+
};
|
|
4714
|
+
};
|
|
4715
|
+
};
|
|
4716
|
+
};
|
|
4717
|
+
};
|
|
4718
|
+
};
|
|
4719
|
+
readonly "/auth/verify-sms-otp": {
|
|
4720
|
+
readonly post: {
|
|
4721
|
+
readonly tags: readonly [
|
|
4722
|
+
"Auth"
|
|
4723
|
+
];
|
|
4724
|
+
readonly summary: "Verify an SMS one-time password";
|
|
4725
|
+
readonly description: "Without a bearer token this completes SMS login/signup and returns tokens. With an access token it verifies and attaches a phone to the current account.";
|
|
4726
|
+
readonly security: readonly [
|
|
4727
|
+
never
|
|
4728
|
+
];
|
|
4729
|
+
readonly requestBody: {
|
|
4730
|
+
readonly required: true;
|
|
4731
|
+
readonly content: {
|
|
4732
|
+
readonly "application/json": {
|
|
4733
|
+
readonly schema: {
|
|
4734
|
+
readonly type: "object";
|
|
4735
|
+
readonly required: readonly [
|
|
4736
|
+
"dialCode",
|
|
4737
|
+
"number",
|
|
4738
|
+
"otp"
|
|
4739
|
+
];
|
|
4740
|
+
readonly properties: {
|
|
4741
|
+
readonly dialCode: {
|
|
4742
|
+
readonly type: "string";
|
|
4743
|
+
readonly description: "International dial code, with or without a leading +.";
|
|
4744
|
+
readonly example: "+7";
|
|
4745
|
+
};
|
|
4746
|
+
readonly number: {
|
|
4747
|
+
readonly type: "string";
|
|
4748
|
+
readonly description: "National phone number without the dial code.";
|
|
4749
|
+
readonly example: "9197286223";
|
|
4750
|
+
};
|
|
4751
|
+
readonly otp: {
|
|
4752
|
+
readonly type: "string";
|
|
4753
|
+
readonly pattern: "^[0-9]{6}$";
|
|
4754
|
+
readonly description: "6-digit OTP code.";
|
|
4755
|
+
};
|
|
4756
|
+
readonly keepSignIn: {
|
|
4757
|
+
readonly type: "boolean";
|
|
4758
|
+
readonly description: "Extend refresh token validity to 30 days when true (default 7 days).";
|
|
4759
|
+
};
|
|
4760
|
+
};
|
|
4761
|
+
};
|
|
4762
|
+
};
|
|
4763
|
+
};
|
|
4764
|
+
};
|
|
4765
|
+
readonly responses: {
|
|
4766
|
+
readonly 200: {
|
|
4767
|
+
readonly description: "OTP verified successfully.";
|
|
4768
|
+
readonly content: {
|
|
4769
|
+
readonly "application/json": {
|
|
4770
|
+
readonly schema: {
|
|
4771
|
+
readonly $ref: "#/components/schemas/VerifyOtpSuccess";
|
|
4772
|
+
};
|
|
4773
|
+
};
|
|
4774
|
+
};
|
|
4775
|
+
};
|
|
4776
|
+
readonly 400: {
|
|
4777
|
+
readonly description: "Validation failed or OTP is invalid/expired.";
|
|
4778
|
+
readonly content: {
|
|
4779
|
+
readonly "application/json": {
|
|
4780
|
+
readonly schema: {
|
|
4781
|
+
readonly $ref: "#/components/schemas/VerifyOtpFailure";
|
|
4782
|
+
};
|
|
4783
|
+
};
|
|
4784
|
+
};
|
|
4785
|
+
};
|
|
4786
|
+
readonly 429: {
|
|
4787
|
+
readonly description: "Too Many Requests - Rate limit exceeded.";
|
|
4788
|
+
readonly content: {
|
|
4789
|
+
readonly "application/json": {
|
|
4790
|
+
readonly schema: {
|
|
4791
|
+
readonly $ref: "#/components/schemas/ErrorResponse";
|
|
4792
|
+
};
|
|
4793
|
+
};
|
|
4794
|
+
};
|
|
4795
|
+
};
|
|
4796
|
+
};
|
|
4797
|
+
};
|
|
4798
|
+
};
|
|
4629
4799
|
readonly "/auth/me": {
|
|
4630
4800
|
readonly get: {
|
|
4631
4801
|
readonly tags: readonly [
|
|
@@ -4989,7 +5159,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
4989
5159
|
"Workspace"
|
|
4990
5160
|
];
|
|
4991
5161
|
readonly summary: "Create a new workspace";
|
|
4992
|
-
readonly description: "Creates a workspace and its billing subscription atomically. Free starts a 15-day trial (default `TRIAL_WORKSPACE_LIMIT` is 1 Free trial per owner). Economy, Standard, and Professional create a pending invoice; use the returned invoiceId to start YooKassa checkout. An owner may have at most 5 pending unpaid invoices for those paid plans before creating another. Professional may create one complimentary workspace for an owner with an active paid Professional workspace.";
|
|
5162
|
+
readonly description: "Creates a workspace and its billing subscription atomically. Requires the caller to have both email and phone verified. Free starts a 15-day trial (default `TRIAL_WORKSPACE_LIMIT` is 1 Free trial per owner). Economy, Standard, and Professional create a pending invoice; use the returned invoiceId to start YooKassa checkout. An owner may have at most 5 pending unpaid invoices for those paid plans before creating another. Professional may create one complimentary workspace for an owner with an active paid Professional workspace.";
|
|
4993
5163
|
readonly security: readonly [
|
|
4994
5164
|
never
|
|
4995
5165
|
];
|
|
@@ -5074,7 +5244,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
5074
5244
|
};
|
|
5075
5245
|
};
|
|
5076
5246
|
readonly 403: {
|
|
5077
|
-
readonly description: "Forbidden - Token issuer is not 'access'.";
|
|
5247
|
+
readonly description: "Forbidden - Token issuer is not 'access', or email and phone are not both verified.";
|
|
5078
5248
|
readonly content: {
|
|
5079
5249
|
readonly "application/json": {
|
|
5080
5250
|
readonly schema: {
|
|
@@ -5855,7 +6025,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
5855
6025
|
"Workspace"
|
|
5856
6026
|
];
|
|
5857
6027
|
readonly summary: "Accept workspace invitation";
|
|
5858
|
-
readonly description: "Accepts a workspace invitation using the provided token. Requires authentication.";
|
|
6028
|
+
readonly description: "Accepts a workspace invitation using the provided token. Requires authentication and both email and phone verified.";
|
|
5859
6029
|
readonly security: readonly [
|
|
5860
6030
|
never
|
|
5861
6031
|
];
|
|
@@ -5914,7 +6084,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
5914
6084
|
};
|
|
5915
6085
|
};
|
|
5916
6086
|
readonly 403: {
|
|
5917
|
-
readonly description: "Forbidden - Token issuer is not 'access'
|
|
6087
|
+
readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access, or email and phone are not both verified.";
|
|
5918
6088
|
readonly content: {
|
|
5919
6089
|
readonly "application/json": {
|
|
5920
6090
|
readonly schema: {
|
|
@@ -12878,6 +13048,27 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
12878
13048
|
};
|
|
12879
13049
|
} & {
|
|
12880
13050
|
"/verify-otp": {
|
|
13051
|
+
$post: {
|
|
13052
|
+
input: {};
|
|
13053
|
+
output: {
|
|
13054
|
+
success: boolean;
|
|
13055
|
+
error: string | undefined;
|
|
13056
|
+
};
|
|
13057
|
+
outputFormat: "json";
|
|
13058
|
+
status: 200 | 400;
|
|
13059
|
+
} | {
|
|
13060
|
+
input: {};
|
|
13061
|
+
output: {
|
|
13062
|
+
success: boolean;
|
|
13063
|
+
accessToken: string | null;
|
|
13064
|
+
refreshToken: string | null;
|
|
13065
|
+
};
|
|
13066
|
+
outputFormat: "json";
|
|
13067
|
+
status: 200 | 400;
|
|
13068
|
+
};
|
|
13069
|
+
};
|
|
13070
|
+
} & {
|
|
13071
|
+
"/request-sms-otp": {
|
|
12881
13072
|
$post: {
|
|
12882
13073
|
input: {};
|
|
12883
13074
|
output: {
|
|
@@ -12886,6 +13077,26 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
12886
13077
|
};
|
|
12887
13078
|
outputFormat: "json";
|
|
12888
13079
|
status: 400;
|
|
13080
|
+
} | {
|
|
13081
|
+
input: {};
|
|
13082
|
+
output: {
|
|
13083
|
+
success: boolean;
|
|
13084
|
+
expiresAt: any;
|
|
13085
|
+
};
|
|
13086
|
+
outputFormat: "json";
|
|
13087
|
+
status: 200 | 400;
|
|
13088
|
+
};
|
|
13089
|
+
};
|
|
13090
|
+
} & {
|
|
13091
|
+
"/verify-sms-otp": {
|
|
13092
|
+
$post: {
|
|
13093
|
+
input: {};
|
|
13094
|
+
output: {
|
|
13095
|
+
success: boolean;
|
|
13096
|
+
error: string | undefined;
|
|
13097
|
+
};
|
|
13098
|
+
outputFormat: "json";
|
|
13099
|
+
status: 200 | 400;
|
|
12889
13100
|
} | {
|
|
12890
13101
|
input: {};
|
|
12891
13102
|
output: {
|
|
@@ -12905,7 +13116,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
12905
13116
|
success: true;
|
|
12906
13117
|
user: {
|
|
12907
13118
|
id: string;
|
|
12908
|
-
email: string;
|
|
13119
|
+
email: string | null;
|
|
13120
|
+
phone: string | null;
|
|
13121
|
+
emailVerified: boolean;
|
|
13122
|
+
phoneVerified: boolean;
|
|
12909
13123
|
firstName: string | null;
|
|
12910
13124
|
lastName: string | null;
|
|
12911
13125
|
profilePicture: string | null;
|
|
@@ -13339,6 +13553,20 @@ declare const routes: import("hono/hono-base").HonoBase<{
|
|
|
13339
13553
|
};
|
|
13340
13554
|
outputFormat: "json";
|
|
13341
13555
|
status: 400;
|
|
13556
|
+
} | {
|
|
13557
|
+
input: {
|
|
13558
|
+
param: {
|
|
13559
|
+
workspace: string;
|
|
13560
|
+
} & {
|
|
13561
|
+
token: string;
|
|
13562
|
+
};
|
|
13563
|
+
};
|
|
13564
|
+
output: {
|
|
13565
|
+
success: false;
|
|
13566
|
+
error: string;
|
|
13567
|
+
};
|
|
13568
|
+
outputFormat: "json";
|
|
13569
|
+
status: 403;
|
|
13342
13570
|
} | {
|
|
13343
13571
|
input: {
|
|
13344
13572
|
param: {
|