@scalar/openapi-parser 0.10.15 → 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 (332) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +0 -22
  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 -2
  22. package/dist/plugins/fetch-urls/fetchUrls.d.ts.map +1 -1
  23. package/dist/plugins/fetch-urls/fetchUrls.js +36 -111
  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 -70
  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 +5 -24
  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 +1 -2
  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 +3 -12
  168. package/dist/utils/load/load.d.ts.map +1 -1
  169. package/dist/utils/load/load.js +89 -149
  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 +2 -19
  174. package/dist/utils/makeFilesystem.d.ts.map +1 -1
  175. package/dist/utils/makeFilesystem.js +20 -68
  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 +1174 -1174
  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 +700 -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 -7
  248. package/dist/utils/resolveReferences.d.ts.map +1 -1
  249. package/dist/utils/resolveReferences.js +91 -149
  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 +1 -1
  298. package/dist/utils/traverse.d.ts.map +1 -1
  299. package/dist/utils/traverse.js +19 -22
  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.d.ts +1 -1
  308. package/dist/utils/upgrade.d.ts.map +1 -1
  309. package/dist/utils/upgrade.js +22 -22
  310. package/dist/utils/upgrade.js.map +7 -0
  311. package/dist/utils/upgrade.test-d.js +16 -0
  312. package/dist/utils/upgrade.test-d.js.map +7 -0
  313. package/dist/utils/upgrade.test.js +57 -0
  314. package/dist/utils/upgrade.test.js.map +7 -0
  315. package/dist/utils/upgradeFromThreeToThreeOne.js +114 -140
  316. package/dist/utils/upgradeFromThreeToThreeOne.js.map +7 -0
  317. package/dist/utils/upgradeFromThreeToThreeOne.test.js +462 -0
  318. package/dist/utils/upgradeFromThreeToThreeOne.test.js.map +7 -0
  319. package/dist/utils/upgradeFromTwoToThree.js +212 -219
  320. package/dist/utils/upgradeFromTwoToThree.js.map +7 -0
  321. package/dist/utils/upgradeFromTwoToThree.test.js +589 -0
  322. package/dist/utils/upgradeFromTwoToThree.test.js.map +7 -0
  323. package/dist/utils/validate.d.ts +1 -1
  324. package/dist/utils/validate.d.ts.map +1 -1
  325. package/dist/utils/validate.js +14 -16
  326. package/dist/utils/validate.js.map +7 -0
  327. package/dist/utils/validate.test.js +64 -0
  328. package/dist/utils/validate.test.js.map +7 -0
  329. package/package.json +6 -8
  330. package/dist/schemas/v2.0/schema.json.js +0 -1623
  331. package/dist/schemas/v3.0/schema.json.js +0 -1673
  332. package/dist/schemas/v3.1/schema.json.js +0 -1451
@@ -1,235 +1,228 @@
1
- import { traverse } from './traverse.js';
2
-
3
- /**
4
- * Upgrade Swagger 2.0 to OpenAPI 3.0
5
- *
6
- * https://swagger.io/blog/news/whats-new-in-openapi-3-0/
7
- */
1
+ import { traverse } from "./traverse.js";
8
2
  function upgradeFromTwoToThree(originalSpecification) {
9
- let specification = originalSpecification;
10
- // Version
11
- if (specification !== null && typeof specification.swagger === 'string' && specification.swagger?.startsWith('2.0')) {
12
- specification.openapi = '3.0.4';
13
- delete specification.swagger;
14
- }
15
- else {
16
- // Skip if it’s something else than 3.0.x
17
- return specification;
18
- }
19
- // Servers
20
- if (specification.host) {
21
- const schemes = Array.isArray(specification.schemes) && specification.schemes?.length ? specification.schemes : ['http'];
22
- specification.servers = schemes.map((scheme) => ({
23
- url: `${scheme}://${specification.host}${specification.basePath ?? ''}`,
24
- }));
25
- delete specification.basePath;
26
- delete specification.schemes;
27
- delete specification.host;
28
- }
29
- else if (specification.basePath) {
30
- specification.servers = [{ url: specification.basePath }];
31
- delete specification.basePath;
32
- }
33
- // Schemas
34
- if (specification.definitions) {
35
- specification.components = Object.assign({}, specification.components, {
36
- schemas: specification.definitions,
37
- });
38
- delete specification.definitions;
39
- // Rewrite $refs to definitions
40
- specification = traverse(specification, (schema) => {
41
- if (schema.$ref?.startsWith('#/definitions/')) {
42
- schema.$ref = schema.$ref.replace(/^#\/definitions\//, '#/components/schemas/');
43
- }
44
- return schema;
45
- });
46
- }
3
+ let specification = originalSpecification;
4
+ if (specification !== null && typeof specification.swagger === "string" && specification.swagger?.startsWith("2.0")) {
5
+ specification.openapi = "3.0.4";
6
+ delete specification.swagger;
7
+ } else {
8
+ return specification;
9
+ }
10
+ if (specification.host) {
11
+ const schemes = Array.isArray(specification.schemes) && specification.schemes?.length ? specification.schemes : ["http"];
12
+ specification.servers = schemes.map((scheme) => ({
13
+ url: `${scheme}://${specification.host}${specification.basePath ?? ""}`
14
+ }));
15
+ delete specification.basePath;
16
+ delete specification.schemes;
17
+ delete specification.host;
18
+ } else if (specification.basePath) {
19
+ specification.servers = [{ url: specification.basePath }];
20
+ delete specification.basePath;
21
+ }
22
+ if (specification.definitions) {
23
+ specification.components = Object.assign({}, specification.components, {
24
+ schemas: specification.definitions
25
+ });
26
+ delete specification.definitions;
47
27
  specification = traverse(specification, (schema) => {
48
- if (schema.type === 'file') {
49
- schema.type = 'string';
50
- schema.format = 'binary';
51
- }
52
- return schema;
28
+ if (schema.$ref?.startsWith("#/definitions/")) {
29
+ schema.$ref = schema.$ref.replace(/^#\/definitions\//, "#/components/schemas/");
30
+ }
31
+ return schema;
53
32
  });
54
- // Paths
55
- if (typeof specification.paths === 'object') {
56
- for (const path in specification.paths) {
57
- if (Object.hasOwn(specification.paths, path)) {
58
- const pathItem = specification.paths[path];
59
- for (const method in pathItem) {
60
- if (Object.hasOwn(pathItem, method)) {
61
- const operationItem = pathItem[method];
62
- // Request bodies
63
- if (operationItem.parameters) {
64
- const bodyParameter = structuredClone(operationItem.parameters.find((parameter) => parameter.in === 'body') ?? {});
65
- if (bodyParameter && Object.keys(bodyParameter).length) {
66
- delete bodyParameter.name;
67
- delete bodyParameter.in;
68
- const consumes = specification.consumes ?? operationItem.consumes ?? ['application/json'];
69
- if (typeof operationItem.requestBody !== 'object') {
70
- operationItem.requestBody = {};
71
- }
72
- if (typeof operationItem.requestBody.content !== 'object') {
73
- operationItem.requestBody.content = {};
74
- }
75
- const { schema, ...requestBody } = bodyParameter;
76
- operationItem.requestBody = {
77
- ...operationItem.requestBody,
78
- ...requestBody,
79
- };
80
- for (const type of consumes) {
81
- operationItem.requestBody.content[type] = {
82
- schema: schema,
83
- };
84
- }
85
- }
86
- // Delete body parameter
87
- operationItem.parameters = operationItem.parameters.filter((parameter) => parameter.in !== 'body');
88
- delete operationItem.consumes;
89
- // formData parameters
90
- const formDataParameters = operationItem.parameters.filter((parameter) => parameter.in === 'formData');
91
- if (formDataParameters.length > 0) {
92
- if (typeof operationItem.requestBody !== 'object') {
93
- operationItem.requestBody = {};
94
- }
95
- if (typeof operationItem.requestBody.content !== 'object') {
96
- operationItem.requestBody.content = {};
97
- }
98
- operationItem.requestBody.content['application/x-www-form-urlencoded'] = {
99
- schema: {
100
- type: 'object',
101
- properties: {},
102
- required: [], // Initialize required array
103
- },
104
- };
105
- for (const param of formDataParameters) {
106
- operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.properties[param.name] =
107
- {
108
- type: param.type,
109
- description: param.description,
110
- };
111
- // Add to required array if param is required
112
- if (param.required) {
113
- operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.required.push(param.name);
114
- }
115
- }
116
- // Remove formData parameters from the parameters array
117
- operationItem.parameters = operationItem.parameters.filter((parameter) => parameter.in !== 'formData');
118
- }
119
- operationItem.parameters = operationItem.parameters.map((parameter) => transformParameterObject(parameter));
120
- }
121
- // Responses
122
- if (operationItem.responses) {
123
- for (const response in operationItem.responses) {
124
- if (Object.hasOwn(operationItem.responses, response)) {
125
- const responseItem = operationItem.responses[response];
126
- if (responseItem.headers) {
127
- responseItem.headers = Object.entries(responseItem.headers).reduce((acc, [name, header]) => {
128
- return {
129
- [name]: transformParameterObject(header),
130
- ...acc,
131
- };
132
- }, {});
133
- }
134
- if (responseItem.schema) {
135
- const produces = specification.produces ?? operationItem.produces ?? ['application/json'];
136
- if (typeof responseItem.content !== 'object') {
137
- responseItem.content = {};
138
- }
139
- for (const type of produces) {
140
- responseItem.content[type] = {
141
- schema: responseItem.schema,
142
- };
143
- }
144
- delete responseItem.schema;
145
- }
146
- }
147
- }
148
- }
149
- delete operationItem.produces;
150
- // Delete empty parameters
151
- if (operationItem.parameters?.length === 0) {
152
- delete operationItem.parameters;
153
- }
33
+ }
34
+ specification = traverse(specification, (schema) => {
35
+ if (schema.type === "file") {
36
+ schema.type = "string";
37
+ schema.format = "binary";
38
+ }
39
+ return schema;
40
+ });
41
+ if (typeof specification.paths === "object") {
42
+ for (const path in specification.paths) {
43
+ if (Object.hasOwn(specification.paths, path)) {
44
+ const pathItem = specification.paths[path];
45
+ for (const method in pathItem) {
46
+ if (Object.hasOwn(pathItem, method)) {
47
+ const operationItem = pathItem[method];
48
+ if (operationItem.parameters) {
49
+ const bodyParameter = structuredClone(
50
+ operationItem.parameters.find((parameter) => parameter.in === "body") ?? {}
51
+ );
52
+ if (bodyParameter && Object.keys(bodyParameter).length) {
53
+ delete bodyParameter.name;
54
+ delete bodyParameter.in;
55
+ const consumes = specification.consumes ?? operationItem.consumes ?? ["application/json"];
56
+ if (typeof operationItem.requestBody !== "object") {
57
+ operationItem.requestBody = {};
58
+ }
59
+ if (typeof operationItem.requestBody.content !== "object") {
60
+ operationItem.requestBody.content = {};
61
+ }
62
+ const { schema, ...requestBody } = bodyParameter;
63
+ operationItem.requestBody = {
64
+ ...operationItem.requestBody,
65
+ ...requestBody
66
+ };
67
+ for (const type of consumes) {
68
+ operationItem.requestBody.content[type] = {
69
+ schema
70
+ };
71
+ }
72
+ }
73
+ operationItem.parameters = operationItem.parameters.filter(
74
+ (parameter) => parameter.in !== "body"
75
+ );
76
+ delete operationItem.consumes;
77
+ const formDataParameters = operationItem.parameters.filter(
78
+ (parameter) => parameter.in === "formData"
79
+ );
80
+ if (formDataParameters.length > 0) {
81
+ if (typeof operationItem.requestBody !== "object") {
82
+ operationItem.requestBody = {};
83
+ }
84
+ if (typeof operationItem.requestBody.content !== "object") {
85
+ operationItem.requestBody.content = {};
86
+ }
87
+ operationItem.requestBody.content["application/x-www-form-urlencoded"] = {
88
+ schema: {
89
+ type: "object",
90
+ properties: {},
91
+ required: []
92
+ // Initialize required array
93
+ }
94
+ };
95
+ for (const param of formDataParameters) {
96
+ operationItem.requestBody.content["application/x-www-form-urlencoded"].schema.properties[param.name] = {
97
+ type: param.type,
98
+ description: param.description
99
+ };
100
+ if (param.required) {
101
+ operationItem.requestBody.content["application/x-www-form-urlencoded"].schema.required.push(
102
+ param.name
103
+ );
104
+ }
105
+ }
106
+ operationItem.parameters = operationItem.parameters.filter(
107
+ (parameter) => parameter.in !== "formData"
108
+ );
109
+ }
110
+ operationItem.parameters = operationItem.parameters.map(
111
+ (parameter) => transformParameterObject(parameter)
112
+ );
113
+ }
114
+ if (operationItem.responses) {
115
+ for (const response in operationItem.responses) {
116
+ if (Object.hasOwn(operationItem.responses, response)) {
117
+ const responseItem = operationItem.responses[response];
118
+ if (responseItem.headers) {
119
+ responseItem.headers = Object.entries(responseItem.headers).reduce((acc, [name, header]) => {
120
+ return {
121
+ [name]: transformParameterObject(header),
122
+ ...acc
123
+ };
124
+ }, {});
125
+ }
126
+ if (responseItem.schema) {
127
+ const produces = specification.produces ?? operationItem.produces ?? ["application/json"];
128
+ if (typeof responseItem.content !== "object") {
129
+ responseItem.content = {};
130
+ }
131
+ for (const type of produces) {
132
+ responseItem.content[type] = {
133
+ schema: responseItem.schema
134
+ };
154
135
  }
136
+ delete responseItem.schema;
137
+ }
155
138
  }
139
+ }
156
140
  }
141
+ delete operationItem.produces;
142
+ if (operationItem.parameters?.length === 0) {
143
+ delete operationItem.parameters;
144
+ }
145
+ }
157
146
  }
147
+ }
158
148
  }
159
- // Upgrade securityDefinitions
160
- if (specification.securityDefinitions) {
161
- if (typeof specification.components !== 'object') {
162
- specification.components = {};
163
- }
164
- // Assert that components is of type OpenAPIV3.ComponentsObject
165
- specification.components = specification.components;
166
- Object.assign(specification.components, { securitySchemes: {} });
167
- for (const [key, securityScheme] of Object.entries(specification.securityDefinitions)) {
168
- if (typeof securityScheme === 'object') {
169
- if ('type' in securityScheme && securityScheme.type === 'oauth2') {
170
- const { flow, authorizationUrl, tokenUrl, scopes } = securityScheme;
171
- // Assert that securitySchemes is of type OpenAPIV3.SecuritySchemeObject
172
- Object.assign(specification.components.securitySchemes, {
173
- [key]: {
174
- type: 'oauth2',
175
- flows: {
176
- [flow]: Object.assign({}, authorizationUrl && { authorizationUrl }, tokenUrl && { tokenUrl }, scopes && { scopes }),
177
- },
178
- },
179
- });
180
- }
181
- else if ('type' in securityScheme && securityScheme.type === 'basic') {
182
- Object.assign(specification.components.securitySchemes, {
183
- [key]: {
184
- type: 'http',
185
- scheme: 'basic',
186
- },
187
- });
188
- }
189
- else {
190
- Object.assign(specification.components.securitySchemes, {
191
- [key]: securityScheme,
192
- });
193
- }
149
+ }
150
+ if (specification.securityDefinitions) {
151
+ if (typeof specification.components !== "object") {
152
+ specification.components = {};
153
+ }
154
+ specification.components = specification.components;
155
+ Object.assign(specification.components, { securitySchemes: {} });
156
+ for (const [key, securityScheme] of Object.entries(specification.securityDefinitions)) {
157
+ if (typeof securityScheme === "object") {
158
+ if ("type" in securityScheme && securityScheme.type === "oauth2") {
159
+ const { flow, authorizationUrl, tokenUrl, scopes } = securityScheme;
160
+ Object.assign(specification.components.securitySchemes, {
161
+ [key]: {
162
+ type: "oauth2",
163
+ flows: {
164
+ [flow]: Object.assign(
165
+ {},
166
+ authorizationUrl && { authorizationUrl },
167
+ tokenUrl && { tokenUrl },
168
+ scopes && { scopes }
169
+ )
170
+ }
171
+ }
172
+ });
173
+ } else if ("type" in securityScheme && securityScheme.type === "basic") {
174
+ Object.assign(specification.components.securitySchemes, {
175
+ [key]: {
176
+ type: "http",
177
+ scheme: "basic"
194
178
  }
179
+ });
180
+ } else {
181
+ Object.assign(specification.components.securitySchemes, {
182
+ [key]: securityScheme
183
+ });
195
184
  }
196
- delete specification.securityDefinitions;
185
+ }
197
186
  }
198
- return specification;
187
+ delete specification.securityDefinitions;
188
+ }
189
+ return specification;
199
190
  }
200
191
  function transformItemsObject(obj) {
201
- const schemaProperties = [
202
- 'type',
203
- 'format',
204
- 'items',
205
- 'maximum',
206
- 'exclusiveMaximum',
207
- 'minimum',
208
- 'exclusiveMinimum',
209
- 'maxLength',
210
- 'minLength',
211
- 'pattern',
212
- 'maxItems',
213
- 'minItems',
214
- 'uniqueItems',
215
- 'enum',
216
- 'multipleOf',
217
- ];
218
- return schemaProperties.reduce((acc, property) => {
219
- if (Object.hasOwn(obj, property)) {
220
- acc[property] = obj[property];
221
- delete obj[property];
222
- }
223
- return acc;
224
- }, {});
192
+ const schemaProperties = [
193
+ "type",
194
+ "format",
195
+ "items",
196
+ "maximum",
197
+ "exclusiveMaximum",
198
+ "minimum",
199
+ "exclusiveMinimum",
200
+ "maxLength",
201
+ "minLength",
202
+ "pattern",
203
+ "maxItems",
204
+ "minItems",
205
+ "uniqueItems",
206
+ "enum",
207
+ "multipleOf"
208
+ ];
209
+ return schemaProperties.reduce((acc, property) => {
210
+ if (Object.hasOwn(obj, property)) {
211
+ acc[property] = obj[property];
212
+ delete obj[property];
213
+ }
214
+ return acc;
215
+ }, {});
225
216
  }
226
217
  function transformParameterObject(parameter) {
227
- delete parameter.collectionFormat;
228
- delete parameter.default;
229
- return {
230
- schema: transformItemsObject(parameter),
231
- ...parameter,
232
- };
218
+ delete parameter.collectionFormat;
219
+ delete parameter.default;
220
+ return {
221
+ schema: transformItemsObject(parameter),
222
+ ...parameter
223
+ };
233
224
  }
234
-
235
- export { upgradeFromTwoToThree };
225
+ export {
226
+ upgradeFromTwoToThree
227
+ };
228
+ //# sourceMappingURL=upgradeFromTwoToThree.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/utils/upgradeFromTwoToThree.ts"],
4
+ "sourcesContent": ["import type { OpenAPIV2, OpenAPIV3 } from '@scalar/openapi-types'\nimport type { UnknownObject } from '@scalar/types/utils'\n\nimport { traverse } from './traverse'\n\n/**\n * Upgrade Swagger 2.0 to OpenAPI 3.0\n *\n * https://swagger.io/blog/news/whats-new-in-openapi-3-0/\n */\nexport function upgradeFromTwoToThree(originalSpecification: UnknownObject) {\n let specification = originalSpecification\n\n // Version\n if (specification !== null && typeof specification.swagger === 'string' && specification.swagger?.startsWith('2.0')) {\n specification.openapi = '3.0.4'\n delete specification.swagger\n } else {\n // Skip if it\u2019s something else than 3.0.x\n return specification\n }\n\n // Servers\n if (specification.host) {\n const schemes =\n Array.isArray(specification.schemes) && specification.schemes?.length ? specification.schemes : ['http']\n\n specification.servers = schemes.map((scheme: string[]) => ({\n url: `${scheme}://${specification.host}${specification.basePath ?? ''}`,\n }))\n\n delete specification.basePath\n delete specification.schemes\n delete specification.host\n } else if (specification.basePath) {\n specification.servers = [{ url: specification.basePath }]\n delete specification.basePath\n }\n\n // Schemas\n if (specification.definitions) {\n specification.components = Object.assign({}, specification.components, {\n schemas: specification.definitions,\n })\n\n delete specification.definitions\n\n // Rewrite $refs to definitions\n specification = traverse(specification, (schema) => {\n if (schema.$ref?.startsWith('#/definitions/')) {\n schema.$ref = schema.$ref.replace(/^#\\/definitions\\//, '#/components/schemas/')\n }\n\n return schema\n })\n }\n\n specification = traverse(specification, (schema) => {\n if (schema.type === 'file') {\n schema.type = 'string'\n schema.format = 'binary'\n }\n\n return schema\n })\n\n // Paths\n if (typeof specification.paths === 'object') {\n for (const path in specification.paths) {\n if (Object.hasOwn(specification.paths, path)) {\n const pathItem = specification.paths[path]\n\n for (const method in pathItem) {\n if (Object.hasOwn(pathItem, method)) {\n const operationItem = pathItem[method]\n\n // Request bodies\n if (operationItem.parameters) {\n const bodyParameter = structuredClone(\n operationItem.parameters.find((parameter: OpenAPIV3.ParameterObject) => parameter.in === 'body') ?? {},\n )\n\n if (bodyParameter && Object.keys(bodyParameter).length) {\n delete bodyParameter.name\n delete bodyParameter.in\n\n const consumes = specification.consumes ?? operationItem.consumes ?? ['application/json']\n\n if (typeof operationItem.requestBody !== 'object') {\n operationItem.requestBody = {}\n }\n\n if (typeof operationItem.requestBody.content !== 'object') {\n operationItem.requestBody.content = {}\n }\n\n const { schema, ...requestBody } = bodyParameter\n\n operationItem.requestBody = {\n ...operationItem.requestBody,\n ...requestBody,\n }\n\n for (const type of consumes) {\n operationItem.requestBody.content[type] = {\n schema: schema,\n }\n }\n }\n\n // Delete body parameter\n operationItem.parameters = operationItem.parameters.filter(\n (parameter: OpenAPIV2.ParameterObject) => parameter.in !== 'body',\n )\n\n delete operationItem.consumes\n\n // formData parameters\n const formDataParameters = operationItem.parameters.filter(\n (parameter: OpenAPIV2.ParameterObject) => parameter.in === 'formData',\n )\n\n if (formDataParameters.length > 0) {\n if (typeof operationItem.requestBody !== 'object') {\n operationItem.requestBody = {}\n }\n\n if (typeof operationItem.requestBody.content !== 'object') {\n operationItem.requestBody.content = {}\n }\n\n operationItem.requestBody.content['application/x-www-form-urlencoded'] = {\n schema: {\n type: 'object',\n properties: {},\n required: [], // Initialize required array\n },\n }\n\n for (const param of formDataParameters) {\n operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.properties[param.name] =\n {\n type: param.type,\n description: param.description,\n }\n\n // Add to required array if param is required\n if (param.required) {\n operationItem.requestBody.content['application/x-www-form-urlencoded'].schema.required.push(\n param.name,\n )\n }\n }\n\n // Remove formData parameters from the parameters array\n operationItem.parameters = operationItem.parameters.filter(\n (parameter: OpenAPIV2.ParameterObject) => parameter.in !== 'formData',\n )\n }\n\n operationItem.parameters = operationItem.parameters.map((parameter) =>\n transformParameterObject(parameter),\n )\n }\n\n // Responses\n if (operationItem.responses) {\n for (const response in operationItem.responses) {\n if (Object.hasOwn(operationItem.responses, response)) {\n const responseItem = operationItem.responses[response]\n\n if (responseItem.headers) {\n responseItem.headers = Object.entries(responseItem.headers).reduce((acc, [name, header]) => {\n return {\n [name]: transformParameterObject(header),\n ...acc,\n }\n }, {})\n }\n if (responseItem.schema) {\n const produces = specification.produces ?? operationItem.produces ?? ['application/json']\n\n if (typeof responseItem.content !== 'object') {\n responseItem.content = {}\n }\n\n for (const type of produces) {\n responseItem.content[type] = {\n schema: responseItem.schema,\n }\n }\n\n delete responseItem.schema\n }\n }\n }\n }\n\n delete operationItem.produces\n\n // Delete empty parameters\n if (operationItem.parameters?.length === 0) {\n delete operationItem.parameters\n }\n }\n }\n }\n }\n }\n\n // Upgrade securityDefinitions\n if (specification.securityDefinitions) {\n if (typeof specification.components !== 'object') {\n specification.components = {}\n }\n\n // Assert that components is of type OpenAPIV3.ComponentsObject\n specification.components = specification.components as OpenAPIV3.ComponentsObject\n\n Object.assign(specification.components, { securitySchemes: {} })\n\n for (const [key, securityScheme] of Object.entries(specification.securityDefinitions)) {\n if (typeof securityScheme === 'object') {\n if ('type' in securityScheme && securityScheme.type === 'oauth2') {\n const { flow, authorizationUrl, tokenUrl, scopes } = securityScheme as {\n type: 'oauth2'\n flow?: string\n authorizationUrl?: string\n tokenUrl?: string\n scopes?: Record<string, string>\n }\n\n // Assert that securitySchemes is of type OpenAPIV3.SecuritySchemeObject\n Object.assign((specification.components as OpenAPIV3.ComponentsObject).securitySchemes, {\n [key]: {\n type: 'oauth2',\n flows: {\n [flow as string]: Object.assign(\n {},\n authorizationUrl && { authorizationUrl },\n tokenUrl && { tokenUrl },\n scopes && { scopes },\n ),\n },\n },\n })\n } else if ('type' in securityScheme && securityScheme.type === 'basic') {\n Object.assign((specification.components as OpenAPIV3.ComponentsObject).securitySchemes, {\n [key]: {\n type: 'http',\n scheme: 'basic',\n },\n })\n } else {\n Object.assign((specification.components as OpenAPIV3.ComponentsObject).securitySchemes, {\n [key]: securityScheme,\n })\n }\n }\n }\n\n delete specification.securityDefinitions\n }\n\n return specification as OpenAPIV3.Document\n}\n\nfunction transformItemsObject<T extends Record<PropertyKey, unknown>>(obj: T): OpenAPIV3.SchemaObject {\n const schemaProperties = [\n 'type',\n 'format',\n 'items',\n 'maximum',\n 'exclusiveMaximum',\n 'minimum',\n 'exclusiveMinimum',\n 'maxLength',\n 'minLength',\n 'pattern',\n 'maxItems',\n 'minItems',\n 'uniqueItems',\n 'enum',\n 'multipleOf',\n ]\n\n return schemaProperties.reduce((acc, property) => {\n if (Object.hasOwn(obj, property)) {\n acc[property] = obj[property]\n delete obj[property]\n }\n\n return acc\n }, {} as OpenAPIV3.SchemaObject)\n}\n\nfunction transformParameterObject(parameter: OpenAPIV2.ParameterObject): OpenAPIV3.ParameterObject {\n delete parameter.collectionFormat\n delete parameter.default\n\n return {\n schema: transformItemsObject(parameter),\n ...parameter,\n }\n}\n"],
5
+ "mappings": "AAGA,SAAS,gBAAgB;AAOlB,SAAS,sBAAsB,uBAAsC;AAC1E,MAAI,gBAAgB;AAGpB,MAAI,kBAAkB,QAAQ,OAAO,cAAc,YAAY,YAAY,cAAc,SAAS,WAAW,KAAK,GAAG;AACnH,kBAAc,UAAU;AACxB,WAAO,cAAc;AAAA,EACvB,OAAO;AAE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