@movmo_app/types 1.20.0 → 1.21.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 +28 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/passkeys.d.ts +18 -0
- package/dist/passkeys.js +2 -0
- package/dist/sessions.d.ts +3 -1
- package/package.json +1 -1
package/dist/auth.d.ts
CHANGED
|
@@ -27,3 +27,31 @@ export type LoginUserResponse = {
|
|
|
27
27
|
challengeName?: AuthenticationChallengeName;
|
|
28
28
|
username?: string;
|
|
29
29
|
};
|
|
30
|
+
export type WebAuthnOptionsJSON = {
|
|
31
|
+
publicKey: Record<string, unknown>;
|
|
32
|
+
mediation?: string;
|
|
33
|
+
};
|
|
34
|
+
export type MovmoCodeFlow = {
|
|
35
|
+
flow_id: string;
|
|
36
|
+
next: 'code';
|
|
37
|
+
code_length: number;
|
|
38
|
+
expires_in: number;
|
|
39
|
+
resend_after: number;
|
|
40
|
+
};
|
|
41
|
+
export type MovmoPasskeyFlow = {
|
|
42
|
+
flow_id: string;
|
|
43
|
+
next: 'passkey';
|
|
44
|
+
options: WebAuthnOptionsJSON;
|
|
45
|
+
code_length: number;
|
|
46
|
+
expires_in: number;
|
|
47
|
+
};
|
|
48
|
+
export type MovmoLoginResponse = MovmoCodeFlow | MovmoPasskeyFlow;
|
|
49
|
+
export type PasskeyOptionsResponse = {
|
|
50
|
+
flow_id: string;
|
|
51
|
+
options: WebAuthnOptionsJSON;
|
|
52
|
+
};
|
|
53
|
+
export type MovmoVerifyResponse = {
|
|
54
|
+
user_id: string;
|
|
55
|
+
new_user: boolean;
|
|
56
|
+
};
|
|
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';
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WebAuthnOptionsJSON } from './auth';
|
|
2
|
+
export type PasskeyKind = 'synced' | 'device' | 'security_key';
|
|
3
|
+
/**
|
|
4
|
+
* `kind` is optional so the UI tolerates a monolith that predates Task 2: it
|
|
5
|
+
* falls back to `synced ? 'synced' : 'device'`.
|
|
6
|
+
*/
|
|
7
|
+
export type PasskeySummary = {
|
|
8
|
+
id: string;
|
|
9
|
+
provider: string;
|
|
10
|
+
created_at: string;
|
|
11
|
+
last_used_at: string | null;
|
|
12
|
+
synced: boolean;
|
|
13
|
+
kind?: PasskeyKind;
|
|
14
|
+
};
|
|
15
|
+
export type PasskeyRegistrationStart = {
|
|
16
|
+
flow_id: string;
|
|
17
|
+
options: WebAuthnOptionsJSON;
|
|
18
|
+
};
|
package/dist/passkeys.js
ADDED
package/dist/sessions.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type SecurityPreferences = {
|
|
|
18
18
|
export type AuthEvent = {
|
|
19
19
|
id: string;
|
|
20
20
|
user_id: string;
|
|
21
|
-
event_type: 'sign_in' | 'sign_up' | 'email_change' | 'phone_change';
|
|
21
|
+
event_type: 'sign_in' | 'sign_up' | 'email_change' | 'phone_change' | 'passkey_added' | 'passkey_removed';
|
|
22
22
|
browser: string;
|
|
23
23
|
device_type: string;
|
|
24
24
|
os: string;
|
|
@@ -27,6 +27,8 @@ export type AuthEvent = {
|
|
|
27
27
|
country: string;
|
|
28
28
|
timezone: string;
|
|
29
29
|
created_at: string;
|
|
30
|
+
/** How the traveler authenticated (server: `user_auth_events.method`, MOVMO-705). */
|
|
31
|
+
method?: 'otp' | 'passkey';
|
|
30
32
|
};
|
|
31
33
|
/**
|
|
32
34
|
* @deprecated Use AuthEvent instead. This type was a placeholder before the
|