swagger-client 3.19.8 → 3.19.10
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 +958 -1119
- package/dist/swagger-client.browser.min.js +1 -1
- package/dist/swagger-client.browser.min.js.map +1 -1
- package/es/resolver/strategies/openapi-3-1-apidom/normalize.js +5 -1
- package/es/resolver/strategies/openapi-3-1-apidom/resolve.js +13 -2
- package/es/specmap/index.js +0 -1
- package/lib/resolver/strategies/openapi-3-1-apidom/normalize.js +5 -1
- package/lib/resolver/strategies/openapi-3-1-apidom/resolve.js +13 -2
- package/lib/specmap/index.js +0 -1
- package/package.json +10 -10
|
@@ -30,9 +30,13 @@ const normalize = element => {
|
|
|
30
30
|
*/
|
|
31
31
|
export const pojoAdapter = normalizeFn => spec => {
|
|
32
32
|
if (spec?.$$normalized) return spec;
|
|
33
|
+
if (pojoAdapter.cache.has(spec)) return spec;
|
|
33
34
|
const openApiElement = OpenApi3_1Element.refract(spec);
|
|
34
35
|
const normalized = normalizeFn(openApiElement);
|
|
35
|
-
|
|
36
|
+
const value = toValue(normalized);
|
|
37
|
+
pojoAdapter.cache.set(spec, value);
|
|
38
|
+
return value;
|
|
36
39
|
};
|
|
40
|
+
pojoAdapter.cache = new WeakMap();
|
|
37
41
|
export default normalize;
|
|
38
42
|
/* eslint-enable camelcase */
|
|
@@ -29,14 +29,24 @@ const resolveOpenAPI31Strategy = async options => {
|
|
|
29
29
|
mode = 'non-strict'
|
|
30
30
|
} = options;
|
|
31
31
|
try {
|
|
32
|
+
const {
|
|
33
|
+
cache
|
|
34
|
+
} = resolveOpenAPI31Strategy;
|
|
35
|
+
|
|
32
36
|
// determining BaseURI
|
|
33
37
|
const cwd = url.isHttpUrl(url.cwd()) ? url.cwd() : 'https://smartbear.com/';
|
|
34
38
|
const retrievalURI = optionsUtil.retrievalURI(options);
|
|
35
39
|
const baseURI = url.resolve(cwd, retrievalURI);
|
|
36
40
|
|
|
37
41
|
// prepare spec for dereferencing
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
let openApiElement;
|
|
43
|
+
if (cache.has(spec)) {
|
|
44
|
+
openApiElement = cache.get(spec);
|
|
45
|
+
} else {
|
|
46
|
+
openApiElement = OpenApi3_1Element.refract(spec);
|
|
47
|
+
openApiElement.classes.push('result');
|
|
48
|
+
cache.set(spec, openApiElement);
|
|
49
|
+
}
|
|
40
50
|
const openApiParseResultElement = new ParseResultElement([openApiElement]);
|
|
41
51
|
|
|
42
52
|
// prepare fragment for dereferencing
|
|
@@ -129,5 +139,6 @@ const resolveOpenAPI31Strategy = async options => {
|
|
|
129
139
|
throw error;
|
|
130
140
|
}
|
|
131
141
|
};
|
|
142
|
+
resolveOpenAPI31Strategy.cache = new WeakMap();
|
|
132
143
|
export default resolveOpenAPI31Strategy;
|
|
133
144
|
/* eslint-enable camelcase */
|
package/es/specmap/index.js
CHANGED
|
@@ -36,11 +36,15 @@ const normalize = element => {
|
|
|
36
36
|
*/
|
|
37
37
|
const pojoAdapter = normalizeFn => spec => {
|
|
38
38
|
if (spec !== null && spec !== void 0 && spec.$$normalized) return spec;
|
|
39
|
+
if (pojoAdapter.cache.has(spec)) return spec;
|
|
39
40
|
const openApiElement = _apidomNsOpenapi.OpenApi3_1Element.refract(spec);
|
|
40
41
|
const normalized = normalizeFn(openApiElement);
|
|
41
|
-
|
|
42
|
+
const value = (0, _apidomCore.toValue)(normalized);
|
|
43
|
+
pojoAdapter.cache.set(spec, value);
|
|
44
|
+
return value;
|
|
42
45
|
};
|
|
43
46
|
exports.pojoAdapter = pojoAdapter;
|
|
47
|
+
pojoAdapter.cache = new WeakMap();
|
|
44
48
|
var _default = normalize;
|
|
45
49
|
/* eslint-enable camelcase */
|
|
46
50
|
exports.default = _default;
|
|
@@ -37,14 +37,24 @@ const resolveOpenAPI31Strategy = async options => {
|
|
|
37
37
|
mode = 'non-strict'
|
|
38
38
|
} = options;
|
|
39
39
|
try {
|
|
40
|
+
const {
|
|
41
|
+
cache
|
|
42
|
+
} = resolveOpenAPI31Strategy;
|
|
43
|
+
|
|
40
44
|
// determining BaseURI
|
|
41
45
|
const cwd = _empty.url.isHttpUrl(_empty.url.cwd()) ? _empty.url.cwd() : 'https://smartbear.com/';
|
|
42
46
|
const retrievalURI = optionsUtil.retrievalURI(options);
|
|
43
47
|
const baseURI = _empty.url.resolve(cwd, retrievalURI);
|
|
44
48
|
|
|
45
49
|
// prepare spec for dereferencing
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
let openApiElement;
|
|
51
|
+
if (cache.has(spec)) {
|
|
52
|
+
openApiElement = cache.get(spec);
|
|
53
|
+
} else {
|
|
54
|
+
openApiElement = _apidomNsOpenapi.OpenApi3_1Element.refract(spec);
|
|
55
|
+
openApiElement.classes.push('result');
|
|
56
|
+
cache.set(spec, openApiElement);
|
|
57
|
+
}
|
|
48
58
|
const openApiParseResultElement = new _apidomCore.ParseResultElement([openApiElement]);
|
|
49
59
|
|
|
50
60
|
// prepare fragment for dereferencing
|
|
@@ -137,6 +147,7 @@ const resolveOpenAPI31Strategy = async options => {
|
|
|
137
147
|
throw error;
|
|
138
148
|
}
|
|
139
149
|
};
|
|
150
|
+
resolveOpenAPI31Strategy.cache = new WeakMap();
|
|
140
151
|
var _default = resolveOpenAPI31Strategy;
|
|
141
152
|
/* eslint-enable camelcase */
|
|
142
153
|
exports.default = _default;
|
package/lib/specmap/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swagger-client",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.10",
|
|
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",
|
|
@@ -82,14 +82,14 @@
|
|
|
82
82
|
"babel-loader": "=9.1.2",
|
|
83
83
|
"babel-plugin-lodash": "=3.3.4",
|
|
84
84
|
"cross-env": "=7.0.3",
|
|
85
|
-
"eslint": "^8.
|
|
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
89
|
"eslint-plugin-prettier": "=4.2.1",
|
|
90
90
|
"expect": "^29.0.3",
|
|
91
91
|
"fetch-mock": "=9.11.0",
|
|
92
|
-
"glob": "=10.2.
|
|
92
|
+
"glob": "=10.2.7",
|
|
93
93
|
"husky": "^8.0.1",
|
|
94
94
|
"inspectpack": "=4.7.1",
|
|
95
95
|
"install": "=0.13.0",
|
|
@@ -106,18 +106,18 @@
|
|
|
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.87.0",
|
|
110
110
|
"webpack-bundle-size-analyzer": "=3.1.0",
|
|
111
|
-
"webpack-cli": "=5.1.
|
|
112
|
-
"webpack-stats-plugin": "=1.1.
|
|
111
|
+
"webpack-cli": "=5.1.4",
|
|
112
|
+
"webpack-stats-plugin": "=1.1.3",
|
|
113
113
|
"xmock": "=0.3.0"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
116
|
"@babel/runtime-corejs3": "^7.20.13",
|
|
117
|
-
"@swagger-api/apidom-core": ">=0.70.
|
|
118
|
-
"@swagger-api/apidom-json-pointer": ">=0.70.
|
|
119
|
-
"@swagger-api/apidom-ns-openapi-3-1": ">=0.70.
|
|
120
|
-
"@swagger-api/apidom-reference": ">=0.70.
|
|
117
|
+
"@swagger-api/apidom-core": ">=0.70.1 <1.0.0",
|
|
118
|
+
"@swagger-api/apidom-json-pointer": ">=0.70.1 <1.0.0",
|
|
119
|
+
"@swagger-api/apidom-ns-openapi-3-1": ">=0.70.2 <1.0.0",
|
|
120
|
+
"@swagger-api/apidom-reference": ">=0.70.2 <1.0.0",
|
|
121
121
|
"cookie": "~0.5.0",
|
|
122
122
|
"cross-fetch": "^3.1.5",
|
|
123
123
|
"deepmerge": "~4.3.0",
|