alchemy 2.0.0-beta.65 → 2.0.0-beta.67
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 +578 -224
- package/bin/exec.js.map +1 -1
- package/lib/AWS/ApiGateway/common.d.ts.map +1 -1
- package/lib/AWS/ApiGateway/common.js +8 -1
- package/lib/AWS/ApiGateway/common.js.map +1 -1
- package/lib/AWS/Bedrock/LanguageModel.d.ts +208 -0
- package/lib/AWS/Bedrock/LanguageModel.d.ts.map +1 -0
- package/lib/AWS/Bedrock/LanguageModel.js +508 -0
- package/lib/AWS/Bedrock/LanguageModel.js.map +1 -0
- package/lib/AWS/Bedrock/LanguageModelHttp.d.ts +10 -0
- package/lib/AWS/Bedrock/LanguageModelHttp.d.ts.map +1 -0
- package/lib/AWS/Bedrock/LanguageModelHttp.js +26 -0
- package/lib/AWS/Bedrock/LanguageModelHttp.js.map +1 -0
- package/lib/AWS/Bedrock/index.d.ts +2 -0
- package/lib/AWS/Bedrock/index.d.ts.map +1 -1
- package/lib/AWS/Bedrock/index.js +2 -0
- package/lib/AWS/Bedrock/index.js.map +1 -1
- package/lib/AWS/CloudFront/Distribution.d.ts +24 -0
- package/lib/AWS/CloudFront/Distribution.d.ts.map +1 -1
- package/lib/AWS/CloudFront/Distribution.js +89 -4
- package/lib/AWS/CloudFront/Distribution.js.map +1 -1
- package/lib/AWS/CostExplorer/AnomalyMonitor.d.ts +1 -1
- package/lib/AWS/CostExplorer/AnomalyMonitor.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/AnomalySubscription.d.ts +1 -1
- package/lib/AWS/CostExplorer/AnomalySubscription.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/BindingHttp.d.ts +3 -3
- package/lib/AWS/CostExplorer/BindingHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/CostCategory.d.ts +1 -1
- package/lib/AWS/CostExplorer/CostCategory.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetAnomaliesHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetAnomaliesHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetApproximateUsageRecordsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetApproximateUsageRecordsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCommitmentPurchaseAnalysisHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCommitmentPurchaseAnalysisHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageComparisonsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageComparisonsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageWithResourcesHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostAndUsageWithResourcesHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostCategoriesHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostCategoriesHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostComparisonDriversHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostComparisonDriversHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetCostForecastHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetCostForecastHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetDimensionValuesHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetDimensionValuesHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetReservationCoverageHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetReservationCoverageHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetReservationPurchaseRecommendationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetReservationPurchaseRecommendationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetReservationUtilizationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetReservationUtilizationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetRightsizingRecommendationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetRightsizingRecommendationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlanPurchaseRecommendationDetailsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlanPurchaseRecommendationDetailsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansCoverageHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansCoverageHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansPurchaseRecommendationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansPurchaseRecommendationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationDetailsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationDetailsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetSavingsPlansUtilizationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetTagsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetTagsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/GetUsageForecastHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/GetUsageForecastHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ListCommitmentPurchaseAnalysesHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ListCommitmentPurchaseAnalysesHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ListCostAllocationTagBackfillHistoryHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ListCostAllocationTagBackfillHistoryHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ListCostAllocationTagsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ListCostAllocationTagsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ListCostCategoryResourceAssociationsHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ListCostCategoryResourceAssociationsHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ListSavingsPlansPurchaseRecommendationGenerationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ListSavingsPlansPurchaseRecommendationGenerationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/ProvideAnomalyFeedbackHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/ProvideAnomalyFeedbackHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/StartCommitmentPurchaseAnalysisHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/StartCommitmentPurchaseAnalysisHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/StartCostAllocationTagBackfillHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/StartCostAllocationTagBackfillHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/StartSavingsPlansPurchaseRecommendationGenerationHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/StartSavingsPlansPurchaseRecommendationGenerationHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/UpdateCostAllocationTagsStatusHttp.d.ts +1 -1
- package/lib/AWS/CostExplorer/UpdateCostAllocationTagsStatusHttp.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/common.d.ts +5 -3
- package/lib/AWS/CostExplorer/common.d.ts.map +1 -1
- package/lib/AWS/CostExplorer/common.js +16 -1
- package/lib/AWS/CostExplorer/common.js.map +1 -1
- package/lib/AWS/DataSync/Task.d.ts.map +1 -1
- package/lib/AWS/DataSync/Task.js +16 -2
- package/lib/AWS/DataSync/Task.js.map +1 -1
- package/lib/AWS/EC2/Vpc.d.ts.map +1 -1
- package/lib/AWS/EC2/Vpc.js +15 -2
- package/lib/AWS/EC2/Vpc.js.map +1 -1
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js +10 -2
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECR/Image.d.ts +132 -13
- package/lib/AWS/ECR/Image.d.ts.map +1 -1
- package/lib/AWS/ECR/ImageSource.d.ts.map +1 -1
- package/lib/AWS/ECR/ImageSource.js +10 -2
- package/lib/AWS/ECR/ImageSource.js.map +1 -1
- package/lib/AWS/ECR/Repository.d.ts +2 -0
- package/lib/AWS/ECR/Repository.d.ts.map +1 -1
- package/lib/AWS/ECR/Repository.js +28 -3
- package/lib/AWS/ECR/Repository.js.map +1 -1
- package/lib/AWS/ECS/Service.d.ts +27 -1
- package/lib/AWS/ECS/Service.d.ts.map +1 -1
- package/lib/AWS/ECS/Service.js +184 -22
- package/lib/AWS/ECS/Service.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts +32 -8
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +62 -29
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/EKS/Deployment.d.ts.map +1 -1
- package/lib/AWS/EKS/Deployment.js +10 -2
- package/lib/AWS/EKS/Deployment.js.map +1 -1
- package/lib/AWS/EKS/Job.d.ts.map +1 -1
- package/lib/AWS/EKS/Job.js +10 -2
- package/lib/AWS/EKS/Job.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +15 -0
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +67 -29
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/HttpServer.d.ts.map +1 -1
- package/lib/AWS/Lambda/HttpServer.js +7 -1
- package/lib/AWS/Lambda/HttpServer.js.map +1 -1
- package/lib/AWS/Lambda/LayerVersion.d.ts +176 -0
- package/lib/AWS/Lambda/LayerVersion.d.ts.map +1 -0
- package/lib/AWS/Lambda/LayerVersion.js +288 -0
- package/lib/AWS/Lambda/LayerVersion.js.map +1 -0
- package/lib/AWS/Lambda/MicrovmBundle.d.ts.map +1 -1
- package/lib/AWS/Lambda/MicrovmBundle.js +10 -2
- package/lib/AWS/Lambda/MicrovmBundle.js.map +1 -1
- package/lib/AWS/Lambda/index.d.ts +1 -0
- package/lib/AWS/Lambda/index.d.ts.map +1 -1
- package/lib/AWS/Lambda/index.js +1 -0
- package/lib/AWS/Lambda/index.js.map +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +6 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/SES/ActiveReceiptRuleSet.d.ts +40 -0
- package/lib/AWS/SES/ActiveReceiptRuleSet.d.ts.map +1 -0
- package/lib/AWS/SES/ActiveReceiptRuleSet.js +58 -0
- package/lib/AWS/SES/ActiveReceiptRuleSet.js.map +1 -0
- package/lib/AWS/SES/ReceiptFilter.d.ts +67 -0
- package/lib/AWS/SES/ReceiptFilter.d.ts.map +1 -0
- package/lib/AWS/SES/ReceiptFilter.js +92 -0
- package/lib/AWS/SES/ReceiptFilter.js.map +1 -0
- package/lib/AWS/SES/ReceiptRule.d.ts +133 -0
- package/lib/AWS/SES/ReceiptRule.d.ts.map +1 -0
- package/lib/AWS/SES/ReceiptRule.js +178 -0
- package/lib/AWS/SES/ReceiptRule.js.map +1 -0
- package/lib/AWS/SES/ReceiptRuleSet.d.ts +55 -0
- package/lib/AWS/SES/ReceiptRuleSet.d.ts.map +1 -0
- package/lib/AWS/SES/ReceiptRuleSet.js +112 -0
- package/lib/AWS/SES/ReceiptRuleSet.js.map +1 -0
- package/lib/AWS/SES/SendBounce.d.ts +37 -0
- package/lib/AWS/SES/SendBounce.d.ts.map +1 -0
- package/lib/AWS/SES/SendBounce.js +3 -0
- package/lib/AWS/SES/SendBounce.js.map +1 -0
- package/lib/AWS/SES/SendBounceHttp.d.ts +4 -0
- package/lib/AWS/SES/SendBounceHttp.d.ts.map +1 -0
- package/lib/AWS/SES/SendBounceHttp.js +10 -0
- package/lib/AWS/SES/SendBounceHttp.js.map +1 -0
- package/lib/AWS/SES/index.d.ts +6 -0
- package/lib/AWS/SES/index.d.ts.map +1 -1
- package/lib/AWS/SES/index.js +6 -0
- package/lib/AWS/SES/index.js.map +1 -1
- package/lib/AWS/StateStore/State.d.ts +11 -0
- package/lib/AWS/StateStore/State.d.ts.map +1 -1
- package/lib/AWS/StateStore/State.js +117 -38
- package/lib/AWS/StateStore/State.js.map +1 -1
- package/lib/Apply.d.ts +37 -1
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +270 -194
- package/lib/Apply.js.map +1 -1
- package/lib/Axiom/Telemetry.d.ts +66 -0
- package/lib/Axiom/Telemetry.d.ts.map +1 -0
- package/lib/Axiom/Telemetry.js +69 -0
- package/lib/Axiom/Telemetry.js.map +1 -0
- package/lib/Axiom/index.d.ts +1 -0
- package/lib/Axiom/index.d.ts.map +1 -1
- package/lib/Axiom/index.js +1 -0
- package/lib/Axiom/index.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +1 -1
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +14 -6
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.js +10 -5
- package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -1
- package/lib/Bundle/PurePlugin.d.ts +1 -1
- package/lib/Bundle/PurePlugin.d.ts.map +1 -1
- package/lib/Bundle/PurePlugin.js +15 -7
- package/lib/Bundle/PurePlugin.js.map +1 -1
- package/lib/Cli/checkVersion.d.ts +11 -5
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +73 -12
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +2 -1
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/cloudflare.d.ts +1 -1
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +3 -11
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +3 -1
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/tail.d.ts.map +1 -1
- package/lib/Cli/commands/tail.js +3 -1
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +5 -4
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cloudflare/AI/Search.d.ts +4 -15
- package/lib/Cloudflare/AI/Search.d.ts.map +1 -1
- package/lib/Cloudflare/AI/Search.js +4 -6
- package/lib/Cloudflare/AI/Search.js.map +1 -1
- package/lib/Cloudflare/AI/SearchInstance.d.ts +7 -26
- package/lib/Cloudflare/AI/SearchInstance.d.ts.map +1 -1
- package/lib/Cloudflare/AI/SearchInstance.js +7 -26
- package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
- package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts +3 -0
- package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
- package/lib/Cloudflare/ApiToken/AccountApiToken.js +3 -0
- package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +8 -3
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.d.ts +5 -0
- package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.js +50 -4
- package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
- package/lib/Cloudflare/Containers/Container.d.ts +81 -3
- package/lib/Cloudflare/Containers/Container.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/Container.js +70 -0
- package/lib/Cloudflare/Containers/Container.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts +22 -1
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.js +4 -1
- package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerBundle.js +10 -2
- package/lib/Cloudflare/Containers/ContainerBundle.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerProvider.js +43 -0
- package/lib/Cloudflare/Containers/ContainerProvider.js.map +1 -1
- package/lib/Cloudflare/Credentials.d.ts +21 -1
- package/lib/Cloudflare/Credentials.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.js +52 -9
- package/lib/Cloudflare/Credentials.js.map +1 -1
- package/lib/Cloudflare/D1/ApplyMigrations.d.ts +30 -5
- package/lib/Cloudflare/D1/ApplyMigrations.d.ts.map +1 -1
- package/lib/Cloudflare/D1/ApplyMigrations.js +36 -26
- package/lib/Cloudflare/D1/ApplyMigrations.js.map +1 -1
- package/lib/Cloudflare/D1/Database.d.ts +18 -1
- package/lib/Cloudflare/D1/Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/Database.js +134 -2
- package/lib/Cloudflare/D1/Database.js.map +1 -1
- package/lib/Cloudflare/D1/LocalD1Gateway.d.ts +39 -0
- package/lib/Cloudflare/D1/LocalD1Gateway.d.ts.map +1 -0
- package/lib/Cloudflare/D1/LocalD1Gateway.js +100 -0
- package/lib/Cloudflare/D1/LocalD1Gateway.js.map +1 -0
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts +31 -0
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.d.ts.map +1 -1
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js +13 -6
- package/lib/Cloudflare/D1/QueryDatabaseHttpClient.js.map +1 -1
- package/lib/Cloudflare/D1/QueryDatabaseLocal.d.ts.map +1 -1
- package/lib/Cloudflare/D1/QueryDatabaseLocal.js +21 -2
- package/lib/Cloudflare/D1/QueryDatabaseLocal.js.map +1 -1
- package/lib/Cloudflare/DNS/Record.d.ts +3 -1
- package/lib/Cloudflare/DNS/Record.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/Record.js +23 -4
- package/lib/Cloudflare/DNS/Record.js.map +1 -1
- package/lib/Cloudflare/Email/Address.d.ts.map +1 -1
- package/lib/Cloudflare/Email/Address.js +15 -1
- package/lib/Cloudflare/Email/Address.js.map +1 -1
- package/lib/Cloudflare/Email/SendBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendBinding.js +1 -0
- package/lib/Cloudflare/Email/SendBinding.js.map +1 -1
- package/lib/Cloudflare/Email/SendEmail.d.ts +12 -0
- package/lib/Cloudflare/Email/SendEmail.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendEmail.js +1 -0
- package/lib/Cloudflare/Email/SendEmail.js.map +1 -1
- package/lib/Cloudflare/Flagship/App.d.ts.map +1 -1
- package/lib/Cloudflare/Flagship/App.js +8 -3
- package/lib/Cloudflare/Flagship/App.js.map +1 -1
- package/lib/Cloudflare/KV/LocalKVGateway.d.ts +15 -0
- package/lib/Cloudflare/KV/LocalKVGateway.d.ts.map +1 -0
- package/lib/Cloudflare/KV/LocalKVGateway.js +64 -0
- package/lib/Cloudflare/KV/LocalKVGateway.js.map +1 -0
- package/lib/Cloudflare/KV/Namespace.d.ts +9 -1
- package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -1
- package/lib/Cloudflare/KV/Namespace.js +45 -1
- package/lib/Cloudflare/KV/Namespace.js.map +1 -1
- package/lib/Cloudflare/KV/NamespaceLocal.d.ts +16 -5
- package/lib/Cloudflare/KV/NamespaceLocal.d.ts.map +1 -1
- package/lib/Cloudflare/KV/NamespaceLocal.js +21 -4
- package/lib/Cloudflare/KV/NamespaceLocal.js.map +1 -1
- package/lib/Cloudflare/KV/ReadNamespaceLocal.d.ts.map +1 -1
- package/lib/Cloudflare/KV/ReadNamespaceLocal.js +5 -1
- package/lib/Cloudflare/KV/ReadNamespaceLocal.js.map +1 -1
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.d.ts.map +1 -1
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js +5 -1
- package/lib/Cloudflare/KV/ReadWriteNamespaceLocal.js.map +1 -1
- package/lib/Cloudflare/KV/WriteNamespaceLocal.d.ts.map +1 -1
- package/lib/Cloudflare/KV/WriteNamespaceLocal.js +5 -1
- package/lib/Cloudflare/KV/WriteNamespaceLocal.js.map +1 -1
- package/lib/Cloudflare/LocalGateway.d.ts +25 -0
- package/lib/Cloudflare/LocalGateway.d.ts.map +1 -0
- package/lib/Cloudflare/LocalGateway.js +70 -0
- package/lib/Cloudflare/LocalGateway.js.map +1 -0
- package/lib/Cloudflare/LocalRuntime.d.ts +14 -1
- package/lib/Cloudflare/LocalRuntime.d.ts.map +1 -1
- package/lib/Cloudflare/LocalRuntime.js +16 -1
- package/lib/Cloudflare/LocalRuntime.js.map +1 -1
- package/lib/Cloudflare/Logs.d.ts.map +1 -1
- package/lib/Cloudflare/Logs.js +18 -6
- package/lib/Cloudflare/Logs.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts +1 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +6 -2
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.d.ts +16 -3
- package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.js +51 -3
- package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
- package/lib/Cloudflare/Queues/Queue.d.ts +4 -3
- package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Queue.js +7 -17
- package/lib/Cloudflare/Queues/Queue.js.map +1 -1
- package/lib/Cloudflare/Queues/QueueBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/QueueBinding.js +19 -0
- package/lib/Cloudflare/Queues/QueueBinding.js.map +1 -1
- package/lib/Cloudflare/Queues/QueueShim.d.ts +55 -0
- package/lib/Cloudflare/Queues/QueueShim.d.ts.map +1 -0
- package/lib/Cloudflare/Queues/QueueShim.js +177 -0
- package/lib/Cloudflare/Queues/QueueShim.js.map +1 -0
- package/lib/Cloudflare/R2/Bucket.d.ts +14 -1
- package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/Bucket.js +53 -1
- package/lib/Cloudflare/R2/Bucket.js.map +1 -1
- package/lib/Cloudflare/R2/BucketBinding.d.ts +10 -0
- package/lib/Cloudflare/R2/BucketBinding.d.ts.map +1 -1
- package/lib/Cloudflare/R2/BucketBinding.js +14 -3
- package/lib/Cloudflare/R2/BucketBinding.js.map +1 -1
- package/lib/Cloudflare/R2/BucketLocal.d.ts +13 -6
- package/lib/Cloudflare/R2/BucketLocal.d.ts.map +1 -1
- package/lib/Cloudflare/R2/BucketLocal.js +19 -6
- package/lib/Cloudflare/R2/BucketLocal.js.map +1 -1
- package/lib/Cloudflare/R2/LocalR2Gateway.d.ts +15 -0
- package/lib/Cloudflare/R2/LocalR2Gateway.d.ts.map +1 -0
- package/lib/Cloudflare/R2/LocalR2Gateway.js +65 -0
- package/lib/Cloudflare/R2/LocalR2Gateway.js.map +1 -0
- package/lib/Cloudflare/R2/ReadBucketLocal.d.ts.map +1 -1
- package/lib/Cloudflare/R2/ReadBucketLocal.js +5 -1
- package/lib/Cloudflare/R2/ReadBucketLocal.js.map +1 -1
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.d.ts.map +1 -1
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.js +5 -1
- package/lib/Cloudflare/R2/ReadWriteBucketLocal.js.map +1 -1
- package/lib/Cloudflare/R2/WriteBucketLocal.d.ts.map +1 -1
- package/lib/Cloudflare/R2/WriteBucketLocal.js +5 -1
- package/lib/Cloudflare/R2/WriteBucketLocal.js.map +1 -1
- package/lib/Cloudflare/Ruleset/AccountEntrypoint.d.ts.map +1 -1
- package/lib/Cloudflare/Ruleset/AccountEntrypoint.js +5 -1
- package/lib/Cloudflare/Ruleset/AccountEntrypoint.js.map +1 -1
- package/lib/Cloudflare/Ruleset/Ruleset.d.ts.map +1 -1
- package/lib/Cloudflare/Ruleset/Ruleset.js +19 -6
- package/lib/Cloudflare/Ruleset/Ruleset.js.map +1 -1
- package/lib/Cloudflare/Rum/Site.js +10 -2
- package/lib/Cloudflare/Rum/Site.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +31 -2
- package/lib/Cloudflare/StateStore/Api.js +1 -1
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js +20 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts +34 -7
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +108 -24
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts +33 -19
- package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Vite.js +33 -19
- package/lib/Cloudflare/Website/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Compatibility.js +26 -7
- package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.d.ts +22 -0
- package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.js +22 -0
- package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +20 -5
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +4 -2
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +7 -3
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +483 -298
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +612 -13
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +222 -1
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +13 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +171 -21
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +130 -28
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts +6 -2
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +18 -2
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +4 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts +186 -11
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.js +1765 -236
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts +7 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.js +14 -4
- package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
- package/lib/Command/Build.d.ts +2 -2
- package/lib/Command/Build.d.ts.map +1 -1
- package/lib/Command/Build.js +4 -7
- package/lib/Command/Build.js.map +1 -1
- package/lib/Command/Command.d.ts +34 -4
- package/lib/Command/Command.d.ts.map +1 -1
- package/lib/Command/Command.js +125 -30
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +2 -2
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +51 -73
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Exec.d.ts +11 -2
- package/lib/Command/Exec.d.ts.map +1 -1
- package/lib/Command/Exec.js +9 -0
- package/lib/Command/Exec.js.map +1 -1
- package/lib/Command/Memo.d.ts +9 -1
- package/lib/Command/Memo.d.ts.map +1 -1
- package/lib/Command/Memo.js +14 -2
- package/lib/Command/Memo.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Command/Redaction.d.ts +10 -0
- package/lib/Command/Redaction.d.ts.map +1 -0
- package/lib/Command/Redaction.js +119 -0
- package/lib/Command/Redaction.js.map +1 -0
- package/lib/Deploy.d.ts +2 -1
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Destroy.d.ts +2 -1
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +1 -9
- package/lib/Destroy.js.map +1 -1
- package/lib/Docker/Container.d.ts +15 -1
- package/lib/Docker/Container.d.ts.map +1 -1
- package/lib/Docker/Container.js +34 -11
- package/lib/Docker/Container.js.map +1 -1
- package/lib/Docker/Context.d.ts +84 -0
- package/lib/Docker/Context.d.ts.map +1 -0
- package/lib/Docker/Context.js +145 -0
- package/lib/Docker/Context.js.map +1 -0
- package/lib/Docker/Docker.d.ts +190 -14
- package/lib/Docker/Docker.d.ts.map +1 -1
- package/lib/Docker/Docker.js +149 -28
- package/lib/Docker/Docker.js.map +1 -1
- package/lib/Docker/Image.d.ts +12 -0
- package/lib/Docker/Image.d.ts.map +1 -1
- package/lib/Docker/Image.js +24 -7
- package/lib/Docker/Image.js.map +1 -1
- package/lib/Docker/Network.d.ts +7 -0
- package/lib/Docker/Network.d.ts.map +1 -1
- package/lib/Docker/Network.js +16 -7
- package/lib/Docker/Network.js.map +1 -1
- package/lib/Docker/Providers.d.ts +1 -1
- package/lib/Docker/Providers.d.ts.map +1 -1
- package/lib/Docker/Providers.js +13 -1
- package/lib/Docker/Providers.js.map +1 -1
- package/lib/Docker/RemoteImage.d.ts +12 -0
- package/lib/Docker/RemoteImage.d.ts.map +1 -1
- package/lib/Docker/RemoteImage.js +22 -8
- package/lib/Docker/RemoteImage.js.map +1 -1
- package/lib/Docker/Service.d.ts +445 -0
- package/lib/Docker/Service.d.ts.map +1 -0
- package/lib/Docker/Service.js +578 -0
- package/lib/Docker/Service.js.map +1 -0
- package/lib/Docker/ServiceImage.d.ts +78 -0
- package/lib/Docker/ServiceImage.d.ts.map +1 -0
- package/lib/Docker/ServiceImage.js +232 -0
- package/lib/Docker/ServiceImage.js.map +1 -0
- package/lib/Docker/Swarm.d.ts +117 -0
- package/lib/Docker/Swarm.d.ts.map +1 -0
- package/lib/Docker/Swarm.js +149 -0
- package/lib/Docker/Swarm.js.map +1 -0
- package/lib/Docker/Volume.d.ts +11 -0
- package/lib/Docker/Volume.d.ts.map +1 -1
- package/lib/Docker/Volume.js +21 -6
- package/lib/Docker/Volume.js.map +1 -1
- package/lib/Docker/index.d.ts +3 -0
- package/lib/Docker/index.d.ts.map +1 -1
- package/lib/Docker/index.js +3 -0
- package/lib/Docker/index.js.map +1 -1
- package/lib/Http.d.ts +8 -1
- package/lib/Http.d.ts.map +1 -1
- package/lib/Http.js +7 -2
- package/lib/Http.js.map +1 -1
- package/lib/Local/LocalProvider.d.ts +182 -0
- package/lib/Local/LocalProvider.d.ts.map +1 -0
- package/lib/Local/LocalProvider.js +226 -0
- package/lib/Local/LocalProvider.js.map +1 -0
- package/lib/Local/ProviderLayer.d.ts +43 -2
- package/lib/Local/ProviderLayer.d.ts.map +1 -1
- package/lib/Local/ProviderLayer.js +80 -2
- package/lib/Local/ProviderLayer.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts +7 -0
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js +8 -3
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
- package/lib/Local/RpcProviderProxy.js +3 -0
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +8 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +4 -1
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Plan.d.ts +34 -0
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +127 -40
- package/lib/Plan.js.map +1 -1
- package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
- package/lib/Planetscale/AuthProvider.js +6 -2
- package/lib/Planetscale/AuthProvider.js.map +1 -1
- package/lib/Planetscale/Branch.d.ts.map +1 -1
- package/lib/Planetscale/Branch.js +36 -6
- package/lib/Planetscale/Branch.js.map +1 -1
- package/lib/Planetscale/MySQL/MySQLDatabase.d.ts.map +1 -1
- package/lib/Planetscale/MySQL/MySQLDatabase.js +31 -6
- package/lib/Planetscale/MySQL/MySQLDatabase.js.map +1 -1
- package/lib/Planetscale/OAuthClient.d.ts +7 -1
- package/lib/Planetscale/OAuthClient.d.ts.map +1 -1
- package/lib/Planetscale/OAuthClient.js +51 -4
- package/lib/Planetscale/OAuthClient.js.map +1 -1
- package/lib/Planetscale/Postgres/PostgresDatabase.d.ts.map +1 -1
- package/lib/Planetscale/Postgres/PostgresDatabase.js +30 -5
- package/lib/Planetscale/Postgres/PostgresDatabase.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +25 -14
- package/lib/Platform.js.map +1 -1
- package/lib/Prisma/App.d.ts +93 -0
- package/lib/Prisma/App.d.ts.map +1 -0
- package/lib/Prisma/App.js +251 -0
- package/lib/Prisma/App.js.map +1 -0
- package/lib/Prisma/AuthProvider.d.ts +28 -0
- package/lib/Prisma/AuthProvider.d.ts.map +1 -0
- package/lib/Prisma/AuthProvider.js +131 -0
- package/lib/Prisma/AuthProvider.js.map +1 -0
- package/lib/Prisma/Branch.d.ts +96 -0
- package/lib/Prisma/Branch.d.ts.map +1 -0
- package/lib/Prisma/Branch.js +236 -0
- package/lib/Prisma/Branch.js.map +1 -0
- package/lib/Prisma/Client.d.ts +178 -0
- package/lib/Prisma/Client.d.ts.map +1 -0
- package/lib/Prisma/Client.js +562 -0
- package/lib/Prisma/Client.js.map +1 -0
- package/lib/Prisma/Compute.d.ts +585 -0
- package/lib/Prisma/Compute.d.ts.map +1 -0
- package/lib/Prisma/Compute.js +1545 -0
- package/lib/Prisma/Compute.js.map +1 -0
- package/lib/Prisma/ComputeArchive.d.ts +63 -0
- package/lib/Prisma/ComputeArchive.d.ts.map +1 -0
- package/lib/Prisma/ComputeArchive.js +227 -0
- package/lib/Prisma/ComputeArchive.js.map +1 -0
- package/lib/Prisma/ComputeBuild.d.ts +106 -0
- package/lib/Prisma/ComputeBuild.d.ts.map +1 -0
- package/lib/Prisma/ComputeBuild.js +987 -0
- package/lib/Prisma/ComputeBuild.js.map +1 -0
- package/lib/Prisma/ComputeLifecycle.d.ts +84 -0
- package/lib/Prisma/ComputeLifecycle.d.ts.map +1 -0
- package/lib/Prisma/ComputeLifecycle.js +186 -0
- package/lib/Prisma/ComputeLifecycle.js.map +1 -0
- package/lib/Prisma/Connect.d.ts +122 -0
- package/lib/Prisma/Connect.d.ts.map +1 -0
- package/lib/Prisma/Connect.js +187 -0
- package/lib/Prisma/Connect.js.map +1 -0
- package/lib/Prisma/Connection.d.ts +219 -0
- package/lib/Prisma/Connection.d.ts.map +1 -0
- package/lib/Prisma/Connection.js +360 -0
- package/lib/Prisma/Connection.js.map +1 -0
- package/lib/Prisma/CustomDomain.d.ts +91 -0
- package/lib/Prisma/CustomDomain.d.ts.map +1 -0
- package/lib/Prisma/CustomDomain.js +184 -0
- package/lib/Prisma/CustomDomain.js.map +1 -0
- package/lib/Prisma/Database.d.ts +222 -0
- package/lib/Prisma/Database.d.ts.map +1 -0
- package/lib/Prisma/Database.js +418 -0
- package/lib/Prisma/Database.js.map +1 -0
- package/lib/Prisma/Deployment.d.ts +141 -0
- package/lib/Prisma/Deployment.d.ts.map +1 -0
- package/lib/Prisma/Deployment.js +353 -0
- package/lib/Prisma/Deployment.js.map +1 -0
- package/lib/Prisma/EnvironmentVariable.d.ts +105 -0
- package/lib/Prisma/EnvironmentVariable.d.ts.map +1 -0
- package/lib/Prisma/EnvironmentVariable.js +229 -0
- package/lib/Prisma/EnvironmentVariable.js.map +1 -0
- package/lib/Prisma/Internal/AppIdentity.d.ts +10 -0
- package/lib/Prisma/Internal/AppIdentity.d.ts.map +1 -0
- package/lib/Prisma/Internal/AppIdentity.js +6 -0
- package/lib/Prisma/Internal/AppIdentity.js.map +1 -0
- package/lib/Prisma/Internal/AppPromotion.d.ts +19 -0
- package/lib/Prisma/Internal/AppPromotion.d.ts.map +1 -0
- package/lib/Prisma/Internal/AppPromotion.js +107 -0
- package/lib/Prisma/Internal/AppPromotion.js.map +1 -0
- package/lib/Prisma/Internal/ArchivePlatform.d.ts +42 -0
- package/lib/Prisma/Internal/ArchivePlatform.d.ts.map +1 -0
- package/lib/Prisma/Internal/ArchivePlatform.js +214 -0
- package/lib/Prisma/Internal/ArchivePlatform.js.map +1 -0
- package/lib/Prisma/Internal/ArtifactFile.d.ts +58 -0
- package/lib/Prisma/Internal/ArtifactFile.d.ts.map +1 -0
- package/lib/Prisma/Internal/ArtifactFile.js +134 -0
- package/lib/Prisma/Internal/ArtifactFile.js.map +1 -0
- package/lib/Prisma/Internal/ArtifactUpload.d.ts +5 -0
- package/lib/Prisma/Internal/ArtifactUpload.d.ts.map +1 -0
- package/lib/Prisma/Internal/ArtifactUpload.js +51 -0
- package/lib/Prisma/Internal/ArtifactUpload.js.map +1 -0
- package/lib/Prisma/Internal/BundlePaths.d.ts +4 -0
- package/lib/Prisma/Internal/BundlePaths.d.ts.map +1 -0
- package/lib/Prisma/Internal/BundlePaths.js +16 -0
- package/lib/Prisma/Internal/BundlePaths.js.map +1 -0
- package/lib/Prisma/Internal/CleanupFailure.d.ts +8 -0
- package/lib/Prisma/Internal/CleanupFailure.d.ts.map +1 -0
- package/lib/Prisma/Internal/CleanupFailure.js +8 -0
- package/lib/Prisma/Internal/CleanupFailure.js.map +1 -0
- package/lib/Prisma/Internal/DatabaseSecrets.d.ts +35 -0
- package/lib/Prisma/Internal/DatabaseSecrets.d.ts.map +1 -0
- package/lib/Prisma/Internal/DatabaseSecrets.js +85 -0
- package/lib/Prisma/Internal/DatabaseSecrets.js.map +1 -0
- package/lib/Prisma/Internal/DeploymentActions.d.ts +5 -0
- package/lib/Prisma/Internal/DeploymentActions.d.ts.map +1 -0
- package/lib/Prisma/Internal/DeploymentActions.js +16 -0
- package/lib/Prisma/Internal/DeploymentActions.js.map +1 -0
- package/lib/Prisma/Internal/DeploymentIdentity.d.ts +8 -0
- package/lib/Prisma/Internal/DeploymentIdentity.d.ts.map +1 -0
- package/lib/Prisma/Internal/DeploymentIdentity.js +12 -0
- package/lib/Prisma/Internal/DeploymentIdentity.js.map +1 -0
- package/lib/Prisma/Internal/DeploymentObserve.d.ts +3 -0
- package/lib/Prisma/Internal/DeploymentObserve.d.ts.map +1 -0
- package/lib/Prisma/Internal/DeploymentObserve.js +2 -0
- package/lib/Prisma/Internal/DeploymentObserve.js.map +1 -0
- package/lib/Prisma/Internal/EnvName.d.ts +7 -0
- package/lib/Prisma/Internal/EnvName.d.ts.map +1 -0
- package/lib/Prisma/Internal/EnvName.js +23 -0
- package/lib/Prisma/Internal/EnvName.js.map +1 -0
- package/lib/Prisma/Internal/HttpClient.d.ts +21 -0
- package/lib/Prisma/Internal/HttpClient.d.ts.map +1 -0
- package/lib/Prisma/Internal/HttpClient.js +23 -0
- package/lib/Prisma/Internal/HttpClient.js.map +1 -0
- package/lib/Prisma/Operations.d.ts +143 -0
- package/lib/Prisma/Operations.d.ts.map +1 -0
- package/lib/Prisma/Operations.js +75 -0
- package/lib/Prisma/Operations.js.map +1 -0
- package/lib/Prisma/Postgres.d.ts +25 -0
- package/lib/Prisma/Postgres.d.ts.map +1 -0
- package/lib/Prisma/Postgres.js +24 -0
- package/lib/Prisma/Postgres.js.map +1 -0
- package/lib/Prisma/PostgresOrigin.d.ts +31 -0
- package/lib/Prisma/PostgresOrigin.d.ts.map +1 -0
- package/lib/Prisma/PostgresOrigin.js +30 -0
- package/lib/Prisma/PostgresOrigin.js.map +1 -0
- package/lib/Prisma/PrismaDevDatabase.d.ts +25 -0
- package/lib/Prisma/PrismaDevDatabase.d.ts.map +1 -0
- package/lib/Prisma/PrismaDevDatabase.js +280 -0
- package/lib/Prisma/PrismaDevDatabase.js.map +1 -0
- package/lib/Prisma/PrismaEnvironment.d.ts +14 -0
- package/lib/Prisma/PrismaEnvironment.d.ts.map +1 -0
- package/lib/Prisma/PrismaEnvironment.js +50 -0
- package/lib/Prisma/PrismaEnvironment.js.map +1 -0
- package/lib/Prisma/PrismaLogs.d.ts +42 -0
- package/lib/Prisma/PrismaLogs.d.ts.map +1 -0
- package/lib/Prisma/PrismaLogs.js +318 -0
- package/lib/Prisma/PrismaLogs.js.map +1 -0
- package/lib/Prisma/Project.d.ts +123 -0
- package/lib/Prisma/Project.d.ts.map +1 -0
- package/lib/Prisma/Project.js +366 -0
- package/lib/Prisma/Project.js.map +1 -0
- package/lib/Prisma/Providers.d.ts +63 -0
- package/lib/Prisma/Providers.d.ts.map +1 -0
- package/lib/Prisma/Providers.js +306 -0
- package/lib/Prisma/Providers.js.map +1 -0
- package/lib/Prisma/Refs.d.ts +19 -0
- package/lib/Prisma/Refs.d.ts.map +1 -0
- package/lib/Prisma/Refs.js +25 -0
- package/lib/Prisma/Refs.js.map +1 -0
- package/lib/Prisma/SourceRepository.d.ts +127 -0
- package/lib/Prisma/SourceRepository.d.ts.map +1 -0
- package/lib/Prisma/SourceRepository.js +239 -0
- package/lib/Prisma/SourceRepository.js.map +1 -0
- package/lib/Prisma/Types.d.ts +539 -0
- package/lib/Prisma/Types.d.ts.map +1 -0
- package/lib/Prisma/Types.js +13 -0
- package/lib/Prisma/Types.js.map +1 -0
- package/lib/Prisma/index.d.ts +25 -0
- package/lib/Prisma/index.d.ts.map +1 -0
- package/lib/Prisma/index.js +24 -0
- package/lib/Prisma/index.js.map +1 -0
- package/lib/Provider.d.ts +57 -5
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +54 -30
- package/lib/Provider.js.map +1 -1
- package/lib/ProviderMode.d.ts +93 -0
- package/lib/ProviderMode.d.ts.map +1 -0
- package/lib/ProviderMode.js +77 -0
- package/lib/ProviderMode.js.map +1 -0
- package/lib/Resource.d.ts +8 -0
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +31 -0
- package/lib/Resource.js.map +1 -1
- package/lib/RuntimeContext.d.ts +7 -0
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Server/Process.d.ts +8 -0
- package/lib/Server/Process.d.ts.map +1 -1
- package/lib/Server/Process.js +29 -0
- package/lib/Server/Process.js.map +1 -1
- package/lib/State/InMemoryState.d.ts.map +1 -1
- package/lib/State/InMemoryState.js +2 -0
- package/lib/State/InMemoryState.js.map +1 -1
- package/lib/State/ResourceState.d.ts +18 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/Sync.d.ts.map +1 -1
- package/lib/Sync.js +8 -2
- package/lib/Sync.js.map +1 -1
- package/lib/Telemetry.d.ts +150 -0
- package/lib/Telemetry.d.ts.map +1 -0
- package/lib/Telemetry.js +512 -0
- package/lib/Telemetry.js.map +1 -0
- package/lib/Test/Alchemy.d.ts.map +1 -1
- package/lib/Test/Alchemy.js +3 -1
- package/lib/Test/Alchemy.js.map +1 -1
- package/lib/Test/Core.d.ts +2 -2
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +1 -8
- package/lib/Test/Core.js.map +1 -1
- package/lib/Util/Clank.d.ts +11 -6
- package/lib/Util/Clank.d.ts.map +1 -1
- package/lib/Util/Clank.js +22 -9
- package/lib/Util/Clank.js.map +1 -1
- package/lib/Util/zip.d.ts +11 -0
- package/lib/Util/zip.d.ts.map +1 -1
- package/lib/Util/zip.js +30 -0
- package/lib/Util/zip.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -0
- package/lib/index.js.map +1 -1
- package/package.json +46 -13
- package/src/AWS/ApiGateway/common.ts +9 -0
- package/src/AWS/Bedrock/LanguageModel.ts +883 -0
- package/src/AWS/Bedrock/LanguageModelHttp.ts +36 -0
- package/src/AWS/Bedrock/index.ts +2 -0
- package/src/AWS/CloudFront/Distribution.ts +116 -6
- package/src/AWS/CostExplorer/common.ts +23 -2
- package/src/AWS/DataSync/Task.ts +30 -15
- package/src/AWS/EC2/Vpc.ts +35 -21
- package/src/AWS/EC2/hosted.ts +10 -2
- package/src/AWS/ECR/ImageSource.ts +10 -2
- package/src/AWS/ECR/Repository.ts +39 -4
- package/src/AWS/ECS/Service.ts +322 -22
- package/src/AWS/ECS/Task.ts +82 -32
- package/src/AWS/EKS/Deployment.ts +10 -2
- package/src/AWS/EKS/Job.ts +10 -2
- package/src/AWS/Lambda/Function.ts +101 -43
- package/src/AWS/Lambda/HttpServer.ts +7 -1
- package/src/AWS/Lambda/LayerVersion.ts +490 -0
- package/src/AWS/Lambda/MicrovmBundle.ts +10 -2
- package/src/AWS/Lambda/index.ts +1 -0
- package/src/AWS/Providers.ts +10 -0
- package/src/AWS/SES/ActiveReceiptRuleSet.ts +88 -0
- package/src/AWS/SES/ReceiptFilter.ts +169 -0
- package/src/AWS/SES/ReceiptRule.ts +300 -0
- package/src/AWS/SES/ReceiptRuleSet.ts +164 -0
- package/src/AWS/SES/SendBounce.ts +44 -0
- package/src/AWS/SES/SendBounceHttp.ts +13 -0
- package/src/AWS/SES/index.ts +6 -0
- package/src/AWS/StateStore/State.ts +159 -42
- package/src/Apply.ts +199 -83
- package/src/Axiom/Telemetry.ts +119 -0
- package/src/Axiom/index.ts +1 -0
- package/src/Bundle/Bundle.ts +17 -7
- package/src/Bundle/BundleAnalyzerPlugin.ts +9 -4
- package/src/Bundle/PurePlugin.ts +19 -9
- package/src/Cli/checkVersion.ts +102 -16
- package/src/Cli/commands/_shared.ts +2 -0
- package/src/Cli/commands/deploy.ts +3 -14
- package/src/Cli/commands/logs.ts +6 -1
- package/src/Cli/commands/tail.ts +6 -1
- package/src/Cli/main.ts +5 -4
- package/src/Cloudflare/AI/Search.ts +4 -18
- package/src/Cloudflare/AI/SearchInstance.ts +7 -26
- package/src/Cloudflare/ApiToken/AccountApiToken.ts +3 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +17 -3
- package/src/Cloudflare/Auth/OAuthClient.ts +58 -2
- package/src/Cloudflare/Containers/Container.ts +92 -3
- package/src/Cloudflare/Containers/ContainerApplication.ts +31 -5
- package/src/Cloudflare/Containers/ContainerBundle.ts +10 -2
- package/src/Cloudflare/Containers/ContainerProvider.ts +62 -0
- package/src/Cloudflare/Credentials.ts +69 -9
- package/src/Cloudflare/D1/ApplyMigrations.ts +72 -77
- package/src/Cloudflare/D1/Database.ts +169 -2
- package/src/Cloudflare/D1/LocalD1Gateway.ts +150 -0
- package/src/Cloudflare/D1/QueryDatabaseHttpClient.ts +49 -11
- package/src/Cloudflare/D1/QueryDatabaseLocal.ts +44 -2
- package/src/Cloudflare/DNS/Record.ts +30 -4
- package/src/Cloudflare/Email/Address.ts +18 -1
- package/src/Cloudflare/Email/SendBinding.ts +1 -0
- package/src/Cloudflare/Email/SendEmail.ts +13 -0
- package/src/Cloudflare/Flagship/App.ts +18 -6
- package/src/Cloudflare/KV/LocalKVGateway.ts +86 -0
- package/src/Cloudflare/KV/Namespace.ts +47 -1
- package/src/Cloudflare/KV/NamespaceLocal.ts +29 -6
- package/src/Cloudflare/KV/ReadNamespaceLocal.ts +5 -1
- package/src/Cloudflare/KV/ReadWriteNamespaceLocal.ts +5 -1
- package/src/Cloudflare/KV/WriteNamespaceLocal.ts +5 -1
- package/src/Cloudflare/LocalGateway.ts +86 -0
- package/src/Cloudflare/LocalRuntime.ts +21 -1
- package/src/Cloudflare/Logs.ts +58 -28
- package/src/Cloudflare/Providers.ts +4 -2
- package/src/Cloudflare/Queues/Consumer.ts +70 -2
- package/src/Cloudflare/Queues/Queue.ts +7 -16
- package/src/Cloudflare/Queues/QueueBinding.ts +21 -0
- package/src/Cloudflare/Queues/QueueShim.ts +193 -0
- package/src/Cloudflare/R2/Bucket.ts +55 -1
- package/src/Cloudflare/R2/BucketBinding.ts +17 -3
- package/src/Cloudflare/R2/BucketLocal.ts +25 -8
- package/src/Cloudflare/R2/LocalR2Gateway.ts +84 -0
- package/src/Cloudflare/R2/ReadBucketLocal.ts +7 -1
- package/src/Cloudflare/R2/ReadWriteBucketLocal.ts +7 -1
- package/src/Cloudflare/R2/WriteBucketLocal.ts +7 -1
- package/src/Cloudflare/Ruleset/AccountEntrypoint.ts +5 -1
- package/src/Cloudflare/Ruleset/Ruleset.ts +20 -6
- package/src/Cloudflare/Rum/Site.ts +11 -4
- package/src/Cloudflare/StateStore/Api.ts +1 -1
- package/src/Cloudflare/Tunnel/Tunnel.ts +23 -1
- package/src/Cloudflare/Website/StaticSite.ts +117 -28
- package/src/Cloudflare/Website/Vite.ts +33 -19
- package/src/Cloudflare/Workers/Compatibility.ts +27 -7
- package/src/Cloudflare/Workers/DurableObject.ts +22 -0
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +29 -10
- package/src/Cloudflare/Workers/InferEnv.ts +74 -59
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +619 -401
- package/src/Cloudflare/Workers/Worker.ts +676 -28
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +209 -25
- package/src/Cloudflare/Workers/WorkerBinding.ts +67 -3
- package/src/Cloudflare/Workers/WorkerBridge.ts +26 -4
- package/src/Cloudflare/Workers/WorkerBundle.ts +6 -1
- package/src/Cloudflare/Workers/WorkerProvider.ts +2269 -277
- package/src/Cloudflare/Workflows/WorkflowBridge.ts +31 -13
- package/src/Command/Build.ts +8 -8
- package/src/Command/Command.ts +217 -42
- package/src/Command/Dev.ts +79 -107
- package/src/Command/Exec.ts +11 -2
- package/src/Command/Memo.ts +27 -3
- package/src/Command/Redaction.ts +181 -0
- package/src/Destroy.ts +1 -10
- package/src/Docker/Container.ts +55 -15
- package/src/Docker/Context.ts +236 -0
- package/src/Docker/Docker.ts +393 -43
- package/src/Docker/Image.ts +28 -7
- package/src/Docker/Network.ts +38 -14
- package/src/Docker/Providers.ts +16 -1
- package/src/Docker/RemoteImage.ts +23 -7
- package/src/Docker/Service.ts +1119 -0
- package/src/Docker/ServiceImage.ts +331 -0
- package/src/Docker/Swarm.ts +226 -0
- package/src/Docker/Volume.ts +25 -6
- package/src/Docker/index.ts +3 -0
- package/src/Http.ts +15 -2
- package/src/Local/LocalProvider.ts +518 -0
- package/src/Local/ProviderLayer.ts +113 -11
- package/src/Local/RpcProvider.ts +10 -5
- package/src/Local/RpcProviderProxy.ts +4 -1
- package/src/Local/RpcServer.ts +20 -2
- package/src/Plan.ts +182 -54
- package/src/Planetscale/AuthProvider.ts +15 -2
- package/src/Planetscale/Branch.ts +39 -6
- package/src/Planetscale/MySQL/MySQLDatabase.ts +34 -6
- package/src/Planetscale/OAuthClient.ts +59 -3
- package/src/Planetscale/Postgres/PostgresDatabase.ts +33 -5
- package/src/Platform.ts +29 -17
- package/src/Prisma/App.ts +433 -0
- package/src/Prisma/AuthProvider.ts +260 -0
- package/src/Prisma/Branch.ts +417 -0
- package/src/Prisma/Client.ts +1337 -0
- package/src/Prisma/Compute.ts +2878 -0
- package/src/Prisma/ComputeArchive.ts +432 -0
- package/src/Prisma/ComputeBuild.ts +1652 -0
- package/src/Prisma/ComputeLifecycle.ts +391 -0
- package/src/Prisma/Connect.ts +433 -0
- package/src/Prisma/Connection.ts +643 -0
- package/src/Prisma/CustomDomain.ts +373 -0
- package/src/Prisma/Database.ts +850 -0
- package/src/Prisma/Deployment.ts +661 -0
- package/src/Prisma/EnvironmentVariable.ts +417 -0
- package/src/Prisma/Internal/AppIdentity.ts +19 -0
- package/src/Prisma/Internal/AppPromotion.ts +172 -0
- package/src/Prisma/Internal/ArchivePlatform.ts +320 -0
- package/src/Prisma/Internal/ArtifactFile.ts +242 -0
- package/src/Prisma/Internal/ArtifactUpload.ts +86 -0
- package/src/Prisma/Internal/BundlePaths.ts +28 -0
- package/src/Prisma/Internal/CleanupFailure.ts +17 -0
- package/src/Prisma/Internal/DatabaseSecrets.ts +175 -0
- package/src/Prisma/Internal/DeploymentActions.ts +59 -0
- package/src/Prisma/Internal/DeploymentIdentity.ts +25 -0
- package/src/Prisma/Internal/DeploymentObserve.ts +6 -0
- package/src/Prisma/Internal/EnvName.ts +24 -0
- package/src/Prisma/Internal/HttpClient.ts +30 -0
- package/src/Prisma/Operations.ts +259 -0
- package/src/Prisma/Postgres.ts +25 -0
- package/src/Prisma/PostgresOrigin.ts +52 -0
- package/src/Prisma/PrismaDevDatabase.ts +395 -0
- package/src/Prisma/PrismaEnvironment.ts +89 -0
- package/src/Prisma/PrismaLogs.ts +434 -0
- package/src/Prisma/Project.ts +687 -0
- package/src/Prisma/Providers.ts +471 -0
- package/src/Prisma/Refs.ts +69 -0
- package/src/Prisma/SourceRepository.ts +455 -0
- package/src/Prisma/Types.ts +611 -0
- package/src/Prisma/index.ts +24 -0
- package/src/Provider.ts +155 -39
- package/src/ProviderMode.ts +123 -0
- package/src/Resource.ts +46 -0
- package/src/RuntimeContext.ts +7 -0
- package/src/Server/Process.ts +33 -0
- package/src/State/InMemoryState.ts +2 -0
- package/src/State/ResourceState.ts +18 -0
- package/src/Sync.ts +14 -2
- package/src/Telemetry.ts +736 -0
- package/src/Test/Alchemy.ts +3 -1
- package/src/Test/Core.ts +1 -8
- package/src/Util/Clank.ts +37 -11
- package/src/Util/zip.ts +39 -0
- package/src/index.ts +3 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared scaffolding for the local-simulator gateways.
|
|
3
|
+
*
|
|
4
|
+
* The local binding simulators (KV, R2, D1, ...) live inside workerd — only
|
|
5
|
+
* a Worker with the native binding can reach them. Deploy-time code (Action
|
|
6
|
+
* capability clients, provider reconciles) runs in Node, so the `*Local`
|
|
7
|
+
* layers bridge the two with the runtime's platform proxy
|
|
8
|
+
* (`PlatformProxy.open` — our `getPlatformProxy`): a scoped workerd
|
|
9
|
+
* instance hosts the binding, and Node drives it through proxied clients.
|
|
10
|
+
*
|
|
11
|
+
* NOT exported from `index.ts` — provider/capability-internal scaffolding.
|
|
12
|
+
*/
|
|
13
|
+
import { layerRuntime } from "@distilled.cloud/cloudflare-runtime";
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
15
|
+
import * as Layer from "effect/Layer";
|
|
16
|
+
import * as Path from "effect/Path";
|
|
17
|
+
import { AlchemyContext } from "../AlchemyContext.ts";
|
|
18
|
+
import { CloudflareEnvironment } from "./CloudflareEnvironment.ts";
|
|
19
|
+
import { isLocalId } from "./LocalRuntime.ts";
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A standalone local-runtime layer for gateway consumers OUTSIDE the
|
|
23
|
+
* provider stack (e.g. capability `*Local` layers running in an Action,
|
|
24
|
+
* whose ambient context has no workerd `Runtime`). Configured identically
|
|
25
|
+
* to the providers' shared runtime — same `.alchemy/local` storage
|
|
26
|
+
* directory — so it reads and writes the same simulator data.
|
|
27
|
+
*/
|
|
28
|
+
export const localGatewayRuntime = Layer.unwrap(
|
|
29
|
+
Effect.gen(function* () {
|
|
30
|
+
const getEnv = yield* CloudflareEnvironment;
|
|
31
|
+
const { dotAlchemy } = yield* AlchemyContext;
|
|
32
|
+
const path = yield* Path.Path;
|
|
33
|
+
return layerRuntime({
|
|
34
|
+
api: {
|
|
35
|
+
accountId: getEnv.pipe(Effect.map((env) => env.accountId)),
|
|
36
|
+
},
|
|
37
|
+
storage: {
|
|
38
|
+
directory: path.join(dotAlchemy, "local"),
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
/** Sanitize an id into a workerd instance-name-safe suffix. */
|
|
45
|
+
export const gatewayName = (prefix: string, id: string) =>
|
|
46
|
+
`${prefix}-${id.replace(/[^a-zA-Z0-9_-]/g, "-")}`;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Build a client whose every member resolves the resource id first and then
|
|
50
|
+
* delegates: `dev:` ids to the (memoized) native-over-gateway client, real
|
|
51
|
+
* ids to the HTTP client. Function members dispatch per call; Effect-valued
|
|
52
|
+
* members (`raw`) dispatch on evaluation. Used by the `*Local` capability
|
|
53
|
+
* scaffolding (KV, R2) where the id is a deferred accessor resolved at
|
|
54
|
+
* apply time.
|
|
55
|
+
*/
|
|
56
|
+
export const dispatchByMode = <Client extends object>(
|
|
57
|
+
resourceId: Effect.Effect<string>,
|
|
58
|
+
httpClient: Client,
|
|
59
|
+
makeNative: (id: string) => Client,
|
|
60
|
+
): Client => {
|
|
61
|
+
let native: Client | undefined;
|
|
62
|
+
let nativeId: string | undefined;
|
|
63
|
+
const nativeFor = (id: string): Client => {
|
|
64
|
+
if (nativeId !== id) {
|
|
65
|
+
nativeId = id;
|
|
66
|
+
native = makeNative(id);
|
|
67
|
+
}
|
|
68
|
+
return native!;
|
|
69
|
+
};
|
|
70
|
+
const pick = (id: string): Client =>
|
|
71
|
+
isLocalId(id) ? nativeFor(id) : httpClient;
|
|
72
|
+
const out: Record<string, unknown> = {};
|
|
73
|
+
for (const [key, value] of Object.entries(httpClient)) {
|
|
74
|
+
out[key] =
|
|
75
|
+
typeof value === "function"
|
|
76
|
+
? (...args: unknown[]) =>
|
|
77
|
+
Effect.flatMap(resourceId, (id) =>
|
|
78
|
+
(pick(id) as Record<string, any>)[key](...args),
|
|
79
|
+
)
|
|
80
|
+
: Effect.flatMap(
|
|
81
|
+
resourceId,
|
|
82
|
+
(id) => (pick(id) as Record<string, any>)[key],
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
return out as Client;
|
|
86
|
+
};
|
|
@@ -60,7 +60,7 @@ const LocalRuntimeStateLive = Layer.succeed(
|
|
|
60
60
|
}),
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
const makeLocalRuntimeServices = () =>
|
|
64
64
|
RpcProvider.providerServicesEffect(
|
|
65
65
|
Effect.gen(function* () {
|
|
66
66
|
const getEnv = yield* CloudflareEnvironment;
|
|
@@ -80,6 +80,26 @@ export const localRuntimeServices = () =>
|
|
|
80
80
|
}),
|
|
81
81
|
);
|
|
82
82
|
|
|
83
|
+
let _localRuntimeServices:
|
|
84
|
+
| ReturnType<typeof makeLocalRuntimeServices>
|
|
85
|
+
| undefined;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* The shared local-runtime dependency layer (workerd `Runtime`,
|
|
89
|
+
* `WorkerProxy`, {@link LocalRuntimeState}) used by every Cloudflare local
|
|
90
|
+
* provider.
|
|
91
|
+
*
|
|
92
|
+
* Returns a **module-memoized layer reference**: local providers register
|
|
93
|
+
* via `ProviderLayer.dual`, which builds each provider's local variant
|
|
94
|
+
* lazily against the stack build's shared `Layer.MemoMap` — memoization is
|
|
95
|
+
* keyed by layer identity, so Worker/Queue/Consumer/Container composing
|
|
96
|
+
* this exact reference into their local thunks share one runtime instance
|
|
97
|
+
* per stack build (a fresh build gets a fresh instance via its own memo
|
|
98
|
+
* map; the layer blueprint itself is immutable).
|
|
99
|
+
*/
|
|
100
|
+
export const localRuntimeServices = () =>
|
|
101
|
+
(_localRuntimeServices ??= makeLocalRuntimeServices());
|
|
102
|
+
|
|
83
103
|
export const isLocalId = (id: string | undefined): id is string =>
|
|
84
104
|
typeof id === "string" && id.startsWith("dev:");
|
|
85
105
|
export const isLiveId = (id: string | undefined): id is string =>
|
package/src/Cloudflare/Logs.ts
CHANGED
|
@@ -78,6 +78,30 @@ export const CloudflareLogs = Effect.gen(function* () {
|
|
|
78
78
|
const createScriptTail = yield* workers.createScriptTail;
|
|
79
79
|
const deleteScriptTail = yield* workers.deleteScriptTail;
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* The telemetry query needs the `workers_observability:read` OAuth scope.
|
|
83
|
+
* A token minted by an older `alchemy login` (before the scope joined the
|
|
84
|
+
* defaults) keeps its original grants forever, so the query fails with a
|
|
85
|
+
* bare `Unauthorized`/`Forbidden` even though a fresh login would work —
|
|
86
|
+
* explain the fix instead of surfacing the raw tag.
|
|
87
|
+
*/
|
|
88
|
+
const explainMissingObservabilityScope = <A, R>(
|
|
89
|
+
effect: Effect.Effect<A, workers.QueryObservabilityTelemetryError, R>,
|
|
90
|
+
): Effect.Effect<A, workers.QueryObservabilityTelemetryError, R> =>
|
|
91
|
+
effect.pipe(
|
|
92
|
+
Effect.catchTag("Unauthorized", () =>
|
|
93
|
+
Effect.die(
|
|
94
|
+
new Error(
|
|
95
|
+
"Cloudflare rejected the observability telemetry query (Unauthorized). " +
|
|
96
|
+
'Your stored credentials are likely missing the "workers_observability:read" scope — ' +
|
|
97
|
+
"OAuth tokens keep the scopes they were minted with, so tokens from an older " +
|
|
98
|
+
"`alchemy login` won't have it. Run `alchemy login` again to mint a token with " +
|
|
99
|
+
"the current default scopes, or use an API token that grants Workers Observability read access.",
|
|
100
|
+
),
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
);
|
|
104
|
+
|
|
81
105
|
const queryLogs = (opts: {
|
|
82
106
|
accountId: string;
|
|
83
107
|
filters: TelemetryFilter[];
|
|
@@ -88,30 +112,34 @@ export const CloudflareLogs = Effect.gen(function* () {
|
|
|
88
112
|
const limit = opts.options.limit ?? 100;
|
|
89
113
|
|
|
90
114
|
if (opts.options.since) {
|
|
91
|
-
const response = yield*
|
|
115
|
+
const response = yield* explainMissingObservabilityScope(
|
|
116
|
+
queryTelemetry({
|
|
117
|
+
accountId: opts.accountId,
|
|
118
|
+
queryId: "events",
|
|
119
|
+
view: "events",
|
|
120
|
+
timeframe: { from: opts.options.since.getTime(), to: now },
|
|
121
|
+
limit,
|
|
122
|
+
parameters: {
|
|
123
|
+
filters: opts.filters,
|
|
124
|
+
// orderBy: { value: "timestamp", order: "desc" },
|
|
125
|
+
},
|
|
126
|
+
}),
|
|
127
|
+
);
|
|
128
|
+
return parseEvents(response);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const response = yield* explainMissingObservabilityScope(
|
|
132
|
+
queryTelemetry({
|
|
92
133
|
accountId: opts.accountId,
|
|
93
134
|
queryId: "events",
|
|
94
135
|
view: "events",
|
|
95
|
-
timeframe: { from:
|
|
136
|
+
timeframe: { from: now - DEFAULT_LOOKBACK_MS, to: now },
|
|
96
137
|
limit,
|
|
97
138
|
parameters: {
|
|
98
139
|
filters: opts.filters,
|
|
99
|
-
// orderBy: { value: "timestamp", order: "desc" },
|
|
100
140
|
},
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
const response = yield* queryTelemetry({
|
|
106
|
-
accountId: opts.accountId,
|
|
107
|
-
queryId: "events",
|
|
108
|
-
view: "events",
|
|
109
|
-
timeframe: { from: now - DEFAULT_LOOKBACK_MS, to: now },
|
|
110
|
-
limit,
|
|
111
|
-
parameters: {
|
|
112
|
-
filters: opts.filters,
|
|
113
|
-
},
|
|
114
|
-
});
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
115
143
|
|
|
116
144
|
return parseEvents(response);
|
|
117
145
|
});
|
|
@@ -207,17 +235,19 @@ export const CloudflareLogs = Effect.gen(function* () {
|
|
|
207
235
|
yield* Effect.sleep("2 seconds");
|
|
208
236
|
const now = Date.now();
|
|
209
237
|
|
|
210
|
-
const response = yield*
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
238
|
+
const response = yield* explainMissingObservabilityScope(
|
|
239
|
+
queryTelemetry({
|
|
240
|
+
accountId: opts.accountId,
|
|
241
|
+
queryId: "events",
|
|
242
|
+
view: "events",
|
|
243
|
+
timeframe: { from: since, to: now },
|
|
244
|
+
limit: 100,
|
|
245
|
+
parameters: {
|
|
246
|
+
filters: opts.filters,
|
|
247
|
+
orderBy: { value: "timestamp", order: "asc" },
|
|
248
|
+
},
|
|
249
|
+
}),
|
|
250
|
+
);
|
|
221
251
|
|
|
222
252
|
const lines = parseEvents(response);
|
|
223
253
|
const nextSince =
|
|
@@ -78,7 +78,6 @@ import * as KeylessCertificate from "./KeylessCertificate/index.ts";
|
|
|
78
78
|
import * as KV from "./KV/index.ts";
|
|
79
79
|
import * as LeakedCredentialCheck from "./LeakedCredentialCheck/index.ts";
|
|
80
80
|
import * as LoadBalancer from "./LoadBalancer/index.ts";
|
|
81
|
-
import { localRuntimeServices } from "./LocalRuntime.ts";
|
|
82
81
|
import * as Logpush from "./Logpush/index.ts";
|
|
83
82
|
import * as LogsControl from "./LogsControl/index.ts";
|
|
84
83
|
import * as MagicCloudNetworking from "./MagicCloudNetworking/index.ts";
|
|
@@ -683,7 +682,10 @@ export const providers = () =>
|
|
|
683
682
|
),
|
|
684
683
|
),
|
|
685
684
|
Layer.provide(DockerLive),
|
|
686
|
-
|
|
685
|
+
// Note: `localRuntimeServices()` is no longer provided globally — each
|
|
686
|
+
// local provider composes it into its `ProviderLayer.dual` local thunk,
|
|
687
|
+
// so workerd machinery only builds when a local variant is actually
|
|
688
|
+
// demanded (dev runs, or deleting a local-mode row during deploy).
|
|
687
689
|
Layer.provideMerge(CloudflareApiLive()),
|
|
688
690
|
Layer.orDie,
|
|
689
691
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as queues from "@distilled.cloud/cloudflare/queues";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
3
4
|
import * as MutableHashMap from "effect/MutableHashMap";
|
|
4
5
|
import * as Option from "effect/Option";
|
|
5
6
|
import * as Schedule from "effect/Schedule";
|
|
@@ -14,6 +15,7 @@ import {
|
|
|
14
15
|
isLiveId,
|
|
15
16
|
LOCAL_ENTRY_URL,
|
|
16
17
|
LocalRuntimeState,
|
|
18
|
+
localRuntimeServices,
|
|
17
19
|
} from "../LocalRuntime.ts";
|
|
18
20
|
import type { Providers } from "../Providers.ts";
|
|
19
21
|
|
|
@@ -72,6 +74,18 @@ export type Consumer = Resource<
|
|
|
72
74
|
accountId: string;
|
|
73
75
|
deadLetterQueue?: string;
|
|
74
76
|
settings?: ConsumerSettings;
|
|
77
|
+
/**
|
|
78
|
+
* Dev only, live queues only: the real queue's name, resolved from the
|
|
79
|
+
* cloud so the local runtime can wire the broker + pull loop for a
|
|
80
|
+
* locally-running consumer of an `Alchemy.remote()` queue.
|
|
81
|
+
*/
|
|
82
|
+
queueName?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Dev only, live queues only: id of the `http_pull` consumer attached
|
|
85
|
+
* to the real queue so the local runtime can drain it via the HTTP
|
|
86
|
+
* pull API. Deleted when this resource is deleted.
|
|
87
|
+
*/
|
|
88
|
+
pullConsumerId?: string;
|
|
75
89
|
},
|
|
76
90
|
never,
|
|
77
91
|
Providers
|
|
@@ -636,6 +650,40 @@ export const ConsumerProviderLocal = () =>
|
|
|
636
650
|
}),
|
|
637
651
|
reconcile: Effect.fn(function* ({ news, output }) {
|
|
638
652
|
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
653
|
+
// A LIVE queue (`Alchemy.remote()`) consumed by a LOCAL worker:
|
|
654
|
+
// Cloudflare only pushes to deployed consumers, so the local
|
|
655
|
+
// runtime drains the real queue via the HTTP pull API instead.
|
|
656
|
+
// Observe the queue (name + existing consumers) and ensure an
|
|
657
|
+
// `http_pull` consumer exists for the pull loop to lease from.
|
|
658
|
+
let queueName: string | undefined;
|
|
659
|
+
let pullConsumerId: string | undefined;
|
|
660
|
+
if (isLiveId(news.queueId)) {
|
|
661
|
+
const queue = yield* queues.getQueue({
|
|
662
|
+
accountId,
|
|
663
|
+
queueId: news.queueId,
|
|
664
|
+
});
|
|
665
|
+
queueName = queue.queueName ?? undefined;
|
|
666
|
+
const existingPull = (queue.consumers ?? []).find(
|
|
667
|
+
(c) => c.type === "http_pull",
|
|
668
|
+
);
|
|
669
|
+
if (existingPull?.consumerId) {
|
|
670
|
+
pullConsumerId = existingPull.consumerId;
|
|
671
|
+
} else {
|
|
672
|
+
const created = yield* queues.createConsumer({
|
|
673
|
+
accountId,
|
|
674
|
+
queueId: news.queueId,
|
|
675
|
+
type: "http_pull",
|
|
676
|
+
settings: {
|
|
677
|
+
batchSize: news.settings?.batchSize,
|
|
678
|
+
maxRetries: news.settings?.maxRetries,
|
|
679
|
+
retryDelay: news.settings?.retryDelay,
|
|
680
|
+
},
|
|
681
|
+
});
|
|
682
|
+
pullConsumerId =
|
|
683
|
+
("consumerId" in created ? created.consumerId : undefined) ??
|
|
684
|
+
undefined;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
639
687
|
const consumer: Consumer["Attributes"] = {
|
|
640
688
|
consumerId: output?.consumerId ?? `dev:${crypto.randomUUID()}`,
|
|
641
689
|
queueId: news.queueId,
|
|
@@ -643,6 +691,8 @@ export const ConsumerProviderLocal = () =>
|
|
|
643
691
|
deadLetterQueue: news.deadLetterQueue,
|
|
644
692
|
accountId,
|
|
645
693
|
settings: news.settings,
|
|
694
|
+
queueName,
|
|
695
|
+
pullConsumerId,
|
|
646
696
|
};
|
|
647
697
|
MutableHashMap.set(
|
|
648
698
|
localRuntimeState.queueConsumers,
|
|
@@ -668,13 +718,31 @@ export const ConsumerProviderLocal = () =>
|
|
|
668
718
|
output.consumerId,
|
|
669
719
|
);
|
|
670
720
|
yield* restartScripts([output.scriptName]);
|
|
721
|
+
// Remove the http_pull consumer this row attached to its live
|
|
722
|
+
// queue. Idempotent: gone-already (or queue deleted first) is
|
|
723
|
+
// success.
|
|
724
|
+
if (output.pullConsumerId && isLiveId(output.queueId)) {
|
|
725
|
+
yield* queues
|
|
726
|
+
.deleteConsumer({
|
|
727
|
+
accountId: output.accountId,
|
|
728
|
+
queueId: output.queueId,
|
|
729
|
+
consumerId: output.pullConsumerId,
|
|
730
|
+
})
|
|
731
|
+
.pipe(
|
|
732
|
+
Effect.catchTag(
|
|
733
|
+
["ConsumerNotFound", "QueueNotFound"],
|
|
734
|
+
() => Effect.void,
|
|
735
|
+
),
|
|
736
|
+
);
|
|
737
|
+
}
|
|
671
738
|
}),
|
|
672
739
|
};
|
|
673
740
|
}),
|
|
674
741
|
);
|
|
675
742
|
|
|
676
743
|
export const ConsumerProvider = () =>
|
|
677
|
-
ProviderLayer.
|
|
678
|
-
local: () =>
|
|
744
|
+
ProviderLayer.dual(Consumer, {
|
|
745
|
+
local: () =>
|
|
746
|
+
ConsumerProviderLocal().pipe(Layer.provide(localRuntimeServices())),
|
|
679
747
|
live: () => ConsumerProviderLive(),
|
|
680
748
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as queues from "@distilled.cloud/cloudflare/queues";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
3
4
|
import * as MutableHashMap from "effect/MutableHashMap";
|
|
4
5
|
import * as Option from "effect/Option";
|
|
5
6
|
import * as Schedule from "effect/Schedule";
|
|
@@ -13,9 +14,9 @@ import { isResourceOfType, Resource } from "../../Resource.ts";
|
|
|
13
14
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
14
15
|
import {
|
|
15
16
|
generateLocalId,
|
|
16
|
-
isLiveId,
|
|
17
17
|
LOCAL_ENTRY_URL,
|
|
18
18
|
LocalRuntimeState,
|
|
19
|
+
localRuntimeServices,
|
|
19
20
|
} from "../LocalRuntime.ts";
|
|
20
21
|
import type { Providers } from "../Providers.ts";
|
|
21
22
|
|
|
@@ -109,16 +110,10 @@ export const Queue = Resource<Queue>("Cloudflare.Queues.Queue", {
|
|
|
109
110
|
|
|
110
111
|
export const ProviderLive = () =>
|
|
111
112
|
Provider.succeed(Queue, {
|
|
112
|
-
|
|
113
|
-
stables: ["accountId"],
|
|
113
|
+
stables: ["queueId", "accountId"],
|
|
114
114
|
diff: Effect.fn(function* ({ id, olds = {}, news = {}, output }) {
|
|
115
115
|
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
116
116
|
if (!isResolved(news)) return undefined;
|
|
117
|
-
// If the queueId is a `dev:` ID, we need to update to a live one.
|
|
118
|
-
// The live resource doesn't exist yet, so there's no need to replace even if the name or accountId changed.
|
|
119
|
-
if (!isLiveId(output?.queueId)) {
|
|
120
|
-
return { action: "update" };
|
|
121
|
-
}
|
|
122
117
|
if ((output?.accountId ?? accountId) !== accountId) {
|
|
123
118
|
return { action: "replace" } as const;
|
|
124
119
|
}
|
|
@@ -143,9 +138,7 @@ export const ProviderLive = () =>
|
|
|
143
138
|
let observed:
|
|
144
139
|
| { queueId?: string | null; queueName?: string | null }
|
|
145
140
|
| undefined;
|
|
146
|
-
|
|
147
|
-
// name scan (promotion from dev to live).
|
|
148
|
-
if (output?.queueId && isLiveId(output.queueId)) {
|
|
141
|
+
if (output?.queueId) {
|
|
149
142
|
observed = yield* queues
|
|
150
143
|
.getQueue({
|
|
151
144
|
accountId: acct,
|
|
@@ -196,8 +189,6 @@ export const ProviderLive = () =>
|
|
|
196
189
|
};
|
|
197
190
|
}),
|
|
198
191
|
delete: Effect.fn(function* ({ output }) {
|
|
199
|
-
// If the queueId is a `dev:` ID, the resource only exists locally, so we don't need to delete it from Cloudflare.
|
|
200
|
-
if (!isLiveId(output.queueId)) return;
|
|
201
192
|
// Dependents (e.g. R2 event notification configs targeting this
|
|
202
193
|
// queue) may still be tearing down concurrently — ride out the
|
|
203
194
|
// dependency violation briefly, then fail loudly instead of
|
|
@@ -240,7 +231,7 @@ export const ProviderLive = () =>
|
|
|
240
231
|
}),
|
|
241
232
|
read: Effect.fn(function* ({ id, output, olds }) {
|
|
242
233
|
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
243
|
-
if (output?.queueId
|
|
234
|
+
if (output?.queueId) {
|
|
244
235
|
return yield* queues
|
|
245
236
|
.getQueue({
|
|
246
237
|
accountId: output.accountId,
|
|
@@ -340,7 +331,7 @@ export const ProviderLocal = () =>
|
|
|
340
331
|
);
|
|
341
332
|
|
|
342
333
|
export const QueueProvider = () =>
|
|
343
|
-
ProviderLayer.
|
|
344
|
-
local: () => ProviderLocal(),
|
|
334
|
+
ProviderLayer.dual(Queue, {
|
|
335
|
+
local: () => ProviderLocal().pipe(Layer.provide(localRuntimeServices())),
|
|
345
336
|
live: () => ProviderLive(),
|
|
346
337
|
});
|
|
@@ -2,6 +2,7 @@ import type * as runtime from "@cloudflare/workers-types";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import { Worker, WorkerEnvironment } from "../Workers/Worker.ts";
|
|
4
4
|
import type { Queue } from "./Queue.ts";
|
|
5
|
+
import { maybeQueueShim } from "./QueueShim.ts";
|
|
5
6
|
import { SendError } from "./QueueTypes.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -18,15 +19,35 @@ export const makeQueueBinding = <Client>(options: {
|
|
|
18
19
|
Effect.gen(function* () {
|
|
19
20
|
const env = yield* WorkerEnvironment;
|
|
20
21
|
const host = yield* Worker;
|
|
22
|
+
// Deploy-time ambient context (providers, stack). Captured at layer
|
|
23
|
+
// init so the shim registration below can run inside the callable —
|
|
24
|
+
// whose contract requires `R = never` — without leaking engine
|
|
25
|
+
// requirements into the binding's public type. Only dereferenced under
|
|
26
|
+
// the `__ALCHEMY_RUNTIME__` guard, where the context is the stack
|
|
27
|
+
// eval's (at runtime the captured context lacks providers, but the
|
|
28
|
+
// guarded branch never runs there).
|
|
29
|
+
const context = yield* Effect.context<never>();
|
|
21
30
|
|
|
22
31
|
return Effect.fn(function* (queue: Queue) {
|
|
23
32
|
if (!globalThis.__ALCHEMY_RUNTIME__) {
|
|
33
|
+
// A LOCAL host binding a LIVE queue needs the dev-mode
|
|
34
|
+
// remote-producer shim (see `QueueShim.ts`) — registered here as
|
|
35
|
+
// ordinary engine-managed resources, like the `AccountApiToken`
|
|
36
|
+
// the HTTP capability layers mint.
|
|
37
|
+
const shim = yield* maybeQueueShim(queue, host).pipe(
|
|
38
|
+
Effect.provideContext(context),
|
|
39
|
+
) as Effect.Effect<Effect.Success<ReturnType<typeof maybeQueueShim>>>;
|
|
24
40
|
yield* host.bind`${queue}`({
|
|
25
41
|
bindings: [
|
|
26
42
|
{
|
|
27
43
|
type: "queue",
|
|
28
44
|
name: queue.LogicalId,
|
|
29
45
|
queueName: queue.queueName,
|
|
46
|
+
// Alchemy-only mode discriminator for dev (stripped before
|
|
47
|
+
// upload): a `dev:` id keeps the local broker, a real id
|
|
48
|
+
// (Alchemy.remote()) routes through the deployed shim.
|
|
49
|
+
queueId: queue.queueId,
|
|
50
|
+
...(shim ? { shim } : {}),
|
|
30
51
|
},
|
|
31
52
|
],
|
|
32
53
|
});
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev-mode remote-producer shim for `Alchemy.remote()` queues.
|
|
3
|
+
*
|
|
4
|
+
* Cloudflare's preview/remote-binding sessions reject queue bindings
|
|
5
|
+
* outright (a preview worker carrying one serves 503 for every request;
|
|
6
|
+
* wrangler has the same gap — cloudflare/workers-sdk#9929), so a locally
|
|
7
|
+
* running worker cannot produce to a live queue through the usual
|
|
8
|
+
* remote-binding proxy. Instead, alchemy deploys a REAL shim worker that
|
|
9
|
+
* holds the actual queue binding:
|
|
10
|
+
*
|
|
11
|
+
* local worker ── env.QUEUE.send() ──▶ forwarder service (local workerd)
|
|
12
|
+
* POST /message | /batch + Authorization: Bearer <token>
|
|
13
|
+
* │
|
|
14
|
+
* ▼
|
|
15
|
+
* deployed shim worker (workers.dev)
|
|
16
|
+
* │ env.QUEUE.send(body, { contentType })
|
|
17
|
+
* ▼
|
|
18
|
+
* real Cloudflare Queue
|
|
19
|
+
*
|
|
20
|
+
* The shim and its bearer token are ordinary engine-managed resources
|
|
21
|
+
* ({@link Worker} + {@link Random}), conditionally instantiated at eval
|
|
22
|
+
* time when a LOCAL worker binds a LIVE queue — the same idiom as
|
|
23
|
+
* `AccountApiToken` (capability layers minting token resources) and
|
|
24
|
+
* event-source mappings. The engine gives the full lifecycle for free:
|
|
25
|
+
* Output-based ordering (shim deploys before the local worker serves),
|
|
26
|
+
* stable-name updates, deletion on destroy, and orphan GC on promotion
|
|
27
|
+
* (`alchemy deploy` no longer registers the shim, so it is cleaned up).
|
|
28
|
+
*
|
|
29
|
+
* NOT exported from `index.ts` — binding-internal scaffolding.
|
|
30
|
+
*/
|
|
31
|
+
import * as Effect from "effect/Effect";
|
|
32
|
+
import type * as Redacted from "effect/Redacted";
|
|
33
|
+
import type * as Output from "../../Output.ts";
|
|
34
|
+
import {
|
|
35
|
+
defaultProviderMode,
|
|
36
|
+
remote,
|
|
37
|
+
type ProviderMode,
|
|
38
|
+
} from "../../ProviderMode.ts";
|
|
39
|
+
import { Random } from "../../Random.ts";
|
|
40
|
+
import { Worker } from "../Workers/Worker.ts";
|
|
41
|
+
import type { Queue } from "./Queue.ts";
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The deployed shim's script: decodes workerd's queue wire protocol
|
|
45
|
+
* (`POST /message` with raw bytes + `X-Msg-Fmt`, `POST /batch` with base64
|
|
46
|
+
* payloads) back into `send()`/`sendBatch()` calls on its real queue
|
|
47
|
+
* binding, gated by a bearer token.
|
|
48
|
+
*
|
|
49
|
+
* `v8`-serialized messages cannot cross the boundary — deserializing V8
|
|
50
|
+
* payloads in userland is not possible — so they are rejected with a clear
|
|
51
|
+
* error telling the caller to pass an explicit contentType.
|
|
52
|
+
*/
|
|
53
|
+
const QUEUE_SHIM_SCRIPT = `class HttpError extends Error {
|
|
54
|
+
constructor(status, message) {
|
|
55
|
+
super(message);
|
|
56
|
+
this.status = status;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function decodeBody(contentType, bytes) {
|
|
61
|
+
switch (contentType) {
|
|
62
|
+
case "text":
|
|
63
|
+
return { contentType, body: new TextDecoder().decode(bytes) };
|
|
64
|
+
case "json":
|
|
65
|
+
return { contentType, body: JSON.parse(new TextDecoder().decode(bytes)) };
|
|
66
|
+
case "bytes":
|
|
67
|
+
return { contentType, body: bytes.slice().buffer };
|
|
68
|
+
case "v8":
|
|
69
|
+
throw new HttpError(
|
|
70
|
+
422,
|
|
71
|
+
'v8-serialized queue messages cannot be produced to a live queue from local dev; pass an explicit contentType of "json", "text", or "bytes" to send()/sendBatch()',
|
|
72
|
+
);
|
|
73
|
+
default:
|
|
74
|
+
throw new HttpError(400, "message content type " + contentType + " is invalid");
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function base64ToBytes(b64) {
|
|
79
|
+
const binary = atob(b64);
|
|
80
|
+
const bytes = new Uint8Array(binary.length);
|
|
81
|
+
for (let i = 0; i < binary.length; i++) {
|
|
82
|
+
bytes[i] = binary.charCodeAt(i);
|
|
83
|
+
}
|
|
84
|
+
return bytes;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getDelay(value) {
|
|
88
|
+
if (!value) return undefined;
|
|
89
|
+
const delay = Number(value);
|
|
90
|
+
if (!Number.isInteger(delay) || delay < 0) {
|
|
91
|
+
throw new HttpError(400, "message delay " + value + " is invalid");
|
|
92
|
+
}
|
|
93
|
+
return delay;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// workerd's queue client requires this response shape (SendMetadata);
|
|
97
|
+
// the metrics are informational and synthesized as zeros here.
|
|
98
|
+
const sendResponse = () =>
|
|
99
|
+
Response.json({
|
|
100
|
+
metadata: {
|
|
101
|
+
metrics: { backlogCount: 0, backlogBytes: 0, oldestMessageTimestamp: 0 },
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export default {
|
|
106
|
+
async fetch(request, env) {
|
|
107
|
+
try {
|
|
108
|
+
const auth = request.headers.get("authorization");
|
|
109
|
+
if (auth !== "Bearer " + env.SHIM_TOKEN) {
|
|
110
|
+
throw new HttpError(401, "unauthorized");
|
|
111
|
+
}
|
|
112
|
+
if (request.method !== "POST") {
|
|
113
|
+
throw new HttpError(405, "method " + request.method + " not allowed");
|
|
114
|
+
}
|
|
115
|
+
const url = new URL(request.url);
|
|
116
|
+
switch (url.pathname) {
|
|
117
|
+
case "/message": {
|
|
118
|
+
// workerd's absent-header default is "v8" — mirrored here so an
|
|
119
|
+
// unmarked payload is rejected rather than misparsed.
|
|
120
|
+
const contentType = request.headers.get("X-Msg-Fmt") ?? "v8";
|
|
121
|
+
const delaySeconds = getDelay(request.headers.get("X-Msg-Delay-Secs"));
|
|
122
|
+
const bytes = new Uint8Array(await request.arrayBuffer());
|
|
123
|
+
const decoded = decodeBody(contentType, bytes);
|
|
124
|
+
await env.QUEUE.send(decoded.body, {
|
|
125
|
+
contentType: decoded.contentType,
|
|
126
|
+
...(delaySeconds !== undefined && { delaySeconds }),
|
|
127
|
+
});
|
|
128
|
+
return sendResponse();
|
|
129
|
+
}
|
|
130
|
+
case "/batch": {
|
|
131
|
+
const delaySeconds = getDelay(request.headers.get("X-Msg-Delay-Secs"));
|
|
132
|
+
const body = await request.json();
|
|
133
|
+
const messages = body.messages.map((message) => {
|
|
134
|
+
const decoded = decodeBody(message.contentType, base64ToBytes(message.body));
|
|
135
|
+
const delay = message.delaySecs ?? delaySeconds;
|
|
136
|
+
return {
|
|
137
|
+
body: decoded.body,
|
|
138
|
+
contentType: decoded.contentType,
|
|
139
|
+
...(delay !== undefined && { delaySeconds: delay }),
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
await env.QUEUE.sendBatch(messages);
|
|
143
|
+
return sendResponse();
|
|
144
|
+
}
|
|
145
|
+
default:
|
|
146
|
+
throw new HttpError(404, "not found");
|
|
147
|
+
}
|
|
148
|
+
} catch (e) {
|
|
149
|
+
if (e instanceof HttpError) {
|
|
150
|
+
return new Response(e.message, { status: e.status });
|
|
151
|
+
}
|
|
152
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
153
|
+
return new Response("queue shim failed: " + message, { status: 500 });
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
};`;
|
|
157
|
+
|
|
158
|
+
export interface QueueShimBinding {
|
|
159
|
+
url: Output.Output<string | undefined>;
|
|
160
|
+
token: Output.Output<Redacted.Redacted<string>>;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Conditionally instantiate the queue shim for a producer binding: when a
|
|
165
|
+
* LOCAL host worker binds a LIVE queue (dev run + `Alchemy.remote()` on the
|
|
166
|
+
* queue), register the shim worker + its token and return their outputs
|
|
167
|
+
* for the binding data. Any other mode combination returns `undefined` —
|
|
168
|
+
* including the shim worker's own eval of its queue binding (the shim is
|
|
169
|
+
* pinned live, so no recursion).
|
|
170
|
+
*/
|
|
171
|
+
export const maybeQueueShim = Effect.fn(function* (
|
|
172
|
+
queue: Queue,
|
|
173
|
+
host: { Mode?: ProviderMode | undefined },
|
|
174
|
+
) {
|
|
175
|
+
const runDefault = yield* defaultProviderMode;
|
|
176
|
+
const hostMode = host.Mode ?? runDefault;
|
|
177
|
+
const queueMode = queue.Mode ?? runDefault;
|
|
178
|
+
if (hostMode !== "local" || queueMode !== "live") {
|
|
179
|
+
return undefined;
|
|
180
|
+
}
|
|
181
|
+
const token = yield* Random(`${queue.LogicalId}ShimToken`);
|
|
182
|
+
const shim = yield* Worker(`${queue.LogicalId}Shim`, {
|
|
183
|
+
script: QUEUE_SHIM_SCRIPT,
|
|
184
|
+
env: {
|
|
185
|
+
QUEUE: queue,
|
|
186
|
+
SHIM_TOKEN: token.text,
|
|
187
|
+
},
|
|
188
|
+
}).pipe(remote());
|
|
189
|
+
return {
|
|
190
|
+
url: shim.url,
|
|
191
|
+
token: token.text,
|
|
192
|
+
} satisfies QueueShimBinding;
|
|
193
|
+
});
|