@elliemae/pui-app-sdk 5.49.0 → 5.50.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/docs/404.html +1 -1
- package/build/docs/api/classes/Analytics/index.html +1 -1
- package/build/docs/api/classes/CMicroAppGuest/index.html +1 -1
- package/build/docs/api/classes/CMicroAppHost/index.html +1 -1
- package/build/docs/api/classes/ErrorBoundary/index.html +1 -1
- package/build/docs/api/classes/GuestModule/index.html +1 -1
- package/build/docs/api/functions/AppRoot/index.html +1 -1
- package/build/docs/api/functions/Autocomplete/index.html +1 -1
- package/build/docs/api/functions/CheckBox/index.html +1 -1
- package/build/docs/api/functions/ComboBox/index.html +1 -1
- package/build/docs/api/functions/ComboBoxV3/index.html +1 -1
- package/build/docs/api/functions/ConnectForm/index.html +1 -1
- package/build/docs/api/functions/DateInput/index.html +1 -1
- package/build/docs/api/functions/DatePicker/index.html +1 -1
- package/build/docs/api/functions/DateRangePicker/index.html +1 -1
- package/build/docs/api/functions/DateTimePicker/index.html +1 -1
- package/build/docs/api/functions/Form/index.html +1 -1
- package/build/docs/api/functions/FormItemLayout/index.html +1 -1
- package/build/docs/api/functions/FormLayoutBlockItem/index.html +1 -1
- package/build/docs/api/functions/FormSubmitButton/index.html +1 -1
- package/build/docs/api/functions/InputMask/index.html +1 -1
- package/build/docs/api/functions/InputText/index.html +1 -1
- package/build/docs/api/functions/LargeTextBox/index.html +1 -1
- package/build/docs/api/functions/MaskedInputText/index.html +1 -1
- package/build/docs/api/functions/Page/index.html +1 -1
- package/build/docs/api/functions/Radio/index.html +1 -1
- package/build/docs/api/functions/RadioGroup/index.html +1 -1
- package/build/docs/api/functions/RegisterService/index.html +1 -1
- package/build/docs/api/functions/RenderWithStateAddOns/index.html +1 -1
- package/build/docs/api/functions/RequireAuth/index.html +1 -1
- package/build/docs/api/functions/SessionTimeout/index.html +1 -1
- package/build/docs/api/functions/TextBox/index.html +1 -1
- package/build/docs/api/functions/Toggle/index.html +1 -1
- package/build/docs/api/functions/authSaga/index.html +1 -1
- package/build/docs/api/functions/authorize/index.html +1 -1
- package/build/docs/api/functions/buildModuleParams/index.html +1 -1
- package/build/docs/api/functions/cleanup/index.html +1 -1
- package/build/docs/api/functions/configureStore/index.html +1 -1
- package/build/docs/api/functions/createGuestModule/index.html +1 -1
- package/build/docs/api/functions/createManager/index.html +1 -1
- package/build/docs/api/functions/enableReactAppForHostIntegration/index.html +1 -1
- package/build/docs/api/functions/fetchHostAppData/index.html +1 -1
- package/build/docs/api/functions/fetchUserSettings/index.html +1 -1
- package/build/docs/api/functions/getApiActionCreator/index.html +1 -1
- package/build/docs/api/functions/getAppConfig/index.html +1 -1
- package/build/docs/api/functions/getAppConfigValue/index.html +1 -1
- package/build/docs/api/functions/getAuthHTTPClient/index.html +1 -1
- package/build/docs/api/functions/getAuthorizationHeader/index.html +1 -1
- package/build/docs/api/functions/getHTTPClient/index.html +1 -1
- package/build/docs/api/functions/getHostAppDataByKey/index.html +1 -1
- package/build/docs/api/functions/getLogger/index.html +1 -1
- package/build/docs/api/functions/getMicroFrontEndAppConfig/index.html +1 -1
- package/build/docs/api/functions/getNavigationLinks/index.html +1 -1
- package/build/docs/api/functions/getRedirectUrl/index.html +1 -1
- package/build/docs/api/functions/getSelectField/index.html +1 -1
- package/build/docs/api/functions/getStore/index.html +1 -1
- package/build/docs/api/functions/initServiceWorker/index.html +1 -1
- package/build/docs/api/functions/isCIBuild/index.html +1 -1
- package/build/docs/api/functions/isProd/index.html +1 -1
- package/build/docs/api/functions/isUserAuthorized/index.html +1 -1
- package/build/docs/api/functions/listenStorageEvents/index.html +1 -1
- package/build/docs/api/functions/loadAppConfig/index.html +1 -1
- package/build/docs/api/functions/loadable/index.html +1 -1
- package/build/docs/api/functions/login/index.html +1 -1
- package/build/docs/api/functions/notifyGuestUnloadComplete/index.html +1 -1
- package/build/docs/api/functions/onAuthorizationFailure/index.html +1 -1
- package/build/docs/api/functions/onGuestUnloadStart/index.html +1 -1
- package/build/docs/api/functions/redactPii/index.html +1 -1
- package/build/docs/api/functions/removeDoubleSlash/index.html +1 -1
- package/build/docs/api/functions/removeStorageEvents/index.html +1 -1
- package/build/docs/api/functions/render/index.html +1 -1
- package/build/docs/api/functions/renderHook/index.html +1 -1
- package/build/docs/api/functions/renderWithHostData/index.html +1 -1
- package/build/docs/api/functions/renderWithRedux/index.html +1 -1
- package/build/docs/api/functions/renderWithRouter/index.html +1 -1
- package/build/docs/api/functions/renderWithRouterRedux/index.html +1 -1
- package/build/docs/api/functions/sdkBaseQuery/index.html +1 -1
- package/build/docs/api/functions/sendBAEvent/index.html +1 -1
- package/build/docs/api/functions/sendMessageToHost/index.html +1 -1
- package/build/docs/api/functions/setAppConfig/index.html +1 -1
- package/build/docs/api/functions/setAppConfigValue/index.html +1 -1
- package/build/docs/api/functions/setHostAppData/index.html +1 -1
- package/build/docs/api/functions/setLoginParams/index.html +1 -1
- package/build/docs/api/functions/setSessionTimeoutInterval/index.html +1 -1
- package/build/docs/api/functions/subscribeToResetSession/index.html +1 -1
- package/build/docs/api/functions/subscribeToSessionExpiry/index.html +1 -1
- package/build/docs/api/functions/subscribeToSessionExpiryWarning/index.html +1 -1
- package/build/docs/api/functions/trackActivity/index.html +1 -1
- package/build/docs/api/functions/useAppDispatch/index.html +1 -1
- package/build/docs/api/functions/useAppMiddleware/index.html +1 -1
- package/build/docs/api/functions/useInjectQuery/index.html +1 -1
- package/build/docs/api/functions/useInjectReducer/index.html +1 -1
- package/build/docs/api/functions/useInjectSaga/index.html +1 -1
- package/build/docs/api/functions/useInjectSideEffect/index.html +1 -1
- package/build/docs/api/functions/useMediaQueryList/index.html +1 -1
- package/build/docs/api/functions/useStateSelector/index.html +1 -1
- package/build/docs/api/functions/useStateSelectorShallow/index.html +1 -1
- package/build/docs/api/functions/waitFor/index.html +1 -1
- package/build/docs/api/functions/waitForElementToBeRemoved/index.html +1 -1
- package/build/docs/api/functions/withAppDecorator/index.html +1 -1
- package/build/docs/api/index.html +1 -1
- package/build/docs/api/interfaces/AppConfig/index.html +1 -1
- package/build/docs/api/interfaces/GuestProps/index.html +1 -1
- package/build/docs/api/interfaces/UseStateSelectorOptions/index.html +1 -1
- package/build/docs/api/type-aliases/AppDispatch/index.html +1 -1
- package/build/docs/api/type-aliases/AppStore/index.html +1 -1
- package/build/docs/api/type-aliases/Await/index.html +1 -1
- package/build/docs/api/type-aliases/EMUI/index.html +1 -1
- package/build/docs/api/type-aliases/HostOptions/index.html +1 -1
- package/build/docs/api/type-aliases/HostProvidedParams/index.html +1 -1
- package/build/docs/api/type-aliases/ModuleOverrides/index.html +1 -1
- package/build/docs/api/type-aliases/OnHostInitCallback/index.html +1 -1
- package/build/docs/api/type-aliases/OnInitCallback/index.html +1 -1
- package/build/docs/api/type-aliases/OnMountCallback/index.html +1 -1
- package/build/docs/api/type-aliases/OnUnMountCallback/index.html +1 -1
- package/build/docs/api/type-aliases/RootState/index.html +1 -1
- package/build/docs/api/type-aliases/SelectStateFieldFunction/index.html +1 -1
- package/build/docs/api/variables/ErrorToast/index.html +1 -1
- package/build/docs/api/variables/FormPropsContext/index.html +1 -1
- package/build/docs/api/variables/GuestMicroApp/index.html +1 -1
- package/build/docs/api/variables/MASK_PIPES/index.html +1 -1
- package/build/docs/api/variables/MASK_TYPES/index.html +1 -1
- package/build/docs/api/variables/MicroApp/index.html +1 -1
- package/build/docs/api/variables/MicroIFrameApp/index.html +1 -1
- package/build/docs/api/variables/NavigationPrompt/index.html +1 -1
- package/build/docs/api/variables/NavigationPromptActions/index.html +1 -1
- package/build/docs/api/variables/Themes/index.html +1 -1
- package/build/docs/api/variables/VisuallyHidden/index.html +1 -1
- package/build/docs/api/variables/WaitMessage/index.html +1 -1
- package/build/docs/api/variables/act/index.html +1 -1
- package/build/docs/api/variables/ariaLive/index.html +1 -1
- package/build/docs/api/variables/auth/index.html +1 -1
- package/build/docs/api/variables/authReducer/index.html +1 -1
- package/build/docs/api/variables/clearSideEffects/index.html +1 -1
- package/build/docs/api/variables/createSideEffect/index.html +1 -1
- package/build/docs/api/variables/decorators/index.html +1 -1
- package/build/docs/api/variables/endSession/index.html +1 -1
- package/build/docs/api/variables/error/index.html +1 -1
- package/build/docs/api/variables/errorMiddleware/index.html +1 -1
- package/build/docs/api/variables/fireEvent/index.html +1 -1
- package/build/docs/api/variables/globalConstants/index.html +1 -1
- package/build/docs/api/variables/history/index.html +1 -1
- package/build/docs/api/variables/httpClientProps/index.html +1 -1
- package/build/docs/api/variables/logout/index.html +1 -1
- package/build/docs/api/variables/memoryHistory/index.html +1 -1
- package/build/docs/api/variables/removeSideEffect/index.html +1 -1
- package/build/docs/api/variables/resetUserIdleTime/index.html +1 -1
- package/build/docs/api/variables/screen/index.html +1 -1
- package/build/docs/api/variables/startSideEffect/index.html +1 -1
- package/build/docs/api/variables/updateBAEventParameters/index.html +1 -1
- package/build/docs/api/variables/useAppSelector/index.html +1 -1
- package/build/docs/api/variables/waitMessageAction/index.html +1 -1
- package/build/docs/api/variables/within/index.html +1 -1
- package/build/docs/assets/js/{main.cc7e14f1.js → main.c76c7364.js} +2 -2
- package/build/docs/index.html +1 -1
- package/build/docs/usage-guide/index.html +1 -1
- package/demo/{docs/6751.931e84f7.iframe.bundle.js → 6751.d84d72e6.iframe.bundle.js} +1 -1
- package/demo/6751.d84d72e6.iframe.bundle.js.br +0 -0
- package/demo/{docs/6751.931e84f7.iframe.bundle.js.gz → 6751.d84d72e6.iframe.bundle.js.gz} +0 -0
- package/demo/{6751.931e84f7.iframe.bundle.js → docs/6751.d84d72e6.iframe.bundle.js} +1 -1
- package/demo/docs/6751.d84d72e6.iframe.bundle.js.br +0 -0
- package/demo/{6751.931e84f7.iframe.bundle.js.gz → docs/6751.d84d72e6.iframe.bundle.js.gz} +0 -0
- package/demo/docs/iframe.html +1 -1
- package/demo/docs/index.html +1 -1
- package/demo/docs/{main.630930af4be0dd8216bc.manager.bundle.js → main.60c241009fa4be40eb75.manager.bundle.js} +1 -1
- package/demo/docs/main.60c241009fa4be40eb75.manager.bundle.js.br +0 -0
- package/demo/docs/{main.630930af4be0dd8216bc.manager.bundle.js.gz → main.60c241009fa4be40eb75.manager.bundle.js.gz} +0 -0
- package/demo/docs/main.6592eecd.iframe.bundle.js +5 -0
- package/demo/docs/main.6592eecd.iframe.bundle.js.br +0 -0
- package/demo/docs/main.6592eecd.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.630930af4be0dd8216bc.manager.bundle.js → main.60c241009fa4be40eb75.manager.bundle.js} +1 -1
- package/demo/main.60c241009fa4be40eb75.manager.bundle.js.br +0 -0
- package/demo/{main.630930af4be0dd8216bc.manager.bundle.js.gz → main.60c241009fa4be40eb75.manager.bundle.js.gz} +0 -0
- package/demo/main.6592eecd.iframe.bundle.js +5 -0
- package/demo/main.6592eecd.iframe.bundle.js.br +0 -0
- package/demo/main.6592eecd.iframe.bundle.js.gz +0 -0
- package/demo/project.json +1 -1
- package/dist/cjs/analytics/index.js +2 -9
- package/dist/cjs/analytics/push-to-data-layer.js +34 -0
- package/dist/cjs/analytics/user-session-event.js +5 -9
- package/dist/cjs/utils/constants.js +1 -1
- package/dist/cjs/utils/get-window.js +31 -0
- package/dist/cjs/utils/helpers.js +2 -23
- package/dist/cjs/utils/product-app-details.js +45 -0
- package/dist/cjs/utils/session-timeout-config.js +1 -3
- package/dist/cjs/utils/session.js +14 -4
- package/dist/cjs/utils/window.js +2 -9
- package/dist/cjs/view/session-timeout/index.js +7 -2
- package/dist/esm/analytics/index.js +2 -9
- package/dist/esm/analytics/push-to-data-layer.js +14 -0
- package/dist/esm/analytics/user-session-event.js +5 -9
- package/dist/esm/utils/constants.js +1 -1
- package/dist/esm/utils/get-window.js +11 -0
- package/dist/esm/utils/helpers.js +1 -22
- package/dist/esm/utils/product-app-details.js +25 -0
- package/dist/esm/utils/session-timeout-config.js +1 -3
- package/dist/esm/utils/session.js +14 -4
- package/dist/esm/utils/window.js +1 -8
- package/dist/esm/view/session-timeout/index.js +9 -3
- package/dist/types/lib/analytics/push-to-data-layer.d.ts +6 -0
- package/dist/types/lib/analytics/tests/push-to-data-layer.test.d.ts +1 -0
- package/dist/types/lib/analytics/tests/send-ba-event.test.d.ts +1 -0
- package/dist/types/lib/analytics/tests/user-session-event.test.d.ts +1 -0
- package/dist/types/lib/utils/constants.d.ts +1 -1
- package/dist/types/lib/utils/get-window.d.ts +2 -0
- package/dist/types/lib/utils/helpers.d.ts +1 -11
- package/dist/types/lib/utils/product-app-details.d.ts +12 -0
- package/dist/types/lib/utils/session.d.ts +18 -1
- package/dist/types/lib/utils/tests/get-window.test.d.ts +1 -0
- package/dist/types/lib/utils/tests/product-app-details.test.d.ts +1 -0
- package/dist/types/lib/utils/window.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -1
- package/demo/6751.931e84f7.iframe.bundle.js.br +0 -0
- package/demo/docs/6751.931e84f7.iframe.bundle.js.br +0 -0
- package/demo/docs/main.630930af4be0dd8216bc.manager.bundle.js.br +0 -0
- package/demo/docs/main.cfb1d0ef.iframe.bundle.js +0 -5
- package/demo/docs/main.cfb1d0ef.iframe.bundle.js.br +0 -0
- package/demo/docs/main.cfb1d0ef.iframe.bundle.js.gz +0 -0
- package/demo/main.630930af4be0dd8216bc.manager.bundle.js.br +0 -0
- package/demo/main.cfb1d0ef.iframe.bundle.js +0 -5
- package/demo/main.cfb1d0ef.iframe.bundle.js.br +0 -0
- package/demo/main.cfb1d0ef.iframe.bundle.js.gz +0 -0
- /package/build/docs/assets/js/{main.cc7e14f1.js.LICENSE.txt → main.c76c7364.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { getBAEventParameters } from "@elliemae/pui-analytics-so";
|
|
2
|
+
import { getProductAppDetails } from "../utils/product-app-details.js";
|
|
3
|
+
const pushBAEventToDataLayer = (data) => {
|
|
4
|
+
const eventData = {
|
|
5
|
+
...getBAEventParameters(),
|
|
6
|
+
...getProductAppDetails(),
|
|
7
|
+
...data
|
|
8
|
+
};
|
|
9
|
+
window.gtmDataLayer = window.gtmDataLayer || [];
|
|
10
|
+
window.gtmDataLayer.push(eventData);
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
pushBAEventToDataLayer
|
|
14
|
+
};
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { updateBAEventParameters } from "@elliemae/pui-analytics-so";
|
|
2
|
-
import {
|
|
2
|
+
import { pushBAEventToDataLayer } from "./push-to-data-layer.js";
|
|
3
3
|
const loginEvent = ({
|
|
4
4
|
instanceId,
|
|
5
5
|
userId
|
|
6
6
|
}) => {
|
|
7
7
|
updateBAEventParameters({ instanceId, userId });
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
event: "login"
|
|
11
|
-
}
|
|
8
|
+
pushBAEventToDataLayer({
|
|
9
|
+
event: "login"
|
|
12
10
|
});
|
|
13
11
|
};
|
|
14
12
|
const logoutEvent = () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
event: "logout"
|
|
18
|
-
}
|
|
13
|
+
pushBAEventToDataLayer({
|
|
14
|
+
event: "logout"
|
|
19
15
|
});
|
|
20
16
|
updateBAEventParameters({ instanceId: "", userId: "" });
|
|
21
17
|
};
|
|
@@ -17,7 +17,7 @@ const HOST_WINDOW_BREAKPOINT_CHANGED = "HOST_WINDOW_BREAKPOINT_CHANGED";
|
|
|
17
17
|
const SESSION_RENEWAL_INTERVAL = 6e4;
|
|
18
18
|
const MIN_SESSION_TIMEOUT = 15;
|
|
19
19
|
const MAX_SESSION_TIMEOUT = 60;
|
|
20
|
-
const DEFAULT_SESSION_WARN =
|
|
20
|
+
const DEFAULT_SESSION_WARN = 12;
|
|
21
21
|
const SESSION_EXPIRY_LESS_THAN_MIN_ERROR = `Session timeout interval must be at least ${MIN_SESSION_TIMEOUT} minutes.`;
|
|
22
22
|
const SESSION_EXPIRY_GREATER_THAN_MAX_ERROR = `Session timeout interval can not exceed ${MAX_SESSION_TIMEOUT} minutes.`;
|
|
23
23
|
const WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR = "Session warning interval must be less than session timeout interval.";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getWindow } from "./window.js";
|
|
2
1
|
const isProd = () => false;
|
|
3
2
|
const isCIBuild = () => process.env.CI === "true";
|
|
3
|
+
import { getProductAppDetails } from "./product-app-details.js";
|
|
4
4
|
const PROTOCOL = /^(?:[a-z]+:)?\/\//;
|
|
5
5
|
const convertRelativeToAbsoluteUrl = (url) => {
|
|
6
6
|
if (!PROTOCOL.test(url)) {
|
|
@@ -8,27 +8,6 @@ const convertRelativeToAbsoluteUrl = (url) => {
|
|
|
8
8
|
}
|
|
9
9
|
return url;
|
|
10
10
|
};
|
|
11
|
-
const getProductAppDetails = () => {
|
|
12
|
-
const pageWindow = getWindow();
|
|
13
|
-
const { title: productPageTitle } = pageWindow.document;
|
|
14
|
-
const { title: appPageTitle } = document;
|
|
15
|
-
const productId = pageWindow?.emui?.appId ?? "";
|
|
16
|
-
const version = pageWindow?.emui?.version ?? "";
|
|
17
|
-
const appId = window?.emui?.appId ?? "";
|
|
18
|
-
const { pathname: productPath, href: productUrl } = pageWindow.location;
|
|
19
|
-
const { pathname: appPath, href: appUrl } = window.location;
|
|
20
|
-
return {
|
|
21
|
-
productId,
|
|
22
|
-
productPath,
|
|
23
|
-
productUrl,
|
|
24
|
-
productPageTitle,
|
|
25
|
-
version,
|
|
26
|
-
appId,
|
|
27
|
-
appPath,
|
|
28
|
-
appUrl,
|
|
29
|
-
appPageTitle
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
11
|
const abortPromise = ({
|
|
33
12
|
promise,
|
|
34
13
|
delay,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getWindow } from "./get-window.js";
|
|
2
|
+
const getProductAppDetails = () => {
|
|
3
|
+
const pageWindow = getWindow();
|
|
4
|
+
const { title: productPageTitle } = pageWindow.document;
|
|
5
|
+
const { title: appPageTitle } = document;
|
|
6
|
+
const productId = pageWindow?.emui?.appId ?? "";
|
|
7
|
+
const version = pageWindow?.emui?.version ?? "";
|
|
8
|
+
const appId = window?.emui?.appId ?? "";
|
|
9
|
+
const { pathname: productPath, href: productUrl } = pageWindow.location;
|
|
10
|
+
const { pathname: appPath, href: appUrl } = window.location;
|
|
11
|
+
return {
|
|
12
|
+
productId,
|
|
13
|
+
productPath,
|
|
14
|
+
productUrl,
|
|
15
|
+
productPageTitle,
|
|
16
|
+
version,
|
|
17
|
+
appId,
|
|
18
|
+
appPath,
|
|
19
|
+
appUrl,
|
|
20
|
+
appPageTitle
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
getProductAppDetails
|
|
25
|
+
};
|
|
@@ -11,9 +11,7 @@ const setSessionTimeoutCache = ({
|
|
|
11
11
|
sessionExpiryInterval,
|
|
12
12
|
sessionWarnInterval
|
|
13
13
|
}) => {
|
|
14
|
-
cachedWarnIntervalMs = minutesToMs(
|
|
15
|
-
sessionExpiryInterval - sessionWarnInterval
|
|
16
|
-
);
|
|
14
|
+
cachedWarnIntervalMs = minutesToMs(sessionWarnInterval);
|
|
17
15
|
cachedExpiryIntervalMs = minutesToMs(sessionExpiryInterval);
|
|
18
16
|
};
|
|
19
17
|
const getSessionTimeoutMs = (key, fallback) => {
|
|
@@ -31,6 +31,7 @@ let sessionExpired = false;
|
|
|
31
31
|
let timerHandle;
|
|
32
32
|
let removeWakeListener;
|
|
33
33
|
let sessionExpiryWarningNotifiedAt;
|
|
34
|
+
let updateComponentConfig;
|
|
34
35
|
const resetIdleStateFlags = () => {
|
|
35
36
|
sessionExpired = false;
|
|
36
37
|
sessionExpiryWarningNotified = false;
|
|
@@ -63,8 +64,8 @@ const setSessionTimeoutInterval = ({
|
|
|
63
64
|
throw new Error(SESSION_EXPIRY_GREATER_THAN_MAX_ERROR);
|
|
64
65
|
if (sessionWarnInterval >= sessionExpiryInterval)
|
|
65
66
|
throw new Error(WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR);
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
if (updateComponentConfig)
|
|
68
|
+
updateComponentConfig({ sessionExpiryInterval, sessionWarnInterval });
|
|
68
69
|
};
|
|
69
70
|
const renewSession = async (explicit = false) => {
|
|
70
71
|
if (!enforceIdleThresholds(explicit === true)) return;
|
|
@@ -149,11 +150,16 @@ const addEventListeners = () => {
|
|
|
149
150
|
document.addEventListener(eventType, renewSessionAtInterval);
|
|
150
151
|
});
|
|
151
152
|
};
|
|
152
|
-
const initSessionMonitoring = (
|
|
153
|
+
const initSessionMonitoring = ({
|
|
154
|
+
sessionExpiryInterval = 0,
|
|
155
|
+
sessionWarnInterval = 0
|
|
156
|
+
} = {}) => {
|
|
153
157
|
clearInterval(timerHandle);
|
|
154
158
|
removeWakeListener?.();
|
|
155
159
|
removeActivityEventListeners();
|
|
156
|
-
if (
|
|
160
|
+
if (sessionExpiryInterval && sessionWarnInterval) {
|
|
161
|
+
setSessionTimeoutCache({ sessionExpiryInterval, sessionWarnInterval });
|
|
162
|
+
} else {
|
|
157
163
|
resetSessionTimeoutCache();
|
|
158
164
|
}
|
|
159
165
|
resetIdleStateFlags();
|
|
@@ -173,6 +179,9 @@ const subscribeToResetSession = (onResetListener) => {
|
|
|
173
179
|
resetListeners.push(onResetListener);
|
|
174
180
|
return removeListeners.bind(null, resetListeners, onResetListener);
|
|
175
181
|
};
|
|
182
|
+
const setUpdateComponentConfig = (updateMethod) => {
|
|
183
|
+
updateComponentConfig = updateMethod;
|
|
184
|
+
};
|
|
176
185
|
const trackActivity = (element, cb) => {
|
|
177
186
|
if (!element) return () => {
|
|
178
187
|
};
|
|
@@ -193,6 +202,7 @@ export {
|
|
|
193
202
|
renewSession,
|
|
194
203
|
resetUserIdleTime,
|
|
195
204
|
setSessionTimeoutInterval,
|
|
205
|
+
setUpdateComponentConfig,
|
|
196
206
|
stopSessionMonitoring,
|
|
197
207
|
subscribeToResetSession,
|
|
198
208
|
subscribeToSessionExpiry,
|
package/dist/esm/utils/window.js
CHANGED
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { getDefaultTheme } from "@elliemae/pui-theme";
|
|
2
|
-
|
|
3
|
-
try {
|
|
4
|
-
window.parent.document;
|
|
5
|
-
return window.parent;
|
|
6
|
-
} catch (err) {
|
|
7
|
-
return window;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
2
|
+
import { getWindow } from "./get-window.js";
|
|
10
3
|
const getViewportSize = () => ({
|
|
11
4
|
width: Math.max(
|
|
12
5
|
document.documentElement.clientWidth || 0,
|
|
@@ -8,7 +8,8 @@ import {
|
|
|
8
8
|
subscribeToSessionExpiryWarning,
|
|
9
9
|
subscribeToResetSession,
|
|
10
10
|
subscribeToSessionExpiry,
|
|
11
|
-
resetUserIdleTime
|
|
11
|
+
resetUserIdleTime,
|
|
12
|
+
setUpdateComponentConfig
|
|
12
13
|
} from "../../utils/session.js";
|
|
13
14
|
import { SessionExpiry } from "../modals/session-expiry/index.js";
|
|
14
15
|
import { httpClientProps } from "../../communication/http-client/props.js";
|
|
@@ -16,9 +17,14 @@ const SessionTimeout = () => {
|
|
|
16
17
|
const dispatch = useAppDispatch();
|
|
17
18
|
const [showSessionExpiryWarning, setSessionExpiryWarning] = useState(false);
|
|
18
19
|
const [warningNotifiedAt, setwarningNotifiedAt] = useState();
|
|
20
|
+
const [sessionConfig, setSessionConfig] = useState({
|
|
21
|
+
sessionExpiryInterval: 0,
|
|
22
|
+
sessionWarnInterval: 0
|
|
23
|
+
});
|
|
24
|
+
setUpdateComponentConfig(setSessionConfig);
|
|
19
25
|
useEffect(() => {
|
|
20
26
|
httpClientProps.resetUserIdleTime = resetUserIdleTime;
|
|
21
|
-
initSessionMonitoring();
|
|
27
|
+
initSessionMonitoring(sessionConfig);
|
|
22
28
|
const warningCb = subscribeToSessionExpiryWarning(
|
|
23
29
|
(sessionExpiryWarningNotifiedAt) => {
|
|
24
30
|
if (!sessionExpiryWarningNotifiedAt) return;
|
|
@@ -41,7 +47,7 @@ const SessionTimeout = () => {
|
|
|
41
47
|
sessionExpiredCb();
|
|
42
48
|
stopSessionMonitoring();
|
|
43
49
|
};
|
|
44
|
-
}, [dispatch]);
|
|
50
|
+
}, [dispatch, sessionConfig]);
|
|
45
51
|
return /* @__PURE__ */ jsx("div", { children: showSessionExpiryWarning && /* @__PURE__ */ jsx(SessionExpiry, { open: true, warningNotifiedAt }) });
|
|
46
52
|
};
|
|
47
53
|
export {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -16,7 +16,7 @@ export declare const HOST_WINDOW_BREAKPOINT_CHANGED = "HOST_WINDOW_BREAKPOINT_CH
|
|
|
16
16
|
export declare const SESSION_RENEWAL_INTERVAL = 60000;
|
|
17
17
|
export declare const MIN_SESSION_TIMEOUT = 15;
|
|
18
18
|
export declare const MAX_SESSION_TIMEOUT = 60;
|
|
19
|
-
export declare const DEFAULT_SESSION_WARN =
|
|
19
|
+
export declare const DEFAULT_SESSION_WARN = 12;
|
|
20
20
|
export declare const SESSION_EXPIRY_LESS_THAN_MIN_ERROR = "Session timeout interval must be at least 15 minutes.";
|
|
21
21
|
export declare const SESSION_EXPIRY_GREATER_THAN_MAX_ERROR = "Session timeout interval can not exceed 60 minutes.";
|
|
22
22
|
export declare const WARN_INTERVAL_NOT_LESS_THAN_EXPIRY_ERROR = "Session warning interval must be less than session timeout interval.";
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
export declare const isProd: () => boolean;
|
|
2
2
|
export declare const isCIBuild: () => boolean;
|
|
3
|
+
export { getProductAppDetails } from './product-app-details.js';
|
|
3
4
|
export declare const convertRelativeToAbsoluteUrl: (url: string) => string;
|
|
4
|
-
export declare const getProductAppDetails: () => {
|
|
5
|
-
productId: string;
|
|
6
|
-
productPath: string;
|
|
7
|
-
productUrl: string;
|
|
8
|
-
productPageTitle: string;
|
|
9
|
-
version: string;
|
|
10
|
-
appId: string;
|
|
11
|
-
appPath: string;
|
|
12
|
-
appUrl: string;
|
|
13
|
-
appPageTitle: string;
|
|
14
|
-
};
|
|
15
5
|
export declare const abortPromise: ({ promise, delay, retValue, throwError, errMsg, }: {
|
|
16
6
|
promise: Promise<unknown>;
|
|
17
7
|
delay: number;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Collect host and guest page metadata for analytics events. */
|
|
2
|
+
export declare const getProductAppDetails: () => {
|
|
3
|
+
productId: string;
|
|
4
|
+
productPath: string;
|
|
5
|
+
productUrl: string;
|
|
6
|
+
productPageTitle: string;
|
|
7
|
+
version: string;
|
|
8
|
+
appId: string;
|
|
9
|
+
appPath: string;
|
|
10
|
+
appUrl: string;
|
|
11
|
+
appPageTitle: string;
|
|
12
|
+
};
|
|
@@ -8,6 +8,13 @@ type RESETLISTENER = {
|
|
|
8
8
|
type LISTENER = {
|
|
9
9
|
(): void;
|
|
10
10
|
};
|
|
11
|
+
type SessionConfigType = {
|
|
12
|
+
sessionExpiryInterval: number;
|
|
13
|
+
sessionWarnInterval: number;
|
|
14
|
+
};
|
|
15
|
+
type UPDATECOMPONENTCONFIGTYPE = {
|
|
16
|
+
(arg0: SessionConfigType): void;
|
|
17
|
+
};
|
|
11
18
|
/**
|
|
12
19
|
* Resets the user idle clock without calling the auth introspection API.
|
|
13
20
|
* Used by the HTTP request interceptor. Runs through `enforceIdleThresholds()`
|
|
@@ -52,8 +59,13 @@ export declare const addEventListeners: () => void;
|
|
|
52
59
|
* Safe to call more than once; clears previous listeners and timers first.
|
|
53
60
|
* Typically wired up once via the `SessionTimeout` component.
|
|
54
61
|
* @param resetCache
|
|
62
|
+
* @param resetCache.sessionExpiryInterval
|
|
63
|
+
* @param resetCache.sessionWarnInterval
|
|
55
64
|
*/
|
|
56
|
-
export declare const initSessionMonitoring: (
|
|
65
|
+
export declare const initSessionMonitoring: ({ sessionExpiryInterval, sessionWarnInterval, }?: {
|
|
66
|
+
sessionExpiryInterval?: number | undefined;
|
|
67
|
+
sessionWarnInterval?: number | undefined;
|
|
68
|
+
}) => void;
|
|
57
69
|
/**
|
|
58
70
|
* Registers a callback when idle time crosses the warn threshold.
|
|
59
71
|
* @param {WARNLISTENER} onSessionExpiryWarn - Timestamp the warning was shown.
|
|
@@ -72,6 +84,11 @@ export declare const subscribeToSessionExpiry: (onSessionExpiry: LISTENER) => ()
|
|
|
72
84
|
* @returns {Function} Unsubscribe function.
|
|
73
85
|
*/
|
|
74
86
|
export declare const subscribeToResetSession: (onResetListener: RESETLISTENER) => () => void;
|
|
87
|
+
/**
|
|
88
|
+
* Register a callback that updates the session timeout component with a new configuration
|
|
89
|
+
* @param updateMethod updates the component with the new configuration
|
|
90
|
+
*/
|
|
91
|
+
export declare const setUpdateComponentConfig: (updateMethod: UPDATECOMPONENTCONFIGTYPE) => void;
|
|
75
92
|
/**
|
|
76
93
|
* Tracks user interaction on a document and invokes a callback (iframe guests).
|
|
77
94
|
* Does not run `enforceIdleThresholds`; callback should use a guarded renewal path.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,6 +7,7 @@ import { Logger } from '@elliemae/pui-diagnostics';
|
|
|
7
7
|
import { IMicroFEHost } from '@elliemae/pui-app-bridge';
|
|
8
8
|
import type LogRocket from 'logrocket';
|
|
9
9
|
import { LoginParams } from './auth/types';
|
|
10
|
+
export { getWindow } from './get-window.js';
|
|
10
11
|
export type EMUI<AppObjects extends ScriptingObjects = Partial<ScriptingObjectTypes>, AppEvents extends EventListeners = Events> = {
|
|
11
12
|
[key: string]: IMicroAppGuest<AppObjects, AppEvents> | IMicroAppGuest<AppObjects, AppEvents>[];
|
|
12
13
|
} & {
|
|
@@ -38,7 +39,6 @@ declare global {
|
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
export declare const getWindow: () => WindowProxy;
|
|
42
42
|
export declare const getViewportSize: () => {
|
|
43
43
|
width: number;
|
|
44
44
|
height: number;
|