1 import type { ThemeSetting } from '@proton/shared/lib/themes/themes';
3 import type { DENSITY } from '../constants';
4 import type { RegisteredKey } from '../webauthn/interface';
5 import type { ChecklistId } from './Checklist';
7 export enum SETTINGS_STATUS {
13 export enum SETTINGS_PASSWORD_MODE {
14 ONE_PASSWORD_MODE = 1,
15 TWO_PASSWORD_MODE = 2,
18 export enum SETTINGS_LOG_AUTH_STATE {
24 export enum SETTINGS_PROTON_SENTINEL_STATE {
29 export enum DARK_WEB_MONITORING_STATE {
34 export enum DARK_WEB_MONITORING_EMAILS_STATE {
39 export enum DARK_WEB_MONITORING_ELIGIBILITY_STATE {
44 export enum SETTINGS_WEEK_START {
55 export enum SETTINGS_DATE_FORMAT {
62 export enum SETTINGS_TIME_FORMAT {
68 export enum SETTINGS_2FA_ENABLED {
73 export const enum DRAWER_VISIBILITY {
78 export interface Flags {
80 SupportPgpV6Keys: number;
83 export enum AI_ASSISTANT_ACCESS {
90 export const USED_CLIENT_FLAGS = {
91 OTHER: BigInt(Math.pow(2, 0)),
92 // Available: BigInt(Math.pow(2, 1)),
93 WEB_DOCS: BigInt(Math.pow(2, 2)),
94 IMPORT_EXPORT: BigInt(Math.pow(2, 3)),
95 BRIDGE: BigInt(Math.pow(2, 4)),
96 ADMIN: BigInt(Math.pow(2, 5)),
97 WEB_VPN_SETTINGS: BigInt(Math.pow(2, 6)),
98 WEB_MAIL_SETTINGS: BigInt(Math.pow(2, 7)),
99 WEB: BigInt(Math.pow(2, 8)),
100 WEB_CALENDAR: BigInt(Math.pow(2, 9)),
101 WEB_CONTACTS: BigInt(Math.pow(2, 10)),
102 WEB_DRIVE: BigInt(Math.pow(2, 11)),
103 WEB_MAIL: BigInt(Math.pow(2, 12)),
104 WEB_VPN: BigInt(Math.pow(2, 13)),
105 WEB_ACCOUNT: BigInt(Math.pow(2, 14)),
106 WEB_WALLET: BigInt(Math.pow(2, 15)),
107 IOS_WALLET: BigInt(Math.pow(2, 16)),
108 ANDROID_WALLET: BigInt(Math.pow(2, 17)),
109 WINDOWS_WALLET: BigInt(Math.pow(2, 18)),
110 LINUX_WALLET: BigInt(Math.pow(2, 19)),
111 BROWSER_VPN: BigInt(Math.pow(2, 20)),
112 MACOS_WALLET: BigInt(Math.pow(2, 21)),
113 WINDOWS_INBOX: BigInt(Math.pow(2, 22)),
114 WEB_ADMIN: BigInt(Math.pow(2, 23)),
115 WINDOWS_EPPIE: BigInt(Math.pow(2, 24)),
116 WINDOWS_BRIDGE: BigInt(Math.pow(2, 25)),
117 WINDOWS_DRIVE: BigInt(Math.pow(2, 26)),
118 WINDOWS_IMPORT_EXPORT: BigInt(Math.pow(2, 27)),
119 WINDOWS_VPN: BigInt(Math.pow(2, 28)),
120 WINDOWS_EXPORT: BigInt(Math.pow(2, 29)),
121 LINUX_EPPIE: BigInt(Math.pow(2, 30)),
122 LINUX_EXPORT: BigInt(Math.pow(2, 31)),
123 LINUX_IMPORT_EXPORT: BigInt(Math.pow(2, 32)),
124 LINUX_BRIDGE: BigInt(Math.pow(2, 33)),
125 LINUX_VPN: BigInt(Math.pow(2, 34)),
126 LINUX_PASS: BigInt(Math.pow(2, 35)),
127 ANDROID_PASS: BigInt(Math.pow(2, 36)),
128 IOS_PASS: BigInt(Math.pow(2, 37)),
129 WEB_PASS: BigInt(Math.pow(2, 38)),
130 MACOS_PASS: BigInt(Math.pow(2, 39)),
131 WINDOWS_PASS: BigInt(Math.pow(2, 40)),
132 MACOS_BRIDGE: BigInt(Math.pow(2, 41)),
133 MACOS_DRIVE: BigInt(Math.pow(2, 42)),
134 MACOS_IMPORT_EXPORT: BigInt(Math.pow(2, 43)),
135 MACOS_VPN: BigInt(Math.pow(2, 44)),
136 MACOS_EXPORT: BigInt(Math.pow(2, 45)),
137 MACOS_EPPIE: BigInt(Math.pow(2, 46)),
138 MACOS_INBOX: BigInt(Math.pow(2, 47)),
139 IOS: BigInt(Math.pow(2, 48)),
140 IOS_CALENDAR: BigInt(Math.pow(2, 49)),
141 // Available: BigInt(Math.pow(2, 50)),
142 IOS_DRIVE: BigInt(Math.pow(2, 51)),
143 IOS_MAIL: BigInt(Math.pow(2, 52)),
144 IOS_VPN: BigInt(Math.pow(2, 53)),
145 IOS_EPPIE: BigInt(Math.pow(2, 54)),
146 LINUX_INBOX: BigInt(Math.pow(2, 55)),
147 ANDROID: BigInt(Math.pow(2, 56)),
148 ANDROID_CALENDAR: BigInt(Math.pow(2, 57)),
149 ANDROID_EPPIE: BigInt(Math.pow(2, 58)),
150 ANDROID_DRIVE: BigInt(Math.pow(2, 59)),
151 ANDROID_MAIL: BigInt(Math.pow(2, 60)),
152 ANDROID_VPN: BigInt(Math.pow(2, 61)),
153 ANDROID_TV_VPN: BigInt(Math.pow(2, 62)),
154 APPLE_TV_VPN: BigInt(Math.pow(2, 63)),
157 export interface UserSettings {
159 Enabled: number; // 0 for disabled, 1 for OTP, 2 for FIDO2, 3 for both
160 Allowed: number; // 0 for disabled, 1 for OTP, 2 for FIDO2, 3 for both
161 ExpirationTime: number | null; // If set, after this time force add 2FA
162 RegisteredKeys: RegisteredKey[];
164 AIAssistantFlags: AI_ASSISTANT_ACCESS;
173 Eligible: number; // 0 for free user, 1 for paid user
174 Value: number; // 0 for disabled, 1 for enabled
175 EmailNotifications: number;
177 Checklists?: ChecklistId[];
179 DateFormat: SETTINGS_DATE_FORMAT;
180 DeviceRecovery: 0 | 1;
185 Status: SETTINGS_STATUS;
190 HideSidePanel: DRAWER_VISIBILITY;
193 LogAuth: SETTINGS_LOG_AUTH_STATE;
197 Status: SETTINGS_STATUS;
202 Mode: SETTINGS_PASSWORD_MODE;
203 ExpirationTime: number; // If set, after this time force password change
207 * 1 => user can enable High Security, 0 => can't enable
211 * 1 => user has High Security enabled, 0 => disabled
213 Value: SETTINGS_PROTON_SENTINEL_STATE;
217 * 0 - Not elligible to
218 * 1 - Elligible to "refer a friend"
223 * will always be a string containing the link.
227 SessionAccountRecovery: 1 | 0;
229 Theme: ThemeSetting | null;
231 TimeFormat: SETTINGS_TIME_FORMAT;
232 WeekStart: SETTINGS_WEEK_START;
243 UsedClientFlags: number;