@konfig.ts/k8s 0.0.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.
@@ -0,0 +1,58 @@
1
+ import type { ConfigMapRef, SecretRef, ServiceAccountRef } from "@konfig.ts/core";
2
+ import { Manifest } from "@konfig.ts/core";
3
+ import type { ConfigMap as K8sConfigMap, Namespace as K8sNamespace, Secret as K8sSecret, ServiceAccount as K8sServiceAccount } from "./.generated/k8s-types";
4
+ type CommonMeta = {
5
+ readonly labels?: Readonly<Record<string, string>>;
6
+ readonly annotations?: Readonly<Record<string, string>>;
7
+ };
8
+ export interface NamespaceInput<N extends string> extends CommonMeta {
9
+ readonly name: N;
10
+ }
11
+ export interface NamespaceManifest<N extends string> extends Manifest.Manifest<K8sNamespace> {
12
+ readonly ref: N;
13
+ }
14
+ export declare const Namespace: {
15
+ make: <N extends string>(input: NamespaceInput<N>) => NamespaceManifest<N>;
16
+ };
17
+ export interface ServiceAccountInput<N extends string> extends CommonMeta {
18
+ readonly name: N;
19
+ readonly namespace: string;
20
+ readonly automountServiceAccountToken?: boolean;
21
+ readonly imagePullSecrets?: ReadonlyArray<{
22
+ readonly name: SecretRef<string>;
23
+ }>;
24
+ }
25
+ export interface ServiceAccountManifest<N extends string> extends Manifest.Manifest<K8sServiceAccount> {
26
+ readonly ref: ServiceAccountRef<N>;
27
+ }
28
+ export declare const ServiceAccount: {
29
+ make: <N extends string>(input: ServiceAccountInput<N>) => ServiceAccountManifest<N>;
30
+ };
31
+ export interface ConfigMapInput<N extends string, K extends string = string> extends CommonMeta {
32
+ readonly name: N;
33
+ readonly namespace: string;
34
+ readonly data?: Readonly<Record<K, string>>;
35
+ readonly binaryData?: Readonly<Record<K, string>>;
36
+ readonly immutable?: boolean;
37
+ }
38
+ export interface ConfigMapManifest<N extends string, K extends string = string> extends Manifest.Manifest<K8sConfigMap> {
39
+ readonly ref: ConfigMapRef<N, K>;
40
+ }
41
+ export declare const ConfigMap: {
42
+ make: <const N extends string, const K extends string = string>(input: ConfigMapInput<N, K>) => ConfigMapManifest<N, K>;
43
+ };
44
+ export interface SecretInput<N extends string, Ns extends string = string, K extends string = string> extends CommonMeta {
45
+ readonly name: N;
46
+ readonly namespace: Ns;
47
+ readonly type?: string;
48
+ readonly data?: Readonly<Record<K, string>>;
49
+ readonly stringData?: Readonly<Record<K, string>>;
50
+ readonly immutable?: boolean;
51
+ }
52
+ export interface SecretManifest<N extends string, Ns extends string = string, K extends string = string> extends Manifest.Manifest<K8sSecret> {
53
+ readonly ref: SecretRef<N, K, Ns>;
54
+ }
55
+ export declare const Secret: {
56
+ make: <const N extends string, const Ns extends string = string, const K extends string = string>(input: SecretInput<N, Ns, K>) => SecretManifest<N, Ns, K>;
57
+ };
58
+ export {};
@@ -0,0 +1,48 @@
1
+ export * as K8s from "./.generated/k8s-types";
2
+ export { Container, type ContainerInput, type ContainerSpec, type DefineContainerInput, type DefinedPod, type DefinePodInput, Pod, type PodSpecInput, } from "./container";
3
+ export { type ContainerPort, type ContainerProtocol, type ExecAction, type GrpcAction, type HttpGetAction, type HttpHeader, type NamesOf, Port, type PortInput, type PortName, type ProbeTarget, type ServicePortSpec, type TcpSocketAction, } from "./ports";
4
+ export { type ConfigMapEnvInput, EnvVar, type EnvVarSource, type RawEnvInput, type SecretEnvForPodInput, type SecretEnvInput, type ValueEnvInput, } from "./env";
5
+ export { ConfigMap, type ConfigMapInput, type ConfigMapManifest, Namespace, type NamespaceInput, type NamespaceManifest, type SecretInput, type SecretManifest, ServiceAccount, type ServiceAccountInput, type ServiceAccountManifest, } from "./identity";
6
+ import { Environment as _EnvironmentContract } from "@konfig.ts/env";
7
+ /**
8
+ * `Secret` value namespace — merges the env-contracts side (`define`)
9
+ * with the K8s side (`make`, `bind`, identity helpers). Importing
10
+ * `Secret` from `@konfig.ts/k8s` gives you the full surface:
11
+ *
12
+ * Secret.define({ name, namespace, env }) — env contract (from @konfig.ts/env)
13
+ * Secret.make({ name, namespace, stringData }) — K8s Secret manifest
14
+ * Secret.bind({ secret, backend, source }) — env-to-manifest binder
15
+ */
16
+ export declare const Secret: {
17
+ bind: <N extends string, K extends string, E extends Readonly<Record<K, string>>, const Ns extends string = string>(input: import("./secretBind").BindSecretInput<N, K, E, Ns>) => import("./secretBind").DeclaredSecret<N, K, Ns>;
18
+ make: <const N extends string, const Ns extends string = string, const K extends string = string>(input: import("./identity").SecretInput<N, Ns, K>) => import("./identity").SecretManifest<N, Ns, K>;
19
+ define: <const N extends string, const E extends Readonly<Record<string, string>>>(input: import("@konfig.ts/env").DefineSecretInput<N, E>) => import("@konfig.ts/env").SecretEntry<N, keyof E & string, E>;
20
+ };
21
+ /**
22
+ * `Environment` value namespace — merges `define` (env-contracts) with
23
+ * `bind` + `runtime` (K8s). The same `Environment` symbol carries the
24
+ * declaration, the manifest binder, and the runtime decoder.
25
+ */
26
+ export declare const Environment: {
27
+ bind: <const M extends Readonly<Record<string, import("@konfig.ts/env").EnvMember>>, const Ns extends string = string>(input: import("./environmentBind").BindEnvironmentInput<M, Ns>) => import("./environmentBind").DeclaredEnvironment<M, Ns>;
28
+ runtime: <M extends Readonly<Record<string, import("@konfig.ts/env").EnvMember>>>(env: _EnvironmentContract<M>) => import("effect/Effect").Effect<import("@konfig.ts/env").EnvironmentShape<M>, import("effect/Config").ConfigError>;
29
+ define: <const M extends Readonly<Record<string, import("@konfig.ts/env").EnvMember>>>(members: M & ([{ [K in keyof M]: Extract<M[K] extends infer T ? T extends M[K] ? T extends import("@konfig.ts/env").SecretEntry<infer _N extends string, infer _K extends string, infer Envs extends Readonly<Record<infer _K extends string, string>>> ? Envs extends Readonly<Record<string, infer V extends string>> ? V : never : T extends import("@konfig.ts/env").LiteralEntry<infer EnvName extends string, infer _T> ? EnvName : T extends import("@konfig.ts/env").DownwardEntry<infer EnvName_1 extends string> ? EnvName_1 : never : never : never, { [Other in keyof M]: Other extends K ? never : M[Other] extends infer T_1 ? T_1 extends M[Other] ? T_1 extends import("@konfig.ts/env").SecretEntry<infer _N extends string, infer _K extends string, infer Envs extends Readonly<Record<infer _K extends string, string>>> ? Envs extends Readonly<Record<string, infer V extends string>> ? V : never : T_1 extends import("@konfig.ts/env").LiteralEntry<infer EnvName extends string, infer _T> ? EnvName : T_1 extends import("@konfig.ts/env").DownwardEntry<infer EnvName_1 extends string> ? EnvName_1 : never : never : never; }[keyof M]>; }[keyof M]] extends [never] ? M : {
30
+ readonly _konfig_error: `Environment: envName "${Extract<{ [K in keyof M]: Extract<M[K] extends infer T ? T extends M[K] ? T extends import("@konfig.ts/env").SecretEntry<infer _N extends string, infer _K extends string, infer Envs extends Readonly<Record<infer _K extends string, string>>> ? Envs extends Readonly<Record<string, infer V extends string>> ? V : never : T extends import("@konfig.ts/env").LiteralEntry<infer EnvName extends string, infer _T> ? EnvName : T extends import("@konfig.ts/env").DownwardEntry<infer EnvName_1 extends string> ? EnvName_1 : never : never : never, { [Other in keyof M]: Other extends K ? never : M[Other] extends infer T_1 ? T_1 extends M[Other] ? T_1 extends import("@konfig.ts/env").SecretEntry<infer _N extends string, infer _K extends string, infer Envs extends Readonly<Record<infer _K extends string, string>>> ? Envs extends Readonly<Record<string, infer V extends string>> ? V : never : T_1 extends import("@konfig.ts/env").LiteralEntry<infer EnvName extends string, infer _T> ? EnvName : T_1 extends import("@konfig.ts/env").DownwardEntry<infer EnvName_1 extends string> ? EnvName_1 : never : never : never; }[keyof M]>; }[keyof M], string>}" is claimed by multiple members`;
31
+ })) => _EnvironmentContract<M>;
32
+ };
33
+ export type { BindSecretInput, DeclaredSecret, } from "./secretBind";
34
+ export type { BindEnvironmentInput, DeclaredDownward, DeclaredEnvironment, DeclaredLiteral, DeclaredMember, HasSecrets, SecretMemberOptions, SecretMemberOptionsFor, SecretMembersOpts, } from "./environmentBind";
35
+ export { type BackendEmitInput, BackendSourceMissing, type BackendTag, type SecretBackend, } from "./backend";
36
+ export { NativeSecret, type NativeSecretOptions } from "./nativeSecret";
37
+ export { hashSecretValues, type HashSecretValuesInput } from "./podHash";
38
+ export { Ingress, type IngressInput, type IngressTLSInput, Service, type ServiceFromContainerInput, type ServiceFromPodSetInput, type ServiceInput, } from "./network";
39
+ export { ClusterRole, ClusterRoleBinding, type ClusterRoleBindingInput, type ClusterRoleInput, NetworkPolicy, type NetworkPolicyEgressRule, type NetworkPolicyFromPodSetInput, type NetworkPolicyIngressRule, type NetworkPolicyInput, type NetworkPolicyPeer, PersistentVolume, PersistentVolumeClaim, type PersistentVolumeClaimInput, type PersistentVolumeInput, Role, RoleBinding, type RoleBindingInput, type RoleInput, } from "./policy";
40
+ export type { ConfigMapRefName, PvcRefName, SecretRefName } from "./refs";
41
+ export { ConfigMapRef, PvcRef, SecretRef, ServiceAccountRef } from "./refs";
42
+ export { Volume } from "./volume";
43
+ export type { EmptyVolumeInput, VolumeFromConfigMapInput, VolumeFromPvcInput, VolumeFromSecretInput, VolumeMount, VolumeName, VolumeNamesOf, } from "./volume";
44
+ export { CronJob, type CronJobInput, Deployment, type DeploymentFromPodSetInput, type DeploymentInput, Job, type JobInput, StatefulSet, type StatefulSetInput, } from "./workload";
45
+ export * as Workload from "./workloadHelpers";
46
+ export { Selector } from "./selector";
47
+ export type { SelectorLabels } from "./selector";
48
+ export { type DefinePodSetInput, PodSet } from "./podSet";