alchemy 2.0.0-beta.42 → 2.0.0-beta.44
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/bin/cli.js +18 -5
- package/bin/exec.js +317 -242
- package/bin/exec.js.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmContributors.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmHistory.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarms.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarms.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeAlarmsForMetric.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeAnomalyDetectors.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts +1 -1
- package/lib/AWS/CloudWatch/DescribeInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts +1 -1
- package/lib/AWS/CloudWatch/DisableAlarmActions.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/DisableInsightRules.d.ts +1 -1
- package/lib/AWS/CloudWatch/DisableInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts +1 -1
- package/lib/AWS/CloudWatch/EnableAlarmActions.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetAlarmMuteRule.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetDashboard.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetDashboard.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetInsightRuleReport.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricData.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetMetricData.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetMetricStatistics.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricStream.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetMetricStream.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts +1 -1
- package/lib/AWS/CloudWatch/GetMetricWidgetImage.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListAlarmMuteRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListDashboards.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListDashboards.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListManagedInsightRules.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListMetricStreams.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListMetricStreams.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListMetrics.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListMetrics.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/ListTagsForResource.d.ts +1 -1
- package/lib/AWS/CloudWatch/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/PutMetricData.d.ts +1 -1
- package/lib/AWS/CloudWatch/PutMetricData.d.ts.map +1 -1
- package/lib/AWS/CloudWatch/SetAlarmState.d.ts +1 -1
- package/lib/AWS/CloudWatch/SetAlarmState.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts +1 -1
- package/lib/AWS/DynamoDB/BatchExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchGetItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/BatchGetItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/BatchWriteItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/BatchWriteItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DeleteItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/DeleteItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTable.d.ts +1 -1
- package/lib/AWS/DynamoDB/DescribeTable.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts +1 -1
- package/lib/AWS/DynamoDB/DescribeTimeToLive.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteStatement.d.ts +1 -1
- package/lib/AWS/DynamoDB/ExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts +1 -1
- package/lib/AWS/DynamoDB/ExecuteTransaction.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/GetItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/GetItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ListTables.d.ts +1 -1
- package/lib/AWS/DynamoDB/ListTables.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts +1 -1
- package/lib/AWS/DynamoDB/ListTagsOfResource.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/PutItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/PutItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Query.d.ts +1 -1
- package/lib/AWS/DynamoDB/Query.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts +1 -1
- package/lib/AWS/DynamoDB/RestoreTableToPointInTime.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/Scan.d.ts +1 -1
- package/lib/AWS/DynamoDB/Scan.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/TransactGetItems.d.ts +1 -1
- package/lib/AWS/DynamoDB/TransactGetItems.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/TransactWriteItems.d.ts +1 -1
- package/lib/AWS/DynamoDB/TransactWriteItems.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/UpdateItem.d.ts +1 -1
- package/lib/AWS/DynamoDB/UpdateItem.d.ts.map +1 -1
- package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts +1 -1
- package/lib/AWS/DynamoDB/UpdateTimeToLive.d.ts.map +1 -1
- package/lib/AWS/ECS/DescribeTasks.d.ts +1 -1
- package/lib/AWS/ECS/DescribeTasks.d.ts.map +1 -1
- package/lib/AWS/ECS/ListTasks.d.ts +1 -1
- package/lib/AWS/ECS/ListTasks.d.ts.map +1 -1
- package/lib/AWS/ECS/RunTask.d.ts +1 -1
- package/lib/AWS/ECS/RunTask.d.ts.map +1 -1
- package/lib/AWS/ECS/StopTask.d.ts +1 -1
- package/lib/AWS/ECS/StopTask.d.ts.map +1 -1
- package/lib/AWS/EventBridge/DescribeEventBus.d.ts +1 -1
- package/lib/AWS/EventBridge/DescribeEventBus.d.ts.map +1 -1
- package/lib/AWS/EventBridge/DescribeRule.d.ts +1 -1
- package/lib/AWS/EventBridge/DescribeRule.d.ts.map +1 -1
- package/lib/AWS/EventBridge/EventSource.d.ts +2 -2
- package/lib/AWS/EventBridge/ListEventBuses.d.ts +1 -1
- package/lib/AWS/EventBridge/ListEventBuses.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ListRules.d.ts +1 -1
- package/lib/AWS/EventBridge/ListRules.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ListTargetsByRule.d.ts +1 -1
- package/lib/AWS/EventBridge/ListTargetsByRule.d.ts.map +1 -1
- package/lib/AWS/EventBridge/PutEvents.d.ts +1 -1
- package/lib/AWS/EventBridge/PutEvents.d.ts.map +1 -1
- package/lib/AWS/EventBridge/TestEventPattern.d.ts +1 -1
- package/lib/AWS/EventBridge/TestEventPattern.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ToLambda.d.ts +1 -1
- package/lib/AWS/EventBridge/ToLambda.d.ts.map +1 -1
- package/lib/AWS/EventBridge/ToQueue.d.ts +1 -1
- package/lib/AWS/EventBridge/ToQueue.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts +1 -1
- package/lib/AWS/Kinesis/DescribeAccountSettings.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeLimits.d.ts +1 -1
- package/lib/AWS/Kinesis/DescribeLimits.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStream.d.ts +1 -1
- package/lib/AWS/Kinesis/DescribeStream.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts +1 -1
- package/lib/AWS/Kinesis/DescribeStreamConsumer.d.ts.map +1 -1
- package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts +1 -1
- package/lib/AWS/Kinesis/DescribeStreamSummary.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetRecords.d.ts +1 -1
- package/lib/AWS/Kinesis/GetRecords.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetResourcePolicy.d.ts +1 -1
- package/lib/AWS/Kinesis/GetResourcePolicy.d.ts.map +1 -1
- package/lib/AWS/Kinesis/GetShardIterator.d.ts +1 -1
- package/lib/AWS/Kinesis/GetShardIterator.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListShards.d.ts +1 -1
- package/lib/AWS/Kinesis/ListShards.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListStreamConsumers.d.ts +1 -1
- package/lib/AWS/Kinesis/ListStreamConsumers.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListStreams.d.ts +1 -1
- package/lib/AWS/Kinesis/ListStreams.d.ts.map +1 -1
- package/lib/AWS/Kinesis/ListTagsForResource.d.ts +1 -1
- package/lib/AWS/Kinesis/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/Kinesis/PutRecord.d.ts +1 -1
- package/lib/AWS/Kinesis/PutRecord.d.ts.map +1 -1
- package/lib/AWS/Kinesis/PutRecords.d.ts +1 -1
- package/lib/AWS/Kinesis/PutRecords.d.ts.map +1 -1
- package/lib/AWS/Kinesis/StreamSink.d.ts +1 -1
- package/lib/AWS/Kinesis/StreamSink.d.ts.map +1 -1
- package/lib/AWS/Kinesis/SubscribeToShard.d.ts +1 -1
- package/lib/AWS/Kinesis/SubscribeToShard.d.ts.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/InvokeFunction.d.ts +1 -1
- package/lib/AWS/Lambda/InvokeFunction.d.ts.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +2 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/RDS/Connect.d.ts +1 -1
- package/lib/AWS/RDS/Connect.d.ts.map +1 -1
- package/lib/AWS/RDSData/BatchExecuteStatement.d.ts +1 -1
- package/lib/AWS/RDSData/BatchExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/RDSData/BeginTransaction.d.ts +1 -1
- package/lib/AWS/RDSData/BeginTransaction.d.ts.map +1 -1
- package/lib/AWS/RDSData/CommitTransaction.d.ts +1 -1
- package/lib/AWS/RDSData/CommitTransaction.d.ts.map +1 -1
- package/lib/AWS/RDSData/ExecuteSql.d.ts +1 -1
- package/lib/AWS/RDSData/ExecuteSql.d.ts.map +1 -1
- package/lib/AWS/RDSData/ExecuteStatement.d.ts +1 -1
- package/lib/AWS/RDSData/ExecuteStatement.d.ts.map +1 -1
- package/lib/AWS/RDSData/RollbackTransaction.d.ts +1 -1
- package/lib/AWS/RDSData/RollbackTransaction.d.ts.map +1 -1
- package/lib/AWS/S3/AbortMultipartUpload.d.ts +1 -1
- package/lib/AWS/S3/AbortMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/CompleteMultipartUpload.d.ts +1 -1
- package/lib/AWS/S3/CompleteMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/CopyObject.d.ts +1 -1
- package/lib/AWS/S3/CopyObject.d.ts.map +1 -1
- package/lib/AWS/S3/CreateMultipartUpload.d.ts +1 -1
- package/lib/AWS/S3/CreateMultipartUpload.d.ts.map +1 -1
- package/lib/AWS/S3/DeleteObject.d.ts +1 -1
- package/lib/AWS/S3/DeleteObject.d.ts.map +1 -1
- package/lib/AWS/S3/GetObject.d.ts +1 -1
- package/lib/AWS/S3/GetObject.d.ts.map +1 -1
- package/lib/AWS/S3/HeadObject.d.ts +1 -1
- package/lib/AWS/S3/HeadObject.d.ts.map +1 -1
- package/lib/AWS/S3/ListObjectsV2.d.ts +1 -1
- package/lib/AWS/S3/ListObjectsV2.d.ts.map +1 -1
- package/lib/AWS/S3/PutObject.d.ts +1 -1
- package/lib/AWS/S3/PutObject.d.ts.map +1 -1
- package/lib/AWS/S3/UploadPart.d.ts +1 -1
- package/lib/AWS/S3/UploadPart.d.ts.map +1 -1
- package/lib/AWS/SNS/AddPermission.d.ts +1 -1
- package/lib/AWS/SNS/AddPermission.d.ts.map +1 -1
- package/lib/AWS/SNS/ConfirmSubscription.d.ts +1 -1
- package/lib/AWS/SNS/ConfirmSubscription.d.ts.map +1 -1
- package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts +1 -1
- package/lib/AWS/SNS/GetDataProtectionPolicy.d.ts.map +1 -1
- package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts +1 -1
- package/lib/AWS/SNS/GetSubscriptionAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/GetTopicAttributes.d.ts +1 -1
- package/lib/AWS/SNS/GetTopicAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/ListSubscriptions.d.ts +1 -1
- package/lib/AWS/SNS/ListSubscriptions.d.ts.map +1 -1
- package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts +1 -1
- package/lib/AWS/SNS/ListSubscriptionsByTopic.d.ts.map +1 -1
- package/lib/AWS/SNS/ListTagsForResource.d.ts +1 -1
- package/lib/AWS/SNS/ListTagsForResource.d.ts.map +1 -1
- package/lib/AWS/SNS/ListTopics.d.ts +1 -1
- package/lib/AWS/SNS/ListTopics.d.ts.map +1 -1
- package/lib/AWS/SNS/Publish.d.ts +1 -1
- package/lib/AWS/SNS/Publish.d.ts.map +1 -1
- package/lib/AWS/SNS/PublishBatch.d.ts +1 -1
- package/lib/AWS/SNS/PublishBatch.d.ts.map +1 -1
- package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts +1 -1
- package/lib/AWS/SNS/PutDataProtectionPolicy.d.ts.map +1 -1
- package/lib/AWS/SNS/RemovePermission.d.ts +1 -1
- package/lib/AWS/SNS/RemovePermission.d.ts.map +1 -1
- package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts +1 -1
- package/lib/AWS/SNS/SetSubscriptionAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/SetTopicAttributes.d.ts +1 -1
- package/lib/AWS/SNS/SetTopicAttributes.d.ts.map +1 -1
- package/lib/AWS/SNS/TagResource.d.ts +1 -1
- package/lib/AWS/SNS/TagResource.d.ts.map +1 -1
- package/lib/AWS/SNS/TopicSink.d.ts +1 -1
- package/lib/AWS/SNS/TopicSink.d.ts.map +1 -1
- package/lib/AWS/SNS/UntagResource.d.ts +1 -1
- package/lib/AWS/SNS/UntagResource.d.ts.map +1 -1
- package/lib/AWS/SQS/DeleteMessage.d.ts +1 -1
- package/lib/AWS/SQS/DeleteMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/DeleteMessageBatch.d.ts +1 -1
- package/lib/AWS/SQS/DeleteMessageBatch.d.ts.map +1 -1
- package/lib/AWS/SQS/QueueSink.d.ts +1 -1
- package/lib/AWS/SQS/QueueSink.d.ts.map +1 -1
- package/lib/AWS/SQS/ReceiveMessage.d.ts +1 -1
- package/lib/AWS/SQS/ReceiveMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/SendMessage.d.ts +1 -1
- package/lib/AWS/SQS/SendMessage.d.ts.map +1 -1
- package/lib/AWS/SQS/SendMessageBatch.d.ts +1 -1
- package/lib/AWS/SQS/SendMessageBatch.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/DescribeSecret.d.ts +1 -1
- package/lib/AWS/SecretsManager/DescribeSecret.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/GetRandomPassword.d.ts +1 -1
- package/lib/AWS/SecretsManager/GetRandomPassword.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/GetSecretValue.d.ts +1 -1
- package/lib/AWS/SecretsManager/GetSecretValue.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/ListSecrets.d.ts +1 -1
- package/lib/AWS/SecretsManager/ListSecrets.d.ts.map +1 -1
- package/lib/AWS/SecretsManager/PutSecretValue.d.ts +1 -1
- package/lib/AWS/SecretsManager/PutSecretValue.d.ts.map +1 -1
- package/lib/Auth/Lock.js +2 -2
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Binding.d.ts +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Bundle/Bundle.d.ts +11 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +19 -12
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts +25 -0
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js +16 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -0
- package/lib/Bundle/Docker.d.ts.map +1 -1
- package/lib/Bundle/Docker.js +12 -13
- package/lib/Bundle/Docker.js.map +1 -1
- package/lib/Bundle/RawPlugin.d.ts +36 -0
- package/lib/Bundle/RawPlugin.d.ts.map +1 -0
- package/lib/Bundle/RawPlugin.js +80 -0
- package/lib/Bundle/RawPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +2 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +2 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +1 -0
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts +3 -2
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +9 -1
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +2 -1
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts +8 -7
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.js +2 -6
- package/lib/Cloudflare/AiGateway/AiGatewayBinding.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 -1
- package/lib/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.js.map +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts +8 -7
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js +2 -2
- package/lib/Cloudflare/Artifacts/ArtifactsBinding.js.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.d.ts +12 -10
- package/lib/Cloudflare/D1/D1Connection.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Connection.js +2 -2
- package/lib/Cloudflare/D1/D1Connection.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.js +1 -1
- package/lib/Cloudflare/D1/D1Database.js.map +1 -1
- package/lib/Cloudflare/D1/D1Migrations.d.ts +2 -2
- package/lib/Cloudflare/D1/D1Migrations.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts +5 -4
- package/lib/Cloudflare/Email/SendEmailBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendEmailBinding.js +2 -1
- package/lib/Cloudflare/Email/SendEmailBinding.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +10 -8
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js +2 -2
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.d.ts +5 -4
- package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Images/ImagesBinding.js +4 -2
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts +33 -32
- package/lib/Cloudflare/KV/KVNamespaceBinding.d.ts.map +1 -1
- package/lib/Cloudflare/KV/KVNamespaceBinding.js +5 -2
- package/lib/Cloudflare/KV/KVNamespaceBinding.js.map +1 -1
- package/lib/Cloudflare/Local.d.ts +2 -0
- package/lib/Cloudflare/Local.d.ts.map +1 -0
- package/lib/Cloudflare/Local.js +9 -0
- package/lib/Cloudflare/Local.js.map +1 -0
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +3 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.d.ts +5 -4
- package/lib/Cloudflare/Queue/QueueBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueBinding.js +2 -2
- package/lib/Cloudflare/Queue/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +1 -2
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.d.ts +13 -12
- package/lib/Cloudflare/R2/R2BucketBinding.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2BucketBinding.js +2 -2
- package/lib/Cloudflare/R2/R2BucketBinding.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +5 -4
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +2 -2
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +1 -2
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +0 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js +6 -3
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
- package/lib/Cloudflare/Workers/DynamicWorkerLoader.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DynamicWorkerLoader.js +3 -3
- package/lib/Cloudflare/Workers/DynamicWorkerLoader.js.map +1 -1
- package/lib/Cloudflare/Workers/Fetch.d.ts +1 -1
- package/lib/Cloudflare/Workers/Fetch.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +22 -3
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +413 -21
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcAsync.d.ts +55 -0
- package/lib/Cloudflare/Workers/RpcAsync.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/RpcAsync.js +55 -0
- package/lib/Cloudflare/Workers/RpcAsync.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +9 -22
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +3 -4
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +3 -5
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -2
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +3 -6
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +2 -0
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.d.ts +4 -4
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +6 -3
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts +184 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js +216 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts +188 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js +4 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js.map +1 -0
- package/lib/Cloudflare/Zaraz/index.d.ts +3 -0
- package/lib/Cloudflare/Zaraz/index.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/index.js +2 -0
- package/lib/Cloudflare/Zaraz/index.js.map +1 -0
- package/lib/Cloudflare/index.d.ts +1 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +1 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts +54 -0
- package/lib/Local/RpcProvider.d.ts.map +1 -0
- package/lib/Local/RpcProvider.js +57 -0
- package/lib/Local/RpcProvider.js.map +1 -0
- package/lib/Local/RpcProviderProxy.d.ts +19 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -0
- package/lib/Local/RpcProviderProxy.js +48 -0
- package/lib/Local/RpcProviderProxy.js.map +1 -0
- package/lib/Local/RpcSerialization.d.ts +34 -0
- package/lib/Local/RpcSerialization.d.ts.map +1 -0
- package/lib/Local/RpcSerialization.js +120 -0
- package/lib/Local/RpcSerialization.js.map +1 -0
- package/lib/Local/RpcServer.d.ts +63 -0
- package/lib/Local/RpcServer.d.ts.map +1 -0
- package/lib/Local/RpcServer.js +72 -0
- package/lib/Local/RpcServer.js.map +1 -0
- package/lib/Local/RpcServerBun.d.ts +3 -0
- package/lib/Local/RpcServerBun.d.ts.map +1 -0
- package/lib/Local/RpcServerBun.js +47 -0
- package/lib/Local/RpcServerBun.js.map +1 -0
- package/lib/Local/RpcServerEnvironment.d.ts +20 -0
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -0
- package/lib/Local/RpcServerEnvironment.js +22 -0
- package/lib/Local/RpcServerEnvironment.js.map +1 -0
- package/lib/Local/RpcServerNode.d.ts +3 -0
- package/lib/Local/RpcServerNode.d.ts.map +1 -0
- package/lib/Local/RpcServerNode.js +43 -0
- package/lib/Local/RpcServerNode.js.map +1 -0
- package/lib/Local/RpcServerSession.d.ts +27 -0
- package/lib/Local/RpcServerSession.d.ts.map +1 -0
- package/lib/Local/RpcServerSession.js +68 -0
- package/lib/Local/RpcServerSession.js.map +1 -0
- package/lib/Local/RpcSpawner.d.ts +21 -0
- package/lib/Local/RpcSpawner.d.ts.map +1 -0
- package/lib/Local/RpcSpawner.js +132 -0
- package/lib/Local/RpcSpawner.js.map +1 -0
- package/lib/Neon/Branch.js +1 -1
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Neon/Migrations.d.ts +1 -1
- package/lib/Neon/Migrations.d.ts.map +1 -1
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +1 -15
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Phase.d.ts +2 -2
- package/lib/Phase.d.ts.map +1 -1
- package/lib/Phase.js +2 -1
- package/lib/Phase.js.map +1 -1
- package/lib/Planetscale/AuthProvider.d.ts +59 -0
- package/lib/Planetscale/AuthProvider.d.ts.map +1 -0
- package/lib/Planetscale/AuthProvider.js +131 -0
- package/lib/Planetscale/AuthProvider.js.map +1 -0
- package/lib/Planetscale/Branch.d.ts +113 -0
- package/lib/Planetscale/Branch.d.ts.map +1 -0
- package/lib/Planetscale/Branch.js +287 -0
- package/lib/Planetscale/Branch.js.map +1 -0
- package/lib/Planetscale/Credentials.d.ts +35 -0
- package/lib/Planetscale/Credentials.d.ts.map +1 -0
- package/lib/Planetscale/Credentials.js +56 -0
- package/lib/Planetscale/Credentials.js.map +1 -0
- package/lib/Planetscale/Database.d.ts +117 -0
- package/lib/Planetscale/Database.d.ts.map +1 -0
- package/lib/Planetscale/Database.js +1 -0
- package/lib/Planetscale/Database.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLBranch.d.ts +86 -0
- package/lib/Planetscale/MySQL/MySQLBranch.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLBranch.js +14 -0
- package/lib/Planetscale/MySQL/MySQLBranch.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts +23 -0
- package/lib/Planetscale/MySQL/MySQLClusterSize.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLClusterSize.js +44 -0
- package/lib/Planetscale/MySQL/MySQLClusterSize.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLDatabase.d.ts +119 -0
- package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLDatabase.js +237 -0
- package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLMigrations.d.ts +18 -0
- package/lib/Planetscale/MySQL/MySQLMigrations.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLMigrations.js +157 -0
- package/lib/Planetscale/MySQL/MySQLMigrations.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLOrigin.d.ts +15 -0
- package/lib/Planetscale/MySQL/MySQLOrigin.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLOrigin.js +2 -0
- package/lib/Planetscale/MySQL/MySQLOrigin.js.map +1 -0
- package/lib/Planetscale/MySQL/MySQLPassword.d.ts +115 -0
- package/lib/Planetscale/MySQL/MySQLPassword.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/MySQLPassword.js +197 -0
- package/lib/Planetscale/MySQL/MySQLPassword.js.map +1 -0
- package/lib/Planetscale/MySQL/index.d.ts +6 -0
- package/lib/Planetscale/MySQL/index.d.ts.map +1 -0
- package/lib/Planetscale/MySQL/index.js +6 -0
- package/lib/Planetscale/MySQL/index.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresBranch.d.ts +67 -0
- package/lib/Planetscale/Postgres/PostgresBranch.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresBranch.js +14 -0
- package/lib/Planetscale/Postgres/PostgresBranch.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts +44 -0
- package/lib/Planetscale/Postgres/PostgresClusterSize.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresClusterSize.js +72 -0
- package/lib/Planetscale/Postgres/PostgresClusterSize.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresDatabase.d.ts +73 -0
- package/lib/Planetscale/Postgres/PostgresDatabase.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresDatabase.js +241 -0
- package/lib/Planetscale/Postgres/PostgresDatabase.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts +85 -0
- package/lib/Planetscale/Postgres/PostgresDefaultRole.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresDefaultRole.js +142 -0
- package/lib/Planetscale/Postgres/PostgresDefaultRole.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresMigrations.d.ts +18 -0
- package/lib/Planetscale/Postgres/PostgresMigrations.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresMigrations.js +148 -0
- package/lib/Planetscale/Postgres/PostgresMigrations.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresOrigin.d.ts +15 -0
- package/lib/Planetscale/Postgres/PostgresOrigin.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresOrigin.js +2 -0
- package/lib/Planetscale/Postgres/PostgresOrigin.js.map +1 -0
- package/lib/Planetscale/Postgres/PostgresRole.d.ts +121 -0
- package/lib/Planetscale/Postgres/PostgresRole.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/PostgresRole.js +228 -0
- package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -0
- package/lib/Planetscale/Postgres/index.d.ts +7 -0
- package/lib/Planetscale/Postgres/index.d.ts.map +1 -0
- package/lib/Planetscale/Postgres/index.js +7 -0
- package/lib/Planetscale/Postgres/index.js.map +1 -0
- package/lib/Planetscale/Providers.d.ts +25 -0
- package/lib/Planetscale/Providers.d.ts.map +1 -0
- package/lib/Planetscale/Providers.js +40 -0
- package/lib/Planetscale/Providers.js.map +1 -0
- package/lib/Planetscale/Util.d.ts +182 -0
- package/lib/Planetscale/Util.d.ts.map +1 -0
- package/lib/Planetscale/Util.js +98 -0
- package/lib/Planetscale/Util.js.map +1 -0
- package/lib/Planetscale/index.d.ts +9 -0
- package/lib/Planetscale/index.d.ts.map +1 -0
- package/lib/Planetscale/index.js +9 -0
- package/lib/Planetscale/index.js.map +1 -0
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +7 -2
- package/lib/Platform.js.map +1 -1
- package/lib/RuntimeContext.d.ts +7 -3
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +3 -2
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Server/S3BucketEventSource.d.ts +1 -1
- package/lib/Server/S3BucketEventSource.d.ts.map +1 -1
- package/lib/{Neon → Sql}/SqlFile.d.ts +2 -0
- package/lib/Sql/SqlFile.d.ts.map +1 -0
- package/lib/{Neon → Sql}/SqlFile.js +14 -0
- package/lib/Sql/SqlFile.js.map +1 -0
- package/lib/Sql/index.d.ts +2 -0
- package/lib/Sql/index.d.ts.map +1 -0
- package/lib/Sql/index.js +2 -0
- package/lib/Sql/index.js.map +1 -0
- package/lib/Util/PlatformServices.d.ts +7 -0
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +22 -11
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/camel.d.ts.map +1 -1
- package/lib/Util/camel.js +2 -3
- package/lib/Util/camel.js.map +1 -1
- package/lib/Util/data.d.ts +5 -0
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +29 -0
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/stable.d.ts.map +1 -1
- package/lib/Util/stable.js +3 -6
- package/lib/Util/stable.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +25 -13
- package/src/Auth/Lock.ts +2 -2
- package/src/Binding.ts +1 -1
- package/src/Bundle/Bundle.ts +35 -13
- package/src/Bundle/BundleAnalyzerPlugin.ts +33 -0
- package/src/Bundle/Docker.ts +12 -15
- package/src/Bundle/RawPlugin.ts +82 -0
- package/src/Bundle/index.ts +2 -0
- package/src/Cli/commands/deploy.ts +1 -0
- package/src/Cli/commands/dev.ts +51 -37
- package/src/Cli/exec.ts +12 -7
- package/src/Cloudflare/AiGateway/AiGatewayBinding.ts +11 -16
- package/src/Cloudflare/AnalyticsEngine/AnalyticsEngineDatasetBinding.ts +7 -9
- package/src/Cloudflare/Artifacts/ArtifactsBinding.ts +11 -22
- package/src/Cloudflare/D1/D1Connection.ts +31 -18
- package/src/Cloudflare/D1/D1Database.ts +1 -1
- package/src/Cloudflare/D1/D1Migrations.ts +2 -2
- package/src/Cloudflare/Email/SendEmailBinding.ts +7 -5
- package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +16 -12
- package/src/Cloudflare/Images/ImagesBinding.ts +8 -8
- package/src/Cloudflare/KV/KVNamespaceBinding.ts +38 -38
- package/src/Cloudflare/Local.ts +23 -0
- package/src/Cloudflare/Providers.ts +3 -0
- package/src/Cloudflare/Queue/QueueBinding.ts +7 -6
- package/src/Cloudflare/R2/R2BucketBinding.ts +16 -19
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +11 -13
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +0 -1
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +6 -6
- package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +4 -5
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +547 -21
- package/src/Cloudflare/Workers/RpcAsync.ts +55 -0
- package/src/Cloudflare/Workers/Worker.ts +18 -25
- package/src/Cloudflare/Workers/WorkerBridge.ts +3 -5
- package/src/Cloudflare/Workers/WorkerBundle.ts +4 -8
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +2 -0
- package/src/Cloudflare/Workers/Workflow.ts +10 -11
- package/src/Cloudflare/Zaraz/ZarazConfig.ts +403 -0
- package/src/Cloudflare/Zaraz/ZarazEventTypes.ts +257 -0
- package/src/Cloudflare/Zaraz/index.ts +25 -0
- package/src/Cloudflare/index.ts +1 -0
- package/src/Local/RpcProvider.ts +102 -0
- package/src/Local/RpcProviderProxy.ts +86 -0
- package/src/Local/RpcSerialization.ts +225 -0
- package/src/Local/RpcServer.ts +138 -0
- package/src/Local/RpcServerBun.ts +59 -0
- package/src/Local/RpcServerEnvironment.ts +55 -0
- package/src/Local/RpcServerNode.ts +58 -0
- package/src/Local/RpcServerSession.ts +87 -0
- package/src/Local/RpcSpawner.ts +196 -0
- package/src/Neon/Branch.ts +1 -1
- package/src/Neon/Migrations.ts +1 -1
- package/src/Neon/Project.ts +6 -20
- package/src/Phase.ts +2 -0
- package/src/Planetscale/AuthProvider.ts +285 -0
- package/src/Planetscale/Branch.ts +508 -0
- package/src/Planetscale/Credentials.ts +96 -0
- package/src/Planetscale/Database.ts +129 -0
- package/src/Planetscale/MySQL/MySQLBranch.ts +112 -0
- package/src/Planetscale/MySQL/MySQLClusterSize.ts +102 -0
- package/src/Planetscale/MySQL/MySQLDatabase.ts +446 -0
- package/src/Planetscale/MySQL/MySQLMigrations.ts +271 -0
- package/src/Planetscale/MySQL/MySQLOrigin.ts +15 -0
- package/src/Planetscale/MySQL/MySQLPassword.ts +387 -0
- package/src/Planetscale/MySQL/index.ts +5 -0
- package/src/Planetscale/Postgres/PostgresBranch.ts +97 -0
- package/src/Planetscale/Postgres/PostgresClusterSize.ts +125 -0
- package/src/Planetscale/Postgres/PostgresDatabase.ts +404 -0
- package/src/Planetscale/Postgres/PostgresDefaultRole.ts +270 -0
- package/src/Planetscale/Postgres/PostgresMigrations.ts +256 -0
- package/src/Planetscale/Postgres/PostgresOrigin.ts +15 -0
- package/src/Planetscale/Postgres/PostgresRole.ts +469 -0
- package/src/Planetscale/Postgres/index.ts +6 -0
- package/src/Planetscale/Providers.ts +80 -0
- package/src/Planetscale/Util.ts +160 -0
- package/src/Planetscale/index.ts +18 -0
- package/src/Platform.ts +13 -1
- package/src/RuntimeContext.ts +7 -8
- package/src/{Neon → Sql}/SqlFile.ts +22 -0
- package/src/Sql/index.ts +1 -0
- package/src/Util/PlatformServices.ts +41 -27
- package/src/Util/camel.ts +3 -5
- package/src/Util/data.ts +38 -0
- package/src/Util/stable.ts +4 -10
- package/lib/Cloudflare/D1/D1SqlFile.d.ts +0 -20
- package/lib/Cloudflare/D1/D1SqlFile.d.ts.map +0 -1
- package/lib/Cloudflare/D1/D1SqlFile.js +0 -46
- package/lib/Cloudflare/D1/D1SqlFile.js.map +0 -1
- package/lib/Cloudflare/Local/Sidecar.d.ts +0 -63
- package/lib/Cloudflare/Local/Sidecar.d.ts.map +0 -1
- package/lib/Cloudflare/Local/Sidecar.js +0 -50
- package/lib/Cloudflare/Local/Sidecar.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +0 -8
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +0 -381
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.d.ts +0 -2
- package/lib/Cloudflare/Local/SidecarServer.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.js +0 -34
- package/lib/Cloudflare/Local/SidecarServer.js.map +0 -1
- package/lib/Neon/SqlFile.d.ts.map +0 -1
- package/lib/Neon/SqlFile.js.map +0 -1
- package/lib/Sidecar/Lock.d.ts +0 -23
- package/lib/Sidecar/Lock.d.ts.map +0 -1
- package/lib/Sidecar/Lock.js +0 -39
- package/lib/Sidecar/Lock.js.map +0 -1
- package/lib/Sidecar/RpcClient.d.ts +0 -15
- package/lib/Sidecar/RpcClient.d.ts.map +0 -1
- package/lib/Sidecar/RpcClient.js +0 -78
- package/lib/Sidecar/RpcClient.js.map +0 -1
- package/lib/Sidecar/RpcHandler.d.ts +0 -51
- package/lib/Sidecar/RpcHandler.d.ts.map +0 -1
- package/lib/Sidecar/RpcHandler.js +0 -87
- package/lib/Sidecar/RpcHandler.js.map +0 -1
- package/lib/Sidecar/RpcPaths.d.ts +0 -19
- package/lib/Sidecar/RpcPaths.d.ts.map +0 -1
- package/lib/Sidecar/RpcPaths.js +0 -31
- package/lib/Sidecar/RpcPaths.js.map +0 -1
- package/lib/Sidecar/RpcServer.d.ts +0 -30
- package/lib/Sidecar/RpcServer.d.ts.map +0 -1
- package/lib/Sidecar/RpcServer.js +0 -105
- package/lib/Sidecar/RpcServer.js.map +0 -1
- package/lib/Sidecar/RpcServerBun.d.ts +0 -4
- package/lib/Sidecar/RpcServerBun.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerBun.js +0 -28
- package/lib/Sidecar/RpcServerBun.js.map +0 -1
- package/lib/Sidecar/RpcServerNode.d.ts +0 -4
- package/lib/Sidecar/RpcServerNode.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerNode.js +0 -39
- package/lib/Sidecar/RpcServerNode.js.map +0 -1
- package/lib/Sidecar/RpcServices.d.ts +0 -6
- package/lib/Sidecar/RpcServices.d.ts.map +0 -1
- package/lib/Sidecar/RpcServices.js +0 -29
- package/lib/Sidecar/RpcServices.js.map +0 -1
- package/src/Cloudflare/D1/D1SqlFile.ts +0 -55
- package/src/Cloudflare/Local/Sidecar.ts +0 -81
- package/src/Cloudflare/Local/SidecarHandlers.ts +0 -491
- package/src/Cloudflare/Local/SidecarServer.ts +0 -70
- package/src/Sidecar/Lock.ts +0 -66
- package/src/Sidecar/RpcClient.ts +0 -142
- package/src/Sidecar/RpcHandler.ts +0 -205
- package/src/Sidecar/RpcPaths.ts +0 -39
- package/src/Sidecar/RpcServer.ts +0 -153
- package/src/Sidecar/RpcServerBun.ts +0 -41
- package/src/Sidecar/RpcServerNode.ts +0 -51
- package/src/Sidecar/RpcServices.ts +0 -48
|
@@ -1,37 +1,563 @@
|
|
|
1
|
+
import {
|
|
2
|
+
layerLocalProxy,
|
|
3
|
+
layerRuntime,
|
|
4
|
+
Runtime,
|
|
5
|
+
RuntimeError,
|
|
6
|
+
type BindingHook,
|
|
7
|
+
type BindingServices,
|
|
8
|
+
type HyperdriveOrigin,
|
|
9
|
+
type Module,
|
|
10
|
+
type Assets as RuntimeAssets,
|
|
11
|
+
type DurableObjectNamespace as RuntimeDurableObjectNamespace,
|
|
12
|
+
type RuntimeServices,
|
|
13
|
+
} from "@distilled.cloud/cloudflare-runtime";
|
|
14
|
+
import {
|
|
15
|
+
Ai,
|
|
16
|
+
Artifacts,
|
|
17
|
+
Assets,
|
|
18
|
+
Browser,
|
|
19
|
+
D1,
|
|
20
|
+
Data,
|
|
21
|
+
DurableObjectNamespace,
|
|
22
|
+
Hyperdrive,
|
|
23
|
+
Images,
|
|
24
|
+
Json,
|
|
25
|
+
KvNamespace,
|
|
26
|
+
R2Bucket,
|
|
27
|
+
Service,
|
|
28
|
+
Text,
|
|
29
|
+
VersionMetadata,
|
|
30
|
+
WasmModule,
|
|
31
|
+
WorkerLoader,
|
|
32
|
+
} from "@distilled.cloud/cloudflare-runtime/bindings";
|
|
33
|
+
import * as LocalProxy from "@distilled.cloud/cloudflare-runtime/proxy/LocalProxy";
|
|
34
|
+
import * as Cause from "effect/Cause";
|
|
1
35
|
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as
|
|
36
|
+
import * as Exit from "effect/Exit";
|
|
37
|
+
import * as Fiber from "effect/Fiber";
|
|
38
|
+
import * as Hash from "effect/Hash";
|
|
39
|
+
import * as Layer from "effect/Layer";
|
|
40
|
+
import * as Path from "effect/Path";
|
|
41
|
+
import * as Redacted from "effect/Redacted";
|
|
42
|
+
import * as Result from "effect/Result";
|
|
43
|
+
import * as Schema from "effect/Schema";
|
|
44
|
+
import * as Scope from "effect/Scope";
|
|
45
|
+
import * as Stream from "effect/Stream";
|
|
46
|
+
import { AlchemyContext } from "../../AlchemyContext.ts";
|
|
47
|
+
import type * as Bundle from "../../Bundle/Bundle.ts";
|
|
48
|
+
import { InstanceId } from "../../InstanceId.ts";
|
|
49
|
+
import * as RpcProvider from "../../Local/RpcProvider.ts";
|
|
50
|
+
import type { ResourceBinding } from "../../Resource.ts";
|
|
3
51
|
import { Stack } from "../../Stack.ts";
|
|
4
|
-
import {
|
|
52
|
+
import { Stage } from "../../Stage.ts";
|
|
53
|
+
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
54
|
+
import type { WorkerAssetsConfig, WorkerProps } from "../Workers/Worker.ts";
|
|
55
|
+
import { getCompatibility } from "./Compatibility.ts";
|
|
56
|
+
import * as Vite from "./Vite.ts";
|
|
5
57
|
import { Worker } from "./Worker.ts";
|
|
58
|
+
import { getCronBindings } from "./WorkerAsyncBindings.ts";
|
|
59
|
+
import type { WorkerBinding } from "./WorkerBinding.ts";
|
|
60
|
+
import { WorkerBundle, type WorkerBundleOptions } from "./WorkerBundle.ts";
|
|
61
|
+
import { createWorkerName } from "./WorkerName.ts";
|
|
62
|
+
|
|
63
|
+
export class WorkerValidationError extends Schema.TaggedErrorClass<WorkerValidationError>()(
|
|
64
|
+
"WorkerValidationError",
|
|
65
|
+
{
|
|
66
|
+
message: Schema.String,
|
|
67
|
+
hint: Schema.optional(Schema.String),
|
|
68
|
+
value: Schema.Unknown,
|
|
69
|
+
},
|
|
70
|
+
) {}
|
|
71
|
+
|
|
72
|
+
export const localRuntimeServices = (options: { port?: number } = {}) =>
|
|
73
|
+
RpcProvider.providerServicesEffect(
|
|
74
|
+
Effect.gen(function* () {
|
|
75
|
+
const { accountId } = yield* CloudflareEnvironment;
|
|
76
|
+
const { dotAlchemy } = yield* AlchemyContext;
|
|
77
|
+
const path = yield* Path.Path;
|
|
78
|
+
return Layer.merge(
|
|
79
|
+
layerRuntime({
|
|
80
|
+
api: {
|
|
81
|
+
accountId,
|
|
82
|
+
},
|
|
83
|
+
storage: {
|
|
84
|
+
directory: path.join(dotAlchemy, "local"),
|
|
85
|
+
},
|
|
86
|
+
}),
|
|
87
|
+
layerLocalProxy(options.port ?? 0),
|
|
88
|
+
);
|
|
89
|
+
}),
|
|
90
|
+
);
|
|
6
91
|
|
|
7
92
|
export const LocalWorkerProvider = () =>
|
|
8
|
-
|
|
93
|
+
RpcProvider.effect(
|
|
9
94
|
Worker,
|
|
95
|
+
import.meta.resolve(
|
|
96
|
+
// `import.meta.resolve(<string>)` is a runtime API — TypeScript's
|
|
97
|
+
// `rewriteRelativeImportExtensions` does NOT touch the string literal, so
|
|
98
|
+
// we have to pick the right extension ourselves. `import.meta.url` reflects
|
|
99
|
+
// the actual on-disk extension of *this* file (`.ts` when loaded from
|
|
100
|
+
// `src/` under Bun or vitest, `.js` when loaded from the compiled `lib/`
|
|
101
|
+
// under Node), which is exactly the signal we need.
|
|
102
|
+
import.meta.url.endsWith(".ts") ? "../Local.ts" : "../Local.js",
|
|
103
|
+
import.meta.url,
|
|
104
|
+
),
|
|
10
105
|
Effect.gen(function* () {
|
|
106
|
+
const { accountId } = yield* CloudflareEnvironment;
|
|
107
|
+
const bundler = yield* WorkerBundle;
|
|
108
|
+
const runtime = yield* Runtime;
|
|
11
109
|
const stack = yield* Stack;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
110
|
+
const path = yield* Path.Path;
|
|
111
|
+
const localProxy = yield* LocalProxy.LocalProxy;
|
|
112
|
+
|
|
113
|
+
const toRuntimeModules = Effect.fn(function* (
|
|
114
|
+
bundle: Bundle.BundleOutput,
|
|
115
|
+
) {
|
|
116
|
+
const modules: Module[] = [];
|
|
117
|
+
for (const file of bundle.files) {
|
|
118
|
+
const ext = path.extname(file.path);
|
|
119
|
+
const type = moduleTypeFromExtension(ext);
|
|
120
|
+
if (type === "SourceMap") continue;
|
|
121
|
+
if (type === "Data" || type === "Wasm") {
|
|
122
|
+
if (!(file.content instanceof Uint8Array)) {
|
|
123
|
+
return yield* new WorkerValidationError({
|
|
124
|
+
message: `Expected Uint8Array for ${file.path} (${type})`,
|
|
125
|
+
value: file.content,
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
modules.push({
|
|
129
|
+
name: file.path,
|
|
130
|
+
type,
|
|
131
|
+
content: file.content,
|
|
132
|
+
});
|
|
133
|
+
} else {
|
|
134
|
+
if (typeof file.content !== "string") {
|
|
135
|
+
return yield* new WorkerValidationError({
|
|
136
|
+
message: `Expected string for ${file.path} (${type})`,
|
|
137
|
+
value: file.content,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
modules.push({
|
|
141
|
+
name: file.path,
|
|
142
|
+
type,
|
|
143
|
+
content: file.content,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return modules;
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
const serveScoped = Effect.fnUntraced(function* (
|
|
151
|
+
worker: WorkerConfig,
|
|
152
|
+
bundle: Bundle.BundleOutput,
|
|
153
|
+
) {
|
|
154
|
+
const scope = yield* Effect.scope.pipe(Effect.flatMap(Scope.fork));
|
|
155
|
+
const address = yield* runtime
|
|
156
|
+
.start({
|
|
157
|
+
name: worker.name,
|
|
158
|
+
compatibilityDate: worker.compatibility.date,
|
|
159
|
+
compatibilityFlags: worker.compatibility.flags,
|
|
160
|
+
bindings: worker.workerBindings as never,
|
|
161
|
+
hyperdrives: worker.hyperdrives,
|
|
162
|
+
durableObjectNamespaces: toRuntimeDurableObjectNamespaces(
|
|
163
|
+
worker.durableObjectNamespaces,
|
|
164
|
+
),
|
|
165
|
+
modules: yield* toRuntimeModules(bundle),
|
|
166
|
+
assets: toRuntimeAssets(worker.assets),
|
|
167
|
+
})
|
|
168
|
+
.pipe(Scope.provide(scope));
|
|
169
|
+
const previous = workerdScopes.get(worker.id);
|
|
170
|
+
if (previous) {
|
|
171
|
+
yield* Effect.forkDetach(Scope.close(previous, Exit.void));
|
|
172
|
+
}
|
|
173
|
+
workerdScopes.set(worker.id, scope);
|
|
174
|
+
yield* localProxy.setLocalAddress(worker.id, address);
|
|
175
|
+
return address;
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const buildConfig = Effect.fn(function* ({
|
|
179
|
+
id,
|
|
180
|
+
props,
|
|
181
|
+
bindings,
|
|
182
|
+
instanceId,
|
|
183
|
+
}: {
|
|
184
|
+
id: string;
|
|
185
|
+
props: WorkerProps;
|
|
186
|
+
bindings: ResourceBinding<Worker["Binding"]>[];
|
|
187
|
+
instanceId: string;
|
|
188
|
+
}) {
|
|
189
|
+
const name = yield* createWorkerName(id, props.name).pipe(
|
|
190
|
+
Effect.provideService(Stack, stack),
|
|
191
|
+
Effect.provideService(Stage, stack.stage),
|
|
192
|
+
Effect.provideService(InstanceId, instanceId),
|
|
193
|
+
);
|
|
194
|
+
const compatibility = getCompatibility(props);
|
|
195
|
+
const workerBindings: BindingHook<BindingServices>[] = [];
|
|
196
|
+
const durableObjectNamespaces: Record<string, string> = {};
|
|
197
|
+
const hyperdrives: Record<string, Required<HyperdriveOrigin>> = {};
|
|
198
|
+
for (const { data } of bindings) {
|
|
199
|
+
for (const binding of data.bindings ?? []) {
|
|
200
|
+
if (
|
|
201
|
+
binding.type === "durable_object_namespace" &&
|
|
202
|
+
// The `durableObjectNamespaces` property is only used to declare DOs in this worker.
|
|
203
|
+
// Otherwise, it's a cross-worker durable object binding, which cloudflare-runtime handles automatically.
|
|
204
|
+
(!binding.scriptName || binding.scriptName === name)
|
|
205
|
+
) {
|
|
206
|
+
// Reuse the existing namespace id if it was provided, otherwise generate a new one.
|
|
207
|
+
// `workerd` uses this for the object's storage path, so it must be safe to use as a file name.
|
|
208
|
+
durableObjectNamespaces[binding.className] =
|
|
209
|
+
binding.namespaceId ??
|
|
210
|
+
encodeURIComponent(`${id}-${binding.className}`);
|
|
211
|
+
}
|
|
212
|
+
workerBindings.push(yield* toRuntimeBinding(binding));
|
|
213
|
+
}
|
|
214
|
+
if (data.hyperdrives) {
|
|
215
|
+
for (const [id, origin] of Object.entries(data.hyperdrives)) {
|
|
216
|
+
hyperdrives[id] = {
|
|
217
|
+
scheme: origin.scheme,
|
|
218
|
+
host: origin.host,
|
|
219
|
+
port: origin.port,
|
|
220
|
+
user: origin.user,
|
|
221
|
+
database: origin.database,
|
|
222
|
+
password: Redacted.isRedacted(origin.password)
|
|
223
|
+
? Redacted.value(origin.password)
|
|
224
|
+
: origin.password,
|
|
225
|
+
sslmode: origin.sslmode,
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
for (const [key, value] of Object.entries(props.env ?? {})) {
|
|
231
|
+
if (value === undefined) continue;
|
|
232
|
+
if (Redacted.isRedacted(value)) {
|
|
233
|
+
workerBindings.push(Text.binding(key, Redacted.value(value)));
|
|
234
|
+
} else if (typeof value === "string") {
|
|
235
|
+
workerBindings.push(Text.binding(key, value));
|
|
236
|
+
} else {
|
|
237
|
+
workerBindings.push(Json.binding(key, value));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
return {
|
|
241
|
+
id,
|
|
242
|
+
name,
|
|
243
|
+
compatibility,
|
|
244
|
+
workerBindings,
|
|
245
|
+
durableObjectNamespaces,
|
|
246
|
+
hyperdrives,
|
|
247
|
+
bundleOptions: {
|
|
16
248
|
id,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
249
|
+
main: props.main,
|
|
250
|
+
compatibility,
|
|
251
|
+
entry: props.isExternal
|
|
252
|
+
? { kind: "external" }
|
|
253
|
+
: { kind: "effect", exports: (props.exports ?? {}) as any },
|
|
254
|
+
stack: { name: stack.name, stage: stack.stage },
|
|
255
|
+
extraOptions: props.build,
|
|
256
|
+
} satisfies WorkerBundleOptions,
|
|
257
|
+
assets: props.assets,
|
|
258
|
+
};
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
type WorkerConfig = Effect.Success<ReturnType<typeof buildConfig>>;
|
|
262
|
+
|
|
263
|
+
const runServer = Effect.fnUntraced(function* (worker: WorkerConfig) {
|
|
264
|
+
let start = Date.now();
|
|
265
|
+
let status: "start" | "update" = "start";
|
|
266
|
+
yield* bundler.watch(worker.bundleOptions).pipe(
|
|
267
|
+
Stream.tap((event) => {
|
|
268
|
+
if (event._tag === "Start") {
|
|
269
|
+
start = Date.now();
|
|
270
|
+
if (status === "update") {
|
|
271
|
+
return Effect.log(`[${worker.id}] Rebuilding`);
|
|
272
|
+
}
|
|
273
|
+
} else if (event._tag === "Error") {
|
|
274
|
+
return Effect.logError(
|
|
275
|
+
`[${worker.id}] Bundle error`,
|
|
276
|
+
event.error,
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
return Effect.void;
|
|
21
280
|
}),
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
281
|
+
Stream.filterMap((event) =>
|
|
282
|
+
event._tag === "Success"
|
|
283
|
+
? Result.succeed(event.output)
|
|
284
|
+
: Result.failVoid,
|
|
285
|
+
),
|
|
286
|
+
Stream.mapEffect((bundle) =>
|
|
287
|
+
serveScoped(worker, bundle).pipe(
|
|
288
|
+
Effect.exit,
|
|
289
|
+
Effect.tap((exit) => {
|
|
290
|
+
if (exit._tag === "Success") {
|
|
291
|
+
const message = Effect.log(
|
|
292
|
+
`[${worker.id}] ${status === "update" ? "Updated" : "Started"} in ${Math.round(Date.now() - start)}ms`,
|
|
293
|
+
);
|
|
294
|
+
status = "update";
|
|
295
|
+
return message;
|
|
296
|
+
} else {
|
|
297
|
+
return Effect.logError(
|
|
298
|
+
`[${worker.id}] Error`,
|
|
299
|
+
Cause.squash(exit.cause),
|
|
300
|
+
);
|
|
301
|
+
}
|
|
302
|
+
}),
|
|
303
|
+
),
|
|
304
|
+
),
|
|
305
|
+
Stream.runDrain,
|
|
306
|
+
Effect.forkScoped,
|
|
307
|
+
);
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
const rootScope = yield* Effect.scope;
|
|
311
|
+
const workerdScopes = new Map<string, Scope.Closeable>();
|
|
312
|
+
|
|
313
|
+
const context = yield* Effect.context<RuntimeServices>();
|
|
314
|
+
const instances = new Map<
|
|
315
|
+
string,
|
|
316
|
+
{
|
|
317
|
+
hash: number;
|
|
318
|
+
fiber: Fiber.Fiber<
|
|
319
|
+
Worker["Attributes"],
|
|
320
|
+
Bundle.BundleError | WorkerValidationError | RuntimeError
|
|
321
|
+
>;
|
|
322
|
+
scope: Scope.Closeable;
|
|
323
|
+
}
|
|
324
|
+
>();
|
|
325
|
+
|
|
326
|
+
const runInstance = Effect.fn(function* (options: {
|
|
327
|
+
id: string;
|
|
328
|
+
props: WorkerProps;
|
|
329
|
+
bindings: ResourceBinding<Worker["Binding"]>[];
|
|
330
|
+
instanceId: string;
|
|
331
|
+
}) {
|
|
332
|
+
const { id, props, bindings } = options;
|
|
333
|
+
const config = yield* buildConfig(options);
|
|
334
|
+
const url = yield* localProxy.registerWorker(id);
|
|
335
|
+
if (props.vite) {
|
|
336
|
+
const devServer = yield* Vite.viteDev(
|
|
337
|
+
props.vite.rootDir,
|
|
338
|
+
props.env ?? {},
|
|
339
|
+
{
|
|
340
|
+
compatibilityDate: config.compatibility.date,
|
|
341
|
+
compatibilityFlags: config.compatibility.flags,
|
|
342
|
+
worker: {
|
|
343
|
+
name: config.name,
|
|
344
|
+
bindings: config.workerBindings,
|
|
345
|
+
durableObjectNamespaces: toRuntimeDurableObjectNamespaces(
|
|
346
|
+
config.durableObjectNamespaces,
|
|
347
|
+
),
|
|
348
|
+
hyperdrives: config.hyperdrives,
|
|
349
|
+
assets: toRuntimeAssets(config.assets),
|
|
350
|
+
},
|
|
351
|
+
context,
|
|
352
|
+
},
|
|
353
|
+
);
|
|
354
|
+
const localAddress = devServer.resolvedUrls!.local[0].slice(0, -1);
|
|
355
|
+
yield* localProxy.setLocalAddress(id, localAddress);
|
|
356
|
+
} else {
|
|
357
|
+
yield* runServer(config);
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
workerId: config.name,
|
|
361
|
+
workerName: config.name,
|
|
362
|
+
logpush: undefined,
|
|
363
|
+
url,
|
|
364
|
+
tags: [],
|
|
365
|
+
durableObjectNamespaces: config.durableObjectNamespaces,
|
|
366
|
+
domains: [],
|
|
367
|
+
crons: Array.from(
|
|
368
|
+
new Set([...getCronBindings(bindings), ...(props.crons ?? [])]),
|
|
369
|
+
),
|
|
370
|
+
accountId,
|
|
371
|
+
} satisfies Worker["Attributes"];
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
return {
|
|
375
|
+
diff: Effect.fn(function* ({ id, news, newBindings, instanceId }) {
|
|
376
|
+
const options = {
|
|
28
377
|
id,
|
|
29
378
|
props: news,
|
|
30
|
-
bindings,
|
|
31
|
-
stack,
|
|
379
|
+
bindings: newBindings,
|
|
32
380
|
instanceId,
|
|
33
|
-
}
|
|
34
|
-
|
|
381
|
+
};
|
|
382
|
+
const hash = Hash.structure(options);
|
|
383
|
+
return {
|
|
384
|
+
action:
|
|
385
|
+
instances.get(options.id)?.hash === hash ? "noop" : "update",
|
|
386
|
+
};
|
|
387
|
+
}),
|
|
388
|
+
reconcile: Effect.fn(function* ({ id, news, bindings, instanceId }) {
|
|
389
|
+
const options = { id, props: news, bindings, instanceId };
|
|
390
|
+
const hash = Hash.structure(options);
|
|
391
|
+
const existing = instances.get(options.id);
|
|
392
|
+
if (existing) {
|
|
393
|
+
if (existing.hash === hash) {
|
|
394
|
+
yield* Effect.log(
|
|
395
|
+
`[${options.id}] No changes, using existing instance`,
|
|
396
|
+
);
|
|
397
|
+
return yield* Fiber.join(existing.fiber);
|
|
398
|
+
}
|
|
399
|
+
yield* Effect.log(
|
|
400
|
+
`[${options.id}] Changes detected, interrupting existing instance`,
|
|
401
|
+
);
|
|
402
|
+
yield* Fiber.interrupt(existing.fiber);
|
|
403
|
+
yield* Scope.close(existing.scope, Exit.void);
|
|
404
|
+
instances.delete(options.id);
|
|
405
|
+
}
|
|
406
|
+
const scope = yield* Scope.fork(rootScope);
|
|
407
|
+
const fiber = yield* runInstance(options).pipe(
|
|
408
|
+
Effect.forkDetach,
|
|
409
|
+
Scope.provide(scope),
|
|
410
|
+
);
|
|
411
|
+
instances.set(options.id, { hash, fiber, scope });
|
|
412
|
+
return yield* Fiber.join(fiber).pipe(
|
|
413
|
+
Effect.onExit((exit) =>
|
|
414
|
+
Effect.sync(() => {
|
|
415
|
+
if (exit._tag === "Failure") {
|
|
416
|
+
instances.delete(options.id);
|
|
417
|
+
}
|
|
418
|
+
}),
|
|
419
|
+
),
|
|
420
|
+
);
|
|
421
|
+
}),
|
|
422
|
+
delete: Effect.fn(function* ({ id }) {
|
|
423
|
+
const existing = instances.get(id);
|
|
424
|
+
if (existing) {
|
|
425
|
+
yield* Fiber.interrupt(existing.fiber);
|
|
426
|
+
yield* Scope.close(existing.scope, Exit.void);
|
|
427
|
+
instances.delete(id);
|
|
428
|
+
}
|
|
429
|
+
}),
|
|
35
430
|
};
|
|
36
431
|
}),
|
|
37
432
|
);
|
|
433
|
+
|
|
434
|
+
const toRuntimeBinding = Effect.fnUntraced(function* (b: WorkerBinding) {
|
|
435
|
+
const unsupported = () =>
|
|
436
|
+
new WorkerValidationError({
|
|
437
|
+
message: `${b.type} bindings are not supported in local mode`,
|
|
438
|
+
value: b,
|
|
439
|
+
});
|
|
440
|
+
switch (b.type) {
|
|
441
|
+
case "ai":
|
|
442
|
+
return Ai.remote(b.name);
|
|
443
|
+
case "analytics_engine":
|
|
444
|
+
return yield* unsupported();
|
|
445
|
+
case "artifacts":
|
|
446
|
+
return Artifacts.binding(b.name, b.namespace);
|
|
447
|
+
case "assets":
|
|
448
|
+
return Assets.binding(b.name);
|
|
449
|
+
case "browser":
|
|
450
|
+
return Browser.binding(b.name);
|
|
451
|
+
case "d1":
|
|
452
|
+
return D1.remote(b.name, b.id);
|
|
453
|
+
case "data_blob":
|
|
454
|
+
return Data.binding(b.name, Buffer.from(b.part));
|
|
455
|
+
case "dispatch_namespace":
|
|
456
|
+
return yield* unsupported();
|
|
457
|
+
case "durable_object_namespace":
|
|
458
|
+
return DurableObjectNamespace.local({
|
|
459
|
+
name: b.name,
|
|
460
|
+
className: b.className!,
|
|
461
|
+
scriptName: b.scriptName,
|
|
462
|
+
});
|
|
463
|
+
case "hyperdrive":
|
|
464
|
+
return Hyperdrive.binding(b.name, b.id);
|
|
465
|
+
case "images":
|
|
466
|
+
return Images.remote(b.name);
|
|
467
|
+
case "inherit":
|
|
468
|
+
return yield* unsupported();
|
|
469
|
+
case "json":
|
|
470
|
+
return Json.binding(b.name, b.json);
|
|
471
|
+
case "kv_namespace":
|
|
472
|
+
return KvNamespace.remote(b.name, b.namespaceId);
|
|
473
|
+
case "mtls_certificate":
|
|
474
|
+
return yield* unsupported();
|
|
475
|
+
case "pipelines":
|
|
476
|
+
return yield* unsupported();
|
|
477
|
+
case "plain_text":
|
|
478
|
+
return Text.binding(b.name, b.text);
|
|
479
|
+
case "queue":
|
|
480
|
+
return yield* unsupported();
|
|
481
|
+
case "r2_bucket":
|
|
482
|
+
return R2Bucket.remote(b.name, b.bucketName, b.jurisdiction);
|
|
483
|
+
case "ratelimit":
|
|
484
|
+
return yield* unsupported();
|
|
485
|
+
case "secret_key":
|
|
486
|
+
return yield* unsupported();
|
|
487
|
+
case "secret_text":
|
|
488
|
+
return Text.binding(b.name, b.text);
|
|
489
|
+
case "secrets_store_secret":
|
|
490
|
+
return yield* unsupported();
|
|
491
|
+
case "send_email":
|
|
492
|
+
return yield* unsupported();
|
|
493
|
+
case "service":
|
|
494
|
+
return Service.local({ name: b.name, scriptName: b.service });
|
|
495
|
+
case "text_blob":
|
|
496
|
+
return Data.binding(b.name, Buffer.from(b.part));
|
|
497
|
+
case "vectorize":
|
|
498
|
+
return yield* unsupported();
|
|
499
|
+
case "version_metadata":
|
|
500
|
+
return VersionMetadata.binding(b.name);
|
|
501
|
+
case "wasm_module":
|
|
502
|
+
return WasmModule.binding(b.name, Buffer.from(b.part));
|
|
503
|
+
case "worker_loader":
|
|
504
|
+
return WorkerLoader.binding(b.name);
|
|
505
|
+
case "workflow":
|
|
506
|
+
return yield* unsupported();
|
|
507
|
+
default:
|
|
508
|
+
return yield* unsupported();
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
const toRuntimeAssets = (
|
|
513
|
+
assets: WorkerAssetsConfig | undefined,
|
|
514
|
+
): RuntimeAssets | undefined => {
|
|
515
|
+
if (!assets) return undefined;
|
|
516
|
+
if (typeof assets === "string") {
|
|
517
|
+
return {
|
|
518
|
+
directory: assets,
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
return {
|
|
522
|
+
directory: "directory" in assets ? assets.directory : assets.path,
|
|
523
|
+
headers: assets.config?.headers,
|
|
524
|
+
redirects: assets.config?.redirects,
|
|
525
|
+
htmlHandling: assets.config?.htmlHandling,
|
|
526
|
+
notFoundHandling: assets.config?.notFoundHandling,
|
|
527
|
+
runWorkerFirst: assets.config?.runWorkerFirst,
|
|
528
|
+
serveDirectly: assets.config?.serveDirectly,
|
|
529
|
+
};
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
const toRuntimeDurableObjectNamespaces = (
|
|
533
|
+
namespaces: Record<string, string>,
|
|
534
|
+
): RuntimeDurableObjectNamespace[] => {
|
|
535
|
+
return Object.entries(namespaces).map(([className, namespaceId]) => ({
|
|
536
|
+
className,
|
|
537
|
+
uniqueKey: namespaceId,
|
|
538
|
+
sql: true,
|
|
539
|
+
}));
|
|
540
|
+
};
|
|
541
|
+
|
|
542
|
+
const moduleTypeFromExtension = (ext: string): Module["type"] | "SourceMap" => {
|
|
543
|
+
switch (ext) {
|
|
544
|
+
case ".wasm":
|
|
545
|
+
return "Wasm";
|
|
546
|
+
case ".txt":
|
|
547
|
+
case ".html":
|
|
548
|
+
case ".sql":
|
|
549
|
+
case ".custom":
|
|
550
|
+
return "Text";
|
|
551
|
+
case ".bin":
|
|
552
|
+
return "Data";
|
|
553
|
+
case ".mjs":
|
|
554
|
+
case ".js":
|
|
555
|
+
return "ESModule";
|
|
556
|
+
case ".cjs":
|
|
557
|
+
return "CommonJsModule";
|
|
558
|
+
case ".map":
|
|
559
|
+
return "SourceMap";
|
|
560
|
+
default:
|
|
561
|
+
return "Text";
|
|
562
|
+
}
|
|
563
|
+
};
|
|
@@ -19,6 +19,61 @@ export type RpcAsync<Shape> = {
|
|
|
19
19
|
: Promise<Shape[K]>;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Wrap a Cloudflare Worker RPC stub in a `Promise<T>`-shaped proxy so callers
|
|
24
|
+
* outside the Effect runtime (TanStack Start route handlers, plain Workers,
|
|
25
|
+
* test code) can `await` RPC methods directly.
|
|
26
|
+
*
|
|
27
|
+
* The proxy:
|
|
28
|
+
* - leaves `fetch` / `connect` / `Symbol.dispose` and other non-string keys
|
|
29
|
+
* passing through to the underlying binding unchanged,
|
|
30
|
+
* - turns each `Effect<T>` / `Stream<T>` method into a `Promise<T>` /
|
|
31
|
+
* `Promise<ReadableStream<Uint8Array>>`,
|
|
32
|
+
* - unwraps the wire envelopes produced by the Effect-side RPC bridge:
|
|
33
|
+
* `RpcErrorEnvelope` is rethrown via {@link decodeRpcThrowable} so
|
|
34
|
+
* `try/catch` sees an `Error` (or a tagged error object), and
|
|
35
|
+
* `RpcStreamEnvelope` is flattened to its `ReadableStream` body.
|
|
36
|
+
*
|
|
37
|
+
* @example Three ways to reach a value from a plain Worker — direct binding, fetch, RPC
|
|
38
|
+
* ```ts
|
|
39
|
+
* import { toRpcAsync } from "alchemy/Cloudflare/Bridge";
|
|
40
|
+
* import type Backend from "./backend.ts";
|
|
41
|
+
*
|
|
42
|
+
* interface Env {
|
|
43
|
+
* BUCKET: R2Bucket;
|
|
44
|
+
* BACKEND: Service<Backend>;
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* export default {
|
|
48
|
+
* async fetch(request: Request, env: Env): Promise<Response> {
|
|
49
|
+
* const url = new URL(request.url);
|
|
50
|
+
* const key = url.searchParams.get("key");
|
|
51
|
+
* const via = url.searchParams.get("via") ?? "binding";
|
|
52
|
+
* if (!key) return new Response("Missing 'key'", { status: 400 });
|
|
53
|
+
*
|
|
54
|
+
* // option 1 — use the async binding directly
|
|
55
|
+
* if (via === "binding") {
|
|
56
|
+
* const object = await env.BUCKET.get(key);
|
|
57
|
+
* if (!object) return new Response("Not found", { status: 404 });
|
|
58
|
+
* return new Response(object.body);
|
|
59
|
+
* }
|
|
60
|
+
*
|
|
61
|
+
* // option 2 — call the Effect worker's fetch handler
|
|
62
|
+
* if (via === "fetch") {
|
|
63
|
+
* return env.BACKEND.fetch(
|
|
64
|
+
* `https://backend/?key=${encodeURIComponent(key)}`,
|
|
65
|
+
* );
|
|
66
|
+
* }
|
|
67
|
+
*
|
|
68
|
+
* // option 3 — call an Effect worker RPC method as a Promise
|
|
69
|
+
* const backend = toRpcAsync<Backend>(env.BACKEND);
|
|
70
|
+
* const value = await backend.hello(key);
|
|
71
|
+
* if (value === null) return new Response("Not found", { status: 404 });
|
|
72
|
+
* return new Response(value);
|
|
73
|
+
* },
|
|
74
|
+
* };
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
22
77
|
export const toRpcAsync = <W>(stub: any): RpcAsync<Rpc.Shape<W>> & Service =>
|
|
23
78
|
new Proxy(stub, {
|
|
24
79
|
get: (target, prop) => {
|