@mestra-dev/contract 0.0.60 → 0.0.62

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 +179 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -796,6 +796,10 @@ declare const routes: import("hono/hono-base").HonoBase<{
796
796
  readonly type: "string";
797
797
  readonly format: "email";
798
798
  };
799
+ readonly phone: {
800
+ readonly type: "string";
801
+ readonly nullable: true;
802
+ };
799
803
  readonly firstName: {
800
804
  readonly type: "string";
801
805
  readonly nullable: true;
@@ -4626,6 +4630,136 @@ declare const routes: import("hono/hono-base").HonoBase<{
4626
4630
  };
4627
4631
  };
4628
4632
  };
4633
+ readonly "/auth/request-sms-otp": {
4634
+ readonly post: {
4635
+ readonly tags: readonly [
4636
+ "Auth"
4637
+ ];
4638
+ readonly summary: "Request a one-time password by SMS";
4639
+ readonly requestBody: {
4640
+ readonly required: true;
4641
+ readonly content: {
4642
+ readonly "application/json": {
4643
+ readonly schema: {
4644
+ readonly type: "object";
4645
+ readonly required: readonly [
4646
+ "phone"
4647
+ ];
4648
+ readonly properties: {
4649
+ readonly phone: {
4650
+ readonly type: "string";
4651
+ readonly description: "Phone number in E.164 format. Russian numbers starting with 8 or 7 are normalized to +7.";
4652
+ readonly example: "+79001234567";
4653
+ };
4654
+ };
4655
+ };
4656
+ };
4657
+ };
4658
+ };
4659
+ readonly responses: {
4660
+ readonly 200: {
4661
+ readonly description: "OTP generated and sent successfully.";
4662
+ readonly content: {
4663
+ readonly "application/json": {
4664
+ readonly schema: {
4665
+ readonly $ref: "#/components/schemas/OtpRequestSuccess";
4666
+ };
4667
+ };
4668
+ };
4669
+ };
4670
+ readonly 400: {
4671
+ readonly description: "Validation failed or an active OTP already exists.";
4672
+ readonly content: {
4673
+ readonly "application/json": {
4674
+ readonly schema: {
4675
+ readonly $ref: "#/components/schemas/OtpRequestFailure";
4676
+ };
4677
+ };
4678
+ };
4679
+ };
4680
+ readonly 429: {
4681
+ readonly description: "Too Many Requests - Rate limit exceeded.";
4682
+ readonly content: {
4683
+ readonly "application/json": {
4684
+ readonly schema: {
4685
+ readonly $ref: "#/components/schemas/ErrorResponse";
4686
+ };
4687
+ };
4688
+ };
4689
+ };
4690
+ };
4691
+ };
4692
+ };
4693
+ readonly "/auth/verify-sms-otp": {
4694
+ readonly post: {
4695
+ readonly tags: readonly [
4696
+ "Auth"
4697
+ ];
4698
+ readonly summary: "Verify an SMS one-time password";
4699
+ readonly requestBody: {
4700
+ readonly required: true;
4701
+ readonly content: {
4702
+ readonly "application/json": {
4703
+ readonly schema: {
4704
+ readonly type: "object";
4705
+ readonly required: readonly [
4706
+ "phone",
4707
+ "otp"
4708
+ ];
4709
+ readonly properties: {
4710
+ readonly phone: {
4711
+ readonly type: "string";
4712
+ readonly description: "Phone number in E.164 format. Russian numbers starting with 8 or 7 are normalized to +7.";
4713
+ readonly example: "+79001234567";
4714
+ };
4715
+ readonly otp: {
4716
+ readonly type: "string";
4717
+ readonly pattern: "^[0-9]{6}$";
4718
+ readonly description: "6-digit OTP code.";
4719
+ };
4720
+ readonly keepSignIn: {
4721
+ readonly type: "boolean";
4722
+ readonly description: "Extend refresh token validity to 30 days when true (default 7 days).";
4723
+ };
4724
+ };
4725
+ };
4726
+ };
4727
+ };
4728
+ };
4729
+ readonly responses: {
4730
+ readonly 200: {
4731
+ readonly description: "OTP verified successfully.";
4732
+ readonly content: {
4733
+ readonly "application/json": {
4734
+ readonly schema: {
4735
+ readonly $ref: "#/components/schemas/VerifyOtpSuccess";
4736
+ };
4737
+ };
4738
+ };
4739
+ };
4740
+ readonly 400: {
4741
+ readonly description: "Validation failed or OTP is invalid/expired.";
4742
+ readonly content: {
4743
+ readonly "application/json": {
4744
+ readonly schema: {
4745
+ readonly $ref: "#/components/schemas/VerifyOtpFailure";
4746
+ };
4747
+ };
4748
+ };
4749
+ };
4750
+ readonly 429: {
4751
+ readonly description: "Too Many Requests - Rate limit exceeded.";
4752
+ readonly content: {
4753
+ readonly "application/json": {
4754
+ readonly schema: {
4755
+ readonly $ref: "#/components/schemas/ErrorResponse";
4756
+ };
4757
+ };
4758
+ };
4759
+ };
4760
+ };
4761
+ };
4762
+ };
4629
4763
  readonly "/auth/me": {
4630
4764
  readonly get: {
4631
4765
  readonly tags: readonly [
@@ -6292,7 +6426,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6292
6426
  };
6293
6427
  };
6294
6428
  readonly 400: {
6295
- readonly description: "Invalid request payload, confirm text does not match, or user is not the owner of the workspace.";
6429
+ readonly description: "Invalid request payload, confirm text does not match, user is not the owner, or the workspace is a Free trial (`Free trial workspaces cannot be deleted`).";
6296
6430
  readonly content: {
6297
6431
  readonly "application/json": {
6298
6432
  readonly schema: {
@@ -6312,7 +6446,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
6312
6446
  };
6313
6447
  };
6314
6448
  readonly 403: {
6315
- readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access or crm::general write, the workspace is a Free trial (`Free trial workspaces cannot be deleted`), or the workspace is frozen/past-due/has an open YooKassa checkout (delete is only exempt for an unpaid initial invoice with no checkout).";
6449
+ readonly description: "Forbidden - Token issuer is not 'access', user lacks workspace access or crm::general write, or the workspace is frozen/past-due/has an open YooKassa checkout (delete is only exempt for an unpaid initial invoice with no checkout).";
6316
6450
  readonly content: {
6317
6451
  readonly "application/json": {
6318
6452
  readonly schema: {
@@ -12897,6 +13031,47 @@ declare const routes: import("hono/hono-base").HonoBase<{
12897
13031
  status: 200 | 400;
12898
13032
  };
12899
13033
  };
13034
+ } & {
13035
+ "/request-sms-otp": {
13036
+ $post: {
13037
+ input: {};
13038
+ output: {
13039
+ success: false;
13040
+ error: never;
13041
+ };
13042
+ outputFormat: "json";
13043
+ status: 400;
13044
+ } | {
13045
+ input: {};
13046
+ output: {
13047
+ success: boolean;
13048
+ expiresAt: any;
13049
+ };
13050
+ outputFormat: "json";
13051
+ status: 200 | 400;
13052
+ };
13053
+ };
13054
+ } & {
13055
+ "/verify-sms-otp": {
13056
+ $post: {
13057
+ input: {};
13058
+ output: {
13059
+ success: false;
13060
+ error: never;
13061
+ };
13062
+ outputFormat: "json";
13063
+ status: 400;
13064
+ } | {
13065
+ input: {};
13066
+ output: {
13067
+ success: boolean;
13068
+ accessToken: string | null;
13069
+ refreshToken: string | null;
13070
+ };
13071
+ outputFormat: "json";
13072
+ status: 200 | 400;
13073
+ };
13074
+ };
12900
13075
  } & {
12901
13076
  "/me": {
12902
13077
  $get: {
@@ -12906,6 +13081,7 @@ declare const routes: import("hono/hono-base").HonoBase<{
12906
13081
  user: {
12907
13082
  id: string;
12908
13083
  email: string;
13084
+ phone: string | null;
12909
13085
  firstName: string | null;
12910
13086
  lastName: string | null;
12911
13087
  profilePicture: string | null;
@@ -14189,11 +14365,11 @@ declare const routes: import("hono/hono-base").HonoBase<{
14189
14365
  email: string | null;
14190
14366
  workspaceId: string;
14191
14367
  description: string | null;
14368
+ phone: string | null;
14192
14369
  updated_at: string | null;
14193
14370
  deleted_at: string | null;
14194
14371
  verified_at: string | null;
14195
14372
  suspended_at: string | null;
14196
- phone: string | null;
14197
14373
  website: string | null;
14198
14374
  companyPhone: string | null;
14199
14375
  companyAddress: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.60",
3
+ "version": "0.0.62",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,