Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / pass / constants.ts
blob7aca98eeb45e9823803315fb05006bb05876d03c
1 import { PassThemeOption } from '@proton/pass/components/Layout/Theme/types';
3 import type { FeatureFlagState } from './store/reducers';
4 import { PassFeature } from './types/api/features';
6 /** Invalidate local cache for users whose state version is older
7  * than the minimum state version specified by these constants */
8 export const MIN_CACHE_VERSION = '1.10.0';
10 export const MAX_BATCH_PER_REQUEST = 100;
11 export const MAX_BATCH_ADDRESS_REQUEST = 10;
12 export const ALIAS_OPTIONS_MAX_AGE = 10 * 60;
13 export const ALIAS_DETAILS_MAX_AGE = 30;
15 export const DEFAULT_LOCK_TTL = 600; /* 10 minutes */
17 export const MAX_ITEM_NAME_LENGTH = 200;
18 export const MAX_ITEM_NOTE_LENGTH = 25_000;
19 export const MAX_PASSWORD_HISTORY_RETENTION_WEEKS = 2;
21 export const SESSION_RESUME_RETRY_TIMEOUT = 15; /* seconds */
22 export const SESSION_RESUME_MAX_RETRIES = 7;
24 export const MAX_VAULT_MEMBERS = 10;
25 export const MAX_CUSTOM_ADDRESSES = 10;
27 /** Matches 80% of the `SETTINGS_MAX_CONCURRENT_STREAMS=25`
28  * production API configuration */
29 export const API_CONCURRENCY_TRESHOLD = 20;
31 export const PASS_WEB_APP_URL = 'https://pass.proton.me';
32 export const PASS_LEARN_MORE_URL = 'https://proton.me/pass';
33 export const PASS_VIDEO_URL = 'https://www.youtube.com/embed/Nm4DCAjePOM?cc_load_policy=1';
34 export const PASS_ANDROID_URL = 'https://play.google.com/store/apps/details?id=proton.android.pass';
35 export const PASS_IOS_URL = 'https://apps.apple.com/us/app/proton-pass-password-manager/id6443490629';
36 export const PASS_X_URL = 'https://x.com/Proton_Pass';
37 export const PASS_REDDIT_URL = 'https://www.reddit.com/r/ProtonPass/';
38 export const PASS_REQUEST_URL = 'https://protonmail.uservoice.com/forums/953584-proton-pass';
39 export const PASS_BLOG_TRIAL_URL = 'https://proton.me/support/pass-trial';
40 export const PASS_BLOG_MONITORING_URL = 'https://proton.me/support/dark-web-monitoring';
41 export const PASS_CHROME_URL = 'https://chrome.google.com/webstore/detail/proton-pass/ghmbeldphafepmbegfdlkpapadhbakde';
42 export const PASS_FIREFOX_URL = 'https://addons.mozilla.org/en-US/firefox/addon/proton-pass/';
43 export const PASS_SENTINEL_LINK = 'https://proton.me/blog/sentinel-included-pass-plus';
44 export const PASS_LINUX_VERSION_URL = 'https://proton.me/download/PassDesktop/linux/x64/version.json';
45 export const PASS_LINUX_DOWNLOAD_URL = 'https://proton.me/support/set-up-proton-pass-linux';
46 export const PASS_DESKTOP_CHANGELOG_URL =
47     'https://github.com/ProtonMail/WebClients/blob/main/applications/pass-desktop/CHANGELOG.md';
48 export const WEBSITE_RULES_URL = 'https://proton.me/download/pass/auto-detection/rules.json';
49 export const PASS_DOWNLOAD_URL = 'https://proton.me/pass/download';
50 export const PASS_TROUBLESHOOT_URL = 'https://proton.me/support/pass-troubleshooting';
52 export const WEBSITE_RULES_SUPPORTED_VERSION = '1';
54 export const ITEM_COUNT_RATING_PROMPT = 10;
56 export enum AccountPath {
57     ACCOUNT_PASSWORD = 'pass/account-password',
58     ACCOUNT_PASSWORD_2FA = 'pass/account-password#two-fa',
59     USERS = 'pass/users-addresses',
60     POLICIES = 'pass/policies',
63 export const PASS_FAMILY_BF_2024_MONTHLY_PRICE = 349;
64 export const PASS_LIFETIME_BF_2024_YEARLY_PRICE = 19900;
65 export const PASS_BF_2024_DATES = [+new Date('2024-11-04T06:00:00'), +new Date('2024-12-03T00:00:00')] as const;
67 export enum UpsellRefPrefix {
68     Extension = 'pass_extension',
69     Web = 'pass_web',
70     Desktop = 'pass_desktop',
73 export enum UpsellRef {
74     DEFAULT = 'banner',
75     FREE_TRIAL = 'free_trial_banner',
76     IDENTITY_CUSTOM_FIELDS = 'identity_custom_fields',
77     LIMIT_2FA = '2fa_limit',
78     LIMIT_ALIAS = 'alias_limit',
79     LIMIT_AUTOFILL = 'autofill_limit',
80     LIMIT_CC = 'credit_card_limit',
81     LIMIT_EXTRA_FIELD = 'extra_field_limit',
82     LIMIT_IMPORT = 'import_limit',
83     LIMIT_SHARING = 'limit_share',
84     LIMIT_VAULT = 'vault_limit',
85     MENU = 'menu',
86     SECURE_LINKS = 'secure_links',
87     SETTING = 'setting',
88     PASS_MONITOR = 'pass_monitor',
89     PASS_BIOMETRICS = 'pass_biometrics',
90     PASS_FAMILY_FREE_399 = 'pass_family_free_399',
91     PASS_FAMILY_PLUS_399 = 'pass_family_plus_399',
92     PASS_FAMILY_1LT_299 = 'pass_family_1lt_299',
93     PASS_FAMILY_BF_2024 = 'bf_24_pass-family',
94     PASS_LIFETIME_BF_2024 = 'bf_24_pass-lifetime',
97 export const MAX_LOCAL_STORAGE_SIZE = 5 * 1024 * 1024; /* 5MB */
98 export const MAX_LOG_STORAGE_RATIO = 0.2; /* 20% of available storage space */
99 export const MAX_LOG_STORAGE_LINES = 2_000;
100 export const AVERAGE_BYTES_PER_LOG_LINE = 100;
101 export const SAFARI_MESSAGE_KEY = 'application.id';
102 export const SAFARI_URL_SCHEME = 'proton-pass:';
103 export const BIOMETRICS_KEY = 'offlineKey_biometrics';
105 /** Default feature flag states : These values are used as a
106  * fallback if the feature flag endpoint is unavailable.
107  * FIXME: Remove feature flags that are permanently enabled */
108 export const DEFAULT_PASS_FEATURES: FeatureFlagState = {
109     [PassFeature.PassAccountSwitchV1]: false,
110     [PassFeature.PassBlackFriday2024Family]: false,
111     [PassFeature.PassBlackFriday2024Lifetime]: false,
112     [PassFeature.PassEnableDesktopAutoUpdate]: false,
113     [PassFeature.PassFamilyPlanPromo2024]: false,
114     [PassFeature.PassKillSSO]: false,
115     [PassFeature.PassSimpleLoginAliasesSync]: false,
116     [PassFeature.PassWebInternalAlpha]: false,
117     [PassFeature.PassWebOfflineMode]: false,
120 /** NOTE: Timeout mostly used to avoid Safari extension
121  * limbo state when the service-worker is corrupted */
122 export const RUNTIME_RELOAD_TIMEOUT = 2_000; /* ms */
123 export const RUNTIME_RELOAD_THROTTLE = 10; /* seconds */
125 export const PASS_DEFAULT_THEME = PassThemeOption.PassDark;