@elliemae/pui-app-sdk 4.10.0 → 4.11.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/communication/http-client/baseQuery.js +42 -0
- package/dist/cjs/data/appMiddleware.js +51 -0
- package/dist/cjs/data/errorMiddleware.js +31 -0
- package/dist/cjs/data/index.js +3 -3
- package/dist/cjs/data/listenerMiddleware.js +58 -0
- package/dist/cjs/data/queryMiddleware.js +50 -0
- package/dist/cjs/data/react.js +32 -0
- package/dist/cjs/data/store.js +6 -2
- package/dist/cjs/data/useAppDispatch.js +25 -0
- package/dist/cjs/data/useAppMiddleware.js +34 -0
- package/dist/cjs/data/{react-redux.js → useAppSelector.js} +3 -5
- package/dist/cjs/data/useInjectListener.js +34 -0
- package/dist/cjs/data/useInjectQuery.js +33 -0
- package/dist/cjs/index.js +12 -5
- package/dist/cjs/view/breakpoint/use-breakpoint.js +2 -2
- package/dist/cjs/view/error-toast/index.js +3 -3
- package/dist/cjs/view/live-message/index.js +3 -3
- package/dist/cjs/view/login/index.js +2 -2
- package/dist/cjs/view/modals/navigation-prompt/index.js +2 -2
- package/dist/cjs/view/modals/session-expiry/index.js +2 -2
- package/dist/cjs/view/modals/wait-message/index.js +3 -3
- package/dist/cjs/view/modals/wait-message/wait-message-launcher.js +2 -2
- package/dist/cjs/view/session-timeout/index.js +2 -2
- package/dist/esm/communication/http-client/baseQuery.js +22 -0
- package/dist/esm/data/appMiddleware.js +31 -0
- package/dist/esm/data/errorMiddleware.js +11 -0
- package/dist/esm/data/index.js +1 -1
- package/dist/esm/data/listenerMiddleware.js +38 -0
- package/dist/esm/data/queryMiddleware.js +30 -0
- package/dist/esm/data/react.js +12 -0
- package/dist/esm/data/store.js +7 -5
- package/dist/esm/data/useAppDispatch.js +5 -0
- package/dist/esm/data/useAppMiddleware.js +14 -0
- package/dist/esm/data/useAppSelector.js +5 -0
- package/dist/esm/data/useInjectListener.js +17 -0
- package/dist/esm/data/useInjectQuery.js +15 -0
- package/dist/esm/index.js +14 -1
- package/dist/esm/view/breakpoint/use-breakpoint.js +1 -1
- package/dist/esm/view/error-toast/index.js +1 -1
- package/dist/esm/view/live-message/index.js +1 -1
- package/dist/esm/view/login/index.js +1 -1
- package/dist/esm/view/modals/navigation-prompt/index.js +1 -1
- package/dist/esm/view/modals/session-expiry/index.js +1 -1
- package/dist/esm/view/modals/wait-message/index.js +1 -1
- package/dist/esm/view/modals/wait-message/wait-message-launcher.js +1 -1
- package/dist/esm/view/session-timeout/index.js +1 -1
- package/dist/types/lib/communication/http-client/baseQuery.d.ts +14 -0
- package/dist/types/lib/communication/http-client/index.d.ts +1 -1
- package/dist/types/lib/data/appMiddleware.d.ts +8 -0
- package/dist/types/lib/data/errorMiddleware.d.ts +2 -0
- package/dist/types/lib/data/index.d.ts +1 -1
- package/dist/types/lib/data/listenerMiddleware.d.ts +11 -0
- package/dist/types/lib/data/queryMiddleware.d.ts +11 -0
- package/dist/types/lib/data/react.d.ts +5 -0
- package/dist/types/lib/data/store.d.ts +4 -3
- package/dist/types/lib/data/{react-redux.d.ts → useAppDispatch.d.ts} +0 -3
- package/dist/types/lib/data/useAppMiddleware.d.ts +5 -0
- package/dist/types/lib/data/useAppSelector.d.ts +3 -0
- package/dist/types/lib/data/useInjectListener.d.ts +5 -0
- package/dist/types/lib/data/useInjectQuery.d.ts +7 -0
- package/dist/types/lib/index.d.ts +3 -1
- package/dist/types/lib/utils/testing/render-with-redux.d.ts +2 -2
- package/dist/types/lib/utils/testing/render-with-router-redux.d.ts +2 -2
- package/package.json +1 -1
- package/dist/esm/data/react-redux.js +0 -7
|
@@ -22,10 +22,10 @@ __export(wait_message_launcher_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(wait_message_launcher_exports);
|
|
24
24
|
var import_react = require("react");
|
|
25
|
-
var
|
|
25
|
+
var import_react2 = require("../../../data/react.js");
|
|
26
26
|
var import_actions = require("../../../data/wait-message/actions.js");
|
|
27
27
|
const WaitMessageLauncher = () => {
|
|
28
|
-
const dispatch = (0,
|
|
28
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
29
29
|
(0, import_react.useEffect)(() => {
|
|
30
30
|
dispatch(import_actions.waitMessage.open());
|
|
31
31
|
return () => {
|
|
@@ -23,12 +23,12 @@ __export(session_timeout_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(session_timeout_exports);
|
|
24
24
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
25
|
var import_react = require("react");
|
|
26
|
-
var
|
|
26
|
+
var import_react2 = require("../../data/react.js");
|
|
27
27
|
var import_actions = require("../../data/logout/actions.js");
|
|
28
28
|
var import_session = require("../../utils/session.js");
|
|
29
29
|
var import_session_expiry = require("../modals/session-expiry/index.js");
|
|
30
30
|
const SessionTimeout = () => {
|
|
31
|
-
const dispatch = (0,
|
|
31
|
+
const dispatch = (0, import_react2.useAppDispatch)();
|
|
32
32
|
const [showSessionExpiryWarning, setSessionExpiryWarning] = (0, import_react.useState)(false);
|
|
33
33
|
const [warningNotifiedAt, setwarningNotifiedAt] = (0, import_react.useState)();
|
|
34
34
|
(0, import_react.useEffect)(() => {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getAuthHTTPClient } from "./index.js";
|
|
2
|
+
const sdkBaseQuery = ({ baseUrl } = {}) => async ({ url, method, data, params, headers }) => {
|
|
3
|
+
try {
|
|
4
|
+
const result = await getAuthHTTPClient({
|
|
5
|
+
baseURL: baseUrl,
|
|
6
|
+
headers
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
8
|
+
}).request({ url, method, data, params });
|
|
9
|
+
return { data: result.data };
|
|
10
|
+
} catch (axiosError) {
|
|
11
|
+
const err = axiosError;
|
|
12
|
+
return {
|
|
13
|
+
error: {
|
|
14
|
+
status: err.response?.status,
|
|
15
|
+
data: err.response?.data || err.message
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
sdkBaseQuery
|
|
22
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { compose } from "redux";
|
|
2
|
+
const middlewareDispatchFns = /* @__PURE__ */ new Map();
|
|
3
|
+
let store;
|
|
4
|
+
const appMiddleware = (_store) => {
|
|
5
|
+
store = _store;
|
|
6
|
+
const dispatchFns = Array.from(middlewareDispatchFns.values());
|
|
7
|
+
return (next) => (action) => (
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
9
|
+
compose(...dispatchFns)(next)(action)
|
|
10
|
+
);
|
|
11
|
+
};
|
|
12
|
+
const addMiddleware = ({
|
|
13
|
+
key,
|
|
14
|
+
middleware
|
|
15
|
+
}) => {
|
|
16
|
+
if (middlewareDispatchFns.has(key) || !store)
|
|
17
|
+
return;
|
|
18
|
+
middlewareDispatchFns.set(key, middleware(store));
|
|
19
|
+
};
|
|
20
|
+
const removeMiddleware = (key) => {
|
|
21
|
+
middlewareDispatchFns.delete(key);
|
|
22
|
+
};
|
|
23
|
+
const resetMiddlewares = () => {
|
|
24
|
+
middlewareDispatchFns.clear();
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
addMiddleware,
|
|
28
|
+
appMiddleware,
|
|
29
|
+
removeMiddleware,
|
|
30
|
+
resetMiddlewares
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { isRejectedWithValue } from "@reduxjs/toolkit";
|
|
2
|
+
import { actions as error } from "./error/index.js";
|
|
3
|
+
const errorMiddleware = (api) => (next) => (action) => {
|
|
4
|
+
if (isRejectedWithValue(action)) {
|
|
5
|
+
api.dispatch(error.set({ messageText: action?.error?.data?.message }));
|
|
6
|
+
}
|
|
7
|
+
return next(action);
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
errorMiddleware
|
|
11
|
+
};
|
package/dist/esm/data/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
useInjectSaga,
|
|
4
4
|
createManager
|
|
5
5
|
} from "redux-injectors";
|
|
6
|
-
import { useAppDispatch, useAppSelector } from "./react
|
|
6
|
+
import { useAppDispatch, useAppSelector } from "./react.js";
|
|
7
7
|
import { createAppStore, getStore } from "./store.js";
|
|
8
8
|
export {
|
|
9
9
|
createAppStore as configureStore,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createListenerMiddleware } from "@reduxjs/toolkit";
|
|
2
|
+
let listenerAPI;
|
|
3
|
+
const rtkListenerMiddleware = createListenerMiddleware();
|
|
4
|
+
const listenerDispatchFns = /* @__PURE__ */ new Map();
|
|
5
|
+
const listenerMiddleware = (_listenerAPI) => {
|
|
6
|
+
listenerAPI = _listenerAPI;
|
|
7
|
+
return rtkListenerMiddleware.middleware(listenerAPI);
|
|
8
|
+
};
|
|
9
|
+
const addListener = ({
|
|
10
|
+
key,
|
|
11
|
+
listener
|
|
12
|
+
}) => {
|
|
13
|
+
if (listenerDispatchFns.has(key) && listenerAPI) {
|
|
14
|
+
listenerDispatchFns.set(key, listener);
|
|
15
|
+
return rtkListenerMiddleware.startListening(listener);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
};
|
|
19
|
+
const removeListener = (key) => {
|
|
20
|
+
const listener = listenerDispatchFns.get(key);
|
|
21
|
+
if (listener) {
|
|
22
|
+
listenerDispatchFns.delete(key);
|
|
23
|
+
return rtkListenerMiddleware.stopListening(listener);
|
|
24
|
+
}
|
|
25
|
+
return true;
|
|
26
|
+
};
|
|
27
|
+
const resetListeners = () => {
|
|
28
|
+
listenerDispatchFns.forEach((listener) => {
|
|
29
|
+
rtkListenerMiddleware.stopListening(listener);
|
|
30
|
+
});
|
|
31
|
+
listenerDispatchFns.clear();
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
addListener,
|
|
35
|
+
listenerMiddleware,
|
|
36
|
+
removeListener,
|
|
37
|
+
resetListeners
|
|
38
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { compose } from "redux";
|
|
2
|
+
const middlewareDispatchFns = /* @__PURE__ */ new Map();
|
|
3
|
+
let store;
|
|
4
|
+
const queryMiddleware = (_store) => {
|
|
5
|
+
store = _store;
|
|
6
|
+
return (next) => (action) => (
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
8
|
+
compose(...middlewareDispatchFns.values())(next)(action)
|
|
9
|
+
);
|
|
10
|
+
};
|
|
11
|
+
const addMiddleware = ({
|
|
12
|
+
reducerPath,
|
|
13
|
+
middleware
|
|
14
|
+
}) => {
|
|
15
|
+
if (middlewareDispatchFns.has(reducerPath) || !store)
|
|
16
|
+
return;
|
|
17
|
+
middlewareDispatchFns.set(reducerPath, middleware(store));
|
|
18
|
+
};
|
|
19
|
+
const removeMiddleware = (reducerPath) => {
|
|
20
|
+
middlewareDispatchFns.delete(reducerPath);
|
|
21
|
+
};
|
|
22
|
+
const resetMiddlewares = () => {
|
|
23
|
+
middlewareDispatchFns.clear();
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
addMiddleware,
|
|
27
|
+
queryMiddleware,
|
|
28
|
+
removeMiddleware,
|
|
29
|
+
resetMiddlewares
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useInjectQuery } from "./useInjectQuery.js";
|
|
2
|
+
import { useInjectListener } from "./useInjectListener.js";
|
|
3
|
+
import { useAppDispatch } from "./useAppDispatch.js";
|
|
4
|
+
import { useAppSelector } from "./useAppSelector.js";
|
|
5
|
+
import { useAppMiddleware } from "./useAppMiddleware.js";
|
|
6
|
+
export {
|
|
7
|
+
useAppDispatch,
|
|
8
|
+
useAppMiddleware,
|
|
9
|
+
useAppSelector,
|
|
10
|
+
useInjectListener,
|
|
11
|
+
useInjectQuery
|
|
12
|
+
};
|
package/dist/esm/data/store.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { configureStore } from "@reduxjs/toolkit";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
} from "redux-injectors";
|
|
2
|
+
import { setupListeners } from "@reduxjs/toolkit/query/react";
|
|
3
|
+
import { createInjectorsEnhancer } from "redux-injectors";
|
|
5
4
|
import createSagaMiddleware from "redux-saga";
|
|
6
5
|
import { createReducer } from "./reducers.js";
|
|
7
6
|
import { enableHotReloading } from "./webpack-hmr.js";
|
|
7
|
+
import { queryMiddleware } from "./queryMiddleware.js";
|
|
8
|
+
import { listenerMiddleware } from "./listenerMiddleware.js";
|
|
8
9
|
const rootReducer = createReducer();
|
|
9
10
|
let appStore = null;
|
|
10
11
|
const setStore = (store) => {
|
|
11
12
|
appStore = store;
|
|
12
13
|
};
|
|
13
14
|
const getStore = () => appStore;
|
|
14
|
-
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
15
|
+
const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {}) => {
|
|
15
16
|
const { run: runSaga } = sagaMiddleware;
|
|
16
17
|
const enhancers = [
|
|
17
18
|
createInjectorsEnhancer({
|
|
@@ -21,11 +22,12 @@ const createStore = (initialState, sagaMiddleware, history, middlewareConfig = {
|
|
|
21
22
|
];
|
|
22
23
|
const baseStore = configureStore({
|
|
23
24
|
reducer: rootReducer,
|
|
24
|
-
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).concat(sagaMiddleware),
|
|
25
|
+
middleware: (getDefaultMiddleware) => getDefaultMiddleware(middlewareConfig).prepend(listenerMiddleware).concat([sagaMiddleware, queryMiddleware]),
|
|
25
26
|
devTools: true,
|
|
26
27
|
preloadedState: initialState,
|
|
27
28
|
enhancers
|
|
28
29
|
});
|
|
30
|
+
setupListeners(baseStore.dispatch);
|
|
29
31
|
enableHotReloading(baseStore);
|
|
30
32
|
return baseStore;
|
|
31
33
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { addMiddleware, removeMiddleware } from "./appMiddleware.js";
|
|
3
|
+
const useAppMiddleware = ({
|
|
4
|
+
key,
|
|
5
|
+
middleware
|
|
6
|
+
}) => useEffect(() => {
|
|
7
|
+
addMiddleware({ key, middleware });
|
|
8
|
+
return () => {
|
|
9
|
+
removeMiddleware(key);
|
|
10
|
+
};
|
|
11
|
+
}, [key, middleware]);
|
|
12
|
+
export {
|
|
13
|
+
useAppMiddleware
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import {
|
|
3
|
+
addListener,
|
|
4
|
+
removeListener
|
|
5
|
+
} from "./listenerMiddleware.js";
|
|
6
|
+
const useInjectListener = ({
|
|
7
|
+
key,
|
|
8
|
+
listener
|
|
9
|
+
}) => useEffect(() => {
|
|
10
|
+
addListener({ key, listener });
|
|
11
|
+
return () => {
|
|
12
|
+
removeListener(key);
|
|
13
|
+
};
|
|
14
|
+
}, [key, listener]);
|
|
15
|
+
export {
|
|
16
|
+
useInjectListener
|
|
17
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useInjectReducer } from "redux-injectors";
|
|
2
|
+
import {
|
|
3
|
+
addMiddleware
|
|
4
|
+
} from "./queryMiddleware.js";
|
|
5
|
+
const useInjectQuery = ({
|
|
6
|
+
reducerPath,
|
|
7
|
+
reducer,
|
|
8
|
+
middleware
|
|
9
|
+
}) => {
|
|
10
|
+
useInjectReducer({ key: reducerPath, reducer });
|
|
11
|
+
addMiddleware({ reducerPath, middleware });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
useInjectQuery
|
|
15
|
+
};
|
package/dist/esm/index.js
CHANGED
|
@@ -3,17 +3,25 @@ import {
|
|
|
3
3
|
getHTTPClient,
|
|
4
4
|
getAuthHTTPClient
|
|
5
5
|
} from "./communication/http-client/index.js";
|
|
6
|
+
import { sdkBaseQuery } from "./communication/http-client/baseQuery.js";
|
|
6
7
|
import { onAuthorizationFailure } from "./communication/http-client/response-interceptor.js";
|
|
7
8
|
import { auth } from "./data/auth/actions.js";
|
|
8
9
|
import { RequireAuth } from "./view/require-auth.js";
|
|
9
10
|
import { Page } from "./view/page.js";
|
|
10
11
|
import { default as default2 } from "./utils/constants.js";
|
|
11
|
-
import { useAppDispatch, useAppSelector } from "./data/react-redux.js";
|
|
12
12
|
import {
|
|
13
13
|
useInjectReducer,
|
|
14
14
|
useInjectSaga,
|
|
15
15
|
createManager
|
|
16
16
|
} from "redux-injectors";
|
|
17
|
+
import {
|
|
18
|
+
useInjectQuery,
|
|
19
|
+
useInjectListener,
|
|
20
|
+
useAppDispatch,
|
|
21
|
+
useAppSelector,
|
|
22
|
+
useAppMiddleware
|
|
23
|
+
} from "./data/react.js";
|
|
24
|
+
import { errorMiddleware } from "./data/errorMiddleware.js";
|
|
17
25
|
import { getAuthorizationHeader } from "./utils/auth/helper.js";
|
|
18
26
|
import { getRedirectUrl, removeDoubleSlash } from "./utils/url.js";
|
|
19
27
|
import { createAppStore } from "./data/store.js";
|
|
@@ -158,6 +166,7 @@ export {
|
|
|
158
166
|
createManager,
|
|
159
167
|
enableReactAppForHostIntegration,
|
|
160
168
|
actions2 as error,
|
|
169
|
+
errorMiddleware,
|
|
161
170
|
fetchHostAppData,
|
|
162
171
|
getUser as fetchUserSettings,
|
|
163
172
|
getApiActionCreator,
|
|
@@ -195,6 +204,7 @@ export {
|
|
|
195
204
|
renderWithRouter,
|
|
196
205
|
renderWithRouterRedux,
|
|
197
206
|
resetUserIdleTime,
|
|
207
|
+
sdkBaseQuery,
|
|
198
208
|
sendBAEvent,
|
|
199
209
|
sendMessageToHost,
|
|
200
210
|
setAppConfig,
|
|
@@ -207,7 +217,10 @@ export {
|
|
|
207
217
|
trackActivity,
|
|
208
218
|
updateBAEventParameters,
|
|
209
219
|
useAppDispatch,
|
|
220
|
+
useAppMiddleware,
|
|
210
221
|
useAppSelector,
|
|
222
|
+
useInjectListener,
|
|
223
|
+
useInjectQuery,
|
|
211
224
|
useInjectReducer,
|
|
212
225
|
useInjectSaga,
|
|
213
226
|
useMediaQueryList,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useContext } from "react";
|
|
2
2
|
import { ThemeContext } from "styled-components";
|
|
3
3
|
import { publish } from "pubsub-js";
|
|
4
|
-
import { useAppDispatch } from "../../data/react
|
|
4
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
5
5
|
import { breakpoint } from "../../data/breakpoint/index.js";
|
|
6
6
|
import { useMediaQueryList } from "./use-media-query-list.js";
|
|
7
7
|
import { HOST_WINDOW_BREAKPOINT_CHANGED } from "../../utils/constants.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, memo } from "react";
|
|
3
3
|
import { ToastPosition, ToastType, DSToast, toast } from "@elliemae/ds-toast";
|
|
4
|
-
import { useAppSelector, useAppDispatch } from "../../data/react
|
|
4
|
+
import { useAppSelector, useAppDispatch } from "../../data/react.js";
|
|
5
5
|
import { actions as error } from "../../data/error/index.js";
|
|
6
6
|
const ErrorToast = memo((props) => {
|
|
7
7
|
const storeError = useAppSelector((state) => state?.error);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { LiveMessage as AriaLiveMessage } from "react-aria-live";
|
|
3
|
-
import { useAppSelector } from "../../data/react
|
|
3
|
+
import { useAppSelector } from "../../data/react.js";
|
|
4
4
|
const LiveMessage = () => {
|
|
5
5
|
const message = useAppSelector((state) => state.liveMessage?.message);
|
|
6
6
|
const ariaLive = useAppSelector((state) => state.liveMessage?.ariaLive);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fragment, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { useAppDispatch } from "../../data/react
|
|
3
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
4
4
|
import { login } from "../../utils/auth/index.js";
|
|
5
5
|
import { LOGIN_SUCCESS } from "../../data/auth/actions.js";
|
|
6
6
|
const Login = ({
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
DSDialogSeparator,
|
|
11
11
|
DSDialogAddon
|
|
12
12
|
} from "@elliemae/ds-dialog";
|
|
13
|
-
import { useAppDispatch } from "../../../data/react
|
|
13
|
+
import { useAppDispatch } from "../../../data/react.js";
|
|
14
14
|
import { navigationPrompt } from "../../../data/navigation-prompt/actions.js";
|
|
15
15
|
const NavigationPrompt = memo(
|
|
16
16
|
({ open = false }) => {
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
DSDialogFooter,
|
|
12
12
|
DSDialogSeparator
|
|
13
13
|
} from "@elliemae/ds-dialog";
|
|
14
|
-
import { useAppDispatch } from "../../../data/react
|
|
14
|
+
import { useAppDispatch } from "../../../data/react.js";
|
|
15
15
|
import { logout } from "../../../data/logout/actions.js";
|
|
16
16
|
import {
|
|
17
17
|
resetUserIdleTime,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect } from "react";
|
|
3
3
|
import { DSLoadingIndicator } from "@elliemae/ds-loading-indicator";
|
|
4
|
-
import { useAppSelector } from "../../../data/react
|
|
4
|
+
import { useAppSelector } from "../../../data/react.js";
|
|
5
5
|
import { useHTMLWaitMessage } from "./use-html-wait-message.js";
|
|
6
6
|
import {
|
|
7
7
|
waitStartEvent,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
|
-
import { useAppDispatch } from "../../../data/react
|
|
2
|
+
import { useAppDispatch } from "../../../data/react.js";
|
|
3
3
|
import { waitMessage } from "../../../data/wait-message/actions.js";
|
|
4
4
|
const WaitMessageLauncher = () => {
|
|
5
5
|
const dispatch = useAppDispatch();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
|
-
import { useAppDispatch } from "../../data/react
|
|
3
|
+
import { useAppDispatch } from "../../data/react.js";
|
|
4
4
|
import { logout } from "../../data/logout/actions.js";
|
|
5
5
|
import {
|
|
6
6
|
initSessionMonitoring,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseQueryFn } from '@reduxjs/toolkit/query';
|
|
2
|
+
import { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { RequestConfig } from './index.js';
|
|
4
|
+
type BaseQueryFunction = BaseQueryFn<{
|
|
5
|
+
url: string;
|
|
6
|
+
method: AxiosRequestConfig['method'];
|
|
7
|
+
data?: AxiosRequestConfig['data'];
|
|
8
|
+
params?: AxiosRequestConfig['params'];
|
|
9
|
+
headers?: RequestConfig;
|
|
10
|
+
}, unknown, unknown>;
|
|
11
|
+
export declare const sdkBaseQuery: ({ baseUrl }?: {
|
|
12
|
+
baseUrl?: string | undefined;
|
|
13
|
+
}) => BaseQueryFunction;
|
|
14
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance, RawAxiosRequestHeaders, HeadersDefaults } from 'axios';
|
|
2
2
|
type AxiosRequestHeaders = RawAxiosRequestHeaders | Partial<HeadersDefaults>;
|
|
3
|
-
type RequestConfig = {
|
|
3
|
+
export type RequestConfig = {
|
|
4
4
|
Authorization?: string;
|
|
5
5
|
} & AxiosRequestHeaders;
|
|
6
6
|
export declare const getHTTPClient: ({ baseURL, headers, }?: {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Middleware } from 'redux';
|
|
2
|
+
export declare const appMiddleware: Middleware<any, any>;
|
|
3
|
+
export declare const addMiddleware: ({ key, middleware, }: {
|
|
4
|
+
key: string;
|
|
5
|
+
middleware: Middleware<any, any>;
|
|
6
|
+
}) => void;
|
|
7
|
+
export declare const removeMiddleware: (key: string) => void;
|
|
8
|
+
export declare const resetMiddlewares: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { useInjectReducer, useInjectSaga, createManager, } from 'redux-injectors';
|
|
2
|
-
export { useAppDispatch, useAppSelector } from './react
|
|
2
|
+
export { useAppDispatch, useAppSelector } from './react.js';
|
|
3
3
|
export { createAppStore as configureStore, getStore } from './store.js';
|
|
4
4
|
export type { RootState, AppStore } from './store.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Middleware, AnyAction } from 'redux';
|
|
2
|
+
declare const rtkListenerMiddleware: import("@reduxjs/toolkit").ListenerMiddlewareInstance<unknown, import("@reduxjs/toolkit").ThunkDispatch<unknown, unknown, AnyAction>, unknown>;
|
|
3
|
+
export type ListenerDispatchFn = Parameters<typeof rtkListenerMiddleware.startListening>[0];
|
|
4
|
+
export declare const listenerMiddleware: Middleware<any, any>;
|
|
5
|
+
export declare const addListener: ({ key, listener, }: {
|
|
6
|
+
key: string;
|
|
7
|
+
listener: Parameters<typeof rtkListenerMiddleware.startListening>[0];
|
|
8
|
+
}) => import("@reduxjs/toolkit").UnsubscribeListener | null;
|
|
9
|
+
export declare const removeListener: (key: string) => boolean;
|
|
10
|
+
export declare const resetListeners: () => void;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createApi } from '@reduxjs/toolkit/query/react';
|
|
2
|
+
export type QueryMiddleware = ReturnType<typeof createApi>['middleware'];
|
|
3
|
+
export type QueryReducerPath = ReturnType<typeof createApi>['reducerPath'];
|
|
4
|
+
export type QueryReducer = ReturnType<typeof createApi>['reducer'];
|
|
5
|
+
export declare const queryMiddleware: QueryMiddleware;
|
|
6
|
+
export declare const addMiddleware: ({ reducerPath, middleware, }: {
|
|
7
|
+
reducerPath: QueryReducerPath;
|
|
8
|
+
middleware: QueryMiddleware;
|
|
9
|
+
}) => void;
|
|
10
|
+
export declare const removeMiddleware: (reducerPath: string) => void;
|
|
11
|
+
export declare const resetMiddlewares: () => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { useInjectQuery } from './useInjectQuery.js';
|
|
2
|
+
export { useInjectListener } from './useInjectListener.js';
|
|
3
|
+
export { useAppDispatch } from './useAppDispatch.js';
|
|
4
|
+
export { useAppSelector } from './useAppSelector.js';
|
|
5
|
+
export { useAppMiddleware } from './useAppMiddleware.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Middleware } from 'redux';
|
|
1
2
|
import { History } from 'history';
|
|
2
3
|
declare const rootReducer: import("redux").Reducer<import("redux").CombinedState<{
|
|
3
4
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
@@ -15,7 +16,7 @@ export type RootState = ReturnType<typeof rootReducer>;
|
|
|
15
16
|
export declare const setStore: <T>(store: T) => void;
|
|
16
17
|
export declare const getStore: () => unknown;
|
|
17
18
|
type MiddlewareConfig = {
|
|
18
|
-
thunk
|
|
19
|
+
thunk?: boolean;
|
|
19
20
|
};
|
|
20
21
|
export declare const createAppStore: (initialState: import("redux").CombinedState<{
|
|
21
22
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
@@ -33,11 +34,11 @@ export declare const createAppStore: (initialState: import("redux").CombinedStat
|
|
|
33
34
|
} | import("redux").AnyAction | {
|
|
34
35
|
payload: import("./breakpoint/index.js").Breakpoints;
|
|
35
36
|
type: string;
|
|
36
|
-
}, import("@reduxjs/toolkit").MiddlewareArray<[import("@reduxjs/toolkit").ThunkMiddleware<import("redux").CombinedState<{
|
|
37
|
+
}, import("@reduxjs/toolkit").MiddlewareArray<[Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>, import("@reduxjs/toolkit").ThunkMiddleware<import("redux").CombinedState<{
|
|
37
38
|
waitMessage: import("./wait-message/reducer.js").WaitMessageState;
|
|
38
39
|
error: import("./error/index.js").ErrorState;
|
|
39
40
|
breakpoint: import("./breakpoint/index.js").BreakpointState;
|
|
40
41
|
liveMessage: import("./live-message/index.js").LiveMessageState;
|
|
41
|
-
}>, import("redux").AnyAction, undefined>, import("redux
|
|
42
|
+
}>, import("redux").AnyAction, undefined>, ...Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>[]]>>;
|
|
42
43
|
export type AppStore = ReturnType<typeof createAppStore>;
|
|
43
44
|
export {};
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { Dispatch, PayloadAction, AnyAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { TypedUseSelectorHook } from 'react-redux';
|
|
3
|
-
import { RootState } from './store.js';
|
|
4
2
|
import { WaitMessageState } from './wait-message/reducer.js';
|
|
5
3
|
import { BreakpointState } from './breakpoint/index.js';
|
|
6
4
|
import { ErrorState } from './error/index.js';
|
|
7
5
|
import { LiveMessageState } from './live-message/index.js';
|
|
8
6
|
type AppDispatch = Dispatch<PayloadAction<WaitMessageState> | PayloadAction<BreakpointState> | PayloadAction<ErrorState> | PayloadAction<LiveMessageState> | AnyAction>;
|
|
9
7
|
export declare const useAppDispatch: () => AppDispatch;
|
|
10
|
-
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
|
|
11
8
|
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Reducer, AnyAction } from 'redux';
|
|
2
|
+
import { QueryMiddleware, QueryReducerPath } from './queryMiddleware.js';
|
|
3
|
+
export declare const useInjectQuery: ({ reducerPath, reducer, middleware, }: {
|
|
4
|
+
reducerPath: QueryReducerPath;
|
|
5
|
+
reducer: Reducer<any, AnyAction>;
|
|
6
|
+
middleware: QueryMiddleware;
|
|
7
|
+
}) => void;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export { isUserAuthorized, login, authorize } from './utils/auth/index.js';
|
|
2
2
|
export { getHTTPClient, getAuthHTTPClient, } from './communication/http-client/index.js';
|
|
3
|
+
export { sdkBaseQuery } from './communication/http-client/baseQuery.js';
|
|
3
4
|
export { onAuthorizationFailure } from './communication/http-client/response-interceptor.js';
|
|
4
5
|
export { auth } from './data/auth/actions.js';
|
|
5
6
|
export { RequireAuth } from './view/require-auth.js';
|
|
6
7
|
export { Page } from './view/page.js';
|
|
7
8
|
export { default as globalConstants } from './utils/constants.js';
|
|
8
|
-
export { useAppDispatch, useAppSelector } from './data/react-redux.js';
|
|
9
9
|
export { useInjectReducer, useInjectSaga, createManager, } from 'redux-injectors';
|
|
10
|
+
export { useInjectQuery, useInjectListener, useAppDispatch, useAppSelector, useAppMiddleware, } from './data/react.js';
|
|
11
|
+
export { errorMiddleware } from './data/errorMiddleware.js';
|
|
10
12
|
export { getAuthorizationHeader } from './utils/auth/helper.js';
|
|
11
13
|
export { getRedirectUrl, removeDoubleSlash } from './utils/url.js';
|
|
12
14
|
export { createAppStore as configureStore } from './data/store.js';
|
|
@@ -16,12 +16,12 @@ export declare const renderWithRedux: (ui: React.ReactElement, { initialState, s
|
|
|
16
16
|
} | import("redux").AnyAction | {
|
|
17
17
|
payload: import("../../data/breakpoint/index.js").Breakpoints;
|
|
18
18
|
type: string;
|
|
19
|
-
}, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
|
|
19
|
+
}, import("@reduxjs/toolkit").MiddlewareArray<[import("redux").Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>, import("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
|
|
20
20
|
waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
|
|
21
21
|
error: import("../../data/error/index.js").ErrorState;
|
|
22
22
|
breakpoint: import("../../data/breakpoint/index.js").BreakpointState;
|
|
23
23
|
liveMessage: import("../../data/live-message/index.js").LiveMessageState;
|
|
24
|
-
}>, import("redux").AnyAction, undefined>, import("redux
|
|
24
|
+
}>, import("redux").AnyAction, undefined>, ...import("redux").Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>[]]>>;
|
|
25
25
|
container: HTMLElement;
|
|
26
26
|
baseElement: HTMLElement;
|
|
27
27
|
debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|
|
@@ -19,12 +19,12 @@ export declare const renderWithRouterRedux: (ui: React.ReactElement, { route, hi
|
|
|
19
19
|
} | import("redux").AnyAction | {
|
|
20
20
|
payload: import("../../data/breakpoint/index.js").Breakpoints;
|
|
21
21
|
type: string;
|
|
22
|
-
}, import("@reduxjs/toolkit").MiddlewareArray<[import("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
|
|
22
|
+
}, import("@reduxjs/toolkit").MiddlewareArray<[import("redux").Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>, import("redux-thunk").ThunkMiddleware<import("redux").CombinedState<{
|
|
23
23
|
waitMessage: import("../../data/wait-message/reducer.js").WaitMessageState;
|
|
24
24
|
error: import("../../data/error/index.js").ErrorState;
|
|
25
25
|
breakpoint: import("../../data/breakpoint/index.js").BreakpointState;
|
|
26
26
|
liveMessage: import("../../data/live-message/index.js").LiveMessageState;
|
|
27
|
-
}>, import("redux").AnyAction, undefined>, import("redux
|
|
27
|
+
}>, import("redux").AnyAction, undefined>, ...import("redux").Middleware<any, any, import("redux").Dispatch<import("redux").AnyAction>>[]]>>;
|
|
28
28
|
container: HTMLElement;
|
|
29
29
|
baseElement: HTMLElement;
|
|
30
30
|
debug: (baseElement?: Element | DocumentFragment | (Element | DocumentFragment)[] | undefined, maxLength?: number | undefined, options?: import("pretty-format").PrettyFormatOptions | undefined) => void;
|