typekro 0.23.0 → 0.24.1
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/core/deployment/kro-factory.d.ts +19 -0
- package/dist/core/deployment/kro-factory.d.ts.map +1 -1
- package/dist/core/deployment/kro-factory.js +60 -6
- package/dist/core/deployment/kro-factory.js.map +1 -1
- package/dist/core/proxy/create-resource.d.ts.map +1 -1
- package/dist/core/proxy/create-resource.js +37 -0
- package/dist/core/proxy/create-resource.js.map +1 -1
- package/dist/core/references/schema-proxy.d.ts.map +1 -1
- package/dist/core/references/schema-proxy.js +21 -5
- package/dist/core/references/schema-proxy.js.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts.map +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js +47 -28
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js.map +1 -1
- package/dist/factories/clickhouse/types.d.ts +31 -0
- package/dist/factories/clickhouse/types.d.ts.map +1 -1
- package/dist/factories/clickhouse/types.js.map +1 -1
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts +248 -0
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.d.ts.map +1 -0
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.js +257 -0
- package/dist/factories/clickstack/compositions/clickstack-bootstrap.js.map +1 -0
- package/dist/factories/clickstack/compositions/clickstack-helm-repository.d.ts +23 -0
- package/dist/factories/clickstack/compositions/clickstack-helm-repository.d.ts.map +1 -0
- package/dist/factories/clickstack/compositions/clickstack-helm-repository.js +36 -0
- package/dist/factories/clickstack/compositions/clickstack-helm-repository.js.map +1 -0
- package/dist/factories/clickstack/compositions/index.d.ts +5 -0
- package/dist/factories/clickstack/compositions/index.d.ts.map +1 -0
- package/dist/factories/clickstack/compositions/index.js +5 -0
- package/dist/factories/clickstack/compositions/index.js.map +1 -0
- package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts +83 -0
- package/dist/factories/clickstack/compositions/k8s-telemetry.d.ts.map +1 -0
- package/dist/factories/clickstack/compositions/k8s-telemetry.js +134 -0
- package/dist/factories/clickstack/compositions/k8s-telemetry.js.map +1 -0
- package/dist/factories/clickstack/compositions/otel-helm-repository.d.ts +18 -0
- package/dist/factories/clickstack/compositions/otel-helm-repository.d.ts.map +1 -0
- package/dist/factories/clickstack/compositions/otel-helm-repository.js +31 -0
- package/dist/factories/clickstack/compositions/otel-helm-repository.js.map +1 -0
- package/dist/factories/clickstack/index.d.ts +40 -0
- package/dist/factories/clickstack/index.d.ts.map +1 -0
- package/dist/factories/clickstack/index.js +40 -0
- package/dist/factories/clickstack/index.js.map +1 -0
- package/dist/factories/clickstack/resources/helm.d.ts +78 -0
- package/dist/factories/clickstack/resources/helm.d.ts.map +1 -0
- package/dist/factories/clickstack/resources/helm.js +139 -0
- package/dist/factories/clickstack/resources/helm.js.map +1 -0
- package/dist/factories/clickstack/resources/index.d.ts +3 -0
- package/dist/factories/clickstack/resources/index.d.ts.map +1 -0
- package/dist/factories/clickstack/resources/index.js +3 -0
- package/dist/factories/clickstack/resources/index.js.map +1 -0
- package/dist/factories/clickstack/resources/mongo.d.ts +40 -0
- package/dist/factories/clickstack/resources/mongo.d.ts.map +1 -0
- package/dist/factories/clickstack/resources/mongo.js +122 -0
- package/dist/factories/clickstack/resources/mongo.js.map +1 -0
- package/dist/factories/clickstack/types.d.ts +485 -0
- package/dist/factories/clickstack/types.d.ts.map +1 -0
- package/dist/factories/clickstack/types.js +302 -0
- package/dist/factories/clickstack/types.js.map +1 -0
- package/dist/factories/clickstack/utils/helm-values-mapper.d.ts +118 -0
- package/dist/factories/clickstack/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/clickstack/utils/helm-values-mapper.js +505 -0
- package/dist/factories/clickstack/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/clickstack/utils/index.d.ts +2 -0
- package/dist/factories/clickstack/utils/index.d.ts.map +1 -0
- package/dist/factories/clickstack/utils/index.js +2 -0
- package/dist/factories/clickstack/utils/index.js.map +1 -0
- package/dist/factories/index.d.ts +1 -0
- package/dist/factories/index.d.ts.map +1 -1
- package/dist/factories/index.js +4 -0
- package/dist/factories/index.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel-helm-repository.js","sourceRoot":"","sources":["../../../../src/factories/clickstack/compositions/otel-helm-repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EACL,qCAAqC,EACrC,uCAAuC,GACxC,MAAM,aAAa,CAAC;AAErB;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,qBAAqB,CAC9D;IACE,IAAI,EAAE,+BAA+B;IACrC,IAAI,EAAE,6BAA6B;IACnC,IAAI,EAAE,qCAAqC;IAC3C,MAAM,EAAE,uCAAuC;CAChD,EACD,CAAC,IAAI,EAAE,EAAE;IACP,MAAM,UAAU,GAAG,kBAAkB,CAAC;QACpC,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,GAAG,EAAE,IAAI,CAAC,GAAG;QACb,EAAE,EAAE,YAAY;KACjB,CAAC,CAAC;IAEH,OAAO;QACL,KAAK,EAAE,GAAG,CAAC,IAAI,CACb,UAAU,CAAC,MAAM,CAAC,UAAU,EAC5B,qDAAqD,CACtD;KACF,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack (HyperDX) Integration for TypeKro — EXTERNAL ClickHouse only.
|
|
3
|
+
*
|
|
4
|
+
* Type-safe deployment primitives for ClickStack observability on Kubernetes
|
|
5
|
+
* via the OFFICIAL `clickstack` Helm chart (MIT) from
|
|
6
|
+
* https://clickhouse.github.io/ClickStack-helm-charts, wired to an EXTERNAL
|
|
7
|
+
* ClickHouse (e.g. an Altinity-operator-managed ClickHouseInstallation).
|
|
8
|
+
* The chart's bundled ClickHouse and MongoDB are hard-disabled — their CRDs
|
|
9
|
+
* belong to the `clickstack-operators` prerequisite chart, whose ClickHouse
|
|
10
|
+
* operator would collide with the Altinity operator.
|
|
11
|
+
*
|
|
12
|
+
* ## Compositions
|
|
13
|
+
* - `clickstackBootstrap` — Namespace + shared HelmRepository singleton +
|
|
14
|
+
* optional internal Mongo (StatefulSet/Service) + clickstack HelmRelease
|
|
15
|
+
* (HyperDX UI/API/OpAMP + OTel gateway collector).
|
|
16
|
+
* - `clickstackK8sTelemetry` — the documented k8s ingestion pattern: a
|
|
17
|
+
* daemonset + a deployment instance of the STOCK `opentelemetry-collector`
|
|
18
|
+
* chart exporting otlphttp to the ClickStack gateway.
|
|
19
|
+
*
|
|
20
|
+
* ## Resources
|
|
21
|
+
* - `clickstackHelmRepository()` / `otelHelmRepository()` — chart repositories
|
|
22
|
+
* - `clickstackHelmRelease()` / `otelCollectorHelmRelease()` — releases
|
|
23
|
+
* - `clickstackMongoStatefulSet()` / `clickstackMongoService()` — internal Mongo
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { clickstackBootstrap } from 'typekro/clickstack';
|
|
28
|
+
*
|
|
29
|
+
* const factory = clickstackBootstrap.factory('kro', { namespace: 'clickstack' });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see https://github.com/ClickHouse/ClickStack-helm-charts
|
|
33
|
+
* @see https://clickhouse.com/docs/use-cases/observability/clickstack
|
|
34
|
+
* @module
|
|
35
|
+
*/
|
|
36
|
+
export * from './compositions/index.js';
|
|
37
|
+
export * from './resources/index.js';
|
|
38
|
+
export * from './types.js';
|
|
39
|
+
export * from './utils/index.js';
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factories/clickstack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack (HyperDX) Integration for TypeKro — EXTERNAL ClickHouse only.
|
|
3
|
+
*
|
|
4
|
+
* Type-safe deployment primitives for ClickStack observability on Kubernetes
|
|
5
|
+
* via the OFFICIAL `clickstack` Helm chart (MIT) from
|
|
6
|
+
* https://clickhouse.github.io/ClickStack-helm-charts, wired to an EXTERNAL
|
|
7
|
+
* ClickHouse (e.g. an Altinity-operator-managed ClickHouseInstallation).
|
|
8
|
+
* The chart's bundled ClickHouse and MongoDB are hard-disabled — their CRDs
|
|
9
|
+
* belong to the `clickstack-operators` prerequisite chart, whose ClickHouse
|
|
10
|
+
* operator would collide with the Altinity operator.
|
|
11
|
+
*
|
|
12
|
+
* ## Compositions
|
|
13
|
+
* - `clickstackBootstrap` — Namespace + shared HelmRepository singleton +
|
|
14
|
+
* optional internal Mongo (StatefulSet/Service) + clickstack HelmRelease
|
|
15
|
+
* (HyperDX UI/API/OpAMP + OTel gateway collector).
|
|
16
|
+
* - `clickstackK8sTelemetry` — the documented k8s ingestion pattern: a
|
|
17
|
+
* daemonset + a deployment instance of the STOCK `opentelemetry-collector`
|
|
18
|
+
* chart exporting otlphttp to the ClickStack gateway.
|
|
19
|
+
*
|
|
20
|
+
* ## Resources
|
|
21
|
+
* - `clickstackHelmRepository()` / `otelHelmRepository()` — chart repositories
|
|
22
|
+
* - `clickstackHelmRelease()` / `otelCollectorHelmRelease()` — releases
|
|
23
|
+
* - `clickstackMongoStatefulSet()` / `clickstackMongoService()` — internal Mongo
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { clickstackBootstrap } from 'typekro/clickstack';
|
|
28
|
+
*
|
|
29
|
+
* const factory = clickstackBootstrap.factory('kro', { namespace: 'clickstack' });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @see https://github.com/ClickHouse/ClickStack-helm-charts
|
|
33
|
+
* @see https://clickhouse.com/docs/use-cases/observability/clickstack
|
|
34
|
+
* @module
|
|
35
|
+
*/
|
|
36
|
+
export * from './compositions/index.js';
|
|
37
|
+
export * from './resources/index.js';
|
|
38
|
+
export * from './types.js';
|
|
39
|
+
export * from './utils/index.js';
|
|
40
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factories/clickstack/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack Helm Resource Factories
|
|
3
|
+
*
|
|
4
|
+
* Wrappers around the generic Flux Helm factories with ClickStack- and
|
|
5
|
+
* OpenTelemetry-specific defaults (build-around: we wrap the OFFICIAL charts,
|
|
6
|
+
* never hand-rolled manifests).
|
|
7
|
+
*
|
|
8
|
+
* Charts:
|
|
9
|
+
* - `clickstack` from https://clickhouse.github.io/ClickStack-helm-charts
|
|
10
|
+
* (classic Helm repo, MIT). NOT the archived hyperdxio/helm-charts repo and
|
|
11
|
+
* NOT the deprecated `hdx-oss-v2` chart.
|
|
12
|
+
* - `opentelemetry-collector` from
|
|
13
|
+
* https://open-telemetry.github.io/opentelemetry-helm-charts (the stock
|
|
14
|
+
* chart used by the documented ClickStack k8s ingestion pattern; it is also
|
|
15
|
+
* the clickstack chart's only dependency, vendored as alias `otel-collector`).
|
|
16
|
+
*
|
|
17
|
+
* Both chart repositories are cluster-level Flux sources shared by every
|
|
18
|
+
* consumer, so the bootstrap compositions deploy them via `singleton(...)`
|
|
19
|
+
* (see compositions/*-helm-repository.ts). NOTE from the clickhouse family:
|
|
20
|
+
* direct-mode `toYaml()` omits singleton-owned resources — tests must assert
|
|
21
|
+
* repository URLs on the KRO instance bundle instead.
|
|
22
|
+
*/
|
|
23
|
+
import type { Composable, Enhanced } from '../../../core/types/index.js';
|
|
24
|
+
import { type HelmRepositorySpec, type HelmRepositoryStatus } from '../../helm/helm-repository.js';
|
|
25
|
+
import type { HelmReleaseSpec, HelmReleaseStatus } from '../../helm/types.js';
|
|
26
|
+
import type { ClickStackHelmReleaseConfig, ClickStackHelmRepositoryConfig, OtelCollectorHelmReleaseConfig } from '../types.js';
|
|
27
|
+
/** Official ClickStack Helm chart repository URL (classic repo, not OCI). */
|
|
28
|
+
export declare const DEFAULT_CLICKSTACK_REPO_URL = "https://clickhouse.github.io/ClickStack-helm-charts";
|
|
29
|
+
/** Default Flux HelmRepository name for the ClickStack chart repository. */
|
|
30
|
+
export declare const DEFAULT_CLICKSTACK_REPO_NAME = "clickstack";
|
|
31
|
+
/** Official ClickStack chart name. */
|
|
32
|
+
export declare const CLICKSTACK_CHART_NAME = "clickstack";
|
|
33
|
+
/**
|
|
34
|
+
* Default clickstack chart version (verified against the live repo index on
|
|
35
|
+
* 2026-07-06: 3.0.1, appVersion 2.29.0).
|
|
36
|
+
*/
|
|
37
|
+
export declare const DEFAULT_CLICKSTACK_VERSION = "3.0.1";
|
|
38
|
+
/** Official OpenTelemetry Helm chart repository URL. */
|
|
39
|
+
export declare const DEFAULT_OTEL_REPO_URL = "https://open-telemetry.github.io/opentelemetry-helm-charts";
|
|
40
|
+
/** Default Flux HelmRepository name for the OpenTelemetry chart repository. */
|
|
41
|
+
export declare const DEFAULT_OTEL_REPO_NAME = "open-telemetry";
|
|
42
|
+
/** Stock collector chart name. */
|
|
43
|
+
export declare const OTEL_COLLECTOR_CHART_NAME = "opentelemetry-collector";
|
|
44
|
+
/**
|
|
45
|
+
* Default stock opentelemetry-collector chart version for the k8s telemetry
|
|
46
|
+
* collectors. Pinned to the same minor the clickstack chart declares for its
|
|
47
|
+
* gateway subchart dependency (`~0.146.0`; 0.146.1 verified on the live repo
|
|
48
|
+
* index 2026-07-06) so gateway and edge collectors stay aligned.
|
|
49
|
+
*/
|
|
50
|
+
export declare const DEFAULT_OTEL_COLLECTOR_VERSION = "0.146.1";
|
|
51
|
+
/** HyperDX UI port (`hyperdx.ports.app`). */
|
|
52
|
+
export declare const CLICKSTACK_APP_PORT = 3000;
|
|
53
|
+
/** HyperDX API port (`hyperdx.ports.api`). */
|
|
54
|
+
export declare const CLICKSTACK_API_PORT = 8000;
|
|
55
|
+
/** Gateway collector OTLP/HTTP servicePort (`otel-collector.ports.otlp-http`). */
|
|
56
|
+
export declare const CLICKSTACK_OTLP_HTTP_PORT = 4318;
|
|
57
|
+
/** Gateway collector OTLP/gRPC servicePort (`otel-collector.ports.otlp`). */
|
|
58
|
+
export declare const CLICKSTACK_OTLP_GRPC_PORT = 4317;
|
|
59
|
+
/** Suffix the chart appends to `.Release.Name` for the gateway collector Service. */
|
|
60
|
+
export declare const CLICKSTACK_GATEWAY_NAME_SUFFIX = "-otel-collector";
|
|
61
|
+
/**
|
|
62
|
+
* Create a Flux HelmRepository for the official ClickStack chart repository.
|
|
63
|
+
*/
|
|
64
|
+
export declare function clickstackHelmRepository(config: Composable<ClickStackHelmRepositoryConfig>): Enhanced<HelmRepositorySpec, HelmRepositoryStatus>;
|
|
65
|
+
/**
|
|
66
|
+
* Create a Flux HelmRepository for the official OpenTelemetry chart repository.
|
|
67
|
+
*/
|
|
68
|
+
export declare function otelHelmRepository(config: Composable<ClickStackHelmRepositoryConfig>): Enhanced<HelmRepositorySpec, HelmRepositoryStatus>;
|
|
69
|
+
/**
|
|
70
|
+
* Create a Flux HelmRelease for ClickStack using the official chart defaults.
|
|
71
|
+
*/
|
|
72
|
+
export declare function clickstackHelmRelease(config: Composable<ClickStackHelmReleaseConfig>): Enhanced<HelmReleaseSpec, HelmReleaseStatus>;
|
|
73
|
+
/**
|
|
74
|
+
* Create a Flux HelmRelease for a stock opentelemetry-collector instance
|
|
75
|
+
* (daemonset or deployment mode is decided by the supplied values).
|
|
76
|
+
*/
|
|
77
|
+
export declare function otelCollectorHelmRelease(config: Composable<OtelCollectorHelmReleaseConfig>): Enhanced<HelmReleaseSpec, HelmReleaseStatus>;
|
|
78
|
+
//# sourceMappingURL=helm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickstack/resources/helm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,wDAAwD,CAAC;AAEjG,4EAA4E;AAC5E,eAAO,MAAM,4BAA4B,eAAe,CAAC;AAEzD,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,eAAe,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,UAAU,CAAC;AAElD,wDAAwD;AACxD,eAAO,MAAM,qBAAqB,+DAA+D,CAAC;AAElG,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,mBAAmB,CAAC;AAEvD,kCAAkC;AAClC,eAAO,MAAM,yBAAyB,4BAA4B,CAAC;AAEnE;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,YAAY,CAAC;AAKxD,6CAA6C;AAC7C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,8CAA8C;AAC9C,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAExC,kFAAkF;AAClF,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,qFAAqF;AACrF,eAAO,MAAM,8BAA8B,oBAAoB,CAAC;AAEhE;;GAEG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,CAAC,8BAA8B,CAAC,GACjD,QAAQ,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAgBpD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,CAAC,8BAA8B,CAAC,GACjD,QAAQ,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAcpD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,CAAC,2BAA2B,CAAC,GAC9C,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAoB9C;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,CAAC,8BAA8B,CAAC,GACjD,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAoB9C"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack Helm Resource Factories
|
|
3
|
+
*
|
|
4
|
+
* Wrappers around the generic Flux Helm factories with ClickStack- and
|
|
5
|
+
* OpenTelemetry-specific defaults (build-around: we wrap the OFFICIAL charts,
|
|
6
|
+
* never hand-rolled manifests).
|
|
7
|
+
*
|
|
8
|
+
* Charts:
|
|
9
|
+
* - `clickstack` from https://clickhouse.github.io/ClickStack-helm-charts
|
|
10
|
+
* (classic Helm repo, MIT). NOT the archived hyperdxio/helm-charts repo and
|
|
11
|
+
* NOT the deprecated `hdx-oss-v2` chart.
|
|
12
|
+
* - `opentelemetry-collector` from
|
|
13
|
+
* https://open-telemetry.github.io/opentelemetry-helm-charts (the stock
|
|
14
|
+
* chart used by the documented ClickStack k8s ingestion pattern; it is also
|
|
15
|
+
* the clickstack chart's only dependency, vendored as alias `otel-collector`).
|
|
16
|
+
*
|
|
17
|
+
* Both chart repositories are cluster-level Flux sources shared by every
|
|
18
|
+
* consumer, so the bootstrap compositions deploy them via `singleton(...)`
|
|
19
|
+
* (see compositions/*-helm-repository.ts). NOTE from the clickhouse family:
|
|
20
|
+
* direct-mode `toYaml()` omits singleton-owned resources — tests must assert
|
|
21
|
+
* repository URLs on the KRO instance bundle instead.
|
|
22
|
+
*/
|
|
23
|
+
import { DEFAULT_FLUX_NAMESPACE } from '../../../core/config/defaults.js';
|
|
24
|
+
import { setMetadataField } from '../../../core/metadata/resource-metadata.js';
|
|
25
|
+
import { helmRelease } from '../../helm/helm-release.js';
|
|
26
|
+
import { createHelmRepositoryReadinessEvaluator, helmRepository, } from '../../helm/helm-repository.js';
|
|
27
|
+
import { createLabeledHelmReleaseEvaluator } from '../../helm/readiness-evaluators.js';
|
|
28
|
+
/** Official ClickStack Helm chart repository URL (classic repo, not OCI). */
|
|
29
|
+
export const DEFAULT_CLICKSTACK_REPO_URL = 'https://clickhouse.github.io/ClickStack-helm-charts';
|
|
30
|
+
/** Default Flux HelmRepository name for the ClickStack chart repository. */
|
|
31
|
+
export const DEFAULT_CLICKSTACK_REPO_NAME = 'clickstack';
|
|
32
|
+
/** Official ClickStack chart name. */
|
|
33
|
+
export const CLICKSTACK_CHART_NAME = 'clickstack';
|
|
34
|
+
/**
|
|
35
|
+
* Default clickstack chart version (verified against the live repo index on
|
|
36
|
+
* 2026-07-06: 3.0.1, appVersion 2.29.0).
|
|
37
|
+
*/
|
|
38
|
+
export const DEFAULT_CLICKSTACK_VERSION = '3.0.1';
|
|
39
|
+
/** Official OpenTelemetry Helm chart repository URL. */
|
|
40
|
+
export const DEFAULT_OTEL_REPO_URL = 'https://open-telemetry.github.io/opentelemetry-helm-charts';
|
|
41
|
+
/** Default Flux HelmRepository name for the OpenTelemetry chart repository. */
|
|
42
|
+
export const DEFAULT_OTEL_REPO_NAME = 'open-telemetry';
|
|
43
|
+
/** Stock collector chart name. */
|
|
44
|
+
export const OTEL_COLLECTOR_CHART_NAME = 'opentelemetry-collector';
|
|
45
|
+
/**
|
|
46
|
+
* Default stock opentelemetry-collector chart version for the k8s telemetry
|
|
47
|
+
* collectors. Pinned to the same minor the clickstack chart declares for its
|
|
48
|
+
* gateway subchart dependency (`~0.146.0`; 0.146.1 verified on the live repo
|
|
49
|
+
* index 2026-07-06) so gateway and edge collectors stay aligned.
|
|
50
|
+
*/
|
|
51
|
+
export const DEFAULT_OTEL_COLLECTOR_VERSION = '0.146.1';
|
|
52
|
+
// Chart port facts (values.yaml `hyperdx.ports` and `otel-collector.ports`,
|
|
53
|
+
// chart 3.0.1) — the bootstrap status contract is built on these defaults.
|
|
54
|
+
/** HyperDX UI port (`hyperdx.ports.app`). */
|
|
55
|
+
export const CLICKSTACK_APP_PORT = 3000;
|
|
56
|
+
/** HyperDX API port (`hyperdx.ports.api`). */
|
|
57
|
+
export const CLICKSTACK_API_PORT = 8000;
|
|
58
|
+
/** Gateway collector OTLP/HTTP servicePort (`otel-collector.ports.otlp-http`). */
|
|
59
|
+
export const CLICKSTACK_OTLP_HTTP_PORT = 4318;
|
|
60
|
+
/** Gateway collector OTLP/gRPC servicePort (`otel-collector.ports.otlp`). */
|
|
61
|
+
export const CLICKSTACK_OTLP_GRPC_PORT = 4317;
|
|
62
|
+
/** Suffix the chart appends to `.Release.Name` for the gateway collector Service. */
|
|
63
|
+
export const CLICKSTACK_GATEWAY_NAME_SUFFIX = '-otel-collector';
|
|
64
|
+
/**
|
|
65
|
+
* Create a Flux HelmRepository for the official ClickStack chart repository.
|
|
66
|
+
*/
|
|
67
|
+
export function clickstackHelmRepository(config) {
|
|
68
|
+
const repo = helmRepository({
|
|
69
|
+
name: config.name || DEFAULT_CLICKSTACK_REPO_NAME,
|
|
70
|
+
namespace: config.namespace || DEFAULT_FLUX_NAMESPACE,
|
|
71
|
+
url: config.url || DEFAULT_CLICKSTACK_REPO_URL,
|
|
72
|
+
interval: config.interval || '5m',
|
|
73
|
+
...(config.id && { id: config.id }),
|
|
74
|
+
}).withReadinessEvaluator(createHelmRepositoryReadinessEvaluator('ClickStack'));
|
|
75
|
+
// One cluster-level Flux source shared by every consumer — never torn down
|
|
76
|
+
// with an individual instance.
|
|
77
|
+
setMetadataField(repo, 'scopes', ['cluster']);
|
|
78
|
+
return repo;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Create a Flux HelmRepository for the official OpenTelemetry chart repository.
|
|
82
|
+
*/
|
|
83
|
+
export function otelHelmRepository(config) {
|
|
84
|
+
const repo = helmRepository({
|
|
85
|
+
name: config.name || DEFAULT_OTEL_REPO_NAME,
|
|
86
|
+
namespace: config.namespace || DEFAULT_FLUX_NAMESPACE,
|
|
87
|
+
url: config.url || DEFAULT_OTEL_REPO_URL,
|
|
88
|
+
interval: config.interval || '5m',
|
|
89
|
+
...(config.id && { id: config.id }),
|
|
90
|
+
}).withReadinessEvaluator(createHelmRepositoryReadinessEvaluator('OpenTelemetry'));
|
|
91
|
+
setMetadataField(repo, 'scopes', ['cluster']);
|
|
92
|
+
return repo;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Create a Flux HelmRelease for ClickStack using the official chart defaults.
|
|
96
|
+
*/
|
|
97
|
+
export function clickstackHelmRelease(config) {
|
|
98
|
+
return helmRelease({
|
|
99
|
+
name: config.name,
|
|
100
|
+
namespace: config.namespace || 'clickstack',
|
|
101
|
+
chart: {
|
|
102
|
+
repository: DEFAULT_CLICKSTACK_REPO_URL,
|
|
103
|
+
name: CLICKSTACK_CHART_NAME,
|
|
104
|
+
version: config.version || DEFAULT_CLICKSTACK_VERSION,
|
|
105
|
+
},
|
|
106
|
+
sourceRef: {
|
|
107
|
+
name: config.repositoryName || DEFAULT_CLICKSTACK_REPO_NAME,
|
|
108
|
+
namespace: config.repositoryNamespace || DEFAULT_FLUX_NAMESPACE,
|
|
109
|
+
kind: 'HelmRepository',
|
|
110
|
+
},
|
|
111
|
+
driftDetection: { mode: 'enabled' },
|
|
112
|
+
values: config.values || {},
|
|
113
|
+
...(config.id && { id: config.id }),
|
|
114
|
+
}).withReadinessEvaluator(createLabeledHelmReleaseEvaluator('ClickStack'));
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Create a Flux HelmRelease for a stock opentelemetry-collector instance
|
|
118
|
+
* (daemonset or deployment mode is decided by the supplied values).
|
|
119
|
+
*/
|
|
120
|
+
export function otelCollectorHelmRelease(config) {
|
|
121
|
+
return helmRelease({
|
|
122
|
+
name: config.name,
|
|
123
|
+
namespace: config.namespace || 'clickstack-telemetry',
|
|
124
|
+
chart: {
|
|
125
|
+
repository: DEFAULT_OTEL_REPO_URL,
|
|
126
|
+
name: OTEL_COLLECTOR_CHART_NAME,
|
|
127
|
+
version: config.version || DEFAULT_OTEL_COLLECTOR_VERSION,
|
|
128
|
+
},
|
|
129
|
+
sourceRef: {
|
|
130
|
+
name: config.repositoryName || DEFAULT_OTEL_REPO_NAME,
|
|
131
|
+
namespace: config.repositoryNamespace || DEFAULT_FLUX_NAMESPACE,
|
|
132
|
+
kind: 'HelmRepository',
|
|
133
|
+
},
|
|
134
|
+
driftDetection: { mode: 'enabled' },
|
|
135
|
+
values: config.values || {},
|
|
136
|
+
...(config.id && { id: config.id }),
|
|
137
|
+
}).withReadinessEvaluator(createLabeledHelmReleaseEvaluator('OtelCollector'));
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=helm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.js","sourceRoot":"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AM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;KACpC,CAAC,CAAC,sBAAsB,CACvB,iCAAiC,CAAC,eAAe,CAAC,CACH,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickstack/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factories/clickstack/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack Internal MongoDB Resources
|
|
3
|
+
*
|
|
4
|
+
* HyperDX has a HARD MongoDB dependency for app state (dashboards, alerts,
|
|
5
|
+
* users, saved sources — MongoDB is SSPL at runtime). The official chart's
|
|
6
|
+
* bundled MongoDB is a `MongoDBCommunity` CRD owned by the separate
|
|
7
|
+
* `clickstack-operators` prerequisite chart, which this family deliberately
|
|
8
|
+
* does NOT install (its ClickHouse operator CRDs would collide with the
|
|
9
|
+
* Altinity operator; see types.ts). Internal mode therefore provisions a
|
|
10
|
+
* minimal typekro-native StatefulSet + Service instead — NO operator, NO CRDs.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ LOUD CAVEATS — read before pointing production at this:
|
|
13
|
+
* - APP METADATA ONLY: observability data lives in ClickHouse; Mongo holds
|
|
14
|
+
* HyperDX dashboards/alerts/users. Losing it loses UI state, not telemetry.
|
|
15
|
+
* - SINGLE REPLICA, NO AUTH: one `mongo:7` pod with a PVC, reachable only
|
|
16
|
+
* inside the cluster via its ClusterIP Service. Dev-first sizing — use
|
|
17
|
+
* `mongo: { mode: 'external', uri }` for anything with an SLA.
|
|
18
|
+
*/
|
|
19
|
+
import type { Composable, Enhanced } from '../../../core/types/index.js';
|
|
20
|
+
import type { V1ServiceSpec, V1ServiceStatus } from '../../kubernetes/types.js';
|
|
21
|
+
import { type V1StatefulSetSpec, type V1StatefulSetStatus } from '../../kubernetes/workloads/stateful-set.js';
|
|
22
|
+
import type { ClickStackMongoConfig } from '../types.js';
|
|
23
|
+
/** Pinned major-version Mongo image for the internal app-state store. */
|
|
24
|
+
export declare const DEFAULT_CLICKSTACK_MONGO_IMAGE = "mongo:7";
|
|
25
|
+
/** MongoDB port. */
|
|
26
|
+
export declare const CLICKSTACK_MONGO_PORT = 27017;
|
|
27
|
+
/** Default PVC size for the internal Mongo. */
|
|
28
|
+
export declare const DEFAULT_CLICKSTACK_MONGO_STORAGE_SIZE = "5Gi";
|
|
29
|
+
/** Suffix appended to the ClickStack instance name for Mongo resources. */
|
|
30
|
+
export declare const CLICKSTACK_MONGO_NAME_SUFFIX = "-mongodb";
|
|
31
|
+
/**
|
|
32
|
+
* Create the single-replica internal Mongo StatefulSet (`<name>-mongodb`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function clickstackMongoStatefulSet(config: Composable<ClickStackMongoConfig>): Enhanced<V1StatefulSetSpec, V1StatefulSetStatus>;
|
|
35
|
+
/**
|
|
36
|
+
* Create the ClusterIP Service (`<name>-mongodb`) fronting the internal Mongo.
|
|
37
|
+
* `hyperdx.config.MONGO_URI` points at this Service's DNS name.
|
|
38
|
+
*/
|
|
39
|
+
export declare function clickstackMongoService(config: Composable<ClickStackMongoConfig>): Enhanced<V1ServiceSpec, V1ServiceStatus>;
|
|
40
|
+
//# sourceMappingURL=mongo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickstack/resources/mongo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEhF,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACzB,MAAM,4CAA4C,CAAC;AACpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,YAAY,CAAC;AAExD,oBAAoB;AACpB,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C,+CAA+C;AAC/C,eAAO,MAAM,qCAAqC,QAAQ,CAAC;AAE3D,2EAA2E;AAC3E,eAAO,MAAM,4BAA4B,aAAa,CAAC;AAUvD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,UAAU,CAAC,qBAAqB,CAAC,GACxC,QAAQ,CAAC,iBAAiB,EAAE,mBAAmB,CAAC,CAyDlD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,UAAU,CAAC,qBAAqB,CAAC,GACxC,QAAQ,CAAC,aAAa,EAAE,eAAe,CAAC,CAoB1C"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickStack Internal MongoDB Resources
|
|
3
|
+
*
|
|
4
|
+
* HyperDX has a HARD MongoDB dependency for app state (dashboards, alerts,
|
|
5
|
+
* users, saved sources — MongoDB is SSPL at runtime). The official chart's
|
|
6
|
+
* bundled MongoDB is a `MongoDBCommunity` CRD owned by the separate
|
|
7
|
+
* `clickstack-operators` prerequisite chart, which this family deliberately
|
|
8
|
+
* does NOT install (its ClickHouse operator CRDs would collide with the
|
|
9
|
+
* Altinity operator; see types.ts). Internal mode therefore provisions a
|
|
10
|
+
* minimal typekro-native StatefulSet + Service instead — NO operator, NO CRDs.
|
|
11
|
+
*
|
|
12
|
+
* ⚠️ LOUD CAVEATS — read before pointing production at this:
|
|
13
|
+
* - APP METADATA ONLY: observability data lives in ClickHouse; Mongo holds
|
|
14
|
+
* HyperDX dashboards/alerts/users. Losing it loses UI state, not telemetry.
|
|
15
|
+
* - SINGLE REPLICA, NO AUTH: one `mongo:7` pod with a PVC, reachable only
|
|
16
|
+
* inside the cluster via its ClusterIP Service. Dev-first sizing — use
|
|
17
|
+
* `mongo: { mode: 'external', uri }` for anything with an SLA.
|
|
18
|
+
*/
|
|
19
|
+
import { Cel } from '../../../core/references/cel.js';
|
|
20
|
+
import { service } from '../../kubernetes/networking/service.js';
|
|
21
|
+
import { statefulSet, } from '../../kubernetes/workloads/stateful-set.js';
|
|
22
|
+
/** Pinned major-version Mongo image for the internal app-state store. */
|
|
23
|
+
export const DEFAULT_CLICKSTACK_MONGO_IMAGE = 'mongo:7';
|
|
24
|
+
/** MongoDB port. */
|
|
25
|
+
export const CLICKSTACK_MONGO_PORT = 27017;
|
|
26
|
+
/** Default PVC size for the internal Mongo. */
|
|
27
|
+
export const DEFAULT_CLICKSTACK_MONGO_STORAGE_SIZE = '5Gi';
|
|
28
|
+
/** Suffix appended to the ClickStack instance name for Mongo resources. */
|
|
29
|
+
export const CLICKSTACK_MONGO_NAME_SUFFIX = '-mongodb';
|
|
30
|
+
function mongoLabels(instanceName) {
|
|
31
|
+
return {
|
|
32
|
+
'app.kubernetes.io/name': 'clickstack-mongodb',
|
|
33
|
+
'app.kubernetes.io/instance': instanceName,
|
|
34
|
+
'app.kubernetes.io/managed-by': 'typekro',
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Create the single-replica internal Mongo StatefulSet (`<name>-mongodb`).
|
|
39
|
+
*/
|
|
40
|
+
export function clickstackMongoStatefulSet(config) {
|
|
41
|
+
const resourceName = Cel.template('%s%s', config.name, CLICKSTACK_MONGO_NAME_SUFFIX);
|
|
42
|
+
const labels = mongoLabels(config.name);
|
|
43
|
+
return statefulSet({
|
|
44
|
+
metadata: {
|
|
45
|
+
name: resourceName,
|
|
46
|
+
namespace: config.namespace,
|
|
47
|
+
labels,
|
|
48
|
+
},
|
|
49
|
+
spec: {
|
|
50
|
+
// SINGLE REPLICA by design (see module doc) — not configurable.
|
|
51
|
+
replicas: 1,
|
|
52
|
+
serviceName: resourceName,
|
|
53
|
+
selector: { matchLabels: labels },
|
|
54
|
+
template: {
|
|
55
|
+
metadata: { labels },
|
|
56
|
+
spec: {
|
|
57
|
+
containers: [
|
|
58
|
+
{
|
|
59
|
+
name: 'mongodb',
|
|
60
|
+
image: config.image ?? DEFAULT_CLICKSTACK_MONGO_IMAGE,
|
|
61
|
+
ports: [{ name: 'mongodb', containerPort: CLICKSTACK_MONGO_PORT }],
|
|
62
|
+
volumeMounts: [{ name: 'data', mountPath: '/data/db' }],
|
|
63
|
+
readinessProbe: {
|
|
64
|
+
tcpSocket: { port: CLICKSTACK_MONGO_PORT },
|
|
65
|
+
initialDelaySeconds: 5,
|
|
66
|
+
periodSeconds: 10,
|
|
67
|
+
},
|
|
68
|
+
livenessProbe: {
|
|
69
|
+
tcpSocket: { port: CLICKSTACK_MONGO_PORT },
|
|
70
|
+
initialDelaySeconds: 30,
|
|
71
|
+
periodSeconds: 20,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
volumeClaimTemplates: [
|
|
78
|
+
{
|
|
79
|
+
metadata: { name: 'data' },
|
|
80
|
+
spec: {
|
|
81
|
+
accessModes: ['ReadWriteOnce'],
|
|
82
|
+
resources: {
|
|
83
|
+
requests: {
|
|
84
|
+
storage: config.storageSize ?? DEFAULT_CLICKSTACK_MONGO_STORAGE_SIZE,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
...(config.storageClassName !== undefined && {
|
|
88
|
+
storageClassName: config.storageClassName,
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
...(config.statefulSetId && { id: config.statefulSetId }),
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Create the ClusterIP Service (`<name>-mongodb`) fronting the internal Mongo.
|
|
99
|
+
* `hyperdx.config.MONGO_URI` points at this Service's DNS name.
|
|
100
|
+
*/
|
|
101
|
+
export function clickstackMongoService(config) {
|
|
102
|
+
return service({
|
|
103
|
+
metadata: {
|
|
104
|
+
name: Cel.template('%s%s', config.name, CLICKSTACK_MONGO_NAME_SUFFIX),
|
|
105
|
+
namespace: config.namespace,
|
|
106
|
+
labels: mongoLabels(config.name),
|
|
107
|
+
},
|
|
108
|
+
spec: {
|
|
109
|
+
type: 'ClusterIP',
|
|
110
|
+
selector: mongoLabels(config.name),
|
|
111
|
+
ports: [
|
|
112
|
+
{
|
|
113
|
+
name: 'mongodb',
|
|
114
|
+
port: CLICKSTACK_MONGO_PORT,
|
|
115
|
+
targetPort: CLICKSTACK_MONGO_PORT,
|
|
116
|
+
},
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
...(config.serviceId && { id: config.serviceId }),
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=mongo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../../../src/factories/clickstack/resources/mongo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,iCAAiC,CAAC;AAGtD,OAAO,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACjE,OAAO,EACL,WAAW,GAGZ,MAAM,4CAA4C,CAAC;AAGpD,yEAAyE;AACzE,MAAM,CAAC,MAAM,8BAA8B,GAAG,SAAS,CAAC;AAExD,oBAAoB;AACpB,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAE3C,+CAA+C;AAC/C,MAAM,CAAC,MAAM,qCAAqC,GAAG,KAAK,CAAC;AAE3D,2EAA2E;AAC3E,MAAM,CAAC,MAA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