swagger-client 3.19.10 → 3.19.11
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/dist/swagger-client.browser.js +46 -31
- package/dist/swagger-client.browser.min.js +1 -1
- package/dist/swagger-client.browser.min.js.map +1 -1
- package/es/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +7 -5
- package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/all-of.js +4 -4
- package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/dereference.js +15 -13
- package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/parameters.js +2 -2
- package/lib/resolver/apidom/reference/dereference/strategies/openapi-3-1-swagger-client/visitors/properties.js +2 -2
- package/package.json +12 -12
|
@@ -51,7 +51,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
|
|
|
51
51
|
return false;
|
|
52
52
|
}
|
|
53
53
|
const reference = await this.toReference(referenceElement.$ref.toValue());
|
|
54
|
-
const
|
|
54
|
+
const {
|
|
55
|
+
uri: retrievalURI
|
|
56
|
+
} = reference;
|
|
55
57
|
const $refBaseURI = url.resolve(retrievalURI, referenceElement.$ref.toValue());
|
|
56
58
|
this.indirections.push(referenceElement);
|
|
57
59
|
const jsonPointer = uriToPointer($refBaseURI);
|
|
@@ -188,7 +190,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
|
|
|
188
190
|
return undefined;
|
|
189
191
|
}
|
|
190
192
|
const reference = await this.toReference(pathItemElement.$ref.toValue());
|
|
191
|
-
const
|
|
193
|
+
const {
|
|
194
|
+
uri: retrievalURI
|
|
195
|
+
} = reference;
|
|
192
196
|
const $refBaseURI = url.resolve(retrievalURI, pathItemElement.$ref.toValue());
|
|
193
197
|
this.indirections.push(pathItemElement);
|
|
194
198
|
const jsonPointer = uriToPointer($refBaseURI);
|
|
@@ -310,9 +314,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = OpenApi3_1DereferenceVisitor.c
|
|
|
310
314
|
}
|
|
311
315
|
|
|
312
316
|
// compute baseURI using rules around $id and $ref keywords
|
|
313
|
-
let
|
|
314
|
-
reference
|
|
315
|
-
} = this;
|
|
317
|
+
let reference = await this.toReference(url.unsanitize(this.reference.uri));
|
|
316
318
|
let {
|
|
317
319
|
uri: retrievalURI
|
|
318
320
|
} = reference;
|
|
@@ -22,10 +22,10 @@ const AllOfVisitor = (0, _compose.default)({
|
|
|
22
22
|
|
|
23
23
|
// collect error and return if allOf keyword is not an array
|
|
24
24
|
if (!(0, _apidomCore.isArrayElement)(schemaElement.allOf)) {
|
|
25
|
-
var _this$options$derefer, _this$options$derefer2
|
|
25
|
+
var _this$options$derefer, _this$options$derefer2;
|
|
26
26
|
const error = new TypeError('allOf must be an array');
|
|
27
27
|
error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
|
|
28
|
-
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0
|
|
28
|
+
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0 || (_this$options$derefer = _this$options$derefer.errors) === null || _this$options$derefer === void 0 || (_this$options$derefer2 = _this$options$derefer.push) === null || _this$options$derefer2 === void 0 ? void 0 : _this$options$derefer2.call(_this$options$derefer, error);
|
|
29
29
|
return undefined;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -37,10 +37,10 @@ const AllOfVisitor = (0, _compose.default)({
|
|
|
37
37
|
// collect errors if allOf keyword contains anything else than Schema Object
|
|
38
38
|
const includesSchemaElementOnly = schemaElement.allOf.content.every(_apidomNsOpenapi.isSchemaElement);
|
|
39
39
|
if (!includesSchemaElementOnly) {
|
|
40
|
-
var _this$options$
|
|
40
|
+
var _this$options$derefer3, _this$options$derefer4;
|
|
41
41
|
const error = new TypeError('Elements in allOf must be objects');
|
|
42
42
|
error.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'allOf'];
|
|
43
|
-
(_this$options$
|
|
43
|
+
(_this$options$derefer3 = this.options.dereference.dereferenceOpts) === null || _this$options$derefer3 === void 0 || (_this$options$derefer3 = _this$options$derefer3.errors) === null || _this$options$derefer3 === void 0 || (_this$options$derefer4 = _this$options$derefer3.push) === null || _this$options$derefer4 === void 0 ? void 0 : _this$options$derefer4.call(_this$options$derefer3, error);
|
|
44
44
|
return undefined;
|
|
45
45
|
}
|
|
46
46
|
const mergedSchemaElement = _apidomCore.deepmerge.all([...schemaElement.allOf.content, schemaElement]);
|
|
@@ -57,7 +57,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
57
57
|
return false;
|
|
58
58
|
}
|
|
59
59
|
const reference = await this.toReference(referenceElement.$ref.toValue());
|
|
60
|
-
const
|
|
60
|
+
const {
|
|
61
|
+
uri: retrievalURI
|
|
62
|
+
} = reference;
|
|
61
63
|
const $refBaseURI = _empty.url.resolve(retrievalURI, referenceElement.$ref.toValue());
|
|
62
64
|
this.indirections.push(referenceElement);
|
|
63
65
|
const jsonPointer = (0, _apidomJsonPointer.uriToPointer)($refBaseURI);
|
|
@@ -158,7 +160,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
158
160
|
// transclude the element for a fragment
|
|
159
161
|
return fragment;
|
|
160
162
|
} catch (error) {
|
|
161
|
-
var _this$basePath2, _this$options$derefer, _this$options$derefer2
|
|
163
|
+
var _this$basePath2, _this$options$derefer, _this$options$derefer2;
|
|
162
164
|
const rootCause = (0, _getRootCause.default)(error);
|
|
163
165
|
const wrappedError = wrapError(rootCause, {
|
|
164
166
|
baseDoc: this.reference.uri,
|
|
@@ -166,7 +168,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
166
168
|
pointer: (0, _apidomJsonPointer.uriToPointer)(referenceElement.$ref.toValue()),
|
|
167
169
|
fullPath: (_this$basePath2 = this.basePath) !== null && _this$basePath2 !== void 0 ? _this$basePath2 : [...(0, _toPath.default)([...ancestors, parent, referenceElement]), '$ref']
|
|
168
170
|
});
|
|
169
|
-
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0
|
|
171
|
+
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0 || (_this$options$derefer = _this$options$derefer.errors) === null || _this$options$derefer === void 0 || (_this$options$derefer2 = _this$options$derefer.push) === null || _this$options$derefer2 === void 0 ? void 0 : _this$options$derefer2.call(_this$options$derefer, wrappedError);
|
|
170
172
|
return undefined;
|
|
171
173
|
}
|
|
172
174
|
},
|
|
@@ -196,7 +198,9 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
196
198
|
return undefined;
|
|
197
199
|
}
|
|
198
200
|
const reference = await this.toReference(pathItemElement.$ref.toValue());
|
|
199
|
-
const
|
|
201
|
+
const {
|
|
202
|
+
uri: retrievalURI
|
|
203
|
+
} = reference;
|
|
200
204
|
const $refBaseURI = _empty.url.resolve(retrievalURI, pathItemElement.$ref.toValue());
|
|
201
205
|
this.indirections.push(pathItemElement);
|
|
202
206
|
const jsonPointer = (0, _apidomJsonPointer.uriToPointer)($refBaseURI);
|
|
@@ -285,7 +289,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
285
289
|
// transclude referencing element with merged referenced element
|
|
286
290
|
return mergedPathItemElement;
|
|
287
291
|
} catch (error) {
|
|
288
|
-
var _this$basePath4, _this$options$
|
|
292
|
+
var _this$basePath4, _this$options$derefer3, _this$options$derefer4;
|
|
289
293
|
const rootCause = (0, _getRootCause.default)(error);
|
|
290
294
|
const wrappedError = wrapError(rootCause, {
|
|
291
295
|
baseDoc: this.reference.uri,
|
|
@@ -293,7 +297,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
293
297
|
pointer: (0, _apidomJsonPointer.uriToPointer)(pathItemElement.$ref.toValue()),
|
|
294
298
|
fullPath: (_this$basePath4 = this.basePath) !== null && _this$basePath4 !== void 0 ? _this$basePath4 : [...(0, _toPath.default)([...ancestors, parent, pathItemElement]), '$ref']
|
|
295
299
|
});
|
|
296
|
-
(_this$options$
|
|
300
|
+
(_this$options$derefer3 = this.options.dereference.dereferenceOpts) === null || _this$options$derefer3 === void 0 || (_this$options$derefer3 = _this$options$derefer3.errors) === null || _this$options$derefer3 === void 0 || (_this$options$derefer4 = _this$options$derefer3.push) === null || _this$options$derefer4 === void 0 ? void 0 : _this$options$derefer4.call(_this$options$derefer3, wrappedError);
|
|
297
301
|
return undefined;
|
|
298
302
|
}
|
|
299
303
|
},
|
|
@@ -320,9 +324,7 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
320
324
|
}
|
|
321
325
|
|
|
322
326
|
// compute baseURI using rules around $id and $ref keywords
|
|
323
|
-
let
|
|
324
|
-
reference
|
|
325
|
-
} = this;
|
|
327
|
+
let reference = await this.toReference(_empty.url.unsanitize(this.reference.uri));
|
|
326
328
|
let {
|
|
327
329
|
uri: retrievalURI
|
|
328
330
|
} = reference;
|
|
@@ -471,14 +473,14 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
471
473
|
// transclude referencing element with merged referenced element
|
|
472
474
|
return mergedSchemaElement;
|
|
473
475
|
} catch (error) {
|
|
474
|
-
var _this$basePath6, _this$options$
|
|
476
|
+
var _this$basePath6, _this$options$derefer5, _this$options$derefer6;
|
|
475
477
|
const rootCause = (0, _getRootCause.default)(error);
|
|
476
478
|
const wrappedError = new _index.SchemaRefError(`Could not resolve reference: ${rootCause.message}`, {
|
|
477
479
|
baseDoc: this.reference.uri,
|
|
478
480
|
$ref: referencingElement.$ref.toValue(),
|
|
479
481
|
fullPath: (_this$basePath6 = this.basePath) !== null && _this$basePath6 !== void 0 ? _this$basePath6 : [...(0, _toPath.default)([...ancestors, parent, referencingElement]), '$ref']
|
|
480
482
|
}, rootCause);
|
|
481
|
-
(_this$options$
|
|
483
|
+
(_this$options$derefer5 = this.options.dereference.dereferenceOpts) === null || _this$options$derefer5 === void 0 || (_this$options$derefer5 = _this$options$derefer5.errors) === null || _this$options$derefer5 === void 0 || (_this$options$derefer6 = _this$options$derefer5.push) === null || _this$options$derefer6 === void 0 ? void 0 : _this$options$derefer6.call(_this$options$derefer5, wrappedError);
|
|
482
484
|
return undefined;
|
|
483
485
|
}
|
|
484
486
|
},
|
|
@@ -494,14 +496,14 @@ const OpenApi3_1SwaggerClientDereferenceVisitor = _openapi.OpenApi3_1Dereference
|
|
|
494
496
|
try {
|
|
495
497
|
return await _openapi.OpenApi3_1DereferenceVisitor.compose.methods.ExampleElement.call(this, exampleElement, key, parent, path, ancestors);
|
|
496
498
|
} catch (error) {
|
|
497
|
-
var _exampleElement$exter, _this$basePath7, _this$options$
|
|
499
|
+
var _exampleElement$exter, _this$basePath7, _this$options$derefer7, _this$options$derefer8;
|
|
498
500
|
const rootCause = (0, _getRootCause.default)(error);
|
|
499
501
|
const wrappedError = wrapError(rootCause, {
|
|
500
502
|
baseDoc: this.reference.uri,
|
|
501
503
|
externalValue: (_exampleElement$exter = exampleElement.externalValue) === null || _exampleElement$exter === void 0 ? void 0 : _exampleElement$exter.toValue(),
|
|
502
504
|
fullPath: (_this$basePath7 = this.basePath) !== null && _this$basePath7 !== void 0 ? _this$basePath7 : [...(0, _toPath.default)([...ancestors, parent, exampleElement]), 'externalValue']
|
|
503
505
|
});
|
|
504
|
-
(_this$options$
|
|
506
|
+
(_this$options$derefer7 = this.options.dereference.dereferenceOpts) === null || _this$options$derefer7 === void 0 || (_this$options$derefer7 = _this$options$derefer7.errors) === null || _this$options$derefer7 === void 0 || (_this$options$derefer8 = _this$options$derefer7.push) === null || _this$options$derefer8 === void 0 ? void 0 : _this$options$derefer8.call(_this$options$derefer7, wrappedError);
|
|
505
507
|
return undefined;
|
|
506
508
|
}
|
|
507
509
|
}
|
|
@@ -34,12 +34,12 @@ const ParameterMacroVisitor = (0, _compose.default)({
|
|
|
34
34
|
const macroValue = this.parameterMacro(pojoOperation, pojoParameter);
|
|
35
35
|
parameterElement.set('default', macroValue);
|
|
36
36
|
} catch (error) {
|
|
37
|
-
var _this$options$derefer, _this$options$derefer2
|
|
37
|
+
var _this$options$derefer, _this$options$derefer2;
|
|
38
38
|
const macroError = new Error(error, {
|
|
39
39
|
cause: error
|
|
40
40
|
});
|
|
41
41
|
macroError.fullPath = (0, _toPath.default)([...ancestors, parent]);
|
|
42
|
-
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0
|
|
42
|
+
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0 || (_this$options$derefer = _this$options$derefer.errors) === null || _this$options$derefer === void 0 || (_this$options$derefer2 = _this$options$derefer.push) === null || _this$options$derefer2 === void 0 ? void 0 : _this$options$derefer2.call(_this$options$derefer, macroError);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -27,12 +27,12 @@ const ModelPropertyMacroVisitor = (0, _compose.default)({
|
|
|
27
27
|
const macroValue = this.modelPropertyMacro((0, _apidomCore.toValue)(property));
|
|
28
28
|
property.set('default', macroValue);
|
|
29
29
|
} catch (error) {
|
|
30
|
-
var _this$options$derefer, _this$options$derefer2
|
|
30
|
+
var _this$options$derefer, _this$options$derefer2;
|
|
31
31
|
const macroError = new Error(error, {
|
|
32
32
|
cause: error
|
|
33
33
|
});
|
|
34
34
|
macroError.fullPath = [...(0, _toPath.default)([...ancestors, parent, schemaElement]), 'properties'];
|
|
35
|
-
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0
|
|
35
|
+
(_this$options$derefer = this.options.dereference.dereferenceOpts) === null || _this$options$derefer === void 0 || (_this$options$derefer = _this$options$derefer.errors) === null || _this$options$derefer === void 0 || (_this$options$derefer2 = _this$options$derefer.push) === null || _this$options$derefer2 === void 0 ? void 0 : _this$options$derefer2.call(_this$options$derefer, macroError);
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swagger-client",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.11",
|
|
4
4
|
"description": "SwaggerJS - a collection of interfaces for OAI specs",
|
|
5
5
|
"browser": {
|
|
6
6
|
"./src/http/fold-formdata-to-request.node.js": "./src/http/fold-formdata-to-request.browser.js",
|
|
@@ -79,17 +79,17 @@
|
|
|
79
79
|
"@commitlint/cli": "^17.0.0",
|
|
80
80
|
"@commitlint/config-conventional": "^17.0.0",
|
|
81
81
|
"abort-controller": "^3.0.0",
|
|
82
|
-
"babel-loader": "=9.1.
|
|
82
|
+
"babel-loader": "=9.1.3",
|
|
83
83
|
"babel-plugin-lodash": "=3.3.4",
|
|
84
84
|
"cross-env": "=7.0.3",
|
|
85
85
|
"eslint": "^8.42.0",
|
|
86
86
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
87
87
|
"eslint-config-prettier": "=8.8.0",
|
|
88
88
|
"eslint-plugin-import": "=2.27.5",
|
|
89
|
-
"eslint-plugin-prettier": "=
|
|
89
|
+
"eslint-plugin-prettier": "=5.0.0",
|
|
90
90
|
"expect": "^29.0.3",
|
|
91
91
|
"fetch-mock": "=9.11.0",
|
|
92
|
-
"glob": "=10.
|
|
92
|
+
"glob": "=10.3.3",
|
|
93
93
|
"husky": "^8.0.1",
|
|
94
94
|
"inspectpack": "=4.7.1",
|
|
95
95
|
"install": "=0.13.0",
|
|
@@ -97,16 +97,16 @@
|
|
|
97
97
|
"jest-environment-jsdom": "^29.0.3",
|
|
98
98
|
"json-loader": "=0.5.7",
|
|
99
99
|
"license-checker": "=25.0.1",
|
|
100
|
-
"lint-staged": "=13.2.
|
|
100
|
+
"lint-staged": "=13.2.3",
|
|
101
101
|
"lodash-webpack-plugin": "=0.11.6",
|
|
102
|
-
"nock": "=13.3.
|
|
102
|
+
"nock": "=13.3.2",
|
|
103
103
|
"node-fetch": "^2.6.7",
|
|
104
104
|
"npm-run-all": "=4.1.5",
|
|
105
|
-
"prettier": "^
|
|
105
|
+
"prettier": "^3.0.0",
|
|
106
106
|
"rimraf": "=5.0.1",
|
|
107
107
|
"source-map-explorer": "^2.5.3",
|
|
108
108
|
"terser-webpack-plugin": "^5.0.3",
|
|
109
|
-
"webpack": "=5.
|
|
109
|
+
"webpack": "=5.88.1",
|
|
110
110
|
"webpack-bundle-size-analyzer": "=3.1.0",
|
|
111
111
|
"webpack-cli": "=5.1.4",
|
|
112
112
|
"webpack-stats-plugin": "=1.1.3",
|
|
@@ -114,10 +114,10 @@
|
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
116
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
117
|
-
"@swagger-api/apidom-core": ">=0.
|
|
118
|
-
"@swagger-api/apidom-json-pointer": ">=0.
|
|
119
|
-
"@swagger-api/apidom-ns-openapi-3-1": ">=0.
|
|
120
|
-
"@swagger-api/apidom-reference": ">=0.
|
|
117
|
+
"@swagger-api/apidom-core": ">=0.71.0 <1.0.0",
|
|
118
|
+
"@swagger-api/apidom-json-pointer": ">=0.71.0 <1.0.0",
|
|
119
|
+
"@swagger-api/apidom-ns-openapi-3-1": ">=0.71.0 <1.0.0",
|
|
120
|
+
"@swagger-api/apidom-reference": ">=0.71.1 <1.0.0",
|
|
121
121
|
"cookie": "~0.5.0",
|
|
122
122
|
"cross-fetch": "^3.1.5",
|
|
123
123
|
"deepmerge": "~4.3.0",
|