@elliemae/pui-app-sdk 2.15.2 → 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 +32 -20
- 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 -2
- 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 +10 -9
- 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/testing/render-with-redux.d.ts +1 -1
- package/dist/types/utils/testing/render-with-router-redux.d.ts +1 -1
- package/dist/types/utils/testing/render-with-router.d.ts +1 -1
- package/dist/types/utils/window.d.ts +1 -1
- package/dist/types/view/visually-hidden/index.d.ts +1 -3
- package/package.json +19 -17
- 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,148 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const onFulfilled = res => res;
|
|
5
|
-
/**
|
|
6
|
-
* Eject the Axios interceptor that is providing retry capabilities.
|
|
7
|
-
*
|
|
8
|
-
* @param interceptorId The interceptorId provided in the config.
|
|
9
|
-
* @param instance The axios instance using this interceptor.
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export const detach = (interceptorId, instance) => {
|
|
14
|
-
var _instance, _instance$interceptor;
|
|
15
|
-
|
|
1
|
+
import axios from "axios";
|
|
2
|
+
const onFulfilled = (res) => res;
|
|
3
|
+
const detach = (interceptorId, instance) => {
|
|
16
4
|
instance = instance || axios;
|
|
17
|
-
if (
|
|
5
|
+
if (instance?.interceptors?.response)
|
|
6
|
+
instance.interceptors.response.eject(interceptorId);
|
|
18
7
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*
|
|
22
|
-
* @param err The AxiosError passed to the interceptor.
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line complexity
|
|
25
|
-
|
|
26
|
-
const shouldRetryRequest = err => {
|
|
27
|
-
const config = err.config.retryConfig; // If there's no config, or retries are disabled, return.
|
|
28
|
-
|
|
8
|
+
const shouldRetryRequest = (err) => {
|
|
9
|
+
const config = err.config.retryConfig;
|
|
29
10
|
if (!config || config.retry === 0) {
|
|
30
11
|
return false;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
12
|
+
}
|
|
34
13
|
if (!err.response && (config.currentRetryAttempt || 0) >= config.noResponseRetries) {
|
|
35
14
|
return false;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
|
|
15
|
+
}
|
|
39
16
|
if (!err.config.method || config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
|
|
40
17
|
return false;
|
|
41
|
-
}
|
|
42
|
-
// to automatically retry, return.
|
|
43
|
-
|
|
44
|
-
|
|
18
|
+
}
|
|
45
19
|
if (err.response && err.response.status) {
|
|
46
|
-
let isInRange = false;
|
|
47
|
-
|
|
20
|
+
let isInRange = false;
|
|
48
21
|
for (const [min, max] of config.statusCodesToRetry) {
|
|
49
|
-
const {
|
|
50
|
-
status
|
|
51
|
-
} = err.response;
|
|
52
|
-
|
|
22
|
+
const { status } = err.response;
|
|
53
23
|
if (status >= min && status <= max) {
|
|
54
24
|
isInRange = true;
|
|
55
25
|
break;
|
|
56
26
|
}
|
|
57
27
|
}
|
|
58
|
-
|
|
59
28
|
if (!isInRange) {
|
|
60
29
|
return false;
|
|
61
30
|
}
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
31
|
+
}
|
|
65
32
|
config.currentRetryAttempt = config.currentRetryAttempt || 0;
|
|
66
|
-
|
|
67
33
|
if (config.currentRetryAttempt >= config.retry) {
|
|
68
34
|
return false;
|
|
69
35
|
}
|
|
70
|
-
|
|
71
36
|
return true;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const onError = err => {
|
|
37
|
+
};
|
|
38
|
+
const onError = (err) => {
|
|
76
39
|
if (!err.config) {
|
|
77
40
|
return Promise.reject(err);
|
|
78
41
|
}
|
|
79
|
-
|
|
80
42
|
const config = err.config.retryConfig || {};
|
|
81
43
|
config.currentRetryAttempt = config.currentRetryAttempt || 0;
|
|
82
|
-
config.retry = config.retry ===
|
|
44
|
+
config.retry = config.retry === void 0 || config.retry === null ? 3 : config.retry;
|
|
83
45
|
config.retryDelay = config.retryDelay || 100;
|
|
84
46
|
config.instance = config.instance || axios;
|
|
85
|
-
config.httpMethodsToRetry = config.httpMethodsToRetry || [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
err.config.retryConfig = config;
|
|
100
|
-
|
|
47
|
+
config.httpMethodsToRetry = config.httpMethodsToRetry || [
|
|
48
|
+
"GET",
|
|
49
|
+
"HEAD",
|
|
50
|
+
"PUT",
|
|
51
|
+
"OPTIONS",
|
|
52
|
+
"DELETE"
|
|
53
|
+
];
|
|
54
|
+
config.noResponseRetries = config.noResponseRetries === void 0 || config.noResponseRetries === null ? 2 : config.noResponseRetries;
|
|
55
|
+
const retryRanges = [
|
|
56
|
+
[100, 199],
|
|
57
|
+
[429, 429],
|
|
58
|
+
[500, 599]
|
|
59
|
+
];
|
|
60
|
+
config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;
|
|
61
|
+
err.config.retryConfig = config;
|
|
101
62
|
const shouldRetryFn = config.shouldRetry || shouldRetryRequest;
|
|
102
|
-
|
|
103
63
|
if (!shouldRetryFn(err)) {
|
|
104
64
|
return Promise.reject(err);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const onBackoffPromise = new Promise(resolve => {
|
|
109
|
-
// Calculate time to wait with exponential backoff.
|
|
110
|
-
// Formula: (2^c - 1 / 2) * 1000
|
|
111
|
-
// eslint-disable-next-line no-restricted-properties
|
|
112
|
-
const delay = (Math.pow(2, config.currentRetryAttempt) - 1) / 2 * 1000;
|
|
65
|
+
}
|
|
66
|
+
const onBackoffPromise = new Promise((resolve) => {
|
|
67
|
+
const delay = (Math.pow(2, config.currentRetryAttempt) - 1) / 2 * 1e3;
|
|
113
68
|
err.config.retryConfig.currentRetryAttempt += 1;
|
|
114
69
|
setTimeout(resolve, delay);
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
const onRetryAttemptPromise = config.onRetryAttempt ? Promise.resolve(config.onRetryAttempt(err)) : Promise.resolve(); // Return the promise in which recalls axios to retry the request
|
|
118
|
-
|
|
70
|
+
});
|
|
71
|
+
const onRetryAttemptPromise = config.onRetryAttempt ? Promise.resolve(config.onRetryAttempt(err)) : Promise.resolve();
|
|
119
72
|
return Promise.resolve().then(() => onBackoffPromise).then(() => onRetryAttemptPromise).then(() => config.instance.request(err.config));
|
|
120
73
|
};
|
|
121
|
-
|
|
122
|
-
* Attach the interceptor to the Axios instance.
|
|
123
|
-
*
|
|
124
|
-
* @param instance The optional Axios instance on which to attach the
|
|
125
|
-
* interceptor.
|
|
126
|
-
* @returns The id of the interceptor attached to the axios instance.
|
|
127
|
-
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
export const attach = instance => {
|
|
131
|
-
var _instance2, _instance2$intercepto;
|
|
132
|
-
|
|
74
|
+
const attach = (instance) => {
|
|
133
75
|
instance = instance || axios;
|
|
134
|
-
return
|
|
76
|
+
return instance?.interceptors?.response ? instance.interceptors.response.use(onFulfilled, onError) : null;
|
|
135
77
|
};
|
|
136
|
-
|
|
137
|
-
* Acquire the retryConfig object from an AxiosError if available.
|
|
138
|
-
*
|
|
139
|
-
* @param err The Axios error with a config object.
|
|
140
|
-
*/
|
|
141
|
-
|
|
142
|
-
export const getConfig = err => {
|
|
78
|
+
const getConfig = (err) => {
|
|
143
79
|
if (err && err.config) {
|
|
144
80
|
return err.config.retryConfig;
|
|
145
81
|
}
|
|
146
|
-
|
|
147
82
|
return null;
|
|
148
|
-
};
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
attach,
|
|
86
|
+
detach,
|
|
87
|
+
getConfig
|
|
88
|
+
};
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import {
|
|
2
|
+
attach,
|
|
3
|
+
getConfig
|
|
4
|
+
} from "./retry-axios";
|
|
5
|
+
const getRaxConfig = (httpClient) => ({
|
|
4
6
|
retry: 3,
|
|
5
|
-
// Retry twice on errors that don't return a response (ENOTFOUND, ETIMEDOUT, etc).
|
|
6
7
|
noResponseRetries: 2,
|
|
7
|
-
// Milliseconds to delay at first. Defaults to 100.
|
|
8
8
|
retryDelay: 100,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
statusCodesToRetry: [[100, 199], [429, 429], [500, 599]],
|
|
16
|
-
// If you are using a non static instance of Axios you need
|
|
17
|
-
// to pass that instance here (const ax = axios.create())
|
|
9
|
+
httpMethodsToRetry: ["GET", "HEAD", "OPTIONS", "DELETE", "PUT"],
|
|
10
|
+
statusCodesToRetry: [
|
|
11
|
+
[100, 199],
|
|
12
|
+
[429, 429],
|
|
13
|
+
[500, 599]
|
|
14
|
+
],
|
|
18
15
|
instance: httpClient,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if (cfg && cfg.currentRetryAttempt) {}
|
|
16
|
+
onRetryAttempt: (err) => {
|
|
17
|
+
const cfg = getConfig(err);
|
|
18
|
+
if (cfg && cfg.currentRetryAttempt)
|
|
19
|
+
console.log(`Retry attempt #${cfg.currentRetryAttempt}`);
|
|
25
20
|
}
|
|
26
21
|
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (httpClient !== null && httpClient !== void 0 && httpClient.defaults) // eslint-disable-next-line no-param-reassign
|
|
22
|
+
const setupRetry = (httpClient) => {
|
|
23
|
+
if (httpClient?.defaults)
|
|
30
24
|
httpClient.defaults.retryConfig = getRaxConfig(httpClient);
|
|
31
25
|
attach(httpClient);
|
|
32
26
|
};
|
|
33
|
-
|
|
34
|
-
export
|
|
27
|
+
var retry_default = setupRetry;
|
|
28
|
+
export {
|
|
29
|
+
retry_default as default,
|
|
30
|
+
getRaxConfig
|
|
31
|
+
};
|
|
@@ -1,65 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
describe('http client test cases', () => {
|
|
1
|
+
import enums from "../../../utils/constants";
|
|
2
|
+
import { getAuthHTTPClient } from "../index";
|
|
3
|
+
import { onAuthorizationFailure } from "../response-interceptor";
|
|
4
|
+
describe("http client test cases", () => {
|
|
6
5
|
const callApi = ({
|
|
7
6
|
apiUrl,
|
|
8
7
|
options = {},
|
|
9
|
-
baseURL =
|
|
8
|
+
baseURL = "http://localhost:3001"
|
|
10
9
|
}) => {
|
|
11
|
-
const httpClient = getAuthHTTPClient({
|
|
12
|
-
baseURL
|
|
13
|
-
});
|
|
10
|
+
const httpClient = getAuthHTTPClient({ baseURL });
|
|
14
11
|
return httpClient.get(apiUrl, options);
|
|
15
12
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const authorizationHeader = 'pui';
|
|
13
|
+
const refreshToken = () => new Promise((resolve) => {
|
|
14
|
+
const authorizationHeader = "pui";
|
|
19
15
|
sessionStorage.setItem(enums.AUTHORIZATION, authorizationHeader);
|
|
20
16
|
resolve(authorizationHeader);
|
|
21
17
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
apiUrl: 'annual_report_2009.pdf',
|
|
29
|
-
options: {
|
|
30
|
-
timeout: 200000
|
|
31
|
-
},
|
|
32
|
-
baseURL: 'https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en'
|
|
18
|
+
it("should download large file without timing out", async () => {
|
|
19
|
+
jest.setTimeout(3e5);
|
|
20
|
+
const { data } = await callApi({
|
|
21
|
+
apiUrl: "annual_report_2009.pdf",
|
|
22
|
+
options: { timeout: 2e5 },
|
|
23
|
+
baseURL: "https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en"
|
|
33
24
|
});
|
|
34
25
|
expect(data).toBeDefined();
|
|
35
26
|
});
|
|
36
|
-
it(
|
|
37
|
-
jest.setTimeout(
|
|
27
|
+
it("should throw connection aborted error for large file download", async () => {
|
|
28
|
+
jest.setTimeout(3e5);
|
|
38
29
|
await expect(callApi({
|
|
39
|
-
apiUrl:
|
|
40
|
-
baseURL:
|
|
41
|
-
})).rejects.toEqual(new Error(
|
|
30
|
+
apiUrl: "annual_report_2009.pdf",
|
|
31
|
+
baseURL: "https://www.iso.org/files/live/sites/isoorg/files/archive/pdf/en"
|
|
32
|
+
})).rejects.toEqual(new Error("timeout of 10000ms exceeded"));
|
|
42
33
|
});
|
|
43
|
-
it(
|
|
44
|
-
const {
|
|
45
|
-
|
|
46
|
-
} = await callApi({
|
|
47
|
-
apiUrl: '/hello'
|
|
48
|
-
});
|
|
49
|
-
expect(data.name).toEqual('pui-app-sdk');
|
|
34
|
+
it("should return success response", async () => {
|
|
35
|
+
const { data } = await callApi({ apiUrl: "/hello" });
|
|
36
|
+
expect(data.name).toEqual("pui-app-sdk");
|
|
50
37
|
});
|
|
51
|
-
it(
|
|
52
|
-
await expect(callApi({
|
|
53
|
-
apiUrl: '/private'
|
|
54
|
-
})).rejects.toThrow('Request failed with status code 401');
|
|
38
|
+
it("should return unauthorized 401 response", async () => {
|
|
39
|
+
await expect(callApi({ apiUrl: "/private" })).rejects.toThrow("Request failed with status code 401");
|
|
55
40
|
});
|
|
56
|
-
it(
|
|
41
|
+
it("should return success after refreshing authorization token", async () => {
|
|
57
42
|
onAuthorizationFailure(refreshToken);
|
|
58
|
-
const {
|
|
59
|
-
|
|
60
|
-
} = await callApi({
|
|
61
|
-
apiUrl: '/private'
|
|
62
|
-
});
|
|
63
|
-
expect(data.message).toEqual('you are viewing a private message');
|
|
43
|
+
const { data } = await callApi({ apiUrl: "/private" });
|
|
44
|
+
expect(data.message).toEqual("you are viewing a private message");
|
|
64
45
|
});
|
|
65
|
-
});
|
|
46
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
const LOGIN = "auth/LOGIN";
|
|
2
|
+
const LOGIN_SUCCESS = "auth/LOGIN_SUCCESS";
|
|
3
|
+
const LOGOUT = "auth/LOGOUT";
|
|
4
|
+
const auth = {
|
|
5
5
|
login: ({
|
|
6
6
|
idpCode,
|
|
7
7
|
redirectUri,
|
|
@@ -10,13 +10,7 @@ export const auth = {
|
|
|
10
10
|
scope
|
|
11
11
|
}) => ({
|
|
12
12
|
type: LOGIN,
|
|
13
|
-
payload: {
|
|
14
|
-
idpCode,
|
|
15
|
-
redirectUri,
|
|
16
|
-
clientId,
|
|
17
|
-
responseType,
|
|
18
|
-
scope
|
|
19
|
-
}
|
|
13
|
+
payload: { idpCode, redirectUri, clientId, responseType, scope }
|
|
20
14
|
}),
|
|
21
15
|
logout: ({
|
|
22
16
|
clientId,
|
|
@@ -26,12 +20,12 @@ export const auth = {
|
|
|
26
20
|
code
|
|
27
21
|
}) => ({
|
|
28
22
|
type: LOGOUT,
|
|
29
|
-
payload: {
|
|
30
|
-
clientId,
|
|
31
|
-
redirectUri,
|
|
32
|
-
responseType,
|
|
33
|
-
scope,
|
|
34
|
-
code
|
|
35
|
-
}
|
|
23
|
+
payload: { clientId, redirectUri, responseType, scope, code }
|
|
36
24
|
})
|
|
37
|
-
};
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
LOGIN,
|
|
28
|
+
LOGIN_SUCCESS,
|
|
29
|
+
LOGOUT,
|
|
30
|
+
auth
|
|
31
|
+
};
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import produce from
|
|
2
|
-
import { LOGIN_SUCCESS } from "./actions
|
|
3
|
-
|
|
1
|
+
import produce from "immer";
|
|
2
|
+
import { LOGIN_SUCCESS } from "./actions";
|
|
3
|
+
const initialState = {
|
|
4
4
|
authenticated: false
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export const authReducer = produce((draft, action) => {
|
|
6
|
+
const authReducer = produce((draft, action) => {
|
|
9
7
|
switch (action.type) {
|
|
10
8
|
case LOGIN_SUCCESS:
|
|
11
9
|
draft.authenticated = true;
|
|
12
10
|
break;
|
|
13
11
|
}
|
|
14
|
-
}, initialState);
|
|
12
|
+
}, initialState);
|
|
13
|
+
export {
|
|
14
|
+
authReducer,
|
|
15
|
+
initialState
|
|
16
|
+
};
|
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
change: 'change'
|
|
1
|
+
import produce from "immer";
|
|
2
|
+
const breakpoint = {
|
|
3
|
+
change: "change"
|
|
5
4
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
})(Breakpoints || (Breakpoints = {}));
|
|
13
|
-
|
|
5
|
+
var Breakpoints = /* @__PURE__ */ ((Breakpoints2) => {
|
|
6
|
+
Breakpoints2["LARGE"] = "large";
|
|
7
|
+
Breakpoints2["MEDIUM"] = "medium";
|
|
8
|
+
Breakpoints2["SMALL"] = "small";
|
|
9
|
+
return Breakpoints2;
|
|
10
|
+
})(Breakpoints || {});
|
|
14
11
|
const initialState = {
|
|
15
|
-
value:
|
|
12
|
+
value: "large" /* LARGE */
|
|
16
13
|
};
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
|
|
20
|
-
payload
|
|
21
|
-
} = action;
|
|
22
|
-
return produce(state, draft => {
|
|
23
|
-
// eslint-disable-next-line default-case
|
|
14
|
+
const breakpointReducer = (state = initialState, action) => {
|
|
15
|
+
const { type, payload } = action;
|
|
16
|
+
return produce(state, (draft) => {
|
|
24
17
|
switch (type) {
|
|
25
18
|
case breakpoint.change:
|
|
26
19
|
draft.value = payload;
|
|
27
20
|
break;
|
|
28
21
|
}
|
|
29
22
|
});
|
|
30
|
-
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
Breakpoints,
|
|
26
|
+
breakpoint,
|
|
27
|
+
breakpointReducer
|
|
28
|
+
};
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import { createSlice } from
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
2
|
const initialState = {
|
|
3
|
-
description:
|
|
4
|
-
messageText:
|
|
3
|
+
description: "",
|
|
4
|
+
messageText: ""
|
|
5
5
|
};
|
|
6
6
|
const errorSlice = createSlice({
|
|
7
|
-
name:
|
|
7
|
+
name: "error",
|
|
8
8
|
initialState,
|
|
9
9
|
reducers: {
|
|
10
|
-
set: (_,
|
|
10
|
+
set: (_, actions2) => actions2.payload,
|
|
11
11
|
clear: () => initialState
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const { actions } = errorSlice;
|
|
15
|
+
const errorReducer = errorSlice.reducer;
|
|
16
|
+
export {
|
|
17
|
+
actions,
|
|
18
|
+
errorReducer
|
|
19
|
+
};
|
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { createSlice } from
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
2
|
const initialState = {
|
|
3
|
-
message:
|
|
4
|
-
ariaLive:
|
|
5
|
-
id:
|
|
3
|
+
message: "",
|
|
4
|
+
ariaLive: "polite",
|
|
5
|
+
id: ""
|
|
6
6
|
};
|
|
7
7
|
const liveMessage = createSlice({
|
|
8
|
-
name:
|
|
8
|
+
name: "liveMessage",
|
|
9
9
|
initialState,
|
|
10
10
|
reducers: {
|
|
11
|
-
announce: (state, {
|
|
12
|
-
payload: {
|
|
13
|
-
message,
|
|
14
|
-
ariaLive,
|
|
15
|
-
id
|
|
16
|
-
}
|
|
17
|
-
}) => ({
|
|
11
|
+
announce: (state, { payload: { message, ariaLive, id } }) => ({
|
|
18
12
|
message,
|
|
19
13
|
ariaLive,
|
|
20
14
|
id
|
|
21
15
|
})
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
const { actions } = liveMessage;
|
|
19
|
+
const liveMessageReducer = liveMessage.reducer;
|
|
20
|
+
export {
|
|
21
|
+
actions,
|
|
22
|
+
liveMessageReducer
|
|
23
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
CONFIRM:
|
|
3
|
-
CANCEL:
|
|
1
|
+
const actions = {
|
|
2
|
+
CONFIRM: "log-out/CONFIRM",
|
|
3
|
+
CANCEL: "log-out/CANCEL"
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
const logout = {
|
|
6
6
|
confirm: () => ({
|
|
7
7
|
type: actions.CONFIRM,
|
|
8
8
|
payload: null
|
|
@@ -11,4 +11,8 @@ export const logout = {
|
|
|
11
11
|
type: actions.CANCEL,
|
|
12
12
|
payload: null
|
|
13
13
|
})
|
|
14
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
actions,
|
|
17
|
+
logout
|
|
18
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
CONFIRM:
|
|
3
|
-
CANCEL:
|
|
1
|
+
const ACTIONS = {
|
|
2
|
+
CONFIRM: "navigation-prompt/CONFIRM",
|
|
3
|
+
CANCEL: "navigation-prompt/CANCEL"
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
const navigationPrompt = {
|
|
6
6
|
confirm: () => ({
|
|
7
7
|
type: ACTIONS.CONFIRM,
|
|
8
8
|
payload: null
|
|
@@ -11,4 +11,8 @@ export const navigationPrompt = {
|
|
|
11
11
|
type: ACTIONS.CANCEL,
|
|
12
12
|
payload: null
|
|
13
13
|
})
|
|
14
|
-
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
ACTIONS,
|
|
17
|
+
navigationPrompt
|
|
18
|
+
};
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { useDispatch, useSelector } from
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
2
|
+
const useAppDispatch = () => useDispatch();
|
|
3
|
+
const useAppSelector = useSelector;
|
|
4
|
+
export {
|
|
5
|
+
useAppDispatch,
|
|
6
|
+
useAppSelector
|
|
7
|
+
};
|
package/dist/es/data/reducers.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { combineReducers } from
|
|
2
|
-
import { waitMessageReducer } from "./wait-message/reducer
|
|
3
|
-
import { errorReducer } from "./error
|
|
4
|
-
import { breakpointReducer } from "./breakpoint
|
|
5
|
-
import { liveMessageReducer } from "./live-message
|
|
6
|
-
|
|
1
|
+
import { combineReducers } from "@reduxjs/toolkit";
|
|
2
|
+
import { waitMessageReducer } from "./wait-message/reducer";
|
|
3
|
+
import { errorReducer } from "./error";
|
|
4
|
+
import { breakpointReducer } from "./breakpoint";
|
|
5
|
+
import { liveMessageReducer } from "./live-message";
|
|
6
|
+
const createReducer = (injectedReducers = {}) => {
|
|
7
7
|
const rootReducer = combineReducers({
|
|
8
8
|
waitMessage: waitMessageReducer,
|
|
9
9
|
error: errorReducer,
|
|
@@ -12,4 +12,7 @@ export const createReducer = (injectedReducers = {}) => {
|
|
|
12
12
|
...injectedReducers
|
|
13
13
|
});
|
|
14
14
|
return rootReducer;
|
|
15
|
-
};
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
createReducer
|
|
18
|
+
};
|
package/dist/es/data/saga.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
RestartOnRemount:
|
|
3
|
-
Daemon:
|
|
4
|
-
OnceTillUnmount:
|
|
5
|
-
};
|
|
1
|
+
const AllowedModes = {
|
|
2
|
+
RestartOnRemount: "RESTART_ON_REMOUNT",
|
|
3
|
+
Daemon: "DAEMON",
|
|
4
|
+
OnceTillUnmount: "ONCE_TILL_UNMOUNT"
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
AllowedModes
|
|
8
|
+
};
|