@scalar/openapi-parser 0.10.16 → 0.10.17

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 (329) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/configuration/index.js +19 -22
  3. package/dist/configuration/index.js.map +7 -0
  4. package/dist/declarations.d.js +1 -0
  5. package/dist/declarations.d.js.map +7 -0
  6. package/dist/index.d.ts +4 -4
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +5 -29
  9. package/dist/index.js.map +7 -0
  10. package/dist/lib/Validator/Validator.d.ts +2 -2
  11. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  12. package/dist/lib/Validator/Validator.js +99 -119
  13. package/dist/lib/Validator/Validator.js.map +7 -0
  14. package/dist/lib/Validator/Validator.test.js +8 -0
  15. package/dist/lib/Validator/Validator.test.js.map +7 -0
  16. package/dist/lib/Validator/index.d.ts +2 -2
  17. package/dist/lib/Validator/index.d.ts.map +1 -1
  18. package/dist/lib/Validator/index.js +3 -0
  19. package/dist/lib/Validator/index.js.map +7 -0
  20. package/dist/plugins/fetch-urls/fetchUrls.d.ts +1 -1
  21. package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -1
  22. package/dist/plugins/fetch-urls/fetchUrls.js +36 -39
  23. package/dist/plugins/fetch-urls/fetchUrls.js.map +7 -0
  24. package/dist/plugins/fetch-urls/fetchUrls.test.js +50 -0
  25. package/dist/plugins/fetch-urls/fetchUrls.test.js.map +7 -0
  26. package/dist/plugins/fetch-urls/index.d.ts +1 -1
  27. package/dist/plugins/fetch-urls/index.d.ts.map +1 -1
  28. package/dist/plugins/fetch-urls/index.js +2 -1
  29. package/dist/plugins/fetch-urls/index.js.map +7 -0
  30. package/dist/plugins/read-files/index.d.ts +1 -1
  31. package/dist/plugins/read-files/index.d.ts.map +1 -1
  32. package/dist/plugins/read-files/index.js +2 -1
  33. package/dist/plugins/read-files/index.js.map +7 -0
  34. package/dist/plugins/read-files/readFiles.d.ts +1 -1
  35. package/dist/plugins/read-files/readFiles.d.ts.map +1 -1
  36. package/dist/plugins/read-files/readFiles.js +50 -55
  37. package/dist/plugins/read-files/readFiles.js.map +7 -0
  38. package/dist/plugins/read-files/readFiles.test.js +20 -0
  39. package/dist/plugins/read-files/readFiles.test.js.map +7 -0
  40. package/dist/polyfills/index.d.ts +1 -1
  41. package/dist/polyfills/index.d.ts.map +1 -1
  42. package/dist/polyfills/index.js +5 -0
  43. package/dist/polyfills/index.js.map +7 -0
  44. package/dist/polyfills/path.js +155 -98
  45. package/dist/polyfills/path.js.map +7 -0
  46. package/dist/schemas/v2.0/schema.d.ts +1405 -0
  47. package/dist/schemas/v2.0/schema.d.ts.map +1 -0
  48. package/dist/schemas/v2.0/schema.js +1463 -0
  49. package/dist/schemas/v2.0/schema.js.map +7 -0
  50. package/dist/schemas/v3.0/schema.d.ts +1264 -0
  51. package/dist/schemas/v3.0/schema.d.ts.map +1 -0
  52. package/dist/schemas/v3.0/schema.js +1493 -0
  53. package/dist/schemas/v3.0/schema.js.map +7 -0
  54. package/dist/schemas/v3.1/schema.d.ts +1225 -0
  55. package/dist/schemas/v3.1/schema.d.ts.map +1 -0
  56. package/dist/schemas/v3.1/schema.js +1296 -0
  57. package/dist/schemas/v3.1/schema.js.map +7 -0
  58. package/dist/types/index.d.ts +1 -1
  59. package/dist/types/index.d.ts.map +1 -1
  60. package/dist/types/index.js +1 -0
  61. package/dist/types/index.js.map +7 -0
  62. package/dist/utils/betterAjvErrors/helpers.js +88 -93
  63. package/dist/utils/betterAjvErrors/helpers.js.map +7 -0
  64. package/dist/utils/betterAjvErrors/index.js +14 -13
  65. package/dist/utils/betterAjvErrors/index.js.map +7 -0
  66. package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts +2 -0
  67. package/dist/utils/betterAjvErrors/json/get-meta-from-path.d.ts.map +1 -0
  68. package/dist/utils/betterAjvErrors/json/get-meta-from-path.js +27 -0
  69. package/dist/utils/betterAjvErrors/json/get-meta-from-path.js.map +7 -0
  70. package/dist/utils/betterAjvErrors/json/index.d.ts +2 -0
  71. package/dist/utils/betterAjvErrors/json/index.d.ts.map +1 -0
  72. package/dist/utils/betterAjvErrors/json/index.js +5 -0
  73. package/dist/utils/betterAjvErrors/json/index.js.map +7 -0
  74. package/dist/utils/betterAjvErrors/json/utils.d.ts +2 -0
  75. package/dist/utils/betterAjvErrors/json/utils.d.ts.map +1 -0
  76. package/dist/utils/betterAjvErrors/json/utils.js +11 -0
  77. package/dist/utils/betterAjvErrors/json/utils.js.map +7 -0
  78. package/dist/utils/betterAjvErrors/utils.js +21 -14
  79. package/dist/utils/betterAjvErrors/utils.js.map +7 -0
  80. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts +10 -0
  81. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.d.ts.map +1 -0
  82. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js +8 -9
  83. package/dist/utils/betterAjvErrors/validation-errors/additional-prop.js.map +7 -0
  84. package/dist/utils/betterAjvErrors/validation-errors/base.d.ts +23 -0
  85. package/dist/utils/betterAjvErrors/validation-errors/base.d.ts.map +1 -0
  86. package/dist/utils/betterAjvErrors/validation-errors/base.js +6 -10
  87. package/dist/utils/betterAjvErrors/validation-errors/base.js.map +7 -0
  88. package/dist/utils/betterAjvErrors/validation-errors/default.d.ts +10 -0
  89. package/dist/utils/betterAjvErrors/validation-errors/default.d.ts.map +1 -0
  90. package/dist/utils/betterAjvErrors/validation-errors/default.js +8 -9
  91. package/dist/utils/betterAjvErrors/validation-errors/default.js.map +7 -0
  92. package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts +11 -0
  93. package/dist/utils/betterAjvErrors/validation-errors/enum.d.ts.map +1 -0
  94. package/dist/utils/betterAjvErrors/validation-errors/enum.js +19 -29
  95. package/dist/utils/betterAjvErrors/validation-errors/enum.js.map +7 -0
  96. package/dist/utils/betterAjvErrors/validation-errors/index.d.ts +7 -0
  97. package/dist/utils/betterAjvErrors/validation-errors/index.d.ts.map +1 -0
  98. package/dist/utils/betterAjvErrors/validation-errors/index.js +15 -0
  99. package/dist/utils/betterAjvErrors/validation-errors/index.js.map +7 -0
  100. package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts +10 -0
  101. package/dist/utils/betterAjvErrors/validation-errors/pattern.d.ts.map +1 -0
  102. package/dist/utils/betterAjvErrors/validation-errors/pattern.js +8 -9
  103. package/dist/utils/betterAjvErrors/validation-errors/pattern.js.map +7 -0
  104. package/dist/utils/betterAjvErrors/validation-errors/required.d.ts +10 -0
  105. package/dist/utils/betterAjvErrors/validation-errors/required.d.ts.map +1 -0
  106. package/dist/utils/betterAjvErrors/validation-errors/required.js +8 -9
  107. package/dist/utils/betterAjvErrors/validation-errors/required.js.map +7 -0
  108. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts +10 -0
  109. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.d.ts.map +1 -0
  110. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js +8 -9
  111. package/dist/utils/betterAjvErrors/validation-errors/unevaluated-prop.js.map +7 -0
  112. package/dist/utils/dereference.d.ts +2 -2
  113. package/dist/utils/dereference.d.ts.map +1 -1
  114. package/dist/utils/dereference.js +17 -19
  115. package/dist/utils/dereference.js.map +7 -0
  116. package/dist/utils/dereference.test.js +300 -0
  117. package/dist/utils/dereference.test.js.map +7 -0
  118. package/dist/utils/details.d.ts +1 -1
  119. package/dist/utils/details.d.ts.map +1 -1
  120. package/dist/utils/details.js +26 -28
  121. package/dist/utils/details.js.map +7 -0
  122. package/dist/utils/errors.test.js +48 -0
  123. package/dist/utils/errors.test.js.map +7 -0
  124. package/dist/utils/escapeJsonPointer.js +5 -8
  125. package/dist/utils/escapeJsonPointer.js.map +7 -0
  126. package/dist/utils/escapeJsonPointer.test.js +11 -0
  127. package/dist/utils/escapeJsonPointer.test.js.map +7 -0
  128. package/dist/utils/filter.d.ts +1 -1
  129. package/dist/utils/filter.d.ts.map +1 -1
  130. package/dist/utils/filter.js +13 -15
  131. package/dist/utils/filter.js.map +7 -0
  132. package/dist/utils/getEntrypoint.d.ts +1 -1
  133. package/dist/utils/getEntrypoint.d.ts.map +1 -1
  134. package/dist/utils/getEntrypoint.js +5 -6
  135. package/dist/utils/getEntrypoint.js.map +7 -0
  136. package/dist/utils/getEntrypoint.test.js +18 -0
  137. package/dist/utils/getEntrypoint.test.js.map +7 -0
  138. package/dist/utils/getListOfReferences.d.ts +1 -1
  139. package/dist/utils/getListOfReferences.d.ts.map +1 -1
  140. package/dist/utils/getListOfReferences.js +15 -22
  141. package/dist/utils/getListOfReferences.js.map +7 -0
  142. package/dist/utils/getSegmentsFromPath.js +8 -15
  143. package/dist/utils/getSegmentsFromPath.js.map +7 -0
  144. package/dist/utils/getSegmentsFromPath.test.js +13 -0
  145. package/dist/utils/getSegmentsFromPath.test.js.map +7 -0
  146. package/dist/utils/index.d.ts +26 -26
  147. package/dist/utils/index.d.ts.map +1 -1
  148. package/dist/utils/index.js +27 -0
  149. package/dist/utils/index.js.map +7 -0
  150. package/dist/utils/isFilesystem.js +5 -9
  151. package/dist/utils/isFilesystem.js.map +7 -0
  152. package/dist/utils/isJson.js +10 -9
  153. package/dist/utils/isJson.js.map +7 -0
  154. package/dist/utils/isObject.js +5 -6
  155. package/dist/utils/isObject.js.map +7 -0
  156. package/dist/utils/isObject.test.js +23 -0
  157. package/dist/utils/isObject.test.js.map +7 -0
  158. package/dist/utils/isYaml.js +16 -17
  159. package/dist/utils/isYaml.js.map +7 -0
  160. package/dist/utils/load/index.d.ts +1 -1
  161. package/dist/utils/load/index.d.ts.map +1 -1
  162. package/dist/utils/load/index.js +2 -0
  163. package/dist/utils/load/index.js.map +7 -0
  164. package/dist/utils/load/load.d.ts +1 -1
  165. package/dist/utils/load/load.d.ts.map +1 -1
  166. package/dist/utils/load/load.js +89 -110
  167. package/dist/utils/load/load.js.map +7 -0
  168. package/dist/utils/load/load.test.js +361 -0
  169. package/dist/utils/load/load.test.js.map +7 -0
  170. package/dist/utils/makeFilesystem.d.ts +1 -1
  171. package/dist/utils/makeFilesystem.d.ts.map +1 -1
  172. package/dist/utils/makeFilesystem.js +20 -22
  173. package/dist/utils/makeFilesystem.js.map +7 -0
  174. package/dist/utils/makeFilesystem.test.js +15 -0
  175. package/dist/utils/makeFilesystem.test.js.map +7 -0
  176. package/dist/utils/normalize.d.ts +1 -1
  177. package/dist/utils/normalize.d.ts.map +1 -1
  178. package/dist/utils/normalize.js +22 -27
  179. package/dist/utils/normalize.js.map +7 -0
  180. package/dist/utils/normalize.test.js +88 -0
  181. package/dist/utils/normalize.test.js.map +7 -0
  182. package/dist/utils/openapi/actions/details.d.ts +2 -2
  183. package/dist/utils/openapi/actions/details.d.ts.map +1 -1
  184. package/dist/utils/openapi/actions/details.js +9 -11
  185. package/dist/utils/openapi/actions/details.js.map +7 -0
  186. package/dist/utils/openapi/actions/files.d.ts +1 -1
  187. package/dist/utils/openapi/actions/files.d.ts.map +1 -1
  188. package/dist/utils/openapi/actions/files.js +7 -9
  189. package/dist/utils/openapi/actions/files.js.map +7 -0
  190. package/dist/utils/openapi/actions/get.d.ts +1 -1
  191. package/dist/utils/openapi/actions/get.d.ts.map +1 -1
  192. package/dist/utils/openapi/actions/get.js +9 -11
  193. package/dist/utils/openapi/actions/get.js.map +7 -0
  194. package/dist/utils/openapi/actions/toJson.d.ts +1 -1
  195. package/dist/utils/openapi/actions/toJson.d.ts.map +1 -1
  196. package/dist/utils/openapi/actions/toJson.js +9 -11
  197. package/dist/utils/openapi/actions/toJson.js.map +7 -0
  198. package/dist/utils/openapi/actions/toYaml.d.ts +1 -1
  199. package/dist/utils/openapi/actions/toYaml.d.ts.map +1 -1
  200. package/dist/utils/openapi/actions/toYaml.js +9 -11
  201. package/dist/utils/openapi/actions/toYaml.js.map +7 -0
  202. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +5 -5
  203. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +1 -1
  204. package/dist/utils/openapi/commands/dereferenceCommand.js +25 -27
  205. package/dist/utils/openapi/commands/dereferenceCommand.js.map +7 -0
  206. package/dist/utils/openapi/commands/filterCommand.d.ts +9 -9
  207. package/dist/utils/openapi/commands/filterCommand.d.ts.map +1 -1
  208. package/dist/utils/openapi/commands/filterCommand.js +24 -26
  209. package/dist/utils/openapi/commands/filterCommand.js.map +7 -0
  210. package/dist/utils/openapi/commands/loadCommand.d.ts +994 -994
  211. package/dist/utils/openapi/commands/loadCommand.d.ts.map +1 -1
  212. package/dist/utils/openapi/commands/loadCommand.js +40 -42
  213. package/dist/utils/openapi/commands/loadCommand.js.map +7 -0
  214. package/dist/utils/openapi/commands/upgradeCommand.d.ts +311 -311
  215. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +1 -1
  216. package/dist/utils/openapi/commands/upgradeCommand.js +27 -29
  217. package/dist/utils/openapi/commands/upgradeCommand.js.map +7 -0
  218. package/dist/utils/openapi/commands/validateCommand.d.ts +311 -311
  219. package/dist/utils/openapi/commands/validateCommand.d.ts.map +1 -1
  220. package/dist/utils/openapi/commands/validateCommand.js +31 -33
  221. package/dist/utils/openapi/commands/validateCommand.js.map +7 -0
  222. package/dist/utils/openapi/index.d.ts +1 -1
  223. package/dist/utils/openapi/index.d.ts.map +1 -1
  224. package/dist/utils/openapi/index.js +2 -0
  225. package/dist/utils/openapi/index.js.map +7 -0
  226. package/dist/utils/openapi/openapi.d.ts +700 -700
  227. package/dist/utils/openapi/openapi.d.ts.map +1 -1
  228. package/dist/utils/openapi/openapi.js +13 -16
  229. package/dist/utils/openapi/openapi.js.map +7 -0
  230. package/dist/utils/openapi/openapi.test-d.js +14 -0
  231. package/dist/utils/openapi/openapi.test-d.js.map +7 -0
  232. package/dist/utils/openapi/openapi.test.js +309 -0
  233. package/dist/utils/openapi/openapi.test.js.map +7 -0
  234. package/dist/utils/openapi/utils/queueTask.d.ts +1 -1
  235. package/dist/utils/openapi/utils/queueTask.d.ts.map +1 -1
  236. package/dist/utils/openapi/utils/queueTask.js +8 -9
  237. package/dist/utils/openapi/utils/queueTask.js.map +7 -0
  238. package/dist/utils/openapi/utils/workThroughQueue.d.ts +1 -1
  239. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +1 -1
  240. package/dist/utils/openapi/utils/workThroughQueue.js +49 -64
  241. package/dist/utils/openapi/utils/workThroughQueue.js.map +7 -0
  242. package/dist/utils/openapi/utils/workThroughQueue.test.js +244 -0
  243. package/dist/utils/openapi/utils/workThroughQueue.test.js.map +7 -0
  244. package/dist/utils/resolveReferences.d.ts +1 -1
  245. package/dist/utils/resolveReferences.d.ts.map +1 -1
  246. package/dist/utils/resolveReferences.js +91 -139
  247. package/dist/utils/resolveReferences.js.map +7 -0
  248. package/dist/utils/resolveReferences.test.js +567 -0
  249. package/dist/utils/resolveReferences.test.js.map +7 -0
  250. package/dist/utils/toJson.d.ts +1 -1
  251. package/dist/utils/toJson.d.ts.map +1 -1
  252. package/dist/utils/toJson.js +4 -2
  253. package/dist/utils/toJson.js.map +7 -0
  254. package/dist/utils/toYaml.d.ts +1 -1
  255. package/dist/utils/toYaml.d.ts.map +1 -1
  256. package/dist/utils/toYaml.js +5 -4
  257. package/dist/utils/toYaml.js.map +7 -0
  258. package/dist/utils/transform/index.d.ts +1 -1
  259. package/dist/utils/transform/index.d.ts.map +1 -1
  260. package/dist/utils/transform/index.js +2 -0
  261. package/dist/utils/transform/index.js.map +7 -0
  262. package/dist/utils/transform/sanitize.d.ts +3 -3
  263. package/dist/utils/transform/sanitize.d.ts.map +1 -1
  264. package/dist/utils/transform/sanitize.js +22 -21
  265. package/dist/utils/transform/sanitize.js.map +7 -0
  266. package/dist/utils/transform/sanitize.test.js +148 -0
  267. package/dist/utils/transform/sanitize.test.js.map +7 -0
  268. package/dist/utils/transform/utils/addInfoObject.d.ts +1 -1
  269. package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
  270. package/dist/utils/transform/utils/addInfoObject.js +14 -10
  271. package/dist/utils/transform/utils/addInfoObject.js.map +7 -0
  272. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts +1 -1
  273. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
  274. package/dist/utils/transform/utils/addLatestOpenApiVersion.js +8 -5
  275. package/dist/utils/transform/utils/addLatestOpenApiVersion.js.map +7 -0
  276. package/dist/utils/transform/utils/addMissingTags.d.ts +1 -1
  277. package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
  278. package/dist/utils/transform/utils/addMissingTags.js +26 -27
  279. package/dist/utils/transform/utils/addMissingTags.js.map +7 -0
  280. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts +1 -1
  281. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
  282. package/dist/utils/transform/utils/normalizeSecuritySchemes.js +36 -40
  283. package/dist/utils/transform/utils/normalizeSecuritySchemes.js.map +7 -0
  284. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts +1 -1
  285. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
  286. package/dist/utils/transform/utils/rejectSwaggerDocuments.js +8 -6
  287. package/dist/utils/transform/utils/rejectSwaggerDocuments.js.map +7 -0
  288. package/dist/utils/transformErrors.d.ts +1 -1
  289. package/dist/utils/transformErrors.d.ts.map +1 -1
  290. package/dist/utils/transformErrors.js +18 -21
  291. package/dist/utils/transformErrors.js.map +7 -0
  292. package/dist/utils/transformErrors.test.js +17 -0
  293. package/dist/utils/transformErrors.test.js.map +7 -0
  294. package/dist/utils/traverse.d.ts +1 -1
  295. package/dist/utils/traverse.d.ts.map +1 -1
  296. package/dist/utils/traverse.js +19 -22
  297. package/dist/utils/traverse.js.map +7 -0
  298. package/dist/utils/traverse.test.js +68 -0
  299. package/dist/utils/traverse.test.js.map +7 -0
  300. package/dist/utils/unescapeJsonPointer.js +5 -9
  301. package/dist/utils/unescapeJsonPointer.js.map +7 -0
  302. package/dist/utils/unescapeJsonPointer.test.js +19 -0
  303. package/dist/utils/unescapeJsonPointer.test.js.map +7 -0
  304. package/dist/utils/upgrade.d.ts +1 -1
  305. package/dist/utils/upgrade.d.ts.map +1 -1
  306. package/dist/utils/upgrade.js +22 -22
  307. package/dist/utils/upgrade.js.map +7 -0
  308. package/dist/utils/upgrade.test-d.js +16 -0
  309. package/dist/utils/upgrade.test-d.js.map +7 -0
  310. package/dist/utils/upgrade.test.js +57 -0
  311. package/dist/utils/upgrade.test.js.map +7 -0
  312. package/dist/utils/upgradeFromThreeToThreeOne.js +114 -140
  313. package/dist/utils/upgradeFromThreeToThreeOne.js.map +7 -0
  314. package/dist/utils/upgradeFromThreeToThreeOne.test.js +462 -0
  315. package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +7 -0
  316. package/dist/utils/upgradeFromTwoToThree.js +212 -219
  317. package/dist/utils/upgradeFromTwoToThree.js.map +7 -0
  318. package/dist/utils/upgradeFromTwoToThree.test.js +589 -0
  319. package/dist/utils/upgradeFromTwoToThree.test.js.map +7 -0
  320. package/dist/utils/validate.d.ts +1 -1
  321. package/dist/utils/validate.d.ts.map +1 -1
  322. package/dist/utils/validate.js +14 -16
  323. package/dist/utils/validate.js.map +7 -0
  324. package/dist/utils/validate.test.js +64 -0
  325. package/dist/utils/validate.test.js.map +7 -0
  326. package/package.json +6 -7
  327. package/dist/schemas/v2.0/schema.json.js +0 -1623
  328. package/dist/schemas/v3.0/schema.json.js +0 -1673
  329. package/dist/schemas/v3.1/schema.json.js +0 -1451
@@ -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": "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",
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
+ }
@@ -1,6 +1,6 @@
1
- import type { FilterResult, Queue, Task } from '../../../types/index.ts';
2
- import type { DereferenceOptions } from '../../dereference.ts';
3
- import type { FilterCallback } from '../../filter.ts';
1
+ import type { FilterResult, Queue, Task } from '../../../types/index.js';
2
+ import type { DereferenceOptions } from '../../dereference.js';
3
+ import type { FilterCallback } from '../../filter.js';
4
4
  declare global {
5
5
  interface Commands {
6
6
  filter: {
@@ -17,9 +17,9 @@ declare global {
17
17
  */
18
18
  export declare function filterCommand<T extends Task[]>(previousQueue: Queue<T>, options?: FilterCallback): {
19
19
  dereference: (dereferenceOptions?: DereferenceOptions) => {
20
- details: () => Promise<import("../../../types/index.ts").DetailsResult>;
21
- files: () => Promise<import("../../../types/index.ts").Filesystem>;
22
- get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, {
20
+ details: () => Promise<import("../../../index.js").DetailsResult>;
21
+ files: () => Promise<import("../../../index.js").Filesystem>;
22
+ get: () => Promise<import("../../../index.js").CommandChain<[...T, {
23
23
  name: "filter";
24
24
  options?: FilterCallback;
25
25
  }, {
@@ -29,9 +29,9 @@ export declare function filterCommand<T extends Task[]>(previousQueue: Queue<T>,
29
29
  toJson: () => Promise<string>;
30
30
  toYaml: () => Promise<string>;
31
31
  };
32
- details: () => Promise<import("../../../types/index.ts").DetailsResult>;
33
- files: () => Promise<import("../../../types/index.ts").Filesystem>;
34
- get: () => Promise<import("../../../types/index.ts").CommandChain<[...T, {
32
+ details: () => Promise<import("../../../index.js").DetailsResult>;
33
+ files: () => Promise<import("../../../index.js").Filesystem>;
34
+ get: () => Promise<import("../../../index.js").CommandChain<[...T, {
35
35
  name: "filter";
36
36
  options?: FilterCallback;
37
37
  }]>>;
@@ -1 +1 @@
1
- {"version":3,"file":"filterCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/filterCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAC9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AASrD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ,CAAA;gBACd,OAAO,CAAC,EAAE,cAAc,CAAA;aACzB,CAAA;YACD,MAAM,EAAE,YAAY,CAAA;SACrB,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;uCAS1D,kBAAkB;;;;kBApB3C,QAAQ;sBACJ,cAAc;;;;;;;;;;;cADlB,QAAQ;kBACJ,cAAc;;;;EA0B/B"}
1
+ {"version":3,"file":"filterCommand.d.ts","sourceRoot":"","sources":["../../../../src/utils/openapi/commands/filterCommand.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AASlD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ;QAChB,MAAM,EAAE;YACN,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ,CAAA;gBACd,OAAO,CAAC,EAAE,cAAc,CAAA;aACzB,CAAA;YACD,MAAM,EAAE,YAAY,CAAA;SACrB,CAAA;KACF;CACF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc;uCAS1D,kBAAkB;;;;kBApB3C,QAAQ;sBACJ,cAAc;;;;;;;;;;;cADlB,QAAQ;kBACJ,cAAc;;;;EA0B/B"}
@@ -1,28 +1,26 @@
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
- import { dereferenceCommand } from './dereferenceCommand.js';
8
-
9
- /**
10
- * Filter the given OpenAPI document
11
- */
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
+ import { dereferenceCommand } from "./dereferenceCommand.js";
12
8
  function filterCommand(previousQueue, options) {
13
- const task = {
14
- name: 'filter',
15
- options,
16
- };
17
- const queue = queueTask(previousQueue, task);
18
- return {
19
- dereference: (dereferenceOptions) => dereferenceCommand(queue, dereferenceOptions),
20
- details: () => details(queue),
21
- files: () => files(queue),
22
- get: () => get(queue),
23
- toJson: () => toJson(queue),
24
- toYaml: () => toYaml(queue),
25
- };
9
+ const task = {
10
+ name: "filter",
11
+ options
12
+ };
13
+ const queue = queueTask(previousQueue, task);
14
+ return {
15
+ dereference: (dereferenceOptions) => dereferenceCommand(queue, dereferenceOptions),
16
+ details: () => details(queue),
17
+ files: () => files(queue),
18
+ get: () => get(queue),
19
+ toJson: () => toJson(queue),
20
+ toYaml: () => toYaml(queue)
21
+ };
26
22
  }
27
-
28
- export { filterCommand };
23
+ export {
24
+ filterCommand
25
+ };
26
+ //# sourceMappingURL=filterCommand.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/utils/openapi/commands/filterCommand.ts"],
4
+ "sourcesContent": ["import type { FilterResult, Queue, Task } from '../../../types/index'\nimport type { DereferenceOptions } from '../../dereference'\nimport type { FilterCallback } from '../../filter'\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'\nimport { dereferenceCommand } from './dereferenceCommand'\n\ndeclare global {\n interface Commands {\n filter: {\n task: {\n name: 'filter'\n options?: FilterCallback\n }\n result: FilterResult\n }\n }\n}\n\n/**\n * Filter the given OpenAPI document\n */\nexport function filterCommand<T extends Task[]>(previousQueue: Queue<T>, options?: FilterCallback) {\n const task: Task = {\n name: 'filter',\n options,\n }\n\n const queue = queueTask<[...T, typeof task]>(previousQueue, task as Task)\n\n return {\n dereference: (dereferenceOptions?: DereferenceOptions) => dereferenceCommand(queue, dereferenceOptions),\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": "AAGA,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,WAAW;AACpB,SAAS,cAAc;AACvB,SAAS,cAAc;AACvB,SAAS,iBAAiB;AAC1B,SAAS,0BAA0B;AAiB5B,SAAS,cAAgC,eAAyB,SAA0B;AACjG,QAAM,OAAa;AAAA,IACjB,MAAM;AAAA,IACN;AAAA,EACF;AAEA,QAAM,QAAQ,UAA+B,eAAe,IAAY;AAExE,SAAO;AAAA,IACL,aAAa,CAAC,uBAA4C,mBAAmB,OAAO,kBAAkB;AAAA,IACtG,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
+ }