@elliemae/pui-app-sdk 2.8.3 → 2.11.0
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/base-data.js +22 -0
- package/dist/cjs/analytics/index.js +37 -0
- package/dist/cjs/analytics/user-session.js +31 -17
- package/dist/cjs/analytics/user-wait.js +13 -5
- package/dist/cjs/api/auth/index.js +16 -13
- package/dist/cjs/api/helpers.js +17 -3
- package/dist/cjs/api/users/index.js +4 -3
- package/dist/cjs/communication/http-client/index.js +21 -16
- package/dist/cjs/communication/http-client/response-interceptor.js +2 -3
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/cjs/data/auth/actions.js +28 -22
- package/dist/cjs/data/breakpoint/index.js +3 -1
- package/dist/cjs/data/live-message/index.js +11 -8
- package/dist/cjs/data/reducers.js +2 -1
- package/dist/cjs/data/store.js +8 -4
- package/dist/cjs/data/wait-message/actions.js +9 -6
- package/dist/cjs/data/wait-message/reducer.js +17 -13
- package/dist/cjs/index.js +18 -1
- package/dist/cjs/route/index.js +9 -6
- package/dist/cjs/route/private-route/index.js +10 -9
- package/dist/cjs/sideeffect/auth/index.js +10 -6
- package/dist/cjs/utils/app-config/config.js +21 -4
- package/dist/cjs/utils/app-config/index.js +17 -13
- package/dist/cjs/utils/app-host-integration/react.js +10 -7
- package/dist/cjs/utils/auth/index.js +34 -33
- package/dist/cjs/utils/micro-frontend/guest.js +10 -7
- package/dist/cjs/utils/micro-frontend/host.js +12 -1
- package/dist/cjs/utils/micro-frontend/index.js +2 -4
- package/dist/cjs/utils/service-worker.js +2 -1
- package/dist/cjs/utils/session.js +13 -5
- package/dist/cjs/utils/storybook/theme.js +12 -9
- package/dist/cjs/utils/testing/index.js +18 -9
- package/dist/cjs/utils/testing/render-with-redux.js +14 -11
- package/dist/cjs/utils/testing/render-with-router-redux.js +20 -17
- package/dist/cjs/utils/testing/render-with-router.js +16 -13
- package/dist/cjs/utils/testing/render-with-state-addons.js +14 -7
- package/dist/cjs/utils/web-storage.js +6 -0
- package/dist/cjs/view/app-root/hosted-app.js +8 -5
- package/dist/cjs/view/app-root/index.js +23 -20
- package/dist/cjs/view/app-root/stand-alone-app.js +8 -5
- package/dist/cjs/view/app-root/style.js +6 -3
- package/dist/cjs/view/error-toast/index.stories.js +29 -22
- package/dist/cjs/view/fetch-host-app-data/index.js +2 -2
- package/dist/cjs/view/fetch-host-app-data/store.js +8 -2
- package/dist/cjs/view/fields/check-box/index.js +28 -20
- package/dist/cjs/view/fields/check-box/index.stories.js +24 -20
- package/dist/cjs/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/cjs/view/fields/combo-box/index.js +28 -22
- package/dist/cjs/view/fields/connect-form.js +4 -3
- package/dist/cjs/view/fields/date-input/index.js +21 -15
- package/dist/cjs/view/fields/date-input/index.stories.js +1 -1
- package/dist/cjs/view/fields/date-picker/index.js +21 -15
- package/dist/cjs/view/fields/date-picker/index.stories.js +1 -1
- package/dist/cjs/view/fields/form-item-layout/index.js +20 -16
- package/dist/cjs/view/fields/input-mask/index.js +24 -16
- package/dist/cjs/view/fields/large-text-box/index.js +21 -15
- package/dist/cjs/view/fields/radio/index.js +26 -20
- package/dist/cjs/view/fields/radio/index.stories.js +21 -17
- package/dist/cjs/view/fields/radio/set-value.stories.js +19 -15
- package/dist/cjs/view/fields/radio-group/index.js +22 -16
- package/dist/cjs/view/fields/radio-group/index.stories.js +44 -37
- package/dist/cjs/view/fields/text-box/index.js +21 -15
- package/dist/cjs/view/fields/watch-value.js +5 -4
- package/dist/cjs/view/form/index.js +10 -9
- package/dist/cjs/view/form/index.stories.js +6 -3
- package/dist/cjs/view/form/submit-button/index.js +3 -2
- package/dist/cjs/view/form/usecases.stories.js +6 -3
- package/dist/cjs/view/guest-unload-handlers/index.js +2 -1
- package/dist/cjs/view/header/center-region/index.js +18 -8
- package/dist/cjs/view/header/index.js +11 -8
- package/dist/cjs/view/live-message/index.stories.js +2 -0
- package/dist/cjs/view/loadable/index.js +2 -1
- package/dist/cjs/view/login/index.js +6 -5
- package/dist/cjs/view/message-to-host-app/index.js +2 -1
- package/dist/cjs/view/micro-app/app-factory/index.js +39 -23
- package/dist/cjs/view/micro-app/resources/manifest.js +29 -16
- package/dist/cjs/view/micro-app/resources/script.js +29 -22
- package/dist/cjs/view/micro-app/resources/style.js +27 -20
- package/dist/cjs/view/micro-app/use-app-will-render.js +13 -10
- package/dist/cjs/view/micro-app/utils.js +6 -0
- package/dist/cjs/view/micro-iframe-app/app.js +7 -6
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/cjs/view/micro-iframe-app/index.js +5 -4
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/cjs/view/modals/error/index.js +9 -6
- package/dist/cjs/view/modals/navigation-prompt/index.js +7 -4
- package/dist/cjs/view/modals/session-expiry/customHooks.js +7 -3
- package/dist/cjs/view/modals/session-expiry/index.js +8 -5
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/cjs/view/modals/wait-message/index.js +9 -8
- package/dist/cjs/view/modals/wait-message/index.stories.js +5 -4
- package/dist/cjs/view/render-with-delay/index.js +4 -3
- package/dist/cjs/view/useMediaBreakpoints/index.js +10 -0
- package/dist/es/analytics/base-data.js +10 -0
- package/dist/es/analytics/index.js +28 -0
- package/dist/es/analytics/user-session.js +30 -17
- package/dist/es/analytics/user-wait.js +12 -5
- package/dist/es/api/auth/index.js +16 -13
- package/dist/es/api/helpers.js +13 -3
- package/dist/es/api/users/index.js +4 -3
- package/dist/es/communication/http-client/index.js +20 -16
- package/dist/es/communication/http-client/response-interceptor.js +2 -3
- package/dist/es/communication/http-client/tests/index.test-disable.js +6 -5
- package/dist/es/data/auth/actions.js +28 -22
- package/dist/es/data/breakpoint/index.js +3 -1
- package/dist/es/data/live-message/index.js +11 -8
- package/dist/es/data/reducers.js +2 -1
- package/dist/es/data/store.js +8 -4
- package/dist/es/data/wait-message/actions.js +9 -6
- package/dist/es/data/wait-message/reducer.js +16 -12
- package/dist/es/index.js +3 -1
- package/dist/es/route/index.js +7 -6
- package/dist/es/route/private-route/index.js +10 -9
- package/dist/es/sideeffect/auth/index.js +10 -6
- package/dist/es/utils/app-config/config.js +18 -4
- package/dist/es/utils/app-config/index.js +17 -13
- package/dist/es/utils/app-host-integration/react.js +10 -7
- package/dist/es/utils/auth/index.js +34 -33
- package/dist/es/utils/micro-frontend/guest.js +9 -6
- package/dist/es/utils/micro-frontend/host.js +11 -1
- package/dist/es/utils/micro-frontend/index.js +2 -2
- package/dist/es/utils/service-worker.js +2 -1
- package/dist/es/utils/session.js +14 -5
- package/dist/es/utils/storybook/theme.js +12 -9
- package/dist/es/utils/testing/index.js +12 -9
- package/dist/es/utils/testing/render-with-redux.js +14 -11
- package/dist/es/utils/testing/render-with-router-redux.js +20 -17
- package/dist/es/utils/testing/render-with-router.js +16 -13
- package/dist/es/utils/testing/render-with-state-addons.js +11 -7
- package/dist/es/utils/web-storage.js +3 -0
- package/dist/es/view/app-root/hosted-app.js +8 -5
- package/dist/es/view/app-root/index.js +23 -20
- package/dist/es/view/app-root/stand-alone-app.js +8 -5
- package/dist/es/view/app-root/style.js +6 -3
- package/dist/es/view/error-toast/index.stories.js +29 -22
- package/dist/es/view/fetch-host-app-data/index.js +2 -2
- package/dist/es/view/fetch-host-app-data/store.js +6 -2
- package/dist/es/view/fields/check-box/index.js +26 -20
- package/dist/es/view/fields/check-box/index.stories.js +24 -20
- package/dist/es/view/fields/check-box/set-value.stories.js +21 -17
- package/dist/es/view/fields/combo-box/index.js +28 -22
- package/dist/es/view/fields/connect-form.js +4 -3
- package/dist/es/view/fields/date-input/index.js +21 -15
- package/dist/es/view/fields/date-input/index.stories.js +1 -1
- package/dist/es/view/fields/date-picker/index.js +21 -15
- package/dist/es/view/fields/date-picker/index.stories.js +1 -1
- package/dist/es/view/fields/form-item-layout/index.js +20 -16
- package/dist/es/view/fields/input-mask/index.js +22 -16
- package/dist/es/view/fields/large-text-box/index.js +21 -15
- package/dist/es/view/fields/radio/index.js +26 -20
- package/dist/es/view/fields/radio/index.stories.js +21 -17
- package/dist/es/view/fields/radio/set-value.stories.js +19 -15
- package/dist/es/view/fields/radio-group/index.js +22 -16
- package/dist/es/view/fields/radio-group/index.stories.js +44 -37
- package/dist/es/view/fields/text-box/index.js +21 -15
- package/dist/es/view/fields/watch-value.js +5 -4
- package/dist/es/view/form/index.js +10 -9
- package/dist/es/view/form/index.stories.js +6 -3
- package/dist/es/view/form/submit-button/index.js +3 -2
- package/dist/es/view/form/usecases.stories.js +6 -3
- package/dist/es/view/guest-unload-handlers/index.js +2 -1
- package/dist/es/view/header/center-region/index.js +16 -8
- package/dist/es/view/header/index.js +11 -8
- package/dist/es/view/loadable/index.js +2 -1
- package/dist/es/view/login/index.js +6 -5
- package/dist/es/view/message-to-host-app/index.js +2 -1
- package/dist/es/view/micro-app/app-factory/index.js +33 -23
- package/dist/es/view/micro-app/resources/manifest.js +25 -15
- package/dist/es/view/micro-app/resources/script.js +28 -21
- package/dist/es/view/micro-app/resources/style.js +27 -20
- package/dist/es/view/micro-app/use-app-will-render.js +12 -9
- package/dist/es/view/micro-app/utils.js +3 -0
- package/dist/es/view/micro-iframe-app/app.js +7 -6
- package/dist/es/view/micro-iframe-app/iframe/index.js +8 -7
- package/dist/es/view/micro-iframe-app/index.js +5 -4
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +5 -4
- package/dist/es/view/modals/error/index.js +7 -6
- package/dist/es/view/modals/navigation-prompt/index.js +5 -4
- package/dist/es/view/modals/session-expiry/customHooks.js +2 -1
- package/dist/es/view/modals/session-expiry/index.js +6 -5
- package/dist/es/view/modals/wait-message/html-wait-message.js +4 -3
- package/dist/es/view/modals/wait-message/index.js +9 -8
- package/dist/es/view/modals/wait-message/index.stories.js +5 -4
- package/dist/es/view/render-with-delay/index.js +4 -3
- package/dist/es/view/useMediaBreakpoints/index.js +5 -0
- package/dist/public/assets/index.ad459dcebaa616bff55e77d860405729.svg +1 -0
- package/dist/public/assets/index.dae17c8817fd9c5ab29e7c3a8925a1f4.svg +1 -0
- package/dist/public/assets/logo.0cbd33c5006f8ea6d106f8ab13f6e6dc.svg +1 -0
- package/dist/public/index.html +1 -1
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js +3 -0
- package/dist/public/js/{emuiAppSdk.555dc403d2552c23928a.js.LICENSE.txt → emuiAppSdk.bdec42736fbd0fbcbe9a.js.LICENSE.txt} +0 -9
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.bdec42736fbd0fbcbe9a.js.map +1 -0
- package/dist/types/analytics/base-data.d.ts +8 -0
- package/dist/types/analytics/index.d.ts +5 -0
- package/dist/types/analytics/user-session.d.ts +1 -4
- package/dist/types/communication/http-client/index.d.ts +2 -2
- package/dist/types/communication/http-client/request-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/response-interceptor.d.ts +1 -1
- package/dist/types/communication/http-client/retry-axios.d.ts +5 -2
- package/dist/types/index.d.ts +2 -1
- package/dist/types/utils/micro-frontend/host.d.ts +3 -2
- package/dist/types/utils/window.d.ts +3 -3
- package/dist/types/view/fields/date-input/index.d.ts +1 -2
- package/dist/types/view/fields/date-picker/index.d.ts +1 -2
- package/dist/types/view/visually-hidden/index.d.ts +1 -1
- package/package.json +17 -17
- package/dist/cjs/analytics/utils.js +0 -13
- package/dist/cjs/data/tests/store.test.js +0 -32
- package/dist/es/analytics/utils.js +0 -4
- package/dist/es/data/tests/store.test.js +0 -32
- package/dist/public/assets/index.0944904d91ed62aebf865bc6461471aa.svg +0 -4
- package/dist/public/assets/index.4c19242eb7de64399b205c842bf3185c.svg +0 -5
- package/dist/public/assets/logo.6799a57c45dd9c96b44e2bac6c4ee12c.svg +0 -2
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js +0 -3
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.gz +0 -0
- package/dist/public/js/emuiAppSdk.555dc403d2552c23928a.js.map +0 -1
- package/dist/types/analytics/utils.d.ts +0 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CMicroAppGuest } from "../utils/micro-frontend/guest.js";
|
|
2
|
+
|
|
3
|
+
const sendBAEventToSelf = event => {
|
|
4
|
+
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
5
|
+
window.gtmDataLayer.push(event);
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const sendBAEvent = _ref => {
|
|
9
|
+
let {
|
|
10
|
+
eventParams,
|
|
11
|
+
self = true
|
|
12
|
+
} = _ref;
|
|
13
|
+
|
|
14
|
+
if (!self) {
|
|
15
|
+
var _CMicroAppGuest$getIn, _CMicroAppGuest$getIn2;
|
|
16
|
+
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
18
|
+
const sendEvent = (_CMicroAppGuest$getIn = CMicroAppGuest.getInstance()) === null || _CMicroAppGuest$getIn === void 0 ? void 0 : (_CMicroAppGuest$getIn2 = _CMicroAppGuest$getIn.getHost()) === null || _CMicroAppGuest$getIn2 === void 0 ? void 0 : _CMicroAppGuest$getIn2.sendBAEvent;
|
|
19
|
+
|
|
20
|
+
if (sendEvent) {
|
|
21
|
+
sendEvent(eventParams);
|
|
22
|
+
} else {
|
|
23
|
+
sendBAEventToSelf(eventParams);
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
sendBAEventToSelf(eventParams);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -1,17 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
1
|
+
import { sendBAEvent } from "./index.js";
|
|
2
|
+
import { updateBaseData, getBaseData } from "./base-data.js";
|
|
3
|
+
export const loginEvent = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
instanceId,
|
|
6
|
+
userId
|
|
7
|
+
} = _ref;
|
|
8
|
+
updateBaseData({
|
|
9
|
+
instance_id: instanceId,
|
|
10
|
+
user_id: userId
|
|
11
|
+
});
|
|
12
|
+
sendBAEvent({
|
|
13
|
+
eventParams: {
|
|
14
|
+
event: 'user_login',
|
|
15
|
+
...getBaseData()
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export const logoutEvent = () => {
|
|
20
|
+
sendBAEvent({
|
|
21
|
+
eventParams: {
|
|
22
|
+
event: 'user_logout',
|
|
23
|
+
...getBaseData()
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
updateBaseData({
|
|
27
|
+
instance_id: '',
|
|
28
|
+
user_id: ''
|
|
29
|
+
});
|
|
30
|
+
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { sendBAEvent } from "./index.js";
|
|
2
|
+
import { getBaseData } from "./base-data.js";
|
|
3
|
+
export const waitStartEvent = () => sendBAEvent({
|
|
4
|
+
eventParams: {
|
|
5
|
+
event: 'page_interaction_enabled',
|
|
6
|
+
...getBaseData()
|
|
7
|
+
}
|
|
4
8
|
});
|
|
5
|
-
export const waitEndEvent = () =>
|
|
6
|
-
|
|
9
|
+
export const waitEndEvent = () => sendBAEvent({
|
|
10
|
+
eventParams: {
|
|
11
|
+
event: 'page_interaction_disabled',
|
|
12
|
+
...getBaseData()
|
|
13
|
+
}
|
|
7
14
|
});
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
2
2
|
import "core-js/modules/web.url-search-params.js";
|
|
3
3
|
import { getHTTPClient } from "../../communication/http-client/index.js";
|
|
4
|
-
export const getToken = async
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export const getToken = async _ref => {
|
|
5
|
+
let {
|
|
6
|
+
clientId,
|
|
7
|
+
redirectUri,
|
|
8
|
+
idpCode
|
|
9
|
+
} = _ref;
|
|
9
10
|
const params = new URLSearchParams();
|
|
10
11
|
params.append('grant_type', 'authorization_code');
|
|
11
12
|
params.append('client_id', clientId);
|
|
@@ -19,19 +20,21 @@ export const getToken = async ({
|
|
|
19
20
|
accessToken: data.access_token
|
|
20
21
|
};
|
|
21
22
|
};
|
|
22
|
-
export const revokeToken = async
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
export const revokeToken = async _ref2 => {
|
|
24
|
+
let {
|
|
25
|
+
clientId,
|
|
26
|
+
token
|
|
27
|
+
} = _ref2;
|
|
26
28
|
const params = new URLSearchParams();
|
|
27
29
|
params.append('token', token);
|
|
28
30
|
params.append('client_id', clientId);
|
|
29
31
|
await getHTTPClient().post('/oauth2/v1/token/revocation', params);
|
|
30
32
|
};
|
|
31
|
-
export const introspectToken = async
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
export const introspectToken = async _ref3 => {
|
|
34
|
+
let {
|
|
35
|
+
clientId,
|
|
36
|
+
accessToken
|
|
37
|
+
} = _ref3;
|
|
35
38
|
const params = new URLSearchParams();
|
|
36
39
|
params.append('token', accessToken);
|
|
37
40
|
params.append('client_id', clientId);
|
package/dist/es/api/helpers.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
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";
|
|
1
4
|
import { createAction } from '@reduxjs/toolkit';
|
|
2
|
-
|
|
5
|
+
|
|
3
6
|
/**
|
|
4
7
|
* @function
|
|
5
8
|
* @description Creates API Redux Action Creators
|
|
@@ -30,7 +33,6 @@ import { get } from 'lodash';
|
|
|
30
33
|
* @param {string} api API name for which Redux Action Creators are required
|
|
31
34
|
* @returns {Function} Redux Action Creators util function
|
|
32
35
|
*/
|
|
33
|
-
|
|
34
36
|
export const getApiActionCreator = api => operation => ({
|
|
35
37
|
[operation]: createAction("".concat(api, "/").concat(operation)),
|
|
36
38
|
["".concat(operation, "Success")]: createAction("".concat(api, "/").concat(operation, "Success")),
|
|
@@ -81,5 +83,13 @@ export const getApiActionCreator = api => operation => ({
|
|
|
81
83
|
|
|
82
84
|
/* eslint-disable prettier/prettier */
|
|
83
85
|
|
|
84
|
-
export const getSelectField = stateName => (
|
|
86
|
+
export const getSelectField = stateName => function () {
|
|
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
|
+
};
|
|
85
95
|
/* eslint-enable prettier/prettier */
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getAuthHTTPClient } from "../../communication/http-client/index.js";
|
|
2
|
-
export const getUser = async
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export const getUser = async _ref => {
|
|
3
|
+
let {
|
|
4
|
+
userName
|
|
5
|
+
} = _ref;
|
|
5
6
|
const {
|
|
6
7
|
data
|
|
7
8
|
} = await getAuthHTTPClient().get("/encompass/v1/users/".concat(userName));
|
|
@@ -6,12 +6,13 @@ 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 = ({
|
|
10
|
-
baseURL = getAppConfigValue('serviceEndpoints.api', ''),
|
|
11
|
-
headers = {}
|
|
12
|
-
} = {}) => {
|
|
9
|
+
export const getHTTPClient = function () {
|
|
13
10
|
var _client$defaults;
|
|
14
11
|
|
|
12
|
+
let {
|
|
13
|
+
baseURL = getAppConfigValue('serviceEndpoints.api', ''),
|
|
14
|
+
headers = {}
|
|
15
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
15
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
16
17
|
const client = axios.create({
|
|
17
18
|
baseURL,
|
|
@@ -27,15 +28,18 @@ export const getHTTPClient = ({
|
|
|
27
28
|
if (response) response.use(handleSuccess, handleFailure);
|
|
28
29
|
return client;
|
|
29
30
|
};
|
|
30
|
-
export const getAuthHTTPClient = ({
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
31
|
+
export const getAuthHTTPClient = function () {
|
|
32
|
+
let {
|
|
33
|
+
baseURL,
|
|
34
|
+
headers = {},
|
|
35
|
+
...rest
|
|
36
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
37
|
+
return getHTTPClient({
|
|
38
|
+
baseURL,
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
40
|
+
headers: { ...headers,
|
|
41
|
+
Authorization: getAuthorizationHeader()
|
|
42
|
+
},
|
|
43
|
+
...rest
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -14,9 +14,8 @@ export const handleFailure = error => {
|
|
|
14
14
|
return unAuthorizedFailureHandler(error).then(authorizationHeader => {
|
|
15
15
|
const {
|
|
16
16
|
config
|
|
17
|
-
} = error;
|
|
18
|
-
|
|
19
|
-
config.headers.Authorization = authorizationHeader;
|
|
17
|
+
} = error;
|
|
18
|
+
if (config.headers) config.headers.Authorization = authorizationHeader;
|
|
20
19
|
return new Promise((resolve, reject) => {
|
|
21
20
|
axios.request(config).then(response => {
|
|
22
21
|
resolve(response);
|
|
@@ -3,11 +3,12 @@ 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
|
-
|
|
6
|
+
const callApi = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
apiUrl,
|
|
9
|
+
options = {},
|
|
10
|
+
baseURL = 'http://localhost:3001'
|
|
11
|
+
} = _ref;
|
|
11
12
|
const httpClient = getAuthHTTPClient({
|
|
12
13
|
baseURL
|
|
13
14
|
});
|
|
@@ -2,36 +2,42 @@ 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
|
-
|
|
7
|
-
redirectUri,
|
|
8
|
-
clientId,
|
|
9
|
-
responseType,
|
|
10
|
-
scope
|
|
11
|
-
}) => ({
|
|
12
|
-
type: LOGIN,
|
|
13
|
-
payload: {
|
|
5
|
+
login: _ref => {
|
|
6
|
+
let {
|
|
14
7
|
idpCode,
|
|
15
8
|
redirectUri,
|
|
16
9
|
clientId,
|
|
17
10
|
responseType,
|
|
18
11
|
scope
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
type: LOGIN,
|
|
15
|
+
payload: {
|
|
16
|
+
idpCode,
|
|
17
|
+
redirectUri,
|
|
18
|
+
clientId,
|
|
19
|
+
responseType,
|
|
20
|
+
scope
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
logout: _ref2 => {
|
|
25
|
+
let {
|
|
30
26
|
clientId,
|
|
31
27
|
redirectUri,
|
|
32
28
|
responseType,
|
|
33
29
|
scope,
|
|
34
30
|
code
|
|
35
|
-
}
|
|
36
|
-
|
|
31
|
+
} = _ref2;
|
|
32
|
+
return {
|
|
33
|
+
type: LOGOUT,
|
|
34
|
+
payload: {
|
|
35
|
+
clientId,
|
|
36
|
+
redirectUri,
|
|
37
|
+
responseType,
|
|
38
|
+
scope,
|
|
39
|
+
code
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
37
43
|
};
|
|
@@ -14,7 +14,9 @@ export let Breakpoints;
|
|
|
14
14
|
const initialState = {
|
|
15
15
|
value: Breakpoints.LARGE
|
|
16
16
|
};
|
|
17
|
-
export const breakpointReducer = (
|
|
17
|
+
export const breakpointReducer = function () {
|
|
18
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
19
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
18
20
|
const {
|
|
19
21
|
type,
|
|
20
22
|
payload
|
|
@@ -8,17 +8,20 @@ const liveMessage = createSlice({
|
|
|
8
8
|
name: 'liveMessage',
|
|
9
9
|
initialState,
|
|
10
10
|
reducers: {
|
|
11
|
-
announce: (state, {
|
|
12
|
-
|
|
11
|
+
announce: (state, _ref) => {
|
|
12
|
+
let {
|
|
13
|
+
payload: {
|
|
14
|
+
message,
|
|
15
|
+
ariaLive,
|
|
16
|
+
id
|
|
17
|
+
}
|
|
18
|
+
} = _ref;
|
|
19
|
+
return {
|
|
13
20
|
message,
|
|
14
21
|
ariaLive,
|
|
15
22
|
id
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
message,
|
|
19
|
-
ariaLive,
|
|
20
|
-
id
|
|
21
|
-
})
|
|
23
|
+
};
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
});
|
|
24
27
|
export const {
|
package/dist/es/data/reducers.js
CHANGED
|
@@ -3,7 +3,8 @@ 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 = (
|
|
6
|
+
export const createReducer = function () {
|
|
7
|
+
let injectedReducers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
8
|
const rootReducer = combineReducers({
|
|
8
9
|
waitMessage: waitMessageReducer,
|
|
9
10
|
error: errorReducer,
|
package/dist/es/data/store.js
CHANGED
|
@@ -14,9 +14,10 @@ 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 = (initialState, sagaMiddleware, history
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const createStore = function (initialState, sagaMiddleware, history) {
|
|
18
|
+
let middlewareConfig = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
|
19
|
+
thunk: false
|
|
20
|
+
};
|
|
20
21
|
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
21
22
|
const {
|
|
22
23
|
run: runSaga
|
|
@@ -60,7 +61,10 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
60
61
|
return baseStore;
|
|
61
62
|
};
|
|
62
63
|
|
|
63
|
-
export const createAppStore = (
|
|
64
|
+
export const createAppStore = function () {
|
|
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;
|
|
64
68
|
const sagaMiddleware = createSagaMiddleware({});
|
|
65
69
|
const store = createStore(initialState, sagaMiddleware, history, middlewareConfig);
|
|
66
70
|
setStore(store);
|
|
@@ -3,12 +3,15 @@ export const ACTIONS = {
|
|
|
3
3
|
CLOSE: 'wait-message/CLOSE'
|
|
4
4
|
};
|
|
5
5
|
export const waitMessage = {
|
|
6
|
-
open: (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
open: function () {
|
|
7
|
+
let message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'loading...';
|
|
8
|
+
return {
|
|
9
|
+
type: ACTIONS.OPEN,
|
|
10
|
+
payload: {
|
|
11
|
+
message
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
},
|
|
12
15
|
close: () => ({
|
|
13
16
|
type: ACTIONS.CLOSE,
|
|
14
17
|
payload: null
|
|
@@ -6,16 +6,20 @@ export const initialState = {
|
|
|
6
6
|
isOpen: null,
|
|
7
7
|
message: 'loading...'
|
|
8
8
|
};
|
|
9
|
-
export const waitMessageReducer = (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
export const waitMessageReducer = function () {
|
|
10
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
|
|
11
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
12
|
+
return produce(state, draft => {
|
|
13
|
+
// eslint-disable-next-line default-case
|
|
14
|
+
switch (action.type) {
|
|
15
|
+
case ACTIONS.OPEN:
|
|
16
|
+
draft.isOpen = true;
|
|
17
|
+
draft.message = action.payload.message;
|
|
18
|
+
break;
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
20
|
+
case ACTIONS.CLOSE:
|
|
21
|
+
draft.isOpen = false;
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
package/dist/es/index.js
CHANGED
|
@@ -75,4 +75,6 @@ export { MicroIFrameApp } from "./view/micro-iframe-app/index.js";
|
|
|
75
75
|
export { getNavigationLinks } from "./view/micro-app/utils.js"; // app host
|
|
76
76
|
|
|
77
77
|
export { getStore } from "./data/store.js";
|
|
78
|
-
export { RegisterService } from "./utils/guest-with-service.js"; //
|
|
78
|
+
export { RegisterService } from "./utils/guest-with-service.js"; // analytics
|
|
79
|
+
|
|
80
|
+
export { sendBAEvent } from "./analytics/index.js"; // Type utils
|
package/dist/es/route/index.js
CHANGED
|
@@ -2,12 +2,13 @@ import { memo, useCallback } from 'react';
|
|
|
2
2
|
import { Route as ReactRouterRoute } from 'react-router-dom';
|
|
3
3
|
import * as brum from '@elliemae/pui-user-monitoring';
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
-
export const Route = /*#__PURE__*/memo(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
export const Route = /*#__PURE__*/memo(_ref => {
|
|
6
|
+
let {
|
|
7
|
+
component: Component,
|
|
8
|
+
pageTitle,
|
|
9
|
+
render,
|
|
10
|
+
...rest
|
|
11
|
+
} = _ref;
|
|
11
12
|
const memoizedRender = useCallback(routeProps => {
|
|
12
13
|
try {
|
|
13
14
|
if (brum && pageTitle) {
|
|
@@ -10,17 +10,18 @@ import { isUserAuthorized } from "../../utils/auth/index.js";
|
|
|
10
10
|
import { Route } from "../index.js";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const key = 'auth';
|
|
13
|
-
export const PrivateRoute =
|
|
14
|
-
component: Component,
|
|
15
|
-
pageTitle,
|
|
16
|
-
render,
|
|
17
|
-
clientId = enums.CLIENT_ID,
|
|
18
|
-
scope = 'loc',
|
|
19
|
-
responseType = 'code',
|
|
20
|
-
...rest
|
|
21
|
-
}) => {
|
|
13
|
+
export const PrivateRoute = _ref => {
|
|
22
14
|
var _Login;
|
|
23
15
|
|
|
16
|
+
let {
|
|
17
|
+
component: Component,
|
|
18
|
+
pageTitle,
|
|
19
|
+
render,
|
|
20
|
+
clientId = enums.CLIENT_ID,
|
|
21
|
+
scope = 'loc',
|
|
22
|
+
responseType = 'code',
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
24
25
|
useInjectReducer({
|
|
25
26
|
key,
|
|
26
27
|
reducer: authReducer
|
|
@@ -3,9 +3,11 @@ 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
|
-
|
|
6
|
+
export function* login(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
payload
|
|
9
|
+
} = _ref;
|
|
10
|
+
|
|
9
11
|
try {
|
|
10
12
|
yield call(authorize, payload);
|
|
11
13
|
yield put({
|
|
@@ -17,9 +19,11 @@ export function* login({
|
|
|
17
19
|
});
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
export function* logout({
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
export function* logout(_ref2) {
|
|
23
|
+
let {
|
|
24
|
+
payload
|
|
25
|
+
} = _ref2;
|
|
26
|
+
|
|
23
27
|
try {
|
|
24
28
|
yield call(endSession, payload);
|
|
25
29
|
} catch (err) {
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _has from "lodash/has";
|
|
2
|
+
import _set from "lodash/set";
|
|
3
|
+
import _get from "lodash/get";
|
|
4
|
+
import _clone from "lodash/clone";
|
|
2
5
|
// eslint-disable-next-line no-undef
|
|
3
6
|
let gAppConfig = APP_CONFIG;
|
|
4
7
|
export const setAppConfig = config => {
|
|
5
8
|
gAppConfig = config;
|
|
6
9
|
};
|
|
7
|
-
export const getAppConfigValue = (
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
export const getAppConfigValue = function () {
|
|
11
|
+
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
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
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _merge from "lodash/merge";
|
|
2
2
|
import { getHTTPClient } from "../../communication/http-client/index.js";
|
|
3
3
|
import { setAppConfig } from "./config.js";
|
|
4
4
|
|
|
@@ -10,18 +10,22 @@ const parseAppConfig = data => {
|
|
|
10
10
|
// @ts-ignore
|
|
11
11
|
|
|
12
12
|
if (data.env) delete data.env;
|
|
13
|
-
setAppConfig(
|
|
13
|
+
setAppConfig(_merge(data, activeEnvConfig));
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export const loadAppConfig =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
export const loadAppConfig = function () {
|
|
17
|
+
let hostUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : './';
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
getHTTPClient({
|
|
20
|
+
baseURL: hostUrl
|
|
21
|
+
}).get('app.config.json').then(_ref => {
|
|
22
|
+
let {
|
|
23
|
+
data
|
|
24
|
+
} = _ref;
|
|
25
|
+
parseAppConfig(data);
|
|
26
|
+
resolve();
|
|
27
|
+
}).catch(err => {
|
|
28
|
+
reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
|
|
29
|
+
});
|
|
26
30
|
});
|
|
27
|
-
}
|
|
31
|
+
};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { CMicroAppGuest } from "../micro-frontend/guest.js";
|
|
2
|
-
export const enableReactAppForHostIntegration =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
export const enableReactAppForHostIntegration = _ref => {
|
|
3
|
+
let {
|
|
4
|
+
onInit,
|
|
5
|
+
onMount
|
|
6
|
+
} = _ref;
|
|
7
|
+
return CMicroAppGuest.getInstance({
|
|
8
|
+
onInit,
|
|
9
|
+
onMount
|
|
10
|
+
});
|
|
11
|
+
};
|