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
|
@@ -2,9 +2,9 @@ import * as workflows from "@distilled.cloud/cloudflare/workflows";
|
|
|
2
2
|
import type { ConfigError } from "effect/Config";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import type { Scope } from "effect/Scope";
|
|
5
6
|
import * as Stream from "effect/Stream";
|
|
6
7
|
import { AlchemyContext } from "../../AlchemyContext.ts";
|
|
7
|
-
import { ExecutionContext } from "../../ExecutionContext.ts";
|
|
8
8
|
import type { Input } from "../../Input.ts";
|
|
9
9
|
import { ALCHEMY_PHASE } from "../../Phase.ts";
|
|
10
10
|
import type { PlatformServices } from "../../Platform.ts";
|
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
WorkerEnvironment,
|
|
19
19
|
type WorkerServices,
|
|
20
20
|
} from "../Workers/Worker.ts";
|
|
21
|
+
import { makeWorkflowName } from "./WorkflowName.ts";
|
|
21
22
|
|
|
22
23
|
type TypeId = "Cloudflare.Workflow";
|
|
23
24
|
const TypeId = "Cloudflare.Workflow" as const;
|
|
@@ -243,17 +244,17 @@ export const waitForEvent = <T = unknown>(
|
|
|
243
244
|
* reflect that or `yield* WorkerEnvironment` fails to type-check inside a
|
|
244
245
|
* body even though it succeeds at runtime.
|
|
245
246
|
*
|
|
246
|
-
* `
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* resolve
|
|
250
|
-
* Worker `fetch`/`queue` handler.
|
|
247
|
+
* A fresh `Scope` is provided per run-invocation by `WorkflowBridge.run` and
|
|
248
|
+
* threaded into every `task` via the surrounding body context, so `@binding`
|
|
249
|
+
* helpers that acquire per-run resources against the ambient scope (e.g.
|
|
250
|
+
* `Drizzle.postgres`) resolve them inside workflow steps just as they do in
|
|
251
|
+
* a Worker `fetch`/`queue` handler.
|
|
251
252
|
*/
|
|
252
253
|
export type WorkflowRunServices =
|
|
253
254
|
| WorkflowEvent
|
|
254
255
|
| WorkflowStep
|
|
255
256
|
| WorkerServices
|
|
256
|
-
|
|
|
257
|
+
| Scope;
|
|
257
258
|
|
|
258
259
|
export type WorkflowServices =
|
|
259
260
|
| WorkflowRunServices
|
|
@@ -759,7 +760,6 @@ export const Workflow: WorkflowClass = taggedFunction(WorkflowScope, ((
|
|
|
759
760
|
return {
|
|
760
761
|
kind: TypeId,
|
|
761
762
|
name,
|
|
762
|
-
workflowName: name,
|
|
763
763
|
className: props?.className ?? name,
|
|
764
764
|
scriptName: props?.scriptName,
|
|
765
765
|
} satisfies WorkflowLike;
|
|
@@ -769,25 +769,27 @@ export const Workflow: WorkflowClass = taggedFunction(WorkflowScope, ((
|
|
|
769
769
|
Effect.gen(function* () {
|
|
770
770
|
const worker = yield* Worker;
|
|
771
771
|
|
|
772
|
+
// Workflow names are account-global, so derive the physical name from
|
|
773
|
+
// the already-unique host Worker name and exported class name.
|
|
774
|
+
const workflowName = makeWorkflowName(worker.workerName, name);
|
|
775
|
+
const workflow = yield* WorkflowResource(name, {
|
|
776
|
+
workflowName,
|
|
777
|
+
className: name,
|
|
778
|
+
scriptName: worker.workerName,
|
|
779
|
+
});
|
|
780
|
+
|
|
772
781
|
// Add the workflow binding to the Worker metadata
|
|
773
782
|
yield* worker.bind`${name}`({
|
|
774
783
|
bindings: [
|
|
775
784
|
{
|
|
776
785
|
type: "workflow",
|
|
777
786
|
name,
|
|
778
|
-
workflowName:
|
|
787
|
+
workflowName: workflow.workflowName,
|
|
779
788
|
className: name,
|
|
780
789
|
},
|
|
781
790
|
],
|
|
782
791
|
});
|
|
783
792
|
|
|
784
|
-
// Create the Workflow API resource (putWorkflow / deleteWorkflow)
|
|
785
|
-
yield* WorkflowResource(name, {
|
|
786
|
-
workflowName: name,
|
|
787
|
-
className: name,
|
|
788
|
-
scriptName: worker.workerName,
|
|
789
|
-
});
|
|
790
|
-
|
|
791
793
|
const services = yield* Effect.context<Effect.Services<typeof impl>>();
|
|
792
794
|
|
|
793
795
|
const binding = yield* Effect.all([
|
|
@@ -854,6 +856,9 @@ export const Workflow: WorkflowClass = taggedFunction(WorkflowScope, ((
|
|
|
854
856
|
// ---------------------------------------------------------------------------
|
|
855
857
|
|
|
856
858
|
export interface WorkflowResourceProps {
|
|
859
|
+
/**
|
|
860
|
+
* Account-global Workflow name.
|
|
861
|
+
*/
|
|
857
862
|
workflowName: string;
|
|
858
863
|
className: string;
|
|
859
864
|
scriptName: string;
|
|
@@ -887,7 +892,7 @@ export const WorkflowProvider = () =>
|
|
|
887
892
|
|
|
888
893
|
return WorkflowResource.Provider.of({
|
|
889
894
|
// The `workflowId` is no longer marked as stable because if you start in dev mode, the ID will change on first deploy.
|
|
890
|
-
stables: ["accountId"],
|
|
895
|
+
stables: ["accountId", "workflowName"],
|
|
891
896
|
// Workflows are account-scoped. Enumerate every workflow in the account
|
|
892
897
|
// via the paginated list API and hydrate each into the same Attributes
|
|
893
898
|
// shape `reconcile` returns (id/name/className/scriptName are all on the
|
|
@@ -918,17 +923,46 @@ export const WorkflowProvider = () =>
|
|
|
918
923
|
return { action: "update" };
|
|
919
924
|
}
|
|
920
925
|
}),
|
|
926
|
+
read: Effect.fn(function* ({ output, olds }) {
|
|
927
|
+
// Dev workflows only exist in local state; there is no account-level
|
|
928
|
+
// Workflow API resource to observe until the first real deploy.
|
|
929
|
+
if (ctx.dev) return output;
|
|
930
|
+
|
|
931
|
+
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
932
|
+
const workflowName = output?.workflowName ?? olds?.workflowName;
|
|
933
|
+
if (workflowName === undefined) return undefined;
|
|
934
|
+
|
|
935
|
+
const acct = output?.accountId ?? accountId;
|
|
936
|
+
return yield* workflows
|
|
937
|
+
.getWorkflow({
|
|
938
|
+
accountId: acct,
|
|
939
|
+
workflowName,
|
|
940
|
+
})
|
|
941
|
+
.pipe(
|
|
942
|
+
Effect.map((workflow) => ({
|
|
943
|
+
workflowId: workflow.id,
|
|
944
|
+
workflowName: workflow.name,
|
|
945
|
+
className: workflow.className,
|
|
946
|
+
scriptName: workflow.scriptName,
|
|
947
|
+
accountId: acct,
|
|
948
|
+
})),
|
|
949
|
+
Effect.catchTag("WorkflowNotFound", () =>
|
|
950
|
+
Effect.succeed(undefined),
|
|
951
|
+
),
|
|
952
|
+
);
|
|
953
|
+
}),
|
|
921
954
|
reconcile: Effect.fn(function* ({ news, output }) {
|
|
922
955
|
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
923
956
|
const acct = output?.accountId ?? accountId;
|
|
957
|
+
const workflowName = news.workflowName;
|
|
924
958
|
yield* Effect.logInfo(
|
|
925
|
-
`Cloudflare Workflow reconcile: ${
|
|
959
|
+
`Cloudflare Workflow reconcile: ${workflowName}`,
|
|
926
960
|
);
|
|
927
961
|
if (ctx.dev) {
|
|
928
962
|
return {
|
|
929
963
|
workflowId: output?.workflowId ?? `dev:${crypto.randomUUID()}`,
|
|
930
964
|
accountId,
|
|
931
|
-
workflowName
|
|
965
|
+
workflowName,
|
|
932
966
|
className: news.className,
|
|
933
967
|
scriptName: news.scriptName,
|
|
934
968
|
};
|
|
@@ -939,7 +973,7 @@ export const WorkflowProvider = () =>
|
|
|
939
973
|
// — the API is naturally reconciler-shaped.
|
|
940
974
|
const result = yield* workflows.putWorkflow({
|
|
941
975
|
accountId: acct,
|
|
942
|
-
workflowName
|
|
976
|
+
workflowName,
|
|
943
977
|
className: news.className,
|
|
944
978
|
scriptName: news.scriptName,
|
|
945
979
|
});
|
|
@@ -3,7 +3,6 @@ import * as Effect from "effect/Effect";
|
|
|
3
3
|
import * as Exit from "effect/Exit";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as Scope from "effect/Scope";
|
|
6
|
-
import { ExecutionContext } from "../../ExecutionContext.ts";
|
|
7
6
|
import { isScopeEjected } from "../Workers/HttpServer.ts";
|
|
8
7
|
import { getWorkerExport } from "../Workers/WorkerBridge.ts";
|
|
9
8
|
import {
|
|
@@ -40,35 +39,34 @@ export const makeWorkflowBridge =
|
|
|
40
39
|
stack: { name: string; stage: string };
|
|
41
40
|
},
|
|
42
41
|
) =>
|
|
43
|
-
(className: string) =>
|
|
44
|
-
|
|
42
|
+
(className: string) => {
|
|
43
|
+
// One isolate-lifetime layer build shared by every instantiation of this
|
|
44
|
+
// workflow class — `build` memoizes the built context.
|
|
45
|
+
const { build } = getWorkerExport<WorkflowExport>({
|
|
46
|
+
entrypoint,
|
|
47
|
+
stack,
|
|
48
|
+
exportName: className,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return class WorkflowBridge extends WorkflowEntrypoint {
|
|
45
52
|
readonly fn: Promise<WorkflowImpl<unknown, unknown>>;
|
|
46
53
|
|
|
47
54
|
constructor(ctx: unknown, env: unknown) {
|
|
48
55
|
super(ctx, env);
|
|
49
56
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
stack,
|
|
53
|
-
exportName: className,
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
this.fn = exported.pipe(
|
|
57
|
-
Effect.flatMap((wf) => wf.make(env)),
|
|
58
|
-
Effect.provide(globalContext),
|
|
59
|
-
Effect.runPromise,
|
|
57
|
+
this.fn = build(() => {}).then(({ context, export: wf }) =>
|
|
58
|
+
wf.make(env).pipe(Effect.provideContext(context), Effect.runPromise),
|
|
60
59
|
) as Promise<WorkflowImpl<unknown, unknown>>;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
62
|
async run(event: any, step: any): Promise<unknown> {
|
|
64
63
|
const fn = await this.fn;
|
|
65
|
-
// Each run-invocation gets a fresh
|
|
66
|
-
//
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
// (e.g. `Drizzle.postgres`) resolve
|
|
70
|
-
// workflow steps
|
|
71
|
-
// `Scope` service, matching the Worker and Durable Object bridges.
|
|
64
|
+
// Each run-invocation gets a fresh `Scope`, following the same
|
|
65
|
+
// per-invocation-scope pattern as `WorkerBridge.processEvent`. `task`
|
|
66
|
+
// threads it into every step via the surrounding body context, so
|
|
67
|
+
// `@binding` helpers that acquire per-run resources against the
|
|
68
|
+
// ambient scope (e.g. `Drizzle.postgres`) resolve them inside
|
|
69
|
+
// workflow steps, matching the Worker and Durable Object bridges.
|
|
72
70
|
const scope = Scope.makeUnsafe();
|
|
73
71
|
const exit = await Effect.runPromiseExit(
|
|
74
72
|
fn(event.payload).pipe(
|
|
@@ -80,9 +78,6 @@ export const makeWorkflowBridge =
|
|
|
80
78
|
Layer.provideMerge(
|
|
81
79
|
Layer.succeed(WorkflowStep, wrapWorkflowStep(step)),
|
|
82
80
|
),
|
|
83
|
-
Layer.provideMerge(
|
|
84
|
-
Layer.succeed(ExecutionContext, { scope, cache: {} }),
|
|
85
|
-
),
|
|
86
81
|
Layer.provideMerge(Layer.succeed(Scope.Scope, scope)),
|
|
87
82
|
),
|
|
88
83
|
),
|
|
@@ -108,6 +103,7 @@ export const makeWorkflowBridge =
|
|
|
108
103
|
throw Cause.squash(exit.cause);
|
|
109
104
|
}
|
|
110
105
|
};
|
|
106
|
+
};
|
|
111
107
|
|
|
112
108
|
const wrapWorkflowEvent = (event: any): WorkflowEventService["Service"] => ({
|
|
113
109
|
payload: event.payload,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import type { Input } from "../../Input.ts";
|
|
3
|
+
import * as Output from "../../Output.ts";
|
|
4
|
+
import { sha256 } from "../../Util/sha256.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Derive an account-global Workflow name from its unique host Worker name and
|
|
8
|
+
* exported class. The hash preserves uniqueness when the readable prefix must
|
|
9
|
+
* be truncated to Cloudflare's 64-character limit.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
export const makeWorkflowName = (
|
|
14
|
+
scriptName: Input<string>,
|
|
15
|
+
className: string,
|
|
16
|
+
): Output.Output<string> => {
|
|
17
|
+
const resolvedScriptName = Effect.isEffect(scriptName)
|
|
18
|
+
? scriptName.pipe(Effect.orDie)
|
|
19
|
+
: scriptName;
|
|
20
|
+
return Output.asOutput(
|
|
21
|
+
resolvedScriptName as
|
|
22
|
+
| string
|
|
23
|
+
| Output.Output<string>
|
|
24
|
+
| Effect.Effect<string>,
|
|
25
|
+
).pipe(
|
|
26
|
+
Output.mapEffect((scriptName) => {
|
|
27
|
+
const base = `${scriptName}-${className}`
|
|
28
|
+
.toLowerCase()
|
|
29
|
+
.replaceAll(/[^a-z0-9-]/g, "-");
|
|
30
|
+
return sha256(base).pipe(
|
|
31
|
+
Effect.map((hash) => {
|
|
32
|
+
const suffix = `-${hash.slice(0, 8)}`;
|
|
33
|
+
// Trim trailing dashes left by mid-name truncation so the result
|
|
34
|
+
// never contains a `--` seam.
|
|
35
|
+
const head = base.slice(0, 64 - suffix.length).replace(/-+$/, "");
|
|
36
|
+
return `${head}${suffix}`;
|
|
37
|
+
}),
|
|
38
|
+
);
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
};
|
|
@@ -109,10 +109,13 @@ export const isHold = (value: unknown): value is Hold =>
|
|
|
109
109
|
// Cloudflare can transiently fail to authenticate a valid token, surfacing as
|
|
110
110
|
// `Forbidden`. Retry with exponential backoff capped at 5s, bounded to ~8
|
|
111
111
|
// attempts so a persistently-unauthorized call still fails fast.
|
|
112
|
-
const forbiddenRetrySchedule = Schedule.
|
|
113
|
-
Schedule.
|
|
114
|
-
|
|
115
|
-
)
|
|
112
|
+
const forbiddenRetrySchedule = Schedule.max([
|
|
113
|
+
Schedule.min([
|
|
114
|
+
Schedule.exponential("500 millis"),
|
|
115
|
+
Schedule.spaced("5 seconds"),
|
|
116
|
+
]),
|
|
117
|
+
Schedule.recurs(8),
|
|
118
|
+
]);
|
|
116
119
|
|
|
117
120
|
export const HoldProvider = () =>
|
|
118
121
|
Provider.succeed(Hold, {
|
package/src/Command/Dev.ts
CHANGED
|
@@ -22,8 +22,10 @@ export interface Dev extends Resource<
|
|
|
22
22
|
DevProps,
|
|
23
23
|
{
|
|
24
24
|
/**
|
|
25
|
-
* URL extracted from
|
|
26
|
-
*
|
|
25
|
+
* URL extracted from stdout/stderr. A `localhost`/IP URL (the dev
|
|
26
|
+
* server's own address) is preferred over any other URL the command
|
|
27
|
+
* prints; a non-local URL is only used as a fallback if no local one
|
|
28
|
+
* appears. Best-effort: `undefined` if no URL appears within 5 seconds.
|
|
27
29
|
*/
|
|
28
30
|
url: string | undefined;
|
|
29
31
|
}
|
|
@@ -37,10 +39,11 @@ export interface Dev extends Resource<
|
|
|
37
39
|
* The child process runs inside the dev sidecar (see `Command/Local.ts`) so it
|
|
38
40
|
* survives user-code HMR — Alchemy's user process can restart without killing
|
|
39
41
|
* your `npm run dev` server. Its stdout/stderr are mirrored to the terminal
|
|
40
|
-
* (preserving colored output) and
|
|
41
|
-
* `
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* (preserving colored output) and scanned for an `http(s)://…` URL, favoring
|
|
43
|
+
* a `localhost`/IP URL (the dev server's own address) over any unrelated URL
|
|
44
|
+
* the command prints first. The result is exposed as the `url` output
|
|
45
|
+
* attribute — useful for surfacing a dev server's local URL back out to
|
|
46
|
+
* whatever resource declared this `Dev`.
|
|
44
47
|
*
|
|
45
48
|
* @resource
|
|
46
49
|
*
|
|
@@ -119,6 +122,11 @@ export const DevProviderLocal = () =>
|
|
|
119
122
|
const child = yield* spawn(props);
|
|
120
123
|
|
|
121
124
|
let buffer = "";
|
|
125
|
+
// A non-local URL seen so far (docs link, error page, update notice,
|
|
126
|
+
// …). Held as a fallback so that if the dev server never prints a
|
|
127
|
+
// localhost/IP URL we still surface something, but a localhost URL
|
|
128
|
+
// always wins if one shows up. See issue #695.
|
|
129
|
+
let fallbackUrl: string | undefined;
|
|
122
130
|
const deferred = yield* Deferred.make<string>();
|
|
123
131
|
|
|
124
132
|
const mirror = (sink: "stdout" | "stderr") =>
|
|
@@ -132,8 +140,13 @@ export const DevProviderLocal = () =>
|
|
|
132
140
|
if (Deferred.isDoneUnsafe(deferred)) return;
|
|
133
141
|
buffer += text;
|
|
134
142
|
const url = extractUrl(buffer);
|
|
135
|
-
if (url)
|
|
143
|
+
if (!url) return;
|
|
144
|
+
if (isLocalUrl(url)) {
|
|
145
|
+
// The dev server's own address — resolve immediately.
|
|
136
146
|
Deferred.doneUnsafe(deferred, Effect.succeed(url));
|
|
147
|
+
} else {
|
|
148
|
+
// Keep scanning: a localhost/IP URL may still appear.
|
|
149
|
+
fallbackUrl = url;
|
|
137
150
|
}
|
|
138
151
|
}),
|
|
139
152
|
),
|
|
@@ -147,7 +160,9 @@ export const DevProviderLocal = () =>
|
|
|
147
160
|
Deferred.await(deferred).pipe(
|
|
148
161
|
Effect.timeoutOrElse({
|
|
149
162
|
duration: "5 seconds",
|
|
150
|
-
|
|
163
|
+
// No localhost/IP URL appeared in time — fall back to any other
|
|
164
|
+
// URL we saw (or `undefined` if the process stayed silent).
|
|
165
|
+
orElse: () => Effect.succeed(fallbackUrl),
|
|
151
166
|
}),
|
|
152
167
|
),
|
|
153
168
|
child.exitCode.pipe(
|
|
@@ -206,6 +221,13 @@ export const DevProviderLocal = () =>
|
|
|
206
221
|
}),
|
|
207
222
|
);
|
|
208
223
|
|
|
224
|
+
// Matches an http(s) URL whose host is `localhost`, an IPv4 address, or a
|
|
225
|
+
// bracketed IPv6 address — i.e. the shape a dev server prints for its own
|
|
226
|
+
// local address. Preferred over any other URL a command might print first
|
|
227
|
+
// (docs links, error pages, update notices). See issue #695.
|
|
228
|
+
const LOCAL_URL_REGEX =
|
|
229
|
+
/https?:\/\/(?:localhost|\[[0-9a-fA-F:]+\]|(?:\d{1,3}\.){3}\d{1,3})(?::\d+)?[^\s)\],"'`]*/;
|
|
230
|
+
|
|
209
231
|
// Matches the first plain http(s) URL. Stops at whitespace and at a small
|
|
210
232
|
// set of punctuation typically used to wrap URLs in log output.
|
|
211
233
|
const URL_REGEX = /https?:\/\/[^\s)\],"'`]+/;
|
|
@@ -215,5 +237,15 @@ const URL_REGEX = /https?:\/\/[^\s)\],"'`]+/;
|
|
|
215
237
|
// eslint-disable-next-line no-control-regex
|
|
216
238
|
const ANSI_REGEX = /\x1b\[[0-9;]*m/g;
|
|
217
239
|
|
|
218
|
-
|
|
219
|
-
|
|
240
|
+
/**
|
|
241
|
+
* Extract a URL from `text`, favoring a localhost/IP URL (the dev server's
|
|
242
|
+
* own address) over any other URL. Returns the first localhost/IP URL if one
|
|
243
|
+
* is present, otherwise the first plain http(s) URL, otherwise `undefined`.
|
|
244
|
+
* @internal
|
|
245
|
+
*/
|
|
246
|
+
export const extractUrl = (text: string) => {
|
|
247
|
+
const clean = text.replaceAll(ANSI_REGEX, "");
|
|
248
|
+
return clean.match(LOCAL_URL_REGEX)?.[0] ?? clean.match(URL_REGEX)?.[0];
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
const isLocalUrl = (url: string) => LOCAL_URL_REGEX.test(url);
|
package/src/Docker/Container.ts
CHANGED
|
@@ -418,5 +418,8 @@ const normalizeDuration = (
|
|
|
418
418
|
): string | undefined => {
|
|
419
419
|
if (!input) return undefined;
|
|
420
420
|
const duration = Duration.fromInputUnsafe(input);
|
|
421
|
-
|
|
421
|
+
// Docker parses `--health-*` durations with Go's `time.ParseDuration`, which
|
|
422
|
+
// requires a unit suffix — a bare nanosecond count is rejected with "missing
|
|
423
|
+
// unit in duration". `ns` is the lossless Go-duration rendering of the nanos.
|
|
424
|
+
return `${Duration.toNanosUnsafe(duration).toString()}ns`;
|
|
422
425
|
};
|
package/src/Drizzle/Postgres.ts
CHANGED
|
@@ -4,10 +4,21 @@ import type { EffectPgDatabase } from "drizzle-orm/effect-postgres";
|
|
|
4
4
|
import * as PgDrizzle from "drizzle-orm/effect-postgres";
|
|
5
5
|
import * as Effect from "effect/Effect";
|
|
6
6
|
import * as Layer from "effect/Layer";
|
|
7
|
-
import * as Redacted from "effect/Redacted";
|
|
8
|
-
import
|
|
7
|
+
import type * as Redacted from "effect/Redacted";
|
|
8
|
+
import type * as Scope from "effect/Scope";
|
|
9
9
|
import { proxyChain } from "../Util/proxy-chain.ts";
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* Per-execution pool memos, keyed on the execution's `Scope` object. Every
|
|
13
|
+
* bridge (Worker event, Durable Object call, Workflow run, Lambda invoke)
|
|
14
|
+
* provides a fresh `Scope` per execution, so an entry lives exactly as long
|
|
15
|
+
* as its execution and is garbage-collected with the scope object.
|
|
16
|
+
*/
|
|
17
|
+
const caches = new WeakMap<
|
|
18
|
+
Scope.Scope,
|
|
19
|
+
Map<symbol, Effect.Effect<any, any, any>>
|
|
20
|
+
>();
|
|
21
|
+
|
|
11
22
|
/**
|
|
12
23
|
* Open a Drizzle/Postgres database from a connection URL using the
|
|
13
24
|
* `drizzle-orm/effect-postgres` integration.
|
|
@@ -26,19 +37,20 @@ import { proxyChain } from "../Util/proxy-chain.ts";
|
|
|
26
37
|
* ```
|
|
27
38
|
*
|
|
28
39
|
* The connect work is deferred until the first query and memoized on the
|
|
29
|
-
* current `
|
|
30
|
-
* once per execution — a Worker `fetch`/`queue`/`scheduled` event
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* deploy / plan-time invocations
|
|
34
|
-
* provided) never trigger a real connection
|
|
40
|
+
* current execution's `Scope` (`yield* Effect.scope`), so the pool is built
|
|
41
|
+
* at most once per execution — a Worker `fetch`/`queue`/`scheduled` event, a
|
|
42
|
+
* Durable Object call, a Workflow run, or a Lambda invocation — and reused
|
|
43
|
+
* across every query and `task` step in that execution. Yielding the
|
|
44
|
+
* connection string is likewise deferred, so deploy / plan-time invocations
|
|
45
|
+
* (where `WorkerEnvironment` isn't provided) never trigger a real connection
|
|
46
|
+
* attempt.
|
|
35
47
|
*
|
|
36
|
-
* The pool is built against
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
48
|
+
* The pool is built against that same execution scope, so its `end`
|
|
49
|
+
* finalizer fires when the scope closes — when the request / run settles,
|
|
50
|
+
* not when the Worker's isolate-lifetime init completes. Wrapping queries in
|
|
51
|
+
* a nested `Effect.scoped` narrows both the memo and the pool's lifetime to
|
|
52
|
+
* that block: memo key and finalizer target are always the same scope
|
|
53
|
+
* object, so they cannot disagree.
|
|
42
54
|
*
|
|
43
55
|
* @binding
|
|
44
56
|
*/
|
|
@@ -60,16 +72,32 @@ export const postgres = <
|
|
|
60
72
|
}
|
|
61
73
|
>(
|
|
62
74
|
Effect.gen(function* () {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
75
|
+
const scope = yield* Effect.scope;
|
|
76
|
+
let cache = caches.get(scope);
|
|
77
|
+
if (cache === undefined) {
|
|
78
|
+
caches.set(scope, (cache = new Map()));
|
|
79
|
+
}
|
|
80
|
+
let memo = cache.get(symbol);
|
|
81
|
+
if (memo === undefined) {
|
|
82
|
+
// `Effect.cached` only allocates the memo cell — the build runs
|
|
83
|
+
// on first evaluation — so this yield is synchronous and the
|
|
84
|
+
// fiber cannot be interleaved between the miss check and the
|
|
85
|
+
// set: a concurrent first query joins this memo (evaluating the
|
|
86
|
+
// same cached effect) instead of building a second pool.
|
|
87
|
+
memo = yield* Effect.cached(
|
|
88
|
+
Effect.gen(function* () {
|
|
89
|
+
const pgCtx = yield* Layer.buildWithScope(
|
|
90
|
+
PgClient.layer({ url: yield* connectionString }),
|
|
91
|
+
scope,
|
|
92
|
+
);
|
|
93
|
+
return yield* PgDrizzle.makeWithDefaults(config).pipe(
|
|
94
|
+
Effect.provideContext(pgCtx),
|
|
95
|
+
);
|
|
96
|
+
}),
|
|
71
97
|
);
|
|
72
|
-
|
|
98
|
+
cache.set(symbol, memo);
|
|
99
|
+
}
|
|
100
|
+
return yield* memo;
|
|
73
101
|
}) as Effect.Effect<
|
|
74
102
|
EffectPgDatabase<TRelations> & {
|
|
75
103
|
$client: PgClient.PgClient;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import * as Array from "effect/Array";
|
|
2
|
+
import * as Config from "effect/Config";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import { flow } from "effect/Function";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
6
|
+
import * as String from "effect/String";
|
|
7
|
+
|
|
8
|
+
export interface GitHubEnv {
|
|
9
|
+
/** The commit SHA that triggered the workflow run. */
|
|
10
|
+
readonly sha: string;
|
|
11
|
+
/** The repository owner from `GITHUB_REPOSITORY_OWNER`. */
|
|
12
|
+
readonly owner: string;
|
|
13
|
+
/** The repository name parsed from `GITHUB_REPOSITORY`. */
|
|
14
|
+
readonly repository: string;
|
|
15
|
+
/** The pull request number exported by the Alchemy GitHub Action. */
|
|
16
|
+
readonly pr: number | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* GitHub Actions metadata for conditional resources in `alchemy.run.ts`.
|
|
21
|
+
*
|
|
22
|
+
* Resolves to `undefined` outside GitHub Actions. In GitHub Actions, it reads
|
|
23
|
+
* `GITHUB_SHA`, `GITHUB_REPOSITORY_OWNER`, `GITHUB_REPOSITORY`, and the optional
|
|
24
|
+
* `PULL_REQUEST` variable exported by the Alchemy GitHub Action.
|
|
25
|
+
*/
|
|
26
|
+
export const GitHubEnv: Config.Config<GitHubEnv | undefined> = Config.boolean(
|
|
27
|
+
"GITHUB_ACTIONS",
|
|
28
|
+
).pipe(
|
|
29
|
+
Config.withDefault(false),
|
|
30
|
+
// Config has no flatMap in Effect 4; a Config is itself an Effect, so the
|
|
31
|
+
// enabled branch returns the inner config for mapOrFail to evaluate.
|
|
32
|
+
Config.mapOrFail(
|
|
33
|
+
(enabled): Effect.Effect<GitHubEnv | undefined, Config.ConfigError> =>
|
|
34
|
+
enabled
|
|
35
|
+
? Config.all({
|
|
36
|
+
sha: Config.string("GITHUB_SHA"),
|
|
37
|
+
owner: Config.string("GITHUB_REPOSITORY_OWNER"),
|
|
38
|
+
repository: Config.string("GITHUB_REPOSITORY").pipe(
|
|
39
|
+
Config.mapOrFail(
|
|
40
|
+
flow(
|
|
41
|
+
String.split("/"),
|
|
42
|
+
Array.get(1),
|
|
43
|
+
Effect.fromOption,
|
|
44
|
+
Effect.catchTags({
|
|
45
|
+
NoSuchElementError: Effect.die,
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
),
|
|
49
|
+
),
|
|
50
|
+
pr: Config.number("PULL_REQUEST").pipe(
|
|
51
|
+
Config.option,
|
|
52
|
+
Config.map(Option.getOrUndefined),
|
|
53
|
+
),
|
|
54
|
+
})
|
|
55
|
+
: Effect.succeed(undefined),
|
|
56
|
+
),
|
|
57
|
+
);
|
package/src/GitHub/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * as Auth from "./AuthProvider.ts";
|
|
2
2
|
export * from "./Comment.ts";
|
|
3
3
|
export { GitHubCredentials, fromEnv, fromToken } from "./Credentials.ts";
|
|
4
|
+
export * from "./Env.ts";
|
|
4
5
|
export * from "./Providers.ts";
|
|
5
6
|
export * from "./Repository.ts";
|
|
6
7
|
export * from "./RepositoryEventSource.ts";
|
package/src/Http.ts
CHANGED
|
@@ -16,6 +16,17 @@ export type HttpEffect<Req = never> = Effect.Effect<
|
|
|
16
16
|
HttpServerRequest | Scope | Req
|
|
17
17
|
>;
|
|
18
18
|
|
|
19
|
+
/**
|
|
20
|
+
* `effect`'s HttpEffect brands a request scope as "ejected" when ownership
|
|
21
|
+
* is transferred to a consumer that outlives the handler's return — a
|
|
22
|
+
* streaming response body, a WebSocket upgrade, an RPC stream. Bridges check
|
|
23
|
+
* this before their close-on-return path: an ejected scope is closed by its
|
|
24
|
+
* new owner when it finishes, not by the bridge.
|
|
25
|
+
*/
|
|
26
|
+
const scopeEjected = Symbol.for("effect/http/HttpEffect/scopeEjected");
|
|
27
|
+
|
|
28
|
+
export const isScopeEjected = (scope: Scope) => scopeEjected in scope;
|
|
29
|
+
|
|
19
30
|
export const serve = <Req = never>(
|
|
20
31
|
handler: Effect.Effect<
|
|
21
32
|
HttpServerResponse.HttpServerResponse,
|
|
@@ -65,7 +65,7 @@ const make = Effect.fn(function* (spawnerUrl: string) {
|
|
|
65
65
|
|
|
66
66
|
return RpcProviderProxy.of({
|
|
67
67
|
get: Effect.fn(function* (mainUrl, providerName) {
|
|
68
|
-
const session = yield*
|
|
68
|
+
const session = yield* Cache.get(cache, mainUrl);
|
|
69
69
|
const provider = yield* Effect.promise(
|
|
70
70
|
() =>
|
|
71
71
|
session.getProvider(providerName) as ReturnType<
|
package/src/Neon/AuthProvider.ts
CHANGED
package/src/Neon/Project.ts
CHANGED
|
@@ -565,10 +565,10 @@ export const waitForOperations = (
|
|
|
565
565
|
tag === "GatewayTimeout"
|
|
566
566
|
);
|
|
567
567
|
},
|
|
568
|
-
schedule: Schedule.
|
|
568
|
+
schedule: Schedule.max([
|
|
569
569
|
Schedule.exponential(Duration.millis(500), 1.5),
|
|
570
570
|
Schedule.recurs(60),
|
|
571
|
-
),
|
|
571
|
+
]),
|
|
572
572
|
}),
|
|
573
573
|
Effect.catchTag("OperationPending", () => Effect.void),
|
|
574
574
|
);
|