alchemy 2.0.0-beta.36 → 2.0.0-beta.38
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/bin/exec.js +646 -104
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.d.ts +1 -1
- package/lib/AWS/CloudWatch/common.d.ts +1 -1
- package/lib/AWS/Credentials.d.ts.map +1 -1
- package/lib/AWS/Credentials.js +1 -2
- package/lib/AWS/Credentials.js.map +1 -1
- package/lib/AWS/DynamoDB/Stream.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Stream.js +1 -1
- package/lib/AWS/DynamoDB/Stream.js.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts +1 -1
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js +3 -5
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts +1 -1
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +3 -5
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/Endpoint.d.ts.map +1 -1
- package/lib/AWS/Endpoint.js +1 -2
- package/lib/AWS/Endpoint.js.map +1 -1
- package/lib/AWS/Environment.d.ts +2 -2
- package/lib/AWS/EventBridge/EventSource.d.ts.map +1 -1
- package/lib/AWS/EventBridge/EventSource.js +1 -1
- package/lib/AWS/EventBridge/EventSource.js.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js +1 -1
- package/lib/AWS/Kinesis/StreamEventSource.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts +1 -1
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +29 -13
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
- package/lib/AWS/Organizations/common.d.ts +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +21 -3
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/Region.d.ts +1 -1
- package/lib/AWS/Region.d.ts.map +1 -1
- package/lib/AWS/Region.js +2 -3
- package/lib/AWS/Region.js.map +1 -1
- package/lib/AWS/S3/Bucket.d.ts.map +1 -1
- package/lib/AWS/S3/Bucket.js +5 -2
- package/lib/AWS/S3/Bucket.js.map +1 -1
- package/lib/AWS/S3/BucketNotifications.d.ts.map +1 -1
- package/lib/AWS/S3/BucketNotifications.js +1 -1
- package/lib/AWS/S3/BucketNotifications.js.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/SNS/TopicEventSource.js +1 -1
- package/lib/AWS/SNS/TopicEventSource.js.map +1 -1
- package/lib/AWS/SQS/Queue.d.ts.map +1 -1
- package/lib/AWS/SQS/Queue.js +23 -5
- package/lib/AWS/SQS/Queue.js.map +1 -1
- package/lib/Action.d.ts +77 -0
- package/lib/Action.d.ts.map +1 -0
- package/lib/Action.js +89 -0
- package/lib/Action.js.map +1 -0
- package/lib/AlchemyContext.d.ts +1 -1
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +228 -4
- package/lib/Apply.js.map +1 -1
- package/lib/Artifacts.d.ts +1 -1
- package/lib/Artifacts.d.ts.map +1 -1
- package/lib/Artifacts.js +1 -1
- package/lib/Artifacts.js.map +1 -1
- package/lib/Auth/AuthProvider.js +1 -1
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -12
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +5 -5
- package/lib/Binding.js.map +1 -1
- package/lib/Build/Command.d.ts +1 -1
- package/lib/Build/Memo.d.ts +1 -1
- package/lib/Bundle/Docker.d.ts +3 -3
- package/lib/Bundle/Docker.js +1 -1
- package/lib/Bundle/Docker.js.map +1 -1
- package/lib/Bundle/TempRoot.d.ts +3 -3
- package/lib/Cli/Event.d.ts +1 -1
- package/lib/Cli/Event.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.d.ts +11 -5
- package/lib/Cli/NamespaceTree.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.js +28 -1
- package/lib/Cli/NamespaceTree.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +1 -1
- package/lib/Cli/commands/_shared.js +2 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +1 -1
- package/lib/Cli/commands/cloudflare.d.ts +2 -2
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +9 -9
- package/lib/Cli/commands/deploy.js +1 -1
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +1 -3
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/tail.d.ts +1 -1
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/tui/components/Plan.d.ts.map +1 -1
- package/lib/Cli/tui/components/Plan.js +27 -13
- package/lib/Cli/tui/components/Plan.js.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts +8 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts.map +1 -1
- package/lib/Cli/tui/components/PlanProgress.js +95 -16
- package/lib/Cli/tui/components/PlanProgress.js.map +1 -1
- package/lib/Cloudflare/Access.js +0 -1
- package/lib/Cloudflare/Access.js.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts +54 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js +17 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +37 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +45 -0
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/index.d.ts +3 -0
- package/lib/Cloudflare/AnalyticsEngine/index.d.ts.map +1 -0
- package/lib/Cloudflare/AnalyticsEngine/index.js +3 -0
- package/lib/Cloudflare/AnalyticsEngine/index.js.map +1 -0
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -1
- package/lib/Cloudflare/Container/Container.js +0 -1
- package/lib/Cloudflare/Container/Container.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.js +4 -6
- package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerBinding.js +2 -2
- package/lib/Cloudflare/Container/ContainerBinding.js.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.d.ts +47 -3
- package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.js +62 -5
- package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +1 -1
- package/lib/Cloudflare/D1/D1SqlFile.d.ts +2 -2
- package/lib/Cloudflare/Email/EmailAddress.d.ts +45 -0
- package/lib/Cloudflare/Email/EmailAddress.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailAddress.js +99 -0
- package/lib/Cloudflare/Email/EmailAddress.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts +42 -0
- package/lib/Cloudflare/Email/EmailRouting.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRouting.js +89 -0
- package/lib/Cloudflare/Email/EmailRouting.js.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts +80 -0
- package/lib/Cloudflare/Email/EmailRule.d.ts.map +1 -0
- package/lib/Cloudflare/Email/EmailRule.js +110 -0
- package/lib/Cloudflare/Email/EmailRule.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts +74 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmail.js +19 -0
- package/lib/Cloudflare/Email/SendEmail.js.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts +64 -0
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js +54 -0
- package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -0
- package/lib/Cloudflare/Email/index.d.ts +6 -0
- package/lib/Cloudflare/Email/index.d.ts.map +1 -0
- package/lib/Cloudflare/Email/index.js +6 -0
- package/lib/Cloudflare/Email/index.js.map +1 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
- package/lib/Cloudflare/Local/Sidecar.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +9 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +9 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +16 -0
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +7 -2
- package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Api.js +23 -1
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- package/lib/Cloudflare/StateStore/Store.d.ts +16 -1
- package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Store.js +22 -5
- package/lib/Cloudflare/StateStore/Store.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +5 -4
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +35 -0
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/CronEventSource.js +55 -0
- package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -0
- package/lib/Cloudflare/Workers/InferEnv.d.ts +37 -2
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +2 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.d.ts +76 -3
- package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.js +197 -13
- package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +24 -4
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +187 -45
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +19 -11
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
- package/lib/Cloudflare/Workers/Workflow.d.ts +50 -47
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +43 -37
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +1 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +1 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/index.d.ts +2 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +2 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Construct.d.ts +3 -3
- package/lib/Construct.d.ts.map +1 -1
- package/lib/Construct.js.map +1 -1
- package/lib/Deploy.d.ts +5 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +2 -2
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -2
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +3 -2
- package/lib/Destroy.js.map +1 -1
- package/lib/Drizzle/Providers.d.ts +1 -1
- package/lib/Drizzle/Schema.d.ts +1 -1
- package/lib/GitHub/Providers.d.ts +1 -1
- package/lib/Http.d.ts +1 -1
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js +1 -1
- package/lib/Http.js.map +1 -1
- package/lib/Namespace.d.ts.map +1 -1
- package/lib/Namespace.js +3 -4
- package/lib/Namespace.js.map +1 -1
- package/lib/Neon/Branch.d.ts +2 -2
- package/lib/Neon/Branch.d.ts.map +1 -1
- package/lib/Neon/Branch.js +59 -27
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +2 -2
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +2 -2
- package/lib/Neon/Credentials.js.map +1 -1
- package/lib/Neon/NeonEnvironment.d.ts +1 -1
- package/lib/Neon/Project.d.ts +25 -1
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +121 -42
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Neon/Providers.d.ts +1 -1
- package/lib/Neon/SqlFile.d.ts +2 -2
- package/lib/Output.d.ts +47 -8
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +106 -7
- package/lib/Output.js.map +1 -1
- package/lib/PhysicalName.d.ts +1 -1
- package/lib/Plan.d.ts +36 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +284 -37
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +22 -9
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +1 -1
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/Random.d.ts +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js +1 -1
- package/lib/Random.js.map +1 -1
- package/lib/Ref.d.ts +4 -1
- package/lib/Ref.d.ts.map +1 -1
- package/lib/Ref.js +1 -1
- package/lib/Ref.js.map +1 -1
- package/lib/Resource.d.ts +8 -0
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +12 -25
- package/lib/Resource.js.map +1 -1
- package/lib/Runtime.d.ts +24 -0
- package/lib/Runtime.d.ts.map +1 -0
- package/lib/Runtime.js +31 -0
- package/lib/Runtime.js.map +1 -0
- package/lib/RuntimeContext.d.ts +3 -1
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Secret.d.ts +50 -0
- package/lib/Secret.d.ts.map +1 -0
- package/lib/Secret.js +23 -0
- package/lib/Secret.js.map +1 -0
- package/lib/Serverless/Function.d.ts +9 -1
- package/lib/Serverless/Function.d.ts.map +1 -1
- package/lib/Sidecar/RpcClient.d.ts +1 -1
- package/lib/Sidecar/RpcPaths.d.ts +1 -1
- package/lib/Sidecar/RpcServer.d.ts +1 -1
- package/lib/Sidecar/RpcServices.d.ts +1 -1
- package/lib/Stack.d.ts +20 -6
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +35 -23
- package/lib/Stack.js.map +1 -1
- package/lib/State/ActionState.d.ts +48 -0
- package/lib/State/ActionState.d.ts.map +1 -0
- package/lib/State/ActionState.js +1 -0
- package/lib/State/ActionState.js.map +1 -0
- package/lib/State/HttpStateApi.d.ts +15 -1
- package/lib/State/HttpStateApi.d.ts.map +1 -1
- package/lib/State/HttpStateApi.js +11 -0
- package/lib/State/HttpStateApi.js.map +1 -1
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +12 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts +2 -2
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js +12 -6
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/LocalState.d.ts +2 -2
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +11 -2
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/ResourceState.d.ts +5 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +31 -2
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/State.js +2 -0
- package/lib/State/State.js.map +1 -1
- package/lib/State/index.d.ts +1 -0
- package/lib/State/index.d.ts.map +1 -1
- package/lib/State/index.js +1 -0
- package/lib/State/index.js.map +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +30 -7
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Core.d.ts +19 -4
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +33 -12
- package/lib/Test/Core.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +24 -5
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/FileLogger.d.ts +1 -1
- package/lib/Util/LocalhostDns.d.ts +14 -10
- package/lib/Util/LocalhostDns.d.ts.map +1 -1
- package/lib/Util/LocalhostDns.js +27 -36
- package/lib/Util/LocalhostDns.js.map +1 -1
- package/lib/Util/effect.d.ts +7 -0
- package/lib/Util/effect.d.ts.map +1 -1
- package/lib/Util/effect.js +10 -4
- package/lib/Util/effect.js.map +1 -1
- package/lib/Util/exec.d.ts.map +1 -0
- package/lib/Util/exec.js.map +1 -0
- package/lib/Util/hash.d.ts +8 -0
- package/lib/Util/hash.d.ts.map +1 -0
- package/lib/Util/hash.js +11 -0
- package/lib/Util/hash.js.map +1 -0
- package/lib/Util/ignore.d.ts +40 -0
- package/lib/Util/ignore.d.ts.map +1 -0
- package/lib/Util/ignore.js +591 -0
- package/lib/Util/ignore.js.map +1 -0
- package/lib/Variable.d.ts +29 -0
- package/lib/Variable.d.ts.map +1 -0
- package/lib/Variable.js +9 -0
- package/lib/Variable.js.map +1 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -0
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -29
- package/src/AWS/Credentials.ts +1 -2
- package/src/AWS/DynamoDB/Stream.ts +1 -4
- package/src/AWS/EC2/hosted.ts +14 -16
- package/src/AWS/ECS/Task.ts +14 -16
- package/src/AWS/Endpoint.ts +2 -5
- package/src/AWS/EventBridge/EventSource.ts +1 -4
- package/src/AWS/Kinesis/StreamEventSource.ts +1 -4
- package/src/AWS/Lambda/Function.ts +47 -23
- package/src/AWS/Providers.ts +22 -3
- package/src/AWS/Region.ts +2 -3
- package/src/AWS/S3/Bucket.ts +7 -2
- package/src/AWS/S3/BucketNotifications.ts +1 -4
- package/src/AWS/SNS/TopicEventSource.ts +1 -4
- package/src/AWS/SQS/Queue.ts +40 -6
- package/src/Action.ts +280 -0
- package/src/Apply.ts +359 -24
- package/src/Artifacts.ts +2 -4
- package/src/Auth/AuthProvider.ts +1 -1
- package/src/Auth/Env.ts +12 -20
- package/src/Binding.ts +5 -9
- package/src/Bundle/Docker.ts +1 -1
- package/src/Cli/Event.ts +4 -0
- package/src/Cli/NamespaceTree.ts +52 -5
- package/src/Cli/commands/_shared.ts +2 -2
- package/src/Cli/commands/deploy.ts +1 -1
- package/src/Cli/commands/logs.ts +4 -4
- package/src/Cli/commands/tail.ts +4 -4
- package/src/Cli/tui/components/Plan.tsx +65 -17
- package/src/Cli/tui/components/PlanProgress.tsx +142 -32
- package/src/Cloudflare/Access.ts +1 -1
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.ts +82 -0
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +106 -0
- package/src/Cloudflare/AnalyticsEngine/index.ts +2 -0
- package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +1 -1
- package/src/Cloudflare/Container/Container.ts +1 -1
- package/src/Cloudflare/Container/ContainerApplication.ts +4 -6
- package/src/Cloudflare/Container/ContainerBinding.ts +2 -2
- package/src/Cloudflare/D1/D1Connection.ts +95 -12
- package/src/Cloudflare/Email/EmailAddress.ts +155 -0
- package/src/Cloudflare/Email/EmailRouting.ts +138 -0
- package/src/Cloudflare/Email/EmailRule.ts +210 -0
- package/src/Cloudflare/Email/SendEmail.ts +95 -0
- package/src/Cloudflare/Email/SendEmailBinding.ts +124 -0
- package/src/Cloudflare/Email/index.ts +5 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +1 -1
- package/src/Cloudflare/KV/KVNamespaceBinding.ts +1 -1
- package/src/Cloudflare/Local/SidecarHandlers.ts +9 -1
- package/src/Cloudflare/Local/SidecarServer.ts +1 -1
- package/src/Cloudflare/Providers.ts +14 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
- package/src/Cloudflare/R2/R2Bucket.ts +31 -0
- package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
- package/src/Cloudflare/StateStore/Api.ts +34 -1
- package/src/Cloudflare/StateStore/Store.ts +40 -10
- package/src/Cloudflare/Workers/Assets.ts +5 -6
- package/src/Cloudflare/Workers/CronEventSource.ts +89 -0
- package/src/Cloudflare/Workers/InferEnv.ts +94 -20
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
- package/src/Cloudflare/Workers/Rpc.ts +227 -18
- package/src/Cloudflare/Workers/Worker.ts +294 -65
- package/src/Cloudflare/Workers/WorkerBundle.ts +19 -11
- package/src/Cloudflare/Workers/Workflow.ts +76 -72
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Cloudflare/index.ts +2 -0
- package/src/Construct.ts +3 -7
- package/src/Deploy.ts +5 -1
- package/src/Destroy.ts +6 -1
- package/src/Http.ts +1 -1
- package/src/Namespace.ts +4 -4
- package/src/Neon/Branch.ts +93 -59
- package/src/Neon/Credentials.ts +2 -2
- package/src/Neon/Project.ts +193 -64
- package/src/Output.ts +129 -18
- package/src/Plan.ts +375 -36
- package/src/Platform.ts +26 -11
- package/src/Provider.ts +8 -3
- package/src/Random.ts +1 -1
- package/src/Ref.ts +10 -5
- package/src/Resource.ts +24 -25
- package/src/Runtime.ts +38 -0
- package/src/RuntimeContext.ts +1 -0
- package/src/Secret.ts +87 -0
- package/src/Serverless/Function.ts +10 -1
- package/src/Stack.ts +62 -35
- package/src/State/ActionState.ts +51 -0
- package/src/State/HttpStateApi.ts +21 -0
- package/src/State/HttpStateStore.ts +27 -2
- package/src/State/InMemoryState.ts +31 -10
- package/src/State/LocalState.ts +28 -4
- package/src/State/ResourceState.ts +5 -0
- package/src/State/State.ts +38 -2
- package/src/State/index.ts +1 -0
- package/src/Test/Bun.ts +43 -7
- package/src/Test/Core.ts +33 -11
- package/src/Test/Vitest.ts +33 -4
- package/src/Util/LocalhostDns.ts +30 -36
- package/src/Util/effect.ts +29 -4
- package/src/Util/hash.ts +14 -0
- package/src/Util/ignore.ts +815 -0
- package/src/Variable.ts +44 -0
- package/src/index.ts +9 -0
- package/lib/Agent/Agent.d.ts +0 -9
- package/lib/Agent/Agent.d.ts.map +0 -1
- package/lib/Agent/Agent.js +0 -10
- package/lib/Agent/Agent.js.map +0 -1
- package/lib/Agent/Aspect.d.ts +0 -51
- package/lib/Agent/Aspect.d.ts.map +0 -1
- package/lib/Agent/Aspect.js +0 -45
- package/lib/Agent/Aspect.js.map +0 -1
- package/lib/Agent/AspectGraph.d.ts +0 -45
- package/lib/Agent/AspectGraph.d.ts.map +0 -1
- package/lib/Agent/AspectGraph.js +0 -39
- package/lib/Agent/AspectGraph.js.map +0 -1
- package/lib/Agent/ContextPlugin.d.ts +0 -8
- package/lib/Agent/ContextPlugin.d.ts.map +0 -1
- package/lib/Agent/ContextPlugin.js +0 -3
- package/lib/Agent/ContextPlugin.js.map +0 -1
- package/lib/Agent/Plugin.d.ts +0 -18
- package/lib/Agent/Plugin.d.ts.map +0 -1
- package/lib/Agent/Plugin.js +0 -8
- package/lib/Agent/Plugin.js.map +0 -1
- package/lib/Agent/chat/channel.d.ts +0 -9
- package/lib/Agent/chat/channel.d.ts.map +0 -1
- package/lib/Agent/chat/channel.js +0 -10
- package/lib/Agent/chat/channel.js.map +0 -1
- package/lib/Agent/chat/event.d.ts +0 -32
- package/lib/Agent/chat/event.d.ts.map +0 -1
- package/lib/Agent/chat/event.js +0 -32
- package/lib/Agent/chat/event.js.map +0 -1
- package/lib/Agent/chat/message.d.ts +0 -22
- package/lib/Agent/chat/message.d.ts.map +0 -1
- package/lib/Agent/chat/message.js +0 -31
- package/lib/Agent/chat/message.js.map +0 -1
- package/lib/Agent/chat/service.d.ts +0 -102
- package/lib/Agent/chat/service.d.ts.map +0 -1
- package/lib/Agent/chat/service.js +0 -79
- package/lib/Agent/chat/service.js.map +0 -1
- package/lib/Agent/chat/thread.d.ts +0 -13
- package/lib/Agent/chat/thread.d.ts.map +0 -1
- package/lib/Agent/chat/thread.js +0 -16
- package/lib/Agent/chat/thread.js.map +0 -1
- package/lib/Agent/coding/bash.d.ts +0 -36
- package/lib/Agent/coding/bash.d.ts.map +0 -1
- package/lib/Agent/coding/bash.js +0 -170
- package/lib/Agent/coding/bash.js.map +0 -1
- package/lib/Agent/coding/edit.d.ts +0 -31
- package/lib/Agent/coding/edit.d.ts.map +0 -1
- package/lib/Agent/coding/edit.js +0 -90
- package/lib/Agent/coding/edit.js.map +0 -1
- package/lib/Agent/coding/glob.d.ts +0 -23
- package/lib/Agent/coding/glob.d.ts.map +0 -1
- package/lib/Agent/coding/glob.js +0 -78
- package/lib/Agent/coding/glob.js.map +0 -1
- package/lib/Agent/coding/grep.d.ts +0 -26
- package/lib/Agent/coding/grep.d.ts.map +0 -1
- package/lib/Agent/coding/grep.js +0 -105
- package/lib/Agent/coding/grep.js.map +0 -1
- package/lib/Agent/coding/index.d.ts +0 -8
- package/lib/Agent/coding/index.d.ts.map +0 -1
- package/lib/Agent/coding/index.js +0 -8
- package/lib/Agent/coding/index.js.map +0 -1
- package/lib/Agent/coding/read.d.ts +0 -27
- package/lib/Agent/coding/read.d.ts.map +0 -1
- package/lib/Agent/coding/read.js +0 -89
- package/lib/Agent/coding/read.js.map +0 -1
- package/lib/Agent/coding/readlints.d.ts +0 -19
- package/lib/Agent/coding/readlints.d.ts.map +0 -1
- package/lib/Agent/coding/readlints.js +0 -53
- package/lib/Agent/coding/readlints.js.map +0 -1
- package/lib/Agent/coding/write.d.ts +0 -22
- package/lib/Agent/coding/write.d.ts.map +0 -1
- package/lib/Agent/coding/write.js +0 -53
- package/lib/Agent/coding/write.js.map +0 -1
- package/lib/Agent/fs/file.d.ts +0 -12
- package/lib/Agent/fs/file.d.ts.map +0 -1
- package/lib/Agent/fs/file.js +0 -8
- package/lib/Agent/fs/file.js.map +0 -1
- package/lib/Agent/fs/folder.d.ts +0 -5
- package/lib/Agent/fs/folder.d.ts.map +0 -1
- package/lib/Agent/fs/folder.js +0 -3
- package/lib/Agent/fs/folder.js.map +0 -1
- package/lib/Agent/index.d.ts +0 -9
- package/lib/Agent/index.d.ts.map +0 -1
- package/lib/Agent/index.js +0 -9
- package/lib/Agent/index.js.map +0 -1
- package/lib/Agent/llm/error.d.ts +0 -208
- package/lib/Agent/llm/error.d.ts.map +0 -1
- package/lib/Agent/llm/error.js +0 -209
- package/lib/Agent/llm/error.js.map +0 -1
- package/lib/Agent/llm/index.d.ts +0 -5
- package/lib/Agent/llm/index.d.ts.map +0 -1
- package/lib/Agent/llm/index.js +0 -5
- package/lib/Agent/llm/index.js.map +0 -1
- package/lib/Agent/llm/llm.d.ts +0 -32
- package/lib/Agent/llm/llm.d.ts.map +0 -1
- package/lib/Agent/llm/llm.js +0 -74
- package/lib/Agent/llm/llm.js.map +0 -1
- package/lib/Agent/llm/stream-collectors.d.ts +0 -46
- package/lib/Agent/llm/stream-collectors.d.ts.map +0 -1
- package/lib/Agent/llm/stream-collectors.js +0 -33
- package/lib/Agent/llm/stream-collectors.js.map +0 -1
- package/lib/Agent/llm/stream-text-part.d.ts +0 -5
- package/lib/Agent/llm/stream-text-part.d.ts.map +0 -1
- package/lib/Agent/llm/stream-text-part.js +0 -4
- package/lib/Agent/llm/stream-text-part.js.map +0 -1
- package/lib/Agent/lsp/client.d.ts +0 -122
- package/lib/Agent/lsp/client.d.ts.map +0 -1
- package/lib/Agent/lsp/client.js +0 -180
- package/lib/Agent/lsp/client.js.map +0 -1
- package/lib/Agent/lsp/diagnostics.d.ts +0 -16
- package/lib/Agent/lsp/diagnostics.d.ts.map +0 -1
- package/lib/Agent/lsp/diagnostics.js +0 -48
- package/lib/Agent/lsp/diagnostics.js.map +0 -1
- package/lib/Agent/lsp/jsonrpc.d.ts +0 -90
- package/lib/Agent/lsp/jsonrpc.d.ts.map +0 -1
- package/lib/Agent/lsp/jsonrpc.js +0 -178
- package/lib/Agent/lsp/jsonrpc.js.map +0 -1
- package/lib/Agent/lsp/manager.d.ts +0 -38
- package/lib/Agent/lsp/manager.d.ts.map +0 -1
- package/lib/Agent/lsp/manager.js +0 -98
- package/lib/Agent/lsp/manager.js.map +0 -1
- package/lib/Agent/lsp/servers.d.ts +0 -28
- package/lib/Agent/lsp/servers.d.ts.map +0 -1
- package/lib/Agent/lsp/servers.js +0 -21
- package/lib/Agent/lsp/servers.js.map +0 -1
- package/lib/Agent/process/driver.d.ts +0 -10
- package/lib/Agent/process/driver.d.ts.map +0 -1
- package/lib/Agent/process/driver.js +0 -153
- package/lib/Agent/process/driver.js.map +0 -1
- package/lib/Agent/process/issue-service.d.ts +0 -44
- package/lib/Agent/process/issue-service.d.ts.map +0 -1
- package/lib/Agent/process/issue-service.js +0 -28
- package/lib/Agent/process/issue-service.js.map +0 -1
- package/lib/Agent/process/issue-tools.d.ts +0 -28
- package/lib/Agent/process/issue-tools.d.ts.map +0 -1
- package/lib/Agent/process/issue-tools.js +0 -28
- package/lib/Agent/process/issue-tools.js.map +0 -1
- package/lib/Agent/process/issue.d.ts +0 -16
- package/lib/Agent/process/issue.d.ts.map +0 -1
- package/lib/Agent/process/issue.js +0 -17
- package/lib/Agent/process/issue.js.map +0 -1
- package/lib/Agent/process/organization.d.ts +0 -4
- package/lib/Agent/process/organization.d.ts.map +0 -1
- package/lib/Agent/process/organization.js +0 -3
- package/lib/Agent/process/organization.js.map +0 -1
- package/lib/Agent/process/process.d.ts +0 -5
- package/lib/Agent/process/process.d.ts.map +0 -1
- package/lib/Agent/process/process.js +0 -3
- package/lib/Agent/process/process.js.map +0 -1
- package/lib/Agent/process/reply.d.ts +0 -16
- package/lib/Agent/process/reply.d.ts.map +0 -1
- package/lib/Agent/process/reply.js +0 -18
- package/lib/Agent/process/reply.js.map +0 -1
- package/lib/Agent/process/task.d.ts +0 -25
- package/lib/Agent/process/task.d.ts.map +0 -1
- package/lib/Agent/process/task.js +0 -26
- package/lib/Agent/process/task.js.map +0 -1
- package/lib/Agent/tool/index.d.ts +0 -4
- package/lib/Agent/tool/index.d.ts.map +0 -1
- package/lib/Agent/tool/index.js +0 -4
- package/lib/Agent/tool/index.js.map +0 -1
- package/lib/Agent/tool/parameter.d.ts +0 -12
- package/lib/Agent/tool/parameter.d.ts.map +0 -1
- package/lib/Agent/tool/parameter.js +0 -6
- package/lib/Agent/tool/parameter.js.map +0 -1
- package/lib/Agent/tool/result.d.ts +0 -17
- package/lib/Agent/tool/result.d.ts.map +0 -1
- package/lib/Agent/tool/result.js +0 -6
- package/lib/Agent/tool/result.js.map +0 -1
- package/lib/Agent/tool/tool.d.ts +0 -32
- package/lib/Agent/tool/tool.d.ts.map +0 -1
- package/lib/Agent/tool/tool.js +0 -16
- package/lib/Agent/tool/tool.js.map +0 -1
- package/lib/Agent/util/command-validator.d.ts +0 -12
- package/lib/Agent/util/command-validator.d.ts.map +0 -1
- package/lib/Agent/util/command-validator.js +0 -74
- package/lib/Agent/util/command-validator.js.map +0 -1
- package/lib/Agent/util/exec.d.ts.map +0 -1
- package/lib/Agent/util/exec.js.map +0 -1
- package/lib/Agent/util/parser.d.ts +0 -5
- package/lib/Agent/util/parser.d.ts.map +0 -1
- package/lib/Agent/util/parser.js +0 -41
- package/lib/Agent/util/parser.js.map +0 -1
- package/lib/Agent/util/replace.d.ts +0 -38
- package/lib/Agent/util/replace.d.ts.map +0 -1
- package/lib/Agent/util/replace.js +0 -458
- package/lib/Agent/util/replace.js.map +0 -1
- package/lib/Agent/util/ripgrep.d.ts +0 -109
- package/lib/Agent/util/ripgrep.d.ts.map +0 -1
- package/lib/Agent/util/ripgrep.js +0 -221
- package/lib/Agent/util/ripgrep.js.map +0 -1
- package/lib/Neon/api.d.ts +0 -258
- package/lib/Neon/api.d.ts.map +0 -1
- package/lib/Neon/api.js +0 -215
- package/lib/Neon/api.js.map +0 -1
- package/src/Agent/Agent.ts +0 -26
- package/src/Agent/Aspect.ts +0 -173
- package/src/Agent/AspectGraph.ts +0 -98
- package/src/Agent/ContextPlugin.ts +0 -18
- package/src/Agent/Plugin.ts +0 -29
- package/src/Agent/chat/channel.ts +0 -26
- package/src/Agent/chat/event.ts +0 -43
- package/src/Agent/chat/message.ts +0 -35
- package/src/Agent/chat/service.ts +0 -133
- package/src/Agent/chat/thread.ts +0 -17
- package/src/Agent/coding/bash.ts +0 -197
- package/src/Agent/coding/edit.ts +0 -152
- package/src/Agent/coding/glob.ts +0 -96
- package/src/Agent/coding/grep.ts +0 -143
- package/src/Agent/coding/index.ts +0 -7
- package/src/Agent/coding/read.ts +0 -119
- package/src/Agent/coding/readlints.ts +0 -78
- package/src/Agent/coding/write.ts +0 -79
- package/src/Agent/fs/file.ts +0 -22
- package/src/Agent/fs/folder.ts +0 -16
- package/src/Agent/index.ts +0 -9
- package/src/Agent/llm/error.ts +0 -330
- package/src/Agent/llm/index.ts +0 -4
- package/src/Agent/llm/llm.ts +0 -131
- package/src/Agent/llm/stream-collectors.ts +0 -58
- package/src/Agent/llm/stream-text-part.ts +0 -7
- package/src/Agent/lsp/client.ts +0 -293
- package/src/Agent/lsp/diagnostics.ts +0 -64
- package/src/Agent/lsp/jsonrpc.ts +0 -317
- package/src/Agent/lsp/manager.ts +0 -213
- package/src/Agent/lsp/servers.ts +0 -37
- package/src/Agent/process/driver.ts +0 -168
- package/src/Agent/process/issue-service.ts +0 -48
- package/src/Agent/process/issue-tools.ts +0 -33
- package/src/Agent/process/issue.ts +0 -22
- package/src/Agent/process/organization.ts +0 -16
- package/src/Agent/process/process.ts +0 -16
- package/src/Agent/process/reply.ts +0 -21
- package/src/Agent/process/task.ts +0 -34
- package/src/Agent/tool/index.ts +0 -3
- package/src/Agent/tool/parameter.ts +0 -35
- package/src/Agent/tool/result.ts +0 -51
- package/src/Agent/tool/tool.ts +0 -74
- package/src/Agent/util/command-validator.ts +0 -98
- package/src/Agent/util/parser.ts +0 -39
- package/src/Agent/util/replace.ts +0 -559
- package/src/Agent/util/ripgrep.ts +0 -256
- package/src/Neon/api.ts +0 -579
- /package/lib/{Agent/util → Util}/exec.d.ts +0 -0
- /package/lib/{Agent/util → Util}/exec.js +0 -0
- /package/src/{Agent/util → Util}/exec.ts +0 -0
package/src/Ref.ts
CHANGED
|
@@ -22,11 +22,16 @@ export interface RefMetadata<R extends ResourceLike> {
|
|
|
22
22
|
stage?: string;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export const ref = <R extends ResourceLike>(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
export const ref = <R extends ResourceLike>(
|
|
26
|
+
id: string,
|
|
27
|
+
{
|
|
28
|
+
stack,
|
|
29
|
+
stage,
|
|
30
|
+
}: {
|
|
31
|
+
stack?: string;
|
|
32
|
+
stage?: string;
|
|
33
|
+
} = {},
|
|
34
|
+
): Ref<R> => {
|
|
30
35
|
const ref = new Proxy(
|
|
31
36
|
{},
|
|
32
37
|
{
|
package/src/Resource.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { Input, InputProps } from "./Input.ts";
|
|
|
7
7
|
import { CurrentNamespace, type NamespaceNode } from "./Namespace.ts";
|
|
8
8
|
import * as Output from "./Output.ts";
|
|
9
9
|
import { Provider } from "./Provider.ts";
|
|
10
|
+
import { ref as makeRef } from "./Ref.ts";
|
|
10
11
|
import { RemovalPolicy } from "./RemovalPolicy.ts";
|
|
11
12
|
import { Self } from "./Self.ts";
|
|
12
13
|
import { Stack } from "./Stack.ts";
|
|
@@ -47,6 +48,10 @@ export type ResourceClassWithMethods<
|
|
|
47
48
|
Effect.Effect<ResourceConstructor<R>> & {
|
|
48
49
|
Self: Self<R>;
|
|
49
50
|
Provider: Provider<R>;
|
|
51
|
+
ref(
|
|
52
|
+
id: string,
|
|
53
|
+
options?: { stage?: string; stack?: string },
|
|
54
|
+
): Effect.Effect<R>;
|
|
50
55
|
} & Methods;
|
|
51
56
|
|
|
52
57
|
export type ResourceClass<R extends ResourceLike> = ResourceConstructor<
|
|
@@ -56,6 +61,10 @@ export type ResourceClass<R extends ResourceLike> = ResourceConstructor<
|
|
|
56
61
|
Effect.Effect<ResourceConstructor<R>> & {
|
|
57
62
|
Self: Self<R>;
|
|
58
63
|
Provider: Provider<R>;
|
|
64
|
+
ref(
|
|
65
|
+
id: string,
|
|
66
|
+
options?: { stage?: string; stack?: string },
|
|
67
|
+
): Effect.Effect<R>;
|
|
59
68
|
};
|
|
60
69
|
|
|
61
70
|
export type LogicalId = string;
|
|
@@ -228,29 +237,6 @@ export function Resource<R extends ResourceLike>(
|
|
|
228
237
|
[Symbol.toPrimitive](this: typeof target, hint: string) {
|
|
229
238
|
return hint === "number" ? NaN : this.toString();
|
|
230
239
|
},
|
|
231
|
-
// TODO(sam): figure out a better way to log things in cloudflare, this breaks indentation and is bloated
|
|
232
|
-
// [nodeInspect](
|
|
233
|
-
// depth: number,
|
|
234
|
-
// options: { depth?: number | null } & Record<string, unknown>,
|
|
235
|
-
// inspect: (value: unknown, opts?: unknown) => string,
|
|
236
|
-
// ) {
|
|
237
|
-
// if (depth < 0) {
|
|
238
|
-
// return target.toString();
|
|
239
|
-
// }
|
|
240
|
-
// const nextDepth =
|
|
241
|
-
// options.depth == null ? null : Math.max(0, options.depth - 1);
|
|
242
|
-
// return inspect(
|
|
243
|
-
// {
|
|
244
|
-
// Type: target.Type,
|
|
245
|
-
// Namespace: target.Namespace,
|
|
246
|
-
// FQN: target.FQN,
|
|
247
|
-
// LogicalId: target.LogicalId,
|
|
248
|
-
// Props: target.Props,
|
|
249
|
-
// RemovalPolicy: target.RemovalPolicy,
|
|
250
|
-
// },
|
|
251
|
-
// { ...options, depth: nextDepth },
|
|
252
|
-
// );
|
|
253
|
-
// },
|
|
254
240
|
};
|
|
255
241
|
|
|
256
242
|
const Resource: R = (stack.resources[fqn] = new Proxy(target, {
|
|
@@ -276,16 +262,29 @@ export function Resource<R extends ResourceLike>(
|
|
|
276
262
|
|
|
277
263
|
const Service = {
|
|
278
264
|
[Symbol.iterator]() {
|
|
279
|
-
return new SingleShotGen(this);
|
|
265
|
+
return new SingleShotGen(this.asEffect());
|
|
280
266
|
},
|
|
281
267
|
pipe() {
|
|
282
|
-
return pipeArguments(this
|
|
268
|
+
return pipeArguments(this, arguments);
|
|
283
269
|
},
|
|
284
270
|
asEffect() {
|
|
285
271
|
return Effect.succeed((id: string, props: R["Props"]) =>
|
|
286
272
|
constructor(id, props),
|
|
287
273
|
);
|
|
288
274
|
},
|
|
275
|
+
/**
|
|
276
|
+
* Build a typed reference to a deployed instance of this resource
|
|
277
|
+
* — in the current stack/stage by default, or in another via
|
|
278
|
+
* `options`. Resolves to the same shape as `yield*
|
|
279
|
+
* MyResource("id", props)` so downstream code can read attributes
|
|
280
|
+
* (`ref.someAttr`) exactly the way it would for a locally-declared
|
|
281
|
+
* resource.
|
|
282
|
+
*/
|
|
283
|
+
ref: (
|
|
284
|
+
id: string,
|
|
285
|
+
options?: { stage?: string; stack?: string },
|
|
286
|
+
): Effect.Effect<R> =>
|
|
287
|
+
Effect.succeed(Output.of(makeRef<R>(id, options)) as unknown as R),
|
|
289
288
|
Type: type,
|
|
290
289
|
Provider: ProviderTag,
|
|
291
290
|
Self: self,
|
package/src/Runtime.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime helpers consumed by generated bundle entrypoints (Cloudflare
|
|
3
|
+
* Workers, Cloudflare Containers, AWS Lambda, …).
|
|
4
|
+
*
|
|
5
|
+
* Anything exported here runs *inside* the deployed function — keep the
|
|
6
|
+
* surface tiny and dependency-light.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as Layer from "effect/Layer";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the user's default-export entrypoint into a `Layer` for the
|
|
13
|
+
* bundled runtime.
|
|
14
|
+
*
|
|
15
|
+
* `entrypoint` may be any of:
|
|
16
|
+
* - a `Layer` factory (`{ build: (...) => ... }`) — used as-is
|
|
17
|
+
* - an effect-class with `asEffect()` (Alchemy `Platform`/`Worker` shape)
|
|
18
|
+
* - a plain `Effect`
|
|
19
|
+
*
|
|
20
|
+
* Centralized so the inline ternary doesn't have to be re-emitted into
|
|
21
|
+
* every bundle template (and accidentally rewritten to `x : x` by a bulk
|
|
22
|
+
* replace, which silently swaps the class in for the Effect and bricks
|
|
23
|
+
* every deployed worker/lambda).
|
|
24
|
+
*/
|
|
25
|
+
export const makeEntrypointLayer = (
|
|
26
|
+
tag: any,
|
|
27
|
+
entrypoint: any,
|
|
28
|
+
): Layer.Layer<any> => {
|
|
29
|
+
if (typeof entrypoint?.build === "function") {
|
|
30
|
+
return entrypoint;
|
|
31
|
+
}
|
|
32
|
+
return Layer.effect(
|
|
33
|
+
tag,
|
|
34
|
+
typeof entrypoint?.asEffect === "function"
|
|
35
|
+
? entrypoint.asEffect()
|
|
36
|
+
: entrypoint,
|
|
37
|
+
);
|
|
38
|
+
};
|
package/src/RuntimeContext.ts
CHANGED
package/src/Secret.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as Config from "effect/Config";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Redacted from "effect/Redacted";
|
|
4
|
+
import * as Output from "./Output.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The shapes a {@link secret} can be derived from.
|
|
8
|
+
*
|
|
9
|
+
* - `string` — wrapped in `Redacted.make` and bound as a literal.
|
|
10
|
+
* - `Redacted<string>` — bound as-is.
|
|
11
|
+
* - `Effect<string | Redacted<string>>` — resolved at deploy time.
|
|
12
|
+
* - `Config<string | Redacted<string>>` — resolved against the active
|
|
13
|
+
* `ConfigProvider` at deploy time.
|
|
14
|
+
*/
|
|
15
|
+
export type SecretInput<R = never> =
|
|
16
|
+
| string
|
|
17
|
+
| Redacted.Redacted<string>
|
|
18
|
+
| Effect.Effect<string | Redacted.Redacted<string>, any, R>
|
|
19
|
+
| Config.Config<string | Redacted.Redacted<string>>;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Bind a secret value into the active {@link RuntimeContext} (e.g. a
|
|
23
|
+
* Cloudflare Worker's `env`) under the given `name` so the resource
|
|
24
|
+
* provider deploys it as a secret (e.g. `secret_text` for Cloudflare).
|
|
25
|
+
*
|
|
26
|
+
* The result is an `Output<Redacted<string>>` — `yield*`-ing it returns
|
|
27
|
+
* an `Accessor<Redacted<string>>` that resolves the value at runtime.
|
|
28
|
+
*
|
|
29
|
+
* @example One-arg shortcut — reads `Config.redacted("API_KEY")`
|
|
30
|
+
* ```ts
|
|
31
|
+
* const apiKey = yield* Alchemy.Secret("API_KEY");
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example From a literal
|
|
35
|
+
* ```ts
|
|
36
|
+
* const apiKey = yield* Alchemy.Secret("API_KEY", "sk-123");
|
|
37
|
+
* ```
|
|
38
|
+
*
|
|
39
|
+
* @example From an Effect
|
|
40
|
+
* ```ts
|
|
41
|
+
* const apiKey = yield* Alchemy.Secret(
|
|
42
|
+
* "API_KEY",
|
|
43
|
+
* Effect.succeed(Redacted.make("sk-123")),
|
|
44
|
+
* );
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example From a Config
|
|
48
|
+
* ```ts
|
|
49
|
+
* const apiKey = yield* Alchemy.Secret("API_KEY", Config.redacted("API_KEY"));
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export function Secret(
|
|
53
|
+
name: string,
|
|
54
|
+
): Output.Output<Redacted.Redacted<string>, never>;
|
|
55
|
+
export function Secret<R = never>(
|
|
56
|
+
name: string,
|
|
57
|
+
value: SecretInput<R>,
|
|
58
|
+
): Output.Output<Redacted.Redacted<string>, R>;
|
|
59
|
+
export function Secret<R = never>(
|
|
60
|
+
name: string,
|
|
61
|
+
value?: SecretInput<R>,
|
|
62
|
+
): Output.Output<Redacted.Redacted<string>, R> {
|
|
63
|
+
const source = value ?? Config.redacted(name);
|
|
64
|
+
const base = toOutput<string | Redacted.Redacted<string>, R>(source);
|
|
65
|
+
return Output.named(
|
|
66
|
+
base.pipe(
|
|
67
|
+
Output.map((v) => (Redacted.isRedacted(v) ? v : Redacted.make(v))),
|
|
68
|
+
) as Output.Output<Redacted.Redacted<string>, R>,
|
|
69
|
+
name,
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** @internal */
|
|
74
|
+
export const toOutput = <T, R = never>(
|
|
75
|
+
source: T | Effect.Effect<T, any, R> | Config.Config<T> | Output.Output<T, R>,
|
|
76
|
+
): Output.Output<T, R> => {
|
|
77
|
+
if (Output.isOutput(source)) {
|
|
78
|
+
return source;
|
|
79
|
+
}
|
|
80
|
+
if (Config.isConfig(source)) {
|
|
81
|
+
return Output.asOutput(source as any) as Output.Output<T, R>;
|
|
82
|
+
}
|
|
83
|
+
if (Effect.isEffect(source)) {
|
|
84
|
+
return Output.asOutput(source as any) as Output.Output<T, R>;
|
|
85
|
+
}
|
|
86
|
+
return Output.asOutput(source as T) as Output.Output<T, R>;
|
|
87
|
+
};
|
|
@@ -3,7 +3,16 @@ import type { HttpEffect } from "../Http.ts";
|
|
|
3
3
|
import type { BaseRuntimeContext } from "../RuntimeContext.ts";
|
|
4
4
|
|
|
5
5
|
export interface FunctionContext extends BaseRuntimeContext {
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Register an HTTP handler. The optional `shape` payload is the user's
|
|
8
|
+
* full default-export shape — Cloudflare Workers use it to expose
|
|
9
|
+
* non-handler methods (e.g. `greet`) as RPC methods on the deployed
|
|
10
|
+
* `WorkerEntrypoint`. Other platforms (Lambda, etc.) ignore it.
|
|
11
|
+
*/
|
|
12
|
+
serve<Req = never>(
|
|
13
|
+
handler: HttpEffect<Req>,
|
|
14
|
+
options?: { shape?: Record<string, unknown> },
|
|
15
|
+
): Effect.Effect<void, never, Req>;
|
|
7
16
|
listen<A, Req = never>(
|
|
8
17
|
handler: FunctionListener<A, Req>,
|
|
9
18
|
): Effect.Effect<void, never, Req>;
|
package/src/Stack.ts
CHANGED
|
@@ -6,7 +6,7 @@ import * as Layer from "effect/Layer";
|
|
|
6
6
|
import * as Logger from "effect/Logger";
|
|
7
7
|
import * as Option from "effect/Option";
|
|
8
8
|
import { Path } from "effect/Path";
|
|
9
|
-
import
|
|
9
|
+
import * as Scope from "effect/Scope";
|
|
10
10
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
11
11
|
import type { HttpClient } from "effect/unstable/http/HttpClient";
|
|
12
12
|
import type { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
|
|
@@ -18,19 +18,19 @@ import { Profile, ProfileLive } from "./Auth/Profile.ts";
|
|
|
18
18
|
import { Cli } from "./Cli/Cli.ts";
|
|
19
19
|
import type { Input, InputProps } from "./Input.ts";
|
|
20
20
|
import * as Output from "./Output.ts";
|
|
21
|
-
import { ref } from "./Ref.ts";
|
|
22
21
|
import type { ResourceBinding, ResourceLike } from "./Resource.ts";
|
|
23
22
|
import { Stage } from "./Stage.ts";
|
|
23
|
+
import type { ActionLike } from "./Action.ts";
|
|
24
24
|
import type { State } from "./State/State.ts";
|
|
25
25
|
import { loadConfigProvider } from "./Util/ConfigProvider.ts";
|
|
26
|
-
import { taggedFunction } from "./Util/effect.ts";
|
|
26
|
+
import { effectClass, taggedFunction } from "./Util/effect.ts";
|
|
27
27
|
import { fileLogger } from "./Util/FileLogger.ts";
|
|
28
28
|
import { PlatformServices } from "./Util/PlatformServices.ts";
|
|
29
29
|
|
|
30
30
|
export type StackServices =
|
|
31
31
|
| Stack
|
|
32
32
|
| Stage
|
|
33
|
-
| Scope
|
|
33
|
+
| Scope.Scope
|
|
34
34
|
| FileSystem
|
|
35
35
|
| Path
|
|
36
36
|
| AlchemyContext
|
|
@@ -46,7 +46,7 @@ export type StackEffect<A, Err = never, Req = never> = Effect.Effect<
|
|
|
46
46
|
Err,
|
|
47
47
|
| PlatformServices
|
|
48
48
|
| HttpClient
|
|
49
|
-
| Scope
|
|
49
|
+
| Scope.Scope
|
|
50
50
|
| AuthProviders
|
|
51
51
|
| AlchemyContext
|
|
52
52
|
| Cli
|
|
@@ -98,6 +98,7 @@ export const Stack: Context.ServiceClass<
|
|
|
98
98
|
(stackName: string): Effect.Effect<Self> & {
|
|
99
99
|
new (_: never): Output.ToOutput<Shape>;
|
|
100
100
|
make: <A, Req>(
|
|
101
|
+
options: StackProps<NoInfer<Req>>,
|
|
101
102
|
effect: Effect.Effect<A, never, Req>,
|
|
102
103
|
) => Effect.Effect<CompiledStack<A>>;
|
|
103
104
|
stage: {
|
|
@@ -114,36 +115,46 @@ export const Stack: Context.ServiceClass<
|
|
|
114
115
|
taggedFunction(
|
|
115
116
|
Context.Service<Stack, Omit<StackSpec, "output">>()("Stack"),
|
|
116
117
|
<A, Req>(
|
|
117
|
-
stackName
|
|
118
|
-
options
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
118
|
+
stackName?: string,
|
|
119
|
+
options?: StackProps<NoInfer<Req>>,
|
|
120
|
+
eff?: Effect.Effect<A, never, Req>,
|
|
121
|
+
) => {
|
|
122
|
+
if (!stackName) {
|
|
123
|
+
return (stackName: string) =>
|
|
124
|
+
Object.assign(
|
|
125
|
+
// by default, reference the stack at the "current" stage of the importer
|
|
126
|
+
Output.stackRef<A>(stackName).pipe(effectClass),
|
|
127
|
+
{
|
|
128
|
+
stage: createStageProxy(stackName),
|
|
129
|
+
make: <Req = never>(
|
|
130
|
+
options: StackProps<NoInfer<Req>>,
|
|
131
|
+
eff: Effect.Effect<A, never, Req>,
|
|
132
|
+
) => Stack(stackName, options, eff),
|
|
133
|
+
},
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
return eff!.pipe(
|
|
125
137
|
make({
|
|
126
138
|
name: stackName,
|
|
127
|
-
...options
|
|
139
|
+
...options!,
|
|
128
140
|
}),
|
|
129
141
|
(eff) =>
|
|
130
142
|
Object.assign(eff, {
|
|
131
|
-
stage:
|
|
132
|
-
{},
|
|
133
|
-
{
|
|
134
|
-
get: (_, stage: string) =>
|
|
135
|
-
ref({
|
|
136
|
-
stack: stackName,
|
|
137
|
-
stage,
|
|
138
|
-
id: stackName,
|
|
139
|
-
}),
|
|
140
|
-
},
|
|
141
|
-
),
|
|
143
|
+
stage: createStageProxy(stackName),
|
|
142
144
|
}),
|
|
143
|
-
)
|
|
145
|
+
);
|
|
146
|
+
},
|
|
144
147
|
),
|
|
145
148
|
) as any;
|
|
146
149
|
|
|
150
|
+
const createStageProxy = (stackName: string) =>
|
|
151
|
+
new Proxy(
|
|
152
|
+
{},
|
|
153
|
+
{
|
|
154
|
+
get: (_, stage: string) => Output.stackRef(stackName, { stage }),
|
|
155
|
+
},
|
|
156
|
+
);
|
|
157
|
+
|
|
147
158
|
export interface StackSpec<Output = any> {
|
|
148
159
|
name: string;
|
|
149
160
|
stage: string;
|
|
@@ -154,6 +165,10 @@ export interface StackSpec<Output = any> {
|
|
|
154
165
|
bindings: {
|
|
155
166
|
[logicalId: string]: ResourceBinding[];
|
|
156
167
|
};
|
|
168
|
+
/** Tasks registered on the stack, keyed by FQN. */
|
|
169
|
+
actions: {
|
|
170
|
+
[logicalId: string]: ActionLike;
|
|
171
|
+
};
|
|
157
172
|
output: Output;
|
|
158
173
|
}
|
|
159
174
|
|
|
@@ -211,7 +226,7 @@ export const make =
|
|
|
211
226
|
Layer.provideMerge(
|
|
212
227
|
Layer.effect(
|
|
213
228
|
Stack,
|
|
214
|
-
Stage.
|
|
229
|
+
Stage.pipe(
|
|
215
230
|
Effect.map(
|
|
216
231
|
(stage) =>
|
|
217
232
|
options.stack ?? {
|
|
@@ -219,6 +234,7 @@ export const make =
|
|
|
219
234
|
stage,
|
|
220
235
|
resources: {},
|
|
221
236
|
bindings: {},
|
|
237
|
+
actions: {},
|
|
222
238
|
},
|
|
223
239
|
),
|
|
224
240
|
),
|
|
@@ -230,7 +246,7 @@ export const make =
|
|
|
230
246
|
Effect.flatMap((context) =>
|
|
231
247
|
Effect.all([
|
|
232
248
|
effect,
|
|
233
|
-
Stack
|
|
249
|
+
Stack,
|
|
234
250
|
Effect.context<ROut | StackServices>(),
|
|
235
251
|
]).pipe(
|
|
236
252
|
Effect.map(
|
|
@@ -249,7 +265,7 @@ export const make =
|
|
|
249
265
|
);
|
|
250
266
|
|
|
251
267
|
export const CurrentStack = Effect.serviceOption(Stack)
|
|
252
|
-
|
|
268
|
+
|
|
253
269
|
.pipe(Effect.map(Option.getOrUndefined));
|
|
254
270
|
|
|
255
271
|
const platform = Layer.mergeAll(
|
|
@@ -268,9 +284,7 @@ const alchemy = (overrides?: { dev?: boolean }) =>
|
|
|
268
284
|
? Layer.provide(
|
|
269
285
|
Layer.effect(
|
|
270
286
|
AlchemyContext,
|
|
271
|
-
AlchemyContext.
|
|
272
|
-
Effect.map((ctx) => ({ ...ctx, dev: overrides.dev! })),
|
|
273
|
-
),
|
|
287
|
+
AlchemyContext.useSync((ctx) => ({ ...ctx, dev: overrides.dev! })),
|
|
274
288
|
),
|
|
275
289
|
AlchemyContextLive,
|
|
276
290
|
)
|
|
@@ -283,9 +297,18 @@ export const evalStack = <A, B, Err, Req>(
|
|
|
283
297
|
options: {
|
|
284
298
|
stage: string;
|
|
285
299
|
dev?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Optional caller-supplied scope. When provided, scoped resources
|
|
302
|
+
* (e.g. the dev sidecar process) live until the caller closes this
|
|
303
|
+
* scope instead of being torn down when `evalStack` resolves. Used
|
|
304
|
+
* by the test harness so the sidecar survives across `beforeAll`,
|
|
305
|
+
* tests, and `afterAll`. When omitted, behaves as before with a
|
|
306
|
+
* private scope closed on completion.
|
|
307
|
+
*/
|
|
308
|
+
scope?: Scope.Scope;
|
|
286
309
|
},
|
|
287
|
-
) =>
|
|
288
|
-
Effect.gen(function* () {
|
|
310
|
+
) => {
|
|
311
|
+
const body = Effect.gen(function* () {
|
|
289
312
|
const stack = yield* effect;
|
|
290
313
|
const configProvider = yield* loadConfigProvider(Option.none());
|
|
291
314
|
|
|
@@ -305,5 +328,9 @@ export const evalStack = <A, B, Err, Req>(
|
|
|
305
328
|
),
|
|
306
329
|
Effect.provide(Layer.succeed(Stage, options.stage)),
|
|
307
330
|
Effect.provide(Layer.provideMerge(alchemy({ dev: options.dev }), platform)),
|
|
308
|
-
Effect.scoped,
|
|
309
331
|
);
|
|
332
|
+
|
|
333
|
+
return options.scope === undefined
|
|
334
|
+
? Effect.scoped(body)
|
|
335
|
+
: Scope.provide(body, options.scope);
|
|
336
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { NamespaceNode } from "../Namespace.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Persisted state for an {@link Action}. Actions share the same FQN
|
|
5
|
+
* namespace as resources but are discriminated by `kind: "action"`. The
|
|
6
|
+
* engine keys action state in the {@link State} store under the same `fqn`
|
|
7
|
+
* field as resources.
|
|
8
|
+
*/
|
|
9
|
+
export type ActionState = RunningActionState | RanActionState;
|
|
10
|
+
|
|
11
|
+
export type ActionStatus = ActionState["status"];
|
|
12
|
+
|
|
13
|
+
interface BaseActionState {
|
|
14
|
+
readonly kind: "action";
|
|
15
|
+
/** Type of the Action (e.g. "NightlySync"). Mirrors `resourceType` for resources. */
|
|
16
|
+
actionType: string;
|
|
17
|
+
/** Namespace of the Action. */
|
|
18
|
+
namespace: NamespaceNode | undefined;
|
|
19
|
+
/** Fully qualified name (namespace + logical id). */
|
|
20
|
+
fqn: string;
|
|
21
|
+
/** Logical id of the Action (stable across runs). */
|
|
22
|
+
logicalId: string;
|
|
23
|
+
/** Current status. */
|
|
24
|
+
status: ActionStatus;
|
|
25
|
+
/** FQNs of nodes that depend on this Action's output. */
|
|
26
|
+
downstream: string[];
|
|
27
|
+
/** Hash of the resolved input, used to skip noop runs. */
|
|
28
|
+
inputHash: string;
|
|
29
|
+
/** Resolved input snapshot from the most recent attempt. */
|
|
30
|
+
input: unknown;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The Action body has started but persistence after success has not yet
|
|
35
|
+
* occurred. On resume the engine treats this as "should run" since the
|
|
36
|
+
* effect may have completed but the output wasn't durably recorded.
|
|
37
|
+
*/
|
|
38
|
+
export interface RunningActionState extends BaseActionState {
|
|
39
|
+
status: "running";
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The Action body completed and its output is durably persisted. Future
|
|
44
|
+
* plans skip the body when `inputHash` matches the new resolved input
|
|
45
|
+
* (unless `--force` is set).
|
|
46
|
+
*/
|
|
47
|
+
export interface RanActionState extends BaseActionState {
|
|
48
|
+
status: "ran";
|
|
49
|
+
/** Materialized output value returned by the Action body. */
|
|
50
|
+
output: unknown;
|
|
51
|
+
}
|
|
@@ -155,6 +155,25 @@ export const GetReplacedResources = HttpApiEndpoint.get(
|
|
|
155
155
|
},
|
|
156
156
|
);
|
|
157
157
|
|
|
158
|
+
export const GetStackOutput = HttpApiEndpoint.get(
|
|
159
|
+
"getStackOutput",
|
|
160
|
+
"/state/stacks/:stack/stages/:stage/output",
|
|
161
|
+
{
|
|
162
|
+
params: StackStage,
|
|
163
|
+
success: Schema.UndefinedOr(ResourceStateSchema),
|
|
164
|
+
},
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
export const SetStackOutput = HttpApiEndpoint.put(
|
|
168
|
+
"setStackOutput",
|
|
169
|
+
"/state/stacks/:stack/stages/:stage/output",
|
|
170
|
+
{
|
|
171
|
+
params: StackStage,
|
|
172
|
+
payload: ResourceStateSchema,
|
|
173
|
+
success: ResourceStateSchema,
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
|
|
158
177
|
/** Response shape for the unauthenticated `/version` probe. */
|
|
159
178
|
export const VersionResponse = Schema.Struct({
|
|
160
179
|
version: Schema.Number,
|
|
@@ -179,6 +198,8 @@ export class StateGroup extends HttpApiGroup.make("state")
|
|
|
179
198
|
.add(DeleteState)
|
|
180
199
|
.add(GetReplacedResources)
|
|
181
200
|
.add(DeleteStack)
|
|
201
|
+
.add(GetStackOutput)
|
|
202
|
+
.add(SetStackOutput)
|
|
182
203
|
.middleware(StateAuth) {}
|
|
183
204
|
|
|
184
205
|
export class VersionGroup extends HttpApiGroup.make("version").add(
|
|
@@ -7,7 +7,11 @@ import * as HttpApiClient from "effect/unstable/httpapi/HttpApiClient";
|
|
|
7
7
|
import { StateApi } from "./HttpStateApi.ts";
|
|
8
8
|
|
|
9
9
|
import type { ReplacedResourceState, ResourceState } from "./ResourceState.ts";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
StateStoreError,
|
|
12
|
+
type StateService,
|
|
13
|
+
type PersistedState,
|
|
14
|
+
} from "./State.ts";
|
|
11
15
|
import { encodeState, reviveStateRecursive } from "./StateEncoding.ts";
|
|
12
16
|
|
|
13
17
|
/**
|
|
@@ -90,7 +94,7 @@ export const makeHttpStateStore = ({
|
|
|
90
94
|
),
|
|
91
95
|
mapStateStoreError,
|
|
92
96
|
),
|
|
93
|
-
set: <V extends
|
|
97
|
+
set: <V extends PersistedState>(request: {
|
|
94
98
|
stack: string;
|
|
95
99
|
stage: string;
|
|
96
100
|
fqn: string;
|
|
@@ -129,6 +133,27 @@ export const makeHttpStateStore = ({
|
|
|
129
133
|
query: request.stage === undefined ? {} : { stage: request.stage },
|
|
130
134
|
})
|
|
131
135
|
.pipe(Effect.asVoid, mapStateStoreError),
|
|
136
|
+
getOutput: (request) =>
|
|
137
|
+
state
|
|
138
|
+
.getStackOutput({
|
|
139
|
+
params: { stack: request.stack, stage: request.stage },
|
|
140
|
+
})
|
|
141
|
+
.pipe(
|
|
142
|
+
Effect.map((s) =>
|
|
143
|
+
s == null ? undefined : reviveStateRecursive(s),
|
|
144
|
+
),
|
|
145
|
+
mapStateStoreError,
|
|
146
|
+
),
|
|
147
|
+
setOutput: (request) =>
|
|
148
|
+
state
|
|
149
|
+
.setStackOutput({
|
|
150
|
+
params: { stack: request.stack, stage: request.stage },
|
|
151
|
+
payload: encodeState(request.value as any),
|
|
152
|
+
})
|
|
153
|
+
.pipe(
|
|
154
|
+
Effect.map(() => request.value),
|
|
155
|
+
mapStateStoreError,
|
|
156
|
+
),
|
|
132
157
|
};
|
|
133
158
|
return service;
|
|
134
159
|
});
|