@skmtc/core 0.39.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
@@ -18,9 +18,9 @@
18
18
  * declares only the fields it reads — keys other generators own are
19
19
  * expected, not typos.
20
20
  *
21
- * A wrong-typed value still throws exactly as before — the `v.parse` at
22
- * the end is unchanged, and unknown-key detection runs first so a
23
- * throwing leaf doesn't hide a dropped key.
21
+ * A wrong-typed value throws ({@link parseEnrichmentValue}), naming each
22
+ * wrong value's place in `client.json`. Unknown-key detection runs first,
23
+ * so a throwing leaf doesn't hide a dropped key.
24
24
  *
25
25
  * @module parseEnrichmentUmbrella
26
26
  */
@@ -54,9 +54,8 @@ type ParseEnrichmentUmbrellaArgs<EnrichmentType> = {
54
54
  * umbrella, recording the reads for the consumption audit and reporting
55
55
  * schema-dropped keys.
56
56
  *
57
- * @throws on a wrong-typed value, exactly like the raw `v.parse` this
58
- * wraps — the generator's item is then recorded as `error` and the run
59
- * continues (fail-open).
57
+ * @throws on a wrong-typed value. The generator's item is recorded as
58
+ * `error`, and the run fails once every generator has run.
60
59
  */
61
60
  export declare const parseEnrichmentUmbrella: <EnrichmentType>({ context, generatorId, subjectSegments, schema }: ParseEnrichmentUmbrellaArgs<EnrichmentType>) => EnrichmentType;
62
61
  export {};
@@ -18,24 +18,23 @@
18
18
  * declares only the fields it reads — keys other generators own are
19
19
  * expected, not typos.
20
20
  *
21
- * A wrong-typed value still throws exactly as before — the `v.parse` at
22
- * the end is unchanged, and unknown-key detection runs first so a
23
- * throwing leaf doesn't hide a dropped key.
21
+ * A wrong-typed value throws ({@link parseEnrichmentValue}), naming each
22
+ * wrong value's place in `client.json`. Unknown-key detection runs first,
23
+ * so a throwing leaf doesn't hide a dropped key.
24
24
  *
25
25
  * @module parseEnrichmentUmbrella
26
26
  */
27
- import * as v from 'valibot';
28
27
  import { GENERATOR_ENRICHMENT_KEY, STACK_ENRICHMENT_KEY } from '../types/Enrichments.js';
29
28
  import { findUnknownKeys } from './findUnknownKeys.js';
30
29
  import { formatEnrichmentPath } from './EnrichmentWarning.js';
30
+ import { parseEnrichmentValue } from './parseEnrichmentValue.js';
31
31
  /**
32
32
  * Assemble and parse one `{ subject, generator, stack }` enrichment
33
33
  * umbrella, recording the reads for the consumption audit and reporting
34
34
  * schema-dropped keys.
35
35
  *
36
- * @throws on a wrong-typed value, exactly like the raw `v.parse` this
37
- * wraps — the generator's item is then recorded as `error` and the run
38
- * continues (fail-open).
36
+ * @throws on a wrong-typed value. The generator's item is recorded as
37
+ * `error`, and the run fails once every generator has run.
39
38
  */
40
39
  export const parseEnrichmentUmbrella = ({ context, generatorId, subjectSegments, schema }) => {
41
40
  const raw = {
@@ -62,5 +61,21 @@ export const parseEnrichmentUmbrella = ({ context, generatorId, subjectSegments,
62
61
  ...(suggestion !== undefined ? { suggestion } : {})
63
62
  });
64
63
  }
65
- return v.parse(schema, raw);
64
+ return parseEnrichmentValue({
65
+ schema,
66
+ value: raw,
67
+ generatorId,
68
+ toRoutingPath: ([scope, ...leafPath]) => {
69
+ switch (scope) {
70
+ case 'subject':
71
+ return [generatorId, ...subjectSegments, ...leafPath];
72
+ case 'generator':
73
+ return [generatorId, GENERATOR_ENRICHMENT_KEY, ...leafPath];
74
+ case 'stack':
75
+ return [STACK_ENRICHMENT_KEY, ...leafPath];
76
+ default:
77
+ return [generatorId];
78
+ }
79
+ }
80
+ });
66
81
  };
@@ -0,0 +1,17 @@
1
+ import * as v from 'valibot';
2
+ type ParseEnrichmentValueArgs<EnrichmentType> = {
3
+ schema: v.GenericSchema<EnrichmentType>;
4
+ value: unknown;
5
+ /** The generator whose schema reads `value`; `undefined` for the shared `_stack` bag. */
6
+ generatorId: string | undefined;
7
+ /** The `client.json#settings.enrichments` routing path of the value at `path` inside `value`. */
8
+ toRoutingPath: (path: readonly string[]) => string[];
9
+ };
10
+ /**
11
+ * `value` parsed through a generator's enrichment schema. Enrichments are
12
+ * typed configuration, so a value that does not match throws, and the run
13
+ * fails. The message lists every value that does not match, at its place in
14
+ * `client.json`, so the user can fix them all in one pass.
15
+ */
16
+ export declare const parseEnrichmentValue: <EnrichmentType>({ schema, value, generatorId, toRoutingPath }: ParseEnrichmentValueArgs<EnrichmentType>) => EnrichmentType;
17
+ export {};
@@ -0,0 +1,32 @@
1
+ import * as v from 'valibot';
2
+ import { formatEnrichmentPath } from './EnrichmentWarning.js';
3
+ /**
4
+ * `value` parsed through a generator's enrichment schema. Enrichments are
5
+ * typed configuration, so a value that does not match throws, and the run
6
+ * fails. The message lists every value that does not match, at its place in
7
+ * `client.json`, so the user can fix them all in one pass.
8
+ */
9
+ export const parseEnrichmentValue = ({ schema, value, generatorId, toRoutingPath }) => {
10
+ const result = v.safeParse(schema, value);
11
+ if (result.success) {
12
+ return result.output;
13
+ }
14
+ const lines = result.issues.map(issue => {
15
+ const path = (issue.path ?? []).map(item => String(item.key));
16
+ const at = formatEnrichmentPath(toRoutingPath(path));
17
+ return `- '${at}': ${toFix(issue, generatorId)}`;
18
+ });
19
+ const header = generatorId === undefined
20
+ ? 'Stack enrichments do not match the schema a generator reads them with.'
21
+ : `Enrichments for '${generatorId}' do not match its enrichment schema.`;
22
+ throw new Error([`${header} Fix them in client.json (settings.enrichments):`, ...lines].join('\n'));
23
+ };
24
+ /** What to do about one value: a scope the generator does not read takes no value at all. */
25
+ const toFix = (issue, generatorId) => {
26
+ if (issue.expected !== 'undefined') {
27
+ return issue.message;
28
+ }
29
+ return generatorId === undefined
30
+ ? 'No generator reads a value here. Remove the value.'
31
+ : `'${generatorId}' reads no enrichments here. Remove the value.`;
32
+ };
@@ -23,7 +23,7 @@
23
23
  *
24
24
  * @module readEnrichments
25
25
  */
26
- import * as v from 'valibot';
26
+ import type * as v from 'valibot';
27
27
  import type { ClientSettings } from '../types/Settings.js';
28
28
  /**
29
29
  * Minimal structural view of the read context. Any `GenerateContext`
@@ -46,9 +46,9 @@ type EnrichmentReadContext = {
46
46
  * `v.object({...})` (a missing block then throws); one with all-optional
47
47
  * config passes `v.optional(v.object({...}))`.
48
48
  *
49
- * @throws on a malformed block. The generator's item is then recorded as
50
- * `error` and the run continues (fail-open), exactly like a bad subject
51
- * leaf.
49
+ * @throws on a malformed block, naming each wrong value's place in
50
+ * `client.json`. The item is recorded as `error`, and the run fails once
51
+ * every generator has run, exactly as for a bad subject leaf.
52
52
  */
53
53
  export declare const toGeneratorEnrichment: <EnrichmentType>(context: EnrichmentReadContext, generatorId: string, schema: v.GenericSchema<EnrichmentType>) => EnrichmentType;
54
54
  /**
@@ -62,7 +62,7 @@ export declare const toGeneratorEnrichment: <EnrichmentType>(context: Enrichment
62
62
  * `v.object` ignores unknown keys, so fields other generators consume
63
63
  * don't interfere. The return type is inferred from `schema`.
64
64
  *
65
- * @throws on a malformed block (fail-open, as above).
65
+ * @throws on a malformed block, as above.
66
66
  */
67
67
  export declare const toStackEnrichment: <EnrichmentType>(context: EnrichmentReadContext, schema: v.GenericSchema<EnrichmentType>) => EnrichmentType;
68
68
  export {};
@@ -23,8 +23,8 @@
23
23
  *
24
24
  * @module readEnrichments
25
25
  */
26
- import * as v from 'valibot';
27
26
  import { GENERATOR_ENRICHMENT_KEY, STACK_ENRICHMENT_KEY } from '../types/Enrichments.js';
27
+ import { parseEnrichmentValue } from './parseEnrichmentValue.js';
28
28
  /**
29
29
  * Read this generator's **generator-scoped** enrichment — the
30
30
  * run-constant leaf at
@@ -38,11 +38,16 @@ import { GENERATOR_ENRICHMENT_KEY, STACK_ENRICHMENT_KEY } from '../types/Enrichm
38
38
  * `v.object({...})` (a missing block then throws); one with all-optional
39
39
  * config passes `v.optional(v.object({...}))`.
40
40
  *
41
- * @throws on a malformed block. The generator's item is then recorded as
42
- * `error` and the run continues (fail-open), exactly like a bad subject
43
- * leaf.
41
+ * @throws on a malformed block, naming each wrong value's place in
42
+ * `client.json`. The item is recorded as `error`, and the run fails once
43
+ * every generator has run, exactly as for a bad subject leaf.
44
44
  */
45
- export const toGeneratorEnrichment = (context, generatorId, schema) => v.parse(schema, context.settings?.enrichments?.[generatorId]?.[GENERATOR_ENRICHMENT_KEY]);
45
+ export const toGeneratorEnrichment = (context, generatorId, schema) => parseEnrichmentValue({
46
+ schema,
47
+ value: context.settings?.enrichments?.[generatorId]?.[GENERATOR_ENRICHMENT_KEY],
48
+ generatorId,
49
+ toRoutingPath: path => [generatorId, GENERATOR_ENRICHMENT_KEY, ...path]
50
+ });
46
51
  /**
47
52
  * Read the **stack-scoped** enrichment — the run-constant leaf at
48
53
  * `client.json#settings.enrichments._stack`, validated through the
@@ -54,6 +59,11 @@ export const toGeneratorEnrichment = (context, generatorId, schema) => v.parse(s
54
59
  * `v.object` ignores unknown keys, so fields other generators consume
55
60
  * don't interfere. The return type is inferred from `schema`.
56
61
  *
57
- * @throws on a malformed block (fail-open, as above).
62
+ * @throws on a malformed block, as above.
58
63
  */
59
- export const toStackEnrichment = (context, schema) => v.parse(schema, context.settings?.enrichments?.[STACK_ENRICHMENT_KEY]);
64
+ export const toStackEnrichment = (context, schema) => parseEnrichmentValue({
65
+ schema,
66
+ value: context.settings?.enrichments?.[STACK_ENRICHMENT_KEY],
67
+ generatorId: undefined,
68
+ toRoutingPath: path => [STACK_ENRICHMENT_KEY, ...path]
69
+ });
package/esm/mod.d.ts CHANGED
@@ -80,6 +80,7 @@ export * from './dsl/ContentSettings.js';
80
80
  export * from './dsl/Definition.js';
81
81
  export * from './dsl/FileBase.js';
82
82
  export * from './dsl/CodeFileBase.js';
83
+ export * from './dsl/PendingDefinition.js';
83
84
  export * from './dsl/DefinitionContainer.js';
84
85
  export * from './dsl/ImportBase.js';
85
86
  export * from './dsl/ReExportBase.js';
package/esm/mod.js CHANGED
@@ -80,6 +80,7 @@ export * from './dsl/ContentSettings.js';
80
80
  export * from './dsl/Definition.js';
81
81
  export * from './dsl/FileBase.js';
82
82
  export * from './dsl/CodeFileBase.js';
83
+ export * from './dsl/PendingDefinition.js';
83
84
  export * from './dsl/DefinitionContainer.js';
84
85
  export * from './dsl/ImportBase.js';
85
86
  export * from './dsl/ReExportBase.js';
@@ -1,4 +1,5 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ import type { OasUnknown } from '../unknown/Unknown.js';
2
3
  import type { SchemaPath } from '../../types/SchemaPath.js';
3
4
  import type { OasSchema, ToJsonSchemaOptions } from '../schema/Schema.js';
4
5
  import type { OasRef } from '../ref/Ref.js';
@@ -109,6 +110,12 @@ export declare class OasArray<Nullable extends boolean | undefined = boolean | u
109
110
  * Whether the array is deprecated.
110
111
  */
111
112
  deprecated: boolean | undefined;
113
+ /**
114
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
115
+ * `system.not: unknown`: the document says "not something", and core does
116
+ * not read what. `undefined` otherwise.
117
+ */
118
+ not: OasUnknown | undefined;
112
119
  constructor(fields: ArrayFields<Nullable>, context?: ParseContextType);
113
120
  /**
114
121
  * Determines if this array is a reference object.
@@ -116,6 +123,18 @@ export declare class OasArray<Nullable extends boolean | undefined = boolean | u
116
123
  * @returns Always returns false since this is a concrete array instance, not a reference
117
124
  */
118
125
  isRef(): this is OasRef<'schema'>;
126
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
127
+ isReadOnly(): boolean;
128
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
129
+ isWriteOnly(): boolean;
130
+ /**
131
+ * A copy of this schema with what `ref` adds at its site applied: its
132
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
133
+ * this type takes, a sibling's value winning. A value that does not fit
134
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
135
+ * This schema does not change, and the copy shares its child schemas.
136
+ */
137
+ clone(ref?: OasRef<'schema'>): OasArray;
119
138
  traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
120
139
  /**
121
140
  * Resolves this array object.
@@ -1,5 +1,6 @@
1
1
  import "../../_dnt.polyfills.js";
2
2
  import { traverseSchema } from '../schemaPath/traverseSchema.js';
3
+ import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isArrayValue } from '../schema/siblings.js';
3
4
  import { OasBase } from '../../types/OasBase.js';
4
5
  export class OasArray extends OasBase {
5
6
  constructor(fields, context) {
@@ -152,6 +153,17 @@ export class OasArray extends OasBase {
152
153
  writable: true,
153
154
  value: void 0
154
155
  });
156
+ /**
157
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
158
+ * `system.not: unknown`: the document says "not something", and core does
159
+ * not read what. `undefined` otherwise.
160
+ */
161
+ Object.defineProperty(this, "not", {
162
+ enumerable: true,
163
+ configurable: true,
164
+ writable: true,
165
+ value: undefined
166
+ });
155
167
  this.items = fields.items;
156
168
  this.title = fields.title;
157
169
  this.description = fields.description;
@@ -175,6 +187,41 @@ export class OasArray extends OasBase {
175
187
  isRef() {
176
188
  return false;
177
189
  }
190
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
191
+ isReadOnly() {
192
+ return this.readOnly === true;
193
+ }
194
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
195
+ isWriteOnly() {
196
+ return this.writeOnly === true;
197
+ }
198
+ /**
199
+ * A copy of this schema with what `ref` adds at its site applied: its
200
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
201
+ * this type takes, a sibling's value winning. A value that does not fit
202
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
203
+ * This schema does not change, and the copy shares its child schemas.
204
+ */
205
+ clone(ref) {
206
+ const nullable = this.nullable || ref?.nullable || undefined;
207
+ const copy = new OasArray({
208
+ ...toSiblingAnnotations(this, ref),
209
+ example: toSiblingValue(ref?.example, isArrayValue) ?? this.example,
210
+ items: this.items,
211
+ nullable,
212
+ uniqueItems: ref?.uniqueItems ?? this.uniqueItems,
213
+ maxItems: ref?.maxItems ?? this.maxItems,
214
+ minItems: ref?.minItems ?? this.minItems,
215
+ enums: toSiblingEnums(ref?.enums, isArrayValue, nullable) ?? this.enums,
216
+ defaultValue: toSiblingValue(ref?.default, isArrayValue) ?? this.defaultValue,
217
+ readOnly: this.readOnly || ref?.readOnly || undefined,
218
+ writeOnly: this.writeOnly || ref?.writeOnly || undefined,
219
+ deprecated: ref?.deprecated ?? this.deprecated,
220
+ });
221
+ copy.stackTrail = this.stackTrail;
222
+ copy.not = this.not;
223
+ return copy;
224
+ }
178
225
  traverse(path) {
179
226
  return traverseSchema(this, path);
180
227
  }
@@ -1,4 +1,5 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ import type { OasUnknown } from '../unknown/Unknown.js';
2
3
  import type { SchemaPath } from '../../types/SchemaPath.js';
3
4
  import type { OpenAPIV3 } from 'openapi-types';
4
5
  import type { OasRef } from '../ref/Ref.js';
@@ -82,6 +83,12 @@ export declare class OasBoolean<Nullable extends boolean | undefined = boolean |
82
83
  * enabled, the current StackTrail is snapshotted onto the
83
84
  * instance (via the {@link OasBase} base).
84
85
  */
86
+ /**
87
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
88
+ * `system.not: unknown`: the document says "not something", and core does
89
+ * not read what. `undefined` otherwise.
90
+ */
91
+ not: OasUnknown | undefined;
85
92
  constructor(fields?: BooleanFields<Nullable>, context?: ParseContextType);
86
93
  /**
87
94
  * Determines if this boolean is a reference object.
@@ -89,6 +96,18 @@ export declare class OasBoolean<Nullable extends boolean | undefined = boolean |
89
96
  * @returns Always returns false since this is a concrete boolean instance, not a reference
90
97
  */
91
98
  isRef(): this is OasRef<'schema'>;
99
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
100
+ isReadOnly(): boolean;
101
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
102
+ isWriteOnly(): boolean;
103
+ /**
104
+ * A copy of this schema with what `ref` adds at its site applied: its
105
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
106
+ * this type takes, a sibling's value winning. A value that does not fit
107
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
108
+ * This schema does not change, and the copy shares its child schemas.
109
+ */
110
+ clone(ref?: OasRef<'schema'>): OasBoolean;
92
111
  traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
93
112
  /**
94
113
  * Resolves this boolean object.
@@ -1,15 +1,8 @@
1
1
  import "../../_dnt.polyfills.js";
2
2
  import { traverseSchema } from '../schemaPath/traverseSchema.js';
3
+ import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isBooleanValue } from '../schema/siblings.js';
3
4
  import { OasBase } from '../../types/OasBase.js';
4
5
  export class OasBoolean extends OasBase {
5
- /**
6
- * Creates a new OasBoolean instance.
7
- *
8
- * @param fields - Boolean configuration fields including validation constraints and metadata
9
- * @param context - Optional ParseContext. When passed and attribution is
10
- * enabled, the current StackTrail is snapshotted onto the
11
- * instance (via the {@link OasBase} base).
12
- */
13
6
  constructor(fields = {}, context) {
14
7
  super(context);
15
8
  /**
@@ -113,6 +106,25 @@ export class OasBoolean extends OasBase {
113
106
  writable: true,
114
107
  value: void 0
115
108
  });
109
+ /**
110
+ * Creates a new OasBoolean instance.
111
+ *
112
+ * @param fields - Boolean configuration fields including validation constraints and metadata
113
+ * @param context - Optional ParseContext. When passed and attribution is
114
+ * enabled, the current StackTrail is snapshotted onto the
115
+ * instance (via the {@link OasBase} base).
116
+ */
117
+ /**
118
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
119
+ * `system.not: unknown`: the document says "not something", and core does
120
+ * not read what. `undefined` otherwise.
121
+ */
122
+ Object.defineProperty(this, "not", {
123
+ enumerable: true,
124
+ configurable: true,
125
+ writable: true,
126
+ value: undefined
127
+ });
116
128
  this.title = fields.title;
117
129
  this.description = fields.description;
118
130
  this.nullable = fields.nullable;
@@ -132,6 +144,37 @@ export class OasBoolean extends OasBase {
132
144
  isRef() {
133
145
  return false;
134
146
  }
147
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
148
+ isReadOnly() {
149
+ return this.readOnly === true;
150
+ }
151
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
152
+ isWriteOnly() {
153
+ return this.writeOnly === true;
154
+ }
155
+ /**
156
+ * A copy of this schema with what `ref` adds at its site applied: its
157
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
158
+ * this type takes, a sibling's value winning. A value that does not fit
159
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
160
+ * This schema does not change, and the copy shares its child schemas.
161
+ */
162
+ clone(ref) {
163
+ const nullable = this.nullable || ref?.nullable || undefined;
164
+ const copy = new OasBoolean({
165
+ ...toSiblingAnnotations(this, ref),
166
+ example: toSiblingValue(ref?.example, isBooleanValue) ?? this.example,
167
+ nullable,
168
+ enums: toSiblingEnums(ref?.enums, isBooleanValue, nullable) ?? this.enums,
169
+ default: toSiblingValue(ref?.default, isBooleanValue) ?? this.default,
170
+ readOnly: this.readOnly || ref?.readOnly || undefined,
171
+ writeOnly: this.writeOnly || ref?.writeOnly || undefined,
172
+ deprecated: ref?.deprecated ?? this.deprecated,
173
+ });
174
+ copy.stackTrail = this.stackTrail;
175
+ copy.not = this.not;
176
+ return copy;
177
+ }
135
178
  traverse(path) {
136
179
  return traverseSchema(this, path);
137
180
  }
@@ -34,6 +34,10 @@ export declare class OasExample {
34
34
  constructor(fields: ExampleFields);
35
35
  /** Returns true if object is a reference */
36
36
  isRef(): this is OasRef<'example'>;
37
+ /** Always `false`: `readOnly` is a schema keyword. */
38
+ isReadOnly(): boolean;
39
+ /** Always `false`: `writeOnly` is a schema keyword. */
40
+ isWriteOnly(): boolean;
37
41
  /** Returns itself */
38
42
  resolve(): OasExample;
39
43
  resolveOnce(): OasExample;
@@ -62,6 +62,14 @@ export class OasExample {
62
62
  isRef() {
63
63
  return false;
64
64
  }
65
+ /** Always `false`: `readOnly` is a schema keyword. */
66
+ isReadOnly() {
67
+ return false;
68
+ }
69
+ /** Always `false`: `writeOnly` is a schema keyword. */
70
+ isWriteOnly() {
71
+ return false;
72
+ }
65
73
  /** Returns itself */
66
74
  resolve() {
67
75
  return this;
@@ -73,6 +73,10 @@ export declare class OasHeader {
73
73
  constructor(fields: HeaderFields);
74
74
  /** Returns true if object is a reference */
75
75
  isRef(): this is OasRef<'header'>;
76
+ /** Always `false`: `readOnly` is a schema keyword. */
77
+ isReadOnly(): boolean;
78
+ /** Always `false`: `writeOnly` is a schema keyword. */
79
+ isWriteOnly(): boolean;
76
80
  /** Returns itself */
77
81
  resolve(): OasHeader;
78
82
  resolveOnce(): OasHeader;
@@ -99,6 +99,14 @@ export class OasHeader {
99
99
  isRef() {
100
100
  return false;
101
101
  }
102
+ /** Always `false`: `readOnly` is a schema keyword. */
103
+ isReadOnly() {
104
+ return false;
105
+ }
106
+ /** Always `false`: `writeOnly` is a schema keyword. */
107
+ isWriteOnly() {
108
+ return false;
109
+ }
102
110
  /** Returns itself */
103
111
  resolve() {
104
112
  return this;
@@ -1,4 +1,5 @@
1
1
  import "../../_dnt.polyfills.js";
2
+ import type { OasUnknown } from '../unknown/Unknown.js';
2
3
  import type { SchemaPath } from '../../types/SchemaPath.js';
3
4
  import type { OasRef } from '../ref/Ref.js';
4
5
  import type { OpenAPIV3 } from 'openapi-types';
@@ -116,8 +117,26 @@ export declare class OasInteger<Nullable extends boolean | undefined = boolean |
116
117
  * Whether the integer is deprecated.
117
118
  */
118
119
  deprecated: boolean | undefined;
120
+ /**
121
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
122
+ * `system.not: unknown`: the document says "not something", and core does
123
+ * not read what. `undefined` otherwise.
124
+ */
125
+ not: OasUnknown | undefined;
119
126
  constructor(fields?: IntegerFields<Nullable>, context?: ParseContextType);
120
127
  isRef(): this is OasRef<'schema'>;
128
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
129
+ isReadOnly(): boolean;
130
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
131
+ isWriteOnly(): boolean;
132
+ /**
133
+ * A copy of this schema with what `ref` adds at its site applied: its
134
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
135
+ * this type takes, a sibling's value winning. A value that does not fit
136
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
137
+ * This schema does not change, and the copy shares its child schemas.
138
+ */
139
+ clone(ref?: OasRef<'schema'>): OasInteger;
121
140
  traverse(path: SchemaPath): OasSchema | OasRef<'schema'>;
122
141
  resolve(): OasInteger<Nullable>;
123
142
  resolveOnce(): OasInteger<Nullable>;
@@ -1,5 +1,6 @@
1
1
  import "../../_dnt.polyfills.js";
2
2
  import { traverseSchema } from '../schemaPath/traverseSchema.js';
3
+ import { toSiblingAnnotations, toSiblingEnums, toSiblingValue, isIntegerValue, isIntegerFormat } from '../schema/siblings.js';
3
4
  import { OasBase } from '../../types/OasBase.js';
4
5
  export class OasInteger extends OasBase {
5
6
  constructor(fields = {}, context) {
@@ -165,6 +166,17 @@ export class OasInteger extends OasBase {
165
166
  writable: true,
166
167
  value: void 0
167
168
  });
169
+ /**
170
+ * The schema's `not`, kept as an `OasUnknown` under `client.json`
171
+ * `system.not: unknown`: the document says "not something", and core does
172
+ * not read what. `undefined` otherwise.
173
+ */
174
+ Object.defineProperty(this, "not", {
175
+ enumerable: true,
176
+ configurable: true,
177
+ writable: true,
178
+ value: undefined
179
+ });
168
180
  this.title = fields.title;
169
181
  this.description = fields.description;
170
182
  this.nullable = fields.nullable;
@@ -185,6 +197,43 @@ export class OasInteger extends OasBase {
185
197
  isRef() {
186
198
  return false;
187
199
  }
200
+ /** Whether the value is `readOnly`: sent by the API only, never in a request. */
201
+ isReadOnly() {
202
+ return this.readOnly === true;
203
+ }
204
+ /** Whether the value is `writeOnly`: sent in a request only, never by the API. */
205
+ isWriteOnly() {
206
+ return this.writeOnly === true;
207
+ }
208
+ /**
209
+ * A copy of this schema with what `ref` adds at its site applied: its
210
+ * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that
211
+ * this type takes, a sibling's value winning. A value that does not fit
212
+ * this type is left out (the parser reports it). For `OasRef.resolve()`.
213
+ * This schema does not change, and the copy shares its child schemas.
214
+ */
215
+ clone(ref) {
216
+ const nullable = this.nullable || ref?.nullable || undefined;
217
+ const copy = new OasInteger({
218
+ ...toSiblingAnnotations(this, ref),
219
+ example: toSiblingValue(ref?.example, isIntegerValue) ?? this.example,
220
+ nullable,
221
+ format: toSiblingValue(ref?.format, isIntegerFormat) ?? this.format,
222
+ enums: toSiblingEnums(ref?.enums, isIntegerValue, nullable) ?? this.enums,
223
+ multipleOf: ref?.multipleOf ?? this.multipleOf,
224
+ maximum: ref?.maximum ?? this.maximum,
225
+ exclusiveMaximum: ref?.exclusiveMaximum ?? this.exclusiveMaximum,
226
+ minimum: ref?.minimum ?? this.minimum,
227
+ exclusiveMinimum: ref?.exclusiveMinimum ?? this.exclusiveMinimum,
228
+ default: toSiblingValue(ref?.default, isIntegerValue) ?? this.default,
229
+ readOnly: this.readOnly || ref?.readOnly || undefined,
230
+ writeOnly: this.writeOnly || ref?.writeOnly || undefined,
231
+ deprecated: ref?.deprecated ?? this.deprecated,
232
+ });
233
+ copy.stackTrail = this.stackTrail;
234
+ copy.not = this.not;
235
+ return copy;
236
+ }
188
237
  traverse(path) {
189
238
  return traverseSchema(this, path);
190
239
  }
@@ -60,6 +60,10 @@ export declare class OasLink {
60
60
  constructor(fields: LinkFields);
61
61
  /** Returns true if object is a reference */
62
62
  isRef(): this is OasRef<'link'>;
63
+ /** Always `false`: `readOnly` is a schema keyword. */
64
+ isReadOnly(): boolean;
65
+ /** Always `false`: `writeOnly` is a schema keyword. */
66
+ isWriteOnly(): boolean;
63
67
  /** Returns itself */
64
68
  resolve(): OasLink;
65
69
  resolveOnce(): OasLink;
@@ -87,6 +87,14 @@ export class OasLink {
87
87
  isRef() {
88
88
  return false;
89
89
  }
90
+ /** Always `false`: `readOnly` is a schema keyword. */
91
+ isReadOnly() {
92
+ return false;
93
+ }
94
+ /** Always `false`: `writeOnly` is a schema keyword. */
95
+ isWriteOnly() {
96
+ return false;
97
+ }
90
98
  /** Returns itself */
91
99
  resolve() {
92
100
  return this;