@elliemae/pui-app-sdk 2.12.3 → 2.13.2
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.
- package/dist/cjs/analytics/appdynamics.js +36 -0
- package/dist/cjs/analytics/index.js +15 -13
- package/dist/cjs/analytics/page-view-event.js +16 -19
- package/dist/cjs/analytics/user-session-event.js +13 -14
- package/dist/cjs/analytics/user-wait-event.js +4 -4
- package/dist/cjs/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
- package/dist/cjs/api/auth/index.js +13 -20
- package/dist/cjs/api/helpers.js +4 -16
- package/dist/cjs/api/users/index.js +4 -5
- package/dist/cjs/communication/http-client/index.js +16 -21
- package/dist/cjs/communication/http-client/retry-axios.js +0 -2
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +5 -6
- package/dist/cjs/data/auth/actions.js +22 -28
- package/dist/cjs/data/breakpoint/index.js +1 -3
- package/dist/cjs/data/live-message/index.js +8 -11
- package/dist/cjs/data/reducers.js +1 -2
- package/dist/cjs/data/store.js +4 -8
- package/dist/cjs/data/wait-message/actions.js +6 -9
- package/dist/cjs/data/wait-message/reducer.js +13 -17
- package/dist/cjs/index.js +21 -15
- package/dist/cjs/route/index.js +23 -12
- package/dist/cjs/route/{usePageView.js → page-view.js} +12 -22
- package/dist/cjs/route/private-route/index.js +9 -10
- package/dist/cjs/sideeffect/auth/index.js +6 -10
- package/dist/cjs/utils/app-config/config.js +3 -14
- package/dist/cjs/utils/app-config/index.js +11 -15
- package/dist/cjs/utils/app-host-integration/react.js +7 -10
- package/dist/cjs/utils/auth/index.js +40 -44
- package/dist/cjs/utils/font-size.js +1 -1
- package/dist/cjs/utils/helpers.js +0 -6
- package/dist/cjs/utils/log-records.js +7 -7
- package/dist/cjs/utils/micro-frontend/guest.js +31 -8
- package/dist/cjs/utils/micro-frontend/host.js +14 -7
- package/dist/cjs/utils/micro-frontend/index.js +2 -4
- package/dist/cjs/utils/redact-pii.js +39 -0
- package/dist/cjs/utils/service-worker.js +2 -5
- package/dist/cjs/utils/session.js +2 -8
- package/dist/cjs/utils/storybook/theme.js +9 -12
- package/dist/cjs/utils/testing/index.js +9 -18
- package/dist/cjs/utils/testing/render-with-redux.js +11 -14
- package/dist/cjs/utils/testing/render-with-router-redux.js +17 -20
- package/dist/cjs/utils/testing/render-with-router.js +13 -16
- package/dist/cjs/utils/testing/render-with-state-addons.js +7 -16
- package/dist/cjs/utils/url.js +0 -8
- package/dist/cjs/utils/web-storage.js +1 -7
- package/dist/cjs/utils/window.js +0 -2
- package/dist/cjs/view/app-root/hosted-app.js +5 -8
- package/dist/cjs/view/app-root/index.js +20 -23
- package/dist/cjs/view/app-root/stand-alone-app.js +5 -8
- package/dist/cjs/view/app-root/style.js +5 -12
- package/dist/cjs/view/error-toast/index.stories.js +22 -31
- package/dist/cjs/view/fetch-host-app-data/store.js +1 -5
- package/dist/cjs/view/fields/check-box/index.js +20 -32
- package/dist/cjs/view/fields/check-box/index.stories.js +20 -24
- package/dist/cjs/view/fields/check-box/set-value.stories.js +17 -21
- package/dist/cjs/view/fields/combo-box/index.js +22 -28
- package/dist/cjs/view/fields/connect-form.js +3 -4
- package/dist/cjs/view/fields/date-input/index.js +15 -21
- package/dist/cjs/view/fields/date-picker/index.js +15 -21
- package/dist/cjs/view/fields/form-item-layout/index.js +16 -20
- package/dist/cjs/view/fields/input-mask/index.js +16 -28
- package/dist/cjs/view/fields/large-text-box/index.js +15 -21
- package/dist/cjs/view/fields/radio/index.js +20 -26
- package/dist/cjs/view/fields/radio/index.stories.js +17 -21
- package/dist/cjs/view/fields/radio/set-value.stories.js +15 -19
- package/dist/cjs/view/fields/radio-group/index.js +16 -22
- package/dist/cjs/view/fields/radio-group/index.stories.js +37 -44
- package/dist/cjs/view/fields/text-box/index.js +15 -21
- package/dist/cjs/view/fields/watch-value.js +4 -5
- package/dist/cjs/view/form/index.js +9 -10
- package/dist/cjs/view/form/index.stories.js +3 -6
- package/dist/cjs/view/form/submit-button/index.js +2 -3
- package/dist/cjs/view/form/usecases.stories.js +3 -6
- package/dist/cjs/view/guest-unload-handlers/index.js +1 -2
- package/dist/cjs/view/header/center-region/index.js +8 -20
- package/dist/cjs/view/header/index.js +8 -11
- package/dist/cjs/view/host-binding-events/index.js +2 -2
- package/dist/cjs/view/live-message/index.stories.js +0 -6
- package/dist/cjs/view/loadable/index.js +1 -2
- package/dist/cjs/view/login/index.js +5 -6
- package/dist/cjs/view/media-breakpoint/index.js +1 -1
- package/dist/cjs/view/message-to-host-app/index.js +1 -2
- package/dist/cjs/view/micro-app/app-factory/index.js +30 -48
- package/dist/cjs/view/micro-app/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/manifest.js +27 -39
- package/dist/cjs/view/micro-app/resources/script.js +22 -35
- package/dist/cjs/view/micro-app/resources/style.js +20 -33
- package/dist/cjs/view/micro-app/use-app-will-render.js +12 -12
- package/dist/cjs/view/micro-app/utils.js +0 -6
- package/dist/cjs/view/micro-iframe-app/app.js +6 -9
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -9
- package/dist/cjs/view/micro-iframe-app/index.js +4 -7
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -12
- package/dist/cjs/view/modals/error/index.js +6 -13
- package/dist/cjs/view/modals/navigation-prompt/index.js +4 -11
- package/dist/cjs/view/modals/session-expiry/customHooks.js +3 -5
- package/dist/cjs/view/modals/session-expiry/index.js +6 -13
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +3 -4
- package/dist/cjs/view/modals/wait-message/index.js +8 -9
- package/dist/cjs/view/modals/wait-message/index.stories.js +4 -5
- package/dist/cjs/view/render-with-delay/index.js +3 -6
- package/dist/cjs/view/render-with-host-data/index.js +0 -2
- package/dist/cjs/view/session-timeout/index.js +0 -2
- package/dist/cjs/view/useMediaBreakpoints/index.js +0 -12
- package/dist/es/analytics/appdynamics.js +18 -0
- package/dist/es/analytics/index.js +14 -13
- package/dist/es/analytics/page-view-event.js +16 -19
- package/dist/es/analytics/user-session-event.js +12 -13
- package/dist/es/analytics/user-wait-event.js +4 -4
- package/dist/es/analytics/{ba-event-parameters.js → web-analytics.js} +2 -2
- package/dist/es/api/auth/index.js +13 -18
- package/dist/es/api/helpers.js +4 -14
- package/dist/es/api/users/index.js +4 -5
- package/dist/es/communication/http-client/index.js +16 -20
- package/dist/es/communication/http-client/retry-axios.js +0 -2
- package/dist/es/communication/http-client/tests/index.test-disable.js +5 -6
- package/dist/es/data/auth/actions.js +22 -28
- package/dist/es/data/breakpoint/index.js +1 -3
- package/dist/es/data/live-message/index.js +8 -11
- package/dist/es/data/reducers.js +1 -2
- package/dist/es/data/store.js +4 -8
- package/dist/es/data/wait-message/actions.js +6 -9
- package/dist/es/data/wait-message/reducer.js +12 -16
- package/dist/es/index.js +4 -1
- package/dist/es/route/index.js +23 -13
- package/dist/es/route/page-view.js +15 -0
- package/dist/es/route/private-route/index.js +9 -10
- package/dist/es/sideeffect/auth/index.js +6 -10
- package/dist/es/utils/app-config/config.js +3 -14
- package/dist/es/utils/app-config/index.js +11 -15
- package/dist/es/utils/app-host-integration/react.js +7 -10
- package/dist/es/utils/auth/index.js +39 -41
- package/dist/es/utils/font-size.js +1 -1
- package/dist/es/utils/helpers.js +0 -3
- package/dist/es/utils/log-records.js +7 -7
- package/dist/es/utils/micro-frontend/guest.js +29 -6
- package/dist/es/utils/micro-frontend/host.js +13 -7
- package/dist/es/utils/micro-frontend/index.js +2 -3
- package/dist/es/utils/redact-pii.js +31 -0
- package/dist/es/utils/service-worker.js +2 -4
- package/dist/es/utils/session.js +2 -8
- package/dist/es/utils/storybook/theme.js +9 -12
- package/dist/es/utils/testing/index.js +9 -12
- package/dist/es/utils/testing/render-with-redux.js +11 -14
- package/dist/es/utils/testing/render-with-router-redux.js +17 -20
- package/dist/es/utils/testing/render-with-router.js +13 -16
- package/dist/es/utils/testing/render-with-state-addons.js +7 -12
- package/dist/es/utils/url.js +0 -4
- package/dist/es/utils/web-storage.js +1 -4
- package/dist/es/utils/window.js +0 -1
- package/dist/es/view/app-root/hosted-app.js +5 -8
- package/dist/es/view/app-root/index.js +20 -23
- package/dist/es/view/app-root/stand-alone-app.js +5 -8
- package/dist/es/view/app-root/style.js +5 -10
- package/dist/es/view/error-toast/index.stories.js +22 -30
- package/dist/es/view/fetch-host-app-data/store.js +1 -5
- package/dist/es/view/fields/check-box/index.js +20 -26
- package/dist/es/view/fields/check-box/index.stories.js +20 -24
- package/dist/es/view/fields/check-box/set-value.stories.js +17 -21
- package/dist/es/view/fields/combo-box/index.js +22 -28
- package/dist/es/view/fields/connect-form.js +3 -4
- package/dist/es/view/fields/date-input/index.js +15 -21
- package/dist/es/view/fields/date-picker/index.js +15 -21
- package/dist/es/view/fields/form-item-layout/index.js +16 -20
- package/dist/es/view/fields/input-mask/index.js +16 -22
- package/dist/es/view/fields/large-text-box/index.js +15 -21
- package/dist/es/view/fields/radio/index.js +20 -26
- package/dist/es/view/fields/radio/index.stories.js +17 -21
- package/dist/es/view/fields/radio/set-value.stories.js +15 -19
- package/dist/es/view/fields/radio-group/index.js +16 -22
- package/dist/es/view/fields/radio-group/index.stories.js +37 -44
- package/dist/es/view/fields/text-box/index.js +15 -21
- package/dist/es/view/fields/watch-value.js +4 -5
- package/dist/es/view/form/index.js +9 -10
- package/dist/es/view/form/index.stories.js +3 -6
- package/dist/es/view/form/submit-button/index.js +2 -3
- package/dist/es/view/form/usecases.stories.js +3 -6
- package/dist/es/view/guest-unload-handlers/index.js +1 -2
- package/dist/es/view/header/center-region/index.js +8 -17
- package/dist/es/view/header/index.js +8 -11
- package/dist/es/view/host-binding-events/index.js +2 -2
- package/dist/es/view/live-message/index.stories.js +0 -1
- package/dist/es/view/loadable/index.js +1 -2
- package/dist/es/view/login/index.js +5 -6
- package/dist/es/view/media-breakpoint/index.js +1 -1
- package/dist/es/view/message-to-host-app/index.js +1 -2
- package/dist/es/view/micro-app/app-factory/index.js +30 -42
- package/dist/es/view/micro-app/index.js +1 -1
- package/dist/es/view/micro-app/resources/manifest.js +26 -31
- package/dist/es/view/micro-app/resources/script.js +21 -31
- package/dist/es/view/micro-app/resources/style.js +20 -30
- package/dist/es/view/micro-app/use-app-will-render.js +12 -12
- package/dist/es/view/micro-app/utils.js +0 -3
- package/dist/es/view/micro-iframe-app/app.js +6 -8
- package/dist/es/view/micro-iframe-app/iframe/index.js +8 -9
- package/dist/es/view/micro-iframe-app/index.js +4 -6
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -9
- package/dist/es/view/modals/error/index.js +6 -8
- package/dist/es/view/modals/navigation-prompt/index.js +4 -5
- package/dist/es/view/modals/session-expiry/customHooks.js +3 -4
- package/dist/es/view/modals/session-expiry/index.js +6 -8
- package/dist/es/view/modals/wait-message/html-wait-message.js +3 -4
- package/dist/es/view/modals/wait-message/index.js +8 -9
- package/dist/es/view/modals/wait-message/index.stories.js +4 -5
- package/dist/es/view/render-with-delay/index.js +3 -5
- package/dist/es/view/render-with-host-data/index.js +0 -1
- package/dist/es/view/session-timeout/index.js +0 -1
- package/dist/es/view/useMediaBreakpoints/index.js +0 -6
- package/dist/types/analytics/appdynamics.d.ts +9 -0
- package/dist/types/analytics/index.d.ts +2 -2
- package/dist/types/analytics/web-analytics.d.ts +8 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/route/page-view.d.ts +1 -0
- package/dist/types/utils/micro-frontend/guest.d.ts +1 -0
- package/dist/types/utils/micro-frontend/host.d.ts +1 -1
- package/dist/types/utils/redact-pii.d.ts +1 -0
- package/dist/types/view/visually-hidden/index.d.ts +1 -1
- package/package.json +7 -3
- package/dist/es/route/usePageView.js +0 -18
- package/dist/public/app.config.json +0 -129
- package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +0 -1
- package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +0 -1
- package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +0 -1
- package/dist/public/iframe.b3911eaf1a99a53ef7b10a1e1f0bdfc4.html +0 -8
- package/dist/public/index.html +0 -5
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js +0 -3
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.LICENSE.txt +0 -95
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.e28a62497e211b4c6132.js.map +0 -1
- package/dist/types/analytics/ba-event-parameters.d.ts +0 -8
- package/dist/types/route/usePageView.d.ts +0 -1
|
@@ -13,19 +13,15 @@ const parseAppConfig = data => {
|
|
|
13
13
|
setAppConfig(_merge(data, activeEnvConfig));
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const loadAppConfig =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
resolve();
|
|
27
|
-
}).catch(err => {
|
|
28
|
-
reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
|
|
29
|
-
});
|
|
16
|
+
export const loadAppConfig = (hostUrl = './') => new Promise((resolve, reject) => {
|
|
17
|
+
getHTTPClient({
|
|
18
|
+
baseURL: hostUrl
|
|
19
|
+
}).get('app.config.json').then(({
|
|
20
|
+
data
|
|
21
|
+
}) => {
|
|
22
|
+
parseAppConfig(data);
|
|
23
|
+
resolve();
|
|
24
|
+
}).catch(err => {
|
|
25
|
+
reject(new Error(`Unable to load application configurtion file. ${err.Message}`));
|
|
30
26
|
});
|
|
31
|
-
};
|
|
27
|
+
});
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { CMicroAppGuest } from "../micro-frontend/guest.js";
|
|
2
|
-
export const enableReactAppForHostIntegration =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
onMount
|
|
10
|
-
});
|
|
11
|
-
};
|
|
2
|
+
export const enableReactAppForHostIntegration = ({
|
|
3
|
+
onInit,
|
|
4
|
+
onMount
|
|
5
|
+
}) => CMicroAppGuest.getInstance({
|
|
6
|
+
onInit,
|
|
7
|
+
onMount
|
|
8
|
+
});
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
-
import "core-js/modules/web.url.js";
|
|
3
|
-
import "core-js/modules/web.url-search-params.js";
|
|
4
|
-
import "core-js/modules/es.string.replace.js";
|
|
5
|
-
|
|
6
1
|
/* eslint-disable max-lines */
|
|
7
2
|
import { browserHistory as history } from "../history.js";
|
|
8
3
|
import { getToken, revokeToken, introspectToken } from "../../api/auth/index.js";
|
|
9
4
|
import { getUser } from "../../api/users/index.js";
|
|
10
5
|
import { loginEvent, logoutEvent } from "../../analytics/user-session-event.js";
|
|
6
|
+
import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
|
|
11
7
|
import { getAuthorizationHeader, setAuthorizationHeader } from "./helper.js";
|
|
12
8
|
import { getAppConfigValue } from "../app-config/config.js";
|
|
13
9
|
import { getLogger } from "../micro-frontend/index.js";
|
|
@@ -25,15 +21,14 @@ export const getIDPInfoFromUrl = () => {
|
|
|
25
21
|
redirectUri: currentUrl.href
|
|
26
22
|
};
|
|
27
23
|
};
|
|
28
|
-
export const navigateToLoginPage =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} = _ref;
|
|
24
|
+
export const navigateToLoginPage = ({
|
|
25
|
+
clientId,
|
|
26
|
+
redirectUri,
|
|
27
|
+
idpErrorCode,
|
|
28
|
+
scope,
|
|
29
|
+
// eslint-disable-next-line camelcase
|
|
30
|
+
responseType
|
|
31
|
+
}) => {
|
|
37
32
|
const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
38
33
|
const idpUrl = new URL('/authorize', idpHost);
|
|
39
34
|
const idpOptions = {
|
|
@@ -48,15 +43,13 @@ export const navigateToLoginPage = _ref => {
|
|
|
48
43
|
idpUrl.search = searchParams.toString();
|
|
49
44
|
window.location.replace(idpUrl.href);
|
|
50
45
|
};
|
|
51
|
-
export const endSession = async
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
} = _ref2;
|
|
59
|
-
|
|
46
|
+
export const endSession = async ({
|
|
47
|
+
clientId,
|
|
48
|
+
redirectUri,
|
|
49
|
+
responseType,
|
|
50
|
+
scope,
|
|
51
|
+
code = '1004'
|
|
52
|
+
}) => {
|
|
60
53
|
try {
|
|
61
54
|
const authorization = getAuthorizationHeader();
|
|
62
55
|
sessionStorage.clear();
|
|
@@ -65,7 +58,11 @@ export const endSession = async _ref2 => {
|
|
|
65
58
|
clientId,
|
|
66
59
|
token
|
|
67
60
|
});
|
|
68
|
-
logoutEvent();
|
|
61
|
+
logoutEvent();
|
|
62
|
+
setAppDynamicsUserData({
|
|
63
|
+
instanceId: '',
|
|
64
|
+
userId: ''
|
|
65
|
+
}); // redirect
|
|
69
66
|
|
|
70
67
|
const idpHost = getAppConfigValue(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
71
68
|
const logoutUrl = new URL('/authorize', idpHost);
|
|
@@ -85,15 +82,13 @@ export const endSession = async _ref2 => {
|
|
|
85
82
|
});
|
|
86
83
|
}
|
|
87
84
|
};
|
|
88
|
-
export const authorize = async
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
} = _ref3;
|
|
96
|
-
|
|
85
|
+
export const authorize = async ({
|
|
86
|
+
idpCode,
|
|
87
|
+
redirectUri,
|
|
88
|
+
clientId,
|
|
89
|
+
scope,
|
|
90
|
+
responseType
|
|
91
|
+
}) => {
|
|
97
92
|
try {
|
|
98
93
|
const {
|
|
99
94
|
tokenType,
|
|
@@ -103,7 +98,7 @@ export const authorize = async _ref3 => {
|
|
|
103
98
|
redirectUri,
|
|
104
99
|
clientId
|
|
105
100
|
});
|
|
106
|
-
const authorizationToken =
|
|
101
|
+
const authorizationToken = `${tokenType} ${accessToken}`;
|
|
107
102
|
setAuthorizationHeader(authorizationToken); // get user introspect data
|
|
108
103
|
|
|
109
104
|
const introspectResponse = await introspectToken({
|
|
@@ -120,7 +115,7 @@ export const authorize = async _ref3 => {
|
|
|
120
115
|
bearerToken,
|
|
121
116
|
realm: instanceId,
|
|
122
117
|
userName,
|
|
123
|
-
sessionId: bearerToken.replace(
|
|
118
|
+
sessionId: bearerToken.replace(`${instanceId} `, '')
|
|
124
119
|
};
|
|
125
120
|
sessionStorage.setItem('cred', JSON.stringify(cred));
|
|
126
121
|
sessionStorage.setItem('instanceId', instanceId);
|
|
@@ -128,6 +123,10 @@ export const authorize = async _ref3 => {
|
|
|
128
123
|
loginEvent({
|
|
129
124
|
instanceId,
|
|
130
125
|
userId: userName
|
|
126
|
+
});
|
|
127
|
+
setAppDynamicsUserData({
|
|
128
|
+
instanceId,
|
|
129
|
+
userId: userName
|
|
131
130
|
}); // get user info
|
|
132
131
|
|
|
133
132
|
const data = await getUser({
|
|
@@ -151,12 +150,11 @@ export const authorize = async _ref3 => {
|
|
|
151
150
|
});
|
|
152
151
|
}
|
|
153
152
|
};
|
|
154
|
-
export const login = async
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
} = _ref4;
|
|
153
|
+
export const login = async ({
|
|
154
|
+
clientId,
|
|
155
|
+
scope,
|
|
156
|
+
responseType
|
|
157
|
+
}) => {
|
|
160
158
|
const {
|
|
161
159
|
idpCode,
|
|
162
160
|
idpErrorCode,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
const docFontSize = document && document.documentElement ? getComputedStyle(document.documentElement).fontSize : '16';
|
|
2
2
|
export const remToPx = rem => rem * parseFloat(docFontSize);
|
|
3
|
-
export const pxToRem = px =>
|
|
3
|
+
export const pxToRem = px => `${px / parseFloat(docFontSize)}rem`;
|
package/dist/es/utils/helpers.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
-
import "core-js/modules/web.url.js";
|
|
3
|
-
import "core-js/modules/web.url-search-params.js";
|
|
4
1
|
export const isProd = () => process.env.NODE_ENV === 'production';
|
|
5
2
|
export const isCIBuild = () => process.env.CI === 'true';
|
|
6
3
|
const PROTOCOL = new RegExp('^(?:[a-z]+:)?//', 'i');
|
|
@@ -17,31 +17,31 @@ export const logRecords = {
|
|
|
17
17
|
},
|
|
18
18
|
ASSET_NOT_FOUND_IN_MANIFEST: assetName => ({
|
|
19
19
|
code: 'appsdk05',
|
|
20
|
-
msg:
|
|
20
|
+
msg: `Application load failed. unable to locate ${assetName} in the manifest`
|
|
21
21
|
}),
|
|
22
22
|
APP_INIT_FAILED: (appId, errMsg) => ({
|
|
23
23
|
code: 'appsdk06',
|
|
24
|
-
msg:
|
|
24
|
+
msg: `Application load failed. Unable to load one or more application resources for appId: ${appId}. ${errMsg}`
|
|
25
25
|
}),
|
|
26
26
|
APP_LOADING: appId => ({
|
|
27
27
|
code: 'appsdk07',
|
|
28
|
-
msg:
|
|
28
|
+
msg: `Application ${appId} is loading...`
|
|
29
29
|
}),
|
|
30
30
|
APP_LOADING_COMPLETE: appId => ({
|
|
31
31
|
code: 'appsdk08',
|
|
32
|
-
msg:
|
|
32
|
+
msg: `Application ${appId} loaded`
|
|
33
33
|
}),
|
|
34
34
|
APP_UNLOADING: appId => ({
|
|
35
35
|
code: 'appsdk09',
|
|
36
|
-
msg:
|
|
36
|
+
msg: `Application ${appId} unloading...`
|
|
37
37
|
}),
|
|
38
38
|
APP_UNLOADING_COMPLETE: appId => ({
|
|
39
39
|
code: 'appsdk10',
|
|
40
|
-
msg:
|
|
40
|
+
msg: `Application ${appId} unloaded`
|
|
41
41
|
}),
|
|
42
42
|
SSF_HOST_OBJECT_NOT_FOUND: name => ({
|
|
43
43
|
code: 'appsdk11',
|
|
44
|
-
msg:
|
|
44
|
+
msg: `Parent window doesn't expose SSF Object named ${name}`
|
|
45
45
|
}),
|
|
46
46
|
LOGIN_FAILED: {
|
|
47
47
|
code: 'appsdk12',
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _merge from "lodash/merge";
|
|
3
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
4
|
-
import "core-js/modules/es.string.replace.js";
|
|
5
3
|
import ReactDOM from 'react-dom';
|
|
6
4
|
import ssfGuest from '@elliemae/em-ssf-guest';
|
|
7
5
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
@@ -11,6 +9,8 @@ import { getAppConfigValue } from "../app-config/config.js";
|
|
|
11
9
|
import { browserHistory } from "../history.js";
|
|
12
10
|
import { logger } from "./console-logger.js";
|
|
13
11
|
import { removeStorageEvents } from "../web-storage.js";
|
|
12
|
+
import { updateBAEventParameters } from "../../analytics/web-analytics.js";
|
|
13
|
+
import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
|
|
14
14
|
|
|
15
15
|
const isCrossDomain = () => {
|
|
16
16
|
try {
|
|
@@ -104,6 +104,18 @@ export class CMicroAppGuest {
|
|
|
104
104
|
return this.props;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
getSessionStorageItem(key) {
|
|
108
|
+
var _this$props$host;
|
|
109
|
+
|
|
110
|
+
let value = sessionStorage.getItem(key);
|
|
111
|
+
|
|
112
|
+
if (!value && (_this$props$host = this.props.host) !== null && _this$props$host !== void 0 && _this$props$host.getItem) {
|
|
113
|
+
value = this.props.host.getItem(key);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
return value;
|
|
117
|
+
}
|
|
118
|
+
|
|
107
119
|
async getSSFHost() {
|
|
108
120
|
let host = null;
|
|
109
121
|
|
|
@@ -140,12 +152,23 @@ export class CMicroAppGuest {
|
|
|
140
152
|
if (this.onInit) this.onInit(this.props);
|
|
141
153
|
});
|
|
142
154
|
/* eslint-enable camelcase, no-undef */
|
|
155
|
+
|
|
156
|
+
const instanceId = this.getSessionStorageItem('instanceId') || '';
|
|
157
|
+
const userId = this.getSessionStorageItem('userId') || '';
|
|
158
|
+
updateBAEventParameters({
|
|
159
|
+
instanceId,
|
|
160
|
+
userId
|
|
161
|
+
});
|
|
162
|
+
setAppDynamicsUserData({
|
|
163
|
+
subAppId: this.appId,
|
|
164
|
+
instanceId,
|
|
165
|
+
userId
|
|
166
|
+
});
|
|
143
167
|
}
|
|
144
168
|
|
|
145
|
-
mount(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
};
|
|
169
|
+
mount(options = {
|
|
170
|
+
containerId: 'app-container'
|
|
171
|
+
}) {
|
|
149
172
|
this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
|
|
150
173
|
return Promise.resolve().then(() => {
|
|
151
174
|
if (this.onMount) this.onMount(options);
|
|
@@ -13,6 +13,7 @@ import { logger } from "./console-logger.js";
|
|
|
13
13
|
import { HOST_WINDOW_RESIZED, HOST_WINDOW_BREAKPOINT_CHANGED } from "../constants.js";
|
|
14
14
|
import { getCurrentBreakpoint, getViewportSize as getWindowViewportSize } from "../window.js";
|
|
15
15
|
import { sendBAEvent } from "../../analytics/index.js";
|
|
16
|
+
import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
|
|
16
17
|
export class CMicroAppHost {
|
|
17
18
|
constructor(params) {
|
|
18
19
|
_defineProperty(this, "logger", void 0);
|
|
@@ -49,6 +50,12 @@ export class CMicroAppHost {
|
|
|
49
50
|
if (this.onInit) this.onInit(this.props);
|
|
50
51
|
}).catch(() => {});
|
|
51
52
|
/* eslint-enable camelcase, no-undef */
|
|
53
|
+
|
|
54
|
+
setAppDynamicsUserData({
|
|
55
|
+
subAppId: this.appId,
|
|
56
|
+
instanceId: '',
|
|
57
|
+
userId: ''
|
|
58
|
+
});
|
|
52
59
|
}
|
|
53
60
|
|
|
54
61
|
static getInstance(params) {
|
|
@@ -155,19 +162,18 @@ export class CMicroAppHost {
|
|
|
155
162
|
return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
|
|
156
163
|
}
|
|
157
164
|
|
|
158
|
-
setSystemVersion() {
|
|
159
|
-
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'latest';
|
|
165
|
+
setSystemVersion(version = 'latest') {
|
|
160
166
|
window.emui.version = version;
|
|
161
167
|
this.props.systemVersion = version;
|
|
162
|
-
}
|
|
168
|
+
} // eslint-disable-next-line max-lines
|
|
163
169
|
|
|
164
|
-
|
|
170
|
+
|
|
171
|
+
sendBAEvent(data) {
|
|
165
172
|
sendBAEvent({
|
|
166
|
-
|
|
173
|
+
data,
|
|
167
174
|
self: true
|
|
168
175
|
});
|
|
169
|
-
}
|
|
170
|
-
|
|
176
|
+
}
|
|
171
177
|
|
|
172
178
|
}
|
|
173
179
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _merge from "lodash/merge";
|
|
2
|
-
import "core-js/modules/es.string.replace.js";
|
|
3
2
|
import { CMicroAppGuest } from "./guest.js";
|
|
4
3
|
import { CMicroAppHost } from "./host.js";
|
|
5
4
|
import { getAppConfigValue } from "../app-config/config.js";
|
|
@@ -24,8 +23,8 @@ const getVersionedPath = path => {
|
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
export const getMicroFrontEndAppConfig = appInfo => {
|
|
27
|
-
const microFEAppConfig = getAppConfigValue(
|
|
28
|
-
if (!microFEAppConfig) throw new Error(
|
|
26
|
+
const microFEAppConfig = getAppConfigValue(`microFrontendApps.${appInfo.id}`);
|
|
27
|
+
if (!microFEAppConfig) throw new Error(`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`);
|
|
29
28
|
const {
|
|
30
29
|
mode = 'production'
|
|
31
30
|
} = microFEAppConfig;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const aptRegex = /(apt|bldg|dept|fl|hngr|lot|pier|rm|ste|slip|trlr|unit|#)\.? *[a-z0-9-]+\b/gi;
|
|
2
|
+
const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
|
|
3
|
+
const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
|
|
4
|
+
const piiPatterns = {
|
|
5
|
+
creditCardNumber: /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g,
|
|
6
|
+
streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, 'gi'),
|
|
7
|
+
zipcode: /\b\d{5}\b(-\d{4})?\b/g,
|
|
8
|
+
phoneNumber: /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g,
|
|
9
|
+
ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
|
|
10
|
+
usSocialSecurityNumber: /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g,
|
|
11
|
+
emailAddress: /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi,
|
|
12
|
+
// username: /(user( ?name)?|login): \S+/gi,
|
|
13
|
+
password: /(pass(word|phrase)?|secret): \S+/gi,
|
|
14
|
+
credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi // digits: /\b\d{4,}\b/g,
|
|
15
|
+
// url: /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g,
|
|
16
|
+
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const replacer = (key, value) => {
|
|
20
|
+
if (!key || typeof value !== 'string' || key === 'correlationId') return value;
|
|
21
|
+
return Object.values(piiPatterns).reduce((redactedString, piiPattern) => redactedString.replace(piiPattern, '****'), value);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export const redactPii = data => {
|
|
25
|
+
try {
|
|
26
|
+
const redactedData = JSON.stringify(data, replacer);
|
|
27
|
+
return JSON.parse(redactedData);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import "core-js/modules/es.string.replace.js";
|
|
2
1
|
import { logRecords } from "./log-records.js";
|
|
3
2
|
import { getLogger } from "./micro-frontend/index.js";
|
|
4
|
-
export const initServiceWorker =
|
|
5
|
-
let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
3
|
+
export const initServiceWorker = (swDest = '') => {
|
|
6
4
|
const logger = getLogger() || console;
|
|
7
5
|
|
|
8
6
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
9
7
|
window.addEventListener('load', () => {
|
|
10
|
-
navigator.serviceWorker.register(
|
|
8
|
+
navigator.serviceWorker.register(`${swDest.replace(/\/?$/, '/')}sw.js`).then(() => {
|
|
11
9
|
logger.debug('Service Worker registered');
|
|
12
10
|
}).catch(registrationError => {
|
|
13
11
|
logger.error({ ...logRecords.SERVICE_WORKER_FAILED,
|
package/dist/es/utils/session.js
CHANGED
|
@@ -23,15 +23,9 @@ const throttledResetUserIdleTime = _throttle(resetUserIdleTime, THROTTLING_TIME,
|
|
|
23
23
|
leading: true
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
const isPastWarningTime =
|
|
27
|
-
let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutWarnInterval') || SESSION_TIMEOUT_INTERVAL.WARN;
|
|
28
|
-
return Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
29
|
-
};
|
|
26
|
+
const isPastWarningTime = (warnInterval = getAppConfigValue('sessionTimeoutWarnInterval') || SESSION_TIMEOUT_INTERVAL.WARN) => Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
30
27
|
|
|
31
|
-
const isPastSessionTimeoutTime =
|
|
32
|
-
let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getAppConfigValue('sessionTimeoutInterval') || SESSION_TIMEOUT_INTERVAL.EXPIRY;
|
|
33
|
-
return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
34
|
-
};
|
|
28
|
+
const isPastSessionTimeoutTime = (sessionTimeout = getAppConfigValue('sessionTimeoutInterval') || SESSION_TIMEOUT_INTERVAL.EXPIRY) => Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
35
29
|
|
|
36
30
|
const notifySessionExpiryWarning = () => {
|
|
37
31
|
sessionExpiryWarningNotified = true;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { create } from '@storybook/theming/create';
|
|
2
|
-
export const createTheme =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
...rest
|
|
12
|
-
});
|
|
13
|
-
};
|
|
2
|
+
export const createTheme = ({
|
|
3
|
+
base = 'light',
|
|
4
|
+
brandTitle = 'Platform UI Components',
|
|
5
|
+
...rest
|
|
6
|
+
}) => create({
|
|
7
|
+
base,
|
|
8
|
+
brandTitle: `${brandTitle} ${process.env.STORYBOOK_VERSION || ''}`,
|
|
9
|
+
...rest
|
|
10
|
+
});
|
|
@@ -7,18 +7,15 @@ import { browserHistory } from "../history.js";
|
|
|
7
7
|
const defaultStore = createAppStore({}, browserHistory);
|
|
8
8
|
const defaultTheme = getDefaultTheme();
|
|
9
9
|
|
|
10
|
-
const AllTheProviders =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
theme: theme
|
|
20
|
-
}, void 0, children);
|
|
21
|
-
};
|
|
10
|
+
const AllTheProviders = ({
|
|
11
|
+
store = defaultStore,
|
|
12
|
+
theme = defaultTheme,
|
|
13
|
+
children
|
|
14
|
+
}) => /*#__PURE__*/_jsx(AppRoot, {
|
|
15
|
+
store: store,
|
|
16
|
+
history: browserHistory,
|
|
17
|
+
theme: theme
|
|
18
|
+
}, void 0, children);
|
|
22
19
|
|
|
23
20
|
const customRender = (ui, options) => render(ui, {
|
|
24
21
|
wrapper: AllTheProviders,
|
|
@@ -3,17 +3,14 @@ import { render } from '@testing-library/react';
|
|
|
3
3
|
import { Provider } from 'react-redux';
|
|
4
4
|
import { createAppStore } from "../../data/store.js";
|
|
5
5
|
import { browserHistory } from "../history.js";
|
|
6
|
-
export const renderWithRedux =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
store
|
|
18
|
-
};
|
|
19
|
-
};
|
|
6
|
+
export const renderWithRedux = (ui, {
|
|
7
|
+
initialState,
|
|
8
|
+
store = createAppStore(initialState, browserHistory)
|
|
9
|
+
} = {}) => ({ ...render( /*#__PURE__*/_jsx(Provider, {
|
|
10
|
+
store: store
|
|
11
|
+
}, void 0, ui)),
|
|
12
|
+
// adding `store` to the returned utilities to allow us
|
|
13
|
+
// to reference it in our tests (just try to avoid using
|
|
14
|
+
// this to test implementation details).
|
|
15
|
+
store
|
|
16
|
+
});
|
|
@@ -5,23 +5,20 @@ import { Router } from 'react-router-dom';
|
|
|
5
5
|
import { createMemoryHistory } from 'history';
|
|
6
6
|
import { createAppStore } from "../../data/store.js";
|
|
7
7
|
import { browserHistory } from "../history.js";
|
|
8
|
-
export const renderWithRouterRedux =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
store
|
|
26
|
-
};
|
|
27
|
-
};
|
|
8
|
+
export const renderWithRouterRedux = (ui, {
|
|
9
|
+
route = '/',
|
|
10
|
+
history = createMemoryHistory({
|
|
11
|
+
initialEntries: [route]
|
|
12
|
+
}),
|
|
13
|
+
initialState,
|
|
14
|
+
store = createAppStore(initialState, browserHistory)
|
|
15
|
+
} = {}) => ({ ...render( /*#__PURE__*/_jsx(Provider, {
|
|
16
|
+
store: store
|
|
17
|
+
}, void 0, /*#__PURE__*/_jsx(Router, {
|
|
18
|
+
history: history
|
|
19
|
+
}, void 0, ui))),
|
|
20
|
+
// adding `store` to the returned utilities to allow us
|
|
21
|
+
// to reference it in our tests (just try to avoid using
|
|
22
|
+
// this to test implementation details).
|
|
23
|
+
store
|
|
24
|
+
});
|
|
@@ -2,19 +2,16 @@ import _jsx from "@babel/runtime/helpers/jsx";
|
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import { Router } from 'react-router-dom';
|
|
4
4
|
import { createMemoryHistory } from 'history';
|
|
5
|
-
export const renderWithRouter =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
history
|
|
19
|
-
};
|
|
20
|
-
};
|
|
5
|
+
export const renderWithRouter = (ui, {
|
|
6
|
+
route = '/',
|
|
7
|
+
history = createMemoryHistory({
|
|
8
|
+
initialEntries: [route]
|
|
9
|
+
})
|
|
10
|
+
} = {}) => ({ ...render( /*#__PURE__*/_jsx(Router, {
|
|
11
|
+
history: history
|
|
12
|
+
}, void 0, ui)),
|
|
13
|
+
// adding `history` to the returned utilities to allow us
|
|
14
|
+
// to reference it in our tests (just try to avoid using
|
|
15
|
+
// this to test implementation details).
|
|
16
|
+
history
|
|
17
|
+
});
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import _jsx2 from "@babel/runtime/helpers/jsx";
|
|
2
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
3
|
-
import "core-js/modules/esnext.async-iterator.for-each.js";
|
|
4
|
-
import "core-js/modules/esnext.iterator.constructor.js";
|
|
5
|
-
import "core-js/modules/esnext.iterator.for-each.js";
|
|
6
2
|
|
|
7
3
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
8
4
|
import { useEffect, useState } from 'react';
|
|
@@ -10,14 +6,13 @@ import { ThemeProvider } from 'styled-components';
|
|
|
10
6
|
import { getDefaultTheme } from '@elliemae/pui-theme';
|
|
11
7
|
import { useInjectReducer, useInjectSaga } from 'redux-injectors';
|
|
12
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
export const RenderWithStateAddOns =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} = _ref;
|
|
9
|
+
export const RenderWithStateAddOns = ({
|
|
10
|
+
Component,
|
|
11
|
+
reducer,
|
|
12
|
+
saga,
|
|
13
|
+
theme = getDefaultTheme(),
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
21
16
|
const [ready, setReady] = useState(false);
|
|
22
17
|
|
|
23
18
|
if (Array.isArray(reducer)) {
|
package/dist/es/utils/url.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
-
import "core-js/modules/web.url.js";
|
|
3
|
-
import "core-js/modules/web.url-search-params.js";
|
|
4
|
-
import "core-js/modules/es.string.replace.js";
|
|
5
1
|
export const getRedirectUrl = () => {
|
|
6
2
|
const url = new URL(window.location.href);
|
|
7
3
|
url.search = '';
|