@skmtc/core 0.28.7 → 0.30.1

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 (427) hide show
  1. package/esm/_dnt.polyfills.d.ts +11 -0
  2. package/esm/_dnt.polyfills.js +14 -0
  3. package/esm/context/GenerateContext.js +16 -16
  4. package/esm/context/ParseContext.js +9 -1
  5. package/esm/context/RenderContext.d.ts +7 -7
  6. package/esm/context/RenderContext.js +17 -12
  7. package/esm/context/generateTypes.d.ts +2 -2
  8. package/esm/context/generateTypes.js +3 -1
  9. package/esm/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.d.ts +16 -0
  10. package/esm/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.js +23 -0
  11. package/esm/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.d.ts +16 -0
  12. package/esm/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.js +38 -0
  13. package/esm/dsl/GeneratorKeys.d.ts +2 -2
  14. package/esm/dsl/GeneratorKeys.js +6 -3
  15. package/esm/dsl/model/ModelDriver.js +4 -3
  16. package/esm/dsl/operation/gql/GqlOperationDriver.js +4 -3
  17. package/esm/dsl/operation/oas/OasOperationDriver.js +4 -3
  18. package/esm/dsl/webhook/WebhookDriver.js +4 -3
  19. package/esm/helpers/applyGeneratedSuffix.js +1 -1
  20. package/esm/helpers/isImported.d.ts +10 -74
  21. package/esm/helpers/isImported.js +12 -76
  22. package/esm/helpers/naming.d.ts +2 -1
  23. package/esm/helpers/naming.js +4 -2
  24. package/esm/helpers/normalizeWorkspacePath.d.ts +64 -0
  25. package/esm/helpers/normalizeWorkspacePath.js +98 -0
  26. package/esm/helpers/toResolvedArtifactPath.d.ts +8 -5
  27. package/esm/helpers/toResolvedArtifactPath.js +11 -7
  28. package/esm/helpers/toWorkspacePath.d.ts +3 -3
  29. package/esm/helpers/toWorkspacePath.js +5 -5
  30. package/esm/mod.d.ts +1 -0
  31. package/esm/mod.js +1 -0
  32. package/esm/oas/discriminator/Discriminator.d.ts +3 -0
  33. package/esm/oas/discriminator/Discriminator.js +7 -0
  34. package/esm/oas/document/Document.d.ts +7 -0
  35. package/esm/oas/document/Document.js +8 -0
  36. package/esm/oas/example/Example.d.ts +10 -1
  37. package/esm/oas/example/Example.js +16 -0
  38. package/esm/oas/mediaType/MediaType.d.ts +12 -0
  39. package/esm/oas/mediaType/MediaType.js +24 -0
  40. package/esm/oas/parameter/Parameter.d.ts +2 -1
  41. package/esm/oas/parameter/Parameter.js +5 -2
  42. package/esm/oas/parameter/parameter-types.d.ts +10 -2
  43. package/esm/oas/parameter/parameter-types.js +3 -1
  44. package/esm/oas/response/Response.d.ts +6 -1
  45. package/esm/oas/response/Response.js +8 -0
  46. package/esm/oas/securitySchemes/SecurityScheme.d.ts +47 -4
  47. package/esm/oas/securitySchemes/SecurityScheme.js +46 -1
  48. package/esm/oas/securitySchemes/security-scheme-types.d.ts +21 -0
  49. package/esm/oas/server/Server.d.ts +8 -2
  50. package/esm/oas/server/Server.js +10 -1
  51. package/esm/oas/tag/Tag.d.ts +9 -0
  52. package/esm/oas/tag/Tag.js +9 -0
  53. package/esm/parse/toOasDialect.d.ts +8 -7
  54. package/esm/parse/toOasDialect.js +4 -2
  55. package/esm/parse/v3-0/methods.d.ts +11 -0
  56. package/esm/parse/v3-0/methods.js +16 -0
  57. package/esm/parse/v3-0/operation/toOperationsV3.js +5 -5
  58. package/esm/parse/v3-0/parameter/toParameterV3.d.ts +4 -2
  59. package/esm/parse/v3-0/parameter/toParameterV3.js +17 -3
  60. package/esm/parse/v3-0/securitySchemes/toSecuritySchemes.js +50 -38
  61. package/esm/parse/v3-0/webhook/toWebhooksV3.js +5 -5
  62. package/esm/parse/v3-1/methods.d.ts +11 -0
  63. package/esm/parse/v3-1/methods.js +16 -0
  64. package/esm/parse/v3-1/operation/toOperationsV3.js +5 -5
  65. package/esm/parse/v3-1/parameter/toParameterV3.d.ts +4 -2
  66. package/esm/parse/v3-1/parameter/toParameterV3.js +17 -3
  67. package/esm/parse/v3-1/securitySchemes/toSecuritySchemes.js +50 -38
  68. package/esm/parse/v3-1/webhook/toWebhooksV3.js +5 -5
  69. package/esm/parse/v3-2/_helpers/parseDefault.d.ts +43 -0
  70. package/esm/parse/v3-2/_helpers/parseDefault.js +39 -0
  71. package/esm/parse/v3-2/_helpers/parseEnum.d.ts +13 -0
  72. package/esm/parse/v3-2/_helpers/parseEnum.js +23 -0
  73. package/esm/parse/v3-2/_helpers/parseExample.d.ts +41 -0
  74. package/esm/parse/v3-2/_helpers/parseExample.js +37 -0
  75. package/esm/parse/v3-2/_helpers/parseNullable.d.ts +141 -0
  76. package/esm/parse/v3-2/_helpers/parseNullable.js +140 -0
  77. package/esm/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.d.ts +2 -0
  78. package/esm/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.js +9 -0
  79. package/esm/parse/v3-2/_merge-all-of/check-at-least-one-type-match.d.ts +4 -0
  80. package/esm/parse/v3-2/_merge-all-of/check-at-least-one-type-match.js +5 -0
  81. package/esm/parse/v3-2/_merge-all-of/check-enum-conflicts.d.ts +2 -0
  82. package/esm/parse/v3-2/_merge-all-of/check-enum-conflicts.js +11 -0
  83. package/esm/parse/v3-2/_merge-all-of/check-format-conflicts.d.ts +2 -0
  84. package/esm/parse/v3-2/_merge-all-of/check-format-conflicts.js +5 -0
  85. package/esm/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.d.ts +2 -0
  86. package/esm/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.js +11 -0
  87. package/esm/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.d.ts +2 -0
  88. package/esm/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.js +5 -0
  89. package/esm/parse/v3-2/_merge-all-of/check-type-conflicts.d.ts +2 -0
  90. package/esm/parse/v3-2/_merge-all-of/check-type-conflicts.js +5 -0
  91. package/esm/parse/v3-2/_merge-all-of/cross-product.d.ts +2 -0
  92. package/esm/parse/v3-2/_merge-all-of/cross-product.js +3 -0
  93. package/esm/parse/v3-2/_merge-all-of/decompose-intersection.d.ts +6 -0
  94. package/esm/parse/v3-2/_merge-all-of/decompose-intersection.js +27 -0
  95. package/esm/parse/v3-2/_merge-all-of/decompose-union.d.ts +12 -0
  96. package/esm/parse/v3-2/_merge-all-of/decompose-union.js +69 -0
  97. package/esm/parse/v3-2/_merge-all-of/generic-merge.d.ts +3 -0
  98. package/esm/parse/v3-2/_merge-all-of/generic-merge.js +12 -0
  99. package/esm/parse/v3-2/_merge-all-of/is-equal.d.ts +1 -0
  100. package/esm/parse/v3-2/_merge-all-of/is-equal.js +19 -0
  101. package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +2 -0
  102. package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.js +44 -0
  103. package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +3 -0
  104. package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +7 -0
  105. package/esm/parse/v3-2/_merge-all-of/merge-enum-values.d.ts +3 -0
  106. package/esm/parse/v3-2/_merge-all-of/merge-enum-values.js +32 -0
  107. package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +3 -0
  108. package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.js +41 -0
  109. package/esm/parse/v3-2/_merge-all-of/merge-intersection.d.ts +8 -0
  110. package/esm/parse/v3-2/_merge-all-of/merge-intersection.js +16 -0
  111. package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +3 -0
  112. package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.js +41 -0
  113. package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +5 -0
  114. package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.js +28 -0
  115. package/esm/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -0
  116. package/esm/parse/v3-2/_merge-all-of/merge-properties.js +25 -0
  117. package/esm/parse/v3-2/_merge-all-of/merge-required.d.ts +3 -0
  118. package/esm/parse/v3-2/_merge-all-of/merge-required.js +10 -0
  119. package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +3 -0
  120. package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.js +55 -0
  121. package/esm/parse/v3-2/_merge-all-of/merge-union.d.ts +15 -0
  122. package/esm/parse/v3-2/_merge-all-of/merge-union.js +53 -0
  123. package/esm/parse/v3-2/_merge-all-of/merge.d.ts +2 -0
  124. package/esm/parse/v3-2/_merge-all-of/merge.js +155 -0
  125. package/esm/parse/v3-2/_merge-all-of/nullable-merge.d.ts +3 -0
  126. package/esm/parse/v3-2/_merge-all-of/nullable-merge.js +12 -0
  127. package/esm/parse/v3-2/_merge-all-of/types.d.ts +14 -0
  128. package/esm/parse/v3-2/_merge-all-of/types.js +2 -0
  129. package/esm/parse/v3-2/array/toArray.d.ts +80 -0
  130. package/esm/parse/v3-2/array/toArray.js +165 -0
  131. package/esm/parse/v3-2/boolean/toBoolean.d.ts +78 -0
  132. package/esm/parse/v3-2/boolean/toBoolean.js +139 -0
  133. package/esm/parse/v3-2/components/toComponentsV3.d.ts +14 -0
  134. package/esm/parse/v3-2/components/toComponentsV3.js +43 -0
  135. package/esm/parse/v3-2/contact/toContactV3.d.ts +5 -0
  136. package/esm/parse/v3-2/contact/toContactV3.js +18 -0
  137. package/esm/parse/v3-2/discriminator/toDiscriminatorV3.d.ts +14 -0
  138. package/esm/parse/v3-2/discriminator/toDiscriminatorV3.js +21 -0
  139. package/esm/parse/v3-2/document/toDocumentFieldsV3.d.ts +16 -0
  140. package/esm/parse/v3-2/document/toDocumentFieldsV3.js +33 -0
  141. package/esm/parse/v3-2/example/toExamplesV3.d.ts +77 -0
  142. package/esm/parse/v3-2/example/toExamplesV3.js +143 -0
  143. package/esm/parse/v3-2/externalDocs/toExternalDocs.d.ts +10 -0
  144. package/esm/parse/v3-2/externalDocs/toExternalDocs.js +15 -0
  145. package/esm/parse/v3-2/header/toHeadersV3.d.ts +18 -0
  146. package/esm/parse/v3-2/header/toHeadersV3.js +47 -0
  147. package/esm/parse/v3-2/info/toInfoV3.d.ts +10 -0
  148. package/esm/parse/v3-2/info/toInfoV3.js +23 -0
  149. package/esm/parse/v3-2/integer/toInteger.d.ts +21 -0
  150. package/esm/parse/v3-2/integer/toInteger.js +115 -0
  151. package/esm/parse/v3-2/license/toLicenseV3.d.ts +5 -0
  152. package/esm/parse/v3-2/license/toLicenseV3.js +17 -0
  153. package/esm/parse/v3-2/link/toLinksV3.d.ts +16 -0
  154. package/esm/parse/v3-2/link/toLinksV3.js +40 -0
  155. package/esm/parse/v3-2/mediaType/toMediaTypeItemV3.d.ts +323 -0
  156. package/esm/parse/v3-2/mediaType/toMediaTypeItemV3.js +375 -0
  157. package/esm/parse/v3-2/methods.d.ts +17 -0
  158. package/esm/parse/v3-2/methods.js +21 -0
  159. package/esm/parse/v3-2/number/toNumber.d.ts +10 -0
  160. package/esm/parse/v3-2/number/toNumber.js +115 -0
  161. package/esm/parse/v3-2/object/toAdditionalPropertiesV3.d.ts +11 -0
  162. package/esm/parse/v3-2/object/toAdditionalPropertiesV3.js +10 -0
  163. package/esm/parse/v3-2/object/toObject.d.ts +10 -0
  164. package/esm/parse/v3-2/object/toObject.js +90 -0
  165. package/esm/parse/v3-2/operation/toOperationsV3.d.ts +25 -0
  166. package/esm/parse/v3-2/operation/toOperationsV3.js +129 -0
  167. package/esm/parse/v3-2/parameter/toParameterV3.d.ts +39 -0
  168. package/esm/parse/v3-2/parameter/toParameterV3.js +152 -0
  169. package/esm/parse/v3-2/parameter/warnQuerystringConflictsV3.d.ts +22 -0
  170. package/esm/parse/v3-2/parameter/warnQuerystringConflictsV3.js +39 -0
  171. package/esm/parse/v3-2/pathItem/dropAdditionalOperationsV3.d.ts +17 -0
  172. package/esm/parse/v3-2/pathItem/dropAdditionalOperationsV3.js +34 -0
  173. package/esm/parse/v3-2/pathItem/toPathItemV3.d.ts +23 -0
  174. package/esm/parse/v3-2/pathItem/toPathItemV3.js +45 -0
  175. package/esm/parse/v3-2/ref/toRefV31.d.ts +19 -0
  176. package/esm/parse/v3-2/ref/toRefV31.js +10 -0
  177. package/esm/parse/v3-2/requestBody/toRequestBodiesV3.d.ts +18 -0
  178. package/esm/parse/v3-2/requestBody/toRequestBodiesV3.js +44 -0
  179. package/esm/parse/v3-2/response/toResponseV3.d.ts +29 -0
  180. package/esm/parse/v3-2/response/toResponseV3.js +56 -0
  181. package/esm/parse/v3-2/schema/toSchemasV3.d.ts +29 -0
  182. package/esm/parse/v3-2/schema/toSchemasV3.js +511 -0
  183. package/esm/parse/v3-2/securityRequirement/toSecurityRequirement.d.ts +9 -0
  184. package/esm/parse/v3-2/securityRequirement/toSecurityRequirement.js +9 -0
  185. package/esm/parse/v3-2/securitySchemes/toSecuritySchemes.d.ts +17 -0
  186. package/esm/parse/v3-2/securitySchemes/toSecuritySchemes.js +152 -0
  187. package/esm/parse/v3-2/server/toServerV3.d.ts +26 -0
  188. package/esm/parse/v3-2/server/toServerV3.js +31 -0
  189. package/esm/parse/v3-2/serverVariable/toServerVariableV3.d.ts +22 -0
  190. package/esm/parse/v3-2/serverVariable/toServerVariableV3.js +30 -0
  191. package/esm/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.d.ts +14 -0
  192. package/esm/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.js +25 -0
  193. package/esm/parse/v3-2/string/toString.d.ts +146 -0
  194. package/esm/parse/v3-2/string/toString.js +211 -0
  195. package/esm/parse/v3-2/tag/toTagsV3.d.ts +22 -0
  196. package/esm/parse/v3-2/tag/toTagsV3.js +78 -0
  197. package/esm/parse/v3-2/union/toUnion.d.ts +12 -0
  198. package/esm/parse/v3-2/union/toUnion.js +68 -0
  199. package/esm/parse/v3-2/unknown/toUnknown.d.ts +10 -0
  200. package/esm/parse/v3-2/unknown/toUnknown.js +19 -0
  201. package/esm/parse/v3-2/webhook/toWebhooksV3.d.ts +48 -0
  202. package/esm/parse/v3-2/webhook/toWebhooksV3.js +139 -0
  203. package/esm/types/Method.d.ts +7 -4
  204. package/esm/types/Method.js +17 -4
  205. package/esm/types/Preview.d.ts +2 -1
  206. package/esm/types/Settings.js +6 -8
  207. package/esm/types/SkmtcDocument.d.ts +6 -6
  208. package/package.json +1 -1
  209. package/script/_dnt.polyfills.d.ts +11 -0
  210. package/script/_dnt.polyfills.js +14 -0
  211. package/script/context/GenerateContext.js +16 -16
  212. package/script/context/ParseContext.js +9 -1
  213. package/script/context/RenderContext.d.ts +7 -7
  214. package/script/context/RenderContext.js +17 -12
  215. package/script/context/generateTypes.d.ts +2 -2
  216. package/script/context/generateTypes.js +3 -1
  217. package/script/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.d.ts +16 -0
  218. package/script/deps/jsr.io/@std/path/1.1.6/posix/is_absolute.js +26 -0
  219. package/script/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.d.ts +16 -0
  220. package/script/deps/jsr.io/@std/path/1.1.6/windows/is_absolute.js +41 -0
  221. package/script/dsl/GeneratorKeys.d.ts +2 -2
  222. package/script/dsl/GeneratorKeys.js +6 -3
  223. package/script/dsl/model/ModelDriver.js +4 -3
  224. package/script/dsl/operation/gql/GqlOperationDriver.js +4 -3
  225. package/script/dsl/operation/oas/OasOperationDriver.js +4 -3
  226. package/script/dsl/webhook/WebhookDriver.js +4 -3
  227. package/script/helpers/applyGeneratedSuffix.js +1 -1
  228. package/script/helpers/isImported.d.ts +10 -74
  229. package/script/helpers/isImported.js +12 -76
  230. package/script/helpers/naming.d.ts +2 -1
  231. package/script/helpers/naming.js +4 -2
  232. package/script/helpers/normalizeWorkspacePath.d.ts +64 -0
  233. package/script/helpers/normalizeWorkspacePath.js +107 -0
  234. package/script/helpers/toResolvedArtifactPath.d.ts +8 -5
  235. package/script/helpers/toResolvedArtifactPath.js +11 -7
  236. package/script/helpers/toWorkspacePath.d.ts +3 -3
  237. package/script/helpers/toWorkspacePath.js +5 -5
  238. package/script/mod.d.ts +1 -0
  239. package/script/mod.js +1 -0
  240. package/script/oas/discriminator/Discriminator.d.ts +3 -0
  241. package/script/oas/discriminator/Discriminator.js +7 -0
  242. package/script/oas/document/Document.d.ts +7 -0
  243. package/script/oas/document/Document.js +8 -0
  244. package/script/oas/example/Example.d.ts +10 -1
  245. package/script/oas/example/Example.js +16 -0
  246. package/script/oas/mediaType/MediaType.d.ts +12 -0
  247. package/script/oas/mediaType/MediaType.js +24 -0
  248. package/script/oas/parameter/Parameter.d.ts +2 -1
  249. package/script/oas/parameter/Parameter.js +5 -2
  250. package/script/oas/parameter/parameter-types.d.ts +10 -2
  251. package/script/oas/parameter/parameter-types.js +3 -1
  252. package/script/oas/response/Response.d.ts +6 -1
  253. package/script/oas/response/Response.js +8 -0
  254. package/script/oas/securitySchemes/SecurityScheme.d.ts +47 -4
  255. package/script/oas/securitySchemes/SecurityScheme.js +46 -1
  256. package/script/oas/securitySchemes/security-scheme-types.d.ts +21 -0
  257. package/script/oas/server/Server.d.ts +8 -2
  258. package/script/oas/server/Server.js +10 -1
  259. package/script/oas/tag/Tag.d.ts +9 -0
  260. package/script/oas/tag/Tag.js +9 -0
  261. package/script/parse/toOasDialect.d.ts +8 -7
  262. package/script/parse/toOasDialect.js +4 -2
  263. package/script/parse/v3-0/methods.d.ts +11 -0
  264. package/script/parse/v3-0/methods.js +20 -0
  265. package/script/parse/v3-0/operation/toOperationsV3.js +5 -5
  266. package/script/parse/v3-0/parameter/toParameterV3.d.ts +4 -2
  267. package/script/parse/v3-0/parameter/toParameterV3.js +17 -3
  268. package/script/parse/v3-0/securitySchemes/toSecuritySchemes.js +49 -37
  269. package/script/parse/v3-0/webhook/toWebhooksV3.js +5 -5
  270. package/script/parse/v3-1/methods.d.ts +11 -0
  271. package/script/parse/v3-1/methods.js +20 -0
  272. package/script/parse/v3-1/operation/toOperationsV3.js +5 -5
  273. package/script/parse/v3-1/parameter/toParameterV3.d.ts +4 -2
  274. package/script/parse/v3-1/parameter/toParameterV3.js +17 -3
  275. package/script/parse/v3-1/securitySchemes/toSecuritySchemes.js +49 -37
  276. package/script/parse/v3-1/webhook/toWebhooksV3.js +5 -5
  277. package/script/parse/v3-2/_helpers/parseDefault.d.ts +43 -0
  278. package/script/parse/v3-2/_helpers/parseDefault.js +43 -0
  279. package/script/parse/v3-2/_helpers/parseEnum.d.ts +13 -0
  280. package/script/parse/v3-2/_helpers/parseEnum.js +27 -0
  281. package/script/parse/v3-2/_helpers/parseExample.d.ts +41 -0
  282. package/script/parse/v3-2/_helpers/parseExample.js +41 -0
  283. package/script/parse/v3-2/_helpers/parseNullable.d.ts +141 -0
  284. package/script/parse/v3-2/_helpers/parseNullable.js +144 -0
  285. package/script/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.d.ts +2 -0
  286. package/script/parse/v3-2/_merge-all-of/check-array-item-type-conflicts.js +13 -0
  287. package/script/parse/v3-2/_merge-all-of/check-at-least-one-type-match.d.ts +4 -0
  288. package/script/parse/v3-2/_merge-all-of/check-at-least-one-type-match.js +9 -0
  289. package/script/parse/v3-2/_merge-all-of/check-enum-conflicts.d.ts +2 -0
  290. package/script/parse/v3-2/_merge-all-of/check-enum-conflicts.js +15 -0
  291. package/script/parse/v3-2/_merge-all-of/check-format-conflicts.d.ts +2 -0
  292. package/script/parse/v3-2/_merge-all-of/check-format-conflicts.js +9 -0
  293. package/script/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.d.ts +2 -0
  294. package/script/parse/v3-2/_merge-all-of/check-number-constraints-conflicts.js +15 -0
  295. package/script/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.d.ts +2 -0
  296. package/script/parse/v3-2/_merge-all-of/check-read-only-write-only-conflicts.js +9 -0
  297. package/script/parse/v3-2/_merge-all-of/check-type-conflicts.d.ts +2 -0
  298. package/script/parse/v3-2/_merge-all-of/check-type-conflicts.js +9 -0
  299. package/script/parse/v3-2/_merge-all-of/cross-product.d.ts +2 -0
  300. package/script/parse/v3-2/_merge-all-of/cross-product.js +7 -0
  301. package/script/parse/v3-2/_merge-all-of/decompose-intersection.d.ts +6 -0
  302. package/script/parse/v3-2/_merge-all-of/decompose-intersection.js +31 -0
  303. package/script/parse/v3-2/_merge-all-of/decompose-union.d.ts +12 -0
  304. package/script/parse/v3-2/_merge-all-of/decompose-union.js +73 -0
  305. package/script/parse/v3-2/_merge-all-of/generic-merge.d.ts +3 -0
  306. package/script/parse/v3-2/_merge-all-of/generic-merge.js +16 -0
  307. package/script/parse/v3-2/_merge-all-of/is-equal.d.ts +1 -0
  308. package/script/parse/v3-2/_merge-all-of/is-equal.js +23 -0
  309. package/script/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +2 -0
  310. package/script/parse/v3-2/_merge-all-of/merge-array-constraints.js +80 -0
  311. package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +3 -0
  312. package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +43 -0
  313. package/script/parse/v3-2/_merge-all-of/merge-enum-values.d.ts +3 -0
  314. package/script/parse/v3-2/_merge-all-of/merge-enum-values.js +68 -0
  315. package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +3 -0
  316. package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.js +77 -0
  317. package/script/parse/v3-2/_merge-all-of/merge-intersection.d.ts +8 -0
  318. package/script/parse/v3-2/_merge-all-of/merge-intersection.js +20 -0
  319. package/script/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +3 -0
  320. package/script/parse/v3-2/_merge-all-of/merge-number-constraints.js +77 -0
  321. package/script/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +5 -0
  322. package/script/parse/v3-2/_merge-all-of/merge-object-constraints.js +65 -0
  323. package/script/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -0
  324. package/script/parse/v3-2/_merge-all-of/merge-properties.js +29 -0
  325. package/script/parse/v3-2/_merge-all-of/merge-required.d.ts +3 -0
  326. package/script/parse/v3-2/_merge-all-of/merge-required.js +15 -0
  327. package/script/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +3 -0
  328. package/script/parse/v3-2/_merge-all-of/merge-string-constraints.js +91 -0
  329. package/script/parse/v3-2/_merge-all-of/merge-union.d.ts +15 -0
  330. package/script/parse/v3-2/_merge-all-of/merge-union.js +58 -0
  331. package/script/parse/v3-2/_merge-all-of/merge.d.ts +2 -0
  332. package/script/parse/v3-2/_merge-all-of/merge.js +159 -0
  333. package/script/parse/v3-2/_merge-all-of/nullable-merge.d.ts +3 -0
  334. package/script/parse/v3-2/_merge-all-of/nullable-merge.js +17 -0
  335. package/script/parse/v3-2/_merge-all-of/types.d.ts +14 -0
  336. package/script/parse/v3-2/_merge-all-of/types.js +38 -0
  337. package/script/parse/v3-2/array/toArray.d.ts +80 -0
  338. package/script/parse/v3-2/array/toArray.js +203 -0
  339. package/script/parse/v3-2/boolean/toBoolean.d.ts +78 -0
  340. package/script/parse/v3-2/boolean/toBoolean.js +177 -0
  341. package/script/parse/v3-2/components/toComponentsV3.d.ts +14 -0
  342. package/script/parse/v3-2/components/toComponentsV3.js +47 -0
  343. package/script/parse/v3-2/contact/toContactV3.d.ts +5 -0
  344. package/script/parse/v3-2/contact/toContactV3.js +22 -0
  345. package/script/parse/v3-2/discriminator/toDiscriminatorV3.d.ts +14 -0
  346. package/script/parse/v3-2/discriminator/toDiscriminatorV3.js +25 -0
  347. package/script/parse/v3-2/document/toDocumentFieldsV3.d.ts +16 -0
  348. package/script/parse/v3-2/document/toDocumentFieldsV3.js +37 -0
  349. package/script/parse/v3-2/example/toExamplesV3.d.ts +77 -0
  350. package/script/parse/v3-2/example/toExamplesV3.js +149 -0
  351. package/script/parse/v3-2/externalDocs/toExternalDocs.d.ts +10 -0
  352. package/script/parse/v3-2/externalDocs/toExternalDocs.js +52 -0
  353. package/script/parse/v3-2/header/toHeadersV3.d.ts +18 -0
  354. package/script/parse/v3-2/header/toHeadersV3.js +51 -0
  355. package/script/parse/v3-2/info/toInfoV3.d.ts +10 -0
  356. package/script/parse/v3-2/info/toInfoV3.js +27 -0
  357. package/script/parse/v3-2/integer/toInteger.d.ts +21 -0
  358. package/script/parse/v3-2/integer/toInteger.js +153 -0
  359. package/script/parse/v3-2/license/toLicenseV3.d.ts +5 -0
  360. package/script/parse/v3-2/license/toLicenseV3.js +21 -0
  361. package/script/parse/v3-2/link/toLinksV3.d.ts +16 -0
  362. package/script/parse/v3-2/link/toLinksV3.js +44 -0
  363. package/script/parse/v3-2/mediaType/toMediaTypeItemV3.d.ts +323 -0
  364. package/script/parse/v3-2/mediaType/toMediaTypeItemV3.js +381 -0
  365. package/script/parse/v3-2/methods.d.ts +17 -0
  366. package/script/parse/v3-2/methods.js +25 -0
  367. package/script/parse/v3-2/number/toNumber.d.ts +10 -0
  368. package/script/parse/v3-2/number/toNumber.js +152 -0
  369. package/script/parse/v3-2/object/toAdditionalPropertiesV3.d.ts +11 -0
  370. package/script/parse/v3-2/object/toAdditionalPropertiesV3.js +14 -0
  371. package/script/parse/v3-2/object/toObject.d.ts +10 -0
  372. package/script/parse/v3-2/object/toObject.js +94 -0
  373. package/script/parse/v3-2/operation/toOperationsV3.d.ts +25 -0
  374. package/script/parse/v3-2/operation/toOperationsV3.js +134 -0
  375. package/script/parse/v3-2/parameter/toParameterV3.d.ts +39 -0
  376. package/script/parse/v3-2/parameter/toParameterV3.js +191 -0
  377. package/script/parse/v3-2/parameter/warnQuerystringConflictsV3.d.ts +22 -0
  378. package/script/parse/v3-2/parameter/warnQuerystringConflictsV3.js +43 -0
  379. package/script/parse/v3-2/pathItem/dropAdditionalOperationsV3.d.ts +17 -0
  380. package/script/parse/v3-2/pathItem/dropAdditionalOperationsV3.js +38 -0
  381. package/script/parse/v3-2/pathItem/toPathItemV3.d.ts +23 -0
  382. package/script/parse/v3-2/pathItem/toPathItemV3.js +50 -0
  383. package/script/parse/v3-2/ref/toRefV31.d.ts +19 -0
  384. package/script/parse/v3-2/ref/toRefV31.js +14 -0
  385. package/script/parse/v3-2/requestBody/toRequestBodiesV3.d.ts +18 -0
  386. package/script/parse/v3-2/requestBody/toRequestBodiesV3.js +49 -0
  387. package/script/parse/v3-2/response/toResponseV3.d.ts +29 -0
  388. package/script/parse/v3-2/response/toResponseV3.js +62 -0
  389. package/script/parse/v3-2/schema/toSchemasV3.d.ts +29 -0
  390. package/script/parse/v3-2/schema/toSchemasV3.js +518 -0
  391. package/script/parse/v3-2/securityRequirement/toSecurityRequirement.d.ts +9 -0
  392. package/script/parse/v3-2/securityRequirement/toSecurityRequirement.js +13 -0
  393. package/script/parse/v3-2/securitySchemes/toSecuritySchemes.d.ts +17 -0
  394. package/script/parse/v3-2/securitySchemes/toSecuritySchemes.js +189 -0
  395. package/script/parse/v3-2/server/toServerV3.d.ts +26 -0
  396. package/script/parse/v3-2/server/toServerV3.js +37 -0
  397. package/script/parse/v3-2/serverVariable/toServerVariableV3.d.ts +22 -0
  398. package/script/parse/v3-2/serverVariable/toServerVariableV3.js +36 -0
  399. package/script/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.d.ts +14 -0
  400. package/script/parse/v3-2/specificationExtensions/toSpecificationExtensionsV3.js +30 -0
  401. package/script/parse/v3-2/string/toString.d.ts +146 -0
  402. package/script/parse/v3-2/string/toString.js +249 -0
  403. package/script/parse/v3-2/tag/toTagsV3.d.ts +22 -0
  404. package/script/parse/v3-2/tag/toTagsV3.js +83 -0
  405. package/script/parse/v3-2/union/toUnion.d.ts +12 -0
  406. package/script/parse/v3-2/union/toUnion.js +72 -0
  407. package/script/parse/v3-2/unknown/toUnknown.d.ts +10 -0
  408. package/script/parse/v3-2/unknown/toUnknown.js +23 -0
  409. package/script/parse/v3-2/webhook/toWebhooksV3.d.ts +48 -0
  410. package/script/parse/v3-2/webhook/toWebhooksV3.js +144 -0
  411. package/script/types/Method.d.ts +7 -4
  412. package/script/types/Method.js +17 -4
  413. package/script/types/Preview.d.ts +2 -1
  414. package/script/types/Settings.js +7 -9
  415. package/script/types/SkmtcDocument.d.ts +6 -6
  416. package/esm/deps/jsr.io/@std/path/1.1.6/extname.d.ts +0 -24
  417. package/esm/deps/jsr.io/@std/path/1.1.6/extname.js +0 -31
  418. package/esm/deps/jsr.io/@std/path/1.1.6/normalize.d.ts +0 -25
  419. package/esm/deps/jsr.io/@std/path/1.1.6/normalize.js +0 -32
  420. package/esm/deps/jsr.io/@std/path/1.1.6/windows/extname.d.ts +0 -17
  421. package/esm/deps/jsr.io/@std/path/1.1.6/windows/extname.js +0 -83
  422. package/script/deps/jsr.io/@std/path/1.1.6/extname.d.ts +0 -24
  423. package/script/deps/jsr.io/@std/path/1.1.6/extname.js +0 -34
  424. package/script/deps/jsr.io/@std/path/1.1.6/normalize.d.ts +0 -25
  425. package/script/deps/jsr.io/@std/path/1.1.6/normalize.js +0 -35
  426. package/script/deps/jsr.io/@std/path/1.1.6/windows/extname.d.ts +0 -17
  427. package/script/deps/jsr.io/@std/path/1.1.6/windows/extname.js +0 -86
@@ -0,0 +1,78 @@
1
+ import { OasTag } from '../../../oas/tag/Tag.js';
2
+ import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
3
+ import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
4
+ export const toTagsV3 = ({ tags, stackTrail, context }) => {
5
+ if (!tags) {
6
+ return undefined;
7
+ }
8
+ const parents = new Map(tags.map(({ name, parent }) => [name, parent]));
9
+ return tags.map(tag => {
10
+ const parentError = toParentError({ name: tag.name, parent: tag.parent, parents });
11
+ if (!parentError) {
12
+ return toTagV3({ tag, stackTrail, context });
13
+ }
14
+ context.logIssue({
15
+ key: 'parent',
16
+ level: 'warning',
17
+ message: `Tag '${tag.name}' ${parentError}; dropping 'parent'`,
18
+ parent: tag,
19
+ stackTrail,
20
+ type: 'INVALID_TAG_PARENT'
21
+ });
22
+ return toTagV3({ tag: { ...tag, parent: undefined }, stackTrail, context });
23
+ });
24
+ };
25
+ /** Describes why the tag's `parent` is invalid, or returns undefined when it is valid. */
26
+ const toParentError = ({ name, parent, parents }) => {
27
+ if (parent === undefined) {
28
+ return undefined;
29
+ }
30
+ if (!parents.has(parent)) {
31
+ return `names parent '${parent}', which is not a tag`;
32
+ }
33
+ if (leadsBackTo({ name, current: parent, parents, visited: new Set() })) {
34
+ return `is in a parent cycle through '${parent}'`;
35
+ }
36
+ return undefined;
37
+ };
38
+ /** Follows the parent chain from `current` and reports whether it reaches `name`. */
39
+ const leadsBackTo = ({ name, current, parents, visited }) => {
40
+ if (current === undefined) {
41
+ return false;
42
+ }
43
+ if (current === name) {
44
+ return true;
45
+ }
46
+ // The chain loops without reaching `name`: the cycle is above this tag, and
47
+ // the tags in it report it.
48
+ if (visited.has(current)) {
49
+ return false;
50
+ }
51
+ return leadsBackTo({
52
+ name,
53
+ current: parents.get(current),
54
+ parents,
55
+ visited: new Set([...visited, current])
56
+ });
57
+ };
58
+ export const toTagV3 = ({ tag, stackTrail, context }) => {
59
+ const { name, description, summary, parent, kind, externalDocs, ...skipped } = tag;
60
+ const parsedExternalDocs = stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context }));
61
+ const extensionFields = toSpecificationExtensionsV3({
62
+ skipped,
63
+ parent: tag,
64
+ context,
65
+ stackTrail,
66
+ parentType: 'tag'
67
+ });
68
+ const fields = {
69
+ name,
70
+ description,
71
+ summary,
72
+ parent,
73
+ kind,
74
+ externalDocs: parsedExternalDocs,
75
+ extensionFields
76
+ };
77
+ return new OasTag(fields);
78
+ };
@@ -0,0 +1,12 @@
1
+ import type { OpenAPIV3 } from 'openapi-types';
2
+ import type { ParseContextType } from '../../../context/parseTypes.js';
3
+ import { OasUnion } from '../../../oas/union/Union.js';
4
+ import type { StackTrail } from '../../../context/StackTrail.js';
5
+ export type ToUnionArgs = {
6
+ value: OpenAPIV3.SchemaObject;
7
+ members: (OpenAPIV3.ReferenceObject | OpenAPIV3.SchemaObject)[];
8
+ parentType: 'anyOf' | 'oneOf';
9
+ stackTrail: StackTrail;
10
+ context: ParseContextType;
11
+ };
12
+ export declare const toUnion: ({ value, members, parentType, stackTrail, context }: ToUnionArgs) => OasUnion;
@@ -0,0 +1,68 @@
1
+ import { OasUnion } from '../../../oas/union/Union.js';
2
+ import { toDiscriminatorV3 } from '../discriminator/toDiscriminatorV3.js';
3
+ import { toSchemaV3 } from '../schema/toSchemasV3.js';
4
+ import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
5
+ import { parseNullable } from '../_helpers/parseNullable.js';
6
+ import { parseExample } from '../_helpers/parseExample.js';
7
+ import { parseDefault } from '../_helpers/parseDefault.js';
8
+ import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
9
+ export const toUnion = ({ value, members, parentType, stackTrail, context }) => {
10
+ const { nullable, value: valueWithoutNullable } = parseNullable({
11
+ value,
12
+ context,
13
+ stackTrail
14
+ });
15
+ const { discriminator, title, description, externalDocs, example: unparsedExample, default: unparsedDefaultValue, ...skipped } = valueWithoutNullable;
16
+ const example = parseExample({
17
+ value: unparsedExample,
18
+ context,
19
+ parent: value,
20
+ nullable,
21
+ check: isPresent,
22
+ toMessage: item => `Removed invalid example. Expected a non-null value, got: ${item}`,
23
+ stackTrail
24
+ });
25
+ const defaultValue = parseDefault({
26
+ value: unparsedDefaultValue,
27
+ context,
28
+ parent: value,
29
+ nullable,
30
+ check: isPresent,
31
+ toMessage: item => `Removed invalid default. Expected a non-null value, got: ${item}`,
32
+ stackTrail
33
+ });
34
+ const extensionFields = toSpecificationExtensionsV3({
35
+ skipped,
36
+ parent: value,
37
+ context,
38
+ stackTrail,
39
+ parentType: `schema:${parentType}`
40
+ });
41
+ const discriminatorParsed = stackTrail.trace('discriminator', st => toDiscriminatorV3({ discriminator, stackTrail: st, context }));
42
+ const membersParsed = members.reduce((acc, item, index) => {
43
+ if (item === undefined || item === null) {
44
+ return acc;
45
+ }
46
+ return [
47
+ ...acc,
48
+ stackTrail.trace(`${index}`, st => toSchemaV3({ schema: item, stackTrail: st, context }))
49
+ ];
50
+ }, []);
51
+ return context.withStackTrail(stackTrail, () => new OasUnion({
52
+ title,
53
+ description,
54
+ externalDocs: stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context })),
55
+ nullable,
56
+ default: defaultValue,
57
+ discriminator: discriminatorParsed,
58
+ members: membersParsed,
59
+ example,
60
+ extensionFields
61
+ }, context));
62
+ };
63
+ // A union (anyOf/oneOf) value may match any of its members, so the most we
64
+ // can validate without resolving members is that a present default/example
65
+ // is not a bare `null` on a non-nullable schema.
66
+ const isPresent = (value) => {
67
+ return value !== null && value !== undefined;
68
+ };
@@ -0,0 +1,10 @@
1
+ import type { OpenAPIV3 } from 'openapi-types';
2
+ import type { ParseContextType } from '../../../context/parseTypes.js';
3
+ import { OasUnknown } from '../../../oas/unknown/Unknown.js';
4
+ import type { StackTrail } from '../../../context/StackTrail.js';
5
+ export type ToUnknownArgs = {
6
+ value: OpenAPIV3.SchemaObject;
7
+ stackTrail: StackTrail;
8
+ context: ParseContextType;
9
+ };
10
+ export declare const toUnknown: ({ value, stackTrail, context }: ToUnknownArgs) => OasUnknown;
@@ -0,0 +1,19 @@
1
+ import { OasUnknown } from '../../../oas/unknown/Unknown.js';
2
+ import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
3
+ export const toUnknown = ({ value, stackTrail, context }) => {
4
+ const { type: _type, title, description, example, nullable, ...skipped } = value;
5
+ const extensionFields = toSpecificationExtensionsV3({
6
+ skipped,
7
+ parent: value,
8
+ context,
9
+ stackTrail,
10
+ parentType: 'schema:unknown'
11
+ });
12
+ return context.withStackTrail(stackTrail, () => new OasUnknown({
13
+ title,
14
+ description,
15
+ nullable,
16
+ extensionFields,
17
+ example
18
+ }, context));
19
+ };
@@ -0,0 +1,48 @@
1
+ import type { OpenAPIV3 } from 'openapi-types';
2
+ import type { Method } from '../../../types/Method.js';
3
+ import type { ParseContextType } from '../../../context/parseTypes.js';
4
+ import { OasWebhook } from '../../../oas/webhook/Webhook.js';
5
+ import type { OasPathItem } from '../../../oas/pathItem/PathItem.js';
6
+ import type { StackTrail } from '../../../context/StackTrail.js';
7
+ /**
8
+ * The 3.1 `webhooks` object: a map of webhook NAME → PathItem, identical
9
+ * in shape to `paths` but keyed by name rather than URL path. Inline
10
+ * PathItems only — a webhook PathItem `$ref` is a 3.1 edge case not yet
11
+ * handled (see the arc note §5 Refs).
12
+ */
13
+ export type WebhooksObject = Record<string, OpenAPIV3.PathItemObject>;
14
+ type WebhookInfo = {
15
+ method: Method;
16
+ name: string;
17
+ pathItem: OasPathItem | undefined;
18
+ };
19
+ export type ToWebhookV3Args = {
20
+ operation: OpenAPIV3.OperationObject;
21
+ webhookInfo: WebhookInfo;
22
+ stackTrail: StackTrail;
23
+ context: ParseContextType;
24
+ };
25
+ /**
26
+ * Parses a single webhook Operation Object into an {@link OasWebhook}.
27
+ *
28
+ * Mirrors `toOperationV3` and reuses the same leaf field parsers
29
+ * (`toParameterListV3` / `toRequestBodyV3` / `toResponsesV3` / …) — the
30
+ * inner Operation Object is structurally identical. Only the orchestration
31
+ * is duplicated (the dialect-shaped glue), and the output is an
32
+ * `OasWebhook` carrying a `name`, not an `OasOperation` carrying a `path`.
33
+ */
34
+ export declare const toWebhookV3: ({ operation, webhookInfo, stackTrail, context }: ToWebhookV3Args) => OasWebhook;
35
+ export type ToWebhooksV3Args = {
36
+ webhooks: WebhooksObject | undefined;
37
+ stackTrail: StackTrail;
38
+ context: ParseContextType;
39
+ };
40
+ /**
41
+ * Flattens the 3.1 `webhooks` map into `OasWebhook[]`, mirroring
42
+ * `toOperationsV3`'s `paths` → `OasOperation[]` flattening. Returns `[]`
43
+ * when no `webhooks` object is present (the common 3.0 / no-webhook case).
44
+ * The stack trail nests `webhooks` → `<name>` → `<method>` so
45
+ * `OasDocument.removeItem` can locate a webhook by name.
46
+ */
47
+ export declare const toWebhooksV3: ({ webhooks, stackTrail, context }: ToWebhooksV3Args) => OasWebhook[];
48
+ export {};
@@ -0,0 +1,139 @@
1
+ import { toRequestBodyV3 } from '../requestBody/toRequestBodiesV3.js';
2
+ import { toResponsesV3 } from '../response/toResponseV3.js';
3
+ import { toParameterListV3 } from '../parameter/toParameterV3.js';
4
+ import { OasWebhook } from '../../../oas/webhook/Webhook.js';
5
+ import { toPathItemResultV3 } from '../pathItem/toPathItemV3.js';
6
+ import { toPathItemMethod } from '../methods.js';
7
+ import { dropAdditionalOperationsV3 } from '../pathItem/dropAdditionalOperationsV3.js';
8
+ import { warnQuerystringConflictsV3 } from '../parameter/warnQuerystringConflictsV3.js';
9
+ import { toSpecificationExtensionsV3 } from '../specificationExtensions/toSpecificationExtensionsV3.js';
10
+ import { toSecurityRequirementsV3 } from '../securityRequirement/toSecurityRequirement.js';
11
+ import { toExternalDocs } from '../externalDocs/toExternalDocs.js';
12
+ import { toOptionalServersV3 } from '../server/toServerV3.js';
13
+ /**
14
+ * Parses a single webhook Operation Object into an {@link OasWebhook}.
15
+ *
16
+ * Mirrors `toOperationV3` and reuses the same leaf field parsers
17
+ * (`toParameterListV3` / `toRequestBodyV3` / `toResponsesV3` / …) — the
18
+ * inner Operation Object is structurally identical. Only the orchestration
19
+ * is duplicated (the dialect-shaped glue), and the output is an
20
+ * `OasWebhook` carrying a `name`, not an `OasOperation` carrying a `path`.
21
+ */
22
+ export const toWebhookV3 = ({ operation, webhookInfo, stackTrail, context }) => {
23
+ const { method, name, pathItem } = webhookInfo;
24
+ const { operationId, tags, summary, description, parameters, requestBody, responses, deprecated, security, externalDocs, servers, ...skipped } = operation;
25
+ const extensionFields = toSpecificationExtensionsV3({
26
+ skipped,
27
+ parent: operation,
28
+ context,
29
+ stackTrail,
30
+ parentType: 'operation'
31
+ });
32
+ const parsedParameters = stackTrail.trace('parameters', st => toParameterListV3({ parameters, stackTrail: st, context }));
33
+ warnQuerystringConflictsV3({ parameters: parsedParameters, pathItem, stackTrail, context });
34
+ const parsedRequestBody = stackTrail.trace('requestBody', st => toRequestBodyV3({ requestBody, stackTrail: st, context }));
35
+ const parsedResponses = stackTrail.trace('responses', st => toResponsesV3({ responses, stackTrail: st, context }));
36
+ const parsedSecurity = stackTrail.trace('security', st => toSecurityRequirementsV3({ security, stackTrail: st, context }));
37
+ const parsedExternalDocs = stackTrail.trace('externalDocs', st => toExternalDocs({ externalDocs, stackTrail: st, context }));
38
+ const parsedServers = stackTrail.trace('servers', st => toOptionalServersV3({ servers, stackTrail: st, context }));
39
+ return context.withStackTrail(stackTrail, () => new OasWebhook({
40
+ pathItem,
41
+ name,
42
+ method,
43
+ operationId,
44
+ summary,
45
+ tags,
46
+ description,
47
+ parameters: parsedParameters,
48
+ requestBody: parsedRequestBody,
49
+ responses: parsedResponses,
50
+ deprecated,
51
+ security: parsedSecurity,
52
+ externalDocs: parsedExternalDocs,
53
+ servers: parsedServers,
54
+ extensionFields
55
+ }, context));
56
+ };
57
+ /**
58
+ * Flattens the 3.1 `webhooks` map into `OasWebhook[]`, mirroring
59
+ * `toOperationsV3`'s `paths` → `OasOperation[]` flattening. Returns `[]`
60
+ * when no `webhooks` object is present (the common 3.0 / no-webhook case).
61
+ * The stack trail nests `webhooks` → `<name>` → `<method>` so
62
+ * `OasDocument.removeItem` can locate a webhook by name.
63
+ */
64
+ export const toWebhooksV3 = ({ webhooks, stackTrail, context }) => {
65
+ if (!webhooks) {
66
+ return [];
67
+ }
68
+ return Object.entries(webhooks).flatMap(([name, pathItem]) => {
69
+ return stackTrail.trace(name, nameStack => {
70
+ if (!pathItem) {
71
+ return [];
72
+ }
73
+ const fixedFields = dropAdditionalOperationsV3({ pathItem, stackTrail: nameStack, context });
74
+ const cleaned = Object.entries(fixedFields).reduce(({ rest, methodObject }, [key, operation]) => {
75
+ const method = toPathItemMethod(key);
76
+ if (method) {
77
+ const { [method]: _deleted, ...remaining } = rest;
78
+ return {
79
+ rest: remaining,
80
+ methodObject: {
81
+ ...methodObject,
82
+ [method]: operation
83
+ }
84
+ };
85
+ }
86
+ return { rest, methodObject };
87
+ }, {
88
+ rest: fixedFields,
89
+ methodObject: {}
90
+ });
91
+ const pathItemResult = toPathItemResultV3({
92
+ pathItem: cleaned.rest,
93
+ stackTrail: nameStack,
94
+ context
95
+ });
96
+ if (!pathItemResult.valid) {
97
+ return [];
98
+ }
99
+ const pathItemObject = pathItemResult.pathItem;
100
+ return Object.entries(cleaned.methodObject)
101
+ .map(([method, operation]) => {
102
+ // Use `nameStack` (the trail with the webhook name already
103
+ // pushed) so downstream traces record webhooks:<name>:<method>:…
104
+ // — the trail `OasDocument.removeItem` matches a webhook on.
105
+ return nameStack.trace(method, st => {
106
+ if (!operation) {
107
+ return;
108
+ }
109
+ try {
110
+ return toWebhookV3({
111
+ operation,
112
+ webhookInfo: {
113
+ method: method,
114
+ name,
115
+ pathItem: pathItemObject
116
+ },
117
+ stackTrail: st,
118
+ context
119
+ });
120
+ }
121
+ catch (error) {
122
+ const normalized = error instanceof Error ? error : new Error(String(error));
123
+ context.logIssue({
124
+ key: method,
125
+ parent: operation,
126
+ level: 'error',
127
+ message: normalized.message,
128
+ cause: normalized,
129
+ stackTrail: st,
130
+ type: 'INVALID_OPERATION'
131
+ });
132
+ return undefined;
133
+ }
134
+ });
135
+ })
136
+ .filter((item) => Boolean(item));
137
+ });
138
+ });
139
+ };
@@ -5,9 +5,11 @@ import * as v from 'valibot';
5
5
  *
6
6
  * This constant array includes all HTTP methods that can be used
7
7
  * in OpenAPI path operations, as defined by the OpenAPI specification.
8
- * All methods are in lowercase to match OpenAPI conventions.
8
+ * All methods are in lowercase to match OpenAPI conventions. `query` is
9
+ * an OpenAPI 3.2 method; each parser tree reads its own list from
10
+ * `parse/v3-X/methods.ts`.
9
11
  */
10
- export declare const methodValues: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace"];
12
+ export declare const methodValues: readonly ["get", "put", "post", "delete", "options", "head", "patch", "trace", "query"];
11
13
  /**
12
14
  * Array of HTTP methods excluding TRACE.
13
15
  *
@@ -23,8 +25,9 @@ export declare const method: v.UnionSchema<[
23
25
  v.LiteralSchema<'delete', undefined>,
24
26
  v.LiteralSchema<'head', undefined>,
25
27
  v.LiteralSchema<'options', undefined>,
26
- v.LiteralSchema<'trace', undefined>
28
+ v.LiteralSchema<'trace', undefined>,
29
+ v.LiteralSchema<'query', undefined>
27
30
  ], undefined>;
28
- export type Method = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';
31
+ export type Method = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace' | 'query';
29
32
  export declare const methods: v.ArraySchema<typeof method, undefined>;
30
33
  export declare const isMethod: (arg: unknown) => arg is Method;
@@ -5,7 +5,9 @@ import * as v from 'valibot';
5
5
  *
6
6
  * This constant array includes all HTTP methods that can be used
7
7
  * in OpenAPI path operations, as defined by the OpenAPI specification.
8
- * All methods are in lowercase to match OpenAPI conventions.
8
+ * All methods are in lowercase to match OpenAPI conventions. `query` is
9
+ * an OpenAPI 3.2 method; each parser tree reads its own list from
10
+ * `parse/v3-X/methods.ts`.
9
11
  */
10
12
  export const methodValues = [
11
13
  'get',
@@ -15,7 +17,8 @@ export const methodValues = [
15
17
  'options',
16
18
  'head',
17
19
  'patch',
18
- 'trace'
20
+ 'trace',
21
+ 'query'
19
22
  ];
20
23
  /**
21
24
  * Array of HTTP methods excluding TRACE.
@@ -23,7 +26,16 @@ export const methodValues = [
23
26
  * This is a filtered version of {@link methodValues} that excludes the TRACE method,
24
27
  * which is sometimes excluded from API operations for security reasons.
25
28
  */
26
- export const methodValuesNoTrace = ['get', 'put', 'post', 'delete', 'options', 'head', 'patch'];
29
+ export const methodValuesNoTrace = [
30
+ 'get',
31
+ 'put',
32
+ 'post',
33
+ 'delete',
34
+ 'options',
35
+ 'head',
36
+ 'patch',
37
+ 'query'
38
+ ];
27
39
  export const method = v.union([
28
40
  v.literal('get'),
29
41
  v.literal('post'),
@@ -32,7 +44,8 @@ export const method = v.union([
32
44
  v.literal('delete'),
33
45
  v.literal('head'),
34
46
  v.literal('options'),
35
- v.literal('trace')
47
+ v.literal('trace'),
48
+ v.literal('query')
36
49
  ]);
37
50
  export const methods = v.array(method);
38
51
  export const isMethod = (arg) => {
@@ -139,7 +139,8 @@ export declare const oasOperationSource: v.ObjectSchema<{
139
139
  v.LiteralSchema<'delete', undefined>,
140
140
  v.LiteralSchema<'head', undefined>,
141
141
  v.LiteralSchema<'options', undefined>,
142
- v.LiteralSchema<'trace', undefined>
142
+ v.LiteralSchema<'trace', undefined>,
143
+ v.LiteralSchema<'query', undefined>
143
144
  ], undefined>;
144
145
  readonly variant: v.StringSchema<undefined>;
145
146
  }, undefined>;
@@ -52,13 +52,8 @@ import "../_dnt.polyfills.js";
52
52
  import { generatorEnrichments } from './Enrichments.js';
53
53
  import * as v from 'valibot';
54
54
  import { method } from './Method.js';
55
+ import { hasParentSegment, isAbsolutePath, isValidWorkspacePath } from '../helpers/normalizeWorkspacePath.js';
55
56
  import { toWorkspacePath } from '../helpers/toWorkspacePath.js';
56
- /**
57
- * Whether a relative path contains a `..` parent-reference segment.
58
- * `..` is a parent reference only as a whole path segment — a
59
- * directory name that merely contains dots is not flagged.
60
- */
61
- const hasParentSegment = (path) => path.split(/[/\\]/).some(segment => segment === '..');
62
57
  /**
63
58
  * Valibot schema for {@link ModulePackage}.
64
59
  *
@@ -175,7 +170,9 @@ export const anchorsSettings = v.object({
175
170
  out: v.optional(v.string())
176
171
  });
177
172
  export const clientSettings = v.object({
178
- basePath: v.optional(v.string()),
173
+ basePath: v.optional(v.pipe(v.string(), v.check(basePath => !isAbsolutePath(basePath), 'basePath must be relative to the SKMTC root (the directory containing .skmtc/); ' +
174
+ 'absolute paths are not supported because generated output is always written under it'), v.check(basePath => !hasParentSegment(basePath), 'basePath must be a forward path with no ".." segments — it is the on-disk anchor ' +
175
+ 'every generated file sits below'))),
179
176
  schemaSource: v.optional(v.string()),
180
177
  packages: v.optional(modulePackages),
181
178
  enrichments: v.optional(generatorEnrichments),
@@ -185,7 +182,8 @@ export const clientSettings = v.object({
185
182
  inputDirs: v.optional(v.array(v.string())),
186
183
  formatter: v.optional(v.string()),
187
184
  generatedSuffix: v.optional(v.string()),
188
- ejected: v.optional(v.array(v.string()))
185
+ ejected: v.optional(v.array(v.pipe(v.string(), v.check(isValidWorkspacePath, 'settings.ejected entries are export paths: a forward path below basePath, ' +
186
+ 'with no ".." segment and not a Windows drive or UNC path'))))
189
187
  });
190
188
  /**
191
189
  * Valibot schema for validating SKMTC client configuration.
@@ -59,12 +59,12 @@ export declare const toGqlParsedDocument: (value: GqlDocument) => SkmtcParsedDoc
59
59
  * pipeline runs the protocol-appropriate parser before handing the
60
60
  * post-parse {@link SkmtcParsedDocument} to the generate phase.
61
61
  *
62
- * - `oas.value` is an `OpenAPIV3.Document`. Schema versions other than
63
- * 3.0 (Swagger 2, OpenAPI 3.1) are normalized to 3.0 by
64
- * `@skmtc/convert` before reaching `toArtifacts`. 3.1 `webhooks` ride
65
- * *on* that document as a retained member (the 3.0 base type omits
66
- * `webhooks`, so it is widened here) — the parser flattens them into
67
- * {@link OasDocument.webhooks}.
62
+ * - `oas.value` is an `OpenAPIV3.Document` carrying an OpenAPI 3.0, 3.1 or
63
+ * 3.2 document; each is parsed natively by its own parser tree. Swagger 2
64
+ * is converted to 3.0 by `@skmtc/convert` before reaching `toArtifacts`.
65
+ * 3.1 and 3.2 `webhooks` ride *on* that document as a retained member
66
+ * (the 3.0 base type omits `webhooks`, so it is widened here) — the
67
+ * parser flattens them into {@link OasDocument.webhooks}.
68
68
  * - `gql.value` is either a raw SDL string or a pre-built
69
69
  * `GraphQLSchema`. Strings are run through `buildSchema` inside the
70
70
  * pipeline; pre-built `GraphQLSchema` instances are used as-is.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skmtc/core",
3
- "version": "0.28.7",
3
+ "version": "0.30.1",
4
4
  "description": "Skmtc is a declarative code generation framework",
5
5
  "keywords": [
6
6
  "openapi",
@@ -4,6 +4,17 @@ declare global {
4
4
  }
5
5
  }
6
6
  export {};
7
+ declare global {
8
+ interface Object {
9
+ /**
10
+ * Determines whether an object has a property with the specified name.
11
+ * @param o An object.
12
+ * @param v A property name.
13
+ */
14
+ hasOwn(o: object, v: PropertyKey): boolean;
15
+ }
16
+ }
17
+ export {};
7
18
  /**
8
19
  * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
9
20
  * but instead of using npm to install additional dependencies,
@@ -1,6 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.import_meta_ponyfill = exports.import_meta_ponyfill_esmodule = exports.import_meta_ponyfill_commonjs = void 0;
4
+ // https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
5
+ if (!Object.hasOwn) {
6
+ Object.defineProperty(Object, "hasOwn", {
7
+ value: function (object, property) {
8
+ if (object == null) {
9
+ throw new TypeError("Cannot convert undefined or null to object");
10
+ }
11
+ return Object.prototype.hasOwnProperty.call(Object(object), property);
12
+ },
13
+ configurable: true,
14
+ enumerable: false,
15
+ writable: true,
16
+ });
17
+ }
4
18
  /**
5
19
  * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
6
20
  * but instead of using npm to install additional dependencies,