@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 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
- mkdirSync('patches', {recursive: true});
5
- copyFileSync(
6
- 'node_modules/@gravity-ui/gateway/patches/grpc-reflection-js+0.3.0.patch',
7
- 'patches/grpc-reflection-js+0.3.0.patch',
8
- );
9
- copyFileSync(
10
- 'node_modules/@gravity-ui/gateway/patches/protobufjs+7.2.5.patch',
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'});
@@ -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();
@@ -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> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/gateway",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",