-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.ts
51 lines (46 loc) · 1.08 KB
/
config.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
import { IAuthOptions } from "../api/core/tokenManager";
export const API = {
AUTH: "auth",
REFRESH: "refresh",
DATA: {
ENDPOINT: "ds",
},
FILES: {
ENDPOINT: "fs",
},
REAL_TIME: {
ENDPOINT: "/rtc",
PORT: "",
PROTOCOL: "wss",
},
UMS: {
ENDPOINT: "ums",
SIGNUP: "signup",
USER: "user",
CHANGEPASSWORD: "changepassword",
RESETPASSWORD: "resetpassword",
},
CHANNEL: {
ENDPOINT: "channel",
},
DOMAIN: "com",
HOST: "app.jexia",
PORT: 443,
PROTOCOL: "https",
};
/* default refresh token interval: 1 hour and 50 minutes; JEXIA tokens expire in 2 hours */
export const DELAY = 1000 * 60 * 110;
/**
* The default project zone
*/
export const DEFAULT_PROJECT_ZONE = "nl00";
/**
* Suffix of API url: host.domain:port
*/
export const API_SUFFIX = `${API.HOST}.${API.DOMAIN}:${API.PORT}`;
/**
* Gets the composed API URL of a given project
*/
export function getApiUrl({ projectID, zone, projectURL }: IAuthOptions): string {
return projectURL || `${API.PROTOCOL}://${projectID}.${zone || DEFAULT_PROJECT_ZONE}.${API_SUFFIX}`;
}