@speclynx/apidom-ns-openapi-2 4.0.2 → 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 (326) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +8 -9
  3. package/src/elements/Contact.cjs +33 -0
  4. package/src/elements/Contact.mjs +30 -0
  5. package/src/elements/Contact.ts +42 -0
  6. package/src/elements/Definitions.cjs +15 -0
  7. package/src/elements/Definitions.mjs +12 -0
  8. package/src/elements/Definitions.ts +13 -0
  9. package/src/elements/Example.cjs +15 -0
  10. package/src/elements/Example.mjs +12 -0
  11. package/src/elements/Example.ts +13 -0
  12. package/src/elements/ExternalDocumentation.cjs +27 -0
  13. package/src/elements/ExternalDocumentation.mjs +24 -0
  14. package/src/elements/ExternalDocumentation.ts +34 -0
  15. package/src/elements/Header.cjs +185 -0
  16. package/src/elements/Header.mjs +182 -0
  17. package/src/elements/Header.ts +261 -0
  18. package/src/elements/Headers.cjs +15 -0
  19. package/src/elements/Headers.mjs +12 -0
  20. package/src/elements/Headers.ts +13 -0
  21. package/src/elements/Info.cjs +52 -0
  22. package/src/elements/Info.mjs +48 -0
  23. package/src/elements/Info.ts +70 -0
  24. package/src/elements/Items.cjs +190 -0
  25. package/src/elements/Items.mjs +187 -0
  26. package/src/elements/Items.ts +264 -0
  27. package/src/elements/License.cjs +27 -0
  28. package/src/elements/License.mjs +24 -0
  29. package/src/elements/License.ts +34 -0
  30. package/src/elements/Operation.cjs +78 -0
  31. package/src/elements/Operation.mjs +74 -0
  32. package/src/elements/Operation.ts +106 -0
  33. package/src/elements/Parameter.cjs +230 -0
  34. package/src/elements/Parameter.mjs +226 -0
  35. package/src/elements/Parameter.ts +326 -0
  36. package/src/elements/ParametersDefinitions.cjs +15 -0
  37. package/src/elements/ParametersDefinitions.mjs +12 -0
  38. package/src/elements/ParametersDefinitions.ts +13 -0
  39. package/src/elements/PathItem.cjs +69 -0
  40. package/src/elements/PathItem.mjs +65 -0
  41. package/src/elements/PathItem.ts +93 -0
  42. package/src/elements/Paths.cjs +15 -0
  43. package/src/elements/Paths.mjs +12 -0
  44. package/src/elements/Paths.ts +13 -0
  45. package/src/elements/Reference.cjs +22 -0
  46. package/src/elements/Reference.mjs +19 -0
  47. package/src/elements/Reference.ts +27 -0
  48. package/src/elements/Response.cjs +39 -0
  49. package/src/elements/Response.mjs +35 -0
  50. package/src/elements/Response.ts +54 -0
  51. package/src/elements/Responses.cjs +21 -0
  52. package/src/elements/Responses.mjs +17 -0
  53. package/src/elements/Responses.ts +24 -0
  54. package/src/elements/ResponsesDefinitions.cjs +15 -0
  55. package/src/elements/ResponsesDefinitions.mjs +12 -0
  56. package/src/elements/ResponsesDefinitions.ts +13 -0
  57. package/src/elements/Schema.cjs +151 -0
  58. package/src/elements/Schema.mjs +147 -0
  59. package/src/elements/Schema.ts +204 -0
  60. package/src/elements/Scopes.cjs +15 -0
  61. package/src/elements/Scopes.mjs +12 -0
  62. package/src/elements/Scopes.ts +13 -0
  63. package/src/elements/SecurityDefinitions.cjs +15 -0
  64. package/src/elements/SecurityDefinitions.mjs +12 -0
  65. package/src/elements/SecurityDefinitions.ts +13 -0
  66. package/src/elements/SecurityRequirement.cjs +15 -0
  67. package/src/elements/SecurityRequirement.mjs +12 -0
  68. package/src/elements/SecurityRequirement.ts +13 -0
  69. package/src/elements/SecurityScheme.cjs +63 -0
  70. package/src/elements/SecurityScheme.mjs +60 -0
  71. package/src/elements/SecurityScheme.ts +83 -0
  72. package/src/elements/Swagger.cjs +106 -0
  73. package/src/elements/Swagger.mjs +102 -0
  74. package/src/elements/Swagger.ts +149 -0
  75. package/src/elements/SwaggerVersion.cjs +17 -0
  76. package/src/elements/SwaggerVersion.mjs +14 -0
  77. package/src/elements/SwaggerVersion.ts +15 -0
  78. package/src/elements/Tag.cjs +33 -0
  79. package/src/elements/Tag.mjs +29 -0
  80. package/src/elements/Tag.ts +44 -0
  81. package/src/elements/Xml.cjs +45 -0
  82. package/src/elements/Xml.mjs +42 -0
  83. package/src/elements/Xml.ts +59 -0
  84. package/src/elements/nces/OperationConsumes.cjs +16 -0
  85. package/src/elements/nces/OperationConsumes.mjs +13 -0
  86. package/src/elements/nces/OperationConsumes.ts +15 -0
  87. package/src/elements/nces/OperationParameters.cjs +17 -0
  88. package/src/elements/nces/OperationParameters.mjs +14 -0
  89. package/src/elements/nces/OperationParameters.ts +16 -0
  90. package/src/elements/nces/OperationProduces.cjs +16 -0
  91. package/src/elements/nces/OperationProduces.mjs +13 -0
  92. package/src/elements/nces/OperationProduces.ts +15 -0
  93. package/src/elements/nces/OperationSchemes.cjs +16 -0
  94. package/src/elements/nces/OperationSchemes.mjs +13 -0
  95. package/src/elements/nces/OperationSchemes.ts +15 -0
  96. package/src/elements/nces/OperationSecurity.cjs +17 -0
  97. package/src/elements/nces/OperationSecurity.mjs +14 -0
  98. package/src/elements/nces/OperationSecurity.ts +16 -0
  99. package/src/elements/nces/OperationTags.cjs +17 -0
  100. package/src/elements/nces/OperationTags.mjs +14 -0
  101. package/src/elements/nces/OperationTags.ts +16 -0
  102. package/src/elements/nces/PathItemParameters.cjs +17 -0
  103. package/src/elements/nces/PathItemParameters.mjs +14 -0
  104. package/src/elements/nces/PathItemParameters.ts +16 -0
  105. package/src/elements/nces/SwaggerConsumes.cjs +16 -0
  106. package/src/elements/nces/SwaggerConsumes.mjs +13 -0
  107. package/src/elements/nces/SwaggerConsumes.ts +15 -0
  108. package/src/elements/nces/SwaggerProduces.cjs +16 -0
  109. package/src/elements/nces/SwaggerProduces.mjs +13 -0
  110. package/src/elements/nces/SwaggerProduces.ts +15 -0
  111. package/src/elements/nces/SwaggerSchemes.cjs +16 -0
  112. package/src/elements/nces/SwaggerSchemes.mjs +13 -0
  113. package/src/elements/nces/SwaggerSchemes.ts +15 -0
  114. package/src/elements/nces/SwaggerSecurity.cjs +17 -0
  115. package/src/elements/nces/SwaggerSecurity.mjs +14 -0
  116. package/src/elements/nces/SwaggerSecurity.ts +16 -0
  117. package/src/elements/nces/SwaggerTags.cjs +16 -0
  118. package/src/elements/nces/SwaggerTags.mjs +13 -0
  119. package/src/elements/nces/SwaggerTags.ts +15 -0
  120. package/src/index.cjs +156 -0
  121. package/src/index.mjs +32 -0
  122. package/src/index.ts +368 -0
  123. package/src/media-types.cjs +34 -0
  124. package/src/media-types.mjs +30 -0
  125. package/src/media-types.ts +42 -0
  126. package/src/namespace.cjs +71 -0
  127. package/src/namespace.mjs +66 -0
  128. package/src/namespace.ts +70 -0
  129. package/src/predicates.cjs +193 -0
  130. package/src/predicates.mjs +161 -0
  131. package/src/predicates.ts +194 -0
  132. package/src/refractor/index.cjs +316 -0
  133. package/src/refractor/index.mjs +283 -0
  134. package/src/refractor/index.ts +330 -0
  135. package/src/refractor/inspect.cjs +157 -0
  136. package/src/refractor/inspect.mjs +126 -0
  137. package/src/refractor/inspect.ts +181 -0
  138. package/src/refractor/plugins/replace-empty-element.cjs +366 -0
  139. package/src/refractor/plugins/replace-empty-element.mjs +358 -0
  140. package/src/refractor/plugins/replace-empty-element.ts +389 -0
  141. package/src/refractor/predicates.cjs +26 -0
  142. package/src/refractor/predicates.mjs +21 -0
  143. package/src/refractor/predicates.ts +29 -0
  144. package/src/refractor/specification.cjs +519 -0
  145. package/src/refractor/specification.mjs +513 -0
  146. package/src/refractor/specification.ts +444 -0
  147. package/src/refractor/toolbox.cjs +28 -0
  148. package/src/refractor/toolbox.mjs +21 -0
  149. package/src/refractor/toolbox.ts +24 -0
  150. package/src/refractor/visitors/FallbackVisitor.cjs +24 -0
  151. package/src/refractor/visitors/FallbackVisitor.mjs +18 -0
  152. package/src/refractor/visitors/FallbackVisitor.ts +25 -0
  153. package/src/refractor/visitors/SpecificationExtensionVisitor.cjs +18 -0
  154. package/src/refractor/visitors/SpecificationExtensionVisitor.mjs +13 -0
  155. package/src/refractor/visitors/SpecificationExtensionVisitor.ts +22 -0
  156. package/src/refractor/visitors/SpecificationVisitor.cjs +75 -0
  157. package/src/refractor/visitors/SpecificationVisitor.mjs +69 -0
  158. package/src/refractor/visitors/SpecificationVisitor.ts +83 -0
  159. package/src/refractor/visitors/Visitor.cjs +36 -0
  160. package/src/refractor/visitors/Visitor.mjs +33 -0
  161. package/src/refractor/visitors/Visitor.ts +47 -0
  162. package/src/refractor/visitors/generics/AlternatingVisitor.cjs +42 -0
  163. package/src/refractor/visitors/generics/AlternatingVisitor.mjs +35 -0
  164. package/src/refractor/visitors/generics/AlternatingVisitor.ts +45 -0
  165. package/src/refractor/visitors/generics/FixedFieldsVisitor.cjs +73 -0
  166. package/src/refractor/visitors/generics/FixedFieldsVisitor.mjs +66 -0
  167. package/src/refractor/visitors/generics/FixedFieldsVisitor.ts +109 -0
  168. package/src/refractor/visitors/generics/MapVisitor.cjs +21 -0
  169. package/src/refractor/visitors/generics/MapVisitor.mjs +15 -0
  170. package/src/refractor/visitors/generics/MapVisitor.ts +25 -0
  171. package/src/refractor/visitors/generics/MixedFieldsVisitor.cjs +67 -0
  172. package/src/refractor/visitors/generics/MixedFieldsVisitor.mjs +61 -0
  173. package/src/refractor/visitors/generics/MixedFieldsVisitor.ts +77 -0
  174. package/src/refractor/visitors/generics/PatternedFieldsVisitor.cjs +72 -0
  175. package/src/refractor/visitors/generics/PatternedFieldsVisitor.mjs +66 -0
  176. package/src/refractor/visitors/generics/PatternedFieldsVisitor.ts +99 -0
  177. package/src/refractor/visitors/open-api-2/BasePathVisitor.cjs +16 -0
  178. package/src/refractor/visitors/open-api-2/BasePathVisitor.mjs +11 -0
  179. package/src/refractor/visitors/open-api-2/BasePathVisitor.ts +20 -0
  180. package/src/refractor/visitors/open-api-2/ConsumesVisitor.cjs +23 -0
  181. package/src/refractor/visitors/open-api-2/ConsumesVisitor.mjs +18 -0
  182. package/src/refractor/visitors/open-api-2/ConsumesVisitor.ts +29 -0
  183. package/src/refractor/visitors/open-api-2/HostVisitor.cjs +16 -0
  184. package/src/refractor/visitors/open-api-2/HostVisitor.mjs +11 -0
  185. package/src/refractor/visitors/open-api-2/HostVisitor.ts +20 -0
  186. package/src/refractor/visitors/open-api-2/ProducesVisitor.cjs +23 -0
  187. package/src/refractor/visitors/open-api-2/ProducesVisitor.mjs +18 -0
  188. package/src/refractor/visitors/open-api-2/ProducesVisitor.ts +29 -0
  189. package/src/refractor/visitors/open-api-2/SchemesVisitor.cjs +23 -0
  190. package/src/refractor/visitors/open-api-2/SchemesVisitor.mjs +18 -0
  191. package/src/refractor/visitors/open-api-2/SchemesVisitor.ts +29 -0
  192. package/src/refractor/visitors/open-api-2/SecurityVisitor.cjs +27 -0
  193. package/src/refractor/visitors/open-api-2/SecurityVisitor.mjs +22 -0
  194. package/src/refractor/visitors/open-api-2/SecurityVisitor.ts +34 -0
  195. package/src/refractor/visitors/open-api-2/SwaggerVisitor.cjs +21 -0
  196. package/src/refractor/visitors/open-api-2/SwaggerVisitor.mjs +16 -0
  197. package/src/refractor/visitors/open-api-2/SwaggerVisitor.ts +29 -0
  198. package/src/refractor/visitors/open-api-2/TagsVisitor.cjs +27 -0
  199. package/src/refractor/visitors/open-api-2/TagsVisitor.mjs +22 -0
  200. package/src/refractor/visitors/open-api-2/TagsVisitor.ts +34 -0
  201. package/src/refractor/visitors/open-api-2/bases.cjs +72 -0
  202. package/src/refractor/visitors/open-api-2/bases.mjs +67 -0
  203. package/src/refractor/visitors/open-api-2/bases.ts +82 -0
  204. package/src/refractor/visitors/open-api-2/contact/index.cjs +20 -0
  205. package/src/refractor/visitors/open-api-2/contact/index.mjs +15 -0
  206. package/src/refractor/visitors/open-api-2/contact/index.ts +27 -0
  207. package/src/refractor/visitors/open-api-2/definitions/index.cjs +31 -0
  208. package/src/refractor/visitors/open-api-2/definitions/index.mjs +26 -0
  209. package/src/refractor/visitors/open-api-2/definitions/index.ts +48 -0
  210. package/src/refractor/visitors/open-api-2/example/index.cjs +20 -0
  211. package/src/refractor/visitors/open-api-2/example/index.mjs +15 -0
  212. package/src/refractor/visitors/open-api-2/example/index.ts +27 -0
  213. package/src/refractor/visitors/open-api-2/external-documentation/index.cjs +20 -0
  214. package/src/refractor/visitors/open-api-2/external-documentation/index.mjs +15 -0
  215. package/src/refractor/visitors/open-api-2/external-documentation/index.ts +27 -0
  216. package/src/refractor/visitors/open-api-2/header/index.cjs +20 -0
  217. package/src/refractor/visitors/open-api-2/header/index.mjs +15 -0
  218. package/src/refractor/visitors/open-api-2/header/index.ts +27 -0
  219. package/src/refractor/visitors/open-api-2/headers/index.cjs +20 -0
  220. package/src/refractor/visitors/open-api-2/headers/index.mjs +15 -0
  221. package/src/refractor/visitors/open-api-2/headers/index.ts +27 -0
  222. package/src/refractor/visitors/open-api-2/index.cjs +21 -0
  223. package/src/refractor/visitors/open-api-2/index.mjs +16 -0
  224. package/src/refractor/visitors/open-api-2/index.ts +28 -0
  225. package/src/refractor/visitors/open-api-2/info/VersionVisitor.cjs +17 -0
  226. package/src/refractor/visitors/open-api-2/info/VersionVisitor.mjs +12 -0
  227. package/src/refractor/visitors/open-api-2/info/VersionVisitor.ts +21 -0
  228. package/src/refractor/visitors/open-api-2/info/index.cjs +20 -0
  229. package/src/refractor/visitors/open-api-2/info/index.mjs +15 -0
  230. package/src/refractor/visitors/open-api-2/info/index.ts +27 -0
  231. package/src/refractor/visitors/open-api-2/items/index.cjs +22 -0
  232. package/src/refractor/visitors/open-api-2/items/index.mjs +17 -0
  233. package/src/refractor/visitors/open-api-2/items/index.ts +27 -0
  234. package/src/refractor/visitors/open-api-2/license/index.cjs +20 -0
  235. package/src/refractor/visitors/open-api-2/license/index.mjs +15 -0
  236. package/src/refractor/visitors/open-api-2/license/index.ts +27 -0
  237. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.cjs +23 -0
  238. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.mjs +18 -0
  239. package/src/refractor/visitors/open-api-2/operation/ConsumesVisitor.ts +29 -0
  240. package/src/refractor/visitors/open-api-2/operation/ParametersVisitor.cjs +32 -0
  241. package/src/refractor/visitors/open-api-2/operation/ParametersVisitor.mjs +27 -0
  242. package/src/refractor/visitors/open-api-2/operation/ParametersVisitor.ts +44 -0
  243. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.cjs +23 -0
  244. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.mjs +18 -0
  245. package/src/refractor/visitors/open-api-2/operation/ProducesVisitor.ts +29 -0
  246. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.cjs +23 -0
  247. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.mjs +18 -0
  248. package/src/refractor/visitors/open-api-2/operation/SchemesVisitor.ts +29 -0
  249. package/src/refractor/visitors/open-api-2/operation/SecurityVisitor.cjs +27 -0
  250. package/src/refractor/visitors/open-api-2/operation/SecurityVisitor.mjs +22 -0
  251. package/src/refractor/visitors/open-api-2/operation/SecurityVisitor.ts +34 -0
  252. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.cjs +23 -0
  253. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.mjs +18 -0
  254. package/src/refractor/visitors/open-api-2/operation/TagsVisitor.ts +29 -0
  255. package/src/refractor/visitors/open-api-2/operation/index.cjs +19 -0
  256. package/src/refractor/visitors/open-api-2/operation/index.mjs +14 -0
  257. package/src/refractor/visitors/open-api-2/operation/index.ts +24 -0
  258. package/src/refractor/visitors/open-api-2/parameter/index.cjs +20 -0
  259. package/src/refractor/visitors/open-api-2/parameter/index.mjs +15 -0
  260. package/src/refractor/visitors/open-api-2/parameter/index.ts +27 -0
  261. package/src/refractor/visitors/open-api-2/parameters-definitions/index.cjs +19 -0
  262. package/src/refractor/visitors/open-api-2/parameters-definitions/index.mjs +14 -0
  263. package/src/refractor/visitors/open-api-2/parameters-definitions/index.ts +24 -0
  264. package/src/refractor/visitors/open-api-2/path-item/$RefVisitor.cjs +16 -0
  265. package/src/refractor/visitors/open-api-2/path-item/$RefVisitor.mjs +11 -0
  266. package/src/refractor/visitors/open-api-2/path-item/$RefVisitor.ts +20 -0
  267. package/src/refractor/visitors/open-api-2/path-item/ParametersVisitor.cjs +32 -0
  268. package/src/refractor/visitors/open-api-2/path-item/ParametersVisitor.mjs +27 -0
  269. package/src/refractor/visitors/open-api-2/path-item/ParametersVisitor.ts +44 -0
  270. package/src/refractor/visitors/open-api-2/path-item/index.cjs +39 -0
  271. package/src/refractor/visitors/open-api-2/path-item/index.mjs +34 -0
  272. package/src/refractor/visitors/open-api-2/path-item/index.ts +48 -0
  273. package/src/refractor/visitors/open-api-2/paths/index.cjs +37 -0
  274. package/src/refractor/visitors/open-api-2/paths/index.mjs +32 -0
  275. package/src/refractor/visitors/open-api-2/paths/index.ts +48 -0
  276. package/src/refractor/visitors/open-api-2/reference/$RefVisitor.cjs +16 -0
  277. package/src/refractor/visitors/open-api-2/reference/$RefVisitor.mjs +11 -0
  278. package/src/refractor/visitors/open-api-2/reference/$RefVisitor.ts +20 -0
  279. package/src/refractor/visitors/open-api-2/reference/index.cjs +29 -0
  280. package/src/refractor/visitors/open-api-2/reference/index.mjs +24 -0
  281. package/src/refractor/visitors/open-api-2/reference/index.ts +38 -0
  282. package/src/refractor/visitors/open-api-2/response/index.cjs +20 -0
  283. package/src/refractor/visitors/open-api-2/response/index.mjs +15 -0
  284. package/src/refractor/visitors/open-api-2/response/index.ts +27 -0
  285. package/src/refractor/visitors/open-api-2/responses/DefaultVisitor.cjs +36 -0
  286. package/src/refractor/visitors/open-api-2/responses/DefaultVisitor.mjs +31 -0
  287. package/src/refractor/visitors/open-api-2/responses/DefaultVisitor.ts +36 -0
  288. package/src/refractor/visitors/open-api-2/responses/index.cjs +45 -0
  289. package/src/refractor/visitors/open-api-2/responses/index.mjs +40 -0
  290. package/src/refractor/visitors/open-api-2/responses/index.ts +64 -0
  291. package/src/refractor/visitors/open-api-2/responses-definitions/index.cjs +19 -0
  292. package/src/refractor/visitors/open-api-2/responses-definitions/index.mjs +14 -0
  293. package/src/refractor/visitors/open-api-2/responses-definitions/index.ts +24 -0
  294. package/src/refractor/visitors/open-api-2/schema/AllOfVisitor.cjs +24 -0
  295. package/src/refractor/visitors/open-api-2/schema/AllOfVisitor.mjs +20 -0
  296. package/src/refractor/visitors/open-api-2/schema/AllOfVisitor.ts +35 -0
  297. package/src/refractor/visitors/open-api-2/schema/ItemsVisitor.cjs +26 -0
  298. package/src/refractor/visitors/open-api-2/schema/ItemsVisitor.mjs +23 -0
  299. package/src/refractor/visitors/open-api-2/schema/ItemsVisitor.ts +38 -0
  300. package/src/refractor/visitors/open-api-2/schema/PropertiesVisitor.cjs +24 -0
  301. package/src/refractor/visitors/open-api-2/schema/PropertiesVisitor.mjs +20 -0
  302. package/src/refractor/visitors/open-api-2/schema/PropertiesVisitor.ts +35 -0
  303. package/src/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.cjs +23 -0
  304. package/src/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.mjs +19 -0
  305. package/src/refractor/visitors/open-api-2/schema/SchemaOrJSONReferenceVisitor.ts +37 -0
  306. package/src/refractor/visitors/open-api-2/schema/index.cjs +20 -0
  307. package/src/refractor/visitors/open-api-2/schema/index.mjs +15 -0
  308. package/src/refractor/visitors/open-api-2/schema/index.ts +27 -0
  309. package/src/refractor/visitors/open-api-2/scopes/index.cjs +20 -0
  310. package/src/refractor/visitors/open-api-2/scopes/index.mjs +15 -0
  311. package/src/refractor/visitors/open-api-2/scopes/index.ts +27 -0
  312. package/src/refractor/visitors/open-api-2/security-definitions/index.cjs +20 -0
  313. package/src/refractor/visitors/open-api-2/security-definitions/index.mjs +15 -0
  314. package/src/refractor/visitors/open-api-2/security-definitions/index.ts +24 -0
  315. package/src/refractor/visitors/open-api-2/security-requirement/index.cjs +19 -0
  316. package/src/refractor/visitors/open-api-2/security-requirement/index.mjs +14 -0
  317. package/src/refractor/visitors/open-api-2/security-requirement/index.ts +24 -0
  318. package/src/refractor/visitors/open-api-2/security-scheme/index.cjs +20 -0
  319. package/src/refractor/visitors/open-api-2/security-scheme/index.mjs +15 -0
  320. package/src/refractor/visitors/open-api-2/security-scheme/index.ts +27 -0
  321. package/src/refractor/visitors/open-api-2/tag/index.cjs +20 -0
  322. package/src/refractor/visitors/open-api-2/tag/index.mjs +15 -0
  323. package/src/refractor/visitors/open-api-2/tag/index.ts +27 -0
  324. package/src/refractor/visitors/open-api-2/xml/index.cjs +20 -0
  325. package/src/refractor/visitors/open-api-2/xml/index.mjs +15 -0
  326. package/src/refractor/visitors/open-api-2/xml/index.ts +27 -0
@@ -0,0 +1,194 @@
1
+ import SwaggerElement from './elements/Swagger.ts';
2
+ import SwaggerVersionElement from './elements/SwaggerVersion.ts';
3
+ import InfoElement from './elements/Info.ts';
4
+ import ContactElement from './elements/Contact.ts';
5
+ import LicenseElement from './elements/License.ts';
6
+ import PathsElement from './elements/Paths.ts';
7
+ import PathItemElement from './elements/PathItem.ts';
8
+ import OperationElement from './elements/Operation.ts';
9
+ import ExternalDocumentationElement from './elements/ExternalDocumentation.ts';
10
+ import ParameterElement from './elements/Parameter.ts';
11
+ import ItemsElement from './elements/Items.ts';
12
+ import ExampleElement from './elements/Example.ts';
13
+ import ResponsesElement from './elements/Responses.ts';
14
+ import ResponseElement from './elements/Response.ts';
15
+ import HeadersElement from './elements/Headers.ts';
16
+ import HeaderElement from './elements/Header.ts';
17
+ import TagElement from './elements/Tag.ts';
18
+ import ReferenceElement from './elements/Reference.ts';
19
+ import SchemaElement from './elements/Schema.ts';
20
+ import XmlElement from './elements/Xml.ts';
21
+ import DefinitionsElement from './elements/Definitions.ts';
22
+ import ParametersDefinitionsElement from './elements/ParametersDefinitions.ts';
23
+ import ResponsesDefinitionsElement from './elements/ResponsesDefinitions.ts';
24
+ import SecurityDefinitionsElement from './elements/SecurityDefinitions.ts';
25
+ import SecuritySchemeElement from './elements/SecurityScheme.ts';
26
+ import SecurityRequirementElement from './elements/SecurityRequirement.ts';
27
+ import ScopesElement from './elements/Scopes.ts';
28
+
29
+ /**
30
+ * @public
31
+ */
32
+ export const isSwaggerElement = (element: unknown): element is SwaggerElement =>
33
+ element instanceof SwaggerElement;
34
+
35
+ /**
36
+ * @public
37
+ */
38
+ export const isSwaggerVersionElement = (element: unknown): element is SwaggerVersionElement =>
39
+ element instanceof SwaggerVersionElement;
40
+
41
+ /**
42
+ * @public
43
+ */
44
+ export const isInfoElement = (element: unknown): element is InfoElement =>
45
+ element instanceof InfoElement;
46
+
47
+ /**
48
+ * @public
49
+ */
50
+ export const isLicenseElement = (element: unknown): element is LicenseElement =>
51
+ element instanceof LicenseElement;
52
+
53
+ /**
54
+ * @public
55
+ */
56
+ export const isContactElement = (element: unknown): element is ContactElement =>
57
+ element instanceof ContactElement;
58
+
59
+ /**
60
+ * @public
61
+ */
62
+ export const isPathsElement = (element: unknown): element is PathsElement =>
63
+ element instanceof PathsElement;
64
+
65
+ /**
66
+ * @public
67
+ */
68
+ export const isPathItemElement = (element: unknown): element is PathItemElement =>
69
+ element instanceof PathItemElement;
70
+
71
+ /**
72
+ * @public
73
+ */
74
+ export const isOperationElement = (element: unknown): element is OperationElement =>
75
+ element instanceof OperationElement;
76
+
77
+ /**
78
+ * @public
79
+ */
80
+ export const isExternalDocumentationElement = (
81
+ element: unknown,
82
+ ): element is ExternalDocumentationElement => element instanceof ExternalDocumentationElement;
83
+
84
+ /**
85
+ * @public
86
+ */
87
+ export const isParameterElement = (element: unknown): element is ParameterElement =>
88
+ element instanceof ParameterElement;
89
+
90
+ /**
91
+ * @public
92
+ */
93
+ export const isItemsElement = (element: unknown): element is ItemsElement =>
94
+ element instanceof ItemsElement;
95
+
96
+ /**
97
+ * @public
98
+ */
99
+ export const isResponsesElement = (element: unknown): element is ResponsesElement =>
100
+ element instanceof ResponsesElement;
101
+
102
+ /**
103
+ * @public
104
+ */
105
+ export const isResponseElement = (element: unknown): element is ResponseElement =>
106
+ element instanceof ResponseElement;
107
+
108
+ /**
109
+ * @public
110
+ */
111
+ export const isHeadersElement = (element: unknown): element is HeadersElement =>
112
+ element instanceof HeadersElement;
113
+
114
+ /**
115
+ * @public
116
+ */
117
+ export const isExampleElement = (element: unknown): element is ExampleElement =>
118
+ element instanceof ExampleElement;
119
+
120
+ /**
121
+ * @public
122
+ */
123
+ export const isHeaderElement = (element: unknown): element is HeaderElement =>
124
+ element instanceof HeaderElement;
125
+
126
+ /**
127
+ * @public
128
+ */
129
+ export const isTagElement = (element: unknown): element is TagElement =>
130
+ element instanceof TagElement;
131
+
132
+ /**
133
+ * @public
134
+ */
135
+ export const isReferenceElement = (element: unknown): element is ReferenceElement =>
136
+ element instanceof ReferenceElement;
137
+
138
+ /**
139
+ * @public
140
+ */
141
+ export const isSchemaElement = (element: unknown): element is SchemaElement =>
142
+ element instanceof SchemaElement;
143
+
144
+ /**
145
+ * @public
146
+ */
147
+ export const isXmlElement = (element: unknown): element is XmlElement =>
148
+ element instanceof XmlElement;
149
+
150
+ /**
151
+ * @public
152
+ */
153
+ export const isResponsesDefinitionsElement = (
154
+ element: unknown,
155
+ ): element is ResponsesDefinitionsElement => element instanceof ResponsesDefinitionsElement;
156
+
157
+ /**
158
+ * @public
159
+ */
160
+ export const isSecurityDefinitionsElement = (
161
+ element: unknown,
162
+ ): element is SecurityDefinitionsElement => element instanceof SecurityDefinitionsElement;
163
+
164
+ /**
165
+ * @public
166
+ */
167
+ export const isDefinitionsElement = (element: unknown): element is DefinitionsElement =>
168
+ element instanceof DefinitionsElement;
169
+
170
+ /**
171
+ * @public
172
+ */
173
+ export const isParametersDefinitionsElement = (
174
+ element: unknown,
175
+ ): element is ParametersDefinitionsElement => element instanceof ParametersDefinitionsElement;
176
+
177
+ /**
178
+ * @public
179
+ */
180
+ export const isSecuritySchemeElement = (element: unknown): element is SecuritySchemeElement =>
181
+ element instanceof SecuritySchemeElement;
182
+
183
+ /**
184
+ * @public
185
+ */
186
+ export const isScopesElement = (element: unknown): element is ScopesElement =>
187
+ element instanceof ScopesElement;
188
+
189
+ /**
190
+ * @public
191
+ */
192
+ export const isSecurityRequirementElement = (
193
+ element: unknown,
194
+ ): element is SecurityRequirementElement => element instanceof SecurityRequirementElement;
@@ -0,0 +1,316 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault").default;
4
+ exports.__esModule = true;
5
+ exports.refractXml = exports.refractTag = exports.refractSwagger = exports.refractSecurityScheme = exports.refractSecurityRequirement = exports.refractSecurityDefinitions = exports.refractScopes = exports.refractSchema = exports.refractResponsesDefinitions = exports.refractResponses = exports.refractResponse = exports.refractReference = exports.refractPaths = exports.refractPathItem = exports.refractParametersDefinitions = exports.refractParameter = exports.refractOperation = exports.refractLicense = exports.refractItems = exports.refractInfo = exports.refractHeaders = exports.refractHeader = exports.refractExternalDocumentation = exports.refractExample = exports.refractDefinitions = exports.refractContact = exports.default = void 0;
6
+ var _apidomCore = require("@speclynx/apidom-core");
7
+ var _apidomDatamodel = require("@speclynx/apidom-datamodel");
8
+ var _apidomTraverse = require("@speclynx/apidom-traverse");
9
+ var _ramda = require("ramda");
10
+ var _specification = _interopRequireDefault(require("./specification.cjs"));
11
+ var _toolbox = _interopRequireDefault(require("./toolbox.cjs"));
12
+ /**
13
+ * @public
14
+ */
15
+
16
+ /**
17
+ * @public
18
+ */
19
+
20
+ /**
21
+ * @public
22
+ */
23
+ const refract = (value, {
24
+ element = 'swagger',
25
+ plugins = [],
26
+ specificationObj = _specification.default,
27
+ consume = false
28
+ } = {}) => {
29
+ const genericElement = (0, _apidomDatamodel.refract)(value);
30
+ const resolvedSpec = (0, _apidomCore.resolveSpecification)(specificationObj);
31
+ const elementMap = resolvedSpec.elementMap;
32
+ const specPath = elementMap[element];
33
+ if (!specPath) {
34
+ throw new Error(`Unknown element type: "${element}"`);
35
+ }
36
+
37
+ /**
38
+ * This is where generic ApiDOM becomes semantic (namespace applied).
39
+ * We don't allow consumers to hook into this translation.
40
+ * Though we allow consumers to define their own plugins on already transformed ApiDOM.
41
+ */
42
+ const RootVisitorClass = (0, _ramda.path)(specPath, resolvedSpec);
43
+ const rootVisitor = new RootVisitorClass({
44
+ specObj: resolvedSpec,
45
+ consume
46
+ });
47
+ (0, _apidomTraverse.traverse)(genericElement, rootVisitor);
48
+
49
+ /**
50
+ * Running plugins visitors means extra single traversal === performance hit.
51
+ */
52
+ return (0, _apidomCore.dispatchRefractorPlugins)(rootVisitor.element, plugins, {
53
+ toolboxCreator: _toolbox.default
54
+ });
55
+ };
56
+
57
+ /**
58
+ * Refracts a value into a SwaggerElement.
59
+ * @public
60
+ */
61
+ const refractSwagger = (value, options = {}) => refract(value, {
62
+ ...options,
63
+ element: 'swagger'
64
+ });
65
+
66
+ /**
67
+ * Refracts a value into an InfoElement.
68
+ * @public
69
+ */
70
+ exports.refractSwagger = refractSwagger;
71
+ const refractInfo = (value, options = {}) => refract(value, {
72
+ ...options,
73
+ element: 'info'
74
+ });
75
+
76
+ /**
77
+ * Refracts a value into a ContactElement.
78
+ * @public
79
+ */
80
+ exports.refractInfo = refractInfo;
81
+ const refractContact = (value, options = {}) => refract(value, {
82
+ ...options,
83
+ element: 'contact'
84
+ });
85
+
86
+ /**
87
+ * Refracts a value into a LicenseElement.
88
+ * @public
89
+ */
90
+ exports.refractContact = refractContact;
91
+ const refractLicense = (value, options = {}) => refract(value, {
92
+ ...options,
93
+ element: 'license'
94
+ });
95
+
96
+ /**
97
+ * Refracts a value into a PathsElement.
98
+ * @public
99
+ */
100
+ exports.refractLicense = refractLicense;
101
+ const refractPaths = (value, options = {}) => refract(value, {
102
+ ...options,
103
+ element: 'paths'
104
+ });
105
+
106
+ /**
107
+ * Refracts a value into a PathItemElement.
108
+ * @public
109
+ */
110
+ exports.refractPaths = refractPaths;
111
+ const refractPathItem = (value, options = {}) => refract(value, {
112
+ ...options,
113
+ element: 'pathItem'
114
+ });
115
+
116
+ /**
117
+ * Refracts a value into an OperationElement.
118
+ * @public
119
+ */
120
+ exports.refractPathItem = refractPathItem;
121
+ const refractOperation = (value, options = {}) => refract(value, {
122
+ ...options,
123
+ element: 'operation'
124
+ });
125
+
126
+ /**
127
+ * Refracts a value into an ExternalDocumentationElement.
128
+ * @public
129
+ */
130
+ exports.refractOperation = refractOperation;
131
+ const refractExternalDocumentation = (value, options = {}) => refract(value, {
132
+ ...options,
133
+ element: 'externalDocumentation'
134
+ });
135
+
136
+ /**
137
+ * Refracts a value into a ParameterElement.
138
+ * @public
139
+ */
140
+ exports.refractExternalDocumentation = refractExternalDocumentation;
141
+ const refractParameter = (value, options = {}) => refract(value, {
142
+ ...options,
143
+ element: 'parameter'
144
+ });
145
+
146
+ /**
147
+ * Refracts a value into an ItemsElement.
148
+ * @public
149
+ */
150
+ exports.refractParameter = refractParameter;
151
+ const refractItems = (value, options = {}) => refract(value, {
152
+ ...options,
153
+ element: 'items'
154
+ });
155
+
156
+ /**
157
+ * Refracts a value into a ResponsesElement.
158
+ * @public
159
+ */
160
+ exports.refractItems = refractItems;
161
+ const refractResponses = (value, options = {}) => refract(value, {
162
+ ...options,
163
+ element: 'responses'
164
+ });
165
+
166
+ /**
167
+ * Refracts a value into a ResponseElement.
168
+ * @public
169
+ */
170
+ exports.refractResponses = refractResponses;
171
+ const refractResponse = (value, options = {}) => refract(value, {
172
+ ...options,
173
+ element: 'response'
174
+ });
175
+
176
+ /**
177
+ * Refracts a value into a HeadersElement.
178
+ * @public
179
+ */
180
+ exports.refractResponse = refractResponse;
181
+ const refractHeaders = (value, options = {}) => refract(value, {
182
+ ...options,
183
+ element: 'headers'
184
+ });
185
+
186
+ /**
187
+ * Refracts a value into an ExampleElement.
188
+ * @public
189
+ */
190
+ exports.refractHeaders = refractHeaders;
191
+ const refractExample = (value, options = {}) => refract(value, {
192
+ ...options,
193
+ element: 'example'
194
+ });
195
+
196
+ /**
197
+ * Refracts a value into a HeaderElement.
198
+ * @public
199
+ */
200
+ exports.refractExample = refractExample;
201
+ const refractHeader = (value, options = {}) => refract(value, {
202
+ ...options,
203
+ element: 'header'
204
+ });
205
+
206
+ /**
207
+ * Refracts a value into a TagElement.
208
+ * @public
209
+ */
210
+ exports.refractHeader = refractHeader;
211
+ const refractTag = (value, options = {}) => refract(value, {
212
+ ...options,
213
+ element: 'tag'
214
+ });
215
+
216
+ /**
217
+ * Refracts a value into a ReferenceElement.
218
+ * @public
219
+ */
220
+ exports.refractTag = refractTag;
221
+ const refractReference = (value, options = {}) => refract(value, {
222
+ ...options,
223
+ element: 'reference'
224
+ });
225
+
226
+ /**
227
+ * Refracts a value into a SchemaElement.
228
+ * @public
229
+ */
230
+ exports.refractReference = refractReference;
231
+ const refractSchema = (value, options = {}) => refract(value, {
232
+ ...options,
233
+ element: 'schema'
234
+ });
235
+
236
+ /**
237
+ * Refracts a value into an XmlElement.
238
+ * @public
239
+ */
240
+ exports.refractSchema = refractSchema;
241
+ const refractXml = (value, options = {}) => refract(value, {
242
+ ...options,
243
+ element: 'xml'
244
+ });
245
+
246
+ /**
247
+ * Refracts a value into a DefinitionsElement.
248
+ * @public
249
+ */
250
+ exports.refractXml = refractXml;
251
+ const refractDefinitions = (value, options = {}) => refract(value, {
252
+ ...options,
253
+ element: 'definitions'
254
+ });
255
+
256
+ /**
257
+ * Refracts a value into a ParametersDefinitionsElement.
258
+ * @public
259
+ */
260
+ exports.refractDefinitions = refractDefinitions;
261
+ const refractParametersDefinitions = (value, options = {}) => refract(value, {
262
+ ...options,
263
+ element: 'parametersDefinitions'
264
+ });
265
+
266
+ /**
267
+ * Refracts a value into a ResponsesDefinitionsElement.
268
+ * @public
269
+ */
270
+ exports.refractParametersDefinitions = refractParametersDefinitions;
271
+ const refractResponsesDefinitions = (value, options = {}) => refract(value, {
272
+ ...options,
273
+ element: 'responsesDefinitions'
274
+ });
275
+
276
+ /**
277
+ * Refracts a value into a SecurityDefinitionsElement.
278
+ * @public
279
+ */
280
+ exports.refractResponsesDefinitions = refractResponsesDefinitions;
281
+ const refractSecurityDefinitions = (value, options = {}) => refract(value, {
282
+ ...options,
283
+ element: 'securityDefinitions'
284
+ });
285
+
286
+ /**
287
+ * Refracts a value into a SecuritySchemeElement.
288
+ * @public
289
+ */
290
+ exports.refractSecurityDefinitions = refractSecurityDefinitions;
291
+ const refractSecurityScheme = (value, options = {}) => refract(value, {
292
+ ...options,
293
+ element: 'securityScheme'
294
+ });
295
+
296
+ /**
297
+ * Refracts a value into a ScopesElement.
298
+ * @public
299
+ */
300
+ exports.refractSecurityScheme = refractSecurityScheme;
301
+ const refractScopes = (value, options = {}) => refract(value, {
302
+ ...options,
303
+ element: 'scopes'
304
+ });
305
+
306
+ /**
307
+ * Refracts a value into a SecurityRequirementElement.
308
+ * @public
309
+ */
310
+ exports.refractScopes = refractScopes;
311
+ const refractSecurityRequirement = (value, options = {}) => refract(value, {
312
+ ...options,
313
+ element: 'securityRequirement'
314
+ });
315
+ exports.refractSecurityRequirement = refractSecurityRequirement;
316
+ var _default = exports.default = refract;