@elliemae/pui-app-sdk 5.45.0 → 5.46.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 +2 -2
- package/build/docs/api/functions/getAuthorizationHeader/index.html +2 -2
- package/build/docs/api/functions/getHTTPClient/index.html +2 -2
- 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/77982fdd.ab92b1fc.js +1 -0
- package/build/docs/assets/js/{main.eb628dfd.js → main.dffe1959.js} +2 -2
- package/build/docs/assets/js/{runtime~main.d66bc46a.js → runtime~main.7c35a17b.js} +1 -1
- package/build/docs/index.html +2 -2
- package/build/docs/usage-guide/index.html +2 -2
- package/demo/{1896.11783677.iframe.bundle.js → 1896.b2f22fed.iframe.bundle.js} +1 -1
- package/demo/1896.b2f22fed.iframe.bundle.js.br +0 -0
- package/demo/{docs/1896.11783677.iframe.bundle.js.gz → 1896.b2f22fed.iframe.bundle.js.gz} +0 -0
- package/demo/docs/{1896.11783677.iframe.bundle.js → 1896.b2f22fed.iframe.bundle.js} +1 -1
- package/demo/docs/1896.b2f22fed.iframe.bundle.js.br +0 -0
- package/demo/{1896.11783677.iframe.bundle.js.gz → docs/1896.b2f22fed.iframe.bundle.js.gz} +0 -0
- package/demo/docs/iframe.html +1 -1
- package/demo/docs/index.html +1 -1
- package/demo/docs/main.4043d77f8baa6730e9c7.manager.bundle.js +1 -0
- package/demo/docs/main.4043d77f8baa6730e9c7.manager.bundle.js.br +0 -0
- package/demo/docs/main.4043d77f8baa6730e9c7.manager.bundle.js.gz +0 -0
- package/demo/docs/main.d1512ce2.iframe.bundle.js +5 -0
- package/demo/docs/main.d1512ce2.iframe.bundle.js.br +0 -0
- package/demo/docs/main.d1512ce2.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.4043d77f8baa6730e9c7.manager.bundle.js +1 -0
- package/demo/main.4043d77f8baa6730e9c7.manager.bundle.js.br +0 -0
- package/demo/main.4043d77f8baa6730e9c7.manager.bundle.js.gz +0 -0
- package/demo/main.d1512ce2.iframe.bundle.js +5 -0
- package/demo/main.d1512ce2.iframe.bundle.js.br +0 -0
- package/demo/main.d1512ce2.iframe.bundle.js.gz +0 -0
- package/demo/project.json +1 -1
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/utils/constants.js +12 -0
- package/dist/cjs/utils/session-timeout-config.js +10 -6
- package/dist/cjs/utils/session.js +11 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/utils/constants.js +12 -0
- package/dist/esm/utils/session-timeout-config.js +10 -6
- package/dist/esm/utils/session.js +21 -4
- package/dist/types/lib/utils/constants.d.ts +6 -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/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.dffe1959.js.LICENSE.txt} +0 -0
|
Binary file
|
package/demo/project.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"generatedAt":
|
|
1
|
+
{"generatedAt":1786491336743,"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"}}}
|
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.";
|
|
@@ -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) => {
|
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
|
};
|
|
@@ -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) => {
|
|
@@ -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.";
|
|
@@ -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
|