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
|
@@ -274,9 +274,10 @@ export const RuleProvider = () =>
|
|
|
274
274
|
// visible. Ride out the propagation window with a bounded retry.
|
|
275
275
|
Effect.retry({
|
|
276
276
|
while: (e) => e._tag === "RulesetNotFound",
|
|
277
|
-
schedule: Schedule.
|
|
278
|
-
Schedule.
|
|
279
|
-
|
|
277
|
+
schedule: Schedule.max([
|
|
278
|
+
Schedule.exponential("500 millis"),
|
|
279
|
+
Schedule.recurs(8),
|
|
280
|
+
]),
|
|
280
281
|
}),
|
|
281
282
|
);
|
|
282
283
|
const fresh = yield* listRules(accountId, rulesetId);
|
|
@@ -256,9 +256,10 @@ export const SnippetProvider = () =>
|
|
|
256
256
|
.pipe(
|
|
257
257
|
Effect.retry({
|
|
258
258
|
while: (e) => e._tag === "SnippetInUse",
|
|
259
|
-
schedule: Schedule.
|
|
260
|
-
Schedule.
|
|
261
|
-
|
|
259
|
+
schedule: Schedule.max([
|
|
260
|
+
Schedule.exponential("1 second"),
|
|
261
|
+
Schedule.recurs(8),
|
|
262
|
+
]),
|
|
262
263
|
}),
|
|
263
264
|
Effect.catchTag("SnippetNotFound", () => Effect.void),
|
|
264
265
|
);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { HttpStateStoreCredentials } from "../../State/HttpStateStore.ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Filename (under `~/.alchemy/credentials/{profile}/`) used to cache the
|
|
5
|
+
* Cloudflare-deployed HTTP state store's endpoint + bearer token.
|
|
6
|
+
*
|
|
7
|
+
* Kept in this leaf module (rather than `StateStore/State.ts`) so the
|
|
8
|
+
* Cloudflare auth provider can invalidate the cache on
|
|
9
|
+
* `login --configure` / `logout` without importing the heavy state-store
|
|
10
|
+
* module and creating an import cycle
|
|
11
|
+
* (`StateStore/State.ts` -> `Providers.ts` -> `Auth/AuthProvider.ts`).
|
|
12
|
+
*/
|
|
13
|
+
export const CREDENTIALS_FILE = "cloudflare-state-store";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* On-disk shape of the cached Cloudflare state-store credentials.
|
|
17
|
+
*
|
|
18
|
+
* Extends the generic {@link HttpStateStoreCredentials} (`{ url, authToken }`)
|
|
19
|
+
* with the `accountId` the credentials were minted against. The `url` already
|
|
20
|
+
* encodes the account (via the `*.workers.dev` subdomain), so a cache written
|
|
21
|
+
* while logged into account A keeps pointing at account A's state store even
|
|
22
|
+
* after the user re-authenticates against account B. Persisting `accountId`
|
|
23
|
+
* lets `state()` detect that mismatch and re-derive.
|
|
24
|
+
*
|
|
25
|
+
* `accountId` is optional so legacy files written before this field existed
|
|
26
|
+
* still parse — they are treated as stale (see
|
|
27
|
+
* {@link isStateStoreCredentialsStale}) and re-derived on next use.
|
|
28
|
+
*/
|
|
29
|
+
export interface StoredStateStoreCredentials extends HttpStateStoreCredentials {
|
|
30
|
+
/** Cloudflare account ID the `url`/`authToken` were minted against. */
|
|
31
|
+
accountId?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* `true` when cached state-store credentials must not be trusted for the
|
|
36
|
+
* current account:
|
|
37
|
+
*
|
|
38
|
+
* - the file predates the `accountId` field (legacy cache — exactly the
|
|
39
|
+
* artifact that caused deploys to silently target the wrong account), or
|
|
40
|
+
* - it was minted against a different account than the one now in use.
|
|
41
|
+
*
|
|
42
|
+
* A stale cache is discarded and re-derived from the current account.
|
|
43
|
+
*/
|
|
44
|
+
export const isStateStoreCredentialsStale = (
|
|
45
|
+
credentials: StoredStateStoreCredentials,
|
|
46
|
+
currentAccountId: string,
|
|
47
|
+
): boolean =>
|
|
48
|
+
credentials.accountId == null || credentials.accountId !== currentAccountId;
|
|
@@ -39,6 +39,11 @@ import * as Access from "../Access.ts";
|
|
|
39
39
|
import * as CloudflareEnvironment from "../CloudflareEnvironment.ts";
|
|
40
40
|
import { EdgeSessionError, createEdgeSession } from "../EdgeSession.ts";
|
|
41
41
|
import Api, { STATE_STORE_SCRIPT_NAME, STATE_STORE_VERSION } from "./Api.ts";
|
|
42
|
+
import {
|
|
43
|
+
CREDENTIALS_FILE,
|
|
44
|
+
type StoredStateStoreCredentials,
|
|
45
|
+
isStateStoreCredentialsStale,
|
|
46
|
+
} from "./CredentialsFile.ts";
|
|
42
47
|
import {
|
|
43
48
|
AuthToken,
|
|
44
49
|
AuthTokenSecretName,
|
|
@@ -48,9 +53,6 @@ import {
|
|
|
48
53
|
|
|
49
54
|
const CI = Config.boolean("CI").pipe(Config.withDefault(false));
|
|
50
55
|
|
|
51
|
-
/** Filename used for stored credentials under the profile directory. */
|
|
52
|
-
const CREDENTIALS_FILE = "cloudflare-state-store";
|
|
53
|
-
|
|
54
56
|
export const state = () =>
|
|
55
57
|
Layer.effect(
|
|
56
58
|
State,
|
|
@@ -173,15 +175,32 @@ export const state = () =>
|
|
|
173
175
|
return yield* makeCloudflareStateStore(credentials);
|
|
174
176
|
});
|
|
175
177
|
|
|
176
|
-
const
|
|
178
|
+
const { accountId } =
|
|
179
|
+
yield* yield* CloudflareEnvironment.CloudflareEnvironment;
|
|
180
|
+
|
|
181
|
+
const credentials = yield* credStore.read<StoredStateStoreCredentials>(
|
|
177
182
|
profileName,
|
|
178
183
|
CREDENTIALS_FILE,
|
|
179
184
|
);
|
|
180
185
|
if (credentials) {
|
|
181
|
-
|
|
186
|
+
// The cached `url`/`authToken` are minted per-account (the `url`
|
|
187
|
+
// encodes the account via its workers.dev subdomain). If the
|
|
188
|
+
// active account changed since they were written — or the file
|
|
189
|
+
// predates the `accountId` field — trusting the cache would
|
|
190
|
+
// silently read/write state in the wrong account, so discard it
|
|
191
|
+
// and fall through to re-derivation from the current account.
|
|
192
|
+
if (isStateStoreCredentialsStale(credentials, accountId)) {
|
|
193
|
+
yield* Clank.info(
|
|
194
|
+
`Cloudflare State Store credentials were minted for a different ` +
|
|
195
|
+
`Cloudflare account; re-deriving for the current account.`,
|
|
196
|
+
);
|
|
197
|
+
yield* credStore
|
|
198
|
+
.delete(profileName, CREDENTIALS_FILE)
|
|
199
|
+
.pipe(Effect.ignore);
|
|
200
|
+
} else {
|
|
201
|
+
return yield* ensureLatest(credentials);
|
|
202
|
+
}
|
|
182
203
|
}
|
|
183
|
-
const { accountId } =
|
|
184
|
-
yield* yield* CloudflareEnvironment.CloudflareEnvironment;
|
|
185
204
|
if (yield* isStateStoreServing(accountId)) {
|
|
186
205
|
return yield* ensureLatest(
|
|
187
206
|
yield* loginWithCloudflare(profileName, false),
|
|
@@ -283,7 +302,7 @@ export const bootstrap = (options: BootstrapOptions = {}) =>
|
|
|
283
302
|
if (!isCI) {
|
|
284
303
|
// we don't write credentials in CI because the file system is ephemeral
|
|
285
304
|
const store = yield* CredentialsStore;
|
|
286
|
-
yield* store.write<
|
|
305
|
+
yield* store.write<StoredStateStoreCredentials>(
|
|
287
306
|
profileName,
|
|
288
307
|
CREDENTIALS_FILE,
|
|
289
308
|
credentials,
|
|
@@ -667,9 +686,10 @@ const hoistBootstrapStack = Effect.fn(function* ({
|
|
|
667
686
|
// Secrets Store bindings) can take a while to serve
|
|
668
687
|
// consistently; anything persisting past that is a real
|
|
669
688
|
// failure to surface, not to spin on.
|
|
670
|
-
schedule: Schedule.
|
|
671
|
-
Schedule.
|
|
672
|
-
|
|
689
|
+
schedule: Schedule.max([
|
|
690
|
+
Schedule.fixed(500),
|
|
691
|
+
Schedule.recurs(60),
|
|
692
|
+
]),
|
|
673
693
|
}),
|
|
674
694
|
);
|
|
675
695
|
}
|
|
@@ -703,11 +723,17 @@ export const loginWithCloudflare = (profileName: string, force: boolean) =>
|
|
|
703
723
|
|
|
704
724
|
if (!force) {
|
|
705
725
|
// try and read from the cached credentials first if not forcing (force will always refresh)
|
|
706
|
-
const credentials = yield* credStore.read<
|
|
726
|
+
const credentials = yield* credStore.read<StoredStateStoreCredentials>(
|
|
707
727
|
profileName,
|
|
708
728
|
CREDENTIALS_FILE,
|
|
709
729
|
);
|
|
710
|
-
|
|
730
|
+
// Ignore a cache minted for a different account (or a legacy file with
|
|
731
|
+
// no `accountId`) — reusing it would hand back the wrong account's
|
|
732
|
+
// state-store URL. Fall through to re-derive against `accountId`.
|
|
733
|
+
if (
|
|
734
|
+
credentials &&
|
|
735
|
+
!isStateStoreCredentialsStale(credentials, accountId)
|
|
736
|
+
) {
|
|
711
737
|
return credentials;
|
|
712
738
|
}
|
|
713
739
|
}
|
|
@@ -736,10 +762,13 @@ export const loginWithCloudflare = (profileName: string, force: boolean) =>
|
|
|
736
762
|
isTransientEdgeSessionError(error),
|
|
737
763
|
// Cap the exponential delay at 2s so 15 retries stay within
|
|
738
764
|
// ~30s instead of doubling unboundedly.
|
|
739
|
-
schedule: Schedule.
|
|
740
|
-
Schedule.
|
|
741
|
-
|
|
742
|
-
|
|
765
|
+
schedule: Schedule.max([
|
|
766
|
+
Schedule.min([
|
|
767
|
+
Schedule.exponential(200),
|
|
768
|
+
Schedule.spaced("2 seconds"),
|
|
769
|
+
]),
|
|
770
|
+
Schedule.recurs(15),
|
|
771
|
+
]),
|
|
743
772
|
}),
|
|
744
773
|
);
|
|
745
774
|
|
|
@@ -751,9 +780,10 @@ export const loginWithCloudflare = (profileName: string, force: boolean) =>
|
|
|
751
780
|
// 4. Persist credentials. The profile entry is managed by
|
|
752
781
|
// `loadOrConfigure` when this is invoked through `configure`.
|
|
753
782
|
yield* credStore
|
|
754
|
-
.write<
|
|
783
|
+
.write<StoredStateStoreCredentials>(profileName, CREDENTIALS_FILE, {
|
|
755
784
|
url,
|
|
756
785
|
authToken: authToken.trim(),
|
|
786
|
+
accountId,
|
|
757
787
|
})
|
|
758
788
|
.pipe(
|
|
759
789
|
Effect.mapError(
|
|
@@ -774,6 +804,7 @@ export const loginWithCloudflare = (profileName: string, force: boolean) =>
|
|
|
774
804
|
return {
|
|
775
805
|
url,
|
|
776
806
|
authToken: authToken.trim(),
|
|
807
|
+
accountId,
|
|
777
808
|
};
|
|
778
809
|
}).pipe(
|
|
779
810
|
Effect.catchTag("EdgeSessionError", (e) =>
|
|
@@ -871,9 +902,10 @@ const waitForStateStoreVersion = (url: string) =>
|
|
|
871
902
|
// Edge propagation is usually sub-second but production traces
|
|
872
903
|
// show redeploys occasionally serving the old version for well
|
|
873
904
|
// over 10s. Poll for ~30s before failing loudly.
|
|
874
|
-
schedule: Schedule.
|
|
875
|
-
Schedule.
|
|
876
|
-
|
|
905
|
+
schedule: Schedule.max([
|
|
906
|
+
Schedule.spaced("500 millis"),
|
|
907
|
+
Schedule.recurs(60),
|
|
908
|
+
]),
|
|
877
909
|
}),
|
|
878
910
|
Effect.withSpan("state_store.wait_for_version", {
|
|
879
911
|
attributes: {
|
|
@@ -911,9 +943,10 @@ const checkStateStoreVersion = (url: string) =>
|
|
|
911
943
|
: Effect.fail(e),
|
|
912
944
|
),
|
|
913
945
|
Effect.retry({
|
|
914
|
-
schedule: Schedule.
|
|
915
|
-
Schedule.
|
|
916
|
-
|
|
946
|
+
schedule: Schedule.max([
|
|
947
|
+
Schedule.spaced("250 millis"),
|
|
948
|
+
Schedule.recurs(40),
|
|
949
|
+
]),
|
|
917
950
|
}),
|
|
918
951
|
Effect.catch(() => Effect.succeed(undefined)),
|
|
919
952
|
);
|
|
@@ -1022,12 +1055,15 @@ const writeCredentials = (url: string, authToken: string) =>
|
|
|
1022
1055
|
Effect.gen(function* () {
|
|
1023
1056
|
const profileName = yield* ALCHEMY_PROFILE;
|
|
1024
1057
|
const credStore = yield* CredentialsStore;
|
|
1025
|
-
|
|
1058
|
+
const { accountId } =
|
|
1059
|
+
yield* yield* CloudflareEnvironment.CloudflareEnvironment;
|
|
1060
|
+
yield* credStore.write<StoredStateStoreCredentials>(
|
|
1026
1061
|
profileName,
|
|
1027
1062
|
CREDENTIALS_FILE,
|
|
1028
1063
|
{
|
|
1029
1064
|
url,
|
|
1030
1065
|
authToken,
|
|
1066
|
+
accountId,
|
|
1031
1067
|
},
|
|
1032
1068
|
);
|
|
1033
1069
|
});
|
|
@@ -21,9 +21,10 @@ type TypeId = typeof TypeId;
|
|
|
21
21
|
// calls on that typed tag so reconcile waits out the propagation window.
|
|
22
22
|
const targetVisibleRetry = {
|
|
23
23
|
while: (e: { _tag: string }) => e._tag === "ZoneTagResourceNotFound",
|
|
24
|
-
schedule: Schedule.
|
|
25
|
-
Schedule.
|
|
26
|
-
|
|
24
|
+
schedule: Schedule.max([
|
|
25
|
+
Schedule.exponential("500 millis"),
|
|
26
|
+
Schedule.recurs(10),
|
|
27
|
+
]),
|
|
27
28
|
} as const;
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -155,10 +155,13 @@ export const UrlNormalizationProvider = () =>
|
|
|
155
155
|
// zone never falls out of the enumeration on a blip.
|
|
156
156
|
Effect.retry({
|
|
157
157
|
while: (e) => e._tag === "Forbidden",
|
|
158
|
-
schedule: Schedule.
|
|
159
|
-
Schedule.
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
schedule: Schedule.max([
|
|
159
|
+
Schedule.min([
|
|
160
|
+
Schedule.exponential("500 millis"),
|
|
161
|
+
Schedule.spaced("5 seconds"),
|
|
162
|
+
]),
|
|
163
|
+
Schedule.recurs(8),
|
|
164
|
+
]),
|
|
162
165
|
}),
|
|
163
166
|
Effect.map((observed) => toAttributes(zoneId, observed)),
|
|
164
167
|
// Plan-gated or partial zones reject the route; skip them.
|
|
@@ -116,10 +116,13 @@ export const SettingsProvider = () =>
|
|
|
116
116
|
// test timeout when a zone is persistently 403.
|
|
117
117
|
Effect.retry({
|
|
118
118
|
while: (e) => e._tag === "Forbidden",
|
|
119
|
-
schedule: Schedule.
|
|
120
|
-
Schedule.
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
schedule: Schedule.max([
|
|
120
|
+
Schedule.min([
|
|
121
|
+
Schedule.exponential("500 millis"),
|
|
122
|
+
Schedule.spaced("5 seconds"),
|
|
123
|
+
]),
|
|
124
|
+
Schedule.recurs(8),
|
|
125
|
+
]),
|
|
123
126
|
}),
|
|
124
127
|
Effect.map((observed) =>
|
|
125
128
|
toAttributes(
|
|
@@ -90,6 +90,25 @@ export interface ViteProps<Bindings extends WorkerBindingProps = {}>
|
|
|
90
90
|
* });
|
|
91
91
|
* ```
|
|
92
92
|
*
|
|
93
|
+
* @section Custom Worker Entry
|
|
94
|
+
* By default the deployed Worker entry is the server bundle the
|
|
95
|
+
* framework produces. When the Worker must export more than the
|
|
96
|
+
* framework's fetch handler — Durable Object classes, additional
|
|
97
|
+
* handlers — point `main` at your own module that wraps the framework
|
|
98
|
+
* handler and re-exports the extras. `main` takes precedence over any
|
|
99
|
+
* entry configured in the Vite config.
|
|
100
|
+
*
|
|
101
|
+
* @example Custom entry hosting Durable Objects
|
|
102
|
+
* ```typescript
|
|
103
|
+
* const app = yield* Cloudflare.Website.Vite("App", {
|
|
104
|
+
* main: "worker/index.ts",
|
|
105
|
+
* viteEnvironments: {
|
|
106
|
+
* entry: "rsc",
|
|
107
|
+
* children: ["ssr"],
|
|
108
|
+
* },
|
|
109
|
+
* });
|
|
110
|
+
* ```
|
|
111
|
+
*
|
|
93
112
|
* @section Single-Page Applications
|
|
94
113
|
* For SPAs (React, Vue, etc.), configure asset handling so all
|
|
95
114
|
* routes fall back to `index.html`.
|
|
@@ -178,6 +197,7 @@ export const Vite: {
|
|
|
178
197
|
...props,
|
|
179
198
|
main: undefined!,
|
|
180
199
|
vite: {
|
|
200
|
+
main: props?.main,
|
|
181
201
|
rootDir: props?.rootDir,
|
|
182
202
|
memo: props?.memo,
|
|
183
203
|
viteEnvironments: props?.viteEnvironments,
|
|
@@ -3,10 +3,53 @@ import type { WorkerProps } from "./Worker.ts";
|
|
|
3
3
|
// TODO: figure out why the later one from workerd breaks
|
|
4
4
|
const DEFAULT_COMPATIBILITY_DATE = "2026-03-17";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
/**
|
|
7
|
+
* The Effect worker bridge builds its layer stack once per isolate and shares
|
|
8
|
+
* the in-flight build promise across concurrent events. Awaiting a promise
|
|
9
|
+
* created under another event's request context is only sound with workerd's
|
|
10
|
+
* corrected cross-request promise semantics (default-on since compatibility
|
|
11
|
+
* date 2024-10-14): continuations are scheduled back into the promise's
|
|
12
|
+
* origin context instead of running in whichever request happens to resolve
|
|
13
|
+
* them. A user pinning an older compatibility date must not silently revert
|
|
14
|
+
* the bridge to the broken semantics, so the flag is forced for
|
|
15
|
+
* alchemy-bundled workers — and explicitly disabling it is a deploy-time
|
|
16
|
+
* error.
|
|
17
|
+
*/
|
|
18
|
+
const CROSS_REQUEST_PROMISE_RESOLUTION =
|
|
19
|
+
"handle_cross_request_promise_resolution";
|
|
20
|
+
|
|
21
|
+
// The date the flag became default-on. Cloudflare rejects a script that
|
|
22
|
+
// specifies a flag its compatibility date already defaults on ("does not
|
|
23
|
+
// need to be specified anymore"), so it is only appended for older dates.
|
|
24
|
+
const CROSS_REQUEST_PROMISE_RESOLUTION_DEFAULT_ON = "2024-10-14";
|
|
25
|
+
|
|
26
|
+
export const getCompatibility = (props: WorkerProps) => {
|
|
27
|
+
const userFlags = props.compatibility?.flags ?? [];
|
|
28
|
+
if (
|
|
29
|
+
!props.isExternal &&
|
|
30
|
+
userFlags.includes(`no_${CROSS_REQUEST_PROMISE_RESOLUTION}`)
|
|
31
|
+
) {
|
|
32
|
+
throw new Error(
|
|
33
|
+
`The "no_${CROSS_REQUEST_PROMISE_RESOLUTION}" compatibility flag is not supported: ` +
|
|
34
|
+
"the alchemy Worker runtime shares its layer build across concurrent " +
|
|
35
|
+
"requests, which requires workerd's corrected cross-request promise " +
|
|
36
|
+
"semantics. Remove the flag from `compatibility.flags`.",
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
const date = props.compatibility?.date ?? DEFAULT_COMPATIBILITY_DATE;
|
|
40
|
+
return {
|
|
41
|
+
date,
|
|
42
|
+
flags: [
|
|
43
|
+
...userFlags,
|
|
44
|
+
...(props.isExternal
|
|
45
|
+
? []
|
|
46
|
+
: [
|
|
47
|
+
"nodejs_compat",
|
|
48
|
+
// ISO dates compare lexically.
|
|
49
|
+
...(date < CROSS_REQUEST_PROMISE_RESOLUTION_DEFAULT_ON
|
|
50
|
+
? [CROSS_REQUEST_PROMISE_RESOLUTION]
|
|
51
|
+
: []),
|
|
52
|
+
]),
|
|
53
|
+
].filter((value, index, self) => self.indexOf(value) === index),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -203,14 +203,15 @@ export const cron = <Req = never>(
|
|
|
203
203
|
process: (
|
|
204
204
|
controller: cf.ScheduledController,
|
|
205
205
|
) => Effect.Effect<void, unknown, Req>,
|
|
206
|
-
)
|
|
206
|
+
): Effect.Effect<void, never, CronEventSource | Exclude<Req, RuntimeContext>> =>
|
|
207
|
+
CronEventSource.use((source) => source(expression, process));
|
|
207
208
|
|
|
208
209
|
export type CronEventSourceService = <Req = never>(
|
|
209
210
|
expression: string,
|
|
210
211
|
process: (
|
|
211
212
|
controller: cf.ScheduledController,
|
|
212
213
|
) => Effect.Effect<void, unknown, Req>,
|
|
213
|
-
) => Effect.Effect<void, never,
|
|
214
|
+
) => Effect.Effect<void, never, Exclude<Req, RuntimeContext>>;
|
|
214
215
|
|
|
215
216
|
export class CronEventSource extends Context.Service<
|
|
216
217
|
CronEventSource,
|
|
@@ -42,43 +42,44 @@ export const makeDurableObjectBridge =
|
|
|
42
42
|
};
|
|
43
43
|
},
|
|
44
44
|
) =>
|
|
45
|
-
(className: string) =>
|
|
46
|
-
|
|
45
|
+
(className: string) => {
|
|
46
|
+
// One isolate-lifetime layer build shared by every activation of this DO
|
|
47
|
+
// class: `build` memoizes the built context, so re-activations (including
|
|
48
|
+
// hibernatable WebSocket wakes, which re-run the constructor) reuse it
|
|
49
|
+
// instead of rebuilding the layer stack.
|
|
50
|
+
const { build } = getWorkerExport<DurableObjectExport>({
|
|
51
|
+
entrypoint,
|
|
52
|
+
stack,
|
|
53
|
+
exportName: className,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
return class DurableObjectBridge extends DurableObject {
|
|
47
57
|
#state;
|
|
48
|
-
#globalContext;
|
|
49
|
-
#exported;
|
|
50
58
|
#instance;
|
|
51
59
|
constructor(state: cf.DurableObjectState, env: any) {
|
|
52
60
|
super(state as any, env);
|
|
53
61
|
this.#state = state;
|
|
54
62
|
|
|
55
|
-
const { globalContext, exported } =
|
|
56
|
-
getWorkerExport<DurableObjectExport>({
|
|
57
|
-
entrypoint,
|
|
58
|
-
stack,
|
|
59
|
-
exportName: className,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
this.#globalContext = globalContext;
|
|
63
|
-
this.#exported = exported;
|
|
64
|
-
|
|
65
63
|
this.#instance = state.blockConcurrencyWhile(() =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
const
|
|
64
|
+
build((promise) => void (state as any).waitUntil?.(promise)).then(
|
|
65
|
+
({ context, export: exported }) => {
|
|
66
|
+
const { constructor, services } = exported;
|
|
67
|
+
const doContext = Layer.succeed(
|
|
69
68
|
DurableObjectState,
|
|
70
69
|
fromDurableObjectState(this.#state),
|
|
71
|
-
).pipe(
|
|
70
|
+
).pipe(
|
|
71
|
+
Layer.provideMerge(Layer.succeedContext(services)),
|
|
72
|
+
Layer.provideMerge(Layer.succeedContext(context)),
|
|
73
|
+
);
|
|
72
74
|
return constructor.pipe(
|
|
73
|
-
Effect.provide(
|
|
75
|
+
Effect.provide(doContext),
|
|
74
76
|
Effect.flatMap((instance) =>
|
|
75
|
-
instance.pipe(Effect.provide(
|
|
77
|
+
instance.pipe(Effect.provide(doContext)),
|
|
76
78
|
),
|
|
77
|
-
Effect.map((instance) => ({ instance, services })),
|
|
79
|
+
Effect.map((instance) => ({ instance, services, context })),
|
|
80
|
+
Effect.runPromise,
|
|
78
81
|
);
|
|
79
|
-
}
|
|
80
|
-
Effect.provide(this.#globalContext),
|
|
81
|
-
Effect.runPromise,
|
|
82
|
+
},
|
|
82
83
|
),
|
|
83
84
|
);
|
|
84
85
|
|
|
@@ -116,11 +117,14 @@ export const makeDurableObjectBridge =
|
|
|
116
117
|
|
|
117
118
|
async #execute(
|
|
118
119
|
fn: (instance: DurableObjectShape) => Effect.Effect<any, any, any>,
|
|
119
|
-
onExit?: (
|
|
120
|
+
onExit?: (
|
|
121
|
+
exit: Exit.Exit<any, any>,
|
|
122
|
+
scope: Scope.Closeable,
|
|
123
|
+
) => Promise<any>,
|
|
120
124
|
) {
|
|
121
125
|
const scope = Scope.makeUnsafe();
|
|
122
126
|
|
|
123
|
-
const { instance, services } = await this.#instance;
|
|
127
|
+
const { instance, services, context } = await this.#instance;
|
|
124
128
|
|
|
125
129
|
return fn(instance)
|
|
126
130
|
.pipe(
|
|
@@ -131,17 +135,17 @@ export const makeDurableObjectBridge =
|
|
|
131
135
|
).pipe(
|
|
132
136
|
Layer.provideMerge(Layer.succeed(Scope.Scope, scope)),
|
|
133
137
|
Layer.provideMerge(Layer.succeedContext(services)),
|
|
134
|
-
Layer.provideMerge(
|
|
138
|
+
Layer.provideMerge(Layer.succeedContext(context)),
|
|
135
139
|
),
|
|
136
140
|
),
|
|
137
141
|
Effect.runPromiseExit,
|
|
138
142
|
)
|
|
139
|
-
.then(
|
|
140
|
-
onExit
|
|
141
|
-
(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
.then((exit) =>
|
|
144
|
+
onExit
|
|
145
|
+
? onExit(exit, scope)
|
|
146
|
+
: exit._tag === "Success"
|
|
147
|
+
? Promise.resolve(exit.value)
|
|
148
|
+
: Promise.reject(Cause.squash(exit.cause)),
|
|
145
149
|
)
|
|
146
150
|
.finally(() =>
|
|
147
151
|
isScopeEjected(scope)
|
|
@@ -194,3 +198,4 @@ export const makeDurableObjectBridge =
|
|
|
194
198
|
);
|
|
195
199
|
}
|
|
196
200
|
} as any;
|
|
201
|
+
};
|
|
@@ -3,7 +3,6 @@ import * as Deferred from "effect/Deferred";
|
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as Option from "effect/Option";
|
|
6
|
-
import * as Scope from "effect/Scope";
|
|
7
6
|
import * as EffectHttp from "effect/unstable/http/HttpEffect";
|
|
8
7
|
import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
|
|
9
8
|
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
|
|
@@ -74,6 +73,4 @@ const toHandledWebResponse = <Req>(
|
|
|
74
73
|
return yield* Deferred.await(webResponse);
|
|
75
74
|
});
|
|
76
75
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export const isScopeEjected = (scope: Scope.Scope) => scopeEjected in scope;
|
|
76
|
+
export { isScopeEjected } from "../../Http.ts";
|