@kubb/agent 4.33.2 → 4.33.4

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 (412) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/server/chunks/nitro/nitro.mjs +13 -7
  3. package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
  4. package/.output/server/node_modules/@babel/runtime/package.json +1 -1
  5. package/.output/server/node_modules/@readme/openapi-parser/package.json +3 -3
  6. package/.output/server/node_modules/@redocly/config/lib/asyncapi-config-schema.js +53 -0
  7. package/.output/server/node_modules/@redocly/config/lib/default-theme-config-schema.js +2 -0
  8. package/.output/server/node_modules/@redocly/config/lib/ex-theme-config-schemas.js +2 -1
  9. package/.output/server/node_modules/@redocly/config/lib/remove-property-recursively.js +7 -4
  10. package/.output/server/node_modules/@redocly/config/package.json +2 -2
  11. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-in.js +54 -1
  12. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/common/filters/filter-out.js +54 -1
  13. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas2/index.js +1 -1
  14. package/.output/server/node_modules/@redocly/openapi-core/lib/decorators/oas3/index.js +1 -1
  15. package/.output/server/node_modules/@redocly/openapi-core/package.json +2 -2
  16. package/.output/server/node_modules/ajv/.runkit_example.js +23 -0
  17. package/.output/server/node_modules/ajv/LICENSE +22 -0
  18. package/.output/server/node_modules/ajv/README.md +207 -0
  19. package/.output/server/node_modules/ajv/dist/2019.d.ts +19 -0
  20. package/.output/server/node_modules/ajv/dist/2019.js +61 -0
  21. package/.output/server/node_modules/ajv/dist/2019.js.map +1 -0
  22. package/.output/server/node_modules/ajv/dist/2020.d.ts +19 -0
  23. package/.output/server/node_modules/ajv/dist/2020.js.map +1 -0
  24. package/.output/server/node_modules/ajv/dist/ajv.d.ts +18 -0
  25. package/.output/server/node_modules/ajv/dist/ajv.js +50 -0
  26. package/.output/server/node_modules/ajv/dist/ajv.js.map +1 -0
  27. package/.output/server/node_modules/ajv/dist/compile/codegen/code.d.ts +40 -0
  28. package/.output/server/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
  29. package/.output/server/node_modules/ajv/dist/compile/codegen/index.d.ts +79 -0
  30. package/.output/server/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
  31. package/.output/server/node_modules/ajv/dist/compile/codegen/scope.d.ts +79 -0
  32. package/.output/server/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
  33. package/.output/server/node_modules/ajv/dist/compile/errors.d.ts +13 -0
  34. package/.output/server/node_modules/ajv/dist/compile/errors.js.map +1 -0
  35. package/.output/server/node_modules/ajv/dist/compile/index.d.ts +80 -0
  36. package/.output/server/node_modules/ajv/dist/compile/index.js.map +1 -0
  37. package/.output/server/node_modules/ajv/dist/compile/jtd/parse.d.ts +4 -0
  38. package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js +350 -0
  39. package/.output/server/node_modules/ajv/dist/compile/jtd/parse.js.map +1 -0
  40. package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.d.ts +4 -0
  41. package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js +229 -0
  42. package/.output/server/node_modules/ajv/dist/compile/jtd/serialize.js.map +1 -0
  43. package/.output/server/node_modules/ajv/dist/compile/jtd/types.d.ts +6 -0
  44. package/.output/server/node_modules/ajv/dist/compile/jtd/types.js +14 -0
  45. package/.output/server/node_modules/ajv/dist/compile/jtd/types.js.map +1 -0
  46. package/.output/server/node_modules/ajv/dist/compile/names.d.ts +20 -0
  47. package/.output/server/node_modules/ajv/dist/compile/names.js.map +1 -0
  48. package/.output/server/node_modules/ajv/dist/compile/ref_error.d.ts +6 -0
  49. package/.output/server/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
  50. package/.output/server/node_modules/ajv/dist/compile/resolve.d.ts +12 -0
  51. package/.output/server/node_modules/ajv/dist/compile/resolve.js.map +1 -0
  52. package/.output/server/node_modules/ajv/dist/compile/rules.d.ts +28 -0
  53. package/.output/server/node_modules/ajv/dist/compile/rules.js.map +1 -0
  54. package/.output/server/node_modules/ajv/dist/compile/util.d.ts +40 -0
  55. package/.output/server/node_modules/ajv/dist/compile/util.js.map +1 -0
  56. package/.output/server/node_modules/ajv/dist/compile/validate/applicability.d.ts +6 -0
  57. package/.output/server/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
  58. package/.output/server/node_modules/ajv/dist/compile/validate/boolSchema.d.ts +4 -0
  59. package/.output/server/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
  60. package/.output/server/node_modules/ajv/dist/compile/validate/dataType.d.ts +17 -0
  61. package/.output/server/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
  62. package/.output/server/node_modules/ajv/dist/compile/validate/defaults.d.ts +2 -0
  63. package/.output/server/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
  64. package/.output/server/node_modules/ajv/dist/compile/validate/index.d.ts +42 -0
  65. package/.output/server/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
  66. package/.output/server/node_modules/ajv/dist/compile/validate/keyword.d.ts +8 -0
  67. package/.output/server/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
  68. package/.output/server/node_modules/ajv/dist/compile/validate/subschema.d.ts +47 -0
  69. package/.output/server/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
  70. package/.output/server/node_modules/ajv/dist/core.d.ts +173 -0
  71. package/.output/server/node_modules/ajv/dist/core.js.map +1 -0
  72. package/.output/server/node_modules/ajv/dist/jtd.d.ts +47 -0
  73. package/.output/server/node_modules/ajv/dist/jtd.js +72 -0
  74. package/.output/server/node_modules/ajv/dist/jtd.js.map +1 -0
  75. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.d.ts +2 -0
  76. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.js +28 -0
  77. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/index.js.map +1 -0
  78. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/applicator.json +53 -0
  79. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/content.json +17 -0
  80. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/core.json +57 -0
  81. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/format.json +14 -0
  82. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  83. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json +90 -0
  84. package/.output/server/node_modules/ajv/dist/refs/json-schema-2019-09/schema.json +39 -0
  85. package/.output/server/node_modules/ajv/dist/refs/json-schema-2020-12/index.d.ts +2 -0
  86. package/.output/server/node_modules/ajv/dist/refs/json-schema-2020-12/index.js.map +1 -0
  87. package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-06.json +137 -0
  88. package/.output/server/node_modules/ajv/dist/refs/json-schema-draft-07.json +151 -0
  89. package/.output/server/node_modules/ajv/dist/refs/json-schema-secure.json +88 -0
  90. package/.output/server/node_modules/ajv/dist/refs/jtd-schema.d.ts +3 -0
  91. package/.output/server/node_modules/ajv/dist/refs/jtd-schema.js +118 -0
  92. package/.output/server/node_modules/ajv/dist/refs/jtd-schema.js.map +1 -0
  93. package/.output/server/node_modules/ajv/dist/runtime/equal.d.ts +6 -0
  94. package/.output/server/node_modules/ajv/dist/runtime/equal.js.map +1 -0
  95. package/.output/server/node_modules/ajv/dist/runtime/parseJson.d.ts +18 -0
  96. package/.output/server/node_modules/ajv/dist/runtime/parseJson.js +185 -0
  97. package/.output/server/node_modules/ajv/dist/runtime/parseJson.js.map +1 -0
  98. package/.output/server/node_modules/ajv/dist/runtime/quote.d.ts +5 -0
  99. package/.output/server/node_modules/ajv/dist/runtime/quote.js +30 -0
  100. package/.output/server/node_modules/ajv/dist/runtime/quote.js.map +1 -0
  101. package/.output/server/node_modules/ajv/dist/runtime/re2.d.ts +6 -0
  102. package/.output/server/node_modules/ajv/dist/runtime/re2.js +6 -0
  103. package/.output/server/node_modules/ajv/dist/runtime/re2.js.map +1 -0
  104. package/.output/server/node_modules/ajv/dist/runtime/timestamp.d.ts +5 -0
  105. package/.output/server/node_modules/ajv/dist/runtime/timestamp.js +42 -0
  106. package/.output/server/node_modules/ajv/dist/runtime/timestamp.js.map +1 -0
  107. package/.output/server/node_modules/ajv/dist/runtime/ucs2length.d.ts +5 -0
  108. package/.output/server/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
  109. package/.output/server/node_modules/ajv/dist/runtime/uri.d.ts +6 -0
  110. package/.output/server/node_modules/ajv/dist/runtime/uri.js.map +1 -0
  111. package/.output/server/node_modules/ajv/dist/runtime/validation_error.d.ts +7 -0
  112. package/.output/server/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
  113. package/.output/server/node_modules/ajv/dist/standalone/index.d.ts +6 -0
  114. package/.output/server/node_modules/ajv/dist/standalone/index.js +90 -0
  115. package/.output/server/node_modules/ajv/dist/standalone/index.js.map +1 -0
  116. package/.output/server/node_modules/ajv/dist/standalone/instance.d.ts +12 -0
  117. package/.output/server/node_modules/ajv/dist/standalone/instance.js +35 -0
  118. package/.output/server/node_modules/ajv/dist/standalone/instance.js.map +1 -0
  119. package/.output/server/node_modules/ajv/dist/types/index.d.ts +183 -0
  120. package/.output/server/node_modules/ajv/dist/types/index.js +3 -0
  121. package/.output/server/node_modules/ajv/dist/types/index.js.map +1 -0
  122. package/.output/server/node_modules/ajv/dist/types/json-schema.d.ts +125 -0
  123. package/.output/server/node_modules/ajv/dist/types/json-schema.js +3 -0
  124. package/.output/server/node_modules/ajv/dist/types/json-schema.js.map +1 -0
  125. package/.output/server/node_modules/ajv/dist/types/jtd-schema.d.ts +174 -0
  126. package/.output/server/node_modules/ajv/dist/types/jtd-schema.js +3 -0
  127. package/.output/server/node_modules/ajv/dist/types/jtd-schema.js.map +1 -0
  128. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalItems.d.ts +8 -0
  129. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
  130. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.d.ts +6 -0
  131. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
  132. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.d.ts +3 -0
  133. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
  134. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/anyOf.d.ts +4 -0
  135. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
  136. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/contains.d.ts +7 -0
  137. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
  138. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependencies.d.ts +21 -0
  139. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
  140. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.d.ts +3 -0
  141. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/dependentSchemas.js.map +1 -0
  142. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/if.d.ts +6 -0
  143. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
  144. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/index.d.ts +13 -0
  145. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
  146. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items.d.ts +5 -0
  147. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
  148. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items2020.d.ts +6 -0
  149. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
  150. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/not.d.ts +4 -0
  151. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
  152. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/oneOf.d.ts +6 -0
  153. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
  154. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/patternProperties.d.ts +3 -0
  155. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
  156. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/prefixItems.d.ts +3 -0
  157. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
  158. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.d.ts +3 -0
  159. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
  160. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/propertyNames.d.ts +6 -0
  161. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
  162. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/thenElse.d.ts +3 -0
  163. package/.output/server/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
  164. package/.output/server/node_modules/ajv/dist/vocabularies/code.d.ts +17 -0
  165. package/.output/server/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
  166. package/.output/server/node_modules/ajv/dist/vocabularies/core/id.d.ts +3 -0
  167. package/.output/server/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
  168. package/.output/server/node_modules/ajv/dist/vocabularies/core/index.d.ts +3 -0
  169. package/.output/server/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
  170. package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.d.ts +8 -0
  171. package/.output/server/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
  172. package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.d.ts +5 -0
  173. package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
  174. package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/types.d.ts +10 -0
  175. package/.output/server/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
  176. package/.output/server/node_modules/ajv/dist/vocabularies/draft2020.d.ts +3 -0
  177. package/.output/server/node_modules/ajv/dist/vocabularies/draft2020.js.map +1 -0
  178. package/.output/server/node_modules/ajv/dist/vocabularies/draft7.d.ts +3 -0
  179. package/.output/server/node_modules/ajv/dist/vocabularies/draft7.js +17 -0
  180. package/.output/server/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
  181. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.d.ts +5 -0
  182. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicAnchor.js.map +1 -0
  183. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.d.ts +5 -0
  184. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/dynamicRef.js.map +1 -0
  185. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/index.d.ts +3 -0
  186. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/index.js.map +1 -0
  187. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.d.ts +3 -0
  188. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveAnchor.js.map +1 -0
  189. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.d.ts +3 -0
  190. package/.output/server/node_modules/ajv/dist/vocabularies/dynamic/recursiveRef.js.map +1 -0
  191. package/.output/server/node_modules/ajv/dist/vocabularies/errors.d.ts +9 -0
  192. package/.output/server/node_modules/ajv/dist/vocabularies/errors.js +3 -0
  193. package/.output/server/node_modules/ajv/dist/vocabularies/errors.js.map +1 -0
  194. package/.output/server/node_modules/ajv/dist/vocabularies/format/format.d.ts +8 -0
  195. package/.output/server/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
  196. package/.output/server/node_modules/ajv/dist/vocabularies/format/index.d.ts +3 -0
  197. package/.output/server/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
  198. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.d.ts +6 -0
  199. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.js +71 -0
  200. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/discriminator.js.map +1 -0
  201. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.d.ts +5 -0
  202. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.js +24 -0
  203. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/elements.js.map +1 -0
  204. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.d.ts +6 -0
  205. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.js +43 -0
  206. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/enum.js.map +1 -0
  207. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.d.ts +9 -0
  208. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.js +20 -0
  209. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/error.js.map +1 -0
  210. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.d.ts +10 -0
  211. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.js +29 -0
  212. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/index.js.map +1 -0
  213. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.d.ts +5 -0
  214. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.js +25 -0
  215. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/metadata.js.map +1 -0
  216. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.d.ts +4 -0
  217. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.js +22 -0
  218. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/nullable.js.map +1 -0
  219. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.d.ts +3 -0
  220. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js +15 -0
  221. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/optionalProperties.js.map +1 -0
  222. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.d.ts +22 -0
  223. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.js +149 -0
  224. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/properties.js.map +1 -0
  225. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.d.ts +4 -0
  226. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.js +67 -0
  227. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/ref.js.map +1 -0
  228. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.d.ts +10 -0
  229. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.js +69 -0
  230. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/type.js.map +1 -0
  231. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.d.ts +3 -0
  232. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.js +12 -0
  233. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/union.js.map +1 -0
  234. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.d.ts +5 -0
  235. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.js +51 -0
  236. package/.output/server/node_modules/ajv/dist/vocabularies/jtd/values.js.map +1 -0
  237. package/.output/server/node_modules/ajv/dist/vocabularies/metadata.d.ts +3 -0
  238. package/.output/server/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
  239. package/.output/server/node_modules/ajv/dist/vocabularies/next.d.ts +3 -0
  240. package/.output/server/node_modules/ajv/dist/vocabularies/next.js.map +1 -0
  241. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/index.d.ts +3 -0
  242. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/index.js.map +1 -0
  243. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.d.ts +6 -0
  244. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedItems.js.map +1 -0
  245. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.d.ts +6 -0
  246. package/.output/server/node_modules/ajv/dist/vocabularies/unevaluated/unevaluatedProperties.js.map +1 -0
  247. package/.output/server/node_modules/ajv/dist/vocabularies/validation/const.d.ts +6 -0
  248. package/.output/server/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
  249. package/.output/server/node_modules/ajv/dist/vocabularies/validation/dependentRequired.d.ts +5 -0
  250. package/.output/server/node_modules/ajv/dist/vocabularies/validation/dependentRequired.js.map +1 -0
  251. package/.output/server/node_modules/ajv/dist/vocabularies/validation/enum.d.ts +8 -0
  252. package/.output/server/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
  253. package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.d.ts +16 -0
  254. package/.output/server/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
  255. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitContains.d.ts +3 -0
  256. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitContains.js.map +1 -0
  257. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitItems.d.ts +3 -0
  258. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
  259. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitLength.d.ts +3 -0
  260. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
  261. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitNumber.d.ts +11 -0
  262. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
  263. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitProperties.d.ts +3 -0
  264. package/.output/server/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
  265. package/.output/server/node_modules/ajv/dist/vocabularies/validation/multipleOf.d.ts +8 -0
  266. package/.output/server/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
  267. package/.output/server/node_modules/ajv/dist/vocabularies/validation/pattern.d.ts +8 -0
  268. package/.output/server/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
  269. package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.d.ts +8 -0
  270. package/.output/server/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
  271. package/.output/server/node_modules/ajv/dist/vocabularies/validation/uniqueItems.d.ts +9 -0
  272. package/.output/server/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
  273. package/.output/server/node_modules/ajv/lib/2019.ts +81 -0
  274. package/.output/server/node_modules/ajv/lib/2020.ts +75 -0
  275. package/.output/server/node_modules/ajv/lib/ajv.ts +70 -0
  276. package/.output/server/node_modules/ajv/lib/compile/codegen/code.ts +169 -0
  277. package/.output/server/node_modules/ajv/lib/compile/codegen/index.ts +852 -0
  278. package/.output/server/node_modules/ajv/lib/compile/codegen/scope.ts +215 -0
  279. package/.output/server/node_modules/ajv/lib/compile/errors.ts +184 -0
  280. package/.output/server/node_modules/ajv/lib/compile/index.ts +324 -0
  281. package/.output/server/node_modules/ajv/lib/compile/jtd/parse.ts +411 -0
  282. package/.output/server/node_modules/ajv/lib/compile/jtd/serialize.ts +266 -0
  283. package/.output/server/node_modules/ajv/lib/compile/jtd/types.ts +16 -0
  284. package/.output/server/node_modules/ajv/lib/compile/names.ts +27 -0
  285. package/.output/server/node_modules/ajv/lib/compile/ref_error.ts +13 -0
  286. package/.output/server/node_modules/ajv/lib/compile/resolve.ts +149 -0
  287. package/.output/server/node_modules/ajv/lib/compile/rules.ts +50 -0
  288. package/.output/server/node_modules/ajv/lib/compile/util.ts +213 -0
  289. package/.output/server/node_modules/ajv/lib/compile/validate/applicability.ts +22 -0
  290. package/.output/server/node_modules/ajv/lib/compile/validate/boolSchema.ts +47 -0
  291. package/.output/server/node_modules/ajv/lib/compile/validate/dataType.ts +230 -0
  292. package/.output/server/node_modules/ajv/lib/compile/validate/defaults.ts +32 -0
  293. package/.output/server/node_modules/ajv/lib/compile/validate/index.ts +582 -0
  294. package/.output/server/node_modules/ajv/lib/compile/validate/keyword.ts +171 -0
  295. package/.output/server/node_modules/ajv/lib/compile/validate/subschema.ts +135 -0
  296. package/.output/server/node_modules/ajv/lib/core.ts +891 -0
  297. package/.output/server/node_modules/ajv/lib/jtd.ts +132 -0
  298. package/.output/server/node_modules/ajv/lib/refs/data.json +13 -0
  299. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/index.ts +28 -0
  300. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/applicator.json +53 -0
  301. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/content.json +17 -0
  302. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/core.json +57 -0
  303. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/format.json +14 -0
  304. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/meta-data.json +37 -0
  305. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/meta/validation.json +90 -0
  306. package/.output/server/node_modules/ajv/lib/refs/json-schema-2019-09/schema.json +39 -0
  307. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/index.ts +30 -0
  308. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/applicator.json +48 -0
  309. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/content.json +17 -0
  310. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/core.json +51 -0
  311. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/format-annotation.json +14 -0
  312. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/meta-data.json +37 -0
  313. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/unevaluated.json +15 -0
  314. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/meta/validation.json +90 -0
  315. package/.output/server/node_modules/ajv/lib/refs/json-schema-2020-12/schema.json +55 -0
  316. package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-06.json +137 -0
  317. package/.output/server/node_modules/ajv/lib/refs/json-schema-draft-07.json +151 -0
  318. package/.output/server/node_modules/ajv/lib/refs/json-schema-secure.json +88 -0
  319. package/.output/server/node_modules/ajv/lib/refs/jtd-schema.ts +130 -0
  320. package/.output/server/node_modules/ajv/lib/runtime/equal.ts +7 -0
  321. package/.output/server/node_modules/ajv/lib/runtime/parseJson.ts +177 -0
  322. package/.output/server/node_modules/ajv/lib/runtime/quote.ts +31 -0
  323. package/.output/server/node_modules/ajv/lib/runtime/re2.ts +6 -0
  324. package/.output/server/node_modules/ajv/lib/runtime/timestamp.ts +46 -0
  325. package/.output/server/node_modules/ajv/lib/runtime/ucs2length.ts +20 -0
  326. package/.output/server/node_modules/ajv/lib/runtime/uri.ts +6 -0
  327. package/.output/server/node_modules/ajv/lib/runtime/validation_error.ts +13 -0
  328. package/.output/server/node_modules/ajv/lib/standalone/index.ts +100 -0
  329. package/.output/server/node_modules/ajv/lib/standalone/instance.ts +36 -0
  330. package/.output/server/node_modules/ajv/lib/types/index.ts +244 -0
  331. package/.output/server/node_modules/ajv/lib/types/json-schema.ts +187 -0
  332. package/.output/server/node_modules/ajv/lib/types/jtd-schema.ts +273 -0
  333. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalItems.ts +56 -0
  334. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/additionalProperties.ts +118 -0
  335. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/allOf.ts +22 -0
  336. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/anyOf.ts +14 -0
  337. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/contains.ts +109 -0
  338. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/dependencies.ts +112 -0
  339. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/dependentSchemas.ts +11 -0
  340. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/if.ts +80 -0
  341. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/index.ts +53 -0
  342. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/items.ts +59 -0
  343. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/items2020.ts +36 -0
  344. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/not.ts +38 -0
  345. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/oneOf.ts +82 -0
  346. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/patternProperties.ts +91 -0
  347. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/prefixItems.ts +12 -0
  348. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/properties.ts +57 -0
  349. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/propertyNames.ts +50 -0
  350. package/.output/server/node_modules/ajv/lib/vocabularies/applicator/thenElse.ts +13 -0
  351. package/.output/server/node_modules/ajv/lib/vocabularies/code.ts +168 -0
  352. package/.output/server/node_modules/ajv/lib/vocabularies/core/id.ts +10 -0
  353. package/.output/server/node_modules/ajv/lib/vocabularies/core/index.ts +16 -0
  354. package/.output/server/node_modules/ajv/lib/vocabularies/core/ref.ts +129 -0
  355. package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/index.ts +113 -0
  356. package/.output/server/node_modules/ajv/lib/vocabularies/discriminator/types.ts +12 -0
  357. package/.output/server/node_modules/ajv/lib/vocabularies/draft2020.ts +23 -0
  358. package/.output/server/node_modules/ajv/lib/vocabularies/draft7.ts +17 -0
  359. package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/dynamicAnchor.ts +31 -0
  360. package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/dynamicRef.ts +51 -0
  361. package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/index.ts +9 -0
  362. package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/recursiveAnchor.ts +14 -0
  363. package/.output/server/node_modules/ajv/lib/vocabularies/dynamic/recursiveRef.ts +10 -0
  364. package/.output/server/node_modules/ajv/lib/vocabularies/errors.ts +18 -0
  365. package/.output/server/node_modules/ajv/lib/vocabularies/format/format.ts +120 -0
  366. package/.output/server/node_modules/ajv/lib/vocabularies/format/index.ts +6 -0
  367. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/discriminator.ts +89 -0
  368. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/elements.ts +32 -0
  369. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/enum.ts +45 -0
  370. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/error.ts +23 -0
  371. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/index.ts +37 -0
  372. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/metadata.ts +24 -0
  373. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/nullable.ts +21 -0
  374. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/optionalProperties.ts +15 -0
  375. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/properties.ts +184 -0
  376. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/ref.ts +76 -0
  377. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/type.ts +75 -0
  378. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/union.ts +12 -0
  379. package/.output/server/node_modules/ajv/lib/vocabularies/jtd/values.ts +58 -0
  380. package/.output/server/node_modules/ajv/lib/vocabularies/metadata.ts +17 -0
  381. package/.output/server/node_modules/ajv/lib/vocabularies/next.ts +8 -0
  382. package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/index.ts +7 -0
  383. package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedItems.ts +47 -0
  384. package/.output/server/node_modules/ajv/lib/vocabularies/unevaluated/unevaluatedProperties.ts +85 -0
  385. package/.output/server/node_modules/ajv/lib/vocabularies/validation/const.ts +28 -0
  386. package/.output/server/node_modules/ajv/lib/vocabularies/validation/dependentRequired.ts +23 -0
  387. package/.output/server/node_modules/ajv/lib/vocabularies/validation/enum.ts +54 -0
  388. package/.output/server/node_modules/ajv/lib/vocabularies/validation/index.ts +49 -0
  389. package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitContains.ts +16 -0
  390. package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitItems.ts +26 -0
  391. package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitLength.ts +30 -0
  392. package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitNumber.ts +42 -0
  393. package/.output/server/node_modules/ajv/lib/vocabularies/validation/limitProperties.ts +26 -0
  394. package/.output/server/node_modules/ajv/lib/vocabularies/validation/multipleOf.ts +34 -0
  395. package/.output/server/node_modules/ajv/lib/vocabularies/validation/pattern.ts +28 -0
  396. package/.output/server/node_modules/ajv/lib/vocabularies/validation/required.ts +98 -0
  397. package/.output/server/node_modules/ajv/lib/vocabularies/validation/uniqueItems.ts +79 -0
  398. package/.output/server/node_modules/ajv/package.json +1 -1
  399. package/.output/server/node_modules/oas/dist/{chunk-SH63AK3O.js → chunk-5EP6HY2E.js} +159 -70
  400. package/.output/server/node_modules/oas/dist/{chunk-L3V5TF63.js → chunk-7MARUOFZ.js} +1 -9
  401. package/.output/server/node_modules/oas/dist/{chunk-BOVZLW7Q.js → chunk-HGVFNEKW.js} +517 -126
  402. package/.output/server/node_modules/oas/dist/{chunk-JMLIY2LK.js → chunk-LSH3X5NA.js} +124 -191
  403. package/.output/server/node_modules/oas/dist/{chunk-TTCGKV5E.js → chunk-S27IGTVG.js} +4 -1
  404. package/.output/server/node_modules/oas/dist/chunk-VA3NKXX7.js +9 -0
  405. package/.output/server/node_modules/oas/dist/index.js +6 -6
  406. package/.output/server/node_modules/oas/dist/types.js +1 -5
  407. package/.output/server/node_modules/oas/dist/utils.js +6 -6
  408. package/.output/server/node_modules/oas/package.json +8 -6
  409. package/.output/server/node_modules/oas-normalize/package.json +5 -5
  410. package/.output/server/package.json +7 -7
  411. package/package.json +16 -16
  412. package/.output/server/node_modules/oas/dist/chunk-LV26LN7C.js +0 -27
@@ -1,15 +1,18 @@
1
1
  import {
2
2
  Operation,
3
- Webhook
4
- } from "./chunk-BOVZLW7Q.js";
3
+ Webhook,
4
+ buildDiscriminatorOneOf,
5
+ findDiscriminatorChildren
6
+ } from "./chunk-HGVFNEKW.js";
5
7
  import {
6
- findSchemaDefinition,
8
+ SERVER_VARIABLE_REGEX,
7
9
  supportedMethods
8
- } from "./chunk-LV26LN7C.js";
10
+ } from "./chunk-VA3NKXX7.js";
9
11
  import {
10
- cloneObject,
12
+ dereferenceRef,
13
+ getDereferencingOptions,
11
14
  isPrimitive
12
- } from "./chunk-SH63AK3O.js";
15
+ } from "./chunk-5EP6HY2E.js";
13
16
  import {
14
17
  CODE_SAMPLES,
15
18
  HEADERS,
@@ -20,107 +23,14 @@ import {
20
23
  getExtension,
21
24
  hasRootExtension,
22
25
  validateParameterOrdering
23
- } from "./chunk-TTCGKV5E.js";
26
+ } from "./chunk-S27IGTVG.js";
24
27
  import {
28
+ isOpenAPI31,
25
29
  isRef
26
- } from "./chunk-L3V5TF63.js";
30
+ } from "./chunk-7MARUOFZ.js";
27
31
 
28
32
  // src/index.ts
29
33
  import { dereference } from "@readme/openapi-parser";
30
- import { match, pathToRegexp } from "path-to-regexp";
31
-
32
- // src/lib/build-discriminator-one-of.ts
33
- function hasDiscriminatorWithoutPolymorphism(schema) {
34
- if (!schema || typeof schema !== "object") return false;
35
- if (!("discriminator" in schema)) return false;
36
- if ("oneOf" in schema || "anyOf" in schema) return false;
37
- return true;
38
- }
39
- function allOfReferencesSchema(schema, targetSchemaName) {
40
- if (!schema || typeof schema !== "object") return false;
41
- if (!("allOf" in schema) || !Array.isArray(schema.allOf)) return false;
42
- return schema.allOf.some((item) => {
43
- if (isRef(item)) {
44
- const refParts = item.$ref.split("/");
45
- const refSchemaName = refParts[refParts.length - 1];
46
- return refSchemaName === targetSchemaName;
47
- }
48
- return false;
49
- });
50
- }
51
- function findDiscriminatorChildren(api) {
52
- const childrenMap = /* @__PURE__ */ new Map();
53
- if (!api?.components?.schemas || typeof api.components.schemas !== "object") {
54
- return childrenMap;
55
- }
56
- const schemas = api.components.schemas;
57
- const schemaNames = Object.keys(schemas);
58
- const discriminatorSchemas = schemaNames.filter((name) => {
59
- return hasDiscriminatorWithoutPolymorphism(schemas[name]);
60
- });
61
- for (const baseName of discriminatorSchemas) {
62
- const baseSchema = schemas[baseName];
63
- const discriminator = baseSchema.discriminator;
64
- let childSchemaNames;
65
- if (discriminator.mapping && typeof discriminator.mapping === "object") {
66
- const mappingRefs = Object.values(discriminator.mapping);
67
- if (mappingRefs.length > 0) {
68
- childSchemaNames = mappingRefs.map((ref) => {
69
- const parts = ref.split("/");
70
- return parts[parts.length - 1];
71
- });
72
- }
73
- }
74
- if (!childSchemaNames || childSchemaNames.length === 0) {
75
- childSchemaNames = schemaNames.filter((name) => {
76
- if (name === baseName) return false;
77
- return allOfReferencesSchema(schemas[name], baseName);
78
- });
79
- }
80
- if (childSchemaNames.length > 0) {
81
- childrenMap.set(baseName, childSchemaNames);
82
- }
83
- }
84
- return childrenMap;
85
- }
86
- function buildDiscriminatorOneOf(api, childrenMap) {
87
- if (!api?.components?.schemas || typeof api.components.schemas !== "object") {
88
- return;
89
- }
90
- if (childrenMap.size === 0) {
91
- return;
92
- }
93
- const schemas = api.components.schemas;
94
- for (const [schemaName, childNames] of childrenMap) {
95
- const schema = schemas[schemaName];
96
- if (!schema) continue;
97
- const oneOf = [];
98
- for (const childName of childNames) {
99
- if (schemas[childName]) {
100
- oneOf.push(cloneObject(schemas[childName]));
101
- }
102
- }
103
- if (oneOf.length > 0) {
104
- schema.oneOf = oneOf;
105
- }
106
- }
107
- for (const [parentSchemaName, childNames] of childrenMap) {
108
- for (const childName of childNames) {
109
- const childSchema = schemas[childName];
110
- if (!childSchema || !("allOf" in childSchema) || !Array.isArray(childSchema.allOf)) {
111
- continue;
112
- }
113
- for (let i = 0; i < childSchema.allOf.length; i++) {
114
- const item = childSchema.allOf[i];
115
- if (item && typeof item === "object" && "x-readme-ref-name" in item && item["x-readme-ref-name"] === parentSchemaName && "oneOf" in item) {
116
- const clonedItem = cloneObject(item);
117
- delete clonedItem.oneOf;
118
- childSchema.allOf[i] = clonedItem;
119
- }
120
- }
121
- }
122
- }
123
- }
124
34
 
125
35
  // src/lib/get-auth.ts
126
36
  function getKey(user, scheme) {
@@ -143,10 +53,11 @@ function getKey(user, scheme) {
143
53
  function getByScheme(user, scheme = {}, selectedApp) {
144
54
  if (user?.keys?.length) {
145
55
  if (selectedApp) {
146
- return getKey(
147
- user.keys.find((key) => key.name === selectedApp),
148
- scheme
149
- );
56
+ const userKey = user.keys.find((k) => k.name === selectedApp);
57
+ if (!userKey) {
58
+ return null;
59
+ }
60
+ return getKey(userKey, scheme);
150
61
  }
151
62
  return getKey(user.keys[0], scheme);
152
63
  }
@@ -154,19 +65,21 @@ function getByScheme(user, scheme = {}, selectedApp) {
154
65
  }
155
66
  function getAuth(api, user, selectedApp) {
156
67
  return Object.keys(api?.components?.securitySchemes || {}).map((scheme) => {
68
+ const securityScheme = dereferenceRef(api.components?.securitySchemes?.[scheme], api);
69
+ if (!securityScheme || isRef(securityScheme)) {
70
+ return false;
71
+ }
157
72
  return {
158
73
  [scheme]: getByScheme(
159
74
  user,
160
75
  {
161
- // This sucks but since we dereference we'll never have a `$ref` pointer here with a
162
- // `ReferenceObject` type.
163
- ...api.components.securitySchemes[scheme],
76
+ ...securityScheme,
164
77
  _key: scheme
165
78
  },
166
79
  selectedApp
167
80
  )
168
81
  };
169
- }).reduce((prev, next) => Object.assign(prev, next), {});
82
+ }).filter((item) => item !== void 0).reduce((prev, next) => Object.assign(prev, next), {});
170
83
  }
171
84
 
172
85
  // src/lib/get-user-variable.ts
@@ -179,11 +92,17 @@ function getUserVariable(user, property, selectedApp) {
179
92
  key = user.keys[0];
180
93
  }
181
94
  }
182
- return key[property] || user[property] || null;
95
+ return key?.[property] || user[property] || null;
183
96
  }
184
97
 
185
- // src/index.ts
186
- var SERVER_VARIABLE_REGEX = /{([-_a-zA-Z0-9:.[\]]+)}/g;
98
+ // src/lib/urls.ts
99
+ import { match, pathToRegexp } from "path-to-regexp";
100
+ function stripTrailingSlash(url) {
101
+ if (url[url.length - 1] === "/") {
102
+ return url.slice(0, -1);
103
+ }
104
+ return url;
105
+ }
187
106
  function ensureProtocol(url) {
188
107
  if (url.match(/^\/\//)) {
189
108
  return `https:${url}`;
@@ -193,17 +112,11 @@ function ensureProtocol(url) {
193
112
  }
194
113
  return url;
195
114
  }
196
- function stripTrailingSlash(url) {
197
- if (url[url.length - 1] === "/") {
198
- return url.slice(0, -1);
199
- }
200
- return url;
201
- }
202
- function normalizedUrl(api, selected) {
115
+ function normalizedURL(api, selected) {
203
116
  const exampleDotCom = "https://example.com";
204
117
  let url;
205
118
  try {
206
- url = api.servers[selected].url;
119
+ url = api.servers?.[selected].url;
207
120
  if (!url) throw new Error("no url");
208
121
  url = stripTrailingSlash(url);
209
122
  if (url.startsWith("/") && !url.startsWith("//")) {
@@ -216,7 +129,7 @@ function normalizedUrl(api, selected) {
216
129
  }
217
130
  return ensureProtocol(url);
218
131
  }
219
- function transformUrlIntoRegex(url) {
132
+ function transformURLIntoRegex(url) {
220
133
  return stripTrailingSlash(url.replace(SERVER_VARIABLE_REGEX, "([-_a-zA-Z0-9:.[\\]]+)"));
221
134
  }
222
135
  function normalizePath(path) {
@@ -226,7 +139,7 @@ function normalizePath(path) {
226
139
  }
227
140
  function generatePathMatches(paths, pathName, origin) {
228
141
  const prunedPathName = pathName.split("?")[0];
229
- return Object.keys(paths).map((path) => {
142
+ const matches = Object.keys(paths).map((path) => {
230
143
  const cleanedPath = normalizePath(path);
231
144
  let matchResult;
232
145
  try {
@@ -251,7 +164,8 @@ function generatePathMatches(paths, pathName, origin) {
251
164
  operation: paths[path],
252
165
  match: matchResult
253
166
  };
254
- }).filter(Boolean).filter((p) => p.match);
167
+ }).filter((item) => item !== false);
168
+ return matches.filter((p) => p.match);
255
169
  }
256
170
  function filterPathMethods(pathMatches, targetMethod) {
257
171
  const regExp = pathToRegexp(targetMethod);
@@ -266,21 +180,26 @@ function filterPathMethods(pathMatches, targetMethod) {
266
180
  };
267
181
  }
268
182
  return false;
269
- }).filter(Boolean);
183
+ }).filter((item) => Boolean(item));
270
184
  }
271
185
  function findTargetPath(pathMatches) {
186
+ if (!pathMatches.length) {
187
+ return void 0;
188
+ }
272
189
  let minCount = Object.keys(pathMatches[0].url.slugs).length;
273
- let operation;
190
+ let found;
274
191
  for (let m = 0; m < pathMatches.length; m += 1) {
275
192
  const selection = pathMatches[m];
276
193
  const paramCount = Object.keys(selection.url.slugs).length;
277
194
  if (paramCount <= minCount) {
278
195
  minCount = paramCount;
279
- operation = selection;
196
+ found = selection;
280
197
  }
281
198
  }
282
- return operation;
199
+ return found;
283
200
  }
201
+
202
+ // src/index.ts
284
203
  var Oas = class _Oas {
285
204
  /**
286
205
  * An OpenAPI API Definition.
@@ -349,18 +268,11 @@ var Oas = class _Oas {
349
268
  return this.api;
350
269
  }
351
270
  url(selected = 0, variables) {
352
- const url = normalizedUrl(this.api, selected);
271
+ const url = normalizedURL(this.api, selected);
353
272
  return this.replaceUrl(url, variables || this.defaultVariables(selected)).trim();
354
273
  }
355
274
  variables(selected = 0) {
356
- let variables;
357
- try {
358
- variables = this.api.servers[selected].variables;
359
- if (!variables) throw new Error("no variables");
360
- } catch {
361
- variables = {};
362
- }
363
- return variables;
275
+ return this.api.servers?.[selected]?.variables || {};
364
276
  }
365
277
  defaultVariables(selected = 0) {
366
278
  const variables = this.variables(selected);
@@ -371,7 +283,7 @@ var Oas = class _Oas {
371
283
  return defaults;
372
284
  }
373
285
  splitUrl(selected = 0) {
374
- const url = normalizedUrl(this.api, selected);
286
+ const url = normalizedURL(this.api, selected);
375
287
  const variables = this.variables(selected);
376
288
  return url.split(/({.+?})/).filter(Boolean).map((part, i) => {
377
289
  const isVariable = part.match(/[{}]/);
@@ -410,7 +322,7 @@ var Oas = class _Oas {
410
322
  */
411
323
  splitVariables(baseUrl) {
412
324
  const matchedServer = (this.api.servers || []).map((server, i) => {
413
- const rgx = transformUrlIntoRegex(server.url);
325
+ const rgx = transformURLIntoRegex(server.url);
414
326
  const found = new RegExp(rgx).exec(baseUrl);
415
327
  if (!found) {
416
328
  return false;
@@ -423,7 +335,7 @@ var Oas = class _Oas {
423
335
  selected: i,
424
336
  variables
425
337
  };
426
- }).filter(Boolean);
338
+ }).filter((item) => item !== false);
427
339
  return matchedServer.length ? matchedServer[0] : false;
428
340
  }
429
341
  /**
@@ -452,15 +364,15 @@ var Oas = class _Oas {
452
364
  const data = variables[key];
453
365
  if (typeof data === "object") {
454
366
  if (!Array.isArray(data) && data !== null && "default" in data) {
455
- return data.default;
367
+ return String(data.default);
456
368
  }
457
369
  } else {
458
- return data;
370
+ return String(data);
459
371
  }
460
372
  }
461
373
  const userVariable = getUserVariable(this.user, key);
462
374
  if (userVariable) {
463
- return userVariable;
375
+ return String(userVariable);
464
376
  }
465
377
  return original;
466
378
  })
@@ -477,14 +389,21 @@ var Oas = class _Oas {
477
389
  parameters: []
478
390
  };
479
391
  if (opts.isWebhook) {
480
- const api = this.api;
481
- if (api?.webhooks[path]?.[method]) {
482
- operation = api.webhooks[path][method];
483
- return new Webhook(api, path, method, operation);
392
+ if (isOpenAPI31(this.api)) {
393
+ const webhookPath = dereferenceRef(this.api?.webhooks?.[path], this.api);
394
+ if (webhookPath && !isRef(webhookPath)) {
395
+ if (webhookPath?.[method]) {
396
+ operation = webhookPath[method];
397
+ return new Webhook(this.api, path, method, operation);
398
+ }
399
+ }
484
400
  }
485
401
  }
486
- if (this?.api?.paths?.[path]?.[method]) {
487
- operation = this.api.paths[path][method];
402
+ if (this?.api?.paths?.[path]) {
403
+ const pathItem = dereferenceRef(this.api.paths[path], this.api);
404
+ if (pathItem?.[method]) {
405
+ operation = dereferenceRef(pathItem[method], this.api);
406
+ }
488
407
  }
489
408
  return new Operation(this.api, path, method, operation);
490
409
  }
@@ -514,8 +433,8 @@ var Oas = class _Oas {
514
433
  [, pathName] = url.split(new RegExp(targetServer.url, "i"));
515
434
  }
516
435
  if (!matchedServer || !pathName) {
517
- const matchedServerAndPath = servers.map((server) => {
518
- const rgx = transformUrlIntoRegex(server.url);
436
+ const matchedServerAndPath = (servers || []).map((server) => {
437
+ const rgx = transformURLIntoRegex(server.url);
519
438
  const found = new RegExp(rgx).exec(url);
520
439
  if (!found) {
521
440
  return void 0;
@@ -524,7 +443,7 @@ var Oas = class _Oas {
524
443
  matchedServer: server,
525
444
  pathName: url.split(new RegExp(rgx)).slice(-1).pop()
526
445
  };
527
- }).filter(Boolean);
446
+ }).filter((item) => item !== void 0);
528
447
  if (!matchedServerAndPath.length) {
529
448
  return void 0;
530
449
  }
@@ -535,6 +454,7 @@ var Oas = class _Oas {
535
454
  }
536
455
  if (pathName === void 0) return void 0;
537
456
  if (pathName === "") pathName = "/";
457
+ if (!paths || !targetServer) return void 0;
538
458
  const annotatedPaths = generatePathMatches(paths, pathName, targetServer.url);
539
459
  if (!annotatedPaths.length) return void 0;
540
460
  return annotatedPaths;
@@ -634,16 +554,24 @@ var Oas = class _Oas {
634
554
  */
635
555
  getPaths() {
636
556
  const paths = {};
637
- Object.keys(this.api.paths ? this.api.paths : []).forEach((path) => {
557
+ if (!this.api.paths) {
558
+ return paths;
559
+ }
560
+ Object.keys(this.api.paths).forEach((path) => {
638
561
  if (path.startsWith("x-")) {
639
562
  return;
640
563
  }
641
564
  paths[path] = {};
642
- if ("$ref" in this.api.paths[path]) {
643
- this.api.paths[path] = findSchemaDefinition(this.api.paths[path].$ref, this.api);
565
+ const pathItem = this.api.paths[path];
566
+ if (!pathItem) {
567
+ return;
568
+ } else if (isRef(pathItem)) {
569
+ this.api.paths[path] = dereferenceRef(pathItem, this.api);
644
570
  }
645
- Object.keys(this.api.paths[path]).forEach((method) => {
646
- if (!supportedMethods.includes(method)) return;
571
+ Object.keys(pathItem).forEach((method) => {
572
+ if (!supportedMethods.includes(method)) {
573
+ return;
574
+ }
647
575
  paths[path][method] = this.operation(path, method);
648
576
  });
649
577
  });
@@ -658,18 +586,31 @@ var Oas = class _Oas {
658
586
  */
659
587
  getWebhooks() {
660
588
  const webhooks = {};
661
- const api = this.api;
662
- Object.keys(api.webhooks ? api.webhooks : []).forEach((id) => {
589
+ if (!isOpenAPI31(this.api) || !this.api.webhooks) {
590
+ return webhooks;
591
+ }
592
+ Object.keys(this.api.webhooks).forEach((id) => {
663
593
  webhooks[id] = {};
664
- Object.keys(api.webhooks[id]).forEach((method) => {
665
- webhooks[id][method] = this.operation(id, method, { isWebhook: true });
666
- });
594
+ const webhookPath = dereferenceRef(this.api.webhooks?.[id], this.api);
595
+ if (webhookPath) {
596
+ Object.keys(webhookPath).forEach((method) => {
597
+ if (!supportedMethods.includes(method)) {
598
+ return;
599
+ }
600
+ webhooks[id][method] = this.operation(id, method, {
601
+ isWebhook: true
602
+ });
603
+ });
604
+ }
667
605
  });
668
606
  return webhooks;
669
607
  }
670
608
  /**
671
609
  * Return an array of all tag names that exist on this API definition.
672
610
  *
611
+ * If the API definition uses the `x-disable-tag-sorting` extension then tags will be returned in
612
+ * the order they're defined.
613
+ *
673
614
  * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#openapi-object}
674
615
  * @see {@link https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#openapi-object}
675
616
  * @param setIfMissing If a tag is not present on an operation that operations path will be added
@@ -677,9 +618,7 @@ var Oas = class _Oas {
677
618
  */
678
619
  getTags(setIfMissing = false) {
679
620
  const allTags = /* @__PURE__ */ new Set();
680
- const oasTags = this.api.tags?.map((tag) => {
681
- return tag.name;
682
- }) || [];
621
+ const oasTags = this.api.tags?.map((tag) => tag.name) || [];
683
622
  const disableTagSorting = getExtension("disable-tag-sorting", this.api);
684
623
  Object.entries(this.getPaths()).forEach(([path, operations]) => {
685
624
  Object.values(operations).forEach((operation) => {
@@ -760,11 +699,13 @@ var Oas = class _Oas {
760
699
  }
761
700
  if (extension in data) {
762
701
  if ([CODE_SAMPLES, HEADERS, PARAMETER_ORDERING, SAMPLES_LANGUAGES].includes(extension)) {
763
- if (!Array.isArray(data[extension])) {
764
- throw new TypeError(`"x-readme.${extension}" must be of type "Array"`);
765
- }
766
- if (extension === PARAMETER_ORDERING) {
767
- validateParameterOrdering(data[extension], `x-readme.${extension}`);
702
+ if (data[extension] !== void 0) {
703
+ if (!Array.isArray(data[extension])) {
704
+ throw new TypeError(`"x-readme.${extension}" must be of type "Array"`);
705
+ }
706
+ if (extension === PARAMETER_ORDERING) {
707
+ validateParameterOrdering(data[extension], `x-readme.${extension}`);
708
+ }
768
709
  }
769
710
  } else if (extension === OAUTH_OPTIONS) {
770
711
  if (typeof data[extension] !== "object") {
@@ -814,7 +755,7 @@ var Oas = class _Oas {
814
755
  */
815
756
  getCircularReferences() {
816
757
  if (!this.dereferencing.complete) {
817
- throw new Error("#dereference() must be called first in order for this method to obtain circular references.");
758
+ throw new Error(".dereference() must be called first in order for this method to obtain circular references.");
818
759
  }
819
760
  return this.dereferencing.circularRefs;
820
761
  }
@@ -835,36 +776,24 @@ var Oas = class _Oas {
835
776
  });
836
777
  }
837
778
  this.dereferencing.processing = true;
838
- const discriminatorChildrenMap = findDiscriminatorChildren(this.api);
779
+ const { children: discriminatorChildrenMap } = findDiscriminatorChildren(this.api);
839
780
  const { api, promises } = this;
840
781
  if (api?.components?.schemas && typeof api.components.schemas === "object") {
841
782
  Object.keys(api.components.schemas).forEach((schemaName) => {
842
- if (isPrimitive(api.components.schemas[schemaName]) || Array.isArray(api.components.schemas[schemaName]) || api.components.schemas[schemaName] === null) {
783
+ if (isPrimitive(api.components?.schemas?.[schemaName]) || Array.isArray(api.components?.schemas?.[schemaName]) || api.components?.schemas?.[schemaName] === null) {
843
784
  return;
844
785
  }
845
786
  if (opts.preserveRefAsJSONSchemaTitle) {
846
- api.components.schemas[schemaName].title = schemaName;
787
+ (api.components?.schemas?.[schemaName]).title = schemaName;
847
788
  }
848
- api.components.schemas[schemaName]["x-readme-ref-name"] = schemaName;
789
+ (api.components?.schemas?.[schemaName])["x-readme-ref-name"] = schemaName;
849
790
  });
850
791
  }
851
792
  const circularRefs = /* @__PURE__ */ new Set();
852
- return dereference(api, {
853
- resolve: {
854
- // We shouldn't be resolving external pointers at this point so just ignore them.
855
- external: false
856
- },
857
- dereference: {
858
- // If circular `$refs` are ignored they'll remain in the OAS as `$ref: String`, otherwise
859
- // `$ref‘ just won't exist. This allows us to do easy circular reference detection.
860
- circular: "ignore",
861
- onCircular: (path) => {
862
- circularRefs.add(`#${path.split("#")[1]}`);
863
- }
864
- }
865
- }).then((dereferenced) => {
793
+ const dereferencingOptions = getDereferencingOptions(circularRefs);
794
+ return dereference(api, dereferencingOptions).then((dereferenced) => {
866
795
  this.api = dereferenced;
867
- if (discriminatorChildrenMap && discriminatorChildrenMap.size > 0) {
796
+ if (this.api?.components?.schemas && discriminatorChildrenMap.size > 0) {
868
797
  buildDiscriminatorOneOf(this.api, discriminatorChildrenMap);
869
798
  }
870
799
  this.promises = promises;
@@ -879,6 +808,10 @@ var Oas = class _Oas {
879
808
  }
880
809
  }).then(() => {
881
810
  return this.promises.map((deferred) => deferred.resolve());
811
+ }).catch((err) => {
812
+ this.dereferencing.processing = false;
813
+ this.promises.map((deferred) => deferred.reject(err));
814
+ throw err;
882
815
  });
883
816
  }
884
817
  };
@@ -886,4 +819,4 @@ var Oas = class _Oas {
886
819
  export {
887
820
  Oas
888
821
  };
889
- //# sourceMappingURL=chunk-JMLIY2LK.js.map
822
+ //# sourceMappingURL=chunk-LSH3X5NA.js.map
@@ -60,6 +60,9 @@ function getExtension(extension, api, operation) {
60
60
  return void 0;
61
61
  }
62
62
  function validateParameterOrdering(ordering, extension) {
63
+ if (!ordering) {
64
+ return;
65
+ }
63
66
  const defaultValue = extensionDefaults[PARAMETER_ORDERING];
64
67
  const requiredLength = defaultValue.length;
65
68
  const defaultsHuman = `${defaultValue.slice(0, -1).join(", ")}, and ${defaultValue.slice(-1)}`;
@@ -89,4 +92,4 @@ export {
89
92
  getExtension,
90
93
  validateParameterOrdering
91
94
  };
92
- //# sourceMappingURL=chunk-TTCGKV5E.js.map
95
+ //# sourceMappingURL=chunk-S27IGTVG.js.map
@@ -0,0 +1,9 @@
1
+ // src/utils.ts
2
+ var supportedMethods = ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
3
+ var SERVER_VARIABLE_REGEX = /{([-_a-zA-Z0-9:.[\]]+)}/g;
4
+
5
+ export {
6
+ supportedMethods,
7
+ SERVER_VARIABLE_REGEX
8
+ };
9
+ //# sourceMappingURL=chunk-VA3NKXX7.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  Oas
3
- } from "./chunk-JMLIY2LK.js";
4
- import "./chunk-BOVZLW7Q.js";
5
- import "./chunk-LV26LN7C.js";
6
- import "./chunk-SH63AK3O.js";
7
- import "./chunk-TTCGKV5E.js";
8
- import "./chunk-L3V5TF63.js";
3
+ } from "./chunk-LSH3X5NA.js";
4
+ import "./chunk-HGVFNEKW.js";
5
+ import "./chunk-VA3NKXX7.js";
6
+ import "./chunk-5EP6HY2E.js";
7
+ import "./chunk-S27IGTVG.js";
8
+ import "./chunk-7MARUOFZ.js";
9
9
  export {
10
10
  Oas as default
11
11
  };
@@ -1,15 +1,11 @@
1
1
  import {
2
- isOAS30,
3
- isOAS31,
4
2
  isOpenAPI30,
5
3
  isOpenAPI31,
6
4
  isRef,
7
5
  isSchema,
8
6
  isSwagger
9
- } from "./chunk-L3V5TF63.js";
7
+ } from "./chunk-7MARUOFZ.js";
10
8
  export {
11
- isOAS30,
12
- isOAS31,
13
9
  isOpenAPI30,
14
10
  isOpenAPI31,
15
11
  isRef,
@@ -1,16 +1,16 @@
1
1
  import {
2
- findSchemaDefinition,
2
+ SERVER_VARIABLE_REGEX,
3
3
  supportedMethods
4
- } from "./chunk-LV26LN7C.js";
4
+ } from "./chunk-VA3NKXX7.js";
5
5
  import {
6
6
  getParameterContentType,
7
7
  matches_mimetype_default,
8
8
  types
9
- } from "./chunk-SH63AK3O.js";
10
- import "./chunk-TTCGKV5E.js";
11
- import "./chunk-L3V5TF63.js";
9
+ } from "./chunk-5EP6HY2E.js";
10
+ import "./chunk-S27IGTVG.js";
11
+ import "./chunk-7MARUOFZ.js";
12
12
  export {
13
- findSchemaDefinition,
13
+ SERVER_VARIABLE_REGEX,
14
14
  getParameterContentType,
15
15
  types as jsonSchemaTypes,
16
16
  matches_mimetype_default as matchesMimeType,