swagger-client 3.24.5 → 3.25.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.
Files changed (64) hide show
  1. package/dist/swagger-client.browser.js +5576 -16671
  2. package/dist/swagger-client.browser.min.js +1 -1
  3. package/dist/swagger-client.browser.min.js.map +1 -1
  4. package/es/execute/index.js +26 -31
  5. package/es/execute/oas3/build-request.js +8 -13
  6. package/es/execute/oas3/parameter-builders.js +20 -24
  7. package/es/execute/oas3/style-serializer.js +23 -28
  8. package/es/execute/swagger2/build-request.js +6 -7
  9. package/es/execute/swagger2/parameter-builders.js +24 -29
  10. package/es/helpers/each-operation.js +0 -2
  11. package/es/helpers/get-operation-raw.js +5 -6
  12. package/es/helpers/id-from-path-method/index.js +3 -4
  13. package/es/helpers/op-id.js +3 -5
  14. package/es/http/index.js +12 -28
  15. package/es/index.js +2 -4
  16. package/es/interfaces.js +33 -42
  17. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js +8 -9
  18. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js +3 -4
  19. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +5 -9
  20. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +4 -5
  21. package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +4 -5
  22. package/es/resolver/apidom/reference/resolve/resolvers/http-swagger-client/index.js +3 -4
  23. package/es/resolver/strategies/generic/index.js +3 -4
  24. package/es/resolver/strategies/generic/normalize.js +0 -2
  25. package/es/resolver/strategies/openapi-2/index.js +6 -8
  26. package/es/resolver/strategies/openapi-3-0/index.js +6 -8
  27. package/es/resolver/strategies/openapi-3-1-apidom/index.js +6 -8
  28. package/es/resolver/strategies/openapi-3-1-apidom/normalize.js +1 -1
  29. package/es/resolver/utils/index.js +1 -2
  30. package/es/specmap/helpers.js +5 -6
  31. package/es/specmap/index.js +2 -10
  32. package/es/specmap/lib/create-error.js +1 -4
  33. package/es/subtree-resolver/index.js +2 -4
  34. package/lib/execute/index.js +26 -35
  35. package/lib/execute/oas3/build-request.js +8 -13
  36. package/lib/execute/oas3/parameter-builders.js +20 -24
  37. package/lib/execute/oas3/style-serializer.js +23 -27
  38. package/lib/execute/swagger2/build-request.js +6 -7
  39. package/lib/execute/swagger2/parameter-builders.js +24 -29
  40. package/lib/helpers/each-operation.js +0 -2
  41. package/lib/helpers/get-operation-raw.js +5 -6
  42. package/lib/helpers/id-from-path-method/index.js +3 -4
  43. package/lib/helpers/op-id.js +3 -7
  44. package/lib/http/index.js +12 -42
  45. package/lib/index.js +2 -8
  46. package/lib/interfaces.js +33 -50
  47. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/index.js +8 -9
  48. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js +3 -4
  49. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +5 -9
  50. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +4 -5
  51. package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +4 -5
  52. package/lib/resolver/apidom/reference/resolve/resolvers/http-swagger-client/index.js +3 -4
  53. package/lib/resolver/strategies/generic/index.js +3 -4
  54. package/lib/resolver/strategies/generic/normalize.js +0 -2
  55. package/lib/resolver/strategies/openapi-2/index.js +6 -8
  56. package/lib/resolver/strategies/openapi-3-0/index.js +6 -8
  57. package/lib/resolver/strategies/openapi-3-1-apidom/index.js +6 -8
  58. package/lib/resolver/strategies/openapi-3-1-apidom/normalize.js +1 -1
  59. package/lib/resolver/utils/index.js +1 -4
  60. package/lib/specmap/helpers.js +5 -6
  61. package/lib/specmap/index.js +2 -10
  62. package/lib/specmap/lib/create-error.js +1 -4
  63. package/lib/subtree-resolver/index.js +2 -8
  64. package/package.json +14 -12
@@ -17,15 +17,14 @@ const OpenApi3_1SwaggerClientDereferenceStrategy = OpenApi3_1DereferenceStrategy
17
17
  mode: 'non-strict',
18
18
  ancestors: null
19
19
  },
20
- init() {
21
- let {
22
- useCircularStructures = this.useCircularStructures,
23
- allowMetaPatches = this.allowMetaPatches,
24
- parameterMacro = this.parameterMacro,
25
- modelPropertyMacro = this.modelPropertyMacro,
26
- mode = this.mode,
27
- ancestors = []
28
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
20
+ init({
21
+ useCircularStructures = this.useCircularStructures,
22
+ allowMetaPatches = this.allowMetaPatches,
23
+ parameterMacro = this.parameterMacro,
24
+ modelPropertyMacro = this.modelPropertyMacro,
25
+ mode = this.mode,
26
+ ancestors = []
27
+ } = {}) {
29
28
  this.name = 'openapi-3-1-swagger-client';
30
29
  this.useCircularStructures = useCircularStructures;
31
30
  this.allowMetaPatches = allowMetaPatches;
@@ -3,10 +3,9 @@ import { isSchemaElement, SchemaElement } from '@swagger-api/apidom-ns-openapi-3
3
3
  import compose from '../utils/compose.js';
4
4
  import toPath from '../utils/to-path.js';
5
5
  const AllOfVisitor = compose({
6
- init(_ref) {
7
- let {
8
- options
9
- } = _ref;
6
+ init({
7
+ options
8
+ }) {
10
9
  this.options = options;
11
10
  },
12
11
  props: {
@@ -30,12 +30,11 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
30
30
  allowMetaPatches: false,
31
31
  basePath: null
32
32
  },
33
- init(_ref) {
34
- let {
35
- allowMetaPatches = this.allowMetaPatches,
36
- useCircularStructures = this.useCircularStructures,
37
- basePath = this.basePath
38
- } = _ref;
33
+ init({
34
+ allowMetaPatches = this.allowMetaPatches,
35
+ useCircularStructures = this.useCircularStructures,
36
+ basePath = this.basePath
37
+ }) {
39
38
  this.allowMetaPatches = allowMetaPatches;
40
39
  this.useCircularStructures = useCircularStructures;
41
40
  this.basePath = basePath;
@@ -178,7 +177,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
178
177
  } else if (Array.isArray(parent)) {
179
178
  parent[key] = replaceWith; // eslint-disable-line no-param-reassign
180
179
  }
181
-
182
180
  return false;
183
181
  }
184
182
 
@@ -323,7 +321,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
323
321
  } else if (Array.isArray(parent)) {
324
322
  parent[key] = replaceWith; // eslint-disable-line no-param-reassign
325
323
  }
326
-
327
324
  return false;
328
325
  }
329
326
 
@@ -522,7 +519,6 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
522
519
  } else if (Array.isArray(parent)) {
523
520
  parent[key] = replaceWith; // eslint-disable-line no-param-reassign
524
521
  }
525
-
526
522
  return false;
527
523
  }
528
524
 
@@ -2,11 +2,10 @@ import { toValue } from '@swagger-api/apidom-core';
2
2
  import compose from '../utils/compose.js';
3
3
  import toPath from '../utils/to-path.js';
4
4
  const ParameterMacroVisitor = compose({
5
- init(_ref) {
6
- let {
7
- parameterMacro,
8
- options
9
- } = _ref;
5
+ init({
6
+ parameterMacro,
7
+ options
8
+ }) {
10
9
  this.parameterMacro = parameterMacro;
11
10
  this.options = options;
12
11
  },
@@ -2,11 +2,10 @@ import { isObjectElement, toValue } from '@swagger-api/apidom-core';
2
2
  import compose from '../utils/compose.js';
3
3
  import toPath from '../utils/to-path.js';
4
4
  const ModelPropertyMacroVisitor = compose({
5
- init(_ref) {
6
- let {
7
- modelPropertyMacro,
8
- options
9
- } = _ref;
5
+ init({
6
+ modelPropertyMacro,
7
+ options
8
+ }) {
10
9
  this.modelPropertyMacro = modelPropertyMacro;
11
10
  this.options = options;
12
11
  },
@@ -8,10 +8,9 @@ const HttpResolverSwaggerClient = HttpResolver.compose({
8
8
  swaggerHTTPClient: Http,
9
9
  swaggerHTTPClientConfig: {}
10
10
  },
11
- init() {
12
- let {
13
- swaggerHTTPClient = this.swaggerHTTPClient
14
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11
+ init({
12
+ swaggerHTTPClient = this.swaggerHTTPClient
13
+ } = {}) {
15
14
  this.swaggerHTTPClient = swaggerHTTPClient;
16
15
  },
17
16
  methods: {
@@ -9,10 +9,9 @@ const genericStrategy = {
9
9
  match() {
10
10
  return true;
11
11
  },
12
- normalize(_ref) {
13
- let {
14
- spec
15
- } = _ref;
12
+ normalize({
13
+ spec
14
+ }) {
16
15
  const {
17
16
  spec: normalized
18
17
  } = normalize({
@@ -17,7 +17,6 @@ export default function normalize(parsedSpec) {
17
17
  if (path == null || !['object', 'function'].includes(typeof path)) {
18
18
  continue; // eslint-disable-line no-continue
19
19
  }
20
-
21
20
  const pathParameters = path.parameters;
22
21
 
23
22
  // eslint-disable-next-line no-restricted-syntax, guard-for-in
@@ -26,7 +25,6 @@ export default function normalize(parsedSpec) {
26
25
  if (operation == null || !['object', 'function'].includes(typeof operation)) {
27
26
  continue; // eslint-disable-line no-continue
28
27
  }
29
-
30
28
  const oid = opId(operation, pathName, method);
31
29
  if (oid) {
32
30
  if (map[oid]) {
@@ -4,16 +4,14 @@ import { isOpenAPI2 } from '../../../helpers/openapi-predicates.js';
4
4
  export { clearCache } from '../generic/index.js';
5
5
  const openApi2Strategy = {
6
6
  name: 'openapi-2',
7
- match(_ref) {
8
- let {
9
- spec
10
- } = _ref;
7
+ match({
8
+ spec
9
+ }) {
11
10
  return isOpenAPI2(spec);
12
11
  },
13
- normalize(_ref2) {
14
- let {
15
- spec
16
- } = _ref2;
12
+ normalize({
13
+ spec
14
+ }) {
17
15
  const {
18
16
  spec: normalized
19
17
  } = normalize({
@@ -4,16 +4,14 @@ import { isOpenAPI30 } from '../../../helpers/openapi-predicates.js';
4
4
  export { clearCache } from '../generic/index.js';
5
5
  const openApi30Strategy = {
6
6
  name: 'openapi-3-0',
7
- match(_ref) {
8
- let {
9
- spec
10
- } = _ref;
7
+ match({
8
+ spec
9
+ }) {
11
10
  return isOpenAPI30(spec);
12
11
  },
13
- normalize(_ref2) {
14
- let {
15
- spec
16
- } = _ref2;
12
+ normalize({
13
+ spec
14
+ }) {
17
15
  const {
18
16
  spec: normalized
19
17
  } = normalize({
@@ -3,16 +3,14 @@ import normalize, { pojoAdapter } from './normalize.js';
3
3
  import { isOpenAPI31 } from '../../../helpers/openapi-predicates.js';
4
4
  const openApi31ApiDOMStrategy = {
5
5
  name: 'openapi-3-1-apidom',
6
- match(_ref) {
7
- let {
8
- spec
9
- } = _ref;
6
+ match({
7
+ spec
8
+ }) {
10
9
  return isOpenAPI31(spec);
11
10
  },
12
- normalize(_ref2) {
13
- let {
14
- spec
15
- } = _ref2;
11
+ normalize({
12
+ spec
13
+ }) {
16
14
  return pojoAdapter(normalize)(spec);
17
15
  },
18
16
  async resolve(options) {
@@ -30,7 +30,7 @@ const normalize = element => {
30
30
  */
31
31
  export const pojoAdapter = normalizeFn => spec => {
32
32
  if (spec !== null && spec !== void 0 && spec.$$normalized) return spec;
33
- if (pojoAdapter.cache.has(spec)) return spec;
33
+ if (pojoAdapter.cache.has(spec)) return pojoAdapter.cache.get(spec);
34
34
  const openApiElement = OpenApi3_1Element.refract(spec);
35
35
  const normalized = normalizeFn(openApiElement);
36
36
  const value = toValue(normalized);
@@ -1,8 +1,7 @@
1
1
  import { ACCEPT_HEADER_VALUE_FOR_DOCUMENTS } from '../../constants.js';
2
2
 
3
3
  // eslint-disable-next-line import/prefer-default-export
4
- export function makeFetchJSON(http) {
5
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4
+ export function makeFetchJSON(http, opts = {}) {
6
5
  const {
7
6
  requestInterceptor,
8
7
  responseInterceptor
@@ -33,12 +33,11 @@ export function isFreelyNamed(parentPath) {
33
33
  freelyNamedKeyParents.indexOf(parentKey) > -1 && nonFreelyNamedKeyGrandparents.indexOf(grandparentKey) === -1 || freelyNamedPaths.indexOf(parentStr) > -1 || freelyNamedAncestors.some(el => parentStr.indexOf(el) > -1)
34
34
  );
35
35
  }
36
- export function generateAbsoluteRefPatches(obj, basePath) {
37
- let {
38
- specmap,
39
- getBaseUrlForNodePath = path => specmap.getContext([...basePath, ...path]).baseDoc,
40
- targetKeys = ['$ref', '$$ref']
41
- } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
36
+ export function generateAbsoluteRefPatches(obj, basePath, {
37
+ specmap,
38
+ getBaseUrlForNodePath = path => specmap.getContext([...basePath, ...path]).baseDoc,
39
+ targetKeys = ['$ref', '$$ref']
40
+ } = {}) {
42
41
  const patches = [];
43
42
  traverse(obj).forEach(function callback() {
44
43
  if (targetKeys.includes(this.key) && typeof this.node === 'string') {
@@ -48,24 +48,16 @@ class SpecMap {
48
48
  this.patches.push(lib.context([], this.context));
49
49
  this.updatePatches(this.patches);
50
50
  }
51
- debug(level) {
51
+ debug(level, ...args) {
52
52
  if (this.debugLevel === level) {
53
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
54
- args[_key - 1] = arguments[_key];
55
- }
56
53
  console.log(...args); // eslint-disable-line no-console
57
54
  }
58
55
  }
59
-
60
- verbose(header) {
56
+ verbose(header, ...args) {
61
57
  if (this.debugLevel === 'verbose') {
62
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
63
- args[_key2 - 1] = arguments[_key2];
64
- }
65
58
  console.log(`[${header}] `, ...args); // eslint-disable-line no-console
66
59
  }
67
60
  }
68
-
69
61
  wrapPlugin(plugin, name) {
70
62
  const {
71
63
  pathDiscriminator
@@ -1,13 +1,10 @@
1
1
  export default function createErrorType(name, init) {
2
- function E() {
2
+ function E(...args) {
3
3
  if (!Error.captureStackTrace) {
4
4
  this.stack = new Error().stack;
5
5
  } else {
6
6
  Error.captureStackTrace(this, this.constructor);
7
7
  }
8
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9
- args[_key] = arguments[_key];
10
- }
11
8
  [this.message] = args;
12
9
  if (init) {
13
10
  init.apply(this, args);
@@ -24,8 +24,7 @@ import resolve from '../resolver/index.js';
24
24
  import genericResolverStrategy from '../resolver/strategies/generic/index.js';
25
25
  import openApi2ResolverStrategy from '../resolver/strategies/openapi-2/index.js';
26
26
  import openApi30ResolverStrategy from '../resolver/strategies/openapi-3-0/index.js';
27
- const resolveSubtree = async function (obj, path) {
28
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
27
+ const resolveSubtree = async (obj, path, options = {}) => {
29
28
  const {
30
29
  returnEntireTree,
31
30
  baseDoc,
@@ -60,8 +59,7 @@ const resolveSubtree = async function (obj, path) {
60
59
  }
61
60
  return result;
62
61
  };
63
- export const makeResolveSubtree = defaultOptions => async function (obj, path) {
64
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
62
+ export const makeResolveSubtree = defaultOptions => async (obj, path, options = {}) => {
65
63
  const mergedOptions = {
66
64
  ...defaultOptions,
67
65
  ...options
@@ -78,19 +78,18 @@ const self = exports.self = {
78
78
 
79
79
  // Execute request, with the given operationId and parameters
80
80
  // pathName/method or operationId is optional
81
- function execute(_ref) {
82
- let {
83
- http: userHttp,
84
- fetch,
85
- // This is legacy
86
- spec,
87
- operationId,
88
- pathName,
89
- method,
90
- parameters,
91
- securities,
92
- ...extras
93
- } = _ref;
81
+ function execute({
82
+ http: userHttp,
83
+ fetch,
84
+ // This is legacy
85
+ spec,
86
+ operationId,
87
+ pathName,
88
+ method,
89
+ parameters,
90
+ securities,
91
+ ...extras
92
+ }) {
94
93
  // Provide default fetch implementation
95
94
  const http = userHttp || fetch || _index.default; // Default to _our_ http
96
95
 
@@ -293,16 +292,15 @@ function baseUrl(obj) {
293
292
  return specIsOAS3 ? oas3BaseUrl(obj) : swagger2BaseUrl(obj);
294
293
  }
295
294
  const isNonEmptyServerList = value => Array.isArray(value) && value.length > 0;
296
- function oas3BaseUrl(_ref2) {
295
+ function oas3BaseUrl({
296
+ spec,
297
+ pathName,
298
+ method,
299
+ server,
300
+ contextUrl,
301
+ serverVariables = {}
302
+ }) {
297
303
  var _spec$paths, _spec$paths2;
298
- let {
299
- spec,
300
- pathName,
301
- method,
302
- server,
303
- contextUrl,
304
- serverVariables = {}
305
- } = _ref2;
306
304
  let servers = [];
307
305
  let selectedServerUrl = '';
308
306
  let selectedServerObj;
@@ -341,13 +339,7 @@ function oas3BaseUrl(_ref2) {
341
339
  }
342
340
  return buildOas3UrlWithContext(selectedServerUrl, contextUrl);
343
341
  }
344
- function buildOas3UrlWithContext(ourUrl, contextUrl) {
345
- if (ourUrl === void 0) {
346
- ourUrl = '';
347
- }
348
- if (contextUrl === void 0) {
349
- contextUrl = '';
350
- }
342
+ function buildOas3UrlWithContext(ourUrl = '', contextUrl = '') {
351
343
  // relative server url should be resolved against contextUrl
352
344
  const parsedUrl = ourUrl && contextUrl ? parseURIReference(_empty.url.resolve(contextUrl, ourUrl)) : parseURIReference(ourUrl);
353
345
  const parsedContextUrl = parseURIReference(contextUrl);
@@ -377,12 +369,11 @@ function getVariableTemplateNames(str) {
377
369
  }
378
370
 
379
371
  // Compose the baseUrl ( scheme + host + basePath )
380
- function swagger2BaseUrl(_ref3) {
381
- let {
382
- spec,
383
- scheme,
384
- contextUrl = ''
385
- } = _ref3;
372
+ function swagger2BaseUrl({
373
+ spec,
374
+ scheme,
375
+ contextUrl = ''
376
+ }) {
386
377
  const parsedContextUrl = parseURIReference(contextUrl);
387
378
  const firstSchemeInSpec = Array.isArray(spec.schemes) ? spec.schemes[0] : null;
388
379
  const computedScheme = scheme || firstSchemeInSpec || stripNonAlpha(parsedContextUrl.protocol) || 'http';
@@ -47,14 +47,10 @@ function buildRequest(options, req) {
47
47
  req.headers['Content-Type'] = requestContentType;
48
48
  }
49
49
  if (!options.responseContentType && operation.responses) {
50
- const mediaTypes = Object.entries(operation.responses).filter(_ref => {
51
- let [key, value] = _ref;
50
+ const mediaTypes = Object.entries(operation.responses).filter(([key, value]) => {
52
51
  const code = parseInt(key, 10);
53
52
  return code >= 200 && code < 300 && (0, _isPlainObject.isPlainObject)(value.content);
54
- }).reduce((acc, _ref2) => {
55
- let [, value] = _ref2;
56
- return acc.concat(Object.keys(value.content));
57
- }, []);
53
+ }).reduce((acc, [, value]) => acc.concat(Object.keys(value.content)), []);
58
54
  if (mediaTypes.length > 0) {
59
55
  req.headers.accept = mediaTypes.join(', ');
60
56
  }
@@ -93,14 +89,13 @@ function buildRequest(options, req) {
93
89
 
94
90
  // Add security values, to operations - that declare their need on them
95
91
  // Adapted from the Swagger2 implementation
96
- function applySecurities(_ref3) {
92
+ function applySecurities({
93
+ request,
94
+ securities = {},
95
+ operation = {},
96
+ spec
97
+ }) {
97
98
  var _spec$components;
98
- let {
99
- request,
100
- securities = {},
101
- operation = {},
102
- spec
103
- } = _ref3;
104
99
  const result = {
105
100
  ...request
106
101
  };
@@ -9,12 +9,11 @@ exports.path = path;
9
9
  exports.query = query;
10
10
  var _styleSerializer = _interopRequireWildcard(require("./style-serializer.js"));
11
11
  var _contentSerializer = _interopRequireDefault(require("./content-serializer.js"));
12
- function path(_ref) {
13
- let {
14
- req,
15
- value,
16
- parameter
17
- } = _ref;
12
+ function path({
13
+ req,
14
+ value,
15
+ parameter
16
+ }) {
18
17
  const {
19
18
  name,
20
19
  style,
@@ -37,12 +36,11 @@ function path(_ref) {
37
36
  });
38
37
  req.url = req.url.split(`{${name}}`).join(styledValue);
39
38
  }
40
- function query(_ref2) {
41
- let {
42
- req,
43
- value,
44
- parameter
45
- } = _ref2;
39
+ function query({
40
+ req,
41
+ value,
42
+ parameter
43
+ }) {
46
44
  req.query = req.query || {};
47
45
  if (parameter.content) {
48
46
  const effectiveMediaType = Object.keys(parameter.content)[0];
@@ -83,12 +81,11 @@ function query(_ref2) {
83
81
  }
84
82
  }
85
83
  const PARAMETER_HEADER_BLACKLIST = ['accept', 'authorization', 'content-type'];
86
- function header(_ref3) {
87
- let {
88
- req,
89
- parameter,
90
- value
91
- } = _ref3;
84
+ function header({
85
+ req,
86
+ parameter,
87
+ value
88
+ }) {
92
89
  req.headers = req.headers || {};
93
90
  if (PARAMETER_HEADER_BLACKLIST.indexOf(parameter.name.toLowerCase()) > -1) {
94
91
  return;
@@ -108,12 +105,11 @@ function header(_ref3) {
108
105
  });
109
106
  }
110
107
  }
111
- function cookie(_ref4) {
112
- let {
113
- req,
114
- parameter,
115
- value
116
- } = _ref4;
108
+ function cookie({
109
+ req,
110
+ parameter,
111
+ value
112
+ }) {
117
113
  req.headers = req.headers || {};
118
114
  const type = typeof value;
119
115
  if (parameter.content) {
@@ -7,10 +7,9 @@ const isRfc3986Reserved = char => ":/?#[]@!$&'()*+,;=".indexOf(char) > -1;
7
7
  const isRrc3986Unreserved = char => /^[a-z0-9\-._~]+$/i.test(char);
8
8
 
9
9
  // eslint-disable-next-line default-param-last
10
- function encodeDisallowedCharacters(str, _temp, parse) {
11
- let {
12
- escape
13
- } = _temp === void 0 ? {} : _temp;
10
+ function encodeDisallowedCharacters(str, {
11
+ escape
12
+ } = {}, parse) {
14
13
  if (typeof str === 'number') {
15
14
  str = str.toString();
16
15
  }
@@ -52,14 +51,13 @@ function stylize(config) {
52
51
  }
53
52
  return encodePrimitive(config);
54
53
  }
55
- function encodeArray(_ref) {
56
- let {
57
- key,
58
- value,
59
- style,
60
- explode,
61
- escape
62
- } = _ref;
54
+ function encodeArray({
55
+ key,
56
+ value,
57
+ style,
58
+ explode,
59
+ escape
60
+ }) {
63
61
  const valueEncoder = str => encodeDisallowedCharacters(str, {
64
62
  escape
65
63
  });
@@ -91,14 +89,13 @@ function encodeArray(_ref) {
91
89
  }
92
90
  return undefined;
93
91
  }
94
- function encodeObject(_ref2) {
95
- let {
96
- key,
97
- value,
98
- style,
99
- explode,
100
- escape
101
- } = _ref2;
92
+ function encodeObject({
93
+ key,
94
+ value,
95
+ style,
96
+ explode,
97
+ escape
98
+ }) {
102
99
  const valueEncoder = str => encodeDisallowedCharacters(str, {
103
100
  escape
104
101
  });
@@ -144,13 +141,12 @@ function encodeObject(_ref2) {
144
141
  }
145
142
  return undefined;
146
143
  }
147
- function encodePrimitive(_ref3) {
148
- let {
149
- key,
150
- value,
151
- style,
152
- escape
153
- } = _ref3;
144
+ function encodePrimitive({
145
+ key,
146
+ value,
147
+ style,
148
+ escape
149
+ }) {
154
150
  const valueEncoder = str => encodeDisallowedCharacters(str, {
155
151
  escape
156
152
  });
@@ -50,13 +50,12 @@ function buildRequest(options, req) {
50
50
  }
51
51
 
52
52
  // Add security values, to operations - that declare their need on them
53
- function applySecurities(_ref) {
54
- let {
55
- request,
56
- securities = {},
57
- operation = {},
58
- spec
59
- } = _ref;
53
+ function applySecurities({
54
+ request,
55
+ securities = {},
56
+ operation = {},
57
+ spec
58
+ }) {
60
59
  const result = {
61
60
  ...request
62
61
  };