@gravity-ui/gateway 1.6.0 → 2.0.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.
@@ -9,12 +9,10 @@ export declare function parseMixedError(e: Error & {
9
9
  status: number;
10
10
  message: string;
11
11
  code: string;
12
- details: {
12
+ debug: {
13
13
  originalError: Error & {
14
14
  code?: string | undefined;
15
15
  };
16
- };
17
- debug: {
18
16
  stack: string | undefined;
19
17
  };
20
18
  };
@@ -14,10 +14,8 @@ function parseMixedError(e) {
14
14
  status: 500,
15
15
  message: String(e.message || DEFAULT_GATEWAY_MESSAGE),
16
16
  code: String(e.code || DEFAULT_GATEWAY_CODE),
17
- details: {
18
- originalError: e,
19
- },
20
17
  debug: {
18
+ originalError: e,
21
19
  stack: e.stack,
22
20
  },
23
21
  };
@@ -33,6 +33,7 @@ function getPathParam(value) {
33
33
  }
34
34
  exports.getPathParam = getPathParam;
35
35
  function getPathArgsProxy(args, encodePathArgs) {
36
+ const encodePathArgsVal = encodePathArgs !== null && encodePathArgs !== void 0 ? encodePathArgs : true;
36
37
  if (!args) {
37
38
  return args;
38
39
  }
@@ -47,7 +48,7 @@ function getPathArgsProxy(args, encodePathArgs) {
47
48
  }
48
49
  if (typeof value === 'string') {
49
50
  const pathParam = getPathParam(value);
50
- return encodePathArgs ? encodeURIComponent(pathParam) : pathParam;
51
+ return encodePathArgsVal ? encodeURIComponent(pathParam) : pathParam;
51
52
  }
52
53
  return value; // TODO return error INVALID_PARAMS
53
54
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/gateway",
3
- "version": "1.6.0",
3
+ "version": "2.0.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "main": "build/index.js",