@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
|
@@ -17,9 +17,11 @@ var _index2 = require("../../utils/micro-frontend/index.js");
|
|
|
17
17
|
|
|
18
18
|
var _logRecords = require("../../utils/log-records.js");
|
|
19
19
|
|
|
20
|
-
function* login({
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function* login(_ref) {
|
|
21
|
+
let {
|
|
22
|
+
payload
|
|
23
|
+
} = _ref;
|
|
24
|
+
|
|
23
25
|
try {
|
|
24
26
|
yield (0, _effects.call)(_index.authorize, payload);
|
|
25
27
|
yield (0, _effects.put)({
|
|
@@ -32,9 +34,11 @@ function* login({
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
function* logout({
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
function* logout(_ref2) {
|
|
38
|
+
let {
|
|
39
|
+
payload
|
|
40
|
+
} = _ref2;
|
|
41
|
+
|
|
38
42
|
try {
|
|
39
43
|
yield (0, _effects.call)(_index.endSession, payload);
|
|
40
44
|
} catch (err) {
|
|
@@ -7,7 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.setAppConfigValue = exports.setAppConfig = exports.hasItem = exports.getAppConfigValue = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _has2 = _interopRequireDefault(require("lodash/has"));
|
|
11
|
+
|
|
12
|
+
var _set2 = _interopRequireDefault(require("lodash/set"));
|
|
13
|
+
|
|
14
|
+
var _get2 = _interopRequireDefault(require("lodash/get"));
|
|
15
|
+
|
|
16
|
+
var _clone2 = _interopRequireDefault(require("lodash/clone"));
|
|
11
17
|
|
|
12
18
|
// eslint-disable-next-line no-undef
|
|
13
19
|
let gAppConfig = APP_CONFIG;
|
|
@@ -18,14 +24,25 @@ const setAppConfig = config => {
|
|
|
18
24
|
|
|
19
25
|
exports.setAppConfig = setAppConfig;
|
|
20
26
|
|
|
21
|
-
const getAppConfigValue = (
|
|
27
|
+
const getAppConfigValue = function () {
|
|
28
|
+
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
29
|
+
let defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
30
|
+
return (0, _clone2.default)((0, _get2.default)(gAppConfig, key, defaultValue));
|
|
31
|
+
};
|
|
22
32
|
|
|
23
33
|
exports.getAppConfigValue = getAppConfigValue;
|
|
24
34
|
|
|
25
|
-
const setAppConfigValue = (
|
|
35
|
+
const setAppConfigValue = function () {
|
|
36
|
+
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
37
|
+
let value = arguments.length > 1 ? arguments[1] : undefined;
|
|
38
|
+
return (0, _set2.default)(gAppConfig, key, value);
|
|
39
|
+
};
|
|
26
40
|
|
|
27
41
|
exports.setAppConfigValue = setAppConfigValue;
|
|
28
42
|
|
|
29
|
-
const hasItem = (
|
|
43
|
+
const hasItem = function () {
|
|
44
|
+
let key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
45
|
+
return (0, _has2.default)(gAppConfig, key);
|
|
46
|
+
};
|
|
30
47
|
|
|
31
48
|
exports.hasItem = hasItem;
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.loadAppConfig = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
11
11
|
|
|
12
12
|
var _index = require("../../communication/http-client/index.js");
|
|
13
13
|
|
|
@@ -21,20 +21,24 @@ const parseAppConfig = data => {
|
|
|
21
21
|
// @ts-ignore
|
|
22
22
|
|
|
23
23
|
if (data.env) delete data.env;
|
|
24
|
-
(0, _config.setAppConfig)(
|
|
24
|
+
(0, _config.setAppConfig)((0, _merge2.default)(data, activeEnvConfig));
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
const loadAppConfig =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
const loadAppConfig = function () {
|
|
28
|
+
let hostUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : './';
|
|
29
|
+
return new Promise((resolve, reject) => {
|
|
30
|
+
(0, _index.getHTTPClient)({
|
|
31
|
+
baseURL: hostUrl
|
|
32
|
+
}).get('app.config.json').then(_ref => {
|
|
33
|
+
let {
|
|
34
|
+
data
|
|
35
|
+
} = _ref;
|
|
36
|
+
parseAppConfig(data);
|
|
37
|
+
resolve();
|
|
38
|
+
}).catch(err => {
|
|
39
|
+
reject(new Error("Unable to load application configurtion file. ".concat(err.Message)));
|
|
40
|
+
});
|
|
37
41
|
});
|
|
38
|
-
}
|
|
42
|
+
};
|
|
39
43
|
|
|
40
44
|
exports.loadAppConfig = loadAppConfig;
|
|
@@ -7,12 +7,15 @@ exports.enableReactAppForHostIntegration = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _guest = require("../micro-frontend/guest.js");
|
|
9
9
|
|
|
10
|
-
const enableReactAppForHostIntegration =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
const enableReactAppForHostIntegration = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
onInit,
|
|
13
|
+
onMount
|
|
14
|
+
} = _ref;
|
|
15
|
+
return _guest.CMicroAppGuest.getInstance({
|
|
16
|
+
onInit,
|
|
17
|
+
onMount
|
|
18
|
+
});
|
|
19
|
+
};
|
|
17
20
|
|
|
18
21
|
exports.enableReactAppForHostIntegration = enableReactAppForHostIntegration;
|
|
@@ -50,14 +50,15 @@ const getIDPInfoFromUrl = () => {
|
|
|
50
50
|
|
|
51
51
|
exports.getIDPInfoFromUrl = getIDPInfoFromUrl;
|
|
52
52
|
|
|
53
|
-
const navigateToLoginPage =
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
const navigateToLoginPage = _ref => {
|
|
54
|
+
let {
|
|
55
|
+
clientId,
|
|
56
|
+
redirectUri,
|
|
57
|
+
idpErrorCode,
|
|
58
|
+
scope,
|
|
59
|
+
// eslint-disable-next-line camelcase
|
|
60
|
+
responseType
|
|
61
|
+
} = _ref;
|
|
61
62
|
const idpHost = (0, _config.getAppConfigValue)(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
62
63
|
const idpUrl = new URL('/authorize', idpHost);
|
|
63
64
|
const idpOptions = {
|
|
@@ -75,27 +76,24 @@ const navigateToLoginPage = ({
|
|
|
75
76
|
|
|
76
77
|
exports.navigateToLoginPage = navigateToLoginPage;
|
|
77
78
|
|
|
78
|
-
const endSession = async
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
const endSession = async _ref2 => {
|
|
80
|
+
let {
|
|
81
|
+
clientId,
|
|
82
|
+
redirectUri,
|
|
83
|
+
responseType,
|
|
84
|
+
scope,
|
|
85
|
+
code = '1004'
|
|
86
|
+
} = _ref2;
|
|
87
|
+
|
|
85
88
|
try {
|
|
86
89
|
const authorization = (0, _helper.getAuthorizationHeader)();
|
|
87
|
-
const userId = sessionStorage.getItem('userId') || '';
|
|
88
|
-
const instanceId = sessionStorage.getItem('instanceId') || '';
|
|
89
90
|
sessionStorage.clear();
|
|
90
91
|
const token = authorization ? authorization.split(' ')[1] : '';
|
|
91
92
|
await (0, _index.revokeToken)({
|
|
92
93
|
clientId,
|
|
93
94
|
token
|
|
94
95
|
});
|
|
95
|
-
(0, _userSession.logoutEvent)(
|
|
96
|
-
userId,
|
|
97
|
-
instanceId
|
|
98
|
-
}); // redirect
|
|
96
|
+
(0, _userSession.logoutEvent)(); // redirect
|
|
99
97
|
|
|
100
98
|
const idpHost = (0, _config.getAppConfigValue)(IDP_ENDPOINT_CONFIG_KEY, '');
|
|
101
99
|
const logoutUrl = new URL('/authorize', idpHost);
|
|
@@ -118,13 +116,15 @@ const endSession = async ({
|
|
|
118
116
|
|
|
119
117
|
exports.endSession = endSession;
|
|
120
118
|
|
|
121
|
-
const authorize = async
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
const authorize = async _ref3 => {
|
|
120
|
+
let {
|
|
121
|
+
idpCode,
|
|
122
|
+
redirectUri,
|
|
123
|
+
clientId,
|
|
124
|
+
scope,
|
|
125
|
+
responseType
|
|
126
|
+
} = _ref3;
|
|
127
|
+
|
|
128
128
|
try {
|
|
129
129
|
const {
|
|
130
130
|
tokenType,
|
|
@@ -186,11 +186,12 @@ const authorize = async ({
|
|
|
186
186
|
|
|
187
187
|
exports.authorize = authorize;
|
|
188
188
|
|
|
189
|
-
const login = async
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
189
|
+
const login = async _ref4 => {
|
|
190
|
+
let {
|
|
191
|
+
clientId,
|
|
192
|
+
scope,
|
|
193
|
+
responseType
|
|
194
|
+
} = _ref4;
|
|
194
195
|
const {
|
|
195
196
|
idpCode,
|
|
196
197
|
idpErrorCode,
|
|
@@ -13,9 +13,9 @@ require("core-js/modules/es.string.replace.js");
|
|
|
13
13
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
19
19
|
|
|
20
20
|
var _connectedReactRouter = require("connected-react-router");
|
|
21
21
|
|
|
@@ -50,6 +50,8 @@ const isCrossDomain = () => {
|
|
|
50
50
|
|
|
51
51
|
class CMicroAppGuest {
|
|
52
52
|
constructor(params) {
|
|
53
|
+
var _window$emui;
|
|
54
|
+
|
|
53
55
|
(0, _defineProperty2.default)(this, "logger", void 0);
|
|
54
56
|
(0, _defineProperty2.default)(this, "appId", void 0);
|
|
55
57
|
(0, _defineProperty2.default)(this, "props", void 0);
|
|
@@ -59,7 +61,7 @@ class CMicroAppGuest {
|
|
|
59
61
|
(0, _defineProperty2.default)(this, "onUnmount", void 0);
|
|
60
62
|
(0, _defineProperty2.default)(this, "onGetRef", void 0);
|
|
61
63
|
this.containerId = 'app-container';
|
|
62
|
-
this.appId = (0, _config.getAppConfigValue)('appId');
|
|
64
|
+
this.appId = ((_window$emui = window.emui) === null || _window$emui === void 0 ? void 0 : _window$emui.appId) || (0, _config.getAppConfigValue)('appId');
|
|
63
65
|
this.props = {
|
|
64
66
|
host: null,
|
|
65
67
|
hostUrl: null,
|
|
@@ -142,7 +144,7 @@ class CMicroAppGuest {
|
|
|
142
144
|
}
|
|
143
145
|
|
|
144
146
|
async init(options) {
|
|
145
|
-
this.props =
|
|
147
|
+
this.props = (0, _merge2.default)(this.props, options);
|
|
146
148
|
|
|
147
149
|
if (!this.props.host) {
|
|
148
150
|
const host = await this.getSSFHost();
|
|
@@ -158,9 +160,10 @@ class CMicroAppGuest {
|
|
|
158
160
|
/* eslint-enable camelcase, no-undef */
|
|
159
161
|
}
|
|
160
162
|
|
|
161
|
-
mount(
|
|
162
|
-
|
|
163
|
-
|
|
163
|
+
mount() {
|
|
164
|
+
let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
165
|
+
containerId: 'app-container'
|
|
166
|
+
};
|
|
164
167
|
this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
|
|
165
168
|
return Promise.resolve().then(() => {
|
|
166
169
|
if (this.onMount) this.onMount(options);
|
|
@@ -37,6 +37,8 @@ var _constants = require("../constants.js");
|
|
|
37
37
|
|
|
38
38
|
var _window = require("../window.js");
|
|
39
39
|
|
|
40
|
+
var _index3 = require("../../analytics/index.js");
|
|
41
|
+
|
|
40
42
|
class CMicroAppHost {
|
|
41
43
|
constructor(params) {
|
|
42
44
|
(0, _defineProperty2.default)(this, "logger", void 0);
|
|
@@ -175,11 +177,20 @@ class CMicroAppHost {
|
|
|
175
177
|
return (0, _pubsubJs.subscribe)(_constants.HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
|
|
176
178
|
}
|
|
177
179
|
|
|
178
|
-
setSystemVersion(
|
|
180
|
+
setSystemVersion() {
|
|
181
|
+
let version = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'latest';
|
|
179
182
|
window.emui.version = version;
|
|
180
183
|
this.props.systemVersion = version;
|
|
181
184
|
}
|
|
182
185
|
|
|
186
|
+
sendBAEvent(event) {
|
|
187
|
+
// eslint-disable-next-line max-lines
|
|
188
|
+
(0, _index3.sendBAEvent)({
|
|
189
|
+
eventParams: event,
|
|
190
|
+
self: true
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
exports.CMicroAppHost = CMicroAppHost;
|
|
@@ -9,7 +9,7 @@ exports.isStandAloneGuest = exports.isHost = exports.isGuest = exports.getMicroF
|
|
|
9
9
|
|
|
10
10
|
require("core-js/modules/es.string.replace.js");
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _merge2 = _interopRequireDefault(require("lodash/merge"));
|
|
13
13
|
|
|
14
14
|
var _guest = require("./guest.js");
|
|
15
15
|
|
|
@@ -60,13 +60,11 @@ const getMicroFrontEndAppConfig = appInfo => {
|
|
|
60
60
|
|
|
61
61
|
if (microFEAppConfig.production) delete microFEAppConfig.production;
|
|
62
62
|
if (microFEAppConfig.development) delete microFEAppConfig.development;
|
|
63
|
-
|
|
64
|
-
const microFEConfig = _lodash.default.merge(appInfo, {
|
|
63
|
+
const microFEConfig = (0, _merge2.default)(appInfo, {
|
|
65
64
|
mode: 'production',
|
|
66
65
|
hostUrl: './',
|
|
67
66
|
manifestPath: './{SYSTEM_VERSION}'
|
|
68
67
|
}, microFEAppConfig, envConfig);
|
|
69
|
-
|
|
70
68
|
microFEConfig.hostUrl = (0, _helpers.convertRelativeToAbsoluteUrl)(microFEConfig.hostUrl.replace(/\/?$/, '/'));
|
|
71
69
|
microFEConfig.manifestPath = getVersionedPath(microFEConfig.manifestPath);
|
|
72
70
|
return microFEConfig;
|
|
@@ -11,7 +11,8 @@ var _logRecords = require("./log-records.js");
|
|
|
11
11
|
|
|
12
12
|
var _index = require("./micro-frontend/index.js");
|
|
13
13
|
|
|
14
|
-
const initServiceWorker = (
|
|
14
|
+
const initServiceWorker = function () {
|
|
15
|
+
let swDest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
15
16
|
const logger = (0, _index.getLogger)() || console;
|
|
16
17
|
|
|
17
18
|
if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.trackActivity = exports.subscribeToSessionExpiryWarning = exports.subscribeToSessionExpiry = exports.subscribeToResetSession = exports.stopSessionMonitoring = exports.resetUserIdleTime = exports.initSessionMonitoring = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _throttle2 = _interopRequireDefault(require("lodash/throttle"));
|
|
9
11
|
|
|
10
12
|
var _config = require("./app-config/config.js");
|
|
11
13
|
|
|
@@ -31,13 +33,19 @@ const resetUserIdleTime = () => {
|
|
|
31
33
|
};
|
|
32
34
|
|
|
33
35
|
exports.resetUserIdleTime = resetUserIdleTime;
|
|
34
|
-
const throttledResetUserIdleTime = (0,
|
|
36
|
+
const throttledResetUserIdleTime = (0, _throttle2.default)(resetUserIdleTime, THROTTLING_TIME, {
|
|
35
37
|
leading: true
|
|
36
38
|
});
|
|
37
39
|
|
|
38
|
-
const isPastWarningTime =
|
|
40
|
+
const isPastWarningTime = function () {
|
|
41
|
+
let warnInterval = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutWarnInterval') || _constants.SESSION_TIMEOUT_INTERVAL.WARN;
|
|
42
|
+
return Date.now() - lastUserActivityTimeStamp > warnInterval;
|
|
43
|
+
};
|
|
39
44
|
|
|
40
|
-
const isPastSessionTimeoutTime =
|
|
45
|
+
const isPastSessionTimeoutTime = function () {
|
|
46
|
+
let sessionTimeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (0, _config.getAppConfigValue)('sessionTimeoutInterval') || _constants.SESSION_TIMEOUT_INTERVAL.EXPIRY;
|
|
47
|
+
return Date.now() - lastUserActivityTimeStamp > sessionTimeout;
|
|
48
|
+
};
|
|
41
49
|
|
|
42
50
|
const notifySessionExpiryWarning = () => {
|
|
43
51
|
sessionExpiryWarningNotified = true;
|
|
@@ -110,7 +118,7 @@ exports.subscribeToResetSession = subscribeToResetSession;
|
|
|
110
118
|
|
|
111
119
|
const trackActivity = (element, cb) => {
|
|
112
120
|
if (!element) return () => {};
|
|
113
|
-
const thorttledCb = (0,
|
|
121
|
+
const thorttledCb = (0, _throttle2.default)(cb, THROTTLING_TIME, {
|
|
114
122
|
leading: true
|
|
115
123
|
});
|
|
116
124
|
userInteractionEvents.forEach(r => element.addEventListener(r, thorttledCb));
|
|
@@ -7,14 +7,17 @@ exports.createTheme = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _create = require("@storybook/theming/create");
|
|
9
9
|
|
|
10
|
-
const createTheme =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const createTheme = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
base = 'light',
|
|
13
|
+
brandTitle = 'Platform UI Components',
|
|
14
|
+
...rest
|
|
15
|
+
} = _ref;
|
|
16
|
+
return (0, _create.create)({
|
|
17
|
+
base,
|
|
18
|
+
brandTitle: "".concat(brandTitle, " ").concat(process.env.STORYBOOK_VERSION || ''),
|
|
19
|
+
...rest
|
|
20
|
+
});
|
|
21
|
+
};
|
|
19
22
|
|
|
20
23
|
exports.createTheme = createTheme;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
8
|
+
|
|
3
9
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
10
|
|
|
5
11
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -37,15 +43,18 @@ var _history = require("../history.js");
|
|
|
37
43
|
const defaultStore = (0, _store.createAppStore)({}, _history.browserHistory);
|
|
38
44
|
const defaultTheme = (0, _puiTheme.getDefaultTheme)();
|
|
39
45
|
|
|
40
|
-
const AllTheProviders =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
const AllTheProviders = _ref => {
|
|
47
|
+
let {
|
|
48
|
+
store = defaultStore,
|
|
49
|
+
theme = defaultTheme,
|
|
50
|
+
children
|
|
51
|
+
} = _ref;
|
|
52
|
+
return /*#__PURE__*/(0, _jsx2.default)(_index.AppRoot, {
|
|
53
|
+
store: store,
|
|
54
|
+
history: _history.browserHistory,
|
|
55
|
+
theme: theme
|
|
56
|
+
}, void 0, children);
|
|
57
|
+
};
|
|
49
58
|
|
|
50
59
|
const customRender = (ui, options) => (0, _react.render)(ui, {
|
|
51
60
|
wrapper: AllTheProviders,
|
|
@@ -17,16 +17,19 @@ var _store = require("../../data/store.js");
|
|
|
17
17
|
|
|
18
18
|
var _history = require("../history.js");
|
|
19
19
|
|
|
20
|
-
const renderWithRedux = (ui
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
const renderWithRedux = function (ui) {
|
|
21
|
+
let {
|
|
22
|
+
initialState,
|
|
23
|
+
store = (0, _store.createAppStore)(initialState, _history.browserHistory)
|
|
24
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
|
+
return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
|
|
26
|
+
store: store
|
|
27
|
+
}, void 0, ui)),
|
|
28
|
+
// adding `store` to the returned utilities to allow us
|
|
29
|
+
// to reference it in our tests (just try to avoid using
|
|
30
|
+
// this to test implementation details).
|
|
31
|
+
store
|
|
32
|
+
};
|
|
33
|
+
};
|
|
31
34
|
|
|
32
35
|
exports.renderWithRedux = renderWithRedux;
|
|
@@ -21,22 +21,25 @@ var _store = require("../../data/store.js");
|
|
|
21
21
|
|
|
22
22
|
var _history2 = require("../history.js");
|
|
23
23
|
|
|
24
|
-
const renderWithRouterRedux = (ui
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
24
|
+
const renderWithRouterRedux = function (ui) {
|
|
25
|
+
let {
|
|
26
|
+
route = '/',
|
|
27
|
+
history = (0, _history.createMemoryHistory)({
|
|
28
|
+
initialEntries: [route]
|
|
29
|
+
}),
|
|
30
|
+
initialState,
|
|
31
|
+
store = (0, _store.createAppStore)(initialState, _history2.browserHistory)
|
|
32
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
33
|
+
return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRedux.Provider, {
|
|
34
|
+
store: store
|
|
35
|
+
}, void 0, /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
|
|
36
|
+
history: history
|
|
37
|
+
}, void 0, ui))),
|
|
38
|
+
// adding `store` to the returned utilities to allow us
|
|
39
|
+
// to reference it in our tests (just try to avoid using
|
|
40
|
+
// this to test implementation details).
|
|
41
|
+
store
|
|
42
|
+
};
|
|
43
|
+
};
|
|
41
44
|
|
|
42
45
|
exports.renderWithRouterRedux = renderWithRouterRedux;
|
|
@@ -15,18 +15,21 @@ var _reactRouterDom = require("react-router-dom");
|
|
|
15
15
|
|
|
16
16
|
var _history = require("history");
|
|
17
17
|
|
|
18
|
-
const renderWithRouter = (ui
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
const renderWithRouter = function (ui) {
|
|
19
|
+
let {
|
|
20
|
+
route = '/',
|
|
21
|
+
history = (0, _history.createMemoryHistory)({
|
|
22
|
+
initialEntries: [route]
|
|
23
|
+
})
|
|
24
|
+
} = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
|
+
return { ...(0, _react.render)( /*#__PURE__*/(0, _jsx2.default)(_reactRouterDom.Router, {
|
|
26
|
+
history: history
|
|
27
|
+
}, void 0, ui)),
|
|
28
|
+
// adding `history` to the returned utilities to allow us
|
|
29
|
+
// to reference it in our tests (just try to avoid using
|
|
30
|
+
// this to test implementation details).
|
|
31
|
+
history
|
|
32
|
+
};
|
|
33
|
+
};
|
|
31
34
|
|
|
32
35
|
exports.renderWithRouter = renderWithRouter;
|
|
@@ -11,6 +11,12 @@ var _jsx3 = _interopRequireDefault(require("@babel/runtime/helpers/jsx"));
|
|
|
11
11
|
|
|
12
12
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
13
|
|
|
14
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
15
|
+
|
|
16
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
17
|
+
|
|
18
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
19
|
+
|
|
14
20
|
var _react = require("react");
|
|
15
21
|
|
|
16
22
|
var _styledComponents = require("styled-components");
|
|
@@ -22,13 +28,14 @@ var _reduxInjectors = require("redux-injectors");
|
|
|
22
28
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
23
29
|
|
|
24
30
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
25
|
-
const RenderWithStateAddOns =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
const RenderWithStateAddOns = _ref => {
|
|
32
|
+
let {
|
|
33
|
+
Component,
|
|
34
|
+
reducer,
|
|
35
|
+
saga,
|
|
36
|
+
theme = (0, _puiTheme.getDefaultTheme)(),
|
|
37
|
+
...rest
|
|
38
|
+
} = _ref;
|
|
32
39
|
const [ready, setReady] = (0, _react.useState)(false);
|
|
33
40
|
|
|
34
41
|
if (Array.isArray(reducer)) {
|
|
@@ -7,6 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports.removeStorageEvents = exports.persistentStorage = exports.listenStorageEvents = void 0;
|
|
9
9
|
|
|
10
|
+
require("core-js/modules/esnext.async-iterator.for-each.js");
|
|
11
|
+
|
|
12
|
+
require("core-js/modules/esnext.iterator.constructor.js");
|
|
13
|
+
|
|
14
|
+
require("core-js/modules/esnext.iterator.for-each.js");
|
|
15
|
+
|
|
10
16
|
var _localforage = _interopRequireDefault(require("localforage"));
|
|
11
17
|
|
|
12
18
|
const STORAGE = 'storage';
|