alchemy-effect 0.5.0 → 0.6.2
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/alchemy-effect.js +7155 -17689
- package/bin/alchemy-effect.js.map +1 -1
- package/bin/alchemy-effect.sh +14 -0
- package/bin/alchemy-effect.ts +644 -130
- package/bin/process-manager.ts +10 -0
- package/lib/cli/index.d.ts +207 -378
- package/lib/cli/index.d.ts.map +1 -1
- package/lib/cli/index.js +4134 -985
- package/lib/cli/index.js.map +1 -1
- package/package.json +165 -103
- package/src/AWS/ACM/Certificate.ts +502 -0
- package/src/AWS/ACM/index.ts +1 -0
- package/src/AWS/AGENTS.md +505 -0
- package/src/AWS/Account.ts +56 -0
- package/src/AWS/Assets.ts +182 -0
- package/src/AWS/AutoScaling/AutoScalingGroup.ts +440 -0
- package/src/AWS/AutoScaling/LaunchTemplate.ts +535 -0
- package/src/AWS/AutoScaling/ScalingPolicy.ts +232 -0
- package/src/AWS/AutoScaling/index.ts +3 -0
- package/src/AWS/Bootstrap.ts +281 -0
- package/src/AWS/CloudFront/Distribution.ts +952 -0
- package/src/AWS/CloudFront/Function.ts +374 -0
- package/src/AWS/CloudFront/Invalidation.ts +202 -0
- package/src/AWS/CloudFront/KeyValueStore.ts +216 -0
- package/src/AWS/CloudFront/KvEntries.ts +250 -0
- package/src/AWS/CloudFront/KvRoutesUpdate.ts +301 -0
- package/src/AWS/CloudFront/ManagedPolicies.ts +20 -0
- package/src/AWS/CloudFront/OriginAccessControl.ts +266 -0
- package/src/AWS/CloudFront/common.ts +55 -0
- package/src/AWS/CloudFront/index.ts +15 -0
- package/src/AWS/CloudWatch/Alarm.ts +198 -0
- package/src/AWS/CloudWatch/AlarmMuteRule.ts +183 -0
- package/src/AWS/CloudWatch/AnomalyDetector.ts +242 -0
- package/src/AWS/CloudWatch/CompositeAlarm.ts +198 -0
- package/src/AWS/CloudWatch/Dashboard.ts +262 -0
- package/src/AWS/CloudWatch/DescribeAlarmContributors.ts +79 -0
- package/src/AWS/CloudWatch/DescribeAlarmHistory.ts +66 -0
- package/src/AWS/CloudWatch/DescribeAlarms.ts +94 -0
- package/src/AWS/CloudWatch/DescribeAlarmsForMetric.ts +66 -0
- package/src/AWS/CloudWatch/DescribeAnomalyDetectors.ts +68 -0
- package/src/AWS/CloudWatch/DescribeInsightRules.ts +66 -0
- package/src/AWS/CloudWatch/DisableAlarmActions.ts +74 -0
- package/src/AWS/CloudWatch/DisableInsightRules.ts +74 -0
- package/src/AWS/CloudWatch/EnableAlarmActions.ts +74 -0
- package/src/AWS/CloudWatch/GetAlarmMuteRule.ts +75 -0
- package/src/AWS/CloudWatch/GetDashboard.ts +75 -0
- package/src/AWS/CloudWatch/GetInsightRuleReport.ts +76 -0
- package/src/AWS/CloudWatch/GetMetricData.ts +62 -0
- package/src/AWS/CloudWatch/GetMetricStatistics.ts +64 -0
- package/src/AWS/CloudWatch/GetMetricStream.ts +75 -0
- package/src/AWS/CloudWatch/GetMetricWidgetImage.ts +66 -0
- package/src/AWS/CloudWatch/InsightRule.ts +277 -0
- package/src/AWS/CloudWatch/ListAlarmMuteRules.ts +64 -0
- package/src/AWS/CloudWatch/ListDashboards.ts +62 -0
- package/src/AWS/CloudWatch/ListManagedInsightRules.ts +68 -0
- package/src/AWS/CloudWatch/ListMetricStreams.ts +64 -0
- package/src/AWS/CloudWatch/ListMetrics.ts +62 -0
- package/src/AWS/CloudWatch/ListTagsForResource.ts +79 -0
- package/src/AWS/CloudWatch/MetricStream.ts +262 -0
- package/src/AWS/CloudWatch/PutMetricData.ts +62 -0
- package/src/AWS/CloudWatch/SetAlarmState.ts +73 -0
- package/src/AWS/CloudWatch/alarmStateChanges.ts +24 -0
- package/src/AWS/CloudWatch/binding-common.ts +42 -0
- package/src/AWS/CloudWatch/common.ts +168 -0
- package/src/AWS/CloudWatch/index.ts +32 -0
- package/src/AWS/Context.ts +30 -0
- package/src/AWS/Credentials.ts +52 -0
- package/src/AWS/DynamoDB/AttributeValue.ts +250 -0
- package/src/AWS/DynamoDB/BatchExecuteStatement.ts +113 -0
- package/src/AWS/DynamoDB/BatchGetItem.ts +138 -0
- package/src/AWS/DynamoDB/BatchWriteItem.ts +144 -0
- package/src/AWS/DynamoDB/DeleteItem.ts +67 -0
- package/src/AWS/DynamoDB/DescribeTable.ts +69 -0
- package/src/AWS/DynamoDB/DescribeTimeToLive.ts +72 -0
- package/src/AWS/DynamoDB/ExecuteStatement.ts +91 -0
- package/src/AWS/DynamoDB/ExecuteTransaction.ts +77 -0
- package/src/AWS/DynamoDB/GetItem.ts +85 -0
- package/src/AWS/DynamoDB/ListTables.ts +56 -0
- package/src/AWS/DynamoDB/ListTagsOfResource.ts +72 -0
- package/src/AWS/DynamoDB/ProjectionExpression.ts +159 -0
- package/src/AWS/DynamoDB/PutItem.ts +67 -0
- package/src/AWS/DynamoDB/Query.ts +68 -0
- package/src/AWS/DynamoDB/RestoreTableToPointInTime.ts +94 -0
- package/src/AWS/DynamoDB/Scan.ts +68 -0
- package/src/AWS/DynamoDB/Stream.ts +94 -0
- package/src/AWS/DynamoDB/Table.ts +1175 -0
- package/src/AWS/DynamoDB/TransactGetItems.ts +154 -0
- package/src/AWS/DynamoDB/TransactWriteItems.ts +216 -0
- package/src/AWS/DynamoDB/UpdateItem.ts +67 -0
- package/src/AWS/DynamoDB/UpdateTimeToLive.ts +71 -0
- package/src/AWS/DynamoDB/index.ts +24 -0
- package/src/AWS/EC2/EIP.ts +285 -0
- package/src/AWS/EC2/EgressOnlyInternetGateway.ts +248 -0
- package/src/AWS/EC2/Image.ts +108 -0
- package/src/AWS/EC2/Instance.ts +877 -0
- package/src/AWS/EC2/InternetGateway.ts +382 -0
- package/src/AWS/EC2/NatGateway.ts +474 -0
- package/src/AWS/EC2/Network.ts +459 -0
- package/src/AWS/EC2/NetworkAcl.ts +247 -0
- package/src/AWS/EC2/NetworkAclAssociation.ts +206 -0
- package/src/AWS/EC2/NetworkAclEntry.ts +300 -0
- package/src/AWS/EC2/Route.ts +323 -0
- package/src/AWS/EC2/RouteTable.ts +448 -0
- package/src/AWS/EC2/RouteTableAssociation.ts +274 -0
- package/src/AWS/EC2/SecurityGroup.ts +552 -0
- package/src/AWS/EC2/SecurityGroupRule.ts +395 -0
- package/src/AWS/EC2/Subnet.ts +583 -0
- package/src/AWS/EC2/Vpc.ts +455 -0
- package/src/AWS/EC2/VpcEndpoint.ts +657 -0
- package/src/AWS/EC2/hosted.ts +891 -0
- package/src/AWS/EC2/index.ts +18 -0
- package/src/AWS/ECR/Repository.ts +254 -0
- package/src/AWS/ECR/index.ts +1 -0
- package/src/AWS/ECS/Cluster.ts +257 -0
- package/src/AWS/ECS/DescribeTasks.ts +67 -0
- package/src/AWS/ECS/ListTasks.ts +67 -0
- package/src/AWS/ECS/RunTask.ts +82 -0
- package/src/AWS/ECS/Schedule.ts +115 -0
- package/src/AWS/ECS/Service.ts +572 -0
- package/src/AWS/ECS/StopTask.ts +64 -0
- package/src/AWS/ECS/Task.ts +981 -0
- package/src/AWS/ECS/index.ts +28 -0
- package/src/AWS/EKS/AccessEntry.ts +382 -0
- package/src/AWS/EKS/Addon.ts +385 -0
- package/src/AWS/EKS/AutoCluster.ts +288 -0
- package/src/AWS/EKS/Cluster.ts +655 -0
- package/src/AWS/EKS/LoadBalancedWorkload.ts +76 -0
- package/src/AWS/EKS/PodIdentityAssociation.ts +354 -0
- package/src/AWS/EKS/PodIdentityServiceAccount.ts +156 -0
- package/src/AWS/EKS/PodIdentityWorkload.ts +185 -0
- package/src/AWS/EKS/Workload.ts +145 -0
- package/src/AWS/EKS/index.ts +9 -0
- package/src/AWS/ELBv2/Listener.ts +139 -0
- package/src/AWS/ELBv2/LoadBalancer.ts +227 -0
- package/src/AWS/ELBv2/TargetGroup.ts +209 -0
- package/src/AWS/ELBv2/index.ts +3 -0
- package/src/AWS/Endpoint.ts +16 -0
- package/src/AWS/EventBridge/DescribeEventBus.ts +71 -0
- package/src/AWS/EventBridge/DescribeRule.ts +73 -0
- package/src/AWS/EventBridge/EventBus.ts +273 -0
- package/src/AWS/EventBridge/EventSource.ts +146 -0
- package/src/AWS/EventBridge/ListEventBuses.ts +60 -0
- package/src/AWS/EventBridge/ListRules.ts +87 -0
- package/src/AWS/EventBridge/ListTargetsByRule.ts +76 -0
- package/src/AWS/EventBridge/Permission.ts +151 -0
- package/src/AWS/EventBridge/PutEvents.ts +91 -0
- package/src/AWS/EventBridge/Rule.ts +620 -0
- package/src/AWS/EventBridge/TestEventPattern.ts +60 -0
- package/src/AWS/EventBridge/ToEcsTask.ts +118 -0
- package/src/AWS/EventBridge/ToLambda.ts +87 -0
- package/src/AWS/EventBridge/ToQueue.ts +97 -0
- package/src/AWS/EventBridge/index.ts +14 -0
- package/src/AWS/IAM/AccessKey.ts +142 -0
- package/src/AWS/IAM/AccountAlias.ts +96 -0
- package/src/AWS/IAM/AccountPasswordPolicy.ts +64 -0
- package/src/AWS/IAM/Group.ts +357 -0
- package/src/AWS/IAM/GroupMembership.ts +142 -0
- package/src/AWS/IAM/InstanceProfile.ts +285 -0
- package/src/AWS/IAM/LoginProfile.ts +137 -0
- package/src/AWS/IAM/OpenIDConnectProvider.ts +192 -0
- package/src/AWS/IAM/Policy.ts +387 -0
- package/src/AWS/IAM/Role.ts +500 -0
- package/src/AWS/IAM/SAMLProvider.ts +165 -0
- package/src/AWS/IAM/SSHPublicKey.ts +148 -0
- package/src/AWS/IAM/ServerCertificate.ts +261 -0
- package/src/AWS/IAM/ServiceSpecificCredential.ts +172 -0
- package/src/AWS/IAM/SigningCertificate.ts +137 -0
- package/src/AWS/IAM/User.ts +436 -0
- package/src/AWS/IAM/VirtualMFADevice.ts +259 -0
- package/src/AWS/IAM/common.ts +89 -0
- package/src/AWS/IAM/index.ts +40 -0
- package/src/AWS/IdentityCenter/AccountAssignment.ts +290 -0
- package/src/AWS/IdentityCenter/Group.ts +211 -0
- package/src/AWS/IdentityCenter/Instance.ts +190 -0
- package/src/AWS/IdentityCenter/PermissionSet.ts +235 -0
- package/src/AWS/IdentityCenter/common.ts +117 -0
- package/src/AWS/IdentityCenter/index.ts +4 -0
- package/src/AWS/Kinesis/DescribeAccountSettings.ts +63 -0
- package/src/AWS/Kinesis/DescribeLimits.ts +59 -0
- package/src/AWS/Kinesis/DescribeStream.ts +69 -0
- package/src/AWS/Kinesis/DescribeStreamConsumer.ts +72 -0
- package/src/AWS/Kinesis/DescribeStreamSummary.ts +72 -0
- package/src/AWS/Kinesis/GetRecords.ts +59 -0
- package/src/AWS/Kinesis/GetResourcePolicy.ts +72 -0
- package/src/AWS/Kinesis/GetShardIterator.ts +71 -0
- package/src/AWS/Kinesis/ListShards.ts +66 -0
- package/src/AWS/Kinesis/ListStreamConsumers.ts +72 -0
- package/src/AWS/Kinesis/ListStreams.ts +56 -0
- package/src/AWS/Kinesis/ListTagsForResource.ts +78 -0
- package/src/AWS/Kinesis/PutRecord.ts +67 -0
- package/src/AWS/Kinesis/PutRecords.ts +67 -0
- package/src/AWS/Kinesis/Stream.ts +731 -0
- package/src/AWS/Kinesis/StreamConsumer.ts +325 -0
- package/src/AWS/Kinesis/StreamEventSource.ts +106 -0
- package/src/AWS/Kinesis/StreamSink.ts +68 -0
- package/src/AWS/Kinesis/SubscribeToShard.ts +71 -0
- package/src/AWS/Kinesis/index.ts +19 -0
- package/src/AWS/Lambda/BucketEventSource.ts +146 -0
- package/src/AWS/Lambda/EventBridgeEventSource.ts +183 -0
- package/src/AWS/Lambda/EventSourceMapping.ts +438 -0
- package/src/AWS/Lambda/Function.ts +1185 -0
- package/src/AWS/Lambda/HttpServer.ts +125 -0
- package/src/AWS/Lambda/InvokeFunction.ts +67 -0
- package/src/AWS/Lambda/Permission.ts +217 -0
- package/src/AWS/Lambda/QueueEventSource.ts +96 -0
- package/src/AWS/Lambda/StreamEventSource.ts +123 -0
- package/src/AWS/Lambda/TableEventSource.ts +156 -0
- package/src/AWS/Lambda/TopicEventSource.ts +105 -0
- package/src/AWS/Lambda/index.ts +13 -0
- package/src/AWS/Logs/LogGroup.ts +209 -0
- package/src/AWS/Logs/index.ts +1 -0
- package/src/AWS/Organizations/Account.ts +328 -0
- package/src/AWS/Organizations/DelegatedAdministrator.ts +158 -0
- package/src/AWS/Organizations/Organization.ts +179 -0
- package/src/AWS/Organizations/OrganizationResourcePolicy.ts +108 -0
- package/src/AWS/Organizations/OrganizationalUnit.ts +268 -0
- package/src/AWS/Organizations/Policy.ts +241 -0
- package/src/AWS/Organizations/PolicyAttachment.ts +130 -0
- package/src/AWS/Organizations/Root.ts +151 -0
- package/src/AWS/Organizations/RootPolicyType.ts +130 -0
- package/src/AWS/Organizations/TenantRoot.ts +506 -0
- package/src/AWS/Organizations/TrustedServiceAccess.ts +107 -0
- package/src/AWS/Organizations/common.ts +130 -0
- package/src/AWS/Organizations/index.ts +11 -0
- package/src/AWS/Profile.ts +5 -0
- package/src/AWS/Providers.ts +324 -0
- package/src/AWS/RDS/Aurora.ts +499 -0
- package/src/AWS/RDS/Connect.ts +127 -0
- package/src/AWS/RDS/DBCluster.ts +361 -0
- package/src/AWS/RDS/DBClusterEndpoint.ts +226 -0
- package/src/AWS/RDS/DBClusterParameterGroup.ts +195 -0
- package/src/AWS/RDS/DBInstance.ts +274 -0
- package/src/AWS/RDS/DBParameterGroup.ts +190 -0
- package/src/AWS/RDS/DBProxy.ts +257 -0
- package/src/AWS/RDS/DBProxyEndpoint.ts +255 -0
- package/src/AWS/RDS/DBProxyTargetGroup.ts +243 -0
- package/src/AWS/RDS/DBSubnetGroup.ts +208 -0
- package/src/AWS/RDS/index.ts +11 -0
- package/src/AWS/RDSData/BatchExecuteStatement.ts +103 -0
- package/src/AWS/RDSData/BeginTransaction.ts +97 -0
- package/src/AWS/RDSData/CommitTransaction.ts +102 -0
- package/src/AWS/RDSData/ExecuteSql.ts +98 -0
- package/src/AWS/RDSData/ExecuteStatement.ts +99 -0
- package/src/AWS/RDSData/RollbackTransaction.ts +105 -0
- package/src/AWS/RDSData/index.ts +6 -0
- package/src/AWS/Region.ts +77 -0
- package/src/AWS/Route53/Record.ts +342 -0
- package/src/AWS/Route53/index.ts +1 -0
- package/src/AWS/S3/AbortMultipartUpload.ts +73 -0
- package/src/AWS/S3/Bucket.ts +550 -0
- package/src/AWS/S3/BucketEventSource.ts +26 -0
- package/src/AWS/S3/BucketNotifications.ts +77 -0
- package/src/AWS/S3/CompleteMultipartUpload.ts +73 -0
- package/src/AWS/S3/CopyObject.ts +68 -0
- package/src/AWS/S3/CreateMultipartUpload.ts +73 -0
- package/src/AWS/S3/DeleteObject.ts +67 -0
- package/src/AWS/S3/GetObject.ts +74 -0
- package/src/AWS/S3/HeadObject.ts +67 -0
- package/src/AWS/S3/ListObjectsV2.ts +67 -0
- package/src/AWS/S3/PutObject.ts +83 -0
- package/src/AWS/S3/S3Event.ts +43 -0
- package/src/AWS/S3/UploadPart.ts +67 -0
- package/src/AWS/S3/index.ts +14 -0
- package/src/AWS/SNS/AddPermission.ts +66 -0
- package/src/AWS/SNS/ConfirmSubscription.ts +72 -0
- package/src/AWS/SNS/GetDataProtectionPolicy.ts +72 -0
- package/src/AWS/SNS/GetSubscriptionAttributes.ts +72 -0
- package/src/AWS/SNS/GetTopicAttributes.ts +70 -0
- package/src/AWS/SNS/ListSubscriptions.ts +60 -0
- package/src/AWS/SNS/ListSubscriptionsByTopic.ts +72 -0
- package/src/AWS/SNS/ListTagsForResource.ts +72 -0
- package/src/AWS/SNS/ListTopics.ts +56 -0
- package/src/AWS/SNS/Publish.ts +66 -0
- package/src/AWS/SNS/PublishBatch.ts +66 -0
- package/src/AWS/SNS/PutDataProtectionPolicy.ts +72 -0
- package/src/AWS/SNS/RemovePermission.ts +66 -0
- package/src/AWS/SNS/SetSubscriptionAttributes.ts +72 -0
- package/src/AWS/SNS/SetTopicAttributes.ts +70 -0
- package/src/AWS/SNS/Subscription.ts +305 -0
- package/src/AWS/SNS/TagResource.ts +66 -0
- package/src/AWS/SNS/Topic.ts +363 -0
- package/src/AWS/SNS/TopicEventSource.ts +42 -0
- package/src/AWS/SNS/TopicSink.ts +61 -0
- package/src/AWS/SNS/UntagResource.ts +66 -0
- package/src/AWS/SNS/index.ts +21 -0
- package/src/AWS/SQS/DeleteMessage.ts +67 -0
- package/src/AWS/SQS/DeleteMessageBatch.ts +72 -0
- package/src/AWS/SQS/Queue.ts +210 -0
- package/src/AWS/SQS/QueueEventSource.ts +57 -0
- package/src/AWS/SQS/QueueSink.ts +62 -0
- package/src/AWS/SQS/ReceiveMessage.ts +68 -0
- package/src/AWS/SQS/SendMessage.ts +69 -0
- package/src/AWS/SQS/SendMessageBatch.ts +67 -0
- package/src/AWS/SQS/index.ts +8 -0
- package/src/AWS/Scheduler/Schedule.ts +296 -0
- package/src/AWS/Scheduler/ScheduleGroup.ts +186 -0
- package/src/AWS/Scheduler/builders.ts +229 -0
- package/src/AWS/Scheduler/index.ts +3 -0
- package/src/AWS/SecretsManager/DescribeSecret.ts +66 -0
- package/src/AWS/SecretsManager/GetRandomPassword.ts +65 -0
- package/src/AWS/SecretsManager/GetSecretValue.ts +78 -0
- package/src/AWS/SecretsManager/ListSecrets.ts +62 -0
- package/src/AWS/SecretsManager/PutSecretValue.ts +78 -0
- package/src/AWS/SecretsManager/Secret.ts +318 -0
- package/src/AWS/SecretsManager/index.ts +6 -0
- package/src/AWS/StageConfig.ts +44 -0
- package/src/AWS/Website/AssetDeployment.ts +348 -0
- package/src/AWS/Website/Router.ts +384 -0
- package/src/AWS/Website/SsrSite.ts +393 -0
- package/src/AWS/Website/StaticSite.ts +611 -0
- package/src/AWS/Website/cfcode.ts +180 -0
- package/src/AWS/Website/index.ts +5 -0
- package/src/AWS/Website/shared.ts +223 -0
- package/src/AWS/index.ts +37 -0
- package/src/AdoptPolicy.ts +25 -0
- package/src/Agent/Agent.ts +26 -0
- package/src/Agent/Aspect.ts +173 -0
- package/src/Agent/AspectGraph.ts +98 -0
- package/src/Agent/ContextPlugin.ts +18 -0
- package/src/Agent/Plugin.ts +29 -0
- package/src/Agent/chat/channel.ts +26 -0
- package/src/Agent/chat/event.ts +43 -0
- package/src/Agent/chat/message.ts +35 -0
- package/src/Agent/chat/service.ts +133 -0
- package/src/Agent/chat/thread.ts +17 -0
- package/src/Agent/coding/bash.ts +198 -0
- package/src/Agent/coding/edit.ts +152 -0
- package/src/Agent/coding/glob.ts +97 -0
- package/src/Agent/coding/grep.ts +144 -0
- package/src/Agent/coding/index.ts +7 -0
- package/src/Agent/coding/read.ts +119 -0
- package/src/Agent/coding/readlints.ts +78 -0
- package/src/Agent/coding/write.ts +79 -0
- package/src/Agent/fs/file.ts +22 -0
- package/src/Agent/fs/folder.ts +16 -0
- package/src/Agent/index.ts +9 -0
- package/src/Agent/llm/error.ts +330 -0
- package/src/Agent/llm/index.ts +4 -0
- package/src/Agent/llm/llm.ts +131 -0
- package/src/Agent/llm/stream-collectors.ts +58 -0
- package/src/Agent/llm/stream-text-part.ts +7 -0
- package/src/Agent/lsp/client.ts +293 -0
- package/src/Agent/lsp/diagnostics.ts +64 -0
- package/src/Agent/lsp/jsonrpc.ts +317 -0
- package/src/Agent/lsp/manager.ts +213 -0
- package/src/Agent/lsp/servers.ts +37 -0
- package/src/Agent/process/driver.ts +168 -0
- package/src/Agent/process/issue-service.ts +48 -0
- package/src/Agent/process/issue-tools.ts +33 -0
- package/src/Agent/process/issue.ts +22 -0
- package/src/Agent/process/organization.ts +16 -0
- package/src/Agent/process/process.ts +16 -0
- package/src/Agent/process/reply.ts +21 -0
- package/src/Agent/process/task.ts +34 -0
- package/src/Agent/tool/index.ts +3 -0
- package/src/Agent/tool/parameter.ts +35 -0
- package/src/Agent/tool/result.ts +51 -0
- package/src/Agent/tool/tool.ts +74 -0
- package/src/Agent/util/command-validator.ts +98 -0
- package/src/Agent/util/exec.ts +18 -0
- package/src/Agent/util/parser.ts +39 -0
- package/src/Agent/util/replace.ts +559 -0
- package/src/Agent/util/ripgrep.ts +256 -0
- package/src/Apply.ts +1074 -0
- package/src/Binding.ts +193 -0
- package/src/Build/Command.ts +322 -0
- package/src/Build/index.ts +1 -0
- package/src/Bundle/Bundle.ts +215 -0
- package/src/Bundle/Docker.ts +213 -0
- package/src/Bundle/TempRoot.ts +104 -0
- package/src/Bundle/index.ts +3 -0
- package/src/Cli/Cli.ts +23 -0
- package/src/Cli/Event.ts +32 -0
- package/src/Cli/InkCLI.tsx +60 -0
- package/src/Cli/NamespaceTree.ts +199 -0
- package/src/Cli/Reporter.ts +8 -0
- package/src/Cli/components/ApprovePlan.tsx +44 -0
- package/src/Cli/components/Plan.tsx +148 -0
- package/src/Cli/components/PlanProgress.tsx +325 -0
- package/src/Cli/index.ts +2 -0
- package/src/Cloudflare/Account.ts +38 -0
- package/src/Cloudflare/Container.ts +1345 -0
- package/src/Cloudflare/KV/Delete.ts +38 -0
- package/src/Cloudflare/KV/Get.ts +40 -0
- package/src/Cloudflare/KV/GetWithMetadata.ts +54 -0
- package/src/Cloudflare/KV/List.ts +45 -0
- package/src/Cloudflare/KV/Namespace.ts +150 -0
- package/src/Cloudflare/KV/NamespaceBinding.ts +25 -0
- package/src/Cloudflare/KV/Put.ts +59 -0
- package/src/Cloudflare/KV/index.ts +6 -0
- package/src/Cloudflare/Logs.ts +139 -0
- package/src/Cloudflare/Providers.ts +75 -0
- package/src/Cloudflare/R2/Bucket.ts +173 -0
- package/src/Cloudflare/R2/BucketBinding.ts +31 -0
- package/src/Cloudflare/R2/CreateMultipartUpload.ts +59 -0
- package/src/Cloudflare/R2/DeleteObject.ts +41 -0
- package/src/Cloudflare/R2/GetObject.ts +47 -0
- package/src/Cloudflare/R2/HeadObject.ts +41 -0
- package/src/Cloudflare/R2/ListObjects.ts +45 -0
- package/src/Cloudflare/R2/MultipartUploadClient.ts +40 -0
- package/src/Cloudflare/R2/PutObject.ts +55 -0
- package/src/Cloudflare/R2/ResumeMultipartUpload.ts +48 -0
- package/src/Cloudflare/R2/UploadValue.ts +10 -0
- package/src/Cloudflare/R2/index.ts +9 -0
- package/src/Cloudflare/StageConfig.ts +8 -0
- package/src/Cloudflare/Website/StaticSite.ts +35 -0
- package/src/Cloudflare/Website/TanstackStart.ts +14 -0
- package/src/Cloudflare/Website/index.ts +2 -0
- package/src/Cloudflare/Workers/Assets.ts +286 -0
- package/src/Cloudflare/Workers/ConfigProvider.ts +9 -0
- package/src/Cloudflare/Workers/DurableObject.ts +558 -0
- package/src/Cloudflare/Workers/DynamicWorker.ts +144 -0
- package/src/Cloudflare/Workers/Fetch.ts +142 -0
- package/src/Cloudflare/Workers/Fetcher.ts +280 -0
- package/src/Cloudflare/Workers/HttpServer.ts +159 -0
- package/src/Cloudflare/Workers/Rpc.ts +472 -0
- package/src/Cloudflare/Workers/WebSocket.ts +44 -0
- package/src/Cloudflare/Workers/Worker.ts +1222 -0
- package/src/Cloudflare/Workers/Workflow.ts +400 -0
- package/src/Cloudflare/Workers/cloudflare_workers.ts +25 -0
- package/src/Cloudflare/Workers/index.ts +10 -0
- package/src/Cloudflare/index.ts +7 -0
- package/src/Cloudflare/stream.ts +20 -0
- package/src/Config.ts +31 -0
- package/src/Construct.ts +75 -0
- package/src/Daemon/Client.ts +112 -0
- package/src/Daemon/Config.ts +28 -0
- package/src/Daemon/Errors.ts +32 -0
- package/src/Daemon/Lock.ts +162 -0
- package/src/Daemon/ProcessRegistry.ts +284 -0
- package/src/Daemon/RpcSchema.ts +43 -0
- package/src/Daemon/RpcServer.ts +231 -0
- package/src/Daemon/index.ts +25 -0
- package/src/Destroy.ts +15 -0
- package/src/Diff.ts +142 -0
- package/src/ExecutionContext.ts +30 -0
- package/src/FQN.ts +94 -0
- package/src/Http.ts +105 -0
- package/src/Input.ts +91 -0
- package/src/InstanceId.ts +19 -0
- package/src/Kubernetes/ConfigMap.ts +59 -0
- package/src/Kubernetes/Deployment.ts +123 -0
- package/src/Kubernetes/Job.ts +82 -0
- package/src/Kubernetes/Namespace.ts +49 -0
- package/src/Kubernetes/Object.ts +99 -0
- package/src/Kubernetes/Service.ts +78 -0
- package/src/Kubernetes/ServiceAccount.ts +49 -0
- package/src/Kubernetes/client.ts +298 -0
- package/src/Kubernetes/common.ts +23 -0
- package/src/Kubernetes/index.ts +11 -0
- package/src/Kubernetes/types.ts +177 -0
- package/src/Namespace.ts +64 -0
- package/src/Observability.ts +0 -0
- package/src/Output.ts +584 -0
- package/src/Phase.ts +5 -0
- package/src/PhysicalName.ts +62 -0
- package/src/Plan.ts +899 -0
- package/src/Platform.ts +398 -0
- package/src/Provider.ts +156 -0
- package/src/Ref.ts +46 -0
- package/src/RemovalPolicy.ts +51 -0
- package/src/Resource.ts +387 -0
- package/src/SQLite/BunSQLite.ts +132 -0
- package/src/SQLite/SQLite.ts +19 -0
- package/src/SQLite/SQLiteConnection.ts +55 -0
- package/src/SQLite/SQLiteError.ts +904 -0
- package/src/SQLite/SQLiteStatement.ts +24 -0
- package/src/SQLite/index.ts +6 -0
- package/src/SQLite/libSQL.ts +194 -0
- package/src/Schema.ts +333 -0
- package/src/Self.ts +10 -0
- package/src/Server/Process.ts +30 -0
- package/src/Server/S3BucketEventSource.ts +100 -0
- package/src/Server/SQSQueueEventSource.ts +77 -0
- package/src/Server/index.ts +3 -0
- package/src/Serverless/Function.ts +18 -0
- package/src/Serverless/index.ts +1 -0
- package/src/Spawn.ts +23 -0
- package/src/Stack.ts +84 -0
- package/src/Stage.ts +3 -0
- package/src/State/InMemoryState.ts +86 -0
- package/src/State/LocalState.ts +120 -0
- package/src/State/ResourceState.ts +121 -0
- package/src/State/State.ts +72 -0
- package/src/State/index.ts +4 -0
- package/src/Tags.ts +104 -0
- package/src/Test/TestCli.ts +21 -0
- package/src/Test/TestState.ts +37 -0
- package/src/Test/Vitest.ts +503 -0
- package/src/Test/index.ts +3 -0
- package/src/Trait.ts +105 -0
- package/src/Util/base32.ts +44 -0
- package/src/Util/camel.ts +23 -0
- package/src/Util/class.ts +7 -0
- package/src/Util/effect.ts +57 -0
- package/src/Util/index.ts +15 -0
- package/src/Util/instance.ts +9 -0
- package/src/Util/pointer.ts +5 -0
- package/src/Util/schema-to-type.ts +456 -0
- package/src/Util/service.ts +16 -0
- package/src/Util/sha256.ts +27 -0
- package/src/Util/stable.ts +41 -0
- package/src/Util/todo.ts +4 -0
- package/src/Util/types.ts +25 -0
- package/src/Util/unknown.ts +19 -0
- package/src/Util/zip.ts +27 -0
- package/src/index.ts +29 -26
- package/README.md +0 -179
- package/lib/$.d.ts +0 -5
- package/lib/$.d.ts.map +0 -1
- package/lib/$.js +0 -9
- package/lib/$.js.map +0 -1
- package/lib/app.d.ts +0 -15
- package/lib/app.d.ts.map +0 -1
- package/lib/app.js +0 -7
- package/lib/app.js.map +0 -1
- package/lib/apply.d.ts +0 -18
- package/lib/apply.d.ts.map +0 -1
- package/lib/apply.js +0 -567
- package/lib/apply.js.map +0 -1
- package/lib/assert-never.d.ts +0 -12
- package/lib/assert-never.d.ts.map +0 -1
- package/lib/assert-never.js +0 -11
- package/lib/assert-never.js.map +0 -1
- package/lib/aws/account.d.ts +0 -27
- package/lib/aws/account.d.ts.map +0 -1
- package/lib/aws/account.js +0 -33
- package/lib/aws/account.js.map +0 -1
- package/lib/aws/arn.d.ts +0 -2
- package/lib/aws/arn.d.ts.map +0 -1
- package/lib/aws/arn.js +0 -1
- package/lib/aws/arn.js.map +0 -1
- package/lib/aws/assets.d.ts +0 -8
- package/lib/aws/assets.d.ts.map +0 -1
- package/lib/aws/assets.js +0 -4
- package/lib/aws/assets.js.map +0 -1
- package/lib/aws/bundle.d.ts +0 -4
- package/lib/aws/bundle.d.ts.map +0 -1
- package/lib/aws/bundle.js +0 -4
- package/lib/aws/bundle.js.map +0 -1
- package/lib/aws/client.d.ts +0 -8
- package/lib/aws/client.d.ts.map +0 -1
- package/lib/aws/client.js +0 -27
- package/lib/aws/client.js.map +0 -1
- package/lib/aws/config.d.ts +0 -15
- package/lib/aws/config.d.ts.map +0 -1
- package/lib/aws/config.js +0 -1
- package/lib/aws/config.js.map +0 -1
- package/lib/aws/credentials.d.ts +0 -156
- package/lib/aws/credentials.d.ts.map +0 -1
- package/lib/aws/credentials.js +0 -196
- package/lib/aws/credentials.js.map +0 -1
- package/lib/aws/dynamodb/attribute-value.d.ts +0 -20
- package/lib/aws/dynamodb/attribute-value.d.ts.map +0 -1
- package/lib/aws/dynamodb/attribute-value.js +0 -217
- package/lib/aws/dynamodb/attribute-value.js.map +0 -1
- package/lib/aws/dynamodb/client.d.ts +0 -12
- package/lib/aws/dynamodb/client.d.ts.map +0 -1
- package/lib/aws/dynamodb/client.js +0 -11
- package/lib/aws/dynamodb/client.js.map +0 -1
- package/lib/aws/dynamodb/expr.d.ts +0 -41
- package/lib/aws/dynamodb/expr.d.ts.map +0 -1
- package/lib/aws/dynamodb/expr.js +0 -1
- package/lib/aws/dynamodb/expr.js.map +0 -1
- package/lib/aws/dynamodb/index.d.ts +0 -10
- package/lib/aws/dynamodb/index.d.ts.map +0 -1
- package/lib/aws/dynamodb/index.js +0 -9
- package/lib/aws/dynamodb/index.js.map +0 -1
- package/lib/aws/dynamodb/projection.d.ts +0 -25
- package/lib/aws/dynamodb/projection.d.ts.map +0 -1
- package/lib/aws/dynamodb/projection.js +0 -1
- package/lib/aws/dynamodb/projection.js.map +0 -1
- package/lib/aws/dynamodb/secondary-index.d.ts +0 -26
- package/lib/aws/dynamodb/secondary-index.d.ts.map +0 -1
- package/lib/aws/dynamodb/secondary-index.js +0 -4
- package/lib/aws/dynamodb/secondary-index.js.map +0 -1
- package/lib/aws/dynamodb/table.d.ts +0 -59
- package/lib/aws/dynamodb/table.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.get-item.d.ts +0 -57
- package/lib/aws/dynamodb/table.get-item.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.get-item.js +0 -77
- package/lib/aws/dynamodb/table.get-item.js.map +0 -1
- package/lib/aws/dynamodb/table.js +0 -4
- package/lib/aws/dynamodb/table.js.map +0 -1
- package/lib/aws/dynamodb/table.provider.d.ts +0 -7
- package/lib/aws/dynamodb/table.provider.d.ts.map +0 -1
- package/lib/aws/dynamodb/table.provider.js +0 -196
- package/lib/aws/dynamodb/table.provider.js.map +0 -1
- package/lib/aws/ec2/client.d.ts +0 -12
- package/lib/aws/ec2/client.d.ts.map +0 -1
- package/lib/aws/ec2/client.js +0 -11
- package/lib/aws/ec2/client.js.map +0 -1
- package/lib/aws/ec2/index.d.ts +0 -15
- package/lib/aws/ec2/index.d.ts.map +0 -1
- package/lib/aws/ec2/index.js +0 -15
- package/lib/aws/ec2/index.js.map +0 -1
- package/lib/aws/ec2/internet-gateway.d.ts +0 -65
- package/lib/aws/ec2/internet-gateway.d.ts.map +0 -1
- package/lib/aws/ec2/internet-gateway.js +0 -4
- package/lib/aws/ec2/internet-gateway.js.map +0 -1
- package/lib/aws/ec2/internet-gateway.provider.d.ts +0 -6
- package/lib/aws/ec2/internet-gateway.provider.d.ts.map +0 -1
- package/lib/aws/ec2/internet-gateway.provider.js +0 -193
- package/lib/aws/ec2/internet-gateway.provider.js.map +0 -1
- package/lib/aws/ec2/route-table-association.d.ts +0 -63
- package/lib/aws/ec2/route-table-association.d.ts.map +0 -1
- package/lib/aws/ec2/route-table-association.js +0 -4
- package/lib/aws/ec2/route-table-association.js.map +0 -1
- package/lib/aws/ec2/route-table-association.provider.d.ts +0 -4
- package/lib/aws/ec2/route-table-association.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route-table-association.provider.js +0 -121
- package/lib/aws/ec2/route-table-association.provider.js.map +0 -1
- package/lib/aws/ec2/route-table.d.ts +0 -159
- package/lib/aws/ec2/route-table.d.ts.map +0 -1
- package/lib/aws/ec2/route-table.js +0 -4
- package/lib/aws/ec2/route-table.js.map +0 -1
- package/lib/aws/ec2/route-table.provider.d.ts +0 -6
- package/lib/aws/ec2/route-table.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route-table.provider.js +0 -213
- package/lib/aws/ec2/route-table.provider.js.map +0 -1
- package/lib/aws/ec2/route.d.ts +0 -155
- package/lib/aws/ec2/route.d.ts.map +0 -1
- package/lib/aws/ec2/route.js +0 -3
- package/lib/aws/ec2/route.js.map +0 -1
- package/lib/aws/ec2/route.provider.d.ts +0 -4
- package/lib/aws/ec2/route.provider.d.ts.map +0 -1
- package/lib/aws/ec2/route.provider.js +0 -166
- package/lib/aws/ec2/route.provider.js.map +0 -1
- package/lib/aws/ec2/subnet.d.ts +0 -175
- package/lib/aws/ec2/subnet.d.ts.map +0 -1
- package/lib/aws/ec2/subnet.js +0 -4
- package/lib/aws/ec2/subnet.js.map +0 -1
- package/lib/aws/ec2/subnet.provider.d.ts +0 -4
- package/lib/aws/ec2/subnet.provider.d.ts.map +0 -1
- package/lib/aws/ec2/subnet.provider.js +0 -250
- package/lib/aws/ec2/subnet.provider.js.map +0 -1
- package/lib/aws/ec2/vpc.d.ts +0 -136
- package/lib/aws/ec2/vpc.d.ts.map +0 -1
- package/lib/aws/ec2/vpc.js +0 -4
- package/lib/aws/ec2/vpc.js.map +0 -1
- package/lib/aws/ec2/vpc.provider.d.ts +0 -6
- package/lib/aws/ec2/vpc.provider.d.ts.map +0 -1
- package/lib/aws/ec2/vpc.provider.js +0 -205
- package/lib/aws/ec2/vpc.provider.js.map +0 -1
- package/lib/aws/iam.d.ts +0 -23
- package/lib/aws/iam.d.ts.map +0 -1
- package/lib/aws/iam.js +0 -7
- package/lib/aws/iam.js.map +0 -1
- package/lib/aws/index.d.ts +0 -28
- package/lib/aws/index.d.ts.map +0 -1
- package/lib/aws/index.js +0 -21
- package/lib/aws/index.js.map +0 -1
- package/lib/aws/lambda/client.d.ts +0 -8
- package/lib/aws/lambda/client.d.ts.map +0 -1
- package/lib/aws/lambda/client.js +0 -7
- package/lib/aws/lambda/client.js.map +0 -1
- package/lib/aws/lambda/consume.d.ts +0 -16
- package/lib/aws/lambda/consume.d.ts.map +0 -1
- package/lib/aws/lambda/consume.js +0 -30
- package/lib/aws/lambda/consume.js.map +0 -1
- package/lib/aws/lambda/function.d.ts +0 -41
- package/lib/aws/lambda/function.d.ts.map +0 -1
- package/lib/aws/lambda/function.handler.d.ts +0 -7
- package/lib/aws/lambda/function.handler.d.ts.map +0 -1
- package/lib/aws/lambda/function.handler.js +0 -8
- package/lib/aws/lambda/function.handler.js.map +0 -1
- package/lib/aws/lambda/function.invoke.d.ts +0 -12
- package/lib/aws/lambda/function.invoke.d.ts.map +0 -1
- package/lib/aws/lambda/function.invoke.js +0 -33
- package/lib/aws/lambda/function.invoke.js.map +0 -1
- package/lib/aws/lambda/function.js +0 -3
- package/lib/aws/lambda/function.js.map +0 -1
- package/lib/aws/lambda/function.provider.d.ts +0 -10
- package/lib/aws/lambda/function.provider.d.ts.map +0 -1
- package/lib/aws/lambda/function.provider.js +0 -464
- package/lib/aws/lambda/function.provider.js.map +0 -1
- package/lib/aws/lambda/index.d.ts +0 -9
- package/lib/aws/lambda/index.d.ts.map +0 -1
- package/lib/aws/lambda/index.js +0 -10
- package/lib/aws/lambda/index.js.map +0 -1
- package/lib/aws/lambda/serve.d.ts +0 -12
- package/lib/aws/lambda/serve.d.ts.map +0 -1
- package/lib/aws/lambda/serve.js +0 -7
- package/lib/aws/lambda/serve.js.map +0 -1
- package/lib/aws/parse-ini.d.ts +0 -4
- package/lib/aws/parse-ini.d.ts.map +0 -1
- package/lib/aws/parse-ini.js +0 -67
- package/lib/aws/parse-ini.js.map +0 -1
- package/lib/aws/profile.d.ts +0 -6
- package/lib/aws/profile.d.ts.map +0 -1
- package/lib/aws/profile.js +0 -4
- package/lib/aws/profile.js.map +0 -1
- package/lib/aws/region.d.ts +0 -31
- package/lib/aws/region.d.ts.map +0 -1
- package/lib/aws/region.js +0 -46
- package/lib/aws/region.js.map +0 -1
- package/lib/aws/s3.d.ts +0 -8
- package/lib/aws/s3.d.ts.map +0 -1
- package/lib/aws/s3.js +0 -7
- package/lib/aws/s3.js.map +0 -1
- package/lib/aws/sqs/client.d.ts +0 -12
- package/lib/aws/sqs/client.d.ts.map +0 -1
- package/lib/aws/sqs/client.js +0 -11
- package/lib/aws/sqs/client.js.map +0 -1
- package/lib/aws/sqs/index.d.ts +0 -8
- package/lib/aws/sqs/index.d.ts.map +0 -1
- package/lib/aws/sqs/index.js +0 -8
- package/lib/aws/sqs/index.js.map +0 -1
- package/lib/aws/sqs/queue.consume.d.ts +0 -12
- package/lib/aws/sqs/queue.consume.d.ts.map +0 -1
- package/lib/aws/sqs/queue.consume.js +0 -2
- package/lib/aws/sqs/queue.consume.js.map +0 -1
- package/lib/aws/sqs/queue.d.ts +0 -81
- package/lib/aws/sqs/queue.d.ts.map +0 -1
- package/lib/aws/sqs/queue.event-source.d.ts +0 -22
- package/lib/aws/sqs/queue.event-source.d.ts.map +0 -1
- package/lib/aws/sqs/queue.event-source.js +0 -130
- package/lib/aws/sqs/queue.event-source.js.map +0 -1
- package/lib/aws/sqs/queue.js +0 -3
- package/lib/aws/sqs/queue.js.map +0 -1
- package/lib/aws/sqs/queue.provider.d.ts +0 -6
- package/lib/aws/sqs/queue.provider.d.ts.map +0 -1
- package/lib/aws/sqs/queue.provider.js +0 -87
- package/lib/aws/sqs/queue.provider.js.map +0 -1
- package/lib/aws/sqs/queue.send-message.d.ts +0 -13
- package/lib/aws/sqs/queue.send-message.d.ts.map +0 -1
- package/lib/aws/sqs/queue.send-message.js +0 -34
- package/lib/aws/sqs/queue.send-message.js.map +0 -1
- package/lib/aws/sts.d.ts +0 -8
- package/lib/aws/sts.d.ts.map +0 -1
- package/lib/aws/sts.js +0 -7
- package/lib/aws/sts.js.map +0 -1
- package/lib/aws/zip.d.ts +0 -3
- package/lib/aws/zip.d.ts.map +0 -1
- package/lib/aws/zip.js +0 -12
- package/lib/aws/zip.js.map +0 -1
- package/lib/binding.d.ts +0 -106
- package/lib/binding.d.ts.map +0 -1
- package/lib/binding.js +0 -27
- package/lib/binding.js.map +0 -1
- package/lib/capability.d.ts +0 -49
- package/lib/capability.d.ts.map +0 -1
- package/lib/capability.js +0 -1
- package/lib/capability.js.map +0 -1
- package/lib/cli/components/ApprovePlan.d.ts +0 -8
- package/lib/cli/components/ApprovePlan.d.ts.map +0 -1
- package/lib/cli/components/ApprovePlan.js +0 -30
- package/lib/cli/components/ApprovePlan.js.map +0 -1
- package/lib/cli/components/Plan.d.ts +0 -7
- package/lib/cli/components/Plan.d.ts.map +0 -1
- package/lib/cli/components/Plan.js +0 -100
- package/lib/cli/components/Plan.js.map +0 -1
- package/lib/cli/components/PlanProgress.d.ts +0 -13
- package/lib/cli/components/PlanProgress.d.ts.map +0 -1
- package/lib/cli/components/PlanProgress.js +0 -176
- package/lib/cli/components/PlanProgress.js.map +0 -1
- package/lib/cli/ink-service.d.ts +0 -4
- package/lib/cli/ink-service.d.ts.map +0 -1
- package/lib/cli/ink-service.js +0 -43
- package/lib/cli/ink-service.js.map +0 -1
- package/lib/cli/service.d.ts +0 -21
- package/lib/cli/service.d.ts.map +0 -1
- package/lib/cli/service.js +0 -5
- package/lib/cli/service.js.map +0 -1
- package/lib/cloudflare/account.d.ts +0 -10
- package/lib/cloudflare/account.d.ts.map +0 -1
- package/lib/cloudflare/account.js +0 -24
- package/lib/cloudflare/account.js.map +0 -1
- package/lib/cloudflare/api.d.ts +0 -36
- package/lib/cloudflare/api.d.ts.map +0 -1
- package/lib/cloudflare/api.js +0 -100
- package/lib/cloudflare/api.js.map +0 -1
- package/lib/cloudflare/config.d.ts +0 -9
- package/lib/cloudflare/config.d.ts.map +0 -1
- package/lib/cloudflare/config.js +0 -1
- package/lib/cloudflare/config.js.map +0 -1
- package/lib/cloudflare/context.d.ts +0 -27
- package/lib/cloudflare/context.d.ts.map +0 -1
- package/lib/cloudflare/context.js +0 -24
- package/lib/cloudflare/context.js.map +0 -1
- package/lib/cloudflare/index.d.ts +0 -8
- package/lib/cloudflare/index.d.ts.map +0 -1
- package/lib/cloudflare/index.js +0 -8
- package/lib/cloudflare/index.js.map +0 -1
- package/lib/cloudflare/kv/index.d.ts +0 -4
- package/lib/cloudflare/kv/index.d.ts.map +0 -1
- package/lib/cloudflare/kv/index.js +0 -4
- package/lib/cloudflare/kv/index.js.map +0 -1
- package/lib/cloudflare/kv/namespace.binding.d.ts +0 -10
- package/lib/cloudflare/kv/namespace.binding.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.binding.js +0 -15
- package/lib/cloudflare/kv/namespace.binding.js.map +0 -1
- package/lib/cloudflare/kv/namespace.client.d.ts +0 -11
- package/lib/cloudflare/kv/namespace.client.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.client.js +0 -31
- package/lib/cloudflare/kv/namespace.client.js.map +0 -1
- package/lib/cloudflare/kv/namespace.d.ts +0 -24
- package/lib/cloudflare/kv/namespace.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.js +0 -3
- package/lib/cloudflare/kv/namespace.js.map +0 -1
- package/lib/cloudflare/kv/namespace.provider.d.ts +0 -6
- package/lib/cloudflare/kv/namespace.provider.d.ts.map +0 -1
- package/lib/cloudflare/kv/namespace.provider.js +0 -87
- package/lib/cloudflare/kv/namespace.provider.js.map +0 -1
- package/lib/cloudflare/live.d.ts +0 -11
- package/lib/cloudflare/live.d.ts.map +0 -1
- package/lib/cloudflare/live.js +0 -15
- package/lib/cloudflare/live.js.map +0 -1
- package/lib/cloudflare/r2/bucket.binding.d.ts +0 -10
- package/lib/cloudflare/r2/bucket.binding.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.binding.js +0 -18
- package/lib/cloudflare/r2/bucket.binding.js.map +0 -1
- package/lib/cloudflare/r2/bucket.client.d.ts +0 -8
- package/lib/cloudflare/r2/bucket.client.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.client.js +0 -9
- package/lib/cloudflare/r2/bucket.client.js.map +0 -1
- package/lib/cloudflare/r2/bucket.d.ts +0 -33
- package/lib/cloudflare/r2/bucket.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.del.d.ts +0 -4
- package/lib/cloudflare/r2/bucket.del.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.del.js +0 -7
- package/lib/cloudflare/r2/bucket.del.js.map +0 -1
- package/lib/cloudflare/r2/bucket.get.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.get.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.get.js +0 -7
- package/lib/cloudflare/r2/bucket.get.js.map +0 -1
- package/lib/cloudflare/r2/bucket.head.d.ts +0 -4
- package/lib/cloudflare/r2/bucket.head.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.head.js +0 -7
- package/lib/cloudflare/r2/bucket.head.js.map +0 -1
- package/lib/cloudflare/r2/bucket.js +0 -3
- package/lib/cloudflare/r2/bucket.js.map +0 -1
- package/lib/cloudflare/r2/bucket.list.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.list.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.list.js +0 -7
- package/lib/cloudflare/r2/bucket.list.js.map +0 -1
- package/lib/cloudflare/r2/bucket.multipart.d.ts +0 -19
- package/lib/cloudflare/r2/bucket.multipart.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.multipart.js +0 -25
- package/lib/cloudflare/r2/bucket.multipart.js.map +0 -1
- package/lib/cloudflare/r2/bucket.provider.d.ts +0 -5
- package/lib/cloudflare/r2/bucket.provider.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.provider.js +0 -78
- package/lib/cloudflare/r2/bucket.provider.js.map +0 -1
- package/lib/cloudflare/r2/bucket.put.d.ts +0 -6
- package/lib/cloudflare/r2/bucket.put.d.ts.map +0 -1
- package/lib/cloudflare/r2/bucket.put.js +0 -8
- package/lib/cloudflare/r2/bucket.put.js.map +0 -1
- package/lib/cloudflare/r2/index.d.ts +0 -10
- package/lib/cloudflare/r2/index.d.ts.map +0 -1
- package/lib/cloudflare/r2/index.js +0 -10
- package/lib/cloudflare/r2/index.js.map +0 -1
- package/lib/cloudflare/stream.d.ts +0 -10
- package/lib/cloudflare/stream.d.ts.map +0 -1
- package/lib/cloudflare/stream.js +0 -16
- package/lib/cloudflare/stream.js.map +0 -1
- package/lib/cloudflare/worker/assets.fetch.d.ts +0 -9
- package/lib/cloudflare/worker/assets.fetch.d.ts.map +0 -1
- package/lib/cloudflare/worker/assets.fetch.js +0 -12
- package/lib/cloudflare/worker/assets.fetch.js.map +0 -1
- package/lib/cloudflare/worker/assets.provider.d.ts +0 -66
- package/lib/cloudflare/worker/assets.provider.d.ts.map +0 -1
- package/lib/cloudflare/worker/assets.provider.js +0 -145
- package/lib/cloudflare/worker/assets.provider.js.map +0 -1
- package/lib/cloudflare/worker/index.d.ts +0 -5
- package/lib/cloudflare/worker/index.d.ts.map +0 -1
- package/lib/cloudflare/worker/index.js +0 -5
- package/lib/cloudflare/worker/index.js.map +0 -1
- package/lib/cloudflare/worker/worker.d.ts +0 -66
- package/lib/cloudflare/worker/worker.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.handler.d.ts +0 -11
- package/lib/cloudflare/worker/worker.handler.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.handler.js +0 -15
- package/lib/cloudflare/worker/worker.handler.js.map +0 -1
- package/lib/cloudflare/worker/worker.js +0 -4
- package/lib/cloudflare/worker/worker.js.map +0 -1
- package/lib/cloudflare/worker/worker.provider.d.ts +0 -10
- package/lib/cloudflare/worker/worker.provider.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.provider.js +0 -225
- package/lib/cloudflare/worker/worker.provider.js.map +0 -1
- package/lib/cloudflare/worker/worker.serve.d.ts +0 -39
- package/lib/cloudflare/worker/worker.serve.d.ts.map +0 -1
- package/lib/cloudflare/worker/worker.serve.js +0 -4
- package/lib/cloudflare/worker/worker.serve.js.map +0 -1
- package/lib/data.d.ts +0 -3
- package/lib/data.d.ts.map +0 -1
- package/lib/data.js +0 -8
- package/lib/data.js.map +0 -1
- package/lib/destroy.d.ts +0 -2
- package/lib/destroy.d.ts.map +0 -1
- package/lib/destroy.js +0 -3
- package/lib/destroy.js.map +0 -1
- package/lib/diff.d.ts +0 -18
- package/lib/diff.d.ts.map +0 -1
- package/lib/diff.js +0 -22
- package/lib/diff.js.map +0 -1
- package/lib/dot-alchemy.d.ts +0 -10
- package/lib/dot-alchemy.d.ts.map +0 -1
- package/lib/dot-alchemy.js +0 -15
- package/lib/dot-alchemy.js.map +0 -1
- package/lib/env.d.ts +0 -9
- package/lib/env.d.ts.map +0 -1
- package/lib/env.js +0 -19
- package/lib/env.js.map +0 -1
- package/lib/esbuild.d.ts +0 -28
- package/lib/esbuild.d.ts.map +0 -1
- package/lib/esbuild.js +0 -63
- package/lib/esbuild.js.map +0 -1
- package/lib/event.d.ts +0 -16
- package/lib/event.d.ts.map +0 -1
- package/lib/event.js +0 -1
- package/lib/event.js.map +0 -1
- package/lib/exports.d.ts +0 -9
- package/lib/exports.d.ts.map +0 -1
- package/lib/exports.js +0 -13
- package/lib/exports.js.map +0 -1
- package/lib/index.d.ts +0 -27
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -27
- package/lib/index.js.map +0 -1
- package/lib/input.d.ts +0 -32
- package/lib/input.d.ts.map +0 -1
- package/lib/input.js +0 -1
- package/lib/input.js.map +0 -1
- package/lib/instance-id.d.ts +0 -12
- package/lib/instance-id.d.ts.map +0 -1
- package/lib/instance-id.js +0 -16
- package/lib/instance-id.js.map +0 -1
- package/lib/output.d.ts +0 -145
- package/lib/output.d.ts.map +0 -1
- package/lib/output.js +0 -283
- package/lib/output.js.map +0 -1
- package/lib/phase.d.ts +0 -2
- package/lib/phase.d.ts.map +0 -1
- package/lib/phase.js +0 -1
- package/lib/phase.js.map +0 -1
- package/lib/physical-name.d.ts +0 -28
- package/lib/physical-name.d.ts.map +0 -1
- package/lib/physical-name.js +0 -55
- package/lib/physical-name.js.map +0 -1
- package/lib/plan.d.ts +0 -135
- package/lib/plan.d.ts.map +0 -1
- package/lib/plan.js +0 -686
- package/lib/plan.js.map +0 -1
- package/lib/policy.d.ts +0 -54
- package/lib/policy.d.ts.map +0 -1
- package/lib/policy.js +0 -24
- package/lib/policy.js.map +0 -1
- package/lib/provider.d.ts +0 -71
- package/lib/provider.d.ts.map +0 -1
- package/lib/provider.js +0 -11
- package/lib/provider.js.map +0 -1
- package/lib/ref.d.ts +0 -14
- package/lib/ref.d.ts.map +0 -1
- package/lib/ref.js +0 -21
- package/lib/ref.js.map +0 -1
- package/lib/reporter.d.ts +0 -8
- package/lib/reporter.d.ts.map +0 -1
- package/lib/reporter.js +0 -4
- package/lib/reporter.js.map +0 -1
- package/lib/resource.d.ts +0 -36
- package/lib/resource.d.ts.map +0 -1
- package/lib/resource.js +0 -26
- package/lib/resource.js.map +0 -1
- package/lib/runtime.d.ts +0 -40
- package/lib/runtime.d.ts.map +0 -1
- package/lib/runtime.js +0 -54
- package/lib/runtime.js.map +0 -1
- package/lib/schema.d.ts +0 -37
- package/lib/schema.d.ts.map +0 -1
- package/lib/schema.js +0 -61
- package/lib/schema.js.map +0 -1
- package/lib/service.d.ts +0 -36
- package/lib/service.d.ts.map +0 -1
- package/lib/service.js +0 -4
- package/lib/service.js.map +0 -1
- package/lib/sha256.d.ts +0 -5
- package/lib/sha256.d.ts.map +0 -1
- package/lib/sha256.js +0 -16
- package/lib/sha256.js.map +0 -1
- package/lib/stack.d.ts +0 -60
- package/lib/stack.d.ts.map +0 -1
- package/lib/stack.js +0 -11
- package/lib/stack.js.map +0 -1
- package/lib/stage.d.ts +0 -39
- package/lib/stage.d.ts.map +0 -1
- package/lib/stage.js +0 -32
- package/lib/stage.js.map +0 -1
- package/lib/state.d.ts +0 -157
- package/lib/state.d.ts.map +0 -1
- package/lib/state.js +0 -71
- package/lib/state.js.map +0 -1
- package/lib/tags.d.ts +0 -32
- package/lib/tags.d.ts.map +0 -1
- package/lib/tags.js +0 -49
- package/lib/tags.js.map +0 -1
- package/lib/test.d.ts +0 -35
- package/lib/test.d.ts.map +0 -1
- package/lib/test.js +0 -68
- package/lib/test.js.map +0 -1
- package/lib/todo.d.ts +0 -3
- package/lib/todo.d.ts.map +0 -1
- package/lib/todo.js +0 -3
- package/lib/todo.js.map +0 -1
- package/lib/tsconfig.test.tsbuildinfo +0 -1
- package/lib/type.d.ts +0 -6
- package/lib/type.d.ts.map +0 -1
- package/lib/type.js +0 -3
- package/lib/type.js.map +0 -1
- package/lib/unknown.d.ts +0 -4
- package/lib/unknown.d.ts.map +0 -1
- package/lib/unknown.js +0 -4
- package/lib/unknown.js.map +0 -1
- package/lib/user.d.ts +0 -3
- package/lib/user.d.ts.map +0 -1
- package/lib/user.js +0 -3
- package/lib/user.js.map +0 -1
- package/lib/util.d.ts +0 -6
- package/lib/util.d.ts.map +0 -1
- package/lib/util.js +0 -9
- package/lib/util.js.map +0 -1
- package/src/$.ts +0 -17
- package/src/app.ts +0 -15
- package/src/apply.ts +0 -858
- package/src/aws/account.ts +0 -57
- package/src/aws/assets.ts +0 -8
- package/src/aws/bundle.ts +0 -5
- package/src/aws/client.ts +0 -46
- package/src/aws/config.ts +0 -16
- package/src/aws/credentials.ts +0 -444
- package/src/aws/dynamodb/attribute-value.ts +0 -240
- package/src/aws/dynamodb/client.ts +0 -20
- package/src/aws/dynamodb/index.ts +0 -12
- package/src/aws/dynamodb/projection.ts +0 -159
- package/src/aws/dynamodb/secondary-index.ts +0 -45
- package/src/aws/dynamodb/table.get-item.ts +0 -173
- package/src/aws/dynamodb/table.provider.ts +0 -288
- package/src/aws/dynamodb/table.ts +0 -101
- package/src/aws/ec2/client.ts +0 -20
- package/src/aws/ec2/index.ts +0 -15
- package/src/aws/ec2/internet-gateway.provider.ts +0 -316
- package/src/aws/ec2/internet-gateway.ts +0 -79
- package/src/aws/ec2/route-table-association.provider.ts +0 -214
- package/src/aws/ec2/route-table-association.ts +0 -82
- package/src/aws/ec2/route-table.provider.ts +0 -306
- package/src/aws/ec2/route-table.ts +0 -175
- package/src/aws/ec2/route.provider.ts +0 -213
- package/src/aws/ec2/route.ts +0 -192
- package/src/aws/ec2/subnet.provider.ts +0 -358
- package/src/aws/ec2/subnet.ts +0 -213
- package/src/aws/ec2/vpc.provider.ts +0 -294
- package/src/aws/ec2/vpc.ts +0 -165
- package/src/aws/iam.ts +0 -30
- package/src/aws/index.ts +0 -63
- package/src/aws/lambda/client.ts +0 -14
- package/src/aws/lambda/consume.ts +0 -64
- package/src/aws/lambda/function.handler.ts +0 -30
- package/src/aws/lambda/function.invoke.ts +0 -44
- package/src/aws/lambda/function.provider.ts +0 -675
- package/src/aws/lambda/function.ts +0 -48
- package/src/aws/lambda/index.ts +0 -11
- package/src/aws/lambda/serve.ts +0 -29
- package/src/aws/parse-ini.ts +0 -80
- package/src/aws/profile.ts +0 -3
- package/src/aws/region.ts +0 -76
- package/src/aws/s3.ts +0 -10
- package/src/aws/sqs/client.ts +0 -20
- package/src/aws/sqs/index.ts +0 -8
- package/src/aws/sqs/queue.consume.ts +0 -13
- package/src/aws/sqs/queue.event-source.ts +0 -227
- package/src/aws/sqs/queue.provider.ts +0 -108
- package/src/aws/sqs/queue.send-message.ts +0 -48
- package/src/aws/sqs/queue.ts +0 -91
- package/src/aws/sts.ts +0 -13
- package/src/aws/zip.ts +0 -17
- package/src/binding.ts +0 -240
- package/src/capability.ts +0 -63
- package/src/cli/components/ApprovePlan.tsx +0 -44
- package/src/cli/components/Plan.tsx +0 -155
- package/src/cli/components/PlanProgress.tsx +0 -224
- package/src/cli/index.ts +0 -2
- package/src/cli/ink-service.tsx +0 -61
- package/src/cli/service.ts +0 -23
- package/src/cloudflare/account.ts +0 -37
- package/src/cloudflare/api.ts +0 -156
- package/src/cloudflare/config.ts +0 -7
- package/src/cloudflare/context.ts +0 -49
- package/src/cloudflare/index.ts +0 -8
- package/src/cloudflare/kv/index.ts +0 -3
- package/src/cloudflare/kv/namespace.binding.ts +0 -27
- package/src/cloudflare/kv/namespace.client.ts +0 -70
- package/src/cloudflare/kv/namespace.provider.ts +0 -105
- package/src/cloudflare/kv/namespace.ts +0 -30
- package/src/cloudflare/live.ts +0 -32
- package/src/cloudflare/r2/bucket.binding.ts +0 -29
- package/src/cloudflare/r2/bucket.client.ts +0 -22
- package/src/cloudflare/r2/bucket.del.ts +0 -11
- package/src/cloudflare/r2/bucket.get.ts +0 -13
- package/src/cloudflare/r2/bucket.head.ts +0 -11
- package/src/cloudflare/r2/bucket.list.ts +0 -12
- package/src/cloudflare/r2/bucket.multipart.ts +0 -55
- package/src/cloudflare/r2/bucket.provider.ts +0 -94
- package/src/cloudflare/r2/bucket.put.ts +0 -17
- package/src/cloudflare/r2/bucket.ts +0 -44
- package/src/cloudflare/r2/index.ts +0 -9
- package/src/cloudflare/stream.ts +0 -21
- package/src/cloudflare/worker/assets.fetch.ts +0 -29
- package/src/cloudflare/worker/assets.provider.ts +0 -249
- package/src/cloudflare/worker/index.ts +0 -4
- package/src/cloudflare/worker/worker.handler.ts +0 -39
- package/src/cloudflare/worker/worker.provider.ts +0 -279
- package/src/cloudflare/worker/worker.serve.ts +0 -22
- package/src/cloudflare/worker/worker.ts +0 -77
- package/src/destroy.ts +0 -3
- package/src/diff.ts +0 -48
- package/src/dot-alchemy.ts +0 -18
- package/src/env.ts +0 -39
- package/src/esbuild.ts +0 -98
- package/src/event.ts +0 -33
- package/src/exports.ts +0 -21
- package/src/input.ts +0 -81
- package/src/instance-id.ts +0 -20
- package/src/output.ts +0 -542
- package/src/phase.ts +0 -1
- package/src/physical-name.ts +0 -84
- package/src/plan.ts +0 -1123
- package/src/policy.ts +0 -128
- package/src/provider.ts +0 -112
- package/src/ref.ts +0 -48
- package/src/reporter.ts +0 -8
- package/src/resource.ts +0 -140
- package/src/runtime.ts +0 -152
- package/src/schema.ts +0 -102
- package/src/service.ts +0 -59
- package/src/sha256.ts +0 -23
- package/src/stack.ts +0 -116
- package/src/stage.ts +0 -85
- package/src/state.ts +0 -390
- package/src/tags.ts +0 -69
- package/src/test.ts +0 -172
- package/src/todo.ts +0 -4
- package/src/unknown.ts +0 -6
- package/src/user.ts +0 -4
- package/src/util.ts +0 -21
- /package/src/{aws/arn.ts → AWS/Arn.ts} +0 -0
- /package/src/{aws/dynamodb/expr.ts → AWS/DynamoDB/Expr.ts} +0 -0
- /package/src/{assert-never.ts → Util/assert-never.ts} +0 -0
- /package/src/{data.ts → Util/data.ts} +0 -0
- /package/src/{type.ts → Util/type.ts} +0 -0
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { FileSystem, Path } from "@effect/platform";
|
|
2
|
-
import type { PlatformError } from "@effect/platform/Error";
|
|
3
|
-
import { Context, Data, Layer } from "effect";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import type { ScopedPlanStatusSession } from "../../cli/service.ts";
|
|
6
|
-
import { sha256 } from "../../sha256.ts";
|
|
7
|
-
import { CloudflareApi, CloudflareApiError } from "../api.ts";
|
|
8
|
-
import type { Worker } from "./worker.ts";
|
|
9
|
-
|
|
10
|
-
const MAX_ASSET_SIZE = 1024 * 1024 * 25; // 25MB
|
|
11
|
-
const MAX_ASSET_COUNT = 20_000;
|
|
12
|
-
|
|
13
|
-
export declare namespace Assets {
|
|
14
|
-
export interface ReadResult {
|
|
15
|
-
directory: string;
|
|
16
|
-
config: Worker.AssetsConfig | undefined;
|
|
17
|
-
manifest: Record<string, { hash: string; size: number }>;
|
|
18
|
-
_headers: string | undefined;
|
|
19
|
-
_redirects: string | undefined;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export class Assets extends Context.Tag("Assets")<
|
|
24
|
-
Assets,
|
|
25
|
-
{
|
|
26
|
-
read(
|
|
27
|
-
directory: Worker.AssetsProps,
|
|
28
|
-
): Effect.Effect<Assets.ReadResult, PlatformError | ValidationError>;
|
|
29
|
-
upload(
|
|
30
|
-
accountId: string,
|
|
31
|
-
workerName: string,
|
|
32
|
-
assets: Assets.ReadResult,
|
|
33
|
-
session: ScopedPlanStatusSession,
|
|
34
|
-
): Effect.Effect<
|
|
35
|
-
{ jwt: string | undefined },
|
|
36
|
-
PlatformError | ValidationError | CloudflareApiError
|
|
37
|
-
>;
|
|
38
|
-
}
|
|
39
|
-
>() {}
|
|
40
|
-
|
|
41
|
-
export class AssetTooLargeError extends Data.TaggedError("AssetTooLargeError")<{
|
|
42
|
-
message: string;
|
|
43
|
-
name: string;
|
|
44
|
-
size: number;
|
|
45
|
-
}> {}
|
|
46
|
-
|
|
47
|
-
export class TooManyAssetsError extends Data.TaggedError("TooManyAssetsError")<{
|
|
48
|
-
message: string;
|
|
49
|
-
directory: string;
|
|
50
|
-
count: number;
|
|
51
|
-
}> {}
|
|
52
|
-
|
|
53
|
-
export class AssetNotFoundError extends Data.TaggedError("AssetNotFoundError")<{
|
|
54
|
-
message: string;
|
|
55
|
-
hash: string;
|
|
56
|
-
}> {}
|
|
57
|
-
|
|
58
|
-
export class FailedToReadAssetError extends Data.TaggedError(
|
|
59
|
-
"FailedToReadAssetError",
|
|
60
|
-
)<{
|
|
61
|
-
message: string;
|
|
62
|
-
name: string;
|
|
63
|
-
cause: PlatformError;
|
|
64
|
-
}> {}
|
|
65
|
-
|
|
66
|
-
export type ValidationError =
|
|
67
|
-
| AssetTooLargeError
|
|
68
|
-
| TooManyAssetsError
|
|
69
|
-
| AssetNotFoundError
|
|
70
|
-
| FailedToReadAssetError;
|
|
71
|
-
|
|
72
|
-
export const assetsProvider = () =>
|
|
73
|
-
Layer.effect(
|
|
74
|
-
Assets,
|
|
75
|
-
Effect.gen(function* () {
|
|
76
|
-
const fs = yield* FileSystem.FileSystem;
|
|
77
|
-
const path = yield* Path.Path;
|
|
78
|
-
const api = yield* CloudflareApi;
|
|
79
|
-
|
|
80
|
-
const maybeReadString = Effect.fnUntraced(function* (file: string) {
|
|
81
|
-
return yield* fs.readFileString(file).pipe(
|
|
82
|
-
Effect.catchIf(
|
|
83
|
-
(error) =>
|
|
84
|
-
error._tag === "SystemError" && error.reason === "NotFound",
|
|
85
|
-
() => Effect.succeed(undefined),
|
|
86
|
-
),
|
|
87
|
-
);
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
const createIgnoreMatcher = Effect.fnUntraced(function* (
|
|
91
|
-
patterns: string[],
|
|
92
|
-
) {
|
|
93
|
-
const matcher = yield* Effect.promise(() =>
|
|
94
|
-
import("ignore").then(({ default: ignore }) =>
|
|
95
|
-
ignore().add(patterns),
|
|
96
|
-
),
|
|
97
|
-
);
|
|
98
|
-
return (file: string) => matcher.ignores(file);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
return {
|
|
102
|
-
read: Effect.fnUntraced(function* (props: Worker.AssetsProps) {
|
|
103
|
-
const resolvedDirectory = path.resolve(props.directory);
|
|
104
|
-
const [files, ignore, _headers, _redirects] = yield* Effect.all([
|
|
105
|
-
fs.readDirectory(resolvedDirectory, { recursive: true }),
|
|
106
|
-
maybeReadString(path.join(resolvedDirectory, ".assetsignore")),
|
|
107
|
-
maybeReadString(path.join(resolvedDirectory, "_headers")),
|
|
108
|
-
maybeReadString(path.join(resolvedDirectory, "_redirects")),
|
|
109
|
-
]);
|
|
110
|
-
const ignores = yield* createIgnoreMatcher([
|
|
111
|
-
".assetsignore",
|
|
112
|
-
"_headers",
|
|
113
|
-
"_redirects",
|
|
114
|
-
...(ignore
|
|
115
|
-
?.split("\n")
|
|
116
|
-
.map((line) => line.trim())
|
|
117
|
-
.filter((line) => line.length > 0 && !line.startsWith("#")) ??
|
|
118
|
-
[]),
|
|
119
|
-
]);
|
|
120
|
-
const manifest = new Map<string, { hash: string; size: number }>();
|
|
121
|
-
let count = 0;
|
|
122
|
-
yield* Effect.forEach(
|
|
123
|
-
files,
|
|
124
|
-
Effect.fnUntraced(function* (name) {
|
|
125
|
-
if (ignores(name)) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
const file = path.join(resolvedDirectory, name);
|
|
129
|
-
const stat = yield* fs.stat(file);
|
|
130
|
-
if (stat.type !== "File") {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
const size = Number(stat.size);
|
|
134
|
-
if (size > MAX_ASSET_SIZE) {
|
|
135
|
-
return yield* new AssetTooLargeError({
|
|
136
|
-
message: `Asset ${name} is too large (the maximum size is ${MAX_ASSET_SIZE / 1024 / 1024} MB; this asset is ${size / 1024 / 1024} MB)`,
|
|
137
|
-
name,
|
|
138
|
-
size,
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
const hash = yield* fs.readFile(file).pipe(
|
|
142
|
-
Effect.flatMap(sha256),
|
|
143
|
-
Effect.map((hash) => hash.slice(0, 32)),
|
|
144
|
-
);
|
|
145
|
-
count++;
|
|
146
|
-
if (count > MAX_ASSET_COUNT) {
|
|
147
|
-
return yield* new TooManyAssetsError({
|
|
148
|
-
message: `Too many assets (the maximum count is ${MAX_ASSET_COUNT}; this directory has ${count} assets)`,
|
|
149
|
-
directory: props.directory,
|
|
150
|
-
count,
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
manifest.set(name.startsWith("/") ? name : `/${name}`, {
|
|
154
|
-
hash,
|
|
155
|
-
size,
|
|
156
|
-
});
|
|
157
|
-
}),
|
|
158
|
-
);
|
|
159
|
-
return {
|
|
160
|
-
directory: props.directory,
|
|
161
|
-
config: props.config,
|
|
162
|
-
manifest: Object.fromEntries(
|
|
163
|
-
Array.from(manifest.entries()).sort((a, b) =>
|
|
164
|
-
a[0].localeCompare(b[0]),
|
|
165
|
-
),
|
|
166
|
-
),
|
|
167
|
-
_headers,
|
|
168
|
-
_redirects,
|
|
169
|
-
};
|
|
170
|
-
}),
|
|
171
|
-
upload: Effect.fnUntraced(function* (
|
|
172
|
-
accountId: string,
|
|
173
|
-
workerName: string,
|
|
174
|
-
assets: Assets.ReadResult,
|
|
175
|
-
{ note }: ScopedPlanStatusSession,
|
|
176
|
-
) {
|
|
177
|
-
yield* note("Checking assets...");
|
|
178
|
-
const session = yield* api.workers.scripts.assets.upload.create(
|
|
179
|
-
workerName,
|
|
180
|
-
{
|
|
181
|
-
account_id: accountId,
|
|
182
|
-
manifest: assets.manifest,
|
|
183
|
-
},
|
|
184
|
-
);
|
|
185
|
-
if (!session.buckets?.length) {
|
|
186
|
-
return { jwt: session.jwt };
|
|
187
|
-
}
|
|
188
|
-
let uploaded = 0;
|
|
189
|
-
const total = session.buckets.flat().length;
|
|
190
|
-
yield* note(`Uploaded ${uploaded} of ${total} assets...`);
|
|
191
|
-
const assetsByHash = new Map<string, string>();
|
|
192
|
-
for (const [name, { hash }] of Object.entries(assets.manifest)) {
|
|
193
|
-
assetsByHash.set(hash, name);
|
|
194
|
-
}
|
|
195
|
-
let jwt: string | undefined;
|
|
196
|
-
const directory = path.resolve(assets.directory);
|
|
197
|
-
yield* Effect.forEach(
|
|
198
|
-
session.buckets,
|
|
199
|
-
Effect.fnUntraced(function* (bucket) {
|
|
200
|
-
const body: Record<string, string> = {};
|
|
201
|
-
yield* Effect.forEach(
|
|
202
|
-
bucket,
|
|
203
|
-
Effect.fnUntraced(function* (hash) {
|
|
204
|
-
const name = assetsByHash.get(hash);
|
|
205
|
-
if (!name) {
|
|
206
|
-
return yield* new AssetNotFoundError({
|
|
207
|
-
message: `Asset ${hash} not found in manifest`,
|
|
208
|
-
hash,
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
const file = yield* fs
|
|
212
|
-
.readFile(path.join(directory, name))
|
|
213
|
-
.pipe(
|
|
214
|
-
Effect.mapError(
|
|
215
|
-
(error) =>
|
|
216
|
-
new FailedToReadAssetError({
|
|
217
|
-
message: `Failed to read asset ${name}: ${error.message}`,
|
|
218
|
-
name,
|
|
219
|
-
cause: error,
|
|
220
|
-
}),
|
|
221
|
-
),
|
|
222
|
-
);
|
|
223
|
-
body[hash] = Buffer.from(file).toString("base64");
|
|
224
|
-
}),
|
|
225
|
-
);
|
|
226
|
-
const result = yield* api.workers.assets.upload.create(
|
|
227
|
-
{
|
|
228
|
-
account_id: accountId,
|
|
229
|
-
base64: true,
|
|
230
|
-
body,
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
headers: {
|
|
234
|
-
Authorization: `Bearer ${session.jwt}`,
|
|
235
|
-
},
|
|
236
|
-
},
|
|
237
|
-
);
|
|
238
|
-
uploaded += bucket.length;
|
|
239
|
-
yield* note(`Uploaded ${uploaded} of ${total} assets...`);
|
|
240
|
-
if (result.jwt) {
|
|
241
|
-
jwt = result.jwt;
|
|
242
|
-
}
|
|
243
|
-
}),
|
|
244
|
-
);
|
|
245
|
-
return { jwt };
|
|
246
|
-
}),
|
|
247
|
-
};
|
|
248
|
-
}),
|
|
249
|
-
);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type * as runtime from "@cloudflare/workers-types";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import type { Capability } from "../../capability.ts";
|
|
5
|
-
import { CloudflareContext } from "../context.ts";
|
|
6
|
-
|
|
7
|
-
type Handler = (
|
|
8
|
-
request: Request,
|
|
9
|
-
env: unknown,
|
|
10
|
-
ctx: runtime.ExecutionContext,
|
|
11
|
-
) => Effect.Effect<Response, any, CloudflareContext>;
|
|
12
|
-
type HandlerFactory<H extends Handler, Req = Capability> = Effect.Effect<
|
|
13
|
-
H,
|
|
14
|
-
any,
|
|
15
|
-
Req
|
|
16
|
-
>;
|
|
17
|
-
|
|
18
|
-
export const toHandler = <H extends Handler>(
|
|
19
|
-
factory: HandlerFactory<H, Capability>,
|
|
20
|
-
) => {
|
|
21
|
-
return {
|
|
22
|
-
fetch: async (
|
|
23
|
-
request: Request,
|
|
24
|
-
env: unknown,
|
|
25
|
-
ctx: runtime.ExecutionContext,
|
|
26
|
-
) => {
|
|
27
|
-
const exit = await Effect.runPromiseExit(
|
|
28
|
-
(factory as HandlerFactory<H, never>).pipe(
|
|
29
|
-
Effect.flatMap((handler) => handler(request, env, ctx)),
|
|
30
|
-
Effect.provide(Layer.succeed(CloudflareContext, { env, ctx })),
|
|
31
|
-
),
|
|
32
|
-
);
|
|
33
|
-
if (exit._tag === "Success") {
|
|
34
|
-
return exit.value;
|
|
35
|
-
}
|
|
36
|
-
return Response.json(exit, { status: 500 });
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
};
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import * as FileSystem from "@effect/platform/FileSystem";
|
|
2
|
-
import * as Path from "@effect/platform/Path";
|
|
3
|
-
import type { Workers } from "cloudflare/resources.mjs";
|
|
4
|
-
import * as Effect from "effect/Effect";
|
|
5
|
-
import type { ScopedPlanStatusSession } from "../../cli/service.ts";
|
|
6
|
-
import { DotAlchemy } from "../../dot-alchemy.ts";
|
|
7
|
-
import { ESBuild } from "../../esbuild.ts";
|
|
8
|
-
import { createPhysicalName } from "../../physical-name.ts";
|
|
9
|
-
import { sha256 } from "../../sha256.ts";
|
|
10
|
-
import { Account } from "../account.ts";
|
|
11
|
-
import { CloudflareApi } from "../api.ts";
|
|
12
|
-
import { Assets } from "./assets.provider.ts";
|
|
13
|
-
import { Worker, type WorkerAttr, type WorkerProps } from "./worker.ts";
|
|
14
|
-
|
|
15
|
-
export const workerProvider = () =>
|
|
16
|
-
Worker.provider.effect(
|
|
17
|
-
Effect.gen(function* () {
|
|
18
|
-
const api = yield* CloudflareApi;
|
|
19
|
-
const accountId = yield* Account;
|
|
20
|
-
const { read, upload } = yield* Assets;
|
|
21
|
-
const { build } = yield* ESBuild;
|
|
22
|
-
const fs = yield* FileSystem.FileSystem;
|
|
23
|
-
const path = yield* Path.Path;
|
|
24
|
-
const dotAlchemy = yield* DotAlchemy;
|
|
25
|
-
|
|
26
|
-
const getAccountSubdomain = yield* Effect.cachedFunction(
|
|
27
|
-
Effect.fnUntraced(function* (accountId: string) {
|
|
28
|
-
const { subdomain } = yield* api.workers.subdomains.get({
|
|
29
|
-
account_id: accountId,
|
|
30
|
-
});
|
|
31
|
-
return subdomain;
|
|
32
|
-
}),
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
// pre-fetch subdomain in background
|
|
36
|
-
yield* Effect.forkDaemon(getAccountSubdomain(accountId));
|
|
37
|
-
|
|
38
|
-
const setWorkerSubdomain = Effect.fnUntraced(function* (
|
|
39
|
-
name: string,
|
|
40
|
-
enabled: boolean,
|
|
41
|
-
) {
|
|
42
|
-
const subdomain = yield* api.workers.scripts.subdomain.create(name, {
|
|
43
|
-
account_id: accountId,
|
|
44
|
-
enabled,
|
|
45
|
-
});
|
|
46
|
-
yield* Effect.logDebug("setWorkerSubdomain", subdomain);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const createWorkerName = (id: string, name: string | undefined) =>
|
|
50
|
-
Effect.gen(function* () {
|
|
51
|
-
if (name) return name;
|
|
52
|
-
return (yield* createPhysicalName({
|
|
53
|
-
id,
|
|
54
|
-
maxLength: 54,
|
|
55
|
-
})).toLowerCase();
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
const prepareAssets = Effect.fnUntraced(function* (
|
|
59
|
-
assets: WorkerProps["assets"],
|
|
60
|
-
) {
|
|
61
|
-
if (!assets) return undefined;
|
|
62
|
-
const result = yield* read(
|
|
63
|
-
typeof assets === "string" ? { directory: assets } : assets,
|
|
64
|
-
);
|
|
65
|
-
return {
|
|
66
|
-
...result,
|
|
67
|
-
hash: yield* sha256(JSON.stringify(result)),
|
|
68
|
-
};
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const prepareBundle = Effect.fnUntraced(function* (
|
|
72
|
-
id: string,
|
|
73
|
-
main: string,
|
|
74
|
-
) {
|
|
75
|
-
const outfile = path.join(dotAlchemy, "out", `${id}.js`);
|
|
76
|
-
yield* build({
|
|
77
|
-
entryPoints: [path.relative(process.cwd(), main)],
|
|
78
|
-
outfile,
|
|
79
|
-
write: true,
|
|
80
|
-
bundle: true,
|
|
81
|
-
format: "esm",
|
|
82
|
-
sourcemap: false,
|
|
83
|
-
treeShaking: true,
|
|
84
|
-
});
|
|
85
|
-
const code = yield* fs.readFileString(outfile);
|
|
86
|
-
return {
|
|
87
|
-
code,
|
|
88
|
-
hash: yield* sha256(code),
|
|
89
|
-
};
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
const prepareMetadata = Effect.fnUntraced(function* (
|
|
93
|
-
props: WorkerProps<any>,
|
|
94
|
-
) {
|
|
95
|
-
const metadata: Workers.ScriptUpdateParams.Metadata = {
|
|
96
|
-
assets: undefined,
|
|
97
|
-
bindings: [],
|
|
98
|
-
body_part: undefined,
|
|
99
|
-
compatibility_date: props.compatibility?.date,
|
|
100
|
-
compatibility_flags: props.compatibility?.flags,
|
|
101
|
-
keep_assets: undefined,
|
|
102
|
-
keep_bindings: undefined,
|
|
103
|
-
limits: props.limits,
|
|
104
|
-
logpush: props.logpush,
|
|
105
|
-
main_module: "worker.js",
|
|
106
|
-
migrations: undefined,
|
|
107
|
-
observability: props.observability ?? {
|
|
108
|
-
enabled: true,
|
|
109
|
-
logs: {
|
|
110
|
-
enabled: true,
|
|
111
|
-
invocation_logs: true,
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
placement: props.placement,
|
|
115
|
-
tags: props.tags,
|
|
116
|
-
tail_consumers: undefined,
|
|
117
|
-
usage_model: undefined,
|
|
118
|
-
};
|
|
119
|
-
return metadata;
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const putWorker = Effect.fnUntraced(function* (
|
|
123
|
-
id: string,
|
|
124
|
-
news: WorkerProps<any>,
|
|
125
|
-
bindings: Worker["binding"][],
|
|
126
|
-
olds: WorkerProps<any> | undefined,
|
|
127
|
-
output: WorkerAttr<WorkerProps<any>> | undefined,
|
|
128
|
-
session: ScopedPlanStatusSession,
|
|
129
|
-
) {
|
|
130
|
-
const name = yield* createWorkerName(id, news.name);
|
|
131
|
-
const [assets, bundle, metadata] = yield* Effect.all([
|
|
132
|
-
prepareAssets(news.assets),
|
|
133
|
-
prepareBundle(id, news.main),
|
|
134
|
-
prepareMetadata(news),
|
|
135
|
-
]).pipe(Effect.orDie);
|
|
136
|
-
metadata.bindings = bindings.flatMap((binding) => binding.bindings);
|
|
137
|
-
if (assets) {
|
|
138
|
-
if (output?.hash.assets !== assets.hash) {
|
|
139
|
-
const { jwt } = yield* upload(accountId, name, assets, session);
|
|
140
|
-
metadata.assets = {
|
|
141
|
-
jwt,
|
|
142
|
-
config: assets.config,
|
|
143
|
-
};
|
|
144
|
-
} else {
|
|
145
|
-
metadata.assets = {
|
|
146
|
-
config: assets.config,
|
|
147
|
-
};
|
|
148
|
-
metadata.keep_assets = true;
|
|
149
|
-
}
|
|
150
|
-
metadata.bindings.push({
|
|
151
|
-
type: "assets",
|
|
152
|
-
name: "ASSETS",
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
yield* session.note("Uploading worker...");
|
|
156
|
-
const worker = yield* api.workers.scripts.update(name, {
|
|
157
|
-
account_id: accountId,
|
|
158
|
-
metadata: metadata,
|
|
159
|
-
files: [
|
|
160
|
-
new File([bundle.code], "worker.js", {
|
|
161
|
-
type: "application/javascript+module",
|
|
162
|
-
}),
|
|
163
|
-
],
|
|
164
|
-
});
|
|
165
|
-
if (!olds || news.subdomain?.enabled !== olds.subdomain?.enabled) {
|
|
166
|
-
const enable = news.subdomain?.enabled !== false;
|
|
167
|
-
yield* session.note(
|
|
168
|
-
`${enable ? "Enabling" : "Disabling"} workers.dev subdomain...`,
|
|
169
|
-
);
|
|
170
|
-
yield* setWorkerSubdomain(name, enable);
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
workerId: worker.id,
|
|
174
|
-
workerName: name,
|
|
175
|
-
logpush: worker.logpush,
|
|
176
|
-
observability: metadata.observability,
|
|
177
|
-
subdomain: news.subdomain ?? {
|
|
178
|
-
enabled: true,
|
|
179
|
-
previews_enabled: true,
|
|
180
|
-
},
|
|
181
|
-
url:
|
|
182
|
-
news.subdomain?.enabled !== false
|
|
183
|
-
? `https://${name}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
184
|
-
: undefined,
|
|
185
|
-
tags: metadata.tags,
|
|
186
|
-
accountId,
|
|
187
|
-
hash: {
|
|
188
|
-
assets: assets?.hash,
|
|
189
|
-
bundle: bundle.hash,
|
|
190
|
-
},
|
|
191
|
-
} as WorkerAttr<WorkerProps<any>>;
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
return {
|
|
195
|
-
stables: ["workerId"],
|
|
196
|
-
diff: Effect.fnUntraced(function* ({ id, news, output }) {
|
|
197
|
-
if (output.accountId !== accountId) {
|
|
198
|
-
return { action: "replace" };
|
|
199
|
-
}
|
|
200
|
-
const workerName = yield* createWorkerName(id, news.name);
|
|
201
|
-
if (workerName !== output.workerName) {
|
|
202
|
-
return { action: "replace" };
|
|
203
|
-
}
|
|
204
|
-
const [assets, bundle] = yield* Effect.all([
|
|
205
|
-
prepareAssets(news.assets),
|
|
206
|
-
prepareBundle(id, news.main),
|
|
207
|
-
]).pipe(Effect.orDie);
|
|
208
|
-
if (
|
|
209
|
-
assets?.hash !== output.hash.assets ||
|
|
210
|
-
bundle.hash !== output.hash.bundle
|
|
211
|
-
) {
|
|
212
|
-
return {
|
|
213
|
-
action: "update",
|
|
214
|
-
stables: output.workerName === workerName ? ["name"] : undefined,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
}),
|
|
218
|
-
read: Effect.fnUntraced(function* ({ id, output }) {
|
|
219
|
-
const workerName = yield* createWorkerName(id, output?.workerName);
|
|
220
|
-
const worker = yield* api.workers.beta.workers.get(workerName, {
|
|
221
|
-
account_id: accountId,
|
|
222
|
-
});
|
|
223
|
-
return {
|
|
224
|
-
accountId,
|
|
225
|
-
workerId: worker.id,
|
|
226
|
-
workerName: worker.name,
|
|
227
|
-
logpush: worker.logpush,
|
|
228
|
-
observability: worker.observability,
|
|
229
|
-
subdomain: {
|
|
230
|
-
enabled: worker.subdomain.enabled,
|
|
231
|
-
previews_enabled: worker.subdomain.previews_enabled,
|
|
232
|
-
},
|
|
233
|
-
url: worker.subdomain.enabled
|
|
234
|
-
? `https://${workerName}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
235
|
-
: undefined,
|
|
236
|
-
tags: worker.tags,
|
|
237
|
-
} as WorkerAttr<WorkerProps<any>>;
|
|
238
|
-
}),
|
|
239
|
-
create: Effect.fnUntraced(function* ({ id, news, bindings, session }) {
|
|
240
|
-
const name = yield* createWorkerName(id, news.name);
|
|
241
|
-
const existing = yield* api.workers.beta.workers
|
|
242
|
-
.get(name, {
|
|
243
|
-
account_id: accountId,
|
|
244
|
-
})
|
|
245
|
-
.pipe(Effect.catchTag("NotFound", () => Effect.void));
|
|
246
|
-
if (existing) {
|
|
247
|
-
return yield* Effect.fail(
|
|
248
|
-
new Error(`Worker "${name}" already exists`),
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
return yield* putWorker(
|
|
252
|
-
id,
|
|
253
|
-
news,
|
|
254
|
-
bindings,
|
|
255
|
-
undefined,
|
|
256
|
-
undefined,
|
|
257
|
-
session,
|
|
258
|
-
);
|
|
259
|
-
}),
|
|
260
|
-
update: Effect.fnUntraced(function* ({
|
|
261
|
-
id,
|
|
262
|
-
olds,
|
|
263
|
-
news,
|
|
264
|
-
output,
|
|
265
|
-
bindings,
|
|
266
|
-
session,
|
|
267
|
-
}) {
|
|
268
|
-
return yield* putWorker(id, news, bindings, olds, output, session);
|
|
269
|
-
}),
|
|
270
|
-
delete: Effect.fnUntraced(function* ({ output }) {
|
|
271
|
-
yield* api.workers.scripts
|
|
272
|
-
.delete(output.workerId, {
|
|
273
|
-
account_id: output.accountId,
|
|
274
|
-
})
|
|
275
|
-
.pipe(Effect.catchTag("NotFound", () => Effect.void));
|
|
276
|
-
}),
|
|
277
|
-
};
|
|
278
|
-
}),
|
|
279
|
-
);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ExecutionContext } from "@cloudflare/workers-types";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Worker from "./worker.ts";
|
|
4
|
-
|
|
5
|
-
export type { ExecutionContext };
|
|
6
|
-
export type * from "../../exports.ts";
|
|
7
|
-
|
|
8
|
-
export const serve =
|
|
9
|
-
<const ID extends string, Req>(
|
|
10
|
-
id: ID,
|
|
11
|
-
{
|
|
12
|
-
fetch,
|
|
13
|
-
}: {
|
|
14
|
-
fetch: (
|
|
15
|
-
request: Request,
|
|
16
|
-
env: unknown,
|
|
17
|
-
ctx: ExecutionContext,
|
|
18
|
-
) => Effect.Effect<Response, never, Req>;
|
|
19
|
-
},
|
|
20
|
-
) =>
|
|
21
|
-
<const Props extends Worker.WorkerProps<Req>>(props: Props) =>
|
|
22
|
-
Worker.Worker(id, { handle: fetch })(props);
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { Workers } from "cloudflare/resources";
|
|
2
|
-
import { Runtime, type RuntimeProps } from "../../runtime.ts";
|
|
3
|
-
import type * as Assets from "./assets.fetch.ts";
|
|
4
|
-
|
|
5
|
-
export const WorkerType = "Cloudflare.Worker" as const;
|
|
6
|
-
export type WorkerType = typeof WorkerType;
|
|
7
|
-
|
|
8
|
-
export type WorkerProps<Req = any> = RuntimeProps<
|
|
9
|
-
Worker,
|
|
10
|
-
Exclude<Req, Assets.Fetch>
|
|
11
|
-
> & {
|
|
12
|
-
name?: string;
|
|
13
|
-
logpush?: boolean;
|
|
14
|
-
observability?: Worker.Observability;
|
|
15
|
-
subdomain?: Worker.Subdomain;
|
|
16
|
-
tags?: string[];
|
|
17
|
-
main: string;
|
|
18
|
-
compatibility?: {
|
|
19
|
-
date?: string;
|
|
20
|
-
flags?: string[];
|
|
21
|
-
};
|
|
22
|
-
limits?: Worker.Limits;
|
|
23
|
-
placement?: Worker.Placement;
|
|
24
|
-
} & (Extract<Req, Assets.Fetch> extends never
|
|
25
|
-
? {
|
|
26
|
-
assets?: string | Worker.AssetsProps;
|
|
27
|
-
}
|
|
28
|
-
: {
|
|
29
|
-
assets: string | Worker.AssetsProps;
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export type WorkerAttr<Props extends WorkerProps<any>> = {
|
|
33
|
-
workerId: string;
|
|
34
|
-
workerName: Props["name"] extends string ? Props["name"] : string;
|
|
35
|
-
logpush: Props["logpush"] extends boolean ? Props["logpush"] : boolean;
|
|
36
|
-
observability: Props["observability"] extends Worker.Observability
|
|
37
|
-
? Props["observability"]
|
|
38
|
-
: {
|
|
39
|
-
// whatever cloudflare's (or our, probably ours) default is
|
|
40
|
-
};
|
|
41
|
-
url: Props["subdomain"] extends { enabled: false } ? undefined : string;
|
|
42
|
-
subdomain: Props["subdomain"] extends Worker.Subdomain
|
|
43
|
-
? Props["subdomain"]
|
|
44
|
-
: { enabled: true; previews_enabled: true };
|
|
45
|
-
tags: Props["tags"] extends string[] ? Props["tags"] : string[];
|
|
46
|
-
accountId: string;
|
|
47
|
-
hash: { assets: string | undefined; bundle: string };
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export interface Worker extends Runtime<WorkerType> {
|
|
51
|
-
base: Worker;
|
|
52
|
-
props: WorkerProps<any>;
|
|
53
|
-
attr: WorkerAttr<Extract<this["props"], WorkerProps<any>>>;
|
|
54
|
-
binding: {
|
|
55
|
-
bindings: Worker.Binding[];
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export const Worker = Runtime(WorkerType)<Worker>();
|
|
60
|
-
|
|
61
|
-
export declare namespace Worker {
|
|
62
|
-
export type Observability = Workers.ScriptUpdateParams.Metadata.Observability;
|
|
63
|
-
export type Subdomain = Workers.Beta.Worker.Subdomain;
|
|
64
|
-
export type Binding = NonNullable<
|
|
65
|
-
Workers.Beta.Workers.VersionCreateParams["bindings"]
|
|
66
|
-
>[number];
|
|
67
|
-
export type Limits = Workers.Beta.Workers.Version.Limits;
|
|
68
|
-
export type Placement = Workers.Beta.Workers.Version.Placement;
|
|
69
|
-
export type Assets = Workers.Beta.Workers.Version.Assets;
|
|
70
|
-
export type AssetsConfig = Workers.Beta.Workers.Version.Assets.Config;
|
|
71
|
-
export type Module = Workers.Beta.Workers.Version.Module;
|
|
72
|
-
|
|
73
|
-
export interface AssetsProps {
|
|
74
|
-
directory: string;
|
|
75
|
-
config?: AssetsConfig;
|
|
76
|
-
}
|
|
77
|
-
}
|
package/src/destroy.ts
DELETED