@elliemae/pui-app-sdk 4.13.4 → 4.13.6

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
+ }
@@ -26,19 +26,18 @@ var import_react = require("@testing-library/react");
26
26
  var import_react_redux = require("react-redux");
27
27
  var import_history = require("history");
28
28
  var import_store = require("../../data/store.js");
29
- var import_history2 = require("../history.js");
30
29
  var import_app_router = require("../../view/app-router.js");
31
- const renderWithRouterRedux = (ui, {
32
- route = "/",
33
- history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }),
34
- initialState,
35
- store = (0, import_store.createAppStore)(initialState, import_history2.browserHistory)
36
- } = {}) => ({
37
- ...(0, import_react.render)(
38
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { history, children: ui }) })
39
- ),
40
- // adding `store` to the returned utilities to allow us
41
- // to reference it in our tests (just try to avoid using
42
- // this to test implementation details).
43
- store
44
- });
30
+ const renderWithRouterRedux = (ui, options) => {
31
+ const { route = "/", basename = "/", initialState } = options || {};
32
+ const { history = (0, import_history.createMemoryHistory)({ initialEntries: [route] }) } = options || {};
33
+ const { store = (0, import_store.createAppStore)(initialState, history) } = options || {};
34
+ return {
35
+ ...(0, import_react.render)(
36
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_redux.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_router.AppRouter, { basename, history, children: ui }) })
37
+ ),
38
+ // adding `store` to the returned utilities to allow us
39
+ // to reference it in our tests (just try to avoid using
40
+ // this to test implementation details).
41
+ store
42
+ };
43
+ };
@@ -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
+ }
@@ -3,22 +3,21 @@ import { render } from "@testing-library/react";
3
3
  import { Provider } from "react-redux";
4
4
  import { createMemoryHistory } from "history";
5
5
  import { createAppStore } from "../../data/store.js";
6
- import { browserHistory } from "../history.js";
7
6
  import { AppRouter } from "../../view/app-router.js";
8
- const renderWithRouterRedux = (ui, {
9
- route = "/",
10
- history = createMemoryHistory({ initialEntries: [route] }),
11
- initialState,
12
- store = createAppStore(initialState, browserHistory)
13
- } = {}) => ({
14
- ...render(
15
- /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { history, children: ui }) })
16
- ),
17
- // adding `store` to the returned utilities to allow us
18
- // to reference it in our tests (just try to avoid using
19
- // this to test implementation details).
20
- store
21
- });
7
+ const renderWithRouterRedux = (ui, options) => {
8
+ const { route = "/", basename = "/", initialState } = options || {};
9
+ const { history = createMemoryHistory({ initialEntries: [route] }) } = options || {};
10
+ const { store = createAppStore(initialState, history) } = options || {};
11
+ return {
12
+ ...render(
13
+ /* @__PURE__ */ jsx(Provider, { store, children: /* @__PURE__ */ jsx(AppRouter, { basename, history, children: ui }) })
14
+ ),
15
+ // adding `store` to the returned utilities to allow us
16
+ // to reference it in our tests (just try to avoid using
17
+ // this to test implementation details).
18
+ store
19
+ };
20
+ };
22
21
  export {
23
22
  renderWithRouterRedux
24
23
  };
@@ -3,11 +3,12 @@ import { History } from 'history';
3
3
  import { AppStore, RootState } from '../../data/store.js';
4
4
  interface Args {
5
5
  initialState: RootState;
6
- store: AppStore;
7
- route: string;
8
- history: History;
6
+ store?: AppStore;
7
+ route?: string;
8
+ basename?: string;
9
+ history?: History;
9
10
  }
10
- export declare const renderWithRouterRedux: (ui: React.ReactElement, { route, history, initialState, store, }?: Args) => {
11
+ export declare const renderWithRouterRedux: (ui: React.ReactElement, options?: Args) => {
11
12
  store: import("@reduxjs/toolkit/dist/configureStore.js").ToolkitStore<import("redux").EmptyObject & {
12
13
  waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
13
14
  error: import("../../data/error/index.js").ErrorState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/pui-app-sdk",
3
- "version": "4.13.4",
3
+ "version": "4.13.6",
4
4
  "description": "ICE MT UI Platform Application SDK ",
5
5
  "sideEffects": [
6
6
  "*.css",