@scalar/openapi-parser 0.10.16 → 0.11.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 (339) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +0 -27
  3. package/dist/configuration/index.js +19 -22
  4. package/dist/configuration/index.js.map +7 -0
  5. package/dist/declarations.d.js +1 -0
  6. package/dist/declarations.d.js.map +7 -0
  7. package/dist/index.d.ts +4 -4
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -29
  10. package/dist/index.js.map +7 -0
  11. package/dist/lib/Validator/Validator.d.ts +2 -2
  12. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  13. package/dist/lib/Validator/Validator.js +99 -119
  14. package/dist/lib/Validator/Validator.js.map +7 -0
  15. package/dist/lib/Validator/Validator.test.js +8 -0
  16. package/dist/lib/Validator/Validator.test.js.map +7 -0
  17. package/dist/lib/Validator/index.d.ts +2 -2
  18. package/dist/lib/Validator/index.d.ts.map +1 -1
  19. package/dist/lib/Validator/index.js +3 -0
  20. package/dist/lib/Validator/index.js.map +7 -0
  21. package/dist/plugins/fetch-urls/fetchUrls.d.ts +1 -1
  22. package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -1
  23. package/dist/plugins/fetch-urls/fetchUrls.js +36 -39
  24. package/dist/plugins/fetch-urls/fetchUrls.js.map +7 -0
  25. package/dist/plugins/fetch-urls/fetchUrls.test.js +50 -0
  26. package/dist/plugins/fetch-urls/fetchUrls.test.js.map +7 -0
  27. package/dist/plugins/fetch-urls/index.d.ts +1 -1
  28. package/dist/plugins/fetch-urls/index.d.ts.map +1 -1
  29. package/dist/plugins/fetch-urls/index.js +2 -1
  30. package/dist/plugins/fetch-urls/index.js.map +7 -0
  31. package/dist/plugins/read-files/index.d.ts +1 -1
  32. package/dist/plugins/read-files/index.d.ts.map +1 -1
  33. package/dist/plugins/read-files/index.js +2 -1
  34. package/dist/plugins/read-files/index.js.map +7 -0
  35. package/dist/plugins/read-files/readFiles.d.ts +1 -1
  36. package/dist/plugins/read-files/readFiles.d.ts.map +1 -1
  37. package/dist/plugins/read-files/readFiles.js +50 -55
  38. package/dist/plugins/read-files/readFiles.js.map +7 -0
  39. package/dist/plugins/read-files/readFiles.test.js +20 -0
  40. package/dist/plugins/read-files/readFiles.test.js.map +7 -0
  41. package/dist/polyfills/index.d.ts +1 -1
  42. package/dist/polyfills/index.d.ts.map +1 -1
  43. package/dist/polyfills/index.js +5 -0
  44. package/dist/polyfills/index.js.map +7 -0
  45. package/dist/polyfills/path.js +155 -98
  46. package/dist/polyfills/path.js.map +7 -0
  47. package/dist/schemas/v2.0/schema.d.ts +1405 -0
  48. package/dist/schemas/v2.0/schema.d.ts.map +1 -0
  49. package/dist/schemas/v2.0/schema.js +1463 -0
  50. package/dist/schemas/v2.0/schema.js.map +7 -0
  51. package/dist/schemas/v3.0/schema.d.ts +1264 -0
  52. package/dist/schemas/v3.0/schema.d.ts.map +1 -0
  53. package/dist/schemas/v3.0/schema.js +1493 -0
  54. package/dist/schemas/v3.0/schema.js.map +7 -0
  55. package/dist/schemas/v3.1/schema.d.ts +1225 -0
  56. package/dist/schemas/v3.1/schema.d.ts.map +1 -0
  57. package/dist/schemas/v3.1/schema.js +1296 -0
  58. package/dist/schemas/v3.1/schema.js.map +7 -0
  59. package/dist/types/index.d.ts +1 -1
  60. package/dist/types/index.d.ts.map +1 -1
  61. package/dist/types/index.js +1 -0
  62. package/dist/types/index.js.map +7 -0
  63. package/dist/utils/betterAjvErrors/helpers.js +88 -93
  64. package/dist/utils/betterAjvErrors/helpers.js.map +7 -0
  65. package/dist/utils/betterAjvErrors/index.js +14 -13
  66. package/dist/utils/betterAjvErrors/index.js.map +7 -0
  67. package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts +2 -0
  68. package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts.map +1 -0
  69. package/dist/utils/betterAjvErrors/json/get-meta-from-path.js +27 -0
  70. package/dist/utils/betterAjvErrors/json/get-meta-from-path.js.map +7 -0
  71. package/dist/utils/betterAjvErrors/json/index.d.ts +2 -0
  72. package/dist/utils/betterAjvErrors/json/index.d.ts.map +1 -0
  73. package/dist/utils/betterAjvErrors/json/index.js +5 -0
  74. package/dist/utils/betterAjvErrors/json/index.js.map +7 -0
  75. package/dist/utils/betterAjvErrors/json/utils.d.ts +2 -0
  76. package/dist/utils/betterAjvErrors/json/utils.d.ts.map +1 -0
  77. package/dist/utils/betterAjvErrors/json/utils.js +11 -0
  78. package/dist/utils/betterAjvErrors/json/utils.js.map +7 -0
  79. package/dist/utils/betterAjvErrors/utils.js +21 -14
  80. package/dist/utils/betterAjvErrors/utils.js.map +7 -0
  81. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts +10 -0
  82. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts.map +1 -0
  83. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js +8 -9
  84. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js.map +7 -0
  85. package/dist/utils/betterAjvErrors/validation-errors/base.d.ts +23 -0
  86. package/dist/utils/betterAjvErrors/validation-errors/base.d.ts.map +1 -0
  87. package/dist/utils/betterAjvErrors/validation-errors/base.js +6 -10
  88. package/dist/utils/betterAjvErrors/validation-errors/base.js.map +7 -0
  89. package/dist/utils/betterAjvErrors/validation-errors/default.d.ts +10 -0
  90. package/dist/utils/betterAjvErrors/validation-errors/default.d.ts.map +1 -0
  91. package/dist/utils/betterAjvErrors/validation-errors/default.js +8 -9
  92. package/dist/utils/betterAjvErrors/validation-errors/default.js.map +7 -0
  93. package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts +11 -0
  94. package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts.map +1 -0
  95. package/dist/utils/betterAjvErrors/validation-errors/enum.js +19 -29
  96. package/dist/utils/betterAjvErrors/validation-errors/enum.js.map +7 -0
  97. package/dist/utils/betterAjvErrors/validation-errors/index.d.ts +7 -0
  98. package/dist/utils/betterAjvErrors/validation-errors/index.d.ts.map +1 -0
  99. package/dist/utils/betterAjvErrors/validation-errors/index.js +15 -0
  100. package/dist/utils/betterAjvErrors/validation-errors/index.js.map +7 -0
  101. package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts +10 -0
  102. package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts.map +1 -0
  103. package/dist/utils/betterAjvErrors/validation-errors/pattern.js +8 -9
  104. package/dist/utils/betterAjvErrors/validation-errors/pattern.js.map +7 -0
  105. package/dist/utils/betterAjvErrors/validation-errors/required.d.ts +10 -0
  106. package/dist/utils/betterAjvErrors/validation-errors/required.d.ts.map +1 -0
  107. package/dist/utils/betterAjvErrors/validation-errors/required.js +8 -9
  108. package/dist/utils/betterAjvErrors/validation-errors/required.js.map +7 -0
  109. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts +10 -0
  110. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts.map +1 -0
  111. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js +8 -9
  112. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js.map +7 -0
  113. package/dist/utils/dereference.d.ts +2 -2
  114. package/dist/utils/dereference.d.ts.map +1 -1
  115. package/dist/utils/dereference.js +17 -19
  116. package/dist/utils/dereference.js.map +7 -0
  117. package/dist/utils/dereference.test.js +300 -0
  118. package/dist/utils/dereference.test.js.map +7 -0
  119. package/dist/utils/details.d.ts +1 -1
  120. package/dist/utils/details.d.ts.map +1 -1
  121. package/dist/utils/details.js +26 -28
  122. package/dist/utils/details.js.map +7 -0
  123. package/dist/utils/errors.test.js +48 -0
  124. package/dist/utils/errors.test.js.map +7 -0
  125. package/dist/utils/escapeJsonPointer.js +5 -8
  126. package/dist/utils/escapeJsonPointer.js.map +7 -0
  127. package/dist/utils/escapeJsonPointer.test.js +11 -0
  128. package/dist/utils/escapeJsonPointer.test.js.map +7 -0
  129. package/dist/utils/filter.d.ts +1 -1
  130. package/dist/utils/filter.d.ts.map +1 -1
  131. package/dist/utils/filter.js +13 -15
  132. package/dist/utils/filter.js.map +7 -0
  133. package/dist/utils/getEntrypoint.d.ts +1 -1
  134. package/dist/utils/getEntrypoint.d.ts.map +1 -1
  135. package/dist/utils/getEntrypoint.js +5 -6
  136. package/dist/utils/getEntrypoint.js.map +7 -0
  137. package/dist/utils/getEntrypoint.test.js +18 -0
  138. package/dist/utils/getEntrypoint.test.js.map +7 -0
  139. package/dist/utils/getListOfReferences.d.ts +1 -1
  140. package/dist/utils/getListOfReferences.d.ts.map +1 -1
  141. package/dist/utils/getListOfReferences.js +15 -22
  142. package/dist/utils/getListOfReferences.js.map +7 -0
  143. package/dist/utils/getSegmentsFromPath.js +8 -15
  144. package/dist/utils/getSegmentsFromPath.js.map +7 -0
  145. package/dist/utils/getSegmentsFromPath.test.js +13 -0
  146. package/dist/utils/getSegmentsFromPath.test.js.map +7 -0
  147. package/dist/utils/index.d.ts +26 -26
  148. package/dist/utils/index.d.ts.map +1 -1
  149. package/dist/utils/index.js +27 -0
  150. package/dist/utils/index.js.map +7 -0
  151. package/dist/utils/isFilesystem.d.ts +2 -1
  152. package/dist/utils/isFilesystem.d.ts.map +1 -1
  153. package/dist/utils/isFilesystem.js +5 -9
  154. package/dist/utils/isFilesystem.js.map +7 -0
  155. package/dist/utils/isJson.js +10 -9
  156. package/dist/utils/isJson.js.map +7 -0
  157. package/dist/utils/isObject.js +5 -6
  158. package/dist/utils/isObject.js.map +7 -0
  159. package/dist/utils/isObject.test.js +23 -0
  160. package/dist/utils/isObject.test.js.map +7 -0
  161. package/dist/utils/isYaml.js +16 -17
  162. package/dist/utils/isYaml.js.map +7 -0
  163. package/dist/utils/load/index.d.ts +1 -1
  164. package/dist/utils/load/index.d.ts.map +1 -1
  165. package/dist/utils/load/index.js +2 -0
  166. package/dist/utils/load/index.js.map +7 -0
  167. package/dist/utils/load/load.d.ts +1 -1
  168. package/dist/utils/load/load.d.ts.map +1 -1
  169. package/dist/utils/load/load.js +89 -110
  170. package/dist/utils/load/load.js.map +7 -0
  171. package/dist/utils/load/load.test.js +361 -0
  172. package/dist/utils/load/load.test.js.map +7 -0
  173. package/dist/utils/makeFilesystem.d.ts +1 -1
  174. package/dist/utils/makeFilesystem.d.ts.map +1 -1
  175. package/dist/utils/makeFilesystem.js +20 -22
  176. package/dist/utils/makeFilesystem.js.map +7 -0
  177. package/dist/utils/makeFilesystem.test.js +15 -0
  178. package/dist/utils/makeFilesystem.test.js.map +7 -0
  179. package/dist/utils/normalize.d.ts +1 -1
  180. package/dist/utils/normalize.d.ts.map +1 -1
  181. package/dist/utils/normalize.js +22 -27
  182. package/dist/utils/normalize.js.map +7 -0
  183. package/dist/utils/normalize.test.js +88 -0
  184. package/dist/utils/normalize.test.js.map +7 -0
  185. package/dist/utils/openapi/actions/details.d.ts +2 -2
  186. package/dist/utils/openapi/actions/details.d.ts.map +1 -1
  187. package/dist/utils/openapi/actions/details.js +9 -11
  188. package/dist/utils/openapi/actions/details.js.map +7 -0
  189. package/dist/utils/openapi/actions/files.d.ts +1 -1
  190. package/dist/utils/openapi/actions/files.d.ts.map +1 -1
  191. package/dist/utils/openapi/actions/files.js +7 -9
  192. package/dist/utils/openapi/actions/files.js.map +7 -0
  193. package/dist/utils/openapi/actions/get.d.ts +1 -1
  194. package/dist/utils/openapi/actions/get.d.ts.map +1 -1
  195. package/dist/utils/openapi/actions/get.js +9 -11
  196. package/dist/utils/openapi/actions/get.js.map +7 -0
  197. package/dist/utils/openapi/actions/toJson.d.ts +1 -1
  198. package/dist/utils/openapi/actions/toJson.d.ts.map +1 -1
  199. package/dist/utils/openapi/actions/toJson.js +9 -11
  200. package/dist/utils/openapi/actions/toJson.js.map +7 -0
  201. package/dist/utils/openapi/actions/toYaml.d.ts +1 -1
  202. package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -1
  203. package/dist/utils/openapi/actions/toYaml.js +9 -11
  204. package/dist/utils/openapi/actions/toYaml.js.map +7 -0
  205. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +5 -5
  206. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -1
  207. package/dist/utils/openapi/commands/dereferenceCommand.js +25 -27
  208. package/dist/utils/openapi/commands/dereferenceCommand.js.map +7 -0
  209. package/dist/utils/openapi/commands/filterCommand.d.ts +9 -9
  210. package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -1
  211. package/dist/utils/openapi/commands/filterCommand.js +24 -26
  212. package/dist/utils/openapi/commands/filterCommand.js.map +7 -0
  213. package/dist/utils/openapi/commands/loadCommand.d.ts +994 -994
  214. package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -1
  215. package/dist/utils/openapi/commands/loadCommand.js +40 -42
  216. package/dist/utils/openapi/commands/loadCommand.js.map +7 -0
  217. package/dist/utils/openapi/commands/upgradeCommand.d.ts +311 -311
  218. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -1
  219. package/dist/utils/openapi/commands/upgradeCommand.js +27 -29
  220. package/dist/utils/openapi/commands/upgradeCommand.js.map +7 -0
  221. package/dist/utils/openapi/commands/validateCommand.d.ts +311 -311
  222. package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -1
  223. package/dist/utils/openapi/commands/validateCommand.js +31 -33
  224. package/dist/utils/openapi/commands/validateCommand.js.map +7 -0
  225. package/dist/utils/openapi/index.d.ts +1 -1
  226. package/dist/utils/openapi/index.d.ts.map +1 -1
  227. package/dist/utils/openapi/index.js +2 -0
  228. package/dist/utils/openapi/index.js.map +7 -0
  229. package/dist/utils/openapi/openapi.d.ts +702 -700
  230. package/dist/utils/openapi/openapi.d.ts.map +1 -1
  231. package/dist/utils/openapi/openapi.js +13 -16
  232. package/dist/utils/openapi/openapi.js.map +7 -0
  233. package/dist/utils/openapi/openapi.test-d.js +14 -0
  234. package/dist/utils/openapi/openapi.test-d.js.map +7 -0
  235. package/dist/utils/openapi/openapi.test.js +309 -0
  236. package/dist/utils/openapi/openapi.test.js.map +7 -0
  237. package/dist/utils/openapi/utils/queueTask.d.ts +1 -1
  238. package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -1
  239. package/dist/utils/openapi/utils/queueTask.js +8 -9
  240. package/dist/utils/openapi/utils/queueTask.js.map +7 -0
  241. package/dist/utils/openapi/utils/workThroughQueue.d.ts +1 -1
  242. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -1
  243. package/dist/utils/openapi/utils/workThroughQueue.js +49 -64
  244. package/dist/utils/openapi/utils/workThroughQueue.js.map +7 -0
  245. package/dist/utils/openapi/utils/workThroughQueue.test.js +244 -0
  246. package/dist/utils/openapi/utils/workThroughQueue.test.js.map +7 -0
  247. package/dist/utils/resolveReferences.d.ts +1 -1
  248. package/dist/utils/resolveReferences.d.ts.map +1 -1
  249. package/dist/utils/resolveReferences.js +91 -139
  250. package/dist/utils/resolveReferences.js.map +7 -0
  251. package/dist/utils/resolveReferences.test.js +567 -0
  252. package/dist/utils/resolveReferences.test.js.map +7 -0
  253. package/dist/utils/toJson.d.ts +1 -1
  254. package/dist/utils/toJson.d.ts.map +1 -1
  255. package/dist/utils/toJson.js +4 -2
  256. package/dist/utils/toJson.js.map +7 -0
  257. package/dist/utils/toYaml.d.ts +1 -1
  258. package/dist/utils/toYaml.d.ts.map +1 -1
  259. package/dist/utils/toYaml.js +5 -4
  260. package/dist/utils/toYaml.js.map +7 -0
  261. package/dist/utils/transform/index.d.ts +1 -1
  262. package/dist/utils/transform/index.d.ts.map +1 -1
  263. package/dist/utils/transform/index.js +2 -0
  264. package/dist/utils/transform/index.js.map +7 -0
  265. package/dist/utils/transform/sanitize.d.ts +3 -3
  266. package/dist/utils/transform/sanitize.d.ts.map +1 -1
  267. package/dist/utils/transform/sanitize.js +22 -21
  268. package/dist/utils/transform/sanitize.js.map +7 -0
  269. package/dist/utils/transform/sanitize.test.js +148 -0
  270. package/dist/utils/transform/sanitize.test.js.map +7 -0
  271. package/dist/utils/transform/utils/addInfoObject.d.ts +1 -1
  272. package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
  273. package/dist/utils/transform/utils/addInfoObject.js +14 -10
  274. package/dist/utils/transform/utils/addInfoObject.js.map +7 -0
  275. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts +1 -1
  276. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
  277. package/dist/utils/transform/utils/addLatestOpenApiVersion.js +8 -5
  278. package/dist/utils/transform/utils/addLatestOpenApiVersion.js.map +7 -0
  279. package/dist/utils/transform/utils/addMissingTags.d.ts +1 -1
  280. package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
  281. package/dist/utils/transform/utils/addMissingTags.js +26 -27
  282. package/dist/utils/transform/utils/addMissingTags.js.map +7 -0
  283. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts +1 -1
  284. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
  285. package/dist/utils/transform/utils/normalizeSecuritySchemes.js +36 -40
  286. package/dist/utils/transform/utils/normalizeSecuritySchemes.js.map +7 -0
  287. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts +1 -1
  288. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
  289. package/dist/utils/transform/utils/rejectSwaggerDocuments.js +8 -6
  290. package/dist/utils/transform/utils/rejectSwaggerDocuments.js.map +7 -0
  291. package/dist/utils/transformErrors.d.ts +1 -1
  292. package/dist/utils/transformErrors.d.ts.map +1 -1
  293. package/dist/utils/transformErrors.js +18 -21
  294. package/dist/utils/transformErrors.js.map +7 -0
  295. package/dist/utils/transformErrors.test.js +17 -0
  296. package/dist/utils/transformErrors.test.js.map +7 -0
  297. package/dist/utils/traverse.d.ts +3 -3
  298. package/dist/utils/traverse.d.ts.map +1 -1
  299. package/dist/utils/traverse.js +22 -23
  300. package/dist/utils/traverse.js.map +7 -0
  301. package/dist/utils/traverse.test.js +68 -0
  302. package/dist/utils/traverse.test.js.map +7 -0
  303. package/dist/utils/unescapeJsonPointer.js +5 -9
  304. package/dist/utils/unescapeJsonPointer.js.map +7 -0
  305. package/dist/utils/unescapeJsonPointer.test.js +19 -0
  306. package/dist/utils/unescapeJsonPointer.test.js.map +7 -0
  307. package/dist/utils/upgrade.bench.d.ts +2 -0
  308. package/dist/utils/upgrade.bench.d.ts.map +1 -0
  309. package/dist/utils/upgrade.bench.js +31 -0
  310. package/dist/utils/upgrade.bench.js.map +7 -0
  311. package/dist/utils/upgrade.d.ts +1 -1
  312. package/dist/utils/upgrade.d.ts.map +1 -1
  313. package/dist/utils/upgrade.js +28 -22
  314. package/dist/utils/upgrade.js.map +7 -0
  315. package/dist/utils/upgrade.test-d.js +16 -0
  316. package/dist/utils/upgrade.test-d.js.map +7 -0
  317. package/dist/utils/upgrade.test.js +57 -0
  318. package/dist/utils/upgrade.test.js.map +7 -0
  319. package/dist/utils/upgradeFromThreeToThreeOne.d.ts +3 -3
  320. package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +1 -1
  321. package/dist/utils/upgradeFromThreeToThreeOne.js +107 -144
  322. package/dist/utils/upgradeFromThreeToThreeOne.js.map +7 -0
  323. package/dist/utils/upgradeFromThreeToThreeOne.test.js +462 -0
  324. package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +7 -0
  325. package/dist/utils/upgradeFromTwoToThree.d.ts.map +1 -1
  326. package/dist/utils/upgradeFromTwoToThree.js +212 -219
  327. package/dist/utils/upgradeFromTwoToThree.js.map +7 -0
  328. package/dist/utils/upgradeFromTwoToThree.test.js +589 -0
  329. package/dist/utils/upgradeFromTwoToThree.test.js.map +7 -0
  330. package/dist/utils/validate.d.ts +1 -1
  331. package/dist/utils/validate.d.ts.map +1 -1
  332. package/dist/utils/validate.js +14 -16
  333. package/dist/utils/validate.js.map +7 -0
  334. package/dist/utils/validate.test.js +64 -0
  335. package/dist/utils/validate.test.js.map +7 -0
  336. package/package.json +7 -8
  337. package/dist/schemas/v2.0/schema.json.js +0 -1623
  338. package/dist/schemas/v3.0/schema.json.js +0 -1673
  339. package/dist/schemas/v3.1/schema.json.js +0 -1451
@@ -1,25 +1,23 @@
1
- import { getListOfReferences } from './getListOfReferences.js';
2
- import { isFilesystem } from './isFilesystem.js';
3
- import { normalize } from './normalize.js';
4
-
1
+ import { getListOfReferences } from "./getListOfReferences.js";
2
+ import { isFilesystem } from "./isFilesystem.js";
3
+ import { normalize } from "./normalize.js";
5
4
  function makeFilesystem(value, overwrites = {}) {
6
- // Keep as is
7
- if (isFilesystem(value)) {
8
- return value;
5
+ if (isFilesystem(value)) {
6
+ return value;
7
+ }
8
+ const specification = normalize(value);
9
+ return [
10
+ {
11
+ isEntrypoint: true,
12
+ specification,
13
+ filename: null,
14
+ dir: "./",
15
+ references: getListOfReferences(specification),
16
+ ...overwrites
9
17
  }
10
- // Make an object
11
- const specification = normalize(value);
12
- // Create fake filesystem
13
- return [
14
- {
15
- isEntrypoint: true,
16
- specification,
17
- filename: null,
18
- dir: './',
19
- references: getListOfReferences(specification),
20
- ...overwrites,
21
- },
22
- ];
18
+ ];
23
19
  }
24
-
25
- export { makeFilesystem };
20
+ export {
21
+ makeFilesystem
22
+ };
23
+ //# sourceMappingURL=makeFilesystem.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/makeFilesystem.ts"],
4
+ "sourcesContent": ["import type { AnyObject, Filesystem, FilesystemEntry } from '../types/index'\nimport { getListOfReferences } from './getListOfReferences'\nimport { isFilesystem } from './isFilesystem'\nimport { normalize } from './normalize'\n\nexport function makeFilesystem(\n value: string | AnyObject | Filesystem,\n overwrites: Partial<FilesystemEntry> = {},\n): Filesystem {\n // Keep as is\n if (isFilesystem(value)) {\n return value as Filesystem\n }\n\n // Make an object\n const specification = normalize(value)\n\n // Create fake filesystem\n return [\n {\n isEntrypoint: true,\n specification,\n filename: null,\n dir: './',\n references: getListOfReferences(specification),\n ...overwrites,\n },\n ]\n}\n"],
5
+ "mappings": "AACA,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAEnB,SAAS,eACd,OACA,aAAuC,CAAC,GAC5B;AAEZ,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO;AAAA,EACT;AAGA,QAAM,gBAAgB,UAAU,KAAK;AAGrC,SAAO;AAAA,IACL;AAAA,MACE,cAAc;AAAA,MACd;AAAA,MACA,UAAU;AAAA,MACV,KAAK;AAAA,MACL,YAAY,oBAAoB,aAAa;AAAA,MAC7C,GAAG;AAAA,IACL;AAAA,EACF;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { isFilesystem } from "./isFilesystem.js";
3
+ import { makeFilesystem } from "./makeFilesystem.js";
4
+ describe("isFilesystem", () => {
5
+ it("transforms an object to a filesystem", () => {
6
+ const result = makeFilesystem({
7
+ foo: "bar"
8
+ });
9
+ expect(result).not.toBe({
10
+ foo: "bar"
11
+ });
12
+ expect(isFilesystem(result)).toBe(true);
13
+ });
14
+ });
15
+ //# sourceMappingURL=makeFilesystem.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/makeFilesystem.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { isFilesystem } from './isFilesystem'\nimport { makeFilesystem } from './makeFilesystem'\n\ndescribe('isFilesystem', () => {\n it('transforms an object to a filesystem', () => {\n const result = makeFilesystem({\n foo: 'bar',\n })\n\n expect(result).not.toBe({\n foo: 'bar',\n })\n\n expect(isFilesystem(result)).toBe(true)\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAE/B,SAAS,gBAAgB,MAAM;AAC7B,KAAG,wCAAwC,MAAM;AAC/C,UAAM,SAAS,eAAe;AAAA,MAC5B,KAAK;AAAA,IACP,CAAC;AAED,WAAO,MAAM,EAAE,IAAI,KAAK;AAAA,MACtB,KAAK;AAAA,IACP,CAAC;AAED,WAAO,aAAa,MAAM,CAAC,EAAE,KAAK,IAAI;AAAA,EACxC,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
1
  import type { UnknownObject } from '@scalar/types/utils';
2
- import type { Filesystem } from '../types/index.ts';
2
+ import type { Filesystem } from '../types/index.js';
3
3
  /**
4
4
  * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAGnD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAwBxG"}
1
+ {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/utils/normalize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAGxD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,aAAa,GAAG,UAAU,CAwBxG"}
@@ -1,32 +1,27 @@
1
- import { parse } from 'yaml';
2
- import { isFilesystem } from './isFilesystem.js';
3
-
4
- /**
5
- * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.
6
- *
7
- * Doesn’t modify the object if it’s a `Filesystem` (multiple files) already.
8
- */
1
+ import { parse } from "yaml";
2
+ import { isFilesystem } from "./isFilesystem.js";
9
3
  function normalize(specification) {
10
- if (specification === null) {
11
- return {};
4
+ if (specification === null) {
5
+ return {};
6
+ }
7
+ if (typeof specification === "string") {
8
+ if (specification.trim() === "") {
9
+ return {};
12
10
  }
13
- if (typeof specification === 'string') {
14
- if (specification.trim() === '') {
15
- return {};
16
- }
17
- try {
18
- return JSON.parse(specification);
19
- }
20
- catch (_error) {
21
- return parse(specification, {
22
- maxAliasCount: 10000,
23
- });
24
- }
25
- }
26
- if (isFilesystem(specification)) {
27
- return specification;
11
+ try {
12
+ return JSON.parse(specification);
13
+ } catch (_error) {
14
+ return parse(specification, {
15
+ maxAliasCount: 1e4
16
+ });
28
17
  }
18
+ }
19
+ if (isFilesystem(specification)) {
29
20
  return specification;
21
+ }
22
+ return specification;
30
23
  }
31
-
32
- export { normalize };
24
+ export {
25
+ normalize
26
+ };
27
+ //# sourceMappingURL=normalize.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/normalize.ts"],
4
+ "sourcesContent": ["import type { UnknownObject } from '@scalar/types/utils'\nimport { parse } from 'yaml'\n\nimport type { Filesystem } from '../types/index'\nimport { isFilesystem } from './isFilesystem'\n\n/**\n * Normalize the OpenAPI document (YAML, JSON, object) to a JavaScript object.\n *\n * Doesn\u2019t modify the object if it\u2019s a `Filesystem` (multiple files) already.\n */\nexport function normalize(specification: string | UnknownObject | Filesystem): UnknownObject | Filesystem {\n if (specification === null) {\n return {}\n }\n\n if (typeof specification === 'string') {\n if (specification.trim() === '') {\n return {}\n }\n\n try {\n return JSON.parse(specification)\n } catch (_error) {\n return parse(specification, {\n maxAliasCount: 10000,\n })\n }\n }\n\n if (isFilesystem(specification)) {\n return specification as Filesystem\n }\n\n return specification\n}\n"],
5
+ "mappings": "AACA,SAAS,aAAa;AAGtB,SAAS,oBAAoB;AAOtB,SAAS,UAAU,eAAgF;AACxG,MAAI,kBAAkB,MAAM;AAC1B,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,OAAO,kBAAkB,UAAU;AACrC,QAAI,cAAc,KAAK,MAAM,IAAI;AAC/B,aAAO,CAAC;AAAA,IACV;AAEA,QAAI;AACF,aAAO,KAAK,MAAM,aAAa;AAAA,IACjC,SAAS,QAAQ;AACf,aAAO,MAAM,eAAe;AAAA,QAC1B,eAAe;AAAA,MACjB,CAAC;AAAA,IACH;AAAA,EACF;AAEA,MAAI,aAAa,aAAa,GAAG;AAC/B,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,88 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { normalize } from "./normalize.js";
3
+ describe("normalize", () => {
4
+ it("should return an empty object if the specification is null", () => {
5
+ expect(normalize(null)).toEqual({});
6
+ });
7
+ it("should return the same filesystem if the specification is already a filesystem", () => {
8
+ const filesystem = [
9
+ {
10
+ isEntrypoint: true,
11
+ specification: {},
12
+ filename: null,
13
+ dir: "./",
14
+ references: []
15
+ }
16
+ ];
17
+ expect(normalize(filesystem)).toBe(filesystem);
18
+ });
19
+ it("should parse JSON string specifications", () => {
20
+ const jsonString = '{"foo": "bar"}';
21
+ expect(normalize(jsonString)).toEqual({ foo: "bar" });
22
+ });
23
+ it("should parse YAML string specifications", () => {
24
+ const yamlString = "foo: bar";
25
+ expect(normalize(yamlString)).toEqual({ foo: "bar" });
26
+ });
27
+ it("should handle invalid YAML with custom maxAliasCount", () => {
28
+ const yamlString = `
29
+ aliases: &ref
30
+ - item1
31
+ - item2
32
+ items: *ref
33
+ `;
34
+ expect(() => normalize(yamlString)).not.toThrow();
35
+ });
36
+ it("should return the same object if specification is already an object", () => {
37
+ const obj = { foo: "bar" };
38
+ expect(normalize(obj)).toBe(obj);
39
+ });
40
+ it("should handle malformed JSON strings by falling back to YAML parsing", () => {
41
+ const malformedJson = '{ foo: "bar" }';
42
+ expect(normalize(malformedJson)).toEqual({ foo: "bar" });
43
+ });
44
+ it("should handle empty string input", () => {
45
+ expect(normalize("")).toEqual({});
46
+ });
47
+ it("should handle whitespace-only string input", () => {
48
+ expect(normalize(" ")).toEqual({});
49
+ });
50
+ it("should handle complex nested structures", () => {
51
+ const complex = {
52
+ nested: {
53
+ array: [1, 2, 3],
54
+ object: {
55
+ foo: "bar"
56
+ }
57
+ }
58
+ };
59
+ expect(normalize(complex)).toEqual(complex);
60
+ });
61
+ it("should handle invalid JSON and YAML strings gracefully", () => {
62
+ const invalidString = "not a valid json or yaml";
63
+ expect(() => normalize(invalidString)).not.toThrow();
64
+ });
65
+ it("should handle non-string, non-object inputs", () => {
66
+ expect(normalize(42)).toEqual(42);
67
+ expect(normalize(true)).toEqual(true);
68
+ expect(normalize([1, 2, 3])).toEqual([1, 2, 3]);
69
+ });
70
+ it("should handle deeply nested structures", () => {
71
+ const nested = { a: { b: { c: { d: { e: "deep" } } } } };
72
+ expect(normalize(nested)).toEqual(nested);
73
+ });
74
+ it("should handle large input strings", () => {
75
+ const largeJson = JSON.stringify({ foo: "bar".repeat(1e4) });
76
+ expect(normalize(largeJson)).toEqual({ foo: "bar".repeat(1e4) });
77
+ });
78
+ it("should handle circular references", () => {
79
+ const circularObj = {};
80
+ circularObj.self = circularObj;
81
+ expect(() => normalize(circularObj)).not.toThrow();
82
+ });
83
+ it("should handle special characters in strings", () => {
84
+ const specialCharJson = '{"foo": "bar\\n"}';
85
+ expect(normalize(specialCharJson)).toEqual({ foo: "bar\n" });
86
+ });
87
+ });
88
+ //# sourceMappingURL=normalize.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/normalize.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { normalize } from './normalize'\n\ndescribe('normalize', () => {\n it('should return an empty object if the specification is null', () => {\n expect(normalize(null)).toEqual({})\n })\n\n it('should return the same filesystem if the specification is already a filesystem', () => {\n const filesystem = [\n {\n isEntrypoint: true,\n specification: {},\n filename: null,\n dir: './',\n references: [],\n },\n ]\n expect(normalize(filesystem)).toBe(filesystem)\n })\n\n it('should parse JSON string specifications', () => {\n const jsonString = '{\"foo\": \"bar\"}'\n expect(normalize(jsonString)).toEqual({ foo: 'bar' })\n })\n\n it('should parse YAML string specifications', () => {\n const yamlString = 'foo: bar'\n expect(normalize(yamlString)).toEqual({ foo: 'bar' })\n })\n\n it('should handle invalid YAML with custom maxAliasCount', () => {\n const yamlString = `\n aliases: &ref\n - item1\n - item2\n items: *ref\n `\n expect(() => normalize(yamlString)).not.toThrow()\n })\n\n it('should return the same object if specification is already an object', () => {\n const obj = { foo: 'bar' }\n expect(normalize(obj)).toBe(obj)\n })\n\n it('should handle malformed JSON strings by falling back to YAML parsing', () => {\n const malformedJson = '{ foo: \"bar\" }' // Missing quotes around property name\n expect(normalize(malformedJson)).toEqual({ foo: 'bar' })\n })\n\n it('should handle empty string input', () => {\n expect(normalize('')).toEqual({})\n })\n\n it('should handle whitespace-only string input', () => {\n expect(normalize(' ')).toEqual({})\n })\n\n it('should handle complex nested structures', () => {\n const complex = {\n nested: {\n array: [1, 2, 3],\n object: {\n foo: 'bar',\n },\n },\n }\n expect(normalize(complex)).toEqual(complex)\n })\n\n it('should handle invalid JSON and YAML strings gracefully', () => {\n const invalidString = 'not a valid json or yaml'\n expect(() => normalize(invalidString)).not.toThrow()\n })\n\n it('should handle non-string, non-object inputs', () => {\n // @ts-expect-error testing bad input\n expect(normalize(42)).toEqual(42)\n // @ts-expect-error testing bad input\n expect(normalize(true)).toEqual(true)\n // @ts-expect-error testing bad input\n expect(normalize([1, 2, 3])).toEqual([1, 2, 3])\n })\n\n it('should handle deeply nested structures', () => {\n const nested = { a: { b: { c: { d: { e: 'deep' } } } } }\n expect(normalize(nested)).toEqual(nested)\n })\n\n it('should handle large input strings', () => {\n const largeJson = JSON.stringify({ foo: 'bar'.repeat(10000) })\n expect(normalize(largeJson)).toEqual({ foo: 'bar'.repeat(10000) })\n })\n\n it('should handle circular references', () => {\n const circularObj: any = {}\n circularObj.self = circularObj\n expect(() => normalize(circularObj)).not.toThrow()\n })\n\n it('should handle special characters in strings', () => {\n const specialCharJson = '{\"foo\": \"bar\\\\n\"}'\n expect(normalize(specialCharJson)).toEqual({ foo: 'bar\\n' })\n })\n})\n"],
5
+ "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,iBAAiB;AAE1B,SAAS,aAAa,MAAM;AAC1B,KAAG,8DAA8D,MAAM;AACrE,WAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACpC,CAAC;AAED,KAAG,kFAAkF,MAAM;AACzF,UAAM,aAAa;AAAA,MACjB;AAAA,QACE,cAAc;AAAA,QACd,eAAe,CAAC;AAAA,QAChB,UAAU;AAAA,QACV,KAAK;AAAA,QACL,YAAY,CAAC;AAAA,MACf;AAAA,IACF;AACA,WAAO,UAAU,UAAU,CAAC,EAAE,KAAK,UAAU;AAAA,EAC/C,CAAC;AAED,KAAG,2CAA2C,MAAM;AAClD,UAAM,aAAa;AACnB,WAAO,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,MAAM,CAAC;AAAA,EACtD,CAAC;AAED,KAAG,2CAA2C,MAAM;AAClD,UAAM,aAAa;AACnB,WAAO,UAAU,UAAU,CAAC,EAAE,QAAQ,EAAE,KAAK,MAAM,CAAC;AAAA,EACtD,CAAC;AAED,KAAG,wDAAwD,MAAM;AAC/D,UAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAMnB,WAAO,MAAM,UAAU,UAAU,CAAC,EAAE,IAAI,QAAQ;AAAA,EAClD,CAAC;AAED,KAAG,uEAAuE,MAAM;AAC9E,UAAM,MAAM,EAAE,KAAK,MAAM;AACzB,WAAO,UAAU,GAAG,CAAC,EAAE,KAAK,GAAG;AAAA,EACjC,CAAC;AAED,KAAG,wEAAwE,MAAM;AAC/E,UAAM,gBAAgB;AACtB,WAAO,UAAU,aAAa,CAAC,EAAE,QAAQ,EAAE,KAAK,MAAM,CAAC;AAAA,EACzD,CAAC;AAED,KAAG,oCAAoC,MAAM;AAC3C,WAAO,UAAU,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EAClC,CAAC;AAED,KAAG,8CAA8C,MAAM;AACrD,WAAO,UAAU,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACrC,CAAC;AAED,KAAG,2CAA2C,MAAM;AAClD,UAAM,UAAU;AAAA,MACd,QAAQ;AAAA,QACN,OAAO,CAAC,GAAG,GAAG,CAAC;AAAA,QACf,QAAQ;AAAA,UACN,KAAK;AAAA,QACP;AAAA,MACF;AAAA,IACF;AACA,WAAO,UAAU,OAAO,CAAC,EAAE,QAAQ,OAAO;AAAA,EAC5C,CAAC;AAED,KAAG,0DAA0D,MAAM;AACjE,UAAM,gBAAgB;AACtB,WAAO,MAAM,UAAU,aAAa,CAAC,EAAE,IAAI,QAAQ;AAAA,EACrD,CAAC;AAED,KAAG,+CAA+C,MAAM;AAEtD,WAAO,UAAU,EAAE,CAAC,EAAE,QAAQ,EAAE;AAEhC,WAAO,UAAU,IAAI,CAAC,EAAE,QAAQ,IAAI;AAEpC,WAAO,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,GAAG,CAAC,CAAC;AAAA,EAChD,CAAC;AAED,KAAG,0CAA0C,MAAM;AACjD,UAAM,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,OAAO,EAAE,EAAE,EAAE,EAAE;AACvD,WAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,MAAM;AAAA,EAC1C,CAAC;AAED,KAAG,qCAAqC,MAAM;AAC5C,UAAM,YAAY,KAAK,UAAU,EAAE,KAAK,MAAM,OAAO,GAAK,EAAE,CAAC;AAC7D,WAAO,UAAU,SAAS,CAAC,EAAE,QAAQ,EAAE,KAAK,MAAM,OAAO,GAAK,EAAE,CAAC;AAAA,EACnE,CAAC;AAED,KAAG,qCAAqC,MAAM;AAC5C,UAAM,cAAmB,CAAC;AAC1B,gBAAY,OAAO;AACnB,WAAO,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,QAAQ;AAAA,EACnD,CAAC;AAED,KAAG,+CAA+C,MAAM;AACtD,UAAM,kBAAkB;AACxB,WAAO,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,CAAC;AAAA,EAC7D,CAAC;AACH,CAAC;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
- import type { Queue, Task } from '../../../types/index.ts';
2
- import { details as detailsUtility } from '../../details.ts';
1
+ import type { Queue, Task } from '../../../types/index.js';
2
+ import { details as detailsUtility } from '../../details.js';
3
3
  /**
4
4
  * Run the chained tasks and return just some basic information about the OpenAPI document
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAI5D;;GAEG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAI3G"}
1
+ {"version":3,"file":"details.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/details.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,eAAe,CAAA;AAIzD;;GAEG;AACH,wBAAsB,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAI3G"}
@@ -1,13 +1,11 @@
1
- import { details as details$1 } from '../../details.js';
2
- import { getEntrypoint } from '../../getEntrypoint.js';
3
- import { workThroughQueue } from '../utils/workThroughQueue.js';
4
-
5
- /**
6
- * Run the chained tasks and return just some basic information about the OpenAPI document
7
- */
1
+ import { details as detailsUtility } from "../../details.js";
2
+ import { getEntrypoint } from "../../getEntrypoint.js";
3
+ import { workThroughQueue } from "../utils/workThroughQueue.js";
8
4
  async function details(queue) {
9
- const { filesystem } = await workThroughQueue(queue);
10
- return details$1(getEntrypoint(filesystem).specification);
5
+ const { filesystem } = await workThroughQueue(queue);
6
+ return detailsUtility(getEntrypoint(filesystem).specification);
11
7
  }
12
-
13
- export { details };
8
+ export {
9
+ details
10
+ };
11
+ //# sourceMappingURL=details.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/actions/details.ts"],
4
+ "sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { details as detailsUtility } from '../../details'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return just some basic information about the OpenAPI document\n */\nexport async function details<T extends Task[]>(queue: Queue<T>): Promise<ReturnType<typeof detailsUtility>> {\n const { filesystem } = await workThroughQueue(queue)\n\n return detailsUtility(getEntrypoint(filesystem).specification)\n}\n"],
5
+ "mappings": "AACA,SAAS,WAAW,sBAAsB;AAC1C,SAAS,qBAAqB;AAC9B,SAAS,wBAAwB;AAKjC,eAAsB,QAA0B,OAA6D;AAC3G,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,eAAe,cAAc,UAAU,EAAE,aAAa;AAC/D;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import type { Filesystem, Queue, Task } from '../../../types/index.ts';
1
+ import type { Filesystem, Queue, Task } from '../../../types/index.js';
2
2
  /**
3
3
  * Run the chained tasks and return just the filesystem
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAGtE;;GAEG;AACH,wBAAsB,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAIlF"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/files.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAGnE;;GAEG;AACH,wBAAsB,KAAK,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAIlF"}
@@ -1,11 +1,9 @@
1
- import { workThroughQueue } from '../utils/workThroughQueue.js';
2
-
3
- /**
4
- * Run the chained tasks and return just the filesystem
5
- */
1
+ import { workThroughQueue } from "../utils/workThroughQueue.js";
6
2
  async function files(queue) {
7
- const { filesystem } = await workThroughQueue(queue);
8
- return filesystem;
3
+ const { filesystem } = await workThroughQueue(queue);
4
+ return filesystem;
9
5
  }
10
-
11
- export { files };
6
+ export {
7
+ files
8
+ };
9
+ //# sourceMappingURL=files.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/actions/files.ts"],
4
+ "sourcesContent": ["import type { Filesystem, Queue, Task } from '../../../types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return just the filesystem\n */\nexport async function files<T extends Task[]>(queue: Queue<T>): Promise<Filesystem> {\n const { filesystem } = await workThroughQueue(queue)\n\n return filesystem\n}\n"],
5
+ "mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,MAAwB,OAAsC;AAClF,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import type { CommandChain, Queue, Task } from '../../../types/index.ts';
1
+ import type { CommandChain, Queue, Task } from '../../../types/index.js';
2
2
  /**
3
3
  * Run the chained tasks and return the results
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAGxE;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKrF"}
1
+ {"version":3,"file":"get.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAGrE;;GAEG;AACH,wBAAsB,GAAG,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAKrF"}
@@ -1,13 +1,11 @@
1
- import { workThroughQueue } from '../utils/workThroughQueue.js';
2
-
3
- /**
4
- * Run the chained tasks and return the results
5
- */
1
+ import { workThroughQueue } from "../utils/workThroughQueue.js";
6
2
  async function get(queue) {
7
- return {
8
- filesystem: [],
9
- ...(await workThroughQueue(queue)),
10
- };
3
+ return {
4
+ filesystem: [],
5
+ ...await workThroughQueue(queue)
6
+ };
11
7
  }
12
-
13
- export { get };
8
+ export {
9
+ get
10
+ };
11
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/actions/get.ts"],
4
+ "sourcesContent": ["import type { CommandChain, Queue, Task } from '../../../types/index'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function get<T extends Task[]>(queue: Queue<T>): Promise<CommandChain<T>> {\n return {\n filesystem: [],\n ...(await workThroughQueue(queue)),\n }\n}\n"],
5
+ "mappings": "AACA,SAAS,wBAAwB;AAKjC,eAAsB,IAAsB,OAA2C;AACrF,SAAO;AAAA,IACL,YAAY,CAAC;AAAA,IACb,GAAI,MAAM,iBAAiB,KAAK;AAAA,EAClC;AACF;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import type { Queue, Task } from '../../../types/index.ts';
1
+ import type { Queue, Task } from '../../../types/index.js';
2
2
  /**
3
3
  * Run the chained tasks and return the results
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAK1D;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI3F"}
1
+ {"version":3,"file":"toJson.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toJson.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAI3F"}
@@ -1,13 +1,11 @@
1
- import { getEntrypoint } from '../../getEntrypoint.js';
2
- import { toJson as toJson$1 } from '../../toJson.js';
3
- import { workThroughQueue } from '../utils/workThroughQueue.js';
4
-
5
- /**
6
- * Run the chained tasks and return the results
7
- */
1
+ import { getEntrypoint } from "../../getEntrypoint.js";
2
+ import { toJson as toJsonUtility } from "../../toJson.js";
3
+ import { workThroughQueue } from "../utils/workThroughQueue.js";
8
4
  async function toJson(queue) {
9
- const { filesystem } = await workThroughQueue(queue);
10
- return toJson$1(getEntrypoint(filesystem).specification);
5
+ const { filesystem } = await workThroughQueue(queue);
6
+ return toJsonUtility(getEntrypoint(filesystem).specification);
11
7
  }
12
-
13
- export { toJson };
8
+ export {
9
+ toJson
10
+ };
11
+ //# sourceMappingURL=toJson.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/actions/toJson.ts"],
4
+ "sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { toJson as toJsonUtility } from '../../toJson'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toJson<T extends Task[]>(queue: Queue<T>): Promise<string | undefined> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toJsonUtility(getEntrypoint(filesystem).specification)\n}\n"],
5
+ "mappings": "AACA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAA8C;AAC3F,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
6
+ "names": []
7
+ }
@@ -1,4 +1,4 @@
1
- import type { Queue, Task } from '../../../types/index.ts';
1
+ import type { Queue, Task } from '../../../types/index.js';
2
2
  /**
3
3
  * Run the chained tasks and return the results
4
4
  */
@@ -1 +1 @@
1
- {"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAK1D;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/E"}
1
+ {"version":3,"file":"toYaml.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/actions/toYaml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAKvD;;GAEG;AACH,wBAAsB,MAAM,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/E"}
@@ -1,13 +1,11 @@
1
- import { getEntrypoint } from '../../getEntrypoint.js';
2
- import { toYaml as toYaml$1 } from '../../toYaml.js';
3
- import { workThroughQueue } from '../utils/workThroughQueue.js';
4
-
5
- /**
6
- * Run the chained tasks and return the results
7
- */
1
+ import { getEntrypoint } from "../../getEntrypoint.js";
2
+ import { toYaml as toYamlUtility } from "../../toYaml.js";
3
+ import { workThroughQueue } from "../utils/workThroughQueue.js";
8
4
  async function toYaml(queue) {
9
- const { filesystem } = await workThroughQueue(queue);
10
- return toYaml$1(getEntrypoint(filesystem).specification);
5
+ const { filesystem } = await workThroughQueue(queue);
6
+ return toYamlUtility(getEntrypoint(filesystem).specification);
11
7
  }
12
-
13
- export { toYaml };
8
+ export {
9
+ toYaml
10
+ };
11
+ //# sourceMappingURL=toYaml.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/actions/toYaml.ts"],
4
+ "sourcesContent": ["import type { Queue, Task } from '../../../types/index'\nimport { getEntrypoint } from '../../getEntrypoint'\nimport { toYaml as toYamlUtility } from '../../toYaml'\nimport { workThroughQueue } from '../utils/workThroughQueue'\n\n/**\n * Run the chained tasks and return the results\n */\nexport async function toYaml<T extends Task[]>(queue: Queue<T>): Promise<string> {\n const { filesystem } = await workThroughQueue(queue)\n\n return toYamlUtility(getEntrypoint(filesystem).specification)\n}\n"],
5
+ "mappings": "AACA,SAAS,qBAAqB;AAC9B,SAAS,UAAU,qBAAqB;AACxC,SAAS,wBAAwB;AAKjC,eAAsB,OAAyB,OAAkC;AAC/E,QAAM,EAAE,WAAW,IAAI,MAAM,iBAAiB,KAAK;AAEnD,SAAO,cAAc,cAAc,UAAU,EAAE,aAAa;AAC9D;",
6
+ "names": []
7
+ }
@@ -1,5 +1,5 @@
1
- import type { DereferenceResult, Queue, Task } from '../../../types/index.ts';
2
- import type { DereferenceOptions } from '../../dereference.ts';
1
+ import type { DereferenceResult, Queue, Task } from '../../../types/index.js';
2
+ import type { DereferenceOptions } from '../../dereference.js';
3
3
  declare global {
4
4
  interface Commands {
5
5
  dereference: {
@@ -15,9 +15,9 @@ declare global {
15
15
  * Dereference the given OpenAPI document
16
16
  */
17
17
  export declare function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions): {
18
- details: () => Promise<import("../../../types/index.ts").DetailsResult>;
19
- files: () => Promise<import("../../../types/index.ts").Filesystem>;
20
- get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, {
18
+ details: () => Promise<import("../../../index.js").DetailsResult>;
19
+ files: () => Promise<import("../../../index.js").Filesystem>;
20
+ get: () => Promise<import("../../../index.js").CommandChain<[...T, {
21
21
  name: "dereference";
22
22
  options?: DereferenceOptions;
23
23
  }]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"dereferenceCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAQ9D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,WAAW,EAAE;YACX,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,CAAA;gBACnB,OAAO,CAAC,EAAE,kBAAkB,CAAA;aAC7B,CAAA;YACD,MAAM,EAAE,iBAAiB,CAAA;SAC1B,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB;;;;cAX5F,aAAa;kBACT,kBAAkB;;;;EA4BnC"}
1
+ {"version":3,"file":"dereferenceCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,WAAW,EAAE;YACX,IAAI,EAAE;gBACJ,IAAI,EAAE,aAAa,CAAA;gBACnB,OAAO,CAAC,EAAE,kBAAkB,CAAA;aAC7B,CAAA;YACD,MAAM,EAAE,iBAAiB,CAAA;SAC1B,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,kBAAkB;;;;cAX5F,aAAa;kBACT,kBAAkB;;;;EA4BnC"}
@@ -1,29 +1,27 @@
1
- import { details } from '../actions/details.js';
2
- import { files } from '../actions/files.js';
3
- import { get } from '../actions/get.js';
4
- import { toJson } from '../actions/toJson.js';
5
- import { toYaml } from '../actions/toYaml.js';
6
- import { queueTask } from '../utils/queueTask.js';
7
-
8
- /**
9
- * Dereference the given OpenAPI document
10
- */
1
+ import { details } from "../actions/details.js";
2
+ import { files } from "../actions/files.js";
3
+ import { get } from "../actions/get.js";
4
+ import { toJson } from "../actions/toJson.js";
5
+ import { toYaml } from "../actions/toYaml.js";
6
+ import { queueTask } from "../utils/queueTask.js";
11
7
  function dereferenceCommand(previousQueue, options) {
12
- const task = {
13
- name: 'dereference',
14
- options: {
15
- throwOnError: previousQueue.options?.throwOnError,
16
- ...(options ?? {}),
17
- },
18
- };
19
- const queue = queueTask(previousQueue, task);
20
- return {
21
- details: () => details(queue),
22
- files: () => files(queue),
23
- get: () => get(queue),
24
- toJson: () => toJson(queue),
25
- toYaml: () => toYaml(queue),
26
- };
8
+ const task = {
9
+ name: "dereference",
10
+ options: {
11
+ throwOnError: previousQueue.options?.throwOnError,
12
+ ...options ?? {}
13
+ }
14
+ };
15
+ const queue = queueTask(previousQueue, task);
16
+ return {
17
+ details: () => details(queue),
18
+ files: () => files(queue),
19
+ get: () => get(queue),
20
+ toJson: () => toJson(queue),
21
+ toYaml: () => toYaml(queue)
22
+ };
27
23
  }
28
-
29
- export { dereferenceCommand };
24
+ export {
25
+ dereferenceCommand
26
+ };
27
+ //# sourceMappingURL=dereferenceCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/commands/dereferenceCommand.ts"],
4
+ "sourcesContent": ["import type { DereferenceResult, Queue, Task } from '../../../types/index'\nimport type { DereferenceOptions } from '../../dereference'\nimport { details } from '../actions/details'\nimport { files } from '../actions/files'\nimport { get } from '../actions/get'\nimport { toJson } from '../actions/toJson'\nimport { toYaml } from '../actions/toYaml'\nimport { queueTask } from '../utils/queueTask'\n\ndeclare global {\n interface Commands {\n dereference: {\n task: {\n name: 'dereference'\n options?: DereferenceOptions\n }\n result: DereferenceResult\n }\n }\n}\n\n/**\n * Dereference the given OpenAPI document\n */\nexport function dereferenceCommand<T extends Task[]>(previousQueue: Queue<T>, options?: DereferenceOptions) {\n const task: Task = {\n name: 'dereference',\n options: {\n throwOnError: previousQueue.options?.throwOnError,\n ...(options ?? {}),\n },\n }\n\n const queue = queueTask<[...T, typeof task]>(previousQueue, task as Task)\n\n return {\n details: () => details(queue),\n files: () => files(queue),\n get: () => get(queue),\n toJson: () => toJson(queue),\n toYaml: () => toYaml(queue),\n }\n}\n"],
5
+ "mappings": "AAEA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAiBnB,SAAS,mBAAqC,eAAyB,SAA8B;AAC1G,QAAM,OAAa;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA,MACP,cAAc,cAAc,SAAS;AAAA,MACrC,GAAI,WAAW,CAAC;AAAA,IAClB;AAAA,EACF;AAEA,QAAM,QAAQ,UAA+B,eAAe,IAAY;AAExE,SAAO;AAAA,IACL,SAAS,MAAM,QAAQ,KAAK;AAAA,IAC5B,OAAO,MAAM,MAAM,KAAK;AAAA,IACxB,KAAK,MAAM,IAAI,KAAK;AAAA,IACpB,QAAQ,MAAM,OAAO,KAAK;AAAA,IAC1B,QAAQ,MAAM,OAAO,KAAK;AAAA,EAC5B;AACF;",
6
+ "names": []
7
+ }