@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
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import { sendBAEvent } from "./index.js";
|
|
2
|
-
export const pageViewEvent =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} = _ref;
|
|
2
|
+
export const pageViewEvent = ({
|
|
3
|
+
pageTitle
|
|
4
|
+
}) => {
|
|
6
5
|
const {
|
|
7
6
|
pathname,
|
|
8
7
|
href
|
|
9
8
|
} = (window.top || window.self).location;
|
|
10
9
|
const {
|
|
11
10
|
title
|
|
12
|
-
} = (window.top || window.self).document;
|
|
13
|
-
|
|
11
|
+
} = (window.top || window.self).document;
|
|
14
12
|
const {
|
|
15
|
-
pathname:
|
|
16
|
-
href:
|
|
17
|
-
} = window.location;
|
|
18
|
-
|
|
13
|
+
pathname: guestPagePath,
|
|
14
|
+
href: guestPageUrl
|
|
15
|
+
} = window.location;
|
|
19
16
|
const {
|
|
20
|
-
title:
|
|
17
|
+
title: guestPageTitle
|
|
21
18
|
} = document;
|
|
22
19
|
sendBAEvent({
|
|
23
|
-
|
|
24
|
-
event: '
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
data: {
|
|
21
|
+
event: 'pageView',
|
|
22
|
+
pageUrl: href,
|
|
23
|
+
pagePath: pathname,
|
|
24
|
+
pageTitle: title,
|
|
25
|
+
guestPageUrl,
|
|
26
|
+
guestPagePath,
|
|
27
|
+
guestPageTitle: pageTitle || guestPageTitle
|
|
31
28
|
}
|
|
32
29
|
});
|
|
33
30
|
};
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { sendBAEvent } from "./index.js";
|
|
2
|
-
import { updateBAEventParameters } from "./
|
|
3
|
-
export const loginEvent =
|
|
4
|
-
|
|
2
|
+
import { updateBAEventParameters } from "./web-analytics.js";
|
|
3
|
+
export const loginEvent = ({
|
|
4
|
+
instanceId,
|
|
5
|
+
userId
|
|
6
|
+
}) => {
|
|
7
|
+
updateBAEventParameters({
|
|
5
8
|
instanceId,
|
|
6
9
|
userId
|
|
7
|
-
} = _ref;
|
|
8
|
-
updateBAEventParameters({
|
|
9
|
-
instance_id: instanceId,
|
|
10
|
-
user_id: userId
|
|
11
10
|
});
|
|
12
11
|
sendBAEvent({
|
|
13
|
-
|
|
14
|
-
event: '
|
|
12
|
+
data: {
|
|
13
|
+
event: 'login'
|
|
15
14
|
}
|
|
16
15
|
});
|
|
17
16
|
};
|
|
18
17
|
export const logoutEvent = () => {
|
|
19
18
|
sendBAEvent({
|
|
20
|
-
|
|
21
|
-
event: '
|
|
19
|
+
data: {
|
|
20
|
+
event: 'logout'
|
|
22
21
|
}
|
|
23
22
|
});
|
|
24
23
|
updateBAEventParameters({
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
instanceId: '',
|
|
25
|
+
userId: ''
|
|
27
26
|
});
|
|
28
27
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { sendBAEvent } from "./index.js";
|
|
2
2
|
export const waitStartEvent = () => sendBAEvent({
|
|
3
|
-
|
|
4
|
-
event: '
|
|
3
|
+
data: {
|
|
4
|
+
event: 'pageInteractionEnabled'
|
|
5
5
|
}
|
|
6
6
|
});
|
|
7
7
|
export const waitEndEvent = () => sendBAEvent({
|
|
8
|
-
|
|
9
|
-
event: '
|
|
8
|
+
data: {
|
|
9
|
+
event: 'pageInteractionDisabled'
|
|
10
10
|
}
|
|
11
11
|
});
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
|
-
import "core-js/modules/web.url-search-params.js";
|
|
3
1
|
import { getHTTPClient } from "../../communication/http-client/index.js";
|
|
4
|
-
export const getToken = async
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
2
|
+
export const getToken = async ({
|
|
3
|
+
clientId,
|
|
4
|
+
redirectUri,
|
|
5
|
+
idpCode
|
|
6
|
+
}) => {
|
|
10
7
|
const params = new URLSearchParams();
|
|
11
8
|
params.append('grant_type', 'authorization_code');
|
|
12
9
|
params.append('client_id', clientId);
|
|
@@ -20,21 +17,19 @@ export const getToken = async _ref => {
|
|
|
20
17
|
accessToken: data.access_token
|
|
21
18
|
};
|
|
22
19
|
};
|
|
23
|
-
export const revokeToken = async
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref2;
|
|
20
|
+
export const revokeToken = async ({
|
|
21
|
+
clientId,
|
|
22
|
+
token
|
|
23
|
+
}) => {
|
|
28
24
|
const params = new URLSearchParams();
|
|
29
25
|
params.append('token', token);
|
|
30
26
|
params.append('client_id', clientId);
|
|
31
27
|
await getHTTPClient().post('/oauth2/v1/token/revocation', params);
|
|
32
28
|
};
|
|
33
|
-
export const introspectToken = async
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref3;
|
|
29
|
+
export const introspectToken = async ({
|
|
30
|
+
clientId,
|
|
31
|
+
accessToken
|
|
32
|
+
}) => {
|
|
38
33
|
const params = new URLSearchParams();
|
|
39
34
|
params.append('token', accessToken);
|
|
40
35
|
params.append('client_id', clientId);
|
package/dist/es/api/helpers.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _get from "lodash/get";
|
|
2
|
-
import "core-js/modules/esnext.async-iterator.map.js";
|
|
3
|
-
import "core-js/modules/esnext.iterator.map.js";
|
|
4
2
|
import { createAction } from '@reduxjs/toolkit';
|
|
5
3
|
|
|
6
4
|
/**
|
|
@@ -34,9 +32,9 @@ import { createAction } from '@reduxjs/toolkit';
|
|
|
34
32
|
* @returns {Function} Redux Action Creators util function
|
|
35
33
|
*/
|
|
36
34
|
export const getApiActionCreator = api => operation => ({
|
|
37
|
-
[operation]: createAction(
|
|
38
|
-
[
|
|
39
|
-
[
|
|
35
|
+
[operation]: createAction(`${api}/${operation}`),
|
|
36
|
+
[`${operation}Success`]: createAction(`${api}/${operation}Success`),
|
|
37
|
+
[`${operation}Error`]: createAction(`${api}/${operation}Error`)
|
|
40
38
|
});
|
|
41
39
|
/**
|
|
42
40
|
* Why use this? It will prevent unnecessary rerenders hence improving performance, it also reduces the amount of code needed to select data from the store
|
|
@@ -83,13 +81,5 @@ export const getApiActionCreator = api => operation => ({
|
|
|
83
81
|
|
|
84
82
|
/* eslint-disable prettier/prettier */
|
|
85
83
|
|
|
86
|
-
export const getSelectField = stateName =>
|
|
87
|
-
let fieldName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
88
|
-
let defaultValue = arguments.length > 1 ? arguments[1] : undefined;
|
|
89
|
-
return function () {
|
|
90
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
91
|
-
let stateValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _get(state, stateName);
|
|
92
|
-
return Array.isArray(fieldName) ? fieldName.map((field, i) => _get(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : _get(stateValue, fieldName, defaultValue);
|
|
93
|
-
};
|
|
94
|
-
};
|
|
84
|
+
export const getSelectField = stateName => (fieldName = '', defaultValue) => (state = {}, stateValue = _get(state, stateName)) => Array.isArray(fieldName) ? fieldName.map((field, i) => _get(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : _get(stateValue, fieldName, defaultValue);
|
|
95
85
|
/* eslint-enable prettier/prettier */
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { getAuthHTTPClient } from "../../communication/http-client/index.js";
|
|
2
|
-
export const getUser = async
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} = _ref;
|
|
2
|
+
export const getUser = async ({
|
|
3
|
+
userName
|
|
4
|
+
}) => {
|
|
6
5
|
const {
|
|
7
6
|
data
|
|
8
|
-
} = await getAuthHTTPClient().get(
|
|
7
|
+
} = await getAuthHTTPClient().get(`/encompass/v1/users/${userName}`);
|
|
9
8
|
return data;
|
|
10
9
|
};
|
|
@@ -6,13 +6,12 @@ import { requestInterceptor } from "./request-interceptor.js";
|
|
|
6
6
|
import { handleSuccess, handleFailure } from "./response-interceptor.js";
|
|
7
7
|
const REQUEST_TIMEOUT = 2 * 60 * 1000; // 2 mins
|
|
8
8
|
|
|
9
|
-
export const getHTTPClient =
|
|
9
|
+
export const getHTTPClient = ({
|
|
10
|
+
baseURL = getAppConfigValue('serviceEndpoints.api', ''),
|
|
11
|
+
headers = {}
|
|
12
|
+
} = {}) => {
|
|
10
13
|
var _client$defaults;
|
|
11
14
|
|
|
12
|
-
let {
|
|
13
|
-
baseURL = getAppConfigValue('serviceEndpoints.api', ''),
|
|
14
|
-
headers = {}
|
|
15
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
16
15
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
17
16
|
const client = axios.create({
|
|
18
17
|
baseURL,
|
|
@@ -28,18 +27,15 @@ export const getHTTPClient = function () {
|
|
|
28
27
|
if (response) response.use(handleSuccess, handleFailure);
|
|
29
28
|
return client;
|
|
30
29
|
};
|
|
31
|
-
export const getAuthHTTPClient =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
...rest
|
|
44
|
-
});
|
|
45
|
-
};
|
|
30
|
+
export const getAuthHTTPClient = ({
|
|
31
|
+
baseURL,
|
|
32
|
+
headers = {},
|
|
33
|
+
...rest
|
|
34
|
+
} = {}) => getHTTPClient({
|
|
35
|
+
baseURL,
|
|
36
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
37
|
+
headers: { ...headers,
|
|
38
|
+
Authorization: getAuthorizationHeader()
|
|
39
|
+
},
|
|
40
|
+
...rest
|
|
41
|
+
});
|
|
@@ -3,12 +3,11 @@ import enums from "../../../utils/constants.js";
|
|
|
3
3
|
import { getAuthHTTPClient } from "../index.js";
|
|
4
4
|
import { onAuthorizationFailure } from "../response-interceptor.js";
|
|
5
5
|
describe('http client test cases', () => {
|
|
6
|
-
const callApi =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} = _ref;
|
|
6
|
+
const callApi = ({
|
|
7
|
+
apiUrl,
|
|
8
|
+
options = {},
|
|
9
|
+
baseURL = 'http://localhost:3001'
|
|
10
|
+
}) => {
|
|
12
11
|
const httpClient = getAuthHTTPClient({
|
|
13
12
|
baseURL
|
|
14
13
|
});
|
|
@@ -2,42 +2,36 @@ export const LOGIN = 'auth/LOGIN';
|
|
|
2
2
|
export const LOGIN_SUCCESS = 'auth/LOGIN_SUCCESS';
|
|
3
3
|
export const LOGOUT = 'auth/LOGOUT';
|
|
4
4
|
export const auth = {
|
|
5
|
-
login:
|
|
6
|
-
|
|
5
|
+
login: ({
|
|
6
|
+
idpCode,
|
|
7
|
+
redirectUri,
|
|
8
|
+
clientId,
|
|
9
|
+
responseType,
|
|
10
|
+
scope
|
|
11
|
+
}) => ({
|
|
12
|
+
type: LOGIN,
|
|
13
|
+
payload: {
|
|
7
14
|
idpCode,
|
|
8
15
|
redirectUri,
|
|
9
16
|
clientId,
|
|
10
17
|
responseType,
|
|
11
18
|
scope
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
logout: _ref2 => {
|
|
25
|
-
let {
|
|
19
|
+
}
|
|
20
|
+
}),
|
|
21
|
+
logout: ({
|
|
22
|
+
clientId,
|
|
23
|
+
redirectUri,
|
|
24
|
+
responseType,
|
|
25
|
+
scope,
|
|
26
|
+
code
|
|
27
|
+
}) => ({
|
|
28
|
+
type: LOGOUT,
|
|
29
|
+
payload: {
|
|
26
30
|
clientId,
|
|
27
31
|
redirectUri,
|
|
28
32
|
responseType,
|
|
29
33
|
scope,
|
|
30
34
|
code
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type: LOGOUT,
|
|
34
|
-
payload: {
|
|
35
|
-
clientId,
|
|
36
|
-
redirectUri,
|
|
37
|
-
responseType,
|
|
38
|
-
scope,
|
|
39
|
-
code
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
43
37
|
};
|
|
@@ -14,9 +14,7 @@ export let Breakpoints;
|
|
|
14
14
|
const initialState = {
|
|
15
15
|
value: Breakpoints.LARGE
|
|
16
16
|
};
|
|
17
|
-
export const breakpointReducer =
|
|
18
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
19
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
17
|
+
export const breakpointReducer = (state = initialState, action) => {
|
|
20
18
|
const {
|
|
21
19
|
type,
|
|
22
20
|
payload
|
|
@@ -8,20 +8,17 @@ const liveMessage = createSlice({
|
|
|
8
8
|
name: 'liveMessage',
|
|
9
9
|
initialState,
|
|
10
10
|
reducers: {
|
|
11
|
-
announce: (state,
|
|
12
|
-
|
|
13
|
-
payload: {
|
|
14
|
-
message,
|
|
15
|
-
ariaLive,
|
|
16
|
-
id
|
|
17
|
-
}
|
|
18
|
-
} = _ref;
|
|
19
|
-
return {
|
|
11
|
+
announce: (state, {
|
|
12
|
+
payload: {
|
|
20
13
|
message,
|
|
21
14
|
ariaLive,
|
|
22
15
|
id
|
|
23
|
-
}
|
|
24
|
-
}
|
|
16
|
+
}
|
|
17
|
+
}) => ({
|
|
18
|
+
message,
|
|
19
|
+
ariaLive,
|
|
20
|
+
id
|
|
21
|
+
})
|
|
25
22
|
}
|
|
26
23
|
});
|
|
27
24
|
export const {
|
package/dist/es/data/reducers.js
CHANGED
|
@@ -3,8 +3,7 @@ import { waitMessageReducer } from "./wait-message/reducer.js";
|
|
|
3
3
|
import { errorReducer } from "./error/index.js";
|
|
4
4
|
import { breakpointReducer } from "./breakpoint/index.js";
|
|
5
5
|
import { liveMessageReducer } from "./live-message/index.js";
|
|
6
|
-
export const createReducer =
|
|
7
|
-
let injectedReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
export const createReducer = (injectedReducers = {}) => {
|
|
8
7
|
const rootReducer = combineReducers({
|
|
9
8
|
waitMessage: waitMessageReducer,
|
|
10
9
|
error: errorReducer,
|
package/dist/es/data/store.js
CHANGED
|
@@ -14,10 +14,9 @@ export const setStore = store => {
|
|
|
14
14
|
export const getStore = () => appStore;
|
|
15
15
|
|
|
16
16
|
// ToDo: middlewareConfig is a temporary parameter and will be removed in the future
|
|
17
|
-
const createStore =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
17
|
+
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
18
|
+
thunk: false
|
|
19
|
+
}) => {
|
|
21
20
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
22
21
|
const {
|
|
23
22
|
run: runSaga
|
|
@@ -61,10 +60,7 @@ const createStore = function (initialState, sagaMiddleware, history) {
|
|
|
61
60
|
return baseStore;
|
|
62
61
|
};
|
|
63
62
|
|
|
64
|
-
export const createAppStore =
|
|
65
|
-
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
66
|
-
let history = arguments.length > 1 ? arguments[1] : undefined;
|
|
67
|
-
let middlewareConfig = arguments.length > 2 ? arguments[2] : undefined;
|
|
63
|
+
export const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
68
64
|
const sagaMiddleware = createSagaMiddleware({});
|
|
69
65
|
const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
|
|
70
66
|
setStore(store);
|
|
@@ -3,15 +3,12 @@ export const ACTIONS = {
|
|
|
3
3
|
CLOSE: 'wait-message/CLOSE'
|
|
4
4
|
};
|
|
5
5
|
export const waitMessage = {
|
|
6
|
-
open:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
},
|
|
6
|
+
open: (message = 'loading...') => ({
|
|
7
|
+
type: ACTIONS.OPEN,
|
|
8
|
+
payload: {
|
|
9
|
+
message
|
|
10
|
+
}
|
|
11
|
+
}),
|
|
15
12
|
close: () => ({
|
|
16
13
|
type: ACTIONS.CLOSE,
|
|
17
14
|
payload: null
|
|
@@ -6,20 +6,16 @@ export const initialState = {
|
|
|
6
6
|
isOpen: null,
|
|
7
7
|
message: 'loading...'
|
|
8
8
|
};
|
|
9
|
-
export const waitMessageReducer =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
draft.isOpen = true;
|
|
17
|
-
draft.message = action.payload.message;
|
|
18
|
-
break;
|
|
9
|
+
export const waitMessageReducer = (state = initialState, action) => produce(state, draft => {
|
|
10
|
+
// eslint-disable-next-line default-case
|
|
11
|
+
switch (action.type) {
|
|
12
|
+
case ACTIONS.OPEN:
|
|
13
|
+
draft.isOpen = true;
|
|
14
|
+
draft.message = action.payload.message;
|
|
15
|
+
break;
|
|
19
16
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
17
|
+
case ACTIONS.CLOSE:
|
|
18
|
+
draft.isOpen = false;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
});
|
package/dist/es/index.js
CHANGED
|
@@ -76,5 +76,8 @@ export { getNavigationLinks } from "./view/micro-app/utils.js"; // app host
|
|
|
76
76
|
export { getStore } from "./data/store.js";
|
|
77
77
|
export { RegisterService } from "./utils/guest-with-service.js"; // analytics
|
|
78
78
|
|
|
79
|
+
export { setAppDynamicsUserData } from "./analytics/appdynamics.js";
|
|
79
80
|
export { sendBAEvent } from "./analytics/index.js";
|
|
80
|
-
export { updateBAEventParameters } from "./analytics/
|
|
81
|
+
export { updateBAEventParameters } from "./analytics/web-analytics.js"; // security utils
|
|
82
|
+
|
|
83
|
+
export { redactPii } from "./utils/redact-pii.js"; // Type utils
|
package/dist/es/route/index.js
CHANGED
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Route } from 'react-router-dom';
|
|
1
|
+
import _jsx2 from "@babel/runtime/helpers/jsx";
|
|
3
2
|
import { Helmet } from 'react-helmet';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { Route } from 'react-router-dom';
|
|
5
|
+
import { onPageView } from "./page-view.js";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
7
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
export const AppRoute =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
export const AppRoute = ({
|
|
10
|
+
component: Component,
|
|
11
|
+
render,
|
|
12
|
+
children,
|
|
13
|
+
pageTitle = 'ICE',
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
16
|
+
var _Helmet;
|
|
17
|
+
|
|
18
|
+
const memoizedRender = useCallback(routeProps => render && typeof render === 'function' ? render(routeProps) : Component && /*#__PURE__*/_jsx(Component, { ...routeProps
|
|
19
|
+
}), [Component, render]);
|
|
20
|
+
return /*#__PURE__*/_jsx(Route, { ...rest,
|
|
21
|
+
render: routeProps => {
|
|
22
|
+
onPageView(pageTitle);
|
|
23
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
24
|
+
children: [_Helmet || (_Helmet = /*#__PURE__*/_jsx2(Helmet, {}, void 0, /*#__PURE__*/_jsx2("title", {}, void 0, pageTitle))), children || memoizedRender(routeProps)]
|
|
25
|
+
});
|
|
26
|
+
}
|
|
17
27
|
});
|
|
18
28
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as brum from '@elliemae/pui-user-monitoring';
|
|
2
|
+
import { pageViewEvent } from "../analytics/page-view-event.js";
|
|
3
|
+
export const onPageView = pageTitle => {
|
|
4
|
+
try {
|
|
5
|
+
if (brum && pageTitle) {
|
|
6
|
+
brum.setCustomVirtualPageName(pageTitle);
|
|
7
|
+
brum.startVirtualPageMonitoringWithAutoEnd(pageTitle);
|
|
8
|
+
}
|
|
9
|
+
} catch {// eslint-disable-next-line no-empty
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
pageViewEvent({
|
|
13
|
+
pageTitle
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -10,18 +10,17 @@ import { isUserAuthorized } from "../../utils/auth/index.js";
|
|
|
10
10
|
import { AppRoute } from "../index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const key = 'auth';
|
|
13
|
-
export const PrivateRoute =
|
|
13
|
+
export const PrivateRoute = ({
|
|
14
|
+
component: Component,
|
|
15
|
+
render,
|
|
16
|
+
children,
|
|
17
|
+
clientId = enums.CLIENT_ID,
|
|
18
|
+
scope = 'loc',
|
|
19
|
+
responseType = 'code',
|
|
20
|
+
...rest
|
|
21
|
+
}) => {
|
|
14
22
|
var _Login;
|
|
15
23
|
|
|
16
|
-
let {
|
|
17
|
-
component: Component,
|
|
18
|
-
render,
|
|
19
|
-
children,
|
|
20
|
-
clientId = enums.CLIENT_ID,
|
|
21
|
-
scope = 'loc',
|
|
22
|
-
responseType = 'code',
|
|
23
|
-
...rest
|
|
24
|
-
} = _ref;
|
|
25
24
|
useInjectReducer({
|
|
26
25
|
key,
|
|
27
26
|
reducer: authReducer
|
|
@@ -3,11 +3,9 @@ import { LOGIN, LOGOUT, LOGIN_SUCCESS } from "../../data/auth/actions.js";
|
|
|
3
3
|
import { authorize, endSession } from "../../utils/auth/index.js";
|
|
4
4
|
import { getLogger } from "../../utils/micro-frontend/index.js";
|
|
5
5
|
import { logRecords } from "../../utils/log-records.js";
|
|
6
|
-
export function* login(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} = _ref;
|
|
10
|
-
|
|
6
|
+
export function* login({
|
|
7
|
+
payload
|
|
8
|
+
}) {
|
|
11
9
|
try {
|
|
12
10
|
yield call(authorize, payload);
|
|
13
11
|
yield put({
|
|
@@ -19,11 +17,9 @@ export function* login(_ref) {
|
|
|
19
17
|
});
|
|
20
18
|
}
|
|
21
19
|
}
|
|
22
|
-
export function* logout(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = _ref2;
|
|
26
|
-
|
|
20
|
+
export function* logout({
|
|
21
|
+
payload
|
|
22
|
+
}) {
|
|
27
23
|
try {
|
|
28
24
|
yield call(endSession, payload);
|
|
29
25
|
} catch (err) {
|
|
@@ -7,17 +7,6 @@ let gAppConfig = APP_CONFIG;
|
|
|
7
7
|
export const setAppConfig = config => {
|
|
8
8
|
gAppConfig = config;
|
|
9
9
|
};
|
|
10
|
-
export const getAppConfigValue =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return _clone(_get(gAppConfig, key, defaultValue));
|
|
14
|
-
};
|
|
15
|
-
export const setAppConfigValue = function () {
|
|
16
|
-
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
17
|
-
let value = arguments.length > 1 ? arguments[1] : undefined;
|
|
18
|
-
return _set(gAppConfig, key, value);
|
|
19
|
-
};
|
|
20
|
-
export const hasItem = function () {
|
|
21
|
-
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
22
|
-
return _has(gAppConfig, key);
|
|
23
|
-
};
|
|
10
|
+
export const getAppConfigValue = (key = '', defaultValue = null) => _clone(_get(gAppConfig, key, defaultValue));
|
|
11
|
+
export const setAppConfigValue = (key = '', value) => _set(gAppConfig, key, value);
|
|
12
|
+
export const hasItem = (key = '') => _has(gAppConfig, key);
|