@kumulo/core 0.1.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/LICENSE +20 -0
- package/README.md +15 -0
- package/dist/config/decode.d.ts +5 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/schema.d.ts +400 -0
- package/dist/config/yaml.d.ts +5 -0
- package/dist/dns/index.d.ts +2 -0
- package/dist/dns/ownership.d.ts +6 -0
- package/dist/dns-noop/index.d.ts +7 -0
- package/dist/domain/capabilities.d.ts +6 -0
- package/dist/domain/types.d.ts +175 -0
- package/dist/errors/renderer.d.ts +12 -0
- package/dist/errors/retryable.d.ts +2 -0
- package/dist/errors/tagged.d.ts +138 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.mjs +602 -0
- package/dist/k8s/client.d.ts +23 -0
- package/dist/k8s/index.d.ts +7 -0
- package/dist/k8s/kubeconfig.d.ts +18 -0
- package/dist/k8s/node-ops.d.ts +19 -0
- package/dist/k8s/readiness.d.ts +12 -0
- package/dist/plan/diff.d.ts +12 -0
- package/dist/plan/hash.d.ts +2 -0
- package/dist/plan/index.d.ts +4 -0
- package/dist/plan/naming.d.ts +8 -0
- package/dist/plan/types.d.ts +29 -0
- package/dist/ports/addon.d.ts +13 -0
- package/dist/ports/cloud-provider.d.ts +19 -0
- package/dist/ports/credentials-sink.d.ts +10 -0
- package/dist/ports/distro.d.ts +29 -0
- package/dist/ports/dns-provider.d.ts +12 -0
- package/dist/ports/object-storage-provider.d.ts +14 -0
- package/dist/ports/provider-profile.d.ts +27 -0
- package/dist/ports/validation.d.ts +5 -0
- package/dist/ports/volume-provider.d.ts +14 -0
- package/dist/present/decide.d.ts +15 -0
- package/dist/present/index.d.ts +3 -0
- package/dist/present/render.d.ts +2 -0
- package/dist/profiles/generic.d.ts +22 -0
- package/dist/profiles/index.d.ts +1 -0
- package/dist/reconcile/apply.d.ts +8 -0
- package/dist/reconcile/index.d.ts +3 -0
- package/dist/reconcile/phases.d.ts +5 -0
- package/dist/reconcile/pipeline.d.ts +9 -0
- package/dist/reconcile/poll.d.ts +12 -0
- package/package.json +58 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Duration, Effect } from "effect";
|
|
2
|
+
import type { HttpTransportError, ProvisioningTimeout, ResourceNotFound } from "../errors/tagged";
|
|
3
|
+
import type { K8sManifest } from "../domain/types";
|
|
4
|
+
import type { ResourceRef } from "./client";
|
|
5
|
+
export interface WaitOptions {
|
|
6
|
+
readonly get: (ref: ResourceRef) => Effect.Effect<K8sManifest, ResourceNotFound | HttpTransportError>;
|
|
7
|
+
readonly ref: ResourceRef;
|
|
8
|
+
readonly interval: Duration.Input;
|
|
9
|
+
readonly timeout: Duration.Input;
|
|
10
|
+
}
|
|
11
|
+
export declare const waitForDeploymentAvailable: (options: WaitOptions) => Effect.Effect<K8sManifest, ResourceNotFound | HttpTransportError | ProvisioningTimeout>;
|
|
12
|
+
export declare const waitForNodeReady: (options: WaitOptions) => Effect.Effect<K8sManifest, ResourceNotFound | HttpTransportError | ProvisioningTimeout>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DesiredResource, Plan, TaggedResource } from "./types";
|
|
2
|
+
export declare const toTaggedResource: (desired: DesiredResource) => TaggedResource;
|
|
3
|
+
/**
|
|
4
|
+
* The names the plan says must be replaced. Callers hand this to the
|
|
5
|
+
* reconciler *only* once the operator confirmed, so execution never
|
|
6
|
+
* re-derives replace intent from names or inventory.
|
|
7
|
+
*/
|
|
8
|
+
export declare const namesToReplace: (plan: Plan) => ReadonlySet<string>;
|
|
9
|
+
export declare const computePlan: ({ actual, desired }: {
|
|
10
|
+
readonly desired: ReadonlyArray<DesiredResource>;
|
|
11
|
+
readonly actual: ReadonlyArray<TaggedResource>;
|
|
12
|
+
}) => Plan;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NodeRole } from "../domain/types";
|
|
2
|
+
export interface ResourceCoordinates {
|
|
3
|
+
readonly cluster: string;
|
|
4
|
+
readonly role: NodeRole;
|
|
5
|
+
readonly pool: string;
|
|
6
|
+
readonly index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const resourceName: ({ cluster, role, pool, index }: ResourceCoordinates) => string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ResourceCoordinates } from "./naming";
|
|
2
|
+
export interface DesiredResource extends ResourceCoordinates {
|
|
3
|
+
readonly spec: unknown;
|
|
4
|
+
}
|
|
5
|
+
export interface TaggedResource {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly configHash?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export type PlanAction = {
|
|
10
|
+
readonly _tag: "Create";
|
|
11
|
+
readonly name: string;
|
|
12
|
+
} | {
|
|
13
|
+
readonly _tag: "Delete";
|
|
14
|
+
readonly name: string;
|
|
15
|
+
} | {
|
|
16
|
+
readonly _tag: "NoOp";
|
|
17
|
+
readonly name: string;
|
|
18
|
+
} | {
|
|
19
|
+
readonly _tag: "Update";
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly reason: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly _tag: "ReplaceNeedsConfirm";
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly reason: string;
|
|
26
|
+
};
|
|
27
|
+
export interface Plan {
|
|
28
|
+
readonly actions: ReadonlyArray<PlanAction>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AddonInstallFailed } from "../errors/tagged";
|
|
4
|
+
import type { AddonContext, Capability, K8sManifest } from "../domain/types";
|
|
5
|
+
export type AddonError = AddonInstallFailed;
|
|
6
|
+
declare const Addon_base: Context.ServiceClass<Addon, "@kumulo/core/Addon", {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly requiredCapabilities: ReadonlyArray<Capability>;
|
|
9
|
+
readonly manifests: (ctx: AddonContext) => Effect.Effect<ReadonlyArray<K8sManifest>, AddonError>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare class Addon extends Addon_base {
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AuthenticationFailed, CapabilityMissing, HttpTransportError, ProviderApiError, ProvisioningTimeout, QuotaExceeded, RateLimited, ResourceConflict, ResourceNotFound, ResponseDecodeError } from "../errors/tagged";
|
|
4
|
+
import type { ClusterTag, FlavorId, FlavorRef, ImageId, ImageRef, Inventory, LbInfo, LbSpec, NetworkInfo, NetworkSpec, SecGroupInfo, SecGroupSpec, ServerInfo, ServerSpec } from "../domain/types";
|
|
5
|
+
export type CloudError = AuthenticationFailed | QuotaExceeded | ResourceNotFound | ResourceConflict | CapabilityMissing | ProvisioningTimeout | RateLimited | ProviderApiError | ResponseDecodeError | HttpTransportError;
|
|
6
|
+
declare const CloudProvider_base: Context.ServiceClass<CloudProvider, "@kumulo/core/CloudProvider", {
|
|
7
|
+
readonly ensureNetwork: (spec: NetworkSpec) => Effect.Effect<NetworkInfo, CloudError>;
|
|
8
|
+
readonly ensureSecurityGroups: (spec: SecGroupSpec) => Effect.Effect<SecGroupInfo, CloudError>;
|
|
9
|
+
readonly ensureLoadBalancer: (spec: LbSpec) => Effect.Effect<LbInfo, CloudError>;
|
|
10
|
+
readonly ensureServer: (spec: ServerSpec) => Effect.Effect<ServerInfo, CloudError>;
|
|
11
|
+
readonly deleteServer: (ref: ServerInfo) => Effect.Effect<void, CloudError>;
|
|
12
|
+
readonly deleteByTag: (tag: ClusterTag) => Effect.Effect<void, CloudError>;
|
|
13
|
+
readonly listClusterResources: (tag: ClusterTag) => Effect.Effect<Inventory, CloudError>;
|
|
14
|
+
readonly resolveImage: (ref: ImageRef) => Effect.Effect<ImageId, CloudError>;
|
|
15
|
+
readonly resolveFlavor: (ref: FlavorRef) => Effect.Effect<FlavorId, CloudError>;
|
|
16
|
+
}>;
|
|
17
|
+
export declare class CloudProvider extends CloudProvider_base {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { CredentialsSinkError } from "../errors/tagged";
|
|
4
|
+
import type { CredentialEntry } from "../domain/types";
|
|
5
|
+
declare const CredentialsSink_base: Context.ServiceClass<CredentialsSink, "@kumulo/core/CredentialsSink", {
|
|
6
|
+
readonly write: (entries: ReadonlyArray<CredentialEntry>) => Effect.Effect<void, CredentialsSinkError>;
|
|
7
|
+
}>;
|
|
8
|
+
export declare class CredentialsSink extends CredentialsSink_base {
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AuthenticationFailed, BootstrapFailed, ConfigInvalid, HttpTransportError, ProviderApiError, ProvisioningTimeout, QuotaExceeded, RateLimited, ResourceConflict, ResourceNotFound, ResponseDecodeError } from "../errors/tagged";
|
|
4
|
+
import type { BootstrapPlan, ClusterConfigShape, Inventory, K8sManifest, Kubeconfig, ManagedClusterInfo, ManagedClusterRef, NodeContext, NodeRef, NodeRole, ResolvedVersion, SshTarget, Version } from "../domain/types";
|
|
5
|
+
export interface SelfManagedDistroShape {
|
|
6
|
+
readonly kind: "self-managed";
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly planBootstrap: (cluster: ClusterConfigShape, inventory: Inventory) => Effect.Effect<BootstrapPlan>;
|
|
9
|
+
readonly renderUserData: (role: NodeRole, ctx: NodeContext) => Effect.Effect<string>;
|
|
10
|
+
readonly fetchKubeconfig: (entry: SshTarget, apiEndpoint: string) => Effect.Effect<Kubeconfig, BootstrapFailed>;
|
|
11
|
+
readonly upgradePlan: (target: Version) => Effect.Effect<ReadonlyArray<K8sManifest>>;
|
|
12
|
+
readonly validateVersion: (v: string) => Effect.Effect<ResolvedVersion, ConfigInvalid>;
|
|
13
|
+
readonly drainAndRemove: (node: NodeRef) => Effect.Effect<void, BootstrapFailed>;
|
|
14
|
+
}
|
|
15
|
+
export type MksError = AuthenticationFailed | ResourceNotFound | ResourceConflict | ProvisioningTimeout | QuotaExceeded | RateLimited | ProviderApiError | HttpTransportError | ResponseDecodeError;
|
|
16
|
+
export interface ManagedDistroShape {
|
|
17
|
+
readonly kind: "managed";
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly ensureCluster: (cfg: ClusterConfigShape) => Effect.Effect<ManagedClusterInfo, MksError>;
|
|
20
|
+
readonly ensureNodePools: (cfg: ClusterConfigShape) => Effect.Effect<void, MksError>;
|
|
21
|
+
readonly fetchKubeconfig: (ref: ManagedClusterRef) => Effect.Effect<Kubeconfig, MksError>;
|
|
22
|
+
readonly upgrade: (target: Version) => Effect.Effect<void, MksError>;
|
|
23
|
+
readonly delete: (ref: ManagedClusterRef) => Effect.Effect<void, MksError>;
|
|
24
|
+
}
|
|
25
|
+
export type DistroShape = SelfManagedDistroShape | ManagedDistroShape;
|
|
26
|
+
declare const Distro_base: Context.ServiceClass<Distro, "@kumulo/core/Distro", DistroShape>;
|
|
27
|
+
export declare class Distro extends Distro_base {
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AuthenticationFailed, HttpTransportError, ProviderApiError, RateLimited, ResourceConflict, ResourceNotFound, ResponseDecodeError } from "../errors/tagged";
|
|
4
|
+
import type { ClusterTag, DesiredRecord } from "../domain/types";
|
|
5
|
+
export type DnsError = ResourceNotFound | ResourceConflict | AuthenticationFailed | RateLimited | ProviderApiError | ResponseDecodeError | HttpTransportError;
|
|
6
|
+
declare const DnsProvider_base: Context.ServiceClass<DnsProvider, "@kumulo/core/DnsProvider", {
|
|
7
|
+
readonly ensureRecords: (zone: string, records: ReadonlyArray<DesiredRecord>) => Effect.Effect<void, DnsError>;
|
|
8
|
+
readonly removeClusterRecords: (zone: string, tag: ClusterTag) => Effect.Effect<void, DnsError>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare class DnsProvider extends DnsProvider_base {
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AuthenticationFailed, BucketNotEmpty, HttpTransportError, ProviderApiError, QuotaExceeded, RateLimited, ResourceConflict, ResourceNotFound, ResponseDecodeError } from "../errors/tagged";
|
|
4
|
+
import type { BucketInfo, BucketRef, BucketSpec, ClusterTag, S3Credentials } from "../domain/types";
|
|
5
|
+
export type ObjectStorageError = ResourceNotFound | ResourceConflict | AuthenticationFailed | QuotaExceeded | BucketNotEmpty | HttpTransportError | ResponseDecodeError | RateLimited | ProviderApiError;
|
|
6
|
+
declare const ObjectStorageProvider_base: Context.ServiceClass<ObjectStorageProvider, "@kumulo/core/ObjectStorageProvider", {
|
|
7
|
+
readonly listBuckets: (region: string) => Effect.Effect<ReadonlyArray<BucketInfo>, ObjectStorageError>;
|
|
8
|
+
readonly ensureBucket: (spec: BucketSpec) => Effect.Effect<BucketInfo, ObjectStorageError>;
|
|
9
|
+
readonly deleteBucket: (ref: BucketRef) => Effect.Effect<void, ObjectStorageError>;
|
|
10
|
+
readonly ensureCredentials: (clusterName: ClusterTag) => Effect.Effect<S3Credentials, ObjectStorageError>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare class ObjectStorageProvider extends ObjectStorageProvider_base {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { ConfigInvalid } from "../errors/tagged";
|
|
4
|
+
import type { ClusterConfigShape } from "../domain/types";
|
|
5
|
+
export type ProfileError = ConfigInvalid;
|
|
6
|
+
export interface AuthDefaults {
|
|
7
|
+
readonly keystoneUrlPattern: string;
|
|
8
|
+
readonly domainDefault: string;
|
|
9
|
+
}
|
|
10
|
+
declare const ProviderProfile_base: Context.ServiceClass<ProviderProfile, "@kumulo/core/ProviderProfile", {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly auth: AuthDefaults;
|
|
13
|
+
readonly capabilities: {
|
|
14
|
+
readonly octavia: (region: string) => boolean;
|
|
15
|
+
readonly floatingIps: boolean;
|
|
16
|
+
readonly volumeTypes: ReadonlyArray<string>;
|
|
17
|
+
};
|
|
18
|
+
readonly defaults: {
|
|
19
|
+
readonly externalNetworkName: string;
|
|
20
|
+
readonly imageAliases: Record<string, string>;
|
|
21
|
+
readonly dnsServers: ReadonlyArray<string>;
|
|
22
|
+
};
|
|
23
|
+
readonly validate: (config: ClusterConfigShape) => Effect.Effect<void, ProfileError>;
|
|
24
|
+
}>;
|
|
25
|
+
export declare class ProviderProfile extends ProviderProfile_base {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Option } from "effect";
|
|
2
|
+
import { PlanRejected } from "../errors/tagged";
|
|
3
|
+
import type { ClusterConfigShape } from "../domain/types";
|
|
4
|
+
export declare const validateAutoscaling: (config: ClusterConfigShape) => Option.Option<PlanRejected>;
|
|
5
|
+
export declare const validateCni: (config: ClusterConfigShape) => Option.Option<PlanRejected>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Effect } from "effect";
|
|
2
|
+
import { Context } from "effect";
|
|
3
|
+
import type { AuthenticationFailed, HttpTransportError, ProviderApiError, QuotaExceeded, RateLimited, ResourceConflict, ResourceNotFound, ResponseDecodeError } from "../errors/tagged";
|
|
4
|
+
import type { ClusterTag, K8sManifest, VolumeInfo, VolumeRef, VolumeSpec } from "../domain/types";
|
|
5
|
+
export type VolumeError = ResourceNotFound | ResourceConflict | AuthenticationFailed | QuotaExceeded | RateLimited | ProviderApiError | ResponseDecodeError | HttpTransportError;
|
|
6
|
+
declare const VolumeProvider_base: Context.ServiceClass<VolumeProvider, "@kumulo/core/VolumeProvider", {
|
|
7
|
+
readonly ensureVolume: (spec: VolumeSpec) => Effect.Effect<VolumeInfo, VolumeError>;
|
|
8
|
+
readonly listClusterVolumes: (tag: ClusterTag) => Effect.Effect<ReadonlyArray<VolumeInfo>, VolumeError>;
|
|
9
|
+
readonly deleteVolume: (ref: VolumeRef) => Effect.Effect<void, VolumeError>;
|
|
10
|
+
readonly staticPvManifest: (vol: VolumeInfo, spec: VolumeSpec) => K8sManifest;
|
|
11
|
+
}>;
|
|
12
|
+
export declare class VolumeProvider extends VolumeProvider_base {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Plan } from "../plan/types";
|
|
2
|
+
export type PlanDecision = {
|
|
3
|
+
readonly _tag: "DryRun";
|
|
4
|
+
} | {
|
|
5
|
+
readonly _tag: "NothingToDo";
|
|
6
|
+
} | {
|
|
7
|
+
readonly _tag: "Proceed";
|
|
8
|
+
} | {
|
|
9
|
+
readonly _tag: "NeedsConfirm";
|
|
10
|
+
};
|
|
11
|
+
export declare const decidePlanAction: ({ plan, yes, dryRun }: {
|
|
12
|
+
readonly plan: Plan;
|
|
13
|
+
readonly yes: boolean;
|
|
14
|
+
readonly dryRun: boolean;
|
|
15
|
+
}) => PlanDecision;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import type { ClusterConfigShape } from "../domain/types";
|
|
3
|
+
import { ProviderProfile } from "../ports/provider-profile";
|
|
4
|
+
export declare const genericProfile: {
|
|
5
|
+
name: string;
|
|
6
|
+
auth: {
|
|
7
|
+
keystoneUrlPattern: string;
|
|
8
|
+
domainDefault: string;
|
|
9
|
+
};
|
|
10
|
+
capabilities: {
|
|
11
|
+
octavia: (_region: string) => boolean;
|
|
12
|
+
floatingIps: boolean;
|
|
13
|
+
volumeTypes: never[];
|
|
14
|
+
};
|
|
15
|
+
defaults: {
|
|
16
|
+
externalNetworkName: string;
|
|
17
|
+
imageAliases: {};
|
|
18
|
+
dnsServers: never[];
|
|
19
|
+
};
|
|
20
|
+
validate: (_config: ClusterConfigShape) => Effect.Effect<void, never, never>;
|
|
21
|
+
};
|
|
22
|
+
export declare const genericProfileLive: Layer.Layer<ProviderProfile, never, never>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { genericProfile, genericProfileLive } from "./generic";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { CloudError } from "../ports/cloud-provider";
|
|
3
|
+
import { CloudProvider } from "../ports/cloud-provider";
|
|
4
|
+
import type { ServerSpec } from "../domain/types";
|
|
5
|
+
export declare const applyServers: ({ concurrency, specs }: {
|
|
6
|
+
readonly specs: ReadonlyArray<ServerSpec>;
|
|
7
|
+
readonly concurrency: number;
|
|
8
|
+
}) => Effect.Effect<void, CloudError, CloudProvider>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type ClusterKind = "self-managed" | "managed";
|
|
2
|
+
export declare const SELF_MANAGED_PHASES: readonly ["Network", "Security", "ServerGroups", "LB", "Nodes", "Bootstrap", "Addons", "DNS", "Volumes", "Kubeconfig"];
|
|
3
|
+
export declare const MANAGED_PHASES: readonly ["EnsureCluster", "EnsureNodePools", "Addons", "DNS", "Volumes", "Kubeconfig"];
|
|
4
|
+
export type PhaseName = (typeof SELF_MANAGED_PHASES)[number] | (typeof MANAGED_PHASES)[number];
|
|
5
|
+
export declare const phasesForKind: (kind: ClusterKind) => ReadonlyArray<PhaseName>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
export interface Phase<Name extends string, E, R> {
|
|
3
|
+
readonly name: Name;
|
|
4
|
+
readonly run: Effect.Effect<void, E, R>;
|
|
5
|
+
}
|
|
6
|
+
export declare const runPhases: <Name extends string, E, R>({ order, phases }: {
|
|
7
|
+
readonly order: ReadonlyArray<Name>;
|
|
8
|
+
readonly phases: ReadonlyArray<Phase<Name, E, R>>;
|
|
9
|
+
}) => Effect.Effect<void, E, R>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import type { Duration } from "effect";
|
|
3
|
+
import { ProvisioningTimeout } from "../errors/tagged";
|
|
4
|
+
export interface PollOptions<Status, E, R> {
|
|
5
|
+
readonly check: Effect.Effect<Status, E, R>;
|
|
6
|
+
readonly isDone: (status: Status) => boolean;
|
|
7
|
+
readonly interval: Duration.Input;
|
|
8
|
+
readonly timeout: Duration.Input;
|
|
9
|
+
readonly kind: string;
|
|
10
|
+
readonly ref: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const pollUntil: <Status, E, R>(options: PollOptions<Status, E, R>) => Effect.Effect<Status, E | ProvisioningTimeout, R>;
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kumulo/core",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Core abstractions (config schema, plan, state) for kumulo.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "David Stahl-Gruber",
|
|
7
|
+
"homepage": "https://github.com/DwieDave/kumulo#readme",
|
|
8
|
+
"bugs": "https://github.com/DwieDave/kumulo/issues",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/DwieDave/kumulo.git",
|
|
12
|
+
"directory": "packages/core"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"kubernetes",
|
|
16
|
+
"infrastructure",
|
|
17
|
+
"effect",
|
|
18
|
+
"typescript"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"import": "./dist/index.mjs"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"main": "./dist/index.mjs",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE"
|
|
33
|
+
],
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=22"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"yaml": "2.9.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"effect": "4.0.0-beta.101"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@effect/vitest": "4.0.0-beta.101",
|
|
48
|
+
"fast-check": "4.9.0",
|
|
49
|
+
"vitest": "4.1.10",
|
|
50
|
+
"effect": "4.0.0-beta.101"
|
|
51
|
+
},
|
|
52
|
+
"scripts": {
|
|
53
|
+
"build": "bash ../../scripts/build-package.sh",
|
|
54
|
+
"prepack": "node ../../scripts/prepack-exports.mjs strip",
|
|
55
|
+
"postpack": "node ../../scripts/prepack-exports.mjs restore",
|
|
56
|
+
"prepublishOnly": "bun run build"
|
|
57
|
+
}
|
|
58
|
+
}
|