-
Notifications
You must be signed in to change notification settings - Fork 2.9k
/
Account.ts
128 lines (90 loc) · 3.87 KB
/
Account.ts
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
import type {ValueOf} from 'type-fest';
import type CONST from '@src/CONST';
import type {TranslationPaths} from '@src/languages/types';
import type DismissedReferralBanners from './DismissedReferralBanners';
import type * as OnyxCommon from './OnyxCommon';
/** Two factor authentication steps */
type TwoFactorAuthStep = ValueOf<typeof CONST.TWO_FACTOR_AUTH_STEPS> | '';
/** The role of the delegate */
type DelegateRole = ValueOf<typeof CONST.DELEGATE_ROLE>;
/** Model of delegate */
type Delegate = {
/** The email of the delegate */
email: string;
/** The role of the delegate */
role: DelegateRole;
/** Authentication failure errors */
error?: TranslationPaths;
};
/** Model of delegated access data */
type DelegatedAccess = {
/** The users that can access your account as a delegate */
delegates?: Delegate[];
/** The the users you can access as a delegate */
delegators?: Delegate[];
/** The email of original user when they are acting as a delegate for another account */
delegate?: string;
/** Authentication failure errors when disconnecting as a copilot */
error?: TranslationPaths;
};
/** Model of user account */
type Account = {
/** Whether SAML is enabled for the current account */
isSAMLEnabled?: boolean;
/** Whether SAML is required for the current account */
isSAMLRequired?: boolean;
/** Is this account having trouble receiving emails? */
hasEmailDeliveryFailure?: boolean;
/** URL to the assigned guide's appointment booking calendar */
guideCalendarLink?: string;
/** User recovery codes for setting up 2-FA */
recoveryCodes?: string;
/** Secret key to enable 2FA within the authenticator app */
twoFactorAuthSecretKey?: string;
/** Whether this account has 2FA enabled or not */
requiresTwoFactorAuth?: boolean;
/** Whether this account needs 2FA setup before it can be used. eg: 2FA is required when Xero integration is enabled */
needsTwoFactorAuthSetup?: boolean;
/** Whether the account is validated */
validated?: boolean;
/** The primaryLogin associated with the account */
primaryLogin?: string;
/** The message to be displayed when code requested */
message?: string;
/** Form that is being loaded */
loadingForm?: ValueOf<typeof CONST.FORMS>;
/** Whether the user forgot their password */
forgotPassword?: boolean;
/** Whether the account exists */
accountExists?: boolean;
/** Is the account / domain under domain control? */
domainControlled?: boolean;
/** Whether the validation code has expired */
validateCodeExpired?: boolean;
/** Whether a sign is loading */
isLoading?: boolean;
/** Authentication failure errors */
errors?: OnyxCommon.Errors | null;
/** Authentication success message */
success?: string;
/** Whether the two factor authentication codes were copied */
codesAreCopied?: boolean;
/** Current two factor authentication step */
twoFactorAuthStep?: TwoFactorAuthStep;
/** Referral banners that the user dismissed */
dismissedReferralBanners?: DismissedReferralBanners;
/** Indicates whether the user is an approved accountant */
isApprovedAccountant?: boolean;
/** Indicates whether the user is a client of an approved accountant */
isApprovedAccountantClient?: boolean;
/** Indicates whether the user can downgrade current subscription plan */
canDowngrade?: boolean;
/** Indicates whether the user can downgrade current subscription plan */
isEligibleForRefund?: boolean;
/** Indicates whether the user has at least one previous purchase */
hasPurchases?: boolean;
/** The users you can access as delegate and the users who can access your account as a delegate */
delegatedAccess?: DelegatedAccess;
};
export default Account;
export type {TwoFactorAuthStep, DelegateRole, DelegatedAccess};