@elliemae/pui-app-sdk 5.45.0 → 5.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/docs/404.html +2 -2
- package/build/docs/api/classes/Analytics/index.html +2 -2
- package/build/docs/api/classes/CMicroAppGuest/index.html +2 -2
- package/build/docs/api/classes/CMicroAppHost/index.html +2 -2
- package/build/docs/api/classes/ErrorBoundary/index.html +2 -2
- package/build/docs/api/classes/GuestModule/index.html +2 -2
- package/build/docs/api/functions/AppRoot/index.html +2 -2
- package/build/docs/api/functions/Autocomplete/index.html +2 -2
- package/build/docs/api/functions/CheckBox/index.html +2 -2
- package/build/docs/api/functions/ComboBox/index.html +2 -2
- package/build/docs/api/functions/ComboBoxV3/index.html +2 -2
- package/build/docs/api/functions/ConnectForm/index.html +2 -2
- package/build/docs/api/functions/DateInput/index.html +2 -2
- package/build/docs/api/functions/DatePicker/index.html +2 -2
- package/build/docs/api/functions/DateRangePicker/index.html +2 -2
- package/build/docs/api/functions/DateTimePicker/index.html +2 -2
- package/build/docs/api/functions/Form/index.html +2 -2
- package/build/docs/api/functions/FormItemLayout/index.html +2 -2
- package/build/docs/api/functions/FormLayoutBlockItem/index.html +2 -2
- package/build/docs/api/functions/FormSubmitButton/index.html +2 -2
- package/build/docs/api/functions/InputMask/index.html +2 -2
- package/build/docs/api/functions/InputText/index.html +2 -2
- package/build/docs/api/functions/LargeTextBox/index.html +2 -2
- package/build/docs/api/functions/MaskedInputText/index.html +2 -2
- package/build/docs/api/functions/Page/index.html +2 -2
- package/build/docs/api/functions/Radio/index.html +2 -2
- package/build/docs/api/functions/RadioGroup/index.html +2 -2
- package/build/docs/api/functions/RegisterService/index.html +2 -2
- package/build/docs/api/functions/RenderWithStateAddOns/index.html +2 -2
- package/build/docs/api/functions/RequireAuth/index.html +2 -2
- package/build/docs/api/functions/SessionTimeout/index.html +2 -2
- package/build/docs/api/functions/TextBox/index.html +2 -2
- package/build/docs/api/functions/Toggle/index.html +2 -2
- package/build/docs/api/functions/authSaga/index.html +2 -2
- package/build/docs/api/functions/authorize/index.html +2 -2
- package/build/docs/api/functions/buildModuleParams/index.html +2 -2
- package/build/docs/api/functions/cleanup/index.html +2 -2
- package/build/docs/api/functions/configureStore/index.html +2 -2
- package/build/docs/api/functions/createGuestModule/index.html +2 -2
- package/build/docs/api/functions/createManager/index.html +2 -2
- package/build/docs/api/functions/enableReactAppForHostIntegration/index.html +2 -2
- package/build/docs/api/functions/fetchHostAppData/index.html +2 -2
- package/build/docs/api/functions/fetchUserSettings/index.html +2 -2
- package/build/docs/api/functions/getApiActionCreator/index.html +2 -2
- package/build/docs/api/functions/getAppConfig/index.html +2 -2
- package/build/docs/api/functions/getAppConfigValue/index.html +2 -2
- package/build/docs/api/functions/getAuthHTTPClient/index.html +4 -4
- package/build/docs/api/functions/getAuthorizationHeader/index.html +2 -2
- package/build/docs/api/functions/getHTTPClient/index.html +4 -4
- package/build/docs/api/functions/getHostAppDataByKey/index.html +2 -2
- package/build/docs/api/functions/getLogger/index.html +2 -2
- package/build/docs/api/functions/getMicroFrontEndAppConfig/index.html +2 -2
- package/build/docs/api/functions/getNavigationLinks/index.html +2 -2
- package/build/docs/api/functions/getRedirectUrl/index.html +2 -2
- package/build/docs/api/functions/getSelectField/index.html +2 -2
- package/build/docs/api/functions/getStore/index.html +2 -2
- package/build/docs/api/functions/initServiceWorker/index.html +2 -2
- package/build/docs/api/functions/isCIBuild/index.html +2 -2
- package/build/docs/api/functions/isProd/index.html +2 -2
- package/build/docs/api/functions/isUserAuthorized/index.html +2 -2
- package/build/docs/api/functions/listenStorageEvents/index.html +2 -2
- package/build/docs/api/functions/loadAppConfig/index.html +2 -2
- package/build/docs/api/functions/loadable/index.html +2 -2
- package/build/docs/api/functions/login/index.html +2 -2
- package/build/docs/api/functions/notifyGuestUnloadComplete/index.html +2 -2
- package/build/docs/api/functions/onAuthorizationFailure/index.html +2 -2
- package/build/docs/api/functions/onGuestUnloadStart/index.html +2 -2
- package/build/docs/api/functions/redactPii/index.html +2 -2
- package/build/docs/api/functions/removeDoubleSlash/index.html +2 -2
- package/build/docs/api/functions/removeStorageEvents/index.html +2 -2
- package/build/docs/api/functions/render/index.html +2 -2
- package/build/docs/api/functions/renderHook/index.html +2 -2
- package/build/docs/api/functions/renderWithHostData/index.html +2 -2
- package/build/docs/api/functions/renderWithRedux/index.html +2 -2
- package/build/docs/api/functions/renderWithRouter/index.html +2 -2
- package/build/docs/api/functions/renderWithRouterRedux/index.html +2 -2
- package/build/docs/api/functions/sdkBaseQuery/index.html +2 -2
- package/build/docs/api/functions/sendBAEvent/index.html +2 -2
- package/build/docs/api/functions/sendMessageToHost/index.html +2 -2
- package/build/docs/api/functions/setAppConfig/index.html +2 -2
- package/build/docs/api/functions/setAppConfigValue/index.html +2 -2
- package/build/docs/api/functions/setHostAppData/index.html +2 -2
- package/build/docs/api/functions/setLoginParams/index.html +2 -2
- package/build/docs/api/functions/setSessionTimeoutInterval/index.html +10 -7
- package/build/docs/api/functions/subscribeToResetSession/index.html +2 -2
- package/build/docs/api/functions/subscribeToSessionExpiry/index.html +2 -2
- package/build/docs/api/functions/subscribeToSessionExpiryWarning/index.html +2 -2
- package/build/docs/api/functions/trackActivity/index.html +2 -2
- package/build/docs/api/functions/useAppDispatch/index.html +2 -2
- package/build/docs/api/functions/useAppMiddleware/index.html +2 -2
- package/build/docs/api/functions/useInjectQuery/index.html +2 -2
- package/build/docs/api/functions/useInjectReducer/index.html +2 -2
- package/build/docs/api/functions/useInjectSaga/index.html +2 -2
- package/build/docs/api/functions/useInjectSideEffect/index.html +2 -2
- package/build/docs/api/functions/useMediaQueryList/index.html +2 -2
- package/build/docs/api/functions/useStateSelector/index.html +2 -2
- package/build/docs/api/functions/useStateSelectorShallow/index.html +2 -2
- package/build/docs/api/functions/waitFor/index.html +2 -2
- package/build/docs/api/functions/waitForElementToBeRemoved/index.html +2 -2
- package/build/docs/api/functions/withAppDecorator/index.html +2 -2
- package/build/docs/api/index.html +2 -2
- package/build/docs/api/interfaces/AppConfig/index.html +2 -2
- package/build/docs/api/interfaces/GuestProps/index.html +2 -2
- package/build/docs/api/interfaces/UseStateSelectorOptions/index.html +2 -2
- package/build/docs/api/type-aliases/AppDispatch/index.html +2 -2
- package/build/docs/api/type-aliases/AppStore/index.html +2 -2
- package/build/docs/api/type-aliases/Await/index.html +2 -2
- package/build/docs/api/type-aliases/EMUI/index.html +2 -2
- package/build/docs/api/type-aliases/HostOptions/index.html +2 -2
- package/build/docs/api/type-aliases/HostProvidedParams/index.html +2 -2
- package/build/docs/api/type-aliases/ModuleOverrides/index.html +2 -2
- package/build/docs/api/type-aliases/OnHostInitCallback/index.html +2 -2
- package/build/docs/api/type-aliases/OnInitCallback/index.html +2 -2
- package/build/docs/api/type-aliases/OnMountCallback/index.html +2 -2
- package/build/docs/api/type-aliases/OnUnMountCallback/index.html +2 -2
- package/build/docs/api/type-aliases/RootState/index.html +2 -2
- package/build/docs/api/type-aliases/SelectStateFieldFunction/index.html +2 -2
- package/build/docs/api/variables/ErrorToast/index.html +2 -2
- package/build/docs/api/variables/FormPropsContext/index.html +2 -2
- package/build/docs/api/variables/GuestMicroApp/index.html +2 -2
- package/build/docs/api/variables/MASK_PIPES/index.html +2 -2
- package/build/docs/api/variables/MASK_TYPES/index.html +2 -2
- package/build/docs/api/variables/MicroApp/index.html +2 -2
- package/build/docs/api/variables/MicroIFrameApp/index.html +2 -2
- package/build/docs/api/variables/NavigationPrompt/index.html +2 -2
- package/build/docs/api/variables/NavigationPromptActions/index.html +2 -2
- package/build/docs/api/variables/Themes/index.html +2 -2
- package/build/docs/api/variables/VisuallyHidden/index.html +2 -2
- package/build/docs/api/variables/WaitMessage/index.html +2 -2
- package/build/docs/api/variables/act/index.html +2 -2
- package/build/docs/api/variables/ariaLive/index.html +2 -2
- package/build/docs/api/variables/auth/index.html +2 -2
- package/build/docs/api/variables/authReducer/index.html +2 -2
- package/build/docs/api/variables/clearSideEffects/index.html +2 -2
- package/build/docs/api/variables/createSideEffect/index.html +2 -2
- package/build/docs/api/variables/decorators/index.html +2 -2
- package/build/docs/api/variables/endSession/index.html +2 -2
- package/build/docs/api/variables/error/index.html +2 -2
- package/build/docs/api/variables/errorMiddleware/index.html +2 -2
- package/build/docs/api/variables/fireEvent/index.html +2 -2
- package/build/docs/api/variables/globalConstants/index.html +2 -2
- package/build/docs/api/variables/history/index.html +2 -2
- package/build/docs/api/variables/httpClientProps/index.html +2 -2
- package/build/docs/api/variables/logout/index.html +2 -2
- package/build/docs/api/variables/memoryHistory/index.html +2 -2
- package/build/docs/api/variables/removeSideEffect/index.html +2 -2
- package/build/docs/api/variables/resetUserIdleTime/index.html +2 -2
- package/build/docs/api/variables/screen/index.html +2 -2
- package/build/docs/api/variables/startSideEffect/index.html +2 -2
- package/build/docs/api/variables/updateBAEventParameters/index.html +2 -2
- package/build/docs/api/variables/useAppSelector/index.html +2 -2
- package/build/docs/api/variables/waitMessageAction/index.html +2 -2
- package/build/docs/api/variables/within/index.html +2 -2
- package/build/docs/assets/js/04ee7372.96ded94a.js +1 -0
- package/build/docs/assets/js/{3204d46b.c17c7438.js → 3204d46b.1407c7c7.js} +1 -1
- package/build/docs/assets/js/77982fdd.ab92b1fc.js +1 -0
- package/build/docs/assets/js/{aeb9810c.513b7113.js → aeb9810c.eccdb1f8.js} +1 -1
- package/build/docs/assets/js/{main.eb628dfd.js → main.a55b3e06.js} +2 -2
- package/build/docs/assets/js/{runtime~main.d66bc46a.js → runtime~main.066f0308.js} +1 -1
- package/build/docs/index.html +2 -2
- package/build/docs/usage-guide/index.html +6 -4
- package/demo/{1896.11783677.iframe.bundle.js → 1896.28d0a909.iframe.bundle.js} +1 -1
- package/demo/1896.28d0a909.iframe.bundle.js.br +0 -0
- package/demo/{docs/1896.11783677.iframe.bundle.js.gz → 1896.28d0a909.iframe.bundle.js.gz} +0 -0
- package/demo/docs/{1896.11783677.iframe.bundle.js → 1896.28d0a909.iframe.bundle.js} +1 -1
- package/demo/docs/1896.28d0a909.iframe.bundle.js.br +0 -0
- package/demo/{1896.11783677.iframe.bundle.js.gz → docs/1896.28d0a909.iframe.bundle.js.gz} +0 -0
- package/demo/docs/iframe.html +1 -1
- package/demo/docs/index.html +1 -1
- package/demo/docs/main.3d27acca6f453a527b4e.manager.bundle.js +1 -0
- package/demo/docs/main.3d27acca6f453a527b4e.manager.bundle.js.br +0 -0
- package/demo/docs/main.3d27acca6f453a527b4e.manager.bundle.js.gz +0 -0
- package/demo/docs/main.b110520b.iframe.bundle.js +5 -0
- package/demo/docs/main.b110520b.iframe.bundle.js.br +0 -0
- package/demo/docs/main.b110520b.iframe.bundle.js.gz +0 -0
- package/demo/docs/project.json +1 -1
- package/demo/iframe.html +1 -1
- package/demo/index.html +1 -1
- package/demo/main.3d27acca6f453a527b4e.manager.bundle.js +1 -0
- package/demo/main.3d27acca6f453a527b4e.manager.bundle.js.br +0 -0
- package/demo/main.3d27acca6f453a527b4e.manager.bundle.js.gz +0 -0
- package/demo/main.b110520b.iframe.bundle.js +5 -0
- package/demo/main.b110520b.iframe.bundle.js.br +0 -0
- package/demo/main.b110520b.iframe.bundle.js.gz +0 -0
- package/demo/project.json +1 -1
- package/dist/cjs/communication/http-client/index.js +5 -6
- package/dist/cjs/communication/http-client/request-interceptor.js +14 -5
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/utils/constants.js +12 -0
- package/dist/cjs/utils/logrocket.js +4 -0
- package/dist/cjs/utils/session-timeout-config.js +10 -6
- package/dist/cjs/utils/session.js +11 -2
- package/dist/esm/communication/http-client/index.js +6 -7
- package/dist/esm/communication/http-client/request-interceptor.js +17 -5
- package/dist/esm/package.json +1 -4
- package/dist/esm/utils/constants.js +12 -0
- package/dist/esm/utils/logrocket.js +4 -0
- package/dist/esm/utils/session-timeout-config.js +10 -6
- package/dist/esm/utils/session.js +21 -4
- package/dist/types/lib/communication/http-client/index.d.ts +2 -2
- package/dist/types/lib/communication/http-client/request-interceptor.d.ts +2 -2
- package/dist/types/lib/communication/http-client/tests/session-header.test.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +6 -0
- package/dist/types/lib/utils/logrocket.d.ts +2 -0
- package/dist/types/lib/utils/session-timeout-config.d.ts +4 -1
- package/dist/types/lib/utils/session.d.ts +9 -2
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/build/docs/assets/js/04ee7372.53a92701.js +0 -1
- package/build/docs/assets/js/77982fdd.daa51d7d.js +0 -1
- package/demo/1896.11783677.iframe.bundle.js.br +0 -0
- package/demo/docs/1896.11783677.iframe.bundle.js.br +0 -0
- package/demo/docs/main.7fe19f1fb477a0b9fcce.manager.bundle.js +0 -1
- package/demo/docs/main.7fe19f1fb477a0b9fcce.manager.bundle.js.br +0 -0
- package/demo/docs/main.7fe19f1fb477a0b9fcce.manager.bundle.js.gz +0 -0
- package/demo/docs/main.ccc2d540.iframe.bundle.js +0 -5
- package/demo/docs/main.ccc2d540.iframe.bundle.js.br +0 -0
- package/demo/docs/main.ccc2d540.iframe.bundle.js.gz +0 -0
- package/demo/main.7fe19f1fb477a0b9fcce.manager.bundle.js +0 -1
- package/demo/main.7fe19f1fb477a0b9fcce.manager.bundle.js.br +0 -0
- package/demo/main.7fe19f1fb477a0b9fcce.manager.bundle.js.gz +0 -0
- package/demo/main.ccc2d540.iframe.bundle.js +0 -5
- package/demo/main.ccc2d540.iframe.bundle.js.br +0 -0
- package/demo/main.ccc2d540.iframe.bundle.js.gz +0 -0
- /package/build/docs/assets/js/{main.eb628dfd.js.LICENSE.txt → main.a55b3e06.js.LICENSE.txt} +0 -0
|
Binary file
|
package/demo/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1786572218304,"builder":{"name":"webpack5"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"pnpm","version":"8.15.9"},"typescriptOptions":{"check":false,"checkOptions":{},"reactDocgen":false,"reactDocgenTypescriptOptions":{"shouldExtractLiteralValuesFromEnum":true,"compilerOptions":{"allowSyntheticDefaultImports":false,"esModuleInterop":false}}},"features":{"fastRefresh":true,"storyStoreV7":true},"language":"javascript","storybookPackages":{},"framework":{"options":{"fastRefresh":true,"strictMode":true,"legacyRootApi":true}},"addons":{"@storybook/addon-docs":{"options":{"sourceLoaderOptions":{"injectStoryParameters":false}},"version":"6.5.16"},"@storybook/addon-essentials":{"options":{"docs":false},"version":"6.5.16"},"@storybook/addon-storysource":{"version":"6.5.16"},"@storybook/addon-links":{"version":"6.5.16"},"@storybook/addon-events":{"version":"6.2.9"},"@storybook/addon-interactions":{"version":"6.5.16"},"@storybook/addon-a11y":{"version":"6.5.16"},"storybook-addon-turbo-build":{"options":{"optimizationLevel":2,"esbuildMinifyOptions":{"target":"es2022"}},"version":"1.1.0"}}}
|
|
@@ -39,29 +39,28 @@ var import_helper = require("../../utils/auth/helper.js");
|
|
|
39
39
|
var import_retry = __toESM(require("./retry.js"));
|
|
40
40
|
var import_request_interceptor = require("./request-interceptor.js");
|
|
41
41
|
var import_response_interceptor = require("./response-interceptor.js");
|
|
42
|
-
var import_logrocket = require("../../utils/logrocket.js");
|
|
43
42
|
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
44
43
|
const getHTTPClient = ({
|
|
45
44
|
baseURL = (0, import_config.getAppConfigValue)("serviceEndpoints.api", ""),
|
|
46
45
|
headers = {},
|
|
47
|
-
sendLogRocketSessionHeader =
|
|
46
|
+
sendLogRocketSessionHeader = true
|
|
48
47
|
} = {}) => {
|
|
49
|
-
const logRocketSessionUrl = (0, import_logrocket.getLogRocket)()?.sessionURL || "";
|
|
50
48
|
const client = import_axios.default.create({
|
|
51
49
|
baseURL,
|
|
52
|
-
headers
|
|
50
|
+
headers
|
|
53
51
|
});
|
|
54
52
|
if (client?.defaults?.timeout) client.defaults.timeout = REQUEST_TIMEOUT;
|
|
55
53
|
(0, import_retry.default)(client);
|
|
56
54
|
const { request, response } = client?.interceptors || {};
|
|
57
|
-
if (request)
|
|
55
|
+
if (request)
|
|
56
|
+
request.use((0, import_request_interceptor.createRequestInterceptor)(sendLogRocketSessionHeader));
|
|
58
57
|
if (response) response.use(import_response_interceptor.handleSuccess, import_response_interceptor.handleFailure);
|
|
59
58
|
return client;
|
|
60
59
|
};
|
|
61
60
|
const getAuthHTTPClient = ({
|
|
62
61
|
baseURL,
|
|
63
62
|
headers = {},
|
|
64
|
-
sendLogRocketSessionHeader =
|
|
63
|
+
sendLogRocketSessionHeader = true,
|
|
65
64
|
...rest
|
|
66
65
|
} = {}) => getHTTPClient({
|
|
67
66
|
baseURL,
|
|
@@ -18,11 +18,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var request_interceptor_exports = {};
|
|
20
20
|
__export(request_interceptor_exports, {
|
|
21
|
-
|
|
21
|
+
createRequestInterceptor: () => createRequestInterceptor
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(request_interceptor_exports);
|
|
24
|
+
var import_logrocket = require("../../utils/logrocket.js");
|
|
24
25
|
var import_props = require("./props.js");
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
function createRequestInterceptor(sendLogRocketSessionHeader = true) {
|
|
27
|
+
return (config) => {
|
|
28
|
+
import_props.httpClientProps.resetUserIdleTime();
|
|
29
|
+
if (sendLogRocketSessionHeader) {
|
|
30
|
+
const sessionLink = (0, import_logrocket.getLogRocketSessionLink)();
|
|
31
|
+
if (sessionLink) {
|
|
32
|
+
config.headers.set(import_logrocket.APP_SESSION_LINK_HEADER, sessionLink);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return config;
|
|
36
|
+
};
|
|
37
|
+
}
|
package/dist/cjs/package.json
CHANGED
|
@@ -18,11 +18,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var constants_exports = {};
|
|
20
20
|
__export(constants_exports, {
|
|
21
|
+
DEFAULT_SESSION_WARN: () => DEFAULT_SESSION_WARN,
|
|
21
22
|
HOST_WINDOW_BREAKPOINT_CHANGED: () => HOST_WINDOW_BREAKPOINT_CHANGED,
|
|
22
23
|
HOST_WINDOW_RESIZED: () => HOST_WINDOW_RESIZED,
|
|
24
|
+
MAX_SESSION_TIMEOUT: () => MAX_SESSION_TIMEOUT,
|
|
25
|
+
MIN_SESSION_TIMEOUT: () => MIN_SESSION_TIMEOUT,
|
|
26
|
+
SESSION_EXPIRY_GREATER_THAN_MAX_ERROR: () => SESSION_EXPIRY_GREATER_THAN_MAX_ERROR,
|
|
27
|
+
SESSION_EXPIRY_LESS_THAN_MIN_ERROR: () => SESSION_EXPIRY_LESS_THAN_MIN_ERROR,
|
|
23
28
|
SESSION_RENEWAL_INTERVAL: () => SESSION_RENEWAL_INTERVAL,
|
|
24
29
|
SESSION_TIMEOUT_INTERVAL: () => SESSION_TIMEOUT_INTERVAL,
|
|
25
30
|
Themes: () => Themes,
|
|
31
|
+
WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR: () => WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR,
|
|
26
32
|
default: () => constants_default
|
|
27
33
|
});
|
|
28
34
|
module.exports = __toCommonJS(constants_exports);
|
|
@@ -43,3 +49,9 @@ const Themes = {
|
|
|
43
49
|
const HOST_WINDOW_RESIZED = "HOST_WINDOW_RESIZED";
|
|
44
50
|
const HOST_WINDOW_BREAKPOINT_CHANGED = "HOST_WINDOW_BREAKPOINT_CHANGED";
|
|
45
51
|
const SESSION_RENEWAL_INTERVAL = 6e4;
|
|
52
|
+
const MIN_SESSION_TIMEOUT = 15;
|
|
53
|
+
const MAX_SESSION_TIMEOUT = 60;
|
|
54
|
+
const DEFAULT_SESSION_WARN = 3;
|
|
55
|
+
const SESSION_EXPIRY_LESS_THAN_MIN_ERROR = `Session timeout interval must be at least ${MIN_SESSION_TIMEOUT} minutes.`;
|
|
56
|
+
const SESSION_EXPIRY_GREATER_THAN_MAX_ERROR = `Session timeout interval can not exceed ${MAX_SESSION_TIMEOUT} minutes.`;
|
|
57
|
+
const WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR = "Session warning interval must be less than session timeout interval.";
|
|
@@ -18,7 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var logrocket_exports = {};
|
|
20
20
|
__export(logrocket_exports, {
|
|
21
|
+
APP_SESSION_LINK_HEADER: () => APP_SESSION_LINK_HEADER,
|
|
21
22
|
getLogRocket: () => getLogRocket,
|
|
23
|
+
getLogRocketSessionLink: () => getLogRocketSessionLink,
|
|
22
24
|
lrIdentify: () => lrIdentify,
|
|
23
25
|
lrTrack: () => lrTrack,
|
|
24
26
|
resetLrIdentity: () => import_pui_analytics_so.resetLrIdentity
|
|
@@ -26,6 +28,8 @@ __export(logrocket_exports, {
|
|
|
26
28
|
module.exports = __toCommonJS(logrocket_exports);
|
|
27
29
|
var import_pui_analytics_so = require("@elliemae/pui-analytics-so");
|
|
28
30
|
const getLogRocket = () => window.emui?.logRocket;
|
|
31
|
+
const APP_SESSION_LINK_HEADER = "X-ICE-AppSessionLink";
|
|
32
|
+
const getLogRocketSessionLink = () => getLogRocket()?.sessionURL || "";
|
|
29
33
|
const cleanupData = (data) => {
|
|
30
34
|
const cleanedData = {};
|
|
31
35
|
Object.entries(data).forEach(([key, value]) => {
|
|
@@ -22,22 +22,26 @@ __export(session_timeout_config_exports, {
|
|
|
22
22
|
getSessionTimeoutMs: () => getSessionTimeoutMs,
|
|
23
23
|
getSessionWarnIntervalMs: () => getSessionWarnIntervalMs,
|
|
24
24
|
resetSessionTimeoutCache: () => resetSessionTimeoutCache,
|
|
25
|
-
|
|
25
|
+
setSessionTimeoutCache: () => setSessionTimeoutCache
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(session_timeout_config_exports);
|
|
28
28
|
var import_config = require("./app-config/config.js");
|
|
29
29
|
var import_constants = require("./constants.js");
|
|
30
30
|
let cachedWarnIntervalMs;
|
|
31
31
|
let cachedExpiryIntervalMs;
|
|
32
|
-
const
|
|
33
|
-
const calculateWaringInterval = (timeoutInterval) => timeoutInterval - THREE_MINUTES_IN_MS;
|
|
32
|
+
const minutesToMs = (minutes) => minutes * 6e4;
|
|
34
33
|
const resetSessionTimeoutCache = () => {
|
|
35
34
|
cachedWarnIntervalMs = void 0;
|
|
36
35
|
cachedExpiryIntervalMs = void 0;
|
|
37
36
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
const setSessionTimeoutCache = ({
|
|
38
|
+
sessionExpiryInterval,
|
|
39
|
+
sessionWarnInterval
|
|
40
|
+
}) => {
|
|
41
|
+
cachedWarnIntervalMs = minutesToMs(
|
|
42
|
+
sessionExpiryInterval - sessionWarnInterval
|
|
43
|
+
);
|
|
44
|
+
cachedExpiryIntervalMs = minutesToMs(sessionExpiryInterval);
|
|
41
45
|
};
|
|
42
46
|
const getSessionTimeoutMs = (key, fallback) => {
|
|
43
47
|
const value = (0, import_config.getAppConfigValue)(key);
|
|
@@ -72,8 +72,17 @@ const resetUserIdleTime = (resetWarningModal = false) => {
|
|
|
72
72
|
if (!enforceIdleThresholds(resetWarningModal === true)) return;
|
|
73
73
|
markUserActive(resetWarningModal);
|
|
74
74
|
};
|
|
75
|
-
const setSessionTimeoutInterval = (
|
|
76
|
-
|
|
75
|
+
const setSessionTimeoutInterval = ({
|
|
76
|
+
sessionExpiryInterval = import_constants.MIN_SESSION_TIMEOUT,
|
|
77
|
+
sessionWarnInterval = import_constants.DEFAULT_SESSION_WARN
|
|
78
|
+
}) => {
|
|
79
|
+
if (sessionExpiryInterval < import_constants.MIN_SESSION_TIMEOUT)
|
|
80
|
+
throw new Error(import_constants.SESSION_EXPIRY_LESS_THAN_MIN_ERROR);
|
|
81
|
+
if (sessionExpiryInterval > import_constants.MAX_SESSION_TIMEOUT)
|
|
82
|
+
throw new Error(import_constants.SESSION_EXPIRY_GREATER_THAN_MAX_ERROR);
|
|
83
|
+
if (sessionWarnInterval >= sessionExpiryInterval)
|
|
84
|
+
throw new Error(import_constants.WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR);
|
|
85
|
+
(0, import_session_timeout_config.setSessionTimeoutCache)({ sessionExpiryInterval, sessionWarnInterval });
|
|
77
86
|
resetUserIdleTime(true);
|
|
78
87
|
};
|
|
79
88
|
const renewSession = async (explicit = false) => {
|
|
@@ -2,31 +2,30 @@ import axios from "axios";
|
|
|
2
2
|
import { getAppConfigValue } from "../../utils/app-config/config.js";
|
|
3
3
|
import { getAuthorizationHeader } from "../../utils/auth/helper.js";
|
|
4
4
|
import setupRetry from "./retry.js";
|
|
5
|
-
import {
|
|
5
|
+
import { createRequestInterceptor } from "./request-interceptor.js";
|
|
6
6
|
import { handleSuccess, handleFailure } from "./response-interceptor.js";
|
|
7
|
-
import { getLogRocket } from "../../utils/logrocket.js";
|
|
8
7
|
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
9
8
|
const getHTTPClient = ({
|
|
10
9
|
baseURL = getAppConfigValue("serviceEndpoints.api", ""),
|
|
11
10
|
headers = {},
|
|
12
|
-
sendLogRocketSessionHeader =
|
|
11
|
+
sendLogRocketSessionHeader = true
|
|
13
12
|
} = {}) => {
|
|
14
|
-
const logRocketSessionUrl = getLogRocket()?.sessionURL || "";
|
|
15
13
|
const client = axios.create({
|
|
16
14
|
baseURL,
|
|
17
|
-
headers
|
|
15
|
+
headers
|
|
18
16
|
});
|
|
19
17
|
if (client?.defaults?.timeout) client.defaults.timeout = REQUEST_TIMEOUT;
|
|
20
18
|
setupRetry(client);
|
|
21
19
|
const { request, response } = client?.interceptors || {};
|
|
22
|
-
if (request)
|
|
20
|
+
if (request)
|
|
21
|
+
request.use(createRequestInterceptor(sendLogRocketSessionHeader));
|
|
23
22
|
if (response) response.use(handleSuccess, handleFailure);
|
|
24
23
|
return client;
|
|
25
24
|
};
|
|
26
25
|
const getAuthHTTPClient = ({
|
|
27
26
|
baseURL,
|
|
28
27
|
headers = {},
|
|
29
|
-
sendLogRocketSessionHeader =
|
|
28
|
+
sendLogRocketSessionHeader = true,
|
|
30
29
|
...rest
|
|
31
30
|
} = {}) => getHTTPClient({
|
|
32
31
|
baseURL,
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APP_SESSION_LINK_HEADER,
|
|
3
|
+
getLogRocketSessionLink
|
|
4
|
+
} from "../../utils/logrocket.js";
|
|
1
5
|
import { httpClientProps } from "./props.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
+
function createRequestInterceptor(sendLogRocketSessionHeader = true) {
|
|
7
|
+
return (config) => {
|
|
8
|
+
httpClientProps.resetUserIdleTime();
|
|
9
|
+
if (sendLogRocketSessionHeader) {
|
|
10
|
+
const sessionLink = getLogRocketSessionLink();
|
|
11
|
+
if (sessionLink) {
|
|
12
|
+
config.headers.set(APP_SESSION_LINK_HEADER, sessionLink);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return config;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
6
18
|
export {
|
|
7
|
-
|
|
19
|
+
createRequestInterceptor
|
|
8
20
|
};
|
package/dist/esm/package.json
CHANGED
|
@@ -15,11 +15,23 @@ const Themes = {
|
|
|
15
15
|
const HOST_WINDOW_RESIZED = "HOST_WINDOW_RESIZED";
|
|
16
16
|
const HOST_WINDOW_BREAKPOINT_CHANGED = "HOST_WINDOW_BREAKPOINT_CHANGED";
|
|
17
17
|
const SESSION_RENEWAL_INTERVAL = 6e4;
|
|
18
|
+
const MIN_SESSION_TIMEOUT = 15;
|
|
19
|
+
const MAX_SESSION_TIMEOUT = 60;
|
|
20
|
+
const DEFAULT_SESSION_WARN = 3;
|
|
21
|
+
const SESSION_EXPIRY_LESS_THAN_MIN_ERROR = `Session timeout interval must be at least ${MIN_SESSION_TIMEOUT} minutes.`;
|
|
22
|
+
const SESSION_EXPIRY_GREATER_THAN_MAX_ERROR = `Session timeout interval can not exceed ${MAX_SESSION_TIMEOUT} minutes.`;
|
|
23
|
+
const WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR = "Session warning interval must be less than session timeout interval.";
|
|
18
24
|
export {
|
|
25
|
+
DEFAULT_SESSION_WARN,
|
|
19
26
|
HOST_WINDOW_BREAKPOINT_CHANGED,
|
|
20
27
|
HOST_WINDOW_RESIZED,
|
|
28
|
+
MAX_SESSION_TIMEOUT,
|
|
29
|
+
MIN_SESSION_TIMEOUT,
|
|
30
|
+
SESSION_EXPIRY_GREATER_THAN_MAX_ERROR,
|
|
31
|
+
SESSION_EXPIRY_LESS_THAN_MIN_ERROR,
|
|
21
32
|
SESSION_RENEWAL_INTERVAL,
|
|
22
33
|
SESSION_TIMEOUT_INTERVAL,
|
|
23
34
|
Themes,
|
|
35
|
+
WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR,
|
|
24
36
|
constants_default as default
|
|
25
37
|
};
|
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
resetLrIdentity
|
|
5
5
|
} from "@elliemae/pui-analytics-so";
|
|
6
6
|
const getLogRocket = () => window.emui?.logRocket;
|
|
7
|
+
const APP_SESSION_LINK_HEADER = "X-ICE-AppSessionLink";
|
|
8
|
+
const getLogRocketSessionLink = () => getLogRocket()?.sessionURL || "";
|
|
7
9
|
const cleanupData = (data) => {
|
|
8
10
|
const cleanedData = {};
|
|
9
11
|
Object.entries(data).forEach(([key, value]) => {
|
|
@@ -22,7 +24,9 @@ const lrTrack = (event, eventEx = {}) => {
|
|
|
22
24
|
lrTrackGuarded(event, eventEx);
|
|
23
25
|
};
|
|
24
26
|
export {
|
|
27
|
+
APP_SESSION_LINK_HEADER,
|
|
25
28
|
getLogRocket,
|
|
29
|
+
getLogRocketSessionLink,
|
|
26
30
|
lrIdentify,
|
|
27
31
|
lrTrack,
|
|
28
32
|
resetLrIdentity
|
|
@@ -2,15 +2,19 @@ import { getAppConfigValue } from "./app-config/config.js";
|
|
|
2
2
|
import { SESSION_TIMEOUT_INTERVAL } from "./constants.js";
|
|
3
3
|
let cachedWarnIntervalMs;
|
|
4
4
|
let cachedExpiryIntervalMs;
|
|
5
|
-
const
|
|
6
|
-
const calculateWaringInterval = (timeoutInterval) => timeoutInterval - THREE_MINUTES_IN_MS;
|
|
5
|
+
const minutesToMs = (minutes) => minutes * 6e4;
|
|
7
6
|
const resetSessionTimeoutCache = () => {
|
|
8
7
|
cachedWarnIntervalMs = void 0;
|
|
9
8
|
cachedExpiryIntervalMs = void 0;
|
|
10
9
|
};
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const setSessionTimeoutCache = ({
|
|
11
|
+
sessionExpiryInterval,
|
|
12
|
+
sessionWarnInterval
|
|
13
|
+
}) => {
|
|
14
|
+
cachedWarnIntervalMs = minutesToMs(
|
|
15
|
+
sessionExpiryInterval - sessionWarnInterval
|
|
16
|
+
);
|
|
17
|
+
cachedExpiryIntervalMs = minutesToMs(sessionExpiryInterval);
|
|
14
18
|
};
|
|
15
19
|
const getSessionTimeoutMs = (key, fallback) => {
|
|
16
20
|
const value = getAppConfigValue(key);
|
|
@@ -43,5 +47,5 @@ export {
|
|
|
43
47
|
getSessionTimeoutMs,
|
|
44
48
|
getSessionWarnIntervalMs,
|
|
45
49
|
resetSessionTimeoutCache,
|
|
46
|
-
|
|
50
|
+
setSessionTimeoutCache
|
|
47
51
|
};
|
|
@@ -5,13 +5,21 @@ import { introspectToken } from "../api/auth/index.js";
|
|
|
5
5
|
import { getLogger } from "./logger.js";
|
|
6
6
|
import { logRecords } from "./log-records.js";
|
|
7
7
|
import { endSession } from "./auth/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_SESSION_WARN,
|
|
10
|
+
MIN_SESSION_TIMEOUT,
|
|
11
|
+
MAX_SESSION_TIMEOUT,
|
|
12
|
+
SESSION_RENEWAL_INTERVAL,
|
|
13
|
+
SESSION_EXPIRY_GREATER_THAN_MAX_ERROR,
|
|
14
|
+
SESSION_EXPIRY_LESS_THAN_MIN_ERROR,
|
|
15
|
+
WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR
|
|
16
|
+
} from "./constants.js";
|
|
9
17
|
import { subscribeToPageWake } from "./page-wake.js";
|
|
10
18
|
import {
|
|
11
19
|
getSessionWarnIntervalMs,
|
|
12
20
|
getSessionExpiryIntervalMs,
|
|
13
21
|
resetSessionTimeoutCache,
|
|
14
|
-
|
|
22
|
+
setSessionTimeoutCache
|
|
15
23
|
} from "./session-timeout-config.js";
|
|
16
24
|
let lastUserActivityTimeStamp = Date.now();
|
|
17
25
|
const warnListeners = [];
|
|
@@ -45,8 +53,17 @@ const resetUserIdleTime = (resetWarningModal = false) => {
|
|
|
45
53
|
if (!enforceIdleThresholds(resetWarningModal === true)) return;
|
|
46
54
|
markUserActive(resetWarningModal);
|
|
47
55
|
};
|
|
48
|
-
const setSessionTimeoutInterval = (
|
|
49
|
-
|
|
56
|
+
const setSessionTimeoutInterval = ({
|
|
57
|
+
sessionExpiryInterval = MIN_SESSION_TIMEOUT,
|
|
58
|
+
sessionWarnInterval = DEFAULT_SESSION_WARN
|
|
59
|
+
}) => {
|
|
60
|
+
if (sessionExpiryInterval < MIN_SESSION_TIMEOUT)
|
|
61
|
+
throw new Error(SESSION_EXPIRY_LESS_THAN_MIN_ERROR);
|
|
62
|
+
if (sessionExpiryInterval > MAX_SESSION_TIMEOUT)
|
|
63
|
+
throw new Error(SESSION_EXPIRY_GREATER_THAN_MAX_ERROR);
|
|
64
|
+
if (sessionWarnInterval >= sessionExpiryInterval)
|
|
65
|
+
throw new Error(WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR);
|
|
66
|
+
setSessionTimeoutCache({ sessionExpiryInterval, sessionWarnInterval });
|
|
50
67
|
resetUserIdleTime(true);
|
|
51
68
|
};
|
|
52
69
|
const renewSession = async (explicit = false) => {
|
|
@@ -11,7 +11,7 @@ export { getAuthorizationHeader };
|
|
|
11
11
|
* @param config - Configuration options
|
|
12
12
|
* @param config.baseURL - Base URL for API requests (defaults to app config value)
|
|
13
13
|
* @param config.headers - Custom headers to include in requests
|
|
14
|
-
* @param config.sendLogRocketSessionHeader -
|
|
14
|
+
* @param config.sendLogRocketSessionHeader - Attach `X-ICE-AppSessionLink` when LogRocket session URL is available (default `true`)
|
|
15
15
|
* @returns Configured Axios instance
|
|
16
16
|
* @example
|
|
17
17
|
* ```typescript
|
|
@@ -33,7 +33,7 @@ export declare const getHTTPClient: ({ baseURL, headers, sendLogRocketSessionHea
|
|
|
33
33
|
* @param config - Configuration options
|
|
34
34
|
* @param config.baseURL - Base URL for API requests (defaults to app config value)
|
|
35
35
|
* @param config.headers - Custom headers to include in requests
|
|
36
|
-
* @param config.sendLogRocketSessionHeader -
|
|
36
|
+
* @param config.sendLogRocketSessionHeader - Attach `X-ICE-AppSessionLink` when LogRocket session URL is available (default `true`)
|
|
37
37
|
* @param config.rest
|
|
38
38
|
* @returns Configured Axios instance with auth headers
|
|
39
39
|
* @example
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { InternalAxiosRequestConfig } from 'axios';
|
|
2
|
+
export declare function createRequestInterceptor(sendLogRocketSessionHeader?: boolean): (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -14,3 +14,9 @@ export declare const Themes: {
|
|
|
14
14
|
export declare const HOST_WINDOW_RESIZED = "HOST_WINDOW_RESIZED";
|
|
15
15
|
export declare const HOST_WINDOW_BREAKPOINT_CHANGED = "HOST_WINDOW_BREAKPOINT_CHANGED";
|
|
16
16
|
export declare const SESSION_RENEWAL_INTERVAL = 60000;
|
|
17
|
+
export declare const MIN_SESSION_TIMEOUT = 15;
|
|
18
|
+
export declare const MAX_SESSION_TIMEOUT = 60;
|
|
19
|
+
export declare const DEFAULT_SESSION_WARN = 3;
|
|
20
|
+
export declare const SESSION_EXPIRY_LESS_THAN_MIN_ERROR = "Session timeout interval must be at least 15 minutes.";
|
|
21
|
+
export declare const SESSION_EXPIRY_GREATER_THAN_MAX_ERROR = "Session timeout interval can not exceed 60 minutes.";
|
|
22
|
+
export declare const WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR = "Session warning interval must be less than session timeout interval.";
|
|
@@ -2,6 +2,8 @@ import type LogRocket from 'logrocket';
|
|
|
2
2
|
import { resetLrIdentity } from '@elliemae/pui-analytics-so';
|
|
3
3
|
export { resetLrIdentity };
|
|
4
4
|
export declare const getLogRocket: () => typeof LogRocket | undefined;
|
|
5
|
+
export declare const APP_SESSION_LINK_HEADER = "X-ICE-AppSessionLink";
|
|
6
|
+
export declare const getLogRocketSessionLink: () => string;
|
|
5
7
|
/**
|
|
6
8
|
* Send user identification events to LogRocket.
|
|
7
9
|
* Also marks analytics-so as identified so its internal
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
type SessionTimeoutKey = 'sessionTimeoutWarnInterval' | 'sessionTimeoutInterval';
|
|
2
2
|
export declare const resetSessionTimeoutCache: () => void;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const setSessionTimeoutCache: ({ sessionExpiryInterval, sessionWarnInterval, }: {
|
|
4
|
+
sessionExpiryInterval: number;
|
|
5
|
+
sessionWarnInterval: number;
|
|
6
|
+
}) => void;
|
|
4
7
|
export declare const getSessionTimeoutMs: (key: SessionTimeoutKey, fallback: number) => number;
|
|
5
8
|
export declare const getSessionWarnIntervalMs: () => number;
|
|
6
9
|
export declare const getSessionExpiryIntervalMs: () => number;
|
|
@@ -18,9 +18,16 @@ type LISTENER = {
|
|
|
18
18
|
export declare const resetUserIdleTime: ResetUserIdleTimeFn;
|
|
19
19
|
/**
|
|
20
20
|
* Allows developers to provide a custom value for session expiry.
|
|
21
|
-
* @param
|
|
21
|
+
* @param {object} Customize session timeout warn and expiry intervals
|
|
22
|
+
* @param Customize.sessionExpiryInterval
|
|
23
|
+
* @param sessionExpiryInterval Custom session expiry value in minutes
|
|
24
|
+
* @param sessionWarnInterval Custom session warning value in minutes
|
|
25
|
+
* @param Customize.sessionWarnInterval
|
|
22
26
|
*/
|
|
23
|
-
export declare const setSessionTimeoutInterval: (sessionExpiryInterval
|
|
27
|
+
export declare const setSessionTimeoutInterval: ({ sessionExpiryInterval, sessionWarnInterval, }: {
|
|
28
|
+
sessionExpiryInterval: number;
|
|
29
|
+
sessionWarnInterval: number;
|
|
30
|
+
}) => void;
|
|
24
31
|
/**
|
|
25
32
|
* Extends the PSS (Encompass) session via token introspection and resets idle.
|
|
26
33
|
* @param {boolean} [explicit=false] - Pass true for deliberate user actions
|