@elliemae/pui-app-sdk 2.16.1 → 3.0.0-beta.1
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/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/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/api/users/users.json +0 -8
- package/dist/cjs/app.config.json +0 -129
- 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/index.pug +0 -15
- 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/header/logo-region/logo.svg +0 -2
- package/dist/cjs/view/header/nav-region/notification/index.svg +0 -5
- package/dist/cjs/view/header/nav-region/user/index.svg +0 -4
- package/dist/cjs/view/intro.stories.mdx +0 -27
- 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/micro-iframe-app/iframe/index.html +0 -74
- 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/api/users/users.json +0 -8
- package/dist/es/app.config.json +0 -129
- 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/index.pug +0 -15
- 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/header/logo-region/logo.svg +0 -2
- package/dist/es/view/header/nav-region/notification/index.svg +0 -5
- package/dist/es/view/header/nav-region/user/index.svg +0 -4
- package/dist/es/view/intro.stories.mdx +0 -27
- 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/micro-iframe-app/iframe/index.html +0 -74
- 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,24 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
Object.
|
|
6
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
__markAsModule(target);
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, module2, desc) => {
|
|
14
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(module2))
|
|
16
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
17
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
var __toModule = (module2) => {
|
|
22
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
23
|
+
};
|
|
24
|
+
__export(exports, {
|
|
25
|
+
VisuallyHidden: () => VisuallyHidden
|
|
7
26
|
});
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
var import_react = __toModule(require("react"));
|
|
28
|
+
var import_styled_components = __toModule(require("styled-components"));
|
|
29
|
+
const Span = import_styled_components.default.span`
|
|
30
|
+
border: 0;
|
|
31
|
+
clip: rect(0 0 0 0);
|
|
32
|
+
height: 1px;
|
|
33
|
+
margin: -1px;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
padding: 0;
|
|
36
|
+
position: absolute;
|
|
37
|
+
width: 1px;
|
|
38
|
+
white-space: nowrap;
|
|
39
|
+
word-wrap: normal;
|
|
40
|
+
`;
|
|
41
|
+
const VisuallyHidden = (0, import_react.forwardRef)((props, ref) => /* @__PURE__ */ React.createElement(Span, {
|
|
42
|
+
ref,
|
|
18
43
|
...props
|
|
19
44
|
}));
|
|
20
|
-
exports.VisuallyHidden = VisuallyHidden;
|
|
21
|
-
|
|
22
|
-
var _StyledSpan = /*#__PURE__*/(0, _styledComponents.default)("span").withConfig({
|
|
23
|
-
componentId: "sc-h2hrxk-0"
|
|
24
|
-
})(["border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;word-wrap:normal;"]);
|
|
@@ -1,33 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.
|
|
4
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
__markAsModule(target);
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, module2, desc) => {
|
|
14
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(module2))
|
|
16
|
+
if (!__hasOwnProp.call(target, key) && key !== "default")
|
|
17
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return target;
|
|
20
|
+
};
|
|
21
|
+
var __toModule = (module2) => {
|
|
22
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", module2 && module2.__esModule && "default" in module2 ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
23
|
+
};
|
|
24
|
+
__export(exports, {
|
|
25
|
+
WindowSize: () => WindowSize
|
|
5
26
|
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _pubsubJs = require("pubsub-js");
|
|
11
|
-
|
|
12
|
-
var _constants = require("../../utils/constants.js");
|
|
13
|
-
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
|
|
27
|
+
var import_react = __toModule(require("react"));
|
|
28
|
+
var import_pubsub_js = __toModule(require("pubsub-js"));
|
|
29
|
+
var import_constants = __toModule(require("../../utils/constants"));
|
|
16
30
|
const WindowSize = () => {
|
|
17
|
-
(0,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return () => {};
|
|
31
|
+
(0, import_react.useEffect)(() => {
|
|
32
|
+
const observer = new ResizeObserver((entries) => {
|
|
33
|
+
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_RESIZED, entries && entries[0]);
|
|
34
|
+
});
|
|
35
|
+
observer.observe(window.document.documentElement);
|
|
36
|
+
return () => {
|
|
37
|
+
observer.unobserve(window.document.documentElement);
|
|
38
|
+
};
|
|
29
39
|
}, []);
|
|
30
|
-
return
|
|
40
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
31
41
|
};
|
|
32
|
-
|
|
33
|
-
exports.WindowSize = WindowSize;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import * as brum from
|
|
1
|
+
import * as brum from "@elliemae/pui-user-monitoring";
|
|
2
2
|
let userData = {
|
|
3
|
-
envName:
|
|
4
|
-
appId:
|
|
5
|
-
instanceId:
|
|
6
|
-
userId:
|
|
3
|
+
envName: "localhost",
|
|
4
|
+
appId: "",
|
|
5
|
+
instanceId: "",
|
|
6
|
+
userId: ""
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
userData = { ...userData,
|
|
11
|
-
...params
|
|
12
|
-
};
|
|
13
|
-
|
|
8
|
+
const getAppDynamicsUserData = () => userData;
|
|
9
|
+
const setAppDynamicsUserData = (params) => {
|
|
10
|
+
userData = { ...userData, ...params };
|
|
14
11
|
if (brum) {
|
|
15
|
-
brum.setCustomUserData(() => ({
|
|
16
|
-
userData
|
|
17
|
-
}));
|
|
12
|
+
brum.setCustomUserData(() => ({ userData }));
|
|
18
13
|
}
|
|
19
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getAppDynamicsUserData,
|
|
17
|
+
setAppDynamicsUserData
|
|
18
|
+
};
|
|
@@ -1,27 +1,18 @@
|
|
|
1
|
-
import { CMicroAppGuest } from "../utils/micro-frontend/guest
|
|
2
|
-
import { getBAEventParameters } from "./web-analytics
|
|
3
|
-
import { redactPii } from "../utils/redact-pii
|
|
4
|
-
|
|
5
|
-
const sendBAEventToSelf = data => {
|
|
1
|
+
import { CMicroAppGuest } from "../utils/micro-frontend/guest";
|
|
2
|
+
import { getBAEventParameters } from "./web-analytics";
|
|
3
|
+
import { redactPii } from "../utils/redact-pii";
|
|
4
|
+
const sendBAEventToSelf = (data) => {
|
|
6
5
|
const redactedData = redactPii(data);
|
|
7
6
|
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
8
7
|
window.gtmDataLayer.push(redactedData);
|
|
9
8
|
};
|
|
10
|
-
|
|
11
|
-
export const sendBAEvent = ({
|
|
9
|
+
const sendBAEvent = ({
|
|
12
10
|
data,
|
|
13
11
|
self = true
|
|
14
12
|
}) => {
|
|
15
|
-
const eventData = { ...getBAEventParameters(),
|
|
16
|
-
...data
|
|
17
|
-
};
|
|
18
|
-
|
|
13
|
+
const eventData = { ...getBAEventParameters(), ...data };
|
|
19
14
|
if (!self) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
23
|
-
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;
|
|
24
|
-
|
|
15
|
+
const sendEvent = CMicroAppGuest.getInstance()?.getHost()?.sendBAEvent;
|
|
25
16
|
if (sendEvent) {
|
|
26
17
|
sendEvent(eventData);
|
|
27
18
|
} else {
|
|
@@ -30,4 +21,7 @@ export const sendBAEvent = ({
|
|
|
30
21
|
} else {
|
|
31
22
|
sendBAEventToSelf(eventData);
|
|
32
23
|
}
|
|
33
|
-
};
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
sendBAEvent
|
|
27
|
+
};
|
|
@@ -1,24 +1,12 @@
|
|
|
1
|
-
import { sendBAEvent } from "
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
const {
|
|
6
|
-
|
|
7
|
-
href
|
|
8
|
-
} = (window.top || window.self).location;
|
|
9
|
-
const {
|
|
10
|
-
title
|
|
11
|
-
} = (window.top || window.self).document;
|
|
12
|
-
const {
|
|
13
|
-
pathname: guestPagePath,
|
|
14
|
-
href: guestPageUrl
|
|
15
|
-
} = window.location;
|
|
16
|
-
const {
|
|
17
|
-
title: guestPageTitle
|
|
18
|
-
} = document;
|
|
1
|
+
import { sendBAEvent } from ".";
|
|
2
|
+
const pageViewEvent = ({ pageTitle }) => {
|
|
3
|
+
const { pathname, href } = (window.top || window.self).location;
|
|
4
|
+
const { title } = (window.top || window.self).document;
|
|
5
|
+
const { pathname: guestPagePath, href: guestPageUrl } = window.location;
|
|
6
|
+
const { title: guestPageTitle } = document;
|
|
19
7
|
sendBAEvent({
|
|
20
8
|
data: {
|
|
21
|
-
event:
|
|
9
|
+
event: "pageView",
|
|
22
10
|
pageUrl: href,
|
|
23
11
|
pagePath: pathname,
|
|
24
12
|
pageTitle: title,
|
|
@@ -27,4 +15,7 @@ export const pageViewEvent = ({
|
|
|
27
15
|
guestPageTitle: pageTitle || guestPageTitle
|
|
28
16
|
}
|
|
29
17
|
});
|
|
30
|
-
};
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
pageViewEvent
|
|
21
|
+
};
|
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { sendBAEvent } from "
|
|
2
|
-
import { updateBAEventParameters } from "./web-analytics
|
|
3
|
-
|
|
1
|
+
import { sendBAEvent } from ".";
|
|
2
|
+
import { updateBAEventParameters } from "./web-analytics";
|
|
3
|
+
const loginEvent = ({
|
|
4
4
|
instanceId,
|
|
5
5
|
userId
|
|
6
6
|
}) => {
|
|
7
|
-
updateBAEventParameters({
|
|
8
|
-
instanceId,
|
|
9
|
-
userId
|
|
10
|
-
});
|
|
7
|
+
updateBAEventParameters({ instanceId, userId });
|
|
11
8
|
sendBAEvent({
|
|
12
9
|
data: {
|
|
13
|
-
event:
|
|
10
|
+
event: "login"
|
|
14
11
|
}
|
|
15
12
|
});
|
|
16
13
|
};
|
|
17
|
-
|
|
14
|
+
const logoutEvent = () => {
|
|
18
15
|
sendBAEvent({
|
|
19
16
|
data: {
|
|
20
|
-
event:
|
|
17
|
+
event: "logout"
|
|
21
18
|
}
|
|
22
19
|
});
|
|
23
|
-
updateBAEventParameters({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
updateBAEventParameters({ instanceId: "", userId: "" });
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
loginEvent,
|
|
24
|
+
logoutEvent
|
|
25
|
+
};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import { sendBAEvent } from "
|
|
2
|
-
|
|
1
|
+
import { sendBAEvent } from ".";
|
|
2
|
+
const waitStartEvent = () => sendBAEvent({
|
|
3
3
|
data: {
|
|
4
|
-
event:
|
|
4
|
+
event: "pageInteractionEnabled"
|
|
5
5
|
}
|
|
6
6
|
});
|
|
7
|
-
|
|
7
|
+
const waitEndEvent = () => sendBAEvent({
|
|
8
8
|
data: {
|
|
9
|
-
event:
|
|
9
|
+
event: "pageInteractionDisabled"
|
|
10
10
|
}
|
|
11
|
-
});
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
waitEndEvent,
|
|
14
|
+
waitStartEvent
|
|
15
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
let baEventParameters = {
|
|
2
|
-
envName:
|
|
3
|
-
appId:
|
|
4
|
-
instanceId:
|
|
5
|
-
userId:
|
|
2
|
+
envName: "localhost",
|
|
3
|
+
appId: "",
|
|
4
|
+
instanceId: "",
|
|
5
|
+
userId: ""
|
|
6
|
+
};
|
|
7
|
+
const getBAEventParameters = () => baEventParameters;
|
|
8
|
+
const updateBAEventParameters = (params) => {
|
|
9
|
+
baEventParameters = { ...baEventParameters, ...params };
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
getBAEventParameters,
|
|
13
|
+
updateBAEventParameters
|
|
6
14
|
};
|
|
7
|
-
export const getBAEventParameters = () => baEventParameters;
|
|
8
|
-
export const updateBAEventParameters = params => {
|
|
9
|
-
baEventParameters = { ...baEventParameters,
|
|
10
|
-
...params
|
|
11
|
-
};
|
|
12
|
-
};
|
|
@@ -1,40 +1,35 @@
|
|
|
1
|
-
import { getHTTPClient } from "../../communication/http-client
|
|
2
|
-
|
|
1
|
+
import { getHTTPClient } from "../../communication/http-client";
|
|
2
|
+
const getToken = async ({
|
|
3
3
|
clientId,
|
|
4
4
|
redirectUri,
|
|
5
5
|
idpCode
|
|
6
6
|
}) => {
|
|
7
7
|
const params = new URLSearchParams();
|
|
8
|
-
params.append(
|
|
9
|
-
params.append(
|
|
10
|
-
params.append(
|
|
11
|
-
params.append(
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
} = await getHTTPClient().post('/oauth2/v1/token', params);
|
|
15
|
-
return {
|
|
16
|
-
tokenType: data.token_type,
|
|
17
|
-
accessToken: data.access_token
|
|
18
|
-
};
|
|
8
|
+
params.append("grant_type", "authorization_code");
|
|
9
|
+
params.append("client_id", clientId);
|
|
10
|
+
params.append("redirect_uri", redirectUri);
|
|
11
|
+
params.append("code", idpCode);
|
|
12
|
+
const { data } = await getHTTPClient().post("/oauth2/v1/token", params);
|
|
13
|
+
return { tokenType: data.token_type, accessToken: data.access_token };
|
|
19
14
|
};
|
|
20
|
-
|
|
21
|
-
clientId,
|
|
22
|
-
token
|
|
23
|
-
}) => {
|
|
15
|
+
const revokeToken = async ({ clientId, token }) => {
|
|
24
16
|
const params = new URLSearchParams();
|
|
25
|
-
params.append(
|
|
26
|
-
params.append(
|
|
27
|
-
await getHTTPClient().post(
|
|
17
|
+
params.append("token", token);
|
|
18
|
+
params.append("client_id", clientId);
|
|
19
|
+
await getHTTPClient().post("/oauth2/v1/token/revocation", params);
|
|
28
20
|
};
|
|
29
|
-
|
|
21
|
+
const introspectToken = async ({
|
|
30
22
|
clientId,
|
|
31
23
|
accessToken
|
|
32
24
|
}) => {
|
|
33
25
|
const params = new URLSearchParams();
|
|
34
|
-
params.append(
|
|
35
|
-
params.append(
|
|
36
|
-
const {
|
|
37
|
-
data
|
|
38
|
-
} = await getHTTPClient().post('/oauth2/v1/token/introspection', params);
|
|
26
|
+
params.append("token", accessToken);
|
|
27
|
+
params.append("client_id", clientId);
|
|
28
|
+
const { data } = await getHTTPClient().post("/oauth2/v1/token/introspection", params);
|
|
39
29
|
return data;
|
|
40
|
-
};
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
getToken,
|
|
33
|
+
introspectToken,
|
|
34
|
+
revokeToken
|
|
35
|
+
};
|
package/dist/es/api/helpers.js
CHANGED
|
@@ -1,85 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* @function
|
|
6
|
-
* @description Creates API Redux Action Creators
|
|
7
|
-
* ## Examples
|
|
8
|
-
* ```javascript
|
|
9
|
-
* import { getApiActionCreator } from '@elliemae/pui-app-sdk';
|
|
10
|
-
* const loansActionCreator = getApiActionCreator('loans');
|
|
11
|
-
*
|
|
12
|
-
* export const loans = {
|
|
13
|
-
* ...loansActionCreator('create'),
|
|
14
|
-
* ...loansActionCreator('get'),
|
|
15
|
-
* ...loansActionCreator('save'),
|
|
16
|
-
* };
|
|
17
|
-
*
|
|
18
|
-
* const loansSlice = createSlice({
|
|
19
|
-
* name: 'loans',
|
|
20
|
-
* initialState: [],
|
|
21
|
-
* reducers: {
|
|
22
|
-
* getSuccess: (state, { payload }) => {
|
|
23
|
-
* state.push(...payload);
|
|
24
|
-
* },
|
|
25
|
-
* saveSuccess: (state, { payload }) => {
|
|
26
|
-
* state.push(payload);
|
|
27
|
-
* },
|
|
28
|
-
* },
|
|
29
|
-
* });
|
|
30
|
-
* ```
|
|
31
|
-
* @param {string} api API name for which Redux Action Creators are required
|
|
32
|
-
* @returns {Function} Redux Action Creators util function
|
|
33
|
-
*/
|
|
34
|
-
export const getApiActionCreator = api => operation => ({
|
|
1
|
+
import { createAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { get } from "lodash";
|
|
3
|
+
const getApiActionCreator = (api) => (operation) => ({
|
|
35
4
|
[operation]: createAction(`${api}/${operation}`),
|
|
36
5
|
[`${operation}Success`]: createAction(`${api}/${operation}Success`),
|
|
37
6
|
[`${operation}Error`]: createAction(`${api}/${operation}Error`)
|
|
38
7
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
* then everytime any of those gets updated it will trigger a rerender even though you're not actually using that field.
|
|
45
|
-
*
|
|
46
|
-
* @description Generic Redux State Selector Helper.
|
|
47
|
-
* ### Example
|
|
48
|
-
* ```javascript
|
|
49
|
-
* // reducer.js
|
|
50
|
-
* import { getSelectField } from 'elliemae/pui-app-sdk';
|
|
51
|
-
*
|
|
52
|
-
* const name = 'someState';
|
|
53
|
-
* export selectSomeState = getSelectField(name);
|
|
54
|
-
*
|
|
55
|
-
* // use-some-state.js hook. NOTE: You can create a hook for each main state
|
|
56
|
-
* import { selectSomeState } from 'slices/some-slice';
|
|
57
|
-
* import { useSelector, shallowEqual } from 'react-redux';
|
|
58
|
-
*
|
|
59
|
-
* export const useSelectSomeState = (fieldName, defaultValue) => useSelector(selectSomeState(fieldName, defaultValue), shallowEqual);
|
|
60
|
-
*
|
|
61
|
-
* // some-component.js
|
|
62
|
-
* import { useSelectSomeState } from 'custom-hooks/state-selectors.js'
|
|
63
|
-
*
|
|
64
|
-
* export const SomeComponent = () => {
|
|
65
|
-
* const someField = useSelectSomeState('someField');
|
|
66
|
-
* ...
|
|
67
|
-
* }
|
|
68
|
-
* export const SomeOtherComponent = () => {
|
|
69
|
-
* const someSubField = useSelectSomeState('someField.someSubField');
|
|
70
|
-
* ...
|
|
71
|
-
* }
|
|
72
|
-
* export const AnotherComponent = () => {
|
|
73
|
-
* const [firstField, secondField, thirdField] = useSelectSomeState(['firstField', 'secondField', 'thirdField']);
|
|
74
|
-
* ...
|
|
75
|
-
* }
|
|
76
|
-
*
|
|
77
|
-
* ```
|
|
78
|
-
* @param {string} stateName the redux store's state name of the state you want to access.
|
|
79
|
-
* @returns {Function} A *selectField* function that returns a selector function to be used inside a *useSelector* hook or a *select* side effect
|
|
80
|
-
*/
|
|
81
|
-
|
|
82
|
-
/* eslint-disable prettier/prettier */
|
|
83
|
-
|
|
84
|
-
export const getSelectField = stateName => (fieldName = '', defaultValue) => (state = {}, stateValue = _get(state, stateName)) => Array.isArray(fieldName) ? fieldName.map((field, i) => _get(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : _get(stateValue, fieldName, defaultValue);
|
|
85
|
-
/* eslint-enable prettier/prettier */
|
|
8
|
+
const getSelectField = (stateName) => (fieldName = "", defaultValue) => (state = {}, stateValue = get(state, stateName)) => Array.isArray(fieldName) ? fieldName.map((field, i) => get(stateValue, field, Array.isArray(defaultValue) ? defaultValue[i] : defaultValue)) : get(stateValue, fieldName, defaultValue);
|
|
9
|
+
export {
|
|
10
|
+
getApiActionCreator,
|
|
11
|
+
getSelectField
|
|
12
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { getAuthHTTPClient } from "../../communication/http-client
|
|
2
|
-
|
|
3
|
-
userName
|
|
4
|
-
}) => {
|
|
5
|
-
const {
|
|
6
|
-
data
|
|
7
|
-
} = await getAuthHTTPClient().get(`/encompass/v1/users/${userName}`);
|
|
1
|
+
import { getAuthHTTPClient } from "../../communication/http-client";
|
|
2
|
+
const getUser = async ({ userName }) => {
|
|
3
|
+
const { data } = await getAuthHTTPClient().get(`/encompass/v1/users/${userName}`);
|
|
8
4
|
return data;
|
|
9
|
-
};
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
getUser
|
|
8
|
+
};
|
|
@@ -1,41 +1,35 @@
|
|
|
1
|
-
import axios from
|
|
2
|
-
import { getAppConfigValue } from "../../utils/app-config/config
|
|
3
|
-
import { getAuthorizationHeader } from "../../utils/auth/helper
|
|
4
|
-
import setupRetry from "./retry
|
|
5
|
-
import { requestInterceptor } from "./request-interceptor
|
|
6
|
-
import { handleSuccess, handleFailure } from "./response-interceptor
|
|
7
|
-
const REQUEST_TIMEOUT = 2 * 60 *
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
baseURL = getAppConfigValue('serviceEndpoints.api', ''),
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
import { getAppConfigValue } from "../../utils/app-config/config";
|
|
3
|
+
import { getAuthorizationHeader } from "../../utils/auth/helper";
|
|
4
|
+
import setupRetry from "./retry";
|
|
5
|
+
import { requestInterceptor } from "./request-interceptor";
|
|
6
|
+
import { handleSuccess, handleFailure } from "./response-interceptor";
|
|
7
|
+
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
8
|
+
const getHTTPClient = ({
|
|
9
|
+
baseURL = getAppConfigValue("serviceEndpoints.api", ""),
|
|
11
10
|
headers = {}
|
|
12
11
|
} = {}) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const client = axios.create({
|
|
17
|
-
baseURL,
|
|
18
|
-
headers
|
|
19
|
-
});
|
|
20
|
-
if (client !== null && client !== void 0 && (_client$defaults = client.defaults) !== null && _client$defaults !== void 0 && _client$defaults.timeout) client.defaults.timeout = REQUEST_TIMEOUT;
|
|
12
|
+
const client = axios.create({ baseURL, headers });
|
|
13
|
+
if (client?.defaults?.timeout)
|
|
14
|
+
client.defaults.timeout = REQUEST_TIMEOUT;
|
|
21
15
|
setupRetry(client);
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (response) response.use(handleSuccess, handleFailure);
|
|
16
|
+
const { request, response } = client?.interceptors || {};
|
|
17
|
+
if (request)
|
|
18
|
+
request.use(requestInterceptor);
|
|
19
|
+
if (response)
|
|
20
|
+
response.use(handleSuccess, handleFailure);
|
|
28
21
|
return client;
|
|
29
22
|
};
|
|
30
|
-
|
|
23
|
+
const getAuthHTTPClient = ({
|
|
31
24
|
baseURL,
|
|
32
25
|
headers = {},
|
|
33
26
|
...rest
|
|
34
27
|
} = {}) => getHTTPClient({
|
|
35
28
|
baseURL,
|
|
36
|
-
|
|
37
|
-
headers: { ...headers,
|
|
38
|
-
Authorization: getAuthorizationHeader()
|
|
39
|
-
},
|
|
29
|
+
headers: { ...headers, Authorization: getAuthorizationHeader() },
|
|
40
30
|
...rest
|
|
41
|
-
});
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
getAuthHTTPClient,
|
|
34
|
+
getHTTPClient
|
|
35
|
+
};
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { resetUserIdleTime } from "../../utils/session
|
|
2
|
-
|
|
1
|
+
import { resetUserIdleTime } from "../../utils/session";
|
|
2
|
+
const requestInterceptor = (config) => {
|
|
3
3
|
resetUserIdleTime();
|
|
4
4
|
return config;
|
|
5
|
-
};
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
requestInterceptor
|
|
8
|
+
};
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import axios from
|
|
1
|
+
import axios from "axios";
|
|
2
2
|
const HTTP_UNAUTHORIZED = 401;
|
|
3
3
|
let unAuthorizedFailureHandler = null;
|
|
4
|
-
|
|
4
|
+
const onAuthorizationFailure = (callback) => {
|
|
5
5
|
unAuthorizedFailureHandler = callback;
|
|
6
6
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const {
|
|
16
|
-
config
|
|
17
|
-
} = error;
|
|
18
|
-
if (config.headers) config.headers.Authorization = authorizationHeader;
|
|
7
|
+
const handleSuccess = (response) => response;
|
|
8
|
+
const handleFailure = (error) => {
|
|
9
|
+
const { status } = (error || {}).response || {};
|
|
10
|
+
if (status === HTTP_UNAUTHORIZED && unAuthorizedFailureHandler && typeof unAuthorizedFailureHandler === "function") {
|
|
11
|
+
return unAuthorizedFailureHandler(error).then((authorizationHeader) => {
|
|
12
|
+
const { config } = error;
|
|
13
|
+
if (config.headers)
|
|
14
|
+
config.headers.Authorization = authorizationHeader;
|
|
19
15
|
return new Promise((resolve, reject) => {
|
|
20
|
-
axios.request(config).then(response => {
|
|
16
|
+
axios.request(config).then((response) => {
|
|
21
17
|
resolve(response);
|
|
22
|
-
}).catch(exception => {
|
|
18
|
+
}).catch((exception) => {
|
|
23
19
|
reject(exception);
|
|
24
20
|
});
|
|
25
21
|
});
|
|
26
|
-
}).catch(exception => Promise.reject(exception));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
22
|
+
}).catch((exception) => Promise.reject(exception));
|
|
23
|
+
}
|
|
30
24
|
return new Promise((resolve, reject) => {
|
|
31
25
|
reject(error);
|
|
32
26
|
});
|
|
33
|
-
};
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
handleFailure,
|
|
30
|
+
handleSuccess,
|
|
31
|
+
onAuthorizationFailure
|
|
32
|
+
};
|