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
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import * as Console from "effect/Console";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Deferred from "effect/Deferred";
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import * as Layer from "effect/Layer";
|
|
6
|
+
import type * as Scope from "effect/Scope";
|
|
7
|
+
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
8
|
+
import type { HttpClient } from "effect/unstable/http/HttpClient";
|
|
9
|
+
import type { ProviderService } from "../Provider.ts";
|
|
10
|
+
import type { ResourceLike } from "../Resource.ts";
|
|
11
|
+
import {
|
|
12
|
+
platformLayer,
|
|
13
|
+
PlatformServices,
|
|
14
|
+
runMain,
|
|
15
|
+
} from "../Util/PlatformServices.ts";
|
|
16
|
+
import * as RpcSerialization from "./RpcSerialization.ts";
|
|
17
|
+
import * as RpcServerEnvironment from "./RpcServerEnvironment.ts";
|
|
18
|
+
import {
|
|
19
|
+
makeServerRpcSession,
|
|
20
|
+
type ServerRpcSession,
|
|
21
|
+
type ServerWebSocketLike,
|
|
22
|
+
} from "./RpcServerSession.ts";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A service that exposes one or more resource providers over RPC.
|
|
26
|
+
* This returns `never` because it is meant to be used with `Layer.launch` (see {@link launch}).
|
|
27
|
+
*/
|
|
28
|
+
export class RpcServer extends Context.Service<RpcServer, never>()(
|
|
29
|
+
"alchemy/Local/RpcServer",
|
|
30
|
+
) {}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The RPC API that is implemented by the server and consumed by {@link RpcProviderProxy}.
|
|
34
|
+
*/
|
|
35
|
+
export interface RpcProxyApi {
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a provider from the RPC server context.
|
|
38
|
+
* The consumer must unwrap the provider using {@link RpcSerialization.unwrapRpcHandlers} before using it.
|
|
39
|
+
*/
|
|
40
|
+
readonly getProvider: <R extends ResourceLike>(
|
|
41
|
+
type: R["Type"],
|
|
42
|
+
) => Promise<RpcSerialization.RpcWrapped<ProviderService<R>>>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const serverPlatformLayer = platformLayer({
|
|
46
|
+
bun: async () => {
|
|
47
|
+
const { RpcServerBun } = await import("./RpcServerBun.ts");
|
|
48
|
+
return RpcServerBun;
|
|
49
|
+
},
|
|
50
|
+
node: async () => {
|
|
51
|
+
const { RpcServerNode } = await import("./RpcServerNode.ts");
|
|
52
|
+
return RpcServerNode;
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Launches an RPC server that serves the given providers.
|
|
58
|
+
* Alchemy globals such as `AlchemyContext`, `Profile`, and `Stack` are inherited from the parent via {@link RpcServerEnvironment.fromEnv} and should not be provided manually.
|
|
59
|
+
* `PlatformServices` and `HttpClient` are also included.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* RpcServer.launch(
|
|
64
|
+
* Layer.merge(
|
|
65
|
+
* FunctionProvider,
|
|
66
|
+
* QueueProvider,
|
|
67
|
+
* ),
|
|
68
|
+
* );
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @param providers - A layer containing the providers to serve.
|
|
72
|
+
*/
|
|
73
|
+
export const launch = <ROut, E>(
|
|
74
|
+
providers: Layer.Layer<
|
|
75
|
+
ROut,
|
|
76
|
+
E,
|
|
77
|
+
| Scope.Scope
|
|
78
|
+
| RpcServerEnvironment.RpcEnvironmentServices
|
|
79
|
+
| PlatformServices
|
|
80
|
+
| HttpClient
|
|
81
|
+
>,
|
|
82
|
+
) =>
|
|
83
|
+
serverPlatformLayer.pipe(
|
|
84
|
+
Layer.provide(providers),
|
|
85
|
+
Layer.provide(RpcServerEnvironment.fromEnv()),
|
|
86
|
+
Layer.provide(Layer.merge(PlatformServices, FetchHttpClient.layer)),
|
|
87
|
+
Layer.launch,
|
|
88
|
+
Effect.scoped,
|
|
89
|
+
runMain,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Constructs an `RpcServer` layer using the given server implementation.
|
|
94
|
+
* @param serve - A function that spawns a websocket server and returns its URL.
|
|
95
|
+
* @returns An `RpcServer` layer.
|
|
96
|
+
*/
|
|
97
|
+
export const layerServer = (
|
|
98
|
+
serve: (handlers: {
|
|
99
|
+
/** Creates a new RPC session over the given websocket. */
|
|
100
|
+
createRpcSession: (
|
|
101
|
+
ws: ServerWebSocketLike,
|
|
102
|
+
) => ServerRpcSession<RpcProxyApi>;
|
|
103
|
+
/** Called when the parent connection, indicated by the `/parent` path, is established. */
|
|
104
|
+
parentConnected: () => void;
|
|
105
|
+
/** Called when the parent disconnects. The server will shut down when this is called. */
|
|
106
|
+
parentDisconnected: () => void;
|
|
107
|
+
}) => Effect.Effect<{ readonly url: string }, never, Scope.Scope>,
|
|
108
|
+
) =>
|
|
109
|
+
Layer.effect(
|
|
110
|
+
RpcServer,
|
|
111
|
+
Effect.gen(function* () {
|
|
112
|
+
const context = yield* Effect.context();
|
|
113
|
+
const connected = yield* Deferred.make<void>();
|
|
114
|
+
const disconnected = yield* Deferred.make<void>();
|
|
115
|
+
const { url } = yield* serve({
|
|
116
|
+
createRpcSession: (ws) =>
|
|
117
|
+
makeServerRpcSession<RpcProxyApi>(ws, {
|
|
118
|
+
getProvider: async <R extends ResourceLike>(type: R["Type"]) => {
|
|
119
|
+
const provider = context.mapUnsafe.get(type);
|
|
120
|
+
if (!provider) {
|
|
121
|
+
throw new Error(`Provider "${type}" not found`);
|
|
122
|
+
}
|
|
123
|
+
return RpcSerialization.wrapRpcHandlers(
|
|
124
|
+
provider as ProviderService<R>,
|
|
125
|
+
["tail"],
|
|
126
|
+
);
|
|
127
|
+
},
|
|
128
|
+
}),
|
|
129
|
+
parentConnected: () => Deferred.doneUnsafe(connected, Effect.void),
|
|
130
|
+
parentDisconnected: () =>
|
|
131
|
+
Deferred.doneUnsafe(disconnected, Effect.void),
|
|
132
|
+
});
|
|
133
|
+
yield* Console.log(`<ALCHEMY_RPC_ADDRESS>${url}</ALCHEMY_RPC_ADDRESS>`);
|
|
134
|
+
yield* Deferred.await(connected).pipe(Effect.timeout("10 seconds")); // TODO(john): should the timeout be shorter?
|
|
135
|
+
yield* Deferred.await(disconnected);
|
|
136
|
+
return yield* Effect.interrupt;
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as RpcServer from "./RpcServer.ts";
|
|
3
|
+
import type { ServerRpcSession } from "./RpcServerSession.ts";
|
|
4
|
+
|
|
5
|
+
export const RpcServerBun = RpcServer.layerServer(
|
|
6
|
+
Effect.fnUntraced(function* ({
|
|
7
|
+
parentConnected,
|
|
8
|
+
parentDisconnected,
|
|
9
|
+
createRpcSession,
|
|
10
|
+
}) {
|
|
11
|
+
const server = yield* Effect.sync(() =>
|
|
12
|
+
Bun.serve<
|
|
13
|
+
{ type: "session"; session: ServerRpcSession<any> } | { type: "parent" }
|
|
14
|
+
>({
|
|
15
|
+
port: 0,
|
|
16
|
+
fetch: (request, server) => {
|
|
17
|
+
const url = new URL(request.url);
|
|
18
|
+
if (
|
|
19
|
+
server.upgrade(request, {
|
|
20
|
+
data:
|
|
21
|
+
url.pathname === "/parent" ? { type: "parent" } : undefined!,
|
|
22
|
+
})
|
|
23
|
+
) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
return new Response("Upgrade failed", { status: 400 });
|
|
27
|
+
},
|
|
28
|
+
websocket: {
|
|
29
|
+
open: (ws) => {
|
|
30
|
+
if (ws.data && ws.data.type === "parent") {
|
|
31
|
+
parentConnected();
|
|
32
|
+
} else {
|
|
33
|
+
ws.data = {
|
|
34
|
+
type: "session",
|
|
35
|
+
session: createRpcSession(ws),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
message: (ws, message) => {
|
|
40
|
+
if (ws.data.type === "session") {
|
|
41
|
+
ws.data.session.dispatch.message(message);
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
close: (ws, code, reason) => {
|
|
45
|
+
if (ws.data.type === "session") {
|
|
46
|
+
ws.data.session.dispatch.close(code, reason);
|
|
47
|
+
} else if (ws.data.type === "parent") {
|
|
48
|
+
parentDisconnected();
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
54
|
+
yield* Effect.addFinalizer(() => Effect.sync(() => server.stop(true)));
|
|
55
|
+
return {
|
|
56
|
+
url: `ws://${server.hostname}:${server.port}`,
|
|
57
|
+
};
|
|
58
|
+
}),
|
|
59
|
+
);
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as Config from "effect/Config";
|
|
2
|
+
import * as ConfigProvider from "effect/ConfigProvider";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
6
|
+
import { AlchemyContext } from "../AlchemyContext.ts";
|
|
7
|
+
import { AuthProviders } from "../Auth/AuthProvider.ts";
|
|
8
|
+
import { CredentialsStoreLive } from "../Auth/Credentials.ts";
|
|
9
|
+
import { ProfileLive, withProfileOverride } from "../Auth/Profile.ts";
|
|
10
|
+
import { Stack } from "../Stack.ts";
|
|
11
|
+
import { Stage } from "../Stage.ts";
|
|
12
|
+
import { loadConfigProvider } from "../Util/ConfigProvider.ts";
|
|
13
|
+
|
|
14
|
+
export interface RpcServerEnvironment {
|
|
15
|
+
alchemyContext: AlchemyContext["Service"];
|
|
16
|
+
profile: string | undefined;
|
|
17
|
+
envFile: string | undefined;
|
|
18
|
+
stack: {
|
|
19
|
+
name: string;
|
|
20
|
+
stage: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type RpcEnvironmentServices = Layer.Success<ReturnType<typeof layer>>;
|
|
25
|
+
|
|
26
|
+
export const layer = (environment: RpcServerEnvironment) =>
|
|
27
|
+
Layer.mergeAll(
|
|
28
|
+
ProfileLive,
|
|
29
|
+
CredentialsStoreLive,
|
|
30
|
+
Layer.succeed(AuthProviders, {}),
|
|
31
|
+
ConfigProvider.layer(
|
|
32
|
+
loadConfigProvider(Option.fromUndefinedOr(environment.envFile)).pipe(
|
|
33
|
+
Effect.map((base) => withProfileOverride(base, environment.profile)),
|
|
34
|
+
),
|
|
35
|
+
),
|
|
36
|
+
Layer.succeed(AlchemyContext, environment.alchemyContext),
|
|
37
|
+
Layer.succeed(Stack, {
|
|
38
|
+
name: environment.stack.name,
|
|
39
|
+
stage: environment.stack.stage,
|
|
40
|
+
resources: {},
|
|
41
|
+
bindings: {},
|
|
42
|
+
actions: {},
|
|
43
|
+
}),
|
|
44
|
+
Layer.succeed(Stage, environment.stack.stage),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
export const RPC_SERVER_ENVIRONMENT_KEY =
|
|
48
|
+
"ALCHEMY_RPC_SERVER_ENVIRONMENT" as const;
|
|
49
|
+
|
|
50
|
+
export const fromEnv = () =>
|
|
51
|
+
Config.string(RPC_SERVER_ENVIRONMENT_KEY).pipe(
|
|
52
|
+
Config.map(JSON.parse),
|
|
53
|
+
Effect.map((environment) => layer(environment)),
|
|
54
|
+
Layer.unwrap,
|
|
55
|
+
);
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { WebSocketServer, type Server } from "ws";
|
|
3
|
+
import * as RpcServer from "./RpcServer.ts";
|
|
4
|
+
|
|
5
|
+
export const RpcServerNode = RpcServer.layerServer(
|
|
6
|
+
Effect.fnUntraced(function* ({
|
|
7
|
+
parentConnected,
|
|
8
|
+
parentDisconnected,
|
|
9
|
+
createRpcSession,
|
|
10
|
+
}) {
|
|
11
|
+
const server = new WebSocketServer({ host: "127.0.0.1", port: 0 });
|
|
12
|
+
const url = yield* Effect.callback<string>((resume) => {
|
|
13
|
+
server.on("connection", (ws, req) => {
|
|
14
|
+
if (req.url?.startsWith("/parent")) {
|
|
15
|
+
parentConnected();
|
|
16
|
+
ws.on("close", () => {
|
|
17
|
+
parentDisconnected();
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const session = createRpcSession(ws);
|
|
22
|
+
ws.on("message", (data) => {
|
|
23
|
+
session.dispatch.message(data.toString());
|
|
24
|
+
});
|
|
25
|
+
ws.on("close", (code, reason) => {
|
|
26
|
+
session.dispatch.close(code, reason.toString());
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
server.on("error", (error) => {
|
|
30
|
+
resume(Effect.die(error));
|
|
31
|
+
});
|
|
32
|
+
server.on("listening", () => {
|
|
33
|
+
resume(getServerAddress(server));
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
yield* Effect.addFinalizer(() => Effect.sync(() => server.close()));
|
|
37
|
+
return { url };
|
|
38
|
+
}),
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
function getServerAddress(server: Server): Effect.Effect<string> {
|
|
42
|
+
const address = server.address();
|
|
43
|
+
if (
|
|
44
|
+
typeof address === "object" &&
|
|
45
|
+
address !== null &&
|
|
46
|
+
"address" in address &&
|
|
47
|
+
"port" in address
|
|
48
|
+
) {
|
|
49
|
+
return Effect.succeed(
|
|
50
|
+
`ws://${address.address === "::" ? "localhost" : address.address}:${address.port}`,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
return Effect.die(
|
|
54
|
+
new Error(
|
|
55
|
+
`Server address is not an object with address and port properties: ${JSON.stringify(address)}`,
|
|
56
|
+
),
|
|
57
|
+
);
|
|
58
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { RpcSession, type RpcCompatible, type RpcTransport } from "capnweb";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A platform-agnostic interface for a server-side WebSocket.
|
|
5
|
+
*/
|
|
6
|
+
export interface ServerWebSocketLike {
|
|
7
|
+
send: (message: string) => any | Promise<any>;
|
|
8
|
+
close: (code?: number, reason?: string) => void;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Represents a websocket RPC session with capnweb.
|
|
13
|
+
* Use the `dispatch` object to handle messages that are received from the client.
|
|
14
|
+
*/
|
|
15
|
+
export type ServerRpcSession<T extends RpcCompatible<T>> = ReturnType<
|
|
16
|
+
typeof makeServerRpcSession<T>
|
|
17
|
+
>;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a ServerRpcSession using capnweb.
|
|
21
|
+
* @param ws - The WebSocket to use for the session.
|
|
22
|
+
* @param main - The main object to use for the session.
|
|
23
|
+
* @returns A ServerRpcSession.
|
|
24
|
+
*/
|
|
25
|
+
export function makeServerRpcSession<T extends RpcCompatible<T>>(
|
|
26
|
+
ws: ServerWebSocketLike,
|
|
27
|
+
main: T,
|
|
28
|
+
) {
|
|
29
|
+
const { transport, dispatch } = makeWebSocketRpcTransport(ws);
|
|
30
|
+
const session = new RpcSession(transport, main);
|
|
31
|
+
return { session, dispatch };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function makeWebSocketRpcTransport(ws: ServerWebSocketLike) {
|
|
35
|
+
let receiveQueue: Array<string> = [];
|
|
36
|
+
let receiveResolver: ((value: string) => void) | undefined;
|
|
37
|
+
let receiveRejecter: ((reason: unknown) => void) | undefined;
|
|
38
|
+
let error: unknown | undefined;
|
|
39
|
+
return {
|
|
40
|
+
transport: {
|
|
41
|
+
send: async (message: string) => await ws.send(message),
|
|
42
|
+
receive: async () => {
|
|
43
|
+
const next = receiveQueue.shift();
|
|
44
|
+
if (next) {
|
|
45
|
+
return next;
|
|
46
|
+
} else if (error) {
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
return new Promise<string>((resolve, reject) => {
|
|
50
|
+
receiveResolver = resolve;
|
|
51
|
+
receiveRejecter = reject;
|
|
52
|
+
});
|
|
53
|
+
},
|
|
54
|
+
abort: (reason: unknown) => {
|
|
55
|
+
const message =
|
|
56
|
+
reason instanceof Error ? reason.message : String(reason);
|
|
57
|
+
ws.close(3000, message);
|
|
58
|
+
error ??= reason;
|
|
59
|
+
},
|
|
60
|
+
} satisfies RpcTransport,
|
|
61
|
+
dispatch: {
|
|
62
|
+
message: (data: string | Buffer<ArrayBuffer>) => {
|
|
63
|
+
if (error) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
data = typeof data === "string" ? data : data.toString("utf-8");
|
|
67
|
+
if (receiveResolver) {
|
|
68
|
+
receiveResolver(data);
|
|
69
|
+
receiveResolver = undefined;
|
|
70
|
+
receiveRejecter = undefined;
|
|
71
|
+
} else {
|
|
72
|
+
receiveQueue.push(data);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
close: (code: number, reason: string) => {
|
|
76
|
+
if (!error) {
|
|
77
|
+
error = new Error(`WebSocket closed with code ${code}: ${reason}`);
|
|
78
|
+
if (receiveRejecter) {
|
|
79
|
+
receiveRejecter(error);
|
|
80
|
+
receiveRejecter = undefined;
|
|
81
|
+
receiveResolver = undefined;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { exitHook } from "@alchemy.run/node-utils/exit-hook";
|
|
2
|
+
import * as Cache from "effect/Cache";
|
|
3
|
+
import * as Context from "effect/Context";
|
|
4
|
+
import * as Deferred from "effect/Deferred";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import * as Layer from "effect/Layer";
|
|
7
|
+
import type { PlatformError } from "effect/PlatformError";
|
|
8
|
+
import * as Scope from "effect/Scope";
|
|
9
|
+
import * as Stream from "effect/Stream";
|
|
10
|
+
import * as HttpServer from "effect/unstable/http/HttpServer";
|
|
11
|
+
import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
|
|
12
|
+
import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
|
|
13
|
+
import * as ChildProcess from "effect/unstable/process/ChildProcess";
|
|
14
|
+
import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawner";
|
|
15
|
+
import * as NodeChildProcess from "node:child_process";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { httpServer } from "../Util/PlatformServices.ts";
|
|
18
|
+
import {
|
|
19
|
+
RPC_SERVER_ENVIRONMENT_KEY,
|
|
20
|
+
type RpcServerEnvironment,
|
|
21
|
+
} from "./RpcServerEnvironment.ts";
|
|
22
|
+
|
|
23
|
+
export class RpcSpawner extends Context.Service<
|
|
24
|
+
RpcSpawner,
|
|
25
|
+
{
|
|
26
|
+
readonly url: string;
|
|
27
|
+
}
|
|
28
|
+
>()("alchemy/Local/RpcSpawner") {}
|
|
29
|
+
|
|
30
|
+
export interface RpcSpawnPayload extends Pick<
|
|
31
|
+
RpcServerEnvironment,
|
|
32
|
+
"alchemyContext" | "stack"
|
|
33
|
+
> {
|
|
34
|
+
serverEntryUrl: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export const make = Effect.fnUntraced(function* ({
|
|
38
|
+
profile,
|
|
39
|
+
envFile,
|
|
40
|
+
}: Pick<RpcServerEnvironment, "profile" | "envFile">) {
|
|
41
|
+
const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
|
|
42
|
+
const scope = yield* Effect.scope;
|
|
43
|
+
const cache = yield* Cache.make({
|
|
44
|
+
lookup: (payload: RpcSpawnPayload) =>
|
|
45
|
+
spawn(payload).pipe(Scope.provide(scope)),
|
|
46
|
+
capacity: Infinity,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const spawn = Effect.fnUntraced(function* ({
|
|
50
|
+
serverEntryUrl,
|
|
51
|
+
alchemyContext,
|
|
52
|
+
stack,
|
|
53
|
+
}: RpcSpawnPayload) {
|
|
54
|
+
const bin = typeof globalThis.Bun !== "undefined" ? "bun" : "node";
|
|
55
|
+
const main = fileURLToPath(serverEntryUrl);
|
|
56
|
+
const environment: RpcServerEnvironment = {
|
|
57
|
+
profile,
|
|
58
|
+
envFile,
|
|
59
|
+
alchemyContext,
|
|
60
|
+
stack,
|
|
61
|
+
};
|
|
62
|
+
const command = ChildProcess.make(
|
|
63
|
+
bin,
|
|
64
|
+
{
|
|
65
|
+
bun: ["run", main],
|
|
66
|
+
// Under Node, transparently strip TypeScript types so that `.ts`
|
|
67
|
+
// entry points work the same way they do under Bun. Mirrors what
|
|
68
|
+
// `dev.ts` already does for the outer process, so the dev experience
|
|
69
|
+
// is symmetric on both runtimes whether the entry came from `src/`
|
|
70
|
+
// (dev/tests) or `lib/` (published packages).
|
|
71
|
+
node: main.endsWith(".ts")
|
|
72
|
+
? [
|
|
73
|
+
"--experimental-transform-types",
|
|
74
|
+
"--no-warnings=ExperimentalWarning",
|
|
75
|
+
main,
|
|
76
|
+
]
|
|
77
|
+
: [main],
|
|
78
|
+
}[bin],
|
|
79
|
+
{
|
|
80
|
+
stdout: "pipe",
|
|
81
|
+
stderr: "inherit",
|
|
82
|
+
detached: false,
|
|
83
|
+
env: {
|
|
84
|
+
[RPC_SERVER_ENVIRONMENT_KEY]: JSON.stringify(environment),
|
|
85
|
+
},
|
|
86
|
+
extendEnv: true,
|
|
87
|
+
},
|
|
88
|
+
);
|
|
89
|
+
const handle = yield* spawner.spawn(command);
|
|
90
|
+
const unregister = exitHook(() => {
|
|
91
|
+
killProcessGroup(handle.pid, "SIGKILL");
|
|
92
|
+
});
|
|
93
|
+
const kill = handle
|
|
94
|
+
.kill({ forceKillAfter: "500 millis" })
|
|
95
|
+
.pipe(Effect.tap(() => Effect.sync(unregister)));
|
|
96
|
+
yield* Effect.addFinalizer(() => kill.pipe(Effect.ignore));
|
|
97
|
+
const url = yield* getRpcAddress(handle.stdout);
|
|
98
|
+
const ws = yield* Effect.acquireRelease(
|
|
99
|
+
Effect.sync(() => new WebSocket(new URL("/parent", url))),
|
|
100
|
+
(ws) => Effect.sync(() => ws.close()),
|
|
101
|
+
);
|
|
102
|
+
return {
|
|
103
|
+
url,
|
|
104
|
+
isRunning: Effect.zipWith(
|
|
105
|
+
handle.isRunning,
|
|
106
|
+
Effect.sync(
|
|
107
|
+
() =>
|
|
108
|
+
ws.readyState === WebSocket.CONNECTING ||
|
|
109
|
+
ws.readyState === WebSocket.OPEN,
|
|
110
|
+
),
|
|
111
|
+
(a, b) => a && b,
|
|
112
|
+
{ concurrent: true },
|
|
113
|
+
),
|
|
114
|
+
kill,
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
const register = Effect.fnUntraced(function* (
|
|
119
|
+
payload: RpcSpawnPayload,
|
|
120
|
+
attempt = 0,
|
|
121
|
+
): Effect.fn.Return<string, PlatformError> {
|
|
122
|
+
const child = yield* Cache.get(cache, payload);
|
|
123
|
+
if (yield* child.isRunning) {
|
|
124
|
+
return child.url;
|
|
125
|
+
}
|
|
126
|
+
if (attempt > 3) {
|
|
127
|
+
return yield* Effect.die(
|
|
128
|
+
new Error(
|
|
129
|
+
`Failed to spawn RPC server for "${payload.serverEntryUrl}" after ${attempt} attempts.`,
|
|
130
|
+
),
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
yield* child.kill;
|
|
134
|
+
yield* Cache.invalidate(cache, payload);
|
|
135
|
+
return yield* register(payload, attempt + 1);
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const server = yield* HttpServer.HttpServer;
|
|
139
|
+
|
|
140
|
+
yield* server.serve(
|
|
141
|
+
Effect.gen(function* () {
|
|
142
|
+
const request = yield* HttpServerRequest;
|
|
143
|
+
const payload = (yield* request.json) as unknown as RpcSpawnPayload;
|
|
144
|
+
const url = yield* register(payload);
|
|
145
|
+
return HttpServerResponse.text(url);
|
|
146
|
+
}),
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
return RpcSpawner.of({
|
|
150
|
+
url: HttpServer.formatAddress(server.address),
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
export const layerServer = (
|
|
155
|
+
environment: Pick<RpcServerEnvironment, "profile" | "envFile">,
|
|
156
|
+
) =>
|
|
157
|
+
Layer.effect(RpcSpawner, make(environment)).pipe(Layer.provide(httpServer()));
|
|
158
|
+
|
|
159
|
+
const RPC_ADDRESS_REGEX =
|
|
160
|
+
/(<ALCHEMY_RPC_ADDRESS>)(.+)(<\/ALCHEMY_RPC_ADDRESS>)/;
|
|
161
|
+
|
|
162
|
+
const getRpcAddress = (stdout: Stream.Stream<Uint8Array, PlatformError>) =>
|
|
163
|
+
Effect.gen(function* () {
|
|
164
|
+
const address = yield* Deferred.make<string>();
|
|
165
|
+
let done = false;
|
|
166
|
+
yield* stdout.pipe(
|
|
167
|
+
Stream.decodeText,
|
|
168
|
+
Stream.splitLines,
|
|
169
|
+
Stream.runForEach((line) => {
|
|
170
|
+
if (done) {
|
|
171
|
+
console.log(line);
|
|
172
|
+
} else {
|
|
173
|
+
const match = line.match(RPC_ADDRESS_REGEX);
|
|
174
|
+
if (match) {
|
|
175
|
+
done = true;
|
|
176
|
+
return Deferred.succeed(address, match[2]);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return Effect.void;
|
|
180
|
+
}),
|
|
181
|
+
Effect.forkScoped,
|
|
182
|
+
);
|
|
183
|
+
return yield* Deferred.await(address);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const killProcessGroup = (pid: number, signal: NodeJS.Signals) => {
|
|
187
|
+
try {
|
|
188
|
+
if (process.platform === "win32") {
|
|
189
|
+
NodeChildProcess.execSync(`taskkill /pid ${pid} /T /F`);
|
|
190
|
+
} else {
|
|
191
|
+
process.kill(-pid, signal);
|
|
192
|
+
}
|
|
193
|
+
} catch {
|
|
194
|
+
// ignore errors during best-effort cleanup
|
|
195
|
+
}
|
|
196
|
+
};
|
package/src/Neon/Branch.ts
CHANGED
|
@@ -18,7 +18,7 @@ import { applyMigrations, runSql } from "./Migrations.ts";
|
|
|
18
18
|
import { parsePostgresOrigin, type PostgresOrigin } from "./PostgresOrigin.ts";
|
|
19
19
|
import { type Project, waitForOperations } from "./Project.ts";
|
|
20
20
|
import type { Providers } from "./Providers.ts";
|
|
21
|
-
import { listSqlFiles, readSqlFile } from "
|
|
21
|
+
import { listSqlFiles, readSqlFile } from "../Sql/SqlFile.ts";
|
|
22
22
|
|
|
23
23
|
const findBranchByName = (projectId: string, name: string) =>
|
|
24
24
|
Effect.gen(function* () {
|
package/src/Neon/Migrations.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as Data from "effect/Data";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Redacted from "effect/Redacted";
|
|
4
4
|
import { Client } from "pg";
|
|
5
|
-
import type { SqlFile } from "
|
|
5
|
+
import type { SqlFile } from "../Sql/SqlFile.ts";
|
|
6
6
|
|
|
7
7
|
export class PgError extends Data.TaggedError("PgError")<{
|
|
8
8
|
message: string;
|
package/src/Neon/Project.ts
CHANGED
|
@@ -24,7 +24,12 @@ import { Resource } from "../Resource.ts";
|
|
|
24
24
|
import { applyMigrations, runSql } from "./Migrations.ts";
|
|
25
25
|
import { parsePostgresOrigin, type PostgresOrigin } from "./PostgresOrigin.ts";
|
|
26
26
|
import type { Providers } from "./Providers.ts";
|
|
27
|
-
import {
|
|
27
|
+
import {
|
|
28
|
+
listSqlFiles,
|
|
29
|
+
readSqlFile,
|
|
30
|
+
hashMigrations,
|
|
31
|
+
hashImports,
|
|
32
|
+
} from "../Sql/SqlFile.ts";
|
|
28
33
|
|
|
29
34
|
type NeonOperationStatus =
|
|
30
35
|
| "scheduling"
|
|
@@ -638,25 +643,6 @@ const runImports = (
|
|
|
638
643
|
return hashes;
|
|
639
644
|
});
|
|
640
645
|
|
|
641
|
-
const hashMigrations = (migrationsDir: string) =>
|
|
642
|
-
listSqlFiles(migrationsDir).pipe(
|
|
643
|
-
Effect.map((files) => {
|
|
644
|
-
const hashes: Record<string, string> = {};
|
|
645
|
-
for (const file of files) hashes[file.id] = file.hash;
|
|
646
|
-
return hashes;
|
|
647
|
-
}),
|
|
648
|
-
);
|
|
649
|
-
|
|
650
|
-
const hashImports = (importFiles: ReadonlyArray<string>, rootDir: string) =>
|
|
651
|
-
Effect.gen(function* () {
|
|
652
|
-
const hashes: Record<string, string> = {};
|
|
653
|
-
for (const filePath of importFiles) {
|
|
654
|
-
const file = yield* readSqlFile(rootDir, filePath);
|
|
655
|
-
hashes[filePath] = file.hash;
|
|
656
|
-
}
|
|
657
|
-
return hashes;
|
|
658
|
-
});
|
|
659
|
-
|
|
660
646
|
const recordsEqual = (
|
|
661
647
|
a: Record<string, string>,
|
|
662
648
|
b: Record<string, string>,
|