@elliemae/pui-app-sdk 2.16.1 → 3.0.0-beta.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 +34 -30
- package/dist/cjs/analytics/index.js +32 -26
- package/dist/cjs/analytics/page-view-event.js +33 -29
- package/dist/cjs/analytics/user-session-event.js +34 -27
- package/dist/cjs/analytics/user-wait-event.js +31 -17
- package/dist/cjs/analytics/web-analytics.js +16 -19
- package/dist/cjs/api/auth/index.js +41 -39
- package/dist/cjs/api/helpers.js +33 -99
- package/dist/cjs/api/users/index.js +28 -16
- package/dist/cjs/communication/http-client/index.js +44 -48
- package/dist/cjs/communication/http-client/request-interceptor.js +28 -12
- package/dist/cjs/communication/http-client/response-interceptor.js +41 -38
- package/dist/cjs/communication/http-client/retry-axios.js +68 -122
- package/dist/cjs/communication/http-client/retry.js +42 -36
- package/dist/cjs/communication/http-client/tests/index.test-disable.js +48 -56
- package/dist/cjs/data/auth/actions.js +17 -26
- package/dist/cjs/data/auth/reducer.js +30 -18
- package/dist/cjs/data/breakpoint/index.js +38 -32
- package/dist/cjs/data/error/index.js +33 -18
- package/dist/cjs/data/live-message/index.js +34 -25
- package/dist/cjs/data/logout/actions.js +12 -9
- package/dist/cjs/data/navigation-prompt/actions.js +12 -9
- package/dist/cjs/data/react-redux.js +29 -13
- package/dist/cjs/data/reducers.js +35 -23
- package/dist/cjs/data/saga.js +12 -9
- package/dist/cjs/data/store.js +53 -60
- package/dist/cjs/data/wait-message/actions.js +14 -13
- package/dist/cjs/data/wait-message/reducer.js +32 -24
- package/dist/cjs/index.js +187 -800
- package/dist/cjs/route/index.js +37 -32
- package/dist/cjs/route/page-view.js +30 -22
- package/dist/cjs/route/private-route/index.js +52 -60
- package/dist/cjs/sideeffect/auth/index.js +42 -30
- package/dist/cjs/sideeffect/error-toast/index.js +39 -26
- package/dist/cjs/sideeffect/wait-message/index.js +45 -29
- package/dist/cjs/typings/custom.d.js +0 -1
- package/dist/cjs/typings/elliemae.d.js +0 -1
- package/dist/cjs/typings/styled.d.js +19 -3
- package/dist/cjs/utils/app-config/config.js +33 -33
- package/dist/cjs/utils/app-config/index.js +42 -44
- package/dist/cjs/utils/app-host-integration/react.js +27 -14
- package/dist/cjs/utils/auth/helper.js +30 -18
- package/dist/cjs/utils/auth/index.js +76 -116
- package/dist/cjs/utils/await.js +3 -0
- package/dist/cjs/utils/constants.js +22 -21
- package/dist/cjs/utils/font-size.js +13 -14
- package/dist/cjs/utils/guest-with-service.js +11 -12
- package/dist/cjs/utils/helpers.js +15 -19
- package/dist/cjs/utils/history.js +29 -12
- package/dist/cjs/utils/log-records.js +38 -35
- package/dist/cjs/utils/micro-frontend/console-logger.js +39 -23
- package/dist/cjs/utils/micro-frontend/guest.js +80 -128
- package/dist/cjs/utils/micro-frontend/host.js +84 -124
- package/dist/cjs/utils/micro-frontend/index.js +60 -61
- package/dist/cjs/utils/micro-frontend/types.js +3 -5
- package/dist/cjs/utils/redact-pii.js +15 -17
- package/dist/cjs/utils/service-worker.js +36 -21
- package/dist/cjs/utils/session.js +64 -70
- package/dist/cjs/utils/storybook/main.js +32 -25
- package/dist/cjs/utils/storybook/manager.js +31 -16
- package/dist/cjs/utils/storybook/middleware.js +3 -7
- package/dist/cjs/utils/storybook/preview.js +57 -48
- package/dist/cjs/utils/storybook/theme.js +30 -14
- package/dist/cjs/utils/storybook/vite.js +6 -0
- package/dist/cjs/utils/storybook/webpack.js +13 -0
- package/dist/cjs/utils/testing/index.js +38 -50
- package/dist/cjs/utils/testing/render-with-redux.js +34 -27
- package/dist/cjs/utils/testing/render-with-router-redux.js +40 -37
- package/dist/cjs/utils/testing/render-with-router.js +34 -28
- package/dist/cjs/utils/testing/render-with-state-addons.js +40 -36
- package/dist/cjs/utils/types.js +3 -0
- package/dist/cjs/utils/url.js +12 -13
- package/dist/cjs/utils/web-storage.js +40 -30
- package/dist/cjs/utils/window.js +36 -28
- package/dist/cjs/view/app-root/hosted-app.js +35 -32
- package/dist/cjs/view/app-root/index.js +57 -62
- package/dist/cjs/view/app-root/stand-alone-app.js +38 -37
- package/dist/cjs/view/app-root/style.js +50 -12
- package/dist/cjs/view/error-boundary/default-error-template.js +10 -15
- package/dist/cjs/view/error-boundary/index.js +41 -43
- package/dist/cjs/view/error-toast/index.js +42 -32
- package/dist/cjs/view/fetch-host-app-data/index.js +34 -26
- package/dist/cjs/view/fetch-host-app-data/store.js +31 -24
- package/dist/cjs/view/fields/check-box/index.js +34 -39
- package/dist/cjs/view/fields/combo-box/index.js +37 -31
- package/dist/cjs/view/fields/connect-form.js +30 -15
- package/dist/cjs/view/fields/date-input/index.js +34 -26
- package/dist/cjs/view/fields/date-picker/index.js +34 -26
- package/dist/cjs/view/fields/form-item-layout/index.js +36 -30
- package/dist/cjs/view/fields/input-mask/index.js +35 -41
- package/dist/cjs/view/fields/large-text-box/index.js +34 -26
- package/dist/cjs/view/fields/radio/index.js +34 -30
- package/dist/cjs/view/fields/radio-group/index.js +32 -27
- package/dist/cjs/view/fields/text-box/index.js +34 -26
- package/dist/cjs/view/fields/watch-value.js +41 -35
- package/dist/cjs/view/form/index.js +41 -34
- package/dist/cjs/view/form/personal-info-section.js +56 -80
- package/dist/cjs/view/form/submit-button/index.js +34 -23
- package/dist/cjs/view/guest-unload-handlers/index.js +33 -22
- package/dist/cjs/view/header/center-region/index.js +61 -38
- package/dist/cjs/view/header/index.js +41 -35
- package/dist/cjs/view/header/logo-region/index.js +31 -23
- package/dist/cjs/view/header/nav-region/index.js +44 -30
- package/dist/cjs/view/header/nav-region/notification/index.js +28 -18
- package/dist/cjs/view/header/nav-region/user/index.js +28 -18
- package/dist/cjs/view/host-binding-events/index.js +10 -11
- package/dist/cjs/view/intro.stories.mdx +1 -1
- package/dist/cjs/view/live-message/index.js +33 -34
- package/dist/cjs/view/loadable/index.js +33 -27
- package/dist/cjs/view/login/index.js +36 -30
- package/dist/cjs/view/media-breakpoint/index.js +43 -34
- package/dist/cjs/view/message-to-host-app/index.js +31 -20
- package/dist/cjs/view/micro-app/app-factory/index.js +98 -134
- package/dist/cjs/view/micro-app/const.js +10 -7
- package/dist/cjs/view/micro-app/index.js +37 -27
- package/dist/cjs/view/micro-app/resources/manifest.js +41 -34
- package/dist/cjs/view/micro-app/resources/script.js +56 -53
- package/dist/cjs/view/micro-app/resources/style.js +44 -38
- package/dist/cjs/view/micro-app/types.js +3 -5
- package/dist/cjs/view/micro-app/use-app-will-render.js +58 -50
- package/dist/cjs/view/micro-app/utils.js +32 -21
- package/dist/cjs/view/micro-iframe-app/app.js +37 -39
- package/dist/cjs/view/micro-iframe-app/iframe/const.js +10 -7
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +51 -47
- package/dist/cjs/view/micro-iframe-app/index.js +36 -24
- package/dist/cjs/view/micro-iframe-app/types.js +3 -5
- package/dist/cjs/view/micro-iframe-app/use-frame-loaded.js +40 -36
- package/dist/cjs/view/modals/error/index.js +35 -28
- package/dist/cjs/view/modals/navigation-prompt/index.js +38 -37
- package/dist/cjs/view/modals/session-expiry/customHooks.js +40 -35
- package/dist/cjs/view/modals/session-expiry/index.js +45 -50
- package/dist/cjs/view/modals/wait-message/html-wait-message.js +32 -18
- package/dist/cjs/view/modals/wait-message/index.js +50 -53
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +33 -21
- package/dist/cjs/view/render-with-delay/index.js +30 -19
- package/dist/cjs/view/render-with-host-data/index.js +35 -30
- package/dist/cjs/view/session-timeout/index.js +44 -35
- package/dist/cjs/view/storybook/decorator.js +32 -21
- package/dist/cjs/view/use-previous.js +29 -13
- package/dist/cjs/view/useMediaBreakpoints/index.js +34 -19
- package/dist/cjs/view/visually-hidden/index.js +41 -21
- package/dist/cjs/view/window-size/index.js +37 -29
- package/dist/es/analytics/appdynamics.js +14 -15
- package/dist/es/analytics/index.js +11 -17
- package/dist/es/analytics/page-view-event.js +11 -20
- package/dist/es/analytics/user-session-event.js +13 -15
- package/dist/es/analytics/user-wait-event.js +10 -6
- package/dist/es/analytics/web-analytics.js +12 -10
- package/dist/es/api/auth/index.js +22 -27
- package/dist/es/api/helpers.js +8 -81
- package/dist/es/api/users/index.js +7 -8
- package/dist/es/communication/http-client/index.js +24 -30
- package/dist/es/communication/http-client/request-interceptor.js +6 -3
- package/dist/es/communication/http-client/response-interceptor.js +20 -21
- package/dist/es/communication/http-client/retry-axios.js +45 -105
- package/dist/es/communication/http-client/retry.js +22 -25
- package/dist/es/communication/http-client/tests/index.test-disable.js +28 -47
- package/dist/es/data/auth/actions.js +13 -19
- package/dist/es/data/auth/reducer.js +9 -7
- package/dist/es/data/breakpoint/index.js +19 -21
- package/dist/es/data/error/index.js +11 -9
- package/dist/es/data/live-message/index.js +12 -16
- package/dist/es/data/logout/actions.js +9 -5
- package/dist/es/data/navigation-prompt/actions.js +9 -5
- package/dist/es/data/react-redux.js +7 -3
- package/dist/es/data/reducers.js +10 -7
- package/dist/es/data/saga.js +8 -5
- package/dist/es/data/store.js +27 -44
- package/dist/es/data/wait-message/actions.js +11 -9
- package/dist/es/data/wait-message/reducer.js +10 -10
- package/dist/es/index.js +181 -83
- package/dist/es/route/index.js +16 -19
- package/dist/es/route/page-view.js +9 -9
- package/dist/es/route/private-route/index.js +30 -38
- package/dist/es/sideeffect/auth/index.js +27 -14
- package/dist/es/sideeffect/error-toast/index.js +15 -14
- package/dist/es/sideeffect/wait-message/index.js +18 -14
- package/dist/es/typings/styled.d.js +1 -1
- package/dist/es/utils/app-config/config.js +11 -9
- package/dist/es/utils/app-config/index.js +21 -31
- package/dist/es/utils/app-host-integration/react.js +8 -6
- package/dist/es/utils/auth/helper.js +8 -4
- package/dist/es/utils/auth/index.js +59 -83
- package/dist/es/utils/constants.js +18 -13
- package/dist/es/utils/font-size.js +7 -3
- package/dist/es/utils/guest-with-service.js +6 -7
- package/dist/es/utils/helpers.js +10 -6
- package/dist/es/utils/history.js +7 -3
- package/dist/es/utils/log-records.js +34 -31
- package/dist/es/utils/micro-frontend/console-logger.js +17 -13
- package/dist/es/utils/micro-frontend/guest.js +52 -108
- package/dist/es/utils/micro-frontend/host.js +53 -89
- package/dist/es/utils/micro-frontend/index.js +39 -37
- package/dist/es/utils/micro-frontend/types.js +0 -1
- package/dist/es/utils/redact-pii.js +10 -11
- package/dist/es/utils/service-worker.js +14 -11
- package/dist/es/utils/session.js +47 -48
- package/dist/es/utils/storybook/manager.js +8 -5
- package/dist/es/utils/storybook/preview.js +30 -26
- package/dist/es/utils/storybook/theme.js +9 -6
- package/dist/es/utils/testing/index.js +14 -21
- package/dist/es/utils/testing/render-with-redux.js +13 -13
- package/dist/es/utils/testing/render-with-router-redux.js +19 -21
- package/dist/es/utils/testing/render-with-router.js +14 -16
- package/dist/es/utils/testing/render-with-state-addons.js +18 -18
- package/dist/es/utils/url.js +7 -3
- package/dist/es/utils/web-storage.js +21 -17
- package/dist/es/utils/window.js +18 -18
- package/dist/es/view/app-root/hosted-app.js +13 -17
- package/dist/es/view/app-root/index.js +34 -39
- package/dist/es/view/app-root/stand-alone-app.js +17 -19
- package/dist/es/view/app-root/style.js +30 -5
- package/dist/es/view/error-boundary/default-error-template.js +4 -5
- package/dist/es/view/error-boundary/index.js +20 -27
- package/dist/es/view/error-toast/index.js +21 -16
- package/dist/es/view/fetch-host-app-data/index.js +13 -13
- package/dist/es/view/fetch-host-app-data/store.js +10 -7
- package/dist/es/view/fields/check-box/index.js +16 -18
- package/dist/es/view/fields/combo-box/index.js +19 -19
- package/dist/es/view/fields/connect-form.js +8 -6
- package/dist/es/view/fields/date-input/index.js +16 -14
- package/dist/es/view/fields/date-picker/index.js +16 -14
- package/dist/es/view/fields/form-item-layout/index.js +15 -16
- package/dist/es/view/fields/input-mask/index.js +20 -14
- package/dist/es/view/fields/large-text-box/index.js +16 -14
- package/dist/es/view/fields/radio/index.js +16 -18
- package/dist/es/view/fields/radio-group/index.js +14 -15
- package/dist/es/view/fields/text-box/index.js +16 -14
- package/dist/es/view/fields/watch-value.js +19 -24
- package/dist/es/view/form/index.js +22 -22
- package/dist/es/view/form/personal-info-section.js +31 -52
- package/dist/es/view/form/submit-button/index.js +12 -10
- package/dist/es/view/guest-unload-handlers/index.js +11 -10
- package/dist/es/view/header/center-region/index.js +40 -23
- package/dist/es/view/header/index.js +19 -19
- package/dist/es/view/header/logo-region/index.js +8 -9
- package/dist/es/view/header/nav-region/index.js +22 -15
- package/dist/es/view/header/nav-region/notification/index.js +5 -6
- package/dist/es/view/header/nav-region/user/index.js +5 -6
- package/dist/es/view/host-binding-events/index.js +7 -3
- package/dist/es/view/intro.stories.mdx +1 -1
- package/dist/es/view/live-message/index.js +13 -23
- package/dist/es/view/loadable/index.js +12 -15
- package/dist/es/view/login/index.js +14 -18
- package/dist/es/view/media-breakpoint/index.js +19 -17
- package/dist/es/view/message-to-host-app/index.js +11 -10
- package/dist/es/view/micro-app/app-factory/index.js +67 -86
- package/dist/es/view/micro-app/const.js +4 -1
- package/dist/es/view/micro-app/index.js +13 -11
- package/dist/es/view/micro-app/resources/manifest.js +19 -19
- package/dist/es/view/micro-app/resources/script.js +36 -36
- package/dist/es/view/micro-app/resources/style.js +23 -22
- package/dist/es/view/micro-app/types.js +0 -1
- package/dist/es/view/micro-app/use-app-will-render.js +32 -28
- package/dist/es/view/micro-app/utils.js +12 -14
- package/dist/es/view/micro-iframe-app/app.js +15 -22
- package/dist/es/view/micro-iframe-app/iframe/const.js +4 -1
- package/dist/es/view/micro-iframe-app/iframe/index.js +27 -32
- package/dist/es/view/micro-iframe-app/index.js +11 -12
- package/dist/es/view/micro-iframe-app/types.js +0 -1
- package/dist/es/view/micro-iframe-app/use-frame-loaded.js +16 -21
- package/dist/es/view/modals/error/index.js +12 -10
- package/dist/es/view/modals/navigation-prompt/index.js +12 -16
- package/dist/es/view/modals/session-expiry/customHooks.js +13 -15
- package/dist/es/view/modals/session-expiry/index.js +16 -24
- package/dist/es/view/modals/wait-message/html-wait-message.js +10 -10
- package/dist/es/view/modals/wait-message/index.js +31 -39
- package/dist/es/view/modals/wait-message/wait-message-launcher.js +9 -8
- package/dist/es/view/render-with-delay/index.js +7 -10
- package/dist/es/view/render-with-host-data/index.js +11 -15
- package/dist/es/view/session-timeout/index.js +21 -12
- package/dist/es/view/storybook/decorator.js +9 -7
- package/dist/es/view/use-previous.js +6 -3
- package/dist/es/view/useMediaBreakpoints/index.js +11 -9
- package/dist/es/view/visually-hidden/index.js +19 -10
- package/dist/es/view/window-size/index.js +16 -19
- package/dist/types/utils/storybook/main.d.cts +41 -0
- package/dist/types/utils/storybook/{middleware.d.ts → middleware.d.cts} +0 -0
- package/dist/types/utils/storybook/preview.d.ts +2 -2
- package/dist/types/utils/storybook/vite.d.cts +4 -0
- package/dist/types/utils/storybook/webpack.d.cts +8 -0
- package/dist/types/utils/window.d.ts +1 -1
- package/dist/types/view/visually-hidden/index.d.ts +1 -3
- package/package.json +7 -5
- package/dist/cjs/api/users/index.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/cjs/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/cjs/view/error-toast/index.stories.js +0 -128
- package/dist/cjs/view/fields/check-box/index.stories.js +0 -64
- package/dist/cjs/view/fields/check-box/set-value.stories.js +0 -83
- package/dist/cjs/view/fields/combo-box/index.stories.js +0 -65
- package/dist/cjs/view/fields/date-input/index.stories.js +0 -53
- package/dist/cjs/view/fields/date-input/index1.stories.js +0 -53
- package/dist/cjs/view/fields/date-picker/index.stories.js +0 -53
- package/dist/cjs/view/fields/form-item-layout/index.stories.js +0 -43
- package/dist/cjs/view/fields/input-mask/index.stories.js +0 -52
- package/dist/cjs/view/fields/large-text-box/index.stories.js +0 -47
- package/dist/cjs/view/fields/radio/index.stories.js +0 -60
- package/dist/cjs/view/fields/radio/set-value.stories.js +0 -81
- package/dist/cjs/view/fields/radio-group/index.stories.js +0 -85
- package/dist/cjs/view/fields/text-box/index.stories.js +0 -48
- package/dist/cjs/view/form/index.stories.js +0 -71
- package/dist/cjs/view/form/usecases.stories.js +0 -59
- package/dist/cjs/view/header/index.stories.js +0 -24
- package/dist/cjs/view/live-message/index.stories.js +0 -53
- package/dist/cjs/view/media-breakpoint/index.stories.js +0 -24
- package/dist/cjs/view/modals/error/index.stories.js +0 -36
- package/dist/cjs/view/modals/navigation-prompt/index.stories.js +0 -32
- package/dist/cjs/view/modals/session-expiry/index.stories.js +0 -30
- package/dist/cjs/view/modals/wait-message/index.stories.js +0 -47
- package/dist/cjs/view/session-timeout/index.stories.js +0 -28
- package/dist/es/api/users/index.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/hello.endpoint.js +0 -14
- package/dist/es/communication/http-client/tests/private.endpoint.js +0 -14
- package/dist/es/utils/storybook/main.js +0 -38
- package/dist/es/utils/storybook/middleware.js +0 -9
- package/dist/es/view/error-toast/index.stories.js +0 -108
- package/dist/es/view/fields/check-box/index.stories.js +0 -47
- package/dist/es/view/fields/check-box/set-value.stories.js +0 -65
- package/dist/es/view/fields/combo-box/index.stories.js +0 -48
- package/dist/es/view/fields/date-input/index.stories.js +0 -35
- package/dist/es/view/fields/date-input/index1.stories.js +0 -35
- package/dist/es/view/fields/date-picker/index.stories.js +0 -35
- package/dist/es/view/fields/form-item-layout/index.stories.js +0 -27
- package/dist/es/view/fields/input-mask/index.stories.js +0 -35
- package/dist/es/view/fields/large-text-box/index.stories.js +0 -30
- package/dist/es/view/fields/radio/index.stories.js +0 -43
- package/dist/es/view/fields/radio/set-value.stories.js +0 -63
- package/dist/es/view/fields/radio-group/index.stories.js +0 -68
- package/dist/es/view/fields/text-box/index.stories.js +0 -31
- package/dist/es/view/form/index.stories.js +0 -56
- package/dist/es/view/form/usecases.stories.js +0 -43
- package/dist/es/view/header/index.stories.js +0 -14
- package/dist/es/view/live-message/index.stories.js +0 -32
- package/dist/es/view/media-breakpoint/index.stories.js +0 -10
- package/dist/es/view/modals/error/index.stories.js +0 -21
- package/dist/es/view/modals/navigation-prompt/index.stories.js +0 -18
- package/dist/es/view/modals/session-expiry/index.stories.js +0 -18
- package/dist/es/view/modals/wait-message/index.stories.js +0 -33
- package/dist/es/view/session-timeout/index.stories.js +0 -13
- package/dist/types/utils/storybook/main.d.ts +0 -30
- package/dist/types/view/fields/date-input/index1.stories.d.ts +0 -24
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
import { logger as uiLogger, Console } from
|
|
2
|
-
import { getAppConfigValue } from "../app-config/config
|
|
3
|
-
|
|
4
|
-
if (!uiLogger)
|
|
1
|
+
import { logger as uiLogger, Console } from "@elliemae/pui-diagnostics";
|
|
2
|
+
import { getAppConfigValue } from "../app-config/config";
|
|
3
|
+
const logger = (() => {
|
|
4
|
+
if (!uiLogger)
|
|
5
|
+
return console;
|
|
5
6
|
return uiLogger({
|
|
6
7
|
transport: Console(),
|
|
7
|
-
index:
|
|
8
|
-
environment: getAppConfigValue(
|
|
9
|
-
logger:
|
|
10
|
-
team:
|
|
11
|
-
appName:
|
|
12
|
-
appVersion:
|
|
13
|
-
tenantId:
|
|
14
|
-
userId:
|
|
8
|
+
index: "app",
|
|
9
|
+
environment: getAppConfigValue("activeEnv"),
|
|
10
|
+
logger: "icemt.app.logger",
|
|
11
|
+
team: "app team",
|
|
12
|
+
appName: "ICEMT App",
|
|
13
|
+
appVersion: "latest",
|
|
14
|
+
tenantId: "",
|
|
15
|
+
userId: ""
|
|
15
16
|
});
|
|
16
|
-
})();
|
|
17
|
+
})();
|
|
18
|
+
export {
|
|
19
|
+
logger
|
|
20
|
+
};
|
|
@@ -1,194 +1,138 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { setAppDynamicsUserData } from "../../analytics/appdynamics.js";
|
|
14
|
-
|
|
1
|
+
import ReactDOM from "react-dom";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import ssfGuest from "@elliemae/em-ssf-guest";
|
|
4
|
+
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
5
|
+
import { getWindow } from "../window";
|
|
6
|
+
import { loadAppConfig } from "../app-config";
|
|
7
|
+
import { getAppConfigValue } from "../app-config/config";
|
|
8
|
+
import { browserHistory } from "../history";
|
|
9
|
+
import { logger } from "./console-logger";
|
|
10
|
+
import { removeStorageEvents } from "../web-storage";
|
|
11
|
+
import { updateBAEventParameters } from "../../analytics/web-analytics";
|
|
12
|
+
import { setAppDynamicsUserData } from "../../analytics/appdynamics";
|
|
15
13
|
const isCrossDomain = () => {
|
|
16
14
|
try {
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
|
|
18
15
|
window.parent.document;
|
|
19
16
|
return false;
|
|
20
17
|
} catch (ex) {
|
|
21
18
|
return true;
|
|
22
19
|
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export class CMicroAppGuest {
|
|
20
|
+
};
|
|
21
|
+
class CMicroAppGuest {
|
|
27
22
|
constructor(params) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "logger", void 0);
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "appId", void 0);
|
|
33
|
-
|
|
34
|
-
_defineProperty(this, "props", void 0);
|
|
35
|
-
|
|
36
|
-
_defineProperty(this, "containerId", void 0);
|
|
37
|
-
|
|
38
|
-
_defineProperty(this, "onInit", void 0);
|
|
39
|
-
|
|
40
|
-
_defineProperty(this, "onMount", void 0);
|
|
41
|
-
|
|
42
|
-
_defineProperty(this, "onUnmount", void 0);
|
|
43
|
-
|
|
44
|
-
_defineProperty(this, "onGetRef", void 0);
|
|
45
|
-
|
|
46
|
-
this.containerId = 'app-container';
|
|
47
|
-
this.appId = ((_window$emui = window.emui) === null || _window$emui === void 0 ? void 0 : _window$emui.appId) || getAppConfigValue('appId');
|
|
23
|
+
this.containerId = "app-container";
|
|
24
|
+
this.appId = window.emui?.appId || getAppConfigValue("appId");
|
|
48
25
|
this.props = {
|
|
49
26
|
host: null,
|
|
50
27
|
hostUrl: null,
|
|
51
28
|
prevState: null,
|
|
52
29
|
history: browserHistory,
|
|
53
30
|
theme: getDefaultTheme(),
|
|
54
|
-
manifestPath:
|
|
31
|
+
manifestPath: "./latest"
|
|
55
32
|
};
|
|
56
|
-
this.logger =
|
|
57
|
-
this.onInit = params
|
|
58
|
-
this.onMount = params
|
|
59
|
-
this.onUnmount = params
|
|
60
|
-
this.onGetRef = params
|
|
33
|
+
this.logger = params?.logger || logger;
|
|
34
|
+
this.onInit = params?.onInit;
|
|
35
|
+
this.onMount = params?.onMount;
|
|
36
|
+
this.onUnmount = params?.onUnmount;
|
|
37
|
+
this.onGetRef = params?.onGetRef;
|
|
61
38
|
this.getHost = this.getHost.bind(this);
|
|
62
39
|
this.getLogger = this.getLogger.bind(this);
|
|
63
40
|
this.getProps = this.getProps.bind(this);
|
|
64
41
|
const browserWindow = getWindow();
|
|
65
|
-
|
|
66
42
|
if (browserWindow) {
|
|
67
43
|
browserWindow.emui = browserWindow.emui || {};
|
|
68
|
-
browserWindow.emui[this.appId] = browserWindow.emui[this.appId] || {};
|
|
69
|
-
|
|
44
|
+
browserWindow.emui[this.appId] = browserWindow.emui[this.appId] || {};
|
|
70
45
|
browserWindow.emui[this.appId].init = this.init.bind(this);
|
|
71
46
|
browserWindow.emui[this.appId].mount = this.mount.bind(this);
|
|
72
47
|
browserWindow.emui[this.appId].unmount = this.unmount.bind(this);
|
|
73
48
|
browserWindow.emui[this.appId].getRef = this.getRef.bind(this);
|
|
74
49
|
}
|
|
75
50
|
}
|
|
76
|
-
|
|
77
51
|
static getInstance(params) {
|
|
78
52
|
if (!this.instance) {
|
|
79
53
|
this.instance = new this(params);
|
|
80
54
|
}
|
|
81
|
-
|
|
82
55
|
return this.instance;
|
|
83
56
|
}
|
|
84
|
-
|
|
85
57
|
static isInitialized() {
|
|
86
58
|
return !!this.instance;
|
|
87
59
|
}
|
|
88
|
-
|
|
89
60
|
static isHosted() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return !!((_this$instance = this.instance) !== null && _this$instance !== void 0 && (_this$instance$props = _this$instance.props) !== null && _this$instance$props !== void 0 && _this$instance$props.host);
|
|
61
|
+
return !!this.instance?.props?.host;
|
|
93
62
|
}
|
|
94
|
-
|
|
95
63
|
getHost() {
|
|
96
64
|
return this.props.host;
|
|
97
65
|
}
|
|
98
|
-
|
|
99
66
|
getLogger() {
|
|
100
67
|
return this.logger;
|
|
101
68
|
}
|
|
102
|
-
|
|
103
69
|
getProps() {
|
|
104
70
|
return this.props;
|
|
105
71
|
}
|
|
106
|
-
|
|
107
72
|
getSessionStorageItem(key) {
|
|
108
|
-
var _this$props$host;
|
|
109
|
-
|
|
110
73
|
let value = sessionStorage.getItem(key);
|
|
111
|
-
|
|
112
|
-
if (!value && (_this$props$host = this.props.host) !== null && _this$props$host !== void 0 && _this$props$host.getItem) {
|
|
74
|
+
if (!value && this.props.host?.getItem) {
|
|
113
75
|
value = this.props.host.getItem(key);
|
|
114
76
|
}
|
|
115
|
-
|
|
116
77
|
return value;
|
|
117
78
|
}
|
|
118
|
-
|
|
119
79
|
async getSSFHost() {
|
|
120
80
|
let host = null;
|
|
121
|
-
|
|
122
81
|
if (window.parent !== window) {
|
|
123
|
-
// not a standalone app
|
|
124
82
|
if (!isCrossDomain()) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
host = ((_window$parent = window.parent) === null || _window$parent === void 0 ? void 0 : (_window$parent$emui = _window$parent.emui) === null || _window$parent$emui === void 0 ? void 0 : _window$parent$emui.MicroAppHost) || null;
|
|
83
|
+
host = window.parent?.emui?.MicroAppHost || null;
|
|
128
84
|
} else if (ssfGuest && this.props.hostName) {
|
|
129
85
|
ssfGuest.connect();
|
|
130
|
-
const timeout = new Promise(resolve => {
|
|
86
|
+
const timeout = new Promise((resolve) => {
|
|
131
87
|
setTimeout(resolve, 100, null);
|
|
132
88
|
});
|
|
133
|
-
host = await Promise.race([
|
|
89
|
+
host = await Promise.race([
|
|
90
|
+
ssfGuest.getObject(this.props.hostName),
|
|
91
|
+
timeout
|
|
92
|
+
]);
|
|
134
93
|
}
|
|
135
94
|
}
|
|
136
|
-
|
|
137
95
|
return host;
|
|
138
96
|
}
|
|
139
|
-
|
|
140
97
|
async init(options) {
|
|
141
|
-
this.props =
|
|
142
|
-
|
|
98
|
+
this.props = _.merge(this.props, options);
|
|
143
99
|
if (!this.props.host) {
|
|
144
100
|
const host = await this.getSSFHost();
|
|
145
|
-
if (host)
|
|
101
|
+
if (host)
|
|
102
|
+
this.props.host = host;
|
|
146
103
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
__webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, '/');
|
|
104
|
+
__webpack_public_path__ = __webpack_public_path__.replace(/\/?$/, "/");
|
|
151
105
|
return loadAppConfig(__webpack_public_path__).then(() => {
|
|
152
|
-
const instanceId = this.getSessionStorageItem(
|
|
153
|
-
const userId = this.getSessionStorageItem(
|
|
154
|
-
updateBAEventParameters({
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
});
|
|
159
|
-
setAppDynamicsUserData({
|
|
160
|
-
appId: this.appId,
|
|
161
|
-
instanceId,
|
|
162
|
-
userId
|
|
163
|
-
});
|
|
164
|
-
if (this.onInit) this.onInit(this.props);
|
|
106
|
+
const instanceId = this.getSessionStorageItem("instanceId") || "";
|
|
107
|
+
const userId = this.getSessionStorageItem("userId") || "";
|
|
108
|
+
updateBAEventParameters({ appId: this.appId, instanceId, userId });
|
|
109
|
+
setAppDynamicsUserData({ appId: this.appId, instanceId, userId });
|
|
110
|
+
if (this.onInit)
|
|
111
|
+
this.onInit(this.props);
|
|
165
112
|
});
|
|
166
113
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
containerId: 'app-container'
|
|
170
|
-
}) {
|
|
171
|
-
this.containerId = options === null || options === void 0 ? void 0 : options.containerId;
|
|
114
|
+
mount(options = { containerId: "app-container" }) {
|
|
115
|
+
this.containerId = options?.containerId;
|
|
172
116
|
return Promise.resolve().then(() => {
|
|
173
|
-
if (this.onMount)
|
|
117
|
+
if (this.onMount)
|
|
118
|
+
this.onMount(options);
|
|
174
119
|
});
|
|
175
120
|
}
|
|
176
|
-
|
|
177
121
|
unmount(options) {
|
|
178
122
|
const appEle = document.getElementById(this.containerId);
|
|
179
|
-
if (appEle)
|
|
123
|
+
if (appEle)
|
|
124
|
+
ReactDOM.unmountComponentAtNode(appEle);
|
|
180
125
|
removeStorageEvents();
|
|
181
126
|
return Promise.resolve().then(() => this.onUnmount ? this.onUnmount(options) : null);
|
|
182
127
|
}
|
|
183
|
-
|
|
184
128
|
getRef() {
|
|
185
129
|
return this.onGetRef ? this.onGetRef() : null;
|
|
186
130
|
}
|
|
187
|
-
|
|
188
131
|
navigate(url, state) {
|
|
189
|
-
if (url)
|
|
132
|
+
if (url)
|
|
133
|
+
this.props.history.push(url, state);
|
|
190
134
|
}
|
|
191
|
-
|
|
192
135
|
}
|
|
193
|
-
|
|
194
|
-
|
|
136
|
+
export {
|
|
137
|
+
CMicroAppGuest
|
|
138
|
+
};
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { publish, subscribe, unsubscribe } from "pubsub-js";
|
|
2
|
+
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
3
|
+
import { getStore } from "../../data/store";
|
|
4
|
+
import { waitMessage } from "../../data/wait-message/actions";
|
|
5
|
+
import { actions as error } from "../../data/error";
|
|
6
|
+
import { logout } from "../../data/logout/actions";
|
|
7
|
+
import { getAppConfigValue } from "../app-config/config";
|
|
8
|
+
import { resetUserIdleTime } from "../session";
|
|
9
|
+
import { loadAppConfig } from "../app-config";
|
|
10
|
+
import { browserHistory } from "../history";
|
|
11
|
+
import { logger } from "./console-logger";
|
|
12
|
+
import {
|
|
13
|
+
HOST_WINDOW_RESIZED,
|
|
14
|
+
HOST_WINDOW_BREAKPOINT_CHANGED
|
|
15
|
+
} from "../constants";
|
|
16
|
+
import {
|
|
17
|
+
getCurrentBreakpoint,
|
|
18
|
+
getViewportSize as getWindowViewportSize
|
|
19
|
+
} from "../window";
|
|
20
|
+
import { sendBAEvent } from "../../analytics";
|
|
21
|
+
import { setAppDynamicsUserData } from "../../analytics/appdynamics";
|
|
22
|
+
import { updateBAEventParameters } from "../../analytics/web-analytics";
|
|
23
|
+
class CMicroAppHost {
|
|
19
24
|
constructor(params) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
_defineProperty(this, "props", void 0);
|
|
25
|
-
|
|
26
|
-
_defineProperty(this, "activeGuests", void 0);
|
|
27
|
-
|
|
28
|
-
_defineProperty(this, "onInit", void 0);
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "onRenewSessionTimer", void 0);
|
|
31
|
-
|
|
32
|
-
this.appId = getAppConfigValue('appId');
|
|
33
|
-
this.onInit = params === null || params === void 0 ? void 0 : params.onInit;
|
|
34
|
-
this.logger = (params === null || params === void 0 ? void 0 : params.logger) || logger;
|
|
35
|
-
this.onRenewSessionTimer = params === null || params === void 0 ? void 0 : params.onRenewSessionTimer;
|
|
25
|
+
this.appId = getAppConfigValue("appId");
|
|
26
|
+
this.onInit = params?.onInit;
|
|
27
|
+
this.logger = params?.logger || logger;
|
|
28
|
+
this.onRenewSessionTimer = params?.onRenewSessionTimer;
|
|
36
29
|
this.props = {
|
|
37
|
-
systemVersion:
|
|
30
|
+
systemVersion: "latest",
|
|
38
31
|
history: browserHistory,
|
|
39
32
|
theme: getDefaultTheme()
|
|
40
33
|
};
|
|
@@ -45,136 +38,107 @@ export class CMicroAppHost {
|
|
|
45
38
|
this.getGuest = this.getGuest.bind(this);
|
|
46
39
|
this.renewSessionTimer = this.renewSessionTimer.bind(this);
|
|
47
40
|
this.setSystemVersion = this.setSystemVersion.bind(this);
|
|
48
|
-
/* eslint-disable camelcase, no-undef */
|
|
49
|
-
|
|
50
41
|
loadAppConfig(__webpack_public_path__).then(() => {
|
|
51
|
-
if (this.onInit)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
appId: this.appId
|
|
42
|
+
if (this.onInit)
|
|
43
|
+
this.onInit(this.props);
|
|
44
|
+
}).catch(() => {
|
|
55
45
|
});
|
|
46
|
+
updateBAEventParameters({ appId: this.appId });
|
|
56
47
|
setAppDynamicsUserData({
|
|
57
48
|
appId: this.appId
|
|
58
49
|
});
|
|
59
50
|
}
|
|
60
|
-
|
|
61
51
|
static getInstance(params) {
|
|
62
52
|
if (!this.instance) {
|
|
63
53
|
this.instance = new this(params);
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
return this.instance;
|
|
67
56
|
}
|
|
68
|
-
|
|
69
57
|
static isInitialized() {
|
|
70
58
|
return !!this.instance;
|
|
71
59
|
}
|
|
72
|
-
|
|
73
60
|
getProps() {
|
|
74
61
|
return this.props;
|
|
75
62
|
}
|
|
76
|
-
|
|
77
63
|
getLogger() {
|
|
78
64
|
return this.logger;
|
|
79
65
|
}
|
|
80
|
-
|
|
81
66
|
getItem(key) {
|
|
82
67
|
return window.parent.sessionStorage.getItem(key);
|
|
83
68
|
}
|
|
84
|
-
|
|
85
69
|
setItem(key, value) {
|
|
86
70
|
window.parent.sessionStorage.setItem(key, value);
|
|
87
71
|
}
|
|
88
|
-
|
|
89
72
|
getGuests() {
|
|
90
73
|
return this.activeGuests;
|
|
91
74
|
}
|
|
92
|
-
|
|
93
75
|
getGuest(id) {
|
|
94
76
|
return this.activeGuests[id] ? this.activeGuests[id] : null;
|
|
95
77
|
}
|
|
96
|
-
|
|
97
78
|
publish(message, data) {
|
|
98
79
|
return publish(message, data);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
}
|
|
102
81
|
subscribe(message, func) {
|
|
103
82
|
return subscribe(message, func);
|
|
104
83
|
}
|
|
105
|
-
|
|
106
84
|
unsubscribe(token) {
|
|
107
85
|
unsubscribe(token);
|
|
108
86
|
}
|
|
109
|
-
|
|
110
87
|
navigate(url, state) {
|
|
111
|
-
if (url)
|
|
88
|
+
if (url)
|
|
89
|
+
this.props.history.push(url, state);
|
|
112
90
|
}
|
|
113
|
-
|
|
114
91
|
openWaitMessage() {
|
|
115
92
|
const store = getStore();
|
|
116
|
-
if (store)
|
|
93
|
+
if (store)
|
|
94
|
+
store.dispatch(waitMessage.open());
|
|
117
95
|
}
|
|
118
|
-
|
|
119
96
|
closeWaitMessage() {
|
|
120
97
|
const store = getStore();
|
|
121
|
-
if (store)
|
|
98
|
+
if (store)
|
|
99
|
+
store.dispatch(waitMessage.close());
|
|
122
100
|
}
|
|
123
|
-
|
|
124
101
|
openErrorBanner(message) {
|
|
125
102
|
const store = getStore();
|
|
126
|
-
if (store)
|
|
127
|
-
description: message
|
|
128
|
-
}));
|
|
103
|
+
if (store)
|
|
104
|
+
store.dispatch(error.set({ description: message }));
|
|
129
105
|
}
|
|
130
|
-
|
|
131
106
|
getAuthToken() {
|
|
132
|
-
return window.parent.sessionStorage.getItem(
|
|
107
|
+
return window.parent.sessionStorage.getItem("Authorization");
|
|
133
108
|
}
|
|
134
|
-
|
|
135
109
|
renewAuthToken() {
|
|
136
|
-
return window.parent.sessionStorage.getItem(
|
|
110
|
+
return window.parent.sessionStorage.getItem("Authorization");
|
|
137
111
|
}
|
|
138
|
-
|
|
139
112
|
logout() {
|
|
140
113
|
const store = getStore();
|
|
141
|
-
if (store)
|
|
114
|
+
if (store)
|
|
115
|
+
store.dispatch(logout.confirm());
|
|
142
116
|
}
|
|
143
|
-
|
|
144
117
|
renewSessionTimer() {
|
|
145
118
|
resetUserIdleTime();
|
|
146
|
-
if (this.onRenewSessionTimer)
|
|
119
|
+
if (this.onRenewSessionTimer)
|
|
120
|
+
this.onRenewSessionTimer();
|
|
147
121
|
}
|
|
148
|
-
|
|
149
122
|
getBreakpoint() {
|
|
150
123
|
return getCurrentBreakpoint();
|
|
151
124
|
}
|
|
152
|
-
|
|
153
125
|
getViewportSize() {
|
|
154
126
|
return getWindowViewportSize();
|
|
155
127
|
}
|
|
156
|
-
|
|
157
128
|
onResizeEvent(eventHandler) {
|
|
158
129
|
return subscribe(HOST_WINDOW_RESIZED, (msg, data) => eventHandler(data));
|
|
159
130
|
}
|
|
160
|
-
|
|
161
131
|
onBreakpointChangeEvent(eventHandler) {
|
|
162
132
|
return subscribe(HOST_WINDOW_BREAKPOINT_CHANGED, (msg, data) => eventHandler(data));
|
|
163
133
|
}
|
|
164
|
-
|
|
165
|
-
setSystemVersion(version = 'latest') {
|
|
134
|
+
setSystemVersion(version = "latest") {
|
|
166
135
|
window.emui.version = version;
|
|
167
136
|
this.props.systemVersion = version;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
|
|
137
|
+
}
|
|
171
138
|
sendBAEvent(data) {
|
|
172
|
-
sendBAEvent({
|
|
173
|
-
data,
|
|
174
|
-
self: true
|
|
175
|
-
});
|
|
139
|
+
sendBAEvent({ data, self: true });
|
|
176
140
|
}
|
|
177
|
-
|
|
178
141
|
}
|
|
179
|
-
|
|
180
|
-
|
|
142
|
+
export {
|
|
143
|
+
CMicroAppHost
|
|
144
|
+
};
|
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { CMicroAppGuest } from "./guest
|
|
3
|
-
import { CMicroAppHost } from "./host
|
|
4
|
-
import { getAppConfigValue } from "../app-config/config
|
|
5
|
-
import { convertRelativeToAbsoluteUrl, isCIBuild } from "../helpers
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (mode)
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { CMicroAppGuest } from "./guest";
|
|
3
|
+
import { CMicroAppHost } from "./host";
|
|
4
|
+
import { getAppConfigValue } from "../app-config/config";
|
|
5
|
+
import { convertRelativeToAbsoluteUrl, isCIBuild } from "../helpers";
|
|
6
|
+
const isHost = () => CMicroAppHost.isInitialized();
|
|
7
|
+
const isGuest = () => CMicroAppGuest.isInitialized();
|
|
8
|
+
const isStandAloneGuest = () => isGuest() && window.top === window.self;
|
|
9
|
+
const getLogger = () => isHost() ? CMicroAppHost.getInstance().getLogger() : CMicroAppGuest.getInstance().getLogger();
|
|
10
|
+
const isProduction = (mode) => {
|
|
11
|
+
if (isCIBuild())
|
|
12
|
+
return true;
|
|
13
|
+
if (mode)
|
|
14
|
+
return mode === "production";
|
|
14
15
|
return true;
|
|
15
16
|
};
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
const {
|
|
19
|
-
systemVersion
|
|
20
|
-
} = CMicroAppHost.getInstance().getProps();
|
|
17
|
+
const getVersionedPath = (path) => {
|
|
18
|
+
const { systemVersion } = CMicroAppHost.getInstance().getProps();
|
|
21
19
|
const majorMinorVersion = systemVersion.match(/^(?:\d+\.\d+)*/g);
|
|
22
|
-
return path.replace(/{SYSTEM_VERSION}/, majorMinorVersion && majorMinorVersion[0] ||
|
|
20
|
+
return path.replace(/{SYSTEM_VERSION}/, majorMinorVersion && majorMinorVersion[0] || "latest");
|
|
23
21
|
};
|
|
24
|
-
|
|
25
|
-
export const getMicroFrontEndAppConfig = appInfo => {
|
|
22
|
+
const getMicroFrontEndAppConfig = (appInfo) => {
|
|
26
23
|
const microFEAppConfig = getAppConfigValue(`microFrontendApps.${appInfo.id}`);
|
|
27
|
-
if (!microFEAppConfig)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (microFEAppConfig.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
manifestPath: './{SYSTEM_VERSION}'
|
|
24
|
+
if (!microFEAppConfig)
|
|
25
|
+
throw new Error(`unable to locate application configuraiton for ${appInfo.id} under microFrontendApps section of app.config.json`);
|
|
26
|
+
const { mode = "production" } = microFEAppConfig;
|
|
27
|
+
const envConfig = isProduction(mode) ? microFEAppConfig.production : microFEAppConfig.development;
|
|
28
|
+
if (microFEAppConfig.production)
|
|
29
|
+
delete microFEAppConfig.production;
|
|
30
|
+
if (microFEAppConfig.development)
|
|
31
|
+
delete microFEAppConfig.development;
|
|
32
|
+
const microFEConfig = _.merge(appInfo, {
|
|
33
|
+
mode: "production",
|
|
34
|
+
hostUrl: "./",
|
|
35
|
+
manifestPath: "./{SYSTEM_VERSION}"
|
|
40
36
|
}, microFEAppConfig, envConfig);
|
|
41
|
-
|
|
42
|
-
microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(microFEConfig.hostUrl.replace(/\/?$/, '/'));
|
|
37
|
+
microFEConfig.hostUrl = convertRelativeToAbsoluteUrl(microFEConfig.hostUrl.replace(/\/?$/, "/"));
|
|
43
38
|
microFEConfig.manifestPath = getVersionedPath(microFEConfig.manifestPath);
|
|
44
39
|
return microFEConfig;
|
|
45
|
-
};
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
getLogger,
|
|
43
|
+
getMicroFrontEndAppConfig,
|
|
44
|
+
isGuest,
|
|
45
|
+
isHost,
|
|
46
|
+
isStandAloneGuest
|
|
47
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -3,29 +3,28 @@ const poBoxRegex = /P\.? ?O\.? *Box +\d+/gi;
|
|
|
3
3
|
const roadRegex = /(street|st|road|rd|avenue|ave|drive|dr|loop|court|ct|circle|cir|lane|ln|boulevard|blvd|way)\.?\b/gi;
|
|
4
4
|
const piiPatterns = {
|
|
5
5
|
creditCardNumber: /\d{4}[ -]?\d{4}[ -]?\d{4}[ -]?\d{4}|\d{4}[ -]?\d{6}[ -]?\d{4}\d?/g,
|
|
6
|
-
streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`,
|
|
6
|
+
streetAddress: new RegExp(`(\\d+\\s*(\\w+ ){1,2}${roadRegex.source}(\\s+${aptRegex.source})?)|(${poBoxRegex.source})`, "gi"),
|
|
7
7
|
zipcode: /\b\d{5}\b(-\d{4})?\b/g,
|
|
8
8
|
phoneNumber: /(\(?\+?[0-9]{1,2}\)?[-. ]?)?(\(?[0-9]{3}\)?|[0-9]{3})[-. ]?([0-9]{3}[-. ]?[0-9]{4}|\b[A-Z0-9]{7}\b)/g,
|
|
9
9
|
ipAddress: /(\d{1,3}(\.\d{1,3}){3}|[0-9A-F]{4}(:[0-9A-F]{4}){5}(::|(:0000)+))/gi,
|
|
10
10
|
usSocialSecurityNumber: /\b\d{3}[ -.]\d{2}[ -.]\d{4}\b/g,
|
|
11
11
|
emailAddress: /([a-z0-9_\-.+]+)@\w+(\.\w+)*/gi,
|
|
12
|
-
// username: /(user( ?name)?|login): \S+/gi,
|
|
13
12
|
password: /(pass(word|phrase)?|secret): \S+/gi,
|
|
14
|
-
credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi
|
|
15
|
-
// url: /([^\s:/?#]+):\/\/([^/?#\s]*)([^?#\s]*)(\?([^#\s]*))?(#([^\s]*))?/g,
|
|
16
|
-
|
|
13
|
+
credentials: /(login( cred(ential)?s| info(rmation)?)?|cred(ential)?s) ?:\s*\S+\s+\/?\s*\S+/gi
|
|
17
14
|
};
|
|
18
|
-
|
|
19
15
|
const replacer = (key, value) => {
|
|
20
|
-
if (!key || typeof value !==
|
|
21
|
-
|
|
16
|
+
if (!key || typeof value !== "string" || key === "correlationId")
|
|
17
|
+
return value;
|
|
18
|
+
return Object.values(piiPatterns).reduce((redactedString, piiPattern) => redactedString.replace(piiPattern, "****"), value);
|
|
22
19
|
};
|
|
23
|
-
|
|
24
|
-
export const redactPii = data => {
|
|
20
|
+
const redactPii = (data) => {
|
|
25
21
|
try {
|
|
26
22
|
const redactedData = JSON.stringify(data, replacer);
|
|
27
23
|
return JSON.parse(redactedData);
|
|
28
24
|
} catch (err) {
|
|
29
25
|
return data;
|
|
30
26
|
}
|
|
31
|
-
};
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
redactPii
|
|
30
|
+
};
|