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,48 @@
1
+ import type { z } from 'zod';
2
+ import type { KustodianErrorType, ResultType } from '../core/index.js';
3
+ import type { ClusterType, TemplateType } from '../schema/index.js';
4
+ /**
5
+ * Context provided to substitution providers during resolution.
6
+ */
7
+ export interface SubstitutionContextType {
8
+ /** Cluster configuration */
9
+ cluster: ClusterType;
10
+ /** All templates being processed */
11
+ templates: TemplateType[];
12
+ /** Plugin-specific configuration (optional) */
13
+ config?: Record<string, unknown> | undefined;
14
+ }
15
+ /**
16
+ * Substitution provider interface.
17
+ * Plugins implement this to provide custom substitution types (e.g., SOPS, Vault, AWS Secrets Manager).
18
+ */
19
+ export interface SubstitutionProviderType {
20
+ /**
21
+ * Unique type identifier for this provider (e.g., 'sops', 'vault', 'aws-secrets').
22
+ * This must match the 'type' field in substitution objects.
23
+ */
24
+ readonly type: string;
25
+ /**
26
+ * Zod schema for validating substitutions of this type.
27
+ * The schema should validate the structure of substitution objects with this provider's type.
28
+ */
29
+ readonly schema: z.ZodType<unknown>;
30
+ /**
31
+ * Resolves substitutions to key-value pairs.
32
+ *
33
+ * @param substitutions - Array of substitution objects to resolve (all of this provider's type)
34
+ * @param context - Context information including cluster config and templates
35
+ * @returns Result containing a map of substitution names to their resolved values
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * // Input substitutions:
40
+ * // [{ type: 'sops', name: 'db_password', file: 'secrets.enc.yaml', key: 'database.password' }]
41
+ * //
42
+ * // Returns:
43
+ * // { db_password: 'actual-secret-value' }
44
+ * ```
45
+ */
46
+ resolve(substitutions: unknown[], context: SubstitutionContextType): Promise<ResultType<Record<string, string>, KustodianErrorType>>;
47
+ }
48
+ //# sourceMappingURL=substitution-providers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"substitution-providers.d.ts","sourceRoot":"","sources":["../../src/plugins/substitution-providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,4BAA4B;IAC5B,OAAO,EAAE,WAAW,CAAC;IACrB,oCAAoC;IACpC,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC9C;AAED;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEpC;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CACL,aAAa,EAAE,OAAO,EAAE,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;CACpE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=substitution-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"substitution-providers.js","sourceRoot":"","sources":["../../src/plugins/substitution-providers.ts"],"names":[],"mappings":""}
@@ -0,0 +1,288 @@
1
+ import type { KustodianErrorType, ResultType } from '../core/index.js';
2
+ import type { NodeListType } from '../nodes/index.js';
3
+ import type { ClusterType, TemplateType } from '../schema/index.js';
4
+ import type { PluginGeneratorType } from './generators.js';
5
+ import type { PluginHookContributionType } from './hooks.js';
6
+ import type { PluginObjectTypeType } from './object-types.js';
7
+ import type { SubstitutionProviderType } from './substitution-providers.js';
8
+ /**
9
+ * Bootstrap options for cluster provisioning.
10
+ */
11
+ export interface BootstrapOptionsType {
12
+ dry_run?: boolean;
13
+ timeout?: number;
14
+ }
15
+ /**
16
+ * Reset options for cluster teardown.
17
+ */
18
+ export interface ResetOptionsType {
19
+ force?: boolean;
20
+ dry_run?: boolean;
21
+ }
22
+ /**
23
+ * Cluster provider interface.
24
+ * Implementations handle specific cluster technologies (k0s, Talos, etc.).
25
+ */
26
+ export interface ClusterProviderType {
27
+ /**
28
+ * Provider name (e.g., "k0s", "talos").
29
+ */
30
+ readonly name: string;
31
+ /**
32
+ * Validates the cluster configuration.
33
+ */
34
+ validate(node_list: NodeListType): ResultType<void, KustodianErrorType>;
35
+ /**
36
+ * Installs the cluster.
37
+ */
38
+ install(node_list: NodeListType, options: BootstrapOptionsType): Promise<ResultType<void, KustodianErrorType>>;
39
+ /**
40
+ * Gets the kubeconfig for the cluster.
41
+ */
42
+ get_kubeconfig(node_list: NodeListType): Promise<ResultType<string, KustodianErrorType>>;
43
+ /**
44
+ * Resets/destroys the cluster.
45
+ */
46
+ reset(node_list: NodeListType, options: ResetOptionsType): Promise<ResultType<void, KustodianErrorType>>;
47
+ }
48
+ /**
49
+ * Service identifier type (compatible with CLI container).
50
+ */
51
+ export type ServiceIdType<T> = symbol & {
52
+ __type?: T;
53
+ };
54
+ /**
55
+ * Factory function type for creating services.
56
+ */
57
+ export type FactoryType<T> = (container: ContainerType) => T;
58
+ /**
59
+ * Container interface for dependency injection (compatible with CLI container).
60
+ */
61
+ export interface ContainerType {
62
+ register_singleton<T>(id: ServiceIdType<T>, factory: FactoryType<T>): void;
63
+ register_transient<T>(id: ServiceIdType<T>, factory: FactoryType<T>): void;
64
+ register_instance<T>(id: ServiceIdType<T>, instance: T): void;
65
+ resolve<T>(id: ServiceIdType<T>): T;
66
+ has<T>(id: ServiceIdType<T>): boolean;
67
+ }
68
+ /**
69
+ * CLI option type (compatible with CLI command options).
70
+ */
71
+ export interface OptionType {
72
+ name: string;
73
+ short?: string;
74
+ description: string;
75
+ required?: boolean;
76
+ default_value?: unknown;
77
+ type?: 'string' | 'boolean' | 'number';
78
+ }
79
+ /**
80
+ * CLI argument type (compatible with CLI command arguments).
81
+ */
82
+ export interface ArgumentType {
83
+ name: string;
84
+ description: string;
85
+ required?: boolean;
86
+ variadic?: boolean;
87
+ }
88
+ /**
89
+ * CLI command type (compatible with CLI commands).
90
+ */
91
+ export interface CommandType {
92
+ name: string;
93
+ description: string;
94
+ options?: OptionType[];
95
+ arguments?: ArgumentType[];
96
+ subcommands?: CommandType[];
97
+ handler?: (ctx: {
98
+ args: string[];
99
+ options: Record<string, unknown>;
100
+ data: Record<string, unknown>;
101
+ }, container: ContainerType) => Promise<ResultType<void, KustodianErrorType>>;
102
+ }
103
+ /**
104
+ * Plugin capabilities indicating what a plugin can provide.
105
+ */
106
+ export type PluginCapabilityType = 'commands' | 'hooks' | 'generators' | 'object-types';
107
+ /**
108
+ * Plugin manifest with metadata.
109
+ */
110
+ export interface PluginManifestType {
111
+ /** Unique plugin identifier (e.g., "@kustodian/plugin-helm") */
112
+ name: string;
113
+ /** Semantic version */
114
+ version: string;
115
+ /** Human-readable description */
116
+ description?: string;
117
+ /** Capabilities this plugin provides */
118
+ capabilities: PluginCapabilityType[];
119
+ /** Minimum kustodian version required */
120
+ kustodian_version?: string;
121
+ }
122
+ /**
123
+ * Plugin activation context with runtime information.
124
+ */
125
+ export interface PluginActivationContextType {
126
+ /** DI container for service registration */
127
+ container: ContainerType;
128
+ /** Plugin configuration from cluster.spec.plugins */
129
+ config: Record<string, unknown>;
130
+ /** Current working directory */
131
+ cwd: string;
132
+ }
133
+ /**
134
+ * Command contribution from a plugin.
135
+ */
136
+ export interface PluginCommandContributionType {
137
+ /** Command definition */
138
+ command: CommandType;
139
+ }
140
+ /**
141
+ * Main plugin interface.
142
+ * Plugins implement this interface and provide contributions via getter methods.
143
+ */
144
+ export interface KustodianPluginType {
145
+ /** Plugin manifest with metadata */
146
+ readonly manifest: PluginManifestType;
147
+ /**
148
+ * Called when the plugin is activated.
149
+ * Use this to initialize resources and register services.
150
+ */
151
+ activate?(ctx: PluginActivationContextType): Promise<ResultType<void, KustodianErrorType>>;
152
+ /**
153
+ * Called when the plugin is deactivated.
154
+ * Use this to clean up resources.
155
+ */
156
+ deactivate?(): Promise<ResultType<void, KustodianErrorType>>;
157
+ /**
158
+ * Returns commands contributed by this plugin.
159
+ */
160
+ get_commands?(): PluginCommandContributionType[];
161
+ /**
162
+ * Returns hooks contributed by this plugin.
163
+ */
164
+ get_hooks?(): PluginHookContributionType[];
165
+ /**
166
+ * Returns generators contributed by this plugin.
167
+ */
168
+ get_generators?(): PluginGeneratorType[];
169
+ /**
170
+ * Returns object types contributed by this plugin.
171
+ */
172
+ get_object_types?(): PluginObjectTypeType[];
173
+ /**
174
+ * Returns substitution providers contributed by this plugin.
175
+ * Substitution providers allow plugins to define custom substitution types
176
+ * (e.g., 'sops', 'vault', 'aws-secrets') that can resolve values during generation.
177
+ */
178
+ get_substitution_providers?(): SubstitutionProviderType[];
179
+ }
180
+ /**
181
+ * Generated Kubernetes resource.
182
+ */
183
+ export interface GeneratedResourceType {
184
+ api_version: string;
185
+ kind: string;
186
+ metadata: {
187
+ name: string;
188
+ namespace?: string;
189
+ labels?: Record<string, string>;
190
+ annotations?: Record<string, string>;
191
+ };
192
+ spec?: Record<string, unknown>;
193
+ data?: Record<string, unknown>;
194
+ string_data?: Record<string, string>;
195
+ }
196
+ /**
197
+ * Context provided to plugins during generation.
198
+ */
199
+ export interface PluginContextType {
200
+ cluster: ClusterType;
201
+ template?: TemplateType;
202
+ config?: Record<string, unknown>;
203
+ }
204
+ /**
205
+ * Plugin source types for discovery.
206
+ */
207
+ export type PluginSourceType = 'npm' | 'local';
208
+ /**
209
+ * Information about a discovered plugin location.
210
+ */
211
+ export interface PluginLocationInfoType {
212
+ source: PluginSourceType;
213
+ /** Module path or npm package name */
214
+ module_path: string;
215
+ /** Resolved absolute path */
216
+ resolved_path: string;
217
+ }
218
+ /**
219
+ * Loaded plugin with location metadata.
220
+ */
221
+ export interface LoadedPluginType {
222
+ plugin: KustodianPluginType;
223
+ location: PluginLocationInfoType;
224
+ }
225
+ /**
226
+ * @deprecated Use PluginCapabilityType instead
227
+ */
228
+ export type PluginTypeType = 'secret-provider' | 'resource-generator' | 'validator' | 'transformer';
229
+ /**
230
+ * @deprecated Use PluginManifestType instead
231
+ */
232
+ export interface LegacyPluginManifestType {
233
+ name: string;
234
+ version: string;
235
+ type: PluginTypeType;
236
+ description?: string;
237
+ }
238
+ /**
239
+ * @deprecated Secret provider plugin interface.
240
+ */
241
+ export interface SecretProviderPluginType {
242
+ readonly manifest: LegacyPluginManifestType;
243
+ readonly scheme: string;
244
+ parse_ref(ref: string): ResultType<Record<string, string>, KustodianErrorType>;
245
+ generate(ref: Record<string, string>, ctx: PluginContextType): ResultType<GeneratedResourceType, KustodianErrorType>;
246
+ }
247
+ /**
248
+ * @deprecated Resource generator plugin interface.
249
+ */
250
+ export interface ResourceGeneratorPluginType {
251
+ readonly manifest: LegacyPluginManifestType;
252
+ generate(ctx: PluginContextType): ResultType<GeneratedResourceType[], KustodianErrorType>;
253
+ }
254
+ /**
255
+ * @deprecated Validator plugin interface.
256
+ */
257
+ export interface ValidatorPluginType {
258
+ readonly manifest: LegacyPluginManifestType;
259
+ validate(ctx: PluginContextType): ResultType<void, KustodianErrorType>;
260
+ }
261
+ /**
262
+ * @deprecated Transformer plugin interface.
263
+ */
264
+ export interface TransformerPluginType {
265
+ readonly manifest: LegacyPluginManifestType;
266
+ transform(resource: GeneratedResourceType, ctx: PluginContextType): ResultType<GeneratedResourceType, KustodianErrorType>;
267
+ }
268
+ /**
269
+ * @deprecated Union type of legacy plugin types.
270
+ */
271
+ export type LegacyPluginType = SecretProviderPluginType | ResourceGeneratorPluginType | ValidatorPluginType | TransformerPluginType;
272
+ /**
273
+ * @deprecated Type guard for secret provider plugins.
274
+ */
275
+ export declare function is_secret_provider(plugin: LegacyPluginType): plugin is SecretProviderPluginType;
276
+ /**
277
+ * @deprecated Type guard for resource generator plugins.
278
+ */
279
+ export declare function is_resource_generator(plugin: LegacyPluginType): plugin is ResourceGeneratorPluginType;
280
+ /**
281
+ * @deprecated Type guard for validator plugins.
282
+ */
283
+ export declare function is_validator(plugin: LegacyPluginType): plugin is ValidatorPluginType;
284
+ /**
285
+ * @deprecated Type guard for transformer plugins.
286
+ */
287
+ export declare function is_transformer(plugin: LegacyPluginType): plugin is TransformerPluginType;
288
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D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,kBAAkB,CAAC,CAAC;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,SAAS,CACP,QAAQ,EAAE,qBAAqB,EAC/B,GAAG,EAAE,iBAAiB,GACrB,UAAU,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;CAC1D;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,wBAAwB,GACxB,2BAA2B,GAC3B,mBAAmB,GACnB,qBAAqB,CAAC;AAE1B;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,IAAI,wBAAwB,CAE/F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,GACvB,MAAM,IAAI,2BAA2B,CAEvC;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,IAAI,mBAAmB,CAEpF;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,IAAI,qBAAqB,CAExF"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @deprecated Type guard for secret provider plugins.
3
+ */
4
+ export function is_secret_provider(plugin) {
5
+ return plugin.manifest.type === 'secret-provider';
6
+ }
7
+ /**
8
+ * @deprecated Type guard for resource generator plugins.
9
+ */
10
+ export function is_resource_generator(plugin) {
11
+ return plugin.manifest.type === 'resource-generator';
12
+ }
13
+ /**
14
+ * @deprecated Type guard for validator plugins.
15
+ */
16
+ export function is_validator(plugin) {
17
+ return plugin.manifest.type === 'validator';
18
+ }
19
+ /**
20
+ * @deprecated Type guard for transformer plugins.
21
+ */
22
+ export function is_transformer(plugin) {
23
+ return plugin.manifest.type === 'transformer';
24
+ }
25
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/plugins/types.ts"],"names":[],"mappings":"AA+UA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAwB;IACzD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,iBAAiB,CAAC;AACpD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAwB;IAExB,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,oBAAoB,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAwB;IACnD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW,CAAC;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAAwB;IACrD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,aAAa,CAAC;AAChD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { RegistryAuthType } from './types.js';
2
+ /**
3
+ * Gets authentication for Docker Hub from environment variables.
4
+ */
5
+ export declare function get_dockerhub_auth(): RegistryAuthType | undefined;
6
+ /**
7
+ * Gets authentication for GHCR from environment variables.
8
+ */
9
+ export declare function get_ghcr_auth(): RegistryAuthType | undefined;
10
+ /**
11
+ * Gets authentication for a registry based on hostname.
12
+ */
13
+ export declare function get_auth_for_registry(registry: string): RegistryAuthType | undefined;
14
+ //# sourceMappingURL=auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/registry/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,GAAG,SAAS,CASjE;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,gBAAgB,GAAG,SAAS,CAQ5D;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAkBpF"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Gets authentication for Docker Hub from environment variables.
3
+ */
4
+ export function get_dockerhub_auth() {
5
+ const username = process.env['DOCKER_USERNAME'];
6
+ const password = process.env['DOCKER_PASSWORD'];
7
+ if (username && password) {
8
+ return { username, password };
9
+ }
10
+ return undefined;
11
+ }
12
+ /**
13
+ * Gets authentication for GHCR from environment variables.
14
+ */
15
+ export function get_ghcr_auth() {
16
+ const token = process.env['GITHUB_TOKEN'] || process.env['GH_TOKEN'];
17
+ if (token) {
18
+ return { token };
19
+ }
20
+ return undefined;
21
+ }
22
+ /**
23
+ * Gets authentication for a registry based on hostname.
24
+ */
25
+ export function get_auth_for_registry(registry) {
26
+ if (registry === 'docker.io' || registry === 'registry.hub.docker.com') {
27
+ return get_dockerhub_auth();
28
+ }
29
+ if (registry === 'ghcr.io') {
30
+ return get_ghcr_auth();
31
+ }
32
+ // Generic fallback
33
+ const username = process.env['REGISTRY_USERNAME'];
34
+ const password = process.env['REGISTRY_PASSWORD'];
35
+ if (username && password) {
36
+ return { username, password };
37
+ }
38
+ return undefined;
39
+ }
40
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/registry/auth.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAEhD,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAErE,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,QAAgB;IACpD,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,yBAAyB,EAAE,CAAC;QACvE,OAAO,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,aAAa,EAAE,CAAC;IACzB,CAAC;IAED,mBAAmB;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAElD,IAAI,QAAQ,IAAI,QAAQ,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { ImageReferenceType, RegistryClientConfigType, RegistryClientType } from './types.js';
2
+ /**
3
+ * Parses an image string into its components.
4
+ *
5
+ * Supports various formats:
6
+ * - nginx -> docker.io/library/nginx
7
+ * - prom/prometheus -> docker.io/prom/prometheus
8
+ * - ghcr.io/org/image -> ghcr.io/org/image
9
+ * - ghcr.io/org/image:tag -> ghcr.io/org/image:tag
10
+ */
11
+ export declare function parse_image_reference(image: string): ImageReferenceType;
12
+ /**
13
+ * Detects the registry type from an image reference.
14
+ */
15
+ export declare function detect_registry_type(image: ImageReferenceType): 'dockerhub' | 'ghcr';
16
+ /**
17
+ * Creates a registry client for the given registry type.
18
+ */
19
+ export declare function create_registry_client(registry_type: 'dockerhub' | 'ghcr', config?: RegistryClientConfigType): RegistryClientType;
20
+ /**
21
+ * Creates a registry client with auto-detected type and authentication.
22
+ */
23
+ export declare function create_client_for_image(image: ImageReferenceType): RegistryClientType;
24
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/registry/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAEnG;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,kBAAkB,CA2CvE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,kBAAkB,GAAG,WAAW,GAAG,MAAM,CAOpF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,WAAW,GAAG,MAAM,EACnC,MAAM,CAAC,EAAE,wBAAwB,GAChC,kBAAkB,CAOpB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,kBAAkB,CAKrF"}
@@ -0,0 +1,85 @@
1
+ import { get_auth_for_registry } from './auth.js';
2
+ import { create_dockerhub_client } from './dockerhub.js';
3
+ import { create_ghcr_client } from './ghcr.js';
4
+ /**
5
+ * Parses an image string into its components.
6
+ *
7
+ * Supports various formats:
8
+ * - nginx -> docker.io/library/nginx
9
+ * - prom/prometheus -> docker.io/prom/prometheus
10
+ * - ghcr.io/org/image -> ghcr.io/org/image
11
+ * - ghcr.io/org/image:tag -> ghcr.io/org/image:tag
12
+ */
13
+ export function parse_image_reference(image) {
14
+ let registry = 'docker.io';
15
+ let namespace = 'library';
16
+ let repository;
17
+ let tag;
18
+ // Split tag if present
19
+ const colonIndex = image.lastIndexOf(':');
20
+ let imagePart = image;
21
+ // Only treat as tag if there's no slash after the colon (to handle ports)
22
+ if (colonIndex > 0 && !image.slice(colonIndex).includes('/')) {
23
+ imagePart = image.slice(0, colonIndex);
24
+ tag = image.slice(colonIndex + 1);
25
+ }
26
+ const parts = imagePart.split('/');
27
+ if (parts.length === 1 && parts[0]) {
28
+ // Simple image name: nginx -> docker.io/library/nginx
29
+ repository = parts[0];
30
+ }
31
+ else if (parts.length === 2 && parts[0] && parts[1]) {
32
+ if (parts[0].includes('.') || parts[0].includes(':')) {
33
+ // Custom registry without namespace: registry.io/image
34
+ registry = parts[0];
35
+ namespace = 'library';
36
+ repository = parts[1];
37
+ }
38
+ else {
39
+ // Docker Hub with namespace: prom/prometheus
40
+ namespace = parts[0];
41
+ repository = parts[1];
42
+ }
43
+ }
44
+ else if (parts.length >= 3 && parts[0] && parts[1]) {
45
+ // Full path: ghcr.io/org/image
46
+ registry = parts[0];
47
+ namespace = parts[1];
48
+ repository = parts.slice(2).join('/');
49
+ }
50
+ else {
51
+ // Fallback - should not happen with valid input
52
+ repository = imagePart;
53
+ }
54
+ return { registry, namespace, repository, tag };
55
+ }
56
+ /**
57
+ * Detects the registry type from an image reference.
58
+ */
59
+ export function detect_registry_type(image) {
60
+ if (image.registry === 'ghcr.io') {
61
+ return 'ghcr';
62
+ }
63
+ // Default to Docker Hub
64
+ return 'dockerhub';
65
+ }
66
+ /**
67
+ * Creates a registry client for the given registry type.
68
+ */
69
+ export function create_registry_client(registry_type, config) {
70
+ switch (registry_type) {
71
+ case 'ghcr':
72
+ return create_ghcr_client(config);
73
+ default:
74
+ return create_dockerhub_client(config);
75
+ }
76
+ }
77
+ /**
78
+ * Creates a registry client with auto-detected type and authentication.
79
+ */
80
+ export function create_client_for_image(image) {
81
+ const registry_type = detect_registry_type(image);
82
+ const auth = get_auth_for_registry(image.registry);
83
+ return create_registry_client(registry_type, { auth });
84
+ }
85
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/registry/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,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AAqB,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAEnD,OAAO,sBAAsB,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { RegistryClientConfigType, RegistryClientType } from './types.js';
2
+ /**
3
+ * Creates a Docker Hub registry client.
4
+ */
5
+ export declare function create_dockerhub_client(config?: RegistryClientConfigType): RegistryClientType;
6
+ //# sourceMappingURL=dockerhub.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dockerhub.d.ts","sourceRoot":"","sources":["../../src/registry/dockerhub.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,wBAAwB,EACxB,kBAAkB,EAEnB,MAAM,YAAY,CAAC;AA6EpB;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,wBAAwB,GAAG,kBAAkB,CA0C7F"}