alchemy 2.0.0-beta.37 → 2.0.0-beta.39
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 +488 -69
- 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 +7 -11
- 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 +222 -3
- 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/AnalyticsEngineDatasetBinding.js +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
- 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/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/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 +6 -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/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 +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- 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/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +25 -3
- package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +4 -3
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +67 -32
- 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 +4 -6
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerName.d.ts +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +2 -2
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/index.d.ts +1 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +1 -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 +1 -1
- package/lib/Destroy.d.ts +1 -1
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +1 -0
- 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 +3 -4
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +7 -4
- 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 +197 -31
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.js +6 -6
- 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/Resource.d.ts.map +1 -1
- package/lib/Resource.js +2 -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/Secret.js +1 -1
- package/lib/Secret.js.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 +7 -2
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +4 -4
- 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/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +1 -1
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/LocalState.d.ts +2 -2
- package/lib/State/ResourceState.d.ts +5 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +10 -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/Core.d.ts +2 -2
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +4 -1
- package/lib/Test/Core.js.map +1 -1
- package/lib/Util/FileLogger.d.ts +1 -1
- package/lib/Util/effect.js +4 -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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -28
- 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 +31 -35
- 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 +351 -23
- 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/AnalyticsEngineDatasetBinding.ts +1 -1
- 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/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/SidecarServer.ts +1 -1
- package/src/Cloudflare/Providers.ts +9 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +1 -1
- package/src/Cloudflare/R2/R2BucketBinding.ts +1 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +1 -1
- package/src/Cloudflare/Workers/Assets.ts +5 -6
- package/src/Cloudflare/Workers/HttpServer.ts +37 -5
- package/src/Cloudflare/Workers/InferEnv.ts +15 -11
- package/src/Cloudflare/Workers/Worker.ts +78 -36
- package/src/Cloudflare/Workers/WorkerBundle.ts +4 -6
- package/src/Cloudflare/Workers/Workflow.ts +2 -2
- package/src/Cloudflare/index.ts +1 -0
- package/src/Construct.ts +3 -7
- package/src/Destroy.ts +1 -0
- 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 +9 -7
- package/src/Plan.ts +303 -53
- package/src/Platform.ts +7 -7
- package/src/Provider.ts +8 -3
- package/src/Random.ts +1 -1
- package/src/Resource.ts +2 -25
- package/src/Runtime.ts +38 -0
- package/src/Secret.ts +1 -1
- package/src/Stack.ts +10 -6
- package/src/State/ActionState.ts +51 -0
- package/src/State/HttpStateStore.ts +6 -2
- package/src/State/InMemoryState.ts +3 -3
- package/src/State/ResourceState.ts +5 -0
- package/src/State/State.ts +17 -2
- package/src/State/index.ts +1 -0
- package/src/Test/Core.ts +4 -3
- package/src/Util/effect.ts +4 -4
- package/src/Util/hash.ts +14 -0
- package/src/Util/ignore.ts +815 -0
- package/src/index.ts +6 -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/Neon/api.ts
DELETED
|
@@ -1,579 +0,0 @@
|
|
|
1
|
-
import * as Data from "effect/Data";
|
|
2
|
-
import * as Duration from "effect/Duration";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Redacted from "effect/Redacted";
|
|
5
|
-
import * as Schedule from "effect/Schedule";
|
|
6
|
-
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
7
|
-
import * as HttpClientRequest from "effect/unstable/http/HttpClientRequest";
|
|
8
|
-
import type { HttpMethod } from "effect/unstable/http/HttpMethod";
|
|
9
|
-
import { Credentials } from "./Credentials.ts";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Direct HTTP client wrappers for Neon Console API endpoints.
|
|
13
|
-
*
|
|
14
|
-
* The generated `@distilled.cloud/neon` SDK doesn't expose typed input
|
|
15
|
-
* schemas for the `branch` / `endpoints` body fields on
|
|
16
|
-
* `createProjectBranch`, so we issue typed requests manually here while
|
|
17
|
-
* still reusing the SDK's `Credentials` service.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
export class NeonApiError extends Data.TaggedError("NeonApiError")<{
|
|
21
|
-
status: number;
|
|
22
|
-
method: string;
|
|
23
|
-
url: string;
|
|
24
|
-
message: string;
|
|
25
|
-
code?: string;
|
|
26
|
-
body?: unknown;
|
|
27
|
-
}> {}
|
|
28
|
-
|
|
29
|
-
export class ProjectNotFound extends Data.TaggedError("ProjectNotFound")<{
|
|
30
|
-
projectId?: string;
|
|
31
|
-
name?: string;
|
|
32
|
-
}> {}
|
|
33
|
-
|
|
34
|
-
export class BranchNotFound extends Data.TaggedError("BranchNotFound")<{
|
|
35
|
-
projectId: string;
|
|
36
|
-
branchId?: string;
|
|
37
|
-
name?: string;
|
|
38
|
-
}> {}
|
|
39
|
-
|
|
40
|
-
export type NeonOperationStatus =
|
|
41
|
-
| "scheduling"
|
|
42
|
-
| "running"
|
|
43
|
-
| "finished"
|
|
44
|
-
| "failed"
|
|
45
|
-
| "error"
|
|
46
|
-
| "cancelling"
|
|
47
|
-
| "cancelled"
|
|
48
|
-
| "skipped";
|
|
49
|
-
|
|
50
|
-
export interface NeonOperation {
|
|
51
|
-
id: string;
|
|
52
|
-
project_id: string;
|
|
53
|
-
branch_id?: string;
|
|
54
|
-
endpoint_id?: string;
|
|
55
|
-
action: string;
|
|
56
|
-
status: NeonOperationStatus;
|
|
57
|
-
error?: string;
|
|
58
|
-
failures_count: number;
|
|
59
|
-
retry_at?: string;
|
|
60
|
-
created_at: string;
|
|
61
|
-
updated_at: string;
|
|
62
|
-
total_duration_ms: number;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export interface NeonProjectInfo {
|
|
66
|
-
id: string;
|
|
67
|
-
name: string;
|
|
68
|
-
region_id: string;
|
|
69
|
-
pg_version: number;
|
|
70
|
-
proxy_host: string;
|
|
71
|
-
default_endpoint_settings?: Record<string, unknown>;
|
|
72
|
-
settings?: Record<string, unknown>;
|
|
73
|
-
history_retention_seconds: number;
|
|
74
|
-
created_at: string;
|
|
75
|
-
updated_at: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface NeonBranchInfo {
|
|
79
|
-
id: string;
|
|
80
|
-
project_id: string;
|
|
81
|
-
parent_id?: string;
|
|
82
|
-
parent_lsn?: string;
|
|
83
|
-
parent_timestamp?: string;
|
|
84
|
-
name: string;
|
|
85
|
-
current_state: string;
|
|
86
|
-
default: boolean;
|
|
87
|
-
protected: boolean;
|
|
88
|
-
created_at: string;
|
|
89
|
-
updated_at: string;
|
|
90
|
-
expires_at?: string;
|
|
91
|
-
init_source?: string;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export interface NeonEndpointInfo {
|
|
95
|
-
id: string;
|
|
96
|
-
host: string;
|
|
97
|
-
project_id: string;
|
|
98
|
-
branch_id: string;
|
|
99
|
-
type: "read_only" | "read_write";
|
|
100
|
-
current_state: string;
|
|
101
|
-
pooler_enabled: boolean;
|
|
102
|
-
pooler_mode?: string;
|
|
103
|
-
proxy_host: string;
|
|
104
|
-
created_at: string;
|
|
105
|
-
updated_at: string;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export interface NeonDatabaseInfo {
|
|
109
|
-
id: number;
|
|
110
|
-
branch_id: string;
|
|
111
|
-
name: string;
|
|
112
|
-
owner_name: string;
|
|
113
|
-
created_at: string;
|
|
114
|
-
updated_at: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface NeonRoleInfo {
|
|
118
|
-
branch_id: string;
|
|
119
|
-
name: string;
|
|
120
|
-
password?: string;
|
|
121
|
-
protected?: boolean;
|
|
122
|
-
created_at: string;
|
|
123
|
-
updated_at: string;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export interface NeonConnectionUriInfo {
|
|
127
|
-
connection_uri: string;
|
|
128
|
-
connection_parameters: {
|
|
129
|
-
database: string;
|
|
130
|
-
password: string;
|
|
131
|
-
role: string;
|
|
132
|
-
host: string;
|
|
133
|
-
pooler_host: string;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export interface CreateProjectInput {
|
|
138
|
-
name?: string;
|
|
139
|
-
region_id?: string;
|
|
140
|
-
pg_version?: number;
|
|
141
|
-
default_branch_name?: string;
|
|
142
|
-
default_branch?: {
|
|
143
|
-
name?: string;
|
|
144
|
-
role_name?: string;
|
|
145
|
-
database_name?: string;
|
|
146
|
-
};
|
|
147
|
-
history_retention_seconds?: number;
|
|
148
|
-
org_id?: string;
|
|
149
|
-
settings?: Record<string, unknown>;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface CreateProjectOutput {
|
|
153
|
-
project: NeonProjectInfo;
|
|
154
|
-
branch: NeonBranchInfo;
|
|
155
|
-
endpoints: NeonEndpointInfo[];
|
|
156
|
-
databases: NeonDatabaseInfo[];
|
|
157
|
-
roles: NeonRoleInfo[];
|
|
158
|
-
connection_uris: NeonConnectionUriInfo[];
|
|
159
|
-
operations: NeonOperation[];
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface UpdateProjectInput {
|
|
163
|
-
name?: string;
|
|
164
|
-
history_retention_seconds?: number;
|
|
165
|
-
default_endpoint_settings?: Record<string, unknown>;
|
|
166
|
-
settings?: Record<string, unknown>;
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
export interface CreateBranchEndpoint {
|
|
170
|
-
type: "read_only" | "read_write";
|
|
171
|
-
autoscaling_limit_min_cu?: number;
|
|
172
|
-
autoscaling_limit_max_cu?: number;
|
|
173
|
-
suspend_timeout_seconds?: number;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export interface CreateBranchInput {
|
|
177
|
-
name?: string;
|
|
178
|
-
parent_id?: string;
|
|
179
|
-
parent_lsn?: string;
|
|
180
|
-
parent_timestamp?: string;
|
|
181
|
-
init_source?: "schema-only" | "parent-data";
|
|
182
|
-
protected?: boolean;
|
|
183
|
-
expires_at?: string;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export interface CreateBranchOutput {
|
|
187
|
-
branch: NeonBranchInfo;
|
|
188
|
-
endpoints: NeonEndpointInfo[];
|
|
189
|
-
databases: NeonDatabaseInfo[];
|
|
190
|
-
roles: NeonRoleInfo[];
|
|
191
|
-
connection_uris?: NeonConnectionUriInfo[];
|
|
192
|
-
operations: NeonOperation[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const request = <A>(
|
|
196
|
-
method: HttpMethod,
|
|
197
|
-
path: string,
|
|
198
|
-
body?: unknown,
|
|
199
|
-
): Effect.Effect<A, NeonApiError, Credentials | HttpClient.HttpClient> =>
|
|
200
|
-
Effect.gen(function* () {
|
|
201
|
-
const creds = yield* Credentials;
|
|
202
|
-
const client = yield* HttpClient.HttpClient;
|
|
203
|
-
const url = `${creds.apiBaseUrl}${path}`;
|
|
204
|
-
|
|
205
|
-
let req = HttpClientRequest.make(method)(url).pipe(
|
|
206
|
-
HttpClientRequest.setHeader(
|
|
207
|
-
"Authorization",
|
|
208
|
-
`Bearer ${Redacted.value(creds.apiKey)}`,
|
|
209
|
-
),
|
|
210
|
-
HttpClientRequest.setHeader("Accept", "application/json"),
|
|
211
|
-
);
|
|
212
|
-
if (body !== undefined) {
|
|
213
|
-
req = yield* HttpClientRequest.bodyJson(body)(req).pipe(
|
|
214
|
-
Effect.mapError(
|
|
215
|
-
(e) =>
|
|
216
|
-
new NeonApiError({
|
|
217
|
-
status: 0,
|
|
218
|
-
method,
|
|
219
|
-
url,
|
|
220
|
-
message: `Failed to serialize body: ${String(e)}`,
|
|
221
|
-
}),
|
|
222
|
-
),
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
const response = yield* client.execute(req).pipe(
|
|
226
|
-
Effect.scoped,
|
|
227
|
-
Effect.mapError(
|
|
228
|
-
(e) =>
|
|
229
|
-
new NeonApiError({
|
|
230
|
-
status: 0,
|
|
231
|
-
method,
|
|
232
|
-
url,
|
|
233
|
-
message: `Network error: ${String(e)}`,
|
|
234
|
-
}),
|
|
235
|
-
),
|
|
236
|
-
);
|
|
237
|
-
if (response.status === 204) {
|
|
238
|
-
return undefined as A;
|
|
239
|
-
}
|
|
240
|
-
const text = yield* response.text.pipe(
|
|
241
|
-
Effect.mapError(
|
|
242
|
-
(e) =>
|
|
243
|
-
new NeonApiError({
|
|
244
|
-
status: response.status,
|
|
245
|
-
method,
|
|
246
|
-
url,
|
|
247
|
-
message: `Failed to read response body: ${String(e)}`,
|
|
248
|
-
}),
|
|
249
|
-
),
|
|
250
|
-
);
|
|
251
|
-
let parsed: unknown;
|
|
252
|
-
try {
|
|
253
|
-
parsed = text.length > 0 ? JSON.parse(text) : undefined;
|
|
254
|
-
} catch {
|
|
255
|
-
parsed = text;
|
|
256
|
-
}
|
|
257
|
-
if (response.status >= 400) {
|
|
258
|
-
const message =
|
|
259
|
-
(typeof parsed === "object" &&
|
|
260
|
-
parsed != null &&
|
|
261
|
-
(parsed as { message?: string }).message) ||
|
|
262
|
-
`HTTP ${response.status}`;
|
|
263
|
-
const code =
|
|
264
|
-
typeof parsed === "object" && parsed != null
|
|
265
|
-
? (parsed as { code?: string }).code
|
|
266
|
-
: undefined;
|
|
267
|
-
return yield* new NeonApiError({
|
|
268
|
-
status: response.status,
|
|
269
|
-
method,
|
|
270
|
-
url,
|
|
271
|
-
message,
|
|
272
|
-
code,
|
|
273
|
-
body: parsed,
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
return parsed as A;
|
|
277
|
-
});
|
|
278
|
-
|
|
279
|
-
export const createProject = (input: CreateProjectInput) =>
|
|
280
|
-
request<CreateProjectOutput>("POST", "/projects", {
|
|
281
|
-
project: {
|
|
282
|
-
name: input.name,
|
|
283
|
-
region_id: input.region_id,
|
|
284
|
-
pg_version: input.pg_version,
|
|
285
|
-
branch:
|
|
286
|
-
input.default_branch ??
|
|
287
|
-
(input.default_branch_name
|
|
288
|
-
? { name: input.default_branch_name }
|
|
289
|
-
: undefined),
|
|
290
|
-
history_retention_seconds: input.history_retention_seconds,
|
|
291
|
-
org_id: input.org_id,
|
|
292
|
-
settings: input.settings,
|
|
293
|
-
},
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
export const getProject = (
|
|
297
|
-
projectId: string,
|
|
298
|
-
): Effect.Effect<
|
|
299
|
-
{ project: NeonProjectInfo },
|
|
300
|
-
NeonApiError | ProjectNotFound,
|
|
301
|
-
Credentials | HttpClient.HttpClient
|
|
302
|
-
> =>
|
|
303
|
-
request<{ project: NeonProjectInfo }>(
|
|
304
|
-
"GET",
|
|
305
|
-
`/projects/${encodeURIComponent(projectId)}`,
|
|
306
|
-
).pipe(
|
|
307
|
-
Effect.catchTag(
|
|
308
|
-
"NeonApiError",
|
|
309
|
-
(e): Effect.Effect<never, NeonApiError | ProjectNotFound> =>
|
|
310
|
-
e.status === 404
|
|
311
|
-
? Effect.fail(new ProjectNotFound({ projectId }))
|
|
312
|
-
: Effect.fail(e),
|
|
313
|
-
),
|
|
314
|
-
);
|
|
315
|
-
|
|
316
|
-
export const updateProject = (projectId: string, input: UpdateProjectInput) =>
|
|
317
|
-
request<{ project: NeonProjectInfo }>(
|
|
318
|
-
"PATCH",
|
|
319
|
-
`/projects/${encodeURIComponent(projectId)}`,
|
|
320
|
-
{ project: input },
|
|
321
|
-
);
|
|
322
|
-
|
|
323
|
-
export const deleteProject = (projectId: string) =>
|
|
324
|
-
request<{ project: NeonProjectInfo }>(
|
|
325
|
-
"DELETE",
|
|
326
|
-
`/projects/${encodeURIComponent(projectId)}`,
|
|
327
|
-
).pipe(
|
|
328
|
-
Effect.catchTag("NeonApiError", (e) =>
|
|
329
|
-
e.status === 404 ? Effect.void : Effect.fail(e),
|
|
330
|
-
),
|
|
331
|
-
);
|
|
332
|
-
|
|
333
|
-
export interface ListProjectsResult {
|
|
334
|
-
projects: NeonProjectInfo[];
|
|
335
|
-
pagination?: { next?: string };
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
export const listProjects = (
|
|
339
|
-
params: { search?: string; cursor?: string } = {},
|
|
340
|
-
) => {
|
|
341
|
-
const q = new URLSearchParams();
|
|
342
|
-
if (params.search) q.set("search", params.search);
|
|
343
|
-
if (params.cursor) q.set("cursor", params.cursor);
|
|
344
|
-
const qs = q.toString();
|
|
345
|
-
return request<ListProjectsResult>("GET", `/projects${qs ? `?${qs}` : ""}`);
|
|
346
|
-
};
|
|
347
|
-
|
|
348
|
-
export const findProjectByName = (name: string) =>
|
|
349
|
-
Effect.gen(function* () {
|
|
350
|
-
const matches: NeonProjectInfo[] = [];
|
|
351
|
-
let cursor: string | undefined;
|
|
352
|
-
do {
|
|
353
|
-
const page = yield* listProjects({ search: name, cursor });
|
|
354
|
-
for (const p of page.projects) {
|
|
355
|
-
if (p.name === name) matches.push(p);
|
|
356
|
-
}
|
|
357
|
-
cursor = page.pagination?.next;
|
|
358
|
-
} while (cursor);
|
|
359
|
-
return matches;
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
export const createProjectBranch = (
|
|
363
|
-
projectId: string,
|
|
364
|
-
input: CreateBranchInput & { endpoints?: CreateBranchEndpoint[] },
|
|
365
|
-
) =>
|
|
366
|
-
request<CreateBranchOutput>(
|
|
367
|
-
"POST",
|
|
368
|
-
`/projects/${encodeURIComponent(projectId)}/branches`,
|
|
369
|
-
{
|
|
370
|
-
branch: {
|
|
371
|
-
name: input.name,
|
|
372
|
-
parent_id: input.parent_id,
|
|
373
|
-
parent_lsn: input.parent_lsn,
|
|
374
|
-
parent_timestamp: input.parent_timestamp,
|
|
375
|
-
init_source: input.init_source,
|
|
376
|
-
protected: input.protected,
|
|
377
|
-
expires_at: input.expires_at,
|
|
378
|
-
},
|
|
379
|
-
endpoints: input.endpoints ?? [],
|
|
380
|
-
},
|
|
381
|
-
);
|
|
382
|
-
|
|
383
|
-
export const getProjectBranch = (
|
|
384
|
-
projectId: string,
|
|
385
|
-
branchId: string,
|
|
386
|
-
): Effect.Effect<
|
|
387
|
-
{ branch: NeonBranchInfo },
|
|
388
|
-
NeonApiError | BranchNotFound,
|
|
389
|
-
Credentials | HttpClient.HttpClient
|
|
390
|
-
> =>
|
|
391
|
-
request<{ branch: NeonBranchInfo }>(
|
|
392
|
-
"GET",
|
|
393
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}`,
|
|
394
|
-
).pipe(
|
|
395
|
-
Effect.catchTag(
|
|
396
|
-
"NeonApiError",
|
|
397
|
-
(e): Effect.Effect<never, NeonApiError | BranchNotFound> =>
|
|
398
|
-
e.status === 404
|
|
399
|
-
? Effect.fail(new BranchNotFound({ projectId, branchId }))
|
|
400
|
-
: Effect.fail(e),
|
|
401
|
-
),
|
|
402
|
-
);
|
|
403
|
-
|
|
404
|
-
export const updateProjectBranch = (
|
|
405
|
-
projectId: string,
|
|
406
|
-
branchId: string,
|
|
407
|
-
input: { name?: string; protected?: boolean; expires_at?: string | null },
|
|
408
|
-
) =>
|
|
409
|
-
request<{ branch: NeonBranchInfo }>(
|
|
410
|
-
"PATCH",
|
|
411
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}`,
|
|
412
|
-
{ branch: input },
|
|
413
|
-
);
|
|
414
|
-
|
|
415
|
-
export const deleteProjectBranch = (projectId: string, branchId: string) =>
|
|
416
|
-
request<{ branch: NeonBranchInfo }>(
|
|
417
|
-
"DELETE",
|
|
418
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}`,
|
|
419
|
-
).pipe(
|
|
420
|
-
Effect.catchTag("NeonApiError", (e) =>
|
|
421
|
-
e.status === 404 ? Effect.void : Effect.fail(e),
|
|
422
|
-
),
|
|
423
|
-
);
|
|
424
|
-
|
|
425
|
-
export interface ListBranchesResult {
|
|
426
|
-
branches: NeonBranchInfo[];
|
|
427
|
-
pagination?: { next?: string };
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export const listProjectBranches = (
|
|
431
|
-
projectId: string,
|
|
432
|
-
params: { search?: string; cursor?: string } = {},
|
|
433
|
-
) => {
|
|
434
|
-
const q = new URLSearchParams();
|
|
435
|
-
if (params.search) q.set("search", params.search);
|
|
436
|
-
if (params.cursor) q.set("cursor", params.cursor);
|
|
437
|
-
const qs = q.toString();
|
|
438
|
-
return request<ListBranchesResult>(
|
|
439
|
-
"GET",
|
|
440
|
-
`/projects/${encodeURIComponent(projectId)}/branches${qs ? `?${qs}` : ""}`,
|
|
441
|
-
);
|
|
442
|
-
};
|
|
443
|
-
|
|
444
|
-
export const findBranchByName = (projectId: string, name: string) =>
|
|
445
|
-
Effect.gen(function* () {
|
|
446
|
-
const matches: NeonBranchInfo[] = [];
|
|
447
|
-
let cursor: string | undefined;
|
|
448
|
-
do {
|
|
449
|
-
const page = yield* listProjectBranches(projectId, {
|
|
450
|
-
search: name,
|
|
451
|
-
cursor,
|
|
452
|
-
});
|
|
453
|
-
for (const b of page.branches) {
|
|
454
|
-
if (b.name === name) matches.push(b);
|
|
455
|
-
}
|
|
456
|
-
cursor = page.pagination?.next;
|
|
457
|
-
} while (cursor);
|
|
458
|
-
return matches;
|
|
459
|
-
});
|
|
460
|
-
|
|
461
|
-
export const listProjectBranchEndpoints = (
|
|
462
|
-
projectId: string,
|
|
463
|
-
branchId: string,
|
|
464
|
-
) =>
|
|
465
|
-
request<{ endpoints: NeonEndpointInfo[] }>(
|
|
466
|
-
"GET",
|
|
467
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}/endpoints`,
|
|
468
|
-
);
|
|
469
|
-
|
|
470
|
-
export const listProjectBranchDatabases = (
|
|
471
|
-
projectId: string,
|
|
472
|
-
branchId: string,
|
|
473
|
-
) =>
|
|
474
|
-
request<{ databases: NeonDatabaseInfo[] }>(
|
|
475
|
-
"GET",
|
|
476
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}/databases`,
|
|
477
|
-
);
|
|
478
|
-
|
|
479
|
-
export const listProjectBranchRoles = (projectId: string, branchId: string) =>
|
|
480
|
-
request<{ roles: NeonRoleInfo[] }>(
|
|
481
|
-
"GET",
|
|
482
|
-
`/projects/${encodeURIComponent(projectId)}/branches/${encodeURIComponent(branchId)}/roles`,
|
|
483
|
-
);
|
|
484
|
-
|
|
485
|
-
export const getConnectionUri = (
|
|
486
|
-
projectId: string,
|
|
487
|
-
params: {
|
|
488
|
-
branch_id: string;
|
|
489
|
-
database_name: string;
|
|
490
|
-
role_name: string;
|
|
491
|
-
pooled?: boolean;
|
|
492
|
-
},
|
|
493
|
-
) => {
|
|
494
|
-
const q = new URLSearchParams();
|
|
495
|
-
q.set("branch_id", params.branch_id);
|
|
496
|
-
q.set("database_name", params.database_name);
|
|
497
|
-
q.set("role_name", params.role_name);
|
|
498
|
-
if (params.pooled !== undefined) q.set("pooled", String(params.pooled));
|
|
499
|
-
return request<{ uri: string }>(
|
|
500
|
-
"GET",
|
|
501
|
-
`/projects/${encodeURIComponent(projectId)}/connection_uri?${q.toString()}`,
|
|
502
|
-
);
|
|
503
|
-
};
|
|
504
|
-
|
|
505
|
-
export const getProjectOperation = (projectId: string, operationId: string) =>
|
|
506
|
-
request<{ operation: NeonOperation }>(
|
|
507
|
-
"GET",
|
|
508
|
-
`/projects/${encodeURIComponent(projectId)}/operations/${encodeURIComponent(operationId)}`,
|
|
509
|
-
);
|
|
510
|
-
|
|
511
|
-
const isOperationComplete = (op: NeonOperation): boolean =>
|
|
512
|
-
["finished", "failed", "error", "cancelled", "skipped"].includes(op.status);
|
|
513
|
-
|
|
514
|
-
export class OperationFailed extends Data.TaggedError("OperationFailed")<{
|
|
515
|
-
operationId: string;
|
|
516
|
-
action: string;
|
|
517
|
-
status: NeonOperationStatus;
|
|
518
|
-
error?: string;
|
|
519
|
-
}> {}
|
|
520
|
-
|
|
521
|
-
class OperationPending extends Data.TaggedError("OperationPending")<{
|
|
522
|
-
operationId: string;
|
|
523
|
-
}> {}
|
|
524
|
-
|
|
525
|
-
/**
|
|
526
|
-
* Wait for the given operations to reach a terminal state. Polls every
|
|
527
|
-
* 500ms with exponential backoff up to ~30s per operation.
|
|
528
|
-
*/
|
|
529
|
-
export const waitForOperations = (operations: ReadonlyArray<NeonOperation>) =>
|
|
530
|
-
Effect.gen(function* () {
|
|
531
|
-
for (const op of operations) {
|
|
532
|
-
if (isOperationComplete(op)) {
|
|
533
|
-
if (op.status === "failed" || op.status === "error") {
|
|
534
|
-
return yield* new OperationFailed({
|
|
535
|
-
operationId: op.id,
|
|
536
|
-
action: op.action,
|
|
537
|
-
status: op.status,
|
|
538
|
-
error: op.error,
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
continue;
|
|
542
|
-
}
|
|
543
|
-
yield* getProjectOperation(op.project_id, op.id).pipe(
|
|
544
|
-
Effect.flatMap(
|
|
545
|
-
({
|
|
546
|
-
operation,
|
|
547
|
-
}): Effect.Effect<void, OperationFailed | OperationPending> => {
|
|
548
|
-
if (operation.status === "failed" || operation.status === "error") {
|
|
549
|
-
return Effect.fail(
|
|
550
|
-
new OperationFailed({
|
|
551
|
-
operationId: operation.id,
|
|
552
|
-
action: operation.action,
|
|
553
|
-
status: operation.status,
|
|
554
|
-
error: operation.error,
|
|
555
|
-
}),
|
|
556
|
-
);
|
|
557
|
-
}
|
|
558
|
-
if (!isOperationComplete(operation)) {
|
|
559
|
-
return Effect.fail(new OperationPending({ operationId: op.id }));
|
|
560
|
-
}
|
|
561
|
-
return Effect.void;
|
|
562
|
-
},
|
|
563
|
-
),
|
|
564
|
-
Effect.retry({
|
|
565
|
-
while: (e: unknown) =>
|
|
566
|
-
(e as { _tag?: string })._tag === "OperationPending" ||
|
|
567
|
-
(e as { _tag?: string })._tag === "NeonApiError",
|
|
568
|
-
schedule: Schedule.both(
|
|
569
|
-
Schedule.exponential(Duration.millis(500), 1.5),
|
|
570
|
-
Schedule.recurs(60),
|
|
571
|
-
),
|
|
572
|
-
}),
|
|
573
|
-
Effect.catchTag("OperationPending", () => Effect.void),
|
|
574
|
-
Effect.catchTag("NeonApiError", (e) =>
|
|
575
|
-
Effect.die(`Failed to poll Neon operation: ${e.message}`),
|
|
576
|
-
),
|
|
577
|
-
);
|
|
578
|
-
}
|
|
579
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|