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
|
@@ -6,7 +6,7 @@ import * as Layer from "effect/Layer";
|
|
|
6
6
|
import * as Match from "effect/Match";
|
|
7
7
|
import * as Redacted from "effect/Redacted";
|
|
8
8
|
import { getAuthProvider } from "../Auth/AuthProvider.js";
|
|
9
|
-
import { ALCHEMY_PROFILE,
|
|
9
|
+
import { ALCHEMY_PROFILE, Profile } from "../Auth/Profile.js";
|
|
10
10
|
import { CLOUDFLARE_AUTH_PROVIDER_NAME, } from "./Auth/AuthProvider.js";
|
|
11
11
|
export { Credentials, fromEnv } from "@distilled.cloud/cloudflare/Credentials";
|
|
12
12
|
/**
|
|
@@ -15,11 +15,11 @@ export { Credentials, fromEnv } from "@distilled.cloud/cloudflare/Credentials";
|
|
|
15
15
|
* overridable with the `ALCHEMY_PROFILE` env/config value).
|
|
16
16
|
*/
|
|
17
17
|
export const fromAuthProvider = () => Layer.effect(Credentials, Effect.gen(function* () {
|
|
18
|
+
const profile = yield* Profile;
|
|
18
19
|
const auth = yield* getAuthProvider(CLOUDFLARE_AUTH_PROVIDER_NAME);
|
|
19
20
|
const profileName = yield* ALCHEMY_PROFILE;
|
|
20
21
|
const ci = yield* Config.boolean("CI").pipe(Config.withDefault(false));
|
|
21
|
-
|
|
22
|
-
return loadOrConfigure(auth, profileName, { ci }).pipe(Effect.flatMap((config) => auth.read(profileName, config)), Effect.map((creds) => Match.value(creds).pipe(Match.when({ type: "apiToken" }, (c) => apiTokenCredentials({
|
|
22
|
+
return profile.loadOrConfigure(auth, profileName, { ci }).pipe(Effect.flatMap((config) => auth.read(profileName, config)), Effect.map((creds) => Match.value(creds).pipe(Match.when({ type: "apiToken" }, (c) => apiTokenCredentials({
|
|
23
23
|
apiToken: Redacted.value(c.apiToken),
|
|
24
24
|
})), Match.when({ type: "apiKey" }, (c) => apiKeyCredentials({
|
|
25
25
|
apiKey: Redacted.value(c.apiKey),
|
|
@@ -29,6 +29,6 @@ export const fromAuthProvider = () => Layer.effect(Credentials, Effect.gen(funct
|
|
|
29
29
|
expiresAt: c.expires,
|
|
30
30
|
})), Match.exhaustive)), Effect.mapError((e) => new ConfigError({
|
|
31
31
|
message: `Failed to resolve Cloudflare credentials for profile '${profileName}': ${e.message ?? String(e)}`,
|
|
32
|
-
}))
|
|
32
|
+
})));
|
|
33
33
|
}));
|
|
34
34
|
//# sourceMappingURL=Credentials.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Credentials.js","sourceRoot":"","sources":["../../src/Cloudflare/Credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,WAAW,EACX,gBAAgB,GACjB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,
|
|
1
|
+
{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effect";
|
|
2
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
2
3
|
export interface CloneD1DatabaseOptions {
|
|
3
4
|
accountId: string;
|
|
4
5
|
sourceDatabaseId: string;
|
|
@@ -9,5 +10,5 @@ export interface CloneD1DatabaseOptions {
|
|
|
9
10
|
* target. Fetches the SQL dump from the export's signed URL and streams the
|
|
10
11
|
* payload through the import flow.
|
|
11
12
|
*/
|
|
12
|
-
export declare const cloneD1Database: (options: CloneD1DatabaseOptions) => Effect.Effect<import("./D1Import.ts").ImportD1DatabaseResult, import("@distilled.cloud/axiom").ConfigError | import("@distilled.cloud/axiom").Unauthorized | import("@distilled.cloud/axiom").TooManyRequests | import("@distilled.cloud/axiom").InternalServerError | import("@distilled.cloud/axiom").BadGateway | import("@distilled.cloud/axiom").ServiceUnavailable | import("@distilled.cloud/axiom").GatewayTimeout | import("@distilled.cloud/cloudflare").CloudflareHttpError | import("@distilled.cloud/cloudflare").CloudflareParseError | import("@distilled.cloud/cloudflare").UnknownCloudflareError | import("@distilled.cloud/cloudflare").OAuthRefreshError | import("@distilled.cloud/cloudflare/d1").InvalidObjectIdentifier | import("@distilled.cloud/cloudflare/d1").InvalidRequest | import("@distilled.cloud/cloudflare/d1").DatabaseNotFound,
|
|
13
|
+
export declare const cloneD1Database: (options: CloneD1DatabaseOptions) => Effect.Effect<import("./D1Import.ts").ImportD1DatabaseResult, import("@distilled.cloud/axiom").ConfigError | import("@distilled.cloud/axiom").Unauthorized | import("@distilled.cloud/axiom").TooManyRequests | import("@distilled.cloud/axiom").InternalServerError | import("@distilled.cloud/axiom").BadGateway | import("@distilled.cloud/axiom").ServiceUnavailable | import("@distilled.cloud/axiom").GatewayTimeout | import("@distilled.cloud/cloudflare").CloudflareHttpError | import("@distilled.cloud/cloudflare").CloudflareParseError | import("@distilled.cloud/cloudflare").InvalidRoute | import("@distilled.cloud/cloudflare").UnknownCloudflareError | import("@distilled.cloud/cloudflare").OAuthRefreshError | import("@distilled.cloud/cloudflare/d1").InvalidObjectIdentifier | import("@distilled.cloud/cloudflare/d1").InvalidRequest | import("@distilled.cloud/cloudflare/d1").DatabaseNotFound, HttpClient.HttpClient | import("@distilled.cloud/cloudflare").Credentials>;
|
|
13
14
|
//# sourceMappingURL=D1Clone.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1Clone.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Clone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"D1Clone.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Clone.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAK9D,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,28BAwB3D,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as Provider from "../../Provider.ts";
|
|
2
2
|
import { Resource } from "../../Resource.ts";
|
|
3
|
+
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
3
4
|
import type { Providers } from "../Providers.ts";
|
|
4
5
|
export type Jurisdiction = "default" | "eu" | "fedramp";
|
|
5
6
|
export type PrimaryLocationHint = "wnam" | "enam" | "weur" | "eeur" | "apac" | "oc";
|
|
@@ -216,5 +217,5 @@ export type D1Database = Resource<"Cloudflare.D1Database", DatabaseProps, {
|
|
|
216
217
|
* @see https://developers.cloudflare.com/d1/
|
|
217
218
|
*/
|
|
218
219
|
export declare const D1Database: import("../../Resource.ts").ResourceClass<D1Database>;
|
|
219
|
-
export declare const DatabaseProvider: () => import("effect/Layer").Layer<Provider.Provider<D1Database>, never,
|
|
220
|
+
export declare const DatabaseProvider: () => import("effect/Layer").Layer<Provider.Provider<D1Database>, never, import("effect/Path").Path | import("effect/FileSystem").FileSystem | import("effect/unstable/http/HttpClient").HttpClient | import("../../Stage.ts").Stage | import("../../Stack.ts").Stack | import("@distilled.cloud/cloudflare").Credentials | CloudflareEnvironment>;
|
|
220
221
|
//# sourceMappingURL=D1Database.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1Database.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Database.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"D1Database.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Database.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMjD,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAAC;AACxD,MAAM,MAAM,mBAAmB,GAC3B,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,IAAI,CAAC;AAIT,MAAM,MAAM,WAAW,GACnB,UAAU,GACV;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GACtB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAErB,MAAM,MAAM,aAAa,GAAG;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C;;;;;OAK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/cloudflare/Credentials";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
3
5
|
export interface ImportD1DatabaseOptions {
|
|
4
6
|
accountId: string;
|
|
5
7
|
databaseId: string;
|
|
@@ -17,5 +19,5 @@ export interface ImportD1DatabaseResult {
|
|
|
17
19
|
* 3. POST `action: "ingest"` -> returns `at_bookmark`
|
|
18
20
|
* 4. POST `action: "poll"` until `status === "complete"`
|
|
19
21
|
*/
|
|
20
|
-
export declare const importD1Database: (options: ImportD1DatabaseOptions) => Effect.Effect<ImportD1DatabaseResult, import("@distilled.cloud/cloudflare").CredentialsError | d1.ImportDatabaseError,
|
|
22
|
+
export declare const importD1Database: (options: ImportD1DatabaseOptions) => Effect.Effect<ImportD1DatabaseResult, import("@distilled.cloud/cloudflare").CredentialsError | d1.ImportDatabaseError, HttpClient.HttpClient | Credentials>;
|
|
21
23
|
//# sourceMappingURL=D1Import.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"D1Import.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"D1Import.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/D1/D1Import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACrD,OAAO,EACL,WAAW,EAEZ,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,iCAAiC,CAAC;AAG9D,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,GAAG,UAAU,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;CACpB;AAyBD;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS,uBAAuB,gKAuG7D,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { ImagesBinding } from "./ImagesBinding.ts";
|
|
3
|
+
type ImagesTypeId = typeof ImagesTypeId;
|
|
4
|
+
declare const ImagesTypeId: "Cloudflare.Images";
|
|
5
|
+
export type ImagesProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Binding name used when `Cloudflare.Images.bind(images)` attaches Images
|
|
8
|
+
* from inside a Worker init phase. When Images is passed through
|
|
9
|
+
* `Worker({ bindings: { ... } })`, the object key remains the binding name.
|
|
10
|
+
*
|
|
11
|
+
* @default "IMAGES"
|
|
12
|
+
*/
|
|
13
|
+
name?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Marker for a Cloudflare Images binding.
|
|
17
|
+
*
|
|
18
|
+
* Images bindings are configured directly on Workers and do not have a
|
|
19
|
+
* standalone provisioning API. The Worker provider sees this object in
|
|
20
|
+
* `bindings: { ... }` and emits the corresponding `{ type: "images" }`
|
|
21
|
+
* metadata binding to the script.
|
|
22
|
+
*/
|
|
23
|
+
export type Images = {
|
|
24
|
+
kind: ImagesTypeId;
|
|
25
|
+
name: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const isImages: (value: unknown) => value is Images;
|
|
28
|
+
/**
|
|
29
|
+
* A Cloudflare Images binding for image transformation and manipulation inside
|
|
30
|
+
* Workers.
|
|
31
|
+
*
|
|
32
|
+
* The Effect-native interface (`Cloudflare.Images.bind(...)`) returns an
|
|
33
|
+
* `ImagesClient` whose methods take Effect `Stream.Stream<Uint8Array>`
|
|
34
|
+
* inputs and return `Effect`s — `info`, `input(...).transform(...)
|
|
35
|
+
* .draw(...).output(...)`. The runtime conversion to Cloudflare's
|
|
36
|
+
* `ReadableStream` is handled internally.
|
|
37
|
+
*
|
|
38
|
+
* @section Declaring Images
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const Pipeline = yield* Cloudflare.Images({ name: "PIPELINE" });
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @section Effect-style Worker (recommended)
|
|
45
|
+
* @example Read image format and dimensions from the request body
|
|
46
|
+
* ```typescript
|
|
47
|
+
* import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
|
|
48
|
+
*
|
|
49
|
+
* Cloudflare.Worker("ImageWorker", { main: import.meta.filename },
|
|
50
|
+
* Effect.gen(function* () {
|
|
51
|
+
* const pipeline = yield* Pipeline;
|
|
52
|
+
* const images = yield* Cloudflare.Images.bind(pipeline);
|
|
53
|
+
* return {
|
|
54
|
+
* fetch: Effect.gen(function* () {
|
|
55
|
+
* const request = yield* HttpServerRequest;
|
|
56
|
+
* // request.stream is Stream.Stream<Uint8Array>
|
|
57
|
+
* const info = yield* images.info(request.stream);
|
|
58
|
+
* return yield* HttpServerResponse.json(info);
|
|
59
|
+
* }),
|
|
60
|
+
* };
|
|
61
|
+
* }).pipe(Effect.provide(Cloudflare.ImagesBindingLive)),
|
|
62
|
+
* );
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Transform an image — chainable pipeline, single Effect at the end
|
|
66
|
+
* ```typescript
|
|
67
|
+
* const result = yield* (yield* images.input(request.stream))
|
|
68
|
+
* .transform({ width: 128 })
|
|
69
|
+
* .output({ format: "image/jpeg" });
|
|
70
|
+
*
|
|
71
|
+
* const response = yield* result.response;
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @section Binding to a Worker (declarative)
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* export const Worker = Cloudflare.Worker("Worker", {
|
|
78
|
+
* main: "./src/worker.ts",
|
|
79
|
+
* bindings: { MEDIA: Pipeline },
|
|
80
|
+
* });
|
|
81
|
+
*
|
|
82
|
+
* export type WorkerEnv = Cloudflare.InferEnv<typeof Worker>;
|
|
83
|
+
* // { MEDIA: ImagesBinding }
|
|
84
|
+
* ```
|
|
85
|
+
*
|
|
86
|
+
* Inside the Worker, the raw Cloudflare runtime binding is reachable via
|
|
87
|
+
* `client.raw` if you need to call `info()` / `input()` directly with
|
|
88
|
+
* `async`/`await`. The Effect-native interface is preferred — it returns
|
|
89
|
+
* tagged `ImagesError`s, threads `WorkerEnvironment`, and lets you stream
|
|
90
|
+
* Effect `Stream<Uint8Array>` sources without manual conversion.
|
|
91
|
+
*
|
|
92
|
+
* @see https://developers.cloudflare.com/images/transform-images/bindings/
|
|
93
|
+
*/
|
|
94
|
+
export declare const Images: {
|
|
95
|
+
(props?: ImagesProps): Effect.Effect<Images>;
|
|
96
|
+
/**
|
|
97
|
+
* Bind Cloudflare Images to the surrounding Worker, returning an
|
|
98
|
+
* Effect-native client with access to the native Workers runtime binding.
|
|
99
|
+
*/
|
|
100
|
+
bind: typeof ImagesBinding.bind;
|
|
101
|
+
};
|
|
102
|
+
export {};
|
|
103
|
+
//# sourceMappingURL=Images.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Images.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Images/Images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,KAAK,YAAY,GAAG,OAAO,YAAY,CAAC;AACxC,QAAA,MAAM,YAAY,EAAG,mBAA4B,CAAC;AAElD,MAAM,MAAM,WAAW,GAAG;IACxB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAIV,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,eAAO,MAAM,MAAM,EAAE;IACnB,CAAC,KAAK,CAAC,EAAE,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7C;;;OAGG;IACH,IAAI,EAAE,OAAO,aAAa,CAAC,IAAI,CAAC;CAYjC,CAAC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as Effect from "effect/Effect";
|
|
2
|
+
import { ImagesBinding } from "./ImagesBinding.js";
|
|
3
|
+
const ImagesTypeId = "Cloudflare.Images";
|
|
4
|
+
export const isImages = (value) => typeof value === "object" &&
|
|
5
|
+
value !== null &&
|
|
6
|
+
"kind" in value &&
|
|
7
|
+
value.kind === ImagesTypeId;
|
|
8
|
+
/**
|
|
9
|
+
* A Cloudflare Images binding for image transformation and manipulation inside
|
|
10
|
+
* Workers.
|
|
11
|
+
*
|
|
12
|
+
* The Effect-native interface (`Cloudflare.Images.bind(...)`) returns an
|
|
13
|
+
* `ImagesClient` whose methods take Effect `Stream.Stream<Uint8Array>`
|
|
14
|
+
* inputs and return `Effect`s — `info`, `input(...).transform(...)
|
|
15
|
+
* .draw(...).output(...)`. The runtime conversion to Cloudflare's
|
|
16
|
+
* `ReadableStream` is handled internally.
|
|
17
|
+
*
|
|
18
|
+
* @section Declaring Images
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const Pipeline = yield* Cloudflare.Images({ name: "PIPELINE" });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @section Effect-style Worker (recommended)
|
|
25
|
+
* @example Read image format and dimensions from the request body
|
|
26
|
+
* ```typescript
|
|
27
|
+
* import { HttpServerRequest } from "effect/unstable/http/HttpServerRequest";
|
|
28
|
+
*
|
|
29
|
+
* Cloudflare.Worker("ImageWorker", { main: import.meta.filename },
|
|
30
|
+
* Effect.gen(function* () {
|
|
31
|
+
* const pipeline = yield* Pipeline;
|
|
32
|
+
* const images = yield* Cloudflare.Images.bind(pipeline);
|
|
33
|
+
* return {
|
|
34
|
+
* fetch: Effect.gen(function* () {
|
|
35
|
+
* const request = yield* HttpServerRequest;
|
|
36
|
+
* // request.stream is Stream.Stream<Uint8Array>
|
|
37
|
+
* const info = yield* images.info(request.stream);
|
|
38
|
+
* return yield* HttpServerResponse.json(info);
|
|
39
|
+
* }),
|
|
40
|
+
* };
|
|
41
|
+
* }).pipe(Effect.provide(Cloudflare.ImagesBindingLive)),
|
|
42
|
+
* );
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Transform an image — chainable pipeline, single Effect at the end
|
|
46
|
+
* ```typescript
|
|
47
|
+
* const result = yield* (yield* images.input(request.stream))
|
|
48
|
+
* .transform({ width: 128 })
|
|
49
|
+
* .output({ format: "image/jpeg" });
|
|
50
|
+
*
|
|
51
|
+
* const response = yield* result.response;
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @section Binding to a Worker (declarative)
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* export const Worker = Cloudflare.Worker("Worker", {
|
|
58
|
+
* main: "./src/worker.ts",
|
|
59
|
+
* bindings: { MEDIA: Pipeline },
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* export type WorkerEnv = Cloudflare.InferEnv<typeof Worker>;
|
|
63
|
+
* // { MEDIA: ImagesBinding }
|
|
64
|
+
* ```
|
|
65
|
+
*
|
|
66
|
+
* Inside the Worker, the raw Cloudflare runtime binding is reachable via
|
|
67
|
+
* `client.raw` if you need to call `info()` / `input()` directly with
|
|
68
|
+
* `async`/`await`. The Effect-native interface is preferred — it returns
|
|
69
|
+
* tagged `ImagesError`s, threads `WorkerEnvironment`, and lets you stream
|
|
70
|
+
* Effect `Stream<Uint8Array>` sources without manual conversion.
|
|
71
|
+
*
|
|
72
|
+
* @see https://developers.cloudflare.com/images/transform-images/bindings/
|
|
73
|
+
*/
|
|
74
|
+
export const Images = Object.assign(Effect.fn(function* (props) {
|
|
75
|
+
return {
|
|
76
|
+
kind: ImagesTypeId,
|
|
77
|
+
name: props?.name ?? "IMAGES",
|
|
78
|
+
};
|
|
79
|
+
}), {
|
|
80
|
+
bind: (...args) => ImagesBinding.bind(...args),
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=Images.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Images.js","sourceRoot":"","sources":["../../../src/Cloudflare/Images/Images.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,YAAY,GAAG,mBAA4B,CAAC;AA0BlD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAmB,EAAE,CAC1D,OAAO,KAAK,KAAK,QAAQ;IACzB,KAAK,KAAK,IAAI;IACd,MAAM,IAAI,KAAK;IACd,KAAgB,CAAC,IAAI,KAAK,YAAY,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,MAAM,CAAC,MAAM,MAAM,GAOf,MAAM,CAAC,MAAM,CACf,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,KAAmB;IACtC,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,KAAK,EAAE,IAAI,IAAI,QAAQ;KACb,CAAC;AACrB,CAAC,CAAC,EACF;IACE,IAAI,EAAE,CAAC,GAAG,IAA2C,EAAE,EAAE,CACvD,aAAa,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAC9B,CACF,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type * as cf from "@cloudflare/workers-types";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import * as Binding from "../../Binding.ts";
|
|
6
|
+
import { WorkerEnvironment } from "../Workers/Worker.ts";
|
|
7
|
+
import { type Images as ImagesLike } from "./Images.ts";
|
|
8
|
+
declare const ImagesError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
9
|
+
readonly _tag: "ImagesError";
|
|
10
|
+
} & Readonly<A>;
|
|
11
|
+
export declare class ImagesError extends ImagesError_base<{
|
|
12
|
+
message: string;
|
|
13
|
+
code?: number;
|
|
14
|
+
cause: unknown;
|
|
15
|
+
}> {
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Effect-native handle to the result of `input(...).output(...)`.
|
|
19
|
+
* Mirrors the runtime `ImageTransformationResult` but exposes side
|
|
20
|
+
* effects (response/image/contentType reads) as plain sync effects.
|
|
21
|
+
*/
|
|
22
|
+
export interface ImageTransformationResultClient {
|
|
23
|
+
raw: cf.ImageTransformationResult;
|
|
24
|
+
response: Effect.Effect<cf.Response>;
|
|
25
|
+
contentType: Effect.Effect<string>;
|
|
26
|
+
image(options?: cf.ImageTransformationOutputOptions): Effect.Effect<cf.ReadableStream<Uint8Array>>;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Effect-native chainable transformer. `transform`/`draw` are pure
|
|
30
|
+
* (return a new client wrapping the next runtime transformer);
|
|
31
|
+
* `output` is the only step that crosses into Cloudflare's runtime
|
|
32
|
+
* and therefore returns an Effect.
|
|
33
|
+
*/
|
|
34
|
+
export interface ImageTransformerClient {
|
|
35
|
+
raw: cf.ImageTransformer;
|
|
36
|
+
transform(transform: cf.ImageTransform): ImageTransformerClient;
|
|
37
|
+
draw<E = never, R = never>(image: Stream.Stream<Uint8Array, E, R> | ImageTransformerClient, options?: cf.ImageDrawOptions): Effect.Effect<ImageTransformerClient, never, R>;
|
|
38
|
+
output(options: cf.ImageOutputOptions): Effect.Effect<ImageTransformationResultClient, ImagesError>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Effect-native client for a Cloudflare Images binding.
|
|
42
|
+
*
|
|
43
|
+
* Wraps the runtime {@link cf.ImagesBinding} so each method returns
|
|
44
|
+
* an Effect tagged with {@link ImagesError}. Use
|
|
45
|
+
* `Cloudflare.Images.bind(images)` inside a Worker's init phase.
|
|
46
|
+
*/
|
|
47
|
+
export interface ImagesClient {
|
|
48
|
+
/** Effect resolving to the raw Cloudflare runtime binding. */
|
|
49
|
+
raw: Effect.Effect<cf.ImagesBinding, never, WorkerEnvironment>;
|
|
50
|
+
/**
|
|
51
|
+
* Read image format and dimensions from a stream of bytes.
|
|
52
|
+
* Fails with {@link ImagesError} (code 9412) if the input is not
|
|
53
|
+
* a recognized image.
|
|
54
|
+
*/
|
|
55
|
+
info<E = never, R = never>(stream: Stream.Stream<Uint8Array, E, R>, options?: cf.ImageInputOptions): Effect.Effect<cf.ImageInfoResponse, ImagesError, WorkerEnvironment | R>;
|
|
56
|
+
/**
|
|
57
|
+
* Begin a transformation pipeline. Subsequent `.transform()` /
|
|
58
|
+
* `.draw()` calls are pure; `.output(opts)` runs the pipeline.
|
|
59
|
+
*/
|
|
60
|
+
input<E = never, R = never>(stream: Stream.Stream<Uint8Array, E, R>, options?: cf.ImageInputOptions): Effect.Effect<ImageTransformerClient, never, WorkerEnvironment | R>;
|
|
61
|
+
}
|
|
62
|
+
declare const ImagesBinding_base: Binding.Service<ImagesBinding, "Cloudflare.Images.Binding", (images: ImagesLike) => Effect.Effect<ImagesClient>> & {
|
|
63
|
+
bind: (images: ImagesLike) => Effect.Effect<any, any, any>;
|
|
64
|
+
};
|
|
65
|
+
export declare class ImagesBinding extends ImagesBinding_base {
|
|
66
|
+
}
|
|
67
|
+
export declare const ImagesBindingLive: Layer.Layer<ImagesBinding, never, import("../../RuntimeContext.ts").RuntimeContext<import("../../RuntimeContext.ts").BaseRuntimeContext> | ImagesBindingPolicy>;
|
|
68
|
+
declare const ImagesBindingPolicy_base: Binding.Policy<ImagesBindingPolicy, "Policy<Cloudflare.Images.Binding>", (images: ImagesLike) => Effect.Effect<void>>;
|
|
69
|
+
export declare class ImagesBindingPolicy extends ImagesBindingPolicy_base {
|
|
70
|
+
}
|
|
71
|
+
export declare const ImagesBindingPolicyLive: Layer.Layer<ImagesBindingPolicy, never, never>;
|
|
72
|
+
export {};
|
|
73
|
+
//# sourceMappingURL=ImagesBinding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImagesBinding.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Images/ImagesBinding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAErD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAY,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,KAAK,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAC;;;;AAExD,qBAAa,WAAY,SAAQ,iBAAgC;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;CAAG;AAEL;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C,GAAG,EAAE,EAAE,CAAC,yBAAyB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;IACrC,W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AAC,GAAG,KAAK,EAAE,CAAC,GAAG,KAAK,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC,EACvC,OAAO,CAAC,EAAE,EAAE,CAAC,iBAAiB,GAC7B,MAAM,CAAC,MAAM,CAAC,sBAAsB,EAAE,KAAK,EAAE,iBAAiB,GAAG,CAAC,CAAC,CAAC;CACxE;uGAIU,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;;;AAFrD,qBAAa,aAAc,SAAQ,kBAGH;CAAG;AAEnC,eAAO,MAAM,iBAAiB,iKA+B7B,CAAC;0HAIS,UAAU,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;AAF7C,qBAAa,mBAAoB,SAAQ,wBAGT;CAAG;AAEnC,eAAO,MAAM,uBAAuB,gDAiBnC,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as Data from "effect/Data";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Layer from "effect/Layer";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import * as Binding from "../../Binding.js";
|
|
6
|
+
import { isWorker, WorkerEnvironment } from "../Workers/Worker.js";
|
|
7
|
+
import {} from "./Images.js";
|
|
8
|
+
export class ImagesError extends Data.TaggedError("ImagesError") {
|
|
9
|
+
}
|
|
10
|
+
export class ImagesBinding extends Binding.Service()("Cloudflare.Images.Binding") {
|
|
11
|
+
}
|
|
12
|
+
export const ImagesBindingLive = Layer.effect(ImagesBinding, Effect.gen(function* () {
|
|
13
|
+
const Policy = yield* ImagesBindingPolicy;
|
|
14
|
+
return Effect.fn(function* (images) {
|
|
15
|
+
yield* Policy(images);
|
|
16
|
+
const env = WorkerEnvironment.asEffect();
|
|
17
|
+
const raw = env.pipe(Effect.map((env) => env[images.name]));
|
|
18
|
+
return {
|
|
19
|
+
raw,
|
|
20
|
+
info: (stream, options) => Effect.gen(function* () {
|
|
21
|
+
const binding = yield* raw;
|
|
22
|
+
const readable = yield* toCfReadable(stream);
|
|
23
|
+
return yield* tryPromise(() => binding.info(readable, options));
|
|
24
|
+
}),
|
|
25
|
+
input: (stream, options) => Effect.gen(function* () {
|
|
26
|
+
const binding = yield* raw;
|
|
27
|
+
const readable = yield* toCfReadable(stream);
|
|
28
|
+
return wrapTransformer(binding.input(readable, options));
|
|
29
|
+
}),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
}));
|
|
33
|
+
export class ImagesBindingPolicy extends Binding.Policy()("Cloudflare.Images.Binding") {
|
|
34
|
+
}
|
|
35
|
+
export const ImagesBindingPolicyLive = ImagesBindingPolicy.layer.succeed(Effect.fn(function* (host, images) {
|
|
36
|
+
if (isWorker(host)) {
|
|
37
|
+
yield* host.bind(images.name, {
|
|
38
|
+
bindings: [
|
|
39
|
+
{
|
|
40
|
+
type: "images",
|
|
41
|
+
name: images.name,
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
return yield* Effect.die(new Error(`ImagesBinding does not support runtime '${host.Type}'`));
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
const tryPromise = (fn) => Effect.tryPromise({
|
|
51
|
+
try: fn,
|
|
52
|
+
catch: (error) => new ImagesError({
|
|
53
|
+
message: error?.message ?? "Unknown error",
|
|
54
|
+
code: typeof error?.code === "number" ? error.code : undefined,
|
|
55
|
+
cause: error,
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
/**
|
|
59
|
+
* Convert an Effect `Stream<Uint8Array>` into the `cf.ReadableStream<Uint8Array>`
|
|
60
|
+
* shape that the Cloudflare Images runtime binding expects. The two
|
|
61
|
+
* `ReadableStream` types only differ at the type level; at runtime they
|
|
62
|
+
* are the same Web Streams API.
|
|
63
|
+
*/
|
|
64
|
+
const toCfReadable = (stream) => Stream.toReadableStreamEffect(stream).pipe(Effect.map((s) => s));
|
|
65
|
+
const isTransformerClient = (image) => typeof image === "object" && image !== null && "raw" in image;
|
|
66
|
+
const wrapTransformer = (raw) => ({
|
|
67
|
+
raw,
|
|
68
|
+
transform: (transform) => wrapTransformer(raw.transform(transform)),
|
|
69
|
+
draw: (image, options) => {
|
|
70
|
+
if (isTransformerClient(image)) {
|
|
71
|
+
return Effect.succeed(wrapTransformer(raw.draw(image.raw, options)));
|
|
72
|
+
}
|
|
73
|
+
return toCfReadable(image).pipe(Effect.map((readable) => wrapTransformer(raw.draw(readable, options))));
|
|
74
|
+
},
|
|
75
|
+
output: (options) => tryPromise(() => raw.output(options)).pipe(Effect.map(wrapResult)),
|
|
76
|
+
});
|
|
77
|
+
const wrapResult = (raw) => ({
|
|
78
|
+
raw,
|
|
79
|
+
response: Effect.sync(() => raw.response()),
|
|
80
|
+
contentType: Effect.sync(() => raw.contentType()),
|
|
81
|
+
image: (options) => Effect.sync(() => raw.image(options)),
|
|
82
|
+
});
|
|
83
|
+
//# sourceMappingURL=ImagesBinding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImagesBinding.js","sourceRoot":"","sources":["../../../src/Cloudflare/Images/ImagesBinding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAA6B,MAAM,aAAa,CAAC;AAExD,MAAM,OAAO,WAAY,SAAQ,IAAI,CAAC,WAAW,CAAC,aAAa,CAI7D;CAAG;AA+DL,MAAM,OAAO,aAAc,SAAQ,OAAO,CAAC,OAAO,EAG/C,CAAC,2BAA2B,CAAC;CAAG;AA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CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IACjD,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;CAC1D,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Images/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Cloudflare/Images/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ServeError, type ServeResult } from "@distilled.cloud/cloudflare-runtime/Server";
|
|
2
1
|
import * as Worker from "@distilled.cloud/cloudflare-runtime/Worker";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
4
|
import { BundleError } from "../../Bundle/Bundle.ts";
|
|
5
5
|
import type { WorkerBinding } from "../Workers/Worker.ts";
|
|
6
6
|
import type { WorkerBundleOptions } from "../Workers/WorkerBundle.ts";
|
|
@@ -14,15 +14,22 @@ export interface ServeOptions extends WorkerBundleOptions {
|
|
|
14
14
|
hyperdrives?: Record<string, Worker.HyperdriveOrigin>;
|
|
15
15
|
durableObjectNamespaces: Worker.DurableObjectNamespace[];
|
|
16
16
|
}
|
|
17
|
+
export declare const ServeResult: Schema.Struct<{
|
|
18
|
+
readonly name: Schema.String;
|
|
19
|
+
readonly address: Schema.String;
|
|
20
|
+
}>;
|
|
21
|
+
export type ServeResult = typeof ServeResult.Type;
|
|
22
|
+
export declare const ServeError: Schema.Union<readonly [Schema.Union<readonly [typeof import("@distilled.cloud/cloudflare-runtime/RuntimeError").ConfigError, typeof import("@distilled.cloud/cloudflare-runtime/RuntimeError").SystemError, typeof import("@distilled.cloud/cloudflare-runtime/RuntimeError").ApiError]>, typeof BundleError]>;
|
|
23
|
+
export type ServeError = typeof ServeError.Type;
|
|
17
24
|
export declare const SidecarSchema: import("../../Sidecar/RpcHandler.ts").RpcHandlerEncoders<{
|
|
18
|
-
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError
|
|
25
|
+
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError>;
|
|
19
26
|
readonly stop: (name: string) => Effect.Effect<void>;
|
|
20
27
|
}> & import("../../Sidecar/RpcHandler.ts").RpcHandlerDecoders<{
|
|
21
|
-
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError
|
|
28
|
+
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError>;
|
|
22
29
|
readonly stop: (name: string) => Effect.Effect<void>;
|
|
23
30
|
}>;
|
|
24
31
|
declare const Sidecar_base: import("effect/Context").ServiceClass<Sidecar, "Sidecar", {
|
|
25
|
-
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError
|
|
32
|
+
readonly serve: (options: ServeOptions) => Effect.Effect<ServeResult, ServeError>;
|
|
26
33
|
readonly stop: (name: string) => Effect.Effect<void>;
|
|
27
34
|
}>;
|
|
28
35
|
export declare class Sidecar extends Sidecar_base {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidecar.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Local/Sidecar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Sidecar.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Local/Sidecar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,4CAA4C,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAA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B,CAAC"}
|
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RuntimeError } from "@distilled.cloud/cloudflare-runtime/RuntimeError";
|
|
2
2
|
import * as Worker from "@distilled.cloud/cloudflare-runtime/Worker";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import { BundleError } from "../../Bundle/Bundle.js";
|
|
6
6
|
import * as RpcClient from "../../Sidecar/RpcClient.js";
|
|
7
7
|
import { defineSchema } from "../../Sidecar/RpcHandler.js";
|
|
8
|
+
export const ServeResult = Schema.Struct({
|
|
9
|
+
name: Schema.String,
|
|
10
|
+
address: Schema.String,
|
|
11
|
+
});
|
|
12
|
+
export const ServeError = Schema.Union([RuntimeError, BundleError]);
|
|
8
13
|
export const SidecarSchema = defineSchema({
|
|
9
14
|
serve: {
|
|
10
|
-
success:
|
|
11
|
-
|
|
12
|
-
address: Schema.String,
|
|
13
|
-
}),
|
|
14
|
-
error: Schema.Union([ServeError, BundleError]),
|
|
15
|
+
success: ServeResult,
|
|
16
|
+
error: ServeError,
|
|
15
17
|
},
|
|
16
18
|
stop: { success: Schema.Void, error: Schema.Never },
|
|
17
19
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidecar.js","sourceRoot":"","sources":["../../../src/Cloudflare/Local/Sidecar.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Sidecar.js","sourceRoot":"","sources":["../../../src/Cloudflare/Local/Sidecar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kDAAkD,CAAC;AAChF,OAAO,KAAK,MAAM,MAAM,4CAA4C,CAAC;AACrE,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,SAAS,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAe3D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM;CACvB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC;AAGpE,MAAM,CAAC,MAAM,aAAa,GAAG,YAAY,CAAqB;IAC5D,KAAK,EAAE;QACL,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,UAAU;KAClB;IACD,IAAI,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE;CACpD,CAAC,CAAC;AAEH,MAAM,OAAO,OAAQ,SAAQ,SAAS,CAAC,gBAAgB,EAQpD,CAAC,SAAS,CAAC;CAAG;AAEjB,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,EAAE;IAClD,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAChE,MAAM,EAAE,aAAa;CACtB,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidecarHandlers.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Local/SidecarHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4CAA4C,CAAC;AAQrE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAMtC,OAAO,
|
|
1
|
+
{"version":3,"file":"SidecarHandlers.d.ts","sourceRoot":"","sources":["../../../src/Cloudflare/Local/SidecarHandlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,4CAA4C,CAAC;AAQrE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAMtC,OAAO,EACL,OAAO,EAIR,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,eAAe,kHA+I3B,CAAC"}
|
|
@@ -11,7 +11,7 @@ import * as Scope from "effect/Scope";
|
|
|
11
11
|
import * as Stream from "effect/Stream";
|
|
12
12
|
import * as Bundle from "../../Bundle/Bundle.js";
|
|
13
13
|
import { WorkerBundle } from "../Workers/WorkerBundle.js";
|
|
14
|
-
import { Sidecar } from "./Sidecar.js";
|
|
14
|
+
import { Sidecar, } from "./Sidecar.js";
|
|
15
15
|
export const SidecarHandlers = Layer.effect(Sidecar, Effect.gen(function* () {
|
|
16
16
|
const bundle = yield* WorkerBundle;
|
|
17
17
|
const server = yield* Server.Server;
|
|
@@ -20,10 +20,6 @@ export const SidecarHandlers = Layer.effect(Sidecar, Effect.gen(function* () {
|
|
|
20
20
|
const serveScoped = Effect.fnUntraced(function* (worker, modules) {
|
|
21
21
|
const scope = yield* Effect.flatMap(Effect.scope, Scope.fork);
|
|
22
22
|
const result = yield* server
|
|
23
|
-
// The published @distilled.cloud/cloudflare-runtime types don't yet
|
|
24
|
-
// declare `hyperdrives` on the serve options, but the runtime
|
|
25
|
-
// accepts it. Cast through any so dev-mode local DB wiring works
|
|
26
|
-
// until the type is shipped upstream.
|
|
27
23
|
.serve({
|
|
28
24
|
name: worker.id.toLowerCase(),
|
|
29
25
|
compatibilityDate: worker.compatibility.date,
|