1 import type { enums } from '@proton/crypto';
3 import { sizeUnits } from './helpers/size';
4 import type { KeyGenConfig } from './interfaces';
6 export const DEFAULT_TIMEOUT = 30000; // default fetch timeout
7 export const RETRY_DELAY_MAX = 10; // seconds
8 export const RETRY_ATTEMPTS_MAX = 5; // how many times to try the same request
9 export const OFFLINE_RETRY_DELAY = 2000; // how much time in ms to wait before retrying an offline request
10 export const OFFLINE_RETRY_ATTEMPTS_MAX = 0; // how many times to try the same request when offline
11 export const SECOND = 1000;
12 export const MINUTE = 60 * SECOND;
13 export const HOUR = 60 * MINUTE;
14 export const DAY = 24 * HOUR;
15 export const WEEK = 7 * DAY;
16 export const MONTH = 4 * WEEK;
17 export const YEAR = 12 * MONTH;
18 export const MINUTE_IN_SECONDS = 60;
19 export const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
20 export const DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS;
22 export const DOMAIN_PLACEHOLDER = 'example.com';
23 export const EMAIL_PLACEHOLDER = 'john.doe@example.com';
24 export const USERNAME_PLACEHOLDER = 'john.doe';
25 export const NAME_PLACEHOLDER = 'Thomas A. Anderson';
27 export const BRAND_NAME = 'Proton';
28 export const MAIL_SHORT_APP_NAME = 'Mail';
29 export const MAIL_APP_NAME = `${BRAND_NAME} ${MAIL_SHORT_APP_NAME}`;
30 export const CONTACTS_SHORT_APP_NAME = 'Contacts';
31 export const CONTACTS_APP_NAME = `${BRAND_NAME} ${CONTACTS_SHORT_APP_NAME}`;
32 export const CALENDAR_SHORT_APP_NAME = 'Calendar';
33 export const CALENDAR_APP_NAME = `${BRAND_NAME} ${CALENDAR_SHORT_APP_NAME}`;
34 export const DRIVE_SHORT_APP_NAME = 'Drive';
35 export const DRIVE_APP_NAME = `${BRAND_NAME} ${DRIVE_SHORT_APP_NAME}`;
36 export const PASS_SHORT_APP_NAME = 'Pass';
37 export const PASS_APP_NAME = `${BRAND_NAME} ${PASS_SHORT_APP_NAME}`;
38 export const VPN_SHORT_APP_NAME = 'VPN';
39 export const VPN_APP_NAME = `${BRAND_NAME} ${VPN_SHORT_APP_NAME}`;
40 export const DOCS_SHORT_APP_NAME = 'Docs';
41 export const DOCS_APP_NAME = `${BRAND_NAME} ${DOCS_SHORT_APP_NAME}`;
42 export const DOCS_EDITOR_SHORT_APP_NAME = 'Docs Editor';
43 export const DOCS_EDITOR_APP_NAME = `${BRAND_NAME} ${DOCS_EDITOR_SHORT_APP_NAME}`;
44 export const VERIFY_APP_NAME = 'Proton Verify';
45 export const WALLET_SHORT_APP_NAME = 'Wallet';
46 export const WALLET_APP_NAME = `${BRAND_NAME} ${WALLET_SHORT_APP_NAME}`;
47 export const REFERRER_CODE_MAIL_TRIAL = 'MAILPLUSTRIAL';
48 export const PROTON_SENTINEL_NAME = 'Proton Sentinel';
49 export const DARK_WEB_MONITORING_NAME = 'Dark Web Monitoring';
52 PROTONACCOUNT: 'proton-account',
53 PROTONACCOUNTLITE: 'proton-account-lite',
54 PROTONVPNBROWSEREXTENSION: 'proton-vpn-browser-extension',
55 PROTONMAIL: 'proton-mail',
56 PROTONCONTACTS: 'proton-contacts',
57 PROTONDRIVE: 'proton-drive',
58 PROTONCALENDAR: 'proton-calendar',
59 PROTONPASS: 'proton-pass',
60 PROTONVPN_SETTINGS: 'proton-vpn-settings',
61 PROTONADMIN: 'proton-admin',
62 PROTONVERIFICATION: 'proton-verify',
63 PROTONEXTENSION: 'proton-extension',
64 PROTONWALLET: 'proton-wallet',
65 PROTONPASSBROWSEREXTENSION: 'proton-pass-extension',
66 PROTONDOCS: 'proton-docs',
67 PROTONDOCSEDITOR: 'proton-docs-editor',
70 interface AppConfiguration {
76 windowsClientID?: string;
77 macosClientID?: string;
78 linuxClientID?: string;
83 export const APPS_CONFIGURATION: { [key in APP_NAMES]: AppConfiguration } = {
84 [APPS.PROTONACCOUNT]: {
87 name: 'Proton Account',
89 clientID: 'web-account',
91 settingsSlug: 'account',
93 [APPS.PROTONACCOUNTLITE]: {
96 name: 'Proton Account',
98 clientID: 'web-account-lite',
99 windowsClientID: 'windows-mail',
100 macosClientID: 'macos-mail',
101 linuxClientID: 'linux-mail',
102 icon: 'brand-proton',
103 settingsSlug: 'account',
105 [APPS.PROTONVPNBROWSEREXTENSION]: {
108 name: 'Proton VPN Browser Extension',
109 bareName: 'Browser VPN Extension',
110 clientID: 'browser-vpn',
111 icon: 'brand-proton-vpn',
118 bareName: MAIL_SHORT_APP_NAME,
119 clientID: 'web-mail',
120 windowsClientID: 'windows-mail',
121 macosClientID: 'macos-mail',
122 linuxClientID: 'linux-mail',
123 icon: 'brand-proton-mail',
124 settingsSlug: 'mail',
126 [APPS.PROTONCONTACTS]: {
127 publicPath: '/contacts',
128 subdomain: 'contacts',
129 name: 'ProtonContacts',
130 bareName: 'Contacts',
131 clientID: 'web-contacts',
132 icon: 'brand-proton',
133 settingsSlug: 'contacts',
135 [APPS.PROTONDRIVE]: {
136 publicPath: '/drive',
138 name: DRIVE_APP_NAME,
139 bareName: DRIVE_SHORT_APP_NAME,
140 clientID: 'web-drive',
141 icon: 'brand-proton-drive',
142 settingsSlug: 'drive',
144 [APPS.PROTONCALENDAR]: {
145 publicPath: '/calendar',
146 subdomain: 'calendar',
147 name: CALENDAR_APP_NAME,
148 bareName: CALENDAR_SHORT_APP_NAME,
149 clientID: 'web-calendar',
150 windowsClientID: 'windows-mail',
151 macosClientID: 'macos-mail',
152 linuxClientID: 'linux-mail',
153 icon: 'brand-proton-calendar',
154 settingsSlug: 'calendar',
160 bareName: PASS_SHORT_APP_NAME,
161 clientID: 'web-pass',
162 windowsClientID: 'windows-pass',
163 macosClientID: 'macos-pass',
164 linuxClientID: 'linux-pass',
165 icon: 'brand-proton-pass',
166 settingsSlug: 'pass',
168 [APPS.PROTONEXTENSION]: {
172 bareName: PASS_SHORT_APP_NAME,
173 clientID: 'browser-pass',
177 [APPS.PROTONPASSBROWSEREXTENSION]: {
181 bareName: PASS_SHORT_APP_NAME,
182 clientID: 'browser-pass',
186 [APPS.PROTONVPN_SETTINGS]: {
190 bareName: VPN_SHORT_APP_NAME,
191 clientID: 'web-vpn-settings',
192 icon: 'brand-proton-vpn',
195 [APPS.PROTONADMIN]: {
200 clientID: 'web-admin',
201 icon: 'brand-proton',
204 [APPS.PROTONVERIFICATION]: {
207 name: VERIFY_APP_NAME,
209 clientID: 'web-verify',
210 icon: 'brand-proton',
213 [APPS.PROTONWALLET]: {
216 name: WALLET_APP_NAME,
218 clientID: 'web-wallet',
219 icon: 'brand-proton',
220 settingsSlug: 'wallet',
226 bareName: DOCS_SHORT_APP_NAME,
227 clientID: 'web-docs',
228 icon: 'brand-proton', // TODO: brand icon for Docs
229 settingsSlug: 'docs',
231 [APPS.PROTONDOCSEDITOR]: {
233 subdomain: 'docs-editor',
234 name: DOCS_EDITOR_APP_NAME,
235 bareName: DOCS_EDITOR_SHORT_APP_NAME,
236 clientID: 'web-docs-editor',
237 icon: 'brand-proton', // TODO: brand icon for Docs
238 settingsSlug: 'docs-editor',
242 export enum PRODUCT {
251 // Should be synced with ProductGroup in API
252 export enum PRODUCT_BIT {
261 export type APP_KEYS = keyof typeof APPS;
262 export type APP_NAMES = (typeof APPS)[APP_KEYS];
263 export type APP_CLIENT_IDS =
264 | (typeof APPS_CONFIGURATION)[keyof typeof APPS_CONFIGURATION]['clientID']
267 export const VPN_TV_CLIENT_IDS = {
268 APPLE: 'apple_tv-vpn',
269 ANDROID: 'android_tv-vpn',
272 export const VPN_TV_PATHS_MAP = {
276 export const VPN_TV_PATHS = Object.values(VPN_TV_PATHS_MAP);
278 export const SSO_PATHS = {
279 EXTERNAL_SSO_LOGIN: '/sso/login',
280 EXTERNAL_SSO_REAUTH: '/sso/reauth',
281 OAUTH_AUTHORIZE: '/oauth/authorize',
282 OAUTH_CONFIRM_FORK: '/oauth/confirm',
283 AUTHORIZE: '/authorize',
288 APP_SWITCHER: '/apps',
289 RESET_PASSWORD: '/reset-password',
290 FORGOT_USERNAME: '/forgot-username',
291 MAIL_SIGNUP: '/mail/signup',
292 MAIL_SIGNUP_B2B: '/mail/signup/business',
293 MAIL_SIGN_IN: '/mail',
294 CALENDAR_SIGNUP: '/calendar/signup',
295 CALENDAR_SIGNUP_B2B: '/calendar/signup/business',
296 CALENDAR_SIGN_IN: '/calendar',
297 DRIVE_SIGNUP: '/drive/signup',
298 DRIVE_SIGNUP_B2B: '/drive/signup/business',
299 DRIVE_SIGN_IN: '/drive',
300 BUSINESS_SIGNUP: '/business/signup',
301 VPN_SIGNUP: '/vpn/signup',
302 VPN_PRICING: '/vpn/pricing',
304 PASS_SIGNUP: '/pass/signup',
305 PASS_SIGNUP_B2B: '/pass/signup/business',
306 PASS_SIGN_IN: '/pass',
307 DOCS_SIGNUP: '/docs/signup',
308 DOCS_SIGN_IN: '/docs',
309 WALLET_SIGNUP: '/wallet/signup',
310 WALLET_SIGN_IN: '/wallet',
312 INVITE: '/pre-invite',
313 REFER: '/refer-a-friend',
315 JOIN_MAGIC_LINK: '/join',
317 export const SETUP_ADDRESS_PATH = '/setup-address';
319 export const SECURITY_CHECKUP_PATHS = {
320 ROOT: '/safety-review',
321 SET_PHRASE: '/safety-review/phrase',
322 SET_EMAIL: '/safety-review/email',
323 VERIFY_EMAIL: '/safety-review/email/verify',
324 ENABLE_EMAIL: '/safety-review/email/enable',
325 SET_PHONE: '/safety-review/phone',
326 VERIFY_PHONE: '/safety-review/phone/verify',
327 ENABLE_PHONE: '/safety-review/phone/enable',
328 ENABLE_DEVICE_RECOVERY: '/safety-review/device',
331 export const VPN_HOSTNAME = 'account.protonvpn.com';
333 export enum HTTP_STATUS_CODE {
340 UNPROCESSABLE_ENTITY = 422,
341 TOO_MANY_REQUESTS = 429,
342 INTERNAL_SERVER_ERROR = 500,
345 export enum API_CODES {
346 GLOBAL_SUCCESS = 1001,
347 SINGLE_SUCCESS = 1000,
348 NOT_ALLOWED_ERROR = 2011,
349 INVALID_REQUIREMENT_ERROR = 2000,
350 INVALID_LINK_TYPE_ERROR = 2001,
351 ALREADY_EXISTS_ERROR = 2500,
352 NOT_FOUND_ERROR = 2501,
353 INVALID_ID_ERROR = 2061,
356 export const GET_VTIMEZONES_API_LIMIT = 10;
357 export const GET_CANONICAL_EMAILS_API_LIMIT = 100;
359 export enum ACCOUNT_DELETION_REASONS {
360 DIFFERENT_ACCOUNT = 'DIFFERENT_ACCOUNT',
361 TOO_EXPENSIVE = 'TOO_EXPENSIVE',
362 MISSING_FEATURE = 'MISSING_FEATURE',
363 USE_OTHER_SERVICE = 'USE_OTHER_SERVICE',
367 export const FORBIDDEN_LABEL_NAMES = ['inbox', 'drafts', 'sent', 'starred', 'archive', 'spam', 'trash', 'outbox'];
369 export const INTERVAL_EVENT_TIMER = 30 * 1000;
370 export const MAX_SIZE_SCREENSHOT = 500 * 1000;
372 export enum EVENT_ACTIONS {
380 export enum USER_ROLES {
386 export enum INVOICE_OWNER {
391 export enum MEMBER_TYPE {
396 export enum ADDRESS_STATUS {
402 export enum ADDRESS_TYPE {
405 TYPE_CUSTOM_DOMAIN = 3,
411 export enum ADDRESS_RECEIVE {
416 export enum ADDRESS_SEND {
421 export enum ADDRESS_PERMISSIONS {
423 PERMISSIONS_RECEIVE_ALL = 1,
424 PERMISSIONS_SEND_ALL = 2,
425 PERMISSIONS_AUTORESPONDER = 4,
426 PERMISSIONS_RECEIVE_ORG = 8,
427 PERMISSIONS_SEND_ORG = 16,
430 export enum ADDRESS_PERMISSION_TYPE {
435 export enum ADDRESS_FLAGS {
436 FLAG_DISABLE_E2EE = 16,
437 FLAG_DISABLE_EXPECTED_SIGNED = 32,
440 export enum MEMBER_PERMISSIONS {
441 MANAGE_FORWARDING = 1,
444 export enum MEMBER_PRIVATE {
449 export enum MEMBER_ROLE {
450 ORGANIZATION_NONE = 0,
451 ORGANIZATION_MEMBER = 1,
452 ORGANIZATION_ADMIN = 2,
455 export enum MEMBER_SUBSCRIBER {
460 export enum PACKAGE_SIGNATURES_MODE {
462 SIGNATURES_ATTACHMENTS = 1,
466 export enum PGP_SCHEMES {
467 PGP_INLINE = 'pgp-inline',
468 PGP_MIME = 'pgp-mime',
471 export enum PGP_SCHEMES_MORE {
475 export type CONTACT_PGP_SCHEMES = PGP_SCHEMES | PGP_SCHEMES_MORE;
477 export enum MIME_TYPES {
478 MIME = 'multipart/mixed',
479 PLAINTEXT = 'text/plain',
480 DEFAULT = 'text/html',
481 ICS = 'text/calendar',
482 APPLICATION_ICS = 'application/ics', // Google's special one that doesn't have standard newlines
483 PGP_KEYS = 'application/pgp-keys',
486 export enum MIME_TYPES_MORE {
490 export type CONTACT_MIME_TYPES = MIME_TYPES.PLAINTEXT | MIME_TYPES.DEFAULT | MIME_TYPES_MORE.AUTOMATIC;
492 export enum RECIPIENT_TYPES {
498 * Returned by legacy GET /keys endpoint
500 export enum IGNORE_KT {
502 EXTERNAL_ADDRESS = 1,
506 export enum API_KEY_SOURCE {
512 export enum DRAFT_TYPE {
513 NORMAL = 'text/html',
514 PLAIN_TEXT = 'text/plain',
517 export enum ORGANIZATION_FLAGS {
521 NO_CYCLE_SCHEDULED = 8,
525 TO_MIGRATE_ORG_KEY = 1 << 9,
526 DELETION_WHITELISTED = 1 << 11,
529 export enum ORGANIZATION_TWOFA_SETTING {
531 REQUIRED_ADMIN_ONLY = 1,
535 export enum ORGANIZATION_STATE {
540 export enum APP_UPSELL_REF_PATH {
541 MAIL_UPSELL_REF_PATH = 'upsell_mail-',
542 CALENDAR_UPSELL_REF_PATH = 'upsell_calendar-',
543 DRIVE_UPSELL_REF_PATH = 'upsell_drive-',
544 PASS_UPSELL_REF_PATH = 'upsell_pass-',
545 VPN_UPSELL_REF_PATH = 'upsell_vpn-',
546 INBOX_DESKTOP_REF_PATH = 'upsell_inbox_desktop-',
547 DOCS_UPSELL_REF_PATH = 'upsell_docs-',
548 ACCOUNT_UPSELL_REF_PATH = 'upsell_account-',
549 WALLET_UPSELL_REF_PATH = 'upsell_wallet-',
552 export enum UPSELL_COMPONENT {
560 export enum MAIL_UPSELL_PATHS {
561 AUTO_REPLY = 'auto-reply',
562 DOMAIN_NAMES = 'domain-names',
563 CATCH_ALL = 'catch-all',
566 SHORT_ADDRESS = 'short-address',
567 AUTO_DELETE = 'auto-delete',
568 SCHEDULE_SEND = 'schedule-send',
569 STORAGE_FULL = 'storage-full',
570 GET_STARTED_CHECKLIST = 'get-started-checklist',
571 MAIL_FOOTER = 'mail-footer',
572 UNLIMITED_FOLDERS = 'unlimited-folders',
573 UNLIMITED_LABELS = 'unlimited-labels',
574 UNLIMITED_FILTERS = 'unlimited-filters',
575 UNLIMITED_ADDRESSES = 'unlimited-addresses',
576 FORWARD_EMAILS = 'forward-emails',
577 SMTP_SUBMISSION = 'smtp-submission',
578 SNOOZE_MESSAGE = 'snooze-message',
579 PROTON_SENTINEL = 'proton-sentinel',
580 PASS_ALIASES = 'pass-aliases',
581 TRIAL_WELCOME = 'trial-welcome',
582 TRIAL_BANNER = 'trial-banner',
583 TRIAL_END = 'trial-end',
584 BREACH_ALERTS = 'breach-alerts',
585 SUBSCRIPTION_REMINDER_PRIVACY = 'subscription-reminder-privacy',
586 SUBSCRIPTION_REMINDER_PRODUCTIVITY = 'subscription-reminder-productivity',
587 ASSISTANT_TOGGLE = 'assistant-toggle',
588 ASSISTANT_TOGGLE_DOWNGRADE = 'assistant-toggle-downgrade',
589 ASSISTANT_COMPOSER = 'assistant-composer',
590 ZOOM_MEETING = 'zoom-meeting',
591 ACCOUNT_LOCKED = 'account-locked-state',
594 export enum CALENDAR_UPSELL_PATHS {
595 MULTI_CAL = 'multi-cal',
596 SHARE_CAL = 'share-cal',
598 COLOR_PER_EVENT = 'color-per-event',
601 export enum DRIVE_UPSELL_PATHS {
605 export enum SHARED_UPSELL_PATHS {
606 MULTI_USER = 'multi-user',
607 CONTACT_GROUP = 'contact-groups',
609 USER_DROPDOWN = 'user-dropdown',
610 STORAGE_PERCENTAGE = 'storage-percentage',
611 ORGANIZATION_CAPACITY = 'organization-capacity',
612 SENTINEL = 'sentinel',
613 TRIAL_WILL_END = 'trial-will-end',
614 TOP_NAVIGATION_BAR = 'top-navigation-bar',
617 export enum DASHBOARD_UPSELL_PATHS {
618 MAILPLUS = 'mailplus-dashboard',
619 MAILEPRO = 'mailpro-dashboard',
620 UNLIMITED = 'unlimited-dashboard',
621 DRIVE = 'drive-dashboard',
622 PASS = 'pass-dashboard',
623 VPN = 'vpn-dashboard',
624 DOCS = 'docs-dashboard',
625 WALLET = 'wallet-dashboard',
626 FAMILY = 'family-dashboard',
627 DUO = 'duo-dashboard',
628 BUSINESS = 'business-dashboard',
631 export const LOYAL_BONUS_STORAGE = 5 * sizeUnits.GB;
632 export const LOYAL_BONUS_CONNECTION = 2;
634 export const COVID_PLUS_BONUS_STORAGE = 5 * sizeUnits.GB;
635 export const COVID_PROFESSIONAL_BONUS_STORAGE = 5 * sizeUnits.GB;
636 export const COVID_VISIONARY_BONUS_STORAGE = 10 * sizeUnits.GB;
638 export const FREE_VPN_CONNECTIONS = 1;
639 export const VPN_CONNECTIONS = 10;
651 export const DEFAULT_CYCLE = CYCLE.YEARLY;
653 export const PRODUCT_PAYER = {
654 START: new Date(Date.UTC(2020, 9, 28, 6)),
655 END: new Date(Date.UTC(2020, 11, 15, 6)),
658 export const CONTACT_EMAILS_LIMIT = 1000;
659 export const CONTACTS_LIMIT = 1000;
660 export const EXPORT_CONTACTS_LIMIT = 50; // Maximum page size for export is 50 from API
661 export const CONTACTS_REQUESTS_PER_SECOND = 10;
662 export const ALL_MEMBERS_ID = -100;
664 export enum LABEL_EXCLUSIVE {
669 export const REGEX_IMAGE_EXTENSION = /\.(gif|jpe?g|tiff|png)$/i;
671 export const DARK_MODE_CLASS = 'isDarkMode';
673 export enum COUPON_CODES {
674 BLACK_FRIDAY_2023 = 'BF2023',
675 BLACK_FRIDAY_2024 = 'BF2024YR',
676 BLACK_FRIDAY_2024_MONTH = 'BF2024MO',
677 BLACK_FRIDAY_2024_PCMAG = 'BF2024PCMAG',
678 BLACK_FRIDAY_2024_HB = 'BF2024HB',
679 BLACK_FRIDAY_2024_VPNLIGHTNING = 'BF2024VPNLIGHTNING',
680 BLACK_FRIDAY_2024_PASS_LIFE = 'BF2024PASSLIFE',
681 DEGOOGLE = 'DEGOOGLE', // DEGOOGLE 2024 Campain
682 LIFETIME = 'LIFETIME',
683 REFERRAL = 'REFERRAL',
684 END_OF_YEAR_2023 = 'EOY2023',
685 END_OF_YEAR_2024 = 'EOY2024',
686 EOY_2023_1M_INTRO = 'EOY1MINTRO',
687 PASS_B2B_INTRO = 'PASS2024B2BINTRO',
688 VPN_INTRO_2024 = 'VPNINTROPRICE2024',
689 MEMBER_DOWNGRADE_TRIAL = 'MEMBER_DOWNGRADE_TRIAL',
690 MARCHSAVINGS24 = 'MARCHSAVINGS24',
691 HONEYPROTONSAVINGS = 'HONEYPROTONSAVINGS',
692 TRYMAILPLUS2024 = 'TRYMAILPLUS2024',
693 MAILPLUSINTRO = 'MAILPLUSINTRO',
694 TRYVPNPLUS2024 = 'TRYVPNPLUS2024',
695 PREMIUM_DEAL = 'PREMIUM_DEAL',
696 TRYDRIVEPLUS2024 = 'DRIVEPLUSINTRO2024',
698 TECHRADARVPNPASS = 'TECHRADARVPNPASS',
699 CNETVPNPASS = 'CNETVPNPASS',
700 ZDNETVPNPASS = 'ZDNETVPNPASS',
701 RESTOREPRIVACYVPNPASS = 'RESTOREPRIVACYVPNPASS',
702 ENGADGETVPNPASS = 'ENGADGETVPNPASS',
703 COMPARITECHVPNPASS = 'COMPARITECHVPNPASS',
704 PROPRIVACYVPNPASS = 'PROPRIVACYVPNPASS',
705 BLEEPINGCOMPUTERVPNPASS = 'BLEEPINGCOMPUTERVPNPASS',
706 PCMAGVPNPASS = 'PCMAGVPNPASS',
708 TRYMAILPLUS0724 = 'TRYMAILPLUS0724',
709 DRIVEB2BINTRO2024 = 'DRIVEB2BINTRO2024',
710 /** PassFamily Promo */
711 PASSEARLYSUPPORTER = 'PASSEARLYSUPPORTER',
712 PASSFAMILYLAUNCH = 'PASSFAMILYLAUNCH',
715 export const VPN_PASS_PROMOTION_COUPONS = [
716 COUPON_CODES.TECHRADARVPNPASS,
717 COUPON_CODES.CNETVPNPASS,
718 COUPON_CODES.ZDNETVPNPASS,
719 COUPON_CODES.RESTOREPRIVACYVPNPASS,
720 COUPON_CODES.ENGADGETVPNPASS,
721 COUPON_CODES.COMPARITECHVPNPASS,
722 COUPON_CODES.PROPRIVACYVPNPASS,
723 COUPON_CODES.BLEEPINGCOMPUTERVPNPASS,
724 COUPON_CODES.PCMAGVPNPASS,
727 export const FAMILY_MAX_USERS = 6;
728 export const DUO_MAX_USERS = 2;
730 export const KEY_EXTENSION = 'asc';
731 export const KEY_FILE_EXTENSION = `.${KEY_EXTENSION}`;
733 export enum KEYGEN_TYPES {
734 CURVE25519 = 'CURVE25519',
737 export const DEFAULT_KEYGEN_TYPE = KEYGEN_TYPES.CURVE25519;
739 export const KEYGEN_CONFIGS: { [key: string]: KeyGenConfig } = {
740 [KEYGEN_TYPES.CURVE25519]: {
742 curve: 'ed25519Legacy' as enums.curve,
746 export enum KEY_FLAG {
747 FLAG_EMAIL_NO_SIGN = 8,
749 * Key can't be used to encrypt email. There are multiple scenarios where this can happen
750 * - the key is associated to a product without Mail, like Drive or VPN
751 * - the key is associated to an external address
752 * - the key is associated to an internal address e2e encryption disabled (e.g. because of forwarding)
754 FLAG_EMAIL_NO_ENCRYPT = 4,
755 // Key can be used to encrypt
756 FLAG_NOT_OBSOLETE = 2,
757 // Key can be used to verify signatures
758 FLAG_NOT_COMPROMISED = 1,
761 export enum USER_STATUS {
770 export enum MAILBOX_IDENTIFIERS {
786 export enum INCOMING_DEFAULTS_LOCATION {
787 INBOX = Number(MAILBOX_IDENTIFIERS.inbox),
788 SPAM = Number(MAILBOX_IDENTIFIERS.spam),
792 /* eslint no-useless-escape: "off" */
793 export const REGEX_EMAIL =
794 /(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/i;
796 export enum FILTER_STATUS {
801 export const FREE_USER_ACTIVE_FILTERS_LIMIT = 1;
802 export const FREE_USER_FOLDERS_LIMIT = 3;
803 export const FREE_USER_LABELS_LIMIT = 3;
805 export const VCARD_VERSION = '4.0';
807 export enum CONTACT_CARD_TYPE {
808 ENCRYPTED_AND_SIGNED = 3,
814 export enum LABEL_TYPE {
821 export const DEFAULT_LOCALE = 'en_US';
823 export enum PASSWORD_MODE {
828 export enum SORT_DIRECTION {
833 export enum SERVER_FEATURES {
841 DOUBLE_RESTRICTION = 128,
844 export enum CLIENT_TYPES {
851 export enum TOKEN_TYPES {
859 export enum MAILBOX_LABEL_IDS {
872 ALMOST_ALL_MAIL = '15',
876 export const LINKED_LABEL_IDS: {
877 [key in MAILBOX_LABEL_IDS]?: MAILBOX_LABEL_IDS;
879 [MAILBOX_LABEL_IDS.ALL_DRAFTS]: MAILBOX_LABEL_IDS.DRAFTS,
880 [MAILBOX_LABEL_IDS.ALL_SENT]: MAILBOX_LABEL_IDS.SENT,
881 [MAILBOX_LABEL_IDS.ALL_MAIL]: MAILBOX_LABEL_IDS.ALMOST_ALL_MAIL,
882 [MAILBOX_LABEL_IDS.DRAFTS]: MAILBOX_LABEL_IDS.ALL_DRAFTS,
883 [MAILBOX_LABEL_IDS.SENT]: MAILBOX_LABEL_IDS.ALL_SENT,
884 [MAILBOX_LABEL_IDS.ALMOST_ALL_MAIL]: MAILBOX_LABEL_IDS.ALL_MAIL,
887 export enum AutoReplyDuration {
895 export const DKIM_RSA_1024 = 0;
896 export const DKIM_RSA_2048 = 1;
898 export enum DKIM_KEY_STATUS {
905 export enum DKIM_KEY_DNS_STATUS {
911 export enum DENSITY {
916 export enum SPAM_SCORE {
922 export const COLLAPSE_MENU_KEY = 'collapse-menu';
923 export const ROOT_FOLDER = 0;
925 export const USER_SCOPES = {
929 export const DOH_DOMAINS = ['.compute.amazonaws.com'];
931 export const PROTON_DOMAINS = [
939 'protonmailrmez3lotccipshtkleegetolb73fuirgj7r4o4vfu7ozyd.onion',
943 export enum LINK_TYPES {
949 interface OpenPGPFile {
958 declare const WEBPACK_OPENPGP: {
961 elliptic: OpenPGPFile;
964 export const OPENPGP =
965 typeof WEBPACK_OPENPGP === 'undefined'
969 elliptic: DUMMY_FILE,
974 const PROTONPASS_EXTENSION_IDS = [
975 'ghmbeldphafepmbegfdlkpapadhbakde' /* chromium production */,
976 'hlaiofkbmjenhgeinjlmkafaipackfjh' /* chromium beta channel */,
977 'gcllgfdnfnllodcaambdaknbipemelie' /* edge production */,
978 'me.proton.pass.catalyst.safari-extension (2SB5Z68H26)' /* safari extension */,
981 export const EXTENSIONS = {
982 [APPS.PROTONEXTENSION]: { IDs: PROTONPASS_EXTENSION_IDS },
983 [APPS.PROTONPASSBROWSEREXTENSION]: { IDs: PROTONPASS_EXTENSION_IDS },
984 [APPS.PROTONVPNBROWSEREXTENSION]: { IDs: ['jplgfhpmjnbigmhklmmbgecoobifkmpa'] },
987 export const AES256 = 'aes256';
989 export const REFERRAL_PROGRAM_MAX_AMOUNT = 9000;
991 export const FIBONACCI_LIST = [1, 1, 2, 3, 5, 8, 13];
993 /* Here is a list of product not to be translated */
994 //TODO should this be moved in the easy-switch package
995 export const PRODUCT_NAMES = {
996 EASY_SWITCH: 'Easy Switch',
999 // Allowed Log parameters of the /metrics route
1000 export enum METRICS_LOG {
1002 ENCRYPTED_SEARCH = 'encrypted_search',
1003 DARK_STYLES = 'dark_styles',
1006 /** SimpleLogin constants **/
1007 // SimpleLogin tags used to communicate with the web extension
1008 export enum SIMPLE_LOGIN_TAGS {
1009 EXTENSION_INSTALLED_QUERY = 'EXTENSION_INSTALLED_QUERY',
1010 EXTENSION_INSTALLED_RESPONSE = 'EXTENSION_INSTALLED_RESPONSE',
1013 export enum SIMPLE_LOGIN_EXTENSION_LINKS {
1014 MAIN_PAGE = 'https://simplelogin.io',
1015 DASHBOARD = 'https://app.simplelogin.io/dashboard/',
1018 export const OPEN_OFFER_MODAL_EVENT = 'openoffermodal';
1020 export enum DESKTOP_APP_NAMES {
1024 export enum DESKTOP_PLATFORMS {
1027 WINDOWS = 'windows',
1030 export enum RELEASE_CATEGORIES {
1033 EARLY_ACCESS = 'EarlyAccess',
1036 export enum PROTON_WEBSITES {
1037 PROTON_STATUS_PAGE = 'https://status.proton.me',
1041 * Mail Composer toolbar
1043 export const COMPOSER_TOOLBAR_ICON_SIZE = 3.5;
1046 * Messages list pagination
1048 export const DEFAULT_MAIL_PAGE_SIZE = 50;
1049 export const MAX_MESSAGES_FETCH_CHUNK_SIZE = 50;
1051 export const MIN_PASSWORD_LENGTH = 8;
1053 export enum REASON_TYPES {
1055 TICKET_ID = 'ticket_id',
1059 export const RECOVERY_KIT_FILE_NAME = 'proton-recovery-kit.pdf';
1060 export const RECOVERY_FILE_FILE_NAME = `proton_recovery${KEY_FILE_EXTENSION}`;
1062 export const TWO_FA_RECOVERY_CODES_FILE_NAME = `proton_2FA_recovery_codes.txt`;
1064 export const MAIL_MOBILE_APP_LINKS = {
1065 qrCode: 'https://proton.me/mailapp',
1066 appStore: 'https://apps.apple.com/app/apple-store/id979659905',
1067 playStore: 'https://play.google.com/store/apps/details?id=ch.protonmail.android',
1070 export const CALENDAR_MOBILE_APP_LINKS = {
1071 qrCode: 'https://proton.me/calapp',
1072 appStore: 'https://apps.apple.com/app/apple-store/id1514709943',
1073 playStore: 'https://play.google.com/store/apps/details?id=me.proton.android.calendar',
1076 export const MAX_FOLDER_NESTING_LEVEL = 2;