oas 34.0.2 → 34.1.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 (33) hide show
  1. package/dist/analyzer/index.cjs +6 -6
  2. package/dist/analyzer/index.cjs.map +1 -1
  3. package/dist/analyzer/index.js +4 -4
  4. package/dist/{chunk-HZ7LCMAM.cjs → chunk-4CVTOSVQ.cjs} +132 -132
  5. package/dist/{chunk-HZ7LCMAM.cjs.map → chunk-4CVTOSVQ.cjs.map} +1 -1
  6. package/dist/{chunk-V4IQC5XF.cjs → chunk-6KWJOFQ2.cjs} +37 -37
  7. package/dist/{chunk-V4IQC5XF.cjs.map → chunk-6KWJOFQ2.cjs.map} +1 -1
  8. package/dist/{chunk-GQ6E7DXK.js → chunk-6OI7XULA.js} +2 -2
  9. package/dist/{chunk-66Z3SYJH.js → chunk-CHFSBT33.js} +8 -5
  10. package/dist/{chunk-66Z3SYJH.js.map → chunk-CHFSBT33.js.map} +1 -1
  11. package/dist/{chunk-GXLENSTM.cjs → chunk-JGJR6Y6O.cjs} +32 -29
  12. package/dist/chunk-JGJR6Y6O.cjs.map +1 -0
  13. package/dist/{chunk-KYSWFHUO.js → chunk-LIBQ2UJH.js} +3 -3
  14. package/dist/{chunk-PSNTODZL.js → chunk-NM3QL4AB.js} +1 -1
  15. package/dist/{chunk-PSNTODZL.js.map → chunk-NM3QL4AB.js.map} +1 -1
  16. package/dist/{chunk-3MTU2ESP.cjs → chunk-NR45NABA.cjs} +1 -1
  17. package/dist/{chunk-3MTU2ESP.cjs.map → chunk-NR45NABA.cjs.map} +1 -1
  18. package/dist/index.cjs +5 -5
  19. package/dist/index.js +4 -4
  20. package/dist/operation/index.cjs +4 -4
  21. package/dist/operation/index.js +3 -3
  22. package/dist/reducer/index.cjs +13 -13
  23. package/dist/reducer/index.js +2 -2
  24. package/dist/types.cjs +2 -2
  25. package/dist/types.d.cts +4 -1
  26. package/dist/types.d.ts +4 -1
  27. package/dist/types.js +1 -1
  28. package/dist/utils.cjs +3 -3
  29. package/dist/utils.js +2 -2
  30. package/package.json +1 -1
  31. package/dist/chunk-GXLENSTM.cjs.map +0 -1
  32. /package/dist/{chunk-GQ6E7DXK.js.map → chunk-6OI7XULA.js.map} +0 -0
  33. /package/dist/{chunk-KYSWFHUO.js.map → chunk-LIBQ2UJH.js.map} +0 -0
@@ -6,7 +6,7 @@ var _chunkAYA3UT4Lcjs = require('./chunk-AYA3UT4L.cjs');
6
6
 
7
7
 
8
8
 
9
- var _chunk3MTU2ESPcjs = require('./chunk-3MTU2ESP.cjs');
9
+ var _chunkNR45NABAcjs = require('./chunk-NR45NABA.cjs');
10
10
 
11
11
  // src/lib/matches-mimetype.ts
12
12
  function matchesMediaType(types2, mediaType) {
@@ -118,7 +118,7 @@ function dereferenceRef(value, definition, seenRefs = /* @__PURE__ */ new Set())
118
118
  if (value === void 0) {
119
119
  return void 0;
120
120
  }
121
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, value)) {
121
+ if (_chunkNR45NABAcjs.isRef.call(void 0, value)) {
122
122
  if (!definition) {
123
123
  return value;
124
124
  }
@@ -129,7 +129,7 @@ function dereferenceRef(value, definition, seenRefs = /* @__PURE__ */ new Set())
129
129
  seenRefs.add(ref);
130
130
  try {
131
131
  const dereferenced = findRef(ref, definition);
132
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, dereferenced)) {
132
+ if (_chunkNR45NABAcjs.isRef.call(void 0, dereferenced)) {
133
133
  return dereferenceRef(dereferenced, definition, seenRefs);
134
134
  }
135
135
  return {
@@ -144,10 +144,10 @@ function dereferenceRef(value, definition, seenRefs = /* @__PURE__ */ new Set())
144
144
  function dereferenceRefDeep(value, definition, seenRefs = /* @__PURE__ */ new Set()) {
145
145
  if (value === null || value === void 0) return value;
146
146
  if (typeof value !== "object") return value;
147
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, value)) {
147
+ if (_chunkNR45NABAcjs.isRef.call(void 0, value)) {
148
148
  if (!definition) return value;
149
149
  const resolved = dereferenceRef(value, definition, seenRefs);
150
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, resolved)) return resolved;
150
+ if (_chunkNR45NABAcjs.isRef.call(void 0, resolved)) return resolved;
151
151
  return dereferenceRefDeep(resolved, definition, seenRefs);
152
152
  }
153
153
  if (Array.isArray(value)) {
@@ -180,7 +180,7 @@ function collectRefsInSchema(schema) {
180
180
  const refs = /* @__PURE__ */ new Set();
181
181
  if (!schema || typeof schema !== "object") return refs;
182
182
  const obj = schema;
183
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, obj)) {
183
+ if (_chunkNR45NABAcjs.isRef.call(void 0, obj)) {
184
184
  refs.add(obj.$ref);
185
185
  }
186
186
  for (const value of Object.values(obj)) {
@@ -321,7 +321,7 @@ function allOfReferencesSchema(schema, targetSchemaName) {
321
321
  if (!schema || typeof schema !== "object") return false;
322
322
  if (!("allOf" in schema) || !Array.isArray(schema.allOf)) return false;
323
323
  return schema.allOf.some((item) => {
324
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, item)) {
324
+ if (_chunkNR45NABAcjs.isRef.call(void 0, item)) {
325
325
  const refParts = item.$ref.split("/");
326
326
  const refSchemaName = refParts[refParts.length - 1];
327
327
  return refSchemaName === targetSchemaName;
@@ -458,7 +458,7 @@ function isPendingSchema(s) {
458
458
  return isObject(s) && "__pending" in s && s.__pending === true;
459
459
  }
460
460
  function getSchemaVersionString(schema, api) {
461
- if (_chunk3MTU2ESPcjs.isOpenAPI30.call(void 0, api)) {
461
+ if (_chunkNR45NABAcjs.isOpenAPI30.call(void 0, api)) {
462
462
  return "http://json-schema.org/draft-04/schema#";
463
463
  }
464
464
  if (schema.$schema) {
@@ -474,7 +474,7 @@ function isPolymorphicSchema(schema) {
474
474
  }
475
475
  function shouldFoldParentItemsIntoPolymorphBranch(item) {
476
476
  if (!isObject(item)) return false;
477
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, item)) return true;
477
+ if (_chunkNR45NABAcjs.isRef.call(void 0, item)) return true;
478
478
  const branch = item;
479
479
  if (!("type" in branch) || branch.type === void 0) return true;
480
480
  if (!hasSchemaType(branch, "array")) return false;
@@ -497,7 +497,7 @@ function inlinePropertyRefsForMerge(schema, usedSchemas, refLogger, conflictPath
497
497
  for (const key of Object.keys(out.properties)) {
498
498
  const path = currentPath ? `${currentPath}.${key}` : key;
499
499
  const val = out.properties[key];
500
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, val)) {
500
+ if (_chunkNR45NABAcjs.isRef.call(void 0, val)) {
501
501
  if (val.$ref.startsWith("#/paths/")) {
502
502
  refLogger(val.$ref, "ref");
503
503
  continue;
@@ -577,12 +577,12 @@ function inlineAllOfRefsDeep(schema, usedSchemas) {
577
577
  for (let i = 0; i < schema[keyword].length; i++) {
578
578
  const option = schema[keyword][i];
579
579
  if (!option || typeof option !== "object") continue;
580
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, option) && option.$ref.includes(allOfKey)) {
580
+ if (_chunkNR45NABAcjs.isRef.call(void 0, option) && option.$ref.includes(allOfKey)) {
581
581
  const resolved = usedSchemas.get(option.$ref);
582
582
  if (resolved !== void 0 && !isPendingSchema(resolved)) {
583
583
  schema[keyword][i] = structuredClone(resolved);
584
584
  }
585
- } else if (!_chunk3MTU2ESPcjs.isRef.call(void 0, option)) {
585
+ } else if (!_chunkNR45NABAcjs.isRef.call(void 0, option)) {
586
586
  inlineAllOfRefsDeep(option, usedSchemas);
587
587
  }
588
588
  }
@@ -590,12 +590,12 @@ function inlineAllOfRefsDeep(schema, usedSchemas) {
590
590
  if ("properties" in schema && typeof schema.properties === "object" && schema.properties !== null) {
591
591
  for (const key of Object.keys(schema.properties)) {
592
592
  const val = schema.properties[key];
593
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, val) && val.$ref.includes(allOfKey)) {
593
+ if (_chunkNR45NABAcjs.isRef.call(void 0, val) && val.$ref.includes(allOfKey)) {
594
594
  const resolved = usedSchemas.get(val.$ref);
595
595
  if (resolved !== void 0 && !isPendingSchema(resolved)) {
596
596
  schema.properties[key] = structuredClone(resolved);
597
597
  }
598
- } else if (val && typeof val === "object" && !Array.isArray(val) && !_chunk3MTU2ESPcjs.isRef.call(void 0, val)) {
598
+ } else if (val && typeof val === "object" && !Array.isArray(val) && !_chunkNR45NABAcjs.isRef.call(void 0, val)) {
599
599
  inlineAllOfRefsDeep(val, usedSchemas);
600
600
  }
601
601
  }
@@ -620,7 +620,7 @@ function resolveAndCacheRefSchema({
620
620
  if (_optionalChain([refsEmittedAsStub, 'optionalAccess', _20 => _20.has, 'call', _21 => _21(ref)])) {
621
621
  return { $ref: ref };
622
622
  }
623
- if (!_chunk3MTU2ESPcjs.isRef.call(void 0, existing)) {
623
+ if (!_chunkNR45NABAcjs.isRef.call(void 0, existing)) {
624
624
  return structuredClone(existing);
625
625
  }
626
626
  return { $ref: ref };
@@ -634,7 +634,7 @@ function resolveAndCacheRefSchema({
634
634
  let resolved;
635
635
  try {
636
636
  const dereferenced = dereferenceRef(schema, definition, seenRefs);
637
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, dereferenced)) {
637
+ if (_chunkNR45NABAcjs.isRef.call(void 0, dereferenced)) {
638
638
  refLogger(dereferenced.$ref, "ref");
639
639
  let converted2;
640
640
  try {
@@ -668,7 +668,7 @@ function resolveAndCacheRefSchema({
668
668
  }
669
669
  try {
670
670
  const dereferenced = dereferenceRef(schema, definition, seenRefs);
671
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, dereferenced)) {
671
+ if (_chunkNR45NABAcjs.isRef.call(void 0, dereferenced)) {
672
672
  let converted2;
673
673
  try {
674
674
  const pointer = ref.startsWith("#") ? decodeURIComponent(ref.substring(1)) : ref;
@@ -739,7 +739,7 @@ function searchForValueByPropAndPointer(property, pointer, schemas = []) {
739
739
  }
740
740
  function toJSONSchema(data, opts) {
741
741
  let schema = data === true ? {} : { ...data };
742
- const schemaAdditionalProperties = _chunk3MTU2ESPcjs.isSchema.call(void 0, schema) ? schema.additionalProperties : null;
742
+ const schemaAdditionalProperties = _chunkNR45NABAcjs.isSchema.call(void 0, schema) ? schema.additionalProperties : null;
743
743
  const {
744
744
  addEnumsToDescriptions,
745
745
  currentLocation,
@@ -784,7 +784,7 @@ function toJSONSchema(data, opts) {
784
784
  usedSchemas,
785
785
  refsEmittedAsStub
786
786
  };
787
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, schema)) {
787
+ if (_chunkNR45NABAcjs.isRef.call(void 0, schema)) {
788
788
  if (definition && usedSchemas) {
789
789
  const resolved = resolveAndCacheRefSchema({
790
790
  schema,
@@ -804,7 +804,7 @@ function toJSONSchema(data, opts) {
804
804
  refLogger(schema.$ref, "ref");
805
805
  return schema;
806
806
  }
807
- if (_chunk3MTU2ESPcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild)) {
807
+ if (_chunkNR45NABAcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild)) {
808
808
  if ("allOf" in schema && Array.isArray(schema.allOf)) {
809
809
  if ("properties" in schema && schema.properties !== void 0 && typeof schema.properties === "object" && schema.properties !== null && !Array.isArray(schema.properties)) {
810
810
  const preprocessed = {};
@@ -819,9 +819,9 @@ function toJSONSchema(data, opts) {
819
819
  });
820
820
  if (hideReadOnlyProperties || hideWriteOnlyProperties) {
821
821
  let resolvedRefIsEmpty = false;
822
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, converted) && usedSchemas) {
822
+ if (_chunkNR45NABAcjs.isRef.call(void 0, converted) && usedSchemas) {
823
823
  const cached = usedSchemas.get(converted.$ref);
824
- if (cached && !_chunk3MTU2ESPcjs.isRef.call(void 0, cached) && !isPendingSchema(cached) && Object.keys(cached).length === 0) {
824
+ if (cached && !_chunkNR45NABAcjs.isRef.call(void 0, cached) && !isPendingSchema(cached) && Object.keys(cached).length === 0) {
825
825
  resolvedRefIsEmpty = true;
826
826
  }
827
827
  }
@@ -842,7 +842,7 @@ function toJSONSchema(data, opts) {
842
842
  const allOfOptions = allOfSchemas.length > 1 ? { ...polyOptions, refLogger: () => {
843
843
  } } : polyOptions;
844
844
  allOfSchemas = allOfSchemas.map((item) => {
845
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, item)) {
845
+ if (_chunkNR45NABAcjs.isRef.call(void 0, item)) {
846
846
  if (Object.keys(item).length === 1) {
847
847
  return resolveAndCacheRefSchema({
848
848
  schema: item,
@@ -896,7 +896,7 @@ function toJSONSchema(data, opts) {
896
896
  };
897
897
  const requiredSet = new Set(Array.isArray(fallback.required) ? fallback.required : []);
898
898
  for (const branch of branches) {
899
- if (!branch || typeof branch !== "object" || _chunk3MTU2ESPcjs.isRef.call(void 0, branch)) continue;
899
+ if (!branch || typeof branch !== "object" || _chunkNR45NABAcjs.isRef.call(void 0, branch)) continue;
900
900
  if (fallback.type === void 0 && "type" in branch && branch.type !== void 0) {
901
901
  fallback.type = branch.type;
902
902
  }
@@ -927,7 +927,7 @@ function toJSONSchema(data, opts) {
927
927
  collectRefsInSchema(schema).forEach((ref) => {
928
928
  refLogger(ref, "ref");
929
929
  });
930
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, schema)) {
930
+ if (_chunkNR45NABAcjs.isRef.call(void 0, schema)) {
931
931
  refLogger(schema.$ref, "ref");
932
932
  return schema;
933
933
  }
@@ -985,7 +985,7 @@ function toJSONSchema(data, opts) {
985
985
  delete childSchema.anyOf;
986
986
  }
987
987
  }
988
- if (definition && usedSchemas && _chunk3MTU2ESPcjs.isRef.call(void 0, childSchema)) {
988
+ if (definition && usedSchemas && _chunkNR45NABAcjs.isRef.call(void 0, childSchema)) {
989
989
  const resolved = usedSchemas.get(childSchema.$ref);
990
990
  if (resolved && typeof resolved === "object" && !isPendingSchema(resolved)) {
991
991
  if ("discriminator" in resolved) {
@@ -1106,7 +1106,7 @@ function toJSONSchema(data, opts) {
1106
1106
  }
1107
1107
  }
1108
1108
  }
1109
- if (_chunk3MTU2ESPcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild)) {
1109
+ if (_chunkNR45NABAcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild)) {
1110
1110
  if ("default" in schema && isObject(schema.default)) {
1111
1111
  prevDefaultSchemas.push({ default: schema.default });
1112
1112
  }
@@ -1130,7 +1130,7 @@ function toJSONSchema(data, opts) {
1130
1130
  let currentExample = example;
1131
1131
  if (name === "$ref") {
1132
1132
  currentExample = dereferenceRef({ $ref: currentExample }, definition, seenRefs);
1133
- if (!currentExample || _chunk3MTU2ESPcjs.isRef.call(void 0, currentExample)) {
1133
+ if (!currentExample || _chunkNR45NABAcjs.isRef.call(void 0, currentExample)) {
1134
1134
  refLogger(currentExample.$ref, "ref");
1135
1135
  return;
1136
1136
  }
@@ -1170,7 +1170,7 @@ function toJSONSchema(data, opts) {
1170
1170
  }
1171
1171
  if (hasSchemaType(schema, "array")) {
1172
1172
  if ("items" in schema && schema.items !== void 0) {
1173
- if (!(definition && usedSchemas) && !Array.isArray(schema.items) && Object.keys(schema.items).length === 1 && _chunk3MTU2ESPcjs.isRef.call(void 0, schema.items)) {
1173
+ if (!(definition && usedSchemas) && !Array.isArray(schema.items) && Object.keys(schema.items).length === 1 && _chunkNR45NABAcjs.isRef.call(void 0, schema.items)) {
1174
1174
  refLogger(schema.items.$ref, "ref");
1175
1175
  } else if (schema.items !== true) {
1176
1176
  schema.items = toJSONSchema(schema.items, {
@@ -1208,9 +1208,9 @@ function toJSONSchema(data, opts) {
1208
1208
  let propShouldBeUpdated = true;
1209
1209
  if (hideReadOnlyProperties || hideWriteOnlyProperties) {
1210
1210
  let resolvedRefIsEmpty = false;
1211
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, newPropSchema) && usedSchemas) {
1211
+ if (_chunkNR45NABAcjs.isRef.call(void 0, newPropSchema) && usedSchemas) {
1212
1212
  const cached = usedSchemas.get(newPropSchema.$ref);
1213
- if (cached && !_chunk3MTU2ESPcjs.isRef.call(void 0, cached) && !isPendingSchema(cached) && Object.keys(cached).length === 0) {
1213
+ if (cached && !_chunkNR45NABAcjs.isRef.call(void 0, cached) && !isPendingSchema(cached) && Object.keys(cached).length === 0) {
1214
1214
  resolvedRefIsEmpty = true;
1215
1215
  }
1216
1216
  }
@@ -1258,7 +1258,7 @@ function toJSONSchema(data, opts) {
1258
1258
  }
1259
1259
  }
1260
1260
  }
1261
- if (_chunk3MTU2ESPcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild) && globalDefaults && Object.keys(globalDefaults).length > 0 && currentLocation) {
1261
+ if (_chunkNR45NABAcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild) && globalDefaults && Object.keys(globalDefaults).length > 0 && currentLocation) {
1262
1262
  try {
1263
1263
  const userJwtDefault = _jsonpointer2.default.get(globalDefaults, currentLocation);
1264
1264
  if (userJwtDefault) {
@@ -1280,7 +1280,7 @@ function toJSONSchema(data, opts) {
1280
1280
  schema.default = foundDefault;
1281
1281
  }
1282
1282
  }
1283
- if (_chunk3MTU2ESPcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild) && "enum" in schema && Array.isArray(schema.enum)) {
1283
+ if (_chunkNR45NABAcjs.isSchema.call(void 0, schema, isPolymorphicAllOfChild) && "enum" in schema && Array.isArray(schema.enum)) {
1284
1284
  schema.enum = Array.from(new Set(schema.enum));
1285
1285
  if (addEnumsToDescriptions) {
1286
1286
  const enums = schema.enum.filter((v) => v !== void 0 && (typeof v !== "string" || v.trim() !== "")).map((str) => `\`${str}\``).join(" ");
@@ -1389,9 +1389,9 @@ function getParametersAsJSONSchema(operation, api, opts) {
1389
1389
  examples: Object.values(mediaTypeObject.examples || {}).map((ex) => {
1390
1390
  let example = ex;
1391
1391
  if (!example) return;
1392
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, example)) {
1392
+ if (_chunkNR45NABAcjs.isRef.call(void 0, example)) {
1393
1393
  example = dereferenceRef(example, operation.api);
1394
- if (!example || _chunk3MTU2ESPcjs.isRef.call(void 0, example)) return;
1394
+ if (!example || _chunkNR45NABAcjs.isRef.call(void 0, example)) return;
1395
1395
  }
1396
1396
  return example.value;
1397
1397
  }).filter((item) => item !== void 0)
@@ -1518,7 +1518,7 @@ function getParametersAsJSONSchema(operation, api, opts) {
1518
1518
  }
1519
1519
  try {
1520
1520
  const resolved = dereferenceRef({ $ref: ref }, api, seenRefs);
1521
- if (_chunk3MTU2ESPcjs.isRef.call(void 0, resolved)) return;
1521
+ if (_chunkNR45NABAcjs.isRef.call(void 0, resolved)) return;
1522
1522
  const converted = toJSONSchema(structuredClone(resolved), {
1523
1523
  ...baseSchemaOptions,
1524
1524
  usedSchemas,
@@ -1571,4 +1571,4 @@ var SERVER_VARIABLE_REGEX = /{([-_a-zA-Z0-9:.[\]]+)}/g;
1571
1571
 
1572
1572
 
1573
1573
  exports.isObject = isObject; exports.isPrimitive = isPrimitive; exports.decorateComponentSchemasWithRefName = decorateComponentSchemasWithRefName; exports.decodePointer = decodePointer; exports.dereferenceRef = dereferenceRef; exports.dereferenceRefDeep = dereferenceRefDeep; exports.getDereferencingOptions = getDereferencingOptions; exports.collectRefsInSchema = collectRefsInSchema; exports.filterRequiredRefsToReferenced = filterRequiredRefsToReferenced; exports.mergeReferencedSchemasIntoRoot = mergeReferencedSchemasIntoRoot; exports.matches_mimetype_default = matches_mimetype_default; exports.getParameterContentType = getParameterContentType; exports.cloneObject = cloneObject; exports.applyDiscriminatorOneOfToUsedSchemas = applyDiscriminatorOneOfToUsedSchemas; exports.getSchemaVersionString = getSchemaVersionString; exports.toJSONSchema = toJSONSchema; exports.types = types; exports.getParametersAsJSONSchema = getParametersAsJSONSchema; exports.supportedMethods = supportedMethods; exports.SERVER_VARIABLE_REGEX = SERVER_VARIABLE_REGEX;
1574
- //# sourceMappingURL=chunk-V4IQC5XF.cjs.map
1574
+ //# sourceMappingURL=chunk-6KWJOFQ2.cjs.map