@scalar/openapi-parser 0.11.1 → 0.13.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 (290) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/configuration/index.d.ts +2 -2
  3. package/dist/configuration/index.js +2 -2
  4. package/dist/configuration/index.js.map +1 -1
  5. package/dist/index.d.ts +17 -4
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +34 -4
  8. package/dist/index.js.map +2 -2
  9. package/dist/lib/Validator/Validator.d.ts.map +1 -1
  10. package/dist/lib/Validator/Validator.js +2 -2
  11. package/dist/lib/Validator/Validator.js.map +1 -1
  12. package/dist/lib/Validator/index.d.ts +1 -2
  13. package/dist/lib/Validator/index.d.ts.map +1 -1
  14. package/dist/lib/Validator/index.js +4 -2
  15. package/dist/lib/Validator/index.js.map +2 -2
  16. package/dist/plugins/fetch-urls/{fetchUrls.d.ts → fetch-urls.d.ts} +1 -1
  17. package/dist/plugins/fetch-urls/fetch-urls.d.ts.map +1 -0
  18. package/dist/plugins/fetch-urls/{fetchUrls.js → fetch-urls.js} +1 -1
  19. package/dist/plugins/fetch-urls/fetch-urls.js.map +7 -0
  20. package/dist/plugins/fetch-urls/index.d.ts +1 -1
  21. package/dist/plugins/fetch-urls/index.d.ts.map +1 -1
  22. package/dist/plugins/fetch-urls/index.js +5 -1
  23. package/dist/plugins/fetch-urls/index.js.map +2 -2
  24. package/dist/plugins/read-files/index.d.ts +1 -1
  25. package/dist/plugins/read-files/index.d.ts.map +1 -1
  26. package/dist/plugins/read-files/index.js +4 -1
  27. package/dist/plugins/read-files/index.js.map +2 -2
  28. package/dist/plugins/read-files/{readFiles.d.ts → read-files.d.ts} +1 -1
  29. package/dist/plugins/read-files/read-files.d.ts.map +1 -0
  30. package/dist/plugins/read-files/{readFiles.js → read-files.js} +3 -3
  31. package/dist/plugins/read-files/read-files.js.map +7 -0
  32. package/dist/polyfills/index.d.ts +1 -1
  33. package/dist/polyfills/index.d.ts.map +1 -1
  34. package/dist/polyfills/index.js +22 -2
  35. package/dist/polyfills/index.js.map +2 -2
  36. package/dist/types/index.d.ts.map +1 -1
  37. package/dist/utils/betterAjvErrors/validation-errors/base.js.map +1 -1
  38. package/dist/utils/dereference.d.ts +1 -1
  39. package/dist/utils/dereference.d.ts.map +1 -1
  40. package/dist/utils/dereference.js +3 -3
  41. package/dist/utils/dereference.js.map +1 -1
  42. package/dist/utils/details.d.ts +1 -2
  43. package/dist/utils/details.d.ts.map +1 -1
  44. package/dist/utils/details.js +12 -9
  45. package/dist/utils/details.js.map +2 -2
  46. package/dist/utils/{escapeJsonPointer.d.ts → escape-json-pointer.d.ts} +1 -1
  47. package/dist/utils/escape-json-pointer.d.ts.map +1 -0
  48. package/dist/utils/{escapeJsonPointer.js → escape-json-pointer.js} +1 -1
  49. package/dist/utils/{escapeJsonPointer.js.map → escape-json-pointer.js.map} +1 -1
  50. package/dist/utils/filter.d.ts.map +1 -1
  51. package/dist/utils/filter.js +2 -2
  52. package/dist/utils/filter.js.map +1 -1
  53. package/dist/utils/{getEntrypoint.d.ts → get-entrypoint.d.ts} +1 -1
  54. package/dist/utils/get-entrypoint.d.ts.map +1 -0
  55. package/dist/utils/{getEntrypoint.js → get-entrypoint.js} +1 -1
  56. package/dist/utils/get-entrypoint.js.map +7 -0
  57. package/dist/utils/{getListOfReferences.d.ts → get-list-of-references.d.ts} +1 -1
  58. package/dist/utils/get-list-of-references.d.ts.map +1 -0
  59. package/dist/utils/{getListOfReferences.js → get-list-of-references.js} +1 -1
  60. package/dist/utils/get-list-of-references.js.map +7 -0
  61. package/dist/utils/{getSegmentsFromPath.d.ts → get-segments-from-path.d.ts} +1 -1
  62. package/dist/utils/get-segments-from-path.d.ts.map +1 -0
  63. package/dist/utils/{getSegmentsFromPath.js → get-segments-from-path.js} +2 -2
  64. package/dist/utils/get-segments-from-path.js.map +7 -0
  65. package/dist/utils/{isFilesystem.d.ts → is-filesystem.d.ts} +1 -1
  66. package/dist/utils/is-filesystem.d.ts.map +1 -0
  67. package/dist/utils/{isFilesystem.js → is-filesystem.js} +1 -1
  68. package/dist/utils/is-filesystem.js.map +7 -0
  69. package/dist/utils/{isJson.d.ts → is-json.d.ts} +1 -1
  70. package/dist/utils/is-json.d.ts.map +1 -0
  71. package/dist/utils/{isJson.js → is-json.js} +1 -1
  72. package/dist/utils/{isJson.js.map → is-json.js.map} +1 -1
  73. package/dist/utils/{isObject.d.ts → is-object.d.ts} +1 -1
  74. package/dist/utils/is-object.d.ts.map +1 -0
  75. package/dist/utils/{isObject.js → is-object.js} +1 -1
  76. package/dist/utils/{isObject.js.map → is-object.js.map} +1 -1
  77. package/dist/utils/{isYaml.d.ts → is-yaml.d.ts} +1 -1
  78. package/dist/utils/is-yaml.d.ts.map +1 -0
  79. package/dist/utils/{isYaml.js → is-yaml.js} +1 -1
  80. package/dist/utils/{isYaml.js.map → is-yaml.js.map} +1 -1
  81. package/dist/utils/load/index.d.ts +1 -1
  82. package/dist/utils/load/index.d.ts.map +1 -1
  83. package/dist/utils/load/index.js +4 -1
  84. package/dist/utils/load/index.js.map +2 -2
  85. package/dist/utils/load/load.d.ts.map +1 -1
  86. package/dist/utils/load/load.js +4 -4
  87. package/dist/utils/load/load.js.map +1 -1
  88. package/dist/utils/{makeFilesystem.d.ts → make-filesystem.d.ts} +1 -1
  89. package/dist/utils/make-filesystem.d.ts.map +1 -0
  90. package/dist/utils/{makeFilesystem.js → make-filesystem.js} +3 -3
  91. package/dist/utils/make-filesystem.js.map +7 -0
  92. package/dist/utils/normalize.d.ts +1 -1
  93. package/dist/utils/normalize.d.ts.map +1 -1
  94. package/dist/utils/normalize.js +17 -12
  95. package/dist/utils/normalize.js.map +2 -2
  96. package/dist/utils/{resolveReferences.d.ts → resolve-references.d.ts} +1 -1
  97. package/dist/utils/resolve-references.d.ts.map +1 -0
  98. package/dist/utils/{resolveReferences.js → resolve-references.js} +15 -4
  99. package/dist/utils/resolve-references.js.map +7 -0
  100. package/dist/utils/{toJson.d.ts → to-json.d.ts} +1 -1
  101. package/dist/utils/to-json.d.ts.map +1 -0
  102. package/dist/utils/{toJson.js → to-json.js} +1 -1
  103. package/dist/utils/to-json.js.map +7 -0
  104. package/dist/utils/{toYaml.d.ts → to-yaml.d.ts} +1 -1
  105. package/dist/utils/to-yaml.d.ts.map +1 -0
  106. package/dist/utils/{toYaml.js → to-yaml.js} +1 -1
  107. package/dist/utils/{toYaml.js.map → to-yaml.js.map} +2 -2
  108. package/dist/utils/transform/sanitize.d.ts +2 -0
  109. package/dist/utils/transform/sanitize.d.ts.map +1 -1
  110. package/dist/utils/transform/sanitize.js.map +2 -2
  111. package/dist/utils/transform/utils/addInfoObject.d.ts.map +1 -1
  112. package/dist/utils/transform/utils/addInfoObject.js.map +1 -1
  113. package/dist/utils/transform/utils/addLatestOpenApiVersion.d.ts.map +1 -1
  114. package/dist/utils/transform/utils/addLatestOpenApiVersion.js.map +1 -1
  115. package/dist/utils/transform/utils/addMissingTags.d.ts.map +1 -1
  116. package/dist/utils/transform/utils/addMissingTags.js.map +1 -1
  117. package/dist/utils/transform/utils/normalizeSecuritySchemes.d.ts.map +1 -1
  118. package/dist/utils/transform/utils/normalizeSecuritySchemes.js.map +1 -1
  119. package/dist/utils/transform/utils/rejectSwaggerDocuments.d.ts.map +1 -1
  120. package/dist/utils/transform/utils/rejectSwaggerDocuments.js.map +1 -1
  121. package/dist/utils/{transformErrors.d.ts → transform-errors.d.ts} +1 -1
  122. package/dist/utils/transform-errors.d.ts.map +1 -0
  123. package/dist/utils/{transformErrors.js → transform-errors.js} +1 -1
  124. package/dist/utils/transform-errors.js.map +7 -0
  125. package/dist/utils/traverse.d.ts.map +1 -1
  126. package/dist/utils/traverse.js.map +1 -1
  127. package/dist/utils/{unescapeJsonPointer.d.ts → unescape-json-pointer.d.ts} +1 -1
  128. package/dist/utils/unescape-json-pointer.d.ts.map +1 -0
  129. package/dist/utils/{unescapeJsonPointer.js → unescape-json-pointer.js} +1 -1
  130. package/dist/utils/{unescapeJsonPointer.js.map → unescape-json-pointer.js.map} +1 -1
  131. package/dist/utils/{upgradeFromThreeToThreeOne.d.ts → upgrade-from-three-to-three-one.d.ts} +1 -1
  132. package/dist/utils/upgrade-from-three-to-three-one.d.ts.map +1 -0
  133. package/dist/utils/{upgradeFromThreeToThreeOne.js → upgrade-from-three-to-three-one.js} +1 -2
  134. package/dist/utils/upgrade-from-three-to-three-one.js.map +7 -0
  135. package/dist/utils/{upgradeFromTwoToThree.d.ts → upgrade-from-two-to-three.d.ts} +1 -1
  136. package/dist/utils/upgrade-from-two-to-three.d.ts.map +1 -0
  137. package/dist/utils/{upgradeFromTwoToThree.js → upgrade-from-two-to-three.js} +1 -1
  138. package/dist/utils/{upgradeFromTwoToThree.js.map → upgrade-from-two-to-three.js.map} +1 -1
  139. package/dist/utils/upgrade.bench.js +1 -1
  140. package/dist/utils/upgrade.bench.js.map +1 -1
  141. package/dist/utils/upgrade.d.ts.map +1 -1
  142. package/dist/utils/upgrade.js +4 -4
  143. package/dist/utils/upgrade.js.map +1 -1
  144. package/dist/utils/validate.d.ts.map +1 -1
  145. package/dist/utils/validate.js +1 -1
  146. package/dist/utils/validate.js.map +1 -1
  147. package/package.json +3 -3
  148. package/dist/lib/Validator/Validator.test.js +0 -8
  149. package/dist/lib/Validator/Validator.test.js.map +0 -7
  150. package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +0 -1
  151. package/dist/plugins/fetch-urls/fetchUrls.js.map +0 -7
  152. package/dist/plugins/fetch-urls/fetchUrls.test.js +0 -50
  153. package/dist/plugins/fetch-urls/fetchUrls.test.js.map +0 -7
  154. package/dist/plugins/read-files/readFiles.d.ts.map +0 -1
  155. package/dist/plugins/read-files/readFiles.js.map +0 -7
  156. package/dist/plugins/read-files/readFiles.test.js +0 -20
  157. package/dist/plugins/read-files/readFiles.test.js.map +0 -7
  158. package/dist/utils/dereference.test.js +0 -300
  159. package/dist/utils/dereference.test.js.map +0 -7
  160. package/dist/utils/errors.test.js +0 -48
  161. package/dist/utils/errors.test.js.map +0 -7
  162. package/dist/utils/escapeJsonPointer.d.ts.map +0 -1
  163. package/dist/utils/escapeJsonPointer.test.js +0 -11
  164. package/dist/utils/escapeJsonPointer.test.js.map +0 -7
  165. package/dist/utils/getEntrypoint.d.ts.map +0 -1
  166. package/dist/utils/getEntrypoint.js.map +0 -7
  167. package/dist/utils/getEntrypoint.test.js +0 -18
  168. package/dist/utils/getEntrypoint.test.js.map +0 -7
  169. package/dist/utils/getListOfReferences.d.ts.map +0 -1
  170. package/dist/utils/getListOfReferences.js.map +0 -7
  171. package/dist/utils/getSegmentsFromPath.d.ts.map +0 -1
  172. package/dist/utils/getSegmentsFromPath.js.map +0 -7
  173. package/dist/utils/getSegmentsFromPath.test.js +0 -13
  174. package/dist/utils/getSegmentsFromPath.test.js.map +0 -7
  175. package/dist/utils/index.d.ts +0 -27
  176. package/dist/utils/index.d.ts.map +0 -1
  177. package/dist/utils/index.js +0 -27
  178. package/dist/utils/index.js.map +0 -7
  179. package/dist/utils/isFilesystem.d.ts.map +0 -1
  180. package/dist/utils/isFilesystem.js.map +0 -7
  181. package/dist/utils/isJson.d.ts.map +0 -1
  182. package/dist/utils/isObject.d.ts.map +0 -1
  183. package/dist/utils/isObject.test.js +0 -23
  184. package/dist/utils/isObject.test.js.map +0 -7
  185. package/dist/utils/isYaml.d.ts.map +0 -1
  186. package/dist/utils/load/load.test.js +0 -361
  187. package/dist/utils/load/load.test.js.map +0 -7
  188. package/dist/utils/makeFilesystem.d.ts.map +0 -1
  189. package/dist/utils/makeFilesystem.js.map +0 -7
  190. package/dist/utils/makeFilesystem.test.js +0 -15
  191. package/dist/utils/makeFilesystem.test.js.map +0 -7
  192. package/dist/utils/normalize.test.js +0 -88
  193. package/dist/utils/normalize.test.js.map +0 -7
  194. package/dist/utils/openapi/actions/details.d.ts +0 -7
  195. package/dist/utils/openapi/actions/details.d.ts.map +0 -1
  196. package/dist/utils/openapi/actions/details.js +0 -11
  197. package/dist/utils/openapi/actions/details.js.map +0 -7
  198. package/dist/utils/openapi/actions/files.d.ts +0 -6
  199. package/dist/utils/openapi/actions/files.d.ts.map +0 -1
  200. package/dist/utils/openapi/actions/files.js +0 -9
  201. package/dist/utils/openapi/actions/files.js.map +0 -7
  202. package/dist/utils/openapi/actions/get.d.ts +0 -6
  203. package/dist/utils/openapi/actions/get.d.ts.map +0 -1
  204. package/dist/utils/openapi/actions/get.js +0 -11
  205. package/dist/utils/openapi/actions/get.js.map +0 -7
  206. package/dist/utils/openapi/actions/toJson.d.ts +0 -6
  207. package/dist/utils/openapi/actions/toJson.d.ts.map +0 -1
  208. package/dist/utils/openapi/actions/toJson.js +0 -11
  209. package/dist/utils/openapi/actions/toJson.js.map +0 -7
  210. package/dist/utils/openapi/actions/toYaml.d.ts +0 -6
  211. package/dist/utils/openapi/actions/toYaml.d.ts.map +0 -1
  212. package/dist/utils/openapi/actions/toYaml.js +0 -11
  213. package/dist/utils/openapi/actions/toYaml.js.map +0 -7
  214. package/dist/utils/openapi/commands/dereferenceCommand.d.ts +0 -27
  215. package/dist/utils/openapi/commands/dereferenceCommand.d.ts.map +0 -1
  216. package/dist/utils/openapi/commands/dereferenceCommand.js +0 -27
  217. package/dist/utils/openapi/commands/dereferenceCommand.js.map +0 -7
  218. package/dist/utils/openapi/commands/filterCommand.d.ts +0 -41
  219. package/dist/utils/openapi/commands/filterCommand.d.ts.map +0 -1
  220. package/dist/utils/openapi/commands/filterCommand.js +0 -26
  221. package/dist/utils/openapi/commands/filterCommand.js.map +0 -7
  222. package/dist/utils/openapi/commands/loadCommand.d.ts +0 -8321
  223. package/dist/utils/openapi/commands/loadCommand.d.ts.map +0 -1
  224. package/dist/utils/openapi/commands/loadCommand.js +0 -42
  225. package/dist/utils/openapi/commands/loadCommand.js.map +0 -7
  226. package/dist/utils/openapi/commands/upgradeCommand.d.ts +0 -3406
  227. package/dist/utils/openapi/commands/upgradeCommand.d.ts.map +0 -1
  228. package/dist/utils/openapi/commands/upgradeCommand.js +0 -29
  229. package/dist/utils/openapi/commands/upgradeCommand.js.map +0 -7
  230. package/dist/utils/openapi/commands/validateCommand.d.ts +0 -3451
  231. package/dist/utils/openapi/commands/validateCommand.d.ts.map +0 -1
  232. package/dist/utils/openapi/commands/validateCommand.js +0 -33
  233. package/dist/utils/openapi/commands/validateCommand.js.map +0 -7
  234. package/dist/utils/openapi/index.d.ts +0 -2
  235. package/dist/utils/openapi/index.d.ts.map +0 -1
  236. package/dist/utils/openapi/index.js +0 -2
  237. package/dist/utils/openapi/index.js.map +0 -7
  238. package/dist/utils/openapi/openapi.d.ts +0 -1272
  239. package/dist/utils/openapi/openapi.d.ts.map +0 -1
  240. package/dist/utils/openapi/openapi.js +0 -15
  241. package/dist/utils/openapi/openapi.js.map +0 -7
  242. package/dist/utils/openapi/openapi.test-d.d.ts +0 -2
  243. package/dist/utils/openapi/openapi.test-d.d.ts.map +0 -1
  244. package/dist/utils/openapi/openapi.test-d.js +0 -14
  245. package/dist/utils/openapi/openapi.test-d.js.map +0 -7
  246. package/dist/utils/openapi/openapi.test.js +0 -309
  247. package/dist/utils/openapi/openapi.test.js.map +0 -7
  248. package/dist/utils/openapi/utils/queueTask.d.ts +0 -6
  249. package/dist/utils/openapi/utils/queueTask.d.ts.map +0 -1
  250. package/dist/utils/openapi/utils/queueTask.js +0 -10
  251. package/dist/utils/openapi/utils/queueTask.js.map +0 -7
  252. package/dist/utils/openapi/utils/workThroughQueue.d.ts +0 -6
  253. package/dist/utils/openapi/utils/workThroughQueue.d.ts.map +0 -1
  254. package/dist/utils/openapi/utils/workThroughQueue.js +0 -52
  255. package/dist/utils/openapi/utils/workThroughQueue.js.map +0 -7
  256. package/dist/utils/openapi/utils/workThroughQueue.test.js +0 -244
  257. package/dist/utils/openapi/utils/workThroughQueue.test.js.map +0 -7
  258. package/dist/utils/resolveReferences.d.ts.map +0 -1
  259. package/dist/utils/resolveReferences.js.map +0 -7
  260. package/dist/utils/resolveReferences.test.js +0 -567
  261. package/dist/utils/resolveReferences.test.js.map +0 -7
  262. package/dist/utils/toJson.d.ts.map +0 -1
  263. package/dist/utils/toJson.js.map +0 -7
  264. package/dist/utils/toYaml.d.ts.map +0 -1
  265. package/dist/utils/transform/index.d.ts +0 -2
  266. package/dist/utils/transform/index.d.ts.map +0 -1
  267. package/dist/utils/transform/index.js +0 -2
  268. package/dist/utils/transform/index.js.map +0 -7
  269. package/dist/utils/transform/sanitize.test.js +0 -148
  270. package/dist/utils/transform/sanitize.test.js.map +0 -7
  271. package/dist/utils/transformErrors.d.ts.map +0 -1
  272. package/dist/utils/transformErrors.js.map +0 -7
  273. package/dist/utils/transformErrors.test.js +0 -17
  274. package/dist/utils/transformErrors.test.js.map +0 -7
  275. package/dist/utils/traverse.test.js +0 -68
  276. package/dist/utils/traverse.test.js.map +0 -7
  277. package/dist/utils/unescapeJsonPointer.d.ts.map +0 -1
  278. package/dist/utils/unescapeJsonPointer.test.js +0 -19
  279. package/dist/utils/unescapeJsonPointer.test.js.map +0 -7
  280. package/dist/utils/upgrade.test.js +0 -57
  281. package/dist/utils/upgrade.test.js.map +0 -7
  282. package/dist/utils/upgradeFromThreeToThreeOne.d.ts.map +0 -1
  283. package/dist/utils/upgradeFromThreeToThreeOne.js.map +0 -7
  284. package/dist/utils/upgradeFromThreeToThreeOne.test.js +0 -462
  285. package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +0 -7
  286. package/dist/utils/upgradeFromTwoToThree.d.ts.map +0 -1
  287. package/dist/utils/upgradeFromTwoToThree.test.js +0 -589
  288. package/dist/utils/upgradeFromTwoToThree.test.js.map +0 -7
  289. package/dist/utils/validate.test.js +0 -64
  290. package/dist/utils/validate.test.js.map +0 -7
@@ -1,244 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { workThroughQueue } from "./workThroughQueue.js";
3
- describe("workThroughQueue", () => {
4
- it("loads a specification", async () => {
5
- const result = workThroughQueue({
6
- input: {
7
- openapi: "3.1.0",
8
- info: {
9
- title: "Hello World",
10
- version: "1.0.0"
11
- },
12
- paths: {}
13
- },
14
- specification: {
15
- openapi: "3.1.1",
16
- info: {
17
- title: "Hello World",
18
- version: "1.0.0"
19
- },
20
- paths: {}
21
- },
22
- tasks: [
23
- {
24
- name: "load"
25
- }
26
- ]
27
- });
28
- expect(await result).toStrictEqual({
29
- errors: [],
30
- specification: {
31
- info: {
32
- title: "Hello World",
33
- version: "1.0.0"
34
- },
35
- openapi: "3.1.0",
36
- paths: {}
37
- },
38
- filesystem: [
39
- {
40
- dir: "./",
41
- filename: null,
42
- isEntrypoint: true,
43
- references: [],
44
- specification: {
45
- info: {
46
- title: "Hello World",
47
- version: "1.0.0"
48
- },
49
- openapi: "3.1.0",
50
- paths: {}
51
- }
52
- }
53
- ]
54
- });
55
- });
56
- it("validates a specification", async () => {
57
- const result = workThroughQueue({
58
- input: {
59
- openapi: "3.1.0",
60
- info: {
61
- title: "Hello World",
62
- version: "1.0.0"
63
- },
64
- paths: {}
65
- },
66
- specification: {
67
- openapi: "3.1.0",
68
- info: {
69
- title: "Hello World",
70
- version: "1.0.0"
71
- },
72
- paths: {}
73
- },
74
- tasks: [
75
- {
76
- name: "load"
77
- },
78
- {
79
- name: "validate"
80
- }
81
- ]
82
- });
83
- expect(await result).toStrictEqual({
84
- errors: [],
85
- valid: true,
86
- version: "3.1",
87
- filesystem: [
88
- {
89
- dir: "./",
90
- filename: null,
91
- isEntrypoint: true,
92
- references: [],
93
- specification: {
94
- info: {
95
- title: "Hello World",
96
- version: "1.0.0"
97
- },
98
- openapi: "3.1.0",
99
- paths: {}
100
- }
101
- }
102
- ],
103
- specification: {
104
- openapi: "3.1.0",
105
- info: {
106
- title: "Hello World",
107
- version: "1.0.0"
108
- },
109
- paths: {}
110
- },
111
- schema: {
112
- info: {
113
- title: "Hello World",
114
- version: "1.0.0"
115
- },
116
- openapi: "3.1.0",
117
- paths: {}
118
- }
119
- });
120
- });
121
- it("dereferences a specification", async () => {
122
- const result = workThroughQueue({
123
- input: {
124
- openapi: "3.1.0",
125
- info: {
126
- title: "Hello World",
127
- version: "1.0.0"
128
- },
129
- paths: {}
130
- },
131
- specification: {
132
- openapi: "3.1.0",
133
- info: {
134
- title: "Hello World",
135
- version: "1.0.0"
136
- },
137
- paths: {}
138
- },
139
- tasks: [
140
- {
141
- name: "load"
142
- },
143
- {
144
- name: "dereference"
145
- }
146
- ]
147
- });
148
- expect(await result).toStrictEqual({
149
- errors: [],
150
- specificationType: "openapi",
151
- specificationVersion: "3.1.0",
152
- version: "3.1",
153
- filesystem: [
154
- {
155
- dir: "./",
156
- filename: null,
157
- isEntrypoint: true,
158
- references: [],
159
- specification: {
160
- info: {
161
- title: "Hello World",
162
- version: "1.0.0"
163
- },
164
- openapi: "3.1.0",
165
- paths: {}
166
- }
167
- }
168
- ],
169
- specification: {
170
- openapi: "3.1.0",
171
- info: {
172
- title: "Hello World",
173
- version: "1.0.0"
174
- },
175
- paths: {}
176
- },
177
- schema: {
178
- info: {
179
- title: "Hello World",
180
- version: "1.0.0"
181
- },
182
- openapi: "3.1.0",
183
- paths: {}
184
- }
185
- });
186
- });
187
- it("upgrades a specification", async () => {
188
- const result = workThroughQueue({
189
- input: {
190
- openapi: "3.0.0",
191
- info: {
192
- title: "Hello World",
193
- version: "1.0.0"
194
- },
195
- paths: {}
196
- },
197
- specification: {
198
- openapi: "3.0.0",
199
- info: {
200
- title: "Hello World",
201
- version: "1.0.0"
202
- },
203
- paths: {}
204
- },
205
- tasks: [
206
- {
207
- name: "load"
208
- },
209
- {
210
- name: "upgrade"
211
- }
212
- ]
213
- });
214
- expect(await result).toStrictEqual({
215
- errors: [],
216
- version: "3.1",
217
- specification: {
218
- openapi: "3.1.1",
219
- info: {
220
- title: "Hello World",
221
- version: "1.0.0"
222
- },
223
- paths: {}
224
- },
225
- filesystem: [
226
- {
227
- dir: "./",
228
- filename: null,
229
- isEntrypoint: true,
230
- references: [],
231
- specification: {
232
- info: {
233
- title: "Hello World",
234
- version: "1.0.0"
235
- },
236
- openapi: "3.1.1",
237
- paths: {}
238
- }
239
- }
240
- ]
241
- });
242
- });
243
- });
244
- //# sourceMappingURL=workThroughQueue.test.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/utils/openapi/utils/workThroughQueue.test.ts"],
4
- "sourcesContent": ["import { describe, expect, it } from 'vitest'\n\nimport { workThroughQueue } from './workThroughQueue'\n\ndescribe('workThroughQueue', () => {\n it('loads a specification', async () => {\n const result = workThroughQueue({\n input: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n specification: {\n openapi: '3.1.1',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n tasks: [\n {\n name: 'load',\n },\n ],\n })\n\n expect(await result).toStrictEqual({\n errors: [],\n specification: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n filesystem: [\n {\n dir: './',\n filename: null,\n isEntrypoint: true,\n references: [],\n specification: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n },\n ],\n })\n })\n\n it('validates a specification', async () => {\n const result = workThroughQueue({\n input: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n specification: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n tasks: [\n {\n name: 'load',\n },\n {\n name: 'validate',\n },\n ],\n })\n\n expect(await result).toStrictEqual({\n errors: [],\n valid: true,\n version: '3.1',\n filesystem: [\n {\n dir: './',\n filename: null,\n isEntrypoint: true,\n references: [],\n specification: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n },\n ],\n specification: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n schema: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n })\n })\n\n it('dereferences a specification', async () => {\n const result = workThroughQueue({\n input: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n specification: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n tasks: [\n {\n name: 'load',\n },\n {\n name: 'dereference',\n },\n ],\n })\n\n expect(await result).toStrictEqual({\n errors: [],\n specificationType: 'openapi',\n specificationVersion: '3.1.0',\n version: '3.1',\n filesystem: [\n {\n dir: './',\n filename: null,\n isEntrypoint: true,\n references: [],\n specification: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n },\n ],\n specification: {\n openapi: '3.1.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n schema: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.0',\n paths: {},\n },\n })\n })\n\n it('upgrades a specification', async () => {\n const result = workThroughQueue({\n input: {\n openapi: '3.0.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n specification: {\n openapi: '3.0.0',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n tasks: [\n {\n name: 'load',\n },\n {\n name: 'upgrade',\n },\n ],\n })\n\n expect(await result).toStrictEqual({\n errors: [],\n version: '3.1',\n specification: {\n openapi: '3.1.1',\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n paths: {},\n },\n filesystem: [\n {\n dir: './',\n filename: null,\n isEntrypoint: true,\n references: [],\n specification: {\n info: {\n title: 'Hello World',\n version: '1.0.0',\n },\n openapi: '3.1.1',\n paths: {},\n },\n },\n ],\n })\n })\n})\n"],
5
- "mappings": "AAAA,SAAS,UAAU,QAAQ,UAAU;AAErC,SAAS,wBAAwB;AAEjC,SAAS,oBAAoB,M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,MACV;AAAA,MACA,YAAY;AAAA,QACV;AAAA,UACE,KAAK;AAAA,UACL,UAAU;AAAA,UACV,cAAc;AAAA,UACd,YAAY,CAAC;AAAA,UACb,eAAe;AAAA,YACb,MAAM;AAAA,cACJ,OAAO;AAAA,cACP,SAAS;AAAA,YACX;AAAA,YACA,SAAS;AAAA,YACT,OAAO,CAAC;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH,CAAC;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolveReferences.d.ts","sourceRoot":"","sources":["../../src/utils/resolveReferences.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAGpD,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAe7G,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,OAAO,CAAA;IACd,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,kBAAkB,GAAG;IAC1D;;;;OAIG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,SAAS,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACnE,CAAA;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAE/B,KAAK,EAAE,SAAS,GAAG,UAAU,EAE7B,OAAO,CAAC,EAAE,wBAAwB,EAElC,IAAI,CAAC,EAAE,eAAe,EAEtB,MAAM,GAAE,WAAW,EAAO,GACzB,uBAAuB,CA0BzB"}
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/utils/resolveReferences.ts"],
4
- "sourcesContent": ["import type { OpenAPI } from '@scalar/openapi-types'\n\nimport { ERRORS } from '../configuration/index'\nimport type { AnyObject, ErrorObject, Filesystem, FilesystemEntry, ThrowOnErrorOption } from '../types/index'\nimport { getEntrypoint } from './getEntrypoint'\nimport { getSegmentsFromPath } from './getSegmentsFromPath'\nimport { makeFilesystem } from './makeFilesystem'\n\n// TODO: Add support for all pointer words\n// export const pointerWords = new Set([\n// '$ref',\n// '$id',\n// '$anchor',\n// '$dynamicRef',\n// '$dynamicAnchor',\n// '$schema',\n// ])\n\nexport type ResolveReferencesResult = {\n valid: boolean\n errors: ErrorObject[]\n schema: OpenAPI.Document\n}\n\nexport type ResolveReferencesOptions = ThrowOnErrorOption & {\n /**\n * Fired when dereferenced a schema.\n *\n * Note that for object schemas, its properties may not be dereferenced when the hook is called.\n */\n onDereference?: (data: { schema: AnyObject; ref: string }) => void\n}\n\n/**\n * Takes a specification and resolves all references.\n */\nexport function resolveReferences(\n // Just a specification, or a set of files.\n input: AnyObject | Filesystem,\n // Additional options to control the behaviour\n options?: ResolveReferencesOptions,\n // Fallback to the entrypoint\n file?: FilesystemEntry,\n // Errors that occurred during the process\n errors: ErrorObject[] = [],\n): ResolveReferencesResult {\n // Detach from input\n const clonedInput = structuredClone(input)\n\n // Make it a filesystem, even if it\u2019s just one file\n const filesystem = makeFilesystem(clonedInput)\n\n // Get the main file\n const entrypoint = getEntrypoint(filesystem)\n\n const finalInput = file?.specification ?? entrypoint.specification\n\n // Recursively resolve all references\n dereference(finalInput, filesystem, file ?? entrypoint, new WeakSet(), errors, options)\n\n // Remove duplicats (according to message) from errors\n errors = errors.filter(\n (error, index, self) => index === self.findIndex((t) => t.message === error.message && t.code === error.code),\n )\n\n // Return the resolved specification\n return {\n valid: errors.length === 0,\n errors,\n schema: finalInput as OpenAPI.Document,\n }\n}\n\n/**\n * Resolves the circular reference to an object and deletes the $ref properties (in-place).\n */\nfunction dereference(\n schema: AnyObject,\n filesystem: Filesystem,\n entrypoint: FilesystemEntry,\n // references to resolved object\n resolvedSchemas: WeakSet<object>,\n // error output\n errors: ErrorObject[],\n\n options?: ResolveReferencesOptions,\n): void {\n if (schema === null || resolvedSchemas.has(schema)) {\n return\n }\n resolvedSchemas.add(schema)\n\n function resolveExternal(externalFile: FilesystemEntry) {\n dereference(externalFile.specification, filesystem, externalFile, resolvedSchemas, errors, options)\n\n return externalFile\n }\n\n while (schema.$ref !== undefined) {\n // Find the referenced content\n const resolved = resolveUri(schema.$ref, options, entrypoint, filesystem, resolveExternal, errors)\n\n // invalid\n if (typeof resolved !== 'object' || resolved === null) {\n break\n }\n const dereferencedRef = schema.$ref\n\n // Get rid of the reference\n delete schema.$ref\n\n for (const key of Object.keys(resolved)) {\n if (schema[key] === undefined) {\n schema[key] = resolved[key]\n }\n }\n\n if (dereferencedRef) {\n options?.onDereference?.({ schema, ref: dereferencedRef })\n }\n }\n\n // Iterate over the whole object\n for (const value of Object.values(schema)) {\n if (typeof value === 'object' && value !== null) {\n dereference(value, filesystem, entrypoint, resolvedSchemas, errors, options)\n }\n }\n}\n\n/**\n * Resolves a URI to a part of the specification\n *\n * The output is not necessarily dereferenced\n */\nfunction resolveUri(\n // 'foobar.json#/foo/bar'\n uri: string,\n options: ResolveReferencesOptions,\n // { filename: './foobar.json '}\n file: FilesystemEntry,\n // [ { filename: './foobar.json '} ]\n filesystem: Filesystem,\n\n // a function to resolve references in external file\n resolve: (file: FilesystemEntry) => FilesystemEntry,\n\n errors: ErrorObject[],\n): AnyObject | undefined {\n // Ignore invalid URIs\n if (typeof uri !== 'string') {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n\n return undefined\n }\n\n // Understand the URI\n const [prefix, path] = uri.split('#', 2)\n\n /** Check whether the file is pointing to itself */\n const isDifferentFile = prefix !== file.filename\n\n // External references\n if (prefix && isDifferentFile) {\n const externalReference = filesystem.find((entry) => {\n return entry.filename === prefix\n })\n\n if (!externalReference) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix))\n }\n\n errors.push({\n code: 'EXTERNAL_REFERENCE_NOT_FOUND',\n message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix),\n })\n\n return undefined\n }\n // $ref: 'other-file.yaml'\n if (path === undefined) {\n return externalReference.specification\n }\n\n // $ref: 'other-file.yaml#/foo/bar'\n // resolve refs first before accessing properties directly\n return resolveUri(`#${path}`, options, resolve(externalReference), filesystem, resolve, errors)\n }\n\n // Pointers\n const segments = getSegmentsFromPath(path)\n\n // Try to find the URI\n try {\n return segments.reduce((acc, key) => {\n return acc[key]\n }, file.specification)\n } catch (_error) {\n if (options?.throwOnError) {\n throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri))\n }\n\n errors.push({\n code: 'INVALID_REFERENCE',\n message: ERRORS.INVALID_REFERENCE.replace('%s', uri),\n })\n }\n\n return undefined\n}\n"],
5
- "mappings": "AAEA,SAAS,cAAc;AAEvB,SAAS,qBAAqB;AAC9B,SAAS,2BAA2B;AACpC,SAAS,sBAAsB;AA8BxB,SAAS,kBAEd,OAEA,SAEA,MAEA,SAAwB,CAAC,GACA;AAEzB,QAAM,cAAc,gBAAgB,KAAK;AAGzC,QAAM,aAAa,eAAe,WAAW;AAG7C,QAAM,aAAa,cAAc,UAAU;AAE3C,QAAM,aAAa,MAAM,iBAAiB,WAAW;AAGrD,cAAY,YAAY,YAAY,QAAQ,YAAY,oBAAI,QAAQ,GAAG,QAAQ,OAAO;AAGtF,WAAS,OAAO;AAAA,IACd,CAAC,OAAO,OAAO,SAAS,UAAU,KAAK,UAAU,CAAC,MAAM,EAAE,YAAY,MAAM,WAAW,EAAE,SAAS,MAAM,IAAI;AAAA,EAC9G;AAGA,SAAO;AAAA,IACL,OAAO,OAAO,WAAW;AAAA,IACzB;AAAA,IACA,QAAQ;AAAA,EACV;AACF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