alchemy 2.0.0-beta.41 → 2.0.0-beta.43
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/exec.js +2 -9
- 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/Binding.d.ts +1 -1
- package/lib/Binding.d.ts.map +1 -1
- 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/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/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/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/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/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 +3 -3
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +9 -2
- package/lib/Cloudflare/Workers/Worker.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/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/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +20 -6
- package/src/Binding.ts +1 -1
- package/src/Bundle/Docker.ts +12 -15
- package/src/Cli/commands/deploy.ts +1 -0
- 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/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/DurableObjectNamespace.ts +6 -6
- package/src/Cloudflare/Workers/DynamicWorkerLoader.ts +4 -5
- package/src/Cloudflare/Workers/RpcAsync.ts +55 -0
- package/src/Cloudflare/Workers/Worker.ts +17 -5
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +2 -0
- package/src/Cloudflare/Workers/Workflow.ts +10 -11
- 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/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/Neon/SqlFile.d.ts.map +0 -1
- package/lib/Neon/SqlFile.js.map +0 -1
- package/src/Cloudflare/D1/D1SqlFile.ts +0 -55
|
@@ -4,6 +4,7 @@ import * as Effect from "effect/Effect";
|
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as Binding from "../../Binding.ts";
|
|
6
6
|
import type { ResourceLike } from "../../Resource.ts";
|
|
7
|
+
import type { RuntimeContext } from "../../RuntimeContext.ts";
|
|
7
8
|
import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
|
|
8
9
|
import type { KVNamespace } from "./KVNamespace.ts";
|
|
9
10
|
|
|
@@ -17,46 +18,46 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
17
18
|
get(
|
|
18
19
|
key: Key,
|
|
19
20
|
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
20
|
-
): Effect.Effect<string | null, KVNamespaceError,
|
|
21
|
+
): Effect.Effect<string | null, KVNamespaceError, RuntimeContext>;
|
|
21
22
|
get(
|
|
22
23
|
key: Key,
|
|
23
24
|
type: "text",
|
|
24
|
-
): Effect.Effect<string | null, KVNamespaceError,
|
|
25
|
+
): Effect.Effect<string | null, KVNamespaceError, RuntimeContext>;
|
|
25
26
|
get<ExpectedValue = unknown>(
|
|
26
27
|
key: Key,
|
|
27
28
|
type: "json",
|
|
28
|
-
): Effect.Effect<ExpectedValue | null, KVNamespaceError,
|
|
29
|
+
): Effect.Effect<ExpectedValue | null, KVNamespaceError, RuntimeContext>;
|
|
29
30
|
get(
|
|
30
31
|
key: Key,
|
|
31
32
|
type: "arrayBuffer",
|
|
32
|
-
): Effect.Effect<ArrayBuffer | null, KVNamespaceError,
|
|
33
|
+
): Effect.Effect<ArrayBuffer | null, KVNamespaceError, RuntimeContext>;
|
|
33
34
|
get(
|
|
34
35
|
key: Key,
|
|
35
36
|
type: "stream",
|
|
36
|
-
): Effect.Effect<ReadableStream | null, KVNamespaceError,
|
|
37
|
+
): Effect.Effect<ReadableStream | null, KVNamespaceError, RuntimeContext>;
|
|
37
38
|
get(
|
|
38
39
|
key: Key,
|
|
39
40
|
options?: KVNamespaceGetOptions<"text">,
|
|
40
|
-
): Effect.Effect<string | null, KVNamespaceError,
|
|
41
|
+
): Effect.Effect<string | null, KVNamespaceError, RuntimeContext>;
|
|
41
42
|
get<ExpectedValue = unknown>(
|
|
42
43
|
key: Key,
|
|
43
44
|
options?: KVNamespaceGetOptions<"json">,
|
|
44
|
-
): Effect.Effect<ExpectedValue | null, KVNamespaceError,
|
|
45
|
+
): Effect.Effect<ExpectedValue | null, KVNamespaceError, RuntimeContext>;
|
|
45
46
|
get(
|
|
46
47
|
key: Key,
|
|
47
48
|
options?: KVNamespaceGetOptions<"arrayBuffer">,
|
|
48
|
-
): Effect.Effect<ArrayBuffer | null, KVNamespaceError,
|
|
49
|
+
): Effect.Effect<ArrayBuffer | null, KVNamespaceError, RuntimeContext>;
|
|
49
50
|
get(
|
|
50
51
|
key: Key,
|
|
51
52
|
options?: KVNamespaceGetOptions<"stream">,
|
|
52
|
-
): Effect.Effect<ReadableStream | null, KVNamespaceError,
|
|
53
|
+
): Effect.Effect<ReadableStream | null, KVNamespaceError, RuntimeContext>;
|
|
53
54
|
get(
|
|
54
55
|
key: Array<Key>,
|
|
55
56
|
type: "text",
|
|
56
57
|
): Effect.Effect<
|
|
57
58
|
Map<string, string | null>,
|
|
58
59
|
KVNamespaceError,
|
|
59
|
-
|
|
60
|
+
RuntimeContext
|
|
60
61
|
>;
|
|
61
62
|
get<ExpectedValue = unknown>(
|
|
62
63
|
key: Array<Key>,
|
|
@@ -64,7 +65,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
64
65
|
): Effect.Effect<
|
|
65
66
|
Map<string, ExpectedValue | null>,
|
|
66
67
|
KVNamespaceError,
|
|
67
|
-
|
|
68
|
+
RuntimeContext
|
|
68
69
|
>;
|
|
69
70
|
get(
|
|
70
71
|
key: Array<Key>,
|
|
@@ -72,7 +73,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
72
73
|
): Effect.Effect<
|
|
73
74
|
Map<string, string | null>,
|
|
74
75
|
KVNamespaceError,
|
|
75
|
-
|
|
76
|
+
RuntimeContext
|
|
76
77
|
>;
|
|
77
78
|
get(
|
|
78
79
|
key: Array<Key>,
|
|
@@ -80,7 +81,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
80
81
|
): Effect.Effect<
|
|
81
82
|
Map<string, string | null>,
|
|
82
83
|
KVNamespaceError,
|
|
83
|
-
|
|
84
|
+
RuntimeContext
|
|
84
85
|
>;
|
|
85
86
|
get<ExpectedValue = unknown>(
|
|
86
87
|
key: Array<Key>,
|
|
@@ -88,27 +89,27 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
88
89
|
): Effect.Effect<
|
|
89
90
|
Map<string, ExpectedValue | null>,
|
|
90
91
|
KVNamespaceError,
|
|
91
|
-
|
|
92
|
+
RuntimeContext
|
|
92
93
|
>;
|
|
93
94
|
list<Metadata = unknown>(
|
|
94
95
|
options?: KVNamespaceListOptions,
|
|
95
96
|
): Effect.Effect<
|
|
96
97
|
KVNamespaceListResult<Metadata, Key>,
|
|
97
98
|
KVNamespaceError,
|
|
98
|
-
|
|
99
|
+
RuntimeContext
|
|
99
100
|
>;
|
|
100
101
|
put(
|
|
101
102
|
key: Key,
|
|
102
103
|
value: string | ArrayBuffer | ArrayBufferView | ReadableStream,
|
|
103
104
|
options?: KVNamespacePutOptions,
|
|
104
|
-
): Effect.Effect<void, KVNamespaceError,
|
|
105
|
+
): Effect.Effect<void, KVNamespaceError, RuntimeContext>;
|
|
105
106
|
getWithMetadata<Metadata = unknown>(
|
|
106
107
|
key: Key,
|
|
107
108
|
options?: Partial<KVNamespaceGetOptions<undefined>>,
|
|
108
109
|
): Effect.Effect<
|
|
109
110
|
KVNamespaceGetWithMetadataResult<string, Metadata>,
|
|
110
111
|
KVNamespaceError,
|
|
111
|
-
|
|
112
|
+
RuntimeContext
|
|
112
113
|
>;
|
|
113
114
|
getWithMetadata<Metadata = unknown>(
|
|
114
115
|
key: Key,
|
|
@@ -116,7 +117,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
116
117
|
): Effect.Effect<
|
|
117
118
|
KVNamespaceGetWithMetadataResult<string, Metadata>,
|
|
118
119
|
KVNamespaceError,
|
|
119
|
-
|
|
120
|
+
RuntimeContext
|
|
120
121
|
>;
|
|
121
122
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
122
123
|
key: Key,
|
|
@@ -124,7 +125,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
124
125
|
): Effect.Effect<
|
|
125
126
|
KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>,
|
|
126
127
|
KVNamespaceError,
|
|
127
|
-
|
|
128
|
+
RuntimeContext
|
|
128
129
|
>;
|
|
129
130
|
getWithMetadata<Metadata = unknown>(
|
|
130
131
|
key: Key,
|
|
@@ -132,7 +133,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
132
133
|
): Effect.Effect<
|
|
133
134
|
KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>,
|
|
134
135
|
KVNamespaceError,
|
|
135
|
-
|
|
136
|
+
RuntimeContext
|
|
136
137
|
>;
|
|
137
138
|
getWithMetadata<Metadata = unknown>(
|
|
138
139
|
key: Key,
|
|
@@ -140,7 +141,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
140
141
|
): Effect.Effect<
|
|
141
142
|
KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>,
|
|
142
143
|
KVNamespaceError,
|
|
143
|
-
|
|
144
|
+
RuntimeContext
|
|
144
145
|
>;
|
|
145
146
|
getWithMetadata<Metadata = unknown>(
|
|
146
147
|
key: Key,
|
|
@@ -148,7 +149,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
148
149
|
): Effect.Effect<
|
|
149
150
|
KVNamespaceGetWithMetadataResult<string, Metadata>,
|
|
150
151
|
KVNamespaceError,
|
|
151
|
-
|
|
152
|
+
RuntimeContext
|
|
152
153
|
>;
|
|
153
154
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
154
155
|
key: Key,
|
|
@@ -156,7 +157,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
156
157
|
): Effect.Effect<
|
|
157
158
|
KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>,
|
|
158
159
|
KVNamespaceError,
|
|
159
|
-
|
|
160
|
+
RuntimeContext
|
|
160
161
|
>;
|
|
161
162
|
getWithMetadata<Metadata = unknown>(
|
|
162
163
|
key: Key,
|
|
@@ -164,7 +165,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
164
165
|
): Effect.Effect<
|
|
165
166
|
KVNamespaceGetWithMetadataResult<ArrayBuffer, Metadata>,
|
|
166
167
|
KVNamespaceError,
|
|
167
|
-
|
|
168
|
+
RuntimeContext
|
|
168
169
|
>;
|
|
169
170
|
getWithMetadata<Metadata = unknown>(
|
|
170
171
|
key: Key,
|
|
@@ -172,7 +173,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
172
173
|
): Effect.Effect<
|
|
173
174
|
KVNamespaceGetWithMetadataResult<ReadableStream, Metadata>,
|
|
174
175
|
KVNamespaceError,
|
|
175
|
-
|
|
176
|
+
RuntimeContext
|
|
176
177
|
>;
|
|
177
178
|
getWithMetadata<Metadata = unknown>(
|
|
178
179
|
key: Array<Key>,
|
|
@@ -180,7 +181,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
180
181
|
): Effect.Effect<
|
|
181
182
|
Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>,
|
|
182
183
|
KVNamespaceError,
|
|
183
|
-
|
|
184
|
+
RuntimeContext
|
|
184
185
|
>;
|
|
185
186
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
186
187
|
key: Array<Key>,
|
|
@@ -188,7 +189,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
188
189
|
): Effect.Effect<
|
|
189
190
|
Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>,
|
|
190
191
|
KVNamespaceError,
|
|
191
|
-
|
|
192
|
+
RuntimeContext
|
|
192
193
|
>;
|
|
193
194
|
getWithMetadata<Metadata = unknown>(
|
|
194
195
|
key: Array<Key>,
|
|
@@ -196,7 +197,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
196
197
|
): Effect.Effect<
|
|
197
198
|
Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>,
|
|
198
199
|
KVNamespaceError,
|
|
199
|
-
|
|
200
|
+
RuntimeContext
|
|
200
201
|
>;
|
|
201
202
|
getWithMetadata<Metadata = unknown>(
|
|
202
203
|
key: Array<Key>,
|
|
@@ -204,7 +205,7 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
204
205
|
): Effect.Effect<
|
|
205
206
|
Map<string, KVNamespaceGetWithMetadataResult<string, Metadata>>,
|
|
206
207
|
KVNamespaceError,
|
|
207
|
-
|
|
208
|
+
RuntimeContext
|
|
208
209
|
>;
|
|
209
210
|
getWithMetadata<ExpectedValue = unknown, Metadata = unknown>(
|
|
210
211
|
key: Array<Key>,
|
|
@@ -212,9 +213,9 @@ export interface KVNamespaceClient<Key extends string = string> {
|
|
|
212
213
|
): Effect.Effect<
|
|
213
214
|
Map<string, KVNamespaceGetWithMetadataResult<ExpectedValue, Metadata>>,
|
|
214
215
|
KVNamespaceError,
|
|
215
|
-
|
|
216
|
+
RuntimeContext
|
|
216
217
|
>;
|
|
217
|
-
delete(key: Key): Effect.Effect<void, KVNamespaceError,
|
|
218
|
+
delete(key: Key): Effect.Effect<void, KVNamespaceError, RuntimeContext>;
|
|
218
219
|
}
|
|
219
220
|
|
|
220
221
|
export class KVNamespaceBinding extends Binding.Service<
|
|
@@ -226,15 +227,13 @@ export const KVNamespaceBindingLive = Layer.effect(
|
|
|
226
227
|
KVNamespaceBinding,
|
|
227
228
|
Effect.gen(function* () {
|
|
228
229
|
const bind = yield* KVNamespaceBindingPolicy;
|
|
230
|
+
const env = yield* WorkerEnvironment;
|
|
229
231
|
|
|
230
232
|
return Effect.fn(function* (bucket: KVNamespace) {
|
|
231
233
|
yield* bind(bucket);
|
|
232
|
-
const
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
(env) =>
|
|
236
|
-
(env as Record<string, runtime.KVNamespace>)[bucket.LogicalId],
|
|
237
|
-
),
|
|
234
|
+
const raw = Effect.sync(
|
|
235
|
+
// this must be lazy because the WorkerEnvironment is not available yet
|
|
236
|
+
() => (env as Record<string, runtime.KVNamespace>)[bucket.LogicalId],
|
|
238
237
|
);
|
|
239
238
|
const tryPromise = <T>(
|
|
240
239
|
fn: () => Promise<T>,
|
|
@@ -250,9 +249,10 @@ export const KVNamespaceBindingLive = Layer.effect(
|
|
|
250
249
|
|
|
251
250
|
const use = <T>(
|
|
252
251
|
fn: (raw: runtime.KVNamespace<string>) => Promise<T>,
|
|
253
|
-
): Effect.Effect<T, KVNamespaceError
|
|
252
|
+
): Effect.Effect<T, KVNamespaceError> =>
|
|
254
253
|
raw.pipe(Effect.flatMap((raw) => tryPromise(() => fn(raw))));
|
|
255
254
|
|
|
255
|
+
// @ts-expect-error
|
|
256
256
|
return {
|
|
257
257
|
raw: raw,
|
|
258
258
|
// @ts-expect-error
|
|
@@ -2,21 +2,22 @@ import * as Effect from "effect/Effect";
|
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
3
|
import * as Binding from "../../Binding.ts";
|
|
4
4
|
import type { ResourceLike } from "../../Resource.ts";
|
|
5
|
+
import type { RuntimeContext } from "../../RuntimeContext.ts";
|
|
5
6
|
import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
|
|
6
7
|
import type { Queue } from "./Queue.ts";
|
|
7
8
|
|
|
8
9
|
export interface QueueSender {
|
|
9
|
-
raw: Effect.Effect<any, never,
|
|
10
|
+
raw: Effect.Effect<any, never, RuntimeContext>;
|
|
10
11
|
send(
|
|
11
12
|
body: unknown,
|
|
12
13
|
options?: { contentType?: "json" | "text" },
|
|
13
|
-
): Effect.Effect<void, QueueSendError,
|
|
14
|
+
): Effect.Effect<void, QueueSendError, RuntimeContext>;
|
|
14
15
|
sendBatch(
|
|
15
16
|
messages: ReadonlyArray<{
|
|
16
17
|
body: unknown;
|
|
17
18
|
contentType?: "json" | "text";
|
|
18
19
|
}>,
|
|
19
|
-
): Effect.Effect<void, QueueSendError,
|
|
20
|
+
): Effect.Effect<void, QueueSendError, RuntimeContext>;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
import * as Data from "effect/Data";
|
|
@@ -68,12 +69,12 @@ export const QueueBindingLive = Layer.effect(
|
|
|
68
69
|
QueueBinding,
|
|
69
70
|
Effect.gen(function* () {
|
|
70
71
|
const bind = yield* QueueBindingPolicy;
|
|
72
|
+
const env = yield* WorkerEnvironment;
|
|
71
73
|
|
|
72
74
|
return Effect.fn(function* (queue: Queue) {
|
|
73
75
|
yield* bind(queue);
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
Effect.map((env) => (env as Record<string, any>)[queue.LogicalId]),
|
|
76
|
+
const raw = Effect.sync(
|
|
77
|
+
() => (env as Record<string, any>)[queue.LogicalId],
|
|
77
78
|
);
|
|
78
79
|
|
|
79
80
|
const tryPromise = <T>(
|
|
@@ -6,6 +6,7 @@ import * as Stream from "effect/Stream";
|
|
|
6
6
|
import * as Binding from "../../Binding.ts";
|
|
7
7
|
import * as Output from "../../Output.ts";
|
|
8
8
|
import type { ResourceLike } from "../../Resource.ts";
|
|
9
|
+
import type { RuntimeContext } from "../../RuntimeContext.ts";
|
|
9
10
|
import { getRawStream } from "../../Util/Stream.ts";
|
|
10
11
|
import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
|
|
11
12
|
import type { R2Bucket } from "./R2Bucket.ts";
|
|
@@ -66,18 +67,18 @@ export type R2UploadedPart = runtime.R2UploadedPart;
|
|
|
66
67
|
export interface R2UploadPartOptions extends runtime.R2UploadPartOptions {}
|
|
67
68
|
|
|
68
69
|
export interface R2BucketClient {
|
|
69
|
-
raw: Effect.Effect<runtime.R2Bucket, never,
|
|
70
|
-
head(key: string): Effect.Effect<R2Object | null, R2Error,
|
|
70
|
+
raw: Effect.Effect<runtime.R2Bucket, never, RuntimeContext>;
|
|
71
|
+
head(key: string): Effect.Effect<R2Object | null, R2Error, RuntimeContext>;
|
|
71
72
|
get(
|
|
72
73
|
key: string,
|
|
73
74
|
options: R2GetOptions & {
|
|
74
75
|
onlyIf: runtime.R2Conditional | Headers;
|
|
75
76
|
},
|
|
76
|
-
): Effect.Effect<R2ObjectBody | R2Object | null, R2Error,
|
|
77
|
+
): Effect.Effect<R2ObjectBody | R2Object | null, R2Error, RuntimeContext>;
|
|
77
78
|
get(
|
|
78
79
|
key: string,
|
|
79
80
|
options?: R2GetOptions,
|
|
80
|
-
): Effect.Effect<R2ObjectBody | null, R2Error,
|
|
81
|
+
): Effect.Effect<R2ObjectBody | null, R2Error, RuntimeContext>;
|
|
81
82
|
put<Err = never>(
|
|
82
83
|
key: string,
|
|
83
84
|
value:
|
|
@@ -92,7 +93,7 @@ export interface R2BucketClient {
|
|
|
92
93
|
onlyIf: R2Conditional | Headers;
|
|
93
94
|
contentLength?: number;
|
|
94
95
|
},
|
|
95
|
-
): Effect.Effect<R2Object | null, R2Error | Err,
|
|
96
|
+
): Effect.Effect<R2Object | null, R2Error | Err, RuntimeContext>;
|
|
96
97
|
put<Err = never>(
|
|
97
98
|
key: string,
|
|
98
99
|
value:
|
|
@@ -103,7 +104,7 @@ export interface R2BucketClient {
|
|
|
103
104
|
| null
|
|
104
105
|
| Blob,
|
|
105
106
|
options?: R2PutOptions,
|
|
106
|
-
): Effect.Effect<R2Object, R2Error | Err,
|
|
107
|
+
): Effect.Effect<R2Object, R2Error | Err, RuntimeContext>;
|
|
107
108
|
put<Err = never>(
|
|
108
109
|
key: string,
|
|
109
110
|
value:
|
|
@@ -117,21 +118,19 @@ export interface R2BucketClient {
|
|
|
117
118
|
options: R2PutOptions & {
|
|
118
119
|
contentLength: number;
|
|
119
120
|
},
|
|
120
|
-
): Effect.Effect<R2Object, R2Error | Err,
|
|
121
|
-
delete(
|
|
122
|
-
keys: string | string[],
|
|
123
|
-
): Effect.Effect<void, R2Error, WorkerEnvironment>;
|
|
121
|
+
): Effect.Effect<R2Object, R2Error | Err, RuntimeContext>;
|
|
122
|
+
delete(keys: string | string[]): Effect.Effect<void, R2Error, RuntimeContext>;
|
|
124
123
|
list(
|
|
125
124
|
options?: R2ListOptions,
|
|
126
|
-
): Effect.Effect<R2Objects, R2Error,
|
|
125
|
+
): Effect.Effect<R2Objects, R2Error, RuntimeContext>;
|
|
127
126
|
createMultipartUpload(
|
|
128
127
|
key: string,
|
|
129
128
|
options?: R2MultipartOptions,
|
|
130
|
-
): Effect.Effect<R2MultipartUpload, R2Error,
|
|
129
|
+
): Effect.Effect<R2MultipartUpload, R2Error, RuntimeContext>;
|
|
131
130
|
resumeMultipartUpload(
|
|
132
131
|
key: string,
|
|
133
132
|
uploadId: string,
|
|
134
|
-
): Effect.Effect<R2MultipartUpload, R2Error,
|
|
133
|
+
): Effect.Effect<R2MultipartUpload, R2Error, RuntimeContext>;
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
export class R2BucketBinding extends Binding.Service<
|
|
@@ -143,14 +142,12 @@ export const R2BucketBindingLive = Layer.effect(
|
|
|
143
142
|
R2BucketBinding,
|
|
144
143
|
Effect.gen(function* () {
|
|
145
144
|
const bind = yield* R2BucketBindingPolicy;
|
|
145
|
+
const env = yield* WorkerEnvironment;
|
|
146
146
|
|
|
147
147
|
return Effect.fn(function* (bucket: R2Bucket) {
|
|
148
148
|
yield* bind(bucket);
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
Effect.map(
|
|
152
|
-
(env) => (env as Record<string, runtime.R2Bucket>)[bucket.LogicalId],
|
|
153
|
-
),
|
|
149
|
+
const raw = Effect.sync(
|
|
150
|
+
() => (env as Record<string, runtime.R2Bucket>)[bucket.LogicalId]!,
|
|
154
151
|
);
|
|
155
152
|
const tryPromise = <T>(fn: () => Promise<T>): Effect.Effect<T, R2Error> =>
|
|
156
153
|
Effect.tryPromise({
|
|
@@ -164,7 +161,7 @@ export const R2BucketBindingLive = Layer.effect(
|
|
|
164
161
|
|
|
165
162
|
const use = <T>(
|
|
166
163
|
fn: (raw: runtime.R2Bucket) => Promise<T>,
|
|
167
|
-
): Effect.Effect<T, R2Error
|
|
164
|
+
): Effect.Effect<T, R2Error> =>
|
|
168
165
|
raw.pipe(Effect.flatMap((raw) => tryPromise(() => fn(raw))));
|
|
169
166
|
|
|
170
167
|
const wrapR2Object = (object: runtime.R2Object): R2Object => ({
|
|
@@ -4,6 +4,7 @@ import * as Effect from "effect/Effect";
|
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
5
|
import * as Binding from "../../Binding.ts";
|
|
6
6
|
import type { ResourceLike } from "../../Resource.ts";
|
|
7
|
+
import type { RuntimeContext } from "../../RuntimeContext.ts";
|
|
7
8
|
import { isWorker, WorkerEnvironment } from "../Workers/Worker.ts";
|
|
8
9
|
import type { Secret } from "./Secret.ts";
|
|
9
10
|
|
|
@@ -21,16 +22,16 @@ export class SecretError extends Data.TaggedError("SecretError")<{
|
|
|
21
22
|
export interface SecretClient extends Effect.Effect<
|
|
22
23
|
string,
|
|
23
24
|
SecretError,
|
|
24
|
-
|
|
25
|
+
RuntimeContext
|
|
25
26
|
> {
|
|
26
27
|
/**
|
|
27
28
|
* Effect that resolves to the raw Cloudflare `SecretsStoreSecret` binding.
|
|
28
29
|
*/
|
|
29
|
-
raw: Effect.Effect<runtime.SecretsStoreSecret, never,
|
|
30
|
+
raw: Effect.Effect<runtime.SecretsStoreSecret, never, RuntimeContext>;
|
|
30
31
|
/**
|
|
31
32
|
* Read the current value of the secret.
|
|
32
33
|
*/
|
|
33
|
-
get(): Effect.Effect<string, SecretError,
|
|
34
|
+
get(): Effect.Effect<string, SecretError, RuntimeContext>;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
export class SecretBinding extends Binding.Service<
|
|
@@ -42,17 +43,13 @@ export const SecretBindingLive = Layer.effect(
|
|
|
42
43
|
SecretBinding,
|
|
43
44
|
Effect.gen(function* () {
|
|
44
45
|
const bind = yield* SecretBindingPolicy;
|
|
46
|
+
const env = yield* WorkerEnvironment;
|
|
45
47
|
|
|
46
48
|
return Effect.fn(function* (secret: Secret) {
|
|
47
49
|
yield* bind(secret);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
(env) =>
|
|
52
|
-
(env as Record<string, runtime.SecretsStoreSecret>)[
|
|
53
|
-
secret.LogicalId
|
|
54
|
-
],
|
|
55
|
-
),
|
|
50
|
+
const raw = Effect.sync(
|
|
51
|
+
() =>
|
|
52
|
+
(env as Record<string, runtime.SecretsStoreSecret>)[secret.LogicalId],
|
|
56
53
|
);
|
|
57
54
|
const tryPromise = <T>(
|
|
58
55
|
fn: () => Promise<T>,
|
|
@@ -66,8 +63,9 @@ export const SecretBindingLive = Layer.effect(
|
|
|
66
63
|
}),
|
|
67
64
|
});
|
|
68
65
|
|
|
69
|
-
const getEffect: Effect.Effect<string, SecretError
|
|
70
|
-
|
|
66
|
+
const getEffect: Effect.Effect<string, SecretError> = raw.pipe(
|
|
67
|
+
Effect.flatMap((raw) => tryPromise(() => raw.get())),
|
|
68
|
+
);
|
|
71
69
|
|
|
72
70
|
return Object.assign(
|
|
73
71
|
Effect.suspend(() => getEffect),
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type * as cf from "@cloudflare/workers-types";
|
|
2
2
|
import * as Context from "effect/Context";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Option from "effect/Option";
|
|
5
4
|
import type { HttpServerError } from "effect/unstable/http/HttpServerError";
|
|
6
5
|
import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
|
|
7
6
|
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
|
|
8
7
|
import type { HttpEffect } from "../../Http.ts";
|
|
9
8
|
import * as Output from "../../Output.ts";
|
|
9
|
+
import { ALCHEMY_PHASE } from "../../Phase.ts";
|
|
10
10
|
import type { PlatformServices } from "../../Platform.ts";
|
|
11
11
|
import { effectClass, taggedFunction } from "../../Util/effect.ts";
|
|
12
12
|
import { DurableObjectState } from "./DurableObjectState.ts";
|
|
@@ -589,12 +589,12 @@ export const DurableObjectNamespace: DurableObjectNamespaceClass =
|
|
|
589
589
|
],
|
|
590
590
|
});
|
|
591
591
|
|
|
592
|
-
const binding = yield* Effect.
|
|
592
|
+
const binding = yield* Effect.all([
|
|
593
593
|
WorkerEnvironment,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
Effect.flatMap((env) => {
|
|
597
|
-
if (env === undefined) {
|
|
594
|
+
ALCHEMY_PHASE,
|
|
595
|
+
]).pipe(
|
|
596
|
+
Effect.flatMap(([env, phase]) => {
|
|
597
|
+
if (env === undefined || phase === "plan") {
|
|
598
598
|
// should be fine to return undefined here (it is only undefined at plantime)
|
|
599
599
|
return Effect.succeed(undefined);
|
|
600
600
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
-
import
|
|
2
|
+
import { ALCHEMY_PHASE } from "../../Phase.ts";
|
|
3
3
|
import { fromCloudflareFetcher, type Fetcher } from "../Fetcher.ts";
|
|
4
4
|
import { makeRpcStub } from "./Rpc.ts";
|
|
5
5
|
import { Worker, WorkerEnvironment } from "./Worker.ts";
|
|
@@ -162,10 +162,9 @@ export const DynamicWorkerLoader = Effect.fnUntraced(function* (name: string) {
|
|
|
162
162
|
bindings: [{ type: "worker_loader", name } as any],
|
|
163
163
|
});
|
|
164
164
|
|
|
165
|
-
const binding = yield* Effect.
|
|
166
|
-
Effect.
|
|
167
|
-
|
|
168
|
-
if (env === undefined) {
|
|
165
|
+
const binding = yield* Effect.all([WorkerEnvironment, ALCHEMY_PHASE]).pipe(
|
|
166
|
+
Effect.flatMap(([env, phase]) => {
|
|
167
|
+
if (env === undefined || phase === "plan") {
|
|
169
168
|
return Effect.succeed(undefined as any);
|
|
170
169
|
}
|
|
171
170
|
const loader = env[name];
|
|
@@ -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) => {
|
|
@@ -136,9 +136,13 @@ export const ExportedHandlerMethods = [
|
|
|
136
136
|
"queue",
|
|
137
137
|
] as const satisfies (keyof cf.ExportedHandler)[];
|
|
138
138
|
|
|
139
|
-
export type WorkerServices =
|
|
139
|
+
export type WorkerServices =
|
|
140
|
+
| Worker
|
|
141
|
+
| Request
|
|
142
|
+
| WorkerExecutionContext
|
|
143
|
+
| WorkerEnvironment;
|
|
140
144
|
|
|
141
|
-
export type WorkerShape = Main<WorkerServices
|
|
145
|
+
export type WorkerShape = Main<WorkerServices>;
|
|
142
146
|
|
|
143
147
|
export type WorkerEnv = Record<
|
|
144
148
|
string,
|
|
@@ -658,7 +662,7 @@ export const Worker: Platform<
|
|
|
658
662
|
>(
|
|
659
663
|
id: string,
|
|
660
664
|
props:
|
|
661
|
-
| WorkerProps<Bindings, Env, Assets
|
|
665
|
+
| InputProps<WorkerProps<Bindings, Env, Assets>>
|
|
662
666
|
| Effect.Effect<
|
|
663
667
|
InputProps<WorkerProps<Bindings, Env, Assets>>,
|
|
664
668
|
never,
|
|
@@ -681,8 +685,16 @@ export const Worker: Platform<
|
|
|
681
685
|
Req | Providers
|
|
682
686
|
>;
|
|
683
687
|
} = Platform(WorkerTypeId, {
|
|
684
|
-
|
|
685
|
-
|
|
688
|
+
// Both hooks are wrapped in arrows so the imported references are resolved
|
|
689
|
+
// at call time rather than at module-load time. Worker.ts forms import
|
|
690
|
+
// cycles with both WorkerAsyncBindings.ts (which imports `isWorker` here)
|
|
691
|
+
// and WorkerRuntimeContext.ts (which imports `WorkerTypeId`/`WorkerEnvironment`
|
|
692
|
+
// here). Reading either binding eagerly here hits TDZ when Bun loads the
|
|
693
|
+
// package from node_modules in a different module-init order than the local
|
|
694
|
+
// workspace.
|
|
695
|
+
onCreate: (resource, props) =>
|
|
696
|
+
bindWorkerAsyncBindings(resource as Worker, props),
|
|
697
|
+
createRuntimeContext: (id) => makeWorkerRuntimeContext(id),
|
|
686
698
|
});
|
|
687
699
|
|
|
688
700
|
class MissingDurableObjectNamespaces extends Data.TaggedError(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type * as cf from "@cloudflare/workers-types";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
3
4
|
import * as Option from "effect/Option";
|
|
4
5
|
import * as Redacted from "effect/Redacted";
|
|
5
6
|
import type { HttpEffect } from "../../Http.ts";
|
|
@@ -112,6 +113,7 @@ export const makeWorkerRuntimeContext = (id: string): WorkerRuntimeContext => {
|
|
|
112
113
|
Effect.sync(() => {
|
|
113
114
|
exports[name] = value;
|
|
114
115
|
}),
|
|
116
|
+
planServices: Layer.succeed(WorkerEnvironment, {}),
|
|
115
117
|
exports: Effect.gen(function* () {
|
|
116
118
|
const handlers = yield* Effect.all(listeners, {
|
|
117
119
|
concurrency: "unbounded",
|