typekro 0.3.1 → 0.4.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 (435) hide show
  1. package/README.md +142 -1054
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/alchemy/deployers.d.ts +0 -5
  4. package/dist/alchemy/deployers.d.ts.map +1 -1
  5. package/dist/alchemy/deployers.js +25 -72
  6. package/dist/alchemy/deployers.js.map +1 -1
  7. package/dist/core/composition/imperative.d.ts +2 -2
  8. package/dist/core/composition/imperative.d.ts.map +1 -1
  9. package/dist/core/composition/imperative.js +394 -10
  10. package/dist/core/composition/imperative.js.map +1 -1
  11. package/dist/core/composition/typekro-runtime/typekro-runtime.d.ts +1 -9
  12. package/dist/core/composition/typekro-runtime/typekro-runtime.d.ts.map +1 -1
  13. package/dist/core/composition/typekro-runtime/typekro-runtime.js +76 -10
  14. package/dist/core/composition/typekro-runtime/typekro-runtime.js.map +1 -1
  15. package/dist/core/composition/typekro-runtime/types.d.ts +8 -5
  16. package/dist/core/composition/typekro-runtime/types.d.ts.map +1 -1
  17. package/dist/core/composition/typekro-runtime/types.js.map +1 -1
  18. package/dist/core/constants/brands.d.ts +20 -0
  19. package/dist/core/constants/brands.d.ts.map +1 -1
  20. package/dist/core/constants/brands.js +20 -0
  21. package/dist/core/constants/brands.js.map +1 -1
  22. package/dist/core/deployment/direct-factory.d.ts +36 -1
  23. package/dist/core/deployment/direct-factory.d.ts.map +1 -1
  24. package/dist/core/deployment/direct-factory.js +289 -4
  25. package/dist/core/deployment/direct-factory.js.map +1 -1
  26. package/dist/core/deployment/engine.d.ts +44 -2
  27. package/dist/core/deployment/engine.d.ts.map +1 -1
  28. package/dist/core/deployment/engine.js +645 -63
  29. package/dist/core/deployment/engine.js.map +1 -1
  30. package/dist/core/deployment/event-filter.d.ts.map +1 -1
  31. package/dist/core/deployment/event-filter.js +6 -7
  32. package/dist/core/deployment/event-filter.js.map +1 -1
  33. package/dist/core/deployment/event-monitor.d.ts +36 -2
  34. package/dist/core/deployment/event-monitor.d.ts.map +1 -1
  35. package/dist/core/deployment/event-monitor.js +183 -33
  36. package/dist/core/deployment/event-monitor.js.map +1 -1
  37. package/dist/core/deployment/kro-factory.d.ts +22 -0
  38. package/dist/core/deployment/kro-factory.d.ts.map +1 -1
  39. package/dist/core/deployment/kro-factory.js +291 -27
  40. package/dist/core/deployment/kro-factory.js.map +1 -1
  41. package/dist/core/deployment/readiness.d.ts.map +1 -1
  42. package/dist/core/deployment/readiness.js +4 -2
  43. package/dist/core/deployment/readiness.js.map +1 -1
  44. package/dist/core/deployment/rollback-manager.d.ts +2 -1
  45. package/dist/core/deployment/rollback-manager.d.ts.map +1 -1
  46. package/dist/core/deployment/rollback-manager.js +5 -2
  47. package/dist/core/deployment/rollback-manager.js.map +1 -1
  48. package/dist/core/deployment/shared-utilities.js.map +1 -1
  49. package/dist/core/deployment/status-hydrator.d.ts +1 -1
  50. package/dist/core/deployment/status-hydrator.d.ts.map +1 -1
  51. package/dist/core/deployment/status-hydrator.js +8 -5
  52. package/dist/core/deployment/status-hydrator.js.map +1 -1
  53. package/dist/core/deployment/strategies/base-strategy.d.ts.map +1 -1
  54. package/dist/core/deployment/strategies/base-strategy.js +60 -21
  55. package/dist/core/deployment/strategies/base-strategy.js.map +1 -1
  56. package/dist/core/deployment/strategies/direct-strategy.d.ts +7 -0
  57. package/dist/core/deployment/strategies/direct-strategy.d.ts.map +1 -1
  58. package/dist/core/deployment/strategies/direct-strategy.js +50 -0
  59. package/dist/core/deployment/strategies/direct-strategy.js.map +1 -1
  60. package/dist/core/deployment/strategies/kro-strategy.d.ts +5 -0
  61. package/dist/core/deployment/strategies/kro-strategy.d.ts.map +1 -1
  62. package/dist/core/deployment/strategies/kro-strategy.js +53 -4
  63. package/dist/core/deployment/strategies/kro-strategy.js.map +1 -1
  64. package/dist/core/expressions/analyzer.d.ts +6 -6
  65. package/dist/core/expressions/analyzer.d.ts.map +1 -1
  66. package/dist/core/expressions/analyzer.js +40 -75
  67. package/dist/core/expressions/analyzer.js.map +1 -1
  68. package/dist/core/expressions/cel-conversion-engine.d.ts.map +1 -1
  69. package/dist/core/expressions/cel-conversion-engine.js +10 -11
  70. package/dist/core/expressions/cel-conversion-engine.js.map +1 -1
  71. package/dist/core/expressions/composition-integration.d.ts +2 -2
  72. package/dist/core/expressions/composition-integration.d.ts.map +1 -1
  73. package/dist/core/expressions/composition-integration.js +20 -12
  74. package/dist/core/expressions/composition-integration.js.map +1 -1
  75. package/dist/core/expressions/field-hydration-processor.d.ts +4 -1
  76. package/dist/core/expressions/field-hydration-processor.d.ts.map +1 -1
  77. package/dist/core/expressions/field-hydration-processor.js +12 -13
  78. package/dist/core/expressions/field-hydration-processor.js.map +1 -1
  79. package/dist/core/expressions/imperative-analyzer.d.ts.map +1 -1
  80. package/dist/core/expressions/imperative-analyzer.js +54 -24
  81. package/dist/core/expressions/imperative-analyzer.js.map +1 -1
  82. package/dist/core/expressions/index.d.ts +2 -0
  83. package/dist/core/expressions/index.d.ts.map +1 -1
  84. package/dist/core/expressions/index.js +2 -0
  85. package/dist/core/expressions/index.js.map +1 -1
  86. package/dist/core/expressions/magic-proxy-analyzer.d.ts +1 -1
  87. package/dist/core/expressions/magic-proxy-analyzer.d.ts.map +1 -1
  88. package/dist/core/expressions/magic-proxy-analyzer.js +8 -7
  89. package/dist/core/expressions/magic-proxy-analyzer.js.map +1 -1
  90. package/dist/core/expressions/parser.d.ts +163 -0
  91. package/dist/core/expressions/parser.d.ts.map +1 -0
  92. package/dist/core/expressions/parser.js +272 -0
  93. package/dist/core/expressions/parser.js.map +1 -0
  94. package/dist/core/kubernetes/api.d.ts.map +1 -1
  95. package/dist/core/kubernetes/api.js +5 -6
  96. package/dist/core/kubernetes/api.js.map +1 -1
  97. package/dist/core/kubernetes/bun-api-client.d.ts +95 -0
  98. package/dist/core/kubernetes/bun-api-client.d.ts.map +1 -0
  99. package/dist/core/kubernetes/bun-api-client.js +160 -0
  100. package/dist/core/kubernetes/bun-api-client.js.map +1 -0
  101. package/dist/core/kubernetes/bun-http-library.d.ts +38 -0
  102. package/dist/core/kubernetes/bun-http-library.d.ts.map +1 -0
  103. package/dist/core/kubernetes/bun-http-library.js +133 -0
  104. package/dist/core/kubernetes/bun-http-library.js.map +1 -0
  105. package/dist/core/kubernetes/client-provider.d.ts +3 -0
  106. package/dist/core/kubernetes/client-provider.d.ts.map +1 -1
  107. package/dist/core/kubernetes/client-provider.js +32 -23
  108. package/dist/core/kubernetes/client-provider.js.map +1 -1
  109. package/dist/core/kubernetes/errors.d.ts +189 -0
  110. package/dist/core/kubernetes/errors.d.ts.map +1 -0
  111. package/dist/core/kubernetes/errors.js +298 -0
  112. package/dist/core/kubernetes/errors.js.map +1 -0
  113. package/dist/core/kubernetes/index.d.ts +19 -0
  114. package/dist/core/kubernetes/index.d.ts.map +1 -0
  115. package/dist/core/kubernetes/index.js +23 -0
  116. package/dist/core/kubernetes/index.js.map +1 -0
  117. package/dist/core/kubernetes/type-guards.d.ts +142 -0
  118. package/dist/core/kubernetes/type-guards.d.ts.map +1 -0
  119. package/dist/core/kubernetes/type-guards.js +151 -0
  120. package/dist/core/kubernetes/type-guards.js.map +1 -0
  121. package/dist/core/logging/logger.d.ts.map +1 -1
  122. package/dist/core/logging/logger.js +8 -0
  123. package/dist/core/logging/logger.js.map +1 -1
  124. package/dist/core/readiness/cluster-state.d.ts.map +1 -1
  125. package/dist/core/readiness/cluster-state.js +6 -4
  126. package/dist/core/readiness/cluster-state.js.map +1 -1
  127. package/dist/core/references/cel-evaluator.d.ts.map +1 -1
  128. package/dist/core/references/cel-evaluator.js +12 -2
  129. package/dist/core/references/cel-evaluator.js.map +1 -1
  130. package/dist/core/references/cel.js +1 -1
  131. package/dist/core/references/cel.js.map +1 -1
  132. package/dist/core/references/resolver.d.ts +28 -1
  133. package/dist/core/references/resolver.d.ts.map +1 -1
  134. package/dist/core/references/resolver.js +325 -11
  135. package/dist/core/references/resolver.js.map +1 -1
  136. package/dist/core/references/schema-proxy.d.ts.map +1 -1
  137. package/dist/core/references/schema-proxy.js +14 -5
  138. package/dist/core/references/schema-proxy.js.map +1 -1
  139. package/dist/core/scope/resolver.d.ts +16 -0
  140. package/dist/core/scope/resolver.d.ts.map +1 -0
  141. package/dist/core/scope/resolver.js +45 -0
  142. package/dist/core/scope/resolver.js.map +1 -0
  143. package/dist/core/serialization/core.d.ts +1 -1
  144. package/dist/core/serialization/core.d.ts.map +1 -1
  145. package/dist/core/serialization/core.js +78 -54
  146. package/dist/core/serialization/core.js.map +1 -1
  147. package/dist/core/types/common.d.ts +23 -1
  148. package/dist/core/types/common.d.ts.map +1 -1
  149. package/dist/core/types/deployment.d.ts +68 -1
  150. package/dist/core/types/deployment.d.ts.map +1 -1
  151. package/dist/core/types/deployment.js +17 -0
  152. package/dist/core/types/deployment.js.map +1 -1
  153. package/dist/core/types/factory-scope.d.ts +42 -0
  154. package/dist/core/types/factory-scope.d.ts.map +1 -0
  155. package/dist/core/types/factory-scope.js +14 -0
  156. package/dist/core/types/factory-scope.js.map +1 -0
  157. package/dist/core/types/kubernetes.d.ts +146 -4
  158. package/dist/core/types/kubernetes.d.ts.map +1 -1
  159. package/dist/core/types/references.d.ts +47 -3
  160. package/dist/core/types/references.d.ts.map +1 -1
  161. package/dist/core/types/references.js.map +1 -1
  162. package/dist/core/types/serialization.d.ts +17 -6
  163. package/dist/core/types/serialization.d.ts.map +1 -1
  164. package/dist/core/utils/crd-patcher.d.ts +30 -0
  165. package/dist/core/utils/crd-patcher.d.ts.map +1 -0
  166. package/dist/core/utils/crd-patcher.js +198 -0
  167. package/dist/core/utils/crd-patcher.js.map +1 -0
  168. package/dist/core/utils/crd-schema-fix.d.ts +108 -0
  169. package/dist/core/utils/crd-schema-fix.d.ts.map +1 -0
  170. package/dist/core/utils/crd-schema-fix.js +245 -0
  171. package/dist/core/utils/crd-schema-fix.js.map +1 -0
  172. package/dist/core/utils/index.d.ts +12 -0
  173. package/dist/core/utils/index.d.ts.map +1 -0
  174. package/dist/core/utils/index.js +12 -0
  175. package/dist/core/utils/index.js.map +1 -0
  176. package/dist/core/utils/minimal-connection-reset-suppression.d.ts +16 -0
  177. package/dist/core/utils/minimal-connection-reset-suppression.d.ts.map +1 -0
  178. package/dist/core/utils/minimal-connection-reset-suppression.js +72 -0
  179. package/dist/core/utils/minimal-connection-reset-suppression.js.map +1 -0
  180. package/dist/core/utils/output-filter.d.ts +16 -0
  181. package/dist/core/utils/output-filter.d.ts.map +1 -0
  182. package/dist/core/utils/output-filter.js +90 -0
  183. package/dist/core/utils/output-filter.js.map +1 -0
  184. package/dist/core/utils/scoped-error-suppression.d.ts +25 -0
  185. package/dist/core/utils/scoped-error-suppression.d.ts.map +1 -0
  186. package/dist/core/utils/scoped-error-suppression.js +226 -0
  187. package/dist/core/utils/scoped-error-suppression.js.map +1 -0
  188. package/dist/core/validation/cel-validator.d.ts.map +1 -1
  189. package/dist/core/validation/cel-validator.js +52 -12
  190. package/dist/core/validation/cel-validator.js.map +1 -1
  191. package/dist/factories/apisix/compositions/apisix-bootstrap.d.ts +38 -0
  192. package/dist/factories/apisix/compositions/apisix-bootstrap.d.ts.map +1 -0
  193. package/dist/factories/apisix/compositions/apisix-bootstrap.js +280 -0
  194. package/dist/factories/apisix/compositions/apisix-bootstrap.js.map +1 -0
  195. package/dist/factories/apisix/compositions/index.d.ts +5 -0
  196. package/dist/factories/apisix/compositions/index.d.ts.map +1 -0
  197. package/dist/factories/apisix/compositions/index.js +5 -0
  198. package/dist/factories/apisix/compositions/index.js.map +1 -0
  199. package/dist/factories/apisix/index.d.ts +11 -0
  200. package/dist/factories/apisix/index.d.ts.map +1 -0
  201. package/dist/factories/apisix/index.js +11 -0
  202. package/dist/factories/apisix/index.js.map +1 -0
  203. package/dist/factories/apisix/resources/helm.d.ts +59 -0
  204. package/dist/factories/apisix/resources/helm.d.ts.map +1 -0
  205. package/dist/factories/apisix/resources/helm.js +175 -0
  206. package/dist/factories/apisix/resources/helm.js.map +1 -0
  207. package/dist/factories/apisix/resources/index.d.ts +5 -0
  208. package/dist/factories/apisix/resources/index.d.ts.map +1 -0
  209. package/dist/factories/apisix/resources/index.js +5 -0
  210. package/dist/factories/apisix/resources/index.js.map +1 -0
  211. package/dist/factories/apisix/types.d.ts +339 -0
  212. package/dist/factories/apisix/types.d.ts.map +1 -0
  213. package/dist/factories/apisix/types.js +88 -0
  214. package/dist/factories/apisix/types.js.map +1 -0
  215. package/dist/factories/apisix/utils/helm-values-mapper.d.ts +19 -0
  216. package/dist/factories/apisix/utils/helm-values-mapper.d.ts.map +1 -0
  217. package/dist/factories/apisix/utils/helm-values-mapper.js +108 -0
  218. package/dist/factories/apisix/utils/helm-values-mapper.js.map +1 -0
  219. package/dist/factories/apisix/utils/index.d.ts +5 -0
  220. package/dist/factories/apisix/utils/index.d.ts.map +1 -0
  221. package/dist/factories/apisix/utils/index.js +5 -0
  222. package/dist/factories/apisix/utils/index.js.map +1 -0
  223. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts +45 -0
  224. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.d.ts.map +1 -0
  225. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js +323 -0
  226. package/dist/factories/cert-manager/compositions/cert-manager-bootstrap.js.map +1 -0
  227. package/dist/factories/cert-manager/compositions/index.d.ts +2 -0
  228. package/dist/factories/cert-manager/compositions/index.d.ts.map +1 -0
  229. package/dist/factories/cert-manager/compositions/index.js +2 -0
  230. package/dist/factories/cert-manager/compositions/index.js.map +1 -0
  231. package/dist/factories/cert-manager/index.d.ts +10 -0
  232. package/dist/factories/cert-manager/index.d.ts.map +1 -0
  233. package/dist/factories/cert-manager/index.js +19 -0
  234. package/dist/factories/cert-manager/index.js.map +1 -0
  235. package/dist/factories/cert-manager/resources/certificates.d.ts +39 -0
  236. package/dist/factories/cert-manager/resources/certificates.d.ts.map +1 -0
  237. package/dist/factories/cert-manager/resources/certificates.js +132 -0
  238. package/dist/factories/cert-manager/resources/certificates.js.map +1 -0
  239. package/dist/factories/cert-manager/resources/challenges.d.ts +113 -0
  240. package/dist/factories/cert-manager/resources/challenges.d.ts.map +1 -0
  241. package/dist/factories/cert-manager/resources/challenges.js +281 -0
  242. package/dist/factories/cert-manager/resources/challenges.js.map +1 -0
  243. package/dist/factories/cert-manager/resources/helm.d.ts +57 -0
  244. package/dist/factories/cert-manager/resources/helm.d.ts.map +1 -0
  245. package/dist/factories/cert-manager/resources/helm.js +390 -0
  246. package/dist/factories/cert-manager/resources/helm.js.map +1 -0
  247. package/dist/factories/cert-manager/resources/index.d.ts +5 -0
  248. package/dist/factories/cert-manager/resources/index.d.ts.map +1 -0
  249. package/dist/factories/cert-manager/resources/index.js +6 -0
  250. package/dist/factories/cert-manager/resources/index.js.map +1 -0
  251. package/dist/factories/cert-manager/resources/issuers.d.ts +79 -0
  252. package/dist/factories/cert-manager/resources/issuers.d.ts.map +1 -0
  253. package/dist/factories/cert-manager/resources/issuers.js +204 -0
  254. package/dist/factories/cert-manager/resources/issuers.js.map +1 -0
  255. package/dist/factories/cert-manager/types.d.ts +1015 -0
  256. package/dist/factories/cert-manager/types.d.ts.map +1 -0
  257. package/dist/factories/cert-manager/types.js +198 -0
  258. package/dist/factories/cert-manager/types.js.map +1 -0
  259. package/dist/factories/cert-manager/utils/helm-values-mapper.d.ts +19 -0
  260. package/dist/factories/cert-manager/utils/helm-values-mapper.d.ts.map +1 -0
  261. package/dist/factories/cert-manager/utils/helm-values-mapper.js +117 -0
  262. package/dist/factories/cert-manager/utils/helm-values-mapper.js.map +1 -0
  263. package/dist/factories/cert-manager/utils/index.d.ts +2 -0
  264. package/dist/factories/cert-manager/utils/index.d.ts.map +1 -0
  265. package/dist/factories/cert-manager/utils/index.js +2 -0
  266. package/dist/factories/cert-manager/utils/index.js.map +1 -0
  267. package/dist/factories/cilium/compositions/cilium-bootstrap.d.ts +220 -0
  268. package/dist/factories/cilium/compositions/cilium-bootstrap.d.ts.map +1 -0
  269. package/dist/factories/cilium/compositions/cilium-bootstrap.js +293 -0
  270. package/dist/factories/cilium/compositions/cilium-bootstrap.js.map +1 -0
  271. package/dist/factories/cilium/compositions/index.d.ts +8 -0
  272. package/dist/factories/cilium/compositions/index.d.ts.map +1 -0
  273. package/dist/factories/cilium/compositions/index.js +11 -0
  274. package/dist/factories/cilium/compositions/index.js.map +1 -0
  275. package/dist/factories/cilium/index.d.ts +10 -0
  276. package/dist/factories/cilium/index.d.ts.map +1 -0
  277. package/dist/factories/cilium/index.js +19 -0
  278. package/dist/factories/cilium/index.js.map +1 -0
  279. package/dist/factories/cilium/resources/bgp.d.ts +10 -0
  280. package/dist/factories/cilium/resources/bgp.d.ts.map +1 -0
  281. package/dist/factories/cilium/resources/bgp.js +14 -0
  282. package/dist/factories/cilium/resources/bgp.js.map +1 -0
  283. package/dist/factories/cilium/resources/gateway.d.ts +72 -0
  284. package/dist/factories/cilium/resources/gateway.d.ts.map +1 -0
  285. package/dist/factories/cilium/resources/gateway.js +118 -0
  286. package/dist/factories/cilium/resources/gateway.js.map +1 -0
  287. package/dist/factories/cilium/resources/helm.d.ts +93 -0
  288. package/dist/factories/cilium/resources/helm.d.ts.map +1 -0
  289. package/dist/factories/cilium/resources/helm.js +377 -0
  290. package/dist/factories/cilium/resources/helm.js.map +1 -0
  291. package/dist/factories/cilium/resources/index.d.ts +14 -0
  292. package/dist/factories/cilium/resources/index.d.ts.map +1 -0
  293. package/dist/factories/cilium/resources/index.js +35 -0
  294. package/dist/factories/cilium/resources/index.js.map +1 -0
  295. package/dist/factories/cilium/resources/load-balancer.d.ts +9 -0
  296. package/dist/factories/cilium/resources/load-balancer.d.ts.map +1 -0
  297. package/dist/factories/cilium/resources/load-balancer.js +12 -0
  298. package/dist/factories/cilium/resources/load-balancer.js.map +1 -0
  299. package/dist/factories/cilium/resources/networking.d.ts +202 -0
  300. package/dist/factories/cilium/resources/networking.d.ts.map +1 -0
  301. package/dist/factories/cilium/resources/networking.js +581 -0
  302. package/dist/factories/cilium/resources/networking.js.map +1 -0
  303. package/dist/factories/cilium/resources/observability.d.ts +9 -0
  304. package/dist/factories/cilium/resources/observability.d.ts.map +1 -0
  305. package/dist/factories/cilium/resources/observability.js +11 -0
  306. package/dist/factories/cilium/resources/observability.js.map +1 -0
  307. package/dist/factories/cilium/resources/security.d.ts +10 -0
  308. package/dist/factories/cilium/resources/security.d.ts.map +1 -0
  309. package/dist/factories/cilium/resources/security.js +14 -0
  310. package/dist/factories/cilium/resources/security.js.map +1 -0
  311. package/dist/factories/cilium/types.d.ts +1001 -0
  312. package/dist/factories/cilium/types.d.ts.map +1 -0
  313. package/dist/factories/cilium/types.js +79 -0
  314. package/dist/factories/cilium/types.js.map +1 -0
  315. package/dist/factories/external-dns/compositions/external-dns-bootstrap.d.ts +32 -0
  316. package/dist/factories/external-dns/compositions/external-dns-bootstrap.d.ts.map +1 -0
  317. package/dist/factories/external-dns/compositions/external-dns-bootstrap.js +152 -0
  318. package/dist/factories/external-dns/compositions/external-dns-bootstrap.js.map +1 -0
  319. package/dist/factories/external-dns/compositions/index.d.ts +2 -0
  320. package/dist/factories/external-dns/compositions/index.d.ts.map +1 -0
  321. package/dist/factories/external-dns/compositions/index.js +3 -0
  322. package/dist/factories/external-dns/compositions/index.js.map +1 -0
  323. package/dist/factories/external-dns/index.d.ts +10 -0
  324. package/dist/factories/external-dns/index.d.ts.map +1 -0
  325. package/dist/factories/external-dns/index.js +19 -0
  326. package/dist/factories/external-dns/index.js.map +1 -0
  327. package/dist/factories/external-dns/resources/dns-endpoint.d.ts +54 -0
  328. package/dist/factories/external-dns/resources/dns-endpoint.d.ts.map +1 -0
  329. package/dist/factories/external-dns/resources/dns-endpoint.js +53 -0
  330. package/dist/factories/external-dns/resources/dns-endpoint.js.map +1 -0
  331. package/dist/factories/external-dns/resources/helm.d.ts +57 -0
  332. package/dist/factories/external-dns/resources/helm.d.ts.map +1 -0
  333. package/dist/factories/external-dns/resources/helm.js +435 -0
  334. package/dist/factories/external-dns/resources/helm.js.map +1 -0
  335. package/dist/factories/external-dns/resources/index.d.ts +3 -0
  336. package/dist/factories/external-dns/resources/index.d.ts.map +1 -0
  337. package/dist/factories/external-dns/resources/index.js +4 -0
  338. package/dist/factories/external-dns/resources/index.js.map +1 -0
  339. package/dist/factories/external-dns/types.d.ts +180 -0
  340. package/dist/factories/external-dns/types.d.ts.map +1 -0
  341. package/dist/factories/external-dns/types.js +39 -0
  342. package/dist/factories/external-dns/types.js.map +1 -0
  343. package/dist/factories/flux/git-repository.d.ts +2 -2
  344. package/dist/factories/flux/git-repository.d.ts.map +1 -1
  345. package/dist/factories/helm/types.d.ts +24 -3
  346. package/dist/factories/helm/types.d.ts.map +1 -1
  347. package/dist/factories/index.d.ts +7 -1
  348. package/dist/factories/index.d.ts.map +1 -1
  349. package/dist/factories/index.js +21 -2
  350. package/dist/factories/index.js.map +1 -1
  351. package/dist/factories/kubernetes/config/config-map.d.ts +4 -1
  352. package/dist/factories/kubernetes/config/config-map.d.ts.map +1 -1
  353. package/dist/factories/kubernetes/config/config-map.js +4 -0
  354. package/dist/factories/kubernetes/config/config-map.js.map +1 -1
  355. package/dist/factories/kubernetes/config/secret.d.ts +6 -1
  356. package/dist/factories/kubernetes/config/secret.d.ts.map +1 -1
  357. package/dist/factories/kubernetes/config/secret.js +4 -0
  358. package/dist/factories/kubernetes/config/secret.js.map +1 -1
  359. package/dist/factories/kubernetes/networking/service.d.ts.map +1 -1
  360. package/dist/factories/kubernetes/networking/service.js +6 -1
  361. package/dist/factories/kubernetes/networking/service.js.map +1 -1
  362. package/dist/factories/kubernetes/rbac/cluster-role-binding.d.ts.map +1 -1
  363. package/dist/factories/kubernetes/rbac/cluster-role-binding.js +1 -1
  364. package/dist/factories/kubernetes/rbac/cluster-role-binding.js.map +1 -1
  365. package/dist/factories/kubernetes/rbac/cluster-role.d.ts.map +1 -1
  366. package/dist/factories/kubernetes/rbac/cluster-role.js +1 -1
  367. package/dist/factories/kubernetes/rbac/cluster-role.js.map +1 -1
  368. package/dist/factories/kubernetes/scheduling/priority-class.d.ts.map +1 -1
  369. package/dist/factories/kubernetes/scheduling/priority-class.js +1 -1
  370. package/dist/factories/kubernetes/scheduling/priority-class.js.map +1 -1
  371. package/dist/factories/kubernetes/storage/storage-class.d.ts.map +1 -1
  372. package/dist/factories/kubernetes/storage/storage-class.js +1 -1
  373. package/dist/factories/kubernetes/storage/storage-class.js.map +1 -1
  374. package/dist/factories/kubernetes/workloads/deployment.d.ts.map +1 -1
  375. package/dist/factories/kubernetes/workloads/deployment.js +9 -4
  376. package/dist/factories/kubernetes/workloads/deployment.js.map +1 -1
  377. package/dist/factories/kubernetes/yaml/yaml-directory.js +2 -2
  378. package/dist/factories/kubernetes/yaml/yaml-directory.js.map +1 -1
  379. package/dist/factories/kubernetes/yaml/yaml-file.d.ts +31 -1
  380. package/dist/factories/kubernetes/yaml/yaml-file.d.ts.map +1 -1
  381. package/dist/factories/kubernetes/yaml/yaml-file.js +80 -7
  382. package/dist/factories/kubernetes/yaml/yaml-file.js.map +1 -1
  383. package/dist/factories/pebble/compositions/index.d.ts +2 -0
  384. package/dist/factories/pebble/compositions/index.d.ts.map +1 -0
  385. package/dist/factories/pebble/compositions/index.js +3 -0
  386. package/dist/factories/pebble/compositions/index.js.map +1 -0
  387. package/dist/factories/pebble/compositions/pebble-bootstrap.d.ts +56 -0
  388. package/dist/factories/pebble/compositions/pebble-bootstrap.d.ts.map +1 -0
  389. package/dist/factories/pebble/compositions/pebble-bootstrap.js +97 -0
  390. package/dist/factories/pebble/compositions/pebble-bootstrap.js.map +1 -0
  391. package/dist/factories/pebble/index.d.ts +10 -0
  392. package/dist/factories/pebble/index.d.ts.map +1 -0
  393. package/dist/factories/pebble/index.js +19 -0
  394. package/dist/factories/pebble/index.js.map +1 -0
  395. package/dist/factories/pebble/resources/helm.d.ts +99 -0
  396. package/dist/factories/pebble/resources/helm.d.ts.map +1 -0
  397. package/dist/factories/pebble/resources/helm.js +167 -0
  398. package/dist/factories/pebble/resources/helm.js.map +1 -0
  399. package/dist/factories/pebble/resources/index.d.ts +2 -0
  400. package/dist/factories/pebble/resources/index.d.ts.map +1 -0
  401. package/dist/factories/pebble/resources/index.js +3 -0
  402. package/dist/factories/pebble/resources/index.js.map +1 -0
  403. package/dist/factories/pebble/types.d.ts +184 -0
  404. package/dist/factories/pebble/types.d.ts.map +1 -0
  405. package/dist/factories/pebble/types.js +23 -0
  406. package/dist/factories/pebble/types.js.map +1 -0
  407. package/dist/factories/pebble/utils/helm-values-mapper.d.ts +21 -0
  408. package/dist/factories/pebble/utils/helm-values-mapper.d.ts.map +1 -0
  409. package/dist/factories/pebble/utils/helm-values-mapper.js +96 -0
  410. package/dist/factories/pebble/utils/helm-values-mapper.js.map +1 -0
  411. package/dist/factories/shared.d.ts +18 -1
  412. package/dist/factories/shared.d.ts.map +1 -1
  413. package/dist/factories/shared.js +89 -8
  414. package/dist/factories/shared.js.map +1 -1
  415. package/dist/factories/simple/config/config-map.d.ts +7 -2
  416. package/dist/factories/simple/config/config-map.d.ts.map +1 -1
  417. package/dist/factories/simple/config/config-map.js +3 -0
  418. package/dist/factories/simple/config/config-map.js.map +1 -1
  419. package/dist/factories/simple/config/secret.d.ts +11 -2
  420. package/dist/factories/simple/config/secret.d.ts.map +1 -1
  421. package/dist/factories/simple/config/secret.js +23 -1
  422. package/dist/factories/simple/config/secret.js.map +1 -1
  423. package/dist/factories/simple/storage/persistent-volume-claim.d.ts.map +1 -1
  424. package/dist/factories/simple/storage/persistent-volume-claim.js +1 -0
  425. package/dist/factories/simple/storage/persistent-volume-claim.js.map +1 -1
  426. package/dist/factories/simple/types.d.ts +5 -1
  427. package/dist/factories/simple/types.d.ts.map +1 -1
  428. package/dist/utils/helpers.d.ts.map +1 -1
  429. package/dist/utils/helpers.js +67 -0
  430. package/dist/utils/helpers.js.map +1 -1
  431. package/dist/utils/type-guards.d.ts +5 -0
  432. package/dist/utils/type-guards.d.ts.map +1 -1
  433. package/dist/utils/type-guards.js +9 -3
  434. package/dist/utils/type-guards.js.map +1 -1
  435. package/package.json +49 -5
@@ -0,0 +1,298 @@
1
+ /**
2
+ * Kubernetes Error Handling Utilities
3
+ *
4
+ * Centralized error handling for Kubernetes API errors.
5
+ * Supports both the old request-based errors (0.x) and new fetch-based errors (1.x+).
6
+ *
7
+ * This module provides consistent error handling across the codebase,
8
+ * making it easier to handle API errors and prepare for future client upgrades.
9
+ */
10
+ import { getComponentLogger } from '../logging/index.js';
11
+ const logger = getComponentLogger('kubernetes-errors');
12
+ /**
13
+ * Extract the HTTP status code from a Kubernetes API error.
14
+ *
15
+ * Handles multiple error structures from different client versions:
16
+ * - Direct statusCode property (0.x style)
17
+ * - Nested response.statusCode (1.x+ fetch style)
18
+ * - Nested body.code (some error responses)
19
+ *
20
+ * @param error - The error object to extract status code from
21
+ * @returns The HTTP status code, or undefined if not found
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * try {
26
+ * await api.read(resource);
27
+ * } catch (error) {
28
+ * const statusCode = getErrorStatusCode(error);
29
+ * if (statusCode === 404) {
30
+ * // Handle not found
31
+ * }
32
+ * }
33
+ * ```
34
+ */
35
+ export function getErrorStatusCode(error) {
36
+ if (typeof error !== 'object' || error === null) {
37
+ return undefined;
38
+ }
39
+ const err = error;
40
+ // Try direct statusCode first (0.x style and some 1.x errors)
41
+ if (typeof err.statusCode === 'number') {
42
+ return err.statusCode;
43
+ }
44
+ // Try nested response.statusCode (1.x+ fetch style)
45
+ if (typeof err.response?.statusCode === 'number') {
46
+ return err.response.statusCode;
47
+ }
48
+ // Try nested body.code (some Kubernetes error responses)
49
+ if (typeof err.body?.code === 'number') {
50
+ return err.body.code;
51
+ }
52
+ // Log unexpected error shape at debug level for diagnostics
53
+ logger.debug('Could not extract status code from error', {
54
+ errorType: typeof error,
55
+ hasStatusCode: 'statusCode' in err,
56
+ hasResponse: 'response' in err,
57
+ hasBody: 'body' in err,
58
+ errorKeys: Object.keys(err),
59
+ });
60
+ return undefined;
61
+ }
62
+ /**
63
+ * Check if an error is a "Not Found" (404) error.
64
+ *
65
+ * @param error - The error to check
66
+ * @returns true if the error is a 404 Not Found error
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * try {
71
+ * await api.read(resource);
72
+ * } catch (error) {
73
+ * if (isNotFoundError(error)) {
74
+ * console.log('Resource does not exist');
75
+ * }
76
+ * }
77
+ * ```
78
+ */
79
+ export function isNotFoundError(error) {
80
+ return getErrorStatusCode(error) === 404;
81
+ }
82
+ /**
83
+ * Check if an error is a "Conflict" (409) error.
84
+ *
85
+ * Conflict errors typically occur when:
86
+ * - Trying to create a resource that already exists
87
+ * - Optimistic locking fails due to resource version mismatch
88
+ *
89
+ * @param error - The error to check
90
+ * @returns true if the error is a 409 Conflict error
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * try {
95
+ * await api.create(resource);
96
+ * } catch (error) {
97
+ * if (isConflictError(error)) {
98
+ * console.log('Resource already exists');
99
+ * }
100
+ * }
101
+ * ```
102
+ */
103
+ export function isConflictError(error) {
104
+ return getErrorStatusCode(error) === 409;
105
+ }
106
+ /**
107
+ * HTTP status codes that are typically retryable.
108
+ * These indicate temporary issues that may resolve on retry.
109
+ */
110
+ const RETRYABLE_STATUS_CODES = [
111
+ 408, // Request Timeout
112
+ 429, // Too Many Requests
113
+ 500, // Internal Server Error
114
+ 502, // Bad Gateway
115
+ 503, // Service Unavailable
116
+ 504, // Gateway Timeout
117
+ ];
118
+ /**
119
+ * Check if an error is retryable.
120
+ *
121
+ * An error is considered retryable if:
122
+ * - It has a retryable HTTP status code (408, 429, 500, 502, 503, 504)
123
+ * - It's a network connectivity error (ECONNREFUSED, ENOTFOUND, ETIMEDOUT)
124
+ * - It's a fetch-related TypeError (network failure)
125
+ * - It's an AbortError (timeout)
126
+ *
127
+ * @param error - The error to check
128
+ * @returns true if the error is retryable
129
+ *
130
+ * @example
131
+ * ```typescript
132
+ * try {
133
+ * await api.read(resource);
134
+ * } catch (error) {
135
+ * if (isRetryableError(error)) {
136
+ * // Retry the operation
137
+ * } else {
138
+ * // Don't retry, handle the error
139
+ * }
140
+ * }
141
+ * ```
142
+ */
143
+ export function isRetryableError(error) {
144
+ // Check for retryable HTTP status codes
145
+ const statusCode = getErrorStatusCode(error);
146
+ if (statusCode !== undefined && RETRYABLE_STATUS_CODES.includes(statusCode)) {
147
+ return true;
148
+ }
149
+ // Check for network errors by message content
150
+ if (error instanceof Error) {
151
+ const message = error.message.toLowerCase();
152
+ // Network connectivity issues
153
+ if (message.includes('econnrefused') ||
154
+ message.includes('enotfound') ||
155
+ message.includes('etimedout') ||
156
+ message.includes('network error') ||
157
+ message.includes('socket hang up') ||
158
+ message.includes('connection reset')) {
159
+ return true;
160
+ }
161
+ // Fetch-related network errors (1.x+ client)
162
+ if (error instanceof TypeError && message.includes('fetch')) {
163
+ return true;
164
+ }
165
+ // Abort errors (timeout)
166
+ if (error.name === 'AbortError') {
167
+ return true;
168
+ }
169
+ }
170
+ // Check for DOMException AbortError (browser/Node.js fetch)
171
+ if (typeof error === 'object' &&
172
+ error !== null &&
173
+ 'name' in error &&
174
+ error.name === 'AbortError') {
175
+ return true;
176
+ }
177
+ return false;
178
+ }
179
+ /**
180
+ * Format a Kubernetes API error into a human-readable message.
181
+ *
182
+ * Extracts relevant information from the error and formats it consistently.
183
+ *
184
+ * @param error - The error to format
185
+ * @returns A formatted error message string
186
+ *
187
+ * @example
188
+ * ```typescript
189
+ * try {
190
+ * await api.read(resource);
191
+ * } catch (error) {
192
+ * console.error(formatKubernetesError(error));
193
+ * // Output: "Kubernetes API error (404): Not Found - the resource does not exist"
194
+ * }
195
+ * ```
196
+ */
197
+ export function formatKubernetesError(error) {
198
+ if (typeof error !== 'object' || error === null) {
199
+ return String(error);
200
+ }
201
+ const err = error;
202
+ const statusCode = getErrorStatusCode(error);
203
+ const parts = [];
204
+ // Add status code if available
205
+ if (statusCode !== undefined) {
206
+ parts.push(`Kubernetes API error (${statusCode})`);
207
+ }
208
+ else {
209
+ parts.push('Kubernetes API error');
210
+ }
211
+ // Add reason if available from body
212
+ if (err.body?.reason) {
213
+ parts.push(err.body.reason);
214
+ }
215
+ // Add message
216
+ if (err.body?.message) {
217
+ parts.push(err.body.message);
218
+ }
219
+ else if (err.message) {
220
+ parts.push(err.message);
221
+ }
222
+ return parts.join(': ');
223
+ }
224
+ /**
225
+ * Check if an error is an "Unauthorized" (401) error.
226
+ *
227
+ * @param error - The error to check
228
+ * @returns true if the error is a 401 Unauthorized error
229
+ */
230
+ export function isUnauthorizedError(error) {
231
+ return getErrorStatusCode(error) === 401;
232
+ }
233
+ /**
234
+ * Check if an error is a "Forbidden" (403) error.
235
+ *
236
+ * @param error - The error to check
237
+ * @returns true if the error is a 403 Forbidden error
238
+ */
239
+ export function isForbiddenError(error) {
240
+ return getErrorStatusCode(error) === 403;
241
+ }
242
+ /**
243
+ * Check if an error is a "Bad Request" (400) error.
244
+ *
245
+ * @param error - The error to check
246
+ * @returns true if the error is a 400 Bad Request error
247
+ */
248
+ export function isBadRequestError(error) {
249
+ return getErrorStatusCode(error) === 400;
250
+ }
251
+ /**
252
+ * Check if an error is a "Unprocessable Entity" (422) error.
253
+ *
254
+ * This typically indicates validation errors in the request body.
255
+ *
256
+ * @param error - The error to check
257
+ * @returns true if the error is a 422 Unprocessable Entity error
258
+ */
259
+ export function isValidationError(error) {
260
+ return getErrorStatusCode(error) === 422;
261
+ }
262
+ /**
263
+ * Extract the error reason from a Kubernetes API error.
264
+ *
265
+ * @param error - The error to extract reason from
266
+ * @returns The error reason string, or undefined if not available
267
+ */
268
+ export function getErrorReason(error) {
269
+ if (typeof error !== 'object' || error === null) {
270
+ return undefined;
271
+ }
272
+ const err = error;
273
+ return err.body?.reason;
274
+ }
275
+ /**
276
+ * Extract detailed error information from a Kubernetes API error.
277
+ *
278
+ * @param error - The error to extract details from
279
+ * @returns An object containing all available error details
280
+ */
281
+ export function getErrorDetails(error) {
282
+ if (typeof error !== 'object' || error === null) {
283
+ return {
284
+ statusCode: undefined,
285
+ reason: undefined,
286
+ message: String(error),
287
+ details: undefined,
288
+ };
289
+ }
290
+ const err = error;
291
+ return {
292
+ statusCode: getErrorStatusCode(error),
293
+ reason: err.body?.reason,
294
+ message: err.body?.message ?? err.message,
295
+ details: err.body?.details,
296
+ };
297
+ }
298
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/core/kubernetes/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,MAAM,MAAM,GAAG,kBAAkB,CAAC,mBAAmB,CAAC,CAAC;AAwBvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,GAAG,GAAG,KAA2B,CAAC;IAExC,8DAA8D;IAC9D,IAAI,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,oDAAoD;IACpD,IAAI,OAAO,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK,QAAQ,EAAE,CAAC;QACjD,OAAO,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC;IACjC,CAAC;IAED,yDAAyD;IACzD,IAAI,OAAO,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,4DAA4D;IAC5D,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE;QACvD,SAAS,EAAE,OAAO,KAAK;QACvB,aAAa,EAAE,YAAY,IAAI,GAAG;QAClC,WAAW,EAAE,UAAU,IAAI,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Q,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO;YACL,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC;YACtB,OAAO,EAAE,SAAS;SACnB,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,KAA2B,CAAC;IAExC,OAAO;QACL,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC;QACrC,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM;QACxB,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO,IAAI,GAAG,CAAC,OAAO;QACzC,OAAO,EAAE,GAAG,CAAC,IAAI,EAAE,OAAO;KAC3B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Kubernetes Module
3
+ *
4
+ * Centralized exports for Kubernetes client functionality.
5
+ * This module provides:
6
+ * - Client provider for managing Kubernetes API clients
7
+ * - API utilities for common operations
8
+ * - Error handling utilities for consistent error management
9
+ */
10
+ export { KubernetesClientProvider, createKubernetesClientProvider, createKubernetesClientProviderWithKubeConfig, getKubernetesClientProvider, getKubernetesApi, getKubeConfig, getCoreV1Api, getAppsV1Api, } from './client-provider.js';
11
+ export type { KubernetesClientConfig, KubernetesApiConsumer, KubeConfigConsumer, RetryOptions, } from './client-provider.js';
12
+ export { KubernetesApi } from './api.js';
13
+ export { getErrorStatusCode, isNotFoundError, isConflictError, isRetryableError, formatKubernetesError, isUnauthorizedError, isForbiddenError, isBadRequestError, isValidationError, getErrorReason, getErrorDetails, } from './errors.js';
14
+ export type { KubernetesApiError } from './errors.js';
15
+ export { isKubernetesResponse, isKubernetesError, hasStatusCode, isKubernetesResource, hasBody, isKubernetesList, hasResourceVersion, } from './type-guards.js';
16
+ export type { KubernetesResponse, KubernetesResourceShape, } from './type-guards.js';
17
+ export { BunCompatibleHttpLibrary, isBunRuntime, getHttpLibraryForRuntime, } from './bun-http-library.js';
18
+ export { createBunCompatibleApiClient, createBunCompatibleCoreV1Api, createBunCompatibleAppsV1Api, createBunCompatibleCustomObjectsApi, createBunCompatibleBatchV1Api, createBunCompatibleNetworkingV1Api, createBunCompatibleRbacAuthorizationV1Api, createBunCompatibleStorageV1Api, createBunCompatibleApiextensionsV1Api, createBunCompatibleKubernetesObjectApi, } from './bun-api-client.js';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/kubernetes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,4CAA4C,EAC5C,2BAA2B,EAC3B,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,YAAY,GACb,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAErB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,OAAO,EACP,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,mCAAmC,EACnC,6BAA6B,EAC7B,kCAAkC,EAClC,yCAAyC,EACzC,+BAA+B,EAC/B,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Kubernetes Module
3
+ *
4
+ * Centralized exports for Kubernetes client functionality.
5
+ * This module provides:
6
+ * - Client provider for managing Kubernetes API clients
7
+ * - API utilities for common operations
8
+ * - Error handling utilities for consistent error management
9
+ */
10
+ // Client provider and configuration
11
+ export { KubernetesClientProvider, createKubernetesClientProvider, createKubernetesClientProviderWithKubeConfig, getKubernetesClientProvider, getKubernetesApi, getKubeConfig, getCoreV1Api, getAppsV1Api, } from './client-provider.js';
12
+ // API utilities
13
+ export { KubernetesApi } from './api.js';
14
+ // Error handling utilities
15
+ export { getErrorStatusCode, isNotFoundError, isConflictError, isRetryableError, formatKubernetesError, isUnauthorizedError, isForbiddenError, isBadRequestError, isValidationError, getErrorReason, getErrorDetails, } from './errors.js';
16
+ // Type guards
17
+ export { isKubernetesResponse, isKubernetesError, hasStatusCode, isKubernetesResource, hasBody, isKubernetesList, hasResourceVersion, } from './type-guards.js';
18
+ // Bun compatibility utilities
19
+ // These provide workarounds for Bun's fetch TLS issues
20
+ // See: https://github.com/oven-sh/bun/issues/10642
21
+ export { BunCompatibleHttpLibrary, isBunRuntime, getHttpLibraryForRuntime, } from './bun-http-library.js';
22
+ export { createBunCompatibleApiClient, createBunCompatibleCoreV1Api, createBunCompatibleAppsV1Api, createBunCompatibleCustomObjectsApi, createBunCompatibleBatchV1Api, createBunCompatibleNetworkingV1Api, createBunCompatibleRbacAuthorizationV1Api, createBunCompatibleStorageV1Api, createBunCompatibleApiextensionsV1Api, createBunCompatibleKubernetesObjectApi, } from './bun-api-client.js';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/kubernetes/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,oCAAoC;AACpC,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,4CAA4C,EAC5C,2BAA2B,EAC3B,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,YAAY,GACb,MAAM,sBAAsB,CAAC;AAS9B,gBAAgB;AAChB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,2BAA2B;AAC3B,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,cAAc,EACd,eAAe,GAChB,MAAM,aAAa,CAAC;AAIrB,cAAc;AACd,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACpB,OAAO,EACP,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAO1B,8BAA8B;AAC9B,uDAAuD;AACvD,mDAAmD;AACnD,OAAO,EACL,wBAAwB,EACxB,YAAY,EACZ,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC5B,4BAA4B,EAC5B,mCAAmC,EACnC,6BAA6B,EAC7B,kCAAkC,EAClC,yCAAyC,EACzC,+BAA+B,EAC/B,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Kubernetes Type Guards
3
+ *
4
+ * Type guards for validating Kubernetes API response shapes.
5
+ * These guards help ensure type safety when working with API responses
6
+ * that may have different structures across client versions.
7
+ */
8
+ import type { KubernetesApiError } from './errors.js';
9
+ /**
10
+ * Interface representing a standard Kubernetes API response.
11
+ * The response typically contains a body property with the actual data.
12
+ */
13
+ export interface KubernetesResponse<T> {
14
+ body: T;
15
+ response?: {
16
+ statusCode?: number;
17
+ headers?: Record<string, string>;
18
+ };
19
+ }
20
+ /**
21
+ * Interface representing a Kubernetes resource with standard metadata.
22
+ */
23
+ export interface KubernetesResourceShape {
24
+ apiVersion?: string;
25
+ kind?: string;
26
+ metadata?: {
27
+ name?: string;
28
+ namespace?: string;
29
+ uid?: string;
30
+ resourceVersion?: string;
31
+ creationTimestamp?: string;
32
+ labels?: Record<string, string>;
33
+ annotations?: Record<string, string>;
34
+ };
35
+ spec?: unknown;
36
+ status?: unknown;
37
+ }
38
+ /**
39
+ * Check if a value is a Kubernetes API response with a body property.
40
+ *
41
+ * @param response - The value to check
42
+ * @returns true if the value is a KubernetesResponse
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const result = await api.read(resource);
47
+ * if (isKubernetesResponse(result)) {
48
+ * const resource = result.body;
49
+ * }
50
+ * ```
51
+ */
52
+ export declare function isKubernetesResponse<T>(response: unknown): response is KubernetesResponse<T>;
53
+ /**
54
+ * Check if an error is a Kubernetes API error with expected properties.
55
+ *
56
+ * @param error - The error to check
57
+ * @returns true if the error is a KubernetesApiError
58
+ *
59
+ * @example
60
+ * ```typescript
61
+ * try {
62
+ * await api.read(resource);
63
+ * } catch (error) {
64
+ * if (isKubernetesError(error)) {
65
+ * console.log('Status:', error.statusCode);
66
+ * }
67
+ * }
68
+ * ```
69
+ */
70
+ export declare function isKubernetesError(error: unknown): error is KubernetesApiError;
71
+ /**
72
+ * Check if an object has a statusCode property.
73
+ *
74
+ * @param obj - The object to check
75
+ * @returns true if the object has a numeric statusCode property
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * if (hasStatusCode(error)) {
80
+ * console.log('HTTP Status:', error.statusCode);
81
+ * }
82
+ * ```
83
+ */
84
+ export declare function hasStatusCode(obj: unknown): obj is {
85
+ statusCode: number;
86
+ };
87
+ /**
88
+ * Check if a value is a Kubernetes resource with standard shape.
89
+ *
90
+ * @param value - The value to check
91
+ * @returns true if the value has Kubernetes resource shape
92
+ *
93
+ * @example
94
+ * ```typescript
95
+ * if (isKubernetesResource(obj)) {
96
+ * console.log('Kind:', obj.kind);
97
+ * console.log('Name:', obj.metadata?.name);
98
+ * }
99
+ * ```
100
+ */
101
+ export declare function isKubernetesResource(value: unknown): value is KubernetesResourceShape;
102
+ /**
103
+ * Check if a value has a body property with a specific shape.
104
+ *
105
+ * @param value - The value to check
106
+ * @param bodyGuard - A type guard function to validate the body
107
+ * @returns true if the value has a body that passes the guard
108
+ *
109
+ * @example
110
+ * ```typescript
111
+ * if (hasBody(response, isKubernetesResource)) {
112
+ * console.log('Resource:', response.body.kind);
113
+ * }
114
+ * ```
115
+ */
116
+ export declare function hasBody<T>(value: unknown, bodyGuard: (body: unknown) => body is T): value is {
117
+ body: T;
118
+ };
119
+ /**
120
+ * Check if a value is a list response from the Kubernetes API.
121
+ *
122
+ * @param value - The value to check
123
+ * @returns true if the value is a Kubernetes list response
124
+ */
125
+ export declare function isKubernetesList(value: unknown): value is {
126
+ items: unknown[];
127
+ metadata?: {
128
+ resourceVersion?: string;
129
+ };
130
+ };
131
+ /**
132
+ * Check if a response has a resourceVersion in its metadata.
133
+ *
134
+ * @param value - The value to check
135
+ * @returns true if the value has a resourceVersion
136
+ */
137
+ export declare function hasResourceVersion(value: unknown): value is {
138
+ metadata: {
139
+ resourceVersion: string;
140
+ };
141
+ };
142
+ //# sourceMappingURL=type-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../../../src/core/kubernetes/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,kBAAkB,CAAC,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,QAAQ,CAAC,EAAE;QACT,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,u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B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAAC,QAAQ,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAOxE;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,GACb,KAAK,IAAI;IAAE,QAAQ,EAAE;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAYpD"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Kubernetes Type Guards
3
+ *
4
+ * Type guards for validating Kubernetes API response shapes.
5
+ * These guards help ensure type safety when working with API responses
6
+ * that may have different structures across client versions.
7
+ */
8
+ /**
9
+ * Check if a value is a Kubernetes API response with a body property.
10
+ *
11
+ * @param response - The value to check
12
+ * @returns true if the value is a KubernetesResponse
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const result = await api.read(resource);
17
+ * if (isKubernetesResponse(result)) {
18
+ * const resource = result.body;
19
+ * }
20
+ * ```
21
+ */
22
+ export function isKubernetesResponse(response) {
23
+ return (typeof response === 'object' &&
24
+ response !== null &&
25
+ 'body' in response);
26
+ }
27
+ /**
28
+ * Check if an error is a Kubernetes API error with expected properties.
29
+ *
30
+ * @param error - The error to check
31
+ * @returns true if the error is a KubernetesApiError
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * try {
36
+ * await api.read(resource);
37
+ * } catch (error) {
38
+ * if (isKubernetesError(error)) {
39
+ * console.log('Status:', error.statusCode);
40
+ * }
41
+ * }
42
+ * ```
43
+ */
44
+ export function isKubernetesError(error) {
45
+ if (typeof error !== 'object' || error === null) {
46
+ return false;
47
+ }
48
+ const err = error;
49
+ // Check for common Kubernetes error properties
50
+ return (typeof err.statusCode === 'number' ||
51
+ (typeof err.response === 'object' &&
52
+ err.response !== null &&
53
+ typeof err.response.statusCode === 'number') ||
54
+ (typeof err.body === 'object' &&
55
+ err.body !== null &&
56
+ typeof err.body.code === 'number'));
57
+ }
58
+ /**
59
+ * Check if an object has a statusCode property.
60
+ *
61
+ * @param obj - The object to check
62
+ * @returns true if the object has a numeric statusCode property
63
+ *
64
+ * @example
65
+ * ```typescript
66
+ * if (hasStatusCode(error)) {
67
+ * console.log('HTTP Status:', error.statusCode);
68
+ * }
69
+ * ```
70
+ */
71
+ export function hasStatusCode(obj) {
72
+ return (typeof obj === 'object' &&
73
+ obj !== null &&
74
+ 'statusCode' in obj &&
75
+ typeof obj.statusCode === 'number');
76
+ }
77
+ /**
78
+ * Check if a value is a Kubernetes resource with standard shape.
79
+ *
80
+ * @param value - The value to check
81
+ * @returns true if the value has Kubernetes resource shape
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * if (isKubernetesResource(obj)) {
86
+ * console.log('Kind:', obj.kind);
87
+ * console.log('Name:', obj.metadata?.name);
88
+ * }
89
+ * ```
90
+ */
91
+ export function isKubernetesResource(value) {
92
+ if (typeof value !== 'object' || value === null) {
93
+ return false;
94
+ }
95
+ const obj = value;
96
+ // A Kubernetes resource should have at least apiVersion and kind
97
+ return ((typeof obj.apiVersion === 'string' || obj.apiVersion === undefined) &&
98
+ (typeof obj.kind === 'string' || obj.kind === undefined) &&
99
+ (typeof obj.metadata === 'object' || obj.metadata === undefined));
100
+ }
101
+ /**
102
+ * Check if a value has a body property with a specific shape.
103
+ *
104
+ * @param value - The value to check
105
+ * @param bodyGuard - A type guard function to validate the body
106
+ * @returns true if the value has a body that passes the guard
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * if (hasBody(response, isKubernetesResource)) {
111
+ * console.log('Resource:', response.body.kind);
112
+ * }
113
+ * ```
114
+ */
115
+ export function hasBody(value, bodyGuard) {
116
+ return (typeof value === 'object' &&
117
+ value !== null &&
118
+ 'body' in value &&
119
+ bodyGuard(value.body));
120
+ }
121
+ /**
122
+ * Check if a value is a list response from the Kubernetes API.
123
+ *
124
+ * @param value - The value to check
125
+ * @returns true if the value is a Kubernetes list response
126
+ */
127
+ export function isKubernetesList(value) {
128
+ if (typeof value !== 'object' || value === null) {
129
+ return false;
130
+ }
131
+ const obj = value;
132
+ return Array.isArray(obj.items);
133
+ }
134
+ /**
135
+ * Check if a response has a resourceVersion in its metadata.
136
+ *
137
+ * @param value - The value to check
138
+ * @returns true if the value has a resourceVersion
139
+ */
140
+ export function hasResourceVersion(value) {
141
+ if (typeof value !== 'object' || value === null) {
142
+ return false;
143
+ }
144
+ const obj = value;
145
+ if (typeof obj.metadata !== 'object' || obj.metadata === null) {
146
+ return false;
147
+ }
148
+ const metadata = obj.metadata;
149
+ return typeof metadata.resourceVersion === 'string';
150
+ }
151
+ //# sourceMappingURL=type-guards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../../src/core/kubernetes/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmCH;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAAiB;IAEjB,OAAO,CACL,OAAO,QAAQ,KAAK,QAAQ;QAC5B,QAAQ,KAAK,IAAI;QACjB,MAAM,IAAI,QAAQ,CACnB,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QAChD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,GAAG,GAAG,KAAgC,CAAC;IAE7C,+CAA+C;IAC/C,OAAO,CACL,OAAO,GAAG,CAAC,UAAU,KAAK,QAAQ;QAClC,CAAC,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ;YAC/B,GAAG,CAAC,QAAQ,KAAK,IAAI;YACrB,OAAQ,GAAG,CAAC,QAAoC,CAAC,UAAU,KAAK,QAAQ,CAAC;QAC3E,CAAC,OAAO,GAAG,CAAC,IAAI,KAAK,QAAQ;YAC3B,GAAG,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