alchemy 2.0.0-beta.64 → 2.0.0-beta.66
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 +433 -181
- 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/InternetGateway.d.ts.map +1 -1
- package/lib/AWS/EC2/InternetGateway.js +8 -3
- package/lib/AWS/EC2/InternetGateway.js.map +1 -1
- package/lib/AWS/EC2/LingeringEnis.d.ts +26 -0
- package/lib/AWS/EC2/LingeringEnis.d.ts.map +1 -0
- package/lib/AWS/EC2/LingeringEnis.js +128 -0
- package/lib/AWS/EC2/LingeringEnis.js.map +1 -0
- package/lib/AWS/EC2/SecurityGroup.d.ts.map +1 -1
- package/lib/AWS/EC2/SecurityGroup.js +14 -14
- package/lib/AWS/EC2/SecurityGroup.js.map +1 -1
- package/lib/AWS/EC2/Subnet.d.ts.map +1 -1
- package/lib/AWS/EC2/Subnet.js +13 -21
- package/lib/AWS/EC2/Subnet.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 +133 -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/Addon.d.ts.map +1 -1
- package/lib/AWS/EKS/Addon.js +15 -3
- package/lib/AWS/EKS/Addon.js.map +1 -1
- package/lib/AWS/EKS/Deployment.d.ts +10 -1
- package/lib/AWS/EKS/Deployment.d.ts.map +1 -1
- package/lib/AWS/EKS/Deployment.js +20 -6
- package/lib/AWS/EKS/Deployment.js.map +1 -1
- package/lib/AWS/EKS/HyperPod.d.ts +57 -0
- package/lib/AWS/EKS/HyperPod.d.ts.map +1 -0
- package/lib/AWS/EKS/HyperPod.js +46 -0
- package/lib/AWS/EKS/HyperPod.js.map +1 -0
- package/lib/AWS/EKS/Job.d.ts +10 -1
- package/lib/AWS/EKS/Job.d.ts.map +1 -1
- package/lib/AWS/EKS/Job.js +26 -8
- package/lib/AWS/EKS/Job.js.map +1 -1
- package/lib/AWS/EKS/internal/client.d.ts +4 -3
- package/lib/AWS/EKS/internal/client.d.ts.map +1 -1
- package/lib/AWS/EKS/internal/client.js +33 -2
- package/lib/AWS/EKS/internal/client.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 +68 -30
- 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 +9 -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/SageMaker/Cluster.d.ts +327 -0
- package/lib/AWS/SageMaker/Cluster.d.ts.map +1 -0
- package/lib/AWS/SageMaker/Cluster.js +469 -0
- package/lib/AWS/SageMaker/Cluster.js.map +1 -0
- package/lib/AWS/SageMaker/ClusterSchedulerConfig.d.ts +96 -0
- package/lib/AWS/SageMaker/ClusterSchedulerConfig.d.ts.map +1 -0
- package/lib/AWS/SageMaker/ClusterSchedulerConfig.js +270 -0
- package/lib/AWS/SageMaker/ClusterSchedulerConfig.js.map +1 -0
- package/lib/AWS/SageMaker/ComputeQuota.d.ts +106 -0
- package/lib/AWS/SageMaker/ComputeQuota.d.ts.map +1 -0
- package/lib/AWS/SageMaker/ComputeQuota.js +268 -0
- package/lib/AWS/SageMaker/ComputeQuota.js.map +1 -0
- package/lib/AWS/SageMaker/index.d.ts +3 -0
- package/lib/AWS/SageMaker/index.d.ts.map +1 -1
- package/lib/AWS/SageMaker/index.js +3 -0
- package/lib/AWS/SageMaker/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 +29 -7
- package/lib/Bundle/PurePlugin.d.ts.map +1 -1
- package/lib/Bundle/PurePlugin.js +71 -40
- 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/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/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +231 -37
- package/lib/Cli/commands/nuke.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/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 +32 -3
- 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/Assets.d.ts +26 -8
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +46 -1
- package/lib/Cloudflare/Workers/Assets.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 +520 -302
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +619 -18
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +222 -2
- 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 +20 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +15 -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 +1775 -240
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts +9 -2
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.js +19 -9
- package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
- package/lib/Cloudflare/Workflows/index.d.ts +1 -1
- package/lib/Cloudflare/Workflows/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/index.js +1 -1
- package/lib/Cloudflare/Workflows/index.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 +41 -1
- package/lib/Docker/Container.d.ts.map +1 -1
- package/lib/Docker/Container.js +54 -12
- 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 +192 -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/Output.d.ts +4 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.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 +80 -0
- package/lib/Prisma/App.d.ts.map +1 -0
- package/lib/Prisma/App.js +238 -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 +75 -0
- package/lib/Prisma/Branch.d.ts.map +1 -0
- package/lib/Prisma/Branch.js +216 -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 +583 -0
- package/lib/Prisma/Compute.d.ts.map +1 -0
- package/lib/Prisma/Compute.js +1543 -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 +99 -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 +202 -0
- package/lib/Prisma/Connection.d.ts.map +1 -0
- package/lib/Prisma/Connection.js +346 -0
- package/lib/Prisma/Connection.js.map +1 -0
- package/lib/Prisma/CustomDomain.d.ts +81 -0
- package/lib/Prisma/CustomDomain.d.ts.map +1 -0
- package/lib/Prisma/CustomDomain.js +175 -0
- package/lib/Prisma/CustomDomain.js.map +1 -0
- package/lib/Prisma/Database.d.ts +208 -0
- package/lib/Prisma/Database.d.ts.map +1 -0
- package/lib/Prisma/Database.js +405 -0
- package/lib/Prisma/Database.js.map +1 -0
- package/lib/Prisma/Deployment.d.ts +135 -0
- package/lib/Prisma/Deployment.d.ts.map +1 -0
- package/lib/Prisma/Deployment.js +348 -0
- package/lib/Prisma/Deployment.js.map +1 -0
- package/lib/Prisma/EnvironmentVariable.d.ts +89 -0
- package/lib/Prisma/EnvironmentVariable.d.ts.map +1 -0
- package/lib/Prisma/EnvironmentVariable.js +213 -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 +24 -0
- package/lib/Prisma/Postgres.d.ts.map +1 -0
- package/lib/Prisma/Postgres.js +23 -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 +117 -0
- package/lib/Prisma/Project.d.ts.map +1 -0
- package/lib/Prisma/Project.js +361 -0
- package/lib/Prisma/Project.js.map +1 -0
- package/lib/Prisma/Providers.d.ts +61 -0
- package/lib/Prisma/Providers.d.ts.map +1 -0
- package/lib/Prisma/Providers.js +282 -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 +104 -0
- package/lib/Prisma/SourceRepository.d.ts.map +1 -0
- package/lib/Prisma/SourceRepository.js +221 -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 +77 -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/Random.d.ts +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Resource.d.ts +22 -1
- 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/SQL/D1.d.ts +1 -1
- package/lib/SQL/D1.js +1 -1
- package/lib/SQL/Postgres.d.ts +1 -1
- package/lib/SQL/Postgres.js +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/HttpStateApi.d.ts +11 -11
- 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 +1 -1
- package/lib/Test/Alchemy.d.ts.map +1 -1
- package/lib/Test/Alchemy.js +4 -2
- 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/Test/Vitest.d.ts +58 -0
- package/lib/Test/Vitest.d.ts.map +1 -0
- package/lib/Test/Vitest.js +114 -0
- package/lib/Test/Vitest.js.map +1 -0
- 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/proxy-chain.d.ts +5 -0
- package/lib/Util/proxy-chain.d.ts.map +1 -1
- package/lib/Util/proxy-chain.js +52 -4
- package/lib/Util/proxy-chain.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 +59 -18
- 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/InternetGateway.ts +8 -3
- package/src/AWS/EC2/LingeringEnis.ts +169 -0
- package/src/AWS/EC2/SecurityGroup.ts +24 -28
- package/src/AWS/EC2/Subnet.ts +23 -34
- 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/Addon.ts +17 -4
- package/src/AWS/EKS/Deployment.ts +36 -7
- package/src/AWS/EKS/HyperPod.ts +97 -0
- package/src/AWS/EKS/Job.ts +42 -9
- package/src/AWS/EKS/internal/client.ts +40 -3
- package/src/AWS/Lambda/Function.ts +106 -46
- 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 +16 -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/SageMaker/Cluster.ts +775 -0
- package/src/AWS/SageMaker/ClusterSchedulerConfig.ts +430 -0
- package/src/AWS/SageMaker/ComputeQuota.ts +426 -0
- package/src/AWS/SageMaker/index.ts +3 -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 +109 -46
- package/src/Cli/checkVersion.ts +102 -16
- package/src/Cli/commands/deploy.ts +3 -14
- package/src/Cli/commands/logs.ts +6 -1
- package/src/Cli/commands/nuke.ts +295 -56
- 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 +154 -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/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/Assets.ts +53 -1
- 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 +662 -405
- package/src/Cloudflare/Workers/Worker.ts +683 -33
- 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 +37 -2
- package/src/Cloudflare/Workers/WorkerProvider.ts +2287 -281
- package/src/Cloudflare/Workflows/WorkflowBridge.ts +36 -18
- package/src/Cloudflare/Workflows/index.ts +1 -1
- 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 +85 -16
- package/src/Docker/Context.ts +236 -0
- package/src/Docker/Docker.ts +395 -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/Output.ts +19 -11
- 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 +420 -0
- package/src/Prisma/AuthProvider.ts +260 -0
- package/src/Prisma/Branch.ts +396 -0
- package/src/Prisma/Client.ts +1337 -0
- package/src/Prisma/Compute.ts +2876 -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 +410 -0
- package/src/Prisma/Connection.ts +626 -0
- package/src/Prisma/CustomDomain.ts +363 -0
- package/src/Prisma/Database.ts +836 -0
- package/src/Prisma/Deployment.ts +655 -0
- package/src/Prisma/EnvironmentVariable.ts +401 -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 +24 -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 +681 -0
- package/src/Prisma/Providers.ts +411 -0
- package/src/Prisma/Refs.ts +69 -0
- package/src/Prisma/SourceRepository.ts +432 -0
- package/src/Prisma/Types.ts +611 -0
- package/src/Prisma/index.ts +24 -0
- package/src/Provider.ts +175 -39
- package/src/ProviderMode.ts +123 -0
- package/src/Resource.ts +64 -1
- package/src/RuntimeContext.ts +7 -0
- package/src/SQL/D1.ts +1 -1
- package/src/SQL/Postgres.ts +1 -1
- 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 +4 -2
- package/src/Test/Core.ts +1 -8
- package/src/Test/Vitest.ts +244 -0
- package/src/Util/Clank.ts +37 -11
- package/src/Util/proxy-chain.ts +73 -4
- package/src/Util/zip.ts +39 -0
- package/src/index.ts +3 -0
- package/lib/SQL/index.d.ts +0 -4
- package/lib/SQL/index.d.ts.map +0 -1
- package/lib/SQL/index.js +0 -4
- package/lib/SQL/index.js.map +0 -1
- package/src/SQL/index.ts +0 -3
|
@@ -0,0 +1,1652 @@
|
|
|
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 type { Scope } from "effect/Scope";
|
|
9
|
+
import * as ChildProcess from "effect/unstable/process/ChildProcess";
|
|
10
|
+
import { ChildProcessSpawner } from "effect/unstable/process/ChildProcessSpawner";
|
|
11
|
+
import { nodeFileTrace } from "@vercel/nft";
|
|
12
|
+
import { normalizeEntrypoint } from "./ComputeArchive.ts";
|
|
13
|
+
|
|
14
|
+
export type ComputeAutoBuildFramework =
|
|
15
|
+
| "auto"
|
|
16
|
+
| "nextjs"
|
|
17
|
+
| "nuxt"
|
|
18
|
+
| "astro"
|
|
19
|
+
| "nestjs"
|
|
20
|
+
| "tanstack-start"
|
|
21
|
+
| "bun";
|
|
22
|
+
|
|
23
|
+
export interface ComputeAutoBuildOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Application root.
|
|
26
|
+
*/
|
|
27
|
+
appPath: string;
|
|
28
|
+
/**
|
|
29
|
+
* Entrypoint used by the Bun fallback strategy.
|
|
30
|
+
*/
|
|
31
|
+
entrypoint?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Framework to build. `auto` tries Next.js, Nuxt, Astro, TanStack Start,
|
|
34
|
+
* then Bun.
|
|
35
|
+
*
|
|
36
|
+
* @default "auto"
|
|
37
|
+
*/
|
|
38
|
+
framework?: ComputeAutoBuildFramework;
|
|
39
|
+
/**
|
|
40
|
+
* Environment variables supplied to the build command.
|
|
41
|
+
* Ambient `PRISMA_SERVICE_TOKEN` and `PRISMA_API_TOKEN` credentials are not
|
|
42
|
+
* inherited; include one here explicitly only when the application build
|
|
43
|
+
* genuinely needs Prisma Management API access.
|
|
44
|
+
*
|
|
45
|
+
* Plain strings are persisted in Alchemy state when this is configured
|
|
46
|
+
* through `Prisma.Compute`. Wrap secrets with `Redacted.make(secret)`.
|
|
47
|
+
*
|
|
48
|
+
* ```typescript
|
|
49
|
+
* env: { NPM_TOKEN: Redacted.make(process.env.NPM_TOKEN!) }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
env?: Record<string, string | Redacted.Redacted<string> | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Maximum bytes retained from each build output stream.
|
|
55
|
+
*
|
|
56
|
+
* @default 1048576 (1 MiB)
|
|
57
|
+
*/
|
|
58
|
+
outputLimitBytes?: number;
|
|
59
|
+
/**
|
|
60
|
+
* Maximum wall-clock time for the framework build command.
|
|
61
|
+
*
|
|
62
|
+
* @default 900 (15 minutes)
|
|
63
|
+
*/
|
|
64
|
+
timeoutSeconds?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ComputeBuildArtifact {
|
|
68
|
+
/**
|
|
69
|
+
* Directory to archive and upload.
|
|
70
|
+
*/
|
|
71
|
+
directory: string;
|
|
72
|
+
/**
|
|
73
|
+
* Entrypoint relative to `directory`.
|
|
74
|
+
*/
|
|
75
|
+
entrypoint: string;
|
|
76
|
+
/**
|
|
77
|
+
* Default HTTP port for framework conventions.
|
|
78
|
+
*/
|
|
79
|
+
defaultPort?: number;
|
|
80
|
+
/**
|
|
81
|
+
* Removes temporary build output.
|
|
82
|
+
*/
|
|
83
|
+
cleanup: Effect.Effect<void, never, FileSystem.FileSystem>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface BuildStrategy {
|
|
87
|
+
name: Exclude<ComputeAutoBuildFramework, "auto">;
|
|
88
|
+
canBuild: (appPath: string) => Effect.Effect<boolean, unknown, BuildServices>;
|
|
89
|
+
execute: (
|
|
90
|
+
options: Required<Pick<ComputeAutoBuildOptions, "appPath">> &
|
|
91
|
+
Omit<ComputeAutoBuildOptions, "appPath">,
|
|
92
|
+
) => Effect.Effect<ComputeBuildArtifact, unknown, BuildServices>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
interface DirectoryEntry {
|
|
96
|
+
name: string;
|
|
97
|
+
type: "Directory" | "File" | "SymbolicLink" | "Other";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
type BuildServices =
|
|
101
|
+
| ChildProcessSpawner
|
|
102
|
+
| FileSystem.FileSystem
|
|
103
|
+
| Path.Path
|
|
104
|
+
| Scope;
|
|
105
|
+
|
|
106
|
+
export interface RunBuildCommandOptions {
|
|
107
|
+
command: string;
|
|
108
|
+
cwd?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Explicit environment variables supplied to the build command. Ambient
|
|
111
|
+
* Prisma Management API credentials are withheld unless they are provided
|
|
112
|
+
* here intentionally.
|
|
113
|
+
*/
|
|
114
|
+
env?: Record<string, string>;
|
|
115
|
+
/**
|
|
116
|
+
* Maximum bytes retained from each output stream before the build is
|
|
117
|
+
* interrupted. This prevents noisy build tools from exhausting memory.
|
|
118
|
+
*
|
|
119
|
+
* @default 1048576 (1 MiB)
|
|
120
|
+
*/
|
|
121
|
+
outputLimitBytes?: number;
|
|
122
|
+
/**
|
|
123
|
+
* Maximum wall-clock time for the build command.
|
|
124
|
+
*
|
|
125
|
+
* @default 900 (15 minutes)
|
|
126
|
+
*/
|
|
127
|
+
timeoutSeconds?: number;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const DEFAULT_BUILD_OUTPUT_LIMIT_BYTES = 1024 * 1024;
|
|
131
|
+
const DEFAULT_BUILD_TIMEOUT_SECONDS = 15 * 60;
|
|
132
|
+
const STAGING_MAX_ENTRIES = 50_000;
|
|
133
|
+
const STAGING_MAX_TOTAL_BYTES = 256 * 1024 * 1024;
|
|
134
|
+
const STAGING_MAX_FILE_BYTES = 128 * 1024 * 1024;
|
|
135
|
+
const STAGING_TIMEOUT_SECONDS = 2 * 60;
|
|
136
|
+
const PRISMA_MANAGEMENT_CREDENTIAL_ENV_NAMES = new Set([
|
|
137
|
+
"PRISMA_SERVICE_TOKEN",
|
|
138
|
+
"PRISMA_API_TOKEN",
|
|
139
|
+
]);
|
|
140
|
+
|
|
141
|
+
interface StagingBudget {
|
|
142
|
+
entries: number;
|
|
143
|
+
totalBytes: number;
|
|
144
|
+
readonly deadline: number;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const collectBoundedOutput = (
|
|
148
|
+
stream: Stream.Stream<Uint8Array, unknown>,
|
|
149
|
+
label: string,
|
|
150
|
+
limit: number,
|
|
151
|
+
) =>
|
|
152
|
+
Stream.runFoldEffect(
|
|
153
|
+
stream,
|
|
154
|
+
() => ({ chunks: [] as Uint8Array[], bytes: 0 }),
|
|
155
|
+
(state, chunk) => {
|
|
156
|
+
const bytes = state.bytes + chunk.byteLength;
|
|
157
|
+
return bytes > limit
|
|
158
|
+
? Effect.fail(
|
|
159
|
+
new Error(
|
|
160
|
+
`Build ${label} exceeded the ${limit} byte output safety limit. Reduce build verbosity or raise outputLimitBytes explicitly.`,
|
|
161
|
+
),
|
|
162
|
+
)
|
|
163
|
+
: Effect.sync(() => {
|
|
164
|
+
state.chunks.push(chunk);
|
|
165
|
+
return { chunks: state.chunks, bytes };
|
|
166
|
+
});
|
|
167
|
+
},
|
|
168
|
+
).pipe(
|
|
169
|
+
Effect.map(({ chunks, bytes }) => {
|
|
170
|
+
const output = new Uint8Array(bytes);
|
|
171
|
+
let offset = 0;
|
|
172
|
+
for (const chunk of chunks) {
|
|
173
|
+
output.set(chunk, offset);
|
|
174
|
+
offset += chunk.byteLength;
|
|
175
|
+
}
|
|
176
|
+
return { text: new TextDecoder().decode(output), bytes };
|
|
177
|
+
}),
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Run a shell build command, dying on non-zero exit. Local stand-in for the
|
|
182
|
+
* removed `Build/Command.ts` helper. Build commands inherit the ambient
|
|
183
|
+
* environment except for Prisma Management API credentials, which must be
|
|
184
|
+
* passed explicitly through `env` when a build genuinely needs them.
|
|
185
|
+
*/
|
|
186
|
+
export const runBuildCommand = Effect.fn(function* ({
|
|
187
|
+
command,
|
|
188
|
+
cwd,
|
|
189
|
+
env,
|
|
190
|
+
outputLimitBytes = DEFAULT_BUILD_OUTPUT_LIMIT_BYTES,
|
|
191
|
+
timeoutSeconds = DEFAULT_BUILD_TIMEOUT_SECONDS,
|
|
192
|
+
}: RunBuildCommandOptions) {
|
|
193
|
+
if (!Number.isSafeInteger(outputLimitBytes) || outputLimitBytes <= 0) {
|
|
194
|
+
return yield* Effect.fail(
|
|
195
|
+
new Error("outputLimitBytes must be a positive safe integer"),
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
|
|
199
|
+
return yield* Effect.fail(
|
|
200
|
+
new Error("timeoutSeconds must be a positive finite number"),
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const spawner = yield* ChildProcessSpawner;
|
|
204
|
+
const path = yield* Path.Path;
|
|
205
|
+
const resultOption = yield* Effect.scoped(
|
|
206
|
+
Effect.gen(function* () {
|
|
207
|
+
const handle = yield* spawner.spawn(
|
|
208
|
+
ChildProcess.make(command, [], {
|
|
209
|
+
cwd: path.resolve(cwd ?? "."),
|
|
210
|
+
shell: true,
|
|
211
|
+
env: buildProcessEnvironment(env),
|
|
212
|
+
extendEnv: false,
|
|
213
|
+
stdin: "ignore",
|
|
214
|
+
stdout: "pipe",
|
|
215
|
+
stderr: "pipe",
|
|
216
|
+
killSignal: "SIGKILL",
|
|
217
|
+
}),
|
|
218
|
+
);
|
|
219
|
+
const result = yield* Effect.all(
|
|
220
|
+
{
|
|
221
|
+
exitCode: handle.exitCode,
|
|
222
|
+
stdout: collectBoundedOutput(
|
|
223
|
+
handle.stdout,
|
|
224
|
+
"stdout",
|
|
225
|
+
outputLimitBytes,
|
|
226
|
+
),
|
|
227
|
+
stderr: collectBoundedOutput(
|
|
228
|
+
handle.stderr,
|
|
229
|
+
"stderr",
|
|
230
|
+
outputLimitBytes,
|
|
231
|
+
),
|
|
232
|
+
},
|
|
233
|
+
{ concurrency: "unbounded" },
|
|
234
|
+
);
|
|
235
|
+
// A successful build shell can still leave daemonized descendants in
|
|
236
|
+
// its detached process group. Always reap the group after output has
|
|
237
|
+
// closed; ESRCH is expected when no descendants remain.
|
|
238
|
+
yield* handle.kill({ killSignal: "SIGKILL" }).pipe(Effect.ignore);
|
|
239
|
+
return result;
|
|
240
|
+
}).pipe(Effect.timeoutOption(Duration.seconds(timeoutSeconds))),
|
|
241
|
+
);
|
|
242
|
+
if (Option.isNone(resultOption)) {
|
|
243
|
+
return yield* Effect.fail(
|
|
244
|
+
new Error(`Build command timed out after ${timeoutSeconds} seconds.`),
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
const result = resultOption.value;
|
|
248
|
+
|
|
249
|
+
if (result.exitCode !== 0) {
|
|
250
|
+
return yield* Effect.fail(
|
|
251
|
+
new Error(
|
|
252
|
+
`Build command failed with exit code ${result.exitCode} (stdout: ${result.stdout.bytes} bytes; stderr: ${result.stderr.bytes} bytes).`,
|
|
253
|
+
),
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
yield* Effect.logDebug("Build command completed", {
|
|
258
|
+
stdoutBytes: result.stdout.bytes,
|
|
259
|
+
stderrBytes: result.stderr.bytes,
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
return {
|
|
263
|
+
exitCode: result.exitCode,
|
|
264
|
+
stdout: result.stdout.text,
|
|
265
|
+
stderr: result.stderr.text,
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
const buildProcessEnvironment = (
|
|
270
|
+
explicitEnv: Record<string, string> = {},
|
|
271
|
+
): Record<string, string> => ({
|
|
272
|
+
...Object.fromEntries(
|
|
273
|
+
Object.entries(process.env).filter(
|
|
274
|
+
(entry): entry is [string, string] =>
|
|
275
|
+
entry[1] !== undefined &&
|
|
276
|
+
!PRISMA_MANAGEMENT_CREDENTIAL_ENV_NAMES.has(entry[0].toUpperCase()),
|
|
277
|
+
),
|
|
278
|
+
),
|
|
279
|
+
...explicitEnv,
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
const NEXT_CONFIG_FILENAMES = [
|
|
283
|
+
"next.config.js",
|
|
284
|
+
"next.config.mjs",
|
|
285
|
+
"next.config.ts",
|
|
286
|
+
"next.config.mts",
|
|
287
|
+
] as const;
|
|
288
|
+
|
|
289
|
+
const NUXT_CONFIG_FILENAMES = [
|
|
290
|
+
"nuxt.config.js",
|
|
291
|
+
"nuxt.config.mjs",
|
|
292
|
+
"nuxt.config.cjs",
|
|
293
|
+
"nuxt.config.ts",
|
|
294
|
+
"nuxt.config.mts",
|
|
295
|
+
] as const;
|
|
296
|
+
|
|
297
|
+
const ASTRO_CONFIG_FILENAMES = [
|
|
298
|
+
"astro.config.js",
|
|
299
|
+
"astro.config.mjs",
|
|
300
|
+
"astro.config.cjs",
|
|
301
|
+
"astro.config.ts",
|
|
302
|
+
"astro.config.mts",
|
|
303
|
+
] as const;
|
|
304
|
+
|
|
305
|
+
const NEST_CLI_FILENAME = "nest-cli.json";
|
|
306
|
+
const NEST_TSCONFIG_FILENAMES = [
|
|
307
|
+
"tsconfig.build.json",
|
|
308
|
+
"tsconfig.json",
|
|
309
|
+
] as const;
|
|
310
|
+
const NEST_DEFAULT_COMPILED_ENTRYPOINTS = [
|
|
311
|
+
"dist/src/main.js",
|
|
312
|
+
"dist/main.js",
|
|
313
|
+
] as const;
|
|
314
|
+
|
|
315
|
+
const TANSTACK_START_PACKAGES = [
|
|
316
|
+
"@tanstack/react-start",
|
|
317
|
+
"@tanstack/solid-start",
|
|
318
|
+
] as const;
|
|
319
|
+
|
|
320
|
+
const strategies: readonly BuildStrategy[] = [
|
|
321
|
+
{
|
|
322
|
+
name: "nextjs",
|
|
323
|
+
canBuild: (appPath) =>
|
|
324
|
+
Effect.gen(function* () {
|
|
325
|
+
return (
|
|
326
|
+
(yield* hasRootFile(appPath, NEXT_CONFIG_FILENAMES)) ||
|
|
327
|
+
(yield* hasPackageDependency(appPath, ["next"]))
|
|
328
|
+
);
|
|
329
|
+
}),
|
|
330
|
+
execute: (options) =>
|
|
331
|
+
buildFramework({
|
|
332
|
+
appPath: options.appPath,
|
|
333
|
+
env: options.env,
|
|
334
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
335
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
336
|
+
cliName: "next",
|
|
337
|
+
args: ["build"],
|
|
338
|
+
failurePrefix: "Next.js",
|
|
339
|
+
missingMessage:
|
|
340
|
+
"Could not find an installed Next.js CLI. Install `next` in the application or workspace before deploying.",
|
|
341
|
+
sourceDir: ".next/standalone",
|
|
342
|
+
entrypoint: "server.js",
|
|
343
|
+
defaultPort: 3000,
|
|
344
|
+
allowNestedEntrypoint: true,
|
|
345
|
+
extrasRelativeToEntrypoint: true,
|
|
346
|
+
missingOutputMessage:
|
|
347
|
+
'Next.js build did not produce standalone output. Add output: "standalone" to your next.config file.',
|
|
348
|
+
extras: [
|
|
349
|
+
{ from: "public", to: "public" },
|
|
350
|
+
{ from: ".next/static", to: ".next/static" },
|
|
351
|
+
],
|
|
352
|
+
}),
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
name: "nuxt",
|
|
356
|
+
canBuild: (appPath) =>
|
|
357
|
+
Effect.gen(function* () {
|
|
358
|
+
return (
|
|
359
|
+
(yield* hasRootFile(appPath, NUXT_CONFIG_FILENAMES)) ||
|
|
360
|
+
(yield* hasPackageDependency(appPath, ["nuxt"]))
|
|
361
|
+
);
|
|
362
|
+
}),
|
|
363
|
+
execute: (options) =>
|
|
364
|
+
buildFramework({
|
|
365
|
+
appPath: options.appPath,
|
|
366
|
+
env: options.env,
|
|
367
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
368
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
369
|
+
cliName: "nuxt",
|
|
370
|
+
args: ["build"],
|
|
371
|
+
failurePrefix: "Nuxt",
|
|
372
|
+
missingMessage:
|
|
373
|
+
"Could not find an installed Nuxt CLI. Install `nuxt` in the application or workspace before deploying.",
|
|
374
|
+
sourceDir: ".output",
|
|
375
|
+
entrypoint: "server/index.mjs",
|
|
376
|
+
defaultPort: 3000,
|
|
377
|
+
requiredFile: ".output/server/index.mjs",
|
|
378
|
+
missingOutputMessage:
|
|
379
|
+
"Nuxt build did not produce a Nitro node server entrypoint at .output/server/index.mjs. Ensure nitro.preset is 'node-server' (the default).",
|
|
380
|
+
}),
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
name: "astro",
|
|
384
|
+
canBuild: (appPath) =>
|
|
385
|
+
Effect.gen(function* () {
|
|
386
|
+
return (
|
|
387
|
+
(yield* hasRootFile(appPath, ASTRO_CONFIG_FILENAMES)) ||
|
|
388
|
+
(yield* hasPackageDependency(appPath, ["astro"]))
|
|
389
|
+
);
|
|
390
|
+
}),
|
|
391
|
+
execute: (options) =>
|
|
392
|
+
buildFramework({
|
|
393
|
+
appPath: options.appPath,
|
|
394
|
+
env: options.env,
|
|
395
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
396
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
397
|
+
cliName: "astro",
|
|
398
|
+
args: ["build"],
|
|
399
|
+
failurePrefix: "Astro",
|
|
400
|
+
missingMessage:
|
|
401
|
+
"Could not find an installed Astro CLI. Install `astro` in the application or workspace before deploying.",
|
|
402
|
+
sourceDir: "dist",
|
|
403
|
+
entrypoint: "server/entry.mjs",
|
|
404
|
+
defaultPort: 4321,
|
|
405
|
+
requiredFile: "dist/server/entry.mjs",
|
|
406
|
+
missingOutputMessage:
|
|
407
|
+
'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.',
|
|
408
|
+
}),
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
name: "nestjs",
|
|
412
|
+
canBuild: (appPath) =>
|
|
413
|
+
Effect.gen(function* () {
|
|
414
|
+
return (
|
|
415
|
+
(yield* hasRootFile(appPath, [NEST_CLI_FILENAME])) ||
|
|
416
|
+
(yield* hasPackageDependency(appPath, ["@nestjs/core"]))
|
|
417
|
+
);
|
|
418
|
+
}),
|
|
419
|
+
execute: (options) => buildNestjs(options),
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
name: "tanstack-start",
|
|
423
|
+
canBuild: (appPath) =>
|
|
424
|
+
hasPackageDependency(appPath, TANSTACK_START_PACKAGES),
|
|
425
|
+
execute: (options) =>
|
|
426
|
+
buildFramework({
|
|
427
|
+
appPath: options.appPath,
|
|
428
|
+
env: options.env,
|
|
429
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
430
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
431
|
+
cliName: "vite",
|
|
432
|
+
args: ["build"],
|
|
433
|
+
failurePrefix: "TanStack Start",
|
|
434
|
+
missingMessage:
|
|
435
|
+
"Could not find an installed Vite CLI. Install `vite` in the application or workspace before deploying.",
|
|
436
|
+
sourceDir: ".output",
|
|
437
|
+
entrypoint: "server/index.mjs",
|
|
438
|
+
defaultPort: 3000,
|
|
439
|
+
requiredFile: ".output/server/index.mjs",
|
|
440
|
+
missingOutputMessage:
|
|
441
|
+
"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.",
|
|
442
|
+
}),
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: "bun",
|
|
446
|
+
canBuild: () => Effect.succeed(true),
|
|
447
|
+
execute: (options) => buildBun(options),
|
|
448
|
+
},
|
|
449
|
+
] as const;
|
|
450
|
+
|
|
451
|
+
export const runComputeAutoBuild = Effect.fn(function* (
|
|
452
|
+
options: ComputeAutoBuildOptions,
|
|
453
|
+
) {
|
|
454
|
+
const requested = options.framework ?? "auto";
|
|
455
|
+
const candidates =
|
|
456
|
+
requested === "auto"
|
|
457
|
+
? strategies
|
|
458
|
+
: strategies.filter((strategy) => strategy.name === requested);
|
|
459
|
+
|
|
460
|
+
for (const strategy of candidates) {
|
|
461
|
+
if (yield* strategy.canBuild(options.appPath)) {
|
|
462
|
+
return yield* strategy.execute(options);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
return yield* Effect.fail(
|
|
467
|
+
new Error("No suitable Prisma Compute auto-build strategy found."),
|
|
468
|
+
);
|
|
469
|
+
});
|
|
470
|
+
|
|
471
|
+
const buildFramework = Effect.fn(function* (options: {
|
|
472
|
+
appPath: string;
|
|
473
|
+
env?: Record<string, string | Redacted.Redacted<string> | undefined>;
|
|
474
|
+
outputLimitBytes?: number;
|
|
475
|
+
timeoutSeconds?: number;
|
|
476
|
+
cliName: string;
|
|
477
|
+
args: string[];
|
|
478
|
+
failurePrefix: string;
|
|
479
|
+
missingMessage: string;
|
|
480
|
+
sourceDir: string;
|
|
481
|
+
entrypoint: string;
|
|
482
|
+
defaultPort: number;
|
|
483
|
+
allowNestedEntrypoint?: boolean;
|
|
484
|
+
requiredFile?: string;
|
|
485
|
+
missingOutputMessage: string;
|
|
486
|
+
extrasRelativeToEntrypoint?: boolean;
|
|
487
|
+
extras?: ReadonlyArray<{ from: string; to: string }>;
|
|
488
|
+
}) {
|
|
489
|
+
const fs = yield* FileSystem.FileSystem;
|
|
490
|
+
const path = yield* Path.Path;
|
|
491
|
+
yield* runBuildCommand({
|
|
492
|
+
command: yield* packageCliCommand(
|
|
493
|
+
options.appPath,
|
|
494
|
+
options.cliName,
|
|
495
|
+
options.args,
|
|
496
|
+
options.missingMessage,
|
|
497
|
+
),
|
|
498
|
+
cwd: options.appPath,
|
|
499
|
+
env: processBuildEnv(options.env),
|
|
500
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
501
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
const requiredPath = path.join(
|
|
505
|
+
options.appPath,
|
|
506
|
+
options.requiredFile ?? options.sourceDir,
|
|
507
|
+
);
|
|
508
|
+
if (!(yield* fs.exists(requiredPath))) {
|
|
509
|
+
return yield* Effect.fail(new Error(options.missingOutputMessage));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
const temp = yield* makeTempArtifactDir();
|
|
513
|
+
const budget = makeStagingBudget();
|
|
514
|
+
const build = Effect.gen(function* () {
|
|
515
|
+
return yield* withStagingDeadline(
|
|
516
|
+
Effect.gen(function* () {
|
|
517
|
+
yield* copyDirectoryPreserveSymlinks(
|
|
518
|
+
path.join(options.appPath, options.sourceDir),
|
|
519
|
+
temp.artifactDir,
|
|
520
|
+
temp.artifactDir,
|
|
521
|
+
options.appPath,
|
|
522
|
+
budget,
|
|
523
|
+
);
|
|
524
|
+
yield* materializeBunNodeModuleAliases(
|
|
525
|
+
temp.artifactDir,
|
|
526
|
+
path.join(options.appPath, options.sourceDir),
|
|
527
|
+
budget,
|
|
528
|
+
);
|
|
529
|
+
const entrypoint = yield* resolveFrameworkEntrypoint(
|
|
530
|
+
temp.artifactDir,
|
|
531
|
+
options.entrypoint,
|
|
532
|
+
options.allowNestedEntrypoint ?? false,
|
|
533
|
+
);
|
|
534
|
+
const extrasBaseDir = options.extrasRelativeToEntrypoint
|
|
535
|
+
? path.dirname(path.join(temp.artifactDir, entrypoint))
|
|
536
|
+
: temp.artifactDir;
|
|
537
|
+
for (const extra of options.extras ?? []) {
|
|
538
|
+
const extraSource = path.join(options.appPath, extra.from);
|
|
539
|
+
if (yield* directoryExists(extraSource)) {
|
|
540
|
+
const extraTarget = path.join(extrasBaseDir, extra.to);
|
|
541
|
+
yield* copyDirectoryPreserveSymlinks(
|
|
542
|
+
extraSource,
|
|
543
|
+
extraTarget,
|
|
544
|
+
temp.artifactDir,
|
|
545
|
+
options.appPath,
|
|
546
|
+
budget,
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return {
|
|
551
|
+
directory: temp.artifactDir,
|
|
552
|
+
entrypoint,
|
|
553
|
+
defaultPort: options.defaultPort,
|
|
554
|
+
cleanup: temp.cleanup,
|
|
555
|
+
};
|
|
556
|
+
}),
|
|
557
|
+
budget,
|
|
558
|
+
);
|
|
559
|
+
});
|
|
560
|
+
|
|
561
|
+
return yield* build.pipe(
|
|
562
|
+
Effect.catch((error) =>
|
|
563
|
+
temp.cleanup.pipe(Effect.andThen(Effect.fail(error))),
|
|
564
|
+
),
|
|
565
|
+
);
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
const buildNestjs = Effect.fn(function* (options: ComputeAutoBuildOptions) {
|
|
569
|
+
const fs = yield* FileSystem.FileSystem;
|
|
570
|
+
const path = yield* Path.Path;
|
|
571
|
+
const buildScript = yield* readPackageScript(options.appPath, "build");
|
|
572
|
+
|
|
573
|
+
yield* runBuildCommand({
|
|
574
|
+
command:
|
|
575
|
+
buildScript === undefined
|
|
576
|
+
? yield* packageCliCommand(
|
|
577
|
+
options.appPath,
|
|
578
|
+
"nest",
|
|
579
|
+
["build"],
|
|
580
|
+
"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.",
|
|
581
|
+
)
|
|
582
|
+
: packageScriptCommand("build"),
|
|
583
|
+
cwd: options.appPath,
|
|
584
|
+
env: processBuildEnv(options.env),
|
|
585
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
586
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
const compiledEntry = yield* resolveNestjsCompiledEntrypoint(options.appPath);
|
|
590
|
+
const temp = yield* makeTempArtifactDir();
|
|
591
|
+
const budget = makeStagingBudget();
|
|
592
|
+
const build = Effect.gen(function* () {
|
|
593
|
+
const entrypoint = yield* withStagingDeadline(
|
|
594
|
+
stageTracedNestjsArtifact({
|
|
595
|
+
appPath: options.appPath,
|
|
596
|
+
artifactDir: temp.artifactDir,
|
|
597
|
+
compiledEntry,
|
|
598
|
+
budget,
|
|
599
|
+
}),
|
|
600
|
+
budget,
|
|
601
|
+
);
|
|
602
|
+
return {
|
|
603
|
+
directory: temp.artifactDir,
|
|
604
|
+
entrypoint,
|
|
605
|
+
defaultPort: 3000,
|
|
606
|
+
cleanup: temp.cleanup,
|
|
607
|
+
};
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
return yield* build.pipe(
|
|
611
|
+
Effect.catch((error) =>
|
|
612
|
+
fs
|
|
613
|
+
.remove(path.dirname(temp.artifactDir), { recursive: true })
|
|
614
|
+
.pipe(Effect.ignore, Effect.andThen(Effect.fail(error))),
|
|
615
|
+
),
|
|
616
|
+
);
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
const resolveNestjsCompiledEntrypoint = Effect.fn(function* (appPath: string) {
|
|
620
|
+
const fs = yield* FileSystem.FileSystem;
|
|
621
|
+
const path = yield* Path.Path;
|
|
622
|
+
const candidates = [
|
|
623
|
+
yield* readPackageMain(appPath),
|
|
624
|
+
yield* configuredNestjsCompiledEntrypoint(appPath),
|
|
625
|
+
...NEST_DEFAULT_COMPILED_ENTRYPOINTS,
|
|
626
|
+
].flatMap((candidate) => {
|
|
627
|
+
if (candidate === undefined) return [];
|
|
628
|
+
const normalized = normalizeRelativePath(candidate);
|
|
629
|
+
return normalized === undefined ? [] : [normalized];
|
|
630
|
+
});
|
|
631
|
+
|
|
632
|
+
for (const candidate of candidates) {
|
|
633
|
+
const stat = yield* fs
|
|
634
|
+
.stat(path.join(appPath, candidate))
|
|
635
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
636
|
+
if (stat?.type === "File") return candidate;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
return yield* Effect.fail(
|
|
640
|
+
new Error(
|
|
641
|
+
`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.`,
|
|
642
|
+
),
|
|
643
|
+
);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
const configuredNestjsCompiledEntrypoint = Effect.fn(function* (
|
|
647
|
+
appPath: string,
|
|
648
|
+
) {
|
|
649
|
+
const path = yield* Path.Path;
|
|
650
|
+
const config = yield* readNestCliConfig(appPath);
|
|
651
|
+
const sourceRoot = normalizeRelativePath(config.sourceRoot ?? "src") ?? "src";
|
|
652
|
+
const entryFile = config.entryFile ?? "main";
|
|
653
|
+
const outDir = yield* readNestjsOutDir(appPath);
|
|
654
|
+
return sourceRoot === "."
|
|
655
|
+
? path.join(outDir, `${entryFile}.js`)
|
|
656
|
+
: path.join(outDir, sourceRoot, `${entryFile}.js`);
|
|
657
|
+
});
|
|
658
|
+
|
|
659
|
+
const stageTracedNestjsArtifact = Effect.fn(function* (options: {
|
|
660
|
+
appPath: string;
|
|
661
|
+
artifactDir: string;
|
|
662
|
+
compiledEntry: string;
|
|
663
|
+
budget: StagingBudget;
|
|
664
|
+
}) {
|
|
665
|
+
const fs = yield* FileSystem.FileSystem;
|
|
666
|
+
const path = yield* Path.Path;
|
|
667
|
+
const sourceRoot = yield* resolveSourceRoot(options.appPath);
|
|
668
|
+
const realSourceRoot = yield* fs.realPath(sourceRoot);
|
|
669
|
+
const artifactRoot = path.resolve(options.artifactDir);
|
|
670
|
+
const entry = path.join(options.appPath, options.compiledEntry);
|
|
671
|
+
const entrypoint = path.relative(sourceRoot, entry).replaceAll("\\", "/");
|
|
672
|
+
const fileList = yield* Effect.tryPromise({
|
|
673
|
+
try: () =>
|
|
674
|
+
nodeFileTrace([entry], { base: sourceRoot }).then((result) =>
|
|
675
|
+
Array.from(result.fileList),
|
|
676
|
+
),
|
|
677
|
+
catch: (cause) =>
|
|
678
|
+
cause instanceof Error
|
|
679
|
+
? cause
|
|
680
|
+
: new Error(`Failed to trace NestJS artifact: ${String(cause)}`),
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
const sortedFiles = fileList.sort((a, b) => a.localeCompare(b));
|
|
684
|
+
if (sortedFiles.length > STAGING_MAX_ENTRIES) {
|
|
685
|
+
return yield* Effect.fail(
|
|
686
|
+
new Error(
|
|
687
|
+
`Compute artifact staging exceeded the ${STAGING_MAX_ENTRIES} entry safety limit while tracing NestJS dependencies.`,
|
|
688
|
+
),
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
for (const file of sortedFiles) {
|
|
692
|
+
const normalized = normalizeRelativePath(file);
|
|
693
|
+
if (normalized === undefined || normalized === ".") {
|
|
694
|
+
return yield* Effect.fail(
|
|
695
|
+
new Error(`NestJS dependency trace returned an unsafe path: ${file}`),
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
yield* stageTracedPath(
|
|
699
|
+
path.join(sourceRoot, normalized),
|
|
700
|
+
path.join(options.artifactDir, normalized),
|
|
701
|
+
[realSourceRoot],
|
|
702
|
+
artifactRoot,
|
|
703
|
+
options.budget,
|
|
704
|
+
);
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
return entrypoint;
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
const copyDirectoryPreserveSymlinks = Effect.fn(function* (
|
|
711
|
+
sourceDir: string,
|
|
712
|
+
targetDir: string,
|
|
713
|
+
targetRoot: string,
|
|
714
|
+
sourceBoundary: string,
|
|
715
|
+
budget: StagingBudget,
|
|
716
|
+
) {
|
|
717
|
+
const fs = yield* FileSystem.FileSystem;
|
|
718
|
+
const path = yield* Path.Path;
|
|
719
|
+
const realSourceRoot = yield* fs.realPath(sourceDir);
|
|
720
|
+
const realSourceBoundary = yield* fs.realPath(sourceBoundary);
|
|
721
|
+
yield* assertPathWithinRoots(realSourceRoot, [realSourceBoundary], sourceDir);
|
|
722
|
+
yield* copyDirectoryWithinRoots(
|
|
723
|
+
sourceDir,
|
|
724
|
+
targetDir,
|
|
725
|
+
[realSourceRoot],
|
|
726
|
+
path.resolve(targetRoot),
|
|
727
|
+
budget,
|
|
728
|
+
);
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
const copyDirectoryWithinRoots: (
|
|
732
|
+
sourceDir: string,
|
|
733
|
+
targetDir: string,
|
|
734
|
+
allowedRoots: readonly string[],
|
|
735
|
+
targetRoot: string,
|
|
736
|
+
budget: StagingBudget,
|
|
737
|
+
) => Effect.Effect<void, unknown, FileSystem.FileSystem | Path.Path> =
|
|
738
|
+
Effect.fn(function* (sourceDir, targetDir, allowedRoots, targetRoot, budget) {
|
|
739
|
+
const fs = yield* FileSystem.FileSystem;
|
|
740
|
+
const path = yield* Path.Path;
|
|
741
|
+
yield* assertRealPathWithinRoots(sourceDir, allowedRoots);
|
|
742
|
+
yield* assertSafeStagingDestination(targetDir, targetRoot);
|
|
743
|
+
yield* fs.makeDirectory(targetDir, { recursive: true });
|
|
744
|
+
|
|
745
|
+
const entries = (yield* readDirectoryEntries(sourceDir)).sort((a, b) =>
|
|
746
|
+
a.name.localeCompare(b.name),
|
|
747
|
+
);
|
|
748
|
+
for (const entry of entries) {
|
|
749
|
+
const source = path.join(sourceDir, entry.name);
|
|
750
|
+
const target = path.join(targetDir, entry.name);
|
|
751
|
+
if (entry.type === "SymbolicLink") {
|
|
752
|
+
const symlinkTarget = yield* validateStagedSymlink(
|
|
753
|
+
source,
|
|
754
|
+
allowedRoots,
|
|
755
|
+
);
|
|
756
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
757
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
758
|
+
yield* assertPathWithinRoots(
|
|
759
|
+
path.resolve(path.dirname(target), symlinkTarget),
|
|
760
|
+
[targetRoot],
|
|
761
|
+
target,
|
|
762
|
+
);
|
|
763
|
+
yield* fs.remove(target, { recursive: true, force: true });
|
|
764
|
+
yield* fs.symlink(symlinkTarget, target);
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if (entry.type === "Directory") {
|
|
769
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
770
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
771
|
+
yield* copyDirectoryWithinRoots(
|
|
772
|
+
source,
|
|
773
|
+
target,
|
|
774
|
+
allowedRoots,
|
|
775
|
+
targetRoot,
|
|
776
|
+
budget,
|
|
777
|
+
);
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
if (entry.type === "File") {
|
|
782
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
783
|
+
const stat = yield* fs.stat(source);
|
|
784
|
+
const size = yield* safeFileSize(source, stat.size);
|
|
785
|
+
yield* accountStagingEntry(budget, source, size);
|
|
786
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
787
|
+
yield* fs.makeDirectory(path.dirname(target), { recursive: true });
|
|
788
|
+
yield* fs.copyFile(source, target);
|
|
789
|
+
const copied = yield* fs.stat(target);
|
|
790
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
791
|
+
yield* fs.remove(target, { force: true }).pipe(Effect.ignore);
|
|
792
|
+
return yield* Effect.fail(
|
|
793
|
+
new Error(`Compute artifact file changed while staging: ${source}`),
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
yield* fs.chmod(target, stat.mode & 0o777);
|
|
797
|
+
continue;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
801
|
+
return yield* Effect.fail(
|
|
802
|
+
new Error(
|
|
803
|
+
`Unsupported filesystem entry in compute artifact: ${source}`,
|
|
804
|
+
),
|
|
805
|
+
);
|
|
806
|
+
}
|
|
807
|
+
});
|
|
808
|
+
|
|
809
|
+
const readDirectoryEntries = Effect.fn(function* (directory: string) {
|
|
810
|
+
const fs = yield* FileSystem.FileSystem;
|
|
811
|
+
const path = yield* Path.Path;
|
|
812
|
+
const names = yield* fs.readDirectory(directory);
|
|
813
|
+
if (names.length > STAGING_MAX_ENTRIES) {
|
|
814
|
+
return yield* Effect.fail(
|
|
815
|
+
new Error(
|
|
816
|
+
`Compute artifact directory exceeds the ${STAGING_MAX_ENTRIES} entry safety limit: ${directory}`,
|
|
817
|
+
),
|
|
818
|
+
);
|
|
819
|
+
}
|
|
820
|
+
return yield* Effect.forEach(names, (name) =>
|
|
821
|
+
Effect.gen(function* () {
|
|
822
|
+
const file = path.join(directory, name);
|
|
823
|
+
const isSymlink = yield* fs.readLink(file).pipe(
|
|
824
|
+
Effect.as(true),
|
|
825
|
+
Effect.catch(() => Effect.succeed(false)),
|
|
826
|
+
);
|
|
827
|
+
if (isSymlink) {
|
|
828
|
+
return { name, type: "SymbolicLink" } satisfies DirectoryEntry;
|
|
829
|
+
}
|
|
830
|
+
const stat = yield* fs.stat(file);
|
|
831
|
+
return {
|
|
832
|
+
name,
|
|
833
|
+
type:
|
|
834
|
+
stat.type === "Directory" || stat.type === "File"
|
|
835
|
+
? stat.type
|
|
836
|
+
: "Other",
|
|
837
|
+
} satisfies DirectoryEntry;
|
|
838
|
+
}),
|
|
839
|
+
);
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
const materializeBunNodeModuleAliases = Effect.fn(function* (
|
|
843
|
+
artifactDir: string,
|
|
844
|
+
sourceDir: string,
|
|
845
|
+
budget: StagingBudget,
|
|
846
|
+
) {
|
|
847
|
+
const fs = yield* FileSystem.FileSystem;
|
|
848
|
+
const path = yield* Path.Path;
|
|
849
|
+
const nodeModules = path.join(artifactDir, "node_modules");
|
|
850
|
+
const aliasRoot = path.join(nodeModules, ".bun", "node_modules");
|
|
851
|
+
if (!(yield* directoryExists(aliasRoot))) return;
|
|
852
|
+
const allowedRoots = [
|
|
853
|
+
yield* fs.realPath(artifactDir),
|
|
854
|
+
yield* fs.realPath(sourceDir),
|
|
855
|
+
];
|
|
856
|
+
const targetRoot = path.resolve(artifactDir);
|
|
857
|
+
|
|
858
|
+
for (const entry of yield* fs.readDirectory(aliasRoot)) {
|
|
859
|
+
const source = path.join(aliasRoot, entry);
|
|
860
|
+
const stat = yield* fs
|
|
861
|
+
.stat(source)
|
|
862
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
863
|
+
if (stat?.type !== "Directory") continue;
|
|
864
|
+
|
|
865
|
+
if (entry.startsWith("@")) {
|
|
866
|
+
const targetScope = path.join(nodeModules, entry);
|
|
867
|
+
yield* assertSafeStagingDestination(targetScope, targetRoot);
|
|
868
|
+
yield* fs.makeDirectory(targetScope, { recursive: true });
|
|
869
|
+
for (const packageName of yield* fs.readDirectory(source)) {
|
|
870
|
+
yield* copyAliasIfMissing(
|
|
871
|
+
allowedRoots,
|
|
872
|
+
path.join(source, packageName),
|
|
873
|
+
path.join(targetScope, packageName),
|
|
874
|
+
targetRoot,
|
|
875
|
+
budget,
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
} else {
|
|
879
|
+
yield* copyAliasIfMissing(
|
|
880
|
+
allowedRoots,
|
|
881
|
+
source,
|
|
882
|
+
path.join(nodeModules, entry),
|
|
883
|
+
targetRoot,
|
|
884
|
+
budget,
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
|
|
890
|
+
const copyAliasIfMissing = Effect.fn(function* (
|
|
891
|
+
allowedRoots: readonly string[],
|
|
892
|
+
source: string,
|
|
893
|
+
target: string,
|
|
894
|
+
targetRoot: string,
|
|
895
|
+
budget: StagingBudget,
|
|
896
|
+
) {
|
|
897
|
+
const fs = yield* FileSystem.FileSystem;
|
|
898
|
+
if (yield* fs.exists(target)) return;
|
|
899
|
+
const realSource = yield* fs.realPath(source);
|
|
900
|
+
yield* assertPathWithinRoots(realSource, allowedRoots, source);
|
|
901
|
+
const stat = yield* fs.stat(realSource);
|
|
902
|
+
yield* assertSafeStagingDestination(target, targetRoot);
|
|
903
|
+
if (stat.type === "Directory") {
|
|
904
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
905
|
+
yield* copyDirectoryWithinRoots(
|
|
906
|
+
realSource,
|
|
907
|
+
target,
|
|
908
|
+
allowedRoots,
|
|
909
|
+
targetRoot,
|
|
910
|
+
budget,
|
|
911
|
+
);
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
if (stat.type === "File") {
|
|
915
|
+
const size = yield* safeFileSize(source, stat.size);
|
|
916
|
+
yield* accountStagingEntry(budget, source, size);
|
|
917
|
+
yield* fs.copyFile(realSource, target);
|
|
918
|
+
const copied = yield* fs.stat(target);
|
|
919
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
920
|
+
yield* fs.remove(target, { force: true }).pipe(Effect.ignore);
|
|
921
|
+
return yield* Effect.fail(
|
|
922
|
+
new Error(`Compute artifact file changed while staging: ${source}`),
|
|
923
|
+
);
|
|
924
|
+
}
|
|
925
|
+
yield* fs.chmod(target, stat.mode & 0o777);
|
|
926
|
+
return;
|
|
927
|
+
}
|
|
928
|
+
return yield* Effect.fail(
|
|
929
|
+
new Error(`Unsupported Bun package alias source: ${source}`),
|
|
930
|
+
);
|
|
931
|
+
});
|
|
932
|
+
|
|
933
|
+
const resolveFrameworkEntrypoint = Effect.fn(function* (
|
|
934
|
+
artifactDir: string,
|
|
935
|
+
entrypoint: string,
|
|
936
|
+
allowNested: boolean,
|
|
937
|
+
) {
|
|
938
|
+
const fs = yield* FileSystem.FileSystem;
|
|
939
|
+
const path = yield* Path.Path;
|
|
940
|
+
if (!allowNested) {
|
|
941
|
+
return entrypoint;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
const entrypointFile = path.basename(entrypoint);
|
|
945
|
+
const candidates = (yield* fs.readDirectory(artifactDir, { recursive: true }))
|
|
946
|
+
.map((file) => file.replaceAll("\\", "/"))
|
|
947
|
+
.filter((file) => {
|
|
948
|
+
const parts = file.split("/");
|
|
949
|
+
return (
|
|
950
|
+
path.basename(file) === entrypointFile &&
|
|
951
|
+
!parts.includes("node_modules") &&
|
|
952
|
+
!parts.includes(".next")
|
|
953
|
+
);
|
|
954
|
+
})
|
|
955
|
+
.sort((a, b) => {
|
|
956
|
+
const depth = a.split(/[\\/]/).length - b.split(/[\\/]/).length;
|
|
957
|
+
return depth === 0 ? a.localeCompare(b) : depth;
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
if (candidates.length === 1) return candidates[0]!;
|
|
961
|
+
if (candidates.length > 1) {
|
|
962
|
+
return yield* Effect.fail(
|
|
963
|
+
new Error(
|
|
964
|
+
`Next.js standalone output has multiple ${entrypointFile} files (${candidates.join(", ")}). Cannot determine the application entrypoint.`,
|
|
965
|
+
),
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
return yield* Effect.fail(
|
|
970
|
+
new Error(
|
|
971
|
+
`Could not find framework entrypoint ${entrypoint} inside ${artifactDir}.`,
|
|
972
|
+
),
|
|
973
|
+
);
|
|
974
|
+
});
|
|
975
|
+
|
|
976
|
+
function buildBun(options: ComputeAutoBuildOptions) {
|
|
977
|
+
return Effect.gen(function* () {
|
|
978
|
+
const fs = yield* FileSystem.FileSystem;
|
|
979
|
+
const path = yield* Path.Path;
|
|
980
|
+
const entrypoint = yield* resolveBunEntrypoint(
|
|
981
|
+
options.appPath,
|
|
982
|
+
options.entrypoint,
|
|
983
|
+
);
|
|
984
|
+
const absoluteEntrypoint = path.join(options.appPath, entrypoint);
|
|
985
|
+
const temp = yield* makeTempArtifactDir("bundle");
|
|
986
|
+
|
|
987
|
+
const build = Effect.gen(function* () {
|
|
988
|
+
yield* runBuildCommand({
|
|
989
|
+
command: [
|
|
990
|
+
"bun",
|
|
991
|
+
"build",
|
|
992
|
+
shellQuote(absoluteEntrypoint),
|
|
993
|
+
"--outdir",
|
|
994
|
+
shellQuote(temp.artifactDir),
|
|
995
|
+
"--target",
|
|
996
|
+
"bun",
|
|
997
|
+
"--sourcemap=external",
|
|
998
|
+
].join(" "),
|
|
999
|
+
cwd: options.appPath,
|
|
1000
|
+
env: processBuildEnv(options.env),
|
|
1001
|
+
outputLimitBytes: options.outputLimitBytes,
|
|
1002
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
1003
|
+
});
|
|
1004
|
+
|
|
1005
|
+
const budget = makeStagingBudget();
|
|
1006
|
+
yield* withStagingDeadline(
|
|
1007
|
+
validateStagedDirectory(temp.artifactDir, budget),
|
|
1008
|
+
budget,
|
|
1009
|
+
);
|
|
1010
|
+
|
|
1011
|
+
const outputFiles = (yield* fs.readDirectory(temp.artifactDir))
|
|
1012
|
+
.filter((file) => file.endsWith(".js"))
|
|
1013
|
+
.sort();
|
|
1014
|
+
if (outputFiles.length === 0) {
|
|
1015
|
+
return yield* Effect.fail(
|
|
1016
|
+
new Error("Bun build produced no JavaScript output."),
|
|
1017
|
+
);
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
const expected = `${path.basename(
|
|
1021
|
+
absoluteEntrypoint,
|
|
1022
|
+
path.extname(absoluteEntrypoint),
|
|
1023
|
+
)}.js`;
|
|
1024
|
+
return {
|
|
1025
|
+
directory: temp.artifactDir,
|
|
1026
|
+
entrypoint: outputFiles.includes(expected) ? expected : outputFiles[0]!,
|
|
1027
|
+
cleanup: temp.cleanup,
|
|
1028
|
+
};
|
|
1029
|
+
});
|
|
1030
|
+
|
|
1031
|
+
return yield* build.pipe(
|
|
1032
|
+
Effect.catch((error) =>
|
|
1033
|
+
temp.cleanup.pipe(Effect.andThen(Effect.fail(error))),
|
|
1034
|
+
),
|
|
1035
|
+
);
|
|
1036
|
+
});
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
const resolveBunEntrypoint = Effect.fn(function* (
|
|
1040
|
+
appPath: string,
|
|
1041
|
+
entrypoint: string | undefined,
|
|
1042
|
+
) {
|
|
1043
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1044
|
+
const path = yield* Path.Path;
|
|
1045
|
+
const candidate = entrypoint ?? (yield* readPackageMain(appPath));
|
|
1046
|
+
if (!candidate) {
|
|
1047
|
+
return yield* Effect.fail(
|
|
1048
|
+
new Error(
|
|
1049
|
+
"Prisma Compute auto-build needs an entrypoint for Bun apps. Set `entrypoint` or package.json `main`.",
|
|
1050
|
+
),
|
|
1051
|
+
);
|
|
1052
|
+
}
|
|
1053
|
+
const normalized = yield* normalizeEntrypoint(candidate);
|
|
1054
|
+
const entrypointPath = path.join(appPath, normalized);
|
|
1055
|
+
if (!(yield* fs.exists(entrypointPath))) {
|
|
1056
|
+
return yield* Effect.fail(
|
|
1057
|
+
new Error(`Entrypoint file does not exist: ${entrypointPath}`),
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
const realAppPath = yield* fs.realPath(appPath);
|
|
1061
|
+
const realEntrypointPath = yield* fs.realPath(entrypointPath);
|
|
1062
|
+
yield* assertPathWithinRoots(
|
|
1063
|
+
realEntrypointPath,
|
|
1064
|
+
[realAppPath],
|
|
1065
|
+
entrypointPath,
|
|
1066
|
+
);
|
|
1067
|
+
return normalized;
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
const makeTempArtifactDir = Effect.fn(function* (leaf = "app") {
|
|
1071
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1072
|
+
const path = yield* Path.Path;
|
|
1073
|
+
const tempDir = yield* fs.makeTempDirectory({
|
|
1074
|
+
prefix: "alchemy-prisma-compute-build-",
|
|
1075
|
+
});
|
|
1076
|
+
const artifactDir = path.join(tempDir, leaf);
|
|
1077
|
+
yield* fs.makeDirectory(artifactDir, { recursive: true });
|
|
1078
|
+
return {
|
|
1079
|
+
artifactDir,
|
|
1080
|
+
cleanup: fs.remove(tempDir, { recursive: true }).pipe(Effect.ignore),
|
|
1081
|
+
};
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
const hasRootFile = Effect.fn(function* (
|
|
1085
|
+
appPath: string,
|
|
1086
|
+
filenames: readonly string[],
|
|
1087
|
+
) {
|
|
1088
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1089
|
+
const entries = yield* fs
|
|
1090
|
+
.readDirectory(appPath)
|
|
1091
|
+
.pipe(Effect.catch(() => Effect.succeed([] as string[])));
|
|
1092
|
+
return entries.some((entry) => filenames.includes(entry));
|
|
1093
|
+
});
|
|
1094
|
+
|
|
1095
|
+
const hasPackageDependency = Effect.fn(function* (
|
|
1096
|
+
appPath: string,
|
|
1097
|
+
packageNames: readonly string[],
|
|
1098
|
+
) {
|
|
1099
|
+
const parsed = yield* readPackageJson(appPath);
|
|
1100
|
+
if (!parsed) return false;
|
|
1101
|
+
const deps = isRecord(parsed.dependencies) ? parsed.dependencies : {};
|
|
1102
|
+
const devDeps = isRecord(parsed.devDependencies)
|
|
1103
|
+
? parsed.devDependencies
|
|
1104
|
+
: {};
|
|
1105
|
+
return packageNames.some((name) => name in deps || name in devDeps);
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
const readPackageMain = Effect.fn(function* (appPath: string) {
|
|
1109
|
+
const parsed = yield* readPackageJson(appPath);
|
|
1110
|
+
return typeof parsed?.main === "string" ? parsed.main : undefined;
|
|
1111
|
+
});
|
|
1112
|
+
|
|
1113
|
+
const readPackageScript = Effect.fn(function* (
|
|
1114
|
+
appPath: string,
|
|
1115
|
+
scriptName: string,
|
|
1116
|
+
) {
|
|
1117
|
+
const parsed = yield* readPackageJson(appPath);
|
|
1118
|
+
const scripts = isRecord(parsed?.scripts) ? parsed.scripts : undefined;
|
|
1119
|
+
const script = scripts?.[scriptName];
|
|
1120
|
+
return typeof script === "string" && script.trim() !== ""
|
|
1121
|
+
? script
|
|
1122
|
+
: undefined;
|
|
1123
|
+
});
|
|
1124
|
+
|
|
1125
|
+
const readPackageJson = Effect.fn(function* (appPath: string) {
|
|
1126
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1127
|
+
const path = yield* Path.Path;
|
|
1128
|
+
const packagePath = path.join(appPath, "package.json");
|
|
1129
|
+
const text = yield* fs
|
|
1130
|
+
.readFileString(packagePath)
|
|
1131
|
+
.pipe(
|
|
1132
|
+
Effect.catch((error) =>
|
|
1133
|
+
error._tag === "PlatformError" && error.reason._tag === "NotFound"
|
|
1134
|
+
? Effect.succeed(undefined)
|
|
1135
|
+
: Effect.fail(error),
|
|
1136
|
+
),
|
|
1137
|
+
);
|
|
1138
|
+
if (!text) return undefined;
|
|
1139
|
+
return yield* Effect.try({
|
|
1140
|
+
try: () => JSON.parse(text) as Record<string, unknown>,
|
|
1141
|
+
catch: (cause) =>
|
|
1142
|
+
new Error(`Failed to parse package.json in ${appPath}: ${cause}`),
|
|
1143
|
+
});
|
|
1144
|
+
});
|
|
1145
|
+
|
|
1146
|
+
const readNestCliConfig = Effect.fn(function* (appPath: string) {
|
|
1147
|
+
const parsed = yield* readJsonObjectFile(appPath, NEST_CLI_FILENAME);
|
|
1148
|
+
return {
|
|
1149
|
+
sourceRoot:
|
|
1150
|
+
typeof parsed?.sourceRoot === "string" ? parsed.sourceRoot : undefined,
|
|
1151
|
+
entryFile:
|
|
1152
|
+
typeof parsed?.entryFile === "string" ? parsed.entryFile : undefined,
|
|
1153
|
+
};
|
|
1154
|
+
});
|
|
1155
|
+
|
|
1156
|
+
const readNestjsOutDir = Effect.fn(function* (appPath: string) {
|
|
1157
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1158
|
+
const path = yield* Path.Path;
|
|
1159
|
+
for (const fileName of NEST_TSCONFIG_FILENAMES) {
|
|
1160
|
+
const filePath = path.join(appPath, fileName);
|
|
1161
|
+
const text = yield* fs
|
|
1162
|
+
.readFileString(filePath)
|
|
1163
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1164
|
+
if (text === undefined) continue;
|
|
1165
|
+
const outDir = yield* parseTsconfigOutDir(text);
|
|
1166
|
+
if (outDir !== undefined) return outDir;
|
|
1167
|
+
}
|
|
1168
|
+
return "dist";
|
|
1169
|
+
});
|
|
1170
|
+
|
|
1171
|
+
const parseTsconfigOutDir = Effect.fn(function* (content: string) {
|
|
1172
|
+
const parsed = yield* Effect.try({
|
|
1173
|
+
try: () =>
|
|
1174
|
+
JSON.parse(stripJsonComments(content)) as {
|
|
1175
|
+
compilerOptions?: { outDir?: unknown };
|
|
1176
|
+
},
|
|
1177
|
+
catch: (cause) =>
|
|
1178
|
+
cause instanceof Error ? cause : new Error(String(cause)),
|
|
1179
|
+
}).pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1180
|
+
const outDir = parsed?.compilerOptions?.outDir;
|
|
1181
|
+
return typeof outDir === "string" ? normalizeRelativePath(outDir) : undefined;
|
|
1182
|
+
});
|
|
1183
|
+
|
|
1184
|
+
const readJsonObjectFile = Effect.fn(function* (
|
|
1185
|
+
directory: string,
|
|
1186
|
+
fileName: string,
|
|
1187
|
+
) {
|
|
1188
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1189
|
+
const path = yield* Path.Path;
|
|
1190
|
+
const text = yield* fs
|
|
1191
|
+
.readFileString(path.join(directory, fileName))
|
|
1192
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1193
|
+
if (text === undefined) return undefined;
|
|
1194
|
+
return yield* Effect.try({
|
|
1195
|
+
try: () => {
|
|
1196
|
+
const parsed = JSON.parse(text) as unknown;
|
|
1197
|
+
return isRecord(parsed) ? parsed : undefined;
|
|
1198
|
+
},
|
|
1199
|
+
catch: (cause) =>
|
|
1200
|
+
cause instanceof Error ? cause : new Error(String(cause)),
|
|
1201
|
+
}).pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1202
|
+
});
|
|
1203
|
+
|
|
1204
|
+
const directoryExists = Effect.fn(function* (dirPath: string) {
|
|
1205
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1206
|
+
const stat = yield* fs
|
|
1207
|
+
.stat(dirPath)
|
|
1208
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1209
|
+
return stat?.type === "Directory";
|
|
1210
|
+
});
|
|
1211
|
+
|
|
1212
|
+
const stageTracedPath = Effect.fn(function* (
|
|
1213
|
+
sourcePath: string,
|
|
1214
|
+
destinationPath: string,
|
|
1215
|
+
allowedRoots: readonly string[],
|
|
1216
|
+
targetRoot: string,
|
|
1217
|
+
budget: StagingBudget,
|
|
1218
|
+
) {
|
|
1219
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1220
|
+
const path = yield* Path.Path;
|
|
1221
|
+
const symlinkTarget = yield* fs
|
|
1222
|
+
.readLink(sourcePath)
|
|
1223
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1224
|
+
const stat = yield* fs
|
|
1225
|
+
.stat(sourcePath)
|
|
1226
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1227
|
+
if (stat === undefined && symlinkTarget === undefined) {
|
|
1228
|
+
return yield* Effect.fail(
|
|
1229
|
+
new Error(`NestJS dependency disappeared while staging: ${sourcePath}`),
|
|
1230
|
+
);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
yield* assertSafeStagingDestination(destinationPath, targetRoot);
|
|
1234
|
+
yield* fs.makeDirectory(path.dirname(destinationPath), { recursive: true });
|
|
1235
|
+
if (symlinkTarget !== undefined) {
|
|
1236
|
+
const validatedTarget = yield* validateStagedSymlink(
|
|
1237
|
+
sourcePath,
|
|
1238
|
+
allowedRoots,
|
|
1239
|
+
);
|
|
1240
|
+
yield* accountStagingEntry(budget, sourcePath, 0);
|
|
1241
|
+
yield* assertPathWithinRoots(
|
|
1242
|
+
path.resolve(path.dirname(destinationPath), validatedTarget),
|
|
1243
|
+
[targetRoot],
|
|
1244
|
+
destinationPath,
|
|
1245
|
+
);
|
|
1246
|
+
yield* fs.remove(destinationPath, { recursive: true, force: true });
|
|
1247
|
+
yield* fs.symlink(validatedTarget, destinationPath);
|
|
1248
|
+
return;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
if (stat?.type === "File") {
|
|
1252
|
+
yield* assertRealPathWithinRoots(sourcePath, allowedRoots);
|
|
1253
|
+
const size = yield* safeFileSize(sourcePath, stat.size);
|
|
1254
|
+
yield* accountStagingEntry(budget, sourcePath, size);
|
|
1255
|
+
yield* fs.copyFile(sourcePath, destinationPath);
|
|
1256
|
+
const copied = yield* fs.stat(destinationPath);
|
|
1257
|
+
if (copied.type !== "File" || Number(copied.size) !== size) {
|
|
1258
|
+
yield* fs.remove(destinationPath, { force: true }).pipe(Effect.ignore);
|
|
1259
|
+
return yield* Effect.fail(
|
|
1260
|
+
new Error(`Compute artifact file changed while staging: ${sourcePath}`),
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
yield* fs.chmod(destinationPath, stat.mode & 0o777);
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
yield* accountStagingEntry(budget, sourcePath, 0);
|
|
1268
|
+
return yield* Effect.fail(
|
|
1269
|
+
new Error(
|
|
1270
|
+
`Unsupported filesystem entry in NestJS dependency trace: ${sourcePath}`,
|
|
1271
|
+
),
|
|
1272
|
+
);
|
|
1273
|
+
});
|
|
1274
|
+
|
|
1275
|
+
const makeStagingBudget = (): StagingBudget => ({
|
|
1276
|
+
entries: 0,
|
|
1277
|
+
totalBytes: 0,
|
|
1278
|
+
deadline: Date.now() + STAGING_TIMEOUT_SECONDS * 1000,
|
|
1279
|
+
});
|
|
1280
|
+
|
|
1281
|
+
const withStagingDeadline = <A, E, R>(
|
|
1282
|
+
effect: Effect.Effect<A, E, R>,
|
|
1283
|
+
budget: StagingBudget,
|
|
1284
|
+
): Effect.Effect<A, E | Error, R> =>
|
|
1285
|
+
effect.pipe(
|
|
1286
|
+
Effect.timeoutOption(
|
|
1287
|
+
Duration.millis(Math.max(1, budget.deadline - Date.now())),
|
|
1288
|
+
),
|
|
1289
|
+
Effect.flatMap((result) =>
|
|
1290
|
+
Option.isSome(result)
|
|
1291
|
+
? Effect.succeed(result.value)
|
|
1292
|
+
: Effect.fail(
|
|
1293
|
+
new Error(
|
|
1294
|
+
`Compute artifact staging timed out after ${STAGING_TIMEOUT_SECONDS} seconds.`,
|
|
1295
|
+
),
|
|
1296
|
+
),
|
|
1297
|
+
),
|
|
1298
|
+
);
|
|
1299
|
+
|
|
1300
|
+
const accountStagingEntry = (
|
|
1301
|
+
budget: StagingBudget,
|
|
1302
|
+
source: string,
|
|
1303
|
+
size: number,
|
|
1304
|
+
) => {
|
|
1305
|
+
if (Date.now() > budget.deadline) {
|
|
1306
|
+
return Effect.fail(
|
|
1307
|
+
new Error(
|
|
1308
|
+
`Compute artifact staging timed out after ${STAGING_TIMEOUT_SECONDS} seconds.`,
|
|
1309
|
+
),
|
|
1310
|
+
);
|
|
1311
|
+
}
|
|
1312
|
+
if (size > STAGING_MAX_FILE_BYTES) {
|
|
1313
|
+
return Effect.fail(
|
|
1314
|
+
new Error(
|
|
1315
|
+
`Compute artifact file exceeds the ${STAGING_MAX_FILE_BYTES} byte per-file safety limit: ${source}`,
|
|
1316
|
+
),
|
|
1317
|
+
);
|
|
1318
|
+
}
|
|
1319
|
+
const entries = budget.entries + 1;
|
|
1320
|
+
if (entries > STAGING_MAX_ENTRIES) {
|
|
1321
|
+
return Effect.fail(
|
|
1322
|
+
new Error(
|
|
1323
|
+
`Compute artifact staging exceeded the ${STAGING_MAX_ENTRIES} entry safety limit.`,
|
|
1324
|
+
),
|
|
1325
|
+
);
|
|
1326
|
+
}
|
|
1327
|
+
const totalBytes = budget.totalBytes + size;
|
|
1328
|
+
if (
|
|
1329
|
+
!Number.isSafeInteger(totalBytes) ||
|
|
1330
|
+
totalBytes > STAGING_MAX_TOTAL_BYTES
|
|
1331
|
+
) {
|
|
1332
|
+
return Effect.fail(
|
|
1333
|
+
new Error(
|
|
1334
|
+
`Compute artifact staging exceeded the ${STAGING_MAX_TOTAL_BYTES} byte total safety limit.`,
|
|
1335
|
+
),
|
|
1336
|
+
);
|
|
1337
|
+
}
|
|
1338
|
+
budget.entries = entries;
|
|
1339
|
+
budget.totalBytes = totalBytes;
|
|
1340
|
+
return Effect.void;
|
|
1341
|
+
};
|
|
1342
|
+
|
|
1343
|
+
const safeFileSize = (source: string, rawSize: FileSystem.Size) => {
|
|
1344
|
+
const size = Number(rawSize);
|
|
1345
|
+
return Number.isSafeInteger(size) && size >= 0
|
|
1346
|
+
? Effect.succeed(size)
|
|
1347
|
+
: Effect.fail(
|
|
1348
|
+
new Error(`Compute artifact has an invalid file size: ${source}`),
|
|
1349
|
+
);
|
|
1350
|
+
};
|
|
1351
|
+
|
|
1352
|
+
const assertRealPathWithinRoots = Effect.fn(function* (
|
|
1353
|
+
source: string,
|
|
1354
|
+
allowedRoots: readonly string[],
|
|
1355
|
+
) {
|
|
1356
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1357
|
+
const realSource = yield* fs.realPath(source);
|
|
1358
|
+
yield* assertPathWithinRoots(realSource, allowedRoots, source);
|
|
1359
|
+
return realSource;
|
|
1360
|
+
});
|
|
1361
|
+
|
|
1362
|
+
const assertSafeStagingDestination = Effect.fn(function* (
|
|
1363
|
+
destination: string,
|
|
1364
|
+
targetRoot: string,
|
|
1365
|
+
) {
|
|
1366
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1367
|
+
const path = yield* Path.Path;
|
|
1368
|
+
const absoluteDestination = path.resolve(destination);
|
|
1369
|
+
const absoluteTargetRoot = path.resolve(targetRoot);
|
|
1370
|
+
yield* assertPathWithinRoots(
|
|
1371
|
+
absoluteDestination,
|
|
1372
|
+
[absoluteTargetRoot],
|
|
1373
|
+
destination,
|
|
1374
|
+
);
|
|
1375
|
+
|
|
1376
|
+
let existingAncestor = absoluteDestination;
|
|
1377
|
+
while (!(yield* fs.exists(existingAncestor))) {
|
|
1378
|
+
const isDanglingSymlink = yield* fs.readLink(existingAncestor).pipe(
|
|
1379
|
+
Effect.as(true),
|
|
1380
|
+
Effect.catch(() => Effect.succeed(false)),
|
|
1381
|
+
);
|
|
1382
|
+
if (isDanglingSymlink) {
|
|
1383
|
+
return yield* Effect.fail(
|
|
1384
|
+
new Error(
|
|
1385
|
+
`Compute artifact destination contains a dangling symlink: ${existingAncestor}`,
|
|
1386
|
+
),
|
|
1387
|
+
);
|
|
1388
|
+
}
|
|
1389
|
+
const parent = path.dirname(existingAncestor);
|
|
1390
|
+
if (parent === existingAncestor) {
|
|
1391
|
+
return yield* Effect.fail(
|
|
1392
|
+
new Error(
|
|
1393
|
+
`Could not establish a safe compute artifact destination: ${destination}`,
|
|
1394
|
+
),
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
existingAncestor = parent;
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
const realAncestor = yield* fs.realPath(existingAncestor);
|
|
1401
|
+
const realTargetRoot = yield* fs.realPath(absoluteTargetRoot);
|
|
1402
|
+
yield* assertPathWithinRoots(realAncestor, [realTargetRoot], destination);
|
|
1403
|
+
});
|
|
1404
|
+
|
|
1405
|
+
const assertPathWithinRoots = Effect.fn(function* (
|
|
1406
|
+
realSource: string,
|
|
1407
|
+
allowedRoots: readonly string[],
|
|
1408
|
+
displaySource: string,
|
|
1409
|
+
) {
|
|
1410
|
+
const path = yield* Path.Path;
|
|
1411
|
+
if (
|
|
1412
|
+
allowedRoots.some((root) => {
|
|
1413
|
+
const relative = path.relative(root, realSource);
|
|
1414
|
+
return (
|
|
1415
|
+
relative !== ".." &&
|
|
1416
|
+
!relative.startsWith(`..${path.sep}`) &&
|
|
1417
|
+
!path.isAbsolute(relative)
|
|
1418
|
+
);
|
|
1419
|
+
})
|
|
1420
|
+
) {
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
return yield* Effect.fail(
|
|
1424
|
+
new Error(
|
|
1425
|
+
`Compute artifact path escapes its staging root: ${displaySource}`,
|
|
1426
|
+
),
|
|
1427
|
+
);
|
|
1428
|
+
});
|
|
1429
|
+
|
|
1430
|
+
const validateStagedSymlink = Effect.fn(function* (
|
|
1431
|
+
source: string,
|
|
1432
|
+
allowedRoots: readonly string[],
|
|
1433
|
+
) {
|
|
1434
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1435
|
+
const path = yield* Path.Path;
|
|
1436
|
+
const target = yield* fs.readLink(source);
|
|
1437
|
+
if (path.isAbsolute(target) || /^[a-zA-Z]:[\\/]/.test(target)) {
|
|
1438
|
+
return yield* Effect.fail(
|
|
1439
|
+
new Error(`Compute artifact contains an absolute symlink: ${source}`),
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
yield* assertRealPathWithinRoots(source, allowedRoots);
|
|
1443
|
+
return target;
|
|
1444
|
+
});
|
|
1445
|
+
|
|
1446
|
+
const validateStagedDirectory = Effect.fn(function* (
|
|
1447
|
+
root: string,
|
|
1448
|
+
budget: StagingBudget,
|
|
1449
|
+
) {
|
|
1450
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1451
|
+
const path = yield* Path.Path;
|
|
1452
|
+
const realRoot = yield* fs.realPath(root);
|
|
1453
|
+
|
|
1454
|
+
const visit: (
|
|
1455
|
+
directory: string,
|
|
1456
|
+
) => Effect.Effect<void, unknown, FileSystem.FileSystem | Path.Path> =
|
|
1457
|
+
Effect.fn(function* (directory) {
|
|
1458
|
+
yield* assertRealPathWithinRoots(directory, [realRoot]);
|
|
1459
|
+
const entries = (yield* readDirectoryEntries(directory)).sort((a, b) =>
|
|
1460
|
+
a.name.localeCompare(b.name),
|
|
1461
|
+
);
|
|
1462
|
+
for (const entry of entries) {
|
|
1463
|
+
const source = path.join(directory, entry.name);
|
|
1464
|
+
if (entry.type === "SymbolicLink") {
|
|
1465
|
+
yield* validateStagedSymlink(source, [realRoot]);
|
|
1466
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
1467
|
+
continue;
|
|
1468
|
+
}
|
|
1469
|
+
if (entry.type === "Directory") {
|
|
1470
|
+
yield* assertRealPathWithinRoots(source, [realRoot]);
|
|
1471
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
1472
|
+
yield* visit(source);
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1475
|
+
if (entry.type === "File") {
|
|
1476
|
+
yield* assertRealPathWithinRoots(source, [realRoot]);
|
|
1477
|
+
const stat = yield* fs.stat(source);
|
|
1478
|
+
yield* accountStagingEntry(
|
|
1479
|
+
budget,
|
|
1480
|
+
source,
|
|
1481
|
+
yield* safeFileSize(source, stat.size),
|
|
1482
|
+
);
|
|
1483
|
+
continue;
|
|
1484
|
+
}
|
|
1485
|
+
yield* accountStagingEntry(budget, source, 0);
|
|
1486
|
+
return yield* Effect.fail(
|
|
1487
|
+
new Error(
|
|
1488
|
+
`Unsupported filesystem entry in compute artifact: ${source}`,
|
|
1489
|
+
),
|
|
1490
|
+
);
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
|
|
1494
|
+
yield* visit(root);
|
|
1495
|
+
});
|
|
1496
|
+
|
|
1497
|
+
const resolveSourceRoot = Effect.fn(function* (startPath: string) {
|
|
1498
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1499
|
+
const path = yield* Path.Path;
|
|
1500
|
+
const original = path.resolve(startPath);
|
|
1501
|
+
let current = original;
|
|
1502
|
+
|
|
1503
|
+
while (true) {
|
|
1504
|
+
if (
|
|
1505
|
+
(yield* fs.exists(path.join(current, ".git"))) ||
|
|
1506
|
+
(yield* fs.exists(path.join(current, "pnpm-workspace.yaml"))) ||
|
|
1507
|
+
(yield* fs.exists(path.join(current, "bun.lock"))) ||
|
|
1508
|
+
(yield* fs.exists(path.join(current, "bun.lockb"))) ||
|
|
1509
|
+
(yield* packageJsonDeclaresWorkspaces(current))
|
|
1510
|
+
) {
|
|
1511
|
+
return current;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
const parent = path.dirname(current);
|
|
1515
|
+
if (parent === current) return original;
|
|
1516
|
+
current = parent;
|
|
1517
|
+
}
|
|
1518
|
+
});
|
|
1519
|
+
|
|
1520
|
+
const packageJsonDeclaresWorkspaces = Effect.fn(function* (directory: string) {
|
|
1521
|
+
const parsed = yield* readJsonObjectFile(directory, "package.json");
|
|
1522
|
+
return parsed?.workspaces !== undefined;
|
|
1523
|
+
});
|
|
1524
|
+
|
|
1525
|
+
const packageCliCommand = Effect.fn(function* (
|
|
1526
|
+
appPath: string,
|
|
1527
|
+
cliName: string,
|
|
1528
|
+
args: readonly string[],
|
|
1529
|
+
missingMessage: string,
|
|
1530
|
+
) {
|
|
1531
|
+
const fs = yield* FileSystem.FileSystem;
|
|
1532
|
+
const path = yield* Path.Path;
|
|
1533
|
+
const sourceRoot = yield* resolveSourceRoot(appPath);
|
|
1534
|
+
const executable = process.platform === "win32" ? `${cliName}.cmd` : cliName;
|
|
1535
|
+
const candidates = Array.from(
|
|
1536
|
+
new Set(
|
|
1537
|
+
[appPath, sourceRoot].map((root) =>
|
|
1538
|
+
path.join(root, "node_modules", ".bin", executable),
|
|
1539
|
+
),
|
|
1540
|
+
),
|
|
1541
|
+
);
|
|
1542
|
+
for (const candidate of candidates) {
|
|
1543
|
+
const stat = yield* fs
|
|
1544
|
+
.stat(candidate)
|
|
1545
|
+
.pipe(Effect.catch(() => Effect.succeed(undefined)));
|
|
1546
|
+
if (
|
|
1547
|
+
stat?.type === "File" &&
|
|
1548
|
+
(process.platform === "win32" || (stat.mode & 0o111) !== 0)
|
|
1549
|
+
) {
|
|
1550
|
+
const argText = args.map(shellQuote).join(" ");
|
|
1551
|
+
return `${shellQuote(candidate)}${argText.length > 0 ? ` ${argText}` : ""}`;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
return yield* Effect.fail(new Error(missingMessage));
|
|
1555
|
+
});
|
|
1556
|
+
|
|
1557
|
+
const packageScriptCommand = (scriptName: string) =>
|
|
1558
|
+
[
|
|
1559
|
+
"if command -v bun >/dev/null 2>&1; then",
|
|
1560
|
+
`bun run ${shellQuote(scriptName)};`,
|
|
1561
|
+
"elif command -v npm >/dev/null 2>&1; then",
|
|
1562
|
+
`npm run ${shellQuote(scriptName)};`,
|
|
1563
|
+
"else",
|
|
1564
|
+
`echo ${shellQuote("Could not find bun or npm to run package scripts.")} >&2; exit 127;`,
|
|
1565
|
+
"fi",
|
|
1566
|
+
].join(" ");
|
|
1567
|
+
|
|
1568
|
+
const processBuildEnv = (
|
|
1569
|
+
env: Record<string, string | Redacted.Redacted<string> | undefined> = {},
|
|
1570
|
+
) =>
|
|
1571
|
+
Object.fromEntries(
|
|
1572
|
+
Object.entries(env).flatMap(([key, value]) =>
|
|
1573
|
+
value === undefined
|
|
1574
|
+
? []
|
|
1575
|
+
: [[key, Redacted.isRedacted(value) ? Redacted.value(value) : value]],
|
|
1576
|
+
),
|
|
1577
|
+
) as Record<string, string>;
|
|
1578
|
+
|
|
1579
|
+
const isRecord = (value: unknown): value is Record<string, unknown> =>
|
|
1580
|
+
typeof value === "object" && value !== null;
|
|
1581
|
+
|
|
1582
|
+
const normalizeRelativePath = (value: string) => {
|
|
1583
|
+
const raw = value.trim().replaceAll("\\", "/");
|
|
1584
|
+
if (raw.length === 0 || raw.startsWith("/") || /^[a-zA-Z]:\//.test(raw)) {
|
|
1585
|
+
return undefined;
|
|
1586
|
+
}
|
|
1587
|
+
const parts: string[] = [];
|
|
1588
|
+
for (const part of raw.split("/")) {
|
|
1589
|
+
if (part === "" || part === ".") continue;
|
|
1590
|
+
if (part === "..") {
|
|
1591
|
+
if (parts.length === 0) return undefined;
|
|
1592
|
+
parts.pop();
|
|
1593
|
+
continue;
|
|
1594
|
+
}
|
|
1595
|
+
parts.push(part);
|
|
1596
|
+
}
|
|
1597
|
+
return parts.join("/") || ".";
|
|
1598
|
+
};
|
|
1599
|
+
|
|
1600
|
+
const stripJsonComments = (content: string) => {
|
|
1601
|
+
let result = "";
|
|
1602
|
+
let inString = false;
|
|
1603
|
+
let escaped = false;
|
|
1604
|
+
|
|
1605
|
+
for (let i = 0; i < content.length; i++) {
|
|
1606
|
+
const char = content[i];
|
|
1607
|
+
|
|
1608
|
+
if (inString) {
|
|
1609
|
+
result += char;
|
|
1610
|
+
if (escaped) {
|
|
1611
|
+
escaped = false;
|
|
1612
|
+
} else if (char === "\\") {
|
|
1613
|
+
escaped = true;
|
|
1614
|
+
} else if (char === '"') {
|
|
1615
|
+
inString = false;
|
|
1616
|
+
}
|
|
1617
|
+
continue;
|
|
1618
|
+
}
|
|
1619
|
+
|
|
1620
|
+
if (char === '"') {
|
|
1621
|
+
inString = true;
|
|
1622
|
+
result += char;
|
|
1623
|
+
continue;
|
|
1624
|
+
}
|
|
1625
|
+
|
|
1626
|
+
const next = content[i + 1];
|
|
1627
|
+
if (char === "/" && next === "/") {
|
|
1628
|
+
while (i < content.length && content[i] !== "\n") {
|
|
1629
|
+
i++;
|
|
1630
|
+
}
|
|
1631
|
+
if (i < content.length) result += content[i];
|
|
1632
|
+
continue;
|
|
1633
|
+
}
|
|
1634
|
+
if (char === "/" && next === "*") {
|
|
1635
|
+
i += 2;
|
|
1636
|
+
while (
|
|
1637
|
+
i < content.length &&
|
|
1638
|
+
!(content[i] === "*" && content[i + 1] === "/")
|
|
1639
|
+
) {
|
|
1640
|
+
i++;
|
|
1641
|
+
}
|
|
1642
|
+
i++;
|
|
1643
|
+
continue;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
result += char;
|
|
1647
|
+
}
|
|
1648
|
+
|
|
1649
|
+
return result;
|
|
1650
|
+
};
|
|
1651
|
+
|
|
1652
|
+
const shellQuote = (value: string) => `'${value.replaceAll("'", "'\\''")}'`;
|