@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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.setAppDynamicsUserData = exports.getAppDynamicsUserData = void 0;
|
|
7
|
+
|
|
8
|
+
var brum = _interopRequireWildcard(require("@elliemae/pui-user-monitoring"));
|
|
9
|
+
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
|
|
14
|
+
let userData = {
|
|
15
|
+
subAppId: '',
|
|
16
|
+
instanceId: '',
|
|
17
|
+
userId: ''
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const getAppDynamicsUserData = () => userData;
|
|
21
|
+
|
|
22
|
+
exports.getAppDynamicsUserData = getAppDynamicsUserData;
|
|
23
|
+
|
|
24
|
+
const setAppDynamicsUserData = params => {
|
|
25
|
+
userData = { ...userData,
|
|
26
|
+
...params
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
if (brum) {
|
|
30
|
+
brum.setCustomUserData(() => ({
|
|
31
|
+
userData
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.setAppDynamicsUserData = setAppDynamicsUserData;
|
|
@@ -7,20 +7,22 @@ exports.sendBAEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _guest = require("../utils/micro-frontend/guest.js");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _webAnalytics = require("./web-analytics.js");
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var _redactPii = require("../utils/redact-pii.js");
|
|
13
|
+
|
|
14
|
+
const sendBAEventToSelf = data => {
|
|
15
|
+
const redactedData = (0, _redactPii.redactPii)(data);
|
|
13
16
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
14
|
-
window.gtmDataLayer.push(
|
|
17
|
+
window.gtmDataLayer.push(redactedData);
|
|
15
18
|
};
|
|
16
19
|
|
|
17
|
-
const sendBAEvent =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
...event
|
|
20
|
+
const sendBAEvent = ({
|
|
21
|
+
data,
|
|
22
|
+
self = true
|
|
23
|
+
}) => {
|
|
24
|
+
const eventData = { ...(0, _webAnalytics.getBAEventParameters)(),
|
|
25
|
+
...data
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
if (!self) {
|
|
@@ -30,12 +32,12 @@ const sendBAEvent = _ref => {
|
|
|
30
32
|
const sendEvent = (_CMicroAppGuest$getIn = _guest.CMicroAppGuest.getInstance()) === null || _CMicroAppGuest$getIn === void 0 ? void 0 : (_CMicroAppGuest$getIn2 = _CMicroAppGuest$getIn.getHost()) === null || _CMicroAppGuest$getIn2 === void 0 ? void 0 : _CMicroAppGuest$getIn2.sendBAEvent;
|
|
31
33
|
|
|
32
34
|
if (sendEvent) {
|
|
33
|
-
sendEvent(
|
|
35
|
+
sendEvent(eventData);
|
|
34
36
|
} else {
|
|
35
|
-
sendBAEventToSelf(
|
|
37
|
+
sendBAEventToSelf(eventData);
|
|
36
38
|
}
|
|
37
39
|
} else {
|
|
38
|
-
sendBAEventToSelf(
|
|
40
|
+
sendBAEventToSelf(eventData);
|
|
39
41
|
}
|
|
40
42
|
};
|
|
41
43
|
|
|
@@ -7,35 +7,32 @@ exports.pageViewEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _index = require("./index.js");
|
|
9
9
|
|
|
10
|
-
const pageViewEvent =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
10
|
+
const pageViewEvent = ({
|
|
11
|
+
pageTitle
|
|
12
|
+
}) => {
|
|
14
13
|
const {
|
|
15
14
|
pathname,
|
|
16
15
|
href
|
|
17
16
|
} = (window.top || window.self).location;
|
|
18
17
|
const {
|
|
19
18
|
title
|
|
20
|
-
} = (window.top || window.self).document;
|
|
21
|
-
|
|
19
|
+
} = (window.top || window.self).document;
|
|
22
20
|
const {
|
|
23
|
-
pathname:
|
|
24
|
-
href:
|
|
25
|
-
} = window.location;
|
|
26
|
-
|
|
21
|
+
pathname: guestPagePath,
|
|
22
|
+
href: guestPageUrl
|
|
23
|
+
} = window.location;
|
|
27
24
|
const {
|
|
28
|
-
title:
|
|
25
|
+
title: guestPageTitle
|
|
29
26
|
} = document;
|
|
30
27
|
(0, _index.sendBAEvent)({
|
|
31
|
-
|
|
32
|
-
event: '
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
data: {
|
|
29
|
+
event: 'pageView',
|
|
30
|
+
pageUrl: href,
|
|
31
|
+
pagePath: pathname,
|
|
32
|
+
pageTitle: title,
|
|
33
|
+
guestPageUrl,
|
|
34
|
+
guestPagePath,
|
|
35
|
+
guestPageTitle: pageTitle || guestPageTitle
|
|
39
36
|
}
|
|
40
37
|
});
|
|
41
38
|
};
|
|
@@ -7,20 +7,19 @@ exports.logoutEvent = exports.loginEvent = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _index = require("./index.js");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _webAnalytics = require("./web-analytics.js");
|
|
11
11
|
|
|
12
|
-
const loginEvent =
|
|
13
|
-
|
|
12
|
+
const loginEvent = ({
|
|
13
|
+
instanceId,
|
|
14
|
+
userId
|
|
15
|
+
}) => {
|
|
16
|
+
(0, _webAnalytics.updateBAEventParameters)({
|
|
14
17
|
instanceId,
|
|
15
18
|
userId
|
|
16
|
-
} = _ref;
|
|
17
|
-
(0, _baEventParameters.updateBAEventParameters)({
|
|
18
|
-
instance_id: instanceId,
|
|
19
|
-
user_id: userId
|
|
20
19
|
});
|
|
21
20
|
(0, _index.sendBAEvent)({
|
|
22
|
-
|
|
23
|
-
event: '
|
|
21
|
+
data: {
|
|
22
|
+
event: 'login'
|
|
24
23
|
}
|
|
25
24
|
});
|
|
26
25
|
};
|
|
@@ -29,13 +28,13 @@ exports.loginEvent = loginEvent;
|
|
|
29
28
|
|
|
30
29
|
const logoutEvent = () => {
|
|
31
30
|
(0, _index.sendBAEvent)({
|
|
32
|
-
|
|
33
|
-
event: '
|
|
31
|
+
data: {
|
|
32
|
+
event: 'logout'
|
|
34
33
|
}
|
|
35
34
|
});
|
|
36
|
-
(0,
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
(0, _webAnalytics.updateBAEventParameters)({
|
|
36
|
+
instanceId: '',
|
|
37
|
+
userId: ''
|
|
39
38
|
});
|
|
40
39
|
};
|
|
41
40
|
|
|
@@ -8,16 +8,16 @@ exports.waitStartEvent = exports.waitEndEvent = void 0;
|
|
|
8
8
|
var _index = require("./index.js");
|
|
9
9
|
|
|
10
10
|
const waitStartEvent = () => (0, _index.sendBAEvent)({
|
|
11
|
-
|
|
12
|
-
event: '
|
|
11
|
+
data: {
|
|
12
|
+
event: 'pageInteractionEnabled'
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
exports.waitStartEvent = waitStartEvent;
|
|
17
17
|
|
|
18
18
|
const waitEndEvent = () => (0, _index.sendBAEvent)({
|
|
19
|
-
|
|
20
|
-
event: '
|
|
19
|
+
data: {
|
|
20
|
+
event: 'pageInteractionDisabled'
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.updateBAEventParameters = exports.getBAEventParameters = void 0;
|
|
7
7
|
let baEventParameters = {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
instanceId: '',
|
|
9
|
+
userId: ''
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
const getBAEventParameters = () => baEventParameters;
|
|
@@ -5,18 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.revokeToken = exports.introspectToken = exports.getToken = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
9
|
-
|
|
10
|
-
require("core-js/modules/web.url-search-params.js");
|
|
11
|
-
|
|
12
8
|
var _index = require("../../communication/http-client/index.js");
|
|
13
9
|
|
|
14
|
-
const getToken = async
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = _ref;
|
|
10
|
+
const getToken = async ({
|
|
11
|
+
clientId,
|
|
12
|
+
redirectUri,
|
|
13
|
+
idpCode
|
|
14
|
+
}) => {
|
|
20
15
|
const params = new URLSearchParams();
|
|
21
16
|
params.append('grant_type', 'authorization_code');
|
|
22
17
|
params.append('client_id', clientId);
|
|
@@ -33,11 +28,10 @@ const getToken = async _ref => {
|
|
|
33
28
|
|
|
34
29
|
exports.getToken = getToken;
|
|
35
30
|
|
|
36
|
-
const revokeToken = async
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = _ref2;
|
|
31
|
+
const revokeToken = async ({
|
|
32
|
+
clientId,
|
|
33
|
+
token
|
|
34
|
+
}) => {
|
|
41
35
|
const params = new URLSearchParams();
|
|
42
36
|
params.append('token', token);
|
|
43
37
|
params.append('client_id', clientId);
|
|
@@ -46,11 +40,10 @@ const revokeToken = async _ref2 => {
|
|
|
46
40
|
|
|
47
41
|
exports.revokeToken = revokeToken;
|
|
48
42
|
|
|
49
|
-
const introspectToken = async
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
} = _ref3;
|
|
43
|
+
const introspectToken = async ({
|
|
44
|
+
clientId,
|
|
45
|
+
accessToken
|
|
46
|
+
}) => {
|
|
54
47
|
const params = new URLSearchParams();
|
|
55
48
|
params.append('token', accessToken);
|
|
56
49
|
params.append('client_id', clientId);
|
package/dist/cjs/api/helpers.js
CHANGED
|
@@ -7,10 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.getSelectField = exports.getApiActionCreator = void 0;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/esnext.async-iterator.map.js");
|
|
11
|
-
|
|
12
|
-
require("core-js/modules/esnext.iterator.map.js");
|
|
13
|
-
|
|
14
10
|
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
15
11
|
|
|
16
12
|
var _toolkit = require("@reduxjs/toolkit");
|
|
@@ -46,9 +42,9 @@ var _toolkit = require("@reduxjs/toolkit");
|
|
|
46
42
|
* @returns {Function} Redux Action Creators util function
|
|
47
43
|
*/
|
|
48
44
|
const getApiActionCreator = api => operation => ({
|
|
49
|
-
[operation]: (0, _toolkit.createAction)(
|
|
50
|
-
[
|
|
51
|
-
[
|
|
45
|
+
[operation]: (0, _toolkit.createAction)(`${api}/${operation}`),
|
|
46
|
+
[`${operation}Success`]: (0, _toolkit.createAction)(`${api}/${operation}Success`),
|
|
47
|
+
[`${operation}Error`]: (0, _toolkit.createAction)(`${api}/${operation}Error`)
|
|
52
48
|
});
|
|
53
49
|
/**
|
|
54
50
|
* 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
|
|
@@ -98,15 +94,7 @@ const getApiActionCreator = api => operation => ({
|
|
|
98
94
|
|
|
99
95
|
exports.getApiActionCreator = getApiActionCreator;
|
|
100
96
|
|
|
101
|
-
const getSelectField = stateName =>
|
|
102
|
-
let fieldName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
103
|
-
let defaultValue = arguments.length > 1 ? arguments[1] : undefined;
|
|
104
|
-
return function () {
|
|
105
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
106
|
-
let stateValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _get2.default)(state, stateName);
|
|
107
|
-
return Array.isArray(fieldName) ? fieldName.map((field, i) => (0, _get2.default)(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : (0, _get2.default)(stateValue, fieldName, defaultValue);
|
|
108
|
-
};
|
|
109
|
-
};
|
|
97
|
+
const getSelectField = stateName => (fieldName = '', defaultValue) => (state = {}, stateValue = (0, _get2.default)(state, stateName)) => Array.isArray(fieldName) ? fieldName.map((field, i) => (0, _get2.default)(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : (0, _get2.default)(stateValue, fieldName, defaultValue);
|
|
110
98
|
/* eslint-enable prettier/prettier */
|
|
111
99
|
|
|
112
100
|
|
|
@@ -7,13 +7,12 @@ exports.getUser = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _index = require("../../communication/http-client/index.js");
|
|
9
9
|
|
|
10
|
-
const getUser = async
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} = _ref;
|
|
10
|
+
const getUser = async ({
|
|
11
|
+
userName
|
|
12
|
+
}) => {
|
|
14
13
|
const {
|
|
15
14
|
data
|
|
16
|
-
} = await (0, _index.getAuthHTTPClient)().get(
|
|
15
|
+
} = await (0, _index.getAuthHTTPClient)().get(`/encompass/v1/users/${userName}`);
|
|
17
16
|
return data;
|
|
18
17
|
};
|
|
19
18
|
|
|
@@ -21,14 +21,12 @@ var _responseInterceptor = require("./response-interceptor.js");
|
|
|
21
21
|
|
|
22
22
|
const REQUEST_TIMEOUT = 2 * 60 * 1000; // 2 mins
|
|
23
23
|
|
|
24
|
-
const getHTTPClient =
|
|
24
|
+
const getHTTPClient = ({
|
|
25
|
+
baseURL = (0, _config.getAppConfigValue)('serviceEndpoints.api', ''),
|
|
26
|
+
headers = {}
|
|
27
|
+
} = {}) => {
|
|
25
28
|
var _client$defaults;
|
|
26
29
|
|
|
27
|
-
let {
|
|
28
|
-
baseURL = (0, _config.getAppConfigValue)('serviceEndpoints.api', ''),
|
|
29
|
-
headers = {}
|
|
30
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
31
|
-
|
|
32
30
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
33
31
|
const client = _axios.default.create({
|
|
34
32
|
baseURL,
|
|
@@ -48,20 +46,17 @@ const getHTTPClient = function () {
|
|
|
48
46
|
|
|
49
47
|
exports.getHTTPClient = getHTTPClient;
|
|
50
48
|
|
|
51
|
-
const getAuthHTTPClient =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
...rest
|
|
64
|
-
});
|
|
65
|
-
};
|
|
49
|
+
const getAuthHTTPClient = ({
|
|
50
|
+
baseURL,
|
|
51
|
+
headers = {},
|
|
52
|
+
...rest
|
|
53
|
+
} = {}) => getHTTPClient({
|
|
54
|
+
baseURL,
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
56
|
+
headers: { ...headers,
|
|
57
|
+
Authorization: (0, _helper.getAuthorizationHeader)()
|
|
58
|
+
},
|
|
59
|
+
...rest
|
|
60
|
+
});
|
|
66
61
|
|
|
67
62
|
exports.getAuthHTTPClient = getAuthHTTPClient;
|
|
@@ -7,8 +7,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.getConfig = exports.detach = exports.attach = void 0;
|
|
9
9
|
|
|
10
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
11
|
-
|
|
12
10
|
var _axios = _interopRequireDefault(require("axios"));
|
|
13
11
|
|
|
14
12
|
/* eslint-disable no-param-reassign,jsdoc/require-returns,jsdoc/require-param-type,jsdoc/require-returns-type,max-lines,@typescript-eslint/no-non-null-assertion */
|
|
@@ -10,12 +10,11 @@ var _responseInterceptor = require("../response-interceptor.js");
|
|
|
10
10
|
|
|
11
11
|
/* Important. these test cases work only with server backend. so do not enable these test cases. */
|
|
12
12
|
describe('http client test cases', () => {
|
|
13
|
-
const callApi =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} = _ref;
|
|
13
|
+
const callApi = ({
|
|
14
|
+
apiUrl,
|
|
15
|
+
options = {},
|
|
16
|
+
baseURL = 'http://localhost:3001'
|
|
17
|
+
}) => {
|
|
19
18
|
const httpClient = (0, _index.getAuthHTTPClient)({
|
|
20
19
|
baseURL
|
|
21
20
|
});
|
|
@@ -11,43 +11,37 @@ exports.LOGIN_SUCCESS = LOGIN_SUCCESS;
|
|
|
11
11
|
const LOGOUT = 'auth/LOGOUT';
|
|
12
12
|
exports.LOGOUT = LOGOUT;
|
|
13
13
|
const auth = {
|
|
14
|
-
login:
|
|
15
|
-
|
|
14
|
+
login: ({
|
|
15
|
+
idpCode,
|
|
16
|
+
redirectUri,
|
|
17
|
+
clientId,
|
|
18
|
+
responseType,
|
|
19
|
+
scope
|
|
20
|
+
}) => ({
|
|
21
|
+
type: LOGIN,
|
|
22
|
+
payload: {
|
|
16
23
|
idpCode,
|
|
17
24
|
redirectUri,
|
|
18
25
|
clientId,
|
|
19
26
|
responseType,
|
|
20
27
|
scope
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
logout: _ref2 => {
|
|
34
|
-
let {
|
|
28
|
+
}
|
|
29
|
+
}),
|
|
30
|
+
logout: ({
|
|
31
|
+
clientId,
|
|
32
|
+
redirectUri,
|
|
33
|
+
responseType,
|
|
34
|
+
scope,
|
|
35
|
+
code
|
|
36
|
+
}) => ({
|
|
37
|
+
type: LOGOUT,
|
|
38
|
+
payload: {
|
|
35
39
|
clientId,
|
|
36
40
|
redirectUri,
|
|
37
41
|
responseType,
|
|
38
42
|
scope,
|
|
39
43
|
code
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
type: LOGOUT,
|
|
43
|
-
payload: {
|
|
44
|
-
clientId,
|
|
45
|
-
redirectUri,
|
|
46
|
-
responseType,
|
|
47
|
-
scope,
|
|
48
|
-
code
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
44
|
+
}
|
|
45
|
+
})
|
|
52
46
|
};
|
|
53
47
|
exports.auth = auth;
|
|
@@ -27,9 +27,7 @@ const initialState = {
|
|
|
27
27
|
value: Breakpoints.LARGE
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
-
const breakpointReducer =
|
|
31
|
-
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
32
|
-
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
30
|
+
const breakpointReducer = (state = initialState, action) => {
|
|
33
31
|
const {
|
|
34
32
|
type,
|
|
35
33
|
payload
|
|
@@ -16,20 +16,17 @@ const liveMessage = (0, _toolkit.createSlice)({
|
|
|
16
16
|
name: 'liveMessage',
|
|
17
17
|
initialState,
|
|
18
18
|
reducers: {
|
|
19
|
-
announce: (state,
|
|
20
|
-
|
|
21
|
-
payload: {
|
|
22
|
-
message,
|
|
23
|
-
ariaLive,
|
|
24
|
-
id
|
|
25
|
-
}
|
|
26
|
-
} = _ref;
|
|
27
|
-
return {
|
|
19
|
+
announce: (state, {
|
|
20
|
+
payload: {
|
|
28
21
|
message,
|
|
29
22
|
ariaLive,
|
|
30
23
|
id
|
|
31
|
-
}
|
|
32
|
-
}
|
|
24
|
+
}
|
|
25
|
+
}) => ({
|
|
26
|
+
message,
|
|
27
|
+
ariaLive,
|
|
28
|
+
id
|
|
29
|
+
})
|
|
33
30
|
}
|
|
34
31
|
});
|
|
35
32
|
const {
|
|
@@ -15,8 +15,7 @@ var _index2 = require("./breakpoint/index.js");
|
|
|
15
15
|
|
|
16
16
|
var _index3 = require("./live-message/index.js");
|
|
17
17
|
|
|
18
|
-
const createReducer =
|
|
19
|
-
let injectedReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
18
|
+
const createReducer = (injectedReducers = {}) => {
|
|
20
19
|
const rootReducer = (0, _toolkit.combineReducers)({
|
|
21
20
|
waitMessage: _reducer.waitMessageReducer,
|
|
22
21
|
error: _index.errorReducer,
|
package/dist/cjs/data/store.js
CHANGED
|
@@ -33,10 +33,9 @@ const getStore = () => appStore;
|
|
|
33
33
|
exports.getStore = getStore;
|
|
34
34
|
|
|
35
35
|
// ToDo: middlewareConfig is a temporary parameter and will be removed in the future
|
|
36
|
-
const createStore =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
};
|
|
36
|
+
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
37
|
+
thunk: false
|
|
38
|
+
}) => {
|
|
40
39
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
41
40
|
const {
|
|
42
41
|
run: runSaga
|
|
@@ -73,10 +72,7 @@ const createStore = function (initialState, sagaMiddleware, history) {
|
|
|
73
72
|
return baseStore;
|
|
74
73
|
};
|
|
75
74
|
|
|
76
|
-
const createAppStore =
|
|
77
|
-
let initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
78
|
-
let history = arguments.length > 1 ? arguments[1] : undefined;
|
|
79
|
-
let middlewareConfig = arguments.length > 2 ? arguments[2] : undefined;
|
|
75
|
+
const createAppStore = (initialState = {}, history, middlewareConfig) => {
|
|
80
76
|
const sagaMiddleware = (0, _reduxSaga.default)({});
|
|
81
77
|
const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
|
|
82
78
|
setStore(store);
|
|
@@ -10,15 +10,12 @@ const ACTIONS = {
|
|
|
10
10
|
};
|
|
11
11
|
exports.ACTIONS = ACTIONS;
|
|
12
12
|
const waitMessage = {
|
|
13
|
-
open:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
},
|
|
13
|
+
open: (message = 'loading...') => ({
|
|
14
|
+
type: ACTIONS.OPEN,
|
|
15
|
+
payload: {
|
|
16
|
+
message
|
|
17
|
+
}
|
|
18
|
+
}),
|
|
22
19
|
close: () => ({
|
|
23
20
|
type: ACTIONS.CLOSE,
|
|
24
21
|
payload: null
|
|
@@ -19,22 +19,18 @@ const initialState = {
|
|
|
19
19
|
};
|
|
20
20
|
exports.initialState = initialState;
|
|
21
21
|
|
|
22
|
-
const waitMessageReducer =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
22
|
+
const waitMessageReducer = (state = initialState, action) => (0, _immer.default)(state, draft => {
|
|
23
|
+
// eslint-disable-next-line default-case
|
|
24
|
+
switch (action.type) {
|
|
25
|
+
case _actions.ACTIONS.OPEN:
|
|
26
|
+
draft.isOpen = true;
|
|
27
|
+
draft.message = action.payload.message;
|
|
28
|
+
break;
|
|
29
|
+
|
|
30
|
+
case _actions.ACTIONS.CLOSE:
|
|
31
|
+
draft.isOpen = false;
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
39
35
|
|
|
40
36
|
exports.waitMessageReducer = waitMessageReducer;
|