oas 25.1.0 → 25.2.1

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 (59) hide show
  1. package/README.md +9 -8
  2. package/dist/analyzer/index.cjs +13 -5
  3. package/dist/analyzer/index.cjs.map +1 -1
  4. package/dist/analyzer/index.js +12 -4
  5. package/dist/analyzer/index.js.map +1 -1
  6. package/dist/analyzer/types.d.cts +1 -0
  7. package/dist/analyzer/types.d.ts +1 -0
  8. package/dist/{chunk-G6ASGSM5.cjs → chunk-4DQE5VZI.cjs} +1 -1
  9. package/dist/chunk-4DQE5VZI.cjs.map +1 -0
  10. package/dist/{chunk-MH3THWQH.js → chunk-CLQZGF6D.js} +15 -15
  11. package/dist/chunk-CLQZGF6D.js.map +1 -0
  12. package/dist/{chunk-YIKOQY6K.cjs → chunk-CPI37LBJ.cjs} +17 -17
  13. package/dist/chunk-CPI37LBJ.cjs.map +1 -0
  14. package/dist/{chunk-ZXCOYYXC.cjs → chunk-DAS55TQF.cjs} +39 -39
  15. package/dist/{chunk-ZXCOYYXC.cjs.map → chunk-DAS55TQF.cjs.map} +1 -1
  16. package/dist/{chunk-U7Q7XPMY.js → chunk-QMLWI5HD.js} +1 -1
  17. package/dist/chunk-QMLWI5HD.js.map +1 -0
  18. package/dist/{chunk-3I4KH26E.cjs → chunk-TG4VCYD4.cjs} +11 -11
  19. package/dist/chunk-TG4VCYD4.cjs.map +1 -0
  20. package/dist/{chunk-GMSH2DQK.js → chunk-V6OITOCT.js} +14 -14
  21. package/dist/chunk-V6OITOCT.js.map +1 -0
  22. package/dist/{chunk-LH3S6NWD.js → chunk-W7MR5CC7.js} +2 -2
  23. package/dist/chunk-W7MR5CC7.js.map +1 -0
  24. package/dist/{extensions-B4_nMl6M.d.cts → extensions-CaiwqAu-.d.cts} +14 -14
  25. package/dist/{extensions-BTG_yoHC.d.ts → extensions-DYrxWRh4.d.ts} +14 -14
  26. package/dist/extensions.d.cts +1 -1
  27. package/dist/extensions.d.ts +1 -1
  28. package/dist/index.cjs +5 -5
  29. package/dist/index.d.cts +12 -12
  30. package/dist/index.d.ts +12 -12
  31. package/dist/index.js +4 -4
  32. package/dist/operation/index.cjs +4 -4
  33. package/dist/operation/index.d.cts +1 -1
  34. package/dist/operation/index.d.ts +1 -1
  35. package/dist/operation/index.js +3 -3
  36. package/dist/operation/lib/get-parameters-as-json-schema.cjs +3 -3
  37. package/dist/operation/lib/get-parameters-as-json-schema.d.cts +1 -1
  38. package/dist/operation/lib/get-parameters-as-json-schema.d.ts +1 -1
  39. package/dist/operation/lib/get-parameters-as-json-schema.js +2 -2
  40. package/dist/reducer/index.cjs +1 -2
  41. package/dist/reducer/index.cjs.map +1 -1
  42. package/dist/reducer/index.js +1 -2
  43. package/dist/reducer/index.js.map +1 -1
  44. package/dist/types.cjs +2 -2
  45. package/dist/types.d.cts +36 -36
  46. package/dist/types.d.ts +36 -36
  47. package/dist/types.js +1 -1
  48. package/dist/utils.cjs +3 -3
  49. package/dist/utils.d.cts +1 -1
  50. package/dist/utils.d.ts +1 -1
  51. package/dist/utils.js +2 -2
  52. package/package.json +2 -3
  53. package/dist/chunk-3I4KH26E.cjs.map +0 -1
  54. package/dist/chunk-G6ASGSM5.cjs.map +0 -1
  55. package/dist/chunk-GMSH2DQK.js.map +0 -1
  56. package/dist/chunk-LH3S6NWD.js.map +0 -1
  57. package/dist/chunk-MH3THWQH.js.map +0 -1
  58. package/dist/chunk-U7Q7XPMY.js.map +0 -1
  59. package/dist/chunk-YIKOQY6K.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
3
 
4
- var _chunk3I4KH26Ecjs = require('../../chunk-3I4KH26E.cjs');
4
+ var _chunkTG4VCYD4cjs = require('../../chunk-TG4VCYD4.cjs');
5
5
  require('../../chunk-YHO3AOX6.cjs');
6
- require('../../chunk-G6ASGSM5.cjs');
6
+ require('../../chunk-4DQE5VZI.cjs');
7
7
 
8
8
 
9
9
 
10
- exports.getParametersAsJSONSchema = _chunk3I4KH26Ecjs.getParametersAsJSONSchema; exports.types = _chunk3I4KH26Ecjs.types;
10
+ exports.getParametersAsJSONSchema = _chunkTG4VCYD4cjs.getParametersAsJSONSchema; exports.types = _chunkTG4VCYD4cjs.types;
11
11
  //# sourceMappingURL=get-parameters-as-json-schema.cjs.map
@@ -1,4 +1,4 @@
1
1
  import '../../types.cjs';
2
- export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-B4_nMl6M.cjs';
2
+ export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-CaiwqAu-.cjs';
3
3
  import 'json-schema';
4
4
  import 'openapi-types';
@@ -1,4 +1,4 @@
1
1
  import '../../types.js';
2
- export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-BTG_yoHC.js';
2
+ export { S as SchemaWrapper, a as getParametersAsJSONSchema, g as getParametersAsJSONSchemaOptions, t as types } from '../../extensions-DYrxWRh4.js';
3
3
  import 'json-schema';
4
4
  import 'openapi-types';
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  getParametersAsJSONSchema,
3
3
  types
4
- } from "../../chunk-LH3S6NWD.js";
4
+ } from "../../chunk-W7MR5CC7.js";
5
5
  import "../../chunk-P2SB77YR.js";
6
- import "../../chunk-U7Q7XPMY.js";
6
+ import "../../chunk-QMLWI5HD.js";
7
7
  export {
8
8
  getParametersAsJSONSchema,
9
9
  types
@@ -4,7 +4,6 @@ var _chunkW6GBV2JTcjs = require('../chunk-W6GBV2JT.cjs');
4
4
 
5
5
  // src/reducer/index.ts
6
6
  var _jsonpointer = require('jsonpointer'); var _jsonpointer2 = _interopRequireDefault(_jsonpointer);
7
- var _utils = require('oas-normalize/lib/utils');
8
7
  function getUsedRefs(schema) {
9
8
  return _chunkW6GBV2JTcjs.query.call(void 0, ["$..['$ref']"], schema);
10
9
  }
@@ -32,7 +31,7 @@ function reducer(definition, opts = {}) {
32
31
  }, {}) : {};
33
32
  const $refs = /* @__PURE__ */ new Set();
34
33
  const usedTags = /* @__PURE__ */ new Set();
35
- if (_utils.getAPIDefinitionType.call(void 0, definition) !== "openapi") {
34
+ if (!definition.openapi) {
36
35
  throw new Error("Sorry, only OpenAPI definitions are supported.");
37
36
  }
38
37
  const reduced = JSON.parse(JSON.stringify(definition));
@@ -1 +1 @@
1
- {"version":3,"sources":["/Users/erunion/code/readme/oas/packages/oas/dist/reducer/index.cjs","../../src/reducer/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,yDAAA;AACA;AACA;ACFA,oGAAwB;AACxB,gDAAqC;AAgBrC,SAAS,WAAA,CAAY,MAAA,EAAa;AAChC,EAAA,OAAO,qCAAA,CAAO,aAAa,CAAA,EAAG,MAAM,CAAA;AACtC;AAUA,SAAS,kBAAA,CAAmB,MAAA,EAAiC,KAAA,EAAoB,IAAA,EAAiB;AAChG,EAAA,IAAI,UAAA;AACJ,EAAA,GAAA,CAAI,OAAO,KAAA,IAAS,QAAA,EAAU,WAAA,EAAa,qBAAA,CAAY,GAAA,CAAI,MAAA,EAAQ,IAAA,CAAK,SAAA,CAAU,CAAC,CAAC,CAAA;AACpF,EAAA,GAAA,CAAI,WAAA,IAAe,KAAA,CAAA,EAAW;AAI5B,IAAA,MAAA;AAAA,EACF;AAEA,EAAA,WAAA,CAAY,UAAU,CAAA,CAAE,OAAA,CAAQ,CAAC,EAAE,KAAA,EAAO,QAAQ,CAAA,EAAA,GAAM;AAEtD,IAAA,GAAA,CAAI,KAAA,CAAM,GAAA,CAAI,OAAO,CAAA,EAAG;AACtB,MAAA,MAAA;AAAA,IACF;AAEA,IAAA,KAAA,CAAM,GAAA,CAAI,OAAO,CAAA;AACjB,IAAA,kBAAA,CAAmB,MAAA,EAAQ,KAAA,EAAO,OAAO,CAAA;AAAA,EAC3C,CAAC,CA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ADzFyD;AACA;AACA","file":"/Users/erunion/code/readme/oas/packages/oas/dist/reducer/index.cjs","sourcesContent":[null,"import type { ComponentsObject, HttpMethods, OASDocument, TagObject } from '../types.js';\n\nimport jsonPointer from 'jsonpointer';\nimport { getAPIDefinitionType } from 'oas-normalize/lib/utils';\n\nimport { query } from '../analyzer/util.js';\n\ninterface ReducerOptions {\n /** A key-value object of path + method combinations to reduce by. */\n paths?: Record<string, string[] | '*'>;\n /** An array of tags in the OpenAPI definition to reduce by. */\n tags?: string[];\n}\n\n/**\n * Query a JSON Schema object for any `$ref` pointers. Return any pointers that were found.\n *\n * @param schema JSON Schema object to look for any `$ref` pointers within it.\n */\nfunction getUsedRefs(schema: any) {\n return query([\"$..['$ref']\"], schema);\n}\n\n/**\n * Recursively process a `$ref` pointer and accumulate any other `$ref` pointers that it or its\n * children use.\n *\n * @param schema JSON Schema object to look for and accumulate any `$ref` pointers that it may have.\n * @param $refs Known set of `$ref` pointers.\n * @param $ref `$ref` pointer to fetch a schema from out of the supplied schema.\n */\nfunction accumulateUsedRefs(schema: Record<string, unknown>, $refs: Set<string>, $ref: any): void {\n let $refSchema;\n if (typeof $ref === 'string') $refSchema = jsonPointer.get(schema, $ref.substring(1));\n if ($refSchema === undefined) {\n // If the schema we have wasn't fully dereferenced or bundled for whatever reason and this\n // `$ref` that we have doesn't exist here we shouldn't try to search for more `$ref` pointers\n // in a schema that doesn't exist.\n return;\n }\n\n getUsedRefs($refSchema).forEach(({ value: currRef }) => {\n // If we've already processed this $ref don't send us into an infinite loop.\n if ($refs.has(currRef)) {\n return;\n }\n\n $refs.add(currRef);\n accumulateUsedRefs(schema, $refs, currRef);\n });\n}\n\n/**\n * With an array of tags or object of paths+method combinations, reduce an OpenAPI definition to a\n * new definition that just contains those tags or path + methods.\n *\n * @example <caption>Reduce by an array of tags only.</caption>\n * reducer(apiDefinition, { tags: ['pet'] })\n *\n * @example <caption>Reduce by a specific path and methods.</caption>\n * reducer(apiDefinition, { paths: { '/pet': ['get', 'post'] } })\n *\n * @example <caption>Reduce by a specific path and all methods it has.</caption>\n * reducer(apiDefinition, { paths: { '/pet': '*' } })\n *\n * @param definition A valid OpenAPI 3.x definition\n */\nexport default function reducer(definition: OASDocument, opts: ReducerOptions = {}) {\n // Convert tags and paths to lowercase since casing should not matter.\n const reduceTags = 'tags' in opts ? opts.tags.map(tag => tag.toLowerCase()) : [];\n const reducePaths =\n 'paths' in opts\n ? Object.entries(opts.paths).reduce((acc: Record<string, string[] | string>, [key, value]) => {\n const newKey = key.toLowerCase();\n const newValue = Array.isArray(value) ? value.map(v => v.toLowerCase()) : value.toLowerCase();\n acc[newKey] = newValue;\n return acc;\n }, {})\n : {};\n\n const $refs: Set<string> = new Set();\n const usedTags: Set<string> = new Set();\n\n if (getAPIDefinitionType(definition) !== 'openapi') {\n throw new Error('Sorry, only OpenAPI definitions are supported.');\n }\n\n // Stringify and parse so we get a full non-reference clone of the API definition to work with.\n // eslint-disable-next-line try-catch-failsafe/json-parse\n const reduced = JSON.parse(JSON.stringify(definition)) as OASDocument;\n\n // Retain any root-level security definitions.\n if ('security' in reduced) {\n Object.values(reduced.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n\n if ('paths' in reduced) {\n Object.keys(reduced.paths).forEach(path => {\n const pathLC = path.toLowerCase();\n\n if (Object.keys(reducePaths).length) {\n if (!(pathLC in reducePaths)) {\n delete reduced.paths[path];\n return;\n }\n }\n\n Object.keys(reduced.paths[path]).forEach((method: HttpMethods | 'parameters') => {\n // If this method is `parameters` we should always retain it.\n if (method !== 'parameters') {\n if (Object.keys(reducePaths).length) {\n if (\n reducePaths[pathLC] !== '*' &&\n Array.isArray(reducePaths[pathLC]) &&\n !reducePaths[pathLC].includes(method)\n ) {\n delete reduced.paths[path][method];\n return;\n }\n }\n }\n\n const operation = reduced.paths[path][method];\n\n // If we're reducing by tags and this operation doesn't live in one of those, remove it.\n if (reduceTags.length) {\n if (!('tags' in operation)) {\n delete reduced.paths[path][method];\n return;\n } else if (!operation.tags.filter(tag => reduceTags.includes(tag.toLowerCase())).length) {\n delete reduced.paths[path][method];\n return;\n }\n }\n\n // Accumulate a list of used tags so we can filter out any ones that we don't need later.\n if ('tags' in operation) {\n operation.tags.forEach((tag: string) => {\n usedTags.add(tag);\n });\n }\n\n // Accumulate a list of $ref pointers that are used within this operation.\n getUsedRefs(operation).forEach(({ value: ref }) => {\n $refs.add(ref);\n });\n\n // Accumulate any used security schemas that we need to retain.\n if ('security' in operation) {\n Object.values(operation.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n });\n\n // If this path no longer has any methods, delete it.\n if (!Object.keys(reduced.paths[path]).length) {\n delete reduced.paths[path];\n }\n });\n\n // If we don't have any more paths after cleanup, throw an error because an OpenAPI file must\n // have at least one path.\n if (!Object.keys(reduced.paths).length) {\n throw new Error('All paths in the API definition were removed. Did you supply the right path name to reduce by?');\n }\n }\n\n // Recursively accumulate any components that are in use.\n $refs.forEach($ref => accumulateUsedRefs(reduced, $refs, $ref));\n\n // Remove any unused components.\n if ('components' in reduced) {\n Object.keys(reduced.components).forEach((componentType: keyof ComponentsObject) => {\n Object.keys(reduced.components[componentType]).forEach(component => {\n if (!$refs.has(`#/components/${componentType}/${component}`)) {\n delete reduced.components[componentType][component];\n }\n });\n\n // If this component group is now empty, delete it.\n if (!Object.keys(reduced.components[componentType]).length) {\n delete reduced.components[componentType];\n }\n });\n\n // If this path no longer has any components, delete it.\n if (!Object.keys(reduced.components).length) {\n delete reduced.components;\n }\n }\n\n // Remove any unused tags.\n if ('tags' in reduced) {\n reduced.tags.forEach((tag: TagObject, k: number) => {\n if (!usedTags.has(tag.name)) {\n delete reduced.tags[k];\n }\n });\n\n // Remove any now empty items from the tags array.\n reduced.tags = reduced.tags.filter(Boolean);\n\n if (!reduced.tags.length) {\n delete reduced.tags;\n }\n }\n\n return redu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,QAAA;AACH,UAAA;AACzB,UAAA;AACF,QAAA;AACF,MAAA;AAE0C,MAAA;AAEX,QAAA;AACU,UAAA;AAG3B,YAAA;AAG2B,cAAA;AACjC,cAAA;AACF,YAAA;AACF,UAAA;AACF,QAAA;AAE4C,QAAA;AAGrB,QAAA;AACO,UAAA;AACO,YAAA;AACjC,YAAA;AACuC,UAAA;AACN,YAAA;AACjC,YAAA;AACF,UAAA;AACF,QAAA;AAGyB,QAAA;AACiB,UAAA;AACtB,YAAA;AACjB,UAAA;AACH,QAAA;AAG6C,QAAA;AAC9B,UAAA;AACd,QAAA;AAG4B,QAAA;AACe,UAAA;AACL,YAAA;AACS,cAAA;AAC3C,YAAA;AACF,UAAA;AACH,QAAA;AACD,MAAA;AAG6C,MAAA;AACnB,QAAA;AAC3B,MAAA;AACD,IAAA;AAIuC,IAAA;AACtB,MAAA;AAClB,IAAA;AACF,EAAA;AAGkD,EAAA;AAGrB,EAAA;AACc,IAAA;AACQ,MAAA;AACG,QAAA;AACL,UAAA;AAC3C,QAAA;AACD,MAAA;AAGiD,MAAA;AACT,QAAA;AACzC,MAAA;AACD,IAAA;AAG4C,IAAA;AAC5B,MAAA;AACjB,IAAA;AACF,EAAA;AAGuB,EAAA;AAC+B,IAAA;AACrB,MAAA;AACN,QAAA;AACvB,MAAA;AACD,IAAA;AAGyC,IAAA;AAEhB,IAAA;AACT,MAAA;AACjB,IAAA;AACF,EAAA;AAEO,EAAA;AACT;ADzFyD;AACA;AACA","file":"/Users/erunion/code/readme/oas/packages/oas/dist/reducer/index.cjs","sourcesContent":[null,"import type { ComponentsObject, HttpMethods, OASDocument, TagObject } from '../types.js';\n\nimport jsonPointer from 'jsonpointer';\n\nimport { query } from '../analyzer/util.js';\n\ninterface ReducerOptions {\n /** A key-value object of path + method combinations to reduce by. */\n paths?: Record<string, string[] | '*'>;\n /** An array of tags in the OpenAPI definition to reduce by. */\n tags?: string[];\n}\n\n/**\n * Query a JSON Schema object for any `$ref` pointers. Return any pointers that were found.\n *\n * @param schema JSON Schema object to look for any `$ref` pointers within it.\n */\nfunction getUsedRefs(schema: any) {\n return query([\"$..['$ref']\"], schema);\n}\n\n/**\n * Recursively process a `$ref` pointer and accumulate any other `$ref` pointers that it or its\n * children use.\n *\n * @param schema JSON Schema object to look for and accumulate any `$ref` pointers that it may have.\n * @param $refs Known set of `$ref` pointers.\n * @param $ref `$ref` pointer to fetch a schema from out of the supplied schema.\n */\nfunction accumulateUsedRefs(schema: Record<string, unknown>, $refs: Set<string>, $ref: any): void {\n let $refSchema;\n if (typeof $ref === 'string') $refSchema = jsonPointer.get(schema, $ref.substring(1));\n if ($refSchema === undefined) {\n // If the schema we have wasn't fully dereferenced or bundled for whatever reason and this\n // `$ref` that we have doesn't exist here we shouldn't try to search for more `$ref` pointers\n // in a schema that doesn't exist.\n return;\n }\n\n getUsedRefs($refSchema).forEach(({ value: currRef }) => {\n // If we've already processed this $ref don't send us into an infinite loop.\n if ($refs.has(currRef)) {\n return;\n }\n\n $refs.add(currRef);\n accumulateUsedRefs(schema, $refs, currRef);\n });\n}\n\n/**\n * With an array of tags or object of paths+method combinations, reduce an OpenAPI definition to a\n * new definition that just contains those tags or path + methods.\n *\n * @example <caption>Reduce by an array of tags only.</caption>\n * reducer(apiDefinition, { tags: ['pet'] })\n *\n * @example <caption>Reduce by a specific path and methods.</caption>\n * reducer(apiDefinition, { paths: { '/pet': ['get', 'post'] } })\n *\n * @example <caption>Reduce by a specific path and all methods it has.</caption>\n * reducer(apiDefinition, { paths: { '/pet': '*' } })\n *\n * @param definition A valid OpenAPI 3.x definition\n */\nexport default function reducer(definition: OASDocument, opts: ReducerOptions = {}) {\n // Convert tags and paths to lowercase since casing should not matter.\n const reduceTags = 'tags' in opts ? opts.tags.map(tag => tag.toLowerCase()) : [];\n const reducePaths =\n 'paths' in opts\n ? Object.entries(opts.paths).reduce((acc: Record<string, string[] | string>, [key, value]) => {\n const newKey = key.toLowerCase();\n const newValue = Array.isArray(value) ? value.map(v => v.toLowerCase()) : value.toLowerCase();\n acc[newKey] = newValue;\n return acc;\n }, {})\n : {};\n\n const $refs: Set<string> = new Set();\n const usedTags: Set<string> = new Set();\n\n if (!definition.openapi) {\n throw new Error('Sorry, only OpenAPI definitions are supported.');\n }\n\n // Stringify and parse so we get a full non-reference clone of the API definition to work with.\n // eslint-disable-next-line try-catch-failsafe/json-parse\n const reduced = JSON.parse(JSON.stringify(definition)) as OASDocument;\n\n // Retain any root-level security definitions.\n if ('security' in reduced) {\n Object.values(reduced.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n\n if ('paths' in reduced) {\n Object.keys(reduced.paths).forEach(path => {\n const pathLC = path.toLowerCase();\n\n if (Object.keys(reducePaths).length) {\n if (!(pathLC in reducePaths)) {\n delete reduced.paths[path];\n return;\n }\n }\n\n Object.keys(reduced.paths[path]).forEach((method: HttpMethods | 'parameters') => {\n // If this method is `parameters` we should always retain it.\n if (method !== 'parameters') {\n if (Object.keys(reducePaths).length) {\n if (\n reducePaths[pathLC] !== '*' &&\n Array.isArray(reducePaths[pathLC]) &&\n !reducePaths[pathLC].includes(method)\n ) {\n delete reduced.paths[path][method];\n return;\n }\n }\n }\n\n const operation = reduced.paths[path][method];\n\n // If we're reducing by tags and this operation doesn't live in one of those, remove it.\n if (reduceTags.length) {\n if (!('tags' in operation)) {\n delete reduced.paths[path][method];\n return;\n } else if (!operation.tags.filter(tag => reduceTags.includes(tag.toLowerCase())).length) {\n delete reduced.paths[path][method];\n return;\n }\n }\n\n // Accumulate a list of used tags so we can filter out any ones that we don't need later.\n if ('tags' in operation) {\n operation.tags.forEach((tag: string) => {\n usedTags.add(tag);\n });\n }\n\n // Accumulate a list of $ref pointers that are used within this operation.\n getUsedRefs(operation).forEach(({ value: ref }) => {\n $refs.add(ref);\n });\n\n // Accumulate any used security schemas that we need to retain.\n if ('security' in operation) {\n Object.values(operation.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n });\n\n // If this path no longer has any methods, delete it.\n if (!Object.keys(reduced.paths[path]).length) {\n delete reduced.paths[path];\n }\n });\n\n // If we don't have any more paths after cleanup, throw an error because an OpenAPI file must\n // have at least one path.\n if (!Object.keys(reduced.paths).length) {\n throw new Error('All paths in the API definition were removed. Did you supply the right path name to reduce by?');\n }\n }\n\n // Recursively accumulate any components that are in use.\n $refs.forEach($ref => accumulateUsedRefs(reduced, $refs, $ref));\n\n // Remove any unused components.\n if ('components' in reduced) {\n Object.keys(reduced.components).forEach((componentType: keyof ComponentsObject) => {\n Object.keys(reduced.components[componentType]).forEach(component => {\n if (!$refs.has(`#/components/${componentType}/${component}`)) {\n delete reduced.components[componentType][component];\n }\n });\n\n // If this component group is now empty, delete it.\n if (!Object.keys(reduced.components[componentType]).length) {\n delete reduced.components[componentType];\n }\n });\n\n // If this path no longer has any components, delete it.\n if (!Object.keys(reduced.components).length) {\n delete reduced.components;\n }\n }\n\n // Remove any unused tags.\n if ('tags' in reduced) {\n reduced.tags.forEach((tag: TagObject, k: number) => {\n if (!usedTags.has(tag.name)) {\n delete reduced.tags[k];\n }\n });\n\n // Remove any now empty items from the tags array.\n reduced.tags = reduced.tags.filter(Boolean);\n\n if (!reduced.tags.length) {\n delete reduced.tags;\n }\n }\n\n return reduced;\n}\n"]}
@@ -4,7 +4,6 @@ import {
4
4
 
5
5
  // src/reducer/index.ts
6
6
  import jsonPointer from "jsonpointer";
7
- import { getAPIDefinitionType } from "oas-normalize/lib/utils";
8
7
  function getUsedRefs(schema) {
9
8
  return query(["$..['$ref']"], schema);
10
9
  }
@@ -32,7 +31,7 @@ function reducer(definition, opts = {}) {
32
31
  }, {}) : {};
33
32
  const $refs = /* @__PURE__ */ new Set();
34
33
  const usedTags = /* @__PURE__ */ new Set();
35
- if (getAPIDefinitionType(definition) !== "openapi") {
34
+ if (!definition.openapi) {
36
35
  throw new Error("Sorry, only OpenAPI definitions are supported.");
37
36
  }
38
37
  const reduced = JSON.parse(JSON.stringify(definition));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/reducer/index.ts"],"sourcesContent":["import type { ComponentsObject, HttpMethods, OASDocument, TagObject } from '../types.js';\n\nimport jsonPointer from 'jsonpointer';\nimport { getAPIDefinitionType } from 'oas-normalize/lib/utils';\n\nimport { query } from '../analyzer/util.js';\n\ninterface ReducerOptions {\n /** A key-value object of path + method combinations to reduce by. */\n paths?: Record<string, string[] | '*'>;\n /** An array of tags in the OpenAPI definition to reduce by. */\n tags?: string[];\n}\n\n/**\n * Query a JSON Schema object for any `$ref` pointers. Return any pointers that were found.\n *\n * @param schema JSON Schema object to look for any `$ref` pointers within it.\n */\nfunction getUsedRefs(schema: any) {\n return query([\"$..['$ref']\"], schema);\n}\n\n/**\n * Recursively process a `$ref` pointer and accumulate any other `$ref` pointers that it or its\n * children use.\n *\n * @param schema JSON Schema object to look for and accumulate any `$ref` pointers that it may have.\n * @param $refs Known set of `$ref` pointers.\n * @param $ref `$ref` pointer to fetch a schema from out of the supplied schema.\n */\nfunction accumulateUsedRefs(schema: Record<string, unknown>, $refs: Set<string>, $ref: any): void {\n let $refSchema;\n if (typeof $ref === 'string') $refSchema = jsonPointer.get(schema, $ref.substring(1));\n if ($refSchema === undefined) {\n // If the schema we have wasn't fully dereferenced or bundled for whatever reason and this\n // `$ref` that we have doesn't exist here we shouldn't try to search for more `$ref` pointers\n // in a schema that doesn't exist.\n return;\n }\n\n getUsedRefs($refSchema).forEach(({ value: currRef }) => {\n // If we've already processed this $ref don't send us into an infinite loop.\n if ($refs.has(currRef)) {\n return;\n }\n\n $refs.add(currRef);\n accumulateUsedRefs(schema, $refs, currRef);\n });\n}\n\n/**\n * With an array of tags or object of paths+method combinations, reduce an OpenAPI definition to a\n * new definition that just contains those tags or path + methods.\n *\n * @example <caption>Reduce by an array of tags only.</caption>\n * reducer(apiDefinition, { tags: ['pet'] })\n *\n * @example <caption>Reduce by a specific path and methods.</caption>\n * reducer(apiDefinition, { paths: { '/pet': ['get', 'post'] } })\n *\n * @example <caption>Reduce by a specific path and all methods it has.</caption>\n * reducer(apiDefinition, { paths: { '/pet': '*' } })\n *\n * @param definition A valid OpenAPI 3.x definition\n */\nexport default function reducer(definition: OASDocument, opts: ReducerOptions = {}) {\n // Convert tags and paths to lowercase since casing should not matter.\n const reduceTags = 'tags' in opts ? opts.tags.map(tag => tag.toLowerCase()) : [];\n const reducePaths =\n 'paths' in opts\n ? Object.entries(opts.paths).reduce((acc: Record<string, string[] | string>, [key, value]) => {\n const newKey = key.toLowerCase();\n const newValue = Array.isArray(value) ? value.map(v => v.toLowerCase()) : value.toLowerCase();\n acc[newKey] = newValue;\n return acc;\n }, {})\n : {};\n\n const $refs: Set<string> = new Set();\n const usedTags: Set<string> = new Set();\n\n if (getAPIDefinitionType(definition) !== 'openapi') {\n throw new Error('Sorry, only OpenAPI definitions are supported.');\n }\n\n // Stringify and parse so we get a full non-reference clone of the API definition to work with.\n // eslint-disable-next-line try-catch-failsafe/json-parse\n const reduced = JSON.parse(JSON.stringify(definition)) as OASDocument;\n\n // Retain any root-level security definitions.\n if ('security' in reduced) {\n Object.values(reduced.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n\n if ('paths' in reduced) {\n Object.keys(reduced.paths).forEach(path => {\n const pathLC = path.toLowerCase();\n\n if (Object.keys(reducePaths).length) {\n if (!(pathLC in reducePaths)) {\n delete reduced.paths[path];\n return;\n }\n }\n\n Object.keys(reduced.paths[path]).forEach((method: HttpMethods | 'parameters') => {\n // If this method is `parameters` we should always retain it.\n if (method !== 'parameters') {\n if (Object.keys(reducePaths).length) {\n if (\n reducePaths[pathLC] !== '*' &&\n Array.isArray(reducePaths[pathLC]) &&\n !reducePaths[pathLC].includes(method)\n ) {\n delete reduced.paths[path][method];\n return;\n }\n }\n }\n\n const operation = reduced.paths[path][method];\n\n // If we're reducing by tags and this operation doesn't live in one of those, remove it.\n if (reduceTags.length) {\n if (!('tags' in operation)) {\n delete reduced.paths[path][method];\n return;\n } else if (!operation.tags.filter(tag => reduceTags.includes(tag.toLowerCase())).length) {\n delete reduced.paths[path][method];\n return;\n }\n }\n\n // Accumulate a list of used tags so we can filter out any ones that we don't need later.\n if ('tags' in operation) {\n operation.tags.forEach((tag: string) => {\n usedTags.add(tag);\n });\n }\n\n // Accumulate a list of $ref pointers that are used within this operation.\n getUsedRefs(operation).forEach(({ value: ref }) => {\n $refs.add(ref);\n });\n\n // Accumulate any used security schemas that we need to retain.\n if ('security' in operation) {\n Object.values(operation.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n });\n\n // If this path no longer has any methods, delete it.\n if (!Object.keys(reduced.paths[path]).length) {\n delete reduced.paths[path];\n }\n });\n\n // If we don't have any more paths after cleanup, throw an error because an OpenAPI file must\n // have at least one path.\n if (!Object.keys(reduced.paths).length) {\n throw new Error('All paths in the API definition were removed. Did you supply the right path name to reduce by?');\n }\n }\n\n // Recursively accumulate any components that are in use.\n $refs.forEach($ref => accumulateUsedRefs(reduced, $refs, $ref));\n\n // Remove any unused components.\n if ('components' in reduced) {\n Object.keys(reduced.components).forEach((componentType: keyof ComponentsObject) => {\n Object.keys(reduced.components[componentType]).forEach(component => {\n if (!$refs.has(`#/components/${componentType}/${component}`)) {\n delete reduced.components[componentType][component];\n }\n });\n\n // If this component group is now empty, delete it.\n if (!Object.keys(reduced.components[componentType]).length) {\n delete reduced.components[componentType];\n }\n });\n\n // If this path no longer has any components, delete it.\n if (!Object.keys(reduced.components).length) {\n delete reduced.components;\n }\n }\n\n // Remove any unused tags.\n if ('tags' in reduced) {\n reduced.tags.forEach((tag: TagObject, k: number) => {\n if (!usedTags.has(tag.name)) {\n delete reduced.tags[k];\n }\n });\n\n // Remove any now empty items from the tags array.\n reduced.tags = reduced.tags.filter(Boolean);\n\n if (!re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;AAC3B,eAAO,QAAQ,KAAK,CAAC;AAAA,MACvB;AAAA,IACF,CAAC;AAGD,YAAQ,OAAO,QAAQ,KAAK,OAAO,OAAO;AAE1C,QAAI,CAAC,QAAQ,KAAK,QAAQ;AACxB,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../src/reducer/index.ts"],"sourcesContent":["import type { ComponentsObject, HttpMethods, OASDocument, TagObject } from '../types.js';\n\nimport jsonPointer from 'jsonpointer';\n\nimport { query } from '../analyzer/util.js';\n\ninterface ReducerOptions {\n /** A key-value object of path + method combinations to reduce by. */\n paths?: Record<string, string[] | '*'>;\n /** An array of tags in the OpenAPI definition to reduce by. */\n tags?: string[];\n}\n\n/**\n * Query a JSON Schema object for any `$ref` pointers. Return any pointers that were found.\n *\n * @param schema JSON Schema object to look for any `$ref` pointers within it.\n */\nfunction getUsedRefs(schema: any) {\n return query([\"$..['$ref']\"], schema);\n}\n\n/**\n * Recursively process a `$ref` pointer and accumulate any other `$ref` pointers that it or its\n * children use.\n *\n * @param schema JSON Schema object to look for and accumulate any `$ref` pointers that it may have.\n * @param $refs Known set of `$ref` pointers.\n * @param $ref `$ref` pointer to fetch a schema from out of the supplied schema.\n */\nfunction accumulateUsedRefs(schema: Record<string, unknown>, $refs: Set<string>, $ref: any): void {\n let $refSchema;\n if (typeof $ref === 'string') $refSchema = jsonPointer.get(schema, $ref.substring(1));\n if ($refSchema === undefined) {\n // If the schema we have wasn't fully dereferenced or bundled for whatever reason and this\n // `$ref` that we have doesn't exist here we shouldn't try to search for more `$ref` pointers\n // in a schema that doesn't exist.\n return;\n }\n\n getUsedRefs($refSchema).forEach(({ value: currRef }) => {\n // If we've already processed this $ref don't send us into an infinite loop.\n if ($refs.has(currRef)) {\n return;\n }\n\n $refs.add(currRef);\n accumulateUsedRefs(schema, $refs, currRef);\n });\n}\n\n/**\n * With an array of tags or object of paths+method combinations, reduce an OpenAPI definition to a\n * new definition that just contains those tags or path + methods.\n *\n * @example <caption>Reduce by an array of tags only.</caption>\n * reducer(apiDefinition, { tags: ['pet'] })\n *\n * @example <caption>Reduce by a specific path and methods.</caption>\n * reducer(apiDefinition, { paths: { '/pet': ['get', 'post'] } })\n *\n * @example <caption>Reduce by a specific path and all methods it has.</caption>\n * reducer(apiDefinition, { paths: { '/pet': '*' } })\n *\n * @param definition A valid OpenAPI 3.x definition\n */\nexport default function reducer(definition: OASDocument, opts: ReducerOptions = {}) {\n // Convert tags and paths to lowercase since casing should not matter.\n const reduceTags = 'tags' in opts ? opts.tags.map(tag => tag.toLowerCase()) : [];\n const reducePaths =\n 'paths' in opts\n ? Object.entries(opts.paths).reduce((acc: Record<string, string[] | string>, [key, value]) => {\n const newKey = key.toLowerCase();\n const newValue = Array.isArray(value) ? value.map(v => v.toLowerCase()) : value.toLowerCase();\n acc[newKey] = newValue;\n return acc;\n }, {})\n : {};\n\n const $refs: Set<string> = new Set();\n const usedTags: Set<string> = new Set();\n\n if (!definition.openapi) {\n throw new Error('Sorry, only OpenAPI definitions are supported.');\n }\n\n // Stringify and parse so we get a full non-reference clone of the API definition to work with.\n // eslint-disable-next-line try-catch-failsafe/json-parse\n const reduced = JSON.parse(JSON.stringify(definition)) as OASDocument;\n\n // Retain any root-level security definitions.\n if ('security' in reduced) {\n Object.values(reduced.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n\n if ('paths' in reduced) {\n Object.keys(reduced.paths).forEach(path => {\n const pathLC = path.toLowerCase();\n\n if (Object.keys(reducePaths).length) {\n if (!(pathLC in reducePaths)) {\n delete reduced.paths[path];\n return;\n }\n }\n\n Object.keys(reduced.paths[path]).forEach((method: HttpMethods | 'parameters') => {\n // If this method is `parameters` we should always retain it.\n if (method !== 'parameters') {\n if (Object.keys(reducePaths).length) {\n if (\n reducePaths[pathLC] !== '*' &&\n Array.isArray(reducePaths[pathLC]) &&\n !reducePaths[pathLC].includes(method)\n ) {\n delete reduced.paths[path][method];\n return;\n }\n }\n }\n\n const operation = reduced.paths[path][method];\n\n // If we're reducing by tags and this operation doesn't live in one of those, remove it.\n if (reduceTags.length) {\n if (!('tags' in operation)) {\n delete reduced.paths[path][method];\n return;\n } else if (!operation.tags.filter(tag => reduceTags.includes(tag.toLowerCase())).length) {\n delete reduced.paths[path][method];\n return;\n }\n }\n\n // Accumulate a list of used tags so we can filter out any ones that we don't need later.\n if ('tags' in operation) {\n operation.tags.forEach((tag: string) => {\n usedTags.add(tag);\n });\n }\n\n // Accumulate a list of $ref pointers that are used within this operation.\n getUsedRefs(operation).forEach(({ value: ref }) => {\n $refs.add(ref);\n });\n\n // Accumulate any used security schemas that we need to retain.\n if ('security' in operation) {\n Object.values(operation.security).forEach(sec => {\n Object.keys(sec).forEach(scheme => {\n $refs.add(`#/components/securitySchemes/${scheme}`);\n });\n });\n }\n });\n\n // If this path no longer has any methods, delete it.\n if (!Object.keys(reduced.paths[path]).length) {\n delete reduced.paths[path];\n }\n });\n\n // If we don't have any more paths after cleanup, throw an error because an OpenAPI file must\n // have at least one path.\n if (!Object.keys(reduced.paths).length) {\n throw new Error('All paths in the API definition were removed. Did you supply the right path name to reduce by?');\n }\n }\n\n // Recursively accumulate any components that are in use.\n $refs.forEach($ref => accumulateUsedRefs(reduced, $refs, $ref));\n\n // Remove any unused components.\n if ('components' in reduced) {\n Object.keys(reduced.components).forEach((componentType: keyof ComponentsObject) => {\n Object.keys(reduced.components[componentType]).forEach(component => {\n if (!$refs.has(`#/components/${componentType}/${component}`)) {\n delete reduced.components[componentType][component];\n }\n });\n\n // If this component group is now empty, delete it.\n if (!Object.keys(reduced.components[componentType]).length) {\n delete reduced.components[componentType];\n }\n });\n\n // If this path no longer has any components, delete it.\n if (!Object.keys(reduced.components).length) {\n delete reduced.components;\n }\n }\n\n // Remove any unused tags.\n if ('tags' in reduced) {\n reduced.tags.forEach((tag: TagObject, k: number) => {\n if (!usedTags.has(tag.name)) {\n delete reduced.tags[k];\n }\n });\n\n // Remove any now empty items from the tags array.\n reduced.tags = reduced.tags.filter(Boolean);\n\n if (!reduced.tags.length) {\n delete reduced.tags;\n }\n }\n\n return reduced;\n}\n"],"mappings":";;;;;AAEA,OAAO,iBAAiB;AAgBxB,SAAS,YAAY,QAAa;AAChC,SAAO,MAAM,CAAC,aAAa,GAAG,MAAM;AACtC;AAUA,SAAS,mBAAmB,QAAiC,OAAoB,MAAiB;AAChG,MAAI;AACJ,MAAI,OAAO,SAAS,SAAU,cAAa,YAAY,IAAI,QAAQ,KAAK,UAAU,CAAC,CAAC;AACpF,MAAI,eAAe,QAAW;AAI5B;AAAA,EACF;AAEA,cAAY,UAAU,EAAE,QAAQ,CAAC,EAAE,OAAO,QAAQ,MAAM;AAEtD,QAAI,MAAM,IAAI,OAAO,GAAG;AACtB;AAAA,IACF;AAEA,UAAM,IAAI,OAAO;AACjB,uBAAmB,QAAQ,OAAO,OAAO;AAAA,EAC3C,CAAC;AACH;AAiBe,SAAR,QAAyB,YAAyB,OAAuB,CAAC,GAAG;AAElF,QAAM,aAAa,UAAU,OAAO,KAAK,KAAK,IAAI,SAAO,IAAI,YAAY,CAAC,IAAI,CAAC;AAC/E,QAAM,cACJ,WAAW,OACP,OAAO,QAAQ,KAAK,KAAK,EAAE,OAAO,CAAC,KAAwC,CAAC,KAAK,KAAK,MAAM;AAC1F,UAAM,SAAS,IAAI,YAAY;AAC/B,UAAM,WAAW,MAAM,QAAQ,KAAK,IAAI,MAAM,IAAI,OAAK,EAAE,YAAY,CAAC,IAAI,MAAM,YAAY;AAC5F,QAAI,MAAM,IAAI;AACd,WAAO;AAAA,EACT,GAAG,CAAC,CAAC,IACL,CAAC;AAEP,QAAM,QAAqB,oBAAI,IAAI;AACnC,QAAM,WAAwB,oBAAI,IAAI;AAEtC,MAAI,CAAC,WAAW,SAAS;AACvB,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAIA,QAAM,UAAU,KAAK,MAAM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KAAgB,MAAc;AAClD,UAAI,CAAC,SAAS,IAAI,IAAI,IAAI,GAAG;AAC3B,eAAO,QAAQ,KAAK,CAAC;AAAA,MACvB;AAAA,IACF,CAAC;AAGD,YAAQ,OAAO,QAAQ,KAAK,OAAO,OAAO;AAE1C,QAAI,CAAC,QAAQ,KAAK,QAAQ;AACxB,aAAO,QAAQ;AAAA,IACjB;AAAA,EACF;AAEA,SAAO;AACT;","names":[]}
package/dist/types.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkG6ASGSM5cjs = require('./chunk-G6ASGSM5.cjs');
5
+ var _chunk4DQE5VZIcjs = require('./chunk-4DQE5VZI.cjs');
6
6
 
7
7
 
8
8
 
9
9
 
10
- exports.isOAS31 = _chunkG6ASGSM5cjs.isOAS31; exports.isRef = _chunkG6ASGSM5cjs.isRef; exports.isSchema = _chunkG6ASGSM5cjs.isSchema;
10
+ exports.isOAS31 = _chunk4DQE5VZIcjs.isOAS31; exports.isRef = _chunk4DQE5VZIcjs.isRef; exports.isSchema = _chunk4DQE5VZIcjs.isSchema;
11
11
  //# sourceMappingURL=types.cjs.map
package/dist/types.d.cts CHANGED
@@ -44,19 +44,19 @@ interface User {
44
44
  type SecurityType = 'apiKey' | 'Basic' | 'Bearer' | 'Cookie' | 'Header' | 'http' | 'OAuth2' | 'Query';
45
45
  type HttpMethods = OpenAPIV3_1.HttpMethods | OpenAPIV3.HttpMethods | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
46
46
  /**
47
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#oasObject}
48
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasObject}
47
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object}
48
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
49
49
  */
50
50
  type OASDocument = (OpenAPIV3_1.Document | OpenAPIV3.Document) & Record<string, unknown>;
51
51
  type OAS31Document = OpenAPIV3_1.Document & Record<string, unknown>;
52
52
  /**
53
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#serverObject}
54
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject}
53
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object}
54
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object}
55
55
  */
56
56
  type ServerObject = OpenAPIV3_1.ServerObject | OpenAPIV3.ServerObject;
57
57
  /**
58
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#serverVariableObject}
59
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverVariableObject}
58
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object}
59
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object}
60
60
  */
61
61
  type ServerVariableObject = OpenAPIV3_1.ServerVariableObject | OpenAPIV3.ServerVariableObject;
62
62
  type ServerVariablesObject = Record<string, ServerVariableObject>;
@@ -70,70 +70,70 @@ interface Servers {
70
70
  variables: ServerVariable;
71
71
  }
72
72
  /**
73
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#componentsObject}
74
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject}
73
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object}
74
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object}
75
75
  */
76
76
  type ComponentsObject = OpenAPIV3_1.ComponentsObject | OpenAPIV3.ComponentsObject;
77
77
  /**
78
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#pathsObject}
79
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathsObject}
78
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object}
79
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#paths-object}
80
80
  */
81
81
  type PathsObject = OpenAPIV3_1.PathsObject | OpenAPIV3.PathsObject;
82
82
  /**
83
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#pathItemObject}
84
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject}
83
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object}
84
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object}
85
85
  */
86
86
  type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV3.PathItemObject;
87
87
  /**
88
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operationObject}
89
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject}
88
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object}
89
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object}
90
90
  */
91
91
  type OperationObject = (OpenAPIV3_1.OperationObject | OpenAPIV3.OperationObject) & Record<string, unknown>;
92
92
  /**
93
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterObject}
94
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject}
93
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object}
94
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object}
95
95
  */
96
96
  type ParameterObject = {
97
97
  in: 'cookie' | 'header' | 'path' | 'query';
98
98
  } & (OpenAPIV3_1.ParameterObject | OpenAPIV3.ParameterObject);
99
99
  /**
100
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#requestBodyObject}
101
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject}
100
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object}
101
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object}
102
102
  */
103
103
  type RequestBodyObject = OpenAPIV3_1.RequestBodyObject | OpenAPIV3.RequestBodyObject;
104
104
  /**
105
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject}
106
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject}
105
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
106
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
107
107
  */
108
108
  type MediaTypeObject = OpenAPIV3_1.MediaTypeObject | OpenAPIV3.MediaTypeObject;
109
109
  /**
110
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#responseObject}
111
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject}
110
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object}
111
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#response-object}
112
112
  */
113
113
  type ResponseObject = OpenAPIV3_1.ResponseObject | OpenAPIV3.ResponseObject;
114
114
  /**
115
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callbackObject}
116
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject}
115
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
116
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
117
117
  */
118
118
  type CallbackObject = OpenAPIV3_1.CallbackObject | OpenAPIV3.CallbackObject;
119
119
  /**
120
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#exampleObject}
121
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#exampleObject}
120
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#example-object}
121
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#example-object}
122
122
  */
123
123
  type ExampleObject = OpenAPIV3_1.ExampleObject | OpenAPIV3.ExampleObject;
124
124
  /**
125
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tagObject}
126
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tagObject}
125
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tag-object}
126
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tag-object}
127
127
  */
128
128
  type TagObject = OpenAPIV3_1.TagObject | OpenAPIV3.TagObject;
129
129
  /**
130
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#headerObject}
131
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject}
130
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object}
131
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#header-object}
132
132
  */
133
133
  type HeaderObject = OpenAPIV3_1.HeaderObject | OpenAPIV3.HeaderObject;
134
134
  /**
135
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject}
136
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject}
135
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object}
136
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object}
137
137
  */
138
138
  type SchemaObject = {
139
139
  externalDocs?: unknown;
@@ -156,8 +156,8 @@ type SchemaObject = {
156
156
  */
157
157
  declare function isSchema(check: unknown, isPolymorphicAllOfChild?: boolean): check is SchemaObject;
158
158
  /**
159
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securitySchemeObject}
160
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject}
159
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object}
160
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object}
161
161
  */
162
162
  type SecuritySchemeObject = OpenAPIV3_1.SecuritySchemeObject | OpenAPIV3.SecuritySchemeObject;
163
163
  type SecuritySchemesObject = Record<string, SecuritySchemeObject>;
@@ -174,8 +174,8 @@ type KeyedSecuritySchemeObject = SecuritySchemeObject & {
174
174
  'x-default'?: number | string;
175
175
  };
176
176
  /**
177
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securityRequirementObject}
178
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securityRequirementObject}
177
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
178
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-requirement-object}
179
179
  */
180
180
  type SecurityRequirementObject = OpenAPIV3_1.SecurityRequirementObject | OpenAPIV3.SecurityRequirementObject;
181
181
 
package/dist/types.d.ts CHANGED
@@ -44,19 +44,19 @@ interface User {
44
44
  type SecurityType = 'apiKey' | 'Basic' | 'Bearer' | 'Cookie' | 'Header' | 'http' | 'OAuth2' | 'Query';
45
45
  type HttpMethods = OpenAPIV3_1.HttpMethods | OpenAPIV3.HttpMethods | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
46
46
  /**
47
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#oasObject}
48
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasObject}
47
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-object}
48
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
49
49
  */
50
50
  type OASDocument = (OpenAPIV3_1.Document | OpenAPIV3.Document) & Record<string, unknown>;
51
51
  type OAS31Document = OpenAPIV3_1.Document & Record<string, unknown>;
52
52
  /**
53
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#serverObject}
54
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject}
53
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-object}
54
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-object}
55
55
  */
56
56
  type ServerObject = OpenAPIV3_1.ServerObject | OpenAPIV3.ServerObject;
57
57
  /**
58
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#serverVariableObject}
59
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverVariableObject}
58
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#server-variable-object}
59
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#server-variable-object}
60
60
  */
61
61
  type ServerVariableObject = OpenAPIV3_1.ServerVariableObject | OpenAPIV3.ServerVariableObject;
62
62
  type ServerVariablesObject = Record<string, ServerVariableObject>;
@@ -70,70 +70,70 @@ interface Servers {
70
70
  variables: ServerVariable;
71
71
  }
72
72
  /**
73
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#componentsObject}
74
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsObject}
73
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object}
74
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object}
75
75
  */
76
76
  type ComponentsObject = OpenAPIV3_1.ComponentsObject | OpenAPIV3.ComponentsObject;
77
77
  /**
78
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#pathsObject}
79
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathsObject}
78
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#paths-object}
79
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#paths-object}
80
80
  */
81
81
  type PathsObject = OpenAPIV3_1.PathsObject | OpenAPIV3.PathsObject;
82
82
  /**
83
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#pathItemObject}
84
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject}
83
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#path-item-object}
84
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#path-item-object}
85
85
  */
86
86
  type PathItemObject = OpenAPIV3_1.PathItemObject | OpenAPIV3.PathItemObject;
87
87
  /**
88
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operationObject}
89
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject}
88
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object}
89
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object}
90
90
  */
91
91
  type OperationObject = (OpenAPIV3_1.OperationObject | OpenAPIV3.OperationObject) & Record<string, unknown>;
92
92
  /**
93
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterObject}
94
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject}
93
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameter-object}
94
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameter-object}
95
95
  */
96
96
  type ParameterObject = {
97
97
  in: 'cookie' | 'header' | 'path' | 'query';
98
98
  } & (OpenAPIV3_1.ParameterObject | OpenAPIV3.ParameterObject);
99
99
  /**
100
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#requestBodyObject}
101
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject}
100
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#request-body-object}
101
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#request-body-object}
102
102
  */
103
103
  type RequestBodyObject = OpenAPIV3_1.RequestBodyObject | OpenAPIV3.RequestBodyObject;
104
104
  /**
105
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#mediaTypeObject}
106
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#mediaTypeObject}
105
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#media-type-object}
106
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#media-type-object}
107
107
  */
108
108
  type MediaTypeObject = OpenAPIV3_1.MediaTypeObject | OpenAPIV3.MediaTypeObject;
109
109
  /**
110
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#responseObject}
111
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responseObject}
110
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#response-object}
111
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#response-object}
112
112
  */
113
113
  type ResponseObject = OpenAPIV3_1.ResponseObject | OpenAPIV3.ResponseObject;
114
114
  /**
115
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callbackObject}
116
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject}
115
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#callback-object}
116
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callback-object}
117
117
  */
118
118
  type CallbackObject = OpenAPIV3_1.CallbackObject | OpenAPIV3.CallbackObject;
119
119
  /**
120
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#exampleObject}
121
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#exampleObject}
120
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#example-object}
121
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.3.md#example-object}
122
122
  */
123
123
  type ExampleObject = OpenAPIV3_1.ExampleObject | OpenAPIV3.ExampleObject;
124
124
  /**
125
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tagObject}
126
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tagObject}
125
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#tag-object}
126
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#tag-object}
127
127
  */
128
128
  type TagObject = OpenAPIV3_1.TagObject | OpenAPIV3.TagObject;
129
129
  /**
130
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#headerObject}
131
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#headerObject}
130
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#header-object}
131
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#header-object}
132
132
  */
133
133
  type HeaderObject = OpenAPIV3_1.HeaderObject | OpenAPIV3.HeaderObject;
134
134
  /**
135
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schemaObject}
136
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject}
135
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object}
136
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object}
137
137
  */
138
138
  type SchemaObject = {
139
139
  externalDocs?: unknown;
@@ -156,8 +156,8 @@ type SchemaObject = {
156
156
  */
157
157
  declare function isSchema(check: unknown, isPolymorphicAllOfChild?: boolean): check is SchemaObject;
158
158
  /**
159
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securitySchemeObject}
160
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securitySchemeObject}
159
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-scheme-object}
160
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-scheme-object}
161
161
  */
162
162
  type SecuritySchemeObject = OpenAPIV3_1.SecuritySchemeObject | OpenAPIV3.SecuritySchemeObject;
163
163
  type SecuritySchemesObject = Record<string, SecuritySchemeObject>;
@@ -174,8 +174,8 @@ type KeyedSecuritySchemeObject = SecuritySchemeObject & {
174
174
  'x-default'?: number | string;
175
175
  };
176
176
  /**
177
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#securityRequirementObject}
178
- * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#securityRequirementObject}
177
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#security-requirement-object}
178
+ * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#security-requirement-object}
179
179
  */
180
180
  type SecurityRequirementObject = OpenAPIV3_1.SecurityRequirementObject | OpenAPIV3.SecurityRequirementObject;
181
181
 
package/dist/types.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  isOAS31,
3
3
  isRef,
4
4
  isSchema
5
- } from "./chunk-U7Q7XPMY.js";
5
+ } from "./chunk-QMLWI5HD.js";
6
6
  export {
7
7
  isOAS31,
8
8
  isRef,
package/dist/utils.cjs CHANGED
@@ -5,13 +5,13 @@ var _chunkVIIXOUMHcjs = require('./chunk-VIIXOUMH.cjs');
5
5
 
6
6
 
7
7
 
8
- var _chunk3I4KH26Ecjs = require('./chunk-3I4KH26E.cjs');
8
+ var _chunkTG4VCYD4cjs = require('./chunk-TG4VCYD4.cjs');
9
9
  require('./chunk-YHO3AOX6.cjs');
10
- require('./chunk-G6ASGSM5.cjs');
10
+ require('./chunk-4DQE5VZI.cjs');
11
11
 
12
12
 
13
13
 
14
14
 
15
15
 
16
- exports.findSchemaDefinition = _chunkVIIXOUMHcjs.findSchemaDefinition; exports.jsonSchemaTypes = _chunk3I4KH26Ecjs.types; exports.matchesMimeType = _chunk3I4KH26Ecjs.matches_mimetype_default; exports.supportedMethods = _chunkVIIXOUMHcjs.supportedMethods;
16
+ exports.findSchemaDefinition = _chunkVIIXOUMHcjs.findSchemaDefinition; exports.jsonSchemaTypes = _chunkTG4VCYD4cjs.types; exports.matchesMimeType = _chunkTG4VCYD4cjs.matches_mimetype_default; exports.supportedMethods = _chunkVIIXOUMHcjs.supportedMethods;
17
17
  //# sourceMappingURL=utils.cjs.map
package/dist/utils.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { t as jsonSchemaTypes } from './extensions-B4_nMl6M.cjs';
1
+ export { t as jsonSchemaTypes } from './extensions-CaiwqAu-.cjs';
2
2
  import './types.cjs';
3
3
  import 'json-schema';
4
4
  import 'openapi-types';
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { t as jsonSchemaTypes } from './extensions-BTG_yoHC.js';
1
+ export { t as jsonSchemaTypes } from './extensions-DYrxWRh4.js';
2
2
  import './types.js';
3
3
  import 'json-schema';
4
4
  import 'openapi-types';
package/dist/utils.js CHANGED
@@ -5,9 +5,9 @@ import {
5
5
  import {
6
6
  matches_mimetype_default,
7
7
  types
8
- } from "./chunk-LH3S6NWD.js";
8
+ } from "./chunk-W7MR5CC7.js";
9
9
  import "./chunk-P2SB77YR.js";
10
- import "./chunk-U7Q7XPMY.js";
10
+ import "./chunk-QMLWI5HD.js";
11
11
  export {
12
12
  findSchemaDefinition,
13
13
  types as jsonSchemaTypes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oas",
3
- "version": "25.1.0",
3
+ "version": "25.2.1",
4
4
  "description": "Comprehensive tooling for working with OpenAPI definitions",
5
5
  "license": "MIT",
6
6
  "author": "ReadMe <support@readme.io> (https://readme.com)",
@@ -94,7 +94,6 @@
94
94
  "jsonpath-plus": "^10.0.0",
95
95
  "jsonpointer": "^5.0.0",
96
96
  "memoizee": "^0.4.16",
97
- "oas-normalize": "^11.1.4",
98
97
  "openapi-types": "^12.1.1",
99
98
  "path-to-regexp": "^8.1.0",
100
99
  "remove-undefined-objects": "^5.0.0"
@@ -110,5 +109,5 @@
110
109
  "vitest": "^2.1.3"
111
110
  },
112
111
  "prettier": "@readme/eslint-config/prettier",
113
- "gitHead": "1a67b475bde7bee51fd1bce64f3022180b50a128"
112
+ "gitHead": "5705800d43618a2dcaa5f32926eeff944a6ebbc2"
114
113
  }