forked from clerk/javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserSettings.ts
More file actions
132 lines (111 loc) · 2.97 KB
/
Copy pathuserSettings.ts
File metadata and controls
132 lines (111 loc) · 2.97 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
import type { ClerkResourceJSON } from './json';
import type { ClerkResource } from './resource';
import type { OAuthStrategy, Web3Strategy } from './strategies';
export type Attribute =
| 'email_address'
| 'phone_number'
| 'username'
| 'first_name'
| 'last_name'
| 'password'
| 'web3_wallet'
| 'authenticator_app'
| 'backup_code'
| 'passkey';
export type VerificationStrategy = 'email_link' | 'email_code' | 'phone_code' | 'totp' | 'backup_code';
export type OAuthProviderSettings = {
enabled: boolean;
required: boolean;
authenticatable: boolean;
strategy: OAuthStrategy;
name: string;
logo_url: string | null;
};
export type AttributeDataJSON = {
enabled: boolean;
required: boolean;
verifications: VerificationStrategy[];
used_for_first_factor: boolean;
first_factors: VerificationStrategy[];
used_for_second_factor: boolean;
second_factors: VerificationStrategy[];
verify_at_sign_up: boolean;
};
export type AttributeData = AttributeDataJSON & {
name: Attribute;
};
export type SignInData = {
second_factor: {
required: boolean;
enabled: boolean;
};
};
export type SignUpModes = 'public' | 'restricted' | 'waitlist';
export type SignUpData = {
allowlist_only: boolean;
progressive: boolean;
captcha_enabled: boolean;
mode: SignUpModes;
legal_consent_enabled: boolean;
};
export type PasswordSettingsData = {
allowed_special_characters: string;
disable_hibp: boolean;
min_length: number;
max_length: number;
require_special_char: boolean;
require_numbers: boolean;
require_uppercase: boolean;
require_lowercase: boolean;
show_zxcvbn: boolean;
min_zxcvbn_strength: number;
};
export type PasskeySettingsData = {
allow_autofill: boolean;
show_sign_in_button: boolean;
};
export type OAuthProviders = {
[provider in OAuthStrategy]: OAuthProviderSettings;
};
export type SamlSettings = {
enabled: boolean;
};
export type AttributesJSON = {
[attribute in Attribute]: AttributeDataJSON;
};
export type Attributes = {
[attribute in Attribute]: AttributeData;
};
export type Actions = {
delete_self: boolean;
create_organization: boolean;
};
export interface UserSettingsJSON extends ClerkResourceJSON {
id: never;
object: never;
attributes: AttributesJSON;
actions: Actions;
social: OAuthProviders;
saml: SamlSettings;
sign_in: SignInData;
sign_up: SignUpData;
password_settings: PasswordSettingsData;
passkey_settings: PasskeySettingsData;
}
export interface UserSettingsResource extends ClerkResource {
id?: undefined;
social: OAuthProviders;
saml: SamlSettings;
attributes: Attributes;
actions: Actions;
signIn: SignInData;
signUp: SignUpData;
passwordSettings: PasswordSettingsData;
passkeySettings: PasskeySettingsData;
socialProviderStrategies: OAuthStrategy[];
authenticatableSocialStrategies: OAuthStrategy[];
web3FirstFactors: Web3Strategy[];
enabledFirstFactorIdentifiers: Attribute[];
instanceIsPasswordBased: boolean;
hasValidAuthFactor: boolean;
}