oas 38.5.1 → 38.5.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/dist/analyzer/index.cjs +16 -16
- package/dist/analyzer/index.js +1 -1
- package/dist/{chunk-SMIO4Q5R.js → chunk-22M4FT6M.js} +2 -2
- package/dist/{chunk-FRJT3NFM.cjs → chunk-7DE5LTVI.cjs} +72 -72
- package/dist/{chunk-FRJT3NFM.cjs.map → chunk-7DE5LTVI.cjs.map} +1 -1
- package/dist/{chunk-EQK5HAUI.cjs → chunk-BMTOEJB2.cjs} +46 -22
- package/dist/chunk-BMTOEJB2.cjs.map +1 -0
- package/dist/{chunk-6D7GWVEH.js → chunk-JLN5A26A.js} +17 -15
- package/dist/chunk-JLN5A26A.js.map +1 -0
- package/dist/{chunk-VQNK3PSL.js → chunk-PUG4I2IA.js} +34 -10
- package/dist/chunk-PUG4I2IA.js.map +1 -0
- package/dist/{chunk-6GTPCWO5.cjs → chunk-Y5HU4SVH.cjs} +17 -15
- package/dist/chunk-Y5HU4SVH.cjs.map +1 -0
- package/dist/{index-JqhiKm_-.d.cts → index-C4bupNyk.d.cts} +12 -0
- package/dist/{index-BTzc-Kc8.d.ts → index-C6OzXwLp.d.ts} +12 -0
- package/dist/index.cjs +38 -38
- package/dist/index.js +2 -2
- package/dist/operation/index.cjs +3 -3
- package/dist/operation/index.js +2 -2
- package/dist/pruner/index.cjs +4 -4
- package/dist/pruner/index.d.cts +1 -1
- package/dist/pruner/index.d.ts +1 -1
- package/dist/pruner/index.js +3 -3
- package/dist/reducer/index.cjs +7 -7
- package/dist/reducer/index.cjs.map +1 -1
- package/dist/reducer/index.d.cts +4 -4
- package/dist/reducer/index.d.ts +4 -4
- package/dist/reducer/index.js +6 -6
- package/dist/reducer/index.js.map +1 -1
- package/dist/utils.cjs +2 -2
- package/dist/utils.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-6D7GWVEH.js.map +0 -1
- package/dist/chunk-6GTPCWO5.cjs.map +0 -1
- package/dist/chunk-EQK5HAUI.cjs.map +0 -1
- package/dist/chunk-VQNK3PSL.js.map +0 -1
- /package/dist/{chunk-SMIO4Q5R.js.map → chunk-22M4FT6M.js.map} +0 -0
package/dist/analyzer/index.cjs
CHANGED
|
@@ -8,7 +8,7 @@ var _chunkCOHEPMUPcjs = require('../chunk-COHEPMUP.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkY5HU4SVHcjs = require('../chunk-Y5HU4SVH.cjs');
|
|
12
12
|
require('../chunk-EARDDQSB.cjs');
|
|
13
13
|
|
|
14
14
|
|
|
@@ -116,7 +116,7 @@ function queryCached(queries, definition) {
|
|
|
116
116
|
// src/analyzer/scope.ts
|
|
117
117
|
var _jsonpointer = require('jsonpointer'); var _jsonpointer2 = _interopRequireDefault(_jsonpointer);
|
|
118
118
|
function canonicalizeRefPointer($ref) {
|
|
119
|
-
const pointer =
|
|
119
|
+
const pointer = _chunkY5HU4SVHcjs.toPointer.call(void 0, $ref);
|
|
120
120
|
try {
|
|
121
121
|
return decodeURIComponent(pointer);
|
|
122
122
|
} catch (e) {
|
|
@@ -154,7 +154,7 @@ function resolveKey(keys, target) {
|
|
|
154
154
|
return keys.find((key) => key === target) || keys.find((key) => key.toLowerCase() === target.toLowerCase());
|
|
155
155
|
}
|
|
156
156
|
function resolvePathItem(raw, definition) {
|
|
157
|
-
const resolved =
|
|
157
|
+
const resolved = _chunkY5HU4SVHcjs.dereferenceRef.call(void 0, raw, definition);
|
|
158
158
|
if (!resolved || typeof resolved !== "object" || _chunk7PWF3F2Wcjs.isRef.call(void 0, resolved)) {
|
|
159
159
|
return void 0;
|
|
160
160
|
}
|
|
@@ -162,7 +162,7 @@ function resolvePathItem(raw, definition) {
|
|
|
162
162
|
}
|
|
163
163
|
function resolveMethodKey(container, method) {
|
|
164
164
|
const methodKey = resolveKey(Object.keys(container), method);
|
|
165
|
-
if (!methodKey || !
|
|
165
|
+
if (!methodKey || !_chunkY5HU4SVHcjs.supportedMethods.includes(methodKey.toLowerCase())) {
|
|
166
166
|
return void 0;
|
|
167
167
|
}
|
|
168
168
|
return methodKey;
|
|
@@ -178,14 +178,14 @@ function accumulateReachableRefs(definition, seeds) {
|
|
|
178
178
|
reachable.add(ref);
|
|
179
179
|
let resolved;
|
|
180
180
|
try {
|
|
181
|
-
resolved = _jsonpointer2.default.get(definition,
|
|
181
|
+
resolved = _jsonpointer2.default.get(definition, _chunkY5HU4SVHcjs.toPointer.call(void 0, ref));
|
|
182
182
|
} catch (e3) {
|
|
183
183
|
continue;
|
|
184
184
|
}
|
|
185
185
|
if (resolved === void 0) {
|
|
186
186
|
continue;
|
|
187
187
|
}
|
|
188
|
-
|
|
188
|
+
_chunkY5HU4SVHcjs.collectRefsInSchema.call(void 0, resolved).forEach((nestedRef) => {
|
|
189
189
|
if (!reachable.has(nestedRef)) {
|
|
190
190
|
queue.push(nestedRef);
|
|
191
191
|
}
|
|
@@ -195,7 +195,7 @@ function accumulateReachableRefs(definition, seeds) {
|
|
|
195
195
|
}
|
|
196
196
|
function buildAnchors(rootPointer, extraPointers, reachableRefs) {
|
|
197
197
|
const anchors = [rootPointer, ...extraPointers];
|
|
198
|
-
reachableRefs.forEach((ref) => anchors.push(
|
|
198
|
+
reachableRefs.forEach((ref) => anchors.push(_chunkY5HU4SVHcjs.toPointer.call(void 0, ref)));
|
|
199
199
|
return { anchors, anchorPrefixes: anchors.map((anchor) => `${anchor}/`) };
|
|
200
200
|
}
|
|
201
201
|
function collectSecuritySchemeRefs(security) {
|
|
@@ -230,16 +230,16 @@ function computeOperationScope(definition, path, method) {
|
|
|
230
230
|
if (!operation || typeof operation !== "object") {
|
|
231
231
|
throw new Error(`Operation \`${method} ${path}\` not found.`);
|
|
232
232
|
}
|
|
233
|
-
const rootPointer = `/paths/${
|
|
233
|
+
const rootPointer = `/paths/${_chunkY5HU4SVHcjs.encodePointer.call(void 0, pathKey)}/${methodKey}`;
|
|
234
234
|
const extraPointers = [];
|
|
235
|
-
const seeds = new Set(
|
|
235
|
+
const seeds = new Set(_chunkY5HU4SVHcjs.collectRefsInSchema.call(void 0, operation));
|
|
236
236
|
const targetPointer = resolvePathItemTargetPointer(rawPathItem, definition);
|
|
237
237
|
if (targetPointer) {
|
|
238
238
|
extraPointers.push(`${targetPointer}/${methodKey}`);
|
|
239
239
|
}
|
|
240
240
|
if (pathItem.parameters) {
|
|
241
|
-
extraPointers.push(targetPointer ? `${targetPointer}/parameters` : `/paths/${
|
|
242
|
-
|
|
241
|
+
extraPointers.push(targetPointer ? `${targetPointer}/parameters` : `/paths/${_chunkY5HU4SVHcjs.encodePointer.call(void 0, pathKey)}/parameters`);
|
|
242
|
+
_chunkY5HU4SVHcjs.collectRefsInSchema.call(void 0, pathItem.parameters).forEach((ref) => seeds.add(ref));
|
|
243
243
|
}
|
|
244
244
|
const security = "security" in operation ? operation.security : definition.security;
|
|
245
245
|
collectSecuritySchemeRefs(security).forEach((ref) => seeds.add(ref));
|
|
@@ -265,18 +265,18 @@ function computeWebhookScope(definition, webhookName, method) {
|
|
|
265
265
|
if (!operation || typeof operation !== "object") {
|
|
266
266
|
throw new Error(`Webhook operation \`${method} ${webhookName}\` not found.`);
|
|
267
267
|
}
|
|
268
|
-
const rootPointer = `/webhooks/${
|
|
268
|
+
const rootPointer = `/webhooks/${_chunkY5HU4SVHcjs.encodePointer.call(void 0, webhookKey)}/${methodKey}`;
|
|
269
269
|
const extraPointers = [];
|
|
270
|
-
const seeds = new Set(
|
|
270
|
+
const seeds = new Set(_chunkY5HU4SVHcjs.collectRefsInSchema.call(void 0, operation));
|
|
271
271
|
const targetPointer = resolvePathItemTargetPointer(rawWebhook, definition);
|
|
272
272
|
if (targetPointer) {
|
|
273
273
|
extraPointers.push(`${targetPointer}/${methodKey}`);
|
|
274
274
|
}
|
|
275
275
|
if (webhook.parameters) {
|
|
276
276
|
extraPointers.push(
|
|
277
|
-
targetPointer ? `${targetPointer}/parameters` : `/webhooks/${
|
|
277
|
+
targetPointer ? `${targetPointer}/parameters` : `/webhooks/${_chunkY5HU4SVHcjs.encodePointer.call(void 0, webhookKey)}/parameters`
|
|
278
278
|
);
|
|
279
|
-
|
|
279
|
+
_chunkY5HU4SVHcjs.collectRefsInSchema.call(void 0, webhook.parameters).forEach((ref) => seeds.add(ref));
|
|
280
280
|
}
|
|
281
281
|
const security = "security" in operation ? operation.security : definition.security;
|
|
282
282
|
collectSecuritySchemeRefs(security).forEach((ref) => seeds.add(ref));
|
|
@@ -467,7 +467,7 @@ async function buildAnalysis(definition, query2, scope) {
|
|
|
467
467
|
}
|
|
468
468
|
if (!query2 || query2.includes("circularRefs")) {
|
|
469
469
|
const { circularRefs: dereferencedCircularRefs } = await dereferenceOasShared(definition);
|
|
470
|
-
const circularRefs = (scope ? dereferencedCircularRefs.filter((ref) => isPointerInScope(
|
|
470
|
+
const circularRefs = (scope ? dereferencedCircularRefs.filter((ref) => isPointerInScope(_chunkY5HU4SVHcjs.toPointer.call(void 0, ref), scope)) : [...dereferencedCircularRefs]).toSorted();
|
|
471
471
|
analysis.circularRefs = {
|
|
472
472
|
present: !!circularRefs.length,
|
|
473
473
|
locations: circularRefs
|
package/dist/analyzer/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
mergeReferencedSchemasIntoRoot,
|
|
16
16
|
supportedMethods,
|
|
17
17
|
toJSONSchema
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-JLN5A26A.js";
|
|
19
19
|
import {
|
|
20
20
|
getExtension
|
|
21
21
|
} from "./chunk-DYHV2B4Z.js";
|
|
@@ -1972,4 +1972,4 @@ export {
|
|
|
1972
1972
|
* @license Apache-2.0
|
|
1973
1973
|
* @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
|
|
1974
1974
|
*/
|
|
1975
|
-
//# sourceMappingURL=chunk-
|
|
1975
|
+
//# sourceMappingURL=chunk-22M4FT6M.js.map
|