alchemy 2.0.0-beta.34 → 2.0.0-beta.36
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/cli.js +8 -7
- package/bin/exec.js +253 -52
- package/bin/exec.js.map +1 -1
- package/lib/AWS/AuthProvider.d.ts +7 -6
- package/lib/AWS/AuthProvider.d.ts.map +1 -1
- package/lib/AWS/AuthProvider.js +143 -134
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/Bootstrap.d.ts +2 -2
- package/lib/AWS/Bootstrap.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.d.ts +1 -1
- package/lib/AWS/Environment.d.ts +25 -3
- package/lib/AWS/Environment.d.ts.map +1 -1
- package/lib/AWS/Environment.js +47 -3
- package/lib/AWS/Environment.js.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.d.ts +14 -6
- package/lib/AWS/IAM/OpenIDConnectProvider.d.ts.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.js +6 -3
- package/lib/AWS/IAM/OpenIDConnectProvider.js.map +1 -1
- package/lib/AWS/IAM/Policy.d.ts +1 -1
- package/lib/AWS/IAM/Policy.d.ts.map +1 -1
- package/lib/AWS/IAM/Policy.js.map +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/BucketEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/EventBridgeEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/QueueEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/StreamEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TableEventSource.d.ts.map +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts +1 -1
- package/lib/AWS/Lambda/TopicEventSource.d.ts.map +1 -1
- package/lib/AWS/Providers.d.ts +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +2 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/Auth/Credentials.d.ts +21 -6
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +30 -31
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Profile.d.ts +31 -34
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +46 -31
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Axiom/AuthProvider.d.ts +2 -1
- package/lib/Axiom/AuthProvider.d.ts.map +1 -1
- package/lib/Axiom/AuthProvider.js +149 -143
- package/lib/Axiom/AuthProvider.js.map +1 -1
- package/lib/Axiom/Credentials.d.ts +2 -1
- package/lib/Axiom/Credentials.d.ts.map +1 -1
- package/lib/Axiom/Credentials.js +4 -4
- package/lib/Axiom/Credentials.js.map +1 -1
- package/lib/Axiom/Providers.d.ts +1 -1
- package/lib/Axiom/Providers.d.ts.map +1 -1
- package/lib/Axiom/Providers.js +3 -1
- package/lib/Axiom/Providers.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +105 -7
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/checkVersion.d.ts +13 -0
- package/lib/Cli/checkVersion.d.ts.map +1 -0
- package/lib/Cli/checkVersion.js +47 -0
- package/lib/Cli/checkVersion.js.map +1 -0
- package/lib/Cli/commands/_shared.d.ts +2 -2
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +3 -3
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +6 -0
- package/lib/Cli/commands/aws.d.ts.map +1 -0
- package/lib/Cli/commands/aws.js +63 -0
- package/lib/Cli/commands/aws.js.map +1 -0
- package/lib/Cli/commands/cloudflare.d.ts +17 -0
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -0
- package/lib/Cli/commands/cloudflare.js +111 -0
- package/lib/Cli/commands/cloudflare.js.map +1 -0
- package/lib/Cli/commands/deploy.d.ts +6 -5
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +10 -10
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +16 -16
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/login.d.ts +2 -1
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +9 -8
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +7 -7
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts +3 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +14 -11
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +8 -8
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/commands/tail.d.ts +1 -1
- package/lib/Cli/commands/tail.d.ts.map +1 -1
- package/lib/Cli/commands/tail.js +7 -7
- package/lib/Cli/commands/tail.js.map +1 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +5 -3
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +19 -5
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +12 -0
- package/lib/Cli/selectCli.d.ts.map +1 -0
- package/lib/Cli/selectCli.js +32 -0
- package/lib/Cli/selectCli.js.map +1 -0
- 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 +235 -214
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +2 -1
- package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.js +3 -2
- package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
- package/lib/Cloudflare/Credentials.d.ts +2 -1
- package/lib/Cloudflare/Credentials.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.js +4 -4
- package/lib/Cloudflare/Credentials.js.map +1 -1
- package/lib/Cloudflare/D1/D1Clone.d.ts +2 -1
- package/lib/Cloudflare/D1/D1Clone.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +2 -1
- package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Import.d.ts +3 -1
- package/lib/Cloudflare/D1/D1Import.d.ts.map +1 -1
- package/lib/Cloudflare/Images/Images.d.ts +103 -0
- package/lib/Cloudflare/Images/Images.d.ts.map +1 -0
- package/lib/Cloudflare/Images/Images.js +82 -0
- package/lib/Cloudflare/Images/Images.js.map +1 -0
- package/lib/Cloudflare/Images/ImagesBinding.d.ts +73 -0
- package/lib/Cloudflare/Images/ImagesBinding.d.ts.map +1 -0
- package/lib/Cloudflare/Images/ImagesBinding.js +83 -0
- package/lib/Cloudflare/Images/ImagesBinding.js.map +1 -0
- package/lib/Cloudflare/Images/index.d.ts +3 -0
- package/lib/Cloudflare/Images/index.d.ts.map +1 -0
- package/lib/Cloudflare/Images/index.js +3 -0
- package/lib/Cloudflare/Images/index.js.map +1 -0
- package/lib/Cloudflare/Local/Sidecar.d.ts +11 -4
- package/lib/Cloudflare/Local/Sidecar.d.ts.map +1 -1
- package/lib/Cloudflare/Local/Sidecar.js +8 -6
- package/lib/Cloudflare/Local/Sidecar.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +1 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +1 -5
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +1 -1
- package/lib/Cloudflare/Local/SidecarServer.js +5 -2
- package/lib/Cloudflare/Local/SidecarServer.js.map +1 -1
- package/lib/Cloudflare/Logs.d.ts +5 -0
- package/lib/Cloudflare/Logs.d.ts.map +1 -1
- package/lib/Cloudflare/Logs.js +70 -1
- 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 -1
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/Queue.d.ts +1 -1
- package/lib/Cloudflare/Queue/Queue.js +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts +6 -2
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.js +194 -53
- package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +106 -0
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -0
- package/lib/Cloudflare/Queue/QueueEventSource.js +145 -0
- package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -0
- package/lib/Cloudflare/Queue/index.d.ts +1 -0
- package/lib/Cloudflare/Queue/index.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/index.js +1 -0
- package/lib/Cloudflare/Queue/index.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts +229 -0
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +309 -2
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +4 -3
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +16 -8
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts +1 -1
- package/lib/Cloudflare/VpcService/VpcServiceRef.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +10 -1
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +11 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +14 -12
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +96 -165
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +2 -0
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +21 -7
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Zone.d.ts +14 -0
- package/lib/Cloudflare/Zone.d.ts.map +1 -0
- package/lib/Cloudflare/Zone.js +44 -0
- package/lib/Cloudflare/Zone.js.map +1 -0
- package/lib/Cloudflare/index.d.ts +1 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +1 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Drizzle/Schema.d.ts.map +1 -1
- package/lib/Drizzle/Schema.js +20 -5
- package/lib/Drizzle/Schema.js.map +1 -1
- package/lib/GitHub/AuthProvider.d.ts +3 -1
- package/lib/GitHub/AuthProvider.d.ts.map +1 -1
- package/lib/GitHub/AuthProvider.js +114 -108
- package/lib/GitHub/AuthProvider.js.map +1 -1
- package/lib/GitHub/Credentials.d.ts +2 -1
- package/lib/GitHub/Credentials.d.ts.map +1 -1
- package/lib/GitHub/Credentials.js +4 -4
- package/lib/GitHub/Credentials.js.map +1 -1
- package/lib/GitHub/Providers.d.ts +1 -1
- package/lib/GitHub/Providers.d.ts.map +1 -1
- package/lib/GitHub/Providers.js +3 -1
- package/lib/GitHub/Providers.js.map +1 -1
- package/lib/GitHub/Secrets.d.ts.map +1 -1
- package/lib/GitHub/Secrets.js +14 -1
- package/lib/GitHub/Secrets.js.map +1 -1
- package/lib/GitHub/Variables.d.ts +40 -0
- package/lib/GitHub/Variables.d.ts.map +1 -0
- package/lib/GitHub/Variables.js +28 -0
- package/lib/GitHub/Variables.js.map +1 -0
- package/lib/GitHub/index.d.ts +1 -0
- package/lib/GitHub/index.d.ts.map +1 -1
- package/lib/GitHub/index.js +1 -0
- package/lib/GitHub/index.js.map +1 -1
- package/lib/Neon/AuthProvider.d.ts +3 -1
- package/lib/Neon/AuthProvider.d.ts.map +1 -1
- package/lib/Neon/AuthProvider.js +87 -80
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +2 -1
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +4 -4
- package/lib/Neon/Credentials.js.map +1 -1
- package/lib/Neon/NeonEnvironment.d.ts +2 -1
- package/lib/Neon/NeonEnvironment.d.ts.map +1 -1
- package/lib/Neon/NeonEnvironment.js +3 -2
- package/lib/Neon/NeonEnvironment.js.map +1 -1
- package/lib/Neon/Project.d.ts +16 -0
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +25 -0
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Neon/Providers.d.ts +1 -1
- package/lib/Neon/Providers.d.ts.map +1 -1
- package/lib/Neon/Providers.js +3 -1
- package/lib/Neon/Providers.js.map +1 -1
- package/lib/Neon/api.d.ts +1 -0
- package/lib/Neon/api.d.ts.map +1 -1
- package/lib/Neon/api.js +1 -0
- package/lib/Neon/api.js.map +1 -1
- package/lib/Sidecar/RpcClient.d.ts.map +1 -1
- package/lib/Sidecar/RpcClient.js +8 -5
- package/lib/Sidecar/RpcClient.js.map +1 -1
- package/lib/Sidecar/RpcPaths.d.ts +5 -0
- package/lib/Sidecar/RpcPaths.d.ts.map +1 -1
- package/lib/Sidecar/RpcPaths.js +10 -1
- package/lib/Sidecar/RpcPaths.js.map +1 -1
- package/lib/Sidecar/RpcServer.d.ts +24 -4
- package/lib/Sidecar/RpcServer.d.ts.map +1 -1
- package/lib/Sidecar/RpcServer.js +70 -15
- package/lib/Sidecar/RpcServer.js.map +1 -1
- package/lib/Sidecar/RpcServerBun.d.ts +4 -0
- package/lib/Sidecar/RpcServerBun.d.ts.map +1 -0
- package/lib/Sidecar/RpcServerBun.js +28 -0
- package/lib/Sidecar/RpcServerBun.js.map +1 -0
- package/lib/Sidecar/RpcServerNode.d.ts +4 -0
- package/lib/Sidecar/RpcServerNode.d.ts.map +1 -0
- package/lib/Sidecar/RpcServerNode.js +39 -0
- package/lib/Sidecar/RpcServerNode.js.map +1 -0
- package/lib/Sidecar/RpcServices.d.ts +6 -0
- package/lib/Sidecar/RpcServices.d.ts.map +1 -0
- package/lib/Sidecar/RpcServices.js +29 -0
- package/lib/Sidecar/RpcServices.js.map +1 -0
- package/lib/Stack.d.ts +5 -3
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +3 -1
- package/lib/Stack.js.map +1 -1
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +5 -4
- package/lib/Test/Core.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +2 -0
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/LocalhostDns.d.ts +19 -0
- package/lib/Util/LocalhostDns.d.ts.map +1 -0
- package/lib/Util/LocalhostDns.js +55 -0
- package/lib/Util/LocalhostDns.js.map +1 -0
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +3 -1
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +16 -12
- package/src/AWS/AuthProvider.ts +269 -259
- package/src/AWS/Environment.ts +57 -3
- package/src/AWS/IAM/OpenIDConnectProvider.ts +19 -8
- package/src/AWS/IAM/Policy.ts +1 -1
- package/src/AWS/Providers.ts +2 -0
- package/src/Auth/Credentials.ts +82 -46
- package/src/Auth/Profile.ts +123 -69
- package/src/Axiom/AuthProvider.ts +263 -255
- package/src/Axiom/Credentials.ts +3 -4
- package/src/Axiom/Providers.ts +4 -0
- package/src/Cli/LoggingCli.ts +127 -11
- package/src/Cli/checkVersion.ts +57 -0
- package/src/Cli/commands/_shared.ts +4 -4
- package/src/Cli/commands/aws.ts +127 -0
- package/src/Cli/commands/cloudflare.ts +222 -0
- package/src/Cli/commands/deploy.ts +11 -10
- package/src/Cli/commands/dev.ts +28 -33
- package/src/Cli/commands/login.ts +9 -12
- package/src/Cli/commands/logs.ts +8 -8
- package/src/Cli/commands/profile.ts +14 -16
- package/src/Cli/commands/state.ts +8 -8
- package/src/Cli/commands/tail.ts +8 -8
- package/src/Cli/exec.ts +7 -3
- package/src/Cli/main.ts +23 -5
- package/src/Cli/selectCli.ts +33 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +445 -430
- package/src/Cloudflare/CloudflareEnvironment.ts +3 -2
- package/src/Cloudflare/Credentials.ts +3 -4
- package/src/Cloudflare/Images/Images.ts +121 -0
- package/src/Cloudflare/Images/ImagesBinding.ts +192 -0
- package/src/Cloudflare/Images/index.ts +2 -0
- package/src/Cloudflare/Local/Sidecar.ts +13 -10
- package/src/Cloudflare/Local/SidecarHandlers.ts +8 -13
- package/src/Cloudflare/Local/SidecarServer.ts +6 -1
- package/src/Cloudflare/Logs.ts +115 -1
- package/src/Cloudflare/Providers.ts +9 -0
- package/src/Cloudflare/Queue/Queue.ts +1 -1
- package/src/Cloudflare/Queue/QueueConsumer.ts +262 -60
- package/src/Cloudflare/Queue/QueueEventSource.ts +234 -0
- package/src/Cloudflare/Queue/index.ts +1 -0
- package/src/Cloudflare/R2/R2Bucket.ts +570 -2
- package/src/Cloudflare/StateStore/State.ts +25 -16
- package/src/Cloudflare/Website/StaticSite.ts +11 -1
- package/src/Cloudflare/Workers/InferEnv.ts +7 -3
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
- package/src/Cloudflare/Workers/Worker.ts +130 -231
- package/src/Cloudflare/Workers/WorkerBundle.ts +38 -12
- package/src/Cloudflare/Zone.ts +88 -0
- package/src/Cloudflare/index.ts +1 -0
- package/src/Drizzle/Schema.ts +21 -5
- package/src/GitHub/AuthProvider.ts +221 -217
- package/src/GitHub/Credentials.ts +3 -4
- package/src/GitHub/Providers.ts +4 -0
- package/src/GitHub/Secrets.ts +25 -1
- package/src/GitHub/Variables.ts +54 -0
- package/src/GitHub/index.ts +1 -0
- package/src/Neon/AuthProvider.ts +160 -154
- package/src/Neon/Credentials.ts +3 -4
- package/src/Neon/NeonEnvironment.ts +3 -2
- package/src/Neon/Project.ts +42 -0
- package/src/Neon/Providers.ts +4 -0
- package/src/Neon/api.ts +2 -0
- package/src/Sidecar/RpcClient.ts +8 -7
- package/src/Sidecar/RpcPaths.ts +11 -1
- package/src/Sidecar/RpcServer.ts +97 -24
- package/src/Sidecar/RpcServerBun.ts +41 -0
- package/src/Sidecar/RpcServerNode.ts +51 -0
- package/src/Sidecar/RpcServices.ts +48 -0
- package/src/Stack.ts +8 -0
- package/src/Test/Core.ts +10 -4
- package/src/Test/Vitest.ts +3 -0
- package/src/Util/LocalhostDns.ts +58 -0
- package/src/Util/PlatformServices.ts +3 -1
- package/lib/Cli/commands/bootstrap.d.ts +0 -20
- package/lib/Cli/commands/bootstrap.d.ts.map +0 -1
- package/lib/Cli/commands/bootstrap.js +0 -107
- package/lib/Cli/commands/bootstrap.js.map +0 -1
- package/lib/Sidecar/RpcTransport.d.ts +0 -22
- package/lib/Sidecar/RpcTransport.d.ts.map +0 -1
- package/lib/Sidecar/RpcTransport.js +0 -81
- package/lib/Sidecar/RpcTransport.js.map +0 -1
- package/lib/Test/TestCli.d.ts +0 -19
- package/lib/Test/TestCli.d.ts.map +0 -1
- package/lib/Test/TestCli.js +0 -175
- package/lib/Test/TestCli.js.map +0 -1
- package/src/Cli/commands/bootstrap.ts +0 -216
- package/src/Sidecar/RpcTransport.ts +0 -85
- package/src/Test/TestCli.ts +0 -221
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Cloudflare/Queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Cloudflare/Queue/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
|
@@ -3,8 +3,89 @@ import * as Provider from "../../Provider.ts";
|
|
|
3
3
|
import { Resource } from "../../Resource.ts";
|
|
4
4
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
5
5
|
import type * as Cloudflare from "../Providers.ts";
|
|
6
|
+
import * as Zone from "../Zone.ts";
|
|
6
7
|
import { R2BucketBinding } from "./R2BucketBinding.ts";
|
|
7
8
|
export type R2BucketName = string;
|
|
9
|
+
export type R2BucketCustomDomainZone = Zone.ZoneReference;
|
|
10
|
+
export type R2BucketCustomDomain = {
|
|
11
|
+
/**
|
|
12
|
+
* Custom domain name to attach to the bucket.
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* Zone that contains the custom domain. If omitted, the zone is inferred
|
|
17
|
+
* from `domain`. Pass a zone ID string, a hostname in the zone, or any object
|
|
18
|
+
* with a `zoneId` attribute such as `Cloudflare.Zone`.
|
|
19
|
+
*/
|
|
20
|
+
zone?: R2BucketCustomDomainZone;
|
|
21
|
+
/**
|
|
22
|
+
* Whether public bucket access is enabled at this custom domain.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
enabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Allowlist of TLS ciphers in BoringSSL format.
|
|
28
|
+
*/
|
|
29
|
+
ciphers?: string[];
|
|
30
|
+
/**
|
|
31
|
+
* Minimum TLS version accepted by the custom domain.
|
|
32
|
+
* @default "1.0"
|
|
33
|
+
*/
|
|
34
|
+
minTLS?: "1.0" | "1.1" | "1.2" | "1.3";
|
|
35
|
+
};
|
|
36
|
+
export type R2BucketLifecycleCondition = {
|
|
37
|
+
type: "Age";
|
|
38
|
+
/**
|
|
39
|
+
* Maximum age of an object, in seconds, before the rule's action applies.
|
|
40
|
+
*/
|
|
41
|
+
maxAge: number;
|
|
42
|
+
} | {
|
|
43
|
+
type: "Date";
|
|
44
|
+
/**
|
|
45
|
+
* Absolute date (ISO 8601) at which the rule's action applies.
|
|
46
|
+
*/
|
|
47
|
+
date: string;
|
|
48
|
+
};
|
|
49
|
+
export type R2BucketLifecycleRule = {
|
|
50
|
+
/**
|
|
51
|
+
* Unique identifier for the rule within the bucket.
|
|
52
|
+
*/
|
|
53
|
+
id: string;
|
|
54
|
+
/**
|
|
55
|
+
* Whether the rule is enabled.
|
|
56
|
+
* @default true
|
|
57
|
+
*/
|
|
58
|
+
enabled?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Object key prefix the rule applies to. Use `""` (or omit) to match all
|
|
61
|
+
* objects in the bucket.
|
|
62
|
+
* @default ""
|
|
63
|
+
*/
|
|
64
|
+
prefix?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Abort incomplete multipart uploads after the configured age.
|
|
67
|
+
*/
|
|
68
|
+
abortMultipartUploadsTransition?: {
|
|
69
|
+
condition?: {
|
|
70
|
+
type: "Age";
|
|
71
|
+
maxAge: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Delete matching objects after the configured age or on a specific date.
|
|
76
|
+
*/
|
|
77
|
+
deleteObjectsTransition?: {
|
|
78
|
+
condition?: R2BucketLifecycleCondition;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Transition matching objects to a different storage class. Cloudflare R2
|
|
82
|
+
* only supports transitioning to `InfrequentAccess` today.
|
|
83
|
+
*/
|
|
84
|
+
storageClassTransitions?: {
|
|
85
|
+
condition: R2BucketLifecycleCondition;
|
|
86
|
+
storageClass: "InfrequentAccess";
|
|
87
|
+
}[];
|
|
88
|
+
};
|
|
8
89
|
export type R2BucketProps = {
|
|
9
90
|
/**
|
|
10
91
|
* Name of the bucket. If omitted, a unique name will be generated.
|
|
@@ -25,6 +106,17 @@ export type R2BucketProps = {
|
|
|
25
106
|
* Location hint for the bucket.
|
|
26
107
|
*/
|
|
27
108
|
locationHint?: R2Bucket.Location;
|
|
109
|
+
/**
|
|
110
|
+
* Custom domains to attach to the bucket. Pass an empty array (or omit)
|
|
111
|
+
* to remove all custom domains.
|
|
112
|
+
*/
|
|
113
|
+
domains?: R2BucketCustomDomain[];
|
|
114
|
+
/**
|
|
115
|
+
* Object lifecycle rules applied to the bucket. Pass an empty array (or
|
|
116
|
+
* omit) to clear all lifecycle rules. See the Cloudflare R2 docs for
|
|
117
|
+
* supported transitions.
|
|
118
|
+
*/
|
|
119
|
+
lifecycleRules?: R2BucketLifecycleRule[];
|
|
28
120
|
};
|
|
29
121
|
export type R2Bucket = Resource<"Cloudflare.R2Bucket", R2BucketProps, {
|
|
30
122
|
bucketName: R2BucketName;
|
|
@@ -32,6 +124,8 @@ export type R2Bucket = Resource<"Cloudflare.R2Bucket", R2BucketProps, {
|
|
|
32
124
|
jurisdiction: R2Bucket.Jurisdiction;
|
|
33
125
|
location: R2Bucket.Location | undefined;
|
|
34
126
|
accountId: string;
|
|
127
|
+
domains: R2Bucket.CustomDomain[];
|
|
128
|
+
lifecycleRules: R2Bucket.LifecycleRule[];
|
|
35
129
|
}, never, Cloudflare.Providers>;
|
|
36
130
|
/**
|
|
37
131
|
* A Cloudflare R2 object storage bucket with S3-compatible API.
|
|
@@ -75,6 +169,112 @@ export type R2Bucket = Resource<"Cloudflare.R2Bucket", R2BucketProps, {
|
|
|
75
169
|
* contentLength: Number(request.headers["content-length"] ?? 0),
|
|
76
170
|
* });
|
|
77
171
|
* ```
|
|
172
|
+
*
|
|
173
|
+
* @section Custom Domains
|
|
174
|
+
*
|
|
175
|
+
* Attach one or more custom domains to serve bucket objects from a hostname
|
|
176
|
+
* you control. The domain's zone must already exist in your Cloudflare
|
|
177
|
+
* account; the zone is inferred from the hostname when omitted, or you can
|
|
178
|
+
* pass a `Cloudflare.Zone` resource, a zone ID, or any hostname inside the
|
|
179
|
+
* zone via the `zone` field.
|
|
180
|
+
*
|
|
181
|
+
* @example Single custom domain
|
|
182
|
+
* ```typescript
|
|
183
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
184
|
+
* domains: [{ name: "assets.example.com" }],
|
|
185
|
+
* });
|
|
186
|
+
* ```
|
|
187
|
+
*
|
|
188
|
+
* @example Multiple custom domains
|
|
189
|
+
* ```typescript
|
|
190
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
191
|
+
* domains: [
|
|
192
|
+
* { name: "assets.example.com" },
|
|
193
|
+
* { name: "static.example.com" },
|
|
194
|
+
* ],
|
|
195
|
+
* });
|
|
196
|
+
* ```
|
|
197
|
+
*
|
|
198
|
+
* @example Disable a custom domain without removing it
|
|
199
|
+
* ```typescript
|
|
200
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
201
|
+
* domains: [{ name: "assets.example.com", enabled: false }],
|
|
202
|
+
* });
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* @example Custom domain with explicit zone and TLS settings
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const zone = yield* Cloudflare.Zone("ExampleZone", {
|
|
208
|
+
* name: "example.com",
|
|
209
|
+
* });
|
|
210
|
+
*
|
|
211
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
212
|
+
* domains: [
|
|
213
|
+
* {
|
|
214
|
+
* name: "assets.example.com",
|
|
215
|
+
* zone,
|
|
216
|
+
* minTLS: "1.2",
|
|
217
|
+
* },
|
|
218
|
+
* ],
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
221
|
+
*
|
|
222
|
+
* @section Object Lifecycle Rules
|
|
223
|
+
*
|
|
224
|
+
* Configure lifecycle rules to automatically delete objects, abort
|
|
225
|
+
* incomplete multipart uploads, or transition objects to InfrequentAccess
|
|
226
|
+
* storage. Pass an empty array (or omit) to clear all rules. See the
|
|
227
|
+
* [Cloudflare R2 docs](https://developers.cloudflare.com/r2/buckets/object-lifecycles/)
|
|
228
|
+
* for details and limits (max 1000 rules per bucket).
|
|
229
|
+
*
|
|
230
|
+
* @example Delete objects 30 days after upload
|
|
231
|
+
* ```typescript
|
|
232
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
233
|
+
* lifecycleRules: [
|
|
234
|
+
* {
|
|
235
|
+
* id: "expire-old-objects",
|
|
236
|
+
* deleteObjectsTransition: {
|
|
237
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 30 },
|
|
238
|
+
* },
|
|
239
|
+
* },
|
|
240
|
+
* ],
|
|
241
|
+
* });
|
|
242
|
+
* ```
|
|
243
|
+
*
|
|
244
|
+
* @example Transition to InfrequentAccess after 60 days, delete after 365
|
|
245
|
+
* ```typescript
|
|
246
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
247
|
+
* lifecycleRules: [
|
|
248
|
+
* {
|
|
249
|
+
* id: "archive-then-delete",
|
|
250
|
+
* prefix: "logs/",
|
|
251
|
+
* storageClassTransitions: [
|
|
252
|
+
* {
|
|
253
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 60 },
|
|
254
|
+
* storageClass: "InfrequentAccess",
|
|
255
|
+
* },
|
|
256
|
+
* ],
|
|
257
|
+
* deleteObjectsTransition: {
|
|
258
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 365 },
|
|
259
|
+
* },
|
|
260
|
+
* },
|
|
261
|
+
* ],
|
|
262
|
+
* });
|
|
263
|
+
* ```
|
|
264
|
+
*
|
|
265
|
+
* @example Abort incomplete multipart uploads after 7 days
|
|
266
|
+
* ```typescript
|
|
267
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
268
|
+
* lifecycleRules: [
|
|
269
|
+
* {
|
|
270
|
+
* id: "abort-stale-uploads",
|
|
271
|
+
* abortMultipartUploadsTransition: {
|
|
272
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 7 },
|
|
273
|
+
* },
|
|
274
|
+
* },
|
|
275
|
+
* ],
|
|
276
|
+
* });
|
|
277
|
+
* ```
|
|
78
278
|
*/
|
|
79
279
|
export declare const R2Bucket: import("../../Resource.ts").ResourceClassWithMethods<R2Bucket, {
|
|
80
280
|
readonly bind: (<Req = never>(args_0: R2Bucket | Effect.Effect<R2Bucket, never, Req>) => Effect.Effect<import("./R2BucketBinding.ts").R2BucketClient, never, R2BucketBinding | Req>) & ((bucket: R2Bucket) => Effect.Effect<any, any, any>);
|
|
@@ -83,6 +283,35 @@ export declare namespace R2Bucket {
|
|
|
83
283
|
type StorageClass = "Standard" | "InfrequentAccess";
|
|
84
284
|
type Jurisdiction = "default" | "eu" | "fedramp";
|
|
85
285
|
type Location = "apac" | "eeur" | "enam" | "weur" | "wnam" | "oc";
|
|
286
|
+
type LifecycleRule = {
|
|
287
|
+
id: string;
|
|
288
|
+
enabled: boolean;
|
|
289
|
+
prefix: string;
|
|
290
|
+
abortMultipartUploadsTransition: {
|
|
291
|
+
condition: {
|
|
292
|
+
type: "Age";
|
|
293
|
+
maxAge: number;
|
|
294
|
+
} | undefined;
|
|
295
|
+
} | undefined;
|
|
296
|
+
deleteObjectsTransition: {
|
|
297
|
+
condition: R2BucketLifecycleCondition | undefined;
|
|
298
|
+
} | undefined;
|
|
299
|
+
storageClassTransitions: {
|
|
300
|
+
condition: R2BucketLifecycleCondition;
|
|
301
|
+
storageClass: "InfrequentAccess";
|
|
302
|
+
}[] | undefined;
|
|
303
|
+
};
|
|
304
|
+
type CustomDomain = {
|
|
305
|
+
domain: string;
|
|
306
|
+
zoneId: string | undefined;
|
|
307
|
+
enabled: boolean;
|
|
308
|
+
ciphers: string[] | undefined;
|
|
309
|
+
minTLS: "1.0" | "1.1" | "1.2" | "1.3" | undefined;
|
|
310
|
+
status: {
|
|
311
|
+
ownership: "pending" | "active" | "deactivated" | "blocked" | "error" | "unknown";
|
|
312
|
+
ssl: "initializing" | "pending" | "active" | "deactivated" | "error" | "unknown";
|
|
313
|
+
} | undefined;
|
|
314
|
+
};
|
|
86
315
|
}
|
|
87
316
|
export declare const R2BucketProvider: () => import("effect/Layer").Layer<Provider.Provider<R2Bucket>, never, import("effect/unstable/http/HttpClient").HttpClient | import("../../Stage.ts").Stage | import("../../Stack.ts").Stack | Cloudflare.Credentials | CloudflareEnvironment>;
|
|
88
317
|
//# sourceMappingURL=R2Bucket.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"R2Bucket.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/R2/R2Bucket.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"R2Bucket.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/R2/R2Bucket.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as r2 from "@distilled.cloud/cloudflare/r2";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
-
import
|
|
3
|
+
import * as Schedule from "effect/Schedule";
|
|
4
|
+
import { deepEqual, isResolved } from "../../Diff.js";
|
|
4
5
|
import { createPhysicalName } from "../../PhysicalName.js";
|
|
5
6
|
import * as Provider from "../../Provider.js";
|
|
6
7
|
import { Resource } from "../../Resource.js";
|
|
7
8
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.js";
|
|
9
|
+
import * as Zone from "../Zone.js";
|
|
8
10
|
import { R2BucketBinding } from "./R2BucketBinding.js";
|
|
9
11
|
/**
|
|
10
12
|
* A Cloudflare R2 object storage bucket with S3-compatible API.
|
|
@@ -48,6 +50,112 @@ import { R2BucketBinding } from "./R2BucketBinding.js";
|
|
|
48
50
|
* contentLength: Number(request.headers["content-length"] ?? 0),
|
|
49
51
|
* });
|
|
50
52
|
* ```
|
|
53
|
+
*
|
|
54
|
+
* @section Custom Domains
|
|
55
|
+
*
|
|
56
|
+
* Attach one or more custom domains to serve bucket objects from a hostname
|
|
57
|
+
* you control. The domain's zone must already exist in your Cloudflare
|
|
58
|
+
* account; the zone is inferred from the hostname when omitted, or you can
|
|
59
|
+
* pass a `Cloudflare.Zone` resource, a zone ID, or any hostname inside the
|
|
60
|
+
* zone via the `zone` field.
|
|
61
|
+
*
|
|
62
|
+
* @example Single custom domain
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
65
|
+
* domains: [{ name: "assets.example.com" }],
|
|
66
|
+
* });
|
|
67
|
+
* ```
|
|
68
|
+
*
|
|
69
|
+
* @example Multiple custom domains
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
72
|
+
* domains: [
|
|
73
|
+
* { name: "assets.example.com" },
|
|
74
|
+
* { name: "static.example.com" },
|
|
75
|
+
* ],
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*
|
|
79
|
+
* @example Disable a custom domain without removing it
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
82
|
+
* domains: [{ name: "assets.example.com", enabled: false }],
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* @example Custom domain with explicit zone and TLS settings
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const zone = yield* Cloudflare.Zone("ExampleZone", {
|
|
89
|
+
* name: "example.com",
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
93
|
+
* domains: [
|
|
94
|
+
* {
|
|
95
|
+
* name: "assets.example.com",
|
|
96
|
+
* zone,
|
|
97
|
+
* minTLS: "1.2",
|
|
98
|
+
* },
|
|
99
|
+
* ],
|
|
100
|
+
* });
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @section Object Lifecycle Rules
|
|
104
|
+
*
|
|
105
|
+
* Configure lifecycle rules to automatically delete objects, abort
|
|
106
|
+
* incomplete multipart uploads, or transition objects to InfrequentAccess
|
|
107
|
+
* storage. Pass an empty array (or omit) to clear all rules. See the
|
|
108
|
+
* [Cloudflare R2 docs](https://developers.cloudflare.com/r2/buckets/object-lifecycles/)
|
|
109
|
+
* for details and limits (max 1000 rules per bucket).
|
|
110
|
+
*
|
|
111
|
+
* @example Delete objects 30 days after upload
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
114
|
+
* lifecycleRules: [
|
|
115
|
+
* {
|
|
116
|
+
* id: "expire-old-objects",
|
|
117
|
+
* deleteObjectsTransition: {
|
|
118
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 30 },
|
|
119
|
+
* },
|
|
120
|
+
* },
|
|
121
|
+
* ],
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* @example Transition to InfrequentAccess after 60 days, delete after 365
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
128
|
+
* lifecycleRules: [
|
|
129
|
+
* {
|
|
130
|
+
* id: "archive-then-delete",
|
|
131
|
+
* prefix: "logs/",
|
|
132
|
+
* storageClassTransitions: [
|
|
133
|
+
* {
|
|
134
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 60 },
|
|
135
|
+
* storageClass: "InfrequentAccess",
|
|
136
|
+
* },
|
|
137
|
+
* ],
|
|
138
|
+
* deleteObjectsTransition: {
|
|
139
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 365 },
|
|
140
|
+
* },
|
|
141
|
+
* },
|
|
142
|
+
* ],
|
|
143
|
+
* });
|
|
144
|
+
* ```
|
|
145
|
+
*
|
|
146
|
+
* @example Abort incomplete multipart uploads after 7 days
|
|
147
|
+
* ```typescript
|
|
148
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
149
|
+
* lifecycleRules: [
|
|
150
|
+
* {
|
|
151
|
+
* id: "abort-stale-uploads",
|
|
152
|
+
* abortMultipartUploadsTransition: {
|
|
153
|
+
* condition: { type: "Age", maxAge: 60 * 60 * 24 * 7 },
|
|
154
|
+
* },
|
|
155
|
+
* },
|
|
156
|
+
* ],
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
51
159
|
*/
|
|
52
160
|
export const R2Bucket = Resource("Cloudflare.R2Bucket")({
|
|
53
161
|
bind: R2BucketBinding.bind,
|
|
@@ -58,6 +166,12 @@ export const R2BucketProvider = () => Provider.effect(R2Bucket, Effect.gen(funct
|
|
|
58
166
|
const patchBucket = yield* r2.patchBucket;
|
|
59
167
|
const deleteBucket = yield* r2.deleteBucket;
|
|
60
168
|
const getBucket = yield* r2.getBucket;
|
|
169
|
+
const listBucketDomainCustoms = yield* r2.listBucketDomainCustoms;
|
|
170
|
+
const createBucketDomainCustom = yield* r2.createBucketDomainCustom;
|
|
171
|
+
const updateBucketDomainCustom = yield* r2.updateBucketDomainCustom;
|
|
172
|
+
const deleteBucketDomainCustom = yield* r2.deleteBucketDomainCustom;
|
|
173
|
+
const getBucketLifecycle = yield* r2.getBucketLifecycle;
|
|
174
|
+
const putBucketLifecycle = yield* r2.putBucketLifecycle;
|
|
61
175
|
const createBucketName = (id, name) => Effect.gen(function* () {
|
|
62
176
|
if (name)
|
|
63
177
|
return name;
|
|
@@ -71,6 +185,116 @@ export const R2BucketProvider = () => Provider.effect(R2Bucket, Effect.gen(funct
|
|
|
71
185
|
return undefined;
|
|
72
186
|
return location.toLowerCase();
|
|
73
187
|
};
|
|
188
|
+
const listCustomDomains = (bucketName, jurisdiction) => listBucketDomainCustoms({
|
|
189
|
+
accountId,
|
|
190
|
+
bucketName,
|
|
191
|
+
jurisdiction,
|
|
192
|
+
}).pipe(Effect.retry({
|
|
193
|
+
while: isNoSuchBucket,
|
|
194
|
+
schedule: r2BucketEndpointConsistencySchedule,
|
|
195
|
+
}), Effect.map((response) => response.domains.map(toCustomDomainAttributes)), Effect.catchTag("NoSuchBucket", () => Effect.succeed(undefined)));
|
|
196
|
+
const reconcileCustomDomains = (bucketName, jurisdiction, desired, previous) => Effect.gen(function* () {
|
|
197
|
+
const observed = yield* listCustomDomains(bucketName, jurisdiction);
|
|
198
|
+
if (!observed) {
|
|
199
|
+
return yield* Effect.fail(new Error(`Cannot reconcile custom domains for missing R2 bucket "${bucketName}"`));
|
|
200
|
+
}
|
|
201
|
+
const observedByDomain = new Map(observed.map((domain) => [domain.domain, domain]));
|
|
202
|
+
const desiredDomains = new Set(desired.map((domain) => domain.name));
|
|
203
|
+
// Remove domains that are no longer desired. Domains that keep the
|
|
204
|
+
// same hostname but move zones are intentionally skipped here and
|
|
205
|
+
// handled in the per-domain flow below.
|
|
206
|
+
yield* Effect.forEach(previous, (previousDomain) => desiredDomains.has(previousDomain.domain)
|
|
207
|
+
? Effect.void
|
|
208
|
+
: deleteBucketDomainCustom({
|
|
209
|
+
accountId,
|
|
210
|
+
bucketName,
|
|
211
|
+
domain: previousDomain.domain,
|
|
212
|
+
jurisdiction,
|
|
213
|
+
}).pipe(Effect.catchIf(isMissingCustomDomainOrBucket, () => Effect.void)), { concurrency: "unbounded" });
|
|
214
|
+
const applied = yield* Effect.forEach(desired, (domain) => Effect.gen(function* () {
|
|
215
|
+
const zoneId = yield* Zone.resolveZoneId({
|
|
216
|
+
accountId,
|
|
217
|
+
zone: domain.zone,
|
|
218
|
+
hostname: domain.name,
|
|
219
|
+
});
|
|
220
|
+
const observedDomain = observedByDomain.get(domain.name);
|
|
221
|
+
if (observedDomain &&
|
|
222
|
+
sameCustomDomainConfig(observedDomain, domain, zoneId)) {
|
|
223
|
+
return observedDomain;
|
|
224
|
+
}
|
|
225
|
+
if (observedDomain && observedDomain.zoneId !== zoneId) {
|
|
226
|
+
// Cloudflare does not mutate the zone for an existing custom
|
|
227
|
+
// domain. This is not a duplicate of the stale-domain prune
|
|
228
|
+
// above: the hostname is still desired, so that prune skips it
|
|
229
|
+
// and this branch deletes only to recreate it in the new zone.
|
|
230
|
+
yield* deleteBucketDomainCustom({
|
|
231
|
+
accountId,
|
|
232
|
+
bucketName,
|
|
233
|
+
domain: domain.name,
|
|
234
|
+
jurisdiction,
|
|
235
|
+
}).pipe(Effect.catchIf(isMissingCustomDomainOrBucket, () => Effect.void));
|
|
236
|
+
}
|
|
237
|
+
if (!observedDomain || observedDomain.zoneId !== zoneId) {
|
|
238
|
+
const created = yield* createBucketDomainCustom({
|
|
239
|
+
accountId,
|
|
240
|
+
bucketName,
|
|
241
|
+
jurisdiction,
|
|
242
|
+
domain: domain.name,
|
|
243
|
+
enabled: domain.enabled ?? true,
|
|
244
|
+
zoneId,
|
|
245
|
+
ciphers: domain.ciphers,
|
|
246
|
+
minTLS: domain.minTLS,
|
|
247
|
+
}).pipe(Effect.retry({
|
|
248
|
+
while: isNoSuchBucket,
|
|
249
|
+
schedule: r2BucketEndpointConsistencySchedule,
|
|
250
|
+
}));
|
|
251
|
+
return toCustomDomainAttributes({ ...created, zoneId });
|
|
252
|
+
}
|
|
253
|
+
const updated = yield* updateBucketDomainCustom({
|
|
254
|
+
accountId,
|
|
255
|
+
bucketName,
|
|
256
|
+
domain: domain.name,
|
|
257
|
+
jurisdiction,
|
|
258
|
+
enabled: domain.enabled ?? true,
|
|
259
|
+
ciphers: domain.ciphers,
|
|
260
|
+
minTLS: domain.minTLS,
|
|
261
|
+
}).pipe(Effect.retry({
|
|
262
|
+
while: isNoSuchBucket,
|
|
263
|
+
schedule: r2BucketEndpointConsistencySchedule,
|
|
264
|
+
}));
|
|
265
|
+
return toCustomDomainAttributes({
|
|
266
|
+
...updated,
|
|
267
|
+
enabled: updated.enabled ?? domain.enabled ?? true,
|
|
268
|
+
zoneId,
|
|
269
|
+
});
|
|
270
|
+
}), { concurrency: "unbounded" });
|
|
271
|
+
return applied.sort((a, b) => a.domain.localeCompare(b.domain));
|
|
272
|
+
});
|
|
273
|
+
const reconcileLifecycleRules = (bucketName, jurisdiction, desired) => Effect.gen(function* () {
|
|
274
|
+
const observed = yield* getBucketLifecycle({
|
|
275
|
+
accountId,
|
|
276
|
+
bucketName,
|
|
277
|
+
jurisdiction,
|
|
278
|
+
}).pipe(Effect.retry({
|
|
279
|
+
while: isNoSuchBucket,
|
|
280
|
+
schedule: r2BucketEndpointConsistencySchedule,
|
|
281
|
+
}));
|
|
282
|
+
const observedRules = (observed.rules ?? []).map(toLifecycleRule);
|
|
283
|
+
const desiredRules = desired.map(normalizeLifecycleRule);
|
|
284
|
+
if (deepEqual(observedRules, desiredRules)) {
|
|
285
|
+
return desiredRules;
|
|
286
|
+
}
|
|
287
|
+
yield* putBucketLifecycle({
|
|
288
|
+
accountId,
|
|
289
|
+
bucketName,
|
|
290
|
+
jurisdiction,
|
|
291
|
+
rules: desired.map(toLifecyclePutPayload),
|
|
292
|
+
}).pipe(Effect.retry({
|
|
293
|
+
while: isNoSuchBucket,
|
|
294
|
+
schedule: r2BucketEndpointConsistencySchedule,
|
|
295
|
+
}));
|
|
296
|
+
return desiredRules;
|
|
297
|
+
});
|
|
74
298
|
return {
|
|
75
299
|
stables: ["bucketName", "accountId"],
|
|
76
300
|
diff: Effect.fn(function* ({ id, olds = {}, news = {}, output }) {
|
|
@@ -94,6 +318,12 @@ export const R2BucketProvider = () => Provider.effect(R2Bucket, Effect.gen(funct
|
|
|
94
318
|
stables: oldName === name ? ["bucketName"] : undefined,
|
|
95
319
|
};
|
|
96
320
|
}
|
|
321
|
+
if (!deepEqual(olds.domains, news.domains)) {
|
|
322
|
+
return { action: "update" };
|
|
323
|
+
}
|
|
324
|
+
if (!deepEqual(olds.lifecycleRules, news.lifecycleRules)) {
|
|
325
|
+
return { action: "update" };
|
|
326
|
+
}
|
|
97
327
|
}),
|
|
98
328
|
reconcile: Effect.fn(function* ({ id, news = {}, output }) {
|
|
99
329
|
const name = yield* createBucketName(id, news.name);
|
|
@@ -137,15 +367,30 @@ export const R2BucketProvider = () => Provider.effect(R2Bucket, Effect.gen(funct
|
|
|
137
367
|
jurisdiction: observed.jurisdiction ?? jurisdiction,
|
|
138
368
|
});
|
|
139
369
|
}
|
|
140
|
-
|
|
370
|
+
const attrs = {
|
|
141
371
|
bucketName: observed.name,
|
|
142
372
|
storageClass: observed.storageClass ?? "Standard",
|
|
143
373
|
jurisdiction: observed.jurisdiction ?? "default",
|
|
144
374
|
location: normalizeLocation(observed.location),
|
|
145
375
|
accountId: acct,
|
|
146
376
|
};
|
|
377
|
+
const domains = yield* reconcileCustomDomains(attrs.bucketName, attrs.jurisdiction, news.domains ?? [], output?.domains ?? []);
|
|
378
|
+
const lifecycleRules = yield* reconcileLifecycleRules(attrs.bucketName, attrs.jurisdiction, news.lifecycleRules ?? []);
|
|
379
|
+
return {
|
|
380
|
+
...attrs,
|
|
381
|
+
domains,
|
|
382
|
+
lifecycleRules,
|
|
383
|
+
};
|
|
147
384
|
}),
|
|
148
385
|
delete: Effect.fn(function* ({ output }) {
|
|
386
|
+
for (const domain of output.domains ?? []) {
|
|
387
|
+
yield* deleteBucketDomainCustom({
|
|
388
|
+
accountId: output.accountId,
|
|
389
|
+
bucketName: output.bucketName,
|
|
390
|
+
domain: domain.domain,
|
|
391
|
+
jurisdiction: output.jurisdiction,
|
|
392
|
+
}).pipe(Effect.catchIf(isMissingCustomDomainOrBucket, () => Effect.void));
|
|
393
|
+
}
|
|
149
394
|
yield* deleteBucket({
|
|
150
395
|
accountId: output.accountId,
|
|
151
396
|
bucketName: output.bucketName,
|
|
@@ -165,8 +410,70 @@ export const R2BucketProvider = () => Provider.effect(R2Bucket, Effect.gen(funct
|
|
|
165
410
|
jurisdiction: bucket.jurisdiction ?? "default",
|
|
166
411
|
location: normalizeLocation(bucket.location),
|
|
167
412
|
accountId: acct,
|
|
413
|
+
domains: output?.domains ?? [],
|
|
414
|
+
lifecycleRules: output?.lifecycleRules ?? [],
|
|
168
415
|
})), Effect.catchTag("NoSuchBucket", () => Effect.succeed(undefined)));
|
|
169
416
|
}),
|
|
170
417
|
};
|
|
171
418
|
}));
|
|
419
|
+
// R2 can make a newly-created bucket visible to `getBucket` before its
|
|
420
|
+
// sub-resource endpoints (custom domains, lifecycle) accept it. Retry only
|
|
421
|
+
// that narrow `NoSuchBucket` lag here; not-found sub-resources are still
|
|
422
|
+
// treated as terminal for idempotent deletes.
|
|
423
|
+
const r2BucketEndpointConsistencySchedule = Schedule.exponential(100).pipe(Schedule.both(Schedule.recurs(5)));
|
|
424
|
+
const toCustomDomainAttributes = (domain) => ({
|
|
425
|
+
domain: domain.domain,
|
|
426
|
+
zoneId: domain.zoneId ?? undefined,
|
|
427
|
+
enabled: domain.enabled ?? true,
|
|
428
|
+
ciphers: domain.ciphers ?? undefined,
|
|
429
|
+
minTLS: domain.minTLS ?? undefined,
|
|
430
|
+
status: domain.status,
|
|
431
|
+
});
|
|
432
|
+
const sameCustomDomainConfig = (observed, desired, zoneId) => observed !== undefined &&
|
|
433
|
+
observed.zoneId === zoneId &&
|
|
434
|
+
observed.enabled === (desired.enabled ?? true) &&
|
|
435
|
+
deepEqual(observed.ciphers, desired.ciphers) &&
|
|
436
|
+
observed.minTLS === desired.minTLS;
|
|
437
|
+
const isMissingCustomDomainOrBucket = (error) => typeof error === "object" &&
|
|
438
|
+
error !== null &&
|
|
439
|
+
(("status" in error && error.status === 404) ||
|
|
440
|
+
("_tag" in error &&
|
|
441
|
+
(error._tag === "DomainNotFound" ||
|
|
442
|
+
error._tag === "NoSuchBucket")));
|
|
443
|
+
const toLifecycleRule = (rule) => ({
|
|
444
|
+
id: rule.id,
|
|
445
|
+
enabled: rule.enabled,
|
|
446
|
+
prefix: rule.conditions.prefix ?? "",
|
|
447
|
+
abortMultipartUploadsTransition: rule.abortMultipartUploadsTransition
|
|
448
|
+
? { condition: rule.abortMultipartUploadsTransition.condition ?? undefined }
|
|
449
|
+
: undefined,
|
|
450
|
+
deleteObjectsTransition: rule.deleteObjectsTransition
|
|
451
|
+
? { condition: rule.deleteObjectsTransition.condition ?? undefined }
|
|
452
|
+
: undefined,
|
|
453
|
+
storageClassTransitions: rule.storageClassTransitions ?? undefined,
|
|
454
|
+
});
|
|
455
|
+
const normalizeLifecycleRule = (rule) => ({
|
|
456
|
+
id: rule.id,
|
|
457
|
+
enabled: rule.enabled ?? true,
|
|
458
|
+
prefix: rule.prefix ?? "",
|
|
459
|
+
abortMultipartUploadsTransition: rule.abortMultipartUploadsTransition
|
|
460
|
+
? { condition: rule.abortMultipartUploadsTransition.condition }
|
|
461
|
+
: undefined,
|
|
462
|
+
deleteObjectsTransition: rule.deleteObjectsTransition
|
|
463
|
+
? { condition: rule.deleteObjectsTransition.condition }
|
|
464
|
+
: undefined,
|
|
465
|
+
storageClassTransitions: rule.storageClassTransitions,
|
|
466
|
+
});
|
|
467
|
+
const toLifecyclePutPayload = (rule) => ({
|
|
468
|
+
id: rule.id,
|
|
469
|
+
enabled: rule.enabled ?? true,
|
|
470
|
+
conditions: { prefix: rule.prefix ?? "" },
|
|
471
|
+
abortMultipartUploadsTransition: rule.abortMultipartUploadsTransition,
|
|
472
|
+
deleteObjectsTransition: rule.deleteObjectsTransition,
|
|
473
|
+
storageClassTransitions: rule.storageClassTransitions,
|
|
474
|
+
});
|
|
475
|
+
const isNoSuchBucket = (error) => typeof error === "object" &&
|
|
476
|
+
error !== null &&
|
|
477
|
+
"_tag" in error &&
|
|
478
|
+
error._tag === "NoSuchBucket";
|
|
172
479
|
//# sourceMappingURL=R2Bucket.js.map
|