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,987 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Duration from "effect/Duration";
|
|
3
|
+
import * as FileSystem from "effect/FileSystem";
|
|
4
|
+
import * as Path from "effect/Path";
|
|
5
|
+
import * as Redacted from "effect/Redacted";
|
|
6
|
+
import * as Stream from "effect/Stream";
|
|
7
|
+
import * as Option from "effect/Option";
|
|
8
|
+
import * as ChildProcess from "effect/unstable/process/ChildProcess";
|
|
9
|
+
import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
|
|
10
|
+
import { nodeFileTrace } from "@vercel/nft";
|
|
11
|
+
import { normalizeEntrypoint } from "./ComputeArchive.js";
|
|
12
|
+
const DEFAULT_BUILD_OUTPUT_LIMIT_BYTES = 1024 * 1024;
|
|
13
|
+
const DEFAULT_BUILD_TIMEOUT_SECONDS = 15 * 60;
|
|
14
|
+
const STAGING_MAX_ENTRIES = 50_000;
|
|
15
|
+
const STAGING_MAX_TOTAL_BYTES = 256 * 1024 * 1024;
|
|
16
|
+
const STAGING_MAX_FILE_BYTES = 128 * 1024 * 1024;
|
|
17
|
+
const STAGING_TIMEOUT_SECONDS = 2 * 60;
|
|
18
|
+
const PRISMA_MANAGEMENT_CREDENTIAL_ENV_NAMES = new Set([
|
|
19
|
+
"PRISMA_SERVICE_TOKEN",
|
|
20
|
+
"PRISMA_API_TOKEN",
|
|
21
|
+
]);
|
|
22
|
+
const collectBoundedOutput = (stream, label, limit) => Stream.runFoldEffect(stream, () => ({ chunks: [], bytes: 0 }), (state, chunk) => {
|
|
23
|
+
const bytes = state.bytes + chunk.byteLength;
|
|
24
|
+
return bytes > limit
|
|
25
|
+
? Effect.fail(new Error(`Build ${label} exceeded the ${limit} byte output safety limit. Reduce build verbosity or raise outputLimitBytes explicitly.`))
|
|
26
|
+
: Effect.sync(() => {
|
|
27
|
+
state.chunks.push(chunk);
|
|
28
|
+
return { chunks: state.chunks, bytes };
|
|
29
|
+
});
|
|
30
|
+
}).pipe(Effect.map(({ chunks, bytes }) => {
|
|
31
|
+
const output = new Uint8Array(bytes);
|
|
32
|
+
let offset = 0;
|
|
33
|
+
for (const chunk of chunks) {
|
|
34
|
+
output.set(chunk, offset);
|
|
35
|
+
offset += chunk.byteLength;
|
|
36
|
+
}
|
|
37
|
+
return { text: new TextDecoder().decode(output), bytes };
|
|
38
|
+
}));
|
|
39
|
+
/**
|
|
40
|
+
* Run a shell build command, dying on non-zero exit. Local stand-in for the
|
|
41
|
+
* removed `Build/Command.ts` helper. Build commands inherit the ambient
|
|
42
|
+
* environment except for Prisma Management API credentials, which must be
|
|
43
|
+
* passed explicitly through `env` when a build genuinely needs them.
|
|
44
|
+
*/
|
|
45
|
+
export const runBuildCommand = Effect.fn(function* ({ command, cwd, env, outputLimitBytes = DEFAULT_BUILD_OUTPUT_LIMIT_BYTES, timeoutSeconds = DEFAULT_BUILD_TIMEOUT_SECONDS, }) {
|
|
46
|
+
if (!Number.isSafeInteger(outputLimitBytes) || outputLimitBytes <= 0) {
|
|
47
|
+
return yield* Effect.fail(new Error("outputLimitBytes must be a positive safe integer"));
|
|
48
|
+
}
|
|
49
|
+
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
|
|
50
|
+
return yield* Effect.fail(new Error("timeoutSeconds must be a positive finite number"));
|
|
51
|
+
}
|
|
52
|
+
const spawner = yield* ChildProcessSpawner;
|
|
53
|
+
const path = yield* Path.Path;
|
|
54
|
+
const resultOption = yield* Effect.scoped(Effect.gen(function* () {
|
|
55
|
+
const handle = yield* spawner.spawn(ChildProcess.make(command, [], {
|
|
56
|
+
cwd: path.resolve(cwd ?? "."),
|
|
57
|
+
shell: true,
|
|
58
|
+
env: buildProcessEnvironment(env),
|
|
59
|
+
extendEnv: false,
|
|
60
|
+
stdin: "ignore",
|
|
61
|
+
stdout: "pipe",
|
|
62
|
+
stderr: "pipe",
|
|
63
|
+
killSignal: "SIGKILL",
|
|
64
|
+
}));
|
|
65
|
+
const result = yield* Effect.all({
|
|
66
|
+
exitCode: handle.exitCode,
|
|
67
|
+
stdout: collectBoundedOutput(handle.stdout, "stdout", outputLimitBytes),
|
|
68
|
+
stderr: collectBoundedOutput(handle.stderr, "stderr", outputLimitBytes),
|
|
69
|
+
}, { concurrency: "unbounded" });
|
|
70
|
+
// A successful build shell can still leave daemonized descendants in
|
|
71
|
+
// its detached process group. Always reap the group after output has
|
|
72
|
+
// closed; ESRCH is expected when no descendants remain.
|
|
73
|
+
yield* handle.kill({ killSignal: "SIGKILL" }).pipe(Effect.ignore);
|
|
74
|
+
return result;
|
|
75
|
+
}).pipe(Effect.timeoutOption(Duration.seconds(timeoutSeconds))));
|
|
76
|
+
if (Option.isNone(resultOption)) {
|
|
77
|
+
return yield* Effect.fail(new Error(`Build command timed out after ${timeoutSeconds} seconds.`));
|
|
78
|
+
}
|
|
79
|
+
const result = resultOption.value;
|
|
80
|
+
if (result.exitCode !== 0) {
|
|
81
|
+
return yield* Effect.fail(new Error(`Build command failed with exit code ${result.exitCode} (stdout: ${result.stdout.bytes} bytes; stderr: ${result.stderr.bytes} bytes).`));
|
|
82
|
+
}
|
|
83
|
+
yield* Effect.logDebug("Build command completed", {
|
|
84
|
+
stdoutBytes: result.stdout.bytes,
|
|
85
|
+
stderrBytes: result.stderr.bytes,
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
exitCode: result.exitCode,
|
|
89
|
+
stdout: result.stdout.text,
|
|
90
|
+
stderr: result.stderr.text,
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
const buildProcessEnvironment = (explicitEnv = {}) => ({
|
|
94
|
+
...Object.fromEntries(Object.entries(process.env).filter((entry) => entry[1] !== undefined &&
|
|
95
|
+
!PRISMA_MANAGEMENT_CREDENTIAL_ENV_NAMES.has(entry[0].toUpperCase()))),
|
|
96
|
+
...explicitEnv,
|
|
97
|
+
});
|
|
98
|
+
const NEXT_CONFIG_FILENAMES = [
|
|
99
|
+
"next.config.js",
|
|
100
|
+
"next.config.mjs",
|
|
101
|
+
"next.config.ts",
|
|
102
|
+
"next.config.mts",
|
|
103
|
+
];
|
|
104
|
+
const NUXT_CONFIG_FILENAMES = [
|
|
105
|
+
"nuxt.config.js",
|
|
106
|
+
"nuxt.config.mjs",
|
|
107
|
+
"nuxt.config.cjs",
|
|
108
|
+
"nuxt.config.ts",
|
|
109
|
+
"nuxt.config.mts",
|
|
110
|
+
];
|
|
111
|
+
const ASTRO_CONFIG_FILENAMES = [
|
|
112
|
+
"astro.config.js",
|
|
113
|
+
"astro.config.mjs",
|
|
114
|
+
"astro.config.cjs",
|
|
115
|
+
"astro.config.ts",
|
|
116
|
+
"astro.config.mts",
|
|
117
|
+
];
|
|
118
|
+
const NEST_CLI_FILENAME = "nest-cli.json";
|
|
119
|
+
const NEST_TSCONFIG_FILENAMES = [
|
|
120
|
+
"tsconfig.build.json",
|
|
121
|
+
"tsconfig.json",
|
|
122
|
+
];
|
|
123
|
+
const NEST_DEFAULT_COMPILED_ENTRYPOINTS = [
|
|
124
|
+
"dist/src/main.js",
|
|
125
|
+
"dist/main.js",
|
|
126
|
+
];
|
|
127
|
+
const TANSTACK_START_PACKAGES = [
|
|
128
|
+
"@tanstack/react-start",
|
|
129
|
+
"@tanstack/solid-start",
|
|
130
|
+
];
|
|
131
|
+
const strategies = [
|
|
132
|
+
{
|
|
133
|
+
name: "nextjs",
|
|
134
|
+
canBuild: (appPath) => Effect.gen(function* () {
|
|
135
|
+
return ((yield* hasRootFile(appPath, NEXT_CONFIG_FILENAMES)) ||
|
|
136
|
+
(yield* hasPackageDependency(appPath, ["next"])));
|
|
137
|
+
}),
|
|
138
|
+
execute: (options) => buildFramework({
|
|
139
|
+
appPath: options.appPath,
|
|
140
|
+
env: options.env,
|
|
141
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
142
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
143
|
+
cliName: "next",
|
|
144
|
+
args: ["build"],
|
|
145
|
+
failurePrefix: "Next.js",
|
|
146
|
+
missingMessage: "Could not find an installed Next.js CLI. Install `next` in the application or workspace before deploying.",
|
|
147
|
+
sourceDir: ".next/standalone",
|
|
148
|
+
entrypoint: "server.js",
|
|
149
|
+
defaultPort: 3000,
|
|
150
|
+
allowNestedEntrypoint: true,
|
|
151
|
+
extrasRelativeToEntrypoint: true,
|
|
152
|
+
missingOutputMessage: 'Next.js build did not produce standalone output. Add output: "standalone" to your next.config file.',
|
|
153
|
+
extras: [
|
|
154
|
+
{ from: "public", to: "public" },
|
|
155
|
+
{ from: ".next/static", to: ".next/static" },
|
|
156
|
+
],
|
|
157
|
+
}),
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "nuxt",
|
|
161
|
+
canBuild: (appPath) => Effect.gen(function* () {
|
|
162
|
+
return ((yield* hasRootFile(appPath, NUXT_CONFIG_FILENAMES)) ||
|
|
163
|
+
(yield* hasPackageDependency(appPath, ["nuxt"])));
|
|
164
|
+
}),
|
|
165
|
+
execute: (options) => buildFramework({
|
|
166
|
+
appPath: options.appPath,
|
|
167
|
+
env: options.env,
|
|
168
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
169
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
170
|
+
cliName: "nuxt",
|
|
171
|
+
args: ["build"],
|
|
172
|
+
failurePrefix: "Nuxt",
|
|
173
|
+
missingMessage: "Could not find an installed Nuxt CLI. Install `nuxt` in the application or workspace before deploying.",
|
|
174
|
+
sourceDir: ".output",
|
|
175
|
+
entrypoint: "server/index.mjs",
|
|
176
|
+
defaultPort: 3000,
|
|
177
|
+
requiredFile: ".output/server/index.mjs",
|
|
178
|
+
missingOutputMessage: "Nuxt build did not produce a Nitro node server entrypoint at .output/server/index.mjs. Ensure nitro.preset is 'node-server' (the default).",
|
|
179
|
+
}),
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "astro",
|
|
183
|
+
canBuild: (appPath) => Effect.gen(function* () {
|
|
184
|
+
return ((yield* hasRootFile(appPath, ASTRO_CONFIG_FILENAMES)) ||
|
|
185
|
+
(yield* hasPackageDependency(appPath, ["astro"])));
|
|
186
|
+
}),
|
|
187
|
+
execute: (options) => buildFramework({
|
|
188
|
+
appPath: options.appPath,
|
|
189
|
+
env: options.env,
|
|
190
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
191
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
192
|
+
cliName: "astro",
|
|
193
|
+
args: ["build"],
|
|
194
|
+
failurePrefix: "Astro",
|
|
195
|
+
missingMessage: "Could not find an installed Astro CLI. Install `astro` in the application or workspace before deploying.",
|
|
196
|
+
sourceDir: "dist",
|
|
197
|
+
entrypoint: "server/entry.mjs",
|
|
198
|
+
defaultPort: 4321,
|
|
199
|
+
requiredFile: "dist/server/entry.mjs",
|
|
200
|
+
missingOutputMessage: 'Astro build did not produce a standalone server entrypoint. Install @astrojs/node and configure it with adapter: node({ mode: "standalone" }) in your astro.config file.',
|
|
201
|
+
}),
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "nestjs",
|
|
205
|
+
canBuild: (appPath) => Effect.gen(function* () {
|
|
206
|
+
return ((yield* hasRootFile(appPath, [NEST_CLI_FILENAME])) ||
|
|
207
|
+
(yield* hasPackageDependency(appPath, ["@nestjs/core"])));
|
|
208
|
+
}),
|
|
209
|
+
execute: (options) => buildNestjs(options),
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "tanstack-start",
|
|
213
|
+
canBuild: (appPath) => hasPackageDependency(appPath, TANSTACK_START_PACKAGES),
|
|
214
|
+
execute: (options) => buildFramework({
|
|
215
|
+
appPath: options.appPath,
|
|
216
|
+
env: options.env,
|
|
217
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
218
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
219
|
+
cliName: "vite",
|
|
220
|
+
args: ["build"],
|
|
221
|
+
failurePrefix: "TanStack Start",
|
|
222
|
+
missingMessage: "Could not find an installed Vite CLI. Install `vite` in the application or workspace before deploying.",
|
|
223
|
+
sourceDir: ".output",
|
|
224
|
+
entrypoint: "server/index.mjs",
|
|
225
|
+
defaultPort: 3000,
|
|
226
|
+
requiredFile: ".output/server/index.mjs",
|
|
227
|
+
missingOutputMessage: "TanStack Start build did not produce a Nitro node server entrypoint at .output/server/index.mjs. Ensure your vite.config includes the TanStack Start and Nitro plugins with the default node preset.",
|
|
228
|
+
}),
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
name: "bun",
|
|
232
|
+
canBuild: () => Effect.succeed(true),
|
|
233
|
+
execute: (options) => buildBun(options),
|
|
234
|
+
},
|
|
235
|
+
];
|
|
236
|
+
export const runComputeAutoBuild = Effect.fn(function* (options) {
|
|
237
|
+
const requested = options.framework ?? "auto";
|
|
238
|
+
const candidates = requested === "auto"
|
|
239
|
+
? strategies
|
|
240
|
+
: strategies.filter((strategy) => strategy.name === requested);
|
|
241
|
+
for (const strategy of candidates) {
|
|
242
|
+
if (yield* strategy.canBuild(options.appPath)) {
|
|
243
|
+
return yield* strategy.execute(options);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return yield* Effect.fail(new Error("No suitable Prisma Compute auto-build strategy found."));
|
|
247
|
+
});
|
|
248
|
+
const buildFramework = Effect.fn(function* (options) {
|
|
249
|
+
const fs = yield* FileSystem.FileSystem;
|
|
250
|
+
const path = yield* Path.Path;
|
|
251
|
+
yield* runBuildCommand({
|
|
252
|
+
command: yield* packageCliCommand(options.appPath, options.cliName, options.args, options.missingMessage),
|
|
253
|
+
cwd: options.appPath,
|
|
254
|
+
env: processBuildEnv(options.env),
|
|
255
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
256
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
257
|
+
});
|
|
258
|
+
const requiredPath = path.join(options.appPath, options.requiredFile ?? options.sourceDir);
|
|
259
|
+
if (!(yield* fs.exists(requiredPath))) {
|
|
260
|
+
return yield* Effect.fail(new Error(options.missingOutputMessage));
|
|
261
|
+
}
|
|
262
|
+
const temp = yield* makeTempArtifactDir();
|
|
263
|
+
const budget = makeStagingBudget();
|
|
264
|
+
const build = Effect.gen(function* () {
|
|
265
|
+
return yield* withStagingDeadline(Effect.gen(function* () {
|
|
266
|
+
yield* copyDirectoryPreserveSymlinks(path.join(options.appPath, options.sourceDir), temp.artifactDir, temp.artifactDir, options.appPath, budget);
|
|
267
|
+
yield* materializeBunNodeModuleAliases(temp.artifactDir, path.join(options.appPath, options.sourceDir), budget);
|
|
268
|
+
const entrypoint = yield* resolveFrameworkEntrypoint(temp.artifactDir, options.entrypoint, options.allowNestedEntrypoint ?? false);
|
|
269
|
+
const extrasBaseDir = options.extrasRelativeToEntrypoint
|
|
270
|
+
? path.dirname(path.join(temp.artifactDir, entrypoint))
|
|
271
|
+
: temp.artifactDir;
|
|
272
|
+
for (const extra of options.extras ?? []) {
|
|
273
|
+
const extraSource = path.join(options.appPath, extra.from);
|
|
274
|
+
if (yield* directoryExists(extraSource)) {
|
|
275
|
+
const extraTarget = path.join(extrasBaseDir, extra.to);
|
|
276
|
+
yield* copyDirectoryPreserveSymlinks(extraSource, extraTarget, temp.artifactDir, options.appPath, budget);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
directory: temp.artifactDir,
|
|
281
|
+
entrypoint,
|
|
282
|
+
defaultPort: options.defaultPort,
|
|
283
|
+
cleanup: temp.cleanup,
|
|
284
|
+
};
|
|
285
|
+
}), budget);
|
|
286
|
+
});
|
|
287
|
+
return yield* build.pipe(Effect.catch((error) => temp.cleanup.pipe(Effect.andThen(Effect.fail(error)))));
|
|
288
|
+
});
|
|
289
|
+
const buildNestjs = Effect.fn(function* (options) {
|
|
290
|
+
const fs = yield* FileSystem.FileSystem;
|
|
291
|
+
const path = yield* Path.Path;
|
|
292
|
+
const buildScript = yield* readPackageScript(options.appPath, "build");
|
|
293
|
+
yield* runBuildCommand({
|
|
294
|
+
command: buildScript === undefined
|
|
295
|
+
? yield* packageCliCommand(options.appPath, "nest", ["build"], "Could not find an installed Nest CLI. Add a `build` script to package.json or install `@nestjs/cli` in the application or workspace before deploying.")
|
|
296
|
+
: packageScriptCommand("build"),
|
|
297
|
+
cwd: options.appPath,
|
|
298
|
+
env: processBuildEnv(options.env),
|
|
299
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
300
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
301
|
+
});
|
|
302
|
+
const compiledEntry = yield* resolveNestjsCompiledEntrypoint(options.appPath);
|
|
303
|
+
const temp = yield* makeTempArtifactDir();
|
|
304
|
+
const budget = makeStagingBudget();
|
|
305
|
+
const build = Effect.gen(function* () {
|
|
306
|
+
const entrypoint = yield* withStagingDeadline(stageTracedNestjsArtifact({
|
|
307
|
+
appPath: options.appPath,
|
|
308
|
+
artifactDir: temp.artifactDir,
|
|
309
|
+
compiledEntry,
|
|
310
|
+
budget,
|
|
311
|
+
}), budget);
|
|
312
|
+
return {
|
|
313
|
+
directory: temp.artifactDir,
|
|
314
|
+
entrypoint,
|
|
315
|
+
defaultPort: 3000,
|
|
316
|
+
cleanup: temp.cleanup,
|
|
317
|
+
};
|
|
318
|
+
});
|
|
319
|
+
return yield* build.pipe(Effect.catch((error) => fs
|
|
320
|
+
.remove(path.dirname(temp.artifactDir), { recursive: true })
|
|
321
|
+
.pipe(Effect.ignore, Effect.andThen(Effect.fail(error)))));
|
|
322
|
+
});
|
|
323
|
+
const resolveNestjsCompiledEntrypoint = Effect.fn(function* (appPath) {
|
|
324
|
+
const fs = yield* FileSystem.FileSystem;
|
|
325
|
+
const path = yield* Path.Path;
|
|
326
|
+
const candidates = [
|
|
327
|
+
yield* readPackageMain(appPath),
|
|
328
|
+
yield* configuredNestjsCompiledEntrypoint(appPath),
|
|
329
|
+
...NEST_DEFAULT_COMPILED_ENTRYPOINTS,
|
|
330
|
+
].flatMap((candidate) => {
|
|
331
|
+
if (candidate === undefined)
|
|
332
|
+
return [];
|
|
333
|
+
const normalized = normalizeRelativePath(candidate);
|
|
334
|
+
return normalized === undefined ? [] : [normalized];
|
|
335
|
+
});
|
|
336
|
+
for (const candidate of candidates) {
|
|
337
|
+
const stat = yield* fs
|
|
338
|
+
.stat(path.join(appPath, candidate))
|
|
339
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
340
|
+
if (stat?.type === "File")
|
|
341
|
+
return candidate;
|
|
342
|
+
}
|
|
343
|
+
return yield* Effect.fail(new Error(`NestJS build did not produce a compiled entrypoint. Looked for ${candidates.join(", ")} under ${appPath}. Ensure \`nest build\` ran and check package.json main, nest-cli.json, or tsconfig outDir.`));
|
|
344
|
+
});
|
|
345
|
+
const configuredNestjsCompiledEntrypoint = Effect.fn(function* (appPath) {
|
|
346
|
+
const path = yield* Path.Path;
|
|
347
|
+
const config = yield* readNestCliConfig(appPath);
|
|
348
|
+
const sourceRoot = normalizeRelativePath(config.sourceRoot ?? "src") ?? "src";
|
|
349
|
+
const entryFile = config.entryFile ?? "main";
|
|
350
|
+
const outDir = yield* readNestjsOutDir(appPath);
|
|
351
|
+
return sourceRoot === "."
|
|
352
|
+
? path.join(outDir, `${entryFile}.js`)
|
|
353
|
+
: path.join(outDir, sourceRoot, `${entryFile}.js`);
|
|
354
|
+
});
|
|
355
|
+
const stageTracedNestjsArtifact = Effect.fn(function* (options) {
|
|
356
|
+
const fs = yield* FileSystem.FileSystem;
|
|
357
|
+
const path = yield* Path.Path;
|
|
358
|
+
const sourceRoot = yield* resolveSourceRoot(options.appPath);
|
|
359
|
+
const realSourceRoot = yield* fs.realPath(sourceRoot);
|
|
360
|
+
const artifactRoot = path.resolve(options.artifactDir);
|
|
361
|
+
const entry = path.join(options.appPath, options.compiledEntry);
|
|
362
|
+
const entrypoint = path.relative(sourceRoot, entry).replaceAll("\\", "/");
|
|
363
|
+
const fileList = yield* Effect.tryPromise({
|
|
364
|
+
try: () => nodeFileTrace([entry], { base: sourceRoot }).then((result) => Array.from(result.fileList)),
|
|
365
|
+
catch: (cause) => cause instanceof Error
|
|
366
|
+
? cause
|
|
367
|
+
: new Error(`Failed to trace NestJS artifact: ${String(cause)}`),
|
|
368
|
+
});
|
|
369
|
+
const sortedFiles = fileList.sort((a, b) => a.localeCompare(b));
|
|
370
|
+
if (sortedFiles.length > STAGING_MAX_ENTRIES) {
|
|
371
|
+
return yield* Effect.fail(new Error(`Compute artifact staging exceeded the ${STAGING_MAX_ENTRIES} entry safety limit while tracing NestJS dependencies.`));
|
|
372
|
+
}
|
|
373
|
+
for (const file of sortedFiles) {
|
|
374
|
+
const normalized = normalizeRelativePath(file);
|
|
375
|
+
if (normalized === undefined || normalized === ".") {
|
|
376
|
+
return yield* Effect.fail(new Error(`NestJS dependency trace returned an unsafe path: ${file}`));
|
|
377
|
+
}
|
|
378
|
+
yield* stageTracedPath(path.join(sourceRoot, normalized), path.join(options.artifactDir, normalized), [realSourceRoot], artifactRoot, options.budget);
|
|
379
|
+
}
|
|
380
|
+
return entrypoint;
|
|
381
|
+
});
|
|
382
|
+
const copyDirectoryPreserveSymlinks = Effect.fn(function* (sourceDir, targetDir, targetRoot, sourceBoundary, budget) {
|
|
383
|
+
const fs = yield* FileSystem.FileSystem;
|
|
384
|
+
const path = yield* Path.Path;
|
|
385
|
+
const realSourceRoot = yield* fs.realPath(sourceDir);
|
|
386
|
+
const realSourceBoundary = yield* fs.realPath(sourceBoundary);
|
|
387
|
+
yield* assertPathWithinRoots(realSourceRoot, [realSourceBoundary], sourceDir);
|
|
388
|
+
yield* copyDirectoryWithinRoots(sourceDir, targetDir, [realSourceRoot], path.resolve(targetRoot), budget);
|
|
389
|
+
});
|
|
390
|
+
const copyDirectoryWithinRoots = Effect.fn(function* (sourceDir, targetDir, allowedRoots, targetRoot, budget) {
|
|
391
|
+
const fs = yield* FileSystem.FileSystem;
|
|
392
|
+
const path = yield* Path.Path;
|
|
393
|
+
yield* assertRealPathWithinRoots(sourceDir, allowedRoots);
|
|
394
|
+
yield* assertSafeStagingDestination(targetDir, targetRoot);
|
|
395
|
+
yield* fs.makeDirectory(targetDir, { recursive: true });
|
|
396
|
+
const entries = (yield* readDirectoryEntries(sourceDir)).sort((a, b) => a.name.localeCompare(b.name));
|
|
397
|
+
for (const entry of entries) {
|
|
398
|
+
const source = path.join(sourceDir, entry.name);
|
|
399
|
+
const target = path.join(targetDir, entry.name);
|
|
400
|
+
if (entry.type === "SymbolicLink") {
|
|
401
|
+
const symlinkTarget = yield* validateStagedSymlink(source, allowedRoots);
|
|
402
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
403
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
404
|
+
yield* assertPathWithinRoots(path.resolve(path.dirname(target), symlinkTarget), [targetRoot], target);
|
|
405
|
+
yield* fs.remove(target, { recursive: true, force: true });
|
|
406
|
+
yield* fs.symlink(symlinkTarget, target);
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
if (entry.type === "Directory") {
|
|
410
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
411
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
412
|
+
yield* copyDirectoryWithinRoots(source, target, allowedRoots, targetRoot, budget);
|
|
413
|
+
continue;
|
|
414
|
+
}
|
|
415
|
+
if (entry.type === "File") {
|
|
416
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
417
|
+
const stat = yield* fs.stat(source);
|
|
418
|
+
const size = yield* safeFileSize(source, stat.size);
|
|
419
|
+
yield* accountStagingEntry(budget, source, size);
|
|
420
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
421
|
+
yield* fs.makeDirectory(path.dirname(target), { recursive: true });
|
|
422
|
+
yield* fs.copyFile(source, target);
|
|
423
|
+
const copied = yield* fs.stat(target);
|
|
424
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
425
|
+
yield* fs.remove(target, { force: true }).pipe(Effect.ignore);
|
|
426
|
+
return yield* Effect.fail(new Error(`Compute artifact file changed while staging: ${source}`));
|
|
427
|
+
}
|
|
428
|
+
yield* fs.chmod(target, stat.mode & 0o777);
|
|
429
|
+
continue;
|
|
430
|
+
}
|
|
431
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
432
|
+
return yield* Effect.fail(new Error(`Unsupported filesystem entry in compute artifact: ${source}`));
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
const readDirectoryEntries = Effect.fn(function* (directory) {
|
|
436
|
+
const fs = yield* FileSystem.FileSystem;
|
|
437
|
+
const path = yield* Path.Path;
|
|
438
|
+
const names = yield* fs.readDirectory(directory);
|
|
439
|
+
if (names.length > STAGING_MAX_ENTRIES) {
|
|
440
|
+
return yield* Effect.fail(new Error(`Compute artifact directory exceeds the ${STAGING_MAX_ENTRIES} entry safety limit: ${directory}`));
|
|
441
|
+
}
|
|
442
|
+
return yield* Effect.forEach(names, (name) => Effect.gen(function* () {
|
|
443
|
+
const file = path.join(directory, name);
|
|
444
|
+
const isSymlink = yield* fs.readLink(file).pipe(Effect.as(true), Effect.catch(() => Effect.succeed(false)));
|
|
445
|
+
if (isSymlink) {
|
|
446
|
+
return { name, type: "SymbolicLink" };
|
|
447
|
+
}
|
|
448
|
+
const stat = yield* fs.stat(file);
|
|
449
|
+
return {
|
|
450
|
+
name,
|
|
451
|
+
type: stat.type === "Directory" || stat.type === "File"
|
|
452
|
+
? stat.type
|
|
453
|
+
: "Other",
|
|
454
|
+
};
|
|
455
|
+
}));
|
|
456
|
+
});
|
|
457
|
+
const materializeBunNodeModuleAliases = Effect.fn(function* (artifactDir, sourceDir, budget) {
|
|
458
|
+
const fs = yield* FileSystem.FileSystem;
|
|
459
|
+
const path = yield* Path.Path;
|
|
460
|
+
const nodeModules = path.join(artifactDir, "node_modules");
|
|
461
|
+
const aliasRoot = path.join(nodeModules, ".bun", "node_modules");
|
|
462
|
+
if (!(yield* directoryExists(aliasRoot)))
|
|
463
|
+
return;
|
|
464
|
+
const allowedRoots = [
|
|
465
|
+
yield* fs.realPath(artifactDir),
|
|
466
|
+
yield* fs.realPath(sourceDir),
|
|
467
|
+
];
|
|
468
|
+
const targetRoot = path.resolve(artifactDir);
|
|
469
|
+
for (const entry of yield* fs.readDirectory(aliasRoot)) {
|
|
470
|
+
const source = path.join(aliasRoot, entry);
|
|
471
|
+
const stat = yield* fs
|
|
472
|
+
.stat(source)
|
|
473
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
474
|
+
if (stat?.type !== "Directory")
|
|
475
|
+
continue;
|
|
476
|
+
if (entry.startsWith("@")) {
|
|
477
|
+
const targetScope = path.join(nodeModules, entry);
|
|
478
|
+
yield* assertSafeStagingDestination(targetScope, targetRoot);
|
|
479
|
+
yield* fs.makeDirectory(targetScope, { recursive: true });
|
|
480
|
+
for (const packageName of yield* fs.readDirectory(source)) {
|
|
481
|
+
yield* copyAliasIfMissing(allowedRoots, path.join(source, packageName), path.join(targetScope, packageName), targetRoot, budget);
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
else {
|
|
485
|
+
yield* copyAliasIfMissing(allowedRoots, source, path.join(nodeModules, entry), targetRoot, budget);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
const copyAliasIfMissing = Effect.fn(function* (allowedRoots, source, target, targetRoot, budget) {
|
|
490
|
+
const fs = yield* FileSystem.FileSystem;
|
|
491
|
+
if (yield* fs.exists(target))
|
|
492
|
+
return;
|
|
493
|
+
const realSource = yield* fs.realPath(source);
|
|
494
|
+
yield* assertPathWithinRoots(realSource, allowedRoots, source);
|
|
495
|
+
const stat = yield* fs.stat(realSource);
|
|
496
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
497
|
+
if (stat.type === "Directory") {
|
|
498
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
499
|
+
yield* copyDirectoryWithinRoots(realSource, target, allowedRoots, targetRoot, budget);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
if (stat.type === "File") {
|
|
503
|
+
const size = yield* safeFileSize(source, stat.size);
|
|
504
|
+
yield* accountStagingEntry(budget, source, size);
|
|
505
|
+
yield* fs.copyFile(realSource, target);
|
|
506
|
+
const copied = yield* fs.stat(target);
|
|
507
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
508
|
+
yield* fs.remove(target, { force: true }).pipe(Effect.ignore);
|
|
509
|
+
return yield* Effect.fail(new Error(`Compute artifact file changed while staging: ${source}`));
|
|
510
|
+
}
|
|
511
|
+
yield* fs.chmod(target, stat.mode & 0o777);
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
return yield* Effect.fail(new Error(`Unsupported Bun package alias source: ${source}`));
|
|
515
|
+
});
|
|
516
|
+
const resolveFrameworkEntrypoint = Effect.fn(function* (artifactDir, entrypoint, allowNested) {
|
|
517
|
+
const fs = yield* FileSystem.FileSystem;
|
|
518
|
+
const path = yield* Path.Path;
|
|
519
|
+
if (!allowNested) {
|
|
520
|
+
return entrypoint;
|
|
521
|
+
}
|
|
522
|
+
const entrypointFile = path.basename(entrypoint);
|
|
523
|
+
const candidates = (yield* fs.readDirectory(artifactDir, { recursive: true }))
|
|
524
|
+
.map((file) => file.replaceAll("\\", "/"))
|
|
525
|
+
.filter((file) => {
|
|
526
|
+
const parts = file.split("/");
|
|
527
|
+
return (path.basename(file) === entrypointFile &&
|
|
528
|
+
!parts.includes("node_modules") &&
|
|
529
|
+
!parts.includes(".next"));
|
|
530
|
+
})
|
|
531
|
+
.sort((a, b) => {
|
|
532
|
+
const depth = a.split(/[\\/]/).length - b.split(/[\\/]/).length;
|
|
533
|
+
return depth === 0 ? a.localeCompare(b) : depth;
|
|
534
|
+
});
|
|
535
|
+
if (candidates.length === 1)
|
|
536
|
+
return candidates[0];
|
|
537
|
+
if (candidates.length > 1) {
|
|
538
|
+
return yield* Effect.fail(new Error(`Next.js standalone output has multiple ${entrypointFile} files (${candidates.join(", ")}). Cannot determine the application entrypoint.`));
|
|
539
|
+
}
|
|
540
|
+
return yield* Effect.fail(new Error(`Could not find framework entrypoint ${entrypoint} inside ${artifactDir}.`));
|
|
541
|
+
});
|
|
542
|
+
function buildBun(options) {
|
|
543
|
+
return Effect.gen(function* () {
|
|
544
|
+
const fs = yield* FileSystem.FileSystem;
|
|
545
|
+
const path = yield* Path.Path;
|
|
546
|
+
const entrypoint = yield* resolveBunEntrypoint(options.appPath, options.entrypoint);
|
|
547
|
+
const absoluteEntrypoint = path.join(options.appPath, entrypoint);
|
|
548
|
+
const temp = yield* makeTempArtifactDir("bundle");
|
|
549
|
+
const build = Effect.gen(function* () {
|
|
550
|
+
yield* runBuildCommand({
|
|
551
|
+
command: [
|
|
552
|
+
"bun",
|
|
553
|
+
"build",
|
|
554
|
+
shellQuote(absoluteEntrypoint),
|
|
555
|
+
"--outdir",
|
|
556
|
+
shellQuote(temp.artifactDir),
|
|
557
|
+
"--target",
|
|
558
|
+
"bun",
|
|
559
|
+
"--sourcemap=external",
|
|
560
|
+
].join(" "),
|
|
561
|
+
cwd: options.appPath,
|
|
562
|
+
env: processBuildEnv(options.env),
|
|
563
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
564
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
565
|
+
});
|
|
566
|
+
const budget = makeStagingBudget();
|
|
567
|
+
yield* withStagingDeadline(validateStagedDirectory(temp.artifactDir, budget), budget);
|
|
568
|
+
const outputFiles = (yield* fs.readDirectory(temp.artifactDir))
|
|
569
|
+
.filter((file) => file.endsWith(".js"))
|
|
570
|
+
.sort();
|
|
571
|
+
if (outputFiles.length === 0) {
|
|
572
|
+
return yield* Effect.fail(new Error("Bun build produced no JavaScript output."));
|
|
573
|
+
}
|
|
574
|
+
const expected = `${path.basename(absoluteEntrypoint, path.extname(absoluteEntrypoint))}.js`;
|
|
575
|
+
return {
|
|
576
|
+
directory: temp.artifactDir,
|
|
577
|
+
entrypoint: outputFiles.includes(expected) ? expected : outputFiles[0],
|
|
578
|
+
cleanup: temp.cleanup,
|
|
579
|
+
};
|
|
580
|
+
});
|
|
581
|
+
return yield* build.pipe(Effect.catch((error) => temp.cleanup.pipe(Effect.andThen(Effect.fail(error)))));
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
const resolveBunEntrypoint = Effect.fn(function* (appPath, entrypoint) {
|
|
585
|
+
const fs = yield* FileSystem.FileSystem;
|
|
586
|
+
const path = yield* Path.Path;
|
|
587
|
+
const candidate = entrypoint ?? (yield* readPackageMain(appPath));
|
|
588
|
+
if (!candidate) {
|
|
589
|
+
return yield* Effect.fail(new Error("Prisma Compute auto-build needs an entrypoint for Bun apps. Set `entrypoint` or package.json `main`."));
|
|
590
|
+
}
|
|
591
|
+
const normalized = yield* normalizeEntrypoint(candidate);
|
|
592
|
+
const entrypointPath = path.join(appPath, normalized);
|
|
593
|
+
if (!(yield* fs.exists(entrypointPath))) {
|
|
594
|
+
return yield* Effect.fail(new Error(`Entrypoint file does not exist: ${entrypointPath}`));
|
|
595
|
+
}
|
|
596
|
+
const realAppPath = yield* fs.realPath(appPath);
|
|
597
|
+
const realEntrypointPath = yield* fs.realPath(entrypointPath);
|
|
598
|
+
yield* assertPathWithinRoots(realEntrypointPath, [realAppPath], entrypointPath);
|
|
599
|
+
return normalized;
|
|
600
|
+
});
|
|
601
|
+
const makeTempArtifactDir = Effect.fn(function* (leaf = "app") {
|
|
602
|
+
const fs = yield* FileSystem.FileSystem;
|
|
603
|
+
const path = yield* Path.Path;
|
|
604
|
+
const tempDir = yield* fs.makeTempDirectory({
|
|
605
|
+
prefix: "alchemy-prisma-compute-build-",
|
|
606
|
+
});
|
|
607
|
+
const artifactDir = path.join(tempDir, leaf);
|
|
608
|
+
yield* fs.makeDirectory(artifactDir, { recursive: true });
|
|
609
|
+
return {
|
|
610
|
+
artifactDir,
|
|
611
|
+
cleanup: fs.remove(tempDir, { recursive: true }).pipe(Effect.ignore),
|
|
612
|
+
};
|
|
613
|
+
});
|
|
614
|
+
const hasRootFile = Effect.fn(function* (appPath, filenames) {
|
|
615
|
+
const fs = yield* FileSystem.FileSystem;
|
|
616
|
+
const entries = yield* fs
|
|
617
|
+
.readDirectory(appPath)
|
|
618
|
+
.pipe(Effect.catch(() => Effect.succeed([])));
|
|
619
|
+
return entries.some((entry) => filenames.includes(entry));
|
|
620
|
+
});
|
|
621
|
+
const hasPackageDependency = Effect.fn(function* (appPath, packageNames) {
|
|
622
|
+
const parsed = yield* readPackageJson(appPath);
|
|
623
|
+
if (!parsed)
|
|
624
|
+
return false;
|
|
625
|
+
const deps = isRecord(parsed.dependencies) ? parsed.dependencies : {};
|
|
626
|
+
const devDeps = isRecord(parsed.devDependencies)
|
|
627
|
+
? parsed.devDependencies
|
|
628
|
+
: {};
|
|
629
|
+
return packageNames.some((name) => name in deps || name in devDeps);
|
|
630
|
+
});
|
|
631
|
+
const readPackageMain = Effect.fn(function* (appPath) {
|
|
632
|
+
const parsed = yield* readPackageJson(appPath);
|
|
633
|
+
return typeof parsed?.main === "string" ? parsed.main : undefined;
|
|
634
|
+
});
|
|
635
|
+
const readPackageScript = Effect.fn(function* (appPath, scriptName) {
|
|
636
|
+
const parsed = yield* readPackageJson(appPath);
|
|
637
|
+
const scripts = isRecord(parsed?.scripts) ? parsed.scripts : undefined;
|
|
638
|
+
const script = scripts?.[scriptName];
|
|
639
|
+
return typeof script === "string" && script.trim() !== ""
|
|
640
|
+
? script
|
|
641
|
+
: undefined;
|
|
642
|
+
});
|
|
643
|
+
const readPackageJson = Effect.fn(function* (appPath) {
|
|
644
|
+
const fs = yield* FileSystem.FileSystem;
|
|
645
|
+
const path = yield* Path.Path;
|
|
646
|
+
const packagePath = path.join(appPath, "package.json");
|
|
647
|
+
const text = yield* fs
|
|
648
|
+
.readFileString(packagePath)
|
|
649
|
+
.pipe(Effect.catch((error) => error._tag === "PlatformError" && error.reason._tag === "NotFound"
|
|
650
|
+
? Effect.succeed(undefined)
|
|
651
|
+
: Effect.fail(error)));
|
|
652
|
+
if (!text)
|
|
653
|
+
return undefined;
|
|
654
|
+
return yield* Effect.try({
|
|
655
|
+
try: () => JSON.parse(text),
|
|
656
|
+
catch: (cause) => new Error(`Failed to parse package.json in ${appPath}: ${cause}`),
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
const readNestCliConfig = Effect.fn(function* (appPath) {
|
|
660
|
+
const parsed = yield* readJsonObjectFile(appPath, NEST_CLI_FILENAME);
|
|
661
|
+
return {
|
|
662
|
+
sourceRoot: typeof parsed?.sourceRoot === "string" ? parsed.sourceRoot : undefined,
|
|
663
|
+
entryFile: typeof parsed?.entryFile === "string" ? parsed.entryFile : undefined,
|
|
664
|
+
};
|
|
665
|
+
});
|
|
666
|
+
const readNestjsOutDir = Effect.fn(function* (appPath) {
|
|
667
|
+
const fs = yield* FileSystem.FileSystem;
|
|
668
|
+
const path = yield* Path.Path;
|
|
669
|
+
for (const fileName of NEST_TSCONFIG_FILENAMES) {
|
|
670
|
+
const filePath = path.join(appPath, fileName);
|
|
671
|
+
const text = yield* fs
|
|
672
|
+
.readFileString(filePath)
|
|
673
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
674
|
+
if (text === undefined)
|
|
675
|
+
continue;
|
|
676
|
+
const outDir = yield* parseTsconfigOutDir(text);
|
|
677
|
+
if (outDir !== undefined)
|
|
678
|
+
return outDir;
|
|
679
|
+
}
|
|
680
|
+
return "dist";
|
|
681
|
+
});
|
|
682
|
+
const parseTsconfigOutDir = Effect.fn(function* (content) {
|
|
683
|
+
const parsed = yield* Effect.try({
|
|
684
|
+
try: () => JSON.parse(stripJsonComments(content)),
|
|
685
|
+
catch: (cause) => cause instanceof Error ? cause : new Error(String(cause)),
|
|
686
|
+
}).pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
687
|
+
const outDir = parsed?.compilerOptions?.outDir;
|
|
688
|
+
return typeof outDir === "string" ? normalizeRelativePath(outDir) : undefined;
|
|
689
|
+
});
|
|
690
|
+
const readJsonObjectFile = Effect.fn(function* (directory, fileName) {
|
|
691
|
+
const fs = yield* FileSystem.FileSystem;
|
|
692
|
+
const path = yield* Path.Path;
|
|
693
|
+
const text = yield* fs
|
|
694
|
+
.readFileString(path.join(directory, fileName))
|
|
695
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
696
|
+
if (text === undefined)
|
|
697
|
+
return undefined;
|
|
698
|
+
return yield* Effect.try({
|
|
699
|
+
try: () => {
|
|
700
|
+
const parsed = JSON.parse(text);
|
|
701
|
+
return isRecord(parsed) ? parsed : undefined;
|
|
702
|
+
},
|
|
703
|
+
catch: (cause) => cause instanceof Error ? cause : new Error(String(cause)),
|
|
704
|
+
}).pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
705
|
+
});
|
|
706
|
+
const directoryExists = Effect.fn(function* (dirPath) {
|
|
707
|
+
const fs = yield* FileSystem.FileSystem;
|
|
708
|
+
const stat = yield* fs
|
|
709
|
+
.stat(dirPath)
|
|
710
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
711
|
+
return stat?.type === "Directory";
|
|
712
|
+
});
|
|
713
|
+
const stageTracedPath = Effect.fn(function* (sourcePath, destinationPath, allowedRoots, targetRoot, budget) {
|
|
714
|
+
const fs = yield* FileSystem.FileSystem;
|
|
715
|
+
const path = yield* Path.Path;
|
|
716
|
+
const symlinkTarget = yield* fs
|
|
717
|
+
.readLink(sourcePath)
|
|
718
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
719
|
+
const stat = yield* fs
|
|
720
|
+
.stat(sourcePath)
|
|
721
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
722
|
+
if (stat === undefined && symlinkTarget === undefined) {
|
|
723
|
+
return yield* Effect.fail(new Error(`NestJS dependency disappeared while staging: ${sourcePath}`));
|
|
724
|
+
}
|
|
725
|
+
yield* assertSafeStagingDestination(destinationPath, targetRoot);
|
|
726
|
+
yield* fs.makeDirectory(path.dirname(destinationPath), { recursive: true });
|
|
727
|
+
if (symlinkTarget !== undefined) {
|
|
728
|
+
const validatedTarget = yield* validateStagedSymlink(sourcePath, allowedRoots);
|
|
729
|
+
yield* accountStagingEntry(budget, sourcePath, 0);
|
|
730
|
+
yield* assertPathWithinRoots(path.resolve(path.dirname(destinationPath), validatedTarget), [targetRoot], destinationPath);
|
|
731
|
+
yield* fs.remove(destinationPath, { recursive: true, force: true });
|
|
732
|
+
yield* fs.symlink(validatedTarget, destinationPath);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
if (stat?.type === "File") {
|
|
736
|
+
yield* assertRealPathWithinRoots(sourcePath, allowedRoots);
|
|
737
|
+
const size = yield* safeFileSize(sourcePath, stat.size);
|
|
738
|
+
yield* accountStagingEntry(budget, sourcePath, size);
|
|
739
|
+
yield* fs.copyFile(sourcePath, destinationPath);
|
|
740
|
+
const copied = yield* fs.stat(destinationPath);
|
|
741
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
742
|
+
yield* fs.remove(destinationPath, { force: true }).pipe(Effect.ignore);
|
|
743
|
+
return yield* Effect.fail(new Error(`Compute artifact file changed while staging: ${sourcePath}`));
|
|
744
|
+
}
|
|
745
|
+
yield* fs.chmod(destinationPath, stat.mode & 0o777);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
yield* accountStagingEntry(budget, sourcePath, 0);
|
|
749
|
+
return yield* Effect.fail(new Error(`Unsupported filesystem entry in NestJS dependency trace: ${sourcePath}`));
|
|
750
|
+
});
|
|
751
|
+
const makeStagingBudget = () => ({
|
|
752
|
+
entries: 0,
|
|
753
|
+
totalBytes: 0,
|
|
754
|
+
deadline: Date.now() + STAGING_TIMEOUT_SECONDS * 1000,
|
|
755
|
+
});
|
|
756
|
+
const withStagingDeadline = (effect, budget) => effect.pipe(Effect.timeoutOption(Duration.millis(Math.max(1, budget.deadline - Date.now()))), Effect.flatMap((result) => Option.isSome(result)
|
|
757
|
+
? Effect.succeed(result.value)
|
|
758
|
+
: Effect.fail(new Error(`Compute artifact staging timed out after ${STAGING_TIMEOUT_SECONDS} seconds.`))));
|
|
759
|
+
const accountStagingEntry = (budget, source, size) => {
|
|
760
|
+
if (Date.now() > budget.deadline) {
|
|
761
|
+
return Effect.fail(new Error(`Compute artifact staging timed out after ${STAGING_TIMEOUT_SECONDS} seconds.`));
|
|
762
|
+
}
|
|
763
|
+
if (size > STAGING_MAX_FILE_BYTES) {
|
|
764
|
+
return Effect.fail(new Error(`Compute artifact file exceeds the ${STAGING_MAX_FILE_BYTES} byte per-file safety limit: ${source}`));
|
|
765
|
+
}
|
|
766
|
+
const entries = budget.entries + 1;
|
|
767
|
+
if (entries > STAGING_MAX_ENTRIES) {
|
|
768
|
+
return Effect.fail(new Error(`Compute artifact staging exceeded the ${STAGING_MAX_ENTRIES} entry safety limit.`));
|
|
769
|
+
}
|
|
770
|
+
const totalBytes = budget.totalBytes + size;
|
|
771
|
+
if (!Number.isSafeInteger(totalBytes) ||
|
|
772
|
+
totalBytes > STAGING_MAX_TOTAL_BYTES) {
|
|
773
|
+
return Effect.fail(new Error(`Compute artifact staging exceeded the ${STAGING_MAX_TOTAL_BYTES} byte total safety limit.`));
|
|
774
|
+
}
|
|
775
|
+
budget.entries = entries;
|
|
776
|
+
budget.totalBytes = totalBytes;
|
|
777
|
+
return Effect.void;
|
|
778
|
+
};
|
|
779
|
+
const safeFileSize = (source, rawSize) => {
|
|
780
|
+
const size = Number(rawSize);
|
|
781
|
+
return Number.isSafeInteger(size) && size >= 0
|
|
782
|
+
? Effect.succeed(size)
|
|
783
|
+
: Effect.fail(new Error(`Compute artifact has an invalid file size: ${source}`));
|
|
784
|
+
};
|
|
785
|
+
const assertRealPathWithinRoots = Effect.fn(function* (source, allowedRoots) {
|
|
786
|
+
const fs = yield* FileSystem.FileSystem;
|
|
787
|
+
const realSource = yield* fs.realPath(source);
|
|
788
|
+
yield* assertPathWithinRoots(realSource, allowedRoots, source);
|
|
789
|
+
return realSource;
|
|
790
|
+
});
|
|
791
|
+
const assertSafeStagingDestination = Effect.fn(function* (destination, targetRoot) {
|
|
792
|
+
const fs = yield* FileSystem.FileSystem;
|
|
793
|
+
const path = yield* Path.Path;
|
|
794
|
+
const absoluteDestination = path.resolve(destination);
|
|
795
|
+
const absoluteTargetRoot = path.resolve(targetRoot);
|
|
796
|
+
yield* assertPathWithinRoots(absoluteDestination, [absoluteTargetRoot], destination);
|
|
797
|
+
let existingAncestor = absoluteDestination;
|
|
798
|
+
while (!(yield* fs.exists(existingAncestor))) {
|
|
799
|
+
const isDanglingSymlink = yield* fs.readLink(existingAncestor).pipe(Effect.as(true), Effect.catch(() => Effect.succeed(false)));
|
|
800
|
+
if (isDanglingSymlink) {
|
|
801
|
+
return yield* Effect.fail(new Error(`Compute artifact destination contains a dangling symlink: ${existingAncestor}`));
|
|
802
|
+
}
|
|
803
|
+
const parent = path.dirname(existingAncestor);
|
|
804
|
+
if (parent === existingAncestor) {
|
|
805
|
+
return yield* Effect.fail(new Error(`Could not establish a safe compute artifact destination: ${destination}`));
|
|
806
|
+
}
|
|
807
|
+
existingAncestor = parent;
|
|
808
|
+
}
|
|
809
|
+
const realAncestor = yield* fs.realPath(existingAncestor);
|
|
810
|
+
const realTargetRoot = yield* fs.realPath(absoluteTargetRoot);
|
|
811
|
+
yield* assertPathWithinRoots(realAncestor, [realTargetRoot], destination);
|
|
812
|
+
});
|
|
813
|
+
const assertPathWithinRoots = Effect.fn(function* (realSource, allowedRoots, displaySource) {
|
|
814
|
+
const path = yield* Path.Path;
|
|
815
|
+
if (allowedRoots.some((root) => {
|
|
816
|
+
const relative = path.relative(root, realSource);
|
|
817
|
+
return (relative !== ".." &&
|
|
818
|
+
!relative.startsWith(`..${path.sep}`) &&
|
|
819
|
+
!path.isAbsolute(relative));
|
|
820
|
+
})) {
|
|
821
|
+
return;
|
|
822
|
+
}
|
|
823
|
+
return yield* Effect.fail(new Error(`Compute artifact path escapes its staging root: ${displaySource}`));
|
|
824
|
+
});
|
|
825
|
+
const validateStagedSymlink = Effect.fn(function* (source, allowedRoots) {
|
|
826
|
+
const fs = yield* FileSystem.FileSystem;
|
|
827
|
+
const path = yield* Path.Path;
|
|
828
|
+
const target = yield* fs.readLink(source);
|
|
829
|
+
if (path.isAbsolute(target) || /^[a-zA-Z]:[\\/]/.test(target)) {
|
|
830
|
+
return yield* Effect.fail(new Error(`Compute artifact contains an absolute symlink: ${source}`));
|
|
831
|
+
}
|
|
832
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
833
|
+
return target;
|
|
834
|
+
});
|
|
835
|
+
const validateStagedDirectory = Effect.fn(function* (root, budget) {
|
|
836
|
+
const fs = yield* FileSystem.FileSystem;
|
|
837
|
+
const path = yield* Path.Path;
|
|
838
|
+
const realRoot = yield* fs.realPath(root);
|
|
839
|
+
const visit = Effect.fn(function* (directory) {
|
|
840
|
+
yield* assertRealPathWithinRoots(directory, [realRoot]);
|
|
841
|
+
const entries = (yield* readDirectoryEntries(directory)).sort((a, b) => a.name.localeCompare(b.name));
|
|
842
|
+
for (const entry of entries) {
|
|
843
|
+
const source = path.join(directory, entry.name);
|
|
844
|
+
if (entry.type === "SymbolicLink") {
|
|
845
|
+
yield* validateStagedSymlink(source, [realRoot]);
|
|
846
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
847
|
+
continue;
|
|
848
|
+
}
|
|
849
|
+
if (entry.type === "Directory") {
|
|
850
|
+
yield* assertRealPathWithinRoots(source, [realRoot]);
|
|
851
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
852
|
+
yield* visit(source);
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (entry.type === "File") {
|
|
856
|
+
yield* assertRealPathWithinRoots(source, [realRoot]);
|
|
857
|
+
const stat = yield* fs.stat(source);
|
|
858
|
+
yield* accountStagingEntry(budget, source, yield* safeFileSize(source, stat.size));
|
|
859
|
+
continue;
|
|
860
|
+
}
|
|
861
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
862
|
+
return yield* Effect.fail(new Error(`Unsupported filesystem entry in compute artifact: ${source}`));
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
yield* visit(root);
|
|
866
|
+
});
|
|
867
|
+
const resolveSourceRoot = Effect.fn(function* (startPath) {
|
|
868
|
+
const fs = yield* FileSystem.FileSystem;
|
|
869
|
+
const path = yield* Path.Path;
|
|
870
|
+
const original = path.resolve(startPath);
|
|
871
|
+
let current = original;
|
|
872
|
+
while (true) {
|
|
873
|
+
if ((yield* fs.exists(path.join(current, ".git"))) ||
|
|
874
|
+
(yield* fs.exists(path.join(current, "pnpm-workspace.yaml"))) ||
|
|
875
|
+
(yield* fs.exists(path.join(current, "bun.lock"))) ||
|
|
876
|
+
(yield* fs.exists(path.join(current, "bun.lockb"))) ||
|
|
877
|
+
(yield* packageJsonDeclaresWorkspaces(current))) {
|
|
878
|
+
return current;
|
|
879
|
+
}
|
|
880
|
+
const parent = path.dirname(current);
|
|
881
|
+
if (parent === current)
|
|
882
|
+
return original;
|
|
883
|
+
current = parent;
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
const packageJsonDeclaresWorkspaces = Effect.fn(function* (directory) {
|
|
887
|
+
const parsed = yield* readJsonObjectFile(directory, "package.json");
|
|
888
|
+
return parsed?.workspaces !== undefined;
|
|
889
|
+
});
|
|
890
|
+
const packageCliCommand = Effect.fn(function* (appPath, cliName, args, missingMessage) {
|
|
891
|
+
const fs = yield* FileSystem.FileSystem;
|
|
892
|
+
const path = yield* Path.Path;
|
|
893
|
+
const sourceRoot = yield* resolveSourceRoot(appPath);
|
|
894
|
+
const executable = process.platform === "win32" ? `${cliName}.cmd` : cliName;
|
|
895
|
+
const candidates = Array.from(new Set([appPath, sourceRoot].map((root) => path.join(root, "node_modules", ".bin", executable))));
|
|
896
|
+
for (const candidate of candidates) {
|
|
897
|
+
const stat = yield* fs
|
|
898
|
+
.stat(candidate)
|
|
899
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
900
|
+
if (stat?.type === "File" &&
|
|
901
|
+
(process.platform === "win32" || (stat.mode & 0o111) !== 0)) {
|
|
902
|
+
const argText = args.map(shellQuote).join(" ");
|
|
903
|
+
return `${shellQuote(candidate)}${argText.length > 0 ? ` ${argText}` : ""}`;
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
return yield* Effect.fail(new Error(missingMessage));
|
|
907
|
+
});
|
|
908
|
+
const packageScriptCommand = (scriptName) => [
|
|
909
|
+
"if command -v bun >/dev/null 2>&1; then",
|
|
910
|
+
`bun run ${shellQuote(scriptName)};`,
|
|
911
|
+
"elif command -v npm >/dev/null 2>&1; then",
|
|
912
|
+
`npm run ${shellQuote(scriptName)};`,
|
|
913
|
+
"else",
|
|
914
|
+
`echo ${shellQuote("Could not find bun or npm to run package scripts.")} >&2; exit 127;`,
|
|
915
|
+
"fi",
|
|
916
|
+
].join(" ");
|
|
917
|
+
const processBuildEnv = (env = {}) => Object.fromEntries(Object.entries(env).flatMap(([key, value]) => value === undefined
|
|
918
|
+
? []
|
|
919
|
+
: [[key, Redacted.isRedacted(value) ? Redacted.value(value) : value]]));
|
|
920
|
+
const isRecord = (value) => typeof value === "object" && value !== null;
|
|
921
|
+
const normalizeRelativePath = (value) => {
|
|
922
|
+
const raw = value.trim().replaceAll("\\", "/");
|
|
923
|
+
if (raw.length === 0 || raw.startsWith("/") || /^[a-zA-Z]:\//.test(raw)) {
|
|
924
|
+
return undefined;
|
|
925
|
+
}
|
|
926
|
+
const parts = [];
|
|
927
|
+
for (const part of raw.split("/")) {
|
|
928
|
+
if (part === "" || part === ".")
|
|
929
|
+
continue;
|
|
930
|
+
if (part === "..") {
|
|
931
|
+
if (parts.length === 0)
|
|
932
|
+
return undefined;
|
|
933
|
+
parts.pop();
|
|
934
|
+
continue;
|
|
935
|
+
}
|
|
936
|
+
parts.push(part);
|
|
937
|
+
}
|
|
938
|
+
return parts.join("/") || ".";
|
|
939
|
+
};
|
|
940
|
+
const stripJsonComments = (content) => {
|
|
941
|
+
let result = "";
|
|
942
|
+
let inString = false;
|
|
943
|
+
let escaped = false;
|
|
944
|
+
for (let i = 0; i < content.length; i++) {
|
|
945
|
+
const char = content[i];
|
|
946
|
+
if (inString) {
|
|
947
|
+
result += char;
|
|
948
|
+
if (escaped) {
|
|
949
|
+
escaped = false;
|
|
950
|
+
}
|
|
951
|
+
else if (char === "\\") {
|
|
952
|
+
escaped = true;
|
|
953
|
+
}
|
|
954
|
+
else if (char === '"') {
|
|
955
|
+
inString = false;
|
|
956
|
+
}
|
|
957
|
+
continue;
|
|
958
|
+
}
|
|
959
|
+
if (char === '"') {
|
|
960
|
+
inString = true;
|
|
961
|
+
result += char;
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
const next = content[i + 1];
|
|
965
|
+
if (char === "/" && next === "/") {
|
|
966
|
+
while (i < content.length && content[i] !== "\n") {
|
|
967
|
+
i++;
|
|
968
|
+
}
|
|
969
|
+
if (i < content.length)
|
|
970
|
+
result += content[i];
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
if (char === "/" && next === "*") {
|
|
974
|
+
i += 2;
|
|
975
|
+
while (i < content.length &&
|
|
976
|
+
!(content[i] === "*" && content[i + 1] === "/")) {
|
|
977
|
+
i++;
|
|
978
|
+
}
|
|
979
|
+
i++;
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
result += char;
|
|
983
|
+
}
|
|
984
|
+
return result;
|
|
985
|
+
};
|
|
986
|
+
const shellQuote = (value) => `'${value.replaceAll("'", "'\\''")}'`;
|
|
987
|
+
//# sourceMappingURL=ComputeBuild.js.map
|