Use same lock values as mobile clients
[ProtonMail-WebClient.git] / packages / pass / constants.ts
blobb76b25dd52a2a373d7eeb5d42c6f76f273f26325
1 import type { FeatureFlagState } from './store/reducers';
2 import { PassFeature } from './types/api/features';
4 /** Invalidate local cache for users whose state version is older
5  * than the minimum state version specified by these constants */
6 export const MIN_CACHE_VERSION = '1.10.0';
8 export const MAX_BATCH_PER_REQUEST = 100;
9 export const MAX_BATCH_ADDRESS_REQUEST = 10;
10 export const ALIAS_OPTIONS_MAX_AGE = 10 * 60;
11 export const ALIAS_DETAILS_MAX_AGE = 30;
13 export const DEFAULT_LOCK_TTL = 600; /* 10 minutes */
15 export const MAX_ITEM_NAME_LENGTH = 200;
16 export const MAX_ITEM_NOTE_LENGTH = 25_000;
17 export const MAX_PASSWORD_HISTORY_RETENTION_WEEKS = 2;
19 export const SESSION_RESUME_RETRY_TIMEOUT = 15; /* seconds */
20 export const SESSION_RESUME_MAX_RETRIES = 7;
22 export const MAX_VAULT_MEMBERS = 10;
23 export const MAX_CUSTOM_ADDRESSES = 10;
25 /** Matches 80% of the `SETTINGS_MAX_CONCURRENT_STREAMS=25`
26  * production API configuration */
27 export const API_CONCURRENCY_TRESHOLD = 20;
29 export const PASS_WEB_APP_URL = 'https://pass.proton.me';
30 export const PASS_LEARN_MORE_URL = 'https://proton.me/pass';
31 export const PASS_VIDEO_URL = 'https://www.youtube.com/embed/Nm4DCAjePOM?cc_load_policy=1';
32 export const PASS_ANDROID_URL = 'https://play.google.com/store/apps/details?id=proton.android.pass';
33 export const PASS_IOS_URL = 'https://apps.apple.com/us/app/proton-pass-password-manager/id6443490629';
34 export const PASS_X_URL = 'https://x.com/Proton_Pass';
35 export const PASS_REDDIT_URL = 'https://www.reddit.com/r/ProtonPass/';
36 export const PASS_GITHUB_URL = 'https://github.com/ProtonMail/WebClients/tree/main/applications/pass-extension';
37 export const PASS_REQUEST_URL = 'https://protonmail.uservoice.com/forums/953584-proton-pass';
38 export const PASS_BLOG_TRIAL_URL = 'https://proton.me/support/pass-trial';
39 export const PASS_BLOG_MONITORING_URL = 'https://proton.me/support/dark-web-monitoring';
40 export const PASS_CHROME_URL = 'https://chrome.google.com/webstore/detail/proton-pass/ghmbeldphafepmbegfdlkpapadhbakde';
41 export const PASS_FIREFOX_URL = 'https://addons.mozilla.org/en-US/firefox/addon/proton-pass/';
42 export const PASS_SENTINEL_LINK = 'https://proton.me/blog/sentinel-included-pass-plus';
43 export const PASS_LINUX_VERSION_URL = 'https://proton.me/download/PassDesktop/linux/x64/version.json';
44 export const PASS_LINUX_DOWNLOAD_URL = 'https://proton.me/support/set-up-proton-pass-linux';
45 export const PASS_DESKTOP_CHANGELOG_URL =
46     'https://github.com/ProtonMail/WebClients/blob/main/applications/pass-desktop/CHANGELOG.md';
48 export const ITEM_COUNT_RATING_PROMPT = 10;
50 export const PASS_UPGRADE_PATH = 'pass/signup';
51 export enum AccountPath {
52     ACCOUNT_PASSWORD = 'pass/account-password',
53     ACCOUNT_PASSWORD_2FA = 'pass/account-password#two-fa',
54     USERS = 'pass/users-addresses',
55     POLICIES = 'pass/policies',
58 export const PASS_BF_MONTHLY_PRICE = 199;
59 export const PASS_REGULAR_MONTHLY_PRICE = 399;
61 export const PASS_BF_2023_DATES = [+new Date('2023-11-02T06:00:00'), +new Date('2023-12-04T00:00:00')] as const;
63 export enum UpsellRefPrefix {
64     Extension = 'pass_extension',
65     Web = 'pass_web',
66     Desktop = 'pass_desktop',
69 export enum UpsellRef {
70     DEFAULT = 'banner',
71     FREE_TRIAL = 'free_trial_banner',
72     IDENTITY_CUSTOM_FIELDS = 'identity_custom_fields',
73     LIMIT_2FA = '2fa_limit',
74     LIMIT_ALIAS = 'alias_limit',
75     LIMIT_AUTOFILL = 'autofill_limit',
76     LIMIT_CC = 'credit_card_limit',
77     LIMIT_EXTRA_FIELD = 'extra_field_limit',
78     LIMIT_IMPORT = 'import_limit',
79     LIMIT_SHARING = 'limit_share',
80     LIMIT_VAULT = 'vault_limit',
81     MENU = 'menu',
82     SECURE_LINKS = 'secure_links',
83     SETTING = 'setting',
84     PASS_MONITOR = 'pass_monitor',
85     PASS_BIOMETRICS = 'pass_biometrics',
88 export const MAX_LOCAL_STORAGE_SIZE = 5 * 1024 * 1024; /* 5MB */
89 export const MAX_LOG_STORAGE_RATIO = 0.2; /* 20% of available storage space */
90 export const MAX_LOG_STORAGE_LINES = 2_000;
91 export const AVERAGE_BYTES_PER_LOG_LINE = 100;
92 export const SAFARI_MESSAGE_KEY = 'application.id';
93 export const SAFARI_URL_SCHEME = 'proton-pass:';
94 export const BIOMETRICS_KEY = 'offlineKey_biometrics';
96 /** Default feature flag states : These values are used as a
97  * fallback if the feature flag endpoint is unavailable.
98  * FIXME: Remove feature flags that are permanently enabled */
99 export const DEFAULT_PASS_FEATURES: FeatureFlagState = {
100     [PassFeature.PassEnableDesktopAutoUpdate]: false,
101     [PassFeature.PassUsernameSplit]: false,
102     [PassFeature.PassWebInternalAlpha]: false,
103     [PassFeature.PassWebOfflineMode]: false,
104     [PassFeature.PassIdentityV1]: false,
105     [PassFeature.PassDesktopBiometrics]: false,