alchemy 2.0.0-beta.61 → 2.0.0-beta.62
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/README.md +15 -0
- package/bin/exec.js +71 -12
- package/bin/exec.js.map +1 -1
- package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
- package/lib/AWS/ACM/Certificate.js +16 -4
- package/lib/AWS/ACM/Certificate.js.map +1 -1
- package/lib/AWS/ApiGateway/common.d.ts.map +1 -1
- package/lib/AWS/ApiGateway/common.js +6 -3
- package/lib/AWS/ApiGateway/common.js.map +1 -1
- package/lib/AWS/AuthProvider.d.ts.map +1 -1
- package/lib/AWS/AuthProvider.js +1 -1
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/AutoScaling/AutoScalingGroup.d.ts.map +1 -1
- package/lib/AWS/AutoScaling/AutoScalingGroup.js +8 -2
- package/lib/AWS/AutoScaling/AutoScalingGroup.js.map +1 -1
- package/lib/AWS/Bootstrap.d.ts.map +1 -1
- package/lib/AWS/Bootstrap.js +5 -2
- package/lib/AWS/Bootstrap.js.map +1 -1
- package/lib/AWS/CloudFront/Distribution.d.ts.map +1 -1
- package/lib/AWS/CloudFront/Distribution.js +20 -5
- package/lib/AWS/CloudFront/Distribution.js.map +1 -1
- package/lib/AWS/CloudFront/Function.js +5 -2
- package/lib/AWS/CloudFront/Function.js.map +1 -1
- package/lib/AWS/CloudFront/Invalidation.d.ts.map +1 -1
- package/lib/AWS/CloudFront/Invalidation.js +4 -1
- package/lib/AWS/CloudFront/Invalidation.js.map +1 -1
- package/lib/AWS/CloudFront/KvEntries.d.ts.map +1 -1
- package/lib/AWS/CloudFront/KvEntries.js +4 -1
- package/lib/AWS/CloudFront/KvEntries.js.map +1 -1
- package/lib/AWS/CloudFront/KvRoutesUpdate.d.ts.map +1 -1
- package/lib/AWS/CloudFront/KvRoutesUpdate.js +8 -2
- package/lib/AWS/CloudFront/KvRoutesUpdate.js.map +1 -1
- package/lib/AWS/CloudFront/VpcOrigin.d.ts.map +1 -1
- package/lib/AWS/CloudFront/VpcOrigin.js +12 -3
- package/lib/AWS/CloudFront/VpcOrigin.js.map +1 -1
- package/lib/AWS/CloudFront/common.d.ts.map +1 -1
- package/lib/AWS/CloudFront/common.js +5 -2
- package/lib/AWS/CloudFront/common.js.map +1 -1
- package/lib/AWS/CloudWatch/AnomalyDetector.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/AnomalyDetector.js +4 -1
- package/lib/AWS/CloudWatch/AnomalyDetector.js.map +1 -1
- package/lib/AWS/CloudWatch/common.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/common.js +1 -1
- package/lib/AWS/CloudWatch/common.js.map +1 -1
- package/lib/AWS/DynamoDB/Table.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Table.js +53 -20
- package/lib/AWS/DynamoDB/Table.js.map +1 -1
- package/lib/AWS/EC2/EIP.d.ts.map +1 -1
- package/lib/AWS/EC2/EIP.js +4 -1
- package/lib/AWS/EC2/EIP.js.map +1 -1
- package/lib/AWS/EC2/EgressOnlyInternetGateway.d.ts.map +1 -1
- package/lib/AWS/EC2/EgressOnlyInternetGateway.js +4 -2
- package/lib/AWS/EC2/EgressOnlyInternetGateway.js.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts.map +1 -1
- package/lib/AWS/EC2/Instance.js +12 -3
- package/lib/AWS/EC2/Instance.js.map +1 -1
- package/lib/AWS/EC2/InternetGateway.d.ts.map +1 -1
- package/lib/AWS/EC2/InternetGateway.js +12 -5
- package/lib/AWS/EC2/InternetGateway.js.map +1 -1
- package/lib/AWS/EC2/NatGateway.js +2 -4
- package/lib/AWS/EC2/NatGateway.js.map +1 -1
- package/lib/AWS/EC2/NetworkAcl.d.ts.map +1 -1
- package/lib/AWS/EC2/NetworkAcl.js +4 -1
- package/lib/AWS/EC2/NetworkAcl.js.map +1 -1
- package/lib/AWS/EC2/NetworkAclEntry.d.ts.map +1 -1
- package/lib/AWS/EC2/NetworkAclEntry.js +4 -1
- package/lib/AWS/EC2/NetworkAclEntry.js.map +1 -1
- package/lib/AWS/EC2/RouteTable.d.ts.map +1 -1
- package/lib/AWS/EC2/RouteTable.js +8 -6
- package/lib/AWS/EC2/RouteTable.js.map +1 -1
- package/lib/AWS/EC2/RouteTableAssociation.js +2 -5
- package/lib/AWS/EC2/RouteTableAssociation.js.map +1 -1
- package/lib/AWS/EC2/SecurityGroup.d.ts.map +1 -1
- package/lib/AWS/EC2/SecurityGroup.js +8 -3
- package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
- package/lib/AWS/EC2/Subnet.d.ts.map +1 -1
- package/lib/AWS/EC2/Subnet.js +10 -6
- package/lib/AWS/EC2/Subnet.js.map +1 -1
- package/lib/AWS/EC2/Vpc.d.ts.map +1 -1
- package/lib/AWS/EC2/Vpc.js +7 -7
- package/lib/AWS/EC2/Vpc.js.map +1 -1
- package/lib/AWS/EC2/VpcEndpoint.js +2 -4
- package/lib/AWS/EC2/VpcEndpoint.js.map +1 -1
- package/lib/AWS/ECS/Service.d.ts.map +1 -1
- package/lib/AWS/ECS/Service.js +4 -1
- package/lib/AWS/ECS/Service.js.map +1 -1
- package/lib/AWS/EKS/Addon.js +8 -2
- package/lib/AWS/EKS/Addon.js.map +1 -1
- package/lib/AWS/EKS/Cluster.d.ts.map +1 -1
- package/lib/AWS/EKS/Cluster.js +4 -1
- package/lib/AWS/EKS/Cluster.js.map +1 -1
- package/lib/AWS/ELBv2/TargetGroup.d.ts.map +1 -1
- package/lib/AWS/ELBv2/TargetGroup.js +4 -1
- package/lib/AWS/ELBv2/TargetGroup.js.map +1 -1
- package/lib/AWS/ELBv2/TrustStore.d.ts.map +1 -1
- package/lib/AWS/ELBv2/TrustStore.js +4 -1
- package/lib/AWS/ELBv2/TrustStore.js.map +1 -1
- package/lib/AWS/IAM/SAMLProvider.js +4 -1
- package/lib/AWS/IAM/SAMLProvider.js.map +1 -1
- package/lib/AWS/IdentityCenter/AccountAssignment.js +8 -2
- package/lib/AWS/IdentityCenter/AccountAssignment.js.map +1 -1
- package/lib/AWS/IdentityCenter/common.d.ts.map +1 -1
- package/lib/AWS/IdentityCenter/common.js +1 -1
- package/lib/AWS/IdentityCenter/common.js.map +1 -1
- package/lib/AWS/KMS/Alias.js +4 -1
- package/lib/AWS/KMS/Alias.js.map +1 -1
- package/lib/AWS/KMS/Key.js +4 -1
- package/lib/AWS/KMS/Key.js.map +1 -1
- package/lib/AWS/Kinesis/Stream.d.ts.map +1 -1
- package/lib/AWS/Kinesis/Stream.js +2 -2
- package/lib/AWS/Kinesis/Stream.js.map +1 -1
- package/lib/AWS/Kinesis/StreamConsumer.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamConsumer.js +7 -4
- package/lib/AWS/Kinesis/StreamConsumer.js.map +1 -1
- package/lib/AWS/Lambda/Alias.d.ts.map +1 -1
- package/lib/AWS/Lambda/Alias.js +4 -1
- package/lib/AWS/Lambda/Alias.js.map +1 -1
- package/lib/AWS/Lambda/EventInvokeConfig.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventInvokeConfig.js +2 -2
- package/lib/AWS/Lambda/EventInvokeConfig.js.map +1 -1
- package/lib/AWS/Lambda/EventSourceMapping.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventSourceMapping.js +10 -4
- package/lib/AWS/Lambda/EventSourceMapping.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +16 -1
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +101 -26
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/MicrovmProvider.d.ts.map +1 -1
- package/lib/AWS/Lambda/MicrovmProvider.js +13 -5
- package/lib/AWS/Lambda/MicrovmProvider.js.map +1 -1
- package/lib/AWS/Lambda/NetworkConnector.js +13 -5
- package/lib/AWS/Lambda/NetworkConnector.js.map +1 -1
- package/lib/AWS/Lambda/RuntimeExtension.d.ts +27 -0
- package/lib/AWS/Lambda/RuntimeExtension.d.ts.map +1 -0
- package/lib/AWS/Lambda/RuntimeExtension.js +49 -0
- package/lib/AWS/Lambda/RuntimeExtension.js.map +1 -0
- package/lib/AWS/Organizations/Account.js +5 -2
- package/lib/AWS/Organizations/Account.js.map +1 -1
- package/lib/AWS/Organizations/common.d.ts.map +1 -1
- package/lib/AWS/Organizations/common.js +1 -1
- package/lib/AWS/Organizations/common.js.map +1 -1
- package/lib/AWS/Providers.js +14 -12
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/RDS/DBCluster.d.ts.map +1 -1
- package/lib/AWS/RDS/DBCluster.js +8 -2
- package/lib/AWS/RDS/DBCluster.js.map +1 -1
- package/lib/AWS/RDS/DBInstance.d.ts.map +1 -1
- package/lib/AWS/RDS/DBInstance.js +8 -2
- package/lib/AWS/RDS/DBInstance.js.map +1 -1
- package/lib/AWS/RDS/DBProxy.d.ts.map +1 -1
- package/lib/AWS/RDS/DBProxy.js +4 -1
- package/lib/AWS/RDS/DBProxy.js.map +1 -1
- package/lib/AWS/RDS/DBProxyEndpoint.d.ts.map +1 -1
- package/lib/AWS/RDS/DBProxyEndpoint.js +4 -1
- package/lib/AWS/RDS/DBProxyEndpoint.js.map +1 -1
- package/lib/AWS/Route53/HealthCheck.d.ts.map +1 -1
- package/lib/AWS/Route53/HealthCheck.js +8 -2
- package/lib/AWS/Route53/HealthCheck.js.map +1 -1
- package/lib/AWS/Route53/HostedZone.d.ts.map +1 -1
- package/lib/AWS/Route53/HostedZone.js +8 -2
- package/lib/AWS/Route53/HostedZone.js.map +1 -1
- package/lib/AWS/Route53/Record.d.ts.map +1 -1
- package/lib/AWS/Route53/Record.js +4 -1
- package/lib/AWS/Route53/Record.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/SQS/Queue.d.ts.map +1 -1
- package/lib/AWS/SQS/Queue.js +25 -7
- package/lib/AWS/SQS/Queue.js.map +1 -1
- package/lib/AWS/StateStore/State.js +5 -2
- package/lib/AWS/StateStore/State.js.map +1 -1
- package/lib/AWS/Website/AssetDeployment.js +5 -2
- package/lib/AWS/Website/AssetDeployment.js.map +1 -1
- package/lib/Apply.js +8 -0
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +10 -0
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +10 -0
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Axiom/AuthProvider.d.ts.map +1 -1
- package/lib/Axiom/AuthProvider.js +1 -1
- package/lib/Axiom/AuthProvider.js.map +1 -1
- package/lib/Bundle/Vite.d.ts +1 -1
- package/lib/Bundle/Vite.d.ts.map +1 -1
- package/lib/Bundle/Vite.js +14 -12
- package/lib/Bundle/Vite.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +55 -5
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +62 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +9 -20
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +1 -0
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +15 -24
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +23 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +47 -10
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cli/commands/tail.d.ts.map +1 -1
- package/lib/Cli/commands/tail.js +1 -0
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cloudflare/AI/GatewayDynamicRouting.d.ts.map +1 -1
- package/lib/Cloudflare/AI/GatewayDynamicRouting.js +31 -2
- package/lib/Cloudflare/AI/GatewayDynamicRouting.js.map +1 -1
- package/lib/Cloudflare/AI/SearchInstance.js +4 -1
- package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
- package/lib/Cloudflare/Access/Application.d.ts.map +1 -1
- package/lib/Cloudflare/Access/Application.js +7 -1
- package/lib/Cloudflare/Access/Application.js.map +1 -1
- package/lib/Cloudflare/Alerting/Silence.d.ts.map +1 -1
- package/lib/Cloudflare/Alerting/Silence.js +4 -1
- package/lib/Cloudflare/Alerting/Silence.js.map +1 -1
- package/lib/Cloudflare/Alerting/Webhook.d.ts.map +1 -1
- package/lib/Cloudflare/Alerting/Webhook.js +8 -2
- package/lib/Cloudflare/Alerting/Webhook.js.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +22 -7
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.js +6 -7
- package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.d.ts.map +1 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.js +7 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts +18 -2
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.js +1 -0
- package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.d.ts +29 -3
- package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.js +73 -22
- package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerProvider.js +53 -14
- package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
- package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts +6 -6
- package/lib/Cloudflare/Containers/LocalContainerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/LocalContainerProvider.js +69 -47
- package/lib/Cloudflare/Containers/LocalContainerProvider.js.map +1 -1
- package/lib/Cloudflare/Diagnostics/EndpointHealthcheck.js +4 -1
- package/lib/Cloudflare/Diagnostics/EndpointHealthcheck.js.map +1 -1
- package/lib/Cloudflare/Images/Variant.d.ts.map +1 -1
- package/lib/Cloudflare/Images/Variant.js +4 -1
- package/lib/Cloudflare/Images/Variant.js.map +1 -1
- package/lib/Cloudflare/LoadBalancer/Monitor.d.ts.map +1 -1
- package/lib/Cloudflare/LoadBalancer/Monitor.js +4 -1
- package/lib/Cloudflare/LoadBalancer/Monitor.js.map +1 -1
- package/lib/Cloudflare/LoadBalancer/MonitorGroup.d.ts.map +1 -1
- package/lib/Cloudflare/LoadBalancer/MonitorGroup.js +4 -1
- package/lib/Cloudflare/LoadBalancer/MonitorGroup.js.map +1 -1
- package/lib/Cloudflare/LoadBalancer/Pool.d.ts.map +1 -1
- package/lib/Cloudflare/LoadBalancer/Pool.js +4 -1
- package/lib/Cloudflare/LoadBalancer/Pool.js.map +1 -1
- package/lib/Cloudflare/LocalRuntime.d.ts +14 -0
- package/lib/Cloudflare/LocalRuntime.d.ts.map +1 -1
- package/lib/Cloudflare/LocalRuntime.js +1 -0
- package/lib/Cloudflare/LocalRuntime.js.map +1 -1
- package/lib/Cloudflare/MagicNetworkMonitoring/Rule.d.ts.map +1 -1
- package/lib/Cloudflare/MagicNetworkMonitoring/Rule.js +4 -1
- package/lib/Cloudflare/MagicNetworkMonitoring/Rule.js.map +1 -1
- package/lib/Cloudflare/Pipelines/Pipeline.d.ts.map +1 -1
- package/lib/Cloudflare/Pipelines/Pipeline.js +8 -2
- package/lib/Cloudflare/Pipelines/Pipeline.js.map +1 -1
- package/lib/Cloudflare/Pipelines/Sink.d.ts.map +1 -1
- package/lib/Cloudflare/Pipelines/Sink.js +8 -2
- package/lib/Cloudflare/Pipelines/Sink.js.map +1 -1
- package/lib/Cloudflare/Pipelines/Stream.d.ts.map +1 -1
- package/lib/Cloudflare/Pipelines/Stream.js +4 -1
- package/lib/Cloudflare/Pipelines/Stream.js.map +1 -1
- package/lib/Cloudflare/Providers.js +14 -11
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.js +30 -3
- package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
- package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Queue.js +4 -1
- package/lib/Cloudflare/Queues/Queue.js.map +1 -1
- package/lib/Cloudflare/R2/Bucket.js +12 -3
- package/lib/Cloudflare/R2/Bucket.js.map +1 -1
- package/lib/Cloudflare/R2/BucketEventNotification.js +4 -1
- package/lib/Cloudflare/R2/BucketEventNotification.js.map +1 -1
- package/lib/Cloudflare/R2/DataCatalog.js +4 -1
- package/lib/Cloudflare/R2/DataCatalog.js.map +1 -1
- package/lib/Cloudflare/Rum/Rule.d.ts.map +1 -1
- package/lib/Cloudflare/Rum/Rule.js +4 -1
- package/lib/Cloudflare/Rum/Rule.js.map +1 -1
- package/lib/Cloudflare/Snippets/Snippet.d.ts.map +1 -1
- package/lib/Cloudflare/Snippets/Snippet.js +4 -1
- package/lib/Cloudflare/Snippets/Snippet.js.map +1 -1
- package/lib/Cloudflare/StateStore/CredentialsFile.d.ts +42 -0
- package/lib/Cloudflare/StateStore/CredentialsFile.d.ts.map +1 -0
- package/lib/Cloudflare/StateStore/CredentialsFile.js +23 -0
- package/lib/Cloudflare/StateStore/CredentialsFile.js.map +1 -0
- package/lib/Cloudflare/StateStore/State.d.ts +2 -2
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +46 -9
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/Tags/ZoneResourceTags.d.ts.map +1 -1
- package/lib/Cloudflare/Tags/ZoneResourceTags.js +4 -1
- package/lib/Cloudflare/Tags/ZoneResourceTags.js.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +7 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
- package/lib/Cloudflare/WaitingRoom/Settings.d.ts.map +1 -1
- package/lib/Cloudflare/WaitingRoom/Settings.js +7 -1
- package/lib/Cloudflare/WaitingRoom/Settings.js.map +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts +19 -0
- package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Vite.js +20 -0
- package/lib/Cloudflare/Website/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Compatibility.js +43 -7
- package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +3 -2
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +86 -82
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.d.ts +1 -4
- package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +1 -3
- package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +74 -11
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/ObservabilityDestination.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/ObservabilityDestination.js +4 -1
- package/lib/Cloudflare/Workers/ObservabilityDestination.js.map +1 -1
- package/lib/Cloudflare/Workers/Vite.d.ts +1 -1
- package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +27 -5
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +10 -5
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +24 -15
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts +13 -5
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +126 -50
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.js +26 -7
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/cloudflare_workers.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/cloudflare_workers.js +10 -3
- package/lib/Cloudflare/Workers/cloudflare_workers.js.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.d.ts +10 -7
- package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.js +38 -13
- package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.js +39 -37
- package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowName.d.ts +11 -0
- package/lib/Cloudflare/Workflows/WorkflowName.d.ts.map +1 -0
- package/lib/Cloudflare/Workflows/WorkflowName.js +28 -0
- package/lib/Cloudflare/Workflows/WorkflowName.js.map +1 -0
- package/lib/Cloudflare/Zone/Hold.d.ts.map +1 -1
- package/lib/Cloudflare/Zone/Hold.js +7 -1
- package/lib/Cloudflare/Zone/Hold.js.map +1 -1
- package/lib/Command/Dev.d.ts +16 -6
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +37 -7
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Docker/Container.js +4 -1
- package/lib/Docker/Container.js.map +1 -1
- package/lib/Drizzle/Postgres.d.ts +14 -13
- package/lib/Drizzle/Postgres.d.ts.map +1 -1
- package/lib/Drizzle/Postgres.js +39 -19
- package/lib/Drizzle/Postgres.js.map +1 -1
- package/lib/GitHub/AuthProvider.d.ts.map +1 -1
- package/lib/GitHub/AuthProvider.js +1 -1
- package/lib/GitHub/AuthProvider.js.map +1 -1
- package/lib/GitHub/Env.d.ts +20 -0
- package/lib/GitHub/Env.d.ts.map +1 -0
- package/lib/GitHub/Env.js +27 -0
- package/lib/GitHub/Env.js.map +1 -0
- package/lib/GitHub/index.d.ts +1 -0
- package/lib/GitHub/index.d.ts.map +1 -1
- package/lib/GitHub/index.js +1 -0
- package/lib/GitHub/index.js.map +1 -1
- package/lib/Http.d.ts +9 -0
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js +9 -0
- package/lib/Http.js.map +1 -1
- package/lib/Local/RpcProviderProxy.js +1 -1
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Neon/AuthProvider.d.ts.map +1 -1
- package/lib/Neon/AuthProvider.js +1 -1
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Neon/Project.js +4 -1
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +28 -11
- package/lib/Plan.js.map +1 -1
- package/lib/Planetscale/AuthProvider.d.ts +26 -9
- package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
- package/lib/Planetscale/AuthProvider.js +142 -11
- package/lib/Planetscale/AuthProvider.js.map +1 -1
- package/lib/Planetscale/Branch.d.ts.map +1 -1
- package/lib/Planetscale/Branch.js +4 -1
- package/lib/Planetscale/Branch.js.map +1 -1
- package/lib/Planetscale/Credentials.d.ts.map +1 -1
- package/lib/Planetscale/Credentials.js +14 -6
- package/lib/Planetscale/Credentials.js.map +1 -1
- package/lib/Planetscale/MySQL/MySQLMigrations.js +4 -1
- package/lib/Planetscale/MySQL/MySQLMigrations.js.map +1 -1
- package/lib/Planetscale/OAuthClient.d.ts +72 -0
- package/lib/Planetscale/OAuthClient.d.ts.map +1 -0
- package/lib/Planetscale/OAuthClient.js +227 -0
- package/lib/Planetscale/OAuthClient.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts.map +1 -1
- package/lib/Planetscale/Postgres/PostgresClusterSize.js +4 -1
- package/lib/Planetscale/Postgres/PostgresClusterSize.js.map +1 -1
- package/lib/Planetscale/Postgres/PostgresMigrations.js +4 -1
- package/lib/Planetscale/Postgres/PostgresMigrations.js.map +1 -1
- package/lib/Planetscale/Util.d.ts.map +1 -1
- package/lib/Planetscale/Util.js +4 -1
- package/lib/Planetscale/Util.js.map +1 -1
- package/lib/Platform.d.ts +2 -3
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +52 -3
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +35 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +8 -8
- package/lib/State/HttpStateStore.js +5 -2
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/Sync.d.ts.map +1 -1
- package/lib/Sync.js +3 -0
- package/lib/Sync.js.map +1 -1
- package/lib/Test/Http.d.ts.map +1 -1
- package/lib/Test/Http.js +8 -2
- package/lib/Test/Http.js.map +1 -1
- package/lib/Util/data.d.ts +6 -1
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/poll.js +1 -1
- package/lib/Util/poll.js.map +1 -1
- package/package.json +20 -20
- package/src/AWS/ACM/Certificate.ts +16 -12
- package/src/AWS/ApiGateway/common.ts +11 -8
- package/src/AWS/AuthProvider.ts +0 -3
- package/src/AWS/AutoScaling/AutoScalingGroup.ts +8 -6
- package/src/AWS/Bootstrap.ts +5 -6
- package/src/AWS/CloudFront/Distribution.ts +20 -16
- package/src/AWS/CloudFront/Function.ts +10 -6
- package/src/AWS/CloudFront/Invalidation.ts +4 -3
- package/src/AWS/CloudFront/KvEntries.ts +4 -3
- package/src/AWS/CloudFront/KvRoutesUpdate.ts +8 -6
- package/src/AWS/CloudFront/VpcOrigin.ts +12 -9
- package/src/AWS/CloudFront/common.ts +10 -6
- package/src/AWS/CloudWatch/AnomalyDetector.ts +4 -3
- package/src/AWS/CloudWatch/common.ts +1 -3
- package/src/AWS/DynamoDB/Table.ts +57 -47
- package/src/AWS/EC2/EIP.ts +6 -4
- package/src/AWS/EC2/EgressOnlyInternetGateway.ts +6 -4
- package/src/AWS/EC2/Instance.ts +12 -9
- package/src/AWS/EC2/InternetGateway.ts +18 -12
- package/src/AWS/EC2/NatGateway.ts +6 -10
- package/src/AWS/EC2/NetworkAcl.ts +6 -4
- package/src/AWS/EC2/NetworkAclEntry.ts +4 -3
- package/src/AWS/EC2/RouteTable.ts +12 -9
- package/src/AWS/EC2/RouteTableAssociation.ts +3 -5
- package/src/AWS/EC2/SecurityGroup.ts +10 -7
- package/src/AWS/EC2/Subnet.ts +15 -15
- package/src/AWS/EC2/Vpc.ts +12 -12
- package/src/AWS/EC2/VpcEndpoint.ts +6 -8
- package/src/AWS/ECS/Service.ts +4 -3
- package/src/AWS/EKS/Addon.ts +8 -6
- package/src/AWS/EKS/Cluster.ts +4 -3
- package/src/AWS/ELBv2/TargetGroup.ts +4 -3
- package/src/AWS/ELBv2/TrustStore.ts +4 -3
- package/src/AWS/IAM/SAMLProvider.ts +4 -4
- package/src/AWS/IdentityCenter/AccountAssignment.ts +8 -6
- package/src/AWS/IdentityCenter/common.ts +1 -3
- package/src/AWS/KMS/Alias.ts +4 -3
- package/src/AWS/KMS/Key.ts +4 -3
- package/src/AWS/Kinesis/Stream.ts +2 -6
- package/src/AWS/Kinesis/StreamConsumer.ts +7 -12
- package/src/AWS/Lambda/Alias.ts +4 -3
- package/src/AWS/Lambda/EventInvokeConfig.ts +2 -6
- package/src/AWS/Lambda/EventSourceMapping.ts +10 -8
- package/src/AWS/Lambda/Function.ts +111 -31
- package/src/AWS/Lambda/MicrovmProvider.ts +18 -16
- package/src/AWS/Lambda/NetworkConnector.ts +19 -15
- package/src/AWS/Lambda/RuntimeExtension.ts +46 -0
- package/src/AWS/Organizations/Account.ts +5 -6
- package/src/AWS/Organizations/common.ts +1 -3
- package/src/AWS/Providers.ts +22 -20
- package/src/AWS/RDS/DBCluster.ts +8 -6
- package/src/AWS/RDS/DBInstance.ts +8 -6
- package/src/AWS/RDS/DBProxy.ts +4 -3
- package/src/AWS/RDS/DBProxyEndpoint.ts +4 -3
- package/src/AWS/Route53/HealthCheck.ts +8 -6
- package/src/AWS/Route53/HostedZone.ts +8 -6
- package/src/AWS/Route53/Record.ts +4 -3
- package/src/AWS/S3/Bucket.ts +5 -4
- package/src/AWS/SQS/Queue.ts +26 -20
- package/src/AWS/StateStore/State.ts +5 -4
- package/src/AWS/Website/AssetDeployment.ts +10 -6
- package/src/Apply.ts +8 -0
- package/src/Auth/AuthProvider.ts +11 -0
- package/src/Axiom/AuthProvider.ts +0 -3
- package/src/Bundle/Vite.ts +16 -15
- package/src/Cli/commands/_shared.ts +119 -5
- package/src/Cli/commands/login.ts +9 -40
- package/src/Cli/commands/logs.ts +1 -0
- package/src/Cli/commands/nuke.ts +16 -44
- package/src/Cli/commands/profile.ts +89 -27
- package/src/Cli/commands/tail.ts +1 -0
- package/src/Cloudflare/AI/GatewayDynamicRouting.ts +38 -6
- package/src/Cloudflare/AI/SearchInstance.ts +4 -3
- package/src/Cloudflare/Access/Application.ts +7 -4
- package/src/Cloudflare/Alerting/Silence.ts +4 -3
- package/src/Cloudflare/Alerting/Webhook.ts +8 -6
- package/src/Cloudflare/Auth/AuthProvider.ts +54 -38
- package/src/Cloudflare/Auth/OAuthClient.ts +6 -7
- package/src/Cloudflare/Cache/RegionalTieredCache.ts +7 -4
- package/src/Cloudflare/Containers/ContainerApplication.ts +22 -2
- package/src/Cloudflare/Containers/ContainerBundle.ts +99 -33
- package/src/Cloudflare/Containers/ContainerProvider.ts +73 -19
- package/src/Cloudflare/Containers/LocalContainerProvider.ts +78 -72
- package/src/Cloudflare/Diagnostics/EndpointHealthcheck.ts +4 -3
- package/src/Cloudflare/Images/Variant.ts +4 -3
- package/src/Cloudflare/LoadBalancer/Monitor.ts +4 -3
- package/src/Cloudflare/LoadBalancer/MonitorGroup.ts +4 -3
- package/src/Cloudflare/LoadBalancer/Pool.ts +4 -3
- package/src/Cloudflare/LocalRuntime.ts +17 -0
- package/src/Cloudflare/MagicNetworkMonitoring/Rule.ts +4 -3
- package/src/Cloudflare/Pipelines/Pipeline.ts +8 -6
- package/src/Cloudflare/Pipelines/Sink.ts +8 -6
- package/src/Cloudflare/Pipelines/Stream.ts +4 -3
- package/src/Cloudflare/Providers.ts +21 -19
- package/src/Cloudflare/Queues/Consumer.ts +45 -9
- package/src/Cloudflare/Queues/Queue.ts +4 -3
- package/src/Cloudflare/R2/Bucket.ts +12 -9
- package/src/Cloudflare/R2/BucketEventNotification.ts +4 -3
- package/src/Cloudflare/R2/DataCatalog.ts +4 -3
- package/src/Cloudflare/Rum/Rule.ts +4 -3
- package/src/Cloudflare/Snippets/Snippet.ts +4 -3
- package/src/Cloudflare/StateStore/CredentialsFile.ts +48 -0
- package/src/Cloudflare/StateStore/State.ts +61 -25
- package/src/Cloudflare/Tags/ZoneResourceTags.ts +4 -3
- package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +7 -4
- package/src/Cloudflare/WaitingRoom/Settings.ts +7 -4
- package/src/Cloudflare/Website/Vite.ts +20 -0
- package/src/Cloudflare/Workers/Compatibility.ts +50 -7
- package/src/Cloudflare/Workers/CronEventSource.ts +3 -2
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +38 -33
- package/src/Cloudflare/Workers/HttpServer.ts +1 -4
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +132 -26
- package/src/Cloudflare/Workers/ObservabilityDestination.ts +4 -3
- package/src/Cloudflare/Workers/Worker.ts +27 -5
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +27 -16
- package/src/Cloudflare/Workers/WorkerBridge.ts +227 -106
- package/src/Cloudflare/Workers/WorkerProvider.ts +26 -19
- package/src/Cloudflare/Workers/cloudflare_workers.ts +20 -12
- package/src/Cloudflare/Workflows/Workflow.ts +54 -20
- package/src/Cloudflare/Workflows/WorkflowBridge.ts +19 -23
- package/src/Cloudflare/Workflows/WorkflowName.ts +41 -0
- package/src/Cloudflare/Zone/Hold.ts +7 -4
- package/src/Command/Dev.ts +42 -10
- package/src/Docker/Container.ts +4 -1
- package/src/Drizzle/Postgres.ts +51 -23
- package/src/GitHub/AuthProvider.ts +0 -3
- package/src/GitHub/Env.ts +57 -0
- package/src/GitHub/index.ts +1 -0
- package/src/Http.ts +11 -0
- package/src/Local/RpcProviderProxy.ts +1 -1
- package/src/Neon/AuthProvider.ts +0 -3
- package/src/Neon/Project.ts +2 -2
- package/src/Plan.ts +28 -11
- package/src/Planetscale/AuthProvider.ts +267 -27
- package/src/Planetscale/Branch.ts +4 -3
- package/src/Planetscale/Credentials.ts +18 -6
- package/src/Planetscale/MySQL/MySQLMigrations.ts +4 -3
- package/src/Planetscale/OAuthClient.ts +307 -0
- package/src/Planetscale/Postgres/PostgresClusterSize.ts +4 -3
- package/src/Planetscale/Postgres/PostgresMigrations.ts +4 -3
- package/src/Planetscale/Util.ts +4 -3
- package/src/Platform.ts +74 -7
- package/src/Provider.ts +35 -0
- package/src/State/HttpStateStore.ts +5 -5
- package/src/Sync.ts +3 -0
- package/src/Test/Http.ts +8 -6
- package/src/Util/data.ts +14 -5
- package/src/Util/poll.ts +1 -1
- package/lib/ExecutionContext.d.ts +0 -18
- package/lib/ExecutionContext.d.ts.map +0 -1
- package/lib/ExecutionContext.js +0 -10
- package/lib/ExecutionContext.js.map +0 -1
- package/src/ExecutionContext.ts +0 -18
package/src/Plan.ts
CHANGED
|
@@ -324,6 +324,7 @@ export const make = <A>(
|
|
|
324
324
|
? provider
|
|
325
325
|
.diff({
|
|
326
326
|
id: resource.LogicalId,
|
|
327
|
+
fqn: resource.FQN,
|
|
327
328
|
olds: oldProps,
|
|
328
329
|
instanceId: oldState.instanceId,
|
|
329
330
|
news: props,
|
|
@@ -697,21 +698,32 @@ export const make = <A>(
|
|
|
697
698
|
// - `Unowned(attrs)` → exists but is *not* ours
|
|
698
699
|
//
|
|
699
700
|
// Routing:
|
|
700
|
-
// - owned →
|
|
701
|
+
// - owned → adopt the `created` state
|
|
701
702
|
// from attrs and continue
|
|
702
703
|
// through the normal diff
|
|
703
704
|
// path (so subsequent props
|
|
704
705
|
// drift produces an update).
|
|
705
|
-
// - unowned + adopt enabled → take over:
|
|
706
|
-
// state and let the
|
|
707
|
-
// update overwrite tags
|
|
706
|
+
// - unowned + adopt enabled → take over: adopt the
|
|
707
|
+
// `created` state and let the
|
|
708
|
+
// next update overwrite tags.
|
|
708
709
|
// - unowned + adopt disabled → fail with
|
|
709
710
|
// `OwnedBySomeoneElse`.
|
|
711
|
+
//
|
|
712
|
+
// Plan construction is side-effect-free: the adopted `created`
|
|
713
|
+
// state is only held in-memory here (to drive the diff) and rides
|
|
714
|
+
// onto the plan node as `node.state`. Persisting it to the state
|
|
715
|
+
// store happens exclusively during APPLY of that node (the update
|
|
716
|
+
// lifecycle commits `updating` / `updated` carrying this state).
|
|
717
|
+
// If planning persisted here, a mere `alchemy plan` / `--dry-run`
|
|
718
|
+
// would claim ownership of an unowned cloud resource, arming a
|
|
719
|
+
// later unrelated deploy to orphan-delete it. See
|
|
720
|
+
// https://github.com/alchemy-run/alchemy-effect/issues/793.
|
|
721
|
+
//
|
|
710
722
|
// After a cold-start adoption (engine just discovered an
|
|
711
723
|
// existing cloud resource via `read`), force the engine's
|
|
712
724
|
// normal `update` path so the provider can re-sync ownership
|
|
713
725
|
// tags, configuration, etc. against the desired props.
|
|
714
|
-
// Adoption
|
|
726
|
+
// Adoption carries state with `props: news`, so the default
|
|
715
727
|
// diff sees no drift and would noop — which would leave any
|
|
716
728
|
// foreign-owned tags / divergent config in place. Forcing
|
|
717
729
|
// update keeps the deploy idempotent: if cloud state already
|
|
@@ -730,6 +742,7 @@ export const make = <A>(
|
|
|
730
742
|
const readResult = yield* provider
|
|
731
743
|
.read({
|
|
732
744
|
id,
|
|
745
|
+
fqn,
|
|
733
746
|
instanceId: adoptInstanceId,
|
|
734
747
|
olds: news,
|
|
735
748
|
output: undefined,
|
|
@@ -765,12 +778,13 @@ export const make = <A>(
|
|
|
765
778
|
downstream,
|
|
766
779
|
removalPolicy: resource.RemovalPolicy,
|
|
767
780
|
} satisfies CreatedResourceState;
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
781
|
+
// In-memory only — do NOT persist here. Plan.make runs for
|
|
782
|
+
// `alchemy plan` / `deploy --dry-run` too, so a `state.set`
|
|
783
|
+
// would mutate persistent state during a read-only preview.
|
|
784
|
+
// The adopted state rides onto the plan node via `oldState`
|
|
785
|
+
// (→ `node.state`) and is persisted at APPLY time by the
|
|
786
|
+
// update lifecycle's `updating` / `updated` commits. See
|
|
787
|
+
// https://github.com/alchemy-run/alchemy-effect/issues/793.
|
|
774
788
|
oldState = adoptedState;
|
|
775
789
|
forceUpdateAfterAdoption = true;
|
|
776
790
|
}
|
|
@@ -813,6 +827,7 @@ export const make = <A>(
|
|
|
813
827
|
const attr = yield* provider
|
|
814
828
|
.read({
|
|
815
829
|
id,
|
|
830
|
+
fqn,
|
|
816
831
|
instanceId: oldState.instanceId,
|
|
817
832
|
olds: oldState.props,
|
|
818
833
|
output: oldState.attr,
|
|
@@ -837,6 +852,7 @@ export const make = <A>(
|
|
|
837
852
|
provider
|
|
838
853
|
?.diff?.({
|
|
839
854
|
id,
|
|
855
|
+
fqn,
|
|
840
856
|
olds: oldProps,
|
|
841
857
|
instanceId: oldState.instanceId,
|
|
842
858
|
output: oldState.attr,
|
|
@@ -1232,6 +1248,7 @@ export const make = <A>(
|
|
|
1232
1248
|
attr = yield* provider
|
|
1233
1249
|
.read({
|
|
1234
1250
|
id: logicalId,
|
|
1251
|
+
fqn,
|
|
1235
1252
|
instanceId: oldState.instanceId,
|
|
1236
1253
|
olds: oldState.props as never,
|
|
1237
1254
|
output: oldState.attr as never,
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import * as PsCredentialsModule from "@distilled.cloud/planetscale/Credentials";
|
|
2
|
+
import { listOrganizations } from "@distilled.cloud/planetscale/Operations";
|
|
1
3
|
import * as Console from "effect/Console";
|
|
4
|
+
import * as Duration from "effect/Duration";
|
|
2
5
|
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
3
7
|
import * as Match from "effect/Match";
|
|
4
8
|
import * as Redacted from "effect/Redacted";
|
|
9
|
+
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
10
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
5
11
|
import {
|
|
6
12
|
AuthError,
|
|
7
13
|
AuthProviderLayer,
|
|
@@ -14,6 +20,7 @@ import {
|
|
|
14
20
|
retryOnce,
|
|
15
21
|
} from "../Auth/Env.ts";
|
|
16
22
|
import * as Clank from "../Util/Clank.ts";
|
|
23
|
+
import * as OAuthClient from "./OAuthClient.ts";
|
|
17
24
|
|
|
18
25
|
/**
|
|
19
26
|
* Canonical name registered in {@link AuthProviders}. Use this key to look
|
|
@@ -21,6 +28,66 @@ import * as Clank from "../Util/Clank.ts";
|
|
|
21
28
|
*/
|
|
22
29
|
export const PLANETSCALE_AUTH_PROVIDER_NAME = "Planetscale";
|
|
23
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Provide PlanetScale `Credentials` + `HttpClient` to an Effect using a
|
|
33
|
+
* just-obtained OAuth access token. Used during configure to call
|
|
34
|
+
* org-discovery endpoints before the user has chosen an org.
|
|
35
|
+
*
|
|
36
|
+
* `organization` is required by the credential type but isn't consulted by
|
|
37
|
+
* `listOrganizations` (it's a user-scoped endpoint), so an empty string is
|
|
38
|
+
* fine here.
|
|
39
|
+
*/
|
|
40
|
+
const withOAuthCredentials = <A, E>(
|
|
41
|
+
accessToken: string,
|
|
42
|
+
effect: Effect.Effect<
|
|
43
|
+
A,
|
|
44
|
+
E,
|
|
45
|
+
PsCredentialsModule.Credentials | HttpClient.HttpClient
|
|
46
|
+
>,
|
|
47
|
+
): Effect.Effect<A, E> =>
|
|
48
|
+
Effect.provide(
|
|
49
|
+
effect,
|
|
50
|
+
Layer.mergeAll(
|
|
51
|
+
PsCredentialsModule.fromOAuth({
|
|
52
|
+
accessToken,
|
|
53
|
+
organization: "",
|
|
54
|
+
}),
|
|
55
|
+
FetchHttpClient.layer,
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* List the organizations the OAuth user belongs to and either auto-pick
|
|
61
|
+
* (one org) or prompt the user to choose. Returns the org's URL slug
|
|
62
|
+
* (`name` field, used as `{organization}` in API paths).
|
|
63
|
+
*/
|
|
64
|
+
const selectOrganization = (accessToken: string) =>
|
|
65
|
+
Effect.gen(function* () {
|
|
66
|
+
const list = yield* listOrganizations;
|
|
67
|
+
const response = yield* list({});
|
|
68
|
+
const orgs = response.data;
|
|
69
|
+
if (orgs.length === 0) {
|
|
70
|
+
return yield* new AuthError({
|
|
71
|
+
message: "Planetscale: no organizations found for this credential.",
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
if (orgs.length === 1) {
|
|
75
|
+
const org = orgs[0]!;
|
|
76
|
+
yield* Clank.info(
|
|
77
|
+
`Planetscale: using organization: ${org.name} (${org.id})`,
|
|
78
|
+
);
|
|
79
|
+
return org.name;
|
|
80
|
+
}
|
|
81
|
+
return yield* Clank.select({
|
|
82
|
+
message: "Select a Planetscale organization",
|
|
83
|
+
options: orgs.map((o) => ({
|
|
84
|
+
value: o.name,
|
|
85
|
+
label: o.name,
|
|
86
|
+
hint: o.id,
|
|
87
|
+
})),
|
|
88
|
+
}).pipe(retryOnce);
|
|
89
|
+
}).pipe((e) => withOAuthCredentials(accessToken, e));
|
|
90
|
+
|
|
24
91
|
const options: Array<{
|
|
25
92
|
value: PlanetscaleAuthConfig["method"];
|
|
26
93
|
label: string;
|
|
@@ -31,12 +98,16 @@ const options: Array<{
|
|
|
31
98
|
label: "Environment Variables",
|
|
32
99
|
hint: "PLANETSCALE_API_TOKEN_ID + PLANETSCALE_API_TOKEN + PLANETSCALE_ORGANIZATION",
|
|
33
100
|
},
|
|
101
|
+
{
|
|
102
|
+
value: "oauth",
|
|
103
|
+
label: "OAuth",
|
|
104
|
+
hint: "recommended — browser-based login with automatic token refresh",
|
|
105
|
+
},
|
|
34
106
|
{
|
|
35
107
|
value: "stored",
|
|
36
108
|
label: "Service Token",
|
|
37
109
|
hint: "enter service token interactively, stored in ~/.alchemy/credentials",
|
|
38
110
|
},
|
|
39
|
-
//todo(pear): add planetscale oauth
|
|
40
111
|
];
|
|
41
112
|
|
|
42
113
|
/**
|
|
@@ -44,13 +115,17 @@ const options: Array<{
|
|
|
44
115
|
* PlanetScale provider.
|
|
45
116
|
*
|
|
46
117
|
* - `env`: read credentials from environment variables at resolution time.
|
|
47
|
-
* - `stored`: read credentials from
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
118
|
+
* - `stored`: read service-token credentials from
|
|
119
|
+
* `~/.alchemy/credentials/<profile>/planetscale-stored.json`.
|
|
120
|
+
* - `oauth`: browser-based login; the access/refresh tokens are stored at
|
|
121
|
+
* `~/.alchemy/credentials/<profile>/planetscale-oauth.json` and refreshed
|
|
122
|
+
* on demand. PlanetScale has no PKCE flow, so the OAuth application's
|
|
123
|
+
* `client_secret` ships in the CLI — see {@link OAuthClient}.
|
|
52
124
|
*/
|
|
53
|
-
export type PlanetscaleAuthConfig =
|
|
125
|
+
export type PlanetscaleAuthConfig =
|
|
126
|
+
| { method: "env" }
|
|
127
|
+
| { method: "stored" }
|
|
128
|
+
| { method: "oauth"; organization: string };
|
|
54
129
|
|
|
55
130
|
/**
|
|
56
131
|
* apiToken credentials persisted to disk for `method: "stored"`.
|
|
@@ -65,18 +140,30 @@ export interface PlanetscaleStoredCredentials {
|
|
|
65
140
|
|
|
66
141
|
/**
|
|
67
142
|
* Resolved in-memory PlanetScale credentials returned by
|
|
68
|
-
* {@link AuthProviderImpl.read}.
|
|
143
|
+
* {@link AuthProviderImpl.read}. Either a service token (`tokenId`/`token`)
|
|
144
|
+
* or an OAuth access token.
|
|
69
145
|
*/
|
|
70
|
-
export
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
146
|
+
export type PlanetscaleResolvedCredentials =
|
|
147
|
+
| {
|
|
148
|
+
type: "apiToken";
|
|
149
|
+
tokenId: Redacted.Redacted<string>;
|
|
150
|
+
token: Redacted.Redacted<string>;
|
|
151
|
+
organization: string;
|
|
152
|
+
source: {
|
|
153
|
+
type: PlanetscaleAuthConfig["method"];
|
|
154
|
+
details?: string;
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
| {
|
|
158
|
+
type: "oauth";
|
|
159
|
+
accessToken: Redacted.Redacted<string>;
|
|
160
|
+
expires: number;
|
|
161
|
+
organization: string;
|
|
162
|
+
source: {
|
|
163
|
+
type: PlanetscaleAuthConfig["method"];
|
|
164
|
+
details?: string;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
80
167
|
|
|
81
168
|
/**
|
|
82
169
|
* Layer that registers the PlanetScale {@link AuthProvider} into the
|
|
@@ -87,6 +174,8 @@ export interface PlanetscaleResolvedCredentials {
|
|
|
87
174
|
* - `env`: reads `PLANETSCALE_API_TOKEN_ID`/`PLANETSCALE_API_TOKEN`/`PLANETSCALE_ORGANIZATION`.
|
|
88
175
|
* - `stored`: prompts for a service token interactively and writes it to
|
|
89
176
|
* `~/.alchemy/credentials/<profile>/planetscale-stored.json`.
|
|
177
|
+
* - `oauth`: browser-based login storing access/refresh tokens at
|
|
178
|
+
* `~/.alchemy/credentials/<profile>/planetscale-oauth.json`.
|
|
90
179
|
*/
|
|
91
180
|
export const PlanetscaleAuth = AuthProviderLayer<
|
|
92
181
|
PlanetscaleAuthConfig,
|
|
@@ -96,6 +185,54 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
96
185
|
Effect.gen(function* () {
|
|
97
186
|
const store = yield* CredentialsStore;
|
|
98
187
|
|
|
188
|
+
const oauthLogin = (profileName: string) =>
|
|
189
|
+
Effect.gen(function* () {
|
|
190
|
+
const authorization = OAuthClient.authorize();
|
|
191
|
+
|
|
192
|
+
yield* Clank.info("Planetscale: opening browser for OAuth login...");
|
|
193
|
+
yield* Clank.info(authorization.url);
|
|
194
|
+
yield* Clank.openUrl(authorization.url).pipe(
|
|
195
|
+
Effect.catch(() =>
|
|
196
|
+
Clank.warn(
|
|
197
|
+
"Planetscale: could not open browser automatically. Please open the URL above manually.",
|
|
198
|
+
),
|
|
199
|
+
),
|
|
200
|
+
);
|
|
201
|
+
yield* Clank.info(
|
|
202
|
+
"Planetscale: waiting for authorization (up to 5 minutes)...",
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
const credentials = yield* OAuthClient.callback(authorization);
|
|
206
|
+
yield* store.write(profileName, "planetscale-oauth", credentials);
|
|
207
|
+
yield* Clank.success("Planetscale: OAuth credentials saved.");
|
|
208
|
+
return credentials;
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
const configureOAuth = Effect.fn(function* (profileName: string) {
|
|
212
|
+
const oauthCreds = yield* oauthLogin(profileName);
|
|
213
|
+
|
|
214
|
+
// Use the just-issued access token to list the user's orgs and let
|
|
215
|
+
// them pick (mirrors Cloudflare's selectAccount). Requires the
|
|
216
|
+
// `user:read_organizations` scope. If the call fails for any
|
|
217
|
+
// reason — missing scope, network, off-spec response — fall back
|
|
218
|
+
// to a manual prompt so login still completes.
|
|
219
|
+
const organization = yield* selectOrganization(oauthCreds.access).pipe(
|
|
220
|
+
Effect.catch((e) =>
|
|
221
|
+
Effect.gen(function* () {
|
|
222
|
+
yield* Clank.warn(
|
|
223
|
+
`Planetscale: could not auto-list organizations (${String(e)}). Falling back to manual entry.`,
|
|
224
|
+
);
|
|
225
|
+
return yield* Clank.text({
|
|
226
|
+
message: "Planetscale Organization (URL slug)",
|
|
227
|
+
validate: (v) => (v.length === 0 ? "Required" : undefined),
|
|
228
|
+
}).pipe(retryOnce);
|
|
229
|
+
}),
|
|
230
|
+
),
|
|
231
|
+
);
|
|
232
|
+
|
|
233
|
+
return { method: "oauth" as const, organization };
|
|
234
|
+
});
|
|
235
|
+
|
|
99
236
|
const loginStored = Effect.fn(function* (profileName: string) {
|
|
100
237
|
const tokenId = yield* Clank.text({
|
|
101
238
|
message: "Planetscale Service Token ID",
|
|
@@ -134,6 +271,7 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
134
271
|
Effect.flatMap((method) =>
|
|
135
272
|
Match.value(method).pipe(
|
|
136
273
|
Match.when("env", () => Effect.succeed({ method: "env" as const })),
|
|
274
|
+
Match.when("oauth", () => configureOAuth(profileName)),
|
|
137
275
|
Match.when("stored", () => loginStored(profileName)),
|
|
138
276
|
Match.exhaustive,
|
|
139
277
|
),
|
|
@@ -214,6 +352,48 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
214
352
|
),
|
|
215
353
|
),
|
|
216
354
|
),
|
|
355
|
+
Match.when({ method: "oauth" }, (cfg) =>
|
|
356
|
+
Effect.gen(function* () {
|
|
357
|
+
const creds = yield* store.read<OAuthClient.OAuthCredentials>(
|
|
358
|
+
profileName,
|
|
359
|
+
"planetscale-oauth",
|
|
360
|
+
);
|
|
361
|
+
if (creds == null || creds.type !== "oauth") {
|
|
362
|
+
return yield* Effect.fail(
|
|
363
|
+
new AuthError({
|
|
364
|
+
message:
|
|
365
|
+
"Planetscale OAuth credentials not found. Run: alchemy login",
|
|
366
|
+
}),
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
// Refresh proactively if the token has expired (or is within
|
|
370
|
+
// 10s of expiring). Persist the refreshed creds so subsequent
|
|
371
|
+
// resolves don't repeat the round-trip.
|
|
372
|
+
const fresh =
|
|
373
|
+
creds.expires > Date.now() + 10_000
|
|
374
|
+
? creds
|
|
375
|
+
: yield* OAuthClient.refresh(creds).pipe(
|
|
376
|
+
Effect.tap((refreshed) =>
|
|
377
|
+
store.write(profileName, "planetscale-oauth", refreshed),
|
|
378
|
+
),
|
|
379
|
+
Effect.mapError(
|
|
380
|
+
(e) =>
|
|
381
|
+
new AuthError({
|
|
382
|
+
message:
|
|
383
|
+
"Planetscale OAuth refresh failed. Run: alchemy login",
|
|
384
|
+
cause: e,
|
|
385
|
+
}),
|
|
386
|
+
),
|
|
387
|
+
);
|
|
388
|
+
return {
|
|
389
|
+
type: "oauth" as const,
|
|
390
|
+
accessToken: Redacted.make(fresh.access),
|
|
391
|
+
expires: fresh.expires,
|
|
392
|
+
organization: cfg.organization,
|
|
393
|
+
source: { type: "oauth" as const },
|
|
394
|
+
} satisfies PlanetscaleResolvedCredentials;
|
|
395
|
+
}),
|
|
396
|
+
),
|
|
217
397
|
Match.exhaustive,
|
|
218
398
|
);
|
|
219
399
|
|
|
@@ -229,6 +409,17 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
229
409
|
),
|
|
230
410
|
),
|
|
231
411
|
),
|
|
412
|
+
// PlanetScale publishes no token-revocation endpoint, so logout just
|
|
413
|
+
// drops the locally stored tokens.
|
|
414
|
+
Match.when({ method: "oauth" }, () =>
|
|
415
|
+
store
|
|
416
|
+
.delete(profileName, "planetscale-oauth")
|
|
417
|
+
.pipe(
|
|
418
|
+
Effect.andThen(
|
|
419
|
+
Clank.success("Planetscale: OAuth credentials removed."),
|
|
420
|
+
),
|
|
421
|
+
),
|
|
422
|
+
),
|
|
232
423
|
Match.exhaustive,
|
|
233
424
|
);
|
|
234
425
|
|
|
@@ -248,6 +439,39 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
248
439
|
),
|
|
249
440
|
),
|
|
250
441
|
),
|
|
442
|
+
Match.when({ method: "oauth" }, (c) =>
|
|
443
|
+
Effect.gen(function* () {
|
|
444
|
+
const creds = yield* store.read<OAuthClient.OAuthCredentials>(
|
|
445
|
+
profileName,
|
|
446
|
+
"planetscale-oauth",
|
|
447
|
+
);
|
|
448
|
+
|
|
449
|
+
if (creds?.type === "oauth") {
|
|
450
|
+
yield* Clank.info(
|
|
451
|
+
"Planetscale: refreshing OAuth credentials...",
|
|
452
|
+
);
|
|
453
|
+
yield* OAuthClient.refresh(creds).pipe(
|
|
454
|
+
Effect.flatMap((refreshed) =>
|
|
455
|
+
store
|
|
456
|
+
.write(profileName, "planetscale-oauth", refreshed)
|
|
457
|
+
.pipe(
|
|
458
|
+
Effect.andThen(
|
|
459
|
+
Clank.success(
|
|
460
|
+
"Planetscale: OAuth credentials refreshed.",
|
|
461
|
+
),
|
|
462
|
+
),
|
|
463
|
+
),
|
|
464
|
+
),
|
|
465
|
+
Effect.catchTag("OAuthError", () =>
|
|
466
|
+
oauthLogin(profileName).pipe(Effect.asVoid),
|
|
467
|
+
),
|
|
468
|
+
);
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
yield* oauthLogin(profileName);
|
|
473
|
+
}),
|
|
474
|
+
),
|
|
251
475
|
Match.exhaustive,
|
|
252
476
|
)
|
|
253
477
|
.pipe(
|
|
@@ -262,16 +486,32 @@ export const PlanetscaleAuth = AuthProviderLayer<
|
|
|
262
486
|
const sourceStr = creds.source.details
|
|
263
487
|
? `${creds.source.type} - ${creds.source.details}`
|
|
264
488
|
: creds.source.type;
|
|
265
|
-
return
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
489
|
+
return Match.value(creds).pipe(
|
|
490
|
+
Match.when({ type: "apiToken" }, (c) =>
|
|
491
|
+
Effect.all([
|
|
492
|
+
Console.log(` tokenId: ${displayRedacted(c.tokenId, 3)}`),
|
|
493
|
+
Console.log(` token: ${displayRedacted(c.token, 6)}`),
|
|
494
|
+
Console.log(` organization: ${c.organization}`),
|
|
495
|
+
Console.log(` source: ${sourceStr}`),
|
|
496
|
+
]),
|
|
497
|
+
),
|
|
498
|
+
Match.when({ type: "oauth" }, (c) => {
|
|
499
|
+
const remainingMs = c.expires - Date.now();
|
|
500
|
+
const expiresAt = new Date(c.expires).toISOString();
|
|
501
|
+
const expiresStr =
|
|
502
|
+
remainingMs <= 0
|
|
503
|
+
? `expired (${expiresAt})`
|
|
504
|
+
: `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;
|
|
505
|
+
return Effect.all([
|
|
506
|
+
Console.log(` accessToken: ${displayRedacted(c.accessToken)}`),
|
|
507
|
+
Console.log(` expires: ${expiresStr}`),
|
|
508
|
+
Console.log(` organization: ${c.organization}`),
|
|
509
|
+
Console.log(` source: ${sourceStr}`),
|
|
510
|
+
]);
|
|
511
|
+
}),
|
|
512
|
+
Match.exhaustive,
|
|
513
|
+
);
|
|
271
514
|
}),
|
|
272
|
-
Effect.catch((e) =>
|
|
273
|
-
Console.error(` Failed to retrieve credentials: ${e}`),
|
|
274
|
-
),
|
|
275
515
|
);
|
|
276
516
|
|
|
277
517
|
return {
|
|
@@ -484,9 +484,10 @@ export const makeBranchProvider = <R extends ResourceLike>(opts: {
|
|
|
484
484
|
// rejected with an UnprocessableEntity. Retry until it clears.
|
|
485
485
|
const retryWhileResizing = Effect.retry({
|
|
486
486
|
while: isResizeInProgress,
|
|
487
|
-
schedule: Schedule.
|
|
488
|
-
Schedule.
|
|
489
|
-
|
|
487
|
+
schedule: Schedule.max([
|
|
488
|
+
Schedule.spaced("5 seconds"),
|
|
489
|
+
Schedule.recurs(120),
|
|
490
|
+
]),
|
|
490
491
|
});
|
|
491
492
|
current = desiredProduction
|
|
492
493
|
? yield* planetscale
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
2
|
import {
|
|
3
|
+
type Config as PlanetscaleClientConfig,
|
|
3
4
|
Credentials,
|
|
4
5
|
DEFAULT_API_BASE_URL,
|
|
5
6
|
} from "@distilled.cloud/planetscale/Credentials";
|
|
@@ -82,12 +83,23 @@ export const fromAuthProvider = () =>
|
|
|
82
83
|
Effect.flatMap((config) =>
|
|
83
84
|
auth.read(profileName, config as PlanetscaleAuthConfig),
|
|
84
85
|
),
|
|
85
|
-
Effect.map(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
Effect.map(
|
|
87
|
+
(creds): PlanetscaleClientConfig =>
|
|
88
|
+
creds.type === "oauth"
|
|
89
|
+
? {
|
|
90
|
+
type: "oauth",
|
|
91
|
+
accessToken: creds.accessToken,
|
|
92
|
+
organization: creds.organization,
|
|
93
|
+
apiBaseUrl,
|
|
94
|
+
}
|
|
95
|
+
: {
|
|
96
|
+
type: "serviceToken",
|
|
97
|
+
tokenId: creds.tokenId,
|
|
98
|
+
token: creds.token,
|
|
99
|
+
organization: creds.organization,
|
|
100
|
+
apiBaseUrl,
|
|
101
|
+
},
|
|
102
|
+
),
|
|
91
103
|
Effect.mapError(
|
|
92
104
|
(e) =>
|
|
93
105
|
new ConfigError({
|
|
@@ -217,9 +217,10 @@ const withTemporaryMySQLPassword = <A, E, R>(
|
|
|
217
217
|
// Already-deleted passwords are a success: nothing to clean up.
|
|
218
218
|
Effect.catchTag("NotFound", () => Effect.void),
|
|
219
219
|
Effect.retry({
|
|
220
|
-
schedule: Schedule.
|
|
221
|
-
Schedule.
|
|
222
|
-
|
|
220
|
+
schedule: Schedule.max([
|
|
221
|
+
Schedule.exponential("500 millis"),
|
|
222
|
+
Schedule.recurs(5),
|
|
223
|
+
]),
|
|
223
224
|
}),
|
|
224
225
|
// Migrations succeeded; don't fail the parent over a release-step
|
|
225
226
|
// hiccup. The password's TTL bounds the orphan window; log loudly
|