#!/usr/bin/env node import * as Context from "effect/Context"; import * as Effect$1 from "effect/Effect"; import { Effect, Yieldable } from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Stream from "effect/Stream"; import * as S from "effect/Schema"; import { Pipeable } from "effect/Pipeable"; import "effect/Config"; import { Scope } from "effect/Scope"; import { HttpBodyError } from "effect/unstable/http/HttpBody"; import { HttpServerError } from "effect/unstable/http/HttpServerError"; import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest"; import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse"; import "effect/FileSystem"; import "effect/Path"; //#region src/Util/data.d.ts type Primitive = never | undefined | null | boolean | number | string | bigint | symbol; //#endregion //#region src/Http.d.ts type HttpEffect = Effect$1.Effect; //#endregion //#region src/ExecutionContext.d.ts interface BaseExecutionContext { Type: string; id: string; env: Record; get(key: string): Effect$1.Effect; set(id: string, output: Output): Effect$1.Effect; exports?: Effect$1.Effect>; serve?(handler: HttpEffect): Effect$1.Effect; } interface ExecutionContext extends Context.Service<`ExecutionContext<${Ctx["Type"]}>`, Ctx> {} declare const ExecutionContext: ExecutionContext & ((type: Ctx["Type"]) => ExecutionContext); //#endregion //#region src/Namespace.d.ts interface NamespaceNode { Id: string; Parent?: NamespaceNode; } //#endregion //#region src/RemovalPolicy.d.ts declare const RemovalPolicy_base: any; declare class RemovalPolicy extends RemovalPolicy_base {} //#endregion //#region src/Resource.d.ts type LogicalId = string; interface ResourceBinding { sid: string; data: Data; } interface ResourceLike { /** * Namespace containing this Resource. */ Namespace: NamespaceNode | undefined; /** * Fully Qualified Name (namespace path + logical ID). * Used as the unique key for state storage. */ FQN: string; /** * Type of the Resource (e.g. AWS.Lambda.Function) */ Type: Type; /** * Logical ID of the Resource (e.g. MyFunction) */ LogicalId: LogicalId; /** * Properties of the Resource. */ Props: Props$2; /** * Removal Policy of the Resource. */ RemovalPolicy: RemovalPolicy["Service"]; /** @internal phantom */ Attributes: Attributes$1; /** @internal phantom */ Binding: Binding; } //#endregion //#region src/State/ResourceState.d.ts type ResourceState = CreatingResourceState | CreatedResourceState | UpdatingReourceState | UpdatedResourceState | DeletingResourceState | ReplacingResourceState | ReplacedResourceState; type Props$1 = Record; type Attr = Record; type ResourceStatus = ResourceState["status"]; type ReplacementResourceState = ReplacingResourceState | ReplacedResourceState; type ReplacementOldResourceState = CreatingResourceState | CreatedResourceState | UpdatingReourceState | UpdatedResourceState | DeletingResourceState | ReplacementResourceState; interface BaseResourceState { /** Type of the Resource (e.g. AWS.Lambda.Function) */ resourceType: string; /** Namespace of the Resource */ namespace: NamespaceNode | undefined; /** Fully Qualified Name (namespace path + logical ID) */ fqn: string; /** Logical ID of the Resource (stable across creates, updates, deletes and replaces) */ logicalId: string; /** A unique randomly generated token used to seed ID generation (only changes when replaced) */ instanceId: string; /** The version of the provider that was used to create/update the resource. */ providerVersion: number; /** Current status of the logical Resource */ status: ResourceStatus; /** List of FQNs of resources that depend on this resource */ downstream: string[]; /** List of Bindings attached to this Resource */ bindings: ResourceBinding[]; /** Desired state (input props) of this Resource */ props?: Props$1; /** The output attributes of this Resource (if it has been created) */ attr?: Attr; /** The removal policy of the resource */ removalPolicy?: RemovalPolicy["Service"]; } interface CreatingResourceState extends BaseResourceState { status: "creating"; /** The new resource properties that are being (or have been) applied. */ props: Props$1; } interface CreatedResourceState extends BaseResourceState { status: "created"; /** The new resource properties that have been applied. */ props: Props$1; /** The output attributes of the created resource */ attr: Attr; } interface UpdatingReourceState extends BaseResourceState { status: "updating"; /** The new resource properties that are being (or have been) applied. */ props: Props$1; old: { /** The old resource properties that have been successfully applied. */ props: Props$1; /** List of Bindings attached to this Resource */ bindings: any[]; /** The old output properties that have been successfully applied. */ attr: Attr; }; } interface UpdatedResourceState extends BaseResourceState { status: "updated"; /** The new resource properties that are being (or have been) applied. */ props: Props$1; /** The output attributes of the created resource */ attr: Attr; } interface DeletingResourceState extends BaseResourceState { status: "deleting"; /** Attributes of the resource being deleted */ attr: Attr | undefined; } interface ReplacingResourceState extends BaseResourceState { status: "replacing"; /** Desired properties of the new resource (the replacement) */ props: Props$1; /** Reference to the state of the old resource (the one being replaced) */ old: ReplacementOldResourceState; /** Whether the resource should be deleted before or after replacements */ deleteFirst: boolean; } interface ReplacedResourceState extends BaseResourceState { status: "replaced"; /** Desired properties of the new resource (the replacement) */ props: Props$1; /** Output attributes of the new resource (the replacement) */ attr: Attr; /** Reference to the state of the old resource (the one being replaced) */ old: ReplacementOldResourceState; /** Whether the resource should be deleted before or after replacements */ deleteFirst: boolean; } //#endregion //#region src/Output.d.ts interface Output extends Pipeable { /** @internal phantom */ readonly kind: string; /** @internal phantom */ readonly A: A; /** @internal phantom */ readonly req: Req$1; /** @internal phantom */ [Symbol.iterator](): Iterator, Accessor, void>; bind(id: string): Effect$1.Effect, never, ExecutionContext>; asEffect(): Effect$1.Effect, never, Req$1>; as(): Output; } interface Accessor extends Effect$1.Effect {} //#endregion //#region src/Input.d.ts type Function = (...args: any[]) => any; type Constructor = new (...args: any[]) => any; type PolicyLike = { kind: "alchemy/Policy"; }; type Input = T | Output | Effect | (T extends S.Schema ? never : Output | (T extends Primitive ? never : T extends any[] ? number extends T["length"] ? Input[] : Inputs : T extends object ? { [K in keyof T]: Input } : never)); declare namespace Input { type Resolve = T extends { Type: string; Attributes: infer Attributes; } ? { [K in keyof Attributes]: Resolve } : T extends Output ? U : T extends Primitive | Constructor | Function | S.Schema | PolicyLike ? T : T extends any[] ? ResolveArray : T extends Record ? { [k in keyof T]: Input.Resolve } : never; type ResolveArray = number extends T["length"] ? Resolve[] : ResolveTuple; type ResolveTuple = T extends [infer H, ...infer Tail] ? ResolveTuple]> : Accum; type ResolveProps> = { [k in keyof Props$2]: Input.Resolve }; type ResolveOpaque = true extends IsOut ? ResolveOut : Resolve; type IsOut = T extends Output ? true : never; type ResolveOut = T extends Output ? U : never; } type Inputs = T extends [infer H, ...infer T] ? Inputs]> : Out; //#endregion //#region src/Diff.d.ts type Diff = NoopDiff | UpdateDiff | ReplaceDiff; interface NoopDiff { action: "noop"; stables?: undefined; } interface UpdateDiff { action: "update"; /** properties that won't change as part of this update */ stables?: string[]; } interface ReplaceDiff { action: "replace"; deleteFirst?: boolean; stables?: undefined; } //#endregion //#region src/Provider.d.ts type BindingData = [Res] extends [{ Binding: infer B; }] ? ResourceBinding[] : any[]; type Props = keyof Res["Props"] extends never ? Res["Props"] | undefined : Res["Props"]; interface LogLine { timestamp: Date; message: string; } interface LogsInput { since?: Date; limit?: number; } interface ProviderService { /** * The version of the provider. * * @default 0 */ version?: number; /** * Returns a stream of log lines for a deployed resource. * Used by `alchemy tail` to stream real-time logs. */ tail?(input: { id: string; instanceId: string; props: Props; output: Res["Attributes"]; }): Stream.Stream; /** * Queries historical logs for a deployed resource. * Used by `alchemy logs` to fetch past log entries. */ logs?(input: { id: string; instanceId: string; props: Props; output: Res["Attributes"]; options: LogsInput; }): Effect$1.Effect; read?(input: { id: string; instanceId: string; olds: Props; output: Res["Attributes"] | undefined; }): Effect$1.Effect; /** * Properties that are always stable across any update. */ stables?: Extract[]; diff?(input: { id: string; instanceId: string; olds: Props; news: Input>; oldBindings: BindingData; newBindings: Input>; output: Res["Attributes"] | undefined; }): Effect$1.Effect; precreate?(input: { id: string; news: Props; instanceId: string; session: ScopedPlanStatusSession; bindings: BindingData; }): Effect$1.Effect; create(input: { id: string; instanceId: string; news: Props; session: ScopedPlanStatusSession; bindings: BindingData; output?: Res["Attributes"]; }): Effect$1.Effect; update(input: { id: string; instanceId: string; news: Props; olds: Props; output: Res["Attributes"]; session: ScopedPlanStatusSession; bindings: BindingData; }): Effect$1.Effect; delete(input: { id: string; instanceId: string; olds: Props; output: Res["Attributes"]; session: ScopedPlanStatusSession; bindings: BindingData; }): Effect$1.Effect; } //#endregion //#region src/Plan.d.ts type Apply = Create | Update | Replace | NoopUpdate; type BindingAction = "create" | "update" | "delete" | "noop"; interface BindingNode extends ResourceBinding { action: BindingAction; data: Data; } interface BaseNode = ResourceLike> { resource: R; provider: ProviderService; downstream: string[]; bindings: BindingNode[]; } interface Create extends BaseNode { action: "create"; props: R["Props"]; state: CreatingResourceState | undefined; } interface Update extends BaseNode { action: "update"; props: R["Props"]; state: CreatedResourceState | UpdatedResourceState | UpdatingReourceState | ReplacedResourceState; } interface Delete extends BaseNode { action: "delete"; state: ResourceState; } interface NoopUpdate extends BaseNode { action: "noop"; state: CreatedResourceState | UpdatedResourceState; } interface Replace extends BaseNode { action: "replace"; props: any; deleteFirst: boolean; restart?: boolean; state: CreatingResourceState | CreatedResourceState | UpdatingReourceState | UpdatedResourceState | ReplacingResourceState | ReplacedResourceState; } type Plan = { resources: { [id in string]: Apply }; deletions: { [id in string]?: Delete }; output: Output$1; }; //#endregion //#region src/Cli/Event.d.ts type ApplyStatus = "attaching" | "post-attach" | "pending" | "pre-creating" | "creating" | "creating replacement" | "created" | "updating" | "updated" | "deleting" | "deleted" | "replacing" | "replaced" | "fail"; type ApplyEvent = AnnotateEvent | StatusChangeEvent; interface AnnotateEvent { kind: "annotate"; id: string; message: string; } interface StatusChangeEvent { kind: "status-change"; id: string; type: string; status: ApplyStatus; message?: string; bindingId?: string; } //#endregion //#region src/Cli/Cli.d.ts interface PlanStatusSession { emit: (event: ApplyEvent) => Effect$1.Effect; done: () => Effect$1.Effect; } interface ScopedPlanStatusSession extends PlanStatusSession { note: (note: string) => Effect$1.Effect; } interface CLIService { approvePlan: (plan: P$1) => Effect$1.Effect; displayPlan: (plan: P$1) => Effect$1.Effect; startApplySession: (plan: P$1) => Effect$1.Effect; } declare const Cli_base: any; declare class Cli extends Cli_base {} //#endregion //#region src/Cli/InkCLI.d.ts declare const inkCLI: () => Layer.Layer; //#endregion export { CLIService, Cli, PlanStatusSession, ScopedPlanStatusSession, inkCLI }; //# sourceMappingURL=index.d.ts.map