@gravity-ui/gateway 3.0.0 → 3.0.2
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/components/rest.js +4 -4
- package/package.json +2 -2
package/build/components/rest.js
CHANGED
|
@@ -34,8 +34,8 @@ function getConfigSerializerFunction(config) {
|
|
|
34
34
|
return undefined;
|
|
35
35
|
}
|
|
36
36
|
function createRestAction(endpoints, config, serviceKey, actionName, options, ErrorConstructor) {
|
|
37
|
-
var _a;
|
|
38
|
-
const timeout = (_a = config === null || config === void 0 ? void 0 : config.timeout) !== null && _a !== void 0 ? _a : options === null || options === void 0 ? void 0 : options.timeout;
|
|
37
|
+
var _a, _b, _c;
|
|
38
|
+
const timeout = (_c = (_a = config === null || config === void 0 ? void 0 : config.timeout) !== null && _a !== void 0 ? _a : (_b = options === null || options === void 0 ? void 0 : options.axiosConfig) === null || _b === void 0 ? void 0 : _b.timeout) !== null && _c !== void 0 ? _c : options === null || options === void 0 ? void 0 : options.timeout;
|
|
39
39
|
const defaultAxiosClient = (0, axios_1.getAxiosClient)(timeout, config === null || config === void 0 ? void 0 : config.retries, options === null || options === void 0 ? void 0 : options.axiosConfig);
|
|
40
40
|
/* eslint-disable complexity */
|
|
41
41
|
return async function action(actionConfig) {
|
|
@@ -197,8 +197,8 @@ function createRestAction(endpoints, config, serviceKey, actionName, options, Er
|
|
|
197
197
|
const startRequestTime = Date.now();
|
|
198
198
|
let axiosClient = defaultAxiosClient;
|
|
199
199
|
const customActionTimeout = (_e = (_d = (_c = actionConfig.timeout) !== null && _c !== void 0 ? _c : config.timeout) !== null && _d !== void 0 ? _d : endpointAxiosConfig.timeout) !== null && _e !== void 0 ? _e : timeout;
|
|
200
|
-
if (actionConfig.timeout || endpointAxiosConfig) {
|
|
201
|
-
const customActionAxiosConfig = Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.axiosConfig) || {})),
|
|
200
|
+
if (actionConfig.timeout || Object.keys(endpointAxiosConfig).length > 0) {
|
|
201
|
+
const customActionAxiosConfig = Object.assign(Object.assign({}, ((options === null || options === void 0 ? void 0 : options.axiosConfig) || {})), endpointAxiosConfig);
|
|
202
202
|
axiosClient = (0, axios_1.getAxiosClient)(customActionTimeout, config === null || config === void 0 ? void 0 : config.retries, customActionAxiosConfig);
|
|
203
203
|
}
|
|
204
204
|
headers['x-request-timeout'] = customActionTimeout !== null && customActionTimeout !== void 0 ? customActionTimeout : constants_1.DEFAULT_TIMEOUT;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gravity-ui/gateway",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "build/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"axios": "^1.3.5",
|
|
44
44
|
"axios-retry": "^3.4.0",
|
|
45
45
|
"lodash": "^4.17.21",
|
|
46
|
-
"object-sizeof": "^2.6.
|
|
46
|
+
"object-sizeof": "^2.6.5",
|
|
47
47
|
"protobufjs": "^7.2.5",
|
|
48
48
|
"uuid": "^9.0.0"
|
|
49
49
|
},
|