@mestra-dev/contract 0.0.136 → 0.0.137

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 +218 -0
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -5740,6 +5740,183 @@ declare const routes: import("hono/hono-base").HonoBase<{
5740
5740
  };
5741
5741
  };
5742
5742
  };
5743
+ readonly "/auth/request-voice-otp": {
5744
+ readonly post: {
5745
+ readonly tags: readonly [
5746
+ "Auth"
5747
+ ];
5748
+ readonly summary: "Request a one-time password by voice call";
5749
+ readonly description: "Without a bearer token this starts voice-call login/signup. With an access token it links a phone to the current account. Voice calls are sent through REDSMS only when dialCode is +7.";
5750
+ readonly security: readonly [
5751
+ never
5752
+ ];
5753
+ readonly requestBody: {
5754
+ readonly required: true;
5755
+ readonly content: {
5756
+ readonly "application/json": {
5757
+ readonly schema: {
5758
+ readonly type: "object";
5759
+ readonly required: readonly [
5760
+ "dialCode",
5761
+ "number"
5762
+ ];
5763
+ readonly properties: {
5764
+ readonly dialCode: {
5765
+ readonly type: "string";
5766
+ readonly description: "International dial code, with or without a leading +.";
5767
+ readonly example: "+7";
5768
+ };
5769
+ readonly number: {
5770
+ readonly type: "string";
5771
+ readonly description: "National phone number without the dial code.";
5772
+ readonly example: "9197286223";
5773
+ };
5774
+ };
5775
+ };
5776
+ };
5777
+ };
5778
+ };
5779
+ readonly responses: {
5780
+ readonly 200: {
5781
+ readonly description: "OTP generated and voice call queued successfully.";
5782
+ readonly content: {
5783
+ readonly "application/json": {
5784
+ readonly schema: {
5785
+ readonly $ref: "#/components/schemas/OtpRequestSuccess";
5786
+ };
5787
+ };
5788
+ };
5789
+ };
5790
+ readonly 400: {
5791
+ readonly description: "Validation failed, an active OTP already exists, or linking was rejected (phone already verified / in use).";
5792
+ readonly content: {
5793
+ readonly "application/json": {
5794
+ readonly schema: {
5795
+ readonly $ref: "#/components/schemas/OtpRequestFailure";
5796
+ };
5797
+ };
5798
+ };
5799
+ };
5800
+ readonly 403: {
5801
+ readonly description: "Authorization header was sent but the access token is missing, invalid, or expired.";
5802
+ readonly content: {
5803
+ readonly "application/json": {
5804
+ readonly schema: {
5805
+ readonly $ref: "#/components/schemas/ErrorResponse";
5806
+ };
5807
+ };
5808
+ };
5809
+ };
5810
+ readonly 429: {
5811
+ readonly description: "Too Many Requests - Rate limit exceeded.";
5812
+ readonly content: {
5813
+ readonly "application/json": {
5814
+ readonly schema: {
5815
+ readonly $ref: "#/components/schemas/ErrorResponse";
5816
+ };
5817
+ };
5818
+ };
5819
+ };
5820
+ };
5821
+ };
5822
+ };
5823
+ readonly "/auth/verify-voice-otp": {
5824
+ readonly post: {
5825
+ readonly tags: readonly [
5826
+ "Auth"
5827
+ ];
5828
+ readonly summary: "Verify a voice-call one-time password";
5829
+ readonly description: "Without a bearer token this completes voice-call login/signup and returns tokens. With an access token it verifies and attaches a phone to the current account.";
5830
+ readonly security: readonly [
5831
+ never
5832
+ ];
5833
+ readonly requestBody: {
5834
+ readonly required: true;
5835
+ readonly content: {
5836
+ readonly "application/json": {
5837
+ readonly schema: {
5838
+ readonly type: "object";
5839
+ readonly required: readonly [
5840
+ "dialCode",
5841
+ "number",
5842
+ "otp"
5843
+ ];
5844
+ readonly properties: {
5845
+ readonly dialCode: {
5846
+ readonly type: "string";
5847
+ readonly description: "International dial code, with or without a leading +.";
5848
+ readonly example: "+7";
5849
+ };
5850
+ readonly number: {
5851
+ readonly type: "string";
5852
+ readonly description: "National phone number without the dial code.";
5853
+ readonly example: "9197286223";
5854
+ };
5855
+ readonly otp: {
5856
+ readonly type: "string";
5857
+ readonly pattern: "^[0-9]{6}$";
5858
+ readonly description: "6-digit OTP code.";
5859
+ };
5860
+ readonly keepSignIn: {
5861
+ readonly type: "boolean";
5862
+ readonly description: "Login only. Extend refresh token validity to 30 days when true (default 7 days). Ignored when linking a contact.";
5863
+ };
5864
+ };
5865
+ };
5866
+ };
5867
+ };
5868
+ };
5869
+ readonly responses: {
5870
+ readonly 200: {
5871
+ readonly description: "Login returns tokens. Linking a phone to the current account returns success only (no new tokens).";
5872
+ readonly content: {
5873
+ readonly "application/json": {
5874
+ readonly schema: {
5875
+ readonly oneOf: readonly [
5876
+ {
5877
+ readonly $ref: "#/components/schemas/VerifyOtpSuccess";
5878
+ },
5879
+ {
5880
+ readonly $ref: "#/components/schemas/SimpleSuccess";
5881
+ }
5882
+ ];
5883
+ };
5884
+ };
5885
+ };
5886
+ };
5887
+ readonly 400: {
5888
+ readonly description: "Validation failed, OTP is invalid/expired, or linking was rejected.";
5889
+ readonly content: {
5890
+ readonly "application/json": {
5891
+ readonly schema: {
5892
+ readonly $ref: "#/components/schemas/VerifyOtpFailure";
5893
+ };
5894
+ };
5895
+ };
5896
+ };
5897
+ readonly 403: {
5898
+ readonly description: "Authorization header was sent but the access token is missing, invalid, or expired.";
5899
+ readonly content: {
5900
+ readonly "application/json": {
5901
+ readonly schema: {
5902
+ readonly $ref: "#/components/schemas/ErrorResponse";
5903
+ };
5904
+ };
5905
+ };
5906
+ };
5907
+ readonly 429: {
5908
+ readonly description: "Too Many Requests - Rate limit exceeded.";
5909
+ readonly content: {
5910
+ readonly "application/json": {
5911
+ readonly schema: {
5912
+ readonly $ref: "#/components/schemas/ErrorResponse";
5913
+ };
5914
+ };
5915
+ };
5916
+ };
5917
+ };
5918
+ };
5919
+ };
5743
5920
  readonly "/auth/me": {
5744
5921
  readonly get: {
5745
5922
  readonly tags: readonly [
@@ -15226,6 +15403,47 @@ declare const routes: import("hono/hono-base").HonoBase<{
15226
15403
  status: 200 | 400;
15227
15404
  };
15228
15405
  };
15406
+ } & {
15407
+ "/request-voice-otp": {
15408
+ $post: {
15409
+ input: {};
15410
+ output: {
15411
+ success: false;
15412
+ error: never;
15413
+ };
15414
+ outputFormat: "json";
15415
+ status: 400;
15416
+ } | {
15417
+ input: {};
15418
+ output: {
15419
+ success: boolean;
15420
+ expiresAt: any;
15421
+ };
15422
+ outputFormat: "json";
15423
+ status: 200 | 400;
15424
+ };
15425
+ };
15426
+ } & {
15427
+ "/verify-voice-otp": {
15428
+ $post: {
15429
+ input: {};
15430
+ output: {
15431
+ success: boolean;
15432
+ error: string | undefined;
15433
+ };
15434
+ outputFormat: "json";
15435
+ status: 200 | 400;
15436
+ } | {
15437
+ input: {};
15438
+ output: {
15439
+ success: boolean;
15440
+ accessToken: string | null;
15441
+ refreshToken: string | null;
15442
+ };
15443
+ outputFormat: "json";
15444
+ status: 200 | 400;
15445
+ };
15446
+ };
15229
15447
  } & {
15230
15448
  "/me": {
15231
15449
  $get: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mestra-dev/contract",
3
- "version": "0.0.136",
3
+ "version": "0.0.137",
4
4
  "description": "Types-only Hono AppType contract for the Mestra auth API",
5
5
  "type": "module",
6
6
  "sideEffects": false,