@elliemae/pui-app-sdk 4.13.3 → 4.13.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,6 @@ __export(app_config_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(app_config_exports);
34
34
  var import_lodash = __toESM(require("lodash"));
35
- var import_http_client = require("../../communication/http-client/index.js");
36
35
  var import_config = require("./config.js");
37
36
  var import_appdynamics = require("../../analytics/appdynamics.js");
38
37
  var import_web_analytics = require("../../analytics/web-analytics.js");
@@ -47,15 +46,30 @@ const parseAppConfig = (data) => {
47
46
  (0, import_appdynamics.setAppDynamicsUserData)({ envName: activeEnv });
48
47
  (0, import_web_analytics.updateBAEventParameters)({ envName: activeEnv });
49
48
  };
50
- const loadAppConfig = (configPath = (0, import_window.getAssetPath)()) => new Promise((resolve, reject) => {
51
- (0, import_http_client.getHTTPClient)({ baseURL: configPath }).get("app.config.json").then(({ data }) => {
52
- parseAppConfig(data);
53
- resolve();
54
- }).catch((err) => {
55
- reject(
56
- new Error(
57
- `Unable to load application configurtion file. ${err.Message}`
58
- )
59
- );
60
- });
61
- });
49
+ const getUnVersionedPath = (path) => path.replace(/\d+\.\d+/, "latest");
50
+ const loadAppConfig = async (configPath = (0, import_window.getAssetPath)()) => {
51
+ const appConfigUrl = `${configPath.replace(/\/?$/, "/")}app.config.json`;
52
+ const unversionedConfigPath = getUnVersionedPath(configPath);
53
+ try {
54
+ const response = await fetch(appConfigUrl);
55
+ if (!response.ok) {
56
+ if (configPath !== unversionedConfigPath) {
57
+ await loadAppConfig(unversionedConfigPath);
58
+ return;
59
+ }
60
+ const message = `App Config is not found at ${appConfigUrl}`;
61
+ throw new Error(message);
62
+ }
63
+ const appConfig = await response.json();
64
+ parseAppConfig(appConfig);
65
+ } catch (ex) {
66
+ if (configPath !== unversionedConfigPath) {
67
+ await loadAppConfig(unversionedConfigPath);
68
+ return;
69
+ }
70
+ if (ex?.message?.includes(`Unexpected token`)) {
71
+ throw new Error(`App config file at ${appConfigUrl} is not a valid JSON`);
72
+ }
73
+ throw ex;
74
+ }
75
+ };
@@ -0,0 +1,147 @@
1
+ {
2
+ "appId": "loanapp",
3
+ "activeEnv": "localhost",
4
+ "googleTagManager": true,
5
+ "sessionTimeoutWarnInterval": "7200000",
6
+ "sessionTimeoutInterval": "9000000",
7
+ "serviceEndpoints": {
8
+ "api": "",
9
+ "idp": "https://int.idp.ellielabs.com",
10
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
11
+ },
12
+ "env": {
13
+ "localhost": {
14
+ "serviceEndpoints": {
15
+ "api": "",
16
+ "idp": "https://int.idp.ellielabs.com",
17
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
18
+ }
19
+ },
20
+ "dev": {
21
+ "serviceEndpoints": {
22
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
23
+ "idp": "https://int.idp.ellielabs.com",
24
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
25
+ }
26
+ },
27
+ "dev2": {
28
+ "serviceEndpoints": {
29
+ "api": "https://int.api.ellielabs.com",
30
+ "idp": "https://int.idp.ellielabs.com",
31
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
32
+ }
33
+ },
34
+ "qa": {
35
+ "serviceEndpoints": {
36
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
37
+ "idp": "https://int.idp.ellielabs.com",
38
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
39
+ }
40
+ },
41
+ "qa2": {
42
+ "serviceEndpoints": {
43
+ "api": "https://int.api.ellielabs.com",
44
+ "idp": "https://int.idp.ellielabs.com",
45
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
46
+ }
47
+ },
48
+ "qa3": {
49
+ "serviceEndpoints": {
50
+ "api": "https://int.api.ellielabs.com",
51
+ "idp": "https://int.idp.ellielabs.com",
52
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
53
+ }
54
+ },
55
+ "int": {
56
+ "serviceEndpoints": {
57
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
58
+ "idp": "https://int.idp.ellielabs.com",
59
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
60
+ }
61
+ },
62
+ "peg-osb1": {
63
+ "serviceEndpoints": {
64
+ "api": "https://encompass-peg-api.elliemae.com",
65
+ "idp": "https://peg.idp.ellielabs.com/authorize",
66
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
67
+ }
68
+ },
69
+ "peg-osb2": {
70
+ "serviceEndpoints": {
71
+ "api": "https://encompass-peg2-api.elliemae.com",
72
+ "idp": "https://peg.idp.ellielabs.com/authorize",
73
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
74
+ }
75
+ },
76
+ "peg": {
77
+ "serviceEndpoints": {
78
+ "api": "https://peg2-west.api.ellielabs.com",
79
+ "idp": "https://peg.idp.ellielabs.com/authorize",
80
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
81
+ }
82
+ },
83
+ "peg-oapi-west": {
84
+ "serviceEndpoints": {
85
+ "api": "https://peg2-west.api.ellielabs.com",
86
+ "idp": "https://peg.idp.ellielabs.com/authorize",
87
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
88
+ }
89
+ },
90
+ "peg-oapi-east": {
91
+ "serviceEndpoints": {
92
+ "api": "https://peg2-east.api.ellielabs.com",
93
+ "idp": "https://peg.idp.ellielabs.com/authorize",
94
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
95
+ }
96
+ },
97
+ "peg2-oapi-east": {
98
+ "serviceEndpoints": {
99
+ "api": "https://peg2-east.api.ellielabs.com",
100
+ "idp": "https://peg.idp.ellielabs.com/authorize",
101
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
102
+ }
103
+ },
104
+ "peg3": {
105
+ "serviceEndpoints": {
106
+ "api": "https://pel1.api.ellielabs.com",
107
+ "idp": "https://peg3.idp.ellielabs.com/authorize",
108
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
109
+ }
110
+ },
111
+ "stage": {
112
+ "serviceEndpoints": {
113
+ "api": "https://stg.api.elliemae.com",
114
+ "idp": "https://stg.idp.elliemae.com/authorize",
115
+ "logger": "https://stg.api.puidiagnostics.ellielabs.com/v1/logging"
116
+ }
117
+ },
118
+ "beta": {
119
+ "serviceEndpoints": {
120
+ "api": "https://concept.api.elliemae.com",
121
+ "idp": "https://concept.idp.elliemae.com/authorize",
122
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
123
+ }
124
+ },
125
+ "demo": {
126
+ "serviceEndpoints": {
127
+ "api": "https://concept.api.elliemae.com",
128
+ "idp": "https://concept.idp.elliemae.com/authorize",
129
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
130
+ }
131
+ },
132
+ "epc": {
133
+ "serviceEndpoints": {
134
+ "api": "https://concept.api.elliemae.com",
135
+ "idp": "https://concept.idp.elliemae.com/authorize",
136
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
137
+ }
138
+ },
139
+ "prod": {
140
+ "serviceEndpoints": {
141
+ "api": "https://api.elliemae.com",
142
+ "idp": "https://idp.elliemae.com/authorize",
143
+ "logger": "https://api.puidiagnostics.ellieservices.com/v1/logging"
144
+ }
145
+ }
146
+ }
147
+ }
@@ -53,4 +53,10 @@ const getCurrentBreakpoint = () => {
53
53
  return "medium";
54
54
  return "large";
55
55
  };
56
- const getAssetPath = () => document.currentScript ? new URL("../", document.currentScript?.src).href : "latest/";
56
+ const getAssetPath = () => {
57
+ const assetPath = window?.emui?._ASSET_PATH || "latest/";
58
+ if (!window.emui?.version)
59
+ return assetPath;
60
+ const majorMinorVersion = window.emui?.version.match(/^(?:\d+\.\d+)*/g);
61
+ return majorMinorVersion && majorMinorVersion[0] ? assetPath.replace("latest/", `${majorMinorVersion[0]}/`) : assetPath;
62
+ };
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash";
2
- import { getHTTPClient } from "../../communication/http-client/index.js";
3
2
  import { setAppConfig } from "./config.js";
4
3
  import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
5
4
  import { updateBAEventParameters } from "../../analytics/web-analytics.js";
@@ -14,18 +13,33 @@ const parseAppConfig = (data) => {
14
13
  setAppDynamicsUserData({ envName: activeEnv });
15
14
  updateBAEventParameters({ envName: activeEnv });
16
15
  };
17
- const loadAppConfig = (configPath = getAssetPath()) => new Promise((resolve, reject) => {
18
- getHTTPClient({ baseURL: configPath }).get("app.config.json").then(({ data }) => {
19
- parseAppConfig(data);
20
- resolve();
21
- }).catch((err) => {
22
- reject(
23
- new Error(
24
- `Unable to load application configurtion file. ${err.Message}`
25
- )
26
- );
27
- });
28
- });
16
+ const getUnVersionedPath = (path) => path.replace(/\d+\.\d+/, "latest");
17
+ const loadAppConfig = async (configPath = getAssetPath()) => {
18
+ const appConfigUrl = `${configPath.replace(/\/?$/, "/")}app.config.json`;
19
+ const unversionedConfigPath = getUnVersionedPath(configPath);
20
+ try {
21
+ const response = await fetch(appConfigUrl);
22
+ if (!response.ok) {
23
+ if (configPath !== unversionedConfigPath) {
24
+ await loadAppConfig(unversionedConfigPath);
25
+ return;
26
+ }
27
+ const message = `App Config is not found at ${appConfigUrl}`;
28
+ throw new Error(message);
29
+ }
30
+ const appConfig = await response.json();
31
+ parseAppConfig(appConfig);
32
+ } catch (ex) {
33
+ if (configPath !== unversionedConfigPath) {
34
+ await loadAppConfig(unversionedConfigPath);
35
+ return;
36
+ }
37
+ if (ex?.message?.includes(`Unexpected token`)) {
38
+ throw new Error(`App config file at ${appConfigUrl} is not a valid JSON`);
39
+ }
40
+ throw ex;
41
+ }
42
+ };
29
43
  export {
30
44
  loadAppConfig
31
45
  };
@@ -0,0 +1,147 @@
1
+ {
2
+ "appId": "loanapp",
3
+ "activeEnv": "localhost",
4
+ "googleTagManager": true,
5
+ "sessionTimeoutWarnInterval": "7200000",
6
+ "sessionTimeoutInterval": "9000000",
7
+ "serviceEndpoints": {
8
+ "api": "",
9
+ "idp": "https://int.idp.ellielabs.com",
10
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
11
+ },
12
+ "env": {
13
+ "localhost": {
14
+ "serviceEndpoints": {
15
+ "api": "",
16
+ "idp": "https://int.idp.ellielabs.com",
17
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
18
+ }
19
+ },
20
+ "dev": {
21
+ "serviceEndpoints": {
22
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
23
+ "idp": "https://int.idp.ellielabs.com",
24
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
25
+ }
26
+ },
27
+ "dev2": {
28
+ "serviceEndpoints": {
29
+ "api": "https://int.api.ellielabs.com",
30
+ "idp": "https://int.idp.ellielabs.com",
31
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
32
+ }
33
+ },
34
+ "qa": {
35
+ "serviceEndpoints": {
36
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
37
+ "idp": "https://int.idp.ellielabs.com",
38
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
39
+ }
40
+ },
41
+ "qa2": {
42
+ "serviceEndpoints": {
43
+ "api": "https://int.api.ellielabs.com",
44
+ "idp": "https://int.idp.ellielabs.com",
45
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
46
+ }
47
+ },
48
+ "qa3": {
49
+ "serviceEndpoints": {
50
+ "api": "https://int.api.ellielabs.com",
51
+ "idp": "https://int.idp.ellielabs.com",
52
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
53
+ }
54
+ },
55
+ "int": {
56
+ "serviceEndpoints": {
57
+ "api": "https://dev.api.puiservice.rd.elliemae.io",
58
+ "idp": "https://int.idp.ellielabs.com",
59
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
60
+ }
61
+ },
62
+ "peg-osb1": {
63
+ "serviceEndpoints": {
64
+ "api": "https://encompass-peg-api.elliemae.com",
65
+ "idp": "https://peg.idp.ellielabs.com/authorize",
66
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
67
+ }
68
+ },
69
+ "peg-osb2": {
70
+ "serviceEndpoints": {
71
+ "api": "https://encompass-peg2-api.elliemae.com",
72
+ "idp": "https://peg.idp.ellielabs.com/authorize",
73
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
74
+ }
75
+ },
76
+ "peg": {
77
+ "serviceEndpoints": {
78
+ "api": "https://peg2-west.api.ellielabs.com",
79
+ "idp": "https://peg.idp.ellielabs.com/authorize",
80
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
81
+ }
82
+ },
83
+ "peg-oapi-west": {
84
+ "serviceEndpoints": {
85
+ "api": "https://peg2-west.api.ellielabs.com",
86
+ "idp": "https://peg.idp.ellielabs.com/authorize",
87
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
88
+ }
89
+ },
90
+ "peg-oapi-east": {
91
+ "serviceEndpoints": {
92
+ "api": "https://peg2-east.api.ellielabs.com",
93
+ "idp": "https://peg.idp.ellielabs.com/authorize",
94
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
95
+ }
96
+ },
97
+ "peg2-oapi-east": {
98
+ "serviceEndpoints": {
99
+ "api": "https://peg2-east.api.ellielabs.com",
100
+ "idp": "https://peg.idp.ellielabs.com/authorize",
101
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
102
+ }
103
+ },
104
+ "peg3": {
105
+ "serviceEndpoints": {
106
+ "api": "https://pel1.api.ellielabs.com",
107
+ "idp": "https://peg3.idp.ellielabs.com/authorize",
108
+ "logger": "https://int.api.puidiagnostics.rd.elliemae.io/v1/logging"
109
+ }
110
+ },
111
+ "stage": {
112
+ "serviceEndpoints": {
113
+ "api": "https://stg.api.elliemae.com",
114
+ "idp": "https://stg.idp.elliemae.com/authorize",
115
+ "logger": "https://stg.api.puidiagnostics.ellielabs.com/v1/logging"
116
+ }
117
+ },
118
+ "beta": {
119
+ "serviceEndpoints": {
120
+ "api": "https://concept.api.elliemae.com",
121
+ "idp": "https://concept.idp.elliemae.com/authorize",
122
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
123
+ }
124
+ },
125
+ "demo": {
126
+ "serviceEndpoints": {
127
+ "api": "https://concept.api.elliemae.com",
128
+ "idp": "https://concept.idp.elliemae.com/authorize",
129
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
130
+ }
131
+ },
132
+ "epc": {
133
+ "serviceEndpoints": {
134
+ "api": "https://concept.api.elliemae.com",
135
+ "idp": "https://concept.idp.elliemae.com/authorize",
136
+ "logger": "https://concept.api.puidiagnostics.elliemae.com/v1/logging"
137
+ }
138
+ },
139
+ "prod": {
140
+ "serviceEndpoints": {
141
+ "api": "https://api.elliemae.com",
142
+ "idp": "https://idp.elliemae.com/authorize",
143
+ "logger": "https://api.puidiagnostics.ellieservices.com/v1/logging"
144
+ }
145
+ }
146
+ }
147
+ }
@@ -27,7 +27,13 @@ const getCurrentBreakpoint = () => {
27
27
  return "medium";
28
28
  return "large";
29
29
  };
30
- const getAssetPath = () => document.currentScript ? new URL("../", document.currentScript?.src).href : "latest/";
30
+ const getAssetPath = () => {
31
+ const assetPath = window?.emui?._ASSET_PATH || "latest/";
32
+ if (!window.emui?.version)
33
+ return assetPath;
34
+ const majorMinorVersion = window.emui?.version.match(/^(?:\d+\.\d+)*/g);
35
+ return majorMinorVersion && majorMinorVersion[0] ? assetPath.replace("latest/", `${majorMinorVersion[0]}/`) : assetPath;
36
+ };
31
37
  export {
32
38
  getAssetPath,
33
39
  getCurrentBreakpoint,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "4.13.3",
3
+ "version": "4.13.5",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",