@speclynx/apidom-reference 4.0.1 → 4.0.3

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 (275) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/package.json +26 -27
  3. package/src/File.cjs +50 -0
  4. package/src/File.mjs +44 -0
  5. package/src/File.ts +63 -0
  6. package/src/Reference.cjs +31 -0
  7. package/src/Reference.mjs +27 -0
  8. package/src/Reference.ts +38 -0
  9. package/src/ReferenceSet.cjs +60 -0
  10. package/src/ReferenceSet.mjs +57 -0
  11. package/src/ReferenceSet.ts +73 -0
  12. package/src/bundle/index.cjs +61 -0
  13. package/src/bundle/index.mjs +55 -0
  14. package/src/bundle/index.ts +57 -0
  15. package/src/bundle/strategies/BundleStrategy.cjs +20 -0
  16. package/src/bundle/strategies/BundleStrategy.mjs +16 -0
  17. package/src/bundle/strategies/BundleStrategy.ts +27 -0
  18. package/src/bundle/strategies/openapi-3-1/index.cjs +35 -0
  19. package/src/bundle/strategies/openapi-3-1/index.mjs +29 -0
  20. package/src/bundle/strategies/openapi-3-1/index.ts +57 -0
  21. package/src/configuration/empty.cjs +9 -0
  22. package/src/configuration/empty.mjs +1 -0
  23. package/src/configuration/empty.ts +1 -0
  24. package/src/configuration/saturated.cjs +88 -0
  25. package/src/configuration/saturated.mjs +80 -0
  26. package/src/configuration/saturated.ts +72 -0
  27. package/src/dereference/index.cjs +90 -0
  28. package/src/dereference/index.mjs +83 -0
  29. package/src/dereference/index.ts +96 -0
  30. package/src/dereference/strategies/DereferenceStrategy.cjs +20 -0
  31. package/src/dereference/strategies/DereferenceStrategy.mjs +16 -0
  32. package/src/dereference/strategies/DereferenceStrategy.ts +27 -0
  33. package/src/dereference/strategies/apidom/index.cjs +89 -0
  34. package/src/dereference/strategies/apidom/index.mjs +83 -0
  35. package/src/dereference/strategies/apidom/index.ts +128 -0
  36. package/src/dereference/strategies/apidom/selectors/element-id.cjs +47 -0
  37. package/src/dereference/strategies/apidom/selectors/element-id.mjs +41 -0
  38. package/src/dereference/strategies/apidom/selectors/element-id.ts +48 -0
  39. package/src/dereference/strategies/apidom/visitor.cjs +266 -0
  40. package/src/dereference/strategies/apidom/visitor.mjs +259 -0
  41. package/src/dereference/strategies/apidom/visitor.ts +316 -0
  42. package/src/dereference/strategies/arazzo-1/index.cjs +109 -0
  43. package/src/dereference/strategies/arazzo-1/index.mjs +100 -0
  44. package/src/dereference/strategies/arazzo-1/index.ts +158 -0
  45. package/src/dereference/strategies/arazzo-1/selectors/$anchor.cjs +12 -0
  46. package/src/dereference/strategies/arazzo-1/selectors/$anchor.mjs +1 -0
  47. package/src/dereference/strategies/arazzo-1/selectors/$anchor.ts +9 -0
  48. package/src/dereference/strategies/arazzo-1/selectors/uri.cjs +8 -0
  49. package/src/dereference/strategies/arazzo-1/selectors/uri.mjs +1 -0
  50. package/src/dereference/strategies/arazzo-1/selectors/uri.ts +5 -0
  51. package/src/dereference/strategies/arazzo-1/source-descriptions.cjs +248 -0
  52. package/src/dereference/strategies/arazzo-1/source-descriptions.mjs +243 -0
  53. package/src/dereference/strategies/arazzo-1/source-descriptions.ts +317 -0
  54. package/src/dereference/strategies/arazzo-1/util.cjs +37 -0
  55. package/src/dereference/strategies/arazzo-1/util.mjs +29 -0
  56. package/src/dereference/strategies/arazzo-1/util.ts +33 -0
  57. package/src/dereference/strategies/arazzo-1/visitor.cjs +507 -0
  58. package/src/dereference/strategies/arazzo-1/visitor.mjs +500 -0
  59. package/src/dereference/strategies/arazzo-1/visitor.ts +574 -0
  60. package/src/dereference/strategies/asyncapi-2/index.cjs +94 -0
  61. package/src/dereference/strategies/asyncapi-2/index.mjs +88 -0
  62. package/src/dereference/strategies/asyncapi-2/index.ts +133 -0
  63. package/src/dereference/strategies/asyncapi-2/visitor.cjs +501 -0
  64. package/src/dereference/strategies/asyncapi-2/visitor.mjs +494 -0
  65. package/src/dereference/strategies/asyncapi-2/visitor.ts +589 -0
  66. package/src/dereference/strategies/openapi-2/index.cjs +96 -0
  67. package/src/dereference/strategies/openapi-2/index.mjs +90 -0
  68. package/src/dereference/strategies/openapi-2/index.ts +136 -0
  69. package/src/dereference/strategies/openapi-2/visitor.cjs +629 -0
  70. package/src/dereference/strategies/openapi-2/visitor.mjs +622 -0
  71. package/src/dereference/strategies/openapi-2/visitor.ts +745 -0
  72. package/src/dereference/strategies/openapi-3-0/index.cjs +96 -0
  73. package/src/dereference/strategies/openapi-3-0/index.mjs +90 -0
  74. package/src/dereference/strategies/openapi-3-0/index.ts +134 -0
  75. package/src/dereference/strategies/openapi-3-0/visitor.cjs +622 -0
  76. package/src/dereference/strategies/openapi-3-0/visitor.mjs +615 -0
  77. package/src/dereference/strategies/openapi-3-0/visitor.ts +760 -0
  78. package/src/dereference/strategies/openapi-3-1/index.cjs +99 -0
  79. package/src/dereference/strategies/openapi-3-1/index.mjs +90 -0
  80. package/src/dereference/strategies/openapi-3-1/index.ts +141 -0
  81. package/src/dereference/strategies/openapi-3-1/selectors/$anchor.cjs +65 -0
  82. package/src/dereference/strategies/openapi-3-1/selectors/$anchor.mjs +54 -0
  83. package/src/dereference/strategies/openapi-3-1/selectors/$anchor.ts +64 -0
  84. package/src/dereference/strategies/openapi-3-1/selectors/uri.cjs +50 -0
  85. package/src/dereference/strategies/openapi-3-1/selectors/uri.mjs +42 -0
  86. package/src/dereference/strategies/openapi-3-1/selectors/uri.ts +54 -0
  87. package/src/dereference/strategies/openapi-3-1/util.cjs +68 -0
  88. package/src/dereference/strategies/openapi-3-1/util.mjs +59 -0
  89. package/src/dereference/strategies/openapi-3-1/util.ts +83 -0
  90. package/src/dereference/strategies/openapi-3-1/visitor.cjs +874 -0
  91. package/src/dereference/strategies/openapi-3-1/visitor.mjs +867 -0
  92. package/src/dereference/strategies/openapi-3-1/visitor.ts +1053 -0
  93. package/src/dereference/util.cjs +31 -0
  94. package/src/dereference/util.mjs +27 -0
  95. package/src/dereference/util.ts +29 -0
  96. package/src/errors/BundleError.cjs +10 -0
  97. package/src/errors/BundleError.mjs +7 -0
  98. package/src/errors/BundleError.ts +8 -0
  99. package/src/errors/DereferenceError.cjs +10 -0
  100. package/src/errors/DereferenceError.mjs +7 -0
  101. package/src/errors/DereferenceError.ts +8 -0
  102. package/src/errors/EvaluationElementIdError.cjs +10 -0
  103. package/src/errors/EvaluationElementIdError.mjs +7 -0
  104. package/src/errors/EvaluationElementIdError.ts +8 -0
  105. package/src/errors/EvaluationJsonSchema$anchorError.cjs +11 -0
  106. package/src/errors/EvaluationJsonSchema$anchorError.mjs +6 -0
  107. package/src/errors/EvaluationJsonSchema$anchorError.ts +8 -0
  108. package/src/errors/EvaluationJsonSchemaUriError.cjs +11 -0
  109. package/src/errors/EvaluationJsonSchemaUriError.mjs +6 -0
  110. package/src/errors/EvaluationJsonSchemaUriError.ts +8 -0
  111. package/src/errors/InvalidJsonSchema$anchorError.cjs +15 -0
  112. package/src/errors/InvalidJsonSchema$anchorError.mjs +10 -0
  113. package/src/errors/InvalidJsonSchema$anchorError.ts +12 -0
  114. package/src/errors/JsonSchema$anchorError.cjs +10 -0
  115. package/src/errors/JsonSchema$anchorError.mjs +7 -0
  116. package/src/errors/JsonSchema$anchorError.ts +8 -0
  117. package/src/errors/JsonSchemaUriError.cjs +10 -0
  118. package/src/errors/JsonSchemaUriError.mjs +7 -0
  119. package/src/errors/JsonSchemaUriError.ts +8 -0
  120. package/src/errors/MaximumBundleDepthError.cjs +11 -0
  121. package/src/errors/MaximumBundleDepthError.mjs +6 -0
  122. package/src/errors/MaximumBundleDepthError.ts +8 -0
  123. package/src/errors/MaximumDereferenceDepthError.cjs +11 -0
  124. package/src/errors/MaximumDereferenceDepthError.mjs +6 -0
  125. package/src/errors/MaximumDereferenceDepthError.ts +8 -0
  126. package/src/errors/MaximumResolveDepthError.cjs +11 -0
  127. package/src/errors/MaximumResolveDepthError.mjs +6 -0
  128. package/src/errors/MaximumResolveDepthError.ts +8 -0
  129. package/src/errors/ParseError.cjs +10 -0
  130. package/src/errors/ParseError.mjs +7 -0
  131. package/src/errors/ParseError.ts +8 -0
  132. package/src/errors/ParserError.cjs +11 -0
  133. package/src/errors/ParserError.mjs +6 -0
  134. package/src/errors/ParserError.ts +8 -0
  135. package/src/errors/PluginError.cjs +18 -0
  136. package/src/errors/PluginError.mjs +15 -0
  137. package/src/errors/PluginError.ts +15 -0
  138. package/src/errors/ResolveError.cjs +10 -0
  139. package/src/errors/ResolveError.mjs +7 -0
  140. package/src/errors/ResolveError.ts +8 -0
  141. package/src/errors/ResolverError.cjs +11 -0
  142. package/src/errors/ResolverError.mjs +6 -0
  143. package/src/errors/ResolverError.ts +8 -0
  144. package/src/errors/UnmatchedBundleStrategyError.cjs +11 -0
  145. package/src/errors/UnmatchedBundleStrategyError.mjs +6 -0
  146. package/src/errors/UnmatchedBundleStrategyError.ts +8 -0
  147. package/src/errors/UnmatchedDereferenceStrategyError.cjs +11 -0
  148. package/src/errors/UnmatchedDereferenceStrategyError.mjs +6 -0
  149. package/src/errors/UnmatchedDereferenceStrategyError.ts +8 -0
  150. package/src/errors/UnmatchedParserError.cjs +11 -0
  151. package/src/errors/UnmatchedParserError.mjs +6 -0
  152. package/src/errors/UnmatchedParserError.ts +8 -0
  153. package/src/errors/UnmatchedResolveStrategyError.cjs +11 -0
  154. package/src/errors/UnmatchedResolveStrategyError.mjs +6 -0
  155. package/src/errors/UnmatchedResolveStrategyError.ts +8 -0
  156. package/src/errors/UnmatchedResolverError.cjs +11 -0
  157. package/src/errors/UnmatchedResolverError.mjs +6 -0
  158. package/src/errors/UnmatchedResolverError.ts +8 -0
  159. package/src/errors/UnresolvableReferenceError.cjs +11 -0
  160. package/src/errors/UnresolvableReferenceError.mjs +6 -0
  161. package/src/errors/UnresolvableReferenceError.ts +8 -0
  162. package/src/index.cjs +146 -0
  163. package/src/index.mjs +103 -0
  164. package/src/index.ts +135 -0
  165. package/src/options/index.cjs +194 -0
  166. package/src/options/index.mjs +191 -0
  167. package/src/options/index.ts +239 -0
  168. package/src/options/util.cjs +24 -0
  169. package/src/options/util.mjs +19 -0
  170. package/src/options/util.ts +22 -0
  171. package/src/parse/index.cjs +69 -0
  172. package/src/parse/index.mjs +63 -0
  173. package/src/parse/index.ts +67 -0
  174. package/src/parse/parsers/Parser.cjs +62 -0
  175. package/src/parse/parsers/Parser.mjs +58 -0
  176. package/src/parse/parsers/Parser.ts +80 -0
  177. package/src/parse/parsers/apidom-json/index.cjs +70 -0
  178. package/src/parse/parsers/apidom-json/index.mjs +64 -0
  179. package/src/parse/parsers/apidom-json/index.ts +78 -0
  180. package/src/parse/parsers/arazzo-json-1/index.cjs +62 -0
  181. package/src/parse/parsers/arazzo-json-1/index.mjs +56 -0
  182. package/src/parse/parsers/arazzo-json-1/index.ts +76 -0
  183. package/src/parse/parsers/arazzo-json-1/source-descriptions.cjs +221 -0
  184. package/src/parse/parsers/arazzo-json-1/source-descriptions.mjs +214 -0
  185. package/src/parse/parsers/arazzo-json-1/source-descriptions.ts +280 -0
  186. package/src/parse/parsers/arazzo-yaml-1/index.cjs +62 -0
  187. package/src/parse/parsers/arazzo-yaml-1/index.mjs +56 -0
  188. package/src/parse/parsers/arazzo-yaml-1/index.ts +77 -0
  189. package/src/parse/parsers/arazzo-yaml-1/source-descriptions.cjs +12 -0
  190. package/src/parse/parsers/arazzo-yaml-1/source-descriptions.mjs +7 -0
  191. package/src/parse/parsers/arazzo-yaml-1/source-descriptions.ts +16 -0
  192. package/src/parse/parsers/asyncapi-json-2/index.cjs +54 -0
  193. package/src/parse/parsers/asyncapi-json-2/index.mjs +48 -0
  194. package/src/parse/parsers/asyncapi-json-2/index.ts +58 -0
  195. package/src/parse/parsers/asyncapi-yaml-2/index.cjs +54 -0
  196. package/src/parse/parsers/asyncapi-yaml-2/index.mjs +48 -0
  197. package/src/parse/parsers/asyncapi-yaml-2/index.ts +58 -0
  198. package/src/parse/parsers/binary/index-browser.cjs +56 -0
  199. package/src/parse/parsers/binary/index-browser.mjs +50 -0
  200. package/src/parse/parsers/binary/index-browser.ts +60 -0
  201. package/src/parse/parsers/binary/index-node.cjs +51 -0
  202. package/src/parse/parsers/binary/index-node.mjs +45 -0
  203. package/src/parse/parsers/binary/index-node.ts +57 -0
  204. package/src/parse/parsers/json/index.cjs +53 -0
  205. package/src/parse/parsers/json/index.mjs +47 -0
  206. package/src/parse/parsers/json/index.ts +52 -0
  207. package/src/parse/parsers/openapi-json-2/index.cjs +54 -0
  208. package/src/parse/parsers/openapi-json-2/index.mjs +48 -0
  209. package/src/parse/parsers/openapi-json-2/index.ts +58 -0
  210. package/src/parse/parsers/openapi-json-3-0/index.cjs +54 -0
  211. package/src/parse/parsers/openapi-json-3-0/index.mjs +48 -0
  212. package/src/parse/parsers/openapi-json-3-0/index.ts +59 -0
  213. package/src/parse/parsers/openapi-json-3-1/index.cjs +54 -0
  214. package/src/parse/parsers/openapi-json-3-1/index.mjs +48 -0
  215. package/src/parse/parsers/openapi-json-3-1/index.ts +59 -0
  216. package/src/parse/parsers/openapi-yaml-2/index.cjs +54 -0
  217. package/src/parse/parsers/openapi-yaml-2/index.mjs +48 -0
  218. package/src/parse/parsers/openapi-yaml-2/index.ts +58 -0
  219. package/src/parse/parsers/openapi-yaml-3-0/index.cjs +54 -0
  220. package/src/parse/parsers/openapi-yaml-3-0/index.mjs +48 -0
  221. package/src/parse/parsers/openapi-yaml-3-0/index.ts +59 -0
  222. package/src/parse/parsers/openapi-yaml-3-1/index.cjs +54 -0
  223. package/src/parse/parsers/openapi-yaml-3-1/index.mjs +48 -0
  224. package/src/parse/parsers/openapi-yaml-3-1/index.ts +59 -0
  225. package/src/parse/parsers/yaml-1-2/index.cjs +56 -0
  226. package/src/parse/parsers/yaml-1-2/index.mjs +50 -0
  227. package/src/parse/parsers/yaml-1-2/index.ts +60 -0
  228. package/src/resolve/index.cjs +67 -0
  229. package/src/resolve/index.mjs +60 -0
  230. package/src/resolve/index.ts +75 -0
  231. package/src/resolve/resolvers/HTTPResolver.cjs +45 -0
  232. package/src/resolve/resolvers/HTTPResolver.mjs +37 -0
  233. package/src/resolve/resolvers/HTTPResolver.ts +58 -0
  234. package/src/resolve/resolvers/Resolver.cjs +20 -0
  235. package/src/resolve/resolvers/Resolver.mjs +16 -0
  236. package/src/resolve/resolvers/Resolver.ts +25 -0
  237. package/src/resolve/resolvers/file/index-browser.cjs +24 -0
  238. package/src/resolve/resolvers/file/index-browser.mjs +19 -0
  239. package/src/resolve/resolvers/file/index-browser.ts +24 -0
  240. package/src/resolve/resolvers/file/index-node.cjs +49 -0
  241. package/src/resolve/resolvers/file/index-node.mjs +42 -0
  242. package/src/resolve/resolvers/file/index-node.ts +55 -0
  243. package/src/resolve/resolvers/http-axios/cache/MemoryCache.cjs +41 -0
  244. package/src/resolve/resolvers/http-axios/cache/MemoryCache.mjs +37 -0
  245. package/src/resolve/resolvers/http-axios/cache/MemoryCache.ts +46 -0
  246. package/src/resolve/resolvers/http-axios/index.cjs +113 -0
  247. package/src/resolve/resolvers/http-axios/index.mjs +105 -0
  248. package/src/resolve/resolvers/http-axios/index.ts +130 -0
  249. package/src/resolve/strategies/ResolveStrategy.cjs +20 -0
  250. package/src/resolve/strategies/ResolveStrategy.mjs +16 -0
  251. package/src/resolve/strategies/ResolveStrategy.ts +26 -0
  252. package/src/resolve/strategies/apidom/index.cjs +49 -0
  253. package/src/resolve/strategies/apidom/index.mjs +43 -0
  254. package/src/resolve/strategies/apidom/index.ts +78 -0
  255. package/src/resolve/strategies/asyncapi-2/index.cjs +49 -0
  256. package/src/resolve/strategies/asyncapi-2/index.mjs +43 -0
  257. package/src/resolve/strategies/asyncapi-2/index.ts +78 -0
  258. package/src/resolve/strategies/openapi-2/index.cjs +49 -0
  259. package/src/resolve/strategies/openapi-2/index.mjs +43 -0
  260. package/src/resolve/strategies/openapi-2/index.ts +78 -0
  261. package/src/resolve/strategies/openapi-3-0/index.cjs +49 -0
  262. package/src/resolve/strategies/openapi-3-0/index.mjs +43 -0
  263. package/src/resolve/strategies/openapi-3-0/index.ts +78 -0
  264. package/src/resolve/strategies/openapi-3-1/index.cjs +49 -0
  265. package/src/resolve/strategies/openapi-3-1/index.mjs +43 -0
  266. package/src/resolve/strategies/openapi-3-1/index.ts +78 -0
  267. package/src/resolve/util.cjs +37 -0
  268. package/src/resolve/util.mjs +30 -0
  269. package/src/resolve/util.ts +39 -0
  270. package/src/util/plugins.cjs +39 -0
  271. package/src/util/plugins.mjs +34 -0
  272. package/src/util/plugins.ts +37 -0
  273. package/src/util/url.cjs +288 -0
  274. package/src/util/url.mjs +274 -0
  275. package/src/util/url.ts +285 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [4.0.3](https://github.com/speclynx/apidom/compare/v4.0.2...v4.0.3) (2026-03-11)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **release:** fix v4.0.2 failed release ([b4dc1c4](https://github.com/speclynx/apidom/commit/b4dc1c48e8d9b2986a70e49b5554eb0a166d7528))
11
+
12
+ ## [4.0.2](https://github.com/speclynx/apidom/compare/v4.0.1...v4.0.2) (2026-03-11)
13
+
14
+ **Note:** Version bump only for package @speclynx/apidom-reference
15
+
6
16
  ## [4.0.1](https://github.com/speclynx/apidom/compare/v4.0.0...v4.0.1) (2026-03-11)
7
17
 
8
18
  **Note:** Version bump only for package @speclynx/apidom-reference
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@speclynx/apidom-reference",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Advanced algorithms for semantic ApiDOM manipulations like dereferencing or resolution.",
5
5
  "keywords": [
6
6
  "apidom",
@@ -254,29 +254,29 @@
254
254
  "license": "Apache-2.0",
255
255
  "dependencies": {
256
256
  "@babel/runtime-corejs3": "^7.28.4",
257
- "@speclynx/apidom-core": "4.0.1",
258
- "@speclynx/apidom-datamodel": "4.0.1",
259
- "@speclynx/apidom-error": "4.0.1",
260
- "@speclynx/apidom-json-pointer": "4.0.1",
261
- "@speclynx/apidom-ns-arazzo-1": "4.0.1",
262
- "@speclynx/apidom-ns-asyncapi-2": "4.0.1",
263
- "@speclynx/apidom-ns-json-schema-2020-12": "4.0.1",
264
- "@speclynx/apidom-ns-openapi-2": "4.0.1",
265
- "@speclynx/apidom-ns-openapi-3-0": "4.0.1",
266
- "@speclynx/apidom-ns-openapi-3-1": "4.0.1",
267
- "@speclynx/apidom-parser-adapter-arazzo-json-1": "4.0.1",
268
- "@speclynx/apidom-parser-adapter-arazzo-yaml-1": "4.0.1",
269
- "@speclynx/apidom-parser-adapter-asyncapi-json-2": "4.0.1",
270
- "@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "4.0.1",
271
- "@speclynx/apidom-parser-adapter-json": "4.0.1",
272
- "@speclynx/apidom-parser-adapter-openapi-json-2": "4.0.1",
273
- "@speclynx/apidom-parser-adapter-openapi-json-3-0": "4.0.1",
274
- "@speclynx/apidom-parser-adapter-openapi-json-3-1": "4.0.1",
275
- "@speclynx/apidom-parser-adapter-openapi-yaml-2": "4.0.1",
276
- "@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "4.0.1",
277
- "@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "4.0.1",
278
- "@speclynx/apidom-parser-adapter-yaml-1-2": "4.0.1",
279
- "@speclynx/apidom-traverse": "4.0.1",
257
+ "@speclynx/apidom-core": "4.0.3",
258
+ "@speclynx/apidom-datamodel": "4.0.3",
259
+ "@speclynx/apidom-error": "4.0.3",
260
+ "@speclynx/apidom-json-pointer": "4.0.3",
261
+ "@speclynx/apidom-ns-arazzo-1": "4.0.3",
262
+ "@speclynx/apidom-ns-asyncapi-2": "4.0.3",
263
+ "@speclynx/apidom-ns-json-schema-2020-12": "4.0.3",
264
+ "@speclynx/apidom-ns-openapi-2": "4.0.3",
265
+ "@speclynx/apidom-ns-openapi-3-0": "4.0.3",
266
+ "@speclynx/apidom-ns-openapi-3-1": "4.0.3",
267
+ "@speclynx/apidom-parser-adapter-arazzo-json-1": "4.0.3",
268
+ "@speclynx/apidom-parser-adapter-arazzo-yaml-1": "4.0.3",
269
+ "@speclynx/apidom-parser-adapter-asyncapi-json-2": "4.0.3",
270
+ "@speclynx/apidom-parser-adapter-asyncapi-yaml-2": "4.0.3",
271
+ "@speclynx/apidom-parser-adapter-json": "4.0.3",
272
+ "@speclynx/apidom-parser-adapter-openapi-json-2": "4.0.3",
273
+ "@speclynx/apidom-parser-adapter-openapi-json-3-0": "4.0.3",
274
+ "@speclynx/apidom-parser-adapter-openapi-json-3-1": "4.0.3",
275
+ "@speclynx/apidom-parser-adapter-openapi-yaml-2": "4.0.3",
276
+ "@speclynx/apidom-parser-adapter-openapi-yaml-3-0": "4.0.3",
277
+ "@speclynx/apidom-parser-adapter-openapi-yaml-3-1": "4.0.3",
278
+ "@speclynx/apidom-parser-adapter-yaml-1-2": "4.0.3",
279
+ "@speclynx/apidom-traverse": "4.0.3",
280
280
  "@swaggerexpert/arazzo-runtime-expression": "^2.0.3",
281
281
  "axios": "^1.13.5",
282
282
  "picomatch": "^4.0.3",
@@ -289,8 +289,7 @@
289
289
  "axios-mock-adapter": "^2.0.0"
290
290
  },
291
291
  "files": [
292
- "src/**/*.mjs",
293
- "src/**/*.cjs",
292
+ "src/",
294
293
  "dist/",
295
294
  "types/",
296
295
  "LICENSES",
@@ -298,5 +297,5 @@
298
297
  "README.md",
299
298
  "CHANGELOG.md"
300
299
  ],
301
- "gitHead": "223132a9b00081ca04842efc2736a491f7876f44"
300
+ "gitHead": "6ccfa09c02232516215e7de3ead276641957e626"
302
301
  }
package/src/File.cjs ADDED
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
4
+ exports.__esModule = true;
5
+ exports.default = void 0;
6
+ var _ramda = require("ramda");
7
+ var _ramdaAdjunct = require("ramda-adjunct");
8
+ var url = _interopRequireWildcard(require("./util/url.cjs"));
9
+ /**
10
+ * This class represents a File object with url and data.
11
+ * @public
12
+ */
13
+
14
+ /**
15
+ * @public
16
+ */
17
+ class File {
18
+ uri;
19
+ mediaType;
20
+ data;
21
+ parseResult;
22
+ constructor({
23
+ uri,
24
+ mediaType = 'text/plain',
25
+ data,
26
+ parseResult
27
+ }) {
28
+ this.uri = uri;
29
+ this.mediaType = mediaType;
30
+ this.data = data;
31
+ this.parseResult = parseResult;
32
+ }
33
+ get extension() {
34
+ if ((0, _ramdaAdjunct.isString)(this.uri)) {
35
+ return url.getExtension(this.uri);
36
+ }
37
+ return '';
38
+ }
39
+ toString() {
40
+ if (typeof this.data === 'string') {
41
+ return this.data;
42
+ }
43
+ if (this.data instanceof ArrayBuffer || ['ArrayBuffer'].includes((0, _ramda.type)(this.data)) || ArrayBuffer.isView(this.data)) {
44
+ const textDecoder = new TextDecoder('utf-8');
45
+ return textDecoder.decode(this.data);
46
+ }
47
+ return String(this.data);
48
+ }
49
+ }
50
+ var _default = exports.default = File;
package/src/File.mjs ADDED
@@ -0,0 +1,44 @@
1
+ import { type } from 'ramda';
2
+ import { isString } from 'ramda-adjunct';
3
+ import * as url from "./util/url.mjs";
4
+ /**
5
+ * This class represents a File object with url and data.
6
+ * @public
7
+ */
8
+ /**
9
+ * @public
10
+ */
11
+ class File {
12
+ uri;
13
+ mediaType;
14
+ data;
15
+ parseResult;
16
+ constructor({
17
+ uri,
18
+ mediaType = 'text/plain',
19
+ data,
20
+ parseResult
21
+ }) {
22
+ this.uri = uri;
23
+ this.mediaType = mediaType;
24
+ this.data = data;
25
+ this.parseResult = parseResult;
26
+ }
27
+ get extension() {
28
+ if (isString(this.uri)) {
29
+ return url.getExtension(this.uri);
30
+ }
31
+ return '';
32
+ }
33
+ toString() {
34
+ if (typeof this.data === 'string') {
35
+ return this.data;
36
+ }
37
+ if (this.data instanceof ArrayBuffer || ['ArrayBuffer'].includes(type(this.data)) || ArrayBuffer.isView(this.data)) {
38
+ const textDecoder = new TextDecoder('utf-8');
39
+ return textDecoder.decode(this.data);
40
+ }
41
+ return String(this.data);
42
+ }
43
+ }
44
+ export default File;
package/src/File.ts ADDED
@@ -0,0 +1,63 @@
1
+ import { type } from 'ramda';
2
+ import { isString } from 'ramda-adjunct';
3
+ import { ParseResultElement } from '@speclynx/apidom-datamodel';
4
+
5
+ import * as url from './util/url.ts';
6
+
7
+ /**
8
+ * This class represents a File object with url and data.
9
+ * @public
10
+ */
11
+
12
+ export interface FileOptions {
13
+ readonly uri: string;
14
+ readonly mediaType?: string;
15
+ readonly data?: Buffer | DataView | ArrayBuffer | Uint8Array | string;
16
+ readonly parseResult?: ParseResultElement;
17
+ }
18
+
19
+ /**
20
+ * @public
21
+ */
22
+ class File {
23
+ public uri: string;
24
+
25
+ public mediaType: string;
26
+
27
+ public data?: Buffer | DataView | ArrayBuffer | Uint8Array | string;
28
+
29
+ public parseResult?: ParseResultElement;
30
+
31
+ constructor({ uri, mediaType = 'text/plain', data, parseResult }: FileOptions) {
32
+ this.uri = uri;
33
+ this.mediaType = mediaType;
34
+ this.data = data;
35
+ this.parseResult = parseResult;
36
+ }
37
+
38
+ get extension(): string {
39
+ if (isString(this.uri)) {
40
+ return url.getExtension(this.uri);
41
+ }
42
+ return '';
43
+ }
44
+
45
+ toString(): string {
46
+ if (typeof this.data === 'string') {
47
+ return this.data;
48
+ }
49
+
50
+ if (
51
+ this.data instanceof ArrayBuffer ||
52
+ ['ArrayBuffer'].includes(type(this.data)) ||
53
+ ArrayBuffer.isView(this.data)
54
+ ) {
55
+ const textDecoder = new TextDecoder('utf-8');
56
+ return textDecoder.decode(this.data as Buffer | DataView | ArrayBuffer);
57
+ }
58
+
59
+ return String(this.data);
60
+ }
61
+ }
62
+
63
+ export default File;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ /**
6
+ * @public
7
+ */
8
+
9
+ /**
10
+ * @public
11
+ */
12
+ class Reference {
13
+ uri;
14
+ depth;
15
+ value;
16
+ refSet;
17
+ errors;
18
+ constructor({
19
+ uri,
20
+ depth = 0,
21
+ refSet,
22
+ value
23
+ }) {
24
+ this.uri = uri;
25
+ this.value = value;
26
+ this.depth = depth;
27
+ this.refSet = refSet;
28
+ this.errors = [];
29
+ }
30
+ }
31
+ var _default = exports.default = Reference;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @public
3
+ */
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ class Reference {
9
+ uri;
10
+ depth;
11
+ value;
12
+ refSet;
13
+ errors;
14
+ constructor({
15
+ uri,
16
+ depth = 0,
17
+ refSet,
18
+ value
19
+ }) {
20
+ this.uri = uri;
21
+ this.value = value;
22
+ this.depth = depth;
23
+ this.refSet = refSet;
24
+ this.errors = [];
25
+ }
26
+ }
27
+ export default Reference;
@@ -0,0 +1,38 @@
1
+ import { Element } from '@speclynx/apidom-datamodel';
2
+
3
+ import ReferenceSet from './ReferenceSet.ts';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ export interface ReferenceOptions<T = Element> {
9
+ readonly uri: string;
10
+ readonly depth?: number;
11
+ readonly refSet?: ReferenceSet;
12
+ readonly value: T;
13
+ }
14
+
15
+ /**
16
+ * @public
17
+ */
18
+ class Reference<T = Element> {
19
+ public readonly uri: string;
20
+
21
+ public readonly depth: number;
22
+
23
+ public readonly value: T;
24
+
25
+ public refSet?: ReferenceSet;
26
+
27
+ public readonly errors: Array<Error>;
28
+
29
+ constructor({ uri, depth = 0, refSet, value }: ReferenceOptions<T>) {
30
+ this.uri = uri;
31
+ this.value = value;
32
+ this.depth = depth;
33
+ this.refSet = refSet;
34
+ this.errors = [];
35
+ }
36
+ }
37
+
38
+ export default Reference;
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = void 0;
5
+ var _ramdaAdjunct = require("ramda-adjunct");
6
+ /**
7
+ * @public
8
+ */
9
+
10
+ /**
11
+ * @public
12
+ */
13
+ class ReferenceSet {
14
+ rootRef;
15
+ refs;
16
+ circular;
17
+ constructor({
18
+ refs = [],
19
+ circular = false
20
+ } = {}) {
21
+ this.refs = [];
22
+ this.circular = circular;
23
+ refs.forEach(this.add.bind(this));
24
+ }
25
+ get size() {
26
+ return this.refs.length;
27
+ }
28
+ add(reference) {
29
+ if (!this.has(reference)) {
30
+ this.refs.push(reference);
31
+ this.rootRef = this.rootRef === undefined ? reference : this.rootRef;
32
+ reference.refSet = this;
33
+ }
34
+ return this;
35
+ }
36
+ merge(anotherRefSet) {
37
+ for (const reference of anotherRefSet.values()) {
38
+ this.add(reference);
39
+ }
40
+ return this;
41
+ }
42
+ has(thing) {
43
+ const uri = (0, _ramdaAdjunct.isString)(thing) ? thing : thing.uri;
44
+ return (0, _ramdaAdjunct.isNotUndefined)(this.find(ref => ref.uri === uri));
45
+ }
46
+ find(predicate) {
47
+ return this.refs.find(predicate);
48
+ }
49
+ *values() {
50
+ yield* this.refs;
51
+ }
52
+ clean() {
53
+ this.refs.forEach(ref => {
54
+ ref.refSet = undefined;
55
+ });
56
+ this.rootRef = undefined;
57
+ this.refs.length = 0;
58
+ }
59
+ }
60
+ var _default = exports.default = ReferenceSet;
@@ -0,0 +1,57 @@
1
+ import { isNotUndefined, isString } from 'ramda-adjunct';
2
+
3
+ /**
4
+ * @public
5
+ */
6
+
7
+ /**
8
+ * @public
9
+ */
10
+ class ReferenceSet {
11
+ rootRef;
12
+ refs;
13
+ circular;
14
+ constructor({
15
+ refs = [],
16
+ circular = false
17
+ } = {}) {
18
+ this.refs = [];
19
+ this.circular = circular;
20
+ refs.forEach(this.add.bind(this));
21
+ }
22
+ get size() {
23
+ return this.refs.length;
24
+ }
25
+ add(reference) {
26
+ if (!this.has(reference)) {
27
+ this.refs.push(reference);
28
+ this.rootRef = this.rootRef === undefined ? reference : this.rootRef;
29
+ reference.refSet = this;
30
+ }
31
+ return this;
32
+ }
33
+ merge(anotherRefSet) {
34
+ for (const reference of anotherRefSet.values()) {
35
+ this.add(reference);
36
+ }
37
+ return this;
38
+ }
39
+ has(thing) {
40
+ const uri = isString(thing) ? thing : thing.uri;
41
+ return isNotUndefined(this.find(ref => ref.uri === uri));
42
+ }
43
+ find(predicate) {
44
+ return this.refs.find(predicate);
45
+ }
46
+ *values() {
47
+ yield* this.refs;
48
+ }
49
+ clean() {
50
+ this.refs.forEach(ref => {
51
+ ref.refSet = undefined;
52
+ });
53
+ this.rootRef = undefined;
54
+ this.refs.length = 0;
55
+ }
56
+ }
57
+ export default ReferenceSet;
@@ -0,0 +1,73 @@
1
+ import { isNotUndefined, isString } from 'ramda-adjunct';
2
+
3
+ import type Reference from './Reference.ts';
4
+
5
+ /**
6
+ * @public
7
+ */
8
+ export interface ReferenceSetOptions {
9
+ readonly refs?: Reference[];
10
+ readonly circular?: boolean;
11
+ }
12
+
13
+ /**
14
+ * @public
15
+ */
16
+ class ReferenceSet {
17
+ public rootRef?: Reference;
18
+
19
+ public readonly refs: Reference[];
20
+
21
+ public circular: boolean;
22
+
23
+ constructor({ refs = [], circular = false }: ReferenceSetOptions = {}) {
24
+ this.refs = [];
25
+ this.circular = circular;
26
+ refs.forEach(this.add.bind(this));
27
+ }
28
+
29
+ get size(): number {
30
+ return this.refs.length;
31
+ }
32
+
33
+ add(reference: Reference): this {
34
+ if (!this.has(reference)) {
35
+ this.refs.push(reference);
36
+ this.rootRef = this.rootRef === undefined ? reference : this.rootRef;
37
+ reference.refSet = this;
38
+ }
39
+ return this;
40
+ }
41
+
42
+ merge(anotherRefSet: this): this {
43
+ for (const reference of anotherRefSet.values()) {
44
+ this.add(reference);
45
+ }
46
+ return this;
47
+ }
48
+
49
+ has(thing: string | Reference): boolean {
50
+ const uri = isString(thing) ? thing : thing.uri;
51
+ return isNotUndefined(this.find((ref: Reference) => ref.uri === uri));
52
+ }
53
+
54
+ find(
55
+ predicate: (value: Reference, index: number, obj: Reference[]) => boolean,
56
+ ): Reference | undefined {
57
+ return this.refs.find(predicate);
58
+ }
59
+
60
+ *values() {
61
+ yield* this.refs;
62
+ }
63
+
64
+ clean() {
65
+ this.refs.forEach((ref: Reference) => {
66
+ ref.refSet = undefined;
67
+ });
68
+ this.rootRef = undefined;
69
+ this.refs.length = 0;
70
+ }
71
+ }
72
+
73
+ export default ReferenceSet;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ var _interopRequireWildcard = require("@babel/runtime-corejs3/helpers/interopRequireWildcard").default;
4
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
5
+ exports.__esModule = true;
6
+ exports.default = void 0;
7
+ var _ramda = require("ramda");
8
+ var _File = _interopRequireDefault(require("../File.cjs"));
9
+ var plugins = _interopRequireWildcard(require("../util/plugins.cjs"));
10
+ var _UnmatchedBundleStrategyError = _interopRequireDefault(require("../errors/UnmatchedBundleStrategyError.cjs"));
11
+ var _BundleError = _interopRequireDefault(require("../errors/BundleError.cjs"));
12
+ var _index = _interopRequireDefault(require("../parse/index.cjs"));
13
+ var _util = require("../options/util.cjs");
14
+ var url = _interopRequireWildcard(require("../util/url.cjs"));
15
+ /**
16
+ * Bundle a file with all its external references to a compound document.
17
+ */
18
+ const bundle = async (uri, options) => {
19
+ const {
20
+ refSet
21
+ } = options.bundle;
22
+ const sanitizedURI = url.sanitize(uri);
23
+ const mergedOptions = (0, _util.merge)(options, {
24
+ resolve: {
25
+ baseURI: sanitizedURI
26
+ }
27
+ });
28
+ let parseResult;
29
+
30
+ // if refSet was provided, use it to avoid unnecessary parsing
31
+ if (refSet !== null && refSet.has(sanitizedURI)) {
32
+ // @ts-ignore
33
+ ({
34
+ value: parseResult
35
+ } = refSet.find((0, _ramda.propEq)(sanitizedURI, 'uri')));
36
+ } else {
37
+ parseResult = await (0, _index.default)(uri, mergedOptions);
38
+ }
39
+ const file = new _File.default({
40
+ uri: mergedOptions.resolve.baseURI,
41
+ parseResult,
42
+ mediaType: mergedOptions.parse.mediaType
43
+ });
44
+ const bundleStrategies = await plugins.filter('canBundle', [file, mergedOptions], mergedOptions.bundle.strategies);
45
+
46
+ // we couldn't find any bundle strategy for this File
47
+ if ((0, _ramda.isEmpty)(bundleStrategies)) {
48
+ throw new _UnmatchedBundleStrategyError.default(`Could not find a bundle strategy that can bundle the file "${file.uri}"`);
49
+ }
50
+ try {
51
+ const {
52
+ result
53
+ } = await plugins.run('bundle', [file, mergedOptions], bundleStrategies);
54
+ return result;
55
+ } catch (error) {
56
+ throw new _BundleError.default(`Error while bundling file "${file.uri}"`, {
57
+ cause: error
58
+ });
59
+ }
60
+ };
61
+ var _default = exports.default = bundle;
@@ -0,0 +1,55 @@
1
+ import { isEmpty, propEq } from 'ramda';
2
+ import File from "../File.mjs";
3
+ import * as plugins from "../util/plugins.mjs";
4
+ import UnmatchedBundleStrategyError from "../errors/UnmatchedBundleStrategyError.mjs";
5
+ import BundleError from "../errors/BundleError.mjs";
6
+ import parse from "../parse/index.mjs";
7
+ import { merge as mergeOptions } from "../options/util.mjs";
8
+ import * as url from "../util/url.mjs";
9
+ /**
10
+ * Bundle a file with all its external references to a compound document.
11
+ */
12
+ const bundle = async (uri, options) => {
13
+ const {
14
+ refSet
15
+ } = options.bundle;
16
+ const sanitizedURI = url.sanitize(uri);
17
+ const mergedOptions = mergeOptions(options, {
18
+ resolve: {
19
+ baseURI: sanitizedURI
20
+ }
21
+ });
22
+ let parseResult;
23
+
24
+ // if refSet was provided, use it to avoid unnecessary parsing
25
+ if (refSet !== null && refSet.has(sanitizedURI)) {
26
+ // @ts-ignore
27
+ ({
28
+ value: parseResult
29
+ } = refSet.find(propEq(sanitizedURI, 'uri')));
30
+ } else {
31
+ parseResult = await parse(uri, mergedOptions);
32
+ }
33
+ const file = new File({
34
+ uri: mergedOptions.resolve.baseURI,
35
+ parseResult,
36
+ mediaType: mergedOptions.parse.mediaType
37
+ });
38
+ const bundleStrategies = await plugins.filter('canBundle', [file, mergedOptions], mergedOptions.bundle.strategies);
39
+
40
+ // we couldn't find any bundle strategy for this File
41
+ if (isEmpty(bundleStrategies)) {
42
+ throw new UnmatchedBundleStrategyError(`Could not find a bundle strategy that can bundle the file "${file.uri}"`);
43
+ }
44
+ try {
45
+ const {
46
+ result
47
+ } = await plugins.run('bundle', [file, mergedOptions], bundleStrategies);
48
+ return result;
49
+ } catch (error) {
50
+ throw new BundleError(`Error while bundling file "${file.uri}"`, {
51
+ cause: error
52
+ });
53
+ }
54
+ };
55
+ export default bundle;