@elliemae/pui-app-sdk 5.7.1 → 6.0.0-next.10
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/README.md +8 -0
- package/dist/cjs/analytics/appdynamics.js +1 -1
- package/dist/cjs/analytics/page-view-event.js +1 -1
- package/dist/cjs/api/helpers.js +14 -4
- package/dist/cjs/api/users/index.endpoint.cjs +12 -0
- package/dist/cjs/app.config.json +2 -2
- package/dist/cjs/communication/http-client/index.js +2 -2
- package/dist/cjs/communication/http-client/response-interceptor.js +2 -2
- package/dist/cjs/communication/http-client/retry-axios.js +14 -14
- package/dist/cjs/communication/http-client/retry.js +1 -1
- package/dist/cjs/communication/http-client/tests/hello.endpoint.cjs +12 -0
- package/dist/cjs/communication/http-client/tests/private.endpoint.cjs +13 -0
- package/dist/cjs/data/appMiddleware.js +2 -3
- package/dist/cjs/{view/fields/large-text-box/index.js → data/auth-state.js} +24 -20
- package/dist/cjs/data/breakpoint-state.js +46 -0
- package/dist/cjs/data/{error/index.js → error-state.js} +3 -3
- package/dist/cjs/data/errorMiddleware.js +2 -2
- package/dist/cjs/data/listenerMiddleware.js +5 -3
- package/dist/cjs/data/{live-message/index.js → live-message-state.js} +3 -3
- package/dist/cjs/data/{logout/actions.js → logout-actions.js} +6 -16
- package/dist/cjs/data/{navigation-prompt/actions.js → navigation-prompt-actions.js} +6 -16
- package/dist/cjs/data/queryMiddleware.js +3 -1
- package/dist/cjs/data/reducers.js +8 -8
- package/dist/cjs/data/store.js +12 -8
- package/dist/cjs/data/wait-message-state.js +46 -0
- package/dist/cjs/index.js +13 -35
- package/dist/cjs/sideeffect/auth/index.js +4 -4
- package/dist/cjs/sideeffect/error-toast/index.js +3 -3
- package/dist/cjs/sideeffect/wait-message/index.js +3 -3
- package/dist/cjs/utils/app-config/config.js +2 -2
- package/dist/cjs/utils/app-config/index.js +1 -1
- package/dist/cjs/utils/auth/helper.js +2 -2
- package/dist/cjs/utils/auth/index.js +2 -2
- package/dist/cjs/utils/font-size.js +1 -1
- package/dist/cjs/utils/micro-frontend/guest.js +9 -8
- package/dist/cjs/utils/micro-frontend/host.js +10 -8
- package/dist/cjs/utils/micro-frontend/index.js +15 -5
- package/dist/cjs/utils/micro-frontend/ssfguest-adapter.js +1 -1
- package/dist/cjs/utils/session.js +26 -4
- package/dist/cjs/{data/breakpoint/index.js → utils/storybook/main.js} +31 -26
- package/dist/cjs/utils/storybook/manager.js +2 -2
- package/dist/cjs/{data/wait-message/actions.js → utils/storybook/middleware.js} +7 -18
- package/dist/cjs/utils/storybook/preview.js +10 -5
- package/dist/cjs/utils/storybook/theme.js +5 -8
- package/dist/cjs/utils/storybook/vite.js +33 -0
- package/dist/cjs/{view/fields/date-input/index.js → utils/storybook/webpack.js} +22 -20
- package/dist/cjs/utils/testing/index.js +1 -1
- package/dist/cjs/utils/testing/render-with-redux.js +1 -5
- package/dist/cjs/utils/testing/render-with-router-redux.js +1 -2
- package/dist/cjs/utils/url.js +2 -0
- package/dist/cjs/utils/web-storage.js +1 -1
- package/dist/cjs/utils/window.js +1 -1
- package/dist/cjs/view/app-root/hosted-app.js +3 -3
- package/dist/cjs/view/app-root/index.js +2 -0
- package/dist/cjs/view/app-root/stand-alone-app.js +3 -3
- package/dist/cjs/view/app-root/style.js +1 -1
- package/dist/cjs/{data/auth/actions.js → view/app-root/use-prefetch-resources.js} +15 -31
- package/dist/cjs/view/breakpoint/use-breakpoint.js +4 -4
- package/dist/cjs/view/error-boundary/index.js +2 -2
- package/dist/cjs/view/error-toast/index.js +4 -4
- package/dist/cjs/view/fetch-host-app-data/index.js +1 -1
- package/dist/cjs/view/fetch-host-app-data/store.js +12 -2
- package/dist/cjs/view/fields/autocomplete/index.js +4 -1
- package/dist/cjs/view/fields/combo-box-v3/index.js +1 -1
- package/dist/cjs/view/fields/masked-input-text/index.js +1 -1
- package/dist/cjs/view/fields/watch-value.js +1 -1
- package/dist/cjs/view/form/index.js +1 -1
- package/dist/cjs/view/form/personal-info-section.js +5 -7
- package/dist/cjs/view/login/index.js +2 -2
- package/dist/cjs/view/micro-app/app-factory/index.js +17 -7
- package/dist/cjs/view/micro-app/index.js +1 -1
- package/dist/cjs/view/micro-app/resources/script.js +16 -8
- package/dist/cjs/view/micro-app/resources/style.js +14 -1
- package/dist/cjs/view/micro-app/use-app-will-render.js +15 -5
- package/dist/cjs/view/micro-iframe-app/app.js +1 -1
- package/dist/cjs/view/micro-iframe-app/iframe/index.js +1 -2
- package/dist/cjs/view/modals/navigation-prompt/index.js +3 -3
- package/dist/cjs/view/modals/session-expiry/index.js +3 -3
- package/dist/cjs/view/page.js +1 -1
- package/dist/cjs/view/require-auth.js +3 -3
- package/dist/cjs/view/session-timeout/index.js +2 -2
- package/dist/cjs/view/storybook/decorator.js +1 -1
- package/dist/cjs/view/use-window-size-change.js +1 -1
- package/dist/cjs/view/visually-hidden/index.js +2 -1
- package/dist/cjs/view/wait-message/index.js +2 -2
- package/dist/cjs/view/wait-message/wait-message-launcher.js +3 -3
- package/dist/esm/analytics/page-view-event.js +1 -1
- package/dist/esm/api/users/index.endpoint.cjs +12 -0
- package/dist/esm/app.config.json +2 -2
- package/dist/esm/communication/http-client/response-interceptor.js +1 -1
- package/dist/esm/communication/http-client/retry-axios.js +13 -13
- package/dist/esm/communication/http-client/retry.js +1 -1
- package/dist/esm/communication/http-client/tests/hello.endpoint.cjs +12 -0
- package/dist/esm/communication/http-client/tests/private.endpoint.cjs +13 -0
- package/dist/esm/data/appMiddleware.js +2 -3
- package/dist/esm/data/auth-state.js +24 -0
- package/dist/esm/data/breakpoint-state.js +26 -0
- package/dist/esm/data/errorMiddleware.js +2 -2
- package/dist/esm/data/listenerMiddleware.js +5 -3
- package/dist/esm/data/logout-actions.js +8 -0
- package/dist/esm/data/navigation-prompt-actions.js +8 -0
- package/dist/esm/data/queryMiddleware.js +3 -1
- package/dist/esm/data/reducers.js +4 -4
- package/dist/esm/data/store.js +12 -8
- package/dist/esm/data/wait-message-state.js +26 -0
- package/dist/esm/index.js +11 -37
- package/dist/esm/sideeffect/auth/index.js +4 -8
- package/dist/esm/sideeffect/error-toast/index.js +2 -2
- package/dist/esm/sideeffect/wait-message/index.js +3 -3
- package/dist/esm/utils/auth/helper.js +1 -1
- package/dist/esm/utils/auth/index.js +2 -2
- package/dist/esm/utils/font-size.js +1 -1
- package/dist/esm/utils/micro-frontend/guest.js +8 -7
- package/dist/esm/utils/micro-frontend/host.js +6 -4
- package/dist/esm/utils/micro-frontend/index.js +14 -4
- package/dist/esm/utils/session.js +13 -1
- package/dist/esm/utils/storybook/main.js +33 -0
- package/dist/esm/utils/storybook/manager.js +2 -2
- package/dist/esm/utils/storybook/middleware.js +7 -0
- package/dist/esm/utils/storybook/preview.js +10 -5
- package/dist/esm/utils/storybook/theme.js +5 -8
- package/dist/esm/utils/storybook/vite.js +13 -0
- package/dist/esm/utils/storybook/webpack.js +22 -0
- package/dist/esm/utils/testing/index.js +1 -1
- package/dist/esm/utils/testing/render-with-redux.js +1 -5
- package/dist/esm/utils/testing/render-with-router-redux.js +1 -2
- package/dist/esm/utils/url.js +2 -0
- package/dist/esm/utils/window.js +1 -1
- package/dist/esm/view/app-root/hosted-app.js +1 -1
- package/dist/esm/view/app-root/index.js +2 -0
- package/dist/esm/view/app-root/stand-alone-app.js +1 -1
- package/dist/esm/view/app-root/style.js +1 -1
- package/dist/esm/view/app-root/use-prefetch-resources.js +15 -0
- package/dist/esm/view/breakpoint/use-breakpoint.js +7 -4
- package/dist/esm/view/error-boundary/index.js +1 -1
- package/dist/esm/view/error-toast/index.js +3 -3
- package/dist/esm/view/fields/autocomplete/index.js +4 -1
- package/dist/esm/view/fields/combo-box-v3/index.js +1 -1
- package/dist/esm/view/form/personal-info-section.js +5 -7
- package/dist/esm/view/login/index.js +2 -2
- package/dist/esm/view/micro-app/app-factory/index.js +21 -9
- package/dist/esm/view/micro-app/resources/script.js +17 -9
- package/dist/esm/view/micro-app/resources/style.js +15 -2
- package/dist/esm/view/micro-app/use-app-will-render.js +1 -1
- package/dist/esm/view/micro-iframe-app/iframe/index.js +0 -1
- package/dist/esm/view/modals/navigation-prompt/index.js +1 -1
- package/dist/esm/view/modals/session-expiry/index.js +1 -1
- package/dist/esm/view/require-auth.js +1 -1
- package/dist/esm/view/session-timeout/index.js +1 -1
- package/dist/esm/view/storybook/decorator.js +1 -1
- package/dist/esm/view/use-window-size-change.js +1 -1
- package/dist/esm/view/visually-hidden/index.js +1 -0
- package/dist/esm/view/wait-message/index.js +1 -1
- package/dist/esm/view/wait-message/wait-message-launcher.js +1 -1
- package/dist/types/docusaurus.config.d.ts +2 -0
- package/dist/types/lib/api/helpers.d.ts +1 -1
- package/dist/types/lib/communication/http-client/response-interceptor.d.ts +1 -3
- package/dist/types/lib/communication/http-client/retry-axios.d.ts +5 -5
- package/dist/types/lib/data/appMiddleware.d.ts +2 -2
- package/dist/types/lib/data/auth-state.d.ts +28 -0
- package/dist/types/lib/data/breakpoint-state.d.ts +15 -0
- package/dist/types/lib/data/{error/index.d.ts → error-state.d.ts} +5 -1
- package/dist/types/lib/data/listenerMiddleware.d.ts +38 -17
- package/dist/types/lib/data/{live-message/index.d.ts → live-message-state.d.ts} +5 -1
- package/dist/types/lib/data/logout-actions.d.ts +4 -0
- package/dist/types/lib/data/navigation-prompt-actions.d.ts +4 -0
- package/dist/types/lib/data/reducers.d.ts +12 -15
- package/dist/types/lib/data/saga.d.ts +3 -5
- package/dist/types/lib/data/store.d.ts +31 -38
- package/dist/types/lib/data/types.d.ts +6 -6
- package/dist/types/lib/data/wait-message-state.d.ts +17 -0
- package/dist/types/lib/index.d.ts +6 -16
- package/dist/types/lib/sideeffect/auth/index.d.ts +1 -1
- package/dist/types/lib/utils/app-config/config.d.ts +1 -3
- package/dist/types/lib/utils/app-host-integration/react.d.ts +2 -2
- package/dist/types/lib/utils/guest-with-service.d.ts +1 -3
- package/dist/types/lib/utils/micro-frontend/host.d.ts +4 -4
- package/dist/types/lib/utils/micro-frontend/index.d.ts +1 -0
- package/dist/types/lib/utils/micro-frontend/types.d.ts +5 -4
- package/dist/types/lib/utils/session.d.ts +3 -9
- package/dist/types/lib/utils/storybook/main.d.ts +2 -0
- package/dist/types/lib/utils/storybook/manager.d.ts +2 -1
- package/dist/types/lib/utils/storybook/middleware.d.ts +1 -0
- package/dist/types/lib/utils/storybook/preview.d.ts +5 -29
- package/dist/types/lib/utils/storybook/theme.d.ts +2 -5
- package/dist/types/lib/utils/storybook/vite.d.ts +10 -0
- package/dist/types/lib/utils/storybook/webpack.d.ts +17 -0
- package/dist/types/lib/utils/testing/render-with-redux.d.ts +15 -19
- package/dist/types/lib/utils/testing/render-with-router-redux.d.ts +14 -18
- package/dist/types/lib/utils/testing/render-with-router.d.ts +1 -1
- package/dist/types/lib/utils/testing/render-with-state-addons.d.ts +2 -2
- package/dist/types/lib/utils/url.d.ts +1 -0
- package/dist/types/lib/utils/window.d.ts +1 -3
- package/dist/types/lib/view/app-root/hosted-app.d.ts +2 -2
- package/dist/types/lib/view/app-root/index.d.ts +2 -2
- package/dist/types/lib/view/app-root/stand-alone-app.d.ts +2 -2
- package/dist/types/lib/view/app-root/use-prefetch-resources.d.ts +1 -0
- package/dist/types/lib/view/breakpoint/index.stories.d.ts +6 -3
- package/dist/types/lib/view/breakpoint/use-media-query-list.d.ts +1 -1
- package/dist/types/lib/view/error-toast/index.d.ts +1 -4
- package/dist/types/lib/view/error-toast/index.stories.d.ts +12 -5
- package/dist/types/lib/view/fields/autocomplete/advanced-autocomplete.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/autocomplete/async-suggestions-autocomplete.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/autocomplete/index.stories.d.ts +6 -5
- package/dist/types/lib/view/fields/check-box/index.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/check-box/set-value.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/combo-box-v3/index.stories.d.ts +8 -5
- package/dist/types/lib/view/fields/connect-form.d.ts +2 -2
- package/dist/types/lib/view/fields/date-range-picker/index.d.ts +2 -2
- package/dist/types/lib/view/fields/date-range-picker/index.stories.d.ts +8 -7
- package/dist/types/lib/view/fields/date-time-picker/index.stories.d.ts +19 -39
- package/dist/types/lib/view/fields/form-layout-block-item/index.stories.d.ts +8 -4
- package/dist/types/lib/view/fields/input-text/index.stories.d.ts +8 -10
- package/dist/types/lib/view/fields/masked-input-text/index.d.ts +2 -2
- package/dist/types/lib/view/fields/masked-input-text/index.stories.d.ts +10 -0
- package/dist/types/lib/view/fields/toggle/index.stories.d.ts +6 -10
- package/dist/types/lib/view/fields/watch-value.d.ts +2 -2
- package/dist/types/lib/view/form/index.d.ts +2 -2
- package/dist/types/lib/view/form/index.stories.d.ts +7 -3
- package/dist/types/lib/view/form/personal-info-section.d.ts +0 -1
- package/dist/types/lib/view/form/submit-button/index.d.ts +2 -2
- package/dist/types/lib/view/form/usecases.stories.d.ts +9 -12
- package/dist/types/lib/view/live-message/index.stories.d.ts +5 -3
- package/dist/types/lib/view/micro-app/app-factory/index.d.ts +1 -0
- package/dist/types/lib/view/micro-app/resources/manifest.d.ts +1 -1
- package/dist/types/lib/view/micro-app/resources/script.d.ts +4 -0
- package/dist/types/lib/view/micro-app/resources/style.d.ts +4 -0
- package/dist/types/lib/view/micro-app/types.d.ts +2 -2
- package/dist/types/lib/view/micro-app/utils.d.ts +2 -2
- package/dist/types/lib/view/micro-iframe-app/iframe/index.d.ts +2 -2
- package/dist/types/lib/view/modals/error/index.stories.d.ts +9 -6
- package/dist/types/lib/view/modals/navigation-prompt/index.stories.d.ts +9 -10
- package/dist/types/lib/view/modals/session-expiry/index.stories.d.ts +10 -6
- package/dist/types/lib/view/session-timeout/index.stories.d.ts +8 -4
- package/dist/types/lib/view/storybook/decorator.d.ts +1 -1
- package/dist/types/lib/view/visually-hidden/index.d.ts +1 -0
- package/dist/types/lib/view/wait-message/index.stories.d.ts +8 -8
- package/package.json +52 -50
- package/dist/cjs/data/auth/reducer.js +0 -49
- package/dist/cjs/data/wait-message/reducer.js +0 -51
- package/dist/cjs/utils/storybook/cjs/main.js +0 -58
- package/dist/cjs/utils/storybook/cjs/middleware.js +0 -6
- package/dist/cjs/utils/storybook/cjs/vite.js +0 -8
- package/dist/cjs/utils/storybook/cjs/webpack.js +0 -20
- package/dist/cjs/view/fields/combo-box/index.js +0 -50
- package/dist/cjs/view/fields/date-picker/index.js +0 -50
- package/dist/cjs/view/fields/form-item-layout/index.js +0 -43
- package/dist/cjs/view/fields/input-mask/index.js +0 -60
- package/dist/cjs/view/fields/radio/index.js +0 -48
- package/dist/cjs/view/fields/radio-group/index.js +0 -40
- package/dist/cjs/view/fields/text-box/index.js +0 -40
- package/dist/esm/data/auth/actions.js +0 -31
- package/dist/esm/data/auth/reducer.js +0 -19
- package/dist/esm/data/breakpoint/index.js +0 -28
- package/dist/esm/data/logout/actions.js +0 -18
- package/dist/esm/data/navigation-prompt/actions.js +0 -18
- package/dist/esm/data/wait-message/actions.js +0 -18
- package/dist/esm/data/wait-message/reducer.js +0 -21
- package/dist/esm/view/fields/combo-box/index.js +0 -32
- package/dist/esm/view/fields/date-input/index.js +0 -22
- package/dist/esm/view/fields/date-picker/index.js +0 -22
- package/dist/esm/view/fields/form-item-layout/index.js +0 -23
- package/dist/esm/view/fields/input-mask/index.js +0 -42
- package/dist/esm/view/fields/large-text-box/index.js +0 -22
- package/dist/esm/view/fields/radio/index.js +0 -30
- package/dist/esm/view/fields/radio-group/index.js +0 -22
- package/dist/esm/view/fields/text-box/index.js +0 -22
- package/dist/types/lib/data/auth/actions.d.ts +0 -22
- package/dist/types/lib/data/auth/reducer.d.ts +0 -6
- package/dist/types/lib/data/breakpoint/index.d.ts +0 -13
- package/dist/types/lib/data/logout/actions.d.ts +0 -9
- package/dist/types/lib/data/navigation-prompt/actions.d.ts +0 -9
- package/dist/types/lib/data/wait-message/actions.d.ts +0 -14
- package/dist/types/lib/data/wait-message/reducer.d.ts +0 -7
- package/dist/types/lib/utils/storybook/cjs/main.d.ts +0 -66
- package/dist/types/lib/utils/storybook/cjs/middleware.d.ts +0 -2
- package/dist/types/lib/utils/storybook/cjs/vite.d.ts +0 -5
- package/dist/types/lib/utils/storybook/cjs/webpack.d.ts +0 -17
- package/dist/types/lib/view/fields/combo-box/index.d.ts +0 -8
- package/dist/types/lib/view/fields/combo-box/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/date-input/index.d.ts +0 -8
- package/dist/types/lib/view/fields/date-input/index.stories.d.ts +0 -7
- package/dist/types/lib/view/fields/date-picker/index.d.ts +0 -9
- package/dist/types/lib/view/fields/date-picker/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/form-item-layout/index.d.ts +0 -9
- package/dist/types/lib/view/fields/form-item-layout/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/input-mask/index.d.ts +0 -15
- package/dist/types/lib/view/fields/input-mask/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/large-text-box/index.d.ts +0 -9
- package/dist/types/lib/view/fields/large-text-box/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/masked-input-text/with-money-mask.stories.d.ts +0 -11
- package/dist/types/lib/view/fields/masked-input-text/with-percentage-mask.stories.d.ts +0 -11
- package/dist/types/lib/view/fields/radio/index.d.ts +0 -9
- package/dist/types/lib/view/fields/radio/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/radio/set-value.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/radio-group/index.d.ts +0 -8
- package/dist/types/lib/view/fields/radio-group/index.stories.d.ts +0 -5
- package/dist/types/lib/view/fields/text-box/index.d.ts +0 -8
- package/dist/types/lib/view/fields/text-box/index.stories.d.ts +0 -7
- /package/dist/esm/data/{error/index.js → error-state.js} +0 -0
- /package/dist/esm/data/{live-message/index.js → live-message-state.js} +0 -0
- /package/dist/types/lib/api/users/{index.endpoint.d.ts → index.endpoint.d.cts} +0 -0
- /package/dist/types/lib/communication/http-client/tests/{hello.endpoint.d.ts → hello.endpoint.d.cts} +0 -0
- /package/dist/types/lib/communication/http-client/tests/{private.endpoint.d.ts → private.endpoint.d.cts} +0 -0
|
@@ -33,7 +33,7 @@ __export(micro_app_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(micro_app_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"), 1);
|
|
37
37
|
var import_const = require("./const.js");
|
|
38
38
|
var import_use_app_will_render = require("./use-app-will-render.js");
|
|
39
39
|
const Div = import_styled_components.default.div`
|
|
@@ -20,6 +20,7 @@ var script_exports = {};
|
|
|
20
20
|
__export(script_exports, {
|
|
21
21
|
APP_SCRIPT_ID_PREFIX: () => APP_SCRIPT_ID_PREFIX,
|
|
22
22
|
addScriptToDOM: () => addScriptToDOM,
|
|
23
|
+
prefetchScript: () => prefetchScript,
|
|
23
24
|
removeDynamicImportedScripts: () => removeDynamicImportedScripts,
|
|
24
25
|
removePrefetchLinks: () => removePrefetchLinks,
|
|
25
26
|
removeScriptFromDOM: () => removeScriptFromDOM
|
|
@@ -27,8 +28,6 @@ __export(script_exports, {
|
|
|
27
28
|
module.exports = __toCommonJS(script_exports);
|
|
28
29
|
var import_url = require("../../../utils/url.js");
|
|
29
30
|
const APP_SCRIPT_ID_PREFIX = "emui-script-";
|
|
30
|
-
const HEAD_SCRIPTS = /(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/;
|
|
31
|
-
const isHeadScript = (scriptSrc) => HEAD_SCRIPTS.test(scriptSrc);
|
|
32
31
|
const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
33
32
|
if (!hostUrl)
|
|
34
33
|
throw new Error("Unable to add scripts to DOM. hostUrl is required.");
|
|
@@ -37,15 +36,12 @@ const addScriptToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
|
37
36
|
if (!ele)
|
|
38
37
|
reject(new Error("Unable to insert Application scripts."));
|
|
39
38
|
ele.id = `${APP_SCRIPT_ID_PREFIX}${name}-${index}`;
|
|
40
|
-
const url = new URL(fileName, hostUrl);
|
|
39
|
+
const url = (0, import_url.isAbsoluteUrl)(fileName) ? new URL(fileName) : new URL(fileName, hostUrl);
|
|
41
40
|
ele.src = (0, import_url.removeDoubleSlash)(url.href);
|
|
42
41
|
ele.onload = resolve.bind(null, ele.id);
|
|
43
42
|
ele.onerror = reject.bind(null, ele.id);
|
|
44
|
-
ele.
|
|
45
|
-
|
|
46
|
-
documentEle.head.appendChild(ele);
|
|
47
|
-
else
|
|
48
|
-
documentEle.body.appendChild(ele);
|
|
43
|
+
ele.defer = true;
|
|
44
|
+
documentEle.head.appendChild(ele);
|
|
49
45
|
});
|
|
50
46
|
};
|
|
51
47
|
const removeScriptFromDOM = (elementId = "", documentEle = document) => new Promise((resolve) => {
|
|
@@ -75,3 +71,15 @@ const removePrefetchLinks = (hostUrl, documentEle) => {
|
|
|
75
71
|
ele.remove();
|
|
76
72
|
}
|
|
77
73
|
};
|
|
74
|
+
const prefetchScript = ({
|
|
75
|
+
hostUrl,
|
|
76
|
+
fileName
|
|
77
|
+
}) => {
|
|
78
|
+
if (hostUrl && fileName) {
|
|
79
|
+
const url = new URL(fileName, hostUrl);
|
|
80
|
+
const link = document.createElement("link");
|
|
81
|
+
link.rel = "prefetch";
|
|
82
|
+
link.href = (0, import_url.removeDoubleSlash)(url.href);
|
|
83
|
+
document.head.appendChild(link);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
@@ -20,6 +20,7 @@ var style_exports = {};
|
|
|
20
20
|
__export(style_exports, {
|
|
21
21
|
APP_STYLE_ID_PREFIX: () => APP_STYLE_ID_PREFIX,
|
|
22
22
|
addStylesToDOM: () => addStylesToDOM,
|
|
23
|
+
prefetchStyle: () => prefetchStyle,
|
|
23
24
|
removeDynamicImportedStyles: () => removeDynamicImportedStyles,
|
|
24
25
|
removeStyleFromDOM: () => removeStyleFromDOM
|
|
25
26
|
});
|
|
@@ -35,7 +36,7 @@ const addStylesToDOM = ({ name, hostUrl, documentEle }, fileName, index) => {
|
|
|
35
36
|
reject(new Error("Unable to insert Application styles."));
|
|
36
37
|
ele.id = `${APP_STYLE_ID_PREFIX}${name}-${index}`;
|
|
37
38
|
ele.rel = "stylesheet";
|
|
38
|
-
const url = new URL(fileName, hostUrl);
|
|
39
|
+
const url = (0, import_url.isAbsoluteUrl)(fileName) ? new URL(fileName) : new URL(fileName, hostUrl);
|
|
39
40
|
ele.href = (0, import_url.removeDoubleSlash)(url.href);
|
|
40
41
|
ele.onload = resolve.bind(null, ele.id);
|
|
41
42
|
documentEle.head.appendChild(ele);
|
|
@@ -58,3 +59,15 @@ const removeDynamicImportedStyles = (hostUrl, documentEle) => {
|
|
|
58
59
|
ele.remove();
|
|
59
60
|
}
|
|
60
61
|
};
|
|
62
|
+
const prefetchStyle = ({
|
|
63
|
+
hostUrl,
|
|
64
|
+
fileName
|
|
65
|
+
}) => {
|
|
66
|
+
if (hostUrl && fileName) {
|
|
67
|
+
const url = new URL(fileName, hostUrl);
|
|
68
|
+
const link = document.createElement("link");
|
|
69
|
+
link.rel = "prefetch";
|
|
70
|
+
link.href = (0, import_url.removeDoubleSlash)(url.href);
|
|
71
|
+
document.head.appendChild(link);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var use_app_will_render_exports = {};
|
|
20
30
|
__export(use_app_will_render_exports, {
|
|
@@ -22,9 +32,9 @@ __export(use_app_will_render_exports, {
|
|
|
22
32
|
});
|
|
23
33
|
module.exports = __toCommonJS(use_app_will_render_exports);
|
|
24
34
|
var import_react = require("react");
|
|
25
|
-
var
|
|
35
|
+
var import_merge = __toESM(require("lodash/merge"), 1);
|
|
26
36
|
var import_react_redux = require("react-redux");
|
|
27
|
-
var
|
|
37
|
+
var import_wait_message_state = require("../../data/wait-message-state.js");
|
|
28
38
|
var import_app_factory = require("./app-factory/index.js");
|
|
29
39
|
var import_micro_frontend = require("../../utils/micro-frontend/index.js");
|
|
30
40
|
var import_log_records = require("../../utils/log-records.js");
|
|
@@ -57,7 +67,7 @@ const useAppWillRender = ({
|
|
|
57
67
|
const load = (0, import_react.useCallback)(
|
|
58
68
|
async (appConfig) => {
|
|
59
69
|
if (dispatch)
|
|
60
|
-
dispatch(
|
|
70
|
+
dispatch(import_wait_message_state.actions.open());
|
|
61
71
|
try {
|
|
62
72
|
if (ref.current)
|
|
63
73
|
await ref.current;
|
|
@@ -72,7 +82,7 @@ const useAppWillRender = ({
|
|
|
72
82
|
throw ex;
|
|
73
83
|
}
|
|
74
84
|
if (dispatch)
|
|
75
|
-
dispatch(
|
|
85
|
+
dispatch(import_wait_message_state.actions.close());
|
|
76
86
|
},
|
|
77
87
|
[dispatch, unload]
|
|
78
88
|
);
|
|
@@ -80,7 +90,7 @@ const useAppWillRender = ({
|
|
|
80
90
|
if (!documentEle)
|
|
81
91
|
return () => {
|
|
82
92
|
};
|
|
83
|
-
const appConfig = (0,
|
|
93
|
+
const appConfig = (0, import_merge.default)(getConfig(), {
|
|
84
94
|
documentEle,
|
|
85
95
|
history,
|
|
86
96
|
theme,
|
|
@@ -33,7 +33,7 @@ __export(app_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(app_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_iframe = __toESM(require("./iframe.html?resource"));
|
|
36
|
+
var import_iframe = __toESM(require("./iframe.html?resource"), 1);
|
|
37
37
|
var import_iframe2 = require("./iframe/index.js");
|
|
38
38
|
var import_use_frame_loaded = require("./use-frame-loaded.js");
|
|
39
39
|
var import_use_app_will_render = require("../micro-app/use-app-will-render.js");
|
|
@@ -33,7 +33,7 @@ __export(iframe_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(iframe_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"), 1);
|
|
37
37
|
var import_const = require("./const.js");
|
|
38
38
|
const Div = import_styled_components.default.div`
|
|
39
39
|
display: flex;
|
|
@@ -61,7 +61,6 @@ const IFrame = (0, import_react.memo)(
|
|
|
61
61
|
ref: frameRef,
|
|
62
62
|
title,
|
|
63
63
|
src,
|
|
64
|
-
scrolling: "no",
|
|
65
64
|
...sandboxProps,
|
|
66
65
|
onLoad: () => frameRef?.current?.contentDocument && onFrameReady(frameRef.current.contentDocument)
|
|
67
66
|
}
|
|
@@ -27,12 +27,12 @@ var import_ds_icons = require("@elliemae/ds-icons");
|
|
|
27
27
|
var import_ds_button = require("@elliemae/ds-button");
|
|
28
28
|
var import_ds_dialog = require("@elliemae/ds-dialog");
|
|
29
29
|
var import_react2 = require("../../../data/react.js");
|
|
30
|
-
var
|
|
30
|
+
var import_navigation_prompt_actions = require("../../../data/navigation-prompt-actions.js");
|
|
31
31
|
const NavigationPrompt = (0, import_react.memo)(
|
|
32
32
|
({ open = false }) => {
|
|
33
33
|
const dispatch = (0, import_react2.useAppDispatch)();
|
|
34
|
-
const cancelDialog = () => dispatch(
|
|
35
|
-
const confirmDialog = () => dispatch(
|
|
34
|
+
const cancelDialog = () => dispatch(import_navigation_prompt_actions.navigationPrompt.cancel());
|
|
35
|
+
const confirmDialog = () => dispatch(import_navigation_prompt_actions.navigationPrompt.confirm());
|
|
36
36
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_dialog.DSDialog, { isOpen: open, onClickOutside: cancelDialog, centered: true, children: [
|
|
37
37
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_dialog.DSDialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_dialog.DSDialogAddon, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_button.DSButtonV2, { buttonType: "icon", onClick: cancelDialog, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.Close, { color: ["neutral", "900"] }) }) }) }),
|
|
38
38
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_dialog.DSDialogSeparator, {}),
|
|
@@ -28,7 +28,7 @@ var import_ds_icons = require("@elliemae/ds-icons");
|
|
|
28
28
|
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
29
29
|
var import_ds_dialog = require("@elliemae/ds-dialog");
|
|
30
30
|
var import_react2 = require("../../../data/react.js");
|
|
31
|
-
var
|
|
31
|
+
var import_logout_actions = require("../../../data/logout-actions.js");
|
|
32
32
|
var import_session = require("../../../utils/session.js");
|
|
33
33
|
var import_customHooks = require("./customHooks.js");
|
|
34
34
|
const SessionExpiry = (0, import_react.memo)(
|
|
@@ -46,11 +46,11 @@ const SessionExpiry = (0, import_react.memo)(
|
|
|
46
46
|
setIsOpen(false);
|
|
47
47
|
(0, import_session.resetUserIdleTime)(true);
|
|
48
48
|
(0, import_session.addEventListeners)();
|
|
49
|
-
dispatch(
|
|
49
|
+
dispatch(import_logout_actions.logout.cancel());
|
|
50
50
|
};
|
|
51
51
|
const logoutSession = () => {
|
|
52
52
|
setIsOpen(false);
|
|
53
|
-
dispatch(
|
|
53
|
+
dispatch(import_logout_actions.logout.confirm());
|
|
54
54
|
};
|
|
55
55
|
return timeLeft ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_dialog.DSDialog, { onKeyDown: handleOnKeyDown, isOpen, size: "small", children: [
|
|
56
56
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_dialog.DSDialogBody, { p: "s", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_ds_dialog.DSDialogDefaultLayout, { children: [
|
package/dist/cjs/view/page.js
CHANGED
|
@@ -34,7 +34,7 @@ __export(page_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(page_exports);
|
|
35
35
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
36
|
var import_react_helmet = require("react-helmet");
|
|
37
|
-
var brum = __toESM(require("@elliemae/pui-user-monitoring"));
|
|
37
|
+
var brum = __toESM(require("@elliemae/pui-user-monitoring"), 1);
|
|
38
38
|
var import_page_view_event = require("../analytics/page-view-event.js");
|
|
39
39
|
const onPageView = (pageTitle) => {
|
|
40
40
|
try {
|
|
@@ -33,8 +33,8 @@ __export(require_auth_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(require_auth_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_redux_injectors = require("redux-injectors");
|
|
36
|
-
var import_constants = __toESM(require("../utils/constants.js"));
|
|
37
|
-
var
|
|
36
|
+
var import_constants = __toESM(require("../utils/constants.js"), 1);
|
|
37
|
+
var import_auth_state = require("../data/auth-state.js");
|
|
38
38
|
var import_auth = require("../sideeffect/auth/index.js");
|
|
39
39
|
var import_login = require("./login/index.js");
|
|
40
40
|
var import_auth2 = require("../utils/auth/index.js");
|
|
@@ -48,7 +48,7 @@ const RequireAuth = ({
|
|
|
48
48
|
const AuthManager = (0, import_redux_injectors.createManager)({
|
|
49
49
|
name: "AuthManager",
|
|
50
50
|
key,
|
|
51
|
-
reducer:
|
|
51
|
+
reducer: import_auth_state.authReducer,
|
|
52
52
|
saga: import_auth.authentication
|
|
53
53
|
});
|
|
54
54
|
const userAuthorized = (0, import_auth2.isUserAuthorized)();
|
|
@@ -24,7 +24,7 @@ module.exports = __toCommonJS(session_timeout_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
var import_react2 = require("../../data/react.js");
|
|
27
|
-
var
|
|
27
|
+
var import_logout_actions = require("../../data/logout-actions.js");
|
|
28
28
|
var import_session = require("../../utils/session.js");
|
|
29
29
|
var import_session_expiry = require("../modals/session-expiry/index.js");
|
|
30
30
|
const SessionTimeout = () => {
|
|
@@ -47,7 +47,7 @@ const SessionTimeout = () => {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
const sessionExpiredCb = (0, import_session.subscribeToSessionExpiry)(() => {
|
|
50
|
-
dispatch(
|
|
50
|
+
dispatch(import_logout_actions.logout.confirm());
|
|
51
51
|
setSessionExpiryWarning(false);
|
|
52
52
|
});
|
|
53
53
|
return () => {
|
|
@@ -24,4 +24,4 @@ module.exports = __toCommonJS(decorator_exports);
|
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_history = require("../../utils/history.js");
|
|
26
26
|
var import_app_root = require("../app-root/index.js");
|
|
27
|
-
const withAppDecorator = (theme, store,
|
|
27
|
+
const withAppDecorator = (theme, store, Story) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_app_root.AppRoot, { store, history: import_history.browserHistory, theme, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Story, {}) });
|
|
@@ -28,7 +28,7 @@ const useWindowSizeChange = () => {
|
|
|
28
28
|
(0, import_react.useEffect)(() => {
|
|
29
29
|
if (window.ResizeObserver) {
|
|
30
30
|
const observer = new ResizeObserver((entries) => {
|
|
31
|
-
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_RESIZED, entries
|
|
31
|
+
(0, import_pubsub_js.publish)(import_constants.HOST_WINDOW_RESIZED, entries?.[0]);
|
|
32
32
|
});
|
|
33
33
|
observer.observe(window.document.documentElement);
|
|
34
34
|
return () => {
|
|
@@ -33,7 +33,8 @@ __export(visually_hidden_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(visually_hidden_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"), 1);
|
|
37
|
+
var import_core = require("@emotion/core");
|
|
37
38
|
const Span = import_styled_components.default.span`
|
|
38
39
|
border: 0;
|
|
39
40
|
clip: rect(0 0 0 0);
|
|
@@ -33,7 +33,7 @@ __export(wait_message_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(wait_message_exports);
|
|
34
34
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
35
|
var import_react = require("react");
|
|
36
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
36
|
+
var import_styled_components = __toESM(require("styled-components"), 1);
|
|
37
37
|
var import_ds_backdrop = require("@elliemae/ds-backdrop");
|
|
38
38
|
var import_ds_circular_progress_indicator = require("@elliemae/ds-circular-progress-indicator");
|
|
39
39
|
var import_react2 = require("../../data/react.js");
|
|
@@ -74,7 +74,7 @@ const WaitMessage = (0, import_react.memo)(
|
|
|
74
74
|
}, [isOpen]);
|
|
75
75
|
(0, import_use_html_wait_message.useHTMLWaitMessage)(isOpen !== null);
|
|
76
76
|
return show ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
77
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_backdrop.DSBackdrop, { zIndex: theme
|
|
77
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_backdrop.DSBackdrop, { zIndex: theme?.zIndex?.loader }),
|
|
78
78
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
79
79
|
StyledCircularIndicator,
|
|
80
80
|
{
|
|
@@ -23,13 +23,13 @@ __export(wait_message_launcher_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(wait_message_launcher_exports);
|
|
24
24
|
var import_react = require("react");
|
|
25
25
|
var import_react2 = require("../../data/react.js");
|
|
26
|
-
var
|
|
26
|
+
var import_wait_message_state = require("../../data/wait-message-state.js");
|
|
27
27
|
const WaitMessageLauncher = () => {
|
|
28
28
|
const dispatch = (0, import_react2.useAppDispatch)();
|
|
29
29
|
(0, import_react.useEffect)(() => {
|
|
30
|
-
dispatch(
|
|
30
|
+
dispatch(import_wait_message_state.actions.open());
|
|
31
31
|
return () => {
|
|
32
|
-
dispatch(
|
|
32
|
+
dispatch(import_wait_message_state.actions.close());
|
|
33
33
|
};
|
|
34
34
|
}, [dispatch]);
|
|
35
35
|
return null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const router = express.Router();
|
|
3
|
+
// eslint-disable-next-line import/extensions
|
|
4
|
+
const users = require('./users.json');
|
|
5
|
+
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
res.json(users);
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = (app) => {
|
|
11
|
+
app.use('/sdk/users', router);
|
|
12
|
+
};
|
package/dist/esm/app.config.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"appId": "app-sdk",
|
|
3
3
|
"activeEnv": "localhost",
|
|
4
|
-
"sessionTimeoutWarnInterval": "
|
|
5
|
-
"sessionTimeoutInterval": "
|
|
4
|
+
"sessionTimeoutWarnInterval": "600000",
|
|
5
|
+
"sessionTimeoutInterval": "700000",
|
|
6
6
|
"serviceEndpoints": {
|
|
7
7
|
"api": "",
|
|
8
8
|
"idp": "https://int.idp.ellielabs.com",
|
|
@@ -6,7 +6,7 @@ const onAuthorizationFailure = (callback) => {
|
|
|
6
6
|
};
|
|
7
7
|
const handleSuccess = (response) => response;
|
|
8
8
|
const handleFailure = (error) => {
|
|
9
|
-
const { status } =
|
|
9
|
+
const { status } = error?.response ?? {};
|
|
10
10
|
if (status === HTTP_UNAUTHORIZED && unAuthorizedFailureHandler && typeof unAuthorizedFailureHandler === "function") {
|
|
11
11
|
return unAuthorizedFailureHandler(error).then((authorizationHeader) => {
|
|
12
12
|
const { config } = error;
|
|
@@ -10,13 +10,13 @@ const shouldRetryRequest = (err) => {
|
|
|
10
10
|
if (!config || config.retry === 0) {
|
|
11
11
|
return false;
|
|
12
12
|
}
|
|
13
|
-
if (!err.response && (config.currentRetryAttempt
|
|
13
|
+
if (!err.response && (config.currentRetryAttempt ?? 0) >= config.noResponseRetries) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
if (!err.config.method || config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
|
-
if (err.response
|
|
19
|
+
if (err.response?.status) {
|
|
20
20
|
let isInRange = false;
|
|
21
21
|
for (const [min, max] of config.statusCodesToRetry) {
|
|
22
22
|
const { status } = err.response;
|
|
@@ -29,7 +29,7 @@ const shouldRetryRequest = (err) => {
|
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
config.currentRetryAttempt = config.currentRetryAttempt
|
|
32
|
+
config.currentRetryAttempt = config.currentRetryAttempt ?? 0;
|
|
33
33
|
if (config.currentRetryAttempt >= config.retry) {
|
|
34
34
|
return false;
|
|
35
35
|
}
|
|
@@ -39,19 +39,19 @@ const onError = (err) => {
|
|
|
39
39
|
if (!err.config) {
|
|
40
40
|
return Promise.reject(err);
|
|
41
41
|
}
|
|
42
|
-
const config = err.config.retryConfig
|
|
43
|
-
config.currentRetryAttempt = config.currentRetryAttempt
|
|
44
|
-
config.retry = config.retry
|
|
45
|
-
config.retryDelay = config.retryDelay
|
|
46
|
-
config.instance = config.instance
|
|
47
|
-
config.httpMethodsToRetry = config.httpMethodsToRetry
|
|
42
|
+
const config = err.config.retryConfig ?? {};
|
|
43
|
+
config.currentRetryAttempt = config.currentRetryAttempt ?? 0;
|
|
44
|
+
config.retry = config.retry ?? 3;
|
|
45
|
+
config.retryDelay = config.retryDelay ?? 100;
|
|
46
|
+
config.instance = config.instance ?? axios;
|
|
47
|
+
config.httpMethodsToRetry = config.httpMethodsToRetry ?? [
|
|
48
48
|
"GET",
|
|
49
49
|
"HEAD",
|
|
50
50
|
"PUT",
|
|
51
51
|
"OPTIONS",
|
|
52
52
|
"DELETE"
|
|
53
53
|
];
|
|
54
|
-
config.noResponseRetries = config.noResponseRetries
|
|
54
|
+
config.noResponseRetries = config.noResponseRetries ?? 2;
|
|
55
55
|
const retryRanges = [
|
|
56
56
|
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
|
|
57
57
|
// 1xx - Retry (Informational, request still processing)
|
|
@@ -64,9 +64,9 @@ const onError = (err) => {
|
|
|
64
64
|
[429, 429],
|
|
65
65
|
[500, 599]
|
|
66
66
|
];
|
|
67
|
-
config.statusCodesToRetry = config.statusCodesToRetry
|
|
67
|
+
config.statusCodesToRetry = config.statusCodesToRetry ?? retryRanges;
|
|
68
68
|
err.config.retryConfig = config;
|
|
69
|
-
const shouldRetryFn = config.shouldRetry
|
|
69
|
+
const shouldRetryFn = config.shouldRetry ?? shouldRetryRequest;
|
|
70
70
|
if (!shouldRetryFn(err)) {
|
|
71
71
|
return Promise.reject(err);
|
|
72
72
|
}
|
|
@@ -83,7 +83,7 @@ const attach = (instance) => {
|
|
|
83
83
|
return instance?.interceptors?.response ? instance.interceptors.response.use(onFulfilled, onError) : null;
|
|
84
84
|
};
|
|
85
85
|
const getConfig = (err) => {
|
|
86
|
-
if (err
|
|
86
|
+
if (err?.config) {
|
|
87
87
|
return err.config.retryConfig;
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
@@ -27,7 +27,7 @@ const getRaxConfig = (httpClient) => ({
|
|
|
27
27
|
// retry attempts have been made
|
|
28
28
|
onRetryAttempt: (err) => {
|
|
29
29
|
const cfg = getConfig(err);
|
|
30
|
-
if (cfg
|
|
30
|
+
if (cfg?.currentRetryAttempt)
|
|
31
31
|
console.log(`Retry attempt #${cfg.currentRetryAttempt}`);
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* Important: This file should use CommonJS import exports rather ES6 import and export */
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const router = express.Router();
|
|
4
|
+
|
|
5
|
+
// define the route
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
res.json({ name: 'pui-app-sdk' });
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
module.exports = (app) => {
|
|
11
|
+
app.use('/hello', router);
|
|
12
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* Important: This file should use CommonJS import exports rather ES6 import and export */
|
|
2
|
+
const express = require('express');
|
|
3
|
+
const router = express.Router();
|
|
4
|
+
|
|
5
|
+
// define the route
|
|
6
|
+
router.get('/', (req, res) => {
|
|
7
|
+
if (req.headers.authorization !== 'pui') res.status(401).send('unauthorized');
|
|
8
|
+
else res.send({ message: 'you are viewing a private message' });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = (app) => {
|
|
12
|
+
app.use('/private', router);
|
|
13
|
+
};
|
|
@@ -4,9 +4,8 @@ let store;
|
|
|
4
4
|
const appMiddleware = (_store) => {
|
|
5
5
|
store = _store;
|
|
6
6
|
const dispatchFns = Array.from(middlewareDispatchFns.values());
|
|
7
|
-
return (next) => (action) => (
|
|
8
|
-
|
|
9
|
-
compose(...dispatchFns)(next)(action)
|
|
7
|
+
return (next) => (action) => compose(...dispatchFns)(next)(
|
|
8
|
+
action
|
|
10
9
|
);
|
|
11
10
|
};
|
|
12
11
|
const addMiddleware = ({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createSlice, createAction } from "@reduxjs/toolkit";
|
|
2
|
+
const initialState = {
|
|
3
|
+
authenticated: false
|
|
4
|
+
};
|
|
5
|
+
const authSlice = createSlice({
|
|
6
|
+
name: "auth",
|
|
7
|
+
initialState,
|
|
8
|
+
reducers: {
|
|
9
|
+
loginSuccess: (state) => {
|
|
10
|
+
state.authenticated = true;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const { actions } = authSlice;
|
|
15
|
+
const authActions = Object.assign(actions, {
|
|
16
|
+
login: createAction("auth/login"),
|
|
17
|
+
logout: createAction("auth/logout")
|
|
18
|
+
});
|
|
19
|
+
const authReducer = authSlice.reducer;
|
|
20
|
+
export {
|
|
21
|
+
authActions as actions,
|
|
22
|
+
authReducer,
|
|
23
|
+
initialState
|
|
24
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
2
|
+
var Breakpoints = /* @__PURE__ */ ((Breakpoints2) => {
|
|
3
|
+
Breakpoints2["LARGE"] = "large";
|
|
4
|
+
Breakpoints2["MEDIUM"] = "medium";
|
|
5
|
+
Breakpoints2["SMALL"] = "small";
|
|
6
|
+
return Breakpoints2;
|
|
7
|
+
})(Breakpoints || {});
|
|
8
|
+
const initialState = {
|
|
9
|
+
value: "large" /* LARGE */
|
|
10
|
+
};
|
|
11
|
+
const breakpointSlice = createSlice({
|
|
12
|
+
name: "breakpoint",
|
|
13
|
+
initialState,
|
|
14
|
+
reducers: {
|
|
15
|
+
change: (state, action) => {
|
|
16
|
+
state.value = action.payload;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const { actions } = breakpointSlice;
|
|
21
|
+
const breakpointReducer = breakpointSlice.reducer;
|
|
22
|
+
export {
|
|
23
|
+
Breakpoints,
|
|
24
|
+
actions,
|
|
25
|
+
breakpointReducer
|
|
26
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isRejectedWithValue } from "@reduxjs/toolkit";
|
|
2
|
-
import { actions as error } from "./error
|
|
2
|
+
import { actions as error } from "./error-state.js";
|
|
3
3
|
const errorMiddleware = (api) => (next) => (action) => {
|
|
4
4
|
if (isRejectedWithValue(action)) {
|
|
5
|
-
api.dispatch(error.set({ messageText: action?.error?.
|
|
5
|
+
api.dispatch(error.set({ messageText: action?.error?.message }));
|
|
6
6
|
}
|
|
7
7
|
return next(action);
|
|
8
8
|
};
|
|
@@ -4,13 +4,15 @@ import {
|
|
|
4
4
|
removeListener
|
|
5
5
|
} from "@reduxjs/toolkit";
|
|
6
6
|
const listenerMiddleware = createListenerMiddleware();
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const getListenerMiddleware = () => listenerMiddleware.middleware;
|
|
8
|
+
const startSideEffect = listenerMiddleware.startListening.withTypes();
|
|
9
|
+
const createSideEffect = addListener.withTypes();
|
|
10
|
+
const removeSideEffect = removeListener.withTypes();
|
|
10
11
|
const clearSideEffects = listenerMiddleware.clearListeners;
|
|
11
12
|
export {
|
|
12
13
|
clearSideEffects,
|
|
13
14
|
createSideEffect,
|
|
15
|
+
getListenerMiddleware,
|
|
14
16
|
listenerMiddleware,
|
|
15
17
|
removeSideEffect,
|
|
16
18
|
startSideEffect
|
|
@@ -5,7 +5,9 @@ const queryMiddleware = (_store) => {
|
|
|
5
5
|
store = _store;
|
|
6
6
|
return (next) => (action) => (
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8
|
-
compose(...middlewareDispatchFns.values())(next)(
|
|
8
|
+
compose(...middlewareDispatchFns.values())(next)(
|
|
9
|
+
action
|
|
10
|
+
)
|
|
9
11
|
);
|
|
10
12
|
};
|
|
11
13
|
const addMiddleware = ({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { combineReducers } from "@reduxjs/toolkit";
|
|
2
|
-
import { waitMessageReducer } from "./wait-message
|
|
3
|
-
import { errorReducer } from "./error
|
|
4
|
-
import { breakpointReducer } from "./breakpoint
|
|
5
|
-
import { liveMessageReducer } from "./live-message
|
|
2
|
+
import { waitMessageReducer } from "./wait-message-state.js";
|
|
3
|
+
import { errorReducer } from "./error-state.js";
|
|
4
|
+
import { breakpointReducer } from "./breakpoint-state.js";
|
|
5
|
+
import { liveMessageReducer } from "./live-message-state.js";
|
|
6
6
|
const createReducer = (injectedReducers = {}) => {
|
|
7
7
|
const rootReducer = combineReducers({
|
|
8
8
|
waitMessage: waitMessageReducer,
|