-
Notifications
You must be signed in to change notification settings - Fork 96
/
constants.ts
63 lines (53 loc) · 2.35 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import {LogLevel} from "electron-log";
import {AccountType} from "src/shared/model/account";
import {BuildEnvironment} from "./model/common";
import {EntryUrlItem} from "./types";
// tslint:disable-next-line:no-var-requires no-import-zones
const {name: APP_NAME, version: APP_VERSION} = require("package.json");
export {
APP_NAME,
APP_VERSION,
};
// user data dir, defaults to app.getPath("userData")
export const RUNTIME_ENV_USER_DATA_DIR = `EMAIL_SECURELY_APP_USER_DATA_DIR`;
// boolean
export const RUNTIME_ENV_E2E = `EMAIL_SECURELY_APP_E2E`;
export const ONE_SECOND_MS = 1000;
export const PROVIDER_REPO: Record<Extract<AccountType, "protonmail">, { repo: string, version: string; commit: string; }> = {
protonmail: {
repo: "https://github.com/ProtonMail/WebClient.git",
commit: "9b224b2ac01f9d4258979674d9151bc42677a8b9",
version: "3.15.3",
},
};
export const LOCAL_WEBCLIENT_PROTOCOL_PREFIX = "webclient";
export const LOCAL_WEBCLIENT_PROTOCOL_RE_PATTERN = `${LOCAL_WEBCLIENT_PROTOCOL_PREFIX}[\\d]+`;
export const ACCOUNTS_CONFIG_ENTRY_URL_SEPARATOR = ":::";
export const ACCOUNTS_CONFIG_ENTRY_URL_LOCAL_PREFIX = "local";
export const ACCOUNTS_CONFIG: Record<AccountType, Record<"entryUrl", EntryUrlItem[]>> = {
protonmail: {
entryUrl: [
...((process.env.NODE_ENV as BuildEnvironment) === "development" ? [{
value: `${ACCOUNTS_CONFIG_ENTRY_URL_LOCAL_PREFIX}${ACCOUNTS_CONFIG_ENTRY_URL_SEPARATOR}https://mail.protonmail.com`,
title: `https://mail.protonmail.com (Built-in WebClient v${PROVIDER_REPO.protonmail.version})`,
}] : []),
{value: "https://app.protonmail.ch", title: "https://app.protonmail.ch"},
{value: "https://mail.protonmail.com", title: "https://mail.protonmail.com"},
{value: "https://beta.protonmail.com", title: "https://beta.protonmail.com (Beta)"},
{value: "https://protonirockerxow.onion", title: "https://protonirockerxow.onion (Tor)"},
],
},
tutanota: {
entryUrl: [
{value: "https://mail.tutanota.com", title: "https://mail.tutanota.com"},
],
},
};
export const LOG_LEVELS: LogLevel[] = Object.keys(((stub: Record<LogLevel, null>) => stub)({
error: null,
warn: null,
info: null,
verbose: null,
debug: null,
silly: null,
})) as LogLevel[];