typekro 0.22.0 → 0.23.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 (68) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/core/composition/nested-status-cel.d.ts +10 -11
  3. package/dist/core/composition/nested-status-cel.d.ts.map +1 -1
  4. package/dist/core/composition/nested-status-cel.js +13 -2
  5. package/dist/core/composition/nested-status-cel.js.map +1 -1
  6. package/dist/core/expressions/analysis/cache.d.ts.map +1 -1
  7. package/dist/core/expressions/analysis/cache.js +4 -0
  8. package/dist/core/expressions/analysis/cache.js.map +1 -1
  9. package/dist/core/validation/cel-validator.d.ts.map +1 -1
  10. package/dist/core/validation/cel-validator.js +92 -52
  11. package/dist/core/validation/cel-validator.js.map +1 -1
  12. package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts +78 -0
  13. package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts.map +1 -0
  14. package/dist/factories/clickhouse/compositions/clickhouse-cluster.js +251 -0
  15. package/dist/factories/clickhouse/compositions/clickhouse-cluster.js.map +1 -0
  16. package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.d.ts +22 -0
  17. package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.d.ts.map +1 -0
  18. package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.js +35 -0
  19. package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.js.map +1 -0
  20. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts +68 -0
  21. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts.map +1 -0
  22. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js +137 -0
  23. package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js.map +1 -0
  24. package/dist/factories/clickhouse/compositions/index.d.ts +4 -0
  25. package/dist/factories/clickhouse/compositions/index.d.ts.map +1 -0
  26. package/dist/factories/clickhouse/compositions/index.js +4 -0
  27. package/dist/factories/clickhouse/compositions/index.js.map +1 -0
  28. package/dist/factories/clickhouse/index.d.ts +70 -0
  29. package/dist/factories/clickhouse/index.d.ts.map +1 -0
  30. package/dist/factories/clickhouse/index.js +70 -0
  31. package/dist/factories/clickhouse/index.js.map +1 -0
  32. package/dist/factories/clickhouse/resources/helm.d.ts +62 -0
  33. package/dist/factories/clickhouse/resources/helm.d.ts.map +1 -0
  34. package/dist/factories/clickhouse/resources/helm.js +94 -0
  35. package/dist/factories/clickhouse/resources/helm.js.map +1 -0
  36. package/dist/factories/clickhouse/resources/index.d.ts +4 -0
  37. package/dist/factories/clickhouse/resources/index.d.ts.map +1 -0
  38. package/dist/factories/clickhouse/resources/index.js +4 -0
  39. package/dist/factories/clickhouse/resources/index.js.map +1 -0
  40. package/dist/factories/clickhouse/resources/installation.d.ts +83 -0
  41. package/dist/factories/clickhouse/resources/installation.d.ts.map +1 -0
  42. package/dist/factories/clickhouse/resources/installation.js +316 -0
  43. package/dist/factories/clickhouse/resources/installation.js.map +1 -0
  44. package/dist/factories/clickhouse/resources/keeper.d.ts +40 -0
  45. package/dist/factories/clickhouse/resources/keeper.d.ts.map +1 -0
  46. package/dist/factories/clickhouse/resources/keeper.js +107 -0
  47. package/dist/factories/clickhouse/resources/keeper.js.map +1 -0
  48. package/dist/factories/clickhouse/types.d.ts +532 -0
  49. package/dist/factories/clickhouse/types.d.ts.map +1 -0
  50. package/dist/factories/clickhouse/types.js +295 -0
  51. package/dist/factories/clickhouse/types.js.map +1 -0
  52. package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts +65 -0
  53. package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts.map +1 -0
  54. package/dist/factories/clickhouse/utils/helm-values-mapper.js +80 -0
  55. package/dist/factories/clickhouse/utils/helm-values-mapper.js.map +1 -0
  56. package/dist/factories/clickhouse/utils/index.d.ts +4 -0
  57. package/dist/factories/clickhouse/utils/index.d.ts.map +1 -0
  58. package/dist/factories/clickhouse/utils/index.js +4 -0
  59. package/dist/factories/clickhouse/utils/index.js.map +1 -0
  60. package/dist/factories/clickhouse/utils/validation.d.ts +21 -0
  61. package/dist/factories/clickhouse/utils/validation.d.ts.map +1 -0
  62. package/dist/factories/clickhouse/utils/validation.js +27 -0
  63. package/dist/factories/clickhouse/utils/validation.js.map +1 -0
  64. package/dist/factories/clickhouse/utils/zone-layout.d.ts +74 -0
  65. package/dist/factories/clickhouse/utils/zone-layout.d.ts.map +1 -0
  66. package/dist/factories/clickhouse/utils/zone-layout.js +103 -0
  67. package/dist/factories/clickhouse/utils/zone-layout.js.map +1 -0
  68. package/package.json +5 -1
@@ -0,0 +1,532 @@
1
+ /**
2
+ * ClickHouse (Altinity clickhouse-operator) Type Definitions
3
+ *
4
+ * ArkType schemas as the single source of truth for config shapes, with types
5
+ * inferred via `typeof Schema.infer`. Status types remain hand-written
6
+ * interfaces, mirroring the CNPG factory family.
7
+ *
8
+ * Wraps the OFFICIAL Altinity clickhouse-operator (Apache-2.0):
9
+ * - Operator chart: `altinity-clickhouse-operator` from https://helm.altinity.com
10
+ * - CHI CRD: `clickhouseinstallations.clickhouse.altinity.com/v1`
11
+ * - CHK CRD: `clickhousekeeperinstallations.clickhouse-keeper.altinity.com/v1`
12
+ *
13
+ * @see https://github.com/Altinity/clickhouse-operator
14
+ * @see https://docs.altinity.com/altinitykubernetesoperator/
15
+ */
16
+ import type { TypeKroChartValue } from '../../core/types/common.js';
17
+ /**
18
+ * ArkType schema for ClickHouseOperatorBootstrapConfig.
19
+ *
20
+ * Configuration for installing the Altinity clickhouse-operator via Helm.
21
+ * Used by the `clickhouseOperatorBootstrap` composition to deploy the
22
+ * operator controller into the cluster.
23
+ *
24
+ * IMPORTANT: the operator is CLUSTER-SCOPED and owns the ClickHouse CRDs —
25
+ * install exactly ONE per cluster. Multiple installs fight over CRD ownership
26
+ * and watch the same resources. The bootstrap defaults to `shared: true`
27
+ * (cluster-scoped resource tagging) accordingly.
28
+ */
29
+ export declare const ClickHouseOperatorBootstrapConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
30
+ name: string;
31
+ namespace?: string;
32
+ version?: string;
33
+ metrics?: {
34
+ enabled?: boolean;
35
+ };
36
+ crdHook?: {
37
+ enabled?: boolean;
38
+ };
39
+ resources?: {
40
+ requests?: {
41
+ cpu?: string;
42
+ memory?: string;
43
+ };
44
+ limits?: {
45
+ cpu?: string;
46
+ memory?: string;
47
+ };
48
+ };
49
+ customValues?: Record<string, unknown>;
50
+ shared?: boolean;
51
+ }, {}>;
52
+ /** Configuration for installing the Altinity clickhouse-operator via Helm. */
53
+ export type ClickHouseOperatorBootstrapConfig = typeof ClickHouseOperatorBootstrapConfigSchema.infer;
54
+ /**
55
+ * Observed status of an Altinity clickhouse-operator deployment.
56
+ */
57
+ export interface ClickHouseOperatorBootstrapStatus {
58
+ /** Overall deployment phase (derived from HelmRelease Ready condition). */
59
+ phase: 'Ready' | 'Installing';
60
+ /** Whether the operator is ready to manage installations. */
61
+ ready: boolean;
62
+ /** Deployed chart version. */
63
+ version?: string;
64
+ }
65
+ /** ArkType schema for ClickHouseOperatorBootstrapStatus. */
66
+ export declare const ClickHouseOperatorBootstrapStatusSchema: import("arktype/internal/variants/object.ts").ObjectType<{
67
+ phase: "Ready" | "Installing";
68
+ ready: boolean;
69
+ version?: string;
70
+ }, {}>;
71
+ /** Spec accepted by the shared ClickHouse HelmRepository singleton. */
72
+ export declare const ClickHouseHelmRepositorySingletonSpecSchema: import("arktype/internal/variants/object.ts").ObjectType<{
73
+ name: string;
74
+ namespace: string;
75
+ url: string;
76
+ }, {}>;
77
+ /** Status surfaced by the shared ClickHouse HelmRepository singleton. */
78
+ export declare const ClickHouseHelmRepositorySingletonStatusSchema: import("arktype/internal/variants/object.ts").ObjectType<{
79
+ ready: boolean;
80
+ }, {}>;
81
+ /**
82
+ * ArkType schema for ClickHouseHelmRepositoryConfig.
83
+ *
84
+ * Configuration for the Altinity Helm chart repository.
85
+ */
86
+ export declare const ClickHouseHelmRepositoryConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
87
+ name?: string;
88
+ namespace?: string;
89
+ url?: string;
90
+ interval?: string;
91
+ id?: string;
92
+ }, {}>;
93
+ /** Configuration for the Altinity Helm chart repository. */
94
+ export type ClickHouseHelmRepositoryConfig = typeof ClickHouseHelmRepositoryConfigSchema.infer;
95
+ /**
96
+ * ArkType schema for ClickHouseOperatorHelmReleaseConfig.
97
+ *
98
+ * Configuration for the altinity-clickhouse-operator Helm release.
99
+ */
100
+ export declare const ClickHouseOperatorHelmReleaseConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
101
+ name: string;
102
+ namespace?: string;
103
+ version?: string;
104
+ values?: object;
105
+ repositoryName?: string;
106
+ id?: string;
107
+ }, {}>;
108
+ /**
109
+ * Configuration for the altinity-clickhouse-operator Helm release.
110
+ *
111
+ * `values` is widened beyond the ArkType inference so a graph-aware
112
+ * {@link TypeKroChartValue} (including a runtime values-merge expression
113
+ * produced when `customValues` is a schema ref) flows through to the
114
+ * underlying `helmRelease` factory.
115
+ */
116
+ export type ClickHouseOperatorHelmReleaseConfig = Omit<typeof ClickHouseOperatorHelmReleaseConfigSchema.infer, 'values'> & {
117
+ values?: TypeKroChartValue<Record<string, unknown>>;
118
+ };
119
+ /**
120
+ * ArkType schema for a single ClickHouse user entry.
121
+ *
122
+ * ARRAY shape (not a name-keyed map): user NAMES become CHI configuration
123
+ * PATH FRAGMENTS (`<user>/password_sha256_hex`), so they must be concrete
124
+ * strings at build time — a map keyed by schema proxies would serialize its
125
+ * keys as `__typekroSchemaKey/...` garbage. The array shape keeps names in a
126
+ * plain value position where the factory can validate them loudly, while
127
+ * `passwordSha256Hex`/`networksIp` are ordinary VALUES and may be schema
128
+ * references or CEL expressions.
129
+ */
130
+ export declare const ClickHouseUserSchema: import("arktype/internal/variants/object.ts").ObjectType<{
131
+ name: string;
132
+ passwordSha256Hex?: string;
133
+ networksIp?: string[];
134
+ }, {}>;
135
+ /** A single ClickHouse user entry (see {@link ClickHouseUserSchema}). */
136
+ export type ClickHouseUser = typeof ClickHouseUserSchema.infer;
137
+ /**
138
+ * ArkType schema for ClickHouseInstallationConfig.
139
+ *
140
+ * HIGH-LEVEL configuration compiled by `clickHouseInstallation()` into a
141
+ * `clickhouse.altinity.com/v1` ClickHouseInstallation (CHI) spec. This is
142
+ * deliberately not a 1:1 CRD mirror: the typed factory exists to compile the
143
+ * zone-pinning layout the operator cannot express natively (see
144
+ * `utils/zone-layout.ts`).
145
+ *
146
+ * BUILD-TIME vs RUNTIME: `shards`, `replicas`, `zones`, and user NAMES are
147
+ * BUILD-TIME fields — the compiler enumerates pod templates and per-replica
148
+ * layout entries from them, so they must be concrete JS values (the factory
149
+ * throws loudly if any receives a KubernetesRef/CEL expression). Everything
150
+ * else (name, namespace, version, storage sizes, credentials, keeper host,
151
+ * ...) sits in plain VALUE positions and may be schema references. For
152
+ * schema-driven topology use `makeClickHouseCluster()`, which fixes the
153
+ * topology at construction time and exposes only ref-safe runtime spec.
154
+ */
155
+ export declare const ClickHouseInstallationConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
156
+ name: string;
157
+ version: string;
158
+ storage: {
159
+ size: string;
160
+ storageClassName?: string;
161
+ };
162
+ namespace?: string;
163
+ id?: string;
164
+ clusterName?: string;
165
+ image?: string;
166
+ shards?: number;
167
+ replicas?: number;
168
+ zones?: string[];
169
+ users?: {
170
+ name: string;
171
+ passwordSha256Hex?: string;
172
+ networksIp?: string[];
173
+ }[];
174
+ keeper?: {
175
+ host: string;
176
+ port?: number;
177
+ };
178
+ podResources?: {
179
+ requests?: {
180
+ cpu?: string;
181
+ memory?: string;
182
+ };
183
+ limits?: {
184
+ cpu?: string;
185
+ memory?: string;
186
+ };
187
+ };
188
+ }, {}>;
189
+ /** High-level configuration for a ClickHouseInstallation. */
190
+ export type ClickHouseInstallationConfig = typeof ClickHouseInstallationConfigSchema.infer;
191
+ /** A CHI pod template (`spec.templates.podTemplates[]`). */
192
+ export interface ChiPodTemplate {
193
+ name: string;
194
+ /** Kubernetes PodSpec — open CRD structure. */
195
+ spec?: Record<string, unknown>;
196
+ /** Operator zone sugar; the factory emits explicit nodeAffinity instead. */
197
+ zone?: {
198
+ key?: string;
199
+ values: string[];
200
+ };
201
+ podDistribution?: Record<string, unknown>[];
202
+ }
203
+ /** A CHI volume claim template (`spec.templates.volumeClaimTemplates[]`). */
204
+ export interface ChiVolumeClaimTemplate {
205
+ name: string;
206
+ /** Kubernetes PersistentVolumeClaimSpec — open CRD structure. */
207
+ spec: Record<string, unknown>;
208
+ }
209
+ /** Per-replica entry in a replica-first cluster layout. */
210
+ export interface ChiClusterLayoutReplica {
211
+ name?: string;
212
+ templates?: {
213
+ podTemplate?: string;
214
+ dataVolumeClaimTemplate?: string;
215
+ };
216
+ shardsCount?: number;
217
+ }
218
+ /** Cluster layout (`spec.configuration.clusters[].layout`). */
219
+ export interface ChiClusterLayout {
220
+ shardsCount?: number;
221
+ replicasCount?: number;
222
+ /** Replica-first explicit layout (used for zone pinning). */
223
+ replicas?: ChiClusterLayoutReplica[];
224
+ shards?: Record<string, unknown>[];
225
+ }
226
+ /** Logical cluster (`spec.configuration.clusters[]`). */
227
+ export interface ChiCluster {
228
+ name: string;
229
+ layout?: ChiClusterLayout;
230
+ templates?: {
231
+ podTemplate?: string;
232
+ dataVolumeClaimTemplate?: string;
233
+ };
234
+ }
235
+ /** ClickHouseInstallation spec (`clickhouse.altinity.com/v1`). */
236
+ export interface ClickHouseInstallationSpec {
237
+ defaults?: {
238
+ templates?: {
239
+ podTemplate?: string;
240
+ dataVolumeClaimTemplate?: string;
241
+ serviceTemplate?: string;
242
+ };
243
+ };
244
+ configuration?: {
245
+ clusters?: ChiCluster[];
246
+ /** Keeper/ZooKeeper coordination nodes. */
247
+ zookeeper?: {
248
+ nodes?: {
249
+ host: string;
250
+ port?: number;
251
+ }[];
252
+ };
253
+ /** Path-keyed user settings (e.g. `admin/password_sha256_hex`). */
254
+ users?: Record<string, unknown>;
255
+ settings?: Record<string, unknown>;
256
+ files?: Record<string, string>;
257
+ };
258
+ templates?: {
259
+ podTemplates?: ChiPodTemplate[];
260
+ volumeClaimTemplates?: ChiVolumeClaimTemplate[];
261
+ serviceTemplates?: Record<string, unknown>[];
262
+ };
263
+ }
264
+ /**
265
+ * Observed status of a ClickHouseInstallation.
266
+ *
267
+ * The reconcile state lives in `status.status`, one of:
268
+ * `InProgress` | `Completed` | `Aborted` | `Terminating`
269
+ * (source: clickhouse-operator
270
+ * `pkg/apis/clickhouse.altinity.com/v1/type_status.go`).
271
+ */
272
+ export interface ClickHouseInstallationStatus {
273
+ /** Reconcile status: 'InProgress' | 'Completed' | 'Aborted' | 'Terminating'. */
274
+ status?: string;
275
+ /** Operator version that produced this status. */
276
+ chopVersion?: string;
277
+ clustersCount?: number;
278
+ shardsCount?: number;
279
+ hostsCount?: number;
280
+ hostsCompletedCount?: number;
281
+ taskID?: string;
282
+ /** Recent reconcile errors. */
283
+ errors?: string[];
284
+ /** Generated ClickHouse endpoint (service DNS name). */
285
+ endpoint?: string;
286
+ fqdns?: string[];
287
+ }
288
+ /**
289
+ * BUILD-TIME user declaration for {@link ClickHouseClusterTopology}.
290
+ *
291
+ * The user NAME becomes a CHI configuration path fragment
292
+ * (`<name>/password_sha256_hex`) and the allowed networks are part of the
293
+ * cluster's access topology — both are fixed at construction time. The
294
+ * password hash is env-specific and flows through the RUNTIME spec
295
+ * (`spec.users.<name>.passwordSha256Hex`), so it may be a schema reference.
296
+ */
297
+ export interface ClickHouseClusterUserTopology {
298
+ /** User name — becomes a CHI config path fragment AND a runtime spec key. */
299
+ readonly name: string;
300
+ /** Allowed source networks (default: ['::/0']). */
301
+ readonly networksIp?: readonly string[];
302
+ }
303
+ /**
304
+ * BUILD-TIME topology for {@link makeClickHouseCluster}.
305
+ *
306
+ * These are resolved when the composition is CONSTRUCTED (real JS values),
307
+ * NOT KRO spec fields: the zone-pinned layout enumerates pod templates and
308
+ * per-replica entries, so zones/replicas/shards cannot be instance-dynamic.
309
+ * (Same pattern as `makeCaddyIngress` — build-time choices select the
310
+ * resource set statically.)
311
+ */
312
+ export interface ClickHouseClusterTopology {
313
+ /**
314
+ * Availability zones to pin replicas to (round-robin when
315
+ * replicas > zones.length). WHY build-time AND why at all: EBS volumes are
316
+ * zonal, and the operator's own `podDistribution` supports only the
317
+ * `kubernetes.io/hostname` topologyKey (Altinity/clickhouse-operator#772),
318
+ * so per-zone spreading must be compiled as an explicit per-replica layout.
319
+ */
320
+ readonly zones?: readonly string[];
321
+ /** Replicas per shard (default: 1). */
322
+ readonly replicas?: number;
323
+ /** Shard count (default: 1). */
324
+ readonly shards?: number;
325
+ /**
326
+ * Whether the cluster coordinates through (ClickHouse) Keeper. Structural:
327
+ * it decides whether the CHI has a `zookeeper` section and whether the
328
+ * runtime spec requires `keeper: { host }`. Default: `true` when
329
+ * `replicas > 1` (replicated tables need coordination), else `false`.
330
+ */
331
+ readonly keeper?: boolean;
332
+ /** Declared ClickHouse users (names/networks build-time, passwords runtime). */
333
+ readonly users?: readonly ClickHouseClusterUserTopology[];
334
+ }
335
+ /** Runtime keeper connection spec (present iff the topology enables keeper). */
336
+ export interface ClickHouseClusterKeeperSpec {
337
+ /** Keeper client host, e.g. `keeper-<chk>.<ns>.svc.cluster.local`. */
338
+ host: string;
339
+ /** Keeper client port (default: 2181 — the operator's KpDefaultZKPortNumber). */
340
+ port?: number;
341
+ }
342
+ /** Runtime (proxy-safe) spec fields shared by every cluster topology. */
343
+ export interface ClickHouseClusterSpecBase {
344
+ /** Installation name (CHI metadata.name). */
345
+ name: string;
346
+ /** Target namespace — explicit, it anchors the derived service hostnames. */
347
+ namespace: string;
348
+ /** ClickHouse server image tag, e.g. '25.12.5'. */
349
+ version: string;
350
+ /**
351
+ * Logical cluster name inside the CHI (default: 'cluster').
352
+ * SIGNOZ COMPATIBILITY: SigNoz's migrations hardcode `cluster`.
353
+ */
354
+ clusterName?: string;
355
+ /** Persistent storage for ClickHouse data. */
356
+ storage: {
357
+ /** Volume size (e.g. '100Gi'). */
358
+ size: string;
359
+ /** StorageClass name (EKS: WaitForFirstConsumer + expandable gp3). */
360
+ storageClassName?: string;
361
+ };
362
+ /** ClickHouse server container resources. */
363
+ podResources?: {
364
+ requests?: {
365
+ cpu?: string;
366
+ memory?: string;
367
+ };
368
+ limits?: {
369
+ cpu?: string;
370
+ memory?: string;
371
+ };
372
+ };
373
+ }
374
+ /**
375
+ * Runtime spec for a cluster built by {@link makeClickHouseCluster}.
376
+ *
377
+ * `keeper` and `users` requiredness is enforced by the generated ArkType
378
+ * schema (keeper required iff the topology enables it; one `users.<name>`
379
+ * entry required per declared user) — the TS type keeps them optional-shaped
380
+ * because the effective keeper default (`replicas > 1`) is a runtime value.
381
+ */
382
+ export type ClickHouseClusterSpec = ClickHouseClusterSpecBase & {
383
+ /** Keeper connection (required iff the topology enables keeper). */
384
+ keeper?: ClickHouseClusterKeeperSpec;
385
+ /** Per-declared-user runtime credentials, keyed by build-time user name. */
386
+ users?: Record<string, {
387
+ passwordSha256Hex: string;
388
+ }>;
389
+ };
390
+ /**
391
+ * Typed service contract exposed by {@link makeClickHouseCluster}.
392
+ *
393
+ * Connection details are DERIVED from the Altinity operator's actual naming
394
+ * conventions so downstream compositions never reconstruct hostnames by hand
395
+ * (verified against operator release-0.27.1 sources):
396
+ * - CR-level Service: `clickhouse-{chi-name}`, type ClusterIP
397
+ * (`pkg/model/chi/namer/patterns.go` patternCRServiceName +
398
+ * `pkg/model/chi/creator/service.go`)
399
+ * - per-host Services: `chi-{chi}-{cluster}-{shard}-{replica}`
400
+ * - ports: native TCP 9000 / HTTP 8123
401
+ * (`pkg/apis/clickhouse.altinity.com/v1/type_host.go`
402
+ * ChDefaultTCPPortNumber / ChDefaultHTTPPortNumber)
403
+ *
404
+ * KRO STATUS vs CLIENT-HYDRATED SPLIT: fields derived from the owned CHI
405
+ * resource serialize as KRO status CEL and appear on the live KRO CR's
406
+ * status (GitOps/KRO consumers can read them):
407
+ * `ready`, `phase`, `clickhouse.host`, `clickhouse.nativeUrl`,
408
+ * `clickhouse.httpUrl`, `clickhouse.clusterName`, `keeper.host`,
409
+ * `keeper.port`, `installation.*`.
410
+ * The remaining fields are BARE build-time constants with no resource
411
+ * anchor (KRO status CEL cannot reference schema.spec.* or literals-only
412
+ * expressions), so they are hydrated CLIENT-SIDE by TypeKro and are NOT on
413
+ * the KRO CR status: `clickhouse.port` (9000 — also visible inside the
414
+ * KRO-serialized `nativeUrl`), `clickhouse.database` ('default'), and
415
+ * `clickhouse.user` (first declared user name).
416
+ *
417
+ * NOTE: operator health is NOT surfaced here — the operator is separate
418
+ * one-per-cluster infrastructure installed by `clickhouseOperatorBootstrap`,
419
+ * whose own status carries `ready`/`phase`/`version` for it.
420
+ */
421
+ export interface ClickHouseClusterStatus {
422
+ /** True once the operator reports the CHI fully reconciled ('Completed'). */
423
+ ready: boolean;
424
+ /** Reconcile phase mapped from the operator status state machine. */
425
+ phase: 'Installing' | 'Ready' | 'Failed';
426
+ /** ClickHouse connection contract for downstream compositions. */
427
+ clickhouse: {
428
+ /** CR-level service DNS name: `clickhouse-{name}.{namespace}.svc.cluster.local`. */
429
+ host: string;
430
+ /** Native protocol port (9000). */
431
+ port: number;
432
+ /** Native protocol URL: `clickhouse://{host}:9000`. */
433
+ nativeUrl: string;
434
+ /** HTTP interface URL: `http://{host}:8123`. */
435
+ httpUrl: string;
436
+ /** Logical cluster name (SigNoz needs `cluster`). */
437
+ clusterName: string;
438
+ /** Default database. */
439
+ database: string;
440
+ /** First declared user name, when the topology declares users. */
441
+ user?: string;
442
+ };
443
+ /** Keeper connection echo (present iff the topology enables keeper). */
444
+ keeper?: {
445
+ host: string;
446
+ port: number;
447
+ };
448
+ /** Raw installation identity + operator progress counters. */
449
+ installation: {
450
+ name: string;
451
+ namespace: string;
452
+ /** Operator-reported endpoint (present once reconciled). */
453
+ endpoint?: string;
454
+ hostsCount?: number;
455
+ hostsCompletedCount?: number;
456
+ };
457
+ }
458
+ /** ArkType schema for {@link ClickHouseClusterStatus}. */
459
+ export declare const ClickHouseClusterStatusSchema: import("arktype/internal/variants/object.ts").ObjectType<{
460
+ ready: boolean;
461
+ phase: "Ready" | "Failed" | "Installing";
462
+ clickhouse: {
463
+ host: string;
464
+ port: number;
465
+ nativeUrl: string;
466
+ httpUrl: string;
467
+ clusterName: string;
468
+ database: string;
469
+ user?: string;
470
+ };
471
+ installation: {
472
+ name: string;
473
+ namespace: string;
474
+ endpoint?: string;
475
+ hostsCount?: number;
476
+ hostsCompletedCount?: number;
477
+ };
478
+ keeper?: {
479
+ host: string;
480
+ port: number;
481
+ };
482
+ }, {}>;
483
+ /**
484
+ * ArkType schema for ClickHouseKeeperInstallationConfig.
485
+ *
486
+ * Minimal high-level configuration compiled by
487
+ * `clickHouseKeeperInstallation()` into a `clickhouse-keeper.altinity.com/v1`
488
+ * ClickHouseKeeperInstallation (CHK) spec.
489
+ */
490
+ export declare const ClickHouseKeeperInstallationConfigSchema: import("arktype/internal/variants/object.ts").ObjectType<{
491
+ name: string;
492
+ namespace?: string;
493
+ id?: string;
494
+ replicas?: number;
495
+ storage?: {
496
+ size: string;
497
+ storageClassName?: string;
498
+ };
499
+ }, {}>;
500
+ /** High-level configuration for a ClickHouseKeeperInstallation. */
501
+ export type ClickHouseKeeperInstallationConfig = typeof ClickHouseKeeperInstallationConfigSchema.infer;
502
+ /** ClickHouseKeeperInstallation spec (`clickhouse-keeper.altinity.com/v1`). */
503
+ export interface ClickHouseKeeperInstallationSpec {
504
+ defaults?: {
505
+ templates?: {
506
+ podTemplate?: string;
507
+ dataVolumeClaimTemplate?: string;
508
+ };
509
+ };
510
+ configuration?: {
511
+ clusters?: {
512
+ name: string;
513
+ layout?: {
514
+ replicasCount?: number;
515
+ };
516
+ }[];
517
+ settings?: Record<string, unknown>;
518
+ };
519
+ templates?: {
520
+ podTemplates?: ChiPodTemplate[];
521
+ volumeClaimTemplates?: ChiVolumeClaimTemplate[];
522
+ };
523
+ }
524
+ /**
525
+ * Observed status of a ClickHouseKeeperInstallation.
526
+ *
527
+ * CHK reports the same reconcile state machine as CHI (`status.status`:
528
+ * 'InProgress' | 'Completed' | 'Aborted' | 'Terminating') — the status type
529
+ * is shared operator code.
530
+ */
531
+ export type ClickHouseKeeperInstallationStatus = ClickHouseInstallationStatus;
532
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/factories/clickhouse/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAMpE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;MA2ClD,CAAC;AAEH,8EAA8E;AAC9E,MAAM,MAAM,iCAAiC,GAC3C,OAAO,uCAAuC,CAAC,KAAK,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAChD,2EAA2E;IAC3E,KAAK,EAAE,OAAO,GAAG,YAAY,CAAC;IAC9B,6DAA6D;IAC7D,KAAK,EAAE,OAAO,CAAC;IACf,8BAA8B;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4DAA4D;AAC5D,eAAO,MAAM,uCAAuC;;;;MAIlD,CAAC;AAMH,uEAAuE;AACvE,eAAO,MAAM,2CAA2C;;;;MAItD,CAAC;AAEH,yEAAyE;AACzE,eAAO,MAAM,6CAA6C;;MAExD,CAAC;AAMH;;;;GAIG;AACH,eAAO,MAAM,oCAAoC;;;;;;MAW/C,CAAC;AAEH,4DAA4D;AAC5D,MAAM,MAAM,8BAA8B,GACxC,OAAO,oCAAoC,CAAC,KAAK,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,yCAAyC;;;;;;;MAapD,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,mCAAmC,GAAG,IAAI,CACpD,OAAO,yCAAyC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