@elliemae/pui-app-sdk 5.30.2 → 5.30.3
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.
|
@@ -43,12 +43,13 @@ var import_logrocket = require("../../utils/micro-frontend/scripting-objects/log
|
|
|
43
43
|
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
44
44
|
const getHTTPClient = ({
|
|
45
45
|
baseURL = (0, import_config.getAppConfigValue)("serviceEndpoints.api", ""),
|
|
46
|
-
headers = {}
|
|
46
|
+
headers = {},
|
|
47
|
+
sendLogRocketSessionHeader = false
|
|
47
48
|
} = {}) => {
|
|
48
49
|
const logRocketSessionUrl = (0, import_logrocket.getLogRocket)()?.sessionURL || "";
|
|
49
50
|
const client = import_axios.default.create({
|
|
50
51
|
baseURL,
|
|
51
|
-
headers: logRocketSessionUrl ? { ...headers, "X-LogRocket-URL": logRocketSessionUrl } : headers
|
|
52
|
+
headers: sendLogRocketSessionHeader && logRocketSessionUrl ? { ...headers, "X-LogRocket-URL": logRocketSessionUrl } : headers
|
|
52
53
|
});
|
|
53
54
|
if (client?.defaults?.timeout) client.defaults.timeout = REQUEST_TIMEOUT;
|
|
54
55
|
(0, import_retry.default)(client);
|
|
@@ -60,10 +61,12 @@ const getHTTPClient = ({
|
|
|
60
61
|
const getAuthHTTPClient = ({
|
|
61
62
|
baseURL,
|
|
62
63
|
headers = {},
|
|
64
|
+
sendLogRocketSessionHeader = false,
|
|
63
65
|
...rest
|
|
64
66
|
} = {}) => getHTTPClient({
|
|
65
67
|
baseURL,
|
|
66
68
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
67
69
|
headers: { ...headers, Authorization: (0, import_helper.getAuthorizationHeader)() },
|
|
70
|
+
sendLogRocketSessionHeader,
|
|
68
71
|
...rest
|
|
69
72
|
});
|
|
@@ -8,12 +8,13 @@ import { getLogRocket } from "../../utils/micro-frontend/scripting-objects/logro
|
|
|
8
8
|
const REQUEST_TIMEOUT = 2 * 60 * 1e3;
|
|
9
9
|
const getHTTPClient = ({
|
|
10
10
|
baseURL = getAppConfigValue("serviceEndpoints.api", ""),
|
|
11
|
-
headers = {}
|
|
11
|
+
headers = {},
|
|
12
|
+
sendLogRocketSessionHeader = false
|
|
12
13
|
} = {}) => {
|
|
13
14
|
const logRocketSessionUrl = getLogRocket()?.sessionURL || "";
|
|
14
15
|
const client = axios.create({
|
|
15
16
|
baseURL,
|
|
16
|
-
headers: logRocketSessionUrl ? { ...headers, "X-LogRocket-URL": logRocketSessionUrl } : headers
|
|
17
|
+
headers: sendLogRocketSessionHeader && logRocketSessionUrl ? { ...headers, "X-LogRocket-URL": logRocketSessionUrl } : headers
|
|
17
18
|
});
|
|
18
19
|
if (client?.defaults?.timeout) client.defaults.timeout = REQUEST_TIMEOUT;
|
|
19
20
|
setupRetry(client);
|
|
@@ -25,11 +26,13 @@ const getHTTPClient = ({
|
|
|
25
26
|
const getAuthHTTPClient = ({
|
|
26
27
|
baseURL,
|
|
27
28
|
headers = {},
|
|
29
|
+
sendLogRocketSessionHeader = false,
|
|
28
30
|
...rest
|
|
29
31
|
} = {}) => getHTTPClient({
|
|
30
32
|
baseURL,
|
|
31
33
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
32
34
|
headers: { ...headers, Authorization: getAuthorizationHeader() },
|
|
35
|
+
sendLogRocketSessionHeader,
|
|
33
36
|
...rest
|
|
34
37
|
});
|
|
35
38
|
export {
|
|
@@ -5,12 +5,14 @@ export type RequestConfig = {
|
|
|
5
5
|
Authorization?: string;
|
|
6
6
|
} & AxiosRequestHeaders;
|
|
7
7
|
export { getAuthorizationHeader };
|
|
8
|
-
export declare const getHTTPClient: ({ baseURL, headers, }?: {
|
|
8
|
+
export declare const getHTTPClient: ({ baseURL, headers, sendLogRocketSessionHeader, }?: {
|
|
9
9
|
baseURL?: string;
|
|
10
10
|
headers?: RequestConfig;
|
|
11
|
+
sendLogRocketSessionHeader?: boolean;
|
|
11
12
|
}) => AxiosInstance;
|
|
12
|
-
export declare const getAuthHTTPClient: ({ baseURL, headers, ...rest }?: {
|
|
13
|
+
export declare const getAuthHTTPClient: ({ baseURL, headers, sendLogRocketSessionHeader, ...rest }?: {
|
|
13
14
|
baseURL?: string;
|
|
14
15
|
headers?: RequestConfig;
|
|
16
|
+
sendLogRocketSessionHeader?: boolean;
|
|
15
17
|
rest?: any[];
|
|
16
18
|
}) => AxiosInstance;
|