kustodian 1.0.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 (351) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +346 -0
  3. package/dist/cli/bin.d.ts +3 -0
  4. package/dist/cli/bin.d.ts.map +1 -0
  5. package/dist/cli/bin.js +67 -0
  6. package/dist/cli/bin.js.map +1 -0
  7. package/dist/cli/command.d.ts +57 -0
  8. package/dist/cli/command.d.ts.map +1 -0
  9. package/dist/cli/command.js +26 -0
  10. package/dist/cli/command.js.map +1 -0
  11. package/dist/cli/commands/apply.d.ts +8 -0
  12. package/dist/cli/commands/apply.d.ts.map +1 -0
  13. package/dist/cli/commands/apply.js +802 -0
  14. package/dist/cli/commands/apply.js.map +1 -0
  15. package/dist/cli/commands/init.d.ts +5 -0
  16. package/dist/cli/commands/init.d.ts.map +1 -0
  17. package/dist/cli/commands/init.js +403 -0
  18. package/dist/cli/commands/init.js.map +1 -0
  19. package/dist/cli/commands/sources.d.ts +5 -0
  20. package/dist/cli/commands/sources.d.ts.map +1 -0
  21. package/dist/cli/commands/sources.js +377 -0
  22. package/dist/cli/commands/sources.js.map +1 -0
  23. package/dist/cli/commands/update.d.ts +5 -0
  24. package/dist/cli/commands/update.d.ts.map +1 -0
  25. package/dist/cli/commands/update.js +314 -0
  26. package/dist/cli/commands/update.js.map +1 -0
  27. package/dist/cli/commands/validate.d.ts +5 -0
  28. package/dist/cli/commands/validate.d.ts.map +1 -0
  29. package/dist/cli/commands/validate.js +126 -0
  30. package/dist/cli/commands/validate.js.map +1 -0
  31. package/dist/cli/container.d.ts +48 -0
  32. package/dist/cli/container.d.ts.map +1 -0
  33. package/dist/cli/container.js +49 -0
  34. package/dist/cli/container.js.map +1 -0
  35. package/dist/cli/index.d.ts +8 -0
  36. package/dist/cli/index.d.ts.map +1 -0
  37. package/dist/cli/index.js +9 -0
  38. package/dist/cli/index.js.map +1 -0
  39. package/dist/cli/middleware.d.ts +118 -0
  40. package/dist/cli/middleware.d.ts.map +1 -0
  41. package/dist/cli/middleware.js +280 -0
  42. package/dist/cli/middleware.js.map +1 -0
  43. package/dist/cli/runner.d.ts +34 -0
  44. package/dist/cli/runner.d.ts.map +1 -0
  45. package/dist/cli/runner.js +156 -0
  46. package/dist/cli/runner.js.map +1 -0
  47. package/dist/cli/utils/defaults.d.ts +23 -0
  48. package/dist/cli/utils/defaults.d.ts.map +1 -0
  49. package/dist/cli/utils/defaults.js +43 -0
  50. package/dist/cli/utils/defaults.js.map +1 -0
  51. package/dist/core/error.d.ts +117 -0
  52. package/dist/core/error.d.ts.map +1 -0
  53. package/dist/core/error.js +210 -0
  54. package/dist/core/error.js.map +1 -0
  55. package/dist/core/index.d.ts +6 -0
  56. package/dist/core/index.d.ts.map +1 -0
  57. package/dist/core/index.js +6 -0
  58. package/dist/core/index.js.map +1 -0
  59. package/dist/core/logger.d.ts +31 -0
  60. package/dist/core/logger.d.ts.map +1 -0
  61. package/dist/core/logger.js +78 -0
  62. package/dist/core/logger.js.map +1 -0
  63. package/dist/core/path.d.ts +57 -0
  64. package/dist/core/path.d.ts.map +1 -0
  65. package/dist/core/path.js +154 -0
  66. package/dist/core/path.js.map +1 -0
  67. package/dist/core/result.d.ts +80 -0
  68. package/dist/core/result.d.ts.map +1 -0
  69. package/dist/core/result.js +150 -0
  70. package/dist/core/result.js.map +1 -0
  71. package/dist/core/types.d.ts +80 -0
  72. package/dist/core/types.d.ts.map +1 -0
  73. package/dist/core/types.js +5 -0
  74. package/dist/core/types.js.map +1 -0
  75. package/dist/generator/external-substitutions.d.ts +21 -0
  76. package/dist/generator/external-substitutions.d.ts.map +1 -0
  77. package/dist/generator/external-substitutions.js +49 -0
  78. package/dist/generator/external-substitutions.js.map +1 -0
  79. package/dist/generator/flux.d.ts +61 -0
  80. package/dist/generator/flux.d.ts.map +1 -0
  81. package/dist/generator/flux.js +294 -0
  82. package/dist/generator/flux.js.map +1 -0
  83. package/dist/generator/generator.d.ts +77 -0
  84. package/dist/generator/generator.d.ts.map +1 -0
  85. package/dist/generator/generator.js +183 -0
  86. package/dist/generator/generator.js.map +1 -0
  87. package/dist/generator/index.d.ts +9 -0
  88. package/dist/generator/index.d.ts.map +1 -0
  89. package/dist/generator/index.js +9 -0
  90. package/dist/generator/index.js.map +1 -0
  91. package/dist/generator/kustomization-resolution.d.ts +40 -0
  92. package/dist/generator/kustomization-resolution.d.ts.map +1 -0
  93. package/dist/generator/kustomization-resolution.js +59 -0
  94. package/dist/generator/kustomization-resolution.js.map +1 -0
  95. package/dist/generator/namespace.d.ts +74 -0
  96. package/dist/generator/namespace.d.ts.map +1 -0
  97. package/dist/generator/namespace.js +109 -0
  98. package/dist/generator/namespace.js.map +1 -0
  99. package/dist/generator/output.d.ts +56 -0
  100. package/dist/generator/output.d.ts.map +1 -0
  101. package/dist/generator/output.js +171 -0
  102. package/dist/generator/output.js.map +1 -0
  103. package/dist/generator/preservation.d.ts +45 -0
  104. package/dist/generator/preservation.d.ts.map +1 -0
  105. package/dist/generator/preservation.js +71 -0
  106. package/dist/generator/preservation.js.map +1 -0
  107. package/dist/generator/substitution.d.ts +79 -0
  108. package/dist/generator/substitution.d.ts.map +1 -0
  109. package/dist/generator/substitution.js +210 -0
  110. package/dist/generator/substitution.js.map +1 -0
  111. package/dist/generator/types.d.ts +162 -0
  112. package/dist/generator/types.d.ts.map +1 -0
  113. package/dist/generator/types.js +2 -0
  114. package/dist/generator/types.js.map +1 -0
  115. package/dist/generator/validation/cycle-detection.d.ts +25 -0
  116. package/dist/generator/validation/cycle-detection.d.ts.map +1 -0
  117. package/dist/generator/validation/cycle-detection.js +101 -0
  118. package/dist/generator/validation/cycle-detection.js.map +1 -0
  119. package/dist/generator/validation/enablement.d.ts +24 -0
  120. package/dist/generator/validation/enablement.d.ts.map +1 -0
  121. package/dist/generator/validation/enablement.js +69 -0
  122. package/dist/generator/validation/enablement.js.map +1 -0
  123. package/dist/generator/validation/graph.d.ts +29 -0
  124. package/dist/generator/validation/graph.d.ts.map +1 -0
  125. package/dist/generator/validation/graph.js +106 -0
  126. package/dist/generator/validation/graph.js.map +1 -0
  127. package/dist/generator/validation/index.d.ts +38 -0
  128. package/dist/generator/validation/index.d.ts.map +1 -0
  129. package/dist/generator/validation/index.js +64 -0
  130. package/dist/generator/validation/index.js.map +1 -0
  131. package/dist/generator/validation/reference.d.ts +45 -0
  132. package/dist/generator/validation/reference.d.ts.map +1 -0
  133. package/dist/generator/validation/reference.js +143 -0
  134. package/dist/generator/validation/reference.js.map +1 -0
  135. package/dist/generator/validation/requirements.d.ts +25 -0
  136. package/dist/generator/validation/requirements.d.ts.map +1 -0
  137. package/dist/generator/validation/requirements.js +64 -0
  138. package/dist/generator/validation/requirements.js.map +1 -0
  139. package/dist/generator/validation/types.d.ts +116 -0
  140. package/dist/generator/validation/types.d.ts.map +1 -0
  141. package/dist/generator/validation/types.js +13 -0
  142. package/dist/generator/validation/types.js.map +1 -0
  143. package/dist/k8s/exec.d.ts +20 -0
  144. package/dist/k8s/exec.d.ts.map +1 -0
  145. package/dist/k8s/exec.js +47 -0
  146. package/dist/k8s/exec.js.map +1 -0
  147. package/dist/k8s/flux.d.ts +57 -0
  148. package/dist/k8s/flux.d.ts.map +1 -0
  149. package/dist/k8s/flux.js +202 -0
  150. package/dist/k8s/flux.js.map +1 -0
  151. package/dist/k8s/index.d.ts +6 -0
  152. package/dist/k8s/index.d.ts.map +1 -0
  153. package/dist/k8s/index.js +6 -0
  154. package/dist/k8s/index.js.map +1 -0
  155. package/dist/k8s/kubeconfig.d.ts +45 -0
  156. package/dist/k8s/kubeconfig.d.ts.map +1 -0
  157. package/dist/k8s/kubeconfig.js +152 -0
  158. package/dist/k8s/kubeconfig.js.map +1 -0
  159. package/dist/k8s/kubectl.d.ts +68 -0
  160. package/dist/k8s/kubectl.d.ts.map +1 -0
  161. package/dist/k8s/kubectl.js +187 -0
  162. package/dist/k8s/kubectl.js.map +1 -0
  163. package/dist/k8s/types.d.ts +65 -0
  164. package/dist/k8s/types.d.ts.map +1 -0
  165. package/dist/k8s/types.js +2 -0
  166. package/dist/k8s/types.js.map +1 -0
  167. package/dist/loader/file.d.ts +39 -0
  168. package/dist/loader/file.d.ts.map +1 -0
  169. package/dist/loader/file.js +121 -0
  170. package/dist/loader/file.js.map +1 -0
  171. package/dist/loader/index.d.ts +5 -0
  172. package/dist/loader/index.d.ts.map +1 -0
  173. package/dist/loader/index.js +5 -0
  174. package/dist/loader/index.js.map +1 -0
  175. package/dist/loader/profile.d.ts +23 -0
  176. package/dist/loader/profile.d.ts.map +1 -0
  177. package/dist/loader/profile.js +84 -0
  178. package/dist/loader/profile.js.map +1 -0
  179. package/dist/loader/project.d.ts +76 -0
  180. package/dist/loader/project.d.ts.map +1 -0
  181. package/dist/loader/project.js +279 -0
  182. package/dist/loader/project.js.map +1 -0
  183. package/dist/loader/yaml.d.ts +15 -0
  184. package/dist/loader/yaml.d.ts.map +1 -0
  185. package/dist/loader/yaml.js +44 -0
  186. package/dist/loader/yaml.js.map +1 -0
  187. package/dist/nodes/index.d.ts +5 -0
  188. package/dist/nodes/index.d.ts.map +1 -0
  189. package/dist/nodes/index.js +5 -0
  190. package/dist/nodes/index.js.map +1 -0
  191. package/dist/nodes/kubectl-labeler.d.ts +7 -0
  192. package/dist/nodes/kubectl-labeler.d.ts.map +1 -0
  193. package/dist/nodes/kubectl-labeler.js +89 -0
  194. package/dist/nodes/kubectl-labeler.js.map +1 -0
  195. package/dist/nodes/labeler.d.ts +74 -0
  196. package/dist/nodes/labeler.d.ts.map +1 -0
  197. package/dist/nodes/labeler.js +118 -0
  198. package/dist/nodes/labeler.js.map +1 -0
  199. package/dist/nodes/profile.d.ts +58 -0
  200. package/dist/nodes/profile.d.ts.map +1 -0
  201. package/dist/nodes/profile.js +128 -0
  202. package/dist/nodes/profile.js.map +1 -0
  203. package/dist/nodes/types.d.ts +84 -0
  204. package/dist/nodes/types.d.ts.map +1 -0
  205. package/dist/nodes/types.js +77 -0
  206. package/dist/nodes/types.js.map +1 -0
  207. package/dist/plugins/generators.d.ts +49 -0
  208. package/dist/plugins/generators.d.ts.map +1 -0
  209. package/dist/plugins/generators.js +7 -0
  210. package/dist/plugins/generators.js.map +1 -0
  211. package/dist/plugins/hooks.d.ts +120 -0
  212. package/dist/plugins/hooks.d.ts.map +1 -0
  213. package/dist/plugins/hooks.js +41 -0
  214. package/dist/plugins/hooks.js.map +1 -0
  215. package/dist/plugins/index.d.ts +8 -0
  216. package/dist/plugins/index.d.ts.map +1 -0
  217. package/dist/plugins/index.js +15 -0
  218. package/dist/plugins/index.js.map +1 -0
  219. package/dist/plugins/loader.d.ts +40 -0
  220. package/dist/plugins/loader.d.ts.map +1 -0
  221. package/dist/plugins/loader.js +236 -0
  222. package/dist/plugins/loader.js.map +1 -0
  223. package/dist/plugins/object-types.d.ts +71 -0
  224. package/dist/plugins/object-types.d.ts.map +1 -0
  225. package/dist/plugins/object-types.js +65 -0
  226. package/dist/plugins/object-types.js.map +1 -0
  227. package/dist/plugins/registry.d.ts +87 -0
  228. package/dist/plugins/registry.d.ts.map +1 -0
  229. package/dist/plugins/registry.js +158 -0
  230. package/dist/plugins/registry.js.map +1 -0
  231. package/dist/plugins/substitution-providers.d.ts +48 -0
  232. package/dist/plugins/substitution-providers.d.ts.map +1 -0
  233. package/dist/plugins/substitution-providers.js +2 -0
  234. package/dist/plugins/substitution-providers.js.map +1 -0
  235. package/dist/plugins/types.d.ts +288 -0
  236. package/dist/plugins/types.d.ts.map +1 -0
  237. package/dist/plugins/types.js +25 -0
  238. package/dist/plugins/types.js.map +1 -0
  239. package/dist/registry/auth.d.ts +14 -0
  240. package/dist/registry/auth.d.ts.map +1 -0
  241. package/dist/registry/auth.js +40 -0
  242. package/dist/registry/auth.js.map +1 -0
  243. package/dist/registry/client.d.ts +24 -0
  244. package/dist/registry/client.d.ts.map +1 -0
  245. package/dist/registry/client.js +85 -0
  246. package/dist/registry/client.js.map +1 -0
  247. package/dist/registry/dockerhub.d.ts +6 -0
  248. package/dist/registry/dockerhub.d.ts.map +1 -0
  249. package/dist/registry/dockerhub.js +91 -0
  250. package/dist/registry/dockerhub.js.map +1 -0
  251. package/dist/registry/ghcr.d.ts +6 -0
  252. package/dist/registry/ghcr.d.ts.map +1 -0
  253. package/dist/registry/ghcr.js +95 -0
  254. package/dist/registry/ghcr.js.map +1 -0
  255. package/dist/registry/helm.d.ts +11 -0
  256. package/dist/registry/helm.d.ts.map +1 -0
  257. package/dist/registry/helm.js +124 -0
  258. package/dist/registry/helm.js.map +1 -0
  259. package/dist/registry/index.d.ts +8 -0
  260. package/dist/registry/index.d.ts.map +1 -0
  261. package/dist/registry/index.js +12 -0
  262. package/dist/registry/index.js.map +1 -0
  263. package/dist/registry/types.d.ts +55 -0
  264. package/dist/registry/types.d.ts.map +1 -0
  265. package/dist/registry/types.js +2 -0
  266. package/dist/registry/types.js.map +1 -0
  267. package/dist/registry/version.d.ts +22 -0
  268. package/dist/registry/version.d.ts.map +1 -0
  269. package/dist/registry/version.js +62 -0
  270. package/dist/registry/version.js.map +1 -0
  271. package/dist/schema/cluster.d.ts +2890 -0
  272. package/dist/schema/cluster.d.ts.map +1 -0
  273. package/dist/schema/cluster.js +231 -0
  274. package/dist/schema/cluster.js.map +1 -0
  275. package/dist/schema/common.d.ts +1059 -0
  276. package/dist/schema/common.d.ts.map +1 -0
  277. package/dist/schema/common.js +340 -0
  278. package/dist/schema/common.js.map +1 -0
  279. package/dist/schema/index.d.ts +8 -0
  280. package/dist/schema/index.d.ts.map +1 -0
  281. package/dist/schema/index.js +8 -0
  282. package/dist/schema/index.js.map +1 -0
  283. package/dist/schema/node-list.d.ts +361 -0
  284. package/dist/schema/node-list.d.ts.map +1 -0
  285. package/dist/schema/node-list.js +104 -0
  286. package/dist/schema/node-list.js.map +1 -0
  287. package/dist/schema/profile.d.ts +166 -0
  288. package/dist/schema/profile.d.ts.map +1 -0
  289. package/dist/schema/profile.js +61 -0
  290. package/dist/schema/profile.js.map +1 -0
  291. package/dist/schema/project.d.ts +168 -0
  292. package/dist/schema/project.d.ts.map +1 -0
  293. package/dist/schema/project.js +40 -0
  294. package/dist/schema/project.js.map +1 -0
  295. package/dist/schema/sources.d.ts +338 -0
  296. package/dist/schema/sources.d.ts.map +1 -0
  297. package/dist/schema/sources.js +111 -0
  298. package/dist/schema/sources.js.map +1 -0
  299. package/dist/schema/template.d.ts +2711 -0
  300. package/dist/schema/template.d.ts.map +1 -0
  301. package/dist/schema/template.js +97 -0
  302. package/dist/schema/template.js.map +1 -0
  303. package/dist/sources/cache/index.d.ts +9 -0
  304. package/dist/sources/cache/index.d.ts.map +1 -0
  305. package/dist/sources/cache/index.js +278 -0
  306. package/dist/sources/cache/index.js.map +1 -0
  307. package/dist/sources/cache/metadata.d.ts +36 -0
  308. package/dist/sources/cache/metadata.d.ts.map +1 -0
  309. package/dist/sources/cache/metadata.js +21 -0
  310. package/dist/sources/cache/metadata.js.map +1 -0
  311. package/dist/sources/cache/ttl.d.ts +20 -0
  312. package/dist/sources/cache/ttl.d.ts.map +1 -0
  313. package/dist/sources/cache/ttl.js +53 -0
  314. package/dist/sources/cache/ttl.js.map +1 -0
  315. package/dist/sources/fetchers/git.d.ts +6 -0
  316. package/dist/sources/fetchers/git.d.ts.map +1 -0
  317. package/dist/sources/fetchers/git.js +165 -0
  318. package/dist/sources/fetchers/git.js.map +1 -0
  319. package/dist/sources/fetchers/http.d.ts +6 -0
  320. package/dist/sources/fetchers/http.d.ts.map +1 -0
  321. package/dist/sources/fetchers/http.js +159 -0
  322. package/dist/sources/fetchers/http.js.map +1 -0
  323. package/dist/sources/fetchers/index.d.ts +11 -0
  324. package/dist/sources/fetchers/index.d.ts.map +1 -0
  325. package/dist/sources/fetchers/index.js +24 -0
  326. package/dist/sources/fetchers/index.js.map +1 -0
  327. package/dist/sources/fetchers/oci.d.ts +6 -0
  328. package/dist/sources/fetchers/oci.d.ts.map +1 -0
  329. package/dist/sources/fetchers/oci.js +156 -0
  330. package/dist/sources/fetchers/oci.js.map +1 -0
  331. package/dist/sources/fetchers/types.d.ts +25 -0
  332. package/dist/sources/fetchers/types.d.ts.map +1 -0
  333. package/dist/sources/fetchers/types.js +2 -0
  334. package/dist/sources/fetchers/types.js.map +1 -0
  335. package/dist/sources/index.d.ts +6 -0
  336. package/dist/sources/index.d.ts.map +1 -0
  337. package/dist/sources/index.js +10 -0
  338. package/dist/sources/index.js.map +1 -0
  339. package/dist/sources/loader.d.ts +34 -0
  340. package/dist/sources/loader.d.ts.map +1 -0
  341. package/dist/sources/loader.js +89 -0
  342. package/dist/sources/loader.js.map +1 -0
  343. package/dist/sources/resolver.d.ts +17 -0
  344. package/dist/sources/resolver.d.ts.map +1 -0
  345. package/dist/sources/resolver.js +125 -0
  346. package/dist/sources/resolver.js.map +1 -0
  347. package/dist/sources/types.d.ts +151 -0
  348. package/dist/sources/types.d.ts.map +1 -0
  349. package/dist/sources/types.js +2 -0
  350. package/dist/sources/types.js.map +1 -0
  351. package/package.json +101 -0
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Schema-level defaults (hardcoded fallbacks).
3
+ * These match the current behavior for 100% backward compatibility.
4
+ */
5
+ const SCHEMA_DEFAULTS = {
6
+ flux_namespace: 'flux-system',
7
+ oci_repository_name: 'kustodian-oci',
8
+ oci_registry_secret_name: 'kustodian-oci-registry',
9
+ flux_reconciliation_interval: '10m',
10
+ flux_reconciliation_timeout: '5m',
11
+ };
12
+ /**
13
+ * Resolves defaults for a cluster using three-tier cascading:
14
+ * 1. Cluster spec.defaults (highest priority)
15
+ * 2. Project spec.defaults
16
+ * 3. Schema defaults (hardcoded fallbacks)
17
+ *
18
+ * @param cluster - The cluster configuration
19
+ * @param project_config - Optional project configuration from kustodian.yaml
20
+ * @returns Resolved defaults with all values defined
21
+ */
22
+ export function resolve_defaults(cluster, project_config) {
23
+ const project_defaults = project_config?.spec?.defaults || {};
24
+ const cluster_defaults = cluster.spec.defaults || {};
25
+ return {
26
+ flux_namespace: cluster_defaults.flux_namespace ||
27
+ project_defaults.flux_namespace ||
28
+ SCHEMA_DEFAULTS.flux_namespace,
29
+ oci_repository_name: cluster_defaults.oci_repository_name ||
30
+ project_defaults.oci_repository_name ||
31
+ SCHEMA_DEFAULTS.oci_repository_name,
32
+ oci_registry_secret_name: cluster_defaults.oci_registry_secret_name ||
33
+ project_defaults.oci_registry_secret_name ||
34
+ SCHEMA_DEFAULTS.oci_registry_secret_name,
35
+ flux_reconciliation_interval: cluster_defaults.flux_reconciliation_interval ||
36
+ project_defaults.flux_reconciliation_interval ||
37
+ SCHEMA_DEFAULTS.flux_reconciliation_interval,
38
+ flux_reconciliation_timeout: cluster_defaults.flux_reconciliation_timeout ||
39
+ project_defaults.flux_reconciliation_timeout ||
40
+ SCHEMA_DEFAULTS.flux_reconciliation_timeout,
41
+ };
42
+ }
43
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../../src/cli/utils/defaults.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB,cAAc,EAAE,aAAa;IAC7B,mBAAmB,EAAE,eAAe;IACpC,wBAAwB,EAAE,wBAAwB;IAClD,4BAA4B,EAAE,KAAK;IACnC,2BAA2B,EAAE,IAAI;CACzB,CAAC;AAaX;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAoB,EACpB,cAAkC;IAElC,MAAM,gBAAgB,GAAG,cAAc,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC;IAC9D,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;IAErD,OAAO;QACL,cAAc,EACZ,gBAAgB,CAAC,cAAc;YAC/B,gBAAgB,CAAC,cAAc;YAC/B,eAAe,CAAC,cAAc;QAEhC,mBAAmB,EACjB,gBAAgB,CAAC,mBAAmB;YACpC,gBAAgB,CAAC,mBAAmB;YACpC,eAAe,CAAC,mBAAmB;QAErC,wBAAwB,EACtB,gBAAgB,CAAC,wBAAwB;YACzC,gBAAgB,CAAC,wBAAwB;YACzC,eAAe,CAAC,wBAAwB;QAE1C,4BAA4B,EAC1B,gBAAgB,CAAC,4BAA4B;YAC7C,gBAAgB,CAAC,4BAA4B;YAC7C,eAAe,CAAC,4BAA4B;QAE9C,2BAA2B,EACzB,gBAAgB,CAAC,2BAA2B;YAC5C,gBAAgB,CAAC,2BAA2B;YAC5C,eAAe,CAAC,2BAA2B;KAC9C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Base error type for all Kustodian errors.
3
+ */
4
+ export interface KustodianErrorType {
5
+ readonly code: string;
6
+ readonly message: string;
7
+ readonly cause?: unknown;
8
+ }
9
+ /**
10
+ * Creates a Kustodian error.
11
+ */
12
+ export declare function create_error(code: string, message: string, cause?: unknown): KustodianErrorType;
13
+ /**
14
+ * Error codes for common operations.
15
+ */
16
+ export declare const ErrorCodes: {
17
+ readonly UNKNOWN: "UNKNOWN";
18
+ readonly INVALID_ARGUMENT: "INVALID_ARGUMENT";
19
+ readonly NOT_FOUND: "NOT_FOUND";
20
+ readonly ALREADY_EXISTS: "ALREADY_EXISTS";
21
+ readonly FILE_NOT_FOUND: "FILE_NOT_FOUND";
22
+ readonly FILE_READ_ERROR: "FILE_READ_ERROR";
23
+ readonly FILE_WRITE_ERROR: "FILE_WRITE_ERROR";
24
+ readonly DIRECTORY_NOT_FOUND: "DIRECTORY_NOT_FOUND";
25
+ readonly PARSE_ERROR: "PARSE_ERROR";
26
+ readonly YAML_PARSE_ERROR: "YAML_PARSE_ERROR";
27
+ readonly JSON_PARSE_ERROR: "JSON_PARSE_ERROR";
28
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
29
+ readonly SCHEMA_VALIDATION_ERROR: "SCHEMA_VALIDATION_ERROR";
30
+ readonly CONFIG_NOT_FOUND: "CONFIG_NOT_FOUND";
31
+ readonly CONFIG_INVALID: "CONFIG_INVALID";
32
+ readonly TEMPLATE_NOT_FOUND: "TEMPLATE_NOT_FOUND";
33
+ readonly CLUSTER_NOT_FOUND: "CLUSTER_NOT_FOUND";
34
+ readonly PROFILE_NOT_FOUND: "PROFILE_NOT_FOUND";
35
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
36
+ readonly CONNECTION_REFUSED: "CONNECTION_REFUSED";
37
+ readonly TIMEOUT: "TIMEOUT";
38
+ readonly SSH_CONNECTION_ERROR: "SSH_CONNECTION_ERROR";
39
+ readonly SSH_AUTH_ERROR: "SSH_AUTH_ERROR";
40
+ readonly SSH_COMMAND_ERROR: "SSH_COMMAND_ERROR";
41
+ readonly K8S_CONNECTION_ERROR: "K8S_CONNECTION_ERROR";
42
+ readonly K8S_API_ERROR: "K8S_API_ERROR";
43
+ readonly NODE_NOT_READY: "NODE_NOT_READY";
44
+ readonly BOOTSTRAP_ERROR: "BOOTSTRAP_ERROR";
45
+ readonly BOOTSTRAP_STATE_ERROR: "BOOTSTRAP_STATE_ERROR";
46
+ readonly CLUSTER_PROVIDER_ERROR: "CLUSTER_PROVIDER_ERROR";
47
+ readonly PLUGIN_NOT_FOUND: "PLUGIN_NOT_FOUND";
48
+ readonly PLUGIN_LOAD_ERROR: "PLUGIN_LOAD_ERROR";
49
+ readonly PLUGIN_EXECUTION_ERROR: "PLUGIN_EXECUTION_ERROR";
50
+ readonly DEPENDENCY_CYCLE: "DEPENDENCY_CYCLE";
51
+ readonly DEPENDENCY_MISSING: "DEPENDENCY_MISSING";
52
+ readonly DEPENDENCY_SELF_REFERENCE: "DEPENDENCY_SELF_REFERENCE";
53
+ readonly DEPENDENCY_VALIDATION_ERROR: "DEPENDENCY_VALIDATION_ERROR";
54
+ readonly SECRET_CLI_NOT_FOUND: "SECRET_CLI_NOT_FOUND";
55
+ readonly SECRET_NOT_FOUND: "SECRET_NOT_FOUND";
56
+ readonly SECRET_AUTH_ERROR: "SECRET_AUTH_ERROR";
57
+ readonly SECRET_TIMEOUT: "SECRET_TIMEOUT";
58
+ readonly SOURCE_FETCH_ERROR: "SOURCE_FETCH_ERROR";
59
+ readonly SOURCE_AUTH_ERROR: "SOURCE_AUTH_ERROR";
60
+ readonly SOURCE_TIMEOUT: "SOURCE_TIMEOUT";
61
+ readonly SOURCE_CHECKSUM_MISMATCH: "SOURCE_CHECKSUM_MISMATCH";
62
+ readonly SOURCE_VERSION_NOT_FOUND: "SOURCE_VERSION_NOT_FOUND";
63
+ readonly CACHE_READ_ERROR: "CACHE_READ_ERROR";
64
+ readonly CACHE_WRITE_ERROR: "CACHE_WRITE_ERROR";
65
+ readonly CACHE_CORRUPT: "CACHE_CORRUPT";
66
+ };
67
+ export type ErrorCodeType = (typeof ErrorCodes)[keyof typeof ErrorCodes];
68
+ /**
69
+ * Error factory functions for common error types.
70
+ */
71
+ export declare const Errors: {
72
+ readonly unknown: (message: string, cause?: unknown) => KustodianErrorType;
73
+ readonly invalid_argument: (argument: string, reason: string) => KustodianErrorType;
74
+ readonly not_found: (resource: string, identifier: string) => KustodianErrorType;
75
+ readonly already_exists: (resource: string, identifier: string) => KustodianErrorType;
76
+ readonly file_not_found: (path: string) => KustodianErrorType;
77
+ readonly file_read_error: (path: string, cause?: unknown) => KustodianErrorType;
78
+ readonly file_write_error: (path: string, cause?: unknown) => KustodianErrorType;
79
+ readonly parse_error: (format: string, message: string, cause?: unknown) => KustodianErrorType;
80
+ readonly yaml_parse_error: (message: string, cause?: unknown) => KustodianErrorType;
81
+ readonly validation_error: (message: string, cause?: unknown) => KustodianErrorType;
82
+ readonly schema_validation_error: (errors: string[]) => KustodianErrorType;
83
+ readonly config_not_found: (config_type: string, path: string) => KustodianErrorType;
84
+ readonly template_not_found: (name: string) => KustodianErrorType;
85
+ readonly cluster_not_found: (name: string) => KustodianErrorType;
86
+ readonly profile_not_found: (name: string) => KustodianErrorType;
87
+ readonly ssh_connection_error: (host: string, cause?: unknown) => KustodianErrorType;
88
+ readonly ssh_auth_error: (host: string, cause?: unknown) => KustodianErrorType;
89
+ readonly bootstrap_error: (message: string, cause?: unknown) => KustodianErrorType;
90
+ readonly plugin_not_found: (name: string) => KustodianErrorType;
91
+ readonly plugin_load_error: (name: string, cause?: unknown) => KustodianErrorType;
92
+ readonly dependency_cycle: (cycle: string[]) => KustodianErrorType;
93
+ readonly dependency_missing: (source: string, target: string) => KustodianErrorType;
94
+ readonly dependency_self_reference: (node: string) => KustodianErrorType;
95
+ readonly dependency_validation_error: (errors: string[]) => KustodianErrorType;
96
+ readonly secret_cli_not_found: (provider: string, cli_name: string) => KustodianErrorType;
97
+ readonly secret_not_found: (provider: string, ref: string) => KustodianErrorType;
98
+ readonly secret_auth_error: (provider: string, cause?: unknown) => KustodianErrorType;
99
+ readonly secret_timeout: (provider: string, timeout: number) => KustodianErrorType;
100
+ readonly source_fetch_error: (source: string, cause?: unknown) => KustodianErrorType;
101
+ readonly source_auth_error: (source: string, cause?: unknown) => KustodianErrorType;
102
+ readonly source_timeout: (source: string, timeout: number) => KustodianErrorType;
103
+ readonly source_checksum_mismatch: (source: string, expected: string, actual: string) => KustodianErrorType;
104
+ readonly source_version_not_found: (source: string, version: string) => KustodianErrorType;
105
+ readonly cache_read_error: (path: string, cause?: unknown) => KustodianErrorType;
106
+ readonly cache_write_error: (path: string, cause?: unknown) => KustodianErrorType;
107
+ readonly cache_corrupt: (path: string) => KustodianErrorType;
108
+ };
109
+ /**
110
+ * Formats a KustodianError for display.
111
+ */
112
+ export declare function format_error(error: KustodianErrorType): string;
113
+ /**
114
+ * Type guard to check if an error is a KustodianError.
115
+ */
116
+ export declare function is_kustodian_error(error: unknown): error is KustodianErrorType;
117
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/core/error.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,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AkB;0CAK1B,MAAM,UAAU,MAAM,KAAG,kBAAkB;+CAOtC,MAAM,KAAG,kBAAkB;mDAOvB,MAAM,EAAE,KAAG,kBAAkB;8CAOlC,MAAM,YAAY,MAAM,KAAG,kBAAkB;0CAOjD,MAAM,OAAO,MAAM,KAAG,kBAAkB;2CAIvC,MAAM,UAAU,OAAO,KAAG,kBAAkB;wCAQ/C,MAAM,WAAW,MAAM,KAAG,kBAAkB;0CAO1C,MAAM,UAAU,OAAO,KAAG,kBAAkB;yCAQ7C,MAAM,UAAU,OAAO,KAAG,kBAAkB;sCAQ/C,MAAM,WAAW,MAAM,KAAG,kBAAkB;gDAOlC,MAAM,YAAY,MAAM,UAAU,MAAM,KAAG,kBAAkB;gDAO7D,MAAM,WAAW,MAAM,KAAG,kBAAkB;sCAOtD,MAAM,UAAU,OAAO,KAAG,kBAAkB;uCAI3C,MAAM,UAAU,OAAO,KAAG,kBAAkB;mCAIhD,MAAM,KAAG,kBAAkB;CAGvC,CAAC;AAEX;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,kBAAkB,GAAG,MAAM,CAM9D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,kBAAkB,CAS9E"}
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Creates a Kustodian error.
3
+ */
4
+ export function create_error(code, message, cause) {
5
+ return { code, message, cause };
6
+ }
7
+ /**
8
+ * Error codes for common operations.
9
+ */
10
+ export const ErrorCodes = {
11
+ // General errors
12
+ UNKNOWN: 'UNKNOWN',
13
+ INVALID_ARGUMENT: 'INVALID_ARGUMENT',
14
+ NOT_FOUND: 'NOT_FOUND',
15
+ ALREADY_EXISTS: 'ALREADY_EXISTS',
16
+ // IO errors
17
+ FILE_NOT_FOUND: 'FILE_NOT_FOUND',
18
+ FILE_READ_ERROR: 'FILE_READ_ERROR',
19
+ FILE_WRITE_ERROR: 'FILE_WRITE_ERROR',
20
+ DIRECTORY_NOT_FOUND: 'DIRECTORY_NOT_FOUND',
21
+ // Parsing errors
22
+ PARSE_ERROR: 'PARSE_ERROR',
23
+ YAML_PARSE_ERROR: 'YAML_PARSE_ERROR',
24
+ JSON_PARSE_ERROR: 'JSON_PARSE_ERROR',
25
+ // Validation errors
26
+ VALIDATION_ERROR: 'VALIDATION_ERROR',
27
+ SCHEMA_VALIDATION_ERROR: 'SCHEMA_VALIDATION_ERROR',
28
+ // Configuration errors
29
+ CONFIG_NOT_FOUND: 'CONFIG_NOT_FOUND',
30
+ CONFIG_INVALID: 'CONFIG_INVALID',
31
+ TEMPLATE_NOT_FOUND: 'TEMPLATE_NOT_FOUND',
32
+ CLUSTER_NOT_FOUND: 'CLUSTER_NOT_FOUND',
33
+ PROFILE_NOT_FOUND: 'PROFILE_NOT_FOUND',
34
+ // Network errors
35
+ NETWORK_ERROR: 'NETWORK_ERROR',
36
+ CONNECTION_REFUSED: 'CONNECTION_REFUSED',
37
+ TIMEOUT: 'TIMEOUT',
38
+ // SSH errors
39
+ SSH_CONNECTION_ERROR: 'SSH_CONNECTION_ERROR',
40
+ SSH_AUTH_ERROR: 'SSH_AUTH_ERROR',
41
+ SSH_COMMAND_ERROR: 'SSH_COMMAND_ERROR',
42
+ // Kubernetes errors
43
+ K8S_CONNECTION_ERROR: 'K8S_CONNECTION_ERROR',
44
+ K8S_API_ERROR: 'K8S_API_ERROR',
45
+ NODE_NOT_READY: 'NODE_NOT_READY',
46
+ // Bootstrap errors
47
+ BOOTSTRAP_ERROR: 'BOOTSTRAP_ERROR',
48
+ BOOTSTRAP_STATE_ERROR: 'BOOTSTRAP_STATE_ERROR',
49
+ CLUSTER_PROVIDER_ERROR: 'CLUSTER_PROVIDER_ERROR',
50
+ // Plugin errors
51
+ PLUGIN_NOT_FOUND: 'PLUGIN_NOT_FOUND',
52
+ PLUGIN_LOAD_ERROR: 'PLUGIN_LOAD_ERROR',
53
+ PLUGIN_EXECUTION_ERROR: 'PLUGIN_EXECUTION_ERROR',
54
+ // Dependency graph errors
55
+ DEPENDENCY_CYCLE: 'DEPENDENCY_CYCLE',
56
+ DEPENDENCY_MISSING: 'DEPENDENCY_MISSING',
57
+ DEPENDENCY_SELF_REFERENCE: 'DEPENDENCY_SELF_REFERENCE',
58
+ DEPENDENCY_VALIDATION_ERROR: 'DEPENDENCY_VALIDATION_ERROR',
59
+ // Secret provider errors
60
+ SECRET_CLI_NOT_FOUND: 'SECRET_CLI_NOT_FOUND',
61
+ SECRET_NOT_FOUND: 'SECRET_NOT_FOUND',
62
+ SECRET_AUTH_ERROR: 'SECRET_AUTH_ERROR',
63
+ SECRET_TIMEOUT: 'SECRET_TIMEOUT',
64
+ // Source fetching errors
65
+ SOURCE_FETCH_ERROR: 'SOURCE_FETCH_ERROR',
66
+ SOURCE_AUTH_ERROR: 'SOURCE_AUTH_ERROR',
67
+ SOURCE_TIMEOUT: 'SOURCE_TIMEOUT',
68
+ SOURCE_CHECKSUM_MISMATCH: 'SOURCE_CHECKSUM_MISMATCH',
69
+ SOURCE_VERSION_NOT_FOUND: 'SOURCE_VERSION_NOT_FOUND',
70
+ // Cache errors
71
+ CACHE_READ_ERROR: 'CACHE_READ_ERROR',
72
+ CACHE_WRITE_ERROR: 'CACHE_WRITE_ERROR',
73
+ CACHE_CORRUPT: 'CACHE_CORRUPT',
74
+ };
75
+ /**
76
+ * Error factory functions for common error types.
77
+ */
78
+ export const Errors = {
79
+ unknown(message, cause) {
80
+ return create_error(ErrorCodes.UNKNOWN, message, cause);
81
+ },
82
+ invalid_argument(argument, reason) {
83
+ return create_error(ErrorCodes.INVALID_ARGUMENT, `Invalid argument '${argument}': ${reason}`);
84
+ },
85
+ not_found(resource, identifier) {
86
+ return create_error(ErrorCodes.NOT_FOUND, `${resource} '${identifier}' not found`);
87
+ },
88
+ already_exists(resource, identifier) {
89
+ return create_error(ErrorCodes.ALREADY_EXISTS, `${resource} '${identifier}' already exists`);
90
+ },
91
+ file_not_found(path) {
92
+ return create_error(ErrorCodes.FILE_NOT_FOUND, `File not found: ${path}`);
93
+ },
94
+ file_read_error(path, cause) {
95
+ return create_error(ErrorCodes.FILE_READ_ERROR, `Failed to read file: ${path}`, cause);
96
+ },
97
+ file_write_error(path, cause) {
98
+ return create_error(ErrorCodes.FILE_WRITE_ERROR, `Failed to write file: ${path}`, cause);
99
+ },
100
+ parse_error(format, message, cause) {
101
+ return create_error(ErrorCodes.PARSE_ERROR, `Failed to parse ${format}: ${message}`, cause);
102
+ },
103
+ yaml_parse_error(message, cause) {
104
+ return create_error(ErrorCodes.YAML_PARSE_ERROR, `YAML parse error: ${message}`, cause);
105
+ },
106
+ validation_error(message, cause) {
107
+ return create_error(ErrorCodes.VALIDATION_ERROR, message, cause);
108
+ },
109
+ schema_validation_error(errors) {
110
+ return create_error(ErrorCodes.SCHEMA_VALIDATION_ERROR, `Schema validation failed:\n${errors.map((e) => ` - ${e}`).join('\n')}`);
111
+ },
112
+ config_not_found(config_type, path) {
113
+ return create_error(ErrorCodes.CONFIG_NOT_FOUND, `${config_type} configuration not found at: ${path}`);
114
+ },
115
+ template_not_found(name) {
116
+ return create_error(ErrorCodes.TEMPLATE_NOT_FOUND, `Template '${name}' not found`);
117
+ },
118
+ cluster_not_found(name) {
119
+ return create_error(ErrorCodes.CLUSTER_NOT_FOUND, `Cluster '${name}' not found`);
120
+ },
121
+ profile_not_found(name) {
122
+ return create_error(ErrorCodes.PROFILE_NOT_FOUND, `Node profile '${name}' not found`);
123
+ },
124
+ ssh_connection_error(host, cause) {
125
+ return create_error(ErrorCodes.SSH_CONNECTION_ERROR, `Failed to connect to ${host} via SSH`, cause);
126
+ },
127
+ ssh_auth_error(host, cause) {
128
+ return create_error(ErrorCodes.SSH_AUTH_ERROR, `SSH authentication failed for ${host}`, cause);
129
+ },
130
+ bootstrap_error(message, cause) {
131
+ return create_error(ErrorCodes.BOOTSTRAP_ERROR, `Bootstrap failed: ${message}`, cause);
132
+ },
133
+ plugin_not_found(name) {
134
+ return create_error(ErrorCodes.PLUGIN_NOT_FOUND, `Plugin '${name}' not found`);
135
+ },
136
+ plugin_load_error(name, cause) {
137
+ return create_error(ErrorCodes.PLUGIN_LOAD_ERROR, `Failed to load plugin '${name}'`, cause);
138
+ },
139
+ dependency_cycle(cycle) {
140
+ const cycle_str = cycle.join(' → ');
141
+ return create_error(ErrorCodes.DEPENDENCY_CYCLE, `Dependency cycle detected: ${cycle_str}`);
142
+ },
143
+ dependency_missing(source, target) {
144
+ return create_error(ErrorCodes.DEPENDENCY_MISSING, `Kustomization '${source}' depends on '${target}' which does not exist`);
145
+ },
146
+ dependency_self_reference(node) {
147
+ return create_error(ErrorCodes.DEPENDENCY_SELF_REFERENCE, `Kustomization '${node}' cannot depend on itself`);
148
+ },
149
+ dependency_validation_error(errors) {
150
+ return create_error(ErrorCodes.DEPENDENCY_VALIDATION_ERROR, `Dependency validation failed:\n${errors.map((e) => ` - ${e}`).join('\n')}`);
151
+ },
152
+ secret_cli_not_found(provider, cli_name) {
153
+ return create_error(ErrorCodes.SECRET_CLI_NOT_FOUND, `${provider} CLI (${cli_name}) not found. Please install it first.`);
154
+ },
155
+ secret_not_found(provider, ref) {
156
+ return create_error(ErrorCodes.SECRET_NOT_FOUND, `Secret not found in ${provider}: ${ref}`);
157
+ },
158
+ secret_auth_error(provider, cause) {
159
+ return create_error(ErrorCodes.SECRET_AUTH_ERROR, `${provider} authentication failed. Check your credentials.`, cause);
160
+ },
161
+ secret_timeout(provider, timeout) {
162
+ return create_error(ErrorCodes.SECRET_TIMEOUT, `${provider} operation timed out after ${timeout}ms`);
163
+ },
164
+ source_fetch_error(source, cause) {
165
+ return create_error(ErrorCodes.SOURCE_FETCH_ERROR, `Failed to fetch template source '${source}'`, cause);
166
+ },
167
+ source_auth_error(source, cause) {
168
+ return create_error(ErrorCodes.SOURCE_AUTH_ERROR, `Authentication failed for source '${source}'`, cause);
169
+ },
170
+ source_timeout(source, timeout) {
171
+ return create_error(ErrorCodes.SOURCE_TIMEOUT, `Source '${source}' operation timed out after ${timeout}ms`);
172
+ },
173
+ source_checksum_mismatch(source, expected, actual) {
174
+ return create_error(ErrorCodes.SOURCE_CHECKSUM_MISMATCH, `Checksum mismatch for '${source}': expected ${expected}, got ${actual}`);
175
+ },
176
+ source_version_not_found(source, version) {
177
+ return create_error(ErrorCodes.SOURCE_VERSION_NOT_FOUND, `Version '${version}' not found for source '${source}'`);
178
+ },
179
+ cache_read_error(path, cause) {
180
+ return create_error(ErrorCodes.CACHE_READ_ERROR, `Failed to read cache at: ${path}`, cause);
181
+ },
182
+ cache_write_error(path, cause) {
183
+ return create_error(ErrorCodes.CACHE_WRITE_ERROR, `Failed to write cache at: ${path}`, cause);
184
+ },
185
+ cache_corrupt(path) {
186
+ return create_error(ErrorCodes.CACHE_CORRUPT, `Cache is corrupt at: ${path}`);
187
+ },
188
+ };
189
+ /**
190
+ * Formats a KustodianError for display.
191
+ */
192
+ export function format_error(error) {
193
+ let message = `[${error.code}] ${error.message}`;
194
+ if (error.cause) {
195
+ message += `\nCaused by: ${String(error.cause)}`;
196
+ }
197
+ return message;
198
+ }
199
+ /**
200
+ * Type guard to check if an error is a KustodianError.
201
+ */
202
+ export function is_kustodian_error(error) {
203
+ return (typeof error === 'object' &&
204
+ error !== null &&
205
+ 'code' in error &&
206
+ 'message' in error &&
207
+ typeof error.code === 'string' &&
208
+ typeof error.message === 'string');
209
+ }
210
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/core/error.ts"],"names":[],"mappings":"AASA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,OAAe,EAAE,KAAe;IACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAClC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,iBAAiB;IACjB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,kBAAkB;IACpC,SAAS,E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,CAAC;AACJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './error.js';
2
+ export * from './logger.js';
3
+ export * from './path.js';
4
+ export * from './result.js';
5
+ export * from './types.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './error.js';
2
+ export * from './logger.js';
3
+ export * from './path.js';
4
+ export * from './result.js';
5
+ export * from './types.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Log levels supported by the logger.
3
+ */
4
+ export type LogLevelType = 'debug' | 'info' | 'warn' | 'error';
5
+ /**
6
+ * Logger interface used throughout Kustodian.
7
+ */
8
+ export interface LoggerType {
9
+ debug(message: string, context?: Record<string, unknown>): void;
10
+ info(message: string, context?: Record<string, unknown>): void;
11
+ warn(message: string, context?: Record<string, unknown>): void;
12
+ error(message: string, context?: Record<string, unknown>): void;
13
+ child(context: Record<string, unknown>): LoggerType;
14
+ }
15
+ /**
16
+ * Console logger implementation.
17
+ */
18
+ export interface ConsoleLoggerOptionsType {
19
+ level?: LogLevelType;
20
+ context?: Record<string, unknown>;
21
+ timestamp?: boolean;
22
+ }
23
+ /**
24
+ * Creates a console logger.
25
+ */
26
+ export declare function create_console_logger(options?: ConsoleLoggerOptionsType): LoggerType;
27
+ /**
28
+ * Creates a silent logger that discards all messages.
29
+ */
30
+ export declare function create_silent_logger(): LoggerType;
31
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/core/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAY/D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC/D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAChE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAiBD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,wBAA6B,GAAG,UAAU,CAgDxF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,CASjD"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Log level priority for filtering.
3
+ */
4
+ const LOG_LEVEL_PRIORITY = {
5
+ debug: 0,
6
+ info: 1,
7
+ warn: 2,
8
+ error: 3,
9
+ };
10
+ function format_timestamp() {
11
+ return new Date().toISOString();
12
+ }
13
+ function format_context(context) {
14
+ if (!context || Object.keys(context).length === 0) {
15
+ return '';
16
+ }
17
+ return ` ${JSON.stringify(context)}`;
18
+ }
19
+ function should_log(current_level, message_level) {
20
+ return LOG_LEVEL_PRIORITY[message_level] >= LOG_LEVEL_PRIORITY[current_level];
21
+ }
22
+ /**
23
+ * Creates a console logger.
24
+ */
25
+ export function create_console_logger(options = {}) {
26
+ const level = options.level ?? 'info';
27
+ const base_context = options.context ?? {};
28
+ const show_timestamp = options.timestamp ?? true;
29
+ function log(message_level, message, context) {
30
+ if (!should_log(level, message_level)) {
31
+ return;
32
+ }
33
+ const merged_context = { ...base_context, ...context };
34
+ const timestamp = show_timestamp ? `[${format_timestamp()}] ` : '';
35
+ const level_tag = `[${message_level.toUpperCase()}]`;
36
+ const context_str = format_context(merged_context);
37
+ const formatted = `${timestamp}${level_tag} ${message}${context_str}`;
38
+ switch (message_level) {
39
+ case 'debug':
40
+ console.debug(formatted);
41
+ break;
42
+ case 'info':
43
+ console.info(formatted);
44
+ break;
45
+ case 'warn':
46
+ console.warn(formatted);
47
+ break;
48
+ case 'error':
49
+ console.error(formatted);
50
+ break;
51
+ }
52
+ }
53
+ return {
54
+ debug: (message, context) => log('debug', message, context),
55
+ info: (message, context) => log('info', message, context),
56
+ warn: (message, context) => log('warn', message, context),
57
+ error: (message, context) => log('error', message, context),
58
+ child: (context) => create_console_logger({
59
+ level,
60
+ context: { ...base_context, ...context },
61
+ timestamp: show_timestamp,
62
+ }),
63
+ };
64
+ }
65
+ /**
66
+ * Creates a silent logger that discards all messages.
67
+ */
68
+ export function create_silent_logger() {
69
+ const noop = () => { };
70
+ return {
71
+ debug: noop,
72
+ info: noop,
73
+ warn: noop,
74
+ error: noop,
75
+ child: () => create_silent_logger(),
76
+ };
77
+ }
78
+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C;KACL,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,IAAI,GAAG,GAAS,EAAE,GAAE,CAAC,CAAC;IAC5B,OAAO;QACL,KAAK,EAAE,IAAI;QACX,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,IAAI;QACV,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,GAAG,EAAE,CAAC,oBAAoB,EAAE;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Normalizes a path, removing any leading "./" and trailing slashes.
3
+ */
4
+ export declare function normalize_path(path: string): string;
5
+ /**
6
+ * Joins path segments and normalizes the result.
7
+ */
8
+ export declare function join_paths(...segments: string[]): string;
9
+ /**
10
+ * Resolves a path relative to a base path.
11
+ */
12
+ export declare function resolve_path(base: string, path: string): string;
13
+ /**
14
+ * Gets the relative path from one path to another.
15
+ */
16
+ export declare function relative_path(from: string, to: string): string;
17
+ /**
18
+ * Gets the directory name from a path.
19
+ */
20
+ export declare function get_dirname(path: string): string;
21
+ /**
22
+ * Gets the file name from a path.
23
+ */
24
+ export declare function get_basename(path: string, ext?: string): string;
25
+ /**
26
+ * Gets the file extension from a path.
27
+ */
28
+ export declare function get_extension(path: string): string;
29
+ /**
30
+ * Checks if a path is absolute.
31
+ */
32
+ export declare function is_absolute_path(path: string): boolean;
33
+ /**
34
+ * Ensures a path starts with "./" for relative paths.
35
+ */
36
+ export declare function ensure_relative(path: string): string;
37
+ /**
38
+ * Removes the extension from a file path.
39
+ */
40
+ export declare function remove_extension(path: string): string;
41
+ /**
42
+ * Changes the extension of a file path.
43
+ */
44
+ export declare function change_extension(path: string, new_ext: string): string;
45
+ /**
46
+ * Checks if a path matches any of the given patterns (simple glob support).
47
+ */
48
+ export declare function matches_pattern(path: string, patterns: string[]): boolean;
49
+ /**
50
+ * Splits a path into its segments.
51
+ */
52
+ export declare function split_path(path: string): string[];
53
+ /**
54
+ * Gets the common prefix of multiple paths.
55
+ */
56
+ export declare function common_path_prefix(paths: string[]): string;
57
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/core/path.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASnD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAItE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAuBzE;AAED;;GAEG;AACH,wBAAgB,UAAU,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