typekro 0.33.10 → 0.34.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 (336) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/compositions/typekro-runtime/typekro-runtime.d.ts +0 -33
  3. package/dist/compositions/typekro-runtime/typekro-runtime.d.ts.map +1 -1
  4. package/dist/compositions/typekro-runtime/typekro-runtime.js +63 -1
  5. package/dist/compositions/typekro-runtime/typekro-runtime.js.map +1 -1
  6. package/dist/compositions/typekro-runtime/types.d.ts +8 -0
  7. package/dist/compositions/typekro-runtime/types.d.ts.map +1 -1
  8. package/dist/compositions/typekro-runtime/types.js +1 -0
  9. package/dist/compositions/typekro-runtime/types.js.map +1 -1
  10. package/dist/core/aspects/values-merge.d.ts +17 -0
  11. package/dist/core/aspects/values-merge.d.ts.map +1 -1
  12. package/dist/core/aspects/values-merge.js +67 -8
  13. package/dist/core/aspects/values-merge.js.map +1 -1
  14. package/dist/core/deployment/direct-factory.d.ts +9 -0
  15. package/dist/core/deployment/direct-factory.d.ts.map +1 -1
  16. package/dist/core/deployment/direct-factory.js +37 -3
  17. package/dist/core/deployment/direct-factory.js.map +1 -1
  18. package/dist/core/deployment/engine.d.ts +34 -0
  19. package/dist/core/deployment/engine.d.ts.map +1 -1
  20. package/dist/core/deployment/engine.js +173 -29
  21. package/dist/core/deployment/engine.js.map +1 -1
  22. package/dist/core/deployment/index.d.ts +2 -0
  23. package/dist/core/deployment/index.d.ts.map +1 -1
  24. package/dist/core/deployment/index.js +1 -0
  25. package/dist/core/deployment/index.js.map +1 -1
  26. package/dist/core/deployment/k8s-helpers.d.ts +73 -0
  27. package/dist/core/deployment/k8s-helpers.d.ts.map +1 -1
  28. package/dist/core/deployment/k8s-helpers.js +198 -4
  29. package/dist/core/deployment/k8s-helpers.js.map +1 -1
  30. package/dist/core/deployment/kro-factory.d.ts.map +1 -1
  31. package/dist/core/deployment/kro-factory.js +21 -1
  32. package/dist/core/deployment/kro-factory.js.map +1 -1
  33. package/dist/core/deployment/status-leaf-resolution.d.ts +101 -0
  34. package/dist/core/deployment/status-leaf-resolution.d.ts.map +1 -0
  35. package/dist/core/deployment/status-leaf-resolution.js +232 -0
  36. package/dist/core/deployment/status-leaf-resolution.js.map +1 -0
  37. package/dist/core/deployment/strategies/base-strategy.d.ts.map +1 -1
  38. package/dist/core/deployment/strategies/base-strategy.js +31 -3
  39. package/dist/core/deployment/strategies/base-strategy.js.map +1 -1
  40. package/dist/core/deployment/strategies/kro-strategy.d.ts.map +1 -1
  41. package/dist/core/deployment/strategies/kro-strategy.js +8 -1
  42. package/dist/core/deployment/strategies/kro-strategy.js.map +1 -1
  43. package/dist/core/kro/index.d.ts +6 -0
  44. package/dist/core/kro/index.d.ts.map +1 -0
  45. package/dist/core/kro/index.js +6 -0
  46. package/dist/core/kro/index.js.map +1 -0
  47. package/dist/core/kro/label-guard-capability.d.ts +141 -0
  48. package/dist/core/kro/label-guard-capability.d.ts.map +1 -0
  49. package/dist/core/kro/label-guard-capability.js +257 -0
  50. package/dist/core/kro/label-guard-capability.js.map +1 -0
  51. package/dist/core/kro/labels.d.ts +56 -0
  52. package/dist/core/kro/labels.d.ts.map +1 -0
  53. package/dist/core/kro/labels.js +62 -0
  54. package/dist/core/kro/labels.js.map +1 -0
  55. package/dist/core/kubernetes/api-capability.d.ts +196 -0
  56. package/dist/core/kubernetes/api-capability.d.ts.map +1 -0
  57. package/dist/core/kubernetes/api-capability.js +301 -0
  58. package/dist/core/kubernetes/api-capability.js.map +1 -0
  59. package/dist/core/kubernetes/index.d.ts +2 -0
  60. package/dist/core/kubernetes/index.d.ts.map +1 -1
  61. package/dist/core/kubernetes/index.js +2 -0
  62. package/dist/core/kubernetes/index.js.map +1 -1
  63. package/dist/core/kubernetes/naming.d.ts +100 -0
  64. package/dist/core/kubernetes/naming.d.ts.map +1 -0
  65. package/dist/core/kubernetes/naming.js +93 -0
  66. package/dist/core/kubernetes/naming.js.map +1 -0
  67. package/dist/core/planning/direct-runtime-adapter.d.ts.map +1 -1
  68. package/dist/core/planning/direct-runtime-adapter.js +54 -17
  69. package/dist/core/planning/direct-runtime-adapter.js.map +1 -1
  70. package/dist/core/planning/planner.d.ts.map +1 -1
  71. package/dist/core/planning/planner.js +17 -0
  72. package/dist/core/planning/planner.js.map +1 -1
  73. package/dist/core/planning/schema.d.ts.map +1 -1
  74. package/dist/core/planning/schema.js +7 -3
  75. package/dist/core/planning/schema.js.map +1 -1
  76. package/dist/core/references/cel-lexical-scanner.d.ts +100 -1
  77. package/dist/core/references/cel-lexical-scanner.d.ts.map +1 -1
  78. package/dist/core/references/cel-lexical-scanner.js +196 -2
  79. package/dist/core/references/cel-lexical-scanner.js.map +1 -1
  80. package/dist/core/references/cel.d.ts +249 -1
  81. package/dist/core/references/cel.d.ts.map +1 -1
  82. package/dist/core/references/cel.js +289 -8
  83. package/dist/core/references/cel.js.map +1 -1
  84. package/dist/core/serialization/arktype-ast.d.ts +21 -0
  85. package/dist/core/serialization/arktype-ast.d.ts.map +1 -0
  86. package/dist/core/serialization/arktype-ast.js +29 -0
  87. package/dist/core/serialization/arktype-ast.js.map +1 -0
  88. package/dist/core/serialization/cel-references.d.ts +133 -32
  89. package/dist/core/serialization/cel-references.d.ts.map +1 -1
  90. package/dist/core/serialization/cel-references.js +908 -109
  91. package/dist/core/serialization/cel-references.js.map +1 -1
  92. package/dist/core/serialization/schema.d.ts +16 -2
  93. package/dist/core/serialization/schema.d.ts.map +1 -1
  94. package/dist/core/serialization/schema.js +113 -21
  95. package/dist/core/serialization/schema.js.map +1 -1
  96. package/dist/core/types/composable.d.ts +7 -1
  97. package/dist/core/types/composable.d.ts.map +1 -1
  98. package/dist/core/types/deployment.d.ts +32 -2
  99. package/dist/core/types/deployment.d.ts.map +1 -1
  100. package/dist/core/types/serialization.d.ts +37 -0
  101. package/dist/core/types/serialization.d.ts.map +1 -1
  102. package/dist/core/validation/cel-dialect.d.ts +246 -0
  103. package/dist/core/validation/cel-dialect.d.ts.map +1 -0
  104. package/dist/core/validation/cel-dialect.js +1997 -0
  105. package/dist/core/validation/cel-dialect.js.map +1 -0
  106. package/dist/core/validation/cel-validator.d.ts.map +1 -1
  107. package/dist/core/validation/cel-validator.js +8 -1
  108. package/dist/core/validation/cel-validator.js.map +1 -1
  109. package/dist/core/validation/literal-status.d.ts +107 -0
  110. package/dist/core/validation/literal-status.d.ts.map +1 -0
  111. package/dist/core/validation/literal-status.js +346 -0
  112. package/dist/core/validation/literal-status.js.map +1 -0
  113. package/dist/core/validation/structural-spec-dependence.d.ts +179 -0
  114. package/dist/core/validation/structural-spec-dependence.d.ts.map +1 -0
  115. package/dist/core/validation/structural-spec-dependence.js +911 -0
  116. package/dist/core/validation/structural-spec-dependence.js.map +1 -0
  117. package/dist/factories/apisix/compositions/apisix-bootstrap.d.ts.map +1 -1
  118. package/dist/factories/apisix/compositions/apisix-bootstrap.js +9 -0
  119. package/dist/factories/apisix/compositions/apisix-bootstrap.js.map +1 -1
  120. package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts +6 -0
  121. package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts.map +1 -1
  122. package/dist/factories/clickhouse/compositions/clickhouse-cluster.js +273 -23
  123. package/dist/factories/clickhouse/compositions/clickhouse-cluster.js.map +1 -1
  124. package/dist/factories/clickhouse/resources/index.d.ts +1 -0
  125. package/dist/factories/clickhouse/resources/index.d.ts.map +1 -1
  126. package/dist/factories/clickhouse/resources/index.js +1 -0
  127. package/dist/factories/clickhouse/resources/index.js.map +1 -1
  128. package/dist/factories/clickhouse/resources/installation.d.ts.map +1 -1
  129. package/dist/factories/clickhouse/resources/installation.js +31 -4
  130. package/dist/factories/clickhouse/resources/installation.js.map +1 -1
  131. package/dist/factories/clickhouse/resources/s3-backup.d.ts +215 -0
  132. package/dist/factories/clickhouse/resources/s3-backup.d.ts.map +1 -0
  133. package/dist/factories/clickhouse/resources/s3-backup.js +410 -0
  134. package/dist/factories/clickhouse/resources/s3-backup.js.map +1 -0
  135. package/dist/factories/clickhouse/types.d.ts +416 -20
  136. package/dist/factories/clickhouse/types.d.ts.map +1 -1
  137. package/dist/factories/clickhouse/types.js +235 -11
  138. package/dist/factories/clickhouse/types.js.map +1 -1
  139. package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts +42 -0
  140. package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts.map +1 -1
  141. package/dist/factories/clickhouse/utils/helm-values-mapper.js +48 -0
  142. package/dist/factories/clickhouse/utils/helm-values-mapper.js.map +1 -1
  143. package/dist/factories/clickhouse/utils/index.d.ts +2 -0
  144. package/dist/factories/clickhouse/utils/index.d.ts.map +1 -1
  145. package/dist/factories/clickhouse/utils/index.js +2 -0
  146. package/dist/factories/clickhouse/utils/index.js.map +1 -1
  147. package/dist/factories/clickhouse/utils/s3-storage.d.ts +503 -0
  148. package/dist/factories/clickhouse/utils/s3-storage.d.ts.map +1 -0
  149. package/dist/factories/clickhouse/utils/s3-storage.js +1139 -0
  150. package/dist/factories/clickhouse/utils/s3-storage.js.map +1 -0
  151. package/dist/factories/clickhouse/utils/validation.d.ts +103 -0
  152. package/dist/factories/clickhouse/utils/validation.d.ts.map +1 -1
  153. package/dist/factories/clickhouse/utils/validation.js +129 -0
  154. package/dist/factories/clickhouse/utils/validation.js.map +1 -1
  155. package/dist/factories/clickhouse/utils/xml.d.ts +87 -0
  156. package/dist/factories/clickhouse/utils/xml.d.ts.map +1 -0
  157. package/dist/factories/clickhouse/utils/xml.js +151 -0
  158. package/dist/factories/clickhouse/utils/xml.js.map +1 -0
  159. package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts +57 -0
  160. package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts.map +1 -1
  161. package/dist/factories/clickstack/compositions/clickstack-bootstrap.js +266 -7
  162. package/dist/factories/clickstack/compositions/clickstack-bootstrap.js.map +1 -1
  163. package/dist/factories/clickstack/types.d.ts +205 -26
  164. package/dist/factories/clickstack/types.d.ts.map +1 -1
  165. package/dist/factories/clickstack/types.js +106 -8
  166. package/dist/factories/clickstack/types.js.map +1 -1
  167. package/dist/factories/clickstack/utils/collector-config.d.ts +104 -0
  168. package/dist/factories/clickstack/utils/collector-config.d.ts.map +1 -0
  169. package/dist/factories/clickstack/utils/collector-config.js +266 -0
  170. package/dist/factories/clickstack/utils/collector-config.js.map +1 -0
  171. package/dist/factories/clickstack/utils/helm-values-mapper.d.ts +26 -0
  172. package/dist/factories/clickstack/utils/helm-values-mapper.d.ts.map +1 -1
  173. package/dist/factories/clickstack/utils/helm-values-mapper.js +53 -12
  174. package/dist/factories/clickstack/utils/helm-values-mapper.js.map +1 -1
  175. package/dist/factories/clickstack/utils/index.d.ts +2 -0
  176. package/dist/factories/clickstack/utils/index.d.ts.map +1 -1
  177. package/dist/factories/clickstack/utils/index.js +2 -0
  178. package/dist/factories/clickstack/utils/index.js.map +1 -1
  179. package/dist/factories/clickstack/utils/storage.d.ts +449 -0
  180. package/dist/factories/clickstack/utils/storage.d.ts.map +1 -0
  181. package/dist/factories/clickstack/utils/storage.js +698 -0
  182. package/dist/factories/clickstack/utils/storage.js.map +1 -0
  183. package/dist/factories/cnpg/resources/helm.d.ts.map +1 -1
  184. package/dist/factories/cnpg/resources/helm.js +4 -4
  185. package/dist/factories/cnpg/resources/helm.js.map +1 -1
  186. package/dist/factories/cnpg/types.d.ts +10 -1
  187. package/dist/factories/cnpg/types.d.ts.map +1 -1
  188. package/dist/factories/cnpg/types.js.map +1 -1
  189. package/dist/factories/cnpg/utils/helm-values-mapper.d.ts +19 -2
  190. package/dist/factories/cnpg/utils/helm-values-mapper.d.ts.map +1 -1
  191. package/dist/factories/cnpg/utils/helm-values-mapper.js +22 -4
  192. package/dist/factories/cnpg/utils/helm-values-mapper.js.map +1 -1
  193. package/dist/factories/envoy-ai-gateway/compositions/gateway.d.ts.map +1 -1
  194. package/dist/factories/envoy-ai-gateway/compositions/gateway.js +16 -3
  195. package/dist/factories/envoy-ai-gateway/compositions/gateway.js.map +1 -1
  196. package/dist/factories/envoy-ai-gateway/constants.d.ts +5 -2
  197. package/dist/factories/envoy-ai-gateway/constants.d.ts.map +1 -1
  198. package/dist/factories/envoy-ai-gateway/constants.js +5 -2
  199. package/dist/factories/envoy-ai-gateway/constants.js.map +1 -1
  200. package/dist/factories/envoy-ai-gateway/resources/gateway.d.ts +12 -0
  201. package/dist/factories/envoy-ai-gateway/resources/gateway.d.ts.map +1 -1
  202. package/dist/factories/envoy-ai-gateway/resources/gateway.js +27 -104
  203. package/dist/factories/envoy-ai-gateway/resources/gateway.js.map +1 -1
  204. package/dist/factories/envoy-ai-gateway/types.d.ts +15 -47
  205. package/dist/factories/envoy-ai-gateway/types.d.ts.map +1 -1
  206. package/dist/factories/envoy-ai-gateway/types.js.map +1 -1
  207. package/dist/factories/gateway-api/constants.d.ts +27 -0
  208. package/dist/factories/gateway-api/constants.d.ts.map +1 -0
  209. package/dist/factories/gateway-api/constants.js +27 -0
  210. package/dist/factories/gateway-api/constants.js.map +1 -0
  211. package/dist/factories/gateway-api/index.d.ts +14 -0
  212. package/dist/factories/gateway-api/index.d.ts.map +1 -0
  213. package/dist/factories/gateway-api/index.js +14 -0
  214. package/dist/factories/gateway-api/index.js.map +1 -0
  215. package/dist/factories/gateway-api/readiness.d.ts +67 -0
  216. package/dist/factories/gateway-api/readiness.d.ts.map +1 -0
  217. package/dist/factories/gateway-api/readiness.js +213 -0
  218. package/dist/factories/gateway-api/readiness.js.map +1 -0
  219. package/dist/factories/gateway-api/resources/gateway.d.ts +91 -0
  220. package/dist/factories/gateway-api/resources/gateway.d.ts.map +1 -0
  221. package/dist/factories/gateway-api/resources/gateway.js +99 -0
  222. package/dist/factories/gateway-api/resources/gateway.js.map +1 -0
  223. package/dist/factories/gateway-api/resources/index.d.ts +2 -0
  224. package/dist/factories/gateway-api/resources/index.d.ts.map +1 -0
  225. package/dist/factories/gateway-api/resources/index.js +2 -0
  226. package/dist/factories/gateway-api/resources/index.js.map +1 -0
  227. package/dist/factories/gateway-api/types.d.ts +1269 -0
  228. package/dist/factories/gateway-api/types.d.ts.map +1 -0
  229. package/dist/factories/gateway-api/types.js +417 -0
  230. package/dist/factories/gateway-api/types.js.map +1 -0
  231. package/dist/factories/helm/readiness-evaluators.d.ts +21 -3
  232. package/dist/factories/helm/readiness-evaluators.d.ts.map +1 -1
  233. package/dist/factories/helm/readiness-evaluators.js +117 -11
  234. package/dist/factories/helm/readiness-evaluators.js.map +1 -1
  235. package/dist/factories/helm/types.d.ts +28 -0
  236. package/dist/factories/helm/types.d.ts.map +1 -1
  237. package/dist/factories/index.d.ts +2 -0
  238. package/dist/factories/index.d.ts.map +1 -1
  239. package/dist/factories/index.js +8 -0
  240. package/dist/factories/index.js.map +1 -1
  241. package/dist/factories/inngest/compositions/inngest-bootstrap.d.ts.map +1 -1
  242. package/dist/factories/inngest/compositions/inngest-bootstrap.js +10 -0
  243. package/dist/factories/inngest/compositions/inngest-bootstrap.js.map +1 -1
  244. package/dist/factories/kubernetes/admission/index.d.ts +2 -0
  245. package/dist/factories/kubernetes/admission/index.d.ts.map +1 -1
  246. package/dist/factories/kubernetes/admission/index.js +2 -0
  247. package/dist/factories/kubernetes/admission/index.js.map +1 -1
  248. package/dist/factories/kubernetes/admission/label-propagation-guard.d.ts +108 -0
  249. package/dist/factories/kubernetes/admission/label-propagation-guard.d.ts.map +1 -0
  250. package/dist/factories/kubernetes/admission/label-propagation-guard.js +247 -0
  251. package/dist/factories/kubernetes/admission/label-propagation-guard.js.map +1 -0
  252. package/dist/factories/kubernetes/admission/mutating-admission-policy.d.ts +286 -0
  253. package/dist/factories/kubernetes/admission/mutating-admission-policy.d.ts.map +1 -0
  254. package/dist/factories/kubernetes/admission/mutating-admission-policy.js +157 -0
  255. package/dist/factories/kubernetes/admission/mutating-admission-policy.js.map +1 -0
  256. package/dist/factories/opensearch/compositions/cluster.d.ts.map +1 -1
  257. package/dist/factories/opensearch/compositions/cluster.js +6 -1
  258. package/dist/factories/opensearch/compositions/cluster.js.map +1 -1
  259. package/dist/factories/ory/compositions/ory-identity-stack.d.ts +8 -8
  260. package/dist/factories/ory/types.d.ts +16 -16
  261. package/dist/factories/rook/compositions/object-storage-claim.d.ts +1 -1
  262. package/dist/factories/rook/compositions/rook-ceph-platform.js +8 -1
  263. package/dist/factories/rook/compositions/rook-ceph-platform.js.map +1 -1
  264. package/dist/factories/rook/types.d.ts +1 -1
  265. package/dist/factories/traefik/compositions/index.d.ts +6 -0
  266. package/dist/factories/traefik/compositions/index.d.ts.map +1 -0
  267. package/dist/factories/traefik/compositions/index.js +6 -0
  268. package/dist/factories/traefik/compositions/index.js.map +1 -0
  269. package/dist/factories/traefik/compositions/traefik-bootstrap.d.ts +185 -0
  270. package/dist/factories/traefik/compositions/traefik-bootstrap.d.ts.map +1 -0
  271. package/dist/factories/traefik/compositions/traefik-bootstrap.js +339 -0
  272. package/dist/factories/traefik/compositions/traefik-bootstrap.js.map +1 -0
  273. package/dist/factories/traefik/compositions/traefik-helm-repository.d.ts +16 -0
  274. package/dist/factories/traefik/compositions/traefik-helm-repository.d.ts.map +1 -0
  275. package/dist/factories/traefik/compositions/traefik-helm-repository.js +31 -0
  276. package/dist/factories/traefik/compositions/traefik-helm-repository.js.map +1 -0
  277. package/dist/factories/traefik/constants.d.ts +78 -0
  278. package/dist/factories/traefik/constants.d.ts.map +1 -0
  279. package/dist/factories/traefik/constants.js +104 -0
  280. package/dist/factories/traefik/constants.js.map +1 -0
  281. package/dist/factories/traefik/index.d.ts +25 -0
  282. package/dist/factories/traefik/index.d.ts.map +1 -0
  283. package/dist/factories/traefik/index.js +25 -0
  284. package/dist/factories/traefik/index.js.map +1 -0
  285. package/dist/factories/traefik/resources/common.d.ts +68 -0
  286. package/dist/factories/traefik/resources/common.d.ts.map +1 -0
  287. package/dist/factories/traefik/resources/common.js +59 -0
  288. package/dist/factories/traefik/resources/common.js.map +1 -0
  289. package/dist/factories/traefik/resources/gateway.d.ts +85 -0
  290. package/dist/factories/traefik/resources/gateway.d.ts.map +1 -0
  291. package/dist/factories/traefik/resources/gateway.js +109 -0
  292. package/dist/factories/traefik/resources/gateway.js.map +1 -0
  293. package/dist/factories/traefik/resources/helm.d.ts +56 -0
  294. package/dist/factories/traefik/resources/helm.d.ts.map +1 -0
  295. package/dist/factories/traefik/resources/helm.js +131 -0
  296. package/dist/factories/traefik/resources/helm.js.map +1 -0
  297. package/dist/factories/traefik/resources/index.d.ts +10 -0
  298. package/dist/factories/traefik/resources/index.d.ts.map +1 -0
  299. package/dist/factories/traefik/resources/index.js +10 -0
  300. package/dist/factories/traefik/resources/index.js.map +1 -0
  301. package/dist/factories/traefik/resources/middleware.d.ts +169 -0
  302. package/dist/factories/traefik/resources/middleware.d.ts.map +1 -0
  303. package/dist/factories/traefik/resources/middleware.js +225 -0
  304. package/dist/factories/traefik/resources/middleware.js.map +1 -0
  305. package/dist/factories/traefik/resources/routing.d.ts +113 -0
  306. package/dist/factories/traefik/resources/routing.d.ts.map +1 -0
  307. package/dist/factories/traefik/resources/routing.js +119 -0
  308. package/dist/factories/traefik/resources/routing.js.map +1 -0
  309. package/dist/factories/traefik/resources/tls.d.ts +85 -0
  310. package/dist/factories/traefik/resources/tls.d.ts.map +1 -0
  311. package/dist/factories/traefik/resources/tls.js +93 -0
  312. package/dist/factories/traefik/resources/tls.js.map +1 -0
  313. package/dist/factories/traefik/types.d.ts +2690 -0
  314. package/dist/factories/traefik/types.d.ts.map +1 -0
  315. package/dist/factories/traefik/types.js +1084 -0
  316. package/dist/factories/traefik/types.js.map +1 -0
  317. package/dist/factories/traefik/utils/helm-values-mapper.d.ts +198 -0
  318. package/dist/factories/traefik/utils/helm-values-mapper.d.ts.map +1 -0
  319. package/dist/factories/traefik/utils/helm-values-mapper.js +372 -0
  320. package/dist/factories/traefik/utils/helm-values-mapper.js.map +1 -0
  321. package/dist/factories/traefik/utils/index.d.ts +6 -0
  322. package/dist/factories/traefik/utils/index.d.ts.map +1 -0
  323. package/dist/factories/traefik/utils/index.js +6 -0
  324. package/dist/factories/traefik/utils/index.js.map +1 -0
  325. package/dist/factories/traefik/utils/middleware-validation.d.ts +42 -0
  326. package/dist/factories/traefik/utils/middleware-validation.d.ts.map +1 -0
  327. package/dist/factories/traefik/utils/middleware-validation.js +78 -0
  328. package/dist/factories/traefik/utils/middleware-validation.js.map +1 -0
  329. package/dist/factories/webapp/compositions/web-app-with-processing.d.ts.map +1 -1
  330. package/dist/factories/webapp/compositions/web-app-with-processing.js +10 -0
  331. package/dist/factories/webapp/compositions/web-app-with-processing.js.map +1 -1
  332. package/dist/index.d.ts +4 -3
  333. package/dist/index.d.ts.map +1 -1
  334. package/dist/index.js +3 -1
  335. package/dist/index.js.map +1 -1
  336. package/package.json +9 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/gateway-api/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAiBH,oEAAoE;AACpE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CACtC;AAED,+EAA+E;AAC/E,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACtD;AAED,gFAAgF;AAChF,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS;QAC5B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,EAAE,CAAC;IACJ,QAAQ,CAAC,UAAU,CAAC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0CAA0C,CAAC,KAAK,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MASvC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,MAAM,sBAAsB,GAAG,OAAO,4BAA4B,CAAC,KAAK,CAAC"}
@@ -0,0 +1,417 @@
1
+ /**
2
+ * Shared upstream Gateway API type definitions.
3
+ *
4
+ * Extracted from `src/factories/envoy-ai-gateway` (see #176) so that every
5
+ * Gateway API implementation in TypeKro — Envoy Gateway, Traefik v3, and any
6
+ * future controller — describes `GatewayClass`, `Gateway`, `HTTPRoute`,
7
+ * `GRPCRoute`, `ReferenceGrant` and `BackendTLSPolicy` with one set of types.
8
+ *
9
+ * Vendor-specific policy CRDs (`BackendTrafficPolicy`, `AIGatewayRoute`,
10
+ * Traefik `Middleware`, ...) deliberately stay in their own factory packages.
11
+ *
12
+ * **ArkType is the single source of truth for the SPEC types here.** Every
13
+ * `*Spec` / config type below is inferred from the schema next to it
14
+ * (`typeof XSchema.infer`), which is the repository's integration contract: one
15
+ * definition validates at runtime, generates KRO SimpleSchema, and types the
16
+ * factory. The shapes were verified field-by-field against the CRDs installed
17
+ * by the Gateway API v1.2.1 experimental channel, read back from a live API
18
+ * server with `kubectl get crd <name> -o jsonpath='{.spec.versions[*].schema.openAPIV3Schema}'`.
19
+ *
20
+ * STATUS types stay hand-written interfaces: they describe what a controller
21
+ * publishes, never user input, so there is nothing to validate or generate.
22
+ *
23
+ * Where a schema is narrower than the CRD it is deliberate and noted inline
24
+ * (for example `listeners[].protocol`, which the CRD types as a bare string).
25
+ */
26
+ import { type } from 'arktype';
27
+ /**
28
+ * A Gateway API port.
29
+ *
30
+ * Every `port` in the API — listener, `parentRef`, `backendRef`,
31
+ * `requestRedirect` — carries `minimum: 1` / `maximum: 65535` in the CRD, so
32
+ * the bound is declared once here rather than repeated (or dropped) per field.
33
+ */
34
+ const gatewayApiPort = '1 <= number.integer <= 65535';
35
+ // ============================================================================
36
+ // Shared schema shapes
37
+ //
38
+ // Extracted as `as const` shapes wherever a CRD repeats the same object at
39
+ // several paths, so the definitions cannot drift apart.
40
+ // ============================================================================
41
+ /** An object reference restricted to Secrets (and, historically, ConfigMaps). */
42
+ export const SecretObjectReferenceSchema = type({
43
+ 'group?': 'string',
44
+ 'kind?': 'string',
45
+ name: 'string',
46
+ 'namespace?': 'string',
47
+ });
48
+ /** `GatewayClass.spec.parametersRef` — an implementation-specific config object. */
49
+ const parametersRefShape = {
50
+ group: 'string',
51
+ kind: 'string',
52
+ name: 'string',
53
+ 'namespace?': 'string',
54
+ };
55
+ /** A `metav1.LabelSelector` as Gateway API embeds it under `allowedRoutes`. */
56
+ const labelSelectorShape = {
57
+ 'matchLabels?': 'Record<string, string>',
58
+ 'matchExpressions?': type({
59
+ key: 'string',
60
+ operator: 'string',
61
+ 'values?': 'string[]',
62
+ }).array(),
63
+ };
64
+ /** An `HTTPRoute`/`GRPCRoute` header (and query-param) match. */
65
+ const headerMatchShape = {
66
+ 'type?': '"Exact" | "RegularExpression"',
67
+ name: 'string',
68
+ value: 'string',
69
+ };
70
+ /** One `name`/`value` pair of a header-modifier filter. */
71
+ const headerValueShape = { name: 'string', value: 'string' };
72
+ /** `filters[].requestRedirect.path` / `filters[].urlRewrite.path`. */
73
+ const httpPathModifierShape = {
74
+ type: '"ReplaceFullPath" | "ReplacePrefixMatch"',
75
+ 'replaceFullPath?': 'string',
76
+ 'replacePrefixMatch?': 'string',
77
+ };
78
+ /** `sessionPersistence` — identical on `HTTPRoute` and `GRPCRoute` rules. */
79
+ const sessionPersistenceShape = {
80
+ 'sessionName?': 'string',
81
+ 'absoluteTimeout?': 'string',
82
+ 'idleTimeout?': 'string',
83
+ 'type?': '"Cookie" | "Header"',
84
+ 'cookieConfig?': {
85
+ 'lifetimeType?': '"Permanent" | "Session"',
86
+ },
87
+ };
88
+ /** A CA-certificate reference, which unlike a Secret ref requires group/kind. */
89
+ const caCertificateRefShape = {
90
+ group: 'string',
91
+ kind: 'string',
92
+ name: 'string',
93
+ };
94
+ // ============================================================================
95
+ // GatewayClass
96
+ // ============================================================================
97
+ /** `GatewayClass.spec`. */
98
+ export const GatewayClassSpecSchema = type({
99
+ controllerName: 'string',
100
+ 'description?': 'string',
101
+ 'parametersRef?': parametersRefShape,
102
+ });
103
+ // ============================================================================
104
+ // Gateway
105
+ // ============================================================================
106
+ /** Which namespaces a listener accepts routes from. */
107
+ export const AllowedRoutesSchema = type({
108
+ 'namespaces?': {
109
+ 'from?': '"All" | "Selector" | "Same"',
110
+ 'selector?': labelSelectorShape,
111
+ },
112
+ 'kinds?': type({
113
+ 'group?': 'string',
114
+ kind: 'string',
115
+ }).array(),
116
+ });
117
+ /** `Gateway.spec.listeners[].tls`. */
118
+ export const GatewayTLSConfigSchema = type({
119
+ 'mode?': '"Terminate" | "Passthrough"',
120
+ 'certificateRefs?': SecretObjectReferenceSchema.array(),
121
+ /** Client-certificate validation for a terminating listener. */
122
+ 'frontendValidation?': {
123
+ 'caCertificateRefs?': type({
124
+ ...caCertificateRefShape,
125
+ 'namespace?': 'string',
126
+ }).array(),
127
+ },
128
+ 'options?': 'Record<string, string>',
129
+ });
130
+ /**
131
+ * A single `Gateway.spec.listeners[]` entry.
132
+ *
133
+ * `protocol` is narrower than the CRD, which types it as a bare string: these
134
+ * five are the protocols the API defines, and an unknown protocol is rejected
135
+ * by every controller rather than doing something useful.
136
+ */
137
+ export const GatewayListenerSchema = type({
138
+ name: 'string',
139
+ protocol: '"HTTP" | "HTTPS" | "TLS" | "TCP" | "UDP"',
140
+ port: gatewayApiPort,
141
+ 'hostname?': 'string',
142
+ 'tls?': GatewayTLSConfigSchema,
143
+ 'allowedRoutes?': AllowedRoutesSchema,
144
+ });
145
+ /** A `Gateway.spec.addresses[]` entry. */
146
+ const gatewayAddressShape = {
147
+ 'type?': 'string',
148
+ value: 'string',
149
+ };
150
+ /** `Gateway.spec`. */
151
+ export const GatewaySpecSchema = type({
152
+ gatewayClassName: 'string',
153
+ listeners: GatewayListenerSchema.array(),
154
+ 'addresses?': type(gatewayAddressShape).array(),
155
+ 'infrastructure?': {
156
+ 'labels?': 'Record<string, string>',
157
+ 'annotations?': 'Record<string, string>',
158
+ 'parametersRef?': {
159
+ group: 'string',
160
+ kind: 'string',
161
+ name: 'string',
162
+ },
163
+ },
164
+ /** Default client certificate the Gateway presents to backends. */
165
+ 'backendTLS?': {
166
+ 'clientCertificateRef?': SecretObjectReferenceSchema,
167
+ },
168
+ });
169
+ // ============================================================================
170
+ // Routes
171
+ // ============================================================================
172
+ /**
173
+ * A route's reference to the Gateway (or listener) it attaches to.
174
+ *
175
+ * `kind` stays a plain string, matching the CRD: the mesh profile allows a
176
+ * `Service` parent, so pinning the literal `'Gateway'` would reject a valid
177
+ * upstream shape.
178
+ */
179
+ export const ParentReferenceSchema = type({
180
+ 'group?': 'string',
181
+ 'kind?': 'string',
182
+ name: 'string',
183
+ 'namespace?': 'string',
184
+ 'sectionName?': 'string',
185
+ 'port?': gatewayApiPort,
186
+ });
187
+ /** A backend a route rule forwards to. */
188
+ export const BackendRefSchema = type({
189
+ 'group?': 'string',
190
+ 'kind?': 'string',
191
+ name: 'string',
192
+ 'namespace?': 'string',
193
+ 'port?': gatewayApiPort,
194
+ /** Relative share of the rule's traffic. The CRD caps it at 1,000,000. */
195
+ 'weight?': '0 <= number.integer <= 1000000',
196
+ });
197
+ /**
198
+ * One `HTTPRoute.spec.rules[].matches[]` entry.
199
+ *
200
+ * `path.value` is optional exactly as the CRD has it — an omitted value means
201
+ * the `/` prefix — and `method` uses the CRD's enum rather than a bare string.
202
+ */
203
+ export const HTTPRouteMatchSchema = type({
204
+ 'path?': {
205
+ 'type?': '"Exact" | "PathPrefix" | "RegularExpression"',
206
+ 'value?': 'string',
207
+ },
208
+ 'headers?': type(headerMatchShape).array(),
209
+ 'queryParams?': type(headerMatchShape).array(),
210
+ 'method?': '"GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "CONNECT" | "OPTIONS" | "TRACE" | "PATCH"',
211
+ });
212
+ /** A header modification applied by an `HTTPRoute` filter. */
213
+ export const HTTPHeaderFilterSchema = type({
214
+ 'set?': type(headerValueShape).array(),
215
+ 'add?': type(headerValueShape).array(),
216
+ 'remove?': 'string[]',
217
+ });
218
+ /**
219
+ * One `HTTPRoute.spec.rules[].filters[]` entry.
220
+ *
221
+ * `extensionRef` is how an implementation attaches its own middleware — Traefik
222
+ * uses it to reference a `traefik.io/v1alpha1` `Middleware`.
223
+ */
224
+ export const HTTPRouteFilterSchema = type({
225
+ type: '"RequestHeaderModifier" | "ResponseHeaderModifier" | "RequestMirror" | "RequestRedirect" | "URLRewrite" | "ExtensionRef"',
226
+ 'requestHeaderModifier?': HTTPHeaderFilterSchema,
227
+ 'responseHeaderModifier?': HTTPHeaderFilterSchema,
228
+ 'requestRedirect?': {
229
+ 'scheme?': '"http" | "https"',
230
+ 'hostname?': 'string',
231
+ 'port?': gatewayApiPort,
232
+ 'statusCode?': '301 | 302',
233
+ 'path?': httpPathModifierShape,
234
+ },
235
+ 'urlRewrite?': {
236
+ 'hostname?': 'string',
237
+ 'path?': httpPathModifierShape,
238
+ },
239
+ 'requestMirror?': {
240
+ backendRef: BackendRefSchema,
241
+ /** Mirror only a share of the requests. `percent` and `fraction` are exclusive. */
242
+ 'percent?': '0 <= number.integer <= 100',
243
+ 'fraction?': {
244
+ numerator: 'number.integer >= 0',
245
+ /** Defaults to 100 in the CRD, which also requires it to be positive. */
246
+ 'denominator?': 'number.integer >= 1',
247
+ },
248
+ },
249
+ 'extensionRef?': {
250
+ group: 'string',
251
+ kind: 'string',
252
+ name: 'string',
253
+ },
254
+ });
255
+ /** A `backendRefs[]` entry, which may carry its own per-backend filters. */
256
+ const routeBackendRefSchema = BackendRefSchema.and({
257
+ 'filters?': HTTPRouteFilterSchema.array(),
258
+ });
259
+ /** One `HTTPRoute.spec.rules[]` entry. */
260
+ export const HTTPRouteRuleSchema = type({
261
+ 'name?': 'string',
262
+ 'matches?': HTTPRouteMatchSchema.array(),
263
+ 'filters?': HTTPRouteFilterSchema.array(),
264
+ 'backendRefs?': routeBackendRefSchema.array(),
265
+ 'timeouts?': {
266
+ 'request?': 'string',
267
+ 'backendRequest?': 'string',
268
+ },
269
+ 'retry?': {
270
+ /** Retriable response codes. The CRD admits 400-599. */
271
+ 'codes?': '(400 <= number.integer <= 599)[]',
272
+ /** Unbounded in the CRD, so unbounded here. */
273
+ 'attempts?': 'number.integer',
274
+ 'backoff?': 'string',
275
+ },
276
+ 'sessionPersistence?': sessionPersistenceShape,
277
+ });
278
+ /**
279
+ * `HTTPRoute.spec`.
280
+ *
281
+ * `parentRefs` is required here although the CRD allows it to be absent: a
282
+ * route attached to nothing serves no traffic, and TypeKro would have no
283
+ * resource to order it against.
284
+ */
285
+ export const HTTPRouteSpecSchema = type({
286
+ parentRefs: ParentReferenceSchema.array(),
287
+ 'hostnames?': 'string[]',
288
+ 'rules?': HTTPRouteRuleSchema.array(),
289
+ });
290
+ /** One `GRPCRoute.spec.rules[].matches[]` entry. */
291
+ export const GRPCRouteMatchSchema = type({
292
+ 'method?': {
293
+ 'type?': '"Exact" | "RegularExpression"',
294
+ 'service?': 'string',
295
+ 'method?': 'string',
296
+ },
297
+ 'headers?': type(headerMatchShape).array(),
298
+ });
299
+ /**
300
+ * One `GRPCRoute.spec.rules[]` entry.
301
+ *
302
+ * The CRD accepts only the four filter types that make sense for gRPC
303
+ * (`RequestHeaderModifier`, `ResponseHeaderModifier`, `RequestMirror`,
304
+ * `ExtensionRef`) but reuses the HTTP filter shape, which is what
305
+ * {@link HTTPRouteFilterSchema} models.
306
+ */
307
+ export const GRPCRouteRuleSchema = type({
308
+ 'name?': 'string',
309
+ 'matches?': GRPCRouteMatchSchema.array(),
310
+ 'filters?': HTTPRouteFilterSchema.array(),
311
+ 'backendRefs?': routeBackendRefSchema.array(),
312
+ 'sessionPersistence?': sessionPersistenceShape,
313
+ });
314
+ /** `GRPCRoute.spec`. */
315
+ export const GRPCRouteSpecSchema = type({
316
+ parentRefs: ParentReferenceSchema.array(),
317
+ 'hostnames?': 'string[]',
318
+ 'rules?': GRPCRouteRuleSchema.array(),
319
+ });
320
+ // ============================================================================
321
+ // ReferenceGrant / BackendTLSPolicy
322
+ // ============================================================================
323
+ /**
324
+ * `ReferenceGrant.spec` — the opt-in a namespace publishes so resources in
325
+ * `from` namespaces may reference the listed `to` resources in this namespace.
326
+ */
327
+ export const ReferenceGrantSpecSchema = type({
328
+ from: type({
329
+ group: 'string',
330
+ kind: 'string',
331
+ namespace: 'string',
332
+ }).array(),
333
+ to: type({
334
+ group: 'string',
335
+ kind: 'string',
336
+ 'name?': 'string',
337
+ }).array(),
338
+ });
339
+ /**
340
+ * `BackendTLSPolicy.spec`.
341
+ *
342
+ * Kept general on purpose: Envoy Gateway targets its own `Backend` kind while
343
+ * other controllers target `Service`, so `targetRefs[].group`/`kind` are plain
344
+ * strings rather than one vendor's literals.
345
+ */
346
+ export const BackendTLSPolicySpecSchema = type({
347
+ targetRefs: type({
348
+ group: 'string',
349
+ kind: 'string',
350
+ name: 'string',
351
+ 'sectionName?': 'string',
352
+ }).array(),
353
+ validation: {
354
+ hostname: 'string',
355
+ 'wellKnownCACertificates?': '"System"',
356
+ 'caCertificateRefs?': type(caCertificateRefShape).array(),
357
+ 'subjectAltNames?': type({
358
+ type: '"Hostname" | "URI"',
359
+ 'hostname?': 'string',
360
+ 'uri?': 'string',
361
+ }).array(),
362
+ },
363
+ 'options?': 'Record<string, string>',
364
+ });
365
+ // ============================================================================
366
+ // Resource configuration
367
+ //
368
+ // The identity half of every Gateway API factory's config. `spec` is the only
369
+ // part that varies by kind, so it stays a type parameter (see
370
+ // `resources/gateway.ts`) while everything a caller types by hand is declared
371
+ // once, here, and inferred from.
372
+ // ============================================================================
373
+ const kubernetesName = type(/^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/).and('string <= 253');
374
+ const kubernetesDnsLabel = type(/^[a-z0-9](?:[-a-z0-9]*[a-z0-9])?$/).and('string <= 63');
375
+ /**
376
+ * Identity fields every Gateway API resource factory accepts.
377
+ *
378
+ * These schemas are the source of truth for the TYPES and the target of the
379
+ * schema tests; the factories do not run them over their input, because inside
380
+ * a composition `name` may be a `KubernetesRef` proxy rather than a string and
381
+ * every constraint here would reject it.
382
+ */
383
+ export const gatewayApiClusterResourceMetadataShape = {
384
+ name: kubernetesName,
385
+ /** Extra labels merged onto `metadata.labels`. */
386
+ 'labels?': 'Record<string, string>',
387
+ /** Extra annotations merged onto `metadata.annotations`. */
388
+ 'annotations?': 'Record<string, string>',
389
+ /** Resource graph id. Required when `name` is a schema reference. */
390
+ 'id?': 'string > 0',
391
+ };
392
+ /** Identity fields every namespaced Gateway API resource factory accepts. */
393
+ export const gatewayApiNamespacedResourceMetadataShape = {
394
+ ...gatewayApiClusterResourceMetadataShape,
395
+ namespace: kubernetesDnsLabel,
396
+ };
397
+ /** Identity of a cluster-scoped Gateway API resource, without its spec. */
398
+ export const GatewayApiClusterResourceMetadataSchema = type(gatewayApiClusterResourceMetadataShape);
399
+ /** Identity of a namespaced Gateway API resource, without its spec. */
400
+ export const GatewayApiNamespacedResourceMetadataSchema = type(gatewayApiNamespacedResourceMetadataShape);
401
+ /**
402
+ * Configuration for `backendTLSPolicy`.
403
+ *
404
+ * Fully inferred rather than generic: a `BackendTLSPolicy` has exactly one
405
+ * spec shape, so there is nothing for a type parameter to vary.
406
+ */
407
+ export const BackendTLSPolicyConfigSchema = type({
408
+ ...gatewayApiNamespacedResourceMetadataShape,
409
+ /**
410
+ * The `GatewayClass.spec.controllerName` whose ancestor conditions decide
411
+ * readiness. A cluster can run several Gateway API controllers, and each one
412
+ * publishes its own ancestor entry.
413
+ */
414
+ controllerName: 'string > 0',
415
+ spec: BackendTLSPolicySpecSchema,
416
+ });
417
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/factories/gateway-api/types.ts"],"names":[],"m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E;AAC/E,yBAAyB;AACzB,EAAE;AACF,8EAA8E;AAC9E,8DAA8D;AAC9D,8EAA8E;AAC9E,iCAAiC;AACjC,+EAA+E;AAE/E,MAAM,cAAc,GAAG,IAAI,CAAC,mCAAmC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;AACtF,MAAM,kBAAkB,GAAG,IAAI,CAAC,mCAAmC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;AAEzF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG;IACpD,IAAI,EAAE,cAAc;IACpB,kDAAkD;IAClD,SAAS,EAAE,wBAAwB;IACnC,4DAA4D;IAC5D,cAAc,EAAE,wBAAwB;IACxC,qEAAqE;IACrE,KAAK,EAAE,YAAY;CACX,CAAC;AAEX,6EAA6E;AAC7E,MAAM,CAAC,MAAM,yCAAyC,GAAG;IACvD,GAAG,sCAAsC;IACzC,SAAS,EAAE,kBAAkB;CACrB,CAAC;AAEX,2EAA2E;AAC3E,MAAM,CAAC,MAAM,uCAAuC,GAAG,IAAI,CAAC,sCAAsC,CAAC,CAAC;AAMpG,uEAAuE;AACvE,MAAM,CAAC,MAAM,0CAA0C,GAAG,IAAI,CAC5D,yCAAyC,CAC1C,CAAC;AAMF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;IAC/C,GAAG,yCAAyC;IAC5C;;;;OAIG;IACH,cAAc,EAAE,YAAY;IAC5B,IAAI,EAAE,0BAA0B;CACjC,CAAC,CAAC"}
@@ -8,9 +8,27 @@ import type { ReadinessEvaluator } from '../../core/types/index.js';
8
8
  /**
9
9
  * Create a readiness evaluator for HelmRelease resources.
10
10
  *
11
- * Checks multiple readiness criteria in priority order: status phase,
12
- * Flux CD conditions array, and installation/upgrade progress. Wraps
13
- * the evaluation in a try/catch for resilience.
11
+ * READINESS CONTRACT (tightened by issue #191). A HelmRelease is ready only
12
+ * when ALL of the following hold, checked in this order:
13
+ *
14
+ * 1. `status` exists at all (Flux adds it a beat after creation).
15
+ * 2. Every generation-bearing observation Flux publishes — the top-level
16
+ * `status.observedGeneration` and the `Ready`/`Released` conditions' own —
17
+ * is EXACTLY `metadata.generation`. Readiness evidence from a neighbouring
18
+ * generation describes a different spec.
19
+ * 3. `Reconciling` is not `True`. Flux holds that condition for the whole
20
+ * install/upgrade, so a `Ready=True` beside it belongs to the PREVIOUS
21
+ * release — the state that made `waitForReady` on a Helm-backed bootstrap
22
+ * return before the chart's workloads existed.
23
+ * 4. `Stalled` is not `True` (a stalled release does not retry itself).
24
+ * 5. The revision Flux last ATTEMPTED (`status.lastAttemptedRevision`) is the
25
+ * revision actually released (`status.history[0].chartVersion`, or the
26
+ * beta-shape `status.lastAppliedRevision`). A failed upgrade that
27
+ * remediates leaves the older chart deployed with a `Ready=True` that must
28
+ * not read as success.
29
+ * 6. A present `Released` condition is `True`.
30
+ * 7. Then, and only then, the legacy `status.phase` and the Flux v2 `Ready`
31
+ * condition decide readiness.
14
32
  *
15
33
  * @param label - Optional label prefix for log messages (e.g., `'Cert-Manager'`).
16
34
  * Defaults to no prefix (`'HelmRelease'`).
@@ -1 +1 @@
1
- {"version":3,"file":"readiness-evaluators.d.ts","sourceRoot":"","sources":["../../../src/factories/helm/readiness-evaluators.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,OAAO,KAAK,EAEV,kBAAkB,EAEnB,MAAM,2BAA2B,CAAC;AAuBnC;;;;;;;;;;;;GAYG;AAEH,wBAAgB,iCAAiC,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC,CA6H7F;AAED;;;;GAIG;AAEH,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,OAAO,CACjC,CAAC;AAEtC;;;;;;;GAOG;AAEH,wBAAgB,oCAAoC,CAClD,gBAAgB,EAAE,MAAM,GACvB,kBAAkB,CAAC,OAAO,CAAC,CA2C7B;AAED;;;;;;;GAOG;AACH,wB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AAC,EAAE,OAAO,CAAC;IAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3F,kBAAkB,CAAC,OAAO,CAAC,CA0D7B"}
@@ -10,13 +10,61 @@ import { optionalReadinessString, readinessConfiguration, readinessLiteral, requ
10
10
  const HELM_RELEASE_STRATEGY = 'typekro.readiness.flux.helm-release';
11
11
  const HELM_RELEASE_REVISION_STRATEGY = 'typekro.readiness.flux.helm-release-revision';
12
12
  const HELM_RELEASE_TEST_STRATEGY = 'typekro.readiness.flux.helm-release-test';
13
- const HELM_READINESS_REVISION = '1';
13
+ /**
14
+ * Bumped to '2' with the #191 tightening (Reconciling/Stalled gating, exact
15
+ * generation observation, released-revision currency). The revision is part of
16
+ * the portable strategy identity, so a graph serialized by an older TypeKro
17
+ * cannot silently rehydrate the looser evaluator.
18
+ */
19
+ const HELM_READINESS_REVISION = '2';
20
+ /** Flux condition types this evaluator gates on, beyond `Ready`. */
21
+ const RECONCILING_CONDITION = 'Reconciling';
22
+ const STALLED_CONDITION = 'Stalled';
23
+ const RELEASED_CONDITION = 'Released';
24
+ function findCondition(conditions, type) {
25
+ return conditions?.find((condition) => condition.type === type);
26
+ }
27
+ /**
28
+ * The chart revision Flux has actually RELEASED, across both v2 status shapes.
29
+ *
30
+ * Flux v2 GA keeps a `history` snapshot stack (newest first); the beta shape
31
+ * exposed a single `lastAppliedRevision`. Either is compared against
32
+ * `lastAttemptedRevision` to tell "the attempt succeeded" from "the attempt
33
+ * failed and an older release is still what is installed".
34
+ */
35
+ function releasedRevision(status) {
36
+ const fromHistory = status.history?.[0]?.chartVersion;
37
+ if (typeof fromHistory === 'string' && fromHistory !== '')
38
+ return fromHistory;
39
+ const applied = status.lastAppliedRevision;
40
+ if (typeof applied === 'string' && applied !== '')
41
+ return applied;
42
+ return undefined;
43
+ }
14
44
  /**
15
45
  * Create a readiness evaluator for HelmRelease resources.
16
46
  *
17
- * Checks multiple readiness criteria in priority order: status phase,
18
- * Flux CD conditions array, and installation/upgrade progress. Wraps
19
- * the evaluation in a try/catch for resilience.
47
+ * READINESS CONTRACT (tightened by issue #191). A HelmRelease is ready only
48
+ * when ALL of the following hold, checked in this order:
49
+ *
50
+ * 1. `status` exists at all (Flux adds it a beat after creation).
51
+ * 2. Every generation-bearing observation Flux publishes — the top-level
52
+ * `status.observedGeneration` and the `Ready`/`Released` conditions' own —
53
+ * is EXACTLY `metadata.generation`. Readiness evidence from a neighbouring
54
+ * generation describes a different spec.
55
+ * 3. `Reconciling` is not `True`. Flux holds that condition for the whole
56
+ * install/upgrade, so a `Ready=True` beside it belongs to the PREVIOUS
57
+ * release — the state that made `waitForReady` on a Helm-backed bootstrap
58
+ * return before the chart's workloads existed.
59
+ * 4. `Stalled` is not `True` (a stalled release does not retry itself).
60
+ * 5. The revision Flux last ATTEMPTED (`status.lastAttemptedRevision`) is the
61
+ * revision actually released (`status.history[0].chartVersion`, or the
62
+ * beta-shape `status.lastAppliedRevision`). A failed upgrade that
63
+ * remediates leaves the older chart deployed with a `Ready=True` that must
64
+ * not read as success.
65
+ * 6. A present `Released` condition is `True`.
66
+ * 7. Then, and only then, the legacy `status.phase` and the Flux v2 `Ready`
67
+ * condition decide readiness.
20
68
  *
21
69
  * @param label - Optional label prefix for log messages (e.g., `'Cert-Manager'`).
22
70
  * Defaults to no prefix (`'HelmRelease'`).
@@ -43,20 +91,24 @@ export function createLabeledHelmReleaseEvaluator(label) {
43
91
  // An apply can advance metadata.generation before Flux has observed the
44
92
  // new spec. Never reuse readiness evidence from the preceding
45
93
  // generation: doing so makes a direct factory update return while Flux
46
- // is still reconciling the replacement values. Prefer the top-level
47
- // observedGeneration and also honor generation-aware Ready conditions
48
- // when the controller supplies them.
94
+ // is still reconciling the replacement values. Every generation-bearing
95
+ // observation Flux publishes the top-level `observedGeneration` and
96
+ // the `Ready`/`Released` conditions' own — must be EXACTLY the desired
97
+ // generation (#191): a lagging one is stale evidence, and an
98
+ // unexpectedly leading one is not evidence about this spec at all.
49
99
  const desiredGeneration = live.metadata?.generation;
50
- const readyCondition = status.conditions?.find((condition) => condition.type === 'Ready');
100
+ const readyCondition = findCondition(status.conditions, 'Ready');
101
+ const releasedCondition = findCondition(status.conditions, RELEASED_CONDITION);
51
102
  const observedGenerations = [
52
103
  status.observedGeneration,
53
104
  readyCondition?.observedGeneration,
105
+ releasedCondition?.observedGeneration,
54
106
  ].filter((generation) => typeof generation === 'number');
55
- const staleGenerations = typeof desiredGeneration === 'number'
56
- ? observedGenerations.filter((generation) => generation < desiredGeneration)
107
+ const mismatchedGenerations = typeof desiredGeneration === 'number'
108
+ ? observedGenerations.filter((generation) => generation !== desiredGeneration)
57
109
  : [];
58
110
  if (typeof desiredGeneration === 'number' &&
59
- (observedGenerations.length === 0 || staleGenerations.length > 0)) {
111
+ (observedGenerations.length === 0 || mismatchedGenerations.length > 0)) {
60
112
  return {
61
113
  ready: false,
62
114
  reason: 'GenerationNotObserved',
@@ -69,6 +121,60 @@ export function createLabeledHelmReleaseEvaluator(label) {
69
121
  },
70
122
  };
71
123
  }
124
+ // #191: Flux keeps `Reconciling=True` for the WHOLE duration of an
125
+ // install/upgrade and removes it when the release settles. A `Ready`
126
+ // condition (or a legacy `phase`) that co-exists with it describes the
127
+ // PREVIOUS release, so an in-flight reconcile is never ready — this is
128
+ // the state that let `waitForReady` return ~90s before the ClickHouse
129
+ // operator's chart had actually installed.
130
+ const reconciling = findCondition(status.conditions, RECONCILING_CONDITION);
131
+ if (reconciling?.status === 'True') {
132
+ return {
133
+ ready: false,
134
+ reason: 'Reconciling',
135
+ message: reconciling.message ??
136
+ `${prefix}HelmRelease is still reconciling (Reconciling=True), so any Ready ` +
137
+ `condition describes the preceding release`,
138
+ };
139
+ }
140
+ // A stalled release will not retry on its own; surface it as a failure
141
+ // rather than letting the caller wait out its timeout.
142
+ const stalled = findCondition(status.conditions, STALLED_CONDITION);
143
+ if (stalled?.status === 'True') {
144
+ return {
145
+ ready: false,
146
+ reason: stalled.reason ?? 'Stalled',
147
+ message: stalled.message ?? `${prefix}HelmRelease is stalled and will not retry`,
148
+ };
149
+ }
150
+ // #191: the release Flux last ATTEMPTED must be the release that is
151
+ // actually installed. A failed upgrade that remediates leaves the older
152
+ // chart deployed (`history[0].chartVersion`) while
153
+ // `lastAttemptedRevision` names the version that failed — the exact
154
+ // shape where a lingering `Ready=True` would otherwise read as success.
155
+ const attemptedRevision = status.lastAttemptedRevision;
156
+ const currentRevision = releasedRevision(status);
157
+ if (typeof attemptedRevision === 'string' &&
158
+ attemptedRevision !== '' &&
159
+ currentRevision !== undefined &&
160
+ attemptedRevision !== currentRevision) {
161
+ return {
162
+ ready: false,
163
+ reason: 'RevisionNotReleased',
164
+ message: `${prefix}HelmRelease last attempted revision ${attemptedRevision} but the ` +
165
+ `released revision is still ${currentRevision}`,
166
+ details: { attemptedRevision, releasedRevision: currentRevision },
167
+ };
168
+ }
169
+ // A `Released` condition that is present and not True means the chart
170
+ // was not handed to Helm successfully, whatever `Ready` says.
171
+ if (releasedCondition !== undefined && releasedCondition.status !== 'True') {
172
+ return {
173
+ ready: false,
174
+ reason: releasedCondition.reason ?? 'NotReleased',
175
+ message: releasedCondition.message ?? `${prefix}HelmRelease has not released its chart yet`,
176
+ };
177
+ }
72
178
  // Case 2: Check the phase of the HelmRelease (primary readiness indicator)
73
179
  if (status.phase === 'Ready') {
74
180
  return {