forked from bcgov/namerequest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetConfig.ts
More file actions
110 lines (77 loc) · 4.6 KB
/
Copy pathgetConfig.ts
File metadata and controls
110 lines (77 loc) · 4.6 KB
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
import axios from 'axios'
import { EnvConfigI } from '@/interfaces'
import { appBaseURL } from '../router/router'
export async function getConfig (): Promise<EnvConfigI> {
// get config from environment
const windowLocationOrigin = window.location.origin
if (!{ appBaseURL } || !windowLocationOrigin) {
return Promise.reject(new Error('Missing environment variables'))
}
axios.defaults.baseURL = appBaseURL
const paymentPortalUrl: string = process.env.VUE_APP_PAYMENT_PORTAL_URL
sessionStorage.setItem('PAYMENT_PORTAL_URL', paymentPortalUrl)
const businessesUrl: string = process.env.VUE_APP_BUSINESSES_URL
sessionStorage.setItem('BUSINESSES_URL', businessesUrl)
const corporateOnlineUrl: string = process.env.VUE_APP_CORPORATE_ONLINE_URL
sessionStorage.setItem('CORPORATE_ONLINE_URL', corporateOnlineUrl)
const businessDashUrl: string = process.env.VUE_APP_BUSINESS_DASH_URL
sessionStorage.setItem('BUSINESS_DASH_URL', businessDashUrl)
const businessRegistryUrl: string = process.env.VUE_APP_BUSINESS_REGISTRY_URL
sessionStorage.setItem('BUSINESS_REGISTRY_URL', businessRegistryUrl)
const legalApiUrl: string = process.env.VUE_APP_LEGAL_API_URL + process.env.VUE_APP_LEGAL_API_VERSION_2
sessionStorage.setItem('LEGAL_API_URL', legalApiUrl)
const businessApiGwUrl: string = process.env.VUE_APP_BUSINESS_API_GW_URL + process.env.VUE_APP_LEGAL_API_VERSION_2
sessionStorage.setItem('BUSINESS_API_GW_URL', businessApiGwUrl)
const authApiUrl: string = process.env.VUE_APP_AUTH_API_URL + process.env.VUE_APP_AUTH_API_VERSION
sessionStorage.setItem('AUTH_API_URL', authApiUrl)
const siteminderLogoutUrl: string = process.env.VUE_APP_SITEMINDER_LOGOUT_URL
sessionStorage.setItem('SITEMINDER_LOGOUT_URL', siteminderLogoutUrl)
const registryHomeUrl: string = process.env.VUE_APP_REGISTRY_HOME_URL
sessionStorage.setItem('REGISTRY_HOME_URL', registryHomeUrl)
const societiesOnlineHomeUrl: string = process.env.VUE_APP_SOCIETIES_ONLINE_HOME_URL
sessionStorage.setItem('SOCIETIES_ONLINE_HOME_URL', societiesOnlineHomeUrl)
const stepsToRestoreUrl: string = process.env.VUE_APP_STEPS_TO_RESTORE_URL
sessionStorage.setItem('STEPS_TO_RESTORE_URL', stepsToRestoreUrl)
// for system alert banner (sbc-common-components)
const statusApiUrl: string = process.env.VUE_APP_STATUS_API_URL + process.env.VUE_APP_STATUS_API_VERSION
sessionStorage.setItem('STATUS_API_URL', statusApiUrl)
// for sbc header (sbc-common-components)
const authWebUrl: string = process.env.VUE_APP_AUTH_WEB_URL
sessionStorage.setItem('AUTH_WEB_URL', authWebUrl)
const registriesSearchApiUrl: string =
(process.env.VUE_APP_REGISTRIES_SEARCH_API_URL + process.env.VUE_APP_REGISTRIES_SEARCH_API_VERSION_2 + '/')
sessionStorage.setItem('REGISTRIES_SEARCH_API_URL', registriesSearchApiUrl)
const hotjarId: string = process.env.VUE_APP_HOTJAR_ID;
(<any>window).hotjarId = hotjarId
const ldClientId: string = process.env.VUE_APP_NAMEREQUEST_LD_CLIENT_ID;
(<any>window).ldClientId = ldClientId
const authTokenUrl: string = process.env.VUE_APP_AUTH_TOKEN_URL;
(<any>window).authTokenUrl = authTokenUrl
const quickSearchPublicId: string = process.env.VUE_APP_QUICK_SEARCH_PUBLIC_ID;
(<any>window).quickSearchPublicId = quickSearchPublicId
const quickSearchPublicSecret: string = process.env.VUE_APP_QUICK_SEARCH_PUBLIC_SECRET;
(<any>window).quickSearchPublicSecret = quickSearchPublicSecret
const genesysEnv: string = process.env.VUE_APP_GENESYS_ENV;
(<any>window).genesysEnv = genesysEnv
const genesysId: string = process.env.VUE_APP_GENESYS_ID;
(<any>window).genesysId = genesysId
const genesysUrl: string = process.env.VUE_APP_GENESYS_URL;
(<any>window).genesysUrl = genesysUrl
const webChatUrl: string = process.env.VUE_APP_WEBCHAT_URL;
(<any>window).webChatUrl = webChatUrl
const webChatReason: string = process.env.VUE_APP_WEBCHAT_REASON;
(<any>window).webChatReason = webChatReason
const webChatStatusUrl: string = process.env.VUE_APP_WEBCHAT_STATUS_URL;
(<any>window).webChatStatusUrl = webChatStatusUrl
const entitySelectorUrl: string = process.env.VUE_APP_ENTITY_SELECTOR_URL
entitySelectorUrl && sessionStorage.setItem('ENTITY_SELECTOR_URL', entitySelectorUrl)
const keycloakAuthUrl: string = process.env.VUE_APP_KEYCLOAK_AUTH_URL;
(<any>window).keycloakAuthUrl = keycloakAuthUrl
const keycloakRealm: string = process.env.VUE_APP_KEYCLOAK_REALM;
(<any>window).keycloakRealm = keycloakRealm
const keycloakClientId: string = process.env.VUE_APP_KEYCLOAK_CLIENTID;
(<any>window).keycloakClientId = keycloakClientId
return {
$PAYMENT_PORTAL_URL: paymentPortalUrl
} as EnvConfigI
}