alchemy 2.0.0-beta.57 → 2.0.0-beta.58
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 +1 -1
- package/bin/exec.js +68 -49
- package/bin/exec.js.map +1 -1
- package/lib/AI/Agent.d.ts +30 -0
- package/lib/AI/Agent.d.ts.map +1 -0
- package/lib/AI/Agent.js +14 -0
- package/lib/AI/Agent.js.map +1 -0
- package/lib/AI/Parameter.d.ts +19 -0
- package/lib/AI/Parameter.d.ts.map +1 -0
- package/lib/AI/Parameter.js +12 -0
- package/lib/AI/Parameter.js.map +1 -0
- package/lib/AI/Tool.d.ts +37 -0
- package/lib/AI/Tool.d.ts.map +1 -0
- package/lib/AI/Tool.js +11 -0
- package/lib/AI/Tool.js.map +1 -0
- package/lib/AI/index.d.ts +4 -0
- package/lib/AI/index.d.ts.map +1 -0
- package/lib/AI/index.js +4 -0
- package/lib/AI/index.js.map +1 -0
- package/lib/AWS/ACM/Certificate.d.ts +4 -0
- package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
- package/lib/AWS/ACM/Certificate.js +18 -11
- package/lib/AWS/ACM/Certificate.js.map +1 -1
- package/lib/AWS/Assets.js +1 -1
- package/lib/AWS/Assets.js.map +1 -1
- package/lib/AWS/AuthProvider.js +3 -3
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.js +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.js.map +1 -1
- package/lib/AWS/CloudFront/Distribution.js +1 -1
- package/lib/AWS/CloudFront/Distribution.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmContributors.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmHistory.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarms.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeAlarms.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarms.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts +4 -3
- package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeInsightRules.js.map +1 -1
- package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts +4 -3
- package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DisableAlarmActions.js.map +1 -1
- package/lib/AWS/CloudWatch/DisableInsightRules.d.ts +4 -3
- package/lib/AWS/CloudWatch/DisableInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DisableInsightRules.js.map +1 -1
- package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts +4 -3
- package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/EnableAlarmActions.js.map +1 -1
- package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetAlarmMuteRule.js.map +1 -1
- package/lib/AWS/CloudWatch/GetDashboard.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetDashboard.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetDashboard.js.map +1 -1
- package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetInsightRuleReport.js.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricData.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetMetricData.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricData.js.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStatistics.js.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStream.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetMetricStream.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStream.js.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts +4 -3
- package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricWidgetImage.js.map +1 -1
- package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListAlarmMuteRules.js.map +1 -1
- package/lib/AWS/CloudWatch/ListDashboards.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListDashboards.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListDashboards.js.map +1 -1
- package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListManagedInsightRules.js.map +1 -1
- package/lib/AWS/CloudWatch/ListMetricStreams.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListMetricStreams.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListMetricStreams.js.map +1 -1
- package/lib/AWS/CloudWatch/ListMetrics.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListMetrics.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListMetrics.js.map +1 -1
- package/lib/AWS/CloudWatch/ListTagsForResource.d.ts +4 -3
- package/lib/AWS/CloudWatch/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListTagsForResource.js.map +1 -1
- package/lib/AWS/CloudWatch/PutMetricData.d.ts +4 -3
- package/lib/AWS/CloudWatch/PutMetricData.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/PutMetricData.js.map +1 -1
- package/lib/AWS/CloudWatch/SetAlarmState.d.ts +4 -3
- package/lib/AWS/CloudWatch/SetAlarmState.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/SetAlarmState.js.map +1 -1
- package/lib/AWS/Credentials.d.ts +5 -0
- package/lib/AWS/Credentials.d.ts.map +1 -1
- package/lib/AWS/Credentials.js.map +1 -1
- package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts +4 -3
- package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchExecuteStatement.js.map +1 -1
- package/lib/AWS/DynamoDB/BatchGetItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/BatchGetItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchGetItem.js +4 -4
- package/lib/AWS/DynamoDB/BatchGetItem.js.map +1 -1
- package/lib/AWS/DynamoDB/BatchWriteItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/BatchWriteItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchWriteItem.js +4 -4
- package/lib/AWS/DynamoDB/BatchWriteItem.js.map +1 -1
- package/lib/AWS/DynamoDB/DeleteItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/DeleteItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DeleteItem.js.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTable.d.ts +4 -3
- package/lib/AWS/DynamoDB/DescribeTable.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTable.js.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts +4 -3
- package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTimeToLive.js.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteStatement.d.ts +4 -3
- package/lib/AWS/DynamoDB/ExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteStatement.js.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts +4 -3
- package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteTransaction.js.map +1 -1
- package/lib/AWS/DynamoDB/GetItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/GetItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/GetItem.js.map +1 -1
- package/lib/AWS/DynamoDB/ListTables.d.ts +4 -3
- package/lib/AWS/DynamoDB/ListTables.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ListTables.js.map +1 -1
- package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts +4 -3
- package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ListTagsOfResource.js.map +1 -1
- package/lib/AWS/DynamoDB/PutItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/PutItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/PutItem.js.map +1 -1
- package/lib/AWS/DynamoDB/Query.d.ts +4 -3
- package/lib/AWS/DynamoDB/Query.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Query.js.map +1 -1
- package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts +4 -3
- package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/RestoreTableToPointInTime.js.map +1 -1
- package/lib/AWS/DynamoDB/Scan.d.ts +4 -3
- package/lib/AWS/DynamoDB/Scan.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Scan.js.map +1 -1
- package/lib/AWS/DynamoDB/TransactGetItems.d.ts +4 -3
- package/lib/AWS/DynamoDB/TransactGetItems.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/TransactGetItems.js +4 -4
- package/lib/AWS/DynamoDB/TransactGetItems.js.map +1 -1
- package/lib/AWS/DynamoDB/TransactWriteItems.d.ts +4 -3
- package/lib/AWS/DynamoDB/TransactWriteItems.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/TransactWriteItems.js +5 -5
- package/lib/AWS/DynamoDB/TransactWriteItems.js.map +1 -1
- package/lib/AWS/DynamoDB/UpdateItem.d.ts +4 -3
- package/lib/AWS/DynamoDB/UpdateItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/UpdateItem.js.map +1 -1
- package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts +4 -3
- package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/UpdateTimeToLive.js.map +1 -1
- package/lib/AWS/EC2/Image.js +2 -2
- package/lib/AWS/EC2/Image.js.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts.map +1 -1
- package/lib/AWS/EC2/Instance.js +1 -1
- package/lib/AWS/EC2/Instance.js.map +1 -1
- package/lib/AWS/EC2/NatGateway.js +1 -1
- package/lib/AWS/EC2/NatGateway.js.map +1 -1
- package/lib/AWS/EC2/NetworkAcl.js +1 -1
- package/lib/AWS/EC2/NetworkAcl.js.map +1 -1
- package/lib/AWS/EC2/SecurityGroup.js +1 -1
- package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
- package/lib/AWS/EC2/VpcEndpoint.js +1 -1
- package/lib/AWS/EC2/VpcEndpoint.js.map +1 -1
- package/lib/AWS/EC2/hosted.js +2 -2
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECS/DescribeTasks.d.ts +4 -3
- package/lib/AWS/ECS/DescribeTasks.d.ts.map +1 -1
- package/lib/AWS/ECS/DescribeTasks.js.map +1 -1
- package/lib/AWS/ECS/ListTasks.d.ts +4 -3
- package/lib/AWS/ECS/ListTasks.d.ts.map +1 -1
- package/lib/AWS/ECS/ListTasks.js.map +1 -1
- package/lib/AWS/ECS/RunTask.d.ts +4 -3
- package/lib/AWS/ECS/RunTask.d.ts.map +1 -1
- package/lib/AWS/ECS/RunTask.js.map +1 -1
- package/lib/AWS/ECS/StopTask.d.ts +4 -3
- package/lib/AWS/ECS/StopTask.d.ts.map +1 -1
- package/lib/AWS/ECS/StopTask.js.map +1 -1
- package/lib/AWS/ECS/Task.js +1 -1
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/Environment.d.ts +2 -1
- package/lib/AWS/Environment.d.ts.map +1 -1
- package/lib/AWS/Environment.js +1 -1
- package/lib/AWS/Environment.js.map +1 -1
- package/lib/AWS/EventBridge/DescribeEventBus.d.ts +4 -3
- package/lib/AWS/EventBridge/DescribeEventBus.d.ts.map +1 -1
- package/lib/AWS/EventBridge/DescribeEventBus.js.map +1 -1
- package/lib/AWS/EventBridge/DescribeRule.d.ts +4 -3
- package/lib/AWS/EventBridge/DescribeRule.d.ts.map +1 -1
- package/lib/AWS/EventBridge/DescribeRule.js.map +1 -1
- package/lib/AWS/EventBridge/EventSource.d.ts +2 -2
- package/lib/AWS/EventBridge/ListEventBuses.d.ts +4 -3
- package/lib/AWS/EventBridge/ListEventBuses.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ListEventBuses.js.map +1 -1
- package/lib/AWS/EventBridge/ListRules.d.ts +4 -3
- package/lib/AWS/EventBridge/ListRules.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ListRules.js.map +1 -1
- package/lib/AWS/EventBridge/ListTargetsByRule.d.ts +4 -3
- package/lib/AWS/EventBridge/ListTargetsByRule.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ListTargetsByRule.js.map +1 -1
- package/lib/AWS/EventBridge/PutEvents.d.ts +4 -3
- package/lib/AWS/EventBridge/PutEvents.d.ts.map +1 -1
- package/lib/AWS/EventBridge/PutEvents.js.map +1 -1
- package/lib/AWS/EventBridge/TestEventPattern.d.ts +4 -3
- package/lib/AWS/EventBridge/TestEventPattern.d.ts.map +1 -1
- package/lib/AWS/EventBridge/TestEventPattern.js.map +1 -1
- package/lib/AWS/EventBridge/ToLambda.d.ts +4 -3
- package/lib/AWS/EventBridge/ToLambda.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ToLambda.js.map +1 -1
- package/lib/AWS/EventBridge/ToQueue.d.ts +4 -3
- package/lib/AWS/EventBridge/ToQueue.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ToQueue.js.map +1 -1
- package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts +4 -3
- package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeAccountSettings.js.map +1 -1
- package/lib/AWS/Kinesis/DescribeLimits.d.ts +4 -3
- package/lib/AWS/Kinesis/DescribeLimits.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeLimits.js.map +1 -1
- package/lib/AWS/Kinesis/DescribeStream.d.ts +4 -3
- package/lib/AWS/Kinesis/DescribeStream.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStream.js.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts +4 -3
- package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamConsumer.js.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts +4 -3
- package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamSummary.js.map +1 -1
- package/lib/AWS/Kinesis/GetRecords.d.ts +4 -3
- package/lib/AWS/Kinesis/GetRecords.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetRecords.js.map +1 -1
- package/lib/AWS/Kinesis/GetResourcePolicy.d.ts +4 -3
- package/lib/AWS/Kinesis/GetResourcePolicy.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetResourcePolicy.js.map +1 -1
- package/lib/AWS/Kinesis/GetShardIterator.d.ts +4 -3
- package/lib/AWS/Kinesis/GetShardIterator.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetShardIterator.js.map +1 -1
- package/lib/AWS/Kinesis/ListShards.d.ts +4 -3
- package/lib/AWS/Kinesis/ListShards.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListShards.js.map +1 -1
- package/lib/AWS/Kinesis/ListStreamConsumers.d.ts +4 -3
- package/lib/AWS/Kinesis/ListStreamConsumers.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListStreamConsumers.js.map +1 -1
- package/lib/AWS/Kinesis/ListStreams.d.ts +4 -3
- package/lib/AWS/Kinesis/ListStreams.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListStreams.js.map +1 -1
- package/lib/AWS/Kinesis/ListTagsForResource.d.ts +4 -3
- package/lib/AWS/Kinesis/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListTagsForResource.js.map +1 -1
- package/lib/AWS/Kinesis/PutRecord.d.ts +4 -3
- package/lib/AWS/Kinesis/PutRecord.d.ts.map +1 -1
- package/lib/AWS/Kinesis/PutRecord.js.map +1 -1
- package/lib/AWS/Kinesis/PutRecords.d.ts +4 -3
- package/lib/AWS/Kinesis/PutRecords.d.ts.map +1 -1
- package/lib/AWS/Kinesis/PutRecords.js.map +1 -1
- package/lib/AWS/Kinesis/StreamSink.d.ts +4 -3
- package/lib/AWS/Kinesis/StreamSink.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamSink.js.map +1 -1
- package/lib/AWS/Kinesis/SubscribeToShard.d.ts +4 -3
- package/lib/AWS/Kinesis/SubscribeToShard.d.ts.map +1 -1
- package/lib/AWS/Kinesis/SubscribeToShard.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.js.map +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +45 -3
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +121 -47
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/InvokeFunction.d.ts +4 -3
- package/lib/AWS/Lambda/InvokeFunction.d.ts.map +1 -1
- package/lib/AWS/Lambda/InvokeFunction.js.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.js.map +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/StreamEventSource.js.map +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TableEventSource.js.map +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +4 -3
- package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TopicEventSource.js.map +1 -1
- package/lib/AWS/Organizations/Root.js +1 -1
- package/lib/AWS/Organizations/Root.js.map +1 -1
- package/lib/AWS/Providers.d.ts +2 -2
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +4 -5
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/RDS/Connect.d.ts +4 -3
- package/lib/AWS/RDS/Connect.d.ts.map +1 -1
- package/lib/AWS/RDS/Connect.js.map +1 -1
- package/lib/AWS/RDSData/BatchExecuteStatement.d.ts +4 -3
- package/lib/AWS/RDSData/BatchExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/RDSData/BatchExecuteStatement.js.map +1 -1
- package/lib/AWS/RDSData/BeginTransaction.d.ts +4 -3
- package/lib/AWS/RDSData/BeginTransaction.d.ts.map +1 -1
- package/lib/AWS/RDSData/BeginTransaction.js.map +1 -1
- package/lib/AWS/RDSData/CommitTransaction.d.ts +4 -3
- package/lib/AWS/RDSData/CommitTransaction.d.ts.map +1 -1
- package/lib/AWS/RDSData/CommitTransaction.js.map +1 -1
- package/lib/AWS/RDSData/ExecuteSql.d.ts +4 -3
- package/lib/AWS/RDSData/ExecuteSql.d.ts.map +1 -1
- package/lib/AWS/RDSData/ExecuteSql.js.map +1 -1
- package/lib/AWS/RDSData/ExecuteStatement.d.ts +4 -3
- package/lib/AWS/RDSData/ExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/RDSData/ExecuteStatement.js.map +1 -1
- package/lib/AWS/RDSData/RollbackTransaction.d.ts +4 -3
- package/lib/AWS/RDSData/RollbackTransaction.d.ts.map +1 -1
- package/lib/AWS/RDSData/RollbackTransaction.js.map +1 -1
- package/lib/AWS/Region.d.ts +5 -0
- package/lib/AWS/Region.d.ts.map +1 -1
- package/lib/AWS/Region.js.map +1 -1
- package/lib/AWS/S3/AbortMultipartUpload.d.ts +4 -3
- package/lib/AWS/S3/AbortMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/AbortMultipartUpload.js.map +1 -1
- package/lib/AWS/S3/Bucket.js +18 -18
- package/lib/AWS/S3/Bucket.js.map +1 -1
- package/lib/AWS/S3/CompleteMultipartUpload.d.ts +4 -3
- package/lib/AWS/S3/CompleteMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/CompleteMultipartUpload.js.map +1 -1
- package/lib/AWS/S3/CopyObject.d.ts +4 -3
- package/lib/AWS/S3/CopyObject.d.ts.map +1 -1
- package/lib/AWS/S3/CopyObject.js.map +1 -1
- package/lib/AWS/S3/CreateMultipartUpload.d.ts +4 -3
- package/lib/AWS/S3/CreateMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/CreateMultipartUpload.js.map +1 -1
- package/lib/AWS/S3/DeleteObject.d.ts +4 -3
- package/lib/AWS/S3/DeleteObject.d.ts.map +1 -1
- package/lib/AWS/S3/DeleteObject.js.map +1 -1
- package/lib/AWS/S3/GetObject.d.ts +4 -3
- package/lib/AWS/S3/GetObject.d.ts.map +1 -1
- package/lib/AWS/S3/GetObject.js.map +1 -1
- package/lib/AWS/S3/HeadObject.d.ts +4 -3
- package/lib/AWS/S3/HeadObject.d.ts.map +1 -1
- package/lib/AWS/S3/HeadObject.js.map +1 -1
- package/lib/AWS/S3/ListObjectsV2.d.ts +4 -3
- package/lib/AWS/S3/ListObjectsV2.d.ts.map +1 -1
- package/lib/AWS/S3/ListObjectsV2.js.map +1 -1
- package/lib/AWS/S3/PutObject.d.ts +4 -3
- package/lib/AWS/S3/PutObject.d.ts.map +1 -1
- package/lib/AWS/S3/PutObject.js.map +1 -1
- package/lib/AWS/S3/UploadPart.d.ts +4 -3
- package/lib/AWS/S3/UploadPart.d.ts.map +1 -1
- package/lib/AWS/S3/UploadPart.js.map +1 -1
- package/lib/AWS/SNS/AddPermission.d.ts +4 -3
- package/lib/AWS/SNS/AddPermission.d.ts.map +1 -1
- package/lib/AWS/SNS/AddPermission.js.map +1 -1
- package/lib/AWS/SNS/ConfirmSubscription.d.ts +4 -3
- package/lib/AWS/SNS/ConfirmSubscription.d.ts.map +1 -1
- package/lib/AWS/SNS/ConfirmSubscription.js.map +1 -1
- package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts +4 -3
- package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts.map +1 -1
- package/lib/AWS/SNS/GetDataProtectionPolicy.js.map +1 -1
- package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts +4 -3
- package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/GetSubscriptionAttributes.js.map +1 -1
- package/lib/AWS/SNS/GetTopicAttributes.d.ts +4 -3
- package/lib/AWS/SNS/GetTopicAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/GetTopicAttributes.js.map +1 -1
- package/lib/AWS/SNS/ListSubscriptions.d.ts +4 -3
- package/lib/AWS/SNS/ListSubscriptions.d.ts.map +1 -1
- package/lib/AWS/SNS/ListSubscriptions.js.map +1 -1
- package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts +4 -3
- package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts.map +1 -1
- package/lib/AWS/SNS/ListSubscriptionsByTopic.js.map +1 -1
- package/lib/AWS/SNS/ListTagsForResource.d.ts +4 -3
- package/lib/AWS/SNS/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/SNS/ListTagsForResource.js.map +1 -1
- package/lib/AWS/SNS/ListTopics.d.ts +4 -3
- package/lib/AWS/SNS/ListTopics.d.ts.map +1 -1
- package/lib/AWS/SNS/ListTopics.js.map +1 -1
- package/lib/AWS/SNS/Publish.d.ts +4 -3
- package/lib/AWS/SNS/Publish.d.ts.map +1 -1
- package/lib/AWS/SNS/Publish.js.map +1 -1
- package/lib/AWS/SNS/PublishBatch.d.ts +4 -3
- package/lib/AWS/SNS/PublishBatch.d.ts.map +1 -1
- package/lib/AWS/SNS/PublishBatch.js.map +1 -1
- package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts +4 -3
- package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts.map +1 -1
- package/lib/AWS/SNS/PutDataProtectionPolicy.js.map +1 -1
- package/lib/AWS/SNS/RemovePermission.d.ts +4 -3
- package/lib/AWS/SNS/RemovePermission.d.ts.map +1 -1
- package/lib/AWS/SNS/RemovePermission.js.map +1 -1
- package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts +4 -3
- package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/SetSubscriptionAttributes.js.map +1 -1
- package/lib/AWS/SNS/SetTopicAttributes.d.ts +4 -3
- package/lib/AWS/SNS/SetTopicAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/SetTopicAttributes.js.map +1 -1
- package/lib/AWS/SNS/TagResource.d.ts +4 -3
- package/lib/AWS/SNS/TagResource.d.ts.map +1 -1
- package/lib/AWS/SNS/TagResource.js.map +1 -1
- package/lib/AWS/SNS/TopicSink.d.ts +4 -3
- package/lib/AWS/SNS/TopicSink.d.ts.map +1 -1
- package/lib/AWS/SNS/TopicSink.js.map +1 -1
- package/lib/AWS/SNS/UntagResource.d.ts +4 -3
- package/lib/AWS/SNS/UntagResource.d.ts.map +1 -1
- package/lib/AWS/SNS/UntagResource.js.map +1 -1
- package/lib/AWS/SQS/DeleteMessage.d.ts +4 -3
- package/lib/AWS/SQS/DeleteMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/DeleteMessage.js.map +1 -1
- package/lib/AWS/SQS/DeleteMessageBatch.d.ts +4 -3
- package/lib/AWS/SQS/DeleteMessageBatch.d.ts.map +1 -1
- package/lib/AWS/SQS/DeleteMessageBatch.js.map +1 -1
- package/lib/AWS/SQS/Queue.js +1 -1
- package/lib/AWS/SQS/Queue.js.map +1 -1
- package/lib/AWS/SQS/QueueSink.d.ts +4 -3
- package/lib/AWS/SQS/QueueSink.d.ts.map +1 -1
- package/lib/AWS/SQS/QueueSink.js.map +1 -1
- package/lib/AWS/SQS/ReceiveMessage.d.ts +4 -3
- package/lib/AWS/SQS/ReceiveMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/ReceiveMessage.js.map +1 -1
- package/lib/AWS/SQS/SendMessage.d.ts +4 -3
- package/lib/AWS/SQS/SendMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/SendMessage.js.map +1 -1
- package/lib/AWS/SQS/SendMessageBatch.d.ts +4 -3
- package/lib/AWS/SQS/SendMessageBatch.d.ts.map +1 -1
- package/lib/AWS/SQS/SendMessageBatch.js.map +1 -1
- package/lib/AWS/SecretsManager/DescribeSecret.d.ts +4 -3
- package/lib/AWS/SecretsManager/DescribeSecret.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/DescribeSecret.js.map +1 -1
- package/lib/AWS/SecretsManager/GetRandomPassword.d.ts +4 -3
- package/lib/AWS/SecretsManager/GetRandomPassword.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/GetRandomPassword.js.map +1 -1
- package/lib/AWS/SecretsManager/GetSecretValue.d.ts +4 -3
- package/lib/AWS/SecretsManager/GetSecretValue.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/GetSecretValue.js.map +1 -1
- package/lib/AWS/SecretsManager/ListSecrets.d.ts +4 -3
- package/lib/AWS/SecretsManager/ListSecrets.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/ListSecrets.js.map +1 -1
- package/lib/AWS/SecretsManager/PutSecretValue.d.ts +4 -3
- package/lib/AWS/SecretsManager/PutSecretValue.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/PutSecretValue.js.map +1 -1
- package/lib/AWS/StateStore/State.js +30 -6
- package/lib/AWS/StateStore/State.js.map +1 -1
- package/lib/AWS/Website/Router.d.ts.map +1 -1
- package/lib/AWS/Website/Router.js +7 -4
- package/lib/AWS/Website/Router.js.map +1 -1
- package/lib/AWS/Website/SsrSite.d.ts.map +1 -1
- package/lib/AWS/Website/SsrSite.js +3 -3
- package/lib/AWS/Website/SsrSite.js.map +1 -1
- package/lib/AWS/Website/StaticSite.d.ts +3 -3
- package/lib/AWS/Website/StaticSite.d.ts.map +1 -1
- package/lib/AWS/Website/StaticSite.js +9 -6
- package/lib/AWS/Website/StaticSite.js.map +1 -1
- package/lib/AdoptPolicy.d.ts +1 -1
- package/lib/AdoptPolicy.js +1 -1
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +16 -8
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +4 -1
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/Profile.d.ts +2 -1
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +28 -3
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Axiom/AuthProvider.js +2 -2
- package/lib/Axiom/AuthProvider.js.map +1 -1
- package/lib/Binding.d.ts +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +46 -4
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/Docker.d.ts +4 -1
- package/lib/Bundle/Docker.d.ts.map +1 -1
- package/lib/Bundle/Docker.js +21 -4
- package/lib/Bundle/Docker.js.map +1 -1
- package/lib/Bundle/InstalledPackages.d.ts +79 -0
- package/lib/Bundle/InstalledPackages.d.ts.map +1 -0
- package/lib/Bundle/InstalledPackages.js +364 -0
- package/lib/Bundle/InstalledPackages.js.map +1 -0
- package/lib/Bundle/TempRoot.js +1 -1
- package/lib/Bundle/TempRoot.js.map +1 -1
- package/lib/Bundle/index.d.ts +1 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +1 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/commands/aws.js +1 -1
- package/lib/Cli/commands/aws.js.map +1 -1
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
- package/lib/Cli/commands/cloudflare.js +3 -3
- package/lib/Cli/commands/cloudflare.js.map +1 -1
- package/lib/Cli/commands/login.js +1 -1
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/logs.js +1 -1
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.js +1 -1
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile.js +2 -2
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +6 -6
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/commands/tail.js +1 -1
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +1 -8
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +2 -27
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Cloudflare/Access/Application.d.ts.map +1 -1
- package/lib/Cloudflare/Access/Application.js +36 -3
- package/lib/Cloudflare/Access/Application.js.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts +96 -0
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.js +87 -0
- package/lib/Cloudflare/AiGateway/AiGateway.js.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts +4 -3
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.js.map +1 -1
- package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.d.ts +7 -0
- package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.d.ts.map +1 -0
- package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.js +45 -0
- package/lib/Cloudflare/AiGateway/DurableObjectChatPersistence.js.map +1 -0
- package/lib/Cloudflare/AiGateway/LanguageModel.js +1 -1
- package/lib/Cloudflare/AiGateway/LanguageModel.js.map +1 -1
- package/lib/Cloudflare/AiGateway/index.d.ts +1 -1
- package/lib/Cloudflare/AiGateway/index.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/index.js +1 -1
- package/lib/Cloudflare/AiGateway/index.js.map +1 -1
- package/lib/Cloudflare/AiSearch/AiSearch.d.ts +3 -2
- package/lib/Cloudflare/AiSearch/AiSearch.d.ts.map +1 -1
- package/lib/Cloudflare/AiSearch/AiSearch.js +4 -3
- package/lib/Cloudflare/AiSearch/AiSearch.js.map +1 -1
- package/lib/Cloudflare/AiSearch/AiSearchBinding.d.ts +7 -6
- package/lib/Cloudflare/AiSearch/AiSearchBinding.d.ts.map +1 -1
- package/lib/Cloudflare/AiSearch/AiSearchBinding.js.map +1 -1
- package/lib/Cloudflare/AiSearch/AiSearchInstance.js +28 -14
- package/lib/Cloudflare/AiSearch/AiSearchInstance.js.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.d.ts.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.js.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts +4 -3
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.d.ts.map +1 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js +2 -2
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
- package/lib/Cloudflare/ApiShield/UserSchema.d.ts.map +1 -1
- package/lib/Cloudflare/ApiShield/UserSchema.js +4 -1
- package/lib/Cloudflare/ApiShield/UserSchema.js.map +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts +4 -3
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts +1 -0
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +5 -3
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/Browser/BrowserBinding.d.ts +4 -3
- package/lib/Cloudflare/Browser/BrowserBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Browser/BrowserBinding.js.map +1 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.d.ts.map +1 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.js +15 -1
- package/lib/Cloudflare/Cache/RegionalTieredCache.js.map +1 -1
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.js +17 -10
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +1 -0
- package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.js +1 -0
- package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
- package/lib/Cloudflare/Container/Container.d.ts +233 -81
- package/lib/Cloudflare/Container/Container.d.ts.map +1 -1
- package/lib/Cloudflare/Container/Container.js +181 -116
- package/lib/Cloudflare/Container/Container.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.d.ts +67 -13
- package/lib/Cloudflare/Container/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Container/ContainerApplication.js +2 -557
- package/lib/Cloudflare/Container/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerBundle.d.ts +26 -0
- package/lib/Cloudflare/Container/ContainerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Container/ContainerBundle.js +65 -2
- package/lib/Cloudflare/Container/ContainerBundle.js.map +1 -1
- package/lib/Cloudflare/Container/ContainerPlatform.d.ts +5 -0
- package/lib/Cloudflare/Container/ContainerPlatform.d.ts.map +1 -0
- package/lib/Cloudflare/Container/ContainerPlatform.js +129 -0
- package/lib/Cloudflare/Container/ContainerPlatform.js.map +1 -0
- package/lib/Cloudflare/Container/ContainerProvider.d.ts +10 -0
- package/lib/Cloudflare/Container/ContainerProvider.d.ts.map +1 -0
- package/lib/Cloudflare/Container/ContainerProvider.js +684 -0
- package/lib/Cloudflare/Container/ContainerProvider.js.map +1 -0
- package/lib/Cloudflare/Container/LocalContainerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Container/LocalContainerProvider.js +8 -8
- package/lib/Cloudflare/Container/LocalContainerProvider.js.map +1 -1
- package/lib/Cloudflare/Container/StartContainer.d.ts +3 -19
- package/lib/Cloudflare/Container/StartContainer.d.ts.map +1 -1
- package/lib/Cloudflare/Container/StartContainer.js +41 -7
- package/lib/Cloudflare/Container/StartContainer.js.map +1 -1
- package/lib/Cloudflare/Container/index.d.ts +2 -1
- package/lib/Cloudflare/Container/index.d.ts.map +1 -1
- package/lib/Cloudflare/Container/index.js +2 -1
- package/lib/Cloudflare/Container/index.js.map +1 -1
- package/lib/Cloudflare/Credentials.d.ts +5 -0
- package/lib/Cloudflare/Credentials.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.js.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.d.ts +4 -3
- package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
- package/lib/Cloudflare/Dns/DnsBinding.d.ts +2 -11
- package/lib/Cloudflare/Dns/DnsBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Dns/DnsBinding.js +0 -11
- package/lib/Cloudflare/Dns/DnsBinding.js.map +1 -1
- package/lib/Cloudflare/Dns/DnsRead.d.ts +3 -2
- package/lib/Cloudflare/Dns/DnsRead.d.ts.map +1 -1
- package/lib/Cloudflare/Dns/DnsRead.js +3 -2
- package/lib/Cloudflare/Dns/DnsRead.js.map +1 -1
- package/lib/Cloudflare/Dns/DnsReadWrite.d.ts +3 -2
- package/lib/Cloudflare/Dns/DnsReadWrite.d.ts.map +1 -1
- package/lib/Cloudflare/Dns/DnsReadWrite.js.map +1 -1
- package/lib/Cloudflare/Dns/DnsWrite.d.ts +3 -2
- package/lib/Cloudflare/Dns/DnsWrite.d.ts.map +1 -1
- package/lib/Cloudflare/Dns/DnsWrite.js +3 -2
- package/lib/Cloudflare/Dns/DnsWrite.js.map +1 -1
- package/lib/Cloudflare/Email/EmailCatchAll.js +1 -1
- package/lib/Cloudflare/Email/EmailCatchAll.js.map +1 -1
- package/lib/Cloudflare/Email/EmailRouting.js +1 -1
- package/lib/Cloudflare/Email/EmailRouting.js.map +1 -1
- package/lib/Cloudflare/Email/EmailRule.js +1 -1
- package/lib/Cloudflare/Email/EmailRule.js.map +1 -1
- package/lib/Cloudflare/Email/SendEmail.js +1 -1
- package/lib/Cloudflare/Email/SendEmail.js.map +1 -1
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts +4 -3
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendEmailBinding.js +2 -2
- package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -1
- package/lib/Cloudflare/Fetcher.d.ts +1 -5
- package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
- package/lib/Cloudflare/Fetcher.js +77 -12
- package/lib/Cloudflare/Fetcher.js.map +1 -1
- package/lib/Cloudflare/Flagship/FlagshipBinding.d.ts +4 -3
- package/lib/Cloudflare/Flagship/FlagshipBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Flagship/FlagshipBinding.js.map +1 -1
- package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js +1 -1
- package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js.map +1 -1
- package/lib/Cloudflare/HttpClientUtils.d.ts +13 -0
- package/lib/Cloudflare/HttpClientUtils.d.ts.map +1 -0
- package/lib/Cloudflare/HttpClientUtils.js +11 -0
- package/lib/Cloudflare/HttpClientUtils.js.map +1 -0
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +4 -3
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
- package/lib/Cloudflare/Iam/UserGroupMembership.d.ts.map +1 -1
- package/lib/Cloudflare/Iam/UserGroupMembership.js +6 -1
- package/lib/Cloudflare/Iam/UserGroupMembership.js.map +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.d.ts +4 -3
- package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
- package/lib/Cloudflare/Images/Variant.d.ts.map +1 -1
- package/lib/Cloudflare/Images/Variant.js +15 -3
- package/lib/Cloudflare/Images/Variant.js.map +1 -1
- package/lib/Cloudflare/KV/{KVNamespace.d.ts → Namespace.d.ts} +9 -7
- package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -0
- package/lib/Cloudflare/KV/{KVNamespace.js → Namespace.js} +10 -7
- package/lib/Cloudflare/KV/Namespace.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceBinding.d.ts +24 -0
- package/lib/Cloudflare/KV/NamespaceBinding.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceBinding.js +46 -0
- package/lib/Cloudflare/KV/NamespaceBinding.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceHttp.d.ts +36 -0
- package/lib/Cloudflare/KV/NamespaceHttp.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceHttp.js +57 -0
- package/lib/Cloudflare/KV/NamespaceHttp.js.map +1 -0
- package/lib/Cloudflare/KV/{KVNamespaceBinding.d.ts → NamespaceRead.d.ts} +15 -30
- package/lib/Cloudflare/KV/NamespaceRead.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceRead.js +11 -0
- package/lib/Cloudflare/KV/NamespaceRead.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadBinding.d.ts +11 -0
- package/lib/Cloudflare/KV/NamespaceReadBinding.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadBinding.js +19 -0
- package/lib/Cloudflare/KV/NamespaceReadBinding.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadHttp.d.ts +16 -0
- package/lib/Cloudflare/KV/NamespaceReadHttp.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadHttp.js +93 -0
- package/lib/Cloudflare/KV/NamespaceReadHttp.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWrite.d.ts +20 -0
- package/lib/Cloudflare/KV/NamespaceReadWrite.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWrite.js +11 -0
- package/lib/Cloudflare/KV/NamespaceReadWrite.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteBinding.d.ts +11 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteBinding.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteBinding.js +17 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteBinding.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteHttp.d.ts +17 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteHttp.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteHttp.js +22 -0
- package/lib/Cloudflare/KV/NamespaceReadWriteHttp.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceTypes.d.ts +10 -0
- package/lib/Cloudflare/KV/NamespaceTypes.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceTypes.js +4 -0
- package/lib/Cloudflare/KV/NamespaceTypes.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWrite.d.ts +22 -0
- package/lib/Cloudflare/KV/NamespaceWrite.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWrite.js +11 -0
- package/lib/Cloudflare/KV/NamespaceWrite.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWriteBinding.d.ts +11 -0
- package/lib/Cloudflare/KV/NamespaceWriteBinding.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWriteBinding.js +17 -0
- package/lib/Cloudflare/KV/NamespaceWriteBinding.js.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWriteHttp.d.ts +16 -0
- package/lib/Cloudflare/KV/NamespaceWriteHttp.d.ts.map +1 -0
- package/lib/Cloudflare/KV/NamespaceWriteHttp.js +54 -0
- package/lib/Cloudflare/KV/NamespaceWriteHttp.js.map +1 -0
- package/lib/Cloudflare/KV/index.d.ts +11 -2
- package/lib/Cloudflare/KV/index.d.ts.map +1 -1
- package/lib/Cloudflare/KV/index.js +11 -2
- package/lib/Cloudflare/KV/index.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts +2 -2
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +5 -13
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/Queue.d.ts +8 -8
- package/lib/Cloudflare/Queue/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/Queue.js +9 -9
- package/lib/Cloudflare/Queue/Queue.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.d.ts +17 -65
- package/lib/Cloudflare/Queue/QueueBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js +35 -78
- package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +5 -4
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueHttp.d.ts +36 -0
- package/lib/Cloudflare/Queue/QueueHttp.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueHttp.js +57 -0
- package/lib/Cloudflare/Queue/QueueHttp.js.map +1 -0
- package/lib/Cloudflare/Queue/QueueTypes.d.ts +19 -0
- package/lib/Cloudflare/Queue/QueueTypes.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueTypes.js +4 -0
- package/lib/Cloudflare/Queue/QueueTypes.js.map +1 -0
- package/lib/Cloudflare/Queue/QueueWrite.d.ts +55 -0
- package/lib/Cloudflare/Queue/QueueWrite.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueWrite.js +42 -0
- package/lib/Cloudflare/Queue/QueueWrite.js.map +1 -0
- package/lib/Cloudflare/Queue/QueueWriteBinding.d.ts +11 -0
- package/lib/Cloudflare/Queue/QueueWriteBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueWriteBinding.js +19 -0
- package/lib/Cloudflare/Queue/QueueWriteBinding.js.map +1 -0
- package/lib/Cloudflare/Queue/QueueWriteHttp.d.ts +22 -0
- package/lib/Cloudflare/Queue/QueueWriteHttp.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueWriteHttp.js +50 -0
- package/lib/Cloudflare/Queue/QueueWriteHttp.js.map +1 -0
- package/lib/Cloudflare/Queue/index.d.ts +4 -1
- package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/index.js +4 -1
- package/lib/Cloudflare/Queue/index.js.map +1 -1
- package/lib/Cloudflare/R2/{R2Bucket.d.ts → Bucket.d.ts} +5 -9
- package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -0
- package/lib/Cloudflare/R2/{R2Bucket.js → Bucket.js} +6 -9
- package/lib/Cloudflare/R2/Bucket.js.map +1 -0
- package/lib/Cloudflare/R2/BucketBinding.d.ts +31 -0
- package/lib/Cloudflare/R2/BucketBinding.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketBinding.js +83 -0
- package/lib/Cloudflare/R2/BucketBinding.js.map +1 -0
- package/lib/Cloudflare/R2/BucketEventNotification.d.ts +1 -1
- package/lib/Cloudflare/R2/BucketEventNotification.d.ts.map +1 -1
- package/lib/Cloudflare/R2/BucketHttp.d.ts +59 -0
- package/lib/Cloudflare/R2/BucketHttp.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketHttp.js +129 -0
- package/lib/Cloudflare/R2/BucketHttp.js.map +1 -0
- package/lib/Cloudflare/R2/BucketRead.d.ts +28 -0
- package/lib/Cloudflare/R2/BucketRead.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketRead.js +11 -0
- package/lib/Cloudflare/R2/BucketRead.js.map +1 -0
- package/lib/Cloudflare/R2/BucketReadBinding.d.ts +10 -0
- package/lib/Cloudflare/R2/BucketReadBinding.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketReadBinding.js +24 -0
- package/lib/Cloudflare/R2/BucketReadBinding.js.map +1 -0
- package/lib/Cloudflare/R2/BucketReadHttp.d.ts +15 -0
- package/lib/Cloudflare/R2/BucketReadHttp.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketReadHttp.js +109 -0
- package/lib/Cloudflare/R2/BucketReadHttp.js.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWrite.d.ts +20 -0
- package/lib/Cloudflare/R2/BucketReadWrite.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWrite.js +11 -0
- package/lib/Cloudflare/R2/BucketReadWrite.js.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWriteBinding.d.ts +10 -0
- package/lib/Cloudflare/R2/BucketReadWriteBinding.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWriteBinding.js +16 -0
- package/lib/Cloudflare/R2/BucketReadWriteBinding.js.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWriteHttp.d.ts +16 -0
- package/lib/Cloudflare/R2/BucketReadWriteHttp.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketReadWriteHttp.js +21 -0
- package/lib/Cloudflare/R2/BucketReadWriteHttp.js.map +1 -0
- package/lib/Cloudflare/R2/BucketSippy.d.ts +1 -1
- package/lib/Cloudflare/R2/BucketSippy.d.ts.map +1 -1
- package/lib/Cloudflare/R2/BucketTypes.d.ts +52 -0
- package/lib/Cloudflare/R2/BucketTypes.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketTypes.js +6 -0
- package/lib/Cloudflare/R2/BucketTypes.js.map +1 -0
- package/lib/Cloudflare/R2/BucketWrite.d.ts +32 -0
- package/lib/Cloudflare/R2/BucketWrite.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketWrite.js +12 -0
- package/lib/Cloudflare/R2/BucketWrite.js.map +1 -0
- package/lib/Cloudflare/R2/BucketWriteBinding.d.ts +10 -0
- package/lib/Cloudflare/R2/BucketWriteBinding.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketWriteBinding.js +46 -0
- package/lib/Cloudflare/R2/BucketWriteBinding.js.map +1 -0
- package/lib/Cloudflare/R2/BucketWriteHttp.d.ts +16 -0
- package/lib/Cloudflare/R2/BucketWriteHttp.d.ts.map +1 -0
- package/lib/Cloudflare/R2/BucketWriteHttp.js +72 -0
- package/lib/Cloudflare/R2/BucketWriteHttp.js.map +1 -0
- package/lib/Cloudflare/R2/index.d.ts +10 -2
- package/lib/Cloudflare/R2/index.d.ts.map +1 -1
- package/lib/Cloudflare/R2/index.js +10 -2
- package/lib/Cloudflare/R2/index.js.map +1 -1
- package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts +4 -3
- package/lib/Cloudflare/RateLimit/RateLimitBinding.d.ts.map +1 -1
- package/lib/Cloudflare/RateLimit/RateLimitBinding.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +4 -3
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +6 -6
- package/lib/Cloudflare/StateStore/Api.js +1 -1
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +6 -5
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/StateStore/Store.d.ts +13 -13
- package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Store.js +5 -7
- package/lib/Cloudflare/StateStore/Store.js.map +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts +2 -11
- package/lib/Cloudflare/Tunnel/TunnelBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelBinding.js +0 -10
- package/lib/Cloudflare/Tunnel/TunnelBinding.js.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelRead.d.ts +3 -2
- package/lib/Cloudflare/Tunnel/TunnelRead.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelRead.js +2 -1
- package/lib/Cloudflare/Tunnel/TunnelRead.js.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts +3 -2
- package/lib/Cloudflare/Tunnel/TunnelReadWrite.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelReadWrite.js.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts +3 -2
- package/lib/Cloudflare/Tunnel/TunnelWrite.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/TunnelWrite.js +2 -1
- package/lib/Cloudflare/Tunnel/TunnelWrite.js.map +1 -1
- package/lib/Cloudflare/Tunnel/WarpConnector.js +1 -1
- package/lib/Cloudflare/Tunnel/WarpConnector.js.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +10 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
- package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.d.ts +4 -3
- package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Vectorize/VectorizeIndexBinding.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcService.js +1 -1
- package/lib/Cloudflare/VpcService/VpcService.js.map +1 -1
- package/lib/Cloudflare/WaitingRoom/Settings.d.ts.map +1 -1
- package/lib/Cloudflare/WaitingRoom/Settings.js +17 -3
- package/lib/Cloudflare/WaitingRoom/Settings.js.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts +5 -4
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +8 -8
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/AccountSetting.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/AccountSetting.js +12 -4
- package/lib/Cloudflare/Workers/AccountSetting.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +6 -6
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +4 -3
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.js +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 +15 -9
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectChatPersistence.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectChatPersistence.js +7 -6
- package/lib/Cloudflare/Workers/DurableObjectChatPersistence.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts +67 -52
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js +75 -50
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts +11 -10
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts +35 -35
- package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.js +0 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.js.map +1 -1
- package/lib/Cloudflare/Workers/Fetch.d.ts +4 -3
- package/lib/Cloudflare/Workers/Fetch.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Fetch.js.map +1 -1
- package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.d.ts +4 -3
- package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/GitHubRepositoryEventSource.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +14 -15
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.d.ts +1 -75
- package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.js +7 -162
- package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts +8 -6
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js +5 -4
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcWorker.d.ts +4 -3
- package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/RpcWorker.js +3 -3
- package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -1
- package/lib/Cloudflare/Workers/ScheduledEvents.d.ts +5 -4
- package/lib/Cloudflare/Workers/ScheduledEvents.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/ScheduledEvents.js +2 -2
- package/lib/Cloudflare/Workers/ScheduledEvents.js.map +1 -1
- package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts +4 -3
- package/lib/Cloudflare/Workers/VersionMetadataBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/VersionMetadataBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WebSocket.d.ts +1 -1
- package/lib/Cloudflare/Workers/WebSocket.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WebSocket.js +1 -1
- package/lib/Cloudflare/Workers/WebSocket.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +64 -33
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +22 -1297
- 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 +5 -5
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +15 -14
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +22 -18
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +3 -3
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/{DynamicWorkerLoader.d.ts → WorkerLoader.d.ts} +47 -98
- package/lib/Cloudflare/Workers/WorkerLoader.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/{DynamicWorkerLoader.js → WorkerLoader.js} +40 -32
- package/lib/Cloudflare/Workers/WorkerLoader.js.map +1 -0
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts +9 -0
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/WorkerProvider.js +1318 -0
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -0
- package/lib/Cloudflare/Workers/Workflow.d.ts +3 -2
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +4 -4
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +2 -2
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +2 -2
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/Zaraz/ZarazConfig.js +1 -1
- package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -1
- package/lib/Cloudflare/Zone/Hold.d.ts.map +1 -1
- package/lib/Cloudflare/Zone/Hold.js +15 -1
- package/lib/Cloudflare/Zone/Hold.js.map +1 -1
- package/lib/Cloudflare/index.d.ts +3 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +3 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Command/Build.d.ts +98 -0
- package/lib/Command/Build.d.ts.map +1 -0
- package/lib/Command/Build.js +118 -0
- package/lib/Command/Build.js.map +1 -0
- package/lib/Command/Command.d.ts +99 -0
- package/lib/Command/Command.d.ts.map +1 -0
- package/lib/Command/Command.js +118 -0
- package/lib/Command/Command.js.map +1 -0
- package/lib/Command/Dev.d.ts +73 -0
- package/lib/Command/Dev.d.ts.map +1 -0
- package/lib/Command/Dev.js +145 -0
- package/lib/Command/Dev.js.map +1 -0
- package/lib/Command/Exec.d.ts +70 -0
- package/lib/Command/Exec.d.ts.map +1 -0
- package/lib/Command/Exec.js +87 -0
- package/lib/Command/Exec.js.map +1 -0
- package/lib/{Build → Command}/Local.d.ts.map +1 -1
- package/lib/Command/Local.js +6 -0
- package/lib/Command/Local.js.map +1 -0
- package/lib/Command/Memo.d.ts.map +1 -0
- package/lib/{Build → Command}/Memo.js +5 -5
- package/lib/Command/Memo.js.map +1 -0
- package/lib/Command/Providers.d.ts +4 -0
- package/lib/Command/Providers.d.ts.map +1 -0
- package/lib/Command/Providers.js +31 -0
- package/lib/Command/Providers.js.map +1 -0
- package/lib/Command/index.d.ts +6 -0
- package/lib/Command/index.d.ts.map +1 -0
- package/lib/Command/index.js +6 -0
- package/lib/Command/index.js.map +1 -0
- package/lib/Drizzle/Providers.d.ts +1 -1
- package/lib/Drizzle/Providers.d.ts.map +1 -1
- package/lib/Drizzle/Schema.d.ts +1 -1
- package/lib/Drizzle/Schema.d.ts.map +1 -1
- package/lib/Drizzle/Schema.js +147 -12
- package/lib/Drizzle/Schema.js.map +1 -1
- package/lib/GitHub/AuthProvider.js +2 -2
- package/lib/GitHub/AuthProvider.js.map +1 -1
- package/lib/GitHub/Secrets.d.ts.map +1 -1
- package/lib/GitHub/Secrets.js +12 -9
- package/lib/GitHub/Secrets.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts +2 -2
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.js +3 -3
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcServerBun.js +1 -1
- package/lib/Local/RpcServerBun.js.map +1 -1
- package/lib/Local/RpcServerNode.js +1 -1
- package/lib/Local/RpcServerNode.js.map +1 -1
- package/lib/Local/RpcSpawner.js +3 -3
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Named.d.ts +7 -0
- package/lib/Named.d.ts.map +1 -0
- package/lib/Named.js +1 -0
- package/lib/Named.js.map +1 -0
- package/lib/Neon/AuthProvider.js +2 -2
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Neon/Branch.d.ts +0 -2
- package/lib/Neon/Branch.d.ts.map +1 -1
- package/lib/Neon/Branch.js +22 -8
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Neon/Project.js +2 -2
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Phase.d.ts +15 -0
- package/lib/Phase.d.ts.map +1 -1
- package/lib/Phase.js.map +1 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +12 -0
- package/lib/Plan.js.map +1 -1
- package/lib/Planetscale/AuthProvider.js +2 -2
- package/lib/Planetscale/AuthProvider.js.map +1 -1
- package/lib/Platform.d.ts +23 -14
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +9 -9
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +4 -4
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +1 -1
- package/lib/Provider.js.map +1 -1
- package/lib/Resource.d.ts +12 -6
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js.map +1 -1
- package/lib/Rpc.d.ts +124 -1
- package/lib/Rpc.d.ts.map +1 -1
- package/lib/Rpc.js +342 -0
- package/lib/Rpc.js.map +1 -1
- package/lib/RuntimeContext.d.ts +1 -0
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +1 -0
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Self.d.ts +4 -0
- package/lib/Self.d.ts.map +1 -1
- package/lib/Self.js.map +1 -1
- package/lib/Server/S3BucketEventSource.d.ts +4 -3
- package/lib/Server/S3BucketEventSource.d.ts.map +1 -1
- package/lib/Server/S3BucketEventSource.js.map +1 -1
- package/lib/Stack.d.ts +11 -3
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +6 -2
- package/lib/Stack.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +15 -15
- package/lib/State/LocalState.js +1 -1
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Sync.js +4 -4
- package/lib/State/Sync.js.map +1 -1
- package/lib/Tags.d.ts.map +1 -1
- package/lib/Tags.js +3 -3
- package/lib/Tags.js.map +1 -1
- package/lib/Test/Bun.d.ts +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +1 -0
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Http.d.ts +42 -0
- package/lib/Test/Http.d.ts.map +1 -0
- package/lib/Test/Http.js +48 -0
- package/lib/Test/Http.js.map +1 -0
- package/lib/Util/FileLogger.js +1 -1
- package/lib/Util/FileLogger.js.map +1 -1
- package/lib/Util/effect.d.ts.map +1 -1
- package/lib/Util/effect.js +2 -1
- package/lib/Util/effect.js.map +1 -1
- package/lib/Util/interactive.d.ts +16 -0
- package/lib/Util/interactive.d.ts.map +1 -0
- package/lib/Util/interactive.js +35 -0
- package/lib/Util/interactive.js.map +1 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +23 -10
- package/src/AI/Agent.ts +78 -0
- package/src/AI/Parameter.ts +57 -0
- package/src/AI/Tool.ts +98 -0
- package/src/AI/index.ts +3 -0
- package/src/AWS/ACM/Certificate.ts +30 -20
- package/src/AWS/Assets.ts +1 -1
- package/src/AWS/AuthProvider.ts +3 -3
- package/src/AWS/AutoScaling/LaunchTemplate.ts +1 -1
- package/src/AWS/CloudFront/Distribution.ts +1 -1
- package/src/AWS/CloudWatch/DescribeAlarmContributors.ts +3 -1
- package/src/AWS/CloudWatch/DescribeAlarmHistory.ts +3 -1
- package/src/AWS/CloudWatch/DescribeAlarms.ts +3 -1
- package/src/AWS/CloudWatch/DescribeAlarmsForMetric.ts +3 -1
- package/src/AWS/CloudWatch/DescribeAnomalyDetectors.ts +3 -1
- package/src/AWS/CloudWatch/DescribeInsightRules.ts +3 -1
- package/src/AWS/CloudWatch/DisableAlarmActions.ts +3 -1
- package/src/AWS/CloudWatch/DisableInsightRules.ts +3 -1
- package/src/AWS/CloudWatch/EnableAlarmActions.ts +3 -1
- package/src/AWS/CloudWatch/GetAlarmMuteRule.ts +3 -1
- package/src/AWS/CloudWatch/GetDashboard.ts +3 -1
- package/src/AWS/CloudWatch/GetInsightRuleReport.ts +3 -1
- package/src/AWS/CloudWatch/GetMetricData.ts +3 -1
- package/src/AWS/CloudWatch/GetMetricStatistics.ts +3 -1
- package/src/AWS/CloudWatch/GetMetricStream.ts +3 -1
- package/src/AWS/CloudWatch/GetMetricWidgetImage.ts +3 -1
- package/src/AWS/CloudWatch/ListAlarmMuteRules.ts +3 -1
- package/src/AWS/CloudWatch/ListDashboards.ts +3 -1
- package/src/AWS/CloudWatch/ListManagedInsightRules.ts +3 -1
- package/src/AWS/CloudWatch/ListMetricStreams.ts +3 -1
- package/src/AWS/CloudWatch/ListMetrics.ts +3 -1
- package/src/AWS/CloudWatch/ListTagsForResource.ts +3 -1
- package/src/AWS/CloudWatch/PutMetricData.ts +3 -1
- package/src/AWS/CloudWatch/SetAlarmState.ts +3 -1
- package/src/AWS/Credentials.ts +6 -0
- package/src/AWS/DynamoDB/BatchExecuteStatement.ts +3 -1
- package/src/AWS/DynamoDB/BatchGetItem.ts +10 -6
- package/src/AWS/DynamoDB/BatchWriteItem.ts +10 -6
- package/src/AWS/DynamoDB/DeleteItem.ts +3 -1
- package/src/AWS/DynamoDB/DescribeTable.ts +3 -1
- package/src/AWS/DynamoDB/DescribeTimeToLive.ts +3 -1
- package/src/AWS/DynamoDB/ExecuteStatement.ts +3 -1
- package/src/AWS/DynamoDB/ExecuteTransaction.ts +3 -1
- package/src/AWS/DynamoDB/GetItem.ts +3 -1
- package/src/AWS/DynamoDB/ListTables.ts +3 -1
- package/src/AWS/DynamoDB/ListTagsOfResource.ts +3 -1
- package/src/AWS/DynamoDB/PutItem.ts +3 -1
- package/src/AWS/DynamoDB/Query.ts +3 -1
- package/src/AWS/DynamoDB/RestoreTableToPointInTime.ts +3 -1
- package/src/AWS/DynamoDB/Scan.ts +3 -1
- package/src/AWS/DynamoDB/TransactGetItems.ts +10 -6
- package/src/AWS/DynamoDB/TransactWriteItems.ts +14 -8
- package/src/AWS/DynamoDB/UpdateItem.ts +3 -1
- package/src/AWS/DynamoDB/UpdateTimeToLive.ts +3 -1
- package/src/AWS/EC2/Image.ts +2 -2
- package/src/AWS/EC2/Instance.ts +1 -3
- package/src/AWS/EC2/NatGateway.ts +1 -1
- package/src/AWS/EC2/NetworkAcl.ts +1 -1
- package/src/AWS/EC2/SecurityGroup.ts +1 -1
- package/src/AWS/EC2/VpcEndpoint.ts +1 -1
- package/src/AWS/EC2/hosted.ts +2 -2
- package/src/AWS/ECS/DescribeTasks.ts +3 -1
- package/src/AWS/ECS/ListTasks.ts +3 -1
- package/src/AWS/ECS/RunTask.ts +3 -1
- package/src/AWS/ECS/StopTask.ts +3 -1
- package/src/AWS/ECS/Task.ts +1 -1
- package/src/AWS/Environment.ts +4 -3
- package/src/AWS/EventBridge/DescribeEventBus.ts +3 -1
- package/src/AWS/EventBridge/DescribeRule.ts +3 -1
- package/src/AWS/EventBridge/ListEventBuses.ts +3 -1
- package/src/AWS/EventBridge/ListRules.ts +3 -1
- package/src/AWS/EventBridge/ListTargetsByRule.ts +3 -1
- package/src/AWS/EventBridge/PutEvents.ts +3 -1
- package/src/AWS/EventBridge/TestEventPattern.ts +3 -1
- package/src/AWS/EventBridge/ToLambda.ts +3 -1
- package/src/AWS/EventBridge/ToQueue.ts +3 -1
- package/src/AWS/Kinesis/DescribeAccountSettings.ts +3 -1
- package/src/AWS/Kinesis/DescribeLimits.ts +3 -1
- package/src/AWS/Kinesis/DescribeStream.ts +3 -1
- package/src/AWS/Kinesis/DescribeStreamConsumer.ts +3 -1
- package/src/AWS/Kinesis/DescribeStreamSummary.ts +3 -1
- package/src/AWS/Kinesis/GetRecords.ts +3 -1
- package/src/AWS/Kinesis/GetResourcePolicy.ts +3 -1
- package/src/AWS/Kinesis/GetShardIterator.ts +3 -1
- package/src/AWS/Kinesis/ListShards.ts +3 -1
- package/src/AWS/Kinesis/ListStreamConsumers.ts +3 -1
- package/src/AWS/Kinesis/ListStreams.ts +3 -1
- package/src/AWS/Kinesis/ListTagsForResource.ts +3 -1
- package/src/AWS/Kinesis/PutRecord.ts +3 -1
- package/src/AWS/Kinesis/PutRecords.ts +3 -1
- package/src/AWS/Kinesis/StreamSink.ts +3 -1
- package/src/AWS/Kinesis/SubscribeToShard.ts +3 -1
- package/src/AWS/Lambda/BucketEventSource.ts +3 -1
- package/src/AWS/Lambda/EventBridgeEventSource.ts +3 -1
- package/src/AWS/Lambda/Function.ts +182 -55
- package/src/AWS/Lambda/InvokeFunction.ts +3 -1
- package/src/AWS/Lambda/QueueEventSource.ts +3 -1
- package/src/AWS/Lambda/StreamEventSource.ts +3 -1
- package/src/AWS/Lambda/TableEventSource.ts +3 -1
- package/src/AWS/Lambda/TopicEventSource.ts +3 -1
- package/src/AWS/Organizations/Root.ts +1 -1
- package/src/AWS/Providers.ts +4 -5
- package/src/AWS/RDS/Connect.ts +3 -1
- package/src/AWS/RDSData/BatchExecuteStatement.ts +3 -1
- package/src/AWS/RDSData/BeginTransaction.ts +3 -1
- package/src/AWS/RDSData/CommitTransaction.ts +6 -1
- package/src/AWS/RDSData/ExecuteSql.ts +3 -1
- package/src/AWS/RDSData/ExecuteStatement.ts +3 -1
- package/src/AWS/RDSData/RollbackTransaction.ts +3 -1
- package/src/AWS/Region.ts +6 -0
- package/src/AWS/S3/AbortMultipartUpload.ts +3 -1
- package/src/AWS/S3/Bucket.ts +18 -18
- package/src/AWS/S3/CompleteMultipartUpload.ts +3 -1
- package/src/AWS/S3/CopyObject.ts +3 -1
- package/src/AWS/S3/CreateMultipartUpload.ts +3 -1
- package/src/AWS/S3/DeleteObject.ts +3 -1
- package/src/AWS/S3/GetObject.ts +3 -1
- package/src/AWS/S3/HeadObject.ts +3 -1
- package/src/AWS/S3/ListObjectsV2.ts +3 -1
- package/src/AWS/S3/PutObject.ts +3 -1
- package/src/AWS/S3/UploadPart.ts +3 -1
- package/src/AWS/SNS/AddPermission.ts +3 -1
- package/src/AWS/SNS/ConfirmSubscription.ts +3 -1
- package/src/AWS/SNS/GetDataProtectionPolicy.ts +3 -1
- package/src/AWS/SNS/GetSubscriptionAttributes.ts +3 -1
- package/src/AWS/SNS/GetTopicAttributes.ts +3 -1
- package/src/AWS/SNS/ListSubscriptions.ts +3 -1
- package/src/AWS/SNS/ListSubscriptionsByTopic.ts +3 -1
- package/src/AWS/SNS/ListTagsForResource.ts +3 -1
- package/src/AWS/SNS/ListTopics.ts +3 -1
- package/src/AWS/SNS/Publish.ts +3 -1
- package/src/AWS/SNS/PublishBatch.ts +3 -1
- package/src/AWS/SNS/PutDataProtectionPolicy.ts +3 -1
- package/src/AWS/SNS/RemovePermission.ts +3 -1
- package/src/AWS/SNS/SetSubscriptionAttributes.ts +3 -1
- package/src/AWS/SNS/SetTopicAttributes.ts +3 -1
- package/src/AWS/SNS/TagResource.ts +3 -1
- package/src/AWS/SNS/TopicSink.ts +3 -1
- package/src/AWS/SNS/UntagResource.ts +3 -1
- package/src/AWS/SQS/DeleteMessage.ts +3 -1
- package/src/AWS/SQS/DeleteMessageBatch.ts +3 -1
- package/src/AWS/SQS/Queue.ts +1 -1
- package/src/AWS/SQS/QueueSink.ts +3 -1
- package/src/AWS/SQS/ReceiveMessage.ts +3 -1
- package/src/AWS/SQS/SendMessage.ts +3 -1
- package/src/AWS/SQS/SendMessageBatch.ts +3 -1
- package/src/AWS/SecretsManager/DescribeSecret.ts +3 -1
- package/src/AWS/SecretsManager/GetRandomPassword.ts +3 -1
- package/src/AWS/SecretsManager/GetSecretValue.ts +3 -1
- package/src/AWS/SecretsManager/ListSecrets.ts +3 -1
- package/src/AWS/SecretsManager/PutSecretValue.ts +3 -1
- package/src/AWS/StateStore/State.ts +41 -9
- package/src/AWS/Website/Router.ts +212 -208
- package/src/AWS/Website/SsrSite.ts +208 -209
- package/src/AWS/Website/StaticSite.ts +284 -281
- package/src/AdoptPolicy.ts +1 -1
- package/src/Apply.ts +16 -7
- package/src/Auth/Lock.ts +4 -2
- package/src/Auth/Profile.ts +34 -12
- package/src/Axiom/AuthProvider.ts +2 -2
- package/src/Binding.ts +6 -2
- package/src/Bundle/Bundle.ts +53 -4
- package/src/Bundle/Docker.ts +23 -4
- package/src/Bundle/InstalledPackages.ts +615 -0
- package/src/Bundle/TempRoot.ts +1 -1
- package/src/Bundle/index.ts +1 -0
- package/src/Cli/commands/aws.ts +1 -1
- package/src/Cli/commands/cloudflare.ts +3 -10
- package/src/Cli/commands/login.ts +1 -1
- package/src/Cli/commands/logs.ts +1 -1
- package/src/Cli/commands/nuke.ts +1 -1
- package/src/Cli/commands/profile.ts +2 -2
- package/src/Cli/commands/state.ts +6 -11
- package/src/Cli/commands/tail.ts +1 -1
- package/src/Cli/selectCli.ts +2 -25
- package/src/Cloudflare/Access/Application.ts +63 -20
- package/src/Cloudflare/AiGateway/AiGateway.ts +186 -0
- package/src/Cloudflare/AiGateway/AiGatewayBinding.ts +3 -1
- package/src/Cloudflare/AiGateway/DurableObjectChatPersistence.ts +88 -0
- package/src/Cloudflare/AiGateway/LanguageModel.ts +1 -3
- package/src/Cloudflare/AiGateway/index.ts +1 -1
- package/src/Cloudflare/AiSearch/AiSearch.ts +89 -90
- package/src/Cloudflare/AiSearch/AiSearchBinding.ts +5 -2
- package/src/Cloudflare/AiSearch/AiSearchInstance.ts +31 -14
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDataset.ts +1 -4
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +5 -3
- package/src/Cloudflare/ApiShield/UserSchema.ts +5 -0
- package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +3 -1
- package/src/Cloudflare/Auth/AuthProvider.ts +6 -3
- package/src/Cloudflare/Browser/BrowserBinding.ts +3 -1
- package/src/Cloudflare/Cache/RegionalTieredCache.ts +18 -0
- package/src/Cloudflare/ClientCertificate/ClientCertificate.ts +19 -12
- package/src/Cloudflare/CloudflareEnvironment.ts +3 -1
- package/src/Cloudflare/Container/Container.ts +313 -171
- package/src/Cloudflare/Container/ContainerApplication.ts +73 -893
- package/src/Cloudflare/Container/ContainerBundle.ts +78 -2
- package/src/Cloudflare/Container/ContainerPlatform.ts +220 -0
- package/src/Cloudflare/Container/ContainerProvider.ts +1052 -0
- package/src/Cloudflare/Container/LocalContainerProvider.ts +14 -7
- package/src/Cloudflare/Container/StartContainer.ts +65 -14
- package/src/Cloudflare/Container/index.ts +2 -1
- package/src/Cloudflare/Credentials.ts +6 -0
- package/src/Cloudflare/D1/D1Connection.ts +3 -1
- package/src/Cloudflare/Dns/DnsBinding.ts +1 -30
- package/src/Cloudflare/Dns/DnsRead.ts +5 -3
- package/src/Cloudflare/Dns/DnsReadWrite.ts +3 -1
- package/src/Cloudflare/Dns/DnsWrite.ts +5 -3
- package/src/Cloudflare/Email/EmailCatchAll.ts +1 -1
- package/src/Cloudflare/Email/EmailRouting.ts +1 -1
- package/src/Cloudflare/Email/EmailRule.ts +1 -1
- package/src/Cloudflare/Email/SendEmail.ts +1 -1
- package/src/Cloudflare/Email/SendEmailBinding.ts +5 -3
- package/src/Cloudflare/Fetcher.ts +86 -15
- package/src/Cloudflare/Flagship/FlagshipBinding.ts +3 -1
- package/src/Cloudflare/GoogleTagGateway/GoogleTagGateway.ts +1 -1
- package/src/Cloudflare/HttpClientUtils.ts +31 -0
- package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +3 -1
- package/src/Cloudflare/Iam/UserGroupMembership.ts +7 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +3 -1
- package/src/Cloudflare/Images/Variant.ts +20 -3
- package/src/Cloudflare/KV/{KVNamespace.ts → Namespace.ts} +9 -6
- package/src/Cloudflare/KV/NamespaceBinding.ts +68 -0
- package/src/Cloudflare/KV/NamespaceHttp.ts +89 -0
- package/src/Cloudflare/KV/{KVNamespaceBinding.ts → NamespaceRead.ts} +15 -104
- package/src/Cloudflare/KV/NamespaceReadBinding.ts +39 -0
- package/src/Cloudflare/KV/NamespaceReadHttp.ts +171 -0
- package/src/Cloudflare/KV/NamespaceReadWrite.ts +20 -0
- package/src/Cloudflare/KV/NamespaceReadWriteBinding.ts +32 -0
- package/src/Cloudflare/KV/NamespaceReadWriteHttp.ts +38 -0
- package/src/Cloudflare/KV/NamespaceTypes.ts +6 -0
- package/src/Cloudflare/KV/NamespaceWrite.ts +26 -0
- package/src/Cloudflare/KV/NamespaceWriteBinding.ts +34 -0
- package/src/Cloudflare/KV/NamespaceWriteHttp.ts +105 -0
- package/src/Cloudflare/KV/index.ts +11 -2
- package/src/Cloudflare/Providers.ts +4 -22
- package/src/Cloudflare/Queue/Queue.ts +9 -9
- package/src/Cloudflare/Queue/QueueBinding.ts +48 -131
- package/src/Cloudflare/Queue/QueueEventSource.ts +4 -2
- package/src/Cloudflare/Queue/QueueHttp.ts +86 -0
- package/src/Cloudflare/Queue/QueueTypes.ts +17 -0
- package/src/Cloudflare/Queue/QueueWrite.ts +64 -0
- package/src/Cloudflare/Queue/QueueWriteBinding.ts +33 -0
- package/src/Cloudflare/Queue/QueueWriteHttp.ts +82 -0
- package/src/Cloudflare/Queue/index.ts +4 -1
- package/src/Cloudflare/R2/{R2Bucket.ts → Bucket.ts} +6 -9
- package/src/Cloudflare/R2/BucketBinding.ts +115 -0
- package/src/Cloudflare/R2/BucketEventNotification.ts +1 -1
- package/src/Cloudflare/R2/BucketHttp.ts +201 -0
- package/src/Cloudflare/R2/BucketRead.ts +43 -0
- package/src/Cloudflare/R2/BucketReadBinding.ts +44 -0
- package/src/Cloudflare/R2/BucketReadHttp.ts +181 -0
- package/src/Cloudflare/R2/BucketReadWrite.ts +20 -0
- package/src/Cloudflare/R2/BucketReadWriteBinding.ts +26 -0
- package/src/Cloudflare/R2/BucketReadWriteHttp.ts +35 -0
- package/src/Cloudflare/R2/BucketSippy.ts +1 -1
- package/src/Cloudflare/R2/BucketTypes.ts +59 -0
- package/src/Cloudflare/R2/BucketWrite.ts +77 -0
- package/src/Cloudflare/R2/BucketWriteBinding.ts +111 -0
- package/src/Cloudflare/R2/BucketWriteHttp.ts +144 -0
- package/src/Cloudflare/R2/index.ts +10 -2
- package/src/Cloudflare/RateLimit/RateLimitBinding.ts +3 -1
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +3 -1
- package/src/Cloudflare/StateStore/Api.ts +1 -1
- package/src/Cloudflare/StateStore/State.ts +6 -4
- package/src/Cloudflare/StateStore/Store.ts +5 -8
- package/src/Cloudflare/Tunnel/Tunnel.ts +1 -1
- package/src/Cloudflare/Tunnel/TunnelBinding.ts +1 -30
- package/src/Cloudflare/Tunnel/TunnelRead.ts +4 -2
- package/src/Cloudflare/Tunnel/TunnelReadWrite.ts +3 -1
- package/src/Cloudflare/Tunnel/TunnelWrite.ts +4 -2
- package/src/Cloudflare/Tunnel/WarpConnector.ts +1 -1
- package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +12 -0
- package/src/Cloudflare/Vectorize/VectorizeIndexBinding.ts +3 -1
- package/src/Cloudflare/VpcService/VpcService.ts +1 -1
- package/src/Cloudflare/WaitingRoom/Settings.ts +19 -1
- package/src/Cloudflare/Website/StaticSite.ts +12 -11
- package/src/Cloudflare/Website/Vite.ts +1 -1
- package/src/Cloudflare/Workers/AccountSetting.ts +9 -6
- package/src/Cloudflare/Workers/Assets.ts +6 -6
- package/src/Cloudflare/Workers/CronEventSource.ts +4 -2
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +22 -17
- package/src/Cloudflare/Workers/DurableObjectChatPersistence.ts +20 -4
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +125 -73
- package/src/Cloudflare/Workers/DurableObjectState.ts +25 -11
- package/src/Cloudflare/Workers/DurableObjectStorage.ts +50 -37
- package/src/Cloudflare/Workers/Fetch.ts +3 -1
- package/src/Cloudflare/Workers/GitHubRepositoryEventSource.ts +3 -1
- package/src/Cloudflare/Workers/InferEnv.ts +2 -2
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +15 -18
- package/src/Cloudflare/Workers/Rpc.ts +7 -273
- package/src/Cloudflare/Workers/RpcDurableObjectNamespace.ts +10 -8
- package/src/Cloudflare/Workers/RpcWorker.ts +8 -8
- package/src/Cloudflare/Workers/ScheduledEvents.ts +24 -20
- package/src/Cloudflare/Workers/VersionMetadataBinding.ts +3 -1
- package/src/Cloudflare/Workers/WebSocket.ts +1 -1
- package/src/Cloudflare/Workers/Worker.ts +157 -1799
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +5 -5
- package/src/Cloudflare/Workers/WorkerBinding.ts +8 -6
- package/src/Cloudflare/Workers/WorkerBridge.ts +22 -18
- package/src/Cloudflare/Workers/WorkerBundle.ts +3 -5
- package/src/Cloudflare/Workers/{DynamicWorkerLoader.ts → WorkerLoader.ts} +137 -140
- package/src/Cloudflare/Workers/WorkerProvider.ts +1771 -0
- package/src/Cloudflare/Workers/Workflow.ts +9 -5
- package/src/Cloudflare/Workers/index.ts +2 -2
- package/src/Cloudflare/Zaraz/ZarazConfig.ts +1 -1
- package/src/Cloudflare/Zone/Hold.ts +18 -0
- package/src/Cloudflare/index.ts +3 -0
- package/src/Command/Build.ts +187 -0
- package/src/Command/Command.ts +244 -0
- package/src/Command/Dev.ts +219 -0
- package/src/Command/Exec.ts +121 -0
- package/src/Command/Local.ts +6 -0
- package/src/{Build → Command}/Memo.ts +5 -5
- package/src/Command/Providers.ts +41 -0
- package/src/Command/index.ts +5 -0
- package/src/Drizzle/Schema.ts +213 -26
- package/src/GitHub/AuthProvider.ts +2 -2
- package/src/GitHub/Secrets.ts +15 -12
- package/src/Local/RpcProvider.ts +2 -2
- package/src/Local/RpcProviderProxy.ts +3 -3
- package/src/Local/RpcServerBun.ts +1 -1
- package/src/Local/RpcServerNode.ts +1 -1
- package/src/Local/RpcSpawner.ts +3 -3
- package/src/Named.ts +6 -0
- package/src/Neon/AuthProvider.ts +2 -2
- package/src/Neon/Branch.ts +25 -12
- package/src/Neon/Project.ts +2 -2
- package/src/Phase.ts +16 -0
- package/src/Plan.ts +12 -0
- package/src/Planetscale/AuthProvider.ts +2 -2
- package/src/Platform.ts +137 -96
- package/src/Provider.ts +5 -6
- package/src/Resource.ts +14 -7
- package/src/Rpc.ts +552 -1
- package/src/RuntimeContext.ts +3 -1
- package/src/Self.ts +5 -2
- package/src/Server/S3BucketEventSource.ts +3 -1
- package/src/Stack.ts +26 -5
- package/src/State/LocalState.ts +1 -1
- package/src/State/Sync.ts +4 -4
- package/src/Tags.ts +3 -5
- package/src/Test/Bun.ts +7 -0
- package/src/Test/Http.ts +74 -0
- package/src/Util/FileLogger.ts +1 -1
- package/src/Util/effect.ts +2 -1
- package/src/Util/interactive.ts +32 -0
- package/src/index.ts +2 -2
- package/lib/Build/Command.d.ts +0 -114
- package/lib/Build/Command.d.ts.map +0 -1
- package/lib/Build/Command.js +0 -191
- package/lib/Build/Command.js.map +0 -1
- package/lib/Build/DevServer.d.ts +0 -113
- package/lib/Build/DevServer.d.ts.map +0 -1
- package/lib/Build/DevServer.js +0 -220
- package/lib/Build/DevServer.js.map +0 -1
- package/lib/Build/Local.js +0 -4
- package/lib/Build/Local.js.map +0 -1
- package/lib/Build/Memo.d.ts.map +0 -1
- package/lib/Build/Memo.js.map +0 -1
- package/lib/Build/index.d.ts +0 -2
- package/lib/Build/index.d.ts.map +0 -1
- package/lib/Build/index.js +0 -2
- package/lib/Build/index.js.map +0 -1
- package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.d.ts +0 -167
- package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.d.ts.map +0 -1
- package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.js +0 -263
- package/lib/Cloudflare/AiGateway/AiGatewaySpendingLimit.js.map +0 -1
- package/lib/Cloudflare/Container/ContainerBinding.d.ts +0 -8
- package/lib/Cloudflare/Container/ContainerBinding.d.ts.map +0 -1
- package/lib/Cloudflare/Container/ContainerBinding.js +0 -39
- package/lib/Cloudflare/Container/ContainerBinding.js.map +0 -1
- package/lib/Cloudflare/KV/KVNamespace.d.ts.map +0 -1
- package/lib/Cloudflare/KV/KVNamespace.js.map +0 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts.map +0 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js +0 -63
- package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +0 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +0 -1
- package/lib/Cloudflare/R2/R2Bucket.js.map +0 -1
- package/lib/Cloudflare/R2/R2BucketBinding.d.ts +0 -92
- package/lib/Cloudflare/R2/R2BucketBinding.d.ts.map +0 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js +0 -121
- package/lib/Cloudflare/R2/R2BucketBinding.js.map +0 -1
- package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +0 -1
- package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +0 -1
- package/lib/Construct.d.ts +0 -56
- package/lib/Construct.d.ts.map +0 -1
- package/lib/Construct.js +0 -51
- package/lib/Construct.js.map +0 -1
- package/src/Build/Command.ts +0 -293
- package/src/Build/DevServer.ts +0 -338
- package/src/Build/Local.ts +0 -4
- package/src/Build/index.ts +0 -1
- package/src/Cloudflare/AiGateway/AiGatewaySpendingLimit.ts +0 -398
- package/src/Cloudflare/Container/ContainerBinding.ts +0 -74
- package/src/Cloudflare/R2/R2BucketBinding.ts +0 -339
- package/src/Construct.ts +0 -71
- /package/lib/{Build → Command}/Local.d.ts +0 -0
- /package/lib/{Build → Command}/Memo.d.ts +0 -0
|
@@ -1,63 +1,43 @@
|
|
|
1
1
|
import type * as cf from "@cloudflare/workers-types";
|
|
2
|
-
import type { ContainerImage } from "@distilled.cloud/cloudflare-runtime/Docker";
|
|
3
2
|
import * as workers from "@distilled.cloud/cloudflare/workers";
|
|
4
|
-
import * as zones from "@distilled.cloud/cloudflare/zones";
|
|
5
3
|
import type * as Config from "effect/Config";
|
|
6
4
|
import type { ConfigError } from "effect/Config";
|
|
7
5
|
import * as Context from "effect/Context";
|
|
8
|
-
import * as Data from "effect/Data";
|
|
9
6
|
import * as Effect from "effect/Effect";
|
|
10
|
-
import * as
|
|
11
|
-
import * as Predicate from "effect/Predicate";
|
|
7
|
+
import type * as Layer from "effect/Layer";
|
|
12
8
|
import * as Redacted from "effect/Redacted";
|
|
13
|
-
import
|
|
14
|
-
import * as Stream from "effect/Stream";
|
|
15
|
-
import * as crypto from "node:crypto";
|
|
16
|
-
import { Unowned } from "../../AdoptPolicy.ts";
|
|
17
|
-
import * as Artifacts from "../../Artifacts.ts";
|
|
18
|
-
import { hashDirectory, type MemoOptions } from "../../Build/Memo.ts";
|
|
9
|
+
import { type MemoOptions } from "../../Command/Memo.ts";
|
|
19
10
|
import * as Bundle from "../../Bundle/Bundle.ts";
|
|
20
|
-
import type {
|
|
21
|
-
import { isResolved } from "../../Diff.ts";
|
|
11
|
+
import type { Dependencies } from "../../Dependencies.ts";
|
|
22
12
|
import type { InputProps } from "../../Input.ts";
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
import type { Named, Tag } from "../../Named.ts";
|
|
14
|
+
import {
|
|
15
|
+
Platform,
|
|
16
|
+
type Main,
|
|
17
|
+
type MainRpc,
|
|
18
|
+
type MakeShape,
|
|
19
|
+
type PlatformProps,
|
|
20
|
+
type PlatformServices,
|
|
21
|
+
} from "../../Platform.ts";
|
|
22
|
+
import { Resource, type ResourceClassLike } from "../../Resource.ts";
|
|
23
|
+
import type { Rpc } from "../../Rpc.ts";
|
|
24
|
+
import type { RuntimeContext } from "../../RuntimeContext.ts";
|
|
25
|
+
import type { Self } from "../../Self.ts";
|
|
28
26
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
27
|
+
import type { Container } from "../Container/Container.ts";
|
|
28
|
+
import type { DevContainerImage } from "../Container/ContainerApplication.ts";
|
|
29
29
|
import type { HyperdriveDevOrigin } from "../Hyperdrive/Hyperdrive.ts";
|
|
30
|
-
import { CloudflareLogs } from "../Logs.ts";
|
|
31
30
|
import type { Providers } from "../Providers.ts";
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
uploadAssets,
|
|
35
|
-
type Assets,
|
|
36
|
-
type AssetsProps,
|
|
37
|
-
} from "./Assets.ts";
|
|
38
|
-
import { getCompatibility } from "./Compatibility.ts";
|
|
39
|
-
import {
|
|
40
|
-
isDurableObjectExport,
|
|
41
|
-
type DurableObjectExport,
|
|
42
|
-
} from "./DurableObjectNamespace.ts";
|
|
43
|
-
import { LocalWorkerProvider } from "./LocalWorkerProvider.ts";
|
|
31
|
+
import { type Assets, type AssetsProps } from "./Assets.ts";
|
|
32
|
+
import { type DurableObjectExport } from "./DurableObjectNamespace.ts";
|
|
44
33
|
import { Request } from "./Request.ts";
|
|
45
|
-
import {
|
|
46
|
-
bindWorkerAsyncBindings,
|
|
47
|
-
getCronBindings,
|
|
48
|
-
} from "./WorkerAsyncBindings.ts";
|
|
34
|
+
import { bindWorkerAsyncBindings } from "./WorkerAsyncBindings.ts";
|
|
49
35
|
import type {
|
|
50
36
|
WorkerBinding,
|
|
51
37
|
WorkerBindingResource,
|
|
52
38
|
WorkerBindings,
|
|
53
|
-
WorkerSettingsBinding,
|
|
54
39
|
} from "./WorkerBinding.ts";
|
|
55
|
-
import {
|
|
56
|
-
readPrebuiltWorkerBundle,
|
|
57
|
-
WorkerBundle,
|
|
58
|
-
type ModuleRule,
|
|
59
|
-
} from "./WorkerBundle.ts";
|
|
60
|
-
import { createWorkerName } from "./WorkerName.ts";
|
|
40
|
+
import { type ModuleRule } from "./WorkerBundle.ts";
|
|
61
41
|
import {
|
|
62
42
|
makeWorkerRuntimeContext,
|
|
63
43
|
type WorkerRuntimeContext,
|
|
@@ -143,9 +123,12 @@ export type WorkerServices =
|
|
|
143
123
|
| Request
|
|
144
124
|
| WorkerExecutionContext
|
|
145
125
|
| WorkerEnvironment
|
|
146
|
-
| CloudflareEnvironment
|
|
126
|
+
| CloudflareEnvironment
|
|
127
|
+
| Container.Application<any>
|
|
128
|
+
| Self;
|
|
147
129
|
|
|
148
|
-
export type WorkerShape = Main<WorkerServices
|
|
130
|
+
export type WorkerShape<Req = never> = Main<WorkerServices | Req> &
|
|
131
|
+
MainRpc<WorkerServices | Req>;
|
|
149
132
|
|
|
150
133
|
export type WorkerEnv = Record<
|
|
151
134
|
string,
|
|
@@ -324,14 +307,17 @@ export interface WorkerProps<
|
|
|
324
307
|
* Options for the local dev server that runs this Worker under `alchemy dev`.
|
|
325
308
|
* Each Worker is served on its own port.
|
|
326
309
|
*
|
|
327
|
-
*
|
|
328
|
-
* external dev server (e.g. one spawned via `
|
|
329
|
-
* serving the content this Worker would otherwise host.
|
|
310
|
+
* Use `{ mode: "external" }` to skip starting a local Worker entirely —
|
|
311
|
+
* useful when an external dev server (e.g. one spawned via `Command.Dev`)
|
|
312
|
+
* is serving the content this Worker would otherwise host.
|
|
330
313
|
*/
|
|
331
314
|
dev?:
|
|
332
|
-
| false
|
|
333
|
-
| string
|
|
334
315
|
| {
|
|
316
|
+
/**
|
|
317
|
+
* Run this Worker in `workerd` locally (the default).
|
|
318
|
+
* @default "worker"
|
|
319
|
+
*/
|
|
320
|
+
mode?: "worker";
|
|
335
321
|
/**
|
|
336
322
|
* Host the local dev server binds to.
|
|
337
323
|
* @default "localhost"
|
|
@@ -349,6 +335,17 @@ export interface WorkerProps<
|
|
|
349
335
|
* @default false
|
|
350
336
|
*/
|
|
351
337
|
strictPort?: boolean;
|
|
338
|
+
}
|
|
339
|
+
| {
|
|
340
|
+
/**
|
|
341
|
+
* Don't start a local Worker; an external dev server is running instead.
|
|
342
|
+
*/
|
|
343
|
+
mode: "external";
|
|
344
|
+
/**
|
|
345
|
+
* URL the external dev server is reachable at, if applicable.
|
|
346
|
+
* This will be returned as the `url` attribute of the Worker resource.
|
|
347
|
+
*/
|
|
348
|
+
url?: string;
|
|
352
349
|
};
|
|
353
350
|
}
|
|
354
351
|
|
|
@@ -373,7 +370,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
373
370
|
},
|
|
374
371
|
{
|
|
375
372
|
bindings?: WorkerBinding[];
|
|
376
|
-
containers?: { className: string; dev:
|
|
373
|
+
containers?: { className: string; dev: DevContainerImage | undefined }[];
|
|
377
374
|
crons?: string[];
|
|
378
375
|
hyperdrives?: Record<string, Required<HyperdriveDevOrigin>>;
|
|
379
376
|
},
|
|
@@ -392,7 +389,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
392
389
|
* ```typescript
|
|
393
390
|
* Effect.gen(function* () {
|
|
394
391
|
* // Phase 1: bind resources (runs at deploy time)
|
|
395
|
-
* const kv = yield* Cloudflare.
|
|
392
|
+
* const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
|
|
396
393
|
*
|
|
397
394
|
* return {
|
|
398
395
|
* // Phase 2: runtime handlers (runs on each request)
|
|
@@ -473,7 +470,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
473
470
|
* { main: import.meta.filename },
|
|
474
471
|
* Effect.gen(function* () {
|
|
475
472
|
* // init: bind resources
|
|
476
|
-
* const kv = yield* Cloudflare.
|
|
473
|
+
* const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
|
|
477
474
|
*
|
|
478
475
|
* return {
|
|
479
476
|
* // runtime: use them
|
|
@@ -502,16 +499,18 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
502
499
|
*
|
|
503
500
|
* @example Worker Layer (class + .make() in one file)
|
|
504
501
|
* ```typescript
|
|
505
|
-
* // src/WorkerB.ts
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
* )
|
|
502
|
+
* // src/WorkerB.ts — the tag carries the name + RPC shape; props live
|
|
503
|
+
* // on `.make()`.
|
|
504
|
+
* export class WorkerB extends Cloudflare.Worker<
|
|
505
|
+
* WorkerB,
|
|
506
|
+
* { greet: (name: string) => Effect.Effect<string> }
|
|
507
|
+
* >()("WorkerB") {}
|
|
510
508
|
*
|
|
511
509
|
* export default WorkerB.make(
|
|
510
|
+
* { main: import.meta.filename },
|
|
512
511
|
* Effect.gen(function* () {
|
|
513
512
|
* // init: bind resources
|
|
514
|
-
* const kv = yield* Cloudflare.
|
|
513
|
+
* const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
|
|
515
514
|
*
|
|
516
515
|
* return {
|
|
517
516
|
* // runtime: use them
|
|
@@ -622,7 +621,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
622
621
|
* @example Binding and using R2
|
|
623
622
|
* ```typescript
|
|
624
623
|
* // init
|
|
625
|
-
* const bucket = yield* Cloudflare.
|
|
624
|
+
* const bucket = yield* Cloudflare.R2.ReadWrite(MyBucket);
|
|
626
625
|
*
|
|
627
626
|
* return {
|
|
628
627
|
* fetch: Effect.gen(function* () {
|
|
@@ -643,14 +642,14 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
643
642
|
* ```
|
|
644
643
|
*
|
|
645
644
|
* @section KV Namespace
|
|
646
|
-
* Bind a KV namespace with `Cloudflare.
|
|
645
|
+
* Bind a KV namespace with `Cloudflare.KV.ReadWriteNamespace`. KV provides
|
|
647
646
|
* eventually-consistent, low-latency key-value reads replicated
|
|
648
647
|
* globally across Cloudflare's edge.
|
|
649
648
|
*
|
|
650
649
|
* @example Binding and using KV
|
|
651
650
|
* ```typescript
|
|
652
651
|
* // init
|
|
653
|
-
* const kv = yield* Cloudflare.
|
|
652
|
+
* const kv = yield* Cloudflare.KV.ReadWriteNamespace(MyKV);
|
|
654
653
|
*
|
|
655
654
|
* return {
|
|
656
655
|
* fetch: Effect.gen(function* () {
|
|
@@ -726,18 +725,18 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
726
725
|
* ```
|
|
727
726
|
*
|
|
728
727
|
* @section Dynamic Workers
|
|
729
|
-
* `
|
|
728
|
+
* `WorkerLoader` lets you spin up ephemeral Workers at runtime
|
|
730
729
|
* from inline JavaScript modules. This is useful for sandboxing
|
|
731
730
|
* user-provided code or running untrusted scripts in isolation.
|
|
732
731
|
*
|
|
733
732
|
* @example Loading a dynamic Worker
|
|
734
733
|
* ```typescript
|
|
735
734
|
* // init
|
|
736
|
-
* const loader = yield* Cloudflare.
|
|
735
|
+
* const loader = yield* Cloudflare.WorkerLoader("Loader");
|
|
737
736
|
*
|
|
738
737
|
* return {
|
|
739
738
|
* fetch: Effect.gen(function* () {
|
|
740
|
-
* const worker = loader.load({
|
|
739
|
+
* const worker = yield* loader.load({
|
|
741
740
|
* compatibilityDate: "2026-01-28",
|
|
742
741
|
* mainModule: "worker.js",
|
|
743
742
|
* modules: {
|
|
@@ -755,36 +754,101 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
755
754
|
* };
|
|
756
755
|
* ```
|
|
757
756
|
*/
|
|
758
|
-
export const Worker:
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
WorkerShape,
|
|
762
|
-
WorkerRuntimeContext
|
|
763
|
-
> & {
|
|
764
|
-
<
|
|
765
|
-
const Bindings extends WorkerBindingProps = {},
|
|
766
|
-
const Assets extends WorkerAssetsConfig | undefined = undefined,
|
|
767
|
-
Req = never,
|
|
768
|
-
>(
|
|
769
|
-
id: string,
|
|
770
|
-
props:
|
|
771
|
-
| InputProps<WorkerProps<Bindings, Assets>>
|
|
772
|
-
| Effect.Effect<
|
|
773
|
-
InputProps<WorkerProps<Bindings, Assets>>,
|
|
774
|
-
ConfigError,
|
|
775
|
-
Req
|
|
776
|
-
>,
|
|
777
|
-
): Effect.Effect<
|
|
778
|
-
Worker<{
|
|
779
|
-
[binding in keyof NormalizedBindings<
|
|
780
|
-
Bindings,
|
|
781
|
-
Assets
|
|
782
|
-
>]: NormalizedBindings<Bindings, Assets>[binding];
|
|
783
|
-
}>,
|
|
757
|
+
export const Worker: ResourceClassLike<Worker> &
|
|
758
|
+
Effect.Effect<
|
|
759
|
+
Worker & WorkerRuntimeContext & RuntimeContext,
|
|
784
760
|
never,
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
761
|
+
Worker
|
|
762
|
+
> & {
|
|
763
|
+
<Self, Shape extends WorkerShape, Deps = never>(): {
|
|
764
|
+
<const Id extends string>(
|
|
765
|
+
id: Id,
|
|
766
|
+
): Effect.Effect<
|
|
767
|
+
Worker & Rpc<Self> & Dependencies<Deps>,
|
|
768
|
+
never,
|
|
769
|
+
Self | Extract<Deps, Container.Application<any>> | Providers
|
|
770
|
+
> &
|
|
771
|
+
Named<Id> & {
|
|
772
|
+
new (_: never): MakeShape<Shape, WorkerShape> & Named<Id> & Tag;
|
|
773
|
+
of(shape: Shape & WorkerShape): MakeShape<Shape, WorkerShape>;
|
|
774
|
+
make<PropsReq = never, InitReq = never>(
|
|
775
|
+
props:
|
|
776
|
+
| InputProps<WorkerProps>
|
|
777
|
+
| Effect.Effect<InputProps<WorkerProps>, ConfigError, PropsReq>,
|
|
778
|
+
impl: Effect.Effect<Shape, ConfigError, InitReq>,
|
|
779
|
+
): Layer.Layer<
|
|
780
|
+
Self,
|
|
781
|
+
never,
|
|
782
|
+
| Extract<Deps, Container.Application<any>>
|
|
783
|
+
| Providers
|
|
784
|
+
| Exclude<InitReq, Self | WorkerServices>
|
|
785
|
+
>;
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
<Self>(): {
|
|
789
|
+
<
|
|
790
|
+
const Id extends string,
|
|
791
|
+
Shape extends WorkerShape,
|
|
792
|
+
Req extends
|
|
793
|
+
| WorkerServices
|
|
794
|
+
| Container.Application<any>
|
|
795
|
+
| PlatformServices
|
|
796
|
+
| Tag,
|
|
797
|
+
>(
|
|
798
|
+
id: Id,
|
|
799
|
+
props: InputProps<WorkerProps>,
|
|
800
|
+
impl: Effect.Effect<Shape, ConfigError, Req>,
|
|
801
|
+
): Effect.Effect<
|
|
802
|
+
Worker & Rpc<Self>,
|
|
803
|
+
never,
|
|
804
|
+
Extract<Req, Container.Application<any>> | Providers
|
|
805
|
+
> &
|
|
806
|
+
Named<Id> & {
|
|
807
|
+
new (): MakeShape<Shape, WorkerShape> & Named<Id> & Tag;
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
<
|
|
811
|
+
const Bindings extends WorkerBindingProps = {},
|
|
812
|
+
const Assets extends WorkerAssetsConfig | undefined = undefined,
|
|
813
|
+
Req = never,
|
|
814
|
+
>(
|
|
815
|
+
id: string,
|
|
816
|
+
props:
|
|
817
|
+
| InputProps<WorkerProps<Bindings, Assets>>
|
|
818
|
+
| Effect.Effect<
|
|
819
|
+
InputProps<WorkerProps<Bindings, Assets>>,
|
|
820
|
+
ConfigError,
|
|
821
|
+
Req
|
|
822
|
+
>,
|
|
823
|
+
): Effect.Effect<
|
|
824
|
+
Worker<{
|
|
825
|
+
[binding in keyof NormalizedBindings<
|
|
826
|
+
Bindings,
|
|
827
|
+
Assets
|
|
828
|
+
>]: NormalizedBindings<Bindings, Assets>[binding];
|
|
829
|
+
}> &
|
|
830
|
+
Rpc<{}>,
|
|
831
|
+
never,
|
|
832
|
+
Req | Providers
|
|
833
|
+
>;
|
|
834
|
+
<
|
|
835
|
+
const Id extends string,
|
|
836
|
+
Shape extends WorkerShape,
|
|
837
|
+
Req extends
|
|
838
|
+
| WorkerServices
|
|
839
|
+
| Container.Application<any>
|
|
840
|
+
| PlatformServices,
|
|
841
|
+
>(
|
|
842
|
+
id: string,
|
|
843
|
+
props: InputProps<WorkerProps>,
|
|
844
|
+
impl: Effect.Effect<Shape, ConfigError, Req>,
|
|
845
|
+
): Effect.Effect<
|
|
846
|
+
Worker & Rpc<Shape>,
|
|
847
|
+
never,
|
|
848
|
+
Extract<Req, Container.Application<any>> | Providers
|
|
849
|
+
> &
|
|
850
|
+
Named<Id>;
|
|
851
|
+
} = Platform(WorkerTypeId, {
|
|
788
852
|
// Both hooks are wrapped in arrows so the imported references are resolved
|
|
789
853
|
// at call time rather than at module-load time. Worker.ts forms import
|
|
790
854
|
// cycles with both WorkerAsyncBindings.ts (which imports `isWorker` here)
|
|
@@ -796,1709 +860,3 @@ export const Worker: Platform<
|
|
|
796
860
|
bindWorkerAsyncBindings(resource as Worker, props),
|
|
797
861
|
createRuntimeContext: (id) => makeWorkerRuntimeContext(id),
|
|
798
862
|
});
|
|
799
|
-
|
|
800
|
-
class MissingDurableObjectNamespaces extends Data.TaggedError(
|
|
801
|
-
"MissingDurableObjectNamespaces",
|
|
802
|
-
)<{
|
|
803
|
-
scriptName: string;
|
|
804
|
-
expected: string[];
|
|
805
|
-
}> {}
|
|
806
|
-
|
|
807
|
-
export const WorkerProvider = () =>
|
|
808
|
-
ProviderLayer.select({
|
|
809
|
-
live: () => LiveWorkerProvider(),
|
|
810
|
-
local: () => LocalWorkerProvider(),
|
|
811
|
-
});
|
|
812
|
-
|
|
813
|
-
export const LiveWorkerProvider = () =>
|
|
814
|
-
Provider.effect(
|
|
815
|
-
Worker,
|
|
816
|
-
Effect.gen(function* () {
|
|
817
|
-
const path = yield* Path.Path;
|
|
818
|
-
|
|
819
|
-
const bundler = yield* WorkerBundle;
|
|
820
|
-
const stack = yield* Stack;
|
|
821
|
-
|
|
822
|
-
// const createScriptSubdomain = yield* workers.createScriptSubdomain;
|
|
823
|
-
// const deleteScript = yield* workers.deleteScript;
|
|
824
|
-
// const getScriptSubdomain = yield* workers.getScriptSubdomain;
|
|
825
|
-
// const getScriptSchedule = yield* workers.getScriptSchedule;
|
|
826
|
-
// const getScriptSettings = yield* workers.getScriptScriptAndVersionSetting;
|
|
827
|
-
// const getSubdomain = yield* workers.getSubdomain;
|
|
828
|
-
// const putScript = yield* workers.putScript;
|
|
829
|
-
// const putScriptSchedule = yield* workers.putScriptSchedule;
|
|
830
|
-
// const putDomain = yield* workers.putDomain;
|
|
831
|
-
// const listDomains = yield* workers.listDomains;
|
|
832
|
-
// const deleteDomain = yield* workers.deleteDomain;
|
|
833
|
-
// const listZones = yield* zones.listZones;
|
|
834
|
-
const telemetry = yield* CloudflareLogs;
|
|
835
|
-
|
|
836
|
-
const getAccountSubdomain = (accountId: string) =>
|
|
837
|
-
workers
|
|
838
|
-
.getSubdomain({
|
|
839
|
-
accountId,
|
|
840
|
-
})
|
|
841
|
-
.pipe(Effect.map((result) => result.subdomain));
|
|
842
|
-
|
|
843
|
-
// Toggle the workers.dev subdomain via `POST /subdomain` with
|
|
844
|
-
// `enabled: true | false`. Mirrors the upstream Alchemy
|
|
845
|
-
// implementation in `.vendor/alchemy/.../worker-subdomain.ts`.
|
|
846
|
-
// When enabling we also set `previewsEnabled: true` so the
|
|
847
|
-
// script is reachable both at its stable workers.dev URL and at
|
|
848
|
-
// version-preview URLs; on disable we send just `enabled: false`.
|
|
849
|
-
const setWorkerSubdomain = Effect.fn(function* (
|
|
850
|
-
name: string,
|
|
851
|
-
enabled: boolean,
|
|
852
|
-
) {
|
|
853
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
854
|
-
return yield* workers.createScriptSubdomain({
|
|
855
|
-
accountId,
|
|
856
|
-
scriptName: name,
|
|
857
|
-
enabled,
|
|
858
|
-
previewsEnabled: enabled ? true : undefined,
|
|
859
|
-
});
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
// Convert non-ASCII hostnames (emoji, IDN, etc.) to punycode so the
|
|
863
|
-
// Cloudflare API receives the form it stores domains in. `new URL(...)`
|
|
864
|
-
// does IDNA via WHATWG URL parsing — `📦.alchemy.run` → `xn--5z8h.alchemy.run`.
|
|
865
|
-
const toPunycode = (hostname: string): string => {
|
|
866
|
-
try {
|
|
867
|
-
return new URL(`https://${hostname}`).hostname;
|
|
868
|
-
} catch {
|
|
869
|
-
return hostname;
|
|
870
|
-
}
|
|
871
|
-
};
|
|
872
|
-
|
|
873
|
-
const normalizeDomains = (
|
|
874
|
-
domain: string | string[] | undefined,
|
|
875
|
-
): string[] =>
|
|
876
|
-
domain === undefined
|
|
877
|
-
? []
|
|
878
|
-
: Array.from(
|
|
879
|
-
new Set(
|
|
880
|
-
(Array.isArray(domain) ? domain : [domain]).map(toPunycode),
|
|
881
|
-
),
|
|
882
|
-
);
|
|
883
|
-
|
|
884
|
-
const normalizeCrons = (crons: string[] | undefined): string[] =>
|
|
885
|
-
Array.from(new Set(crons ?? []));
|
|
886
|
-
|
|
887
|
-
const getWorkerCrons = Effect.fn(function* (scriptName: string) {
|
|
888
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
889
|
-
return yield* workers
|
|
890
|
-
.getScriptSchedule({
|
|
891
|
-
accountId,
|
|
892
|
-
scriptName,
|
|
893
|
-
})
|
|
894
|
-
.pipe(
|
|
895
|
-
Effect.map((response) =>
|
|
896
|
-
normalizeCrons(
|
|
897
|
-
response.schedules.map((schedule) => schedule.cron),
|
|
898
|
-
),
|
|
899
|
-
),
|
|
900
|
-
Effect.catchTag("WorkerNotFound", () => Effect.succeed([])),
|
|
901
|
-
);
|
|
902
|
-
});
|
|
903
|
-
|
|
904
|
-
const reconcileCrons = (
|
|
905
|
-
scriptName: string,
|
|
906
|
-
desired: string[],
|
|
907
|
-
previous: string[],
|
|
908
|
-
session: ScopedPlanStatusSession,
|
|
909
|
-
) =>
|
|
910
|
-
Effect.gen(function* () {
|
|
911
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
912
|
-
const live = yield* getWorkerCrons(scriptName);
|
|
913
|
-
const desiredSorted = [...desired].sort();
|
|
914
|
-
const liveSorted = [...live].sort();
|
|
915
|
-
const changed =
|
|
916
|
-
desiredSorted.length !== liveSorted.length ||
|
|
917
|
-
desiredSorted.some((cron, index) => cron !== liveSorted[index]);
|
|
918
|
-
|
|
919
|
-
if (!changed) return live;
|
|
920
|
-
|
|
921
|
-
if (desired.length > 0 || previous.length > 0 || live.length > 0) {
|
|
922
|
-
yield* session.note(
|
|
923
|
-
`Reconciling Cron Triggers (${desired.length}) ...`,
|
|
924
|
-
);
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
const result = yield* workers
|
|
928
|
-
.putScriptSchedule({
|
|
929
|
-
accountId,
|
|
930
|
-
scriptName,
|
|
931
|
-
body: desired.map((cron) => ({ cron })),
|
|
932
|
-
})
|
|
933
|
-
.pipe(
|
|
934
|
-
Effect.retry({
|
|
935
|
-
while: (error) => error._tag === "WorkerNotFound",
|
|
936
|
-
schedule: Schedule.exponential(200).pipe(
|
|
937
|
-
Schedule.both(Schedule.recurs(15)),
|
|
938
|
-
),
|
|
939
|
-
}),
|
|
940
|
-
);
|
|
941
|
-
return normalizeCrons(
|
|
942
|
-
result.schedules.map((schedule) => schedule.cron),
|
|
943
|
-
);
|
|
944
|
-
});
|
|
945
|
-
|
|
946
|
-
/**
|
|
947
|
-
* Infer the Cloudflare Zone ID for a given hostname by listing the
|
|
948
|
-
* account's zones and matching the hostname against each zone's name —
|
|
949
|
-
* walking up the DNS label hierarchy until a match is found.
|
|
950
|
-
*/
|
|
951
|
-
const inferZoneIdForHostname = (
|
|
952
|
-
hostname: string,
|
|
953
|
-
zoneCache: Map<string, string>,
|
|
954
|
-
) =>
|
|
955
|
-
Effect.gen(function* () {
|
|
956
|
-
const cached = zoneCache.get(hostname);
|
|
957
|
-
if (cached) return cached;
|
|
958
|
-
|
|
959
|
-
const zoneList = yield* zones
|
|
960
|
-
.listZones({})
|
|
961
|
-
.pipe(Effect.map((response) => response.result ?? []));
|
|
962
|
-
for (const zone of zoneList) {
|
|
963
|
-
zoneCache.set(zone.name, zone.id);
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
const parts = hostname.split(".");
|
|
967
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
968
|
-
const candidate = parts.slice(i).join(".");
|
|
969
|
-
const match = zoneList.find((z) => z.name === candidate);
|
|
970
|
-
if (match) {
|
|
971
|
-
zoneCache.set(hostname, match.id);
|
|
972
|
-
return match.id;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
return yield* Effect.die(
|
|
976
|
-
`Could not infer Cloudflare Zone for hostname "${hostname}". ` +
|
|
977
|
-
"Ensure the parent zone exists in this account.",
|
|
978
|
-
);
|
|
979
|
-
});
|
|
980
|
-
|
|
981
|
-
const reconcileDomains = (scriptName: string, desired: string[]) =>
|
|
982
|
-
Effect.gen(function* () {
|
|
983
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
984
|
-
// Always query the live state of domains attached to *this*
|
|
985
|
-
// Worker rather than trusting `_previous` from local state.
|
|
986
|
-
// State may have been wiped, populated by another machine, or
|
|
987
|
-
// simply be out of date. Without this we PUT domains that are
|
|
988
|
-
// already registered to this same Worker and Cloudflare
|
|
989
|
-
// returns a confusing "hostname already in use" error.
|
|
990
|
-
const liveAll = yield* workers
|
|
991
|
-
.listDomains({
|
|
992
|
-
accountId,
|
|
993
|
-
service: scriptName,
|
|
994
|
-
})
|
|
995
|
-
.pipe(
|
|
996
|
-
Effect.map((r) =>
|
|
997
|
-
(r.result ?? []).flatMap((d) =>
|
|
998
|
-
d.id && d.hostname && d.zoneId
|
|
999
|
-
? [
|
|
1000
|
-
{
|
|
1001
|
-
id: d.id,
|
|
1002
|
-
hostname: d.hostname,
|
|
1003
|
-
zoneId: d.zoneId,
|
|
1004
|
-
service: d.service ?? undefined,
|
|
1005
|
-
},
|
|
1006
|
-
]
|
|
1007
|
-
: [],
|
|
1008
|
-
),
|
|
1009
|
-
),
|
|
1010
|
-
Effect.catch(() => Effect.succeed([])),
|
|
1011
|
-
);
|
|
1012
|
-
|
|
1013
|
-
const desiredSet = new Set(desired);
|
|
1014
|
-
const liveByHostname = new Map(liveAll.map((d) => [d.hostname, d]));
|
|
1015
|
-
|
|
1016
|
-
// Detach what's no longer wanted. Use the live list so we
|
|
1017
|
-
// don't try to delete domains we no longer track.
|
|
1018
|
-
const toRemove = liveAll.filter((d) => !desiredSet.has(d.hostname));
|
|
1019
|
-
yield* Effect.all(
|
|
1020
|
-
toRemove.map((d) =>
|
|
1021
|
-
workers
|
|
1022
|
-
.deleteDomain({ accountId, domainId: d.id })
|
|
1023
|
-
.pipe(Effect.catchTag("DomainNotFound", () => Effect.void)),
|
|
1024
|
-
),
|
|
1025
|
-
{ concurrency: "unbounded" },
|
|
1026
|
-
);
|
|
1027
|
-
|
|
1028
|
-
if (desired.length === 0) return [];
|
|
1029
|
-
|
|
1030
|
-
const zoneCache = new Map<string, string>();
|
|
1031
|
-
|
|
1032
|
-
// Attach `hostname` to this Worker. Skip the PUT entirely if
|
|
1033
|
-
// the hostname is already attached to *this* Worker — that's a
|
|
1034
|
-
// no-op for Cloudflare and avoids the "already in use" 409.
|
|
1035
|
-
// If it's attached to a *different* Worker, refuse with a
|
|
1036
|
-
// clear message rather than silently re-routing traffic.
|
|
1037
|
-
const attachDomain = Effect.fn(function* (hostname: string) {
|
|
1038
|
-
const live = liveByHostname.get(hostname);
|
|
1039
|
-
if (live) {
|
|
1040
|
-
return {
|
|
1041
|
-
hostname: live.hostname,
|
|
1042
|
-
id: live.id,
|
|
1043
|
-
zoneId: live.zoneId,
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
// Not attached to this Worker — but it could still belong
|
|
1048
|
-
// to another Worker. Check before we try to PUT so we can
|
|
1049
|
-
// emit a helpful error instead of the raw 409.
|
|
1050
|
-
const otherOwner = yield* workers
|
|
1051
|
-
.listDomains({
|
|
1052
|
-
accountId,
|
|
1053
|
-
hostname,
|
|
1054
|
-
})
|
|
1055
|
-
.pipe(
|
|
1056
|
-
Effect.map((r) =>
|
|
1057
|
-
(r.result ?? []).find(
|
|
1058
|
-
(d) => d.hostname === hostname && d.service !== scriptName,
|
|
1059
|
-
),
|
|
1060
|
-
),
|
|
1061
|
-
Effect.catch(() => Effect.succeed(undefined)),
|
|
1062
|
-
);
|
|
1063
|
-
if (otherOwner?.id) {
|
|
1064
|
-
return yield* Effect.die(
|
|
1065
|
-
new Error(
|
|
1066
|
-
`Cannot attach hostname '${hostname}' to Worker '${scriptName}': ` +
|
|
1067
|
-
`it is already attached to Worker '${otherOwner.service ?? "<unknown>"}'. ` +
|
|
1068
|
-
`Detach it from that Worker first, or pick a different hostname.`,
|
|
1069
|
-
),
|
|
1070
|
-
);
|
|
1071
|
-
}
|
|
1072
|
-
|
|
1073
|
-
const zoneId = yield* inferZoneIdForHostname(hostname, zoneCache);
|
|
1074
|
-
// Same eventual-consistency window as `setWorkerSubdomain`:
|
|
1075
|
-
// PUT /accounts/.../workers/domains right after `putScript`
|
|
1076
|
-
// can return `WorkerNotFound` until Cloudflare's script
|
|
1077
|
-
// registry has propagated. Retry on that specific tag.
|
|
1078
|
-
const res = yield* workers
|
|
1079
|
-
.putDomain({
|
|
1080
|
-
accountId,
|
|
1081
|
-
hostname,
|
|
1082
|
-
service: scriptName,
|
|
1083
|
-
zoneId,
|
|
1084
|
-
})
|
|
1085
|
-
.pipe(
|
|
1086
|
-
Effect.retry({
|
|
1087
|
-
while: (error) => error._tag === "WorkerNotFound",
|
|
1088
|
-
schedule: Schedule.exponential(200).pipe(
|
|
1089
|
-
Schedule.both(Schedule.recurs(15)),
|
|
1090
|
-
),
|
|
1091
|
-
}),
|
|
1092
|
-
);
|
|
1093
|
-
return {
|
|
1094
|
-
hostname,
|
|
1095
|
-
id: res.id ?? "",
|
|
1096
|
-
zoneId: res.zoneId ?? zoneId,
|
|
1097
|
-
};
|
|
1098
|
-
});
|
|
1099
|
-
|
|
1100
|
-
const applied = yield* Effect.all(desired.map(attachDomain), {
|
|
1101
|
-
concurrency: "unbounded",
|
|
1102
|
-
});
|
|
1103
|
-
return applied;
|
|
1104
|
-
});
|
|
1105
|
-
|
|
1106
|
-
const createAlchemyWorkerTags = (id: string) => [
|
|
1107
|
-
`alchemy:stack:${stack.name}`,
|
|
1108
|
-
`alchemy:stage:${stack.stage}`,
|
|
1109
|
-
`alchemy:id:${id}`,
|
|
1110
|
-
];
|
|
1111
|
-
|
|
1112
|
-
const hasAlchemyWorkerTags = (
|
|
1113
|
-
id: string,
|
|
1114
|
-
tags: readonly string[] | undefined,
|
|
1115
|
-
) => {
|
|
1116
|
-
const actualTags = new Set(tags ?? []);
|
|
1117
|
-
return createAlchemyWorkerTags(id).every((tag) => actualTags.has(tag));
|
|
1118
|
-
};
|
|
1119
|
-
|
|
1120
|
-
const getDurableObjectNamespaces = (
|
|
1121
|
-
bindings: readonly WorkerSettingsBinding[] | null | undefined,
|
|
1122
|
-
) => {
|
|
1123
|
-
const namespaces = Object.fromEntries(
|
|
1124
|
-
(bindings ?? []).flatMap((binding) =>
|
|
1125
|
-
binding.type === "durable_object_namespace" &&
|
|
1126
|
-
binding.className &&
|
|
1127
|
-
binding.namespaceId
|
|
1128
|
-
? [[binding.className, binding.namespaceId]]
|
|
1129
|
-
: [],
|
|
1130
|
-
),
|
|
1131
|
-
);
|
|
1132
|
-
return namespaces;
|
|
1133
|
-
};
|
|
1134
|
-
|
|
1135
|
-
const getExpectedDurableObjectClassNames = (
|
|
1136
|
-
bindings: readonly WorkerBinding[] | undefined,
|
|
1137
|
-
workerName: string,
|
|
1138
|
-
) =>
|
|
1139
|
-
Array.from(
|
|
1140
|
-
new Set(
|
|
1141
|
-
bindings?.flatMap((binding) =>
|
|
1142
|
-
binding.type === "durable_object_namespace" &&
|
|
1143
|
-
binding.className &&
|
|
1144
|
-
(binding.scriptName === undefined ||
|
|
1145
|
-
binding.scriptName === workerName)
|
|
1146
|
-
? [binding.className]
|
|
1147
|
-
: [],
|
|
1148
|
-
) ?? [],
|
|
1149
|
-
),
|
|
1150
|
-
);
|
|
1151
|
-
|
|
1152
|
-
const getWorkerSettingsWithDurableObjects = Effect.fn(function* (
|
|
1153
|
-
scriptName: string,
|
|
1154
|
-
expectedClassNames: readonly string[],
|
|
1155
|
-
) {
|
|
1156
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
1157
|
-
return yield* workers
|
|
1158
|
-
.getScriptScriptAndVersionSetting({
|
|
1159
|
-
accountId,
|
|
1160
|
-
scriptName,
|
|
1161
|
-
})
|
|
1162
|
-
.pipe(
|
|
1163
|
-
Effect.map((settings) => {
|
|
1164
|
-
const namespaces = getDurableObjectNamespaces(settings.bindings);
|
|
1165
|
-
const missing = expectedClassNames.filter(
|
|
1166
|
-
(className) => !namespaces[className],
|
|
1167
|
-
);
|
|
1168
|
-
if (missing.length > 0) {
|
|
1169
|
-
return Effect.fail(
|
|
1170
|
-
new MissingDurableObjectNamespaces({
|
|
1171
|
-
scriptName,
|
|
1172
|
-
expected: missing,
|
|
1173
|
-
}),
|
|
1174
|
-
);
|
|
1175
|
-
}
|
|
1176
|
-
return Effect.succeed({
|
|
1177
|
-
settings,
|
|
1178
|
-
durableObjectNamespaces: namespaces,
|
|
1179
|
-
});
|
|
1180
|
-
}),
|
|
1181
|
-
Effect.flatten,
|
|
1182
|
-
Effect.retry({
|
|
1183
|
-
while: (error) => error._tag === "MissingDurableObjectNamespaces",
|
|
1184
|
-
schedule: Schedule.exponential(100).pipe(
|
|
1185
|
-
Schedule.both(Schedule.recurs(20)),
|
|
1186
|
-
),
|
|
1187
|
-
}),
|
|
1188
|
-
);
|
|
1189
|
-
});
|
|
1190
|
-
|
|
1191
|
-
const prepareAssets = Effect.fn(function* (
|
|
1192
|
-
assets: WorkerProps["assets"],
|
|
1193
|
-
) {
|
|
1194
|
-
if (!assets) {
|
|
1195
|
-
return undefined;
|
|
1196
|
-
}
|
|
1197
|
-
|
|
1198
|
-
if (typeof assets === "object" && "hash" in assets) {
|
|
1199
|
-
const { hash: _, ...config } = assets;
|
|
1200
|
-
return yield* readAssets(config);
|
|
1201
|
-
}
|
|
1202
|
-
|
|
1203
|
-
// Handle string path or AssetsProps
|
|
1204
|
-
return yield* readAssets(
|
|
1205
|
-
typeof assets === "string" ? { directory: assets } : assets,
|
|
1206
|
-
);
|
|
1207
|
-
});
|
|
1208
|
-
|
|
1209
|
-
const prepareBundle = (id: string, props: WorkerProps) =>
|
|
1210
|
-
(props.bundle === false
|
|
1211
|
-
? readPrebuiltWorkerBundle({
|
|
1212
|
-
main: props.main!,
|
|
1213
|
-
rules: props.rules,
|
|
1214
|
-
})
|
|
1215
|
-
: bundler.build({
|
|
1216
|
-
id,
|
|
1217
|
-
main: props.main!,
|
|
1218
|
-
compatibility: getCompatibility(props),
|
|
1219
|
-
entry: props.isExternal
|
|
1220
|
-
? {
|
|
1221
|
-
kind: "external",
|
|
1222
|
-
}
|
|
1223
|
-
: {
|
|
1224
|
-
kind: "effect",
|
|
1225
|
-
exports: props.exports ?? {},
|
|
1226
|
-
},
|
|
1227
|
-
stack: { name: stack.name, stage: stack.stage },
|
|
1228
|
-
extraOptions: props.build,
|
|
1229
|
-
})
|
|
1230
|
-
).pipe(Artifacts.cached("build"));
|
|
1231
|
-
|
|
1232
|
-
const hashScript = (script: string) =>
|
|
1233
|
-
Effect.sync(() =>
|
|
1234
|
-
crypto.createHash("sha256").update(script).digest("hex"),
|
|
1235
|
-
);
|
|
1236
|
-
|
|
1237
|
-
const viteBuild = Effect.fn(function* (props: WorkerProps) {
|
|
1238
|
-
const compatibility = getCompatibility(props);
|
|
1239
|
-
// Loaded lazily: `./Vite.ts` pulls in `@distilled.cloud/cloudflare-vite-plugin`
|
|
1240
|
-
// (~0.5s), which is only needed for vite-based workers at build time —
|
|
1241
|
-
// not for every Worker definition at module-load time.
|
|
1242
|
-
const Vite = yield* Effect.promise(() => import("./Vite.ts"));
|
|
1243
|
-
const { assetsDirectory, serverBundle } = yield* Vite.viteBuild(
|
|
1244
|
-
props.vite?.rootDir,
|
|
1245
|
-
Object.fromEntries(
|
|
1246
|
-
(yield* Effect.all(
|
|
1247
|
-
Object.entries(props.env ?? {}).map(
|
|
1248
|
-
Effect.fn(function* ([key, value]) {
|
|
1249
|
-
return [
|
|
1250
|
-
key,
|
|
1251
|
-
typeof value === "string"
|
|
1252
|
-
? value
|
|
1253
|
-
: Redacted.isRedacted(value) &&
|
|
1254
|
-
typeof Redacted.value(value) === "string"
|
|
1255
|
-
? Redacted.value(value)
|
|
1256
|
-
: Effect.isEffect(value)
|
|
1257
|
-
? yield* value as Effect.Effect<any>
|
|
1258
|
-
: undefined,
|
|
1259
|
-
];
|
|
1260
|
-
}),
|
|
1261
|
-
),
|
|
1262
|
-
)).filter(([_, value]) => value !== undefined),
|
|
1263
|
-
),
|
|
1264
|
-
{
|
|
1265
|
-
compatibilityDate: compatibility.date,
|
|
1266
|
-
compatibilityFlags: compatibility.flags,
|
|
1267
|
-
},
|
|
1268
|
-
);
|
|
1269
|
-
|
|
1270
|
-
if (!assetsDirectory && !serverBundle) {
|
|
1271
|
-
return yield* Effect.die(
|
|
1272
|
-
new Error("Vite build produced neither server nor client output"),
|
|
1273
|
-
);
|
|
1274
|
-
}
|
|
1275
|
-
const [assets, bundle] = yield* Effect.all(
|
|
1276
|
-
[
|
|
1277
|
-
assetsDirectory
|
|
1278
|
-
? readAssets({
|
|
1279
|
-
...(props.assets && typeof props.assets !== "string"
|
|
1280
|
-
? props.assets
|
|
1281
|
-
: undefined),
|
|
1282
|
-
directory: assetsDirectory,
|
|
1283
|
-
})
|
|
1284
|
-
: Effect.succeed(undefined),
|
|
1285
|
-
serverBundle
|
|
1286
|
-
? Bundle.bundleOutputFromRolldownOutputBundle(serverBundle)
|
|
1287
|
-
: Effect.succeed(undefined),
|
|
1288
|
-
],
|
|
1289
|
-
{ concurrency: "unbounded" },
|
|
1290
|
-
);
|
|
1291
|
-
return { assets, bundle };
|
|
1292
|
-
});
|
|
1293
|
-
|
|
1294
|
-
const prepareAssetsAndBundle = (
|
|
1295
|
-
id: string,
|
|
1296
|
-
props: WorkerProps,
|
|
1297
|
-
opts: { skipAssetsRead?: boolean } = {},
|
|
1298
|
-
) =>
|
|
1299
|
-
Effect.gen(function* () {
|
|
1300
|
-
if (props.script !== undefined) {
|
|
1301
|
-
const [assets, bundleHash] = yield* Effect.all(
|
|
1302
|
-
[
|
|
1303
|
-
opts.skipAssetsRead
|
|
1304
|
-
? Effect.succeed(undefined)
|
|
1305
|
-
: prepareAssets(props.assets),
|
|
1306
|
-
hashScript(props.script),
|
|
1307
|
-
],
|
|
1308
|
-
{ concurrency: "unbounded" },
|
|
1309
|
-
);
|
|
1310
|
-
return {
|
|
1311
|
-
assets,
|
|
1312
|
-
bundle: {
|
|
1313
|
-
files: [{ path: "main.js", content: props.script }],
|
|
1314
|
-
hash: bundleHash,
|
|
1315
|
-
},
|
|
1316
|
-
};
|
|
1317
|
-
}
|
|
1318
|
-
if (props.vite) {
|
|
1319
|
-
const [{ assets, bundle }, input] = yield* Effect.all(
|
|
1320
|
-
[
|
|
1321
|
-
viteBuild(props),
|
|
1322
|
-
// hashDirectory expects `{ cwd, memo }`. The vite props
|
|
1323
|
-
// store the project root under `rootDir`, so map it
|
|
1324
|
-
// here. Without this, `cwd` falls back to
|
|
1325
|
-
// `process.cwd()` and the input hash is computed over
|
|
1326
|
-
// the wrong directory tree (often the entire monorepo
|
|
1327
|
-
// root), making it both slow and unable to detect
|
|
1328
|
-
// changes scoped to the actual Vite project.
|
|
1329
|
-
hashDirectory({
|
|
1330
|
-
cwd: props.vite.rootDir,
|
|
1331
|
-
memo: props.vite.memo,
|
|
1332
|
-
}),
|
|
1333
|
-
],
|
|
1334
|
-
{ concurrency: "unbounded" },
|
|
1335
|
-
);
|
|
1336
|
-
return { assets, bundle, input };
|
|
1337
|
-
}
|
|
1338
|
-
const [assets, bundle] = yield* Effect.all(
|
|
1339
|
-
[
|
|
1340
|
-
opts.skipAssetsRead
|
|
1341
|
-
? Effect.succeed(undefined)
|
|
1342
|
-
: prepareAssets(props.assets),
|
|
1343
|
-
prepareBundle(id, props),
|
|
1344
|
-
],
|
|
1345
|
-
{ concurrency: "unbounded" },
|
|
1346
|
-
);
|
|
1347
|
-
return { assets, bundle };
|
|
1348
|
-
}).pipe(
|
|
1349
|
-
Effect.map(({ assets, bundle, input }) => ({
|
|
1350
|
-
assets,
|
|
1351
|
-
bundle: {
|
|
1352
|
-
main: bundle?.files[0].path,
|
|
1353
|
-
files: bundle?.files.map(
|
|
1354
|
-
(file) =>
|
|
1355
|
-
new File([file.content as BlobPart], file.path, {
|
|
1356
|
-
type: contentTypeFromExtension(path.extname(file.path)),
|
|
1357
|
-
}),
|
|
1358
|
-
),
|
|
1359
|
-
},
|
|
1360
|
-
hash: {
|
|
1361
|
-
assets: assets?.hash,
|
|
1362
|
-
bundle: bundle?.hash,
|
|
1363
|
-
input,
|
|
1364
|
-
} satisfies Worker["Attributes"]["hash"],
|
|
1365
|
-
})),
|
|
1366
|
-
);
|
|
1367
|
-
|
|
1368
|
-
const normalizePrebuiltAssets = (
|
|
1369
|
-
assets: WorkerProps["assets"],
|
|
1370
|
-
output: Worker["Attributes"] | undefined,
|
|
1371
|
-
) => {
|
|
1372
|
-
if (!Predicate.hasProperty(assets, "hash")) return undefined;
|
|
1373
|
-
const { directory: _, hash, ...config } = assets;
|
|
1374
|
-
return { config, hash, skip: hash === output?.hash?.assets };
|
|
1375
|
-
};
|
|
1376
|
-
|
|
1377
|
-
const putWorker = Effect.fn(function* (
|
|
1378
|
-
id: string,
|
|
1379
|
-
news: WorkerProps,
|
|
1380
|
-
bindings: ResourceBinding<Worker["Binding"]>[],
|
|
1381
|
-
olds: WorkerProps | undefined,
|
|
1382
|
-
output: Worker["Attributes"] | undefined,
|
|
1383
|
-
session: ScopedPlanStatusSession,
|
|
1384
|
-
existingSettings?: workers.GetScriptScriptAndVersionSettingResponse,
|
|
1385
|
-
) {
|
|
1386
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
1387
|
-
const name = yield* createWorkerName(id, news.name);
|
|
1388
|
-
yield* Effect.logInfo(
|
|
1389
|
-
`Cloudflare Worker ${olds ? "update" : "create"}: preparing bundle for ${name}`,
|
|
1390
|
-
);
|
|
1391
|
-
// If the caller handed us a precomputed asset hash that matches
|
|
1392
|
-
// what we previously stored, we can skip walking the directory
|
|
1393
|
-
// entirely and tell Cloudflare to keep the assets it already
|
|
1394
|
-
// has bound to this script. The disk read is the expensive
|
|
1395
|
-
// part; the script PUT happens either way.
|
|
1396
|
-
const prebuiltAssets = normalizePrebuiltAssets(news.assets, output);
|
|
1397
|
-
const {
|
|
1398
|
-
assets,
|
|
1399
|
-
bundle,
|
|
1400
|
-
hash: preparedHash,
|
|
1401
|
-
} = yield* prepareAssetsAndBundle(id, news, {
|
|
1402
|
-
skipAssetsRead: prebuiltAssets?.skip,
|
|
1403
|
-
});
|
|
1404
|
-
// When the caller supplied a precomputed hash (e.g. via
|
|
1405
|
-
// `Build.Command`), store *that* hash in output state so the
|
|
1406
|
-
// next diff can short-circuit by comparing it directly. The
|
|
1407
|
-
// hash that `readAssets` produces is the manifest-derived
|
|
1408
|
-
// hash, which is shaped differently from any upstream
|
|
1409
|
-
// build-input hash and will never match it on the next pass.
|
|
1410
|
-
const hash = {
|
|
1411
|
-
...preparedHash,
|
|
1412
|
-
assets: prebuiltAssets?.hash ?? preparedHash.assets,
|
|
1413
|
-
} satisfies Worker["Attributes"]["hash"];
|
|
1414
|
-
const metadataBindings = bindings.flatMap((b) => b.data.bindings ?? []);
|
|
1415
|
-
const expectedDurableObjectClassNames =
|
|
1416
|
-
getExpectedDurableObjectClassNames(metadataBindings, name);
|
|
1417
|
-
let metadataAssets:
|
|
1418
|
-
| workers.PutScriptRequest["metadata"]["assets"]
|
|
1419
|
-
| undefined;
|
|
1420
|
-
let keepAssets = false;
|
|
1421
|
-
if (prebuiltAssets?.skip) {
|
|
1422
|
-
// Hash matched what's already on Cloudflare: keep the
|
|
1423
|
-
// existing asset manifest and skip the upload session.
|
|
1424
|
-
yield* Effect.logInfo(
|
|
1425
|
-
`Cloudflare Worker update: assets unchanged for ${name}, keeping existing`,
|
|
1426
|
-
);
|
|
1427
|
-
keepAssets = true;
|
|
1428
|
-
metadataAssets = { config: prebuiltAssets.config };
|
|
1429
|
-
metadataBindings.push({
|
|
1430
|
-
type: "assets",
|
|
1431
|
-
name: "ASSETS",
|
|
1432
|
-
});
|
|
1433
|
-
} else if (assets) {
|
|
1434
|
-
// We had to read the directory. Even after the read, the
|
|
1435
|
-
// computed hash may match what's already deployed (e.g.
|
|
1436
|
-
// legacy `string` / `AssetsProps` shapes that don't carry a
|
|
1437
|
-
// precomputed hash, or a precomputed hash that disagreed with
|
|
1438
|
-
// disk). In that case still keep the existing manifest and
|
|
1439
|
-
// skip the upload session — Cloudflare's content-addressed
|
|
1440
|
-
// session would no-op on every byte anyway.
|
|
1441
|
-
if (assets.hash === prebuiltAssets?.hash) {
|
|
1442
|
-
yield* Effect.logInfo(
|
|
1443
|
-
`Cloudflare Worker update: assets unchanged for ${name}, keeping existing`,
|
|
1444
|
-
);
|
|
1445
|
-
keepAssets = true;
|
|
1446
|
-
metadataAssets = { config: assets.config };
|
|
1447
|
-
} else {
|
|
1448
|
-
yield* Effect.logInfo(
|
|
1449
|
-
`Cloudflare Worker ${olds ? "update" : "create"}: uploading assets for ${name}`,
|
|
1450
|
-
);
|
|
1451
|
-
const { jwt } = yield* uploadAssets(
|
|
1452
|
-
accountId,
|
|
1453
|
-
name,
|
|
1454
|
-
assets,
|
|
1455
|
-
session,
|
|
1456
|
-
);
|
|
1457
|
-
metadataAssets = {
|
|
1458
|
-
jwt,
|
|
1459
|
-
config: assets.config,
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
metadataBindings.push({
|
|
1463
|
-
type: "assets",
|
|
1464
|
-
name: "ASSETS",
|
|
1465
|
-
});
|
|
1466
|
-
}
|
|
1467
|
-
metadataBindings.push(
|
|
1468
|
-
{
|
|
1469
|
-
type: "plain_text",
|
|
1470
|
-
name: "ALCHEMY_PHASE",
|
|
1471
|
-
text: "runtime",
|
|
1472
|
-
},
|
|
1473
|
-
{
|
|
1474
|
-
type: "plain_text",
|
|
1475
|
-
name: "ALCHEMY_STACK_NAME",
|
|
1476
|
-
text: stack.name,
|
|
1477
|
-
},
|
|
1478
|
-
{
|
|
1479
|
-
type: "plain_text",
|
|
1480
|
-
name: "ALCHEMY_STAGE",
|
|
1481
|
-
text: stack.stage,
|
|
1482
|
-
},
|
|
1483
|
-
{
|
|
1484
|
-
type: "plain_text",
|
|
1485
|
-
name: "ALCHEMY_CLOUDFLARE_ACCOUNT_ID",
|
|
1486
|
-
text: accountId,
|
|
1487
|
-
},
|
|
1488
|
-
);
|
|
1489
|
-
// Add environment variables as metadata bindings
|
|
1490
|
-
if (news.env) {
|
|
1491
|
-
for (const [key, value] of Object.entries(news.env)) {
|
|
1492
|
-
if (value === undefined) continue;
|
|
1493
|
-
if (metadataBindings.some((b) => b.name === key)) continue;
|
|
1494
|
-
if (Redacted.isRedacted(value)) {
|
|
1495
|
-
const unredacted = Redacted.value(value);
|
|
1496
|
-
metadataBindings.push({
|
|
1497
|
-
type: "secret_text",
|
|
1498
|
-
name: key,
|
|
1499
|
-
text:
|
|
1500
|
-
typeof unredacted === "string"
|
|
1501
|
-
? unredacted
|
|
1502
|
-
: JSON.stringify(unredacted),
|
|
1503
|
-
});
|
|
1504
|
-
} else if (typeof value === "string") {
|
|
1505
|
-
metadataBindings.push({
|
|
1506
|
-
type: "plain_text",
|
|
1507
|
-
name: key,
|
|
1508
|
-
text: value,
|
|
1509
|
-
});
|
|
1510
|
-
} else {
|
|
1511
|
-
metadataBindings.push({
|
|
1512
|
-
type: "json",
|
|
1513
|
-
name: key,
|
|
1514
|
-
json: value,
|
|
1515
|
-
});
|
|
1516
|
-
}
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
yield* Effect.logInfo(
|
|
1520
|
-
`Cloudflare Worker ${olds ? "update" : "create"}: uploading script for ${name}`,
|
|
1521
|
-
);
|
|
1522
|
-
const size =
|
|
1523
|
-
bundle.files
|
|
1524
|
-
?.filter((file) => !file.name.endsWith(".map"))
|
|
1525
|
-
.reduce((acc, file) => acc + file.size, 0) ?? 0;
|
|
1526
|
-
const sizeKB = size / 1024;
|
|
1527
|
-
const sizeMB = sizeKB / 1024;
|
|
1528
|
-
const bundleSize = `${sizeKB > 1024 ? `${sizeMB.toFixed(2)} MB` : `${sizeKB.toFixed(2)} KB`}`;
|
|
1529
|
-
yield* session.note(`Uploading worker (${bundleSize}) ...`);
|
|
1530
|
-
|
|
1531
|
-
// Read existing worker settings for migration tracking
|
|
1532
|
-
const oldSettings =
|
|
1533
|
-
existingSettings ??
|
|
1534
|
-
(yield* workers
|
|
1535
|
-
.getScriptScriptAndVersionSetting({
|
|
1536
|
-
accountId,
|
|
1537
|
-
scriptName: name,
|
|
1538
|
-
})
|
|
1539
|
-
.pipe(
|
|
1540
|
-
Effect.map((s) => s as typeof s | undefined),
|
|
1541
|
-
Effect.catch(() => Effect.succeed(undefined)),
|
|
1542
|
-
));
|
|
1543
|
-
|
|
1544
|
-
const oldTags = Array.from(new Set(oldSettings?.tags ?? []));
|
|
1545
|
-
const oldBindings = oldSettings?.bindings ?? [];
|
|
1546
|
-
|
|
1547
|
-
// Parse alchemy:do:{logicalId}:{className} tags
|
|
1548
|
-
const oldDoClassNameByLogicalId = getDurableObjectTagMap(oldTags);
|
|
1549
|
-
const currentDoBindings = getDurableObjectBindings(bindings, name);
|
|
1550
|
-
const currentDoClassNameByLogicalId = Object.fromEntries(
|
|
1551
|
-
currentDoBindings.map((binding) => [
|
|
1552
|
-
binding.logicalId,
|
|
1553
|
-
binding.className,
|
|
1554
|
-
]),
|
|
1555
|
-
);
|
|
1556
|
-
|
|
1557
|
-
// Parse alchemy:migration-tag:{version}
|
|
1558
|
-
const oldMigrationTag = oldTags.flatMap((tag) =>
|
|
1559
|
-
tag.startsWith("alchemy:migration-tag:")
|
|
1560
|
-
? [tag.slice("alchemy:migration-tag:".length)]
|
|
1561
|
-
: [],
|
|
1562
|
-
)[0];
|
|
1563
|
-
const newMigrationTag = bumpMigrationTagVersion(oldMigrationTag);
|
|
1564
|
-
|
|
1565
|
-
// Compute deleted classes
|
|
1566
|
-
const deletedClasses: string[] = [];
|
|
1567
|
-
for (const [logicalId, className] of Object.entries(
|
|
1568
|
-
oldDoClassNameByLogicalId,
|
|
1569
|
-
)) {
|
|
1570
|
-
if (!currentDoClassNameByLogicalId[logicalId]) {
|
|
1571
|
-
deletedClasses.push(className);
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
|
|
1575
|
-
// Backward compatibility for old workers that have DO bindings but no
|
|
1576
|
-
// alchemy:do tags yet. Cross-script bindings (`scriptName` set to
|
|
1577
|
-
// anything other than this worker) are NEVER candidates for
|
|
1578
|
-
// delete-class migrations — the class lives on the foreign script
|
|
1579
|
-
// and we don't own its lifecycle.
|
|
1580
|
-
if (Object.keys(oldDoClassNameByLogicalId).length === 0) {
|
|
1581
|
-
for (const oldBinding of oldBindings) {
|
|
1582
|
-
const ownedLocally =
|
|
1583
|
-
!("scriptName" in oldBinding) || oldBinding.scriptName === name;
|
|
1584
|
-
if (
|
|
1585
|
-
oldBinding.type === "durable_object_namespace" &&
|
|
1586
|
-
"className" in oldBinding &&
|
|
1587
|
-
oldBinding.className &&
|
|
1588
|
-
ownedLocally &&
|
|
1589
|
-
!currentDoBindings.some(
|
|
1590
|
-
(binding) => binding.bindingName === oldBinding.name,
|
|
1591
|
-
)
|
|
1592
|
-
) {
|
|
1593
|
-
deletedClasses.push(oldBinding.className);
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
// Collect container-backed class names so we can send container metadata
|
|
1599
|
-
const containerClassNames = new Set(
|
|
1600
|
-
bindings.flatMap((b) =>
|
|
1601
|
-
(b.data.containers ?? []).map((c) => c.className),
|
|
1602
|
-
),
|
|
1603
|
-
);
|
|
1604
|
-
|
|
1605
|
-
// Compute new and renamed classes
|
|
1606
|
-
const newClasses: string[] = [];
|
|
1607
|
-
const newSqliteClasses: string[] = [];
|
|
1608
|
-
const renamedClasses: { from: string; to: string }[] = [];
|
|
1609
|
-
for (const binding of currentDoBindings) {
|
|
1610
|
-
const previousClassName =
|
|
1611
|
-
oldDoClassNameByLogicalId[binding.logicalId];
|
|
1612
|
-
if (!previousClassName) {
|
|
1613
|
-
// Default all new Durable Object classes to SQLite. Cloudflare
|
|
1614
|
-
// recommends SQLite for new namespaces, and container-backed
|
|
1615
|
-
// Durable Objects require it.
|
|
1616
|
-
newSqliteClasses.push(binding.className);
|
|
1617
|
-
} else if (previousClassName !== binding.className) {
|
|
1618
|
-
renamedClasses.push({
|
|
1619
|
-
from: previousClassName,
|
|
1620
|
-
to: binding.className,
|
|
1621
|
-
});
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
|
|
1625
|
-
yield* Effect.logInfo(
|
|
1626
|
-
`Cloudflare Worker put: durable object reconciliation ${JSON.stringify(
|
|
1627
|
-
{
|
|
1628
|
-
oldDoClassNameByLogicalId,
|
|
1629
|
-
currentDoClassNameByLogicalId,
|
|
1630
|
-
deletedClasses,
|
|
1631
|
-
renamedClasses,
|
|
1632
|
-
newSqliteClasses,
|
|
1633
|
-
},
|
|
1634
|
-
)}`,
|
|
1635
|
-
);
|
|
1636
|
-
|
|
1637
|
-
// Build alchemy:do:{logicalId}:{className} tags for each DO binding
|
|
1638
|
-
const alchemyDoTags: string[] = [];
|
|
1639
|
-
for (const binding of currentDoBindings) {
|
|
1640
|
-
alchemyDoTags.push(
|
|
1641
|
-
`alchemy:do:${binding.logicalId}:${binding.className}`,
|
|
1642
|
-
);
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
const metadataTags = Array.from(
|
|
1646
|
-
new Set([
|
|
1647
|
-
...createAlchemyWorkerTags(id),
|
|
1648
|
-
...alchemyDoTags,
|
|
1649
|
-
...(newMigrationTag
|
|
1650
|
-
? [`alchemy:migration-tag:${newMigrationTag}`]
|
|
1651
|
-
: []),
|
|
1652
|
-
...(news.tags ?? []),
|
|
1653
|
-
]),
|
|
1654
|
-
);
|
|
1655
|
-
|
|
1656
|
-
const migrations = {
|
|
1657
|
-
oldTag: oldMigrationTag,
|
|
1658
|
-
newTag: newMigrationTag,
|
|
1659
|
-
newClasses,
|
|
1660
|
-
deletedClasses,
|
|
1661
|
-
renamedClasses,
|
|
1662
|
-
transferredClasses: [] as { from: string; to: string }[],
|
|
1663
|
-
newSqliteClasses,
|
|
1664
|
-
};
|
|
1665
|
-
|
|
1666
|
-
const metadataContainers = [...containerClassNames].map(
|
|
1667
|
-
(className) => ({
|
|
1668
|
-
className,
|
|
1669
|
-
}),
|
|
1670
|
-
);
|
|
1671
|
-
|
|
1672
|
-
const compatibility = getCompatibility(news);
|
|
1673
|
-
const metadata: workers.PutScriptRequest["metadata"] = {
|
|
1674
|
-
assets: metadataAssets,
|
|
1675
|
-
bindings: metadataBindings,
|
|
1676
|
-
bodyPart: undefined,
|
|
1677
|
-
compatibilityDate: compatibility.date,
|
|
1678
|
-
compatibilityFlags: compatibility.flags,
|
|
1679
|
-
containers:
|
|
1680
|
-
metadataContainers.length > 0 ? metadataContainers : undefined,
|
|
1681
|
-
keepAssets,
|
|
1682
|
-
keepBindings: undefined,
|
|
1683
|
-
limits: news.limits,
|
|
1684
|
-
logpush: news.logpush,
|
|
1685
|
-
mainModule: bundle.main,
|
|
1686
|
-
migrations,
|
|
1687
|
-
observability: news.observability ?? {
|
|
1688
|
-
enabled: true,
|
|
1689
|
-
logs: {
|
|
1690
|
-
enabled: true,
|
|
1691
|
-
invocationLogs: true,
|
|
1692
|
-
},
|
|
1693
|
-
},
|
|
1694
|
-
placement: news.placement,
|
|
1695
|
-
tags: metadataTags,
|
|
1696
|
-
tailConsumers: undefined,
|
|
1697
|
-
usageModel: undefined,
|
|
1698
|
-
};
|
|
1699
|
-
const worker = yield* workers
|
|
1700
|
-
.putScript({
|
|
1701
|
-
accountId,
|
|
1702
|
-
scriptName: name,
|
|
1703
|
-
metadata,
|
|
1704
|
-
files: bundle.files,
|
|
1705
|
-
})
|
|
1706
|
-
.pipe(
|
|
1707
|
-
Effect.catch((err) => {
|
|
1708
|
-
// When adopting a Worker managed by Wrangler (or after a previous
|
|
1709
|
-
// deploy with mismatched migrations), the old_tag precondition
|
|
1710
|
-
// fails. The only way to discover the actual tag is through the
|
|
1711
|
-
// error message — getScriptSettings is meant to return it but
|
|
1712
|
-
// doesn't at runtime.
|
|
1713
|
-
const msg = String(
|
|
1714
|
-
typeof err === "object" && err !== null && "message" in err
|
|
1715
|
-
? err.message
|
|
1716
|
-
: err,
|
|
1717
|
-
);
|
|
1718
|
-
const expectedTag = msg.match(
|
|
1719
|
-
/when expected tag is ['"]?([^'"]+)['"]?/,
|
|
1720
|
-
)?.[1];
|
|
1721
|
-
if (expectedTag) {
|
|
1722
|
-
return workers.putScript({
|
|
1723
|
-
accountId,
|
|
1724
|
-
scriptName: name,
|
|
1725
|
-
metadata: {
|
|
1726
|
-
...metadata,
|
|
1727
|
-
migrations: {
|
|
1728
|
-
...migrations,
|
|
1729
|
-
oldTag: expectedTag,
|
|
1730
|
-
newTag: bumpMigrationTagVersion(expectedTag),
|
|
1731
|
-
},
|
|
1732
|
-
},
|
|
1733
|
-
files: bundle.files,
|
|
1734
|
-
});
|
|
1735
|
-
}
|
|
1736
|
-
return Effect.fail(err as any);
|
|
1737
|
-
}),
|
|
1738
|
-
);
|
|
1739
|
-
const { settings, durableObjectNamespaces } =
|
|
1740
|
-
yield* getWorkerSettingsWithDurableObjects(
|
|
1741
|
-
name,
|
|
1742
|
-
expectedDurableObjectClassNames,
|
|
1743
|
-
);
|
|
1744
|
-
// Reconcile workers.dev subdomain against observed cloud state.
|
|
1745
|
-
// We can't diff `news.url` against `olds.url` here because both
|
|
1746
|
-
// default to `undefined` (meaning "enable") — that comparison
|
|
1747
|
-
// would skip the API call on every deploy where the user never
|
|
1748
|
-
// explicitly set `url`, leaving the subdomain in whatever state
|
|
1749
|
-
// Cloudflare currently has it (disabled by default, or whatever
|
|
1750
|
-
// a previous failed/external action left it as).
|
|
1751
|
-
const desiredSubdomainEnabled = news.url !== false;
|
|
1752
|
-
const observedSubdomain = yield* workers
|
|
1753
|
-
.getScriptSubdomain({
|
|
1754
|
-
accountId,
|
|
1755
|
-
scriptName: name,
|
|
1756
|
-
})
|
|
1757
|
-
.pipe(
|
|
1758
|
-
Effect.orElseSucceed<workers.GetScriptSubdomainResponse>(() => ({
|
|
1759
|
-
enabled: false,
|
|
1760
|
-
previewsEnabled: false,
|
|
1761
|
-
})),
|
|
1762
|
-
);
|
|
1763
|
-
if (
|
|
1764
|
-
desiredSubdomainEnabled !== observedSubdomain.enabled ||
|
|
1765
|
-
desiredSubdomainEnabled !== observedSubdomain.previewsEnabled
|
|
1766
|
-
) {
|
|
1767
|
-
yield* session.note(
|
|
1768
|
-
`${desiredSubdomainEnabled ? "Enabling" : "Disabling"} workers.dev subdomain...`,
|
|
1769
|
-
);
|
|
1770
|
-
// Cloudflare's script registry is eventually consistent — for the
|
|
1771
|
-
// first few hundred ms after `putScript` returns, POST /subdomain
|
|
1772
|
-
// can still get back `WorkerNotFound` (a generic "unknown error"
|
|
1773
|
-
// body), or a bare 500 surfaced as `InternalServerError` /
|
|
1774
|
-
// `UnknownCloudflareError` (code 10013). Bigger uploads race harder.
|
|
1775
|
-
// Retry the subdomain toggle on those transient tags with a short
|
|
1776
|
-
// exponential backoff; same pattern we use elsewhere in this
|
|
1777
|
-
// provider for DO-namespace propagation and for `putScript` itself.
|
|
1778
|
-
yield* setWorkerSubdomain(name, desiredSubdomainEnabled).pipe(
|
|
1779
|
-
Effect.retry({
|
|
1780
|
-
while: (error) =>
|
|
1781
|
-
error._tag === "WorkerNotFound" ||
|
|
1782
|
-
error._tag === "InternalServerError" ||
|
|
1783
|
-
error._tag === "UnknownCloudflareError",
|
|
1784
|
-
schedule: Schedule.exponential(200).pipe(
|
|
1785
|
-
Schedule.both(Schedule.recurs(15)),
|
|
1786
|
-
),
|
|
1787
|
-
}),
|
|
1788
|
-
);
|
|
1789
|
-
}
|
|
1790
|
-
const desiredDomains = normalizeDomains(news.domain);
|
|
1791
|
-
const previousDomains = output?.domains ?? [];
|
|
1792
|
-
if (desiredDomains.length > 0 || previousDomains.length > 0) {
|
|
1793
|
-
yield* session.note(
|
|
1794
|
-
`Reconciling custom domains (${desiredDomains.length}) ...`,
|
|
1795
|
-
);
|
|
1796
|
-
}
|
|
1797
|
-
const reconciled = yield* reconcileDomains(name, desiredDomains);
|
|
1798
|
-
const workersDevUrl =
|
|
1799
|
-
news.url !== false
|
|
1800
|
-
? `https://${name}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
1801
|
-
: undefined;
|
|
1802
|
-
const domains = [
|
|
1803
|
-
...reconciled.map((d) => `https://${d.hostname}`),
|
|
1804
|
-
...(workersDevUrl ? [workersDevUrl] : []),
|
|
1805
|
-
];
|
|
1806
|
-
const crons = yield* reconcileCrons(
|
|
1807
|
-
name,
|
|
1808
|
-
normalizeCrons([...getCronBindings(bindings), ...(news.crons ?? [])]),
|
|
1809
|
-
output?.crons ?? [],
|
|
1810
|
-
session,
|
|
1811
|
-
);
|
|
1812
|
-
return {
|
|
1813
|
-
workerId: worker.id ?? name,
|
|
1814
|
-
workerName: name,
|
|
1815
|
-
logpush: worker.logpush ?? undefined,
|
|
1816
|
-
url: domains[0],
|
|
1817
|
-
tags: settings.tags ?? metadata.tags,
|
|
1818
|
-
durableObjectNamespaces,
|
|
1819
|
-
accountId,
|
|
1820
|
-
domains,
|
|
1821
|
-
crons,
|
|
1822
|
-
hash,
|
|
1823
|
-
} satisfies Worker["Attributes"];
|
|
1824
|
-
});
|
|
1825
|
-
|
|
1826
|
-
const hasChanged = Effect.fn(function* (
|
|
1827
|
-
id: string,
|
|
1828
|
-
props: WorkerProps,
|
|
1829
|
-
output: Worker["Attributes"],
|
|
1830
|
-
) {
|
|
1831
|
-
if (props.script !== undefined) {
|
|
1832
|
-
const scriptHash = yield* hashScript(props.script);
|
|
1833
|
-
if (scriptHash !== output.hash?.bundle) {
|
|
1834
|
-
return true;
|
|
1835
|
-
}
|
|
1836
|
-
if (!props.assets) {
|
|
1837
|
-
return false;
|
|
1838
|
-
}
|
|
1839
|
-
const assetsHash = Predicate.hasProperty(props.assets, "hash")
|
|
1840
|
-
? props.assets.hash
|
|
1841
|
-
: undefined;
|
|
1842
|
-
if (assetsHash === undefined) {
|
|
1843
|
-
return true;
|
|
1844
|
-
}
|
|
1845
|
-
return assetsHash !== output.hash?.assets;
|
|
1846
|
-
}
|
|
1847
|
-
if (props.vite) {
|
|
1848
|
-
const input = yield* hashDirectory({
|
|
1849
|
-
cwd: props.vite.rootDir,
|
|
1850
|
-
memo: props.vite.memo,
|
|
1851
|
-
});
|
|
1852
|
-
return input !== output.hash?.input;
|
|
1853
|
-
}
|
|
1854
|
-
const bundleHash = yield* prepareBundle(id, props).pipe(
|
|
1855
|
-
Effect.map((b) => b.hash),
|
|
1856
|
-
);
|
|
1857
|
-
if (bundleHash !== output.hash?.bundle) {
|
|
1858
|
-
return true;
|
|
1859
|
-
}
|
|
1860
|
-
if (!props.assets) {
|
|
1861
|
-
return false;
|
|
1862
|
-
}
|
|
1863
|
-
// We deliberately don't read the assets directory during diff.
|
|
1864
|
-
// For `AssetsWithHash` (the documented contract) the upstream
|
|
1865
|
-
// `Build.Command` already gave us an authoritative hash — we
|
|
1866
|
-
// just compare strings. Reading the directory here would
|
|
1867
|
-
// (a) hash the same tree twice per apply (`putWorker` reads
|
|
1868
|
-
// again when an upload is actually required), and (b) crash
|
|
1869
|
-
// when the prior state was written on a different machine
|
|
1870
|
-
// and `path` doesn't exist locally — blocking any local
|
|
1871
|
-
// reapply even though the precomputed hash is right there
|
|
1872
|
-
// in props.
|
|
1873
|
-
//
|
|
1874
|
-
// For the legacy `string` / `AssetsProps` shapes there's no
|
|
1875
|
-
// hash in props to compare against, so we conservatively
|
|
1876
|
-
// assume the assets changed; `putWorker` will read once,
|
|
1877
|
-
// hash, and use `keepAssets` if it turns out nothing actually
|
|
1878
|
-
// changed.
|
|
1879
|
-
const assetsHash = Predicate.hasProperty(props.assets, "hash")
|
|
1880
|
-
? props.assets.hash
|
|
1881
|
-
: undefined;
|
|
1882
|
-
if (assetsHash === undefined) {
|
|
1883
|
-
return true;
|
|
1884
|
-
}
|
|
1885
|
-
return assetsHash !== output.hash?.assets;
|
|
1886
|
-
});
|
|
1887
|
-
|
|
1888
|
-
return Worker.Provider.of({
|
|
1889
|
-
stables: ["workerId", "workerName"],
|
|
1890
|
-
list: () =>
|
|
1891
|
-
Effect.gen(function* () {
|
|
1892
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
1893
|
-
// Account-scoped enumeration of every Worker script. The
|
|
1894
|
-
// per-script `read` makes several extra calls (subdomain,
|
|
1895
|
-
// settings, domains, schedule) to fully hydrate
|
|
1896
|
-
// url/durableObjectNamespaces/domains/crons. Doing that for
|
|
1897
|
-
// every script on the account is both expensive (4 calls × N)
|
|
1898
|
-
// and fragile — a single script with a binding shape the
|
|
1899
|
-
// settings schema doesn't know about would break the whole
|
|
1900
|
-
// listing (the same reason `read` deliberately avoids
|
|
1901
|
-
// `listScripts`). For `list()` we hydrate the core identifying
|
|
1902
|
-
// and settings fields that come straight from the script
|
|
1903
|
-
// metadata and leave the binding-derived fields at the same
|
|
1904
|
-
// defaults `read` returns when those sub-resources are absent
|
|
1905
|
-
// (`url: undefined`, `durableObjectNamespaces: {}`,
|
|
1906
|
-
// `domains: []`, `crons: []`). `accountId` + `workerName` are
|
|
1907
|
-
// sufficient for `delete`.
|
|
1908
|
-
return yield* workers.listScripts.pages({ accountId }).pipe(
|
|
1909
|
-
Stream.runCollect,
|
|
1910
|
-
Effect.map((chunk) =>
|
|
1911
|
-
Array.from(chunk).flatMap((page) =>
|
|
1912
|
-
// Annotate the element type as the full `Attributes` shape
|
|
1913
|
-
// (incl. the optional `hash`) so it matches `read` exactly.
|
|
1914
|
-
// `list()` is an inference source for the provider's resource
|
|
1915
|
-
// type; a narrower element (e.g. via `satisfies`, which omits
|
|
1916
|
-
// `hash`) would derail `Res` inference and cascade every
|
|
1917
|
-
// lifecycle method's requirement channel to `never`.
|
|
1918
|
-
(page.result ?? []).flatMap(
|
|
1919
|
-
(script): Worker["Attributes"][] =>
|
|
1920
|
-
script.id
|
|
1921
|
-
? [
|
|
1922
|
-
{
|
|
1923
|
-
accountId,
|
|
1924
|
-
workerId: script.id,
|
|
1925
|
-
workerName: script.id,
|
|
1926
|
-
logpush: script.logpush ?? undefined,
|
|
1927
|
-
url: undefined,
|
|
1928
|
-
tags: script.tags ?? undefined,
|
|
1929
|
-
durableObjectNamespaces: {},
|
|
1930
|
-
domains: [],
|
|
1931
|
-
crons: [],
|
|
1932
|
-
},
|
|
1933
|
-
]
|
|
1934
|
-
: [],
|
|
1935
|
-
),
|
|
1936
|
-
),
|
|
1937
|
-
),
|
|
1938
|
-
);
|
|
1939
|
-
}),
|
|
1940
|
-
diff: Effect.fn(function* ({ id, news, olds, output, newBindings }) {
|
|
1941
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
1942
|
-
if (!isResolved(news)) return undefined;
|
|
1943
|
-
if ((output?.accountId ?? accountId) !== accountId) {
|
|
1944
|
-
return { action: "replace" };
|
|
1945
|
-
}
|
|
1946
|
-
const workerName = yield* createWorkerName(id, news.name);
|
|
1947
|
-
const oldWorkerName = output?.workerName
|
|
1948
|
-
? output.workerName
|
|
1949
|
-
: yield* createWorkerName(id, olds?.name);
|
|
1950
|
-
if (workerName !== oldWorkerName) {
|
|
1951
|
-
return { action: "replace" };
|
|
1952
|
-
}
|
|
1953
|
-
if (!output) {
|
|
1954
|
-
return;
|
|
1955
|
-
}
|
|
1956
|
-
const newDomains = normalizeDomains(news.domain)
|
|
1957
|
-
.map((h) => `https://${h}`)
|
|
1958
|
-
.sort();
|
|
1959
|
-
const oldDomains = (output?.domains ?? [])
|
|
1960
|
-
.filter((u) => !u.endsWith(".workers.dev"))
|
|
1961
|
-
.sort();
|
|
1962
|
-
const domainsChanged =
|
|
1963
|
-
newDomains.length !== oldDomains.length ||
|
|
1964
|
-
newDomains.some((d, i) => d !== oldDomains[i]);
|
|
1965
|
-
const newCrons = normalizeCrons([
|
|
1966
|
-
...(Array.isArray(newBindings)
|
|
1967
|
-
? getCronBindings(
|
|
1968
|
-
newBindings as ResourceBinding<Worker["Binding"]>[],
|
|
1969
|
-
)
|
|
1970
|
-
: []),
|
|
1971
|
-
...(news.crons ?? []),
|
|
1972
|
-
]).sort();
|
|
1973
|
-
const oldCrons = [...(output?.crons ?? [])].sort();
|
|
1974
|
-
const cronsChanged =
|
|
1975
|
-
newCrons.length !== oldCrons.length ||
|
|
1976
|
-
newCrons.some((cron, index) => cron !== oldCrons[index]);
|
|
1977
|
-
// `url` is `domains[0]`: the first custom domain in user order if
|
|
1978
|
-
// any, otherwise the workers.dev URL (derived from the stable
|
|
1979
|
-
// worker name + account subdomain). It's stable across this update
|
|
1980
|
-
// exactly when that first domain is unchanged — which is NOT the
|
|
1981
|
-
// same as "the domain set is unchanged": adding a second custom
|
|
1982
|
-
// domain leaves `url` put, while reordering changes it even though
|
|
1983
|
-
// the set is equal. Compute the resulting `url` and carry it
|
|
1984
|
-
// forward as a stable only when it matches the old one, so
|
|
1985
|
-
// downstream resources that reference `worker.url` (e.g. a GitHub
|
|
1986
|
-
// Webhook delivery URL built via `Output.interpolate`) resolve it
|
|
1987
|
-
// to a concrete value during planning instead of an unresolved
|
|
1988
|
-
// Output — otherwise every worker update spuriously re-updates them.
|
|
1989
|
-
const newCustomDomains = normalizeDomains(news.domain);
|
|
1990
|
-
const newUrl =
|
|
1991
|
-
newCustomDomains.length > 0
|
|
1992
|
-
? `https://${newCustomDomains[0]}`
|
|
1993
|
-
: news.url !== false
|
|
1994
|
-
? (output.domains ?? []).find((u) => u.endsWith(".workers.dev"))
|
|
1995
|
-
: undefined;
|
|
1996
|
-
const urlStable = newUrl !== undefined && newUrl === output.url;
|
|
1997
|
-
// `durableObjectNamespaces` maps each hosted DO class name to the
|
|
1998
|
-
// namespace id Cloudflare assigned it. Those ids are permanent for
|
|
1999
|
-
// the lifetime of a (worker, class) pair, so the map only changes
|
|
2000
|
-
// when a class is added or removed — never on a plain code/config
|
|
2001
|
-
// update. Carry it forward as a stable whenever the set of local DO
|
|
2002
|
-
// class names is unchanged, for the same reason as `url` above:
|
|
2003
|
-
// downstream resources that bind a DO namespace via
|
|
2004
|
-
// `worker.durableObjectNamespaces[name]` (e.g. a Container attached
|
|
2005
|
-
// to a DO) must resolve it to a concrete value during planning.
|
|
2006
|
-
// Otherwise the binding holds an unresolved Output, which
|
|
2007
|
-
// `diffBindings` treats as "changed", spuriously re-updating the
|
|
2008
|
-
// bound resource on every deploy. Class names are structural (not the
|
|
2009
|
-
// namespace id), so this comparison holds even when `newBindings` is
|
|
2010
|
-
// otherwise unresolved.
|
|
2011
|
-
const newDoClassNames = Array.isArray(newBindings)
|
|
2012
|
-
? getExpectedDurableObjectClassNames(
|
|
2013
|
-
(newBindings as ResourceBinding<Worker["Binding"]>[]).flatMap(
|
|
2014
|
-
(b) => b.data.bindings ?? [],
|
|
2015
|
-
),
|
|
2016
|
-
workerName,
|
|
2017
|
-
).sort()
|
|
2018
|
-
: [];
|
|
2019
|
-
const oldDoClassNames = Object.keys(
|
|
2020
|
-
output.durableObjectNamespaces ?? {},
|
|
2021
|
-
).sort();
|
|
2022
|
-
const doNamespacesStable =
|
|
2023
|
-
oldWorkerName === workerName &&
|
|
2024
|
-
newDoClassNames.length === oldDoClassNames.length &&
|
|
2025
|
-
newDoClassNames.every((name, i) => name === oldDoClassNames[i]);
|
|
2026
|
-
if (
|
|
2027
|
-
domainsChanged ||
|
|
2028
|
-
cronsChanged ||
|
|
2029
|
-
(yield* hasChanged(id, news, output))
|
|
2030
|
-
) {
|
|
2031
|
-
// `workerId` is always stable across an update; seed it so it
|
|
2032
|
-
// survives now that `diff.stables` overrides `provider.stables`
|
|
2033
|
-
// rather than being merged with it.
|
|
2034
|
-
const stables: string[] = ["workerId"];
|
|
2035
|
-
if (oldWorkerName === workerName) {
|
|
2036
|
-
stables.push("workerName");
|
|
2037
|
-
}
|
|
2038
|
-
if (urlStable) {
|
|
2039
|
-
stables.push("url");
|
|
2040
|
-
}
|
|
2041
|
-
if (doNamespacesStable) {
|
|
2042
|
-
stables.push("durableObjectNamespaces");
|
|
2043
|
-
}
|
|
2044
|
-
return {
|
|
2045
|
-
action: "update",
|
|
2046
|
-
stables: stables.length > 0 ? stables : undefined,
|
|
2047
|
-
};
|
|
2048
|
-
}
|
|
2049
|
-
}),
|
|
2050
|
-
precreate: Effect.fn(function* ({ id, news, session }) {
|
|
2051
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
2052
|
-
const name = yield* createWorkerName(id, news.name);
|
|
2053
|
-
const exportMap = news.exports ?? {};
|
|
2054
|
-
const durableObjects = Object.keys(exportMap)
|
|
2055
|
-
.filter((logicalId) => isDurableObjectExport(exportMap[logicalId]))
|
|
2056
|
-
.map((logicalId) => ({
|
|
2057
|
-
logicalId,
|
|
2058
|
-
className: logicalId,
|
|
2059
|
-
}));
|
|
2060
|
-
const doClasses = durableObjects.map((binding) => binding.className);
|
|
2061
|
-
const containers = doClasses.map((className) => ({ className }));
|
|
2062
|
-
const alchemyDoTags = durableObjects.map(
|
|
2063
|
-
({ logicalId, className }) =>
|
|
2064
|
-
`alchemy:do:${logicalId}:${className}`,
|
|
2065
|
-
);
|
|
2066
|
-
const tags = Array.from(
|
|
2067
|
-
new Set([
|
|
2068
|
-
...createAlchemyWorkerTags(id),
|
|
2069
|
-
...alchemyDoTags,
|
|
2070
|
-
...(news.tags ?? []),
|
|
2071
|
-
]),
|
|
2072
|
-
);
|
|
2073
|
-
yield* Effect.logInfo(
|
|
2074
|
-
`Cloudflare Worker precreate: starting ${name}`,
|
|
2075
|
-
);
|
|
2076
|
-
yield* Effect.logInfo(
|
|
2077
|
-
`Cloudflare Worker precreate: durable objects ${JSON.stringify(
|
|
2078
|
-
durableObjects,
|
|
2079
|
-
)}`,
|
|
2080
|
-
);
|
|
2081
|
-
const existingSettings = yield* workers
|
|
2082
|
-
.getScriptScriptAndVersionSetting({
|
|
2083
|
-
accountId,
|
|
2084
|
-
scriptName: name,
|
|
2085
|
-
})
|
|
2086
|
-
.pipe(
|
|
2087
|
-
Effect.catchTag("WorkerNotFound", () =>
|
|
2088
|
-
Effect.succeed(undefined),
|
|
2089
|
-
),
|
|
2090
|
-
);
|
|
2091
|
-
let durableObjectNamespaces = getDurableObjectNamespaces(
|
|
2092
|
-
existingSettings?.bindings,
|
|
2093
|
-
);
|
|
2094
|
-
|
|
2095
|
-
if (existingSettings) {
|
|
2096
|
-
// Engine has already cleared this resource for write via
|
|
2097
|
-
// `read` + AdoptPolicy. Either we own it (matching tags) or
|
|
2098
|
-
// the user opted in to a takeover (`--adopt` / `adopt(true)`).
|
|
2099
|
-
yield* Effect.logInfo(
|
|
2100
|
-
`Cloudflare Worker precreate: reusing existing ${name}`,
|
|
2101
|
-
);
|
|
2102
|
-
} else {
|
|
2103
|
-
yield* session.note("Pre-creating worker...");
|
|
2104
|
-
const mainModule = "main.js";
|
|
2105
|
-
const placeholderScript = `${doClasses.length > 0 ? 'import { DurableObject } from "cloudflare:workers";\n\n' : ""}export default { fetch() { return new Response("Alchemy worker is being deployed...") } };\n${doClasses
|
|
2106
|
-
.map(
|
|
2107
|
-
(className) =>
|
|
2108
|
-
`export class ${className} extends DurableObject {}`,
|
|
2109
|
-
)
|
|
2110
|
-
.join("\n")}`;
|
|
2111
|
-
yield* workers
|
|
2112
|
-
.putScript({
|
|
2113
|
-
accountId,
|
|
2114
|
-
scriptName: name,
|
|
2115
|
-
metadata: {
|
|
2116
|
-
mainModule,
|
|
2117
|
-
bindings:
|
|
2118
|
-
doClasses.length > 0
|
|
2119
|
-
? doClasses.map((className) => ({
|
|
2120
|
-
type: "durable_object_namespace" as const,
|
|
2121
|
-
name: className,
|
|
2122
|
-
className,
|
|
2123
|
-
}))
|
|
2124
|
-
: undefined,
|
|
2125
|
-
...getCompatibility(news),
|
|
2126
|
-
containers,
|
|
2127
|
-
migrations:
|
|
2128
|
-
doClasses.length > 0
|
|
2129
|
-
? {
|
|
2130
|
-
oldTag: undefined,
|
|
2131
|
-
newTag: undefined,
|
|
2132
|
-
newClasses: [],
|
|
2133
|
-
deletedClasses: [],
|
|
2134
|
-
renamedClasses: [],
|
|
2135
|
-
transferredClasses: [],
|
|
2136
|
-
newSqliteClasses: doClasses,
|
|
2137
|
-
}
|
|
2138
|
-
: undefined,
|
|
2139
|
-
observability: news.observability ?? {
|
|
2140
|
-
enabled: true,
|
|
2141
|
-
logs: {
|
|
2142
|
-
enabled: true,
|
|
2143
|
-
invocationLogs: true,
|
|
2144
|
-
},
|
|
2145
|
-
},
|
|
2146
|
-
tags,
|
|
2147
|
-
},
|
|
2148
|
-
files: [
|
|
2149
|
-
new File([placeholderScript], mainModule, {
|
|
2150
|
-
type: "application/javascript+module",
|
|
2151
|
-
}),
|
|
2152
|
-
],
|
|
2153
|
-
})
|
|
2154
|
-
.pipe(
|
|
2155
|
-
// Cloudflare's PUT /workers/scripts/{name} intermittently
|
|
2156
|
-
// returns code 10002 / "An unknown error has occurred" on the
|
|
2157
|
-
// first put for a fresh worker name. Surfaced as the shared
|
|
2158
|
-
// `InternalServerError` upstream (alchemy-run/distilled#290).
|
|
2159
|
-
// Also match `UnknownCloudflareError` for older
|
|
2160
|
-
// @distilled.cloud/cloudflare versions that haven't picked
|
|
2161
|
-
// up the patch yet.
|
|
2162
|
-
Effect.retry({
|
|
2163
|
-
while: (e) =>
|
|
2164
|
-
e._tag === "InternalServerError" ||
|
|
2165
|
-
e._tag === "UnknownCloudflareError",
|
|
2166
|
-
schedule: Schedule.exponential(1000).pipe(
|
|
2167
|
-
Schedule.both(Schedule.recurs(5)),
|
|
2168
|
-
),
|
|
2169
|
-
}),
|
|
2170
|
-
);
|
|
2171
|
-
if (doClasses.length > 0) {
|
|
2172
|
-
({ durableObjectNamespaces } =
|
|
2173
|
-
yield* getWorkerSettingsWithDurableObjects(name, doClasses));
|
|
2174
|
-
}
|
|
2175
|
-
}
|
|
2176
|
-
|
|
2177
|
-
if (existingSettings && doClasses.length > 0) {
|
|
2178
|
-
({ durableObjectNamespaces } =
|
|
2179
|
-
yield* getWorkerSettingsWithDurableObjects(name, doClasses));
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
return {
|
|
2183
|
-
workerId: name,
|
|
2184
|
-
workerName: name,
|
|
2185
|
-
logpush: existingSettings?.logpush ?? undefined,
|
|
2186
|
-
url: undefined,
|
|
2187
|
-
tags: existingSettings?.tags ?? tags,
|
|
2188
|
-
durableObjectNamespaces,
|
|
2189
|
-
accountId,
|
|
2190
|
-
domains: [],
|
|
2191
|
-
crons: [],
|
|
2192
|
-
} satisfies Worker["Attributes"];
|
|
2193
|
-
}),
|
|
2194
|
-
read: Effect.fn(
|
|
2195
|
-
function* ({ id, output, olds }) {
|
|
2196
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
2197
|
-
const workerName =
|
|
2198
|
-
output?.workerName ?? (yield* createWorkerName(id, olds?.name));
|
|
2199
|
-
yield* Effect.logInfo(
|
|
2200
|
-
`Cloudflare Worker read: checking ${workerName}`,
|
|
2201
|
-
);
|
|
2202
|
-
// We deliberately don't call `listScripts({ accountId })` here:
|
|
2203
|
-
// it pulls every Worker on the account back through a strict
|
|
2204
|
-
// schema decode, and a single existing Worker the schema doesn't
|
|
2205
|
-
// know about (e.g. `placement_mode: "targeted"`) breaks the
|
|
2206
|
-
// entire read. `getScriptSettings` already fails with
|
|
2207
|
-
// `WorkerNotFound` if the script doesn't exist, which the
|
|
2208
|
-
// surrounding `Effect.catchTag` turns into `undefined` — that's
|
|
2209
|
-
// all the existence check we need.
|
|
2210
|
-
const [subdomain, settings, domainsList] = yield* Effect.all([
|
|
2211
|
-
workers.getScriptSubdomain({
|
|
2212
|
-
accountId,
|
|
2213
|
-
scriptName: workerName,
|
|
2214
|
-
}),
|
|
2215
|
-
workers.getScriptScriptAndVersionSetting({
|
|
2216
|
-
accountId,
|
|
2217
|
-
scriptName: workerName,
|
|
2218
|
-
}),
|
|
2219
|
-
workers
|
|
2220
|
-
.listDomains({
|
|
2221
|
-
accountId,
|
|
2222
|
-
service: workerName,
|
|
2223
|
-
})
|
|
2224
|
-
.pipe(Effect.map((r) => r.result ?? [])),
|
|
2225
|
-
]);
|
|
2226
|
-
// Preserve the order the user provided in `olds.domain`. The
|
|
2227
|
-
// Cloudflare API returns domains in non-deterministic order,
|
|
2228
|
-
// which would cause downstream `worker.domains[0]` reads to flip
|
|
2229
|
-
// between deploys. Drift (domains we don't know about) is
|
|
2230
|
-
// appended after the user-ordered ones.
|
|
2231
|
-
const userOrder = normalizeDomains(olds?.domain);
|
|
2232
|
-
const orderedHostnames = [
|
|
2233
|
-
...userOrder.flatMap(
|
|
2234
|
-
(h) =>
|
|
2235
|
-
domainsList.find((d) => d.hostname === h)?.hostname ?? [],
|
|
2236
|
-
),
|
|
2237
|
-
...domainsList.flatMap((d) =>
|
|
2238
|
-
d.hostname && !userOrder.includes(d.hostname)
|
|
2239
|
-
? [d.hostname]
|
|
2240
|
-
: [],
|
|
2241
|
-
),
|
|
2242
|
-
];
|
|
2243
|
-
const workersDevUrl = subdomain.enabled
|
|
2244
|
-
? `https://${workerName}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
2245
|
-
: undefined;
|
|
2246
|
-
const domains = [
|
|
2247
|
-
...orderedHostnames.map((h) => `https://${h}`),
|
|
2248
|
-
...(workersDevUrl ? [workersDevUrl] : []),
|
|
2249
|
-
];
|
|
2250
|
-
const crons = yield* getWorkerCrons(workerName);
|
|
2251
|
-
yield* Effect.logInfo(
|
|
2252
|
-
`Cloudflare Worker read: found ${workerName}`,
|
|
2253
|
-
);
|
|
2254
|
-
const attrs = {
|
|
2255
|
-
accountId,
|
|
2256
|
-
workerId: workerName,
|
|
2257
|
-
workerName,
|
|
2258
|
-
logpush: settings.logpush ?? undefined,
|
|
2259
|
-
url: domains[0],
|
|
2260
|
-
tags: settings.tags ?? undefined,
|
|
2261
|
-
durableObjectNamespaces: getDurableObjectNamespaces(
|
|
2262
|
-
settings.bindings,
|
|
2263
|
-
),
|
|
2264
|
-
domains,
|
|
2265
|
-
crons,
|
|
2266
|
-
} satisfies Worker["Attributes"];
|
|
2267
|
-
|
|
2268
|
-
// Centralized ownership decision: the engine routes `read`'s
|
|
2269
|
-
// return value based on `AdoptPolicy`. We hand it the attrs
|
|
2270
|
-
// either as-is (owned: alchemy tags identify this stack/stage/id,
|
|
2271
|
-
// safe to silently adopt even without `--adopt`) or branded with
|
|
2272
|
-
// `Unowned` (caller must opt in via `--adopt` or the engine
|
|
2273
|
-
// raises `OwnedBySomeoneElse`).
|
|
2274
|
-
return hasAlchemyWorkerTags(id, settings.tags ?? [])
|
|
2275
|
-
? attrs
|
|
2276
|
-
: Unowned(attrs);
|
|
2277
|
-
},
|
|
2278
|
-
(effect) =>
|
|
2279
|
-
effect.pipe(
|
|
2280
|
-
Effect.catchTag("WorkerNotFound", () =>
|
|
2281
|
-
Effect.succeed(undefined),
|
|
2282
|
-
),
|
|
2283
|
-
),
|
|
2284
|
-
),
|
|
2285
|
-
reconcile: Effect.fn(function* ({
|
|
2286
|
-
id,
|
|
2287
|
-
news,
|
|
2288
|
-
olds,
|
|
2289
|
-
bindings,
|
|
2290
|
-
output,
|
|
2291
|
-
session,
|
|
2292
|
-
}) {
|
|
2293
|
-
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
2294
|
-
const name =
|
|
2295
|
-
output?.workerName ?? (yield* createWorkerName(id, news.name));
|
|
2296
|
-
const durableObjects = getDurableObjectBindings(bindings, name).map(
|
|
2297
|
-
({ logicalId, className }) => ({
|
|
2298
|
-
logicalId,
|
|
2299
|
-
className,
|
|
2300
|
-
}),
|
|
2301
|
-
);
|
|
2302
|
-
yield* Effect.logInfo(
|
|
2303
|
-
`Cloudflare Worker reconcile: starting ${name}`,
|
|
2304
|
-
);
|
|
2305
|
-
yield* Effect.logInfo(
|
|
2306
|
-
`Cloudflare Worker reconcile: durable objects ${JSON.stringify(
|
|
2307
|
-
durableObjects,
|
|
2308
|
-
)}`,
|
|
2309
|
-
);
|
|
2310
|
-
|
|
2311
|
-
// Observe — fetch the script's current settings if it already exists.
|
|
2312
|
-
// `putWorker` is a true upsert against the Cloudflare API; the
|
|
2313
|
-
// existing settings inform asset/migration decisions and let the
|
|
2314
|
-
// reconciler converge whether the worker is brand-new, adopted, or
|
|
2315
|
-
// an in-place update.
|
|
2316
|
-
const existingSettings = yield* workers
|
|
2317
|
-
.getScriptScriptAndVersionSetting({
|
|
2318
|
-
accountId,
|
|
2319
|
-
scriptName: name,
|
|
2320
|
-
})
|
|
2321
|
-
.pipe(
|
|
2322
|
-
Effect.catchTag("WorkerNotFound", () =>
|
|
2323
|
-
Effect.succeed(undefined),
|
|
2324
|
-
),
|
|
2325
|
-
);
|
|
2326
|
-
yield* Effect.logInfo(
|
|
2327
|
-
`Cloudflare Worker reconcile: existing durable object tags ${JSON.stringify(
|
|
2328
|
-
(existingSettings?.tags ?? []).filter((tag) =>
|
|
2329
|
-
tag.startsWith("alchemy:do:"),
|
|
2330
|
-
),
|
|
2331
|
-
)}`,
|
|
2332
|
-
);
|
|
2333
|
-
yield* Effect.logInfo(
|
|
2334
|
-
`Cloudflare Worker reconcile: previous durable object tags ${JSON.stringify(
|
|
2335
|
-
(output?.tags ?? []).filter((tag) =>
|
|
2336
|
-
tag.startsWith("alchemy:do:"),
|
|
2337
|
-
),
|
|
2338
|
-
)}`,
|
|
2339
|
-
);
|
|
2340
|
-
return yield* putWorker(
|
|
2341
|
-
id,
|
|
2342
|
-
news,
|
|
2343
|
-
bindings,
|
|
2344
|
-
olds,
|
|
2345
|
-
output,
|
|
2346
|
-
session,
|
|
2347
|
-
existingSettings,
|
|
2348
|
-
);
|
|
2349
|
-
}),
|
|
2350
|
-
delete: Effect.fn(function* ({ output }) {
|
|
2351
|
-
yield* Effect.logInfo(
|
|
2352
|
-
`Cloudflare Worker delete: deleting ${output.workerName}`,
|
|
2353
|
-
);
|
|
2354
|
-
// Look up live domain IDs rather than trusting persisted state.
|
|
2355
|
-
// We no longer track `{ id, zoneId }` on the output; fetching
|
|
2356
|
-
// straight from Cloudflare handles both the normal case and
|
|
2357
|
-
// adopted workers whose domains we never recorded.
|
|
2358
|
-
const liveDomains = yield* workers
|
|
2359
|
-
.listDomains({
|
|
2360
|
-
accountId: output.accountId,
|
|
2361
|
-
service: output.workerName,
|
|
2362
|
-
})
|
|
2363
|
-
.pipe(
|
|
2364
|
-
Effect.map((r) => r.result ?? []),
|
|
2365
|
-
Effect.catch(() => Effect.succeed([])),
|
|
2366
|
-
);
|
|
2367
|
-
if (liveDomains.length) {
|
|
2368
|
-
yield* Effect.all(
|
|
2369
|
-
liveDomains.flatMap((d) =>
|
|
2370
|
-
d.id
|
|
2371
|
-
? [
|
|
2372
|
-
workers
|
|
2373
|
-
.deleteDomain({
|
|
2374
|
-
accountId: output.accountId,
|
|
2375
|
-
domainId: d.id,
|
|
2376
|
-
})
|
|
2377
|
-
.pipe(
|
|
2378
|
-
Effect.catchTag("DomainNotFound", () => Effect.void),
|
|
2379
|
-
),
|
|
2380
|
-
]
|
|
2381
|
-
: [],
|
|
2382
|
-
),
|
|
2383
|
-
{ concurrency: "unbounded" },
|
|
2384
|
-
);
|
|
2385
|
-
}
|
|
2386
|
-
yield* workers
|
|
2387
|
-
.deleteScript({
|
|
2388
|
-
accountId: output.accountId,
|
|
2389
|
-
scriptName: output.workerName,
|
|
2390
|
-
// Force teardown of queue consumers, durable object classes, and
|
|
2391
|
-
// service bindings hanging off this worker. Without `force`, those
|
|
2392
|
-
// conditions raise QueueConsumerConflict / ServiceBindingConflict
|
|
2393
|
-
// and leave the script in CF. Alchemy is the source of truth for
|
|
2394
|
-
// the worker, so we want a hard delete on teardown.
|
|
2395
|
-
force: true,
|
|
2396
|
-
})
|
|
2397
|
-
.pipe(Effect.catchTag("WorkerNotFound", () => Effect.void));
|
|
2398
|
-
}),
|
|
2399
|
-
tail: ({ output }) =>
|
|
2400
|
-
telemetry.tailScript({
|
|
2401
|
-
accountId: output.accountId,
|
|
2402
|
-
scriptName: output.workerName,
|
|
2403
|
-
}),
|
|
2404
|
-
logs: ({ output, options }) =>
|
|
2405
|
-
telemetry.queryLogs({
|
|
2406
|
-
accountId: output.accountId,
|
|
2407
|
-
filters: [
|
|
2408
|
-
{
|
|
2409
|
-
key: "$workers.scriptName",
|
|
2410
|
-
operation: "eq",
|
|
2411
|
-
type: "string",
|
|
2412
|
-
value: output.workerName,
|
|
2413
|
-
},
|
|
2414
|
-
],
|
|
2415
|
-
options,
|
|
2416
|
-
}),
|
|
2417
|
-
});
|
|
2418
|
-
}),
|
|
2419
|
-
);
|
|
2420
|
-
|
|
2421
|
-
const contentTypeFromExtension = (extension: string) => {
|
|
2422
|
-
switch (extension) {
|
|
2423
|
-
case ".wasm":
|
|
2424
|
-
return "application/wasm";
|
|
2425
|
-
case ".txt":
|
|
2426
|
-
case ".html":
|
|
2427
|
-
case ".sql":
|
|
2428
|
-
case ".custom":
|
|
2429
|
-
return "text/plain";
|
|
2430
|
-
case ".bin":
|
|
2431
|
-
return "application/octet-stream";
|
|
2432
|
-
case ".mjs":
|
|
2433
|
-
case ".js":
|
|
2434
|
-
return "application/javascript+module";
|
|
2435
|
-
case ".cjs":
|
|
2436
|
-
return "application/javascript";
|
|
2437
|
-
case ".map":
|
|
2438
|
-
return "application/source-map";
|
|
2439
|
-
default:
|
|
2440
|
-
return "application/octet-stream";
|
|
2441
|
-
}
|
|
2442
|
-
};
|
|
2443
|
-
|
|
2444
|
-
function bumpMigrationTagVersion(
|
|
2445
|
-
oldTag: string | undefined,
|
|
2446
|
-
): string | undefined {
|
|
2447
|
-
if (!oldTag) return undefined;
|
|
2448
|
-
const version = oldTag.match(/^(alchemy:)?v(\d+)$/)?.[2];
|
|
2449
|
-
if (!version) return "alchemy:v1";
|
|
2450
|
-
return `alchemy:v${parseInt(version, 10) + 1}`;
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
function getDurableObjectBindings(
|
|
2454
|
-
bindings: ReadonlyArray<ResourceBinding>,
|
|
2455
|
-
workerName: string,
|
|
2456
|
-
) {
|
|
2457
|
-
// Resource authors (and the `make`/`yield* Tag`/plan-vs-apply machinery)
|
|
2458
|
-
// can register the same DO binding multiple times under the same logical
|
|
2459
|
-
// id — `binding()` is a plain `worker.bind` and intentionally has no
|
|
2460
|
-
// dedup. Collapse duplicates here so each `(logicalId, bindingName,
|
|
2461
|
-
// className)` tuple appears at most once. We also exclude cross-script
|
|
2462
|
-
// references: a `scriptName` pointing to *another* worker means this
|
|
2463
|
-
// worker just references a foreign class — ship the binding to
|
|
2464
|
-
// Cloudflare, but don't drive class migrations for it.
|
|
2465
|
-
const seen = new Set<string>();
|
|
2466
|
-
return bindings.flatMap((binding) =>
|
|
2467
|
-
(binding.data.bindings ?? []).flatMap((item: WorkerBinding) => {
|
|
2468
|
-
if (
|
|
2469
|
-
item.type !== "durable_object_namespace" ||
|
|
2470
|
-
!("className" in item) ||
|
|
2471
|
-
!item.className
|
|
2472
|
-
) {
|
|
2473
|
-
return [];
|
|
2474
|
-
}
|
|
2475
|
-
if (item.scriptName !== undefined && item.scriptName !== workerName) {
|
|
2476
|
-
return [];
|
|
2477
|
-
}
|
|
2478
|
-
const dedupKey = `${binding.sid}::${item.name}::${item.className}`;
|
|
2479
|
-
if (seen.has(dedupKey)) return [];
|
|
2480
|
-
seen.add(dedupKey);
|
|
2481
|
-
return [
|
|
2482
|
-
{
|
|
2483
|
-
logicalId: binding.sid,
|
|
2484
|
-
bindingName: item.name,
|
|
2485
|
-
className: item.className,
|
|
2486
|
-
},
|
|
2487
|
-
];
|
|
2488
|
-
}),
|
|
2489
|
-
);
|
|
2490
|
-
}
|
|
2491
|
-
|
|
2492
|
-
function getDurableObjectTagMap(tags: ReadonlyArray<string>) {
|
|
2493
|
-
return Object.fromEntries(
|
|
2494
|
-
tags.flatMap((tag) => {
|
|
2495
|
-
if (!tag.startsWith("alchemy:do:")) {
|
|
2496
|
-
return [];
|
|
2497
|
-
}
|
|
2498
|
-
const parts = tag.split(":");
|
|
2499
|
-
const logicalId = parts[2];
|
|
2500
|
-
const className = parts.slice(3).join(":");
|
|
2501
|
-
return logicalId && className ? [[logicalId, className]] : [];
|
|
2502
|
-
}),
|
|
2503
|
-
);
|
|
2504
|
-
}
|