oas 38.6.1 → 38.7.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 (42) hide show
  1. package/dist/analyzer/index.cjs +22 -22
  2. package/dist/analyzer/index.js +2 -2
  3. package/dist/{chunk-5745XRSJ.js → chunk-44RR2TQE.js} +6 -5
  4. package/dist/{chunk-5745XRSJ.js.map → chunk-44RR2TQE.js.map} +1 -1
  5. package/dist/{chunk-RUHLHK66.cjs → chunk-EUTXEYKF.cjs} +140 -139
  6. package/dist/chunk-EUTXEYKF.cjs.map +1 -0
  7. package/dist/{chunk-HQEDOVWO.cjs → chunk-I5PRGIKK.cjs} +42 -40
  8. package/dist/chunk-I5PRGIKK.cjs.map +1 -0
  9. package/dist/{chunk-XG4HGNCN.js → chunk-IQVLGHQA.js} +1 -1
  10. package/dist/chunk-IQVLGHQA.js.map +1 -0
  11. package/dist/{chunk-OBYCSKPS.cjs → chunk-NASFWOIS.cjs} +39 -39
  12. package/dist/{chunk-OBYCSKPS.cjs.map → chunk-NASFWOIS.cjs.map} +1 -1
  13. package/dist/{chunk-PZR3GKKO.js → chunk-PIYKHCQX.js} +10 -8
  14. package/dist/chunk-PIYKHCQX.js.map +1 -0
  15. package/dist/{chunk-3X7ZLPYE.js → chunk-S333SATE.js} +3 -3
  16. package/dist/{chunk-3X7ZLPYE.js.map → chunk-S333SATE.js.map} +1 -1
  17. package/dist/{chunk-7PWF3F2W.cjs → chunk-X7BGCIJN.cjs} +1 -1
  18. package/dist/chunk-X7BGCIJN.cjs.map +1 -0
  19. package/dist/index.cjs +57 -57
  20. package/dist/index.cjs.map +1 -1
  21. package/dist/index.js +3 -3
  22. package/dist/index.js.map +1 -1
  23. package/dist/operation/index.cjs +4 -4
  24. package/dist/operation/index.js +3 -3
  25. package/dist/pruner/index.cjs +5 -5
  26. package/dist/pruner/index.js +4 -4
  27. package/dist/reducer/index.cjs +5 -5
  28. package/dist/reducer/index.js +4 -4
  29. package/dist/types.cjs +2 -2
  30. package/dist/types.d.cts +9 -2
  31. package/dist/types.d.ts +9 -2
  32. package/dist/types.js +1 -1
  33. package/dist/utils.cjs +3 -3
  34. package/dist/utils.d.cts +1 -1
  35. package/dist/utils.d.ts +1 -1
  36. package/dist/utils.js +2 -2
  37. package/package.json +1 -1
  38. package/dist/chunk-7PWF3F2W.cjs.map +0 -1
  39. package/dist/chunk-HQEDOVWO.cjs.map +0 -1
  40. package/dist/chunk-PZR3GKKO.js.map +0 -1
  41. package/dist/chunk-RUHLHK66.cjs.map +0 -1
  42. package/dist/chunk-XG4HGNCN.js.map +0 -1
@@ -8,12 +8,12 @@ var _chunkCOHEPMUPcjs = require('../chunk-COHEPMUP.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkOBYCSKPScjs = require('../chunk-OBYCSKPS.cjs');
11
+ var _chunkNASFWOIScjs = require('../chunk-NASFWOIS.cjs');
12
12
  require('../chunk-47FD2BIN.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunk7PWF3F2Wcjs = require('../chunk-7PWF3F2W.cjs');
16
+ var _chunkX7BGCIJNcjs = require('../chunk-X7BGCIJN.cjs');
17
17
 
18
18
  // src/analyzer/dereference.ts
19
19
  var _openapiparser = require('@readme/openapi-parser');
@@ -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 = _chunkOBYCSKPScjs.toPointer.call(void 0, $ref);
119
+ const pointer = _chunkNASFWOIScjs.toPointer.call(void 0, $ref);
120
120
  try {
121
121
  return decodeURIComponent(pointer);
122
122
  } catch (e) {
@@ -124,13 +124,13 @@ function canonicalizeRefPointer($ref) {
124
124
  }
125
125
  }
126
126
  function resolvePathItemTargetPointer(raw, definition) {
127
- if (!_chunk7PWF3F2Wcjs.isRef.call(void 0, raw)) {
127
+ if (!_chunkX7BGCIJNcjs.isRef.call(void 0, raw)) {
128
128
  return void 0;
129
129
  }
130
130
  let current = raw;
131
131
  let lastRef = raw.$ref;
132
132
  const seen = /* @__PURE__ */ new Set();
133
- while (_chunk7PWF3F2Wcjs.isRef.call(void 0, current)) {
133
+ while (_chunkX7BGCIJNcjs.isRef.call(void 0, current)) {
134
134
  const ref = current.$ref;
135
135
  if (seen.has(ref)) {
136
136
  break;
@@ -143,7 +143,7 @@ function resolvePathItemTargetPointer(raw, definition) {
143
143
  } catch (e2) {
144
144
  break;
145
145
  }
146
- if (next === void 0 || !_chunk7PWF3F2Wcjs.isRef.call(void 0, next)) {
146
+ if (next === void 0 || !_chunkX7BGCIJNcjs.isRef.call(void 0, next)) {
147
147
  break;
148
148
  }
149
149
  current = next;
@@ -154,15 +154,15 @@ 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 = _chunkOBYCSKPScjs.dereferenceRef.call(void 0, raw, definition);
158
- if (!resolved || typeof resolved !== "object" || _chunk7PWF3F2Wcjs.isRef.call(void 0, resolved)) {
157
+ const resolved = _chunkNASFWOIScjs.dereferenceRef.call(void 0, raw, definition);
158
+ if (!resolved || typeof resolved !== "object" || _chunkX7BGCIJNcjs.isRef.call(void 0, resolved)) {
159
159
  return void 0;
160
160
  }
161
161
  return resolved;
162
162
  }
163
163
  function resolveMethodKey(container, method) {
164
164
  const methodKey = resolveKey(Object.keys(container), method);
165
- if (!methodKey || !_chunkOBYCSKPScjs.supportedMethods.includes(methodKey.toLowerCase())) {
165
+ if (!methodKey || !_chunkNASFWOIScjs.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, _chunkOBYCSKPScjs.toPointer.call(void 0, ref));
181
+ resolved = _jsonpointer2.default.get(definition, _chunkNASFWOIScjs.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
- _chunkOBYCSKPScjs.collectRefsInSchema.call(void 0, resolved).forEach((nestedRef) => {
188
+ _chunkNASFWOIScjs.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(_chunkOBYCSKPScjs.toPointer.call(void 0, ref)));
198
+ reachableRefs.forEach((ref) => anchors.push(_chunkNASFWOIScjs.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/${_chunkOBYCSKPScjs.encodePointer.call(void 0, pathKey)}/${methodKey}`;
233
+ const rootPointer = `/paths/${_chunkNASFWOIScjs.encodePointer.call(void 0, pathKey)}/${methodKey}`;
234
234
  const extraPointers = [];
235
- const seeds = new Set(_chunkOBYCSKPScjs.collectRefsInSchema.call(void 0, operation));
235
+ const seeds = new Set(_chunkNASFWOIScjs.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/${_chunkOBYCSKPScjs.encodePointer.call(void 0, pathKey)}/parameters`);
242
- _chunkOBYCSKPScjs.collectRefsInSchema.call(void 0, pathItem.parameters).forEach((ref) => seeds.add(ref));
241
+ extraPointers.push(targetPointer ? `${targetPointer}/parameters` : `/paths/${_chunkNASFWOIScjs.encodePointer.call(void 0, pathKey)}/parameters`);
242
+ _chunkNASFWOIScjs.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/${_chunkOBYCSKPScjs.encodePointer.call(void 0, webhookKey)}/${methodKey}`;
268
+ const rootPointer = `/webhooks/${_chunkNASFWOIScjs.encodePointer.call(void 0, webhookKey)}/${methodKey}`;
269
269
  const extraPointers = [];
270
- const seeds = new Set(_chunkOBYCSKPScjs.collectRefsInSchema.call(void 0, operation));
270
+ const seeds = new Set(_chunkNASFWOIScjs.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/${_chunkOBYCSKPScjs.encodePointer.call(void 0, webhookKey)}/parameters`
277
+ targetPointer ? `${targetPointer}/parameters` : `/webhooks/${_chunkNASFWOIScjs.encodePointer.call(void 0, webhookKey)}/parameters`
278
278
  );
279
- _chunkOBYCSKPScjs.collectRefsInSchema.call(void 0, webhook.parameters).forEach((ref) => seeds.add(ref));
279
+ _chunkNASFWOIScjs.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(_chunkOBYCSKPScjs.toPointer.call(void 0, ref), scope)) : [...dereferencedCircularRefs]).toSorted();
470
+ const circularRefs = (scope ? dereferencedCircularRefs.filter((ref) => isPointerInScope(_chunkNASFWOIScjs.toPointer.call(void 0, ref), scope)) : [...dereferencedCircularRefs]).toSorted();
471
471
  analysis.circularRefs = {
472
472
  present: !!circularRefs.length,
473
473
  locations: circularRefs
@@ -568,7 +568,7 @@ async function analyzeWebhookOperation(definition, {
568
568
  method,
569
569
  query: query2
570
570
  }) {
571
- if (!_chunk7PWF3F2Wcjs.isOpenAPI31.call(void 0, definition)) {
571
+ if (!_chunkX7BGCIJNcjs.isOpenAPI31.call(void 0, definition)) {
572
572
  throw new TypeError("The supplied definition is not a OpenAPI 3.1 definition.");
573
573
  }
574
574
  const scope = computeWebhookScope(definition, webhookName, method);
@@ -8,12 +8,12 @@ import {
8
8
  encodePointer,
9
9
  supportedMethods,
10
10
  toPointer
11
- } from "../chunk-3X7ZLPYE.js";
11
+ } from "../chunk-S333SATE.js";
12
12
  import "../chunk-JHDEAXSK.js";
13
13
  import {
14
14
  isOpenAPI31,
15
15
  isRef
16
- } from "../chunk-XG4HGNCN.js";
16
+ } from "../chunk-IQVLGHQA.js";
17
17
 
18
18
  // src/analyzer/dereference.ts
19
19
  import { dereference } from "@readme/openapi-parser";
@@ -15,13 +15,13 @@ import {
15
15
  mergeReferencedSchemasIntoRoot,
16
16
  supportedMethods,
17
17
  toJSONSchema
18
- } from "./chunk-3X7ZLPYE.js";
18
+ } from "./chunk-S333SATE.js";
19
19
  import {
20
20
  getExtension
21
21
  } from "./chunk-JHDEAXSK.js";
22
22
  import {
23
23
  isRef
24
- } from "./chunk-XG4HGNCN.js";
24
+ } from "./chunk-IQVLGHQA.js";
25
25
 
26
26
  // src/lib/urls.ts
27
27
  import { match, pathToRegexp } from "path-to-regexp";
@@ -1714,10 +1714,11 @@ var Operation = class {
1714
1714
  return false;
1715
1715
  }
1716
1716
  }
1717
- if (!callback[method]) {
1717
+ const callbackPathItem = callback;
1718
+ if (!callbackPathItem[method]) {
1718
1719
  return false;
1719
1720
  }
1720
- return new Callback(this.oas, expression, method, callback[method], identifier, callback);
1721
+ return new Callback(this.oas, expression, method, callbackPathItem[method], identifier, callback);
1721
1722
  }
1722
1723
  /**
1723
1724
  * Retrieve an array of operations created from each callback.
@@ -1972,4 +1973,4 @@ export {
1972
1973
  * @license Apache-2.0
1973
1974
  * @see {@link https://github.com/swagger-api/swagger-ui/blob/master/src/core/plugins/samples/fn.js}
1974
1975
  */
1975
- //# sourceMappingURL=chunk-5745XRSJ.js.map
1976
+ //# sourceMappingURL=chunk-44RR2TQE.js.map