1 import type { Currency, UNPAID_STATE } from '@proton/payments';
3 import type { USER_ROLES } from '../constants';
4 import type { Key } from './Key';
6 export enum MNEMONIC_STATUS {
14 export enum UserType {
20 export enum SessionRecoveryState {
28 export enum SessionRecoveryReason {
34 export enum ChargebeeEnabled {
36 CHARGEBEE_ALLOWED = 1,
40 export type ChargebeeUserExists = number;
42 export enum UserLockedFlags {
43 BASE_STORAGE_EXCEEDED = 1,
44 DRIVE_STORAGE_EXCEEDED = 2,
45 STORAGE_EXCEEDED = BASE_STORAGE_EXCEEDED | DRIVE_STORAGE_EXCEEDED,
46 ORG_ISSUE_FOR_PRIMARY_ADMIN = 4,
47 ORG_ISSUE_FOR_MEMBER = 8,
50 export interface User {
54 UsedBaseSpace: number;
55 UsedDriveSpace: number;
60 MaxDriveSpace: number;
68 Delinquent: UNPAID_STATE;
71 OrganizationPrivateKey?: string;
73 DriveEarlyAccess: number;
75 MnemonicStatus: MNEMONIC_STATUS;
87 'drive-early-access': boolean;
88 'onboard-checklist-storage-granted': boolean;
89 'has-temporary-password': boolean;
90 'test-account': boolean;
92 'no-proton-address': boolean;
93 'recovery-attempt': boolean;
94 'pass-lifetime': boolean;
98 State: SessionRecoveryState;
101 Reason: SessionRecoveryReason | null;
104 ChargebeeUser: ChargebeeEnabled;
105 LockedFlags?: number;
107 ChargebeeUserExists?: ChargebeeUserExists;
110 export function isBilledUser(user: User | undefined): boolean {
115 return !!user.Billed;
118 export interface UserModel extends User {
125 isDelinquent: boolean;
126 hasNonDelinquentScope: boolean;
127 hasPaidMail: boolean;
129 hasPaidDrive: boolean;
130 hasPaidPass: boolean;
131 hasPassLifetime: boolean;