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,850 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Schedule from "effect/Schedule";
|
|
3
|
+
import { deepEqual, isResolved } from "../Diff.ts";
|
|
4
|
+
import * as Redacted from "effect/Redacted";
|
|
5
|
+
import { Unowned } from "../AdoptPolicy.ts";
|
|
6
|
+
import { createPhysicalName } from "../PhysicalName.ts";
|
|
7
|
+
import * as Provider from "../Provider.ts";
|
|
8
|
+
import { Resource } from "../Resource.ts";
|
|
9
|
+
import {
|
|
10
|
+
PrismaClient,
|
|
11
|
+
extractConnectionSecrets,
|
|
12
|
+
isConflict,
|
|
13
|
+
isNotFound,
|
|
14
|
+
type PrismaManagementClient,
|
|
15
|
+
} from "./Client.ts";
|
|
16
|
+
import type { Project } from "./Project.ts";
|
|
17
|
+
import {
|
|
18
|
+
hasCanonicalConnectionSecrets,
|
|
19
|
+
mergeConnectionSecrets,
|
|
20
|
+
recoverDatabaseConnectionSecrets,
|
|
21
|
+
} from "./Internal/DatabaseSecrets.ts";
|
|
22
|
+
import type { Providers } from "./Providers.ts";
|
|
23
|
+
import {
|
|
24
|
+
concreteIdsChanged,
|
|
25
|
+
isInputObject,
|
|
26
|
+
isPrismaDevId,
|
|
27
|
+
resolveProjectId,
|
|
28
|
+
unresolvedProjectIdOf,
|
|
29
|
+
} from "./Refs.ts";
|
|
30
|
+
import type {
|
|
31
|
+
Database as ApiDatabase,
|
|
32
|
+
DatabaseSourceInput,
|
|
33
|
+
PrismaDatabaseRegionId,
|
|
34
|
+
PrismaRegionId,
|
|
35
|
+
PrismaSecretConnection,
|
|
36
|
+
} from "./Types.ts";
|
|
37
|
+
|
|
38
|
+
export interface DatabaseDev {
|
|
39
|
+
/**
|
|
40
|
+
* Local provider used by `alchemy dev`.
|
|
41
|
+
*
|
|
42
|
+
* @default "@prisma/dev"
|
|
43
|
+
*/
|
|
44
|
+
provider?: "@prisma/dev";
|
|
45
|
+
/**
|
|
46
|
+
* Stable local server name.
|
|
47
|
+
*/
|
|
48
|
+
name?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Local storage mode for the database server.
|
|
51
|
+
*
|
|
52
|
+
* @default "stateful"
|
|
53
|
+
*/
|
|
54
|
+
persistenceMode?: "stateless" | "stateful";
|
|
55
|
+
/**
|
|
56
|
+
* HTTP control port for the local server.
|
|
57
|
+
*/
|
|
58
|
+
port?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Direct Postgres port for the local database.
|
|
61
|
+
*/
|
|
62
|
+
databasePort?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Direct Postgres port for the local shadow database.
|
|
65
|
+
*/
|
|
66
|
+
shadowDatabasePort?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Enable local provider debug logging.
|
|
69
|
+
*
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
debug?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Connection timeout in milliseconds for pending database clients.
|
|
75
|
+
*/
|
|
76
|
+
databaseConnectTimeoutMillis?: number;
|
|
77
|
+
/**
|
|
78
|
+
* Idle timeout in milliseconds for active database clients.
|
|
79
|
+
*/
|
|
80
|
+
databaseIdleTimeoutMillis?: number;
|
|
81
|
+
/**
|
|
82
|
+
* Connection timeout in milliseconds for pending shadow database clients.
|
|
83
|
+
*/
|
|
84
|
+
shadowDatabaseConnectTimeoutMillis?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Idle timeout in milliseconds for active shadow database clients.
|
|
87
|
+
*/
|
|
88
|
+
shadowDatabaseIdleTimeoutMillis?: number;
|
|
89
|
+
/**
|
|
90
|
+
* Optional shell command to run after the local database is ready.
|
|
91
|
+
*/
|
|
92
|
+
migrate?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Working directory for the migration command.
|
|
95
|
+
*/
|
|
96
|
+
migrateCwd?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Maximum time to wait for the migration command before terminating it.
|
|
99
|
+
* Must be a positive finite number.
|
|
100
|
+
*
|
|
101
|
+
* @default 900
|
|
102
|
+
*/
|
|
103
|
+
migrateTimeoutSeconds?: number;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface DatabaseProps {
|
|
107
|
+
/**
|
|
108
|
+
* Project ID or `project.projectId` output that owns this database.
|
|
109
|
+
*/
|
|
110
|
+
project: string | Project;
|
|
111
|
+
/**
|
|
112
|
+
* Database display name. If omitted, Alchemy generates a stable physical
|
|
113
|
+
* name so interrupted creates can be recovered without duplicating a
|
|
114
|
+
* database. Explicit names cannot be combined with branch attachment during
|
|
115
|
+
* initial creation because the Management API creates the database before it
|
|
116
|
+
* attaches the branch and exposes no idempotency key.
|
|
117
|
+
*/
|
|
118
|
+
name?: string;
|
|
119
|
+
/**
|
|
120
|
+
* Region for the database.
|
|
121
|
+
*
|
|
122
|
+
* @default "us-east-1"
|
|
123
|
+
*/
|
|
124
|
+
region?: PrismaDatabaseRegionId;
|
|
125
|
+
/**
|
|
126
|
+
* Standalone Prisma.Database resources cannot be the project's default
|
|
127
|
+
* database because the Management API cannot demote or promote an existing
|
|
128
|
+
* database, making the resource impossible to destroy safely. Use
|
|
129
|
+
* Prisma.Project to manage the project-owned default database.
|
|
130
|
+
*
|
|
131
|
+
* @default false
|
|
132
|
+
*/
|
|
133
|
+
isDefault?: false;
|
|
134
|
+
/**
|
|
135
|
+
* Optional source database/backup descriptor for clone or restore creation.
|
|
136
|
+
*/
|
|
137
|
+
source?: DatabaseSourceInput;
|
|
138
|
+
/**
|
|
139
|
+
* Branch ID to attach the database to. Mutually exclusive with branchGitName.
|
|
140
|
+
*/
|
|
141
|
+
branchId?: string | null;
|
|
142
|
+
/**
|
|
143
|
+
* Branch git name to attach the database to. Mutually exclusive with branchId.
|
|
144
|
+
*/
|
|
145
|
+
branchGitName?: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* Local database settings for `alchemy dev`. Set to `false` to keep only
|
|
148
|
+
* placeholder IDs.
|
|
149
|
+
*/
|
|
150
|
+
dev?: false | DatabaseDev;
|
|
151
|
+
/**
|
|
152
|
+
* Rotate the adopted database's default connection to recover its one-time
|
|
153
|
+
* credentials. Prisma revokes the previous key on a best-effort basis and
|
|
154
|
+
* rotation may interrupt existing consumers, so adoption leaves credentials
|
|
155
|
+
* unset unless explicitly opted in.
|
|
156
|
+
*
|
|
157
|
+
* @default false
|
|
158
|
+
*/
|
|
159
|
+
rotateCredentialsOnAdopt?: boolean;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface Database extends Resource<
|
|
163
|
+
"Prisma.Database",
|
|
164
|
+
DatabaseProps,
|
|
165
|
+
{
|
|
166
|
+
/**
|
|
167
|
+
* Prisma database ID.
|
|
168
|
+
*/
|
|
169
|
+
databaseId: string;
|
|
170
|
+
/**
|
|
171
|
+
* Prisma database display name.
|
|
172
|
+
*/
|
|
173
|
+
databaseName: string;
|
|
174
|
+
/**
|
|
175
|
+
* Project ID that owns the database.
|
|
176
|
+
*/
|
|
177
|
+
projectId: string;
|
|
178
|
+
/**
|
|
179
|
+
* Current Prisma database status.
|
|
180
|
+
*/
|
|
181
|
+
status: string;
|
|
182
|
+
/**
|
|
183
|
+
* Prisma Postgres region ID, when available.
|
|
184
|
+
*/
|
|
185
|
+
region: string | null;
|
|
186
|
+
/**
|
|
187
|
+
* Whether this is the project's default database.
|
|
188
|
+
*/
|
|
189
|
+
isDefault: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Branch ID attached to the database, or null when unassigned.
|
|
192
|
+
*/
|
|
193
|
+
branchId: string | null;
|
|
194
|
+
/**
|
|
195
|
+
* Default connection ID for the database.
|
|
196
|
+
*/
|
|
197
|
+
defaultConnectionId: string | null;
|
|
198
|
+
/**
|
|
199
|
+
* ISO timestamp when the database was created.
|
|
200
|
+
*/
|
|
201
|
+
createdAt: string;
|
|
202
|
+
/**
|
|
203
|
+
* Direct Postgres connection string, redacted in state.
|
|
204
|
+
*/
|
|
205
|
+
directConnectionString: Redacted.Redacted<string> | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Pooled Postgres connection string, redacted in state.
|
|
208
|
+
*/
|
|
209
|
+
pooledConnectionString: Redacted.Redacted<string> | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* Accelerate connection string, redacted in state.
|
|
212
|
+
*/
|
|
213
|
+
accelerateConnectionString: Redacted.Redacted<string> | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Direct database host, when returned by Prisma.
|
|
216
|
+
*/
|
|
217
|
+
host: string | null | undefined;
|
|
218
|
+
/**
|
|
219
|
+
* Direct database username, when returned by Prisma.
|
|
220
|
+
*/
|
|
221
|
+
user: string | null | undefined;
|
|
222
|
+
/**
|
|
223
|
+
* Direct database password, redacted in state.
|
|
224
|
+
*/
|
|
225
|
+
password: Redacted.Redacted<string> | undefined;
|
|
226
|
+
},
|
|
227
|
+
never,
|
|
228
|
+
Providers
|
|
229
|
+
> {}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* A Prisma Postgres database inside a Prisma project.
|
|
233
|
+
*
|
|
234
|
+
* Standalone `Prisma.Database` resources cannot be the project's default
|
|
235
|
+
* database. Use `Prisma.Project` when the project should own a default
|
|
236
|
+
* database. Project, region, and source changes require replacement; display
|
|
237
|
+
* name and branch attachment can converge in place. Destroying this resource
|
|
238
|
+
* deletes its database and data.
|
|
239
|
+
*
|
|
240
|
+
* @resource
|
|
241
|
+
* @section Creating a Database
|
|
242
|
+
* @example Database in a project
|
|
243
|
+
* ```typescript
|
|
244
|
+
* const project = yield* Prisma.Project("app", { createDatabase: false });
|
|
245
|
+
* const database = yield* Prisma.Database("db", {
|
|
246
|
+
* project,
|
|
247
|
+
* region: "us-east-1",
|
|
248
|
+
* });
|
|
249
|
+
* ```
|
|
250
|
+
*
|
|
251
|
+
* @example Database attached to a preview branch
|
|
252
|
+
* ```typescript
|
|
253
|
+
* const database = yield* Prisma.Database("preview-db", {
|
|
254
|
+
* project,
|
|
255
|
+
* branchId: preview.branchId,
|
|
256
|
+
* });
|
|
257
|
+
* ```
|
|
258
|
+
*/
|
|
259
|
+
export const Database = Resource<Database>("Prisma.Database");
|
|
260
|
+
|
|
261
|
+
const createName = (id: string, name: string | undefined) =>
|
|
262
|
+
name === undefined ? createPhysicalName({ id }) : Effect.succeed(name);
|
|
263
|
+
|
|
264
|
+
const findDatabaseByName = (
|
|
265
|
+
client: PrismaManagementClient,
|
|
266
|
+
projectId: string,
|
|
267
|
+
name: string,
|
|
268
|
+
) =>
|
|
269
|
+
client.listProjectDatabases(projectId, { limit: 100 }).pipe(
|
|
270
|
+
Effect.flatMap((databases) => {
|
|
271
|
+
const matches = databases.filter(
|
|
272
|
+
(database: ApiDatabase) => database.name === name,
|
|
273
|
+
);
|
|
274
|
+
return matches.length > 1
|
|
275
|
+
? Effect.fail(
|
|
276
|
+
new Error(
|
|
277
|
+
`Prisma project '${projectId}' has multiple databases named '${name}'; refusing to select one arbitrarily.`,
|
|
278
|
+
),
|
|
279
|
+
)
|
|
280
|
+
: Effect.succeed(matches[0]);
|
|
281
|
+
}),
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
class GeneratedDatabaseNotVisible extends Error {}
|
|
285
|
+
|
|
286
|
+
const generatedDatabaseRecoverySchedule = Schedule.max([
|
|
287
|
+
Schedule.exponential("250 millis"),
|
|
288
|
+
Schedule.recurs(6),
|
|
289
|
+
]);
|
|
290
|
+
|
|
291
|
+
const recoverGeneratedDatabaseAfterConflict = (
|
|
292
|
+
client: PrismaManagementClient,
|
|
293
|
+
projectId: string,
|
|
294
|
+
name: string,
|
|
295
|
+
) =>
|
|
296
|
+
findDatabaseByName(client, projectId, name).pipe(
|
|
297
|
+
Effect.flatMap((database) =>
|
|
298
|
+
database
|
|
299
|
+
? Effect.succeed(database)
|
|
300
|
+
: Effect.fail(
|
|
301
|
+
new GeneratedDatabaseNotVisible(
|
|
302
|
+
`Generated Prisma database '${name}' already exists but is not visible yet.`,
|
|
303
|
+
),
|
|
304
|
+
),
|
|
305
|
+
),
|
|
306
|
+
Effect.retry({
|
|
307
|
+
while: (error) => error instanceof GeneratedDatabaseNotVisible,
|
|
308
|
+
schedule: generatedDatabaseRecoverySchedule,
|
|
309
|
+
}),
|
|
310
|
+
);
|
|
311
|
+
|
|
312
|
+
const findDefaultDatabase = (
|
|
313
|
+
client: PrismaManagementClient,
|
|
314
|
+
projectId: string,
|
|
315
|
+
) =>
|
|
316
|
+
client.listProjectDatabases(projectId, { limit: 100 }).pipe(
|
|
317
|
+
Effect.flatMap((databases) => {
|
|
318
|
+
const matches = databases.filter(
|
|
319
|
+
(database: ApiDatabase) => database.isDefault,
|
|
320
|
+
);
|
|
321
|
+
return matches.length > 1
|
|
322
|
+
? Effect.fail(
|
|
323
|
+
new Error(
|
|
324
|
+
`Prisma project '${projectId}' has multiple default databases; refusing to select one arbitrarily.`,
|
|
325
|
+
),
|
|
326
|
+
)
|
|
327
|
+
: Effect.succeed(matches[0]);
|
|
328
|
+
}),
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
const resolveDatabaseRegion = Effect.fn(function* (
|
|
332
|
+
client: PrismaManagementClient,
|
|
333
|
+
projectId: string,
|
|
334
|
+
region: PrismaDatabaseRegionId | undefined,
|
|
335
|
+
) {
|
|
336
|
+
if (region !== "inherit") {
|
|
337
|
+
return (region ?? "us-east-1") as PrismaRegionId;
|
|
338
|
+
}
|
|
339
|
+
const database = yield* findDefaultDatabase(client, projectId);
|
|
340
|
+
const inherited = database?.region?.id;
|
|
341
|
+
if (inherited === undefined) {
|
|
342
|
+
return yield* Effect.fail(
|
|
343
|
+
new Error(
|
|
344
|
+
`Cannot resolve Prisma database region 'inherit' because project '${projectId}' has no default database region. Create or promote a default database first, or specify an explicit region.`,
|
|
345
|
+
),
|
|
346
|
+
);
|
|
347
|
+
}
|
|
348
|
+
return inherited as PrismaRegionId;
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
const stripDatabaseIdPrefix = (databaseId: string) =>
|
|
352
|
+
databaseId.startsWith("db_") ? databaseId.slice(3) : databaseId;
|
|
353
|
+
|
|
354
|
+
const normalizeDatabaseSource = (
|
|
355
|
+
source: ApiDatabase["source"] | DatabaseSourceInput | undefined,
|
|
356
|
+
) => {
|
|
357
|
+
if (source === undefined || source === null || source.type === "empty") {
|
|
358
|
+
return { type: "empty" as const };
|
|
359
|
+
}
|
|
360
|
+
return source.type === "database"
|
|
361
|
+
? {
|
|
362
|
+
type: "database" as const,
|
|
363
|
+
databaseId: stripDatabaseIdPrefix(source.databaseId),
|
|
364
|
+
}
|
|
365
|
+
: {
|
|
366
|
+
type: "backup" as const,
|
|
367
|
+
databaseId: stripDatabaseIdPrefix(source.databaseId),
|
|
368
|
+
backupId: source.backupId,
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
const sourceMatches = (
|
|
373
|
+
observed: ApiDatabase["source"],
|
|
374
|
+
desired: DatabaseSourceInput | undefined,
|
|
375
|
+
) =>
|
|
376
|
+
deepEqual(
|
|
377
|
+
normalizeDatabaseSource(observed),
|
|
378
|
+
normalizeDatabaseSource(desired),
|
|
379
|
+
);
|
|
380
|
+
|
|
381
|
+
const desiredSourcesMatch = (
|
|
382
|
+
left: DatabaseSourceInput | undefined,
|
|
383
|
+
right: DatabaseSourceInput | undefined,
|
|
384
|
+
) => deepEqual(normalizeDatabaseSource(left), normalizeDatabaseSource(right));
|
|
385
|
+
|
|
386
|
+
const branchIdForGitName = (
|
|
387
|
+
client: PrismaManagementClient,
|
|
388
|
+
projectId: string,
|
|
389
|
+
gitName: string,
|
|
390
|
+
) =>
|
|
391
|
+
client
|
|
392
|
+
.listBranches(projectId, { gitName, limit: 2 })
|
|
393
|
+
.pipe(
|
|
394
|
+
Effect.flatMap((branches) =>
|
|
395
|
+
branches.length > 1
|
|
396
|
+
? Effect.fail(
|
|
397
|
+
new Error(
|
|
398
|
+
`Prisma project '${projectId}' has multiple branches named '${gitName}'; refusing to select one arbitrarily.`,
|
|
399
|
+
),
|
|
400
|
+
)
|
|
401
|
+
: Effect.succeed(branches[0]?.id),
|
|
402
|
+
),
|
|
403
|
+
);
|
|
404
|
+
|
|
405
|
+
const attrsFrom = (
|
|
406
|
+
database: ApiDatabase,
|
|
407
|
+
secrets: PrismaSecretConnection,
|
|
408
|
+
): Database["Attributes"] => ({
|
|
409
|
+
databaseId: database.id,
|
|
410
|
+
databaseName: database.name,
|
|
411
|
+
projectId: database.project.id,
|
|
412
|
+
status: database.status,
|
|
413
|
+
region: database.region?.id ?? null,
|
|
414
|
+
isDefault: database.isDefault,
|
|
415
|
+
branchId: database.branchId,
|
|
416
|
+
defaultConnectionId: database.defaultConnectionId,
|
|
417
|
+
createdAt: database.createdAt,
|
|
418
|
+
directConnectionString: secrets.directConnectionString,
|
|
419
|
+
pooledConnectionString: secrets.pooledConnectionString,
|
|
420
|
+
accelerateConnectionString: secrets.accelerateConnectionString,
|
|
421
|
+
host: secrets.host,
|
|
422
|
+
user: secrets.user,
|
|
423
|
+
password: secrets.password,
|
|
424
|
+
});
|
|
425
|
+
|
|
426
|
+
const branchNeedsSync = Effect.fn(function* (
|
|
427
|
+
client: PrismaManagementClient,
|
|
428
|
+
projectId: string,
|
|
429
|
+
database: ApiDatabase,
|
|
430
|
+
props: DatabaseProps,
|
|
431
|
+
) {
|
|
432
|
+
if (props.branchId !== undefined && !isPrismaDevId(props.branchId)) {
|
|
433
|
+
return database.branchId !== props.branchId;
|
|
434
|
+
}
|
|
435
|
+
if (props.branchGitName === undefined) {
|
|
436
|
+
return database.branchId !== null;
|
|
437
|
+
}
|
|
438
|
+
if (props.branchGitName === null) {
|
|
439
|
+
return database.branchId !== null;
|
|
440
|
+
}
|
|
441
|
+
const branchId = yield* branchIdForGitName(
|
|
442
|
+
client,
|
|
443
|
+
projectId,
|
|
444
|
+
props.branchGitName,
|
|
445
|
+
);
|
|
446
|
+
return branchId === undefined || branchId !== database.branchId;
|
|
447
|
+
});
|
|
448
|
+
|
|
449
|
+
const branchAttachment = (props: DatabaseProps) =>
|
|
450
|
+
props.branchId !== undefined && !isPrismaDevId(props.branchId)
|
|
451
|
+
? {
|
|
452
|
+
branchId: props.branchId,
|
|
453
|
+
branchGitName: undefined,
|
|
454
|
+
}
|
|
455
|
+
: props.branchGitName !== undefined
|
|
456
|
+
? {
|
|
457
|
+
branchId: undefined,
|
|
458
|
+
branchGitName: props.branchGitName,
|
|
459
|
+
}
|
|
460
|
+
: {
|
|
461
|
+
branchId: undefined,
|
|
462
|
+
branchGitName: undefined,
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
const validateDatabaseProps = (props: DatabaseProps) =>
|
|
466
|
+
Effect.gen(function* () {
|
|
467
|
+
if ((props as { isDefault?: boolean }).isDefault === true) {
|
|
468
|
+
return yield* Effect.fail(
|
|
469
|
+
new Error(
|
|
470
|
+
"Prisma.Database cannot manage a default database because the Management API has no safe demotion or promote-existing operation, so the resource could never be destroyed. Use Prisma.Project for the project-owned default database.",
|
|
471
|
+
),
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
if (props.branchId !== undefined && props.branchGitName !== undefined) {
|
|
475
|
+
return yield* Effect.fail(
|
|
476
|
+
new Error("branchId and branchGitName are mutually exclusive."),
|
|
477
|
+
);
|
|
478
|
+
}
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
export const DatabaseProvider = () =>
|
|
482
|
+
Provider.effect(
|
|
483
|
+
Database,
|
|
484
|
+
Effect.gen(function* () {
|
|
485
|
+
const client = yield* PrismaClient;
|
|
486
|
+
return {
|
|
487
|
+
stables: ["databaseId"],
|
|
488
|
+
list: () =>
|
|
489
|
+
client.listDatabases().pipe(
|
|
490
|
+
Effect.map((databases) =>
|
|
491
|
+
// Default databases are project-owned and the API rejects
|
|
492
|
+
// direct deletion. Project.list/delete owns their teardown;
|
|
493
|
+
// exposing them here would make unsafe nuke retry forever.
|
|
494
|
+
databases
|
|
495
|
+
.filter((database) => !database.isDefault)
|
|
496
|
+
.map((database) => attrsFrom(database, {})),
|
|
497
|
+
),
|
|
498
|
+
),
|
|
499
|
+
diff: Effect.fn(function* ({ id, olds, news, output }) {
|
|
500
|
+
if (!isInputObject(news)) return undefined;
|
|
501
|
+
if (
|
|
502
|
+
isResolved(news.rotateCredentialsOnAdopt) &&
|
|
503
|
+
news.rotateCredentialsOnAdopt === true &&
|
|
504
|
+
olds.rotateCredentialsOnAdopt !== true
|
|
505
|
+
) {
|
|
506
|
+
return { action: "update" } as const;
|
|
507
|
+
}
|
|
508
|
+
if ((news as { isDefault?: unknown }).isDefault === true) {
|
|
509
|
+
return yield* Effect.fail(
|
|
510
|
+
new Error(
|
|
511
|
+
"Prisma.Database cannot manage a default database because the Management API has no safe demotion or promote-existing operation. Use Prisma.Project for the project-owned default database.",
|
|
512
|
+
),
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
if (isPrismaDevId(output?.databaseId)) {
|
|
516
|
+
return { action: "update" } as const;
|
|
517
|
+
}
|
|
518
|
+
const oldProjectId =
|
|
519
|
+
output?.projectId ?? unresolvedProjectIdOf(olds.project);
|
|
520
|
+
const newProjectId = isResolved(news.project)
|
|
521
|
+
? unresolvedProjectIdOf(news.project)
|
|
522
|
+
: undefined;
|
|
523
|
+
const desiredRegionInput = isResolved(news.region)
|
|
524
|
+
? (news.region ?? "us-east-1")
|
|
525
|
+
: undefined;
|
|
526
|
+
const regionProjectId = newProjectId ?? oldProjectId;
|
|
527
|
+
const desiredRegion =
|
|
528
|
+
desiredRegionInput === "inherit"
|
|
529
|
+
? regionProjectId
|
|
530
|
+
? yield* resolveDatabaseRegion(
|
|
531
|
+
client,
|
|
532
|
+
regionProjectId,
|
|
533
|
+
desiredRegionInput,
|
|
534
|
+
)
|
|
535
|
+
: undefined
|
|
536
|
+
: desiredRegionInput;
|
|
537
|
+
const observedRegion = output
|
|
538
|
+
? output.region
|
|
539
|
+
: (olds.region ?? "us-east-1");
|
|
540
|
+
const desiredIsDefault = isResolved(news.isDefault)
|
|
541
|
+
? (news.isDefault ?? false)
|
|
542
|
+
: undefined;
|
|
543
|
+
const observedIsDefault =
|
|
544
|
+
output?.isDefault ?? olds.isDefault ?? false;
|
|
545
|
+
|
|
546
|
+
// A default database cannot be deleted from its old project after a
|
|
547
|
+
// cross-project replacement. Block before creating anything until
|
|
548
|
+
// another database has been promoted in the original project.
|
|
549
|
+
if (
|
|
550
|
+
observedIsDefault &&
|
|
551
|
+
concreteIdsChanged(oldProjectId, newProjectId)
|
|
552
|
+
) {
|
|
553
|
+
return { action: "update" } as const;
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
// Prisma has no API operation that directly demotes the current
|
|
557
|
+
// default database. Do not schedule a doomed create-first
|
|
558
|
+
// replacement: reconcile will fail before mutation until another
|
|
559
|
+
// database has been promoted and this one is observed as nondefault.
|
|
560
|
+
if (desiredIsDefault === false && observedIsDefault) {
|
|
561
|
+
return { action: "update" } as const;
|
|
562
|
+
}
|
|
563
|
+
if (
|
|
564
|
+
concreteIdsChanged(oldProjectId, newProjectId) ||
|
|
565
|
+
(desiredRegion !== undefined && desiredRegion !== observedRegion) ||
|
|
566
|
+
(desiredIsDefault !== undefined &&
|
|
567
|
+
desiredIsDefault !== observedIsDefault) ||
|
|
568
|
+
(isResolved(news.source) &&
|
|
569
|
+
!desiredSourcesMatch(news.source, olds.source))
|
|
570
|
+
) {
|
|
571
|
+
return { action: "replace" } as const;
|
|
572
|
+
}
|
|
573
|
+
if (!isResolved(news.name)) return undefined;
|
|
574
|
+
const desiredName = yield* createName(id, news.name);
|
|
575
|
+
const observedName =
|
|
576
|
+
output?.databaseName ?? (yield* createName(id, olds.name));
|
|
577
|
+
let branchMismatch = false;
|
|
578
|
+
if (isResolved(news.branchId) && news.branchId !== undefined) {
|
|
579
|
+
branchMismatch =
|
|
580
|
+
!isPrismaDevId(news.branchId) &&
|
|
581
|
+
(output?.branchId ?? olds.branchId ?? null) !== news.branchId;
|
|
582
|
+
} else if (
|
|
583
|
+
isResolved(news.branchGitName) &&
|
|
584
|
+
news.branchGitName !== undefined
|
|
585
|
+
) {
|
|
586
|
+
if (news.branchGitName === null) {
|
|
587
|
+
branchMismatch =
|
|
588
|
+
(output?.branchId ?? olds.branchId ?? null) !== null;
|
|
589
|
+
} else if (output && newProjectId !== undefined) {
|
|
590
|
+
const desiredBranchId = yield* branchIdForGitName(
|
|
591
|
+
client,
|
|
592
|
+
newProjectId,
|
|
593
|
+
news.branchGitName,
|
|
594
|
+
);
|
|
595
|
+
branchMismatch =
|
|
596
|
+
desiredBranchId === undefined ||
|
|
597
|
+
desiredBranchId !== output.branchId;
|
|
598
|
+
} else {
|
|
599
|
+
branchMismatch = news.branchGitName !== olds.branchGitName;
|
|
600
|
+
}
|
|
601
|
+
} else if (
|
|
602
|
+
isResolved(news.branchId) &&
|
|
603
|
+
isResolved(news.branchGitName)
|
|
604
|
+
) {
|
|
605
|
+
branchMismatch =
|
|
606
|
+
(output?.branchId ?? olds.branchId ?? null) !== null;
|
|
607
|
+
}
|
|
608
|
+
if (desiredName !== observedName || branchMismatch) {
|
|
609
|
+
return { action: "update" } as const;
|
|
610
|
+
}
|
|
611
|
+
return undefined;
|
|
612
|
+
}),
|
|
613
|
+
read: Effect.fn(function* ({ id, output, olds }) {
|
|
614
|
+
const databaseId = isPrismaDevId(output?.databaseId)
|
|
615
|
+
? undefined
|
|
616
|
+
: output?.databaseId;
|
|
617
|
+
let generatedIdentityMatch = false;
|
|
618
|
+
let database = databaseId
|
|
619
|
+
? yield* client
|
|
620
|
+
.getDatabase(databaseId)
|
|
621
|
+
.pipe(
|
|
622
|
+
Effect.catchIf(isNotFound, () => Effect.succeed(undefined)),
|
|
623
|
+
)
|
|
624
|
+
: undefined;
|
|
625
|
+
if (!database && databaseId === undefined) {
|
|
626
|
+
const projectId = unresolvedProjectIdOf(olds.project);
|
|
627
|
+
if (projectId) {
|
|
628
|
+
const name = yield* createName(id, olds.name);
|
|
629
|
+
database = yield* findDatabaseByName(client, projectId, name);
|
|
630
|
+
generatedIdentityMatch =
|
|
631
|
+
database !== undefined && olds.name === undefined;
|
|
632
|
+
if (
|
|
633
|
+
!database &&
|
|
634
|
+
olds.name === undefined &&
|
|
635
|
+
(olds.isDefault ?? false)
|
|
636
|
+
) {
|
|
637
|
+
database = yield* findDefaultDatabase(client, projectId);
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (!database) return undefined;
|
|
642
|
+
if (
|
|
643
|
+
databaseId === undefined &&
|
|
644
|
+
!sourceMatches(database.source, olds.source)
|
|
645
|
+
) {
|
|
646
|
+
return yield* Effect.fail(
|
|
647
|
+
new Error(
|
|
648
|
+
`Prisma database '${database.name}' has immutable source ${JSON.stringify(database.source)} but ${JSON.stringify(olds.source ?? { type: "empty" })} was requested; refusing to adopt a database that cannot converge.`,
|
|
649
|
+
),
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
const cachedSecrets =
|
|
653
|
+
output?.databaseId === database.id ? output : undefined;
|
|
654
|
+
const attrs = attrsFrom(database, {
|
|
655
|
+
directConnectionString: cachedSecrets?.directConnectionString,
|
|
656
|
+
pooledConnectionString: cachedSecrets?.pooledConnectionString,
|
|
657
|
+
accelerateConnectionString:
|
|
658
|
+
cachedSecrets?.accelerateConnectionString,
|
|
659
|
+
host: cachedSecrets?.host,
|
|
660
|
+
user: cachedSecrets?.user,
|
|
661
|
+
password: cachedSecrets?.password,
|
|
662
|
+
});
|
|
663
|
+
return databaseId === undefined && !generatedIdentityMatch
|
|
664
|
+
? Unowned(attrs)
|
|
665
|
+
: attrs;
|
|
666
|
+
}),
|
|
667
|
+
reconcile: Effect.fn(function* ({ id, news, olds, output }) {
|
|
668
|
+
yield* validateDatabaseProps(news);
|
|
669
|
+
const projectId = yield* resolveProjectId(news.project);
|
|
670
|
+
const region = yield* resolveDatabaseRegion(
|
|
671
|
+
client,
|
|
672
|
+
projectId,
|
|
673
|
+
news.region,
|
|
674
|
+
);
|
|
675
|
+
const name = yield* createName(id, news.name);
|
|
676
|
+
const databaseId = isPrismaDevId(output?.databaseId)
|
|
677
|
+
? undefined
|
|
678
|
+
: output?.databaseId;
|
|
679
|
+
let database = databaseId
|
|
680
|
+
? yield* client
|
|
681
|
+
.getDatabase(databaseId)
|
|
682
|
+
.pipe(
|
|
683
|
+
Effect.catchIf(isNotFound, () => Effect.succeed(undefined)),
|
|
684
|
+
)
|
|
685
|
+
: undefined;
|
|
686
|
+
if (!database && news.name === undefined) {
|
|
687
|
+
database = yield* findDatabaseByName(client, projectId, name);
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
let secrets: PrismaSecretConnection = {};
|
|
691
|
+
let recoverCreateSecrets = false;
|
|
692
|
+
const attach = branchAttachment(news);
|
|
693
|
+
if (!database) {
|
|
694
|
+
if (
|
|
695
|
+
news.name !== undefined &&
|
|
696
|
+
(news.branchId !== undefined || news.branchGitName !== undefined)
|
|
697
|
+
) {
|
|
698
|
+
return yield* Effect.fail(
|
|
699
|
+
new Error(
|
|
700
|
+
`Cannot safely create explicitly named Prisma database '${name}' with a branch attachment. The Management API creates the database before attaching the branch and exposes no idempotency key, so a failed response cannot be distinguished from a foreign database. Omit name to use Alchemy's recoverable physical identity, or wait for an atomic Management API operation.`,
|
|
701
|
+
),
|
|
702
|
+
);
|
|
703
|
+
}
|
|
704
|
+
const result = yield* client
|
|
705
|
+
.createDatabase({
|
|
706
|
+
projectId,
|
|
707
|
+
name,
|
|
708
|
+
region,
|
|
709
|
+
isDefault: news.isDefault ?? false,
|
|
710
|
+
source: news.source,
|
|
711
|
+
branchId: attach.branchId,
|
|
712
|
+
branchGitName: attach.branchGitName,
|
|
713
|
+
})
|
|
714
|
+
.pipe(
|
|
715
|
+
Effect.map((database) => ({
|
|
716
|
+
database,
|
|
717
|
+
secrets: extractConnectionSecrets(database.connections[0]),
|
|
718
|
+
recoverSecrets: true,
|
|
719
|
+
})),
|
|
720
|
+
Effect.catchIf(isConflict, () =>
|
|
721
|
+
news.name === undefined
|
|
722
|
+
? recoverGeneratedDatabaseAfterConflict(
|
|
723
|
+
client,
|
|
724
|
+
projectId,
|
|
725
|
+
name,
|
|
726
|
+
).pipe(
|
|
727
|
+
Effect.map((database) => ({
|
|
728
|
+
database,
|
|
729
|
+
secrets: {},
|
|
730
|
+
// The generated physical name is owned by this
|
|
731
|
+
// resource instance. A conflict after the POST can
|
|
732
|
+
// be a lost successful response, so recover the
|
|
733
|
+
// write-only default credentials below.
|
|
734
|
+
recoverSecrets: true,
|
|
735
|
+
})),
|
|
736
|
+
)
|
|
737
|
+
: Effect.fail(
|
|
738
|
+
new Error(
|
|
739
|
+
`A Prisma database named '${name}' appeared after the adoption check. Refusing to take it over; rerun with adoption enabled if it is the intended database.`,
|
|
740
|
+
),
|
|
741
|
+
),
|
|
742
|
+
),
|
|
743
|
+
);
|
|
744
|
+
database = result.database;
|
|
745
|
+
secrets = result.secrets;
|
|
746
|
+
recoverCreateSecrets = result.recoverSecrets;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if (database.project.id !== projectId) {
|
|
750
|
+
return yield* Effect.fail(
|
|
751
|
+
new Error(
|
|
752
|
+
database.isDefault
|
|
753
|
+
? `Cannot move default Prisma database '${database.name}' from project '${database.project.id}' to '${projectId}' because the old default cannot be deleted. Promote another database in the original project first, then retry the move.`
|
|
754
|
+
: `Prisma database '${database.name}' belongs to project '${database.project.id}', not requested project '${projectId}'. Refusing to claim convergence; replace the database.`,
|
|
755
|
+
),
|
|
756
|
+
);
|
|
757
|
+
}
|
|
758
|
+
if (database.region?.id !== region) {
|
|
759
|
+
return yield* Effect.fail(
|
|
760
|
+
new Error(
|
|
761
|
+
`Prisma database '${database.name}' is in immutable region '${database.region?.id ?? "unknown"}', not requested region '${region}'. Refusing to claim convergence; replace the database.`,
|
|
762
|
+
),
|
|
763
|
+
);
|
|
764
|
+
}
|
|
765
|
+
if (!sourceMatches(database.source, news.source)) {
|
|
766
|
+
return yield* Effect.fail(
|
|
767
|
+
new Error(
|
|
768
|
+
`Prisma database '${database.name}' has immutable source ${JSON.stringify(database.source)}, not requested source ${JSON.stringify(news.source ?? { type: "empty" })}. Refusing to claim convergence; replace the database.`,
|
|
769
|
+
),
|
|
770
|
+
);
|
|
771
|
+
}
|
|
772
|
+
if (
|
|
773
|
+
database.isDefault === true &&
|
|
774
|
+
(news.isDefault ?? false) === false
|
|
775
|
+
) {
|
|
776
|
+
return yield* Effect.fail(
|
|
777
|
+
new Error(
|
|
778
|
+
`Cannot demote default Prisma database '${database.name}' directly because the Management API has no demotion operation. Promote another database in project '${projectId}' first, then retry this deployment.`,
|
|
779
|
+
),
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
const ownedGeneratedIdentity =
|
|
784
|
+
news.name === undefined && database.name === name;
|
|
785
|
+
|
|
786
|
+
const desired = { ...news, name };
|
|
787
|
+
const needsPatch =
|
|
788
|
+
database.name !== name ||
|
|
789
|
+
(yield* branchNeedsSync(client, projectId, database, desired));
|
|
790
|
+
if (needsPatch) {
|
|
791
|
+
const updateAttachment =
|
|
792
|
+
attach.branchId === undefined &&
|
|
793
|
+
attach.branchGitName === undefined
|
|
794
|
+
? { branchId: null, branchGitName: undefined }
|
|
795
|
+
: attach;
|
|
796
|
+
database = yield* client.updateDatabase(database.id, {
|
|
797
|
+
name,
|
|
798
|
+
branchId: updateAttachment.branchId,
|
|
799
|
+
branchGitName: updateAttachment.branchGitName,
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
const persistedSecrets =
|
|
804
|
+
output?.databaseId === database.id ? output : undefined;
|
|
805
|
+
const knownSecrets = mergeConnectionSecrets(secrets, {
|
|
806
|
+
directConnectionString: persistedSecrets?.directConnectionString,
|
|
807
|
+
pooledConnectionString: persistedSecrets?.pooledConnectionString,
|
|
808
|
+
accelerateConnectionString:
|
|
809
|
+
persistedSecrets?.accelerateConnectionString,
|
|
810
|
+
host: persistedSecrets?.host,
|
|
811
|
+
user: persistedSecrets?.user,
|
|
812
|
+
password: persistedSecrets?.password,
|
|
813
|
+
});
|
|
814
|
+
if (
|
|
815
|
+
recoverCreateSecrets ||
|
|
816
|
+
(ownedGeneratedIdentity &&
|
|
817
|
+
!hasCanonicalConnectionSecrets(knownSecrets)) ||
|
|
818
|
+
olds !== undefined ||
|
|
819
|
+
news.rotateCredentialsOnAdopt === true
|
|
820
|
+
) {
|
|
821
|
+
const recovered = yield* recoverDatabaseConnectionSecrets(
|
|
822
|
+
client,
|
|
823
|
+
database,
|
|
824
|
+
knownSecrets,
|
|
825
|
+
);
|
|
826
|
+
database = recovered.database;
|
|
827
|
+
return attrsFrom(database, recovered.secrets);
|
|
828
|
+
}
|
|
829
|
+
return attrsFrom(database, knownSecrets);
|
|
830
|
+
}),
|
|
831
|
+
delete: Effect.fn(function* ({ output }) {
|
|
832
|
+
if (isPrismaDevId(output.databaseId)) return;
|
|
833
|
+
const database = yield* client
|
|
834
|
+
.getDatabase(output.databaseId)
|
|
835
|
+
.pipe(Effect.catchIf(isNotFound, () => Effect.succeed(undefined)));
|
|
836
|
+
if (!database) return;
|
|
837
|
+
if (database.isDefault) {
|
|
838
|
+
return yield* Effect.fail(
|
|
839
|
+
new Error(
|
|
840
|
+
`Cannot delete default Prisma database '${database.name ?? output.databaseId}' directly. Promote another database first, or delete the owning Prisma.Project so the API can remove its project-owned default database.`,
|
|
841
|
+
),
|
|
842
|
+
);
|
|
843
|
+
}
|
|
844
|
+
yield* client
|
|
845
|
+
.deleteDatabase(output.databaseId)
|
|
846
|
+
.pipe(Effect.catchIf(isNotFound, () => Effect.void));
|
|
847
|
+
}),
|
|
848
|
+
};
|
|
849
|
+
}),
|
|
850
|
+
);
|