forked from ohcnetwork/care_fe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
care.config.ts
115 lines (95 loc) · 3.01 KB
/
care.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
const env = import.meta.env;
interface ILogo {
light: string;
dark: string;
}
const logo = (value?: string, fallback?: ILogo) => {
if (!value) {
return fallback;
}
try {
return JSON.parse(value) as ILogo;
} catch {
// TODO: define vite plugin to validate care.config.ts during build step
return fallback;
}
};
const careConfig = {
apiUrl: env.REACT_CARE_API_URL,
urls: {
dashboard: env.REACT_DASHBOARD_URL,
github: env.REACT_GITHUB_URL || "https://github.com/ohcnetwork",
ohcn: env.REACT_OHCN_URL || "https://ohc.network?ref=care",
},
headerLogo: logo(env.REACT_HEADER_LOGO, {
light: "https://cdn.ohc.network/header_logo.png",
dark: "https://cdn.ohc.network/header_logo.png",
}),
mainLogo: logo(env.REACT_MAIN_LOGO, {
light: "/images/care_logo.svg",
dark: "/images/care_logo.svg",
}),
stateLogo: logo(env.REACT_STATE_LOGO),
customLogo: logo(env.REACT_CUSTOM_LOGO),
customLogoAlt: logo(env.REACT_CUSTOM_LOGO_ALT),
customDescription: env.REACT_CUSTOM_DESCRIPTION,
availableLocales: (env.REACT_ALLOWED_LOCALES || "")
.split(",")
.map((l) => l.trim()),
gmapsApiKey:
env.REACT_GMAPS_API_KEY || "AIzaSyDsBAc3y7deI5ZO3NtK5GuzKwtUzQNJNUk",
govDataApiKey:
env.REACT_GOV_DATA_API_KEY ||
"579b464db66ec23bdd000001cdd3946e44ce4aad7209ff7b23ac571b",
reCaptchaSiteKey:
env.REACT_RECAPTCHA_SITE_KEY || "6LdvxuQUAAAAADDWVflgBqyHGfq-xmvNJaToM0pN",
kasp: {
enabled: env.REACT_KASP_ENABLED === "true",
string: env.REACT_KASP_STRING || "KASP",
fullString:
env.REACT_KASP_FULL_STRING || "Karunya Arogya Suraksha Padhathi",
},
sampleFormats: {
assetImport:
env.REACT_SAMPLE_FORMAT_ASSET_IMPORT || "/asset-import-template.xlsx",
},
wartimeShifting: env.REACT_WARTIME_SHIFTING === "true",
stillWatching: {
idleTimeout: env.REACT_STILL_WATCHING_IDLE_TIMEOUT
? parseInt(env.REACT_STILL_WATCHING_IDLE_TIMEOUT)
: 3 * 60,
promptDuration: env.REACT_STILL_WATCHING_PROMPT_DURATION
? parseInt(env.REACT_STILL_WATCHING_PROMPT_DURATION)
: 30,
},
auth: {
tokenRefreshInterval: env.REACT_JWT_TOKEN_REFRESH_INTERVAL
? parseInt(env.REACT_JWT_TOKEN_REFRESH_INTERVAL)
: 5 * 60e3,
},
minEncounterDate: new Date(env.REACT_MIN_ENCOUNTER_DATE || "2020-01-01"),
// Plugins related configs...
plausible: {
server: env.REACT_PLAUSIBLE_SERVER_URL || "https://plausible.ohc.network",
domain: env.REACT_PLAUSIBLE_SITE_DOMAIN || "care.ohc.network",
},
sentry: {
dsn:
env.REACT_SENTRY_DSN ||
"https://[email protected]/5183632",
environment: env.REACT_SENTRY_ENVIRONMENT || "staging",
},
hcx: {
enabled: env.REACT_ENABLE_HCX === "true",
},
abdm: {
enabled: (env.REACT_ENABLE_ABDM ?? "true") === "true",
},
careApps: env.REACT_ENABLED_APPS
? env.REACT_ENABLED_APPS.split(",").map((app) => ({
branch: app.split("@")[1],
package: app.split("@")[0],
}))
: [],
} as const;
export default careConfig;