aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.ts
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 08:07:32 +0530
committerLibravatar Vijay A <avijayr@protonmail.com>2021-08-21 08:55:38 +0530
commitb1cf1849f5bfa8f297f78a5ca58d797f466b3086 (patch)
tree658f3adeb740cf54021dfb6ad951649f0d539e6d /src/config.ts
parentrefactor(cleanup): remove code that refers to paid subscription (diff)
downloadferdium-app-b1cf1849f5bfa8f297f78a5ca58d797f466b3086.tar.gz
ferdium-app-b1cf1849f5bfa8f297f78a5ca58d797f466b3086.tar.zst
ferdium-app-b1cf1849f5bfa8f297f78a5ca58d797f466b3086.zip
chore: typescript conversion
Diffstat (limited to 'src/config.ts')
-rw-r--r--src/config.ts183
1 files changed, 183 insertions, 0 deletions
diff --git a/src/config.ts b/src/config.ts
new file mode 100644
index 000000000..005dd3601
--- /dev/null
+++ b/src/config.ts
@@ -0,0 +1,183 @@
1// Note: This file has now become devoid of all references to values deduced from the runtime process - all those now live in the `environment.js` file
2
3import ms from 'ms';
4
5export const CHECK_INTERVAL = ms('1h'); // How often should we perform checks
6
7export const LOCAL_HOSTNAME = 'localhost';
8export const LOCAL_PORT = 45569;
9export const LOCAL_API = 'http://localhost:3000';
10export const DEV_FRANZ_API = 'https://dev.franzinfra.com';
11
12export const LIVE_FERDI_API = 'https://api.getferdi.com';
13export const LIVE_FRANZ_API = 'https://api.franzinfra.com';
14
15// URL used to submit debugger information, see https://github.com/getferdi/debugger
16export const DEBUG_API = 'https://debug.getferdi.com';
17
18export const LOCAL_WS_API = 'ws://localhost:3000';
19export const DEV_WS_API = 'wss://dev.franzinfra.com';
20export const LIVE_WS_API = 'wss://api.franzinfra.com';
21
22export const LOCAL_API_WEBSITE = 'http://localhost:3333';
23export const DEV_API_FRANZ_WEBSITE = 'https://meetfranz.com';
24export const LIVE_API_FERDI_WEBSITE = 'https://getferdi.com';
25
26export const STATS_API = 'https://stats.franzinfra.com';
27
28export const LOCAL_TODOS_FRONTEND_URL = 'http://localhost:4000';
29export const PRODUCTION_TODOS_FRONTEND_URL = 'https://app.franztodos.com';
30export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.netlify.com';
31
32export const CDN_URL = 'https://cdn.franzinfra.com';
33
34export const KEEP_WS_LOADED_USID = '0a0aa000-0a0a-49a0-a000-a0a0a0a0a0a0';
35
36// TODO: Need to convert many of these to i18n
37export const HIBERNATION_STRATEGIES = {
38 10: 'Extremely Fast Hibernation (10sec)',
39 30: 'Very Fast Hibernation (30sec)',
40 60: 'Fast Hibernation (1min)',
41 300: 'Normal Hibernation (5min)',
42 600: 'Slow Hibernation (10min)',
43 1800: 'Very Slow Hibernation (30min)',
44 3600: 'Extremely Slow Hibernation (1hour)',
45};
46
47export const WAKE_UP_STRATEGIES = {
48 0: 'Never wake up',
49 10: 'Wake up after 10sec',
50 30: 'Wake up after 30sec',
51 60: 'Wake up after 1min',
52 300: 'Wake up after 5min',
53 600: 'Wake up after 10min',
54 1800: 'Wake up after 30min',
55 3600: 'Wake up after 1hour',
56};
57
58export const NAVIGATION_BAR_BEHAVIOURS = {
59 custom: 'Show navigation bar on custom websites only',
60 always: 'Show navigation bar on all services',
61 never: 'Never show navigation bar',
62};
63
64export const SEARCH_ENGINE_GOOGLE = 'google';
65export const SEARCH_ENGINE_DDG = 'duckDuckGo';
66export const SEARCH_ENGINE_NAMES = {
67 [SEARCH_ENGINE_GOOGLE]: 'Google',
68 [SEARCH_ENGINE_DDG]: 'DuckDuckGo',
69};
70
71export const SEARCH_ENGINE_URLS = {
72 [SEARCH_ENGINE_GOOGLE]: ({ searchTerm }) => `https://www.google.com/search?q=${searchTerm}`,
73 [SEARCH_ENGINE_DDG]: ({ searchTerm }) => `https://duckduckgo.com/?q=${searchTerm}`,
74};
75
76export const CUSTOM_TODO_SERVICE = 'isUsingCustomTodoService';
77
78const TODO_TODOIST_URL = 'https://todoist.com/app';
79const TODO_FRANZ_TODOS_URL = 'https://app.franztodos.com';
80const TODO_TICKTICK_URL = 'https://ticktick.com/signin';
81const TODO_MSTODO_URL = 'https://todo.microsoft.com/?app#';
82const TODO_HABITICA_URL = 'https://habitica.com/login';
83const TODO_NOZBE_URL = 'https://app.nozbe.com/#login';
84const TODO_RTM_URL = 'https://www.rememberthemilk.com/login/';
85const TODO_ANYDO_URL = 'https://desktop.any.do/';
86const TODO_GOOGLETASKS_URL = 'https://tasks.google.com/embed/?origin=https%3A%2F%2Fcalendar.google.com&fullWidth=1';
87
88export const TODO_SERVICE_RECIPE_IDS = {
89 [TODO_TODOIST_URL]: 'todoist',
90 [TODO_FRANZ_TODOS_URL]: 'franz-todos',
91 [TODO_TICKTICK_URL]: 'TickTick',
92 [TODO_MSTODO_URL]: 'mstodo',
93 [TODO_HABITICA_URL]: 'habitica',
94 [TODO_ANYDO_URL]: 'anydo',
95};
96
97export const TODO_APPS = {
98 [TODO_TODOIST_URL]: 'Todoist',
99 [TODO_FRANZ_TODOS_URL]: 'Franz Todo',
100 [TODO_TICKTICK_URL]: 'TickTick',
101 [TODO_MSTODO_URL]: 'Microsoft To Do',
102 [TODO_HABITICA_URL]: 'Habitica',
103 [TODO_NOZBE_URL]: 'Nozbe',
104 [TODO_RTM_URL]: 'Remember The Milk',
105 [TODO_ANYDO_URL]: 'Any.do',
106 [TODO_GOOGLETASKS_URL]: 'Google Tasks',
107 [CUSTOM_TODO_SERVICE]: 'Other service',
108};
109
110export const DEFAULT_TODO_SERVICE = TODO_FRANZ_TODOS_URL;
111export const DEFAULT_TODO_RECIPE_ID = TODO_SERVICE_RECIPE_IDS[DEFAULT_TODO_SERVICE];
112export const DEFAULT_TODO_SERVICE_NAME = TODO_APPS[DEFAULT_TODO_SERVICE];
113
114export const SIDEBAR_WIDTH = {
115 35: 'Extremely slim sidebar',
116 45: 'Very slim sidebar',
117 55: 'Slim sidebar',
118 68: 'Normal sidebar',
119 80: 'Wide sidebar',
120 90: 'Very wide sidebar',
121 100: 'Extremely wide sidebar',
122};
123
124export const ICON_SIZES = {
125 0: 'Very small icons',
126 10: 'Small icons',
127 20: 'Normal icons',
128 30: 'Large icons',
129 40: 'Very large icons',
130};
131// We need a bias to push all icon sizes into positive numbers
132// otherwise the settings screen won't sort the sizes correctly.
133// The bias should always be the "Normal icons" value
134export const iconSizeBias = 20;
135
136export const DEFAULT_FEATURES_CONFIG = {
137 isServiceProxyEnabled: false,
138 isAnnouncementsEnabled: true,
139 isWorkspaceEnabled: false,
140 isTodosEnabled: true,
141};
142
143export const DEFAULT_WINDOW_OPTIONS = {
144 width: 800,
145 height: 600,
146 x: 0,
147 y: 0,
148};
149
150export const GITHUB_FRANZ_URL = 'https://github.com/meetfranz';
151export const GITHUB_FERDI_URL = 'https://github.com/getferdi';
152export const FRANZ_SERVICE_REQUEST = `${GITHUB_FERDI_URL}/recipes/issues`;
153export const FRANZ_TRANSLATION = 'https://crowdin.com/project/getferdi';
154export const FRANZ_DEV_DOCS = 'http://bit.ly/franz-dev-hub';
155
156export const GITHUB_ORG_NAME = 'getferdi';
157export const GITHUB_FERDI_REPO_NAME = 'ferdi';
158export const GITHUB_NIGHTLIES_REPO_NAME = 'nightlies';
159
160export const FILE_SYSTEM_SETTINGS_TYPES = [
161 'app',
162 'proxy',
163];
164
165export const LOCAL_SERVER = 'You are using Ferdi without a server';
166export const SERVER_NOT_LOADED = 'Ferdi::SERVER_NOT_LOADED';
167
168export const ALLOWED_PROTOCOLS = [
169 'https:',
170 'http:',
171 'ftp:',
172 'ferdi:',
173];
174
175export const DEFAULT_SETTING_KEEP_ALL_WORKSPACES_LOADED = false;
176
177export const DEFAULT_TODOS_WIDTH = 300;
178export const TODOS_MIN_WIDTH = 200;
179export const DEFAULT_TODOS_VISIBLE = true;
180export const DEFAULT_IS_FEATURE_ENABLED_BY_USER = true;
181export const TODOS_PARTITION_ID = 'persist:todos';
182
183export const CUSTOM_WEBSITE_RECIPE_ID = 'franz-custom-website';