@movmo_app/types 1.21.0 → 1.23.0

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/auth.d.ts CHANGED
@@ -1,32 +1,7 @@
1
- export declare enum AuthenticationUsernameType {
2
- EMAIL = "email",
3
- PHONE_NUMBER = "phoneNumber"
4
- }
5
- export declare enum AuthenticationUserStatus {
6
- CONFIRMED = "CONFIRMED",
7
- UNCONFIRMED = "UNCONFIRMED"
8
- }
9
- export declare enum AuthenticationChallengeName {
10
- SMS_OTP = "SMS_OTP",
11
- EMAIL_OTP = "EMAIL_OTP",
12
- CONFIRM_SIGN_UP = "CONFIRM_SIGN_UP"
13
- }
14
- export declare enum AuthenticationChallengeResponse {
15
- SMS_OTP_CODE = "SMS_OTP_CODE",
16
- EMAIL_OTP_CODE = "EMAIL_OTP_CODE"
17
- }
18
1
  export declare enum OTPAction {
19
2
  EMAILED = "emailed",
20
3
  TEXTED = "texted"
21
4
  }
22
- /**
23
- * Response from the login endpoint.
24
- */
25
- export type LoginUserResponse = {
26
- session: string;
27
- challengeName?: AuthenticationChallengeName;
28
- username?: string;
29
- };
30
5
  export type WebAuthnOptionsJSON = {
31
6
  publicKey: Record<string, unknown>;
32
7
  mediation?: string;
@@ -53,5 +28,11 @@ export type PasskeyOptionsResponse = {
53
28
  export type MovmoVerifyResponse = {
54
29
  user_id: string;
55
30
  new_user: boolean;
31
+ /** RFC3339 end of the account-recovery cool-down; present only for recovery sign-ins (MOVMO-687). */
32
+ recovery_until?: string;
33
+ };
34
+ /** POST /v1/auth/recovery/cancel body: the `rc1.`-prefixed token from the recovery notification email. */
35
+ export type MovmoRecoveryCancelRequest = {
36
+ token: string;
56
37
  };
57
- export type AuthErrorCode = 'invalid_email' | 'rate_limited' | 'resend_too_soon' | 'flow_expired' | 'invalid_code' | 'too_many_attempts' | 'invalid_request' | 'invalid_credential' | 'topOrigin_required' | 'passkey_limit' | 'credential_exists' | 'not_found' | 'reauth_required' | 'movmo_session_required' | 'first_party_only' | 'issuer_unavailable' | 'passkey_failed' | 'sign_in_failed';
38
+ export type AuthErrorCode = 'invalid_email' | 'rate_limited' | 'resend_too_soon' | 'flow_expired' | 'invalid_code' | 'too_many_attempts' | 'invalid_request' | 'invalid_credential' | 'topOrigin_required' | 'passkey_limit' | 'credential_exists' | 'not_found' | 'reauth_required' | 'movmo_session_required' | 'first_party_only' | 'issuer_unavailable' | 'passkey_failed' | 'sign_in_failed' | 'recovery_required' | 'recovery_blocked' | 'recovery_cooldown' | 'code_sends_paused';
package/dist/auth.js CHANGED
@@ -1,27 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OTPAction = exports.AuthenticationChallengeResponse = exports.AuthenticationChallengeName = exports.AuthenticationUserStatus = exports.AuthenticationUsernameType = void 0;
4
- var AuthenticationUsernameType;
5
- (function (AuthenticationUsernameType) {
6
- AuthenticationUsernameType["EMAIL"] = "email";
7
- AuthenticationUsernameType["PHONE_NUMBER"] = "phoneNumber";
8
- })(AuthenticationUsernameType || (exports.AuthenticationUsernameType = AuthenticationUsernameType = {}));
9
- var AuthenticationUserStatus;
10
- (function (AuthenticationUserStatus) {
11
- AuthenticationUserStatus["CONFIRMED"] = "CONFIRMED";
12
- AuthenticationUserStatus["UNCONFIRMED"] = "UNCONFIRMED";
13
- })(AuthenticationUserStatus || (exports.AuthenticationUserStatus = AuthenticationUserStatus = {}));
14
- var AuthenticationChallengeName;
15
- (function (AuthenticationChallengeName) {
16
- AuthenticationChallengeName["SMS_OTP"] = "SMS_OTP";
17
- AuthenticationChallengeName["EMAIL_OTP"] = "EMAIL_OTP";
18
- AuthenticationChallengeName["CONFIRM_SIGN_UP"] = "CONFIRM_SIGN_UP";
19
- })(AuthenticationChallengeName || (exports.AuthenticationChallengeName = AuthenticationChallengeName = {}));
20
- var AuthenticationChallengeResponse;
21
- (function (AuthenticationChallengeResponse) {
22
- AuthenticationChallengeResponse["SMS_OTP_CODE"] = "SMS_OTP_CODE";
23
- AuthenticationChallengeResponse["EMAIL_OTP_CODE"] = "EMAIL_OTP_CODE";
24
- })(AuthenticationChallengeResponse || (exports.AuthenticationChallengeResponse = AuthenticationChallengeResponse = {}));
3
+ exports.OTPAction = void 0;
25
4
  var OTPAction;
26
5
  (function (OTPAction) {
27
6
  OTPAction["EMAILED"] = "emailed";
@@ -1,15 +1,12 @@
1
1
  /**
2
- * OTPDeliveryMethod represents how one-time passcodes are delivered.
3
- */
4
- export type OTPDeliveryMethod = 'email_and_phone' | 'email_only' | 'phone_only';
5
- /**
6
- * SecurityPreferences represents a user's OTP delivery preference settings.
2
+ * SecurityPreferences represents a user's security settings.
3
+ * phone_number_verified comes from Postgres `users.phone_verified_at` since MOVMO-706.
7
4
  */
8
5
  export type SecurityPreferences = {
9
6
  user_id: string;
10
- otp_delivery_method: OTPDeliveryMethod;
11
7
  phone_number_verified: boolean;
12
- updated_at?: string;
8
+ /** RFC3339 end of the account-recovery cool-down, or null when none is active (MOVMO-687). */
9
+ recovery_until: string | null;
13
10
  };
14
11
  /**
15
12
  * AuthEvent represents a recorded authentication event returned by
@@ -18,7 +15,7 @@ export type SecurityPreferences = {
18
15
  export type AuthEvent = {
19
16
  id: string;
20
17
  user_id: string;
21
- event_type: 'sign_in' | 'sign_up' | 'email_change' | 'phone_change' | 'passkey_added' | 'passkey_removed';
18
+ event_type: 'sign_in' | 'sign_up' | 'email_change' | 'phone_change' | 'passkey_added' | 'passkey_removed' | 'recovery_started' | 'recovery_blocked' | 'recovery_cancelled';
22
19
  browser: string;
23
20
  device_type: string;
24
21
  os: string;
@@ -28,7 +25,7 @@ export type AuthEvent = {
28
25
  timezone: string;
29
26
  created_at: string;
30
27
  /** How the traveler authenticated (server: `user_auth_events.method`, MOVMO-705). */
31
- method?: 'otp' | 'passkey';
28
+ method?: 'otp' | 'passkey' | 'recovery';
32
29
  };
33
30
  /**
34
31
  * @deprecated Use AuthEvent instead. This type was a placeholder before the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@movmo_app/types",
3
- "version": "1.21.0",
3
+ "version": "1.23.0",
4
4
  "description": "A collection of Movmo's types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",