@skmtc/core 0.38.0 → 0.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (343) hide show
  1. package/esm/context/CoreContext.js +22 -8
  2. package/esm/context/GenerateContext.d.ts +5 -4
  3. package/esm/context/GenerateContext.js +110 -37
  4. package/esm/context/ParseContext.d.ts +9 -1
  5. package/esm/context/ParseContext.js +12 -1
  6. package/esm/context/generateTypes.d.ts +19 -4
  7. package/esm/context/generateTypes.js +2 -0
  8. package/esm/context/toGenerationFailure.d.ts +21 -0
  9. package/esm/context/toGenerationFailure.js +38 -0
  10. package/esm/dsl/CustomValue.d.ts +4 -0
  11. package/esm/dsl/CustomValue.js +8 -0
  12. package/esm/dsl/Definition.d.ts +10 -0
  13. package/esm/dsl/Definition.js +14 -0
  14. package/esm/dsl/PendingDefinition.d.ts +47 -0
  15. package/esm/dsl/PendingDefinition.js +83 -0
  16. package/esm/dsl/model/ModelDriver.d.ts +55 -1
  17. package/esm/dsl/model/ModelDriver.js +228 -51
  18. package/esm/dsl/model/toModelEntry.d.ts +1 -1
  19. package/esm/dsl/model/toModelEntry.js +1 -1
  20. package/esm/dsl/model/types.d.ts +1 -1
  21. package/esm/dsl/operation/gql/GqlOperationDriver.js +1 -4
  22. package/esm/dsl/webhook/WebhookDriver.js +1 -4
  23. package/esm/enrichments/parseEnrichmentUmbrella.d.ts +5 -6
  24. package/esm/enrichments/parseEnrichmentUmbrella.js +23 -8
  25. package/esm/enrichments/parseEnrichmentValue.d.ts +17 -0
  26. package/esm/enrichments/parseEnrichmentValue.js +32 -0
  27. package/esm/enrichments/readEnrichments.d.ts +5 -5
  28. package/esm/enrichments/readEnrichments.js +17 -7
  29. package/esm/mod.d.ts +1 -0
  30. package/esm/mod.js +1 -0
  31. package/esm/oas/array/Array.d.ts +19 -0
  32. package/esm/oas/array/Array.js +47 -0
  33. package/esm/oas/boolean/Boolean.d.ts +19 -0
  34. package/esm/oas/boolean/Boolean.js +51 -8
  35. package/esm/oas/example/Example.d.ts +4 -0
  36. package/esm/oas/example/Example.js +8 -0
  37. package/esm/oas/header/Header.d.ts +4 -0
  38. package/esm/oas/header/Header.js +8 -0
  39. package/esm/oas/integer/Integer.d.ts +19 -0
  40. package/esm/oas/integer/Integer.js +49 -0
  41. package/esm/oas/link/Link.d.ts +4 -0
  42. package/esm/oas/link/Link.js +8 -0
  43. package/esm/oas/number/Number.d.ts +19 -0
  44. package/esm/oas/number/Number.js +49 -0
  45. package/esm/oas/object/Object.d.ts +19 -0
  46. package/esm/oas/object/Object.js +68 -18
  47. package/esm/oas/operation/Operation.d.ts +5 -1
  48. package/esm/oas/operation/Operation.js +17 -5
  49. package/esm/oas/operation/toEffectiveParameters.d.ts +16 -0
  50. package/esm/oas/operation/toEffectiveParameters.js +13 -0
  51. package/esm/oas/parameter/Parameter.d.ts +4 -0
  52. package/esm/oas/parameter/Parameter.js +8 -0
  53. package/esm/oas/ref/Ref.d.ts +147 -25
  54. package/esm/oas/ref/Ref.js +387 -25
  55. package/esm/oas/requestBody/RequestBody.d.ts +4 -0
  56. package/esm/oas/requestBody/RequestBody.js +8 -0
  57. package/esm/oas/response/Response.d.ts +4 -0
  58. package/esm/oas/response/Response.js +8 -0
  59. package/esm/oas/schema/siblings.d.ts +127 -0
  60. package/esm/oas/schema/siblings.js +240 -0
  61. package/esm/oas/securitySchemes/SecurityScheme.d.ts +16 -0
  62. package/esm/oas/securitySchemes/SecurityScheme.js +32 -0
  63. package/esm/oas/string/String.d.ts +19 -0
  64. package/esm/oas/string/String.js +47 -0
  65. package/esm/oas/union/Union.d.ts +31 -0
  66. package/esm/oas/union/Union.js +100 -0
  67. package/esm/oas/unknown/Unknown.d.ts +18 -0
  68. package/esm/oas/unknown/Unknown.js +38 -0
  69. package/esm/oas/void/Void.d.ts +4 -0
  70. package/esm/oas/void/Void.js +8 -0
  71. package/esm/oas/webhook/Webhook.d.ts +2 -2
  72. package/esm/oas/webhook/Webhook.js +6 -5
  73. package/esm/parse/allOfSystem.d.ts +32 -0
  74. package/esm/parse/allOfSystem.js +30 -0
  75. package/esm/parse/anyOfSystem.d.ts +68 -0
  76. package/esm/parse/anyOfSystem.js +107 -0
  77. package/esm/parse/toSiblingKeywords.d.ts +28 -0
  78. package/esm/parse/toSiblingKeywords.js +109 -0
  79. package/esm/parse/v3-0/_merge-all-of/decompose-union.d.ts +8 -0
  80. package/esm/parse/v3-0/_merge-all-of/decompose-union.js +9 -1
  81. package/esm/parse/v3-0/_merge-all-of/generic-merge.d.ts +2 -3
  82. package/esm/parse/v3-0/_merge-all-of/generic-merge.js +2 -2
  83. package/esm/parse/v3-0/_merge-all-of/merge-array-constraints.d.ts +2 -2
  84. package/esm/parse/v3-0/_merge-all-of/merge-array-constraints.js +5 -5
  85. package/esm/parse/v3-0/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  86. package/esm/parse/v3-0/_merge-all-of/merge-boolean-constraints.js +2 -2
  87. package/esm/parse/v3-0/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  88. package/esm/parse/v3-0/_merge-all-of/merge-integer-constraints.js +2 -2
  89. package/esm/parse/v3-0/_merge-all-of/merge-intersection.d.ts +3 -2
  90. package/esm/parse/v3-0/_merge-all-of/merge-intersection.js +2 -2
  91. package/esm/parse/v3-0/_merge-all-of/merge-number-constraints.d.ts +2 -2
  92. package/esm/parse/v3-0/_merge-all-of/merge-number-constraints.js +2 -2
  93. package/esm/parse/v3-0/_merge-all-of/merge-object-constraints.d.ts +2 -2
  94. package/esm/parse/v3-0/_merge-all-of/merge-object-constraints.js +3 -3
  95. package/esm/parse/v3-0/_merge-all-of/merge-properties.d.ts +2 -2
  96. package/esm/parse/v3-0/_merge-all-of/merge-properties.js +2 -2
  97. package/esm/parse/v3-0/_merge-all-of/merge-string-constraints.d.ts +2 -2
  98. package/esm/parse/v3-0/_merge-all-of/merge-string-constraints.js +3 -3
  99. package/esm/parse/v3-0/_merge-all-of/merge-union.d.ts +10 -3
  100. package/esm/parse/v3-0/_merge-all-of/merge-union.js +50 -12
  101. package/esm/parse/v3-0/_merge-all-of/merge.d.ts +2 -2
  102. package/esm/parse/v3-0/_merge-all-of/merge.js +78 -27
  103. package/esm/parse/v3-0/_merge-all-of/nullable-merge.d.ts +4 -0
  104. package/esm/parse/v3-0/_merge-all-of/nullable-merge.js +9 -7
  105. package/esm/parse/v3-0/_merge-all-of/types.d.ts +33 -0
  106. package/esm/parse/v3-0/ref/toRefV31.d.ts +7 -1
  107. package/esm/parse/v3-0/ref/toRefV31.js +2 -2
  108. package/esm/parse/v3-0/schema/toSchemasV3.js +107 -15
  109. package/esm/parse/v3-1/_merge-all-of/decompose-union.d.ts +7 -1
  110. package/esm/parse/v3-1/_merge-all-of/decompose-union.js +8 -2
  111. package/esm/parse/v3-1/_merge-all-of/generic-merge.d.ts +2 -3
  112. package/esm/parse/v3-1/_merge-all-of/generic-merge.js +2 -2
  113. package/esm/parse/v3-1/_merge-all-of/merge-array-constraints.d.ts +3 -2
  114. package/esm/parse/v3-1/_merge-all-of/merge-array-constraints.js +5 -5
  115. package/esm/parse/v3-1/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  116. package/esm/parse/v3-1/_merge-all-of/merge-boolean-constraints.js +2 -2
  117. package/esm/parse/v3-1/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  118. package/esm/parse/v3-1/_merge-all-of/merge-integer-constraints.js +2 -2
  119. package/esm/parse/v3-1/_merge-all-of/merge-intersection.d.ts +3 -2
  120. package/esm/parse/v3-1/_merge-all-of/merge-intersection.js +2 -2
  121. package/esm/parse/v3-1/_merge-all-of/merge-number-constraints.d.ts +2 -2
  122. package/esm/parse/v3-1/_merge-all-of/merge-number-constraints.js +2 -2
  123. package/esm/parse/v3-1/_merge-all-of/merge-object-constraints.d.ts +2 -2
  124. package/esm/parse/v3-1/_merge-all-of/merge-object-constraints.js +3 -3
  125. package/esm/parse/v3-1/_merge-all-of/merge-properties.d.ts +2 -2
  126. package/esm/parse/v3-1/_merge-all-of/merge-properties.js +2 -2
  127. package/esm/parse/v3-1/_merge-all-of/merge-string-constraints.d.ts +2 -2
  128. package/esm/parse/v3-1/_merge-all-of/merge-string-constraints.js +3 -3
  129. package/esm/parse/v3-1/_merge-all-of/merge-union.d.ts +10 -3
  130. package/esm/parse/v3-1/_merge-all-of/merge-union.js +54 -15
  131. package/esm/parse/v3-1/_merge-all-of/merge.d.ts +3 -2
  132. package/esm/parse/v3-1/_merge-all-of/merge.js +88 -29
  133. package/esm/parse/v3-1/_merge-all-of/nullable-merge.d.ts +4 -0
  134. package/esm/parse/v3-1/_merge-all-of/nullable-merge.js +9 -7
  135. package/esm/parse/v3-1/_merge-all-of/types.d.ts +37 -0
  136. package/esm/parse/v3-1/ref/toRefV31.d.ts +7 -1
  137. package/esm/parse/v3-1/ref/toRefV31.js +2 -2
  138. package/esm/parse/v3-1/schema/toSchemasV3.js +111 -16
  139. package/esm/parse/v3-2/_merge-all-of/decompose-union.d.ts +7 -1
  140. package/esm/parse/v3-2/_merge-all-of/decompose-union.js +8 -2
  141. package/esm/parse/v3-2/_merge-all-of/generic-merge.d.ts +2 -3
  142. package/esm/parse/v3-2/_merge-all-of/generic-merge.js +2 -2
  143. package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +3 -2
  144. package/esm/parse/v3-2/_merge-all-of/merge-array-constraints.js +5 -5
  145. package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  146. package/esm/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +2 -2
  147. package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  148. package/esm/parse/v3-2/_merge-all-of/merge-integer-constraints.js +2 -2
  149. package/esm/parse/v3-2/_merge-all-of/merge-intersection.d.ts +3 -2
  150. package/esm/parse/v3-2/_merge-all-of/merge-intersection.js +2 -2
  151. package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +2 -2
  152. package/esm/parse/v3-2/_merge-all-of/merge-number-constraints.js +2 -2
  153. package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +2 -2
  154. package/esm/parse/v3-2/_merge-all-of/merge-object-constraints.js +3 -3
  155. package/esm/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -2
  156. package/esm/parse/v3-2/_merge-all-of/merge-properties.js +2 -2
  157. package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +2 -2
  158. package/esm/parse/v3-2/_merge-all-of/merge-string-constraints.js +3 -3
  159. package/esm/parse/v3-2/_merge-all-of/merge-union.d.ts +10 -3
  160. package/esm/parse/v3-2/_merge-all-of/merge-union.js +54 -15
  161. package/esm/parse/v3-2/_merge-all-of/merge.d.ts +3 -2
  162. package/esm/parse/v3-2/_merge-all-of/merge.js +88 -29
  163. package/esm/parse/v3-2/_merge-all-of/nullable-merge.d.ts +4 -0
  164. package/esm/parse/v3-2/_merge-all-of/nullable-merge.js +9 -7
  165. package/esm/parse/v3-2/_merge-all-of/types.d.ts +37 -0
  166. package/esm/parse/v3-2/ref/toRefV31.d.ts +7 -1
  167. package/esm/parse/v3-2/ref/toRefV31.js +2 -2
  168. package/esm/parse/v3-2/schema/toSchemasV3.js +111 -16
  169. package/esm/types/OasBase.d.ts +1 -1
  170. package/esm/types/Settings.d.ts +34 -0
  171. package/esm/types/Settings.js +8 -0
  172. package/package.json +1 -1
  173. package/script/context/CoreContext.js +22 -8
  174. package/script/context/GenerateContext.d.ts +5 -4
  175. package/script/context/GenerateContext.js +110 -37
  176. package/script/context/ParseContext.d.ts +9 -1
  177. package/script/context/ParseContext.js +12 -1
  178. package/script/context/generateTypes.d.ts +19 -4
  179. package/script/context/generateTypes.js +2 -0
  180. package/script/context/toGenerationFailure.d.ts +21 -0
  181. package/script/context/toGenerationFailure.js +43 -0
  182. package/script/dsl/CustomValue.d.ts +4 -0
  183. package/script/dsl/CustomValue.js +8 -0
  184. package/script/dsl/Definition.d.ts +10 -0
  185. package/script/dsl/Definition.js +14 -0
  186. package/script/dsl/PendingDefinition.d.ts +47 -0
  187. package/script/dsl/PendingDefinition.js +87 -0
  188. package/script/dsl/model/ModelDriver.d.ts +55 -1
  189. package/script/dsl/model/ModelDriver.js +231 -52
  190. package/script/dsl/model/toModelEntry.d.ts +1 -1
  191. package/script/dsl/model/toModelEntry.js +1 -1
  192. package/script/dsl/model/types.d.ts +1 -1
  193. package/script/dsl/operation/gql/GqlOperationDriver.js +1 -4
  194. package/script/dsl/webhook/WebhookDriver.js +1 -4
  195. package/script/enrichments/parseEnrichmentUmbrella.d.ts +5 -6
  196. package/script/enrichments/parseEnrichmentUmbrella.js +23 -41
  197. package/script/enrichments/parseEnrichmentValue.d.ts +17 -0
  198. package/script/enrichments/parseEnrichmentValue.js +69 -0
  199. package/script/enrichments/readEnrichments.d.ts +5 -5
  200. package/script/enrichments/readEnrichments.js +17 -40
  201. package/script/mod.d.ts +1 -0
  202. package/script/mod.js +1 -0
  203. package/script/oas/array/Array.d.ts +19 -0
  204. package/script/oas/array/Array.js +47 -0
  205. package/script/oas/boolean/Boolean.d.ts +19 -0
  206. package/script/oas/boolean/Boolean.js +51 -8
  207. package/script/oas/example/Example.d.ts +4 -0
  208. package/script/oas/example/Example.js +8 -0
  209. package/script/oas/header/Header.d.ts +4 -0
  210. package/script/oas/header/Header.js +8 -0
  211. package/script/oas/integer/Integer.d.ts +19 -0
  212. package/script/oas/integer/Integer.js +49 -0
  213. package/script/oas/link/Link.d.ts +4 -0
  214. package/script/oas/link/Link.js +8 -0
  215. package/script/oas/number/Number.d.ts +19 -0
  216. package/script/oas/number/Number.js +49 -0
  217. package/script/oas/object/Object.d.ts +19 -0
  218. package/script/oas/object/Object.js +68 -18
  219. package/script/oas/operation/Operation.d.ts +5 -1
  220. package/script/oas/operation/Operation.js +17 -5
  221. package/script/oas/operation/toEffectiveParameters.d.ts +16 -0
  222. package/script/oas/operation/toEffectiveParameters.js +17 -0
  223. package/script/oas/parameter/Parameter.d.ts +4 -0
  224. package/script/oas/parameter/Parameter.js +8 -0
  225. package/script/oas/ref/Ref.d.ts +147 -25
  226. package/script/oas/ref/Ref.js +387 -25
  227. package/script/oas/requestBody/RequestBody.d.ts +4 -0
  228. package/script/oas/requestBody/RequestBody.js +8 -0
  229. package/script/oas/response/Response.d.ts +4 -0
  230. package/script/oas/response/Response.js +8 -0
  231. package/script/oas/schema/siblings.d.ts +127 -0
  232. package/script/oas/schema/siblings.js +295 -0
  233. package/script/oas/securitySchemes/SecurityScheme.d.ts +16 -0
  234. package/script/oas/securitySchemes/SecurityScheme.js +32 -0
  235. package/script/oas/string/String.d.ts +19 -0
  236. package/script/oas/string/String.js +47 -0
  237. package/script/oas/union/Union.d.ts +31 -0
  238. package/script/oas/union/Union.js +100 -0
  239. package/script/oas/unknown/Unknown.d.ts +18 -0
  240. package/script/oas/unknown/Unknown.js +38 -0
  241. package/script/oas/void/Void.d.ts +4 -0
  242. package/script/oas/void/Void.js +8 -0
  243. package/script/oas/webhook/Webhook.d.ts +2 -2
  244. package/script/oas/webhook/Webhook.js +6 -5
  245. package/script/parse/allOfSystem.d.ts +32 -0
  246. package/script/parse/allOfSystem.js +35 -0
  247. package/script/parse/anyOfSystem.d.ts +68 -0
  248. package/script/parse/anyOfSystem.js +116 -0
  249. package/script/parse/toSiblingKeywords.d.ts +28 -0
  250. package/script/parse/toSiblingKeywords.js +146 -0
  251. package/script/parse/v3-0/_merge-all-of/decompose-union.d.ts +8 -0
  252. package/script/parse/v3-0/_merge-all-of/decompose-union.js +11 -2
  253. package/script/parse/v3-0/_merge-all-of/generic-merge.d.ts +2 -3
  254. package/script/parse/v3-0/_merge-all-of/generic-merge.js +2 -2
  255. package/script/parse/v3-0/_merge-all-of/merge-array-constraints.d.ts +2 -2
  256. package/script/parse/v3-0/_merge-all-of/merge-array-constraints.js +5 -5
  257. package/script/parse/v3-0/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  258. package/script/parse/v3-0/_merge-all-of/merge-boolean-constraints.js +2 -2
  259. package/script/parse/v3-0/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  260. package/script/parse/v3-0/_merge-all-of/merge-integer-constraints.js +2 -2
  261. package/script/parse/v3-0/_merge-all-of/merge-intersection.d.ts +3 -2
  262. package/script/parse/v3-0/_merge-all-of/merge-intersection.js +2 -2
  263. package/script/parse/v3-0/_merge-all-of/merge-number-constraints.d.ts +2 -2
  264. package/script/parse/v3-0/_merge-all-of/merge-number-constraints.js +2 -2
  265. package/script/parse/v3-0/_merge-all-of/merge-object-constraints.d.ts +2 -2
  266. package/script/parse/v3-0/_merge-all-of/merge-object-constraints.js +3 -3
  267. package/script/parse/v3-0/_merge-all-of/merge-properties.d.ts +2 -2
  268. package/script/parse/v3-0/_merge-all-of/merge-properties.js +2 -2
  269. package/script/parse/v3-0/_merge-all-of/merge-string-constraints.d.ts +2 -2
  270. package/script/parse/v3-0/_merge-all-of/merge-string-constraints.js +3 -3
  271. package/script/parse/v3-0/_merge-all-of/merge-union.d.ts +10 -3
  272. package/script/parse/v3-0/_merge-all-of/merge-union.js +52 -13
  273. package/script/parse/v3-0/_merge-all-of/merge.d.ts +2 -2
  274. package/script/parse/v3-0/_merge-all-of/merge.js +77 -26
  275. package/script/parse/v3-0/_merge-all-of/nullable-merge.d.ts +4 -0
  276. package/script/parse/v3-0/_merge-all-of/nullable-merge.js +9 -7
  277. package/script/parse/v3-0/_merge-all-of/types.d.ts +33 -0
  278. package/script/parse/v3-0/ref/toRefV31.d.ts +7 -1
  279. package/script/parse/v3-0/ref/toRefV31.js +2 -2
  280. package/script/parse/v3-0/schema/toSchemasV3.js +107 -15
  281. package/script/parse/v3-1/_merge-all-of/decompose-union.d.ts +7 -1
  282. package/script/parse/v3-1/_merge-all-of/decompose-union.js +8 -2
  283. package/script/parse/v3-1/_merge-all-of/generic-merge.d.ts +2 -3
  284. package/script/parse/v3-1/_merge-all-of/generic-merge.js +2 -2
  285. package/script/parse/v3-1/_merge-all-of/merge-array-constraints.d.ts +3 -2
  286. package/script/parse/v3-1/_merge-all-of/merge-array-constraints.js +5 -5
  287. package/script/parse/v3-1/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  288. package/script/parse/v3-1/_merge-all-of/merge-boolean-constraints.js +2 -2
  289. package/script/parse/v3-1/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  290. package/script/parse/v3-1/_merge-all-of/merge-integer-constraints.js +2 -2
  291. package/script/parse/v3-1/_merge-all-of/merge-intersection.d.ts +3 -2
  292. package/script/parse/v3-1/_merge-all-of/merge-intersection.js +2 -2
  293. package/script/parse/v3-1/_merge-all-of/merge-number-constraints.d.ts +2 -2
  294. package/script/parse/v3-1/_merge-all-of/merge-number-constraints.js +2 -2
  295. package/script/parse/v3-1/_merge-all-of/merge-object-constraints.d.ts +2 -2
  296. package/script/parse/v3-1/_merge-all-of/merge-object-constraints.js +3 -3
  297. package/script/parse/v3-1/_merge-all-of/merge-properties.d.ts +2 -2
  298. package/script/parse/v3-1/_merge-all-of/merge-properties.js +2 -2
  299. package/script/parse/v3-1/_merge-all-of/merge-string-constraints.d.ts +2 -2
  300. package/script/parse/v3-1/_merge-all-of/merge-string-constraints.js +3 -3
  301. package/script/parse/v3-1/_merge-all-of/merge-union.d.ts +10 -3
  302. package/script/parse/v3-1/_merge-all-of/merge-union.js +56 -16
  303. package/script/parse/v3-1/_merge-all-of/merge.d.ts +3 -2
  304. package/script/parse/v3-1/_merge-all-of/merge.js +87 -28
  305. package/script/parse/v3-1/_merge-all-of/nullable-merge.d.ts +4 -0
  306. package/script/parse/v3-1/_merge-all-of/nullable-merge.js +9 -7
  307. package/script/parse/v3-1/_merge-all-of/types.d.ts +37 -0
  308. package/script/parse/v3-1/ref/toRefV31.d.ts +7 -1
  309. package/script/parse/v3-1/ref/toRefV31.js +2 -2
  310. package/script/parse/v3-1/schema/toSchemasV3.js +111 -16
  311. package/script/parse/v3-2/_merge-all-of/decompose-union.d.ts +7 -1
  312. package/script/parse/v3-2/_merge-all-of/decompose-union.js +8 -2
  313. package/script/parse/v3-2/_merge-all-of/generic-merge.d.ts +2 -3
  314. package/script/parse/v3-2/_merge-all-of/generic-merge.js +2 -2
  315. package/script/parse/v3-2/_merge-all-of/merge-array-constraints.d.ts +3 -2
  316. package/script/parse/v3-2/_merge-all-of/merge-array-constraints.js +5 -5
  317. package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.d.ts +2 -2
  318. package/script/parse/v3-2/_merge-all-of/merge-boolean-constraints.js +2 -2
  319. package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.d.ts +2 -2
  320. package/script/parse/v3-2/_merge-all-of/merge-integer-constraints.js +2 -2
  321. package/script/parse/v3-2/_merge-all-of/merge-intersection.d.ts +3 -2
  322. package/script/parse/v3-2/_merge-all-of/merge-intersection.js +2 -2
  323. package/script/parse/v3-2/_merge-all-of/merge-number-constraints.d.ts +2 -2
  324. package/script/parse/v3-2/_merge-all-of/merge-number-constraints.js +2 -2
  325. package/script/parse/v3-2/_merge-all-of/merge-object-constraints.d.ts +2 -2
  326. package/script/parse/v3-2/_merge-all-of/merge-object-constraints.js +3 -3
  327. package/script/parse/v3-2/_merge-all-of/merge-properties.d.ts +2 -2
  328. package/script/parse/v3-2/_merge-all-of/merge-properties.js +2 -2
  329. package/script/parse/v3-2/_merge-all-of/merge-string-constraints.d.ts +2 -2
  330. package/script/parse/v3-2/_merge-all-of/merge-string-constraints.js +3 -3
  331. package/script/parse/v3-2/_merge-all-of/merge-union.d.ts +10 -3
  332. package/script/parse/v3-2/_merge-all-of/merge-union.js +56 -16
  333. package/script/parse/v3-2/_merge-all-of/merge.d.ts +3 -2
  334. package/script/parse/v3-2/_merge-all-of/merge.js +87 -28
  335. package/script/parse/v3-2/_merge-all-of/nullable-merge.d.ts +4 -0
  336. package/script/parse/v3-2/_merge-all-of/nullable-merge.js +9 -7
  337. package/script/parse/v3-2/_merge-all-of/types.d.ts +37 -0
  338. package/script/parse/v3-2/ref/toRefV31.d.ts +7 -1
  339. package/script/parse/v3-2/ref/toRefV31.js +2 -2
  340. package/script/parse/v3-2/schema/toSchemasV3.js +111 -16
  341. package/script/types/OasBase.d.ts +1 -1
  342. package/script/types/Settings.d.ts +34 -0
  343. package/script/types/Settings.js +9 -1
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toRefV31 = void 0;
4
4
  const Ref_js_1 = require("../../../oas/ref/Ref.js");
5
5
  const isEmpty_js_1 = require("../../../helpers/isEmpty.js");
6
- const toRefV31 = ({ ref, refType, stackTrail, context, nullable }) => {
6
+ const toRefV31 = ({ ref, refType, stackTrail, context, nullable, readOnly, writeOnly, siblings }) => {
7
7
  const { $ref, ...skipped } = ref;
8
8
  if (!(0, isEmpty_js_1.isEmpty)(skipped)) {
9
9
  context.logSkippedFields({ skipped, parent: ref, parentType: 'ref', stackTrail });
10
10
  }
11
11
  context.registerRef(stackTrail.clone(), $ref);
12
- return context.withStackTrail(stackTrail, () => new Ref_js_1.OasRef({ refType, $ref, nullable }, context));
12
+ return context.withStackTrail(stackTrail, () => new Ref_js_1.OasRef({ ...siblings, refType, $ref, nullable, readOnly, writeOnly }, context));
13
13
  };
14
14
  exports.toRefV31 = toRefV31;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.toOptionalSchemaV3 = exports.toSchemaV3 = exports.toOptionalSchemasV3 = exports.toSchemasV3 = void 0;
4
4
  const toRefV31_js_1 = require("../ref/toRefV31.js");
5
5
  const refFns_js_1 = require("../../../helpers/refFns.js");
6
+ const isEmpty_js_1 = require("../../../helpers/isEmpty.js");
7
+ const Unknown_js_1 = require("../../../oas/unknown/Unknown.js");
6
8
  const toArray_js_1 = require("../array/toArray.js");
7
9
  const toObject_js_1 = require("../object/toObject.js");
8
10
  const toInteger_js_1 = require("../integer/toInteger.js");
@@ -12,8 +14,13 @@ const toString_js_1 = require("../string/toString.js");
12
14
  const toUnknown_js_1 = require("../unknown/toUnknown.js");
13
15
  const toUnion_js_1 = require("../union/toUnion.js");
14
16
  const refFns_js_2 = require("../../../helpers/refFns.js");
17
+ const toSiblingKeywords_js_1 = require("../../toSiblingKeywords.js");
18
+ const allOfSystem_js_1 = require("../../allOfSystem.js");
19
+ const anyOfSystem_js_1 = require("../../anyOfSystem.js");
20
+ const toAdditionalPropertiesV3_js_1 = require("../object/toAdditionalPropertiesV3.js");
15
21
  const merge_intersection_js_1 = require("../_merge-all-of/merge-intersection.js");
16
22
  const merge_union_js_1 = require("../_merge-all-of/merge-union.js");
23
+ const nullable_merge_js_1 = require("../_merge-all-of/nullable-merge.js");
17
24
  const tryParseAt_js_1 = require("../../../context/tryParseAt.js");
18
25
  const normalize_schema_shape_js_1 = require("./normalize-schema-shape.js");
19
26
  const toSchemasV3 = ({ schemas, stackTrail, context }) => {
@@ -62,13 +69,15 @@ const withoutWrapperUnevaluatedProperties = ({ schema, parentType, stackTrail, c
62
69
  return rest;
63
70
  };
64
71
  /**
65
- * Is this a 3.1 null-only schema member (`type: 'null'` or `['null']`)?
72
+ * Is this a null-only schema member: 3.1's `type: 'null'` or `['null']`, or
73
+ * 3.0's `{ nullable: true, enum: [null] }`?
66
74
  */
67
75
  const isNullTypeSchema = (member) => {
68
76
  if ((0, refFns_js_1.isRef)(member)) {
69
77
  return false;
70
78
  }
71
- return (0, normalize_schema_shape_js_1.isNullOnlyType)(member.type);
79
+ // 3.0's way to write null too: `{ nullable: true, enum: [null] }`, as the 3.0 parser reads it.
80
+ return (0, normalize_schema_shape_js_1.isNullOnlyType)(member.type) || (0, nullable_merge_js_1.isNullOnly)(member);
72
81
  };
73
82
  /**
74
83
  * Split `oneOf`/`anyOf` members into the non-null members plus whether a
@@ -114,15 +123,48 @@ const collapseSingleMember = (value, member) => {
114
123
  };
115
124
  const toSchemaV3 = ({ schema, stackTrail, context }) => {
116
125
  if ((0, refFns_js_1.isRef)(schema)) {
117
- return (0, toRefV31_js_1.toRefV31)({ ref: schema, refType: 'schema', stackTrail, context });
126
+ // In 3.2, as in JSON Schema 2020-12, keywords beside `$ref` apply with
127
+ // the target: the same as an `allOf` that starts with the reference.
128
+ const { $ref, ...keywords } = schema;
129
+ const allOf = 'allOf' in keywords ? keywords.allOf : undefined;
130
+ // An `allOf` that is not an array holds no members: reported, and the reference kept.
131
+ if (allOf !== undefined && !Array.isArray(allOf)) {
132
+ context.logSkippedFields({
133
+ skipped: { allOf },
134
+ parent: schema,
135
+ parentType: 'ref',
136
+ stackTrail
137
+ });
138
+ }
139
+ const members = Array.isArray(allOf) ? allOf : [];
140
+ return Object.keys(keywords).length > 0
141
+ ? (0, exports.toSchemaV3)({ schema: { ...keywords, allOf: [{ $ref }, ...members] }, stackTrail, context })
142
+ : (0, toRefV31_js_1.toRefV31)({ ref: schema, refType: 'schema', stackTrail, context });
118
143
  }
119
144
  // OpenAPI `not` has no faithful TypeScript representation: a generated type
120
145
  // that ignored it would *widen* the contract (accepting shapes the schema
121
- // forbids). Refuse the schema rather than emit a type that lies. The throw
122
- // is isolated by `tryParseAt` into an `INVALID_SCHEMA` issue, and consumers
123
- // of this schema are pruned via `removeErroredItems` (INVALID_DEPENDENCY_REF).
146
+ // forbids). Under `client.json` `system.not: strict` (the default) the schema
147
+ // is refused rather than emit a type that lies. The throw is isolated by
148
+ // `tryParseAt` into an `INVALID_SCHEMA` issue, and consumers of this schema
149
+ // are pruned via `removeErroredItems` (INVALID_DEPENDENCY_REF).
150
+ //
151
+ // Under `system.not: unknown` the schema parses with its other keywords, and
152
+ // its `not` is kept as an `OasUnknown` that core does not read: a generator
153
+ // can see that the document says "not something".
124
154
  if ('not' in schema) {
125
- throw new Error('Schema uses unsupported "not" keyword');
155
+ // A test's mock context may have no `system`.
156
+ if (context.system?.not !== 'unknown') {
157
+ throw new Error('Schema uses unsupported "not" keyword');
158
+ }
159
+ const { not: _not, ...keywords } = schema;
160
+ const parsed = (0, exports.toSchemaV3)({ schema: keywords, stackTrail, context });
161
+ // Only a one-member `allOf` of a `$ref` parses to a reference, and a
162
+ // reference has no field for a `not`. Fail rather than lose it.
163
+ if (parsed.isRef()) {
164
+ throw new Error('Schema uses "not" next to a one-member allOf reference, which cannot keep it');
165
+ }
166
+ parsed.not = stackTrail.trace('not', notTrail => context.withStackTrail(notTrail, () => new Unknown_js_1.OasUnknown({}, context)));
167
+ return parsed;
126
168
  }
127
169
  const normalized = (0, normalize_schema_shape_js_1.normalizeSchemaShape)(schema);
128
170
  if (normalized !== schema) {
@@ -148,14 +190,40 @@ const toSchemaV3 = ({ schema, stackTrail, context }) => {
148
190
  const members = allOf ?? [];
149
191
  if (members.length === 1) {
150
192
  const [member] = members;
151
- if ((0, refFns_js_1.isRef)(member) && value.nullable) {
152
- return (0, toRefV31_js_1.toRefV31)({
153
- ref: member,
154
- refType: 'schema',
155
- nullable: true,
156
- stackTrail: st,
157
- context
158
- });
193
+ // Keywords next to the one member say how this site uses the
194
+ // reference, which stays lazy, so a self-reference still ends:
195
+ // `nullable`, `readOnly` and `writeOnly` ride it as use-site flags,
196
+ // and the others are read without the target's type (`siblings`).
197
+ // `resolve()` applies them to a copy of the target at generate time;
198
+ // the ones its type cannot take are left out there. The shared model
199
+ // never changes.
200
+ if ((0, refFns_js_1.isRef)(member)) {
201
+ const { nullable, readOnly, writeOnly, ...keywords } = value;
202
+ const siblings = (0, isEmpty_js_1.isEmpty)(keywords)
203
+ ? undefined
204
+ : (0, toSiblingKeywords_js_1.toSiblingKeywords)({
205
+ keywords,
206
+ properties: stackTrail.trace('properties', propertiesTrail => (0, exports.toOptionalSchemasV3)({ schemas: keywords.properties, stackTrail: propertiesTrail, context })),
207
+ additionalProperties: stackTrail.trace('additionalProperties', additionalTrail => (0, toAdditionalPropertiesV3_js_1.toAdditionalPropertiesV3)({
208
+ additionalProperties: keywords.additionalProperties,
209
+ stackTrail: additionalTrail,
210
+ context
211
+ })),
212
+ stackTrail,
213
+ context
214
+ });
215
+ if (nullable || readOnly || writeOnly || siblings) {
216
+ return (0, toRefV31_js_1.toRefV31)({
217
+ ref: member,
218
+ refType: 'schema',
219
+ nullable: nullable || undefined,
220
+ readOnly: readOnly || undefined,
221
+ writeOnly: writeOnly || undefined,
222
+ siblings,
223
+ stackTrail: st,
224
+ context
225
+ });
226
+ }
159
227
  }
160
228
  return (0, exports.toSchemaV3)({
161
229
  schema: collapseSingleMember(value, member),
@@ -163,11 +231,15 @@ const toSchemaV3 = ({ schema, stackTrail, context }) => {
163
231
  context
164
232
  });
165
233
  }
234
+ const system = (0, allOfSystem_js_1.toAllOfSystem)(context);
166
235
  const merged = (0, merge_intersection_js_1.mergeIntersection)({
167
236
  schema: wrapper,
168
237
  getRef: (0, refFns_js_2.toGetRef)(context.documentObject),
169
- normalize: normalize_schema_shape_js_1.normalizeMergeMember
238
+ normalize: normalize_schema_shape_js_1.normalizeMergeMember,
239
+ system
170
240
  });
241
+ (0, allOfSystem_js_1.logAllOfContradictions)({ system, stackTrail, parent: schema, context });
242
+ (0, anyOfSystem_js_1.logMergedUnknownAnyOf)({ system, stackTrail, parent: schema, context });
171
243
  return (0, exports.toSchemaV3)({ schema: merged, stackTrail: st, context });
172
244
  });
173
245
  }
@@ -191,12 +263,16 @@ const toSchemaV3 = ({ schema, stackTrail, context }) => {
191
263
  const withoutNull = hasNullMember
192
264
  ? { ...wrapper, oneOf: oneOfWithoutNull, nullable: true }
193
265
  : wrapper;
266
+ const system = (0, allOfSystem_js_1.toAllOfSystem)(context);
194
267
  const merged = (0, merge_union_js_1.mergeUnion)({
195
268
  schema: withoutNull,
196
269
  getRef: (0, refFns_js_2.toGetRef)(context.documentObject),
197
270
  normalize: normalize_schema_shape_js_1.normalizeMergeMember,
271
+ system,
198
272
  groupType: 'oneOf'
199
273
  });
274
+ (0, allOfSystem_js_1.logAllOfContradictions)({ system, stackTrail, parent: schema, context });
275
+ (0, anyOfSystem_js_1.logMergedUnknownAnyOf)({ system, stackTrail, parent: schema, context });
200
276
  if (!('oneOf' in merged) || !Array.isArray(merged.oneOf)) {
201
277
  throw new Error('Missing "oneOf" array');
202
278
  }
@@ -240,6 +316,21 @@ const toSchemaV3 = ({ schema, stackTrail, context }) => {
240
316
  stackTrail,
241
317
  context
242
318
  });
319
+ // Under `system.anyOf: unknown`, as Cloudflare's `cf` reads it, an `anyOf`
320
+ // of two or more members is any value: the schema parses with its other
321
+ // keywords, so the properties next to it stay, without the members.
322
+ if ((0, anyOfSystem_js_1.isUnknownAnyOf)({ members: wrapper.anyOf ?? [], setting: context.system?.anyOf, getRef: (0, refFns_js_2.toGetRef)(context.documentObject) })) {
323
+ (0, anyOfSystem_js_1.logUnknownAnyOf)({ stackTrail, parent: schema, context });
324
+ const keywords = (0, anyOfSystem_js_1.withoutUnknownAnyOf)({
325
+ schema: wrapper,
326
+ setting: context.system?.anyOf,
327
+ getRef: (0, refFns_js_2.toGetRef)(context.documentObject)
328
+ });
329
+ // A `default` alone is no type: the parser would guess one from it.
330
+ return (0, anyOfSystem_js_1.hasShapeKeyword)(keywords)
331
+ ? (0, exports.toSchemaV3)({ schema: keywords, stackTrail, context })
332
+ : (0, toUnknown_js_1.toUnknown)({ value: keywords, stackTrail, context });
333
+ }
243
334
  return stackTrail.trace('anyOf', st => {
244
335
  // deno-lint-ignore ban-ts-comment
245
336
  // @ts-expect-error
@@ -253,12 +344,16 @@ const toSchemaV3 = ({ schema, stackTrail, context }) => {
253
344
  const withoutNull = hasNullMember
254
345
  ? { ...wrapper, anyOf: anyOfWithoutNull, nullable: true }
255
346
  : wrapper;
347
+ const system = (0, allOfSystem_js_1.toAllOfSystem)(context);
256
348
  const merged = (0, merge_union_js_1.mergeUnion)({
257
349
  schema: withoutNull,
258
350
  getRef: (0, refFns_js_2.toGetRef)(context.documentObject),
259
351
  normalize: normalize_schema_shape_js_1.normalizeMergeMember,
352
+ system,
260
353
  groupType: 'anyOf'
261
354
  });
355
+ (0, allOfSystem_js_1.logAllOfContradictions)({ system, stackTrail, parent: schema, context });
356
+ (0, anyOfSystem_js_1.logMergedUnknownAnyOf)({ system, stackTrail, parent: schema, context });
262
357
  if (!('anyOf' in merged) || !Array.isArray(merged.anyOf)) {
263
358
  throw new Error('Missing "anyOf" array');
264
359
  }
@@ -35,5 +35,5 @@ export declare class OasBase {
35
35
  * at the empty trail, so `isEmpty()` cleanly means "synthetic".
36
36
  */
37
37
  stackTrail: StackTrail;
38
- constructor(context?: ParseContextType);
38
+ constructor(context?: Pick<ParseContextType, 'currentStackTrail'>);
39
39
  }
@@ -162,6 +162,8 @@ export declare const includeModels: v.GenericSchema<IncludeModels>;
162
162
  * {@link AnchorsSettings} for the consumer-facing fields.
163
163
  */
164
164
  export declare const anchorsSettings: v.GenericSchema<AnchorsSettings>;
165
+ /** Valibot schema for {@link SystemSettings}: `client.json#settings.system`. */
166
+ export declare const systemSettings: v.GenericSchema<SystemSettings>;
165
167
  export declare const clientSettings: v.GenericSchema<ClientSettings>;
166
168
  /**
167
169
  * Configuration for skipping specific HTTP methods + variants on API paths.
@@ -418,6 +420,36 @@ export type AnchorsSettings = {
418
420
  */
419
421
  out?: string;
420
422
  };
423
+ /**
424
+ * How the OpenAPI parser treats what it cannot read faithfully, or reads
425
+ * another way (`client.json#settings.system`). Each setting's default parses
426
+ * as core always did: `strict` fails the schema, and `removeErroredItems`
427
+ * removes each item that uses it.
428
+ */
429
+ export type SystemSettings = {
430
+ /**
431
+ * `latestWins`: where `allOf` members contradict, the later member's
432
+ * keyword wins, with one warning for each schema where it happens.
433
+ */
434
+ allOf?: 'strict' | 'latestWins';
435
+ /**
436
+ * `unknown`: a response whose schema fails gets an `unknown` schema (any
437
+ * body), with an error at the response, and the operation stays.
438
+ */
439
+ responseContradictions?: 'strict' | 'unknown';
440
+ /**
441
+ * `unknown`: a schema with `not` parses with its other keywords, and keeps
442
+ * its `not` as an `OasUnknown`.
443
+ */
444
+ not?: 'strict' | 'unknown';
445
+ /**
446
+ * `union` (the default): an `anyOf` is a union, as a `oneOf` is, and the
447
+ * keywords next to it merge into each member. `unknown`: as Cloudflare's
448
+ * `cf` reads it, an `anyOf` is any value. The schema parses with its other
449
+ * keywords and without the `anyOf`, with one warning for each schema.
450
+ */
451
+ anyOf?: 'union' | 'unknown';
452
+ };
421
453
  export type ClientSettings = {
422
454
  /** Base output path for generated files */
423
455
  basePath?: string;
@@ -441,6 +473,8 @@ export type ClientSettings = {
441
473
  * in v1. See {@link AnchorsSettings}.
442
474
  */
443
475
  anchors?: AnchorsSettings;
476
+ /** How the OpenAPI parser treats what it cannot read faithfully. See {@link SystemSettings}. */
477
+ system?: SystemSettings;
444
478
  /**
445
479
  * Preview input-matcher discovery directories (project-root relative, e.g.
446
480
  * `src/fields`, `src/inputs`). A preview/hub concern: the generation engine
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.skmtcClientConfig = exports.clientSettings = exports.anchorsSettings = exports.includeModels = exports.includeModelRefs = exports.includeOperations = exports.includePaths = exports.skipModels = exports.skipModelRefs = exports.skipOperations = exports.skipPaths = exports.modulePackages = exports.modulePackage = void 0;
36
+ exports.skmtcClientConfig = exports.clientSettings = exports.systemSettings = exports.anchorsSettings = exports.includeModels = exports.includeModelRefs = exports.includeOperations = exports.includePaths = exports.skipModels = exports.skipModelRefs = exports.skipOperations = exports.skipPaths = exports.modulePackages = exports.modulePackage = void 0;
37
37
  /**
38
38
  * @fileoverview SKMTC Core Settings and Configuration
39
39
  *
@@ -205,6 +205,13 @@ exports.anchorsSettings = v.object({
205
205
  enabled: v.boolean(),
206
206
  out: v.optional(v.string())
207
207
  });
208
+ /** Valibot schema for {@link SystemSettings}: `client.json#settings.system`. */
209
+ exports.systemSettings = v.object({
210
+ allOf: v.optional(v.picklist(['strict', 'latestWins'])),
211
+ responseContradictions: v.optional(v.picklist(['strict', 'unknown'])),
212
+ not: v.optional(v.picklist(['strict', 'unknown'])),
213
+ anyOf: v.optional(v.picklist(['union', 'unknown']))
214
+ });
208
215
  exports.clientSettings = v.object({
209
216
  basePath: v.optional(v.pipe(v.string(), v.check(basePath => !(0, normalizeWorkspacePath_js_1.isAbsolutePath)(basePath), 'basePath must be relative to the SKMTC root (the directory containing .skmtc/); ' +
210
217
  'absolute paths are not supported because generated output is always written under it'), v.check(basePath => !(0, normalizeWorkspacePath_js_1.hasParentSegment)(basePath), 'basePath must be a forward path with no ".." segments — it is the on-disk anchor ' +
@@ -215,6 +222,7 @@ exports.clientSettings = v.object({
215
222
  include: v.optional(v.array(include)),
216
223
  skip: v.optional(v.array(skip)),
217
224
  anchors: v.optional(exports.anchorsSettings),
225
+ system: v.optional(exports.systemSettings),
218
226
  inputDirs: v.optional(v.array(v.string())),
219
227
  formatter: v.optional(v.string()),
220
228
  generatedSuffix: v.optional(v.string()),