@gravity-ui/gateway 1.3.0 → 1.4.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/bin/patch.js +8 -9
- package/build/components/rest.js +5 -0
- package/build/models/common.d.ts +1 -0
- package/package.json +1 -1
package/bin/patch.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
#! /usr/bin/env node
|
|
2
2
|
const {execSync} = require('child_process');
|
|
3
|
-
const {copyFileSync, mkdirSync} = require('fs');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
'patches/protobufjs+7.2.5.patch',
|
|
3
|
+
const {copyFileSync, mkdirSync, readdirSync, rmSync} = require('fs');
|
|
4
|
+
const srcPatchesDir = 'node_modules/@gravity-ui/gateway/patches';
|
|
5
|
+
const dstPatchesDir = 'patches';
|
|
6
|
+
|
|
7
|
+
mkdirSync(dstPatchesDir, {recursive: true});
|
|
8
|
+
readdirSync(dstPatchesDir).forEach((patch) => rmSync(`${dstPatchesDir}/${patch}`));
|
|
9
|
+
readdirSync(srcPatchesDir).forEach((patch) =>
|
|
10
|
+
copyFileSync(`${srcPatchesDir}/${patch}`, `${dstPatchesDir}/${patch}`),
|
|
12
11
|
);
|
|
13
12
|
execSync('npx patch-package', {stdio: 'inherit'});
|
package/build/components/rest.js
CHANGED
|
@@ -213,6 +213,11 @@ function createRestAction(endpoints, config, serviceKey, actionName, options, Er
|
|
|
213
213
|
paramsSerializer: config.paramsSerializer,
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
+
if (config.responseType) {
|
|
217
|
+
Object.assign(requestConfig, {
|
|
218
|
+
responseType: config.responseType,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
216
221
|
try {
|
|
217
222
|
const response = await axiosClient.request(requestConfig);
|
|
218
223
|
const endRequestTime = Date.now();
|
package/build/models/common.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ export interface ApiServiceRestActionConfig<Context extends GatewayContext, TOut
|
|
|
120
120
|
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
121
121
|
path: (args: TParams) => string;
|
|
122
122
|
paramsSerializer?: AxiosRequestConfig['paramsSerializer'];
|
|
123
|
+
responseType?: AxiosRequestConfig['responseType'];
|
|
123
124
|
maxRedirects?: number;
|
|
124
125
|
}
|
|
125
126
|
export interface ApiServiceBaseGrpcActionConfig<Context extends GatewayContext, TOutput, TParams = undefined, TTransformed = TOutput> extends ApiServiceBaseActionConfig<Context, TOutput, TParams, TTransformed> {
|