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
|
@@ -6,14 +6,13 @@ import * as ConfigProvider from "effect/ConfigProvider";
|
|
|
6
6
|
import * as Context from "effect/Context";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
8
|
import * as Exit from "effect/Exit";
|
|
9
|
-
import { pipe } from "effect/Function";
|
|
10
9
|
import * as Layer from "effect/Layer";
|
|
11
10
|
import * as Logger from "effect/Logger";
|
|
12
11
|
import { MinimumLogLevel } from "effect/References";
|
|
13
12
|
import * as Scope from "effect/Scope";
|
|
14
13
|
import * as Stream from "effect/Stream";
|
|
15
14
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
16
|
-
import
|
|
15
|
+
import * as EffectHttp from "effect/unstable/http/HttpEffect";
|
|
17
16
|
import { makeEntrypointLayer } from "../../Runtime.ts";
|
|
18
17
|
import { Self } from "../../Self.ts";
|
|
19
18
|
import { Stack } from "../../Stack.ts";
|
|
@@ -37,6 +36,17 @@ import {
|
|
|
37
36
|
} from "./Worker.ts";
|
|
38
37
|
import type { WorkerRuntimeContext } from "./WorkerRuntimeContext.ts";
|
|
39
38
|
|
|
39
|
+
/**
|
|
40
|
+
* The isolate-lifetime artifacts produced by a single layer build: the built
|
|
41
|
+
* service Context, the resolved export for this entrypoint, and the user's
|
|
42
|
+
* RPC shape (a thunk — the shape is only populated once `serve` has run).
|
|
43
|
+
*/
|
|
44
|
+
export interface WorkerBuild<Export = any> {
|
|
45
|
+
readonly context: Context.Context<any>;
|
|
46
|
+
readonly export: Export;
|
|
47
|
+
readonly shape: () => Record<string, any>;
|
|
48
|
+
}
|
|
49
|
+
|
|
40
50
|
/**
|
|
41
51
|
* Makes the WorkerEntrypoint class and bridges to Effect fetch and RPC calls.
|
|
42
52
|
*/
|
|
@@ -53,51 +63,55 @@ export const makeWorkerBridge = (
|
|
|
53
63
|
entrypoint: any;
|
|
54
64
|
},
|
|
55
65
|
) => {
|
|
56
|
-
const {
|
|
66
|
+
const { build } = getWorkerExport({
|
|
57
67
|
entrypoint,
|
|
58
68
|
stack,
|
|
59
69
|
exportName: "default",
|
|
60
70
|
});
|
|
61
71
|
|
|
62
|
-
const processEvent = (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
any
|
|
67
|
-
>,
|
|
72
|
+
const processEvent = <T>(
|
|
73
|
+
makeEffect: (
|
|
74
|
+
build: WorkerBuild,
|
|
75
|
+
) => readonly [Effect.Effect<any, any, any>, Context.Context<never>],
|
|
68
76
|
ctx: cf.ExecutionContext,
|
|
69
|
-
|
|
77
|
+
onExit: (
|
|
78
|
+
exit: Exit.Exit<any, any>,
|
|
79
|
+
scope: Scope.Closeable,
|
|
80
|
+
) => T | Promise<T>,
|
|
81
|
+
): Promise<T> => {
|
|
70
82
|
const scope = Scope.makeUnsafe();
|
|
71
|
-
return
|
|
72
|
-
.
|
|
73
|
-
|
|
74
|
-
eff
|
|
75
|
-
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
// be shadowed by the real per-event
|
|
80
|
-
//
|
|
81
|
-
// scope (closed into
|
|
83
|
+
return build((promise) => ctx.waitUntil(promise as Promise<any>))
|
|
84
|
+
.then(
|
|
85
|
+
(built) => {
|
|
86
|
+
const [eff, services] = makeEffect(built);
|
|
87
|
+
return eff.pipe(
|
|
88
|
+
// Per-event services take precedence over the captured services
|
|
89
|
+
// and the built isolate context: the isolate context carries the
|
|
90
|
+
// *deferred* WorkerExecutionContext (yieldable in the top-level
|
|
91
|
+
// closure), which must be shadowed by the real per-event one
|
|
92
|
+
// here, and the fresh request `Scope` so `Effect.addFinalizer`
|
|
93
|
+
// in a handler attaches to the request scope (closed into
|
|
94
|
+
// `ctx.waitUntil` below).
|
|
82
95
|
Effect.provide(
|
|
83
96
|
Layer.mergeAll(
|
|
84
97
|
Layer.succeed(
|
|
85
98
|
WorkerExecutionContext,
|
|
86
99
|
fromExecutionContext(ctx),
|
|
87
100
|
),
|
|
88
|
-
Layer.succeed(ExecutionContext, {
|
|
89
|
-
scope,
|
|
90
|
-
cache: {},
|
|
91
|
-
}),
|
|
92
101
|
Layer.succeed(Scope.Scope, scope),
|
|
102
|
+
).pipe(
|
|
103
|
+
Layer.provideMerge(Layer.succeedContext(services)),
|
|
104
|
+
Layer.provideMerge(Layer.succeedContext(built.context)),
|
|
93
105
|
),
|
|
94
106
|
),
|
|
95
|
-
Effect.
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
107
|
+
Effect.runPromiseExit,
|
|
108
|
+
);
|
|
109
|
+
},
|
|
110
|
+
// A failed isolate build reaches callers as a defect exit so the RPC
|
|
111
|
+
// path can envelope-encode it like any other handler defect.
|
|
112
|
+
(error) => Exit.die(error),
|
|
100
113
|
)
|
|
114
|
+
.then((exit) => onExit(exit, scope))
|
|
101
115
|
.finally(() =>
|
|
102
116
|
isScopeEjected(scope)
|
|
103
117
|
? undefined
|
|
@@ -115,23 +129,18 @@ export const makeWorkerBridge = (
|
|
|
115
129
|
|
|
116
130
|
for (const methodName of ExportedHandlerMethods) {
|
|
117
131
|
(this as any)[methodName] = async (input: any) =>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
],
|
|
127
|
-
),
|
|
128
|
-
(eff) => processEvent(eff, this.ctx),
|
|
129
|
-
)
|
|
130
|
-
.then((exit) =>
|
|
132
|
+
processEvent(
|
|
133
|
+
(built) =>
|
|
134
|
+
built.export[methodName](input, this.env, this.ctx) as [
|
|
135
|
+
Effect.Effect<any>,
|
|
136
|
+
Context.Context<never>,
|
|
137
|
+
],
|
|
138
|
+
this.ctx,
|
|
139
|
+
(exit) =>
|
|
131
140
|
exit._tag === "Success"
|
|
132
141
|
? Promise.resolve(exit.value)
|
|
133
142
|
: Promise.reject(Cause.squash(exit.cause)),
|
|
134
|
-
|
|
143
|
+
);
|
|
135
144
|
}
|
|
136
145
|
|
|
137
146
|
return new Proxy(this, {
|
|
@@ -139,37 +148,39 @@ export const makeWorkerBridge = (
|
|
|
139
148
|
if (typeof prop !== "string") return (target as any)[prop];
|
|
140
149
|
if (prop in target) return (target as any)[prop];
|
|
141
150
|
return (...args: unknown[]) =>
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
151
|
+
processEvent(
|
|
152
|
+
(built) => {
|
|
153
|
+
const dispatcher = built.shape()?.[prop];
|
|
154
|
+
if (typeof dispatcher !== "function") {
|
|
155
|
+
return [
|
|
156
|
+
Effect.die(
|
|
148
157
|
new Error(
|
|
149
158
|
`Method "${prop}" not found on worker. ` +
|
|
150
159
|
`Make sure it's returned from the worker's default export.`,
|
|
151
160
|
),
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
const result = dispatcher(...args);
|
|
155
|
-
// Effects (including nested-RPC values built by
|
|
156
|
-
// `asEffectOrStream`, which are Effects *branded* as Streams)
|
|
157
|
-
// must be run as effects — their resolved value may itself be
|
|
158
|
-
// a `Stream`, which `handleRpcExit` then encodes. Only a
|
|
159
|
-
// *genuine* `Stream` (not an Effect) is lifted into the
|
|
160
|
-
// success channel so `handleRpcExit` encodes it directly.
|
|
161
|
-
return Effect.succeed([
|
|
162
|
-
Effect.isEffect(result)
|
|
163
|
-
? (result as Effect.Effect<any>)
|
|
164
|
-
: Stream.isStream(result)
|
|
165
|
-
? Effect.succeed(result)
|
|
166
|
-
: (result as Effect.Effect<any>),
|
|
161
|
+
),
|
|
167
162
|
Context.empty(),
|
|
168
|
-
] as const
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
] as const;
|
|
164
|
+
}
|
|
165
|
+
const result = dispatcher(...args);
|
|
166
|
+
// Effects (including nested-RPC values built by
|
|
167
|
+
// `asEffectOrStream`, which are Effects *branded* as Streams)
|
|
168
|
+
// must be run as effects — their resolved value may itself be
|
|
169
|
+
// a `Stream`, which `handleRpcExit` then encodes. Only a
|
|
170
|
+
// *genuine* `Stream` (not an Effect) is lifted into the
|
|
171
|
+
// success channel so `handleRpcExit` encodes it directly.
|
|
172
|
+
return [
|
|
173
|
+
Effect.isEffect(result)
|
|
174
|
+
? (result as Effect.Effect<any>)
|
|
175
|
+
: Stream.isStream(result)
|
|
176
|
+
? Effect.succeed(result)
|
|
177
|
+
: (result as Effect.Effect<any>),
|
|
178
|
+
Context.empty(),
|
|
179
|
+
] as const;
|
|
180
|
+
},
|
|
181
|
+
this.ctx,
|
|
182
|
+
handleRpcExit,
|
|
183
|
+
);
|
|
173
184
|
},
|
|
174
185
|
});
|
|
175
186
|
}
|
|
@@ -193,15 +204,27 @@ export const makeWorkerBridge = (
|
|
|
193
204
|
return WorkerBridge;
|
|
194
205
|
};
|
|
195
206
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
/**
|
|
208
|
+
* One isolate-lifetime layer build per entrypoint module. The generated
|
|
209
|
+
* entry passes the same `meta.entrypoint` object to `makeWorkerBridge`,
|
|
210
|
+
* `makeDurableObjectBridge`, and `makeWorkflowBridge`, so keying on it
|
|
211
|
+
* shares a single build (one run of the user's init closure) across the
|
|
212
|
+
* default worker and every Durable Object / Workflow class in the isolate.
|
|
213
|
+
*/
|
|
214
|
+
const sharedBuilds = new WeakMap<
|
|
215
|
+
object,
|
|
216
|
+
(pin: (promise: Promise<unknown>) => unknown) => Promise<Context.Context<any>>
|
|
217
|
+
>();
|
|
218
|
+
|
|
219
|
+
const getSharedBuild = (
|
|
220
|
+
entrypoint: any,
|
|
221
|
+
stack: { name: string; stage: string },
|
|
222
|
+
) => {
|
|
223
|
+
let shared = sharedBuilds.get(entrypoint);
|
|
224
|
+
if (shared !== undefined) {
|
|
225
|
+
return shared;
|
|
226
|
+
}
|
|
227
|
+
|
|
205
228
|
const tag = Self as any as Context.Service<
|
|
206
229
|
never,
|
|
207
230
|
Worker & {
|
|
@@ -209,17 +232,6 @@ export const getWorkerExport = <Export = any>({
|
|
|
209
232
|
}
|
|
210
233
|
>;
|
|
211
234
|
|
|
212
|
-
const runtimeContext = tag.pipe(Effect.map((func) => func.RuntimeContext));
|
|
213
|
-
const shape = runtimeContext.pipe(Effect.map((context) => context.shape()));
|
|
214
|
-
const exported = runtimeContext.pipe(
|
|
215
|
-
Effect.flatMap((context) => context.exports),
|
|
216
|
-
Effect.flatMap((exports) =>
|
|
217
|
-
Effect.isEffect(exports[exportName])
|
|
218
|
-
? exports[exportName]
|
|
219
|
-
: Effect.succeed(exports[exportName]),
|
|
220
|
-
),
|
|
221
|
-
) as Effect.Effect<Export>;
|
|
222
|
-
|
|
223
235
|
const layer = makeEntrypointLayer(tag, entrypoint);
|
|
224
236
|
|
|
225
237
|
const platform = Layer.mergeAll(
|
|
@@ -229,15 +241,15 @@ export const getWorkerExport = <Export = any>({
|
|
|
229
241
|
Logger.layer([Logger.consolePretty()]),
|
|
230
242
|
);
|
|
231
243
|
|
|
232
|
-
//
|
|
233
|
-
//
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
// `processEvent`, which closes into `ctx.waitUntil` after the response.
|
|
244
|
+
// Private scope for the isolate-lifetime layer build. Never closed —
|
|
245
|
+
// workerd has no isolate-teardown hook, so finalizers attached here can
|
|
246
|
+
// never run. It exists only because `Layer.buildWithMemoMap` requires a
|
|
247
|
+
// scope argument (`Layer.scoped`-style layers attach their finalizers to
|
|
248
|
+
// it). It is deliberately NOT provided as the ambient `Scope.Scope` of the
|
|
249
|
+
// init context: request-coupled resources are acquired inside handlers
|
|
250
|
+
// against the per-event scope that `processEvent` provides.
|
|
240
251
|
const instanceScope = Scope.makeUnsafe();
|
|
252
|
+
const memoMap = Layer.makeMemoMapUnsafe();
|
|
241
253
|
|
|
242
254
|
const globalContext = Layer.unwrap(
|
|
243
255
|
cloudflare_workers.pipe(
|
|
@@ -286,17 +298,111 @@ export const getWorkerExport = <Export = any>({
|
|
|
286
298
|
(env as any).DEBUG ? "Debug" : "Info",
|
|
287
299
|
),
|
|
288
300
|
),
|
|
289
|
-
Layer.provideMerge(Layer.succeed(Scope.Scope, instanceScope)),
|
|
290
301
|
),
|
|
291
302
|
),
|
|
292
303
|
),
|
|
293
304
|
);
|
|
294
305
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
306
|
+
let built: Promise<Context.Context<any>> | undefined;
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Build the isolate-lifetime layer stack exactly once; every subsequent
|
|
310
|
+
* event (and every export sharing this entrypoint) reuses the memoized
|
|
311
|
+
* Context.
|
|
312
|
+
*
|
|
313
|
+
* `pin` registers the in-flight build promise with the calling event
|
|
314
|
+
* (`ctx.waitUntil` / `state.waitUntil`). Every awaiting event must pin:
|
|
315
|
+
* workerd schedules a promise's continuations back into its origin request
|
|
316
|
+
* context and *drops* them if that context has ended
|
|
317
|
+
* (`handle_cross_request_promise_resolution`), so the origin event must be
|
|
318
|
+
* kept alive until the build settles or concurrent cold-start requests
|
|
319
|
+
* would hang.
|
|
320
|
+
*
|
|
321
|
+
* Only success is memoized — a transient init failure (e.g. a flaky
|
|
322
|
+
* `Config` read in user init) resets the memo and heals on the next event.
|
|
323
|
+
*/
|
|
324
|
+
shared = (pin) => {
|
|
325
|
+
const promise = (built ??= Effect.runPromise(
|
|
326
|
+
Layer.buildWithMemoMap(globalContext, memoMap, instanceScope).pipe(
|
|
327
|
+
// Strip the build's memo map from the exposed context so a Layer the
|
|
328
|
+
// user `Effect.provide`s *inside a handler* builds per event instead
|
|
329
|
+
// of sharing one instance (pinned to the first request's IoContext)
|
|
330
|
+
// across concurrent events.
|
|
331
|
+
Effect.map(Context.omit(Layer.CurrentMemoMap)),
|
|
332
|
+
),
|
|
333
|
+
).catch((error) => {
|
|
334
|
+
built = undefined;
|
|
335
|
+
throw error;
|
|
336
|
+
}));
|
|
337
|
+
pin(promise.catch(() => {}));
|
|
338
|
+
return promise;
|
|
339
|
+
};
|
|
340
|
+
sharedBuilds.set(entrypoint, shared);
|
|
341
|
+
return shared;
|
|
342
|
+
};
|
|
343
|
+
|
|
344
|
+
export const getWorkerExport = <Export = any>({
|
|
345
|
+
entrypoint,
|
|
346
|
+
stack,
|
|
347
|
+
exportName,
|
|
348
|
+
}: {
|
|
349
|
+
entrypoint: any;
|
|
350
|
+
stack: { name: string; stage: string };
|
|
351
|
+
exportName: string;
|
|
352
|
+
}) => {
|
|
353
|
+
const tag = Self as any as Context.Service<
|
|
354
|
+
never,
|
|
355
|
+
Worker & {
|
|
356
|
+
RuntimeContext: WorkerRuntimeContext;
|
|
357
|
+
}
|
|
358
|
+
>;
|
|
359
|
+
|
|
360
|
+
const runtimeContext = tag.pipe(Effect.map((func) => func.RuntimeContext));
|
|
361
|
+
const exported = runtimeContext.pipe(
|
|
362
|
+
Effect.flatMap((context) => context.exports),
|
|
363
|
+
Effect.flatMap((exports) =>
|
|
364
|
+
Effect.isEffect(exports[exportName])
|
|
365
|
+
? exports[exportName]
|
|
366
|
+
: Effect.succeed(exports[exportName]),
|
|
367
|
+
),
|
|
368
|
+
) as Effect.Effect<Export>;
|
|
369
|
+
|
|
370
|
+
const sharedBuild = getSharedBuild(entrypoint, stack);
|
|
371
|
+
|
|
372
|
+
let built: Promise<WorkerBuild<Export>> | undefined;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Resolve this export against the shared isolate build; memoized so
|
|
376
|
+
* listener assembly and the captured services context resolve once per
|
|
377
|
+
* export. Same success-only memoization contract as the shared build.
|
|
378
|
+
*/
|
|
379
|
+
const build = (
|
|
380
|
+
pin: (promise: Promise<unknown>) => unknown,
|
|
381
|
+
): Promise<WorkerBuild<Export>> => {
|
|
382
|
+
const promise = (built ??= sharedBuild(pin)
|
|
383
|
+
.then((context) =>
|
|
384
|
+
Effect.runPromise(
|
|
385
|
+
Effect.all([exported, runtimeContext]).pipe(
|
|
386
|
+
Effect.map(
|
|
387
|
+
([exp, rc]): WorkerBuild<Export> => ({
|
|
388
|
+
context,
|
|
389
|
+
export: exp,
|
|
390
|
+
shape: rc.shape,
|
|
391
|
+
}),
|
|
392
|
+
),
|
|
393
|
+
Effect.provideContext(context),
|
|
394
|
+
),
|
|
395
|
+
),
|
|
396
|
+
)
|
|
397
|
+
.catch((error) => {
|
|
398
|
+
built = undefined;
|
|
399
|
+
throw error;
|
|
400
|
+
}));
|
|
401
|
+
pin(promise.catch(() => {}));
|
|
402
|
+
return promise;
|
|
299
403
|
};
|
|
404
|
+
|
|
405
|
+
return { build };
|
|
300
406
|
};
|
|
301
407
|
|
|
302
408
|
export const makeRpcProxy = (
|
|
@@ -338,15 +444,30 @@ export const makeRpcProxy = (
|
|
|
338
444
|
}),
|
|
339
445
|
processEvent,
|
|
340
446
|
)
|
|
341
|
-
.then(handleRpcExit);
|
|
447
|
+
.then((exit) => handleRpcExit(exit));
|
|
342
448
|
},
|
|
343
449
|
});
|
|
344
450
|
|
|
345
|
-
export const handleRpcExit = async (
|
|
451
|
+
export const handleRpcExit = async (
|
|
452
|
+
exit: Exit.Exit<any, any>,
|
|
453
|
+
scope?: Scope.Closeable,
|
|
454
|
+
) => {
|
|
346
455
|
if (exit._tag === "Success") {
|
|
347
456
|
if (Stream.isStream(exit.value)) {
|
|
457
|
+
let stream = exit.value as Stream.Stream<any, any, any>;
|
|
458
|
+
if (scope !== undefined && !isScopeEjected(scope)) {
|
|
459
|
+
// The RPC transport drains the encoded ReadableStream *after* this
|
|
460
|
+
// function returns, so the request scope must outlive the handler:
|
|
461
|
+
// eject it from the bridge's close-on-return path and close it when
|
|
462
|
+
// the stream settles instead — mirroring `scopeTransferToStream` on
|
|
463
|
+
// the fetch path.
|
|
464
|
+
EffectHttp.scopeDisableClose(scope);
|
|
465
|
+
stream = stream.pipe(
|
|
466
|
+
Stream.onExit((streamExit) => Scope.close(scope, streamExit)),
|
|
467
|
+
);
|
|
468
|
+
}
|
|
348
469
|
return await Effect.runPromise(
|
|
349
|
-
toRpcStream(
|
|
470
|
+
toRpcStream(stream) as Effect.Effect<RpcStreamEnvelope>,
|
|
350
471
|
);
|
|
351
472
|
}
|
|
352
473
|
return exit.value;
|
|
@@ -125,7 +125,7 @@ const isBindingTargetNotFound = (
|
|
|
125
125
|
e._tag === "MtlsCertificateNotFound";
|
|
126
126
|
|
|
127
127
|
const bindingTargetNotFoundRetrySchedule = () =>
|
|
128
|
-
Schedule.fixed("2 seconds")
|
|
128
|
+
Schedule.max([Schedule.fixed("2 seconds"), Schedule.recurs(10)]);
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
131
|
* Upsert a Worker script, routing to the dispatch-namespace endpoint when
|
|
@@ -488,9 +488,10 @@ export const LiveWorkerProvider = () =>
|
|
|
488
488
|
.pipe(
|
|
489
489
|
Effect.retry({
|
|
490
490
|
while: (error) => error._tag === "WorkerNotFound",
|
|
491
|
-
schedule: Schedule.
|
|
492
|
-
Schedule.
|
|
493
|
-
|
|
491
|
+
schedule: Schedule.max([
|
|
492
|
+
Schedule.exponential(200),
|
|
493
|
+
Schedule.recurs(15),
|
|
494
|
+
]),
|
|
494
495
|
}),
|
|
495
496
|
);
|
|
496
497
|
return normalizeCrons(
|
|
@@ -640,9 +641,10 @@ export const LiveWorkerProvider = () =>
|
|
|
640
641
|
.pipe(
|
|
641
642
|
Effect.retry({
|
|
642
643
|
while: (error) => error._tag === "WorkerNotFound",
|
|
643
|
-
schedule: Schedule.
|
|
644
|
-
Schedule.
|
|
645
|
-
|
|
644
|
+
schedule: Schedule.max([
|
|
645
|
+
Schedule.exponential(200),
|
|
646
|
+
Schedule.recurs(15),
|
|
647
|
+
]),
|
|
646
648
|
}),
|
|
647
649
|
);
|
|
648
650
|
return {
|
|
@@ -841,9 +843,10 @@ export const LiveWorkerProvider = () =>
|
|
|
841
843
|
// typed as `RouteScriptNotFound` via the createRoute patch.
|
|
842
844
|
Effect.retry({
|
|
843
845
|
while: (error) => error._tag === "RouteScriptNotFound",
|
|
844
|
-
schedule: Schedule.
|
|
845
|
-
Schedule.
|
|
846
|
-
|
|
846
|
+
schedule: Schedule.max([
|
|
847
|
+
Schedule.exponential(200),
|
|
848
|
+
Schedule.recurs(15),
|
|
849
|
+
]),
|
|
847
850
|
}),
|
|
848
851
|
Effect.catchTag("InvalidRoute", (originalError) =>
|
|
849
852
|
Effect.gen(function* () {
|
|
@@ -968,9 +971,10 @@ export const LiveWorkerProvider = () =>
|
|
|
968
971
|
error._tag === "WorkerNotFound" ||
|
|
969
972
|
error._tag === "DispatchNamespaceScriptNotFound" ||
|
|
970
973
|
error._tag === "DispatchNamespaceNotFound",
|
|
971
|
-
schedule: Schedule.
|
|
972
|
-
Schedule.
|
|
973
|
-
|
|
974
|
+
schedule: Schedule.max([
|
|
975
|
+
Schedule.exponential(100),
|
|
976
|
+
Schedule.recurs(20),
|
|
977
|
+
]),
|
|
974
978
|
}),
|
|
975
979
|
);
|
|
976
980
|
});
|
|
@@ -1055,6 +1059,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1055
1059
|
)).filter(([_, value]) => value !== undefined),
|
|
1056
1060
|
),
|
|
1057
1061
|
{
|
|
1062
|
+
main: props.vite?.main,
|
|
1058
1063
|
compatibilityDate: compatibility.date,
|
|
1059
1064
|
compatibilityFlags: compatibility.flags,
|
|
1060
1065
|
viteEnvironments: props.vite?.viteEnvironments,
|
|
@@ -1630,9 +1635,10 @@ export const LiveWorkerProvider = () =>
|
|
|
1630
1635
|
error._tag === "WorkerNotFound" ||
|
|
1631
1636
|
error._tag === "InternalServerError" ||
|
|
1632
1637
|
error._tag === "UnknownCloudflareError",
|
|
1633
|
-
schedule: Schedule.
|
|
1634
|
-
Schedule.
|
|
1635
|
-
|
|
1638
|
+
schedule: Schedule.max([
|
|
1639
|
+
Schedule.exponential(200),
|
|
1640
|
+
Schedule.recurs(15),
|
|
1641
|
+
]),
|
|
1636
1642
|
}),
|
|
1637
1643
|
);
|
|
1638
1644
|
}
|
|
@@ -2134,9 +2140,10 @@ export const LiveWorkerProvider = () =>
|
|
|
2134
2140
|
while: (e) =>
|
|
2135
2141
|
e._tag === "InternalServerError" ||
|
|
2136
2142
|
e._tag === "UnknownCloudflareError",
|
|
2137
|
-
schedule: Schedule.
|
|
2138
|
-
Schedule.
|
|
2139
|
-
|
|
2143
|
+
schedule: Schedule.max([
|
|
2144
|
+
Schedule.exponential(1000),
|
|
2145
|
+
Schedule.recurs(5),
|
|
2146
|
+
]),
|
|
2140
2147
|
}),
|
|
2141
2148
|
);
|
|
2142
2149
|
if (doClasses.length > 0) {
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
// Start the import at module evaluation (legal since workerd's 2025-03
|
|
4
|
+
// importable-env change) so the isolate-lifetime layer build that awaits it
|
|
5
|
+
// only ever sees an already-settled promise. This keeps the first event's
|
|
6
|
+
// build free of I/O-backed awaits: everything after this is pure layer
|
|
7
|
+
// assembly plus scheduler microtasks. Outside workerd (deploy/plan in Node,
|
|
8
|
+
// vitest) the import rejects and the fallback stub is used; the `.catch` is
|
|
9
|
+
// attached immediately so the rejection is always handled.
|
|
10
|
+
const modulePromise: Promise<typeof import("cloudflare:workers")> =
|
|
11
|
+
import("cloudflare:workers").catch(
|
|
12
|
+
() =>
|
|
13
|
+
({
|
|
14
|
+
env: {},
|
|
15
|
+
DurableObject: class {},
|
|
16
|
+
WorkflowEntrypoint: class {
|
|
17
|
+
async run() {}
|
|
18
|
+
},
|
|
19
|
+
}) as any,
|
|
15
20
|
);
|
|
16
21
|
|
|
22
|
+
const cloudflare_workers: Effect.Effect<typeof import("cloudflare:workers")> =
|
|
23
|
+
Effect.promise(() => modulePromise);
|
|
24
|
+
|
|
17
25
|
export default cloudflare_workers;
|