swagger-client 3.29.2 → 3.29.3
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/es/execute/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import cookie from 'cookie';
|
|
2
|
+
import { identity } from 'ramda';
|
|
2
3
|
import { isPlainObject } from 'ramda-adjunct';
|
|
3
4
|
import { test as testServerURLTemplate, substitute as substituteServerURLTemplate } from 'openapi-server-url-templating';
|
|
4
5
|
import { ApiDOMStructuredError } from '@swagger-api/apidom-error';
|
|
@@ -116,7 +117,8 @@ export function buildRequest(options) {
|
|
|
116
117
|
server,
|
|
117
118
|
serverVariables,
|
|
118
119
|
http,
|
|
119
|
-
signal
|
|
120
|
+
signal,
|
|
121
|
+
serverVariableEncoder
|
|
120
122
|
} = options;
|
|
121
123
|
let {
|
|
122
124
|
parameters,
|
|
@@ -170,7 +172,8 @@ export function buildRequest(options) {
|
|
|
170
172
|
server,
|
|
171
173
|
serverVariables,
|
|
172
174
|
pathName,
|
|
173
|
-
method
|
|
175
|
+
method,
|
|
176
|
+
serverVariableEncoder
|
|
174
177
|
});
|
|
175
178
|
req.url += baseURL;
|
|
176
179
|
|
|
@@ -289,7 +292,8 @@ function oas3BaseUrl({
|
|
|
289
292
|
method,
|
|
290
293
|
server,
|
|
291
294
|
contextUrl,
|
|
292
|
-
serverVariables = {}
|
|
295
|
+
serverVariables = {},
|
|
296
|
+
serverVariableEncoder
|
|
293
297
|
}) {
|
|
294
298
|
var _spec$paths, _spec$paths2;
|
|
295
299
|
let servers = [];
|
|
@@ -327,6 +331,8 @@ function oas3BaseUrl({
|
|
|
327
331
|
selectedServerUrl = substituteServerURLTemplate(selectedServerUrl, {
|
|
328
332
|
...selectedServerVariables,
|
|
329
333
|
...serverVariables
|
|
334
|
+
}, {
|
|
335
|
+
encoder: typeof serverVariableEncoder === 'function' ? serverVariableEncoder : identity
|
|
330
336
|
});
|
|
331
337
|
}
|
|
332
338
|
return buildOas3UrlWithContext(selectedServerUrl, contextUrl);
|
package/lib/execute/index.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.buildRequest = buildRequest;
|
|
|
8
8
|
exports.execute = execute;
|
|
9
9
|
exports.self = void 0;
|
|
10
10
|
var _cookie = _interopRequireDefault(require("cookie"));
|
|
11
|
+
var _ramda = require("ramda");
|
|
11
12
|
var _ramdaAdjunct = require("ramda-adjunct");
|
|
12
13
|
var _openapiServerUrlTemplating = require("openapi-server-url-templating");
|
|
13
14
|
var _apidomError = require("@swagger-api/apidom-error");
|
|
@@ -125,7 +126,8 @@ function buildRequest(options) {
|
|
|
125
126
|
server,
|
|
126
127
|
serverVariables,
|
|
127
128
|
http,
|
|
128
|
-
signal
|
|
129
|
+
signal,
|
|
130
|
+
serverVariableEncoder
|
|
129
131
|
} = options;
|
|
130
132
|
let {
|
|
131
133
|
parameters,
|
|
@@ -179,7 +181,8 @@ function buildRequest(options) {
|
|
|
179
181
|
server,
|
|
180
182
|
serverVariables,
|
|
181
183
|
pathName,
|
|
182
|
-
method
|
|
184
|
+
method,
|
|
185
|
+
serverVariableEncoder
|
|
183
186
|
});
|
|
184
187
|
req.url += baseURL;
|
|
185
188
|
|
|
@@ -298,7 +301,8 @@ function oas3BaseUrl({
|
|
|
298
301
|
method,
|
|
299
302
|
server,
|
|
300
303
|
contextUrl,
|
|
301
|
-
serverVariables = {}
|
|
304
|
+
serverVariables = {},
|
|
305
|
+
serverVariableEncoder
|
|
302
306
|
}) {
|
|
303
307
|
var _spec$paths, _spec$paths2;
|
|
304
308
|
let servers = [];
|
|
@@ -336,6 +340,8 @@ function oas3BaseUrl({
|
|
|
336
340
|
selectedServerUrl = (0, _openapiServerUrlTemplating.substitute)(selectedServerUrl, {
|
|
337
341
|
...selectedServerVariables,
|
|
338
342
|
...serverVariables
|
|
343
|
+
}, {
|
|
344
|
+
encoder: typeof serverVariableEncoder === 'function' ? serverVariableEncoder : _ramda.identity
|
|
339
345
|
});
|
|
340
346
|
}
|
|
341
347
|
return buildOas3UrlWithContext(selectedServerUrl, contextUrl);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swagger-client",
|
|
3
|
-
"version": "3.29.
|
|
3
|
+
"version": "3.29.3",
|
|
4
4
|
"description": "SwaggerJS - a collection of interfaces for OAI specs",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./src/helpers/btoa.node.js": "./src/helpers/btoa.browser.js",
|
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
"node-fetch-commonjs": "^3.3.2",
|
|
87
87
|
"openapi-path-templating": "^1.5.1",
|
|
88
88
|
"openapi-server-url-templating": "^1.0.0",
|
|
89
|
+
"ramda": "^0.30.1",
|
|
89
90
|
"ramda-adjunct": "^5.0.0",
|
|
90
91
|
"neotraverse": "=0.6.18"
|
|
91
92
|
},
|
|
@@ -103,7 +104,7 @@
|
|
|
103
104
|
"eslint": "^8.42.0",
|
|
104
105
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
105
106
|
"eslint-config-prettier": "=9.1.0",
|
|
106
|
-
"eslint-plugin-import": "=2.
|
|
107
|
+
"eslint-plugin-import": "=2.30.0",
|
|
107
108
|
"eslint-plugin-prettier": "=5.2.1",
|
|
108
109
|
"expect": "^29.0.3",
|
|
109
110
|
"glob": "=11.0.0",
|
|
@@ -114,7 +115,7 @@
|
|
|
114
115
|
"jest-environment-jsdom": "^29.0.3",
|
|
115
116
|
"json-loader": "=0.5.7",
|
|
116
117
|
"license-checker": "=25.0.1",
|
|
117
|
-
"lint-staged": "=15.2.
|
|
118
|
+
"lint-staged": "=15.2.10",
|
|
118
119
|
"lodash": "^4.17.21",
|
|
119
120
|
"npm-run-all": "=4.1.5",
|
|
120
121
|
"prettier": "^3.1.1",
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
"source-map-explorer": "^2.5.3",
|
|
123
124
|
"terser-webpack-plugin": "^5.0.3",
|
|
124
125
|
"undici": "^5.28.4",
|
|
125
|
-
"webpack": "=5.
|
|
126
|
+
"webpack": "=5.94.0",
|
|
126
127
|
"webpack-bundle-size-analyzer": "=3.1.0",
|
|
127
128
|
"webpack-cli": "=5.1.4",
|
|
128
129
|
"webpack-stats-plugin": "=1.1.3"
|