-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtypes.ts
More file actions
156 lines (132 loc) · 3.01 KB
/
types.ts
File metadata and controls
156 lines (132 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
import type { ErrorCode } from './error';
export interface AuthsignalResponse<T> {
data?: T;
error?: string;
errorCode?: ErrorCode | string;
}
export interface TokenPayload {
aud: string;
exp: number;
iat: number;
other: {
actionCode: string;
idempotencyKey: string;
publishableKey: string;
tenantId: string;
userId: string;
username: string;
};
scope?: string;
sub: string;
}
export interface SignUpResponse {
token: string;
}
export interface SignInResponse {
isVerified: boolean;
token?: string;
userId?: string;
userAuthenticatorId?: string;
username?: string;
displayName?: string;
}
export interface VerifyInput {
code: string;
}
export interface VerifyResponse {
isVerified: boolean;
token?: string;
failureReason?: string;
}
export interface AddCredentialInput {
token?: string;
requireUserAuthentication?: boolean;
keychainAccess?: KeychainAccess;
appAttestation?: boolean;
}
export interface AppChallenge {
challengeId: string;
actionCode?: string;
idempotencyKey?: string;
userAgent?: string;
deviceId?: string;
ipAddress?: string;
}
export interface AppCredential {
credentialId: string;
createdAt: string;
userId: string;
lastAuthenticatedAt?: string;
}
export interface ClaimChallengeInput {
challengeId: string;
}
export interface ClaimChallengeResponse {
success: boolean;
userAgent?: string;
ipAddress?: string;
actionCode?: string;
idempotencyKey?: string;
}
export interface UpdateChallengeInput {
challengeId: string;
approved: boolean;
verificationCode?: string | null;
}
export interface InAppGetCredentialInput {
username?: string;
}
export interface InAppAddCredentialInput extends AddCredentialInput {
username?: string;
}
export interface InAppRemoveCredentialInput {
username?: string;
}
export interface InAppVerifyInput {
action?: string;
username?: string;
}
export interface InAppVerifyResponse {
token: string;
userId: string;
userAuthenticatorId: string;
username?: string;
}
export interface CreatePinInput {
pin: string;
username: string;
token?: string;
}
export interface VerifyPinInput {
pin: string;
username: string;
action?: string;
}
export interface VerifyPinResponse {
isVerified: boolean;
token?: string;
userId?: string;
}
export interface DeletePinInput {
username: string;
}
export interface LaunchOptions {
mode?: 'popup' | 'redirect';
}
export enum KeychainAccess {
afterFirstUnlock = 'afterFirstUnlock',
afterFirstUnlockThisDeviceOnly = 'afterFirstUnlockThisDeviceOnly',
whenUnlocked = 'whenUnlocked',
whenUnlockedThisDeviceOnly = 'whenUnlockedThisDeviceOnly',
whenPasscodeSetThisDeviceOnly = 'whenPasscodeSetThisDeviceOnly',
}
export enum UserActionState {
ALLOW = 'ALLOW',
BLOCK = 'BLOCK',
CHALLENGE_REQUIRED = 'CHALLENGE_REQUIRED',
CHALLENGE_SUCCEEDED = 'CHALLENGE_SUCCEEDED',
CHALLENGE_FAILED = 'CHALLENGE_FAILED',
REVIEW_REQUIRED = 'REVIEW_REQUIRED',
REVIEW_SUCCEEDED = 'REVIEW_SUCCEEDED',
REVIEW_FAILED = 'REVIEW_FAILED',
}