alchemy 2.0.0-beta.43 → 2.0.0-beta.45
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 +18 -5
- package/bin/exec.js +381 -240
- package/bin/exec.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +17 -0
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +61 -16
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Providers.d.ts +2 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +3 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/Apply.js +17 -1
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +24 -6
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +3 -3
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Lock.js +2 -2
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +11 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +19 -12
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts +25 -0
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js +16 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -0
- package/lib/Bundle/RawPlugin.d.ts +36 -0
- package/lib/Bundle/RawPlugin.d.ts.map +1 -0
- package/lib/Bundle/RawPlugin.js +80 -0
- package/lib/Bundle/RawPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +2 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +2 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +13 -1
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +33 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts +3 -2
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +19 -2
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +19 -5
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +7 -27
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +2 -1
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +0 -2
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts +0 -2
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.js +2 -4
- package/lib/Cloudflare/AiGateway/AiGateway.js.map +1 -1
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts +116 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.js +92 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.js.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts +55 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.js +55 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.js.map +1 -0
- package/lib/Cloudflare/BrowserRendering/index.d.ts +3 -0
- package/lib/Cloudflare/BrowserRendering/index.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/index.js +3 -0
- package/lib/Cloudflare/BrowserRendering/index.js.map +1 -0
- package/lib/Cloudflare/Container/Container.d.ts +3 -3
- package/lib/Cloudflare/Container/Container.js +3 -3
- package/lib/Cloudflare/Container/StartContainer.d.ts.map +1 -1
- package/lib/Cloudflare/Container/StartContainer.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +1 -0
- package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Database.js +2 -1
- package/lib/Cloudflare/D1/D1Database.js.map +1 -1
- package/lib/Cloudflare/D1/D1DatabaseBinding.js +1 -1
- package/lib/Cloudflare/D1/D1DatabaseBinding.js.map +1 -1
- package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
- package/lib/Cloudflare/Fetcher.js +0 -2
- package/lib/Cloudflare/Fetcher.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.js +3 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +3 -2
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js +32 -33
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespace.d.ts +1 -0
- package/lib/Cloudflare/KV/KVNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/KV/KVNamespace.js +2 -0
- package/lib/Cloudflare/KV/KVNamespace.js.map +1 -1
- package/lib/Cloudflare/Local.d.ts +2 -0
- package/lib/Cloudflare/Local.d.ts.map +1 -0
- package/lib/Cloudflare/Local.js +9 -0
- package/lib/Cloudflare/Local.js.map +1 -0
- package/lib/Cloudflare/Providers.d.ts +2 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +23 -17
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/Queue.d.ts +1 -0
- package/lib/Cloudflare/Queue/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/Queue.js +1 -0
- package/lib/Cloudflare/Queue/Queue.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts +2 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.js +11 -3
- package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +30 -4
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js +22 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts +1 -0
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +18 -0
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.js +13 -34
- package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +3 -2
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +3 -2
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +5 -13
- package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Api.js +14 -8
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +45 -9
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Store.js +5 -2
- package/lib/Cloudflare/StateStore/Store.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcService.d.ts +2 -2
- package/lib/Cloudflare/VpcService/VpcService.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts +5 -5
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +3 -0
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts +5 -5
- package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +1 -1
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +4 -3
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts +183 -6
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js +279 -76
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.d.ts +6 -4
- package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +20 -15
- package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +3 -2
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +19 -3
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +458 -21
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.d.ts +16 -0
- package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.js +22 -0
- package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts +285 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js +288 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js.map +1 -0
- package/lib/Cloudflare/Workers/RpcWorker.d.ts +305 -0
- package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/RpcWorker.js +350 -0
- package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -0
- package/lib/Cloudflare/Workers/Vite.d.ts +1 -1
- package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Vite.js +2 -1
- package/lib/Cloudflare/Workers/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +69 -37
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +171 -51
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +158 -97
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +11 -23
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js +3 -0
- package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +8 -7
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -2
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +7 -7
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +9 -10
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.d.ts +5 -3
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +19 -1
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +2 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +2 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts +184 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js +216 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts +188 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js +4 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js.map +1 -0
- package/lib/Cloudflare/Zaraz/index.d.ts +3 -0
- package/lib/Cloudflare/Zaraz/index.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/index.js +2 -0
- package/lib/Cloudflare/Zaraz/index.js.map +1 -0
- package/lib/Cloudflare/index.d.ts +2 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +2 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Dependencies.d.ts +10 -0
- package/lib/Dependencies.d.ts.map +1 -0
- package/lib/Dependencies.js +1 -0
- package/lib/Dependencies.js.map +1 -0
- package/lib/Deploy.d.ts +2 -1
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +2 -2
- package/lib/Deploy.js.map +1 -1
- package/lib/Diff.d.ts +11 -0
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +11 -0
- package/lib/Diff.js.map +1 -1
- package/lib/Input.d.ts +2 -1
- package/lib/Input.d.ts.map +1 -1
- package/lib/KeyPair.d.ts +77 -0
- package/lib/KeyPair.d.ts.map +1 -0
- package/lib/KeyPair.js +102 -0
- package/lib/KeyPair.js.map +1 -0
- package/lib/Local/RpcProvider.d.ts +56 -0
- package/lib/Local/RpcProvider.d.ts.map +1 -0
- package/lib/Local/RpcProvider.js +83 -0
- package/lib/Local/RpcProvider.js.map +1 -0
- package/lib/Local/RpcProviderProxy.d.ts +19 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -0
- package/lib/Local/RpcProviderProxy.js +48 -0
- package/lib/Local/RpcProviderProxy.js.map +1 -0
- package/lib/Local/RpcSerialization.d.ts +34 -0
- package/lib/Local/RpcSerialization.d.ts.map +1 -0
- package/lib/Local/RpcSerialization.js +120 -0
- package/lib/Local/RpcSerialization.js.map +1 -0
- package/lib/Local/RpcServer.d.ts +63 -0
- package/lib/Local/RpcServer.d.ts.map +1 -0
- package/lib/Local/RpcServer.js +72 -0
- package/lib/Local/RpcServer.js.map +1 -0
- package/lib/Local/RpcServerBun.d.ts +3 -0
- package/lib/Local/RpcServerBun.d.ts.map +1 -0
- package/lib/Local/RpcServerBun.js +47 -0
- package/lib/Local/RpcServerBun.js.map +1 -0
- package/lib/Local/RpcServerEnvironment.d.ts +20 -0
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -0
- package/lib/Local/RpcServerEnvironment.js +22 -0
- package/lib/Local/RpcServerEnvironment.js.map +1 -0
- package/lib/Local/RpcServerNode.d.ts +3 -0
- package/lib/Local/RpcServerNode.d.ts.map +1 -0
- package/lib/Local/RpcServerNode.js +43 -0
- package/lib/Local/RpcServerNode.js.map +1 -0
- package/lib/Local/RpcServerSession.d.ts +27 -0
- package/lib/Local/RpcServerSession.d.ts.map +1 -0
- package/lib/Local/RpcServerSession.js +68 -0
- package/lib/Local/RpcServerSession.js.map +1 -0
- package/lib/Local/RpcSpawner.d.ts +21 -0
- package/lib/Local/RpcSpawner.d.ts.map +1 -0
- package/lib/Local/RpcSpawner.js +132 -0
- package/lib/Local/RpcSpawner.js.map +1 -0
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +14 -3
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +9 -2
- package/lib/Output.js.map +1 -1
- package/lib/Phase.d.ts +2 -1
- package/lib/Phase.d.ts.map +1 -1
- package/lib/Phase.js +6 -1
- package/lib/Phase.js.map +1 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +14 -3
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts +8 -6
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +33 -3
- package/lib/Platform.js.map +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js +9 -14
- package/lib/Random.js.map +1 -1
- package/lib/RuntimeContext.d.ts +21 -1
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +12 -0
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +3 -3
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +2 -2
- package/lib/State/StateEncoding.d.ts +8 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +55 -5
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +0 -2
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +0 -2
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/Duration.d.ts +14 -0
- package/lib/Util/Duration.d.ts.map +1 -0
- package/lib/Util/Duration.js +18 -0
- package/lib/Util/Duration.js.map +1 -0
- package/lib/Util/PlatformServices.d.ts +7 -0
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +22 -11
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/camel.d.ts.map +1 -1
- package/lib/Util/camel.js +2 -3
- package/lib/Util/camel.js.map +1 -1
- package/lib/Util/data.d.ts +5 -0
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +29 -0
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/index.d.ts +0 -6
- package/lib/Util/index.d.ts.map +1 -1
- package/lib/Util/index.js +0 -6
- package/lib/Util/index.js.map +1 -1
- package/lib/Util/stable.d.ts.map +1 -1
- package/lib/Util/stable.js +3 -6
- package/lib/Util/stable.js.map +1 -1
- package/lib/Util/types.d.ts +3 -1
- package/lib/Util/types.d.ts.map +1 -1
- package/lib/Util/types.js +5 -1
- package/lib/Util/types.js.map +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -23
- package/src/AWS/Lambda/Function.ts +87 -34
- package/src/AWS/Providers.ts +3 -0
- package/src/Apply.ts +18 -1
- package/src/Auth/AuthProvider.ts +25 -5
- package/src/Auth/Credentials.ts +8 -7
- package/src/Auth/Lock.ts +2 -2
- package/src/Bundle/Bundle.ts +35 -13
- package/src/Bundle/BundleAnalyzerPlugin.ts +33 -0
- package/src/Bundle/RawPlugin.ts +82 -0
- package/src/Bundle/index.ts +2 -0
- package/src/Cli/commands/_shared.ts +47 -4
- package/src/Cli/commands/dev.ts +63 -37
- package/src/Cli/commands/login.ts +20 -4
- package/src/Cli/commands/profile.ts +24 -34
- package/src/Cli/exec.ts +12 -7
- package/src/Cli/main.ts +0 -3
- package/src/Cloudflare/AiGateway/AiGateway.ts +2 -6
- package/src/Cloudflare/BrowserRendering/BrowserRendering.ts +132 -0
- package/src/Cloudflare/BrowserRendering/BrowserRenderingBinding.ts +137 -0
- package/src/Cloudflare/BrowserRendering/index.ts +11 -0
- package/src/Cloudflare/Container/Container.ts +3 -3
- package/src/Cloudflare/Container/StartContainer.ts +1 -2
- package/src/Cloudflare/D1/D1Database.ts +4 -1
- package/src/Cloudflare/D1/D1DatabaseBinding.ts +1 -1
- package/src/Cloudflare/Fetcher.ts +0 -2
- package/src/Cloudflare/Hyperdrive/Hyperdrive.ts +5 -0
- package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +41 -43
- package/src/Cloudflare/KV/KVNamespace.ts +4 -0
- package/src/Cloudflare/Local.ts +23 -0
- package/src/Cloudflare/Providers.ts +28 -16
- package/src/Cloudflare/Queue/Queue.ts +3 -0
- package/src/Cloudflare/Queue/QueueConsumer.ts +23 -8
- package/src/Cloudflare/Queue/QueueEventSource.ts +33 -5
- package/src/Cloudflare/R2/R2Bucket.ts +26 -0
- package/src/Cloudflare/SecretsStore/Secret.ts +14 -41
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +11 -11
- package/src/Cloudflare/StateStore/Api.ts +15 -15
- package/src/Cloudflare/StateStore/State.ts +68 -6
- package/src/Cloudflare/StateStore/Store.ts +5 -2
- package/src/Cloudflare/VpcService/VpcService.ts +2 -2
- package/src/Cloudflare/Website/StaticSite.ts +8 -10
- package/src/Cloudflare/Website/Vite.ts +4 -7
- package/src/Cloudflare/Workers/Assets.ts +1 -1
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +7 -5
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +380 -121
- package/src/Cloudflare/Workers/HttpServer.ts +31 -25
- package/src/Cloudflare/Workers/InferEnv.ts +15 -8
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +609 -22
- package/src/Cloudflare/Workers/Rpc.ts +50 -0
- package/src/Cloudflare/Workers/RpcDurableObjectNamespace.ts +502 -0
- package/src/Cloudflare/Workers/RpcWorker.ts +562 -0
- package/src/Cloudflare/Workers/Vite.ts +2 -0
- package/src/Cloudflare/Workers/Worker.ts +280 -110
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +158 -103
- package/src/Cloudflare/Workers/WorkerBinding.ts +10 -0
- package/src/Cloudflare/Workers/WorkerBridge.ts +10 -9
- package/src/Cloudflare/Workers/WorkerBundle.ts +8 -9
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +8 -15
- package/src/Cloudflare/Workers/Workflow.ts +22 -3
- package/src/Cloudflare/Workers/index.ts +2 -0
- package/src/Cloudflare/Zaraz/ZarazConfig.ts +403 -0
- package/src/Cloudflare/Zaraz/ZarazEventTypes.ts +257 -0
- package/src/Cloudflare/Zaraz/index.ts +25 -0
- package/src/Cloudflare/index.ts +2 -0
- package/src/Dependencies.ts +10 -0
- package/src/Deploy.ts +3 -1
- package/src/Diff.ts +13 -0
- package/src/Input.ts +2 -0
- package/src/KeyPair.ts +146 -0
- package/src/Local/RpcProvider.ts +146 -0
- package/src/Local/RpcProviderProxy.ts +86 -0
- package/src/Local/RpcSerialization.ts +225 -0
- package/src/Local/RpcServer.ts +138 -0
- package/src/Local/RpcServerBun.ts +59 -0
- package/src/Local/RpcServerEnvironment.ts +55 -0
- package/src/Local/RpcServerNode.ts +58 -0
- package/src/Local/RpcServerSession.ts +87 -0
- package/src/Local/RpcSpawner.ts +196 -0
- package/src/Neon/Project.ts +16 -3
- package/src/Output.ts +8 -2
- package/src/Phase.ts +8 -0
- package/src/Plan.ts +16 -3
- package/src/Platform.ts +74 -27
- package/src/Random.ts +22 -27
- package/src/RuntimeContext.ts +23 -1
- package/src/Stack.ts +3 -3
- package/src/State/StateEncoding.ts +58 -7
- package/src/Test/Bun.ts +0 -3
- package/src/Test/Vitest.ts +0 -3
- package/src/Util/Duration.ts +21 -0
- package/src/Util/PlatformServices.ts +41 -27
- package/src/Util/camel.ts +3 -5
- package/src/Util/data.ts +38 -0
- package/src/Util/index.ts +0 -6
- package/src/Util/stable.ts +4 -10
- package/src/Util/types.ts +9 -2
- package/src/index.ts +2 -3
- package/lib/Cloudflare/Local/Sidecar.d.ts +0 -63
- package/lib/Cloudflare/Local/Sidecar.d.ts.map +0 -1
- package/lib/Cloudflare/Local/Sidecar.js +0 -50
- package/lib/Cloudflare/Local/Sidecar.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +0 -8
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +0 -381
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.d.ts +0 -2
- package/lib/Cloudflare/Local/SidecarServer.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.js +0 -34
- package/lib/Cloudflare/Local/SidecarServer.js.map +0 -1
- package/lib/Secret.d.ts +0 -50
- package/lib/Secret.d.ts.map +0 -1
- package/lib/Secret.js +0 -23
- package/lib/Secret.js.map +0 -1
- package/lib/Sidecar/Lock.d.ts +0 -23
- package/lib/Sidecar/Lock.d.ts.map +0 -1
- package/lib/Sidecar/Lock.js +0 -39
- package/lib/Sidecar/Lock.js.map +0 -1
- package/lib/Sidecar/RpcClient.d.ts +0 -15
- package/lib/Sidecar/RpcClient.d.ts.map +0 -1
- package/lib/Sidecar/RpcClient.js +0 -78
- package/lib/Sidecar/RpcClient.js.map +0 -1
- package/lib/Sidecar/RpcHandler.d.ts +0 -51
- package/lib/Sidecar/RpcHandler.d.ts.map +0 -1
- package/lib/Sidecar/RpcHandler.js +0 -87
- package/lib/Sidecar/RpcHandler.js.map +0 -1
- package/lib/Sidecar/RpcPaths.d.ts +0 -19
- package/lib/Sidecar/RpcPaths.d.ts.map +0 -1
- package/lib/Sidecar/RpcPaths.js +0 -31
- package/lib/Sidecar/RpcPaths.js.map +0 -1
- package/lib/Sidecar/RpcServer.d.ts +0 -30
- package/lib/Sidecar/RpcServer.d.ts.map +0 -1
- package/lib/Sidecar/RpcServer.js +0 -105
- package/lib/Sidecar/RpcServer.js.map +0 -1
- package/lib/Sidecar/RpcServerBun.d.ts +0 -4
- package/lib/Sidecar/RpcServerBun.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerBun.js +0 -28
- package/lib/Sidecar/RpcServerBun.js.map +0 -1
- package/lib/Sidecar/RpcServerNode.d.ts +0 -4
- package/lib/Sidecar/RpcServerNode.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerNode.js +0 -39
- package/lib/Sidecar/RpcServerNode.js.map +0 -1
- package/lib/Sidecar/RpcServices.d.ts +0 -6
- package/lib/Sidecar/RpcServices.d.ts.map +0 -1
- package/lib/Sidecar/RpcServices.js +0 -29
- package/lib/Sidecar/RpcServices.js.map +0 -1
- package/lib/Trait.d.ts +0 -43
- package/lib/Trait.d.ts.map +0 -1
- package/lib/Trait.js +0 -17
- package/lib/Trait.js.map +0 -1
- package/lib/Util/LocalhostDns.d.ts +0 -23
- package/lib/Util/LocalhostDns.d.ts.map +0 -1
- package/lib/Util/LocalhostDns.js +0 -46
- package/lib/Util/LocalhostDns.js.map +0 -1
- package/lib/Util/assert-never.d.ts +0 -12
- package/lib/Util/assert-never.d.ts.map +0 -1
- package/lib/Util/assert-never.js +0 -11
- package/lib/Util/assert-never.js.map +0 -1
- package/lib/Util/class.d.ts +0 -3
- package/lib/Util/class.d.ts.map +0 -1
- package/lib/Util/class.js +0 -1
- package/lib/Util/class.js.map +0 -1
- package/lib/Util/ignore.d.ts +0 -40
- package/lib/Util/ignore.d.ts.map +0 -1
- package/lib/Util/ignore.js +0 -591
- package/lib/Util/ignore.js.map +0 -1
- package/lib/Util/instance.d.ts +0 -4
- package/lib/Util/instance.d.ts.map +0 -1
- package/lib/Util/instance.js +0 -1
- package/lib/Util/instance.js.map +0 -1
- package/lib/Util/pointer.d.ts +0 -5
- package/lib/Util/pointer.d.ts.map +0 -1
- package/lib/Util/pointer.js +0 -1
- package/lib/Util/pointer.js.map +0 -1
- package/lib/Util/schema-to-type.d.ts +0 -42
- package/lib/Util/schema-to-type.d.ts.map +0 -1
- package/lib/Util/schema-to-type.js +0 -364
- package/lib/Util/schema-to-type.js.map +0 -1
- package/lib/Util/todo.d.ts +0 -3
- package/lib/Util/todo.d.ts.map +0 -1
- package/lib/Util/todo.js +0 -3
- package/lib/Util/todo.js.map +0 -1
- package/lib/Variable.d.ts +0 -29
- package/lib/Variable.d.ts.map +0 -1
- package/lib/Variable.js +0 -9
- package/lib/Variable.js.map +0 -1
- package/src/Cloudflare/Local/Sidecar.ts +0 -81
- package/src/Cloudflare/Local/SidecarHandlers.ts +0 -491
- package/src/Cloudflare/Local/SidecarServer.ts +0 -70
- package/src/Secret.ts +0 -87
- package/src/Sidecar/Lock.ts +0 -66
- package/src/Sidecar/RpcClient.ts +0 -142
- package/src/Sidecar/RpcHandler.ts +0 -205
- package/src/Sidecar/RpcPaths.ts +0 -39
- package/src/Sidecar/RpcServer.ts +0 -153
- package/src/Sidecar/RpcServerBun.ts +0 -41
- package/src/Sidecar/RpcServerNode.ts +0 -51
- package/src/Sidecar/RpcServices.ts +0 -48
- package/src/Trait.ts +0 -105
- package/src/Util/LocalhostDns.ts +0 -52
- package/src/Util/assert-never.ts +0 -18
- package/src/Util/class.ts +0 -7
- package/src/Util/ignore.ts +0 -815
- package/src/Util/instance.ts +0 -9
- package/src/Util/pointer.ts +0 -5
- package/src/Util/schema-to-type.ts +0 -456
- package/src/Util/todo.ts +0 -4
- package/src/Variable.ts +0 -44
|
@@ -176,7 +176,7 @@ export type Container = {
|
|
|
176
176
|
*
|
|
177
177
|
* return Effect.gen(function* () {
|
|
178
178
|
* // INNER (per-instance): start the container and expose RPC.
|
|
179
|
-
* const container = yield* Cloudflare.start(sandbox);
|
|
179
|
+
* const container = yield* Cloudflare.start(sandbox, { enableInternet: true });
|
|
180
180
|
*
|
|
181
181
|
* return {
|
|
182
182
|
* exec: (cmd: string) => container.exec(cmd),
|
|
@@ -200,7 +200,7 @@ export type Container = {
|
|
|
200
200
|
*
|
|
201
201
|
* // per-instance (inner Effect)
|
|
202
202
|
* return Effect.gen(function* () {
|
|
203
|
-
* const container = yield* Cloudflare.start(sandbox);
|
|
203
|
+
* const container = yield* Cloudflare.start(sandbox, { enableInternet: true });
|
|
204
204
|
*
|
|
205
205
|
* return {
|
|
206
206
|
* exec: (cmd: string) => container.exec(cmd),
|
|
@@ -215,7 +215,7 @@ export type Container = {
|
|
|
215
215
|
*
|
|
216
216
|
* @example Fetching from a container port
|
|
217
217
|
* ```typescript
|
|
218
|
-
* const container = yield* Cloudflare.start(sandbox);
|
|
218
|
+
* const container = yield* Cloudflare.start(sandbox, { enableInternet: true });
|
|
219
219
|
* const { fetch } = yield* container.getTcpPort(3000);
|
|
220
220
|
*
|
|
221
221
|
* const response = yield* fetch(
|
|
@@ -9,10 +9,9 @@ import { type Fetcher } from "../Fetcher.ts";
|
|
|
9
9
|
import { DurableObjectState } from "../Workers/DurableObjectState.ts";
|
|
10
10
|
import {
|
|
11
11
|
type Container,
|
|
12
|
-
type ContainerStartupOptions,
|
|
13
12
|
ContainerError,
|
|
13
|
+
type ContainerStartupOptions,
|
|
14
14
|
} from "./Container.ts";
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* Runs the Container in a Durable Object and monitors it, providing a durable fetch and RPC interface to it.
|
|
18
17
|
*/
|
|
@@ -5,12 +5,15 @@ import { isResolved } from "../../Diff.ts";
|
|
|
5
5
|
import { createPhysicalName } from "../../PhysicalName.ts";
|
|
6
6
|
import * as Provider from "../../Provider.ts";
|
|
7
7
|
import { Resource } from "../../Resource.ts";
|
|
8
|
+
import { listSqlFiles, readSqlFile } from "../../Sql/SqlFile.ts";
|
|
8
9
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
9
10
|
import type { Providers } from "../Providers.ts";
|
|
10
11
|
import { cloneD1Database } from "./D1Clone.ts";
|
|
11
12
|
import { importD1Database } from "./D1Import.ts";
|
|
12
13
|
import { applyMigrations } from "./D1Migrations.ts";
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
export const isD1Database = (value: unknown): value is D1Database =>
|
|
16
|
+
typeof value === "object" && (value as any)?.Type === "Cloudflare.D1Database";
|
|
14
17
|
|
|
15
18
|
export type Jurisdiction = "default" | "eu" | "fedramp";
|
|
16
19
|
export type PrimaryLocationHint =
|
|
@@ -133,10 +133,8 @@ export const toHttpClient = (fetcher: {
|
|
|
133
133
|
) => Effect.Effect<HttpServerResponse.HttpServerResponse, HttpServerError>;
|
|
134
134
|
}) =>
|
|
135
135
|
HttpClient.make((request) => {
|
|
136
|
-
console.log("toHttpClient: request", request.url);
|
|
137
136
|
return fetcher.fetch(HttpServerRequest.fromClientRequest(request)).pipe(
|
|
138
137
|
Effect.map((response) => {
|
|
139
|
-
console.log("toHttpClient: response", response);
|
|
140
138
|
return HttpClientResponse.fromWeb(
|
|
141
139
|
request,
|
|
142
140
|
HttpServerResponse.toWeb(response),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as hyperdrive from "@distilled.cloud/cloudflare/hyperdrive";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Predicate from "effect/Predicate";
|
|
3
4
|
import * as Redacted from "effect/Redacted";
|
|
4
5
|
|
|
5
6
|
import { AlchemyContext } from "../../AlchemyContext.ts";
|
|
@@ -157,6 +158,10 @@ export const Hyperdrive = Resource<Hyperdrive>("Cloudflare.Hyperdrive")({
|
|
|
157
158
|
bind: HyperdriveBinding.bind,
|
|
158
159
|
});
|
|
159
160
|
|
|
161
|
+
export const isHyperdrive = (value: unknown): value is Hyperdrive =>
|
|
162
|
+
Predicate.hasProperty(value, "Type") &&
|
|
163
|
+
value.Type === "Cloudflare.Hyperdrive";
|
|
164
|
+
|
|
160
165
|
export const HyperdriveProvider = () =>
|
|
161
166
|
Provider.effect(
|
|
162
167
|
Hyperdrive,
|
|
@@ -2,7 +2,6 @@ import type * as runtime from "@cloudflare/workers-types";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Redacted from "effect/Redacted";
|
|
5
|
-
import { AlchemyContext } from "../../AlchemyContext.ts";
|
|
6
5
|
import * as Binding from "../../Binding.ts";
|
|
7
6
|
import * as Output from "../../Output.ts";
|
|
8
7
|
import type { ResourceLike } from "../../Resource.ts";
|
|
@@ -102,8 +101,6 @@ export class HyperdriveBindingPolicy extends Binding.Policy<
|
|
|
102
101
|
|
|
103
102
|
export const HyperdriveBindingPolicyLive = HyperdriveBindingPolicy.layer.effect(
|
|
104
103
|
Effect.gen(function* () {
|
|
105
|
-
const ctx = yield* AlchemyContext;
|
|
106
|
-
|
|
107
104
|
return Effect.fn(function* (host: ResourceLike, hyperdrive: Hyperdrive) {
|
|
108
105
|
if (!isWorker(host)) {
|
|
109
106
|
return yield* Effect.die(
|
|
@@ -113,38 +110,6 @@ export const HyperdriveBindingPolicyLive = HyperdriveBindingPolicy.layer.effect(
|
|
|
113
110
|
);
|
|
114
111
|
}
|
|
115
112
|
|
|
116
|
-
const origin = Output.map(
|
|
117
|
-
Output.all(hyperdrive.dev, hyperdrive.origin, hyperdrive.mtls),
|
|
118
|
-
([dev, origin, mtls]): Required<HyperdriveDevOrigin> => {
|
|
119
|
-
if (dev) {
|
|
120
|
-
return {
|
|
121
|
-
scheme: dev.scheme,
|
|
122
|
-
host: dev.host,
|
|
123
|
-
port: dev.port ?? defaultPort(dev.scheme),
|
|
124
|
-
user: dev.user,
|
|
125
|
-
database: dev.database,
|
|
126
|
-
password: dev.password,
|
|
127
|
-
sslmode: dev.sslmode ?? "prefer",
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
if ("accessClientId" in origin) {
|
|
131
|
-
throw new Error(
|
|
132
|
-
`Hyperdrive instance ${hyperdrive.LogicalId} has an origin that requires Cloudflare Access. This is not supported in development mode. ` +
|
|
133
|
-
"Select a different origin or set the `dev` property to an origin that does not require Cloudflare Access.",
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
return {
|
|
137
|
-
scheme: origin.scheme,
|
|
138
|
-
host: origin.host,
|
|
139
|
-
port: origin.port ?? defaultPort(origin.scheme),
|
|
140
|
-
user: origin.user,
|
|
141
|
-
database: origin.database,
|
|
142
|
-
password: origin.password,
|
|
143
|
-
sslmode: mtls?.sslmode ?? "require",
|
|
144
|
-
};
|
|
145
|
-
},
|
|
146
|
-
);
|
|
147
|
-
|
|
148
113
|
yield* host.bind`${hyperdrive}`({
|
|
149
114
|
bindings: [
|
|
150
115
|
{
|
|
@@ -153,15 +118,48 @@ export const HyperdriveBindingPolicyLive = HyperdriveBindingPolicy.layer.effect(
|
|
|
153
118
|
id: hyperdrive.hyperdriveId as unknown as string,
|
|
154
119
|
},
|
|
155
120
|
],
|
|
156
|
-
hyperdrives:
|
|
157
|
-
? (Output.map(
|
|
158
|
-
Output.all(hyperdrive.hyperdriveId, Output.asOutput(origin)),
|
|
159
|
-
([id, origin]) => ({
|
|
160
|
-
[id]: origin,
|
|
161
|
-
}),
|
|
162
|
-
) as unknown as Record<string, Required<HyperdriveDevOrigin>>)
|
|
163
|
-
: undefined,
|
|
121
|
+
hyperdrives: getHyperdriveDevOrigin(hyperdrive),
|
|
164
122
|
});
|
|
165
123
|
});
|
|
166
124
|
}),
|
|
167
125
|
);
|
|
126
|
+
|
|
127
|
+
export const getHyperdriveDevOrigin = (hyperdrive: Hyperdrive) => {
|
|
128
|
+
const origin = Output.map(
|
|
129
|
+
Output.all(hyperdrive.dev, hyperdrive.origin, hyperdrive.mtls),
|
|
130
|
+
([dev, origin, mtls]): Required<HyperdriveDevOrigin> => {
|
|
131
|
+
if (dev) {
|
|
132
|
+
return {
|
|
133
|
+
scheme: dev.scheme,
|
|
134
|
+
host: dev.host,
|
|
135
|
+
port: dev.port ?? defaultPort(dev.scheme),
|
|
136
|
+
user: dev.user,
|
|
137
|
+
database: dev.database,
|
|
138
|
+
password: dev.password,
|
|
139
|
+
sslmode: dev.sslmode ?? "prefer",
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
if ("accessClientId" in origin) {
|
|
143
|
+
throw new Error(
|
|
144
|
+
`Hyperdrive instance ${hyperdrive.LogicalId} has an origin that requires Cloudflare Access. This is not supported in development mode. ` +
|
|
145
|
+
"Select a different origin or set the `dev` property to an origin that does not require Cloudflare Access.",
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
scheme: origin.scheme,
|
|
150
|
+
host: origin.host,
|
|
151
|
+
port: origin.port ?? defaultPort(origin.scheme),
|
|
152
|
+
user: origin.user,
|
|
153
|
+
database: origin.database,
|
|
154
|
+
password: origin.password,
|
|
155
|
+
sslmode: mtls?.sslmode ?? "require",
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
);
|
|
159
|
+
return Output.map(
|
|
160
|
+
Output.all(hyperdrive.hyperdriveId, Output.asOutput(origin)),
|
|
161
|
+
([id, origin]) => ({
|
|
162
|
+
[id]: origin,
|
|
163
|
+
}),
|
|
164
|
+
) as unknown as Record<string, Required<HyperdriveDevOrigin>>;
|
|
165
|
+
};
|
|
@@ -10,6 +10,10 @@ import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
|
10
10
|
import type { Providers } from "../Providers.ts";
|
|
11
11
|
import { KVNamespaceBinding } from "./KVNamespaceBinding.ts";
|
|
12
12
|
|
|
13
|
+
export const isKVNamespace = (value: unknown): value is KVNamespace =>
|
|
14
|
+
typeof value === "object" &&
|
|
15
|
+
(value as any)?.Type === "Cloudflare.KVNamespace";
|
|
16
|
+
|
|
13
17
|
export type KVNamespaceProps = {
|
|
14
18
|
/**
|
|
15
19
|
* A human-readable string name for the namespace.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Layer from "effect/Layer";
|
|
2
|
+
import * as RpcServer from "../Local/RpcServer.ts";
|
|
3
|
+
import { CloudflareAuth } from "./Auth/AuthProvider.ts";
|
|
4
|
+
import * as CloudflareEnvironment from "./CloudflareEnvironment.ts";
|
|
5
|
+
import * as Credentials from "./Credentials.ts";
|
|
6
|
+
import {
|
|
7
|
+
LocalWorkerProvider,
|
|
8
|
+
localRuntimeServices,
|
|
9
|
+
} from "./Workers/LocalWorkerProvider.ts";
|
|
10
|
+
|
|
11
|
+
const cloudflareServices = Layer.provide(
|
|
12
|
+
Layer.merge(
|
|
13
|
+
Credentials.fromAuthProvider(),
|
|
14
|
+
CloudflareEnvironment.fromProfile(),
|
|
15
|
+
),
|
|
16
|
+
CloudflareAuth,
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
LocalWorkerProvider().pipe(
|
|
20
|
+
Layer.provide(localRuntimeServices()),
|
|
21
|
+
Layer.provide(cloudflareServices),
|
|
22
|
+
RpcServer.launch,
|
|
23
|
+
);
|
|
@@ -5,11 +5,12 @@ import { pipe } from "effect/Function";
|
|
|
5
5
|
import * as Layer from "effect/Layer";
|
|
6
6
|
import * as Ref from "effect/Ref";
|
|
7
7
|
import * as Schedule from "effect/Schedule";
|
|
8
|
+
import { CredentialsStoreLive } from "../Auth/Credentials.ts";
|
|
9
|
+
import { ProfileLive } from "../Auth/Profile.ts";
|
|
8
10
|
import { Command } from "../Build/Command.ts";
|
|
9
11
|
import * as Build from "../Build/index.ts";
|
|
12
|
+
import { KeyPair, KeyPairProvider } from "../KeyPair.ts";
|
|
10
13
|
import * as Provider from "../Provider.ts";
|
|
11
|
-
import { CredentialsStoreLive } from "../Auth/Credentials.ts";
|
|
12
|
-
import { ProfileLive } from "../Auth/Profile.ts";
|
|
13
14
|
import { Random, RandomProvider } from "../Random.ts";
|
|
14
15
|
import * as Access from "./Access.ts";
|
|
15
16
|
import * as AiGateway from "./AiGateway/index.ts";
|
|
@@ -17,6 +18,7 @@ import * as AnalyticsEngine from "./AnalyticsEngine/index.ts";
|
|
|
17
18
|
import * as ApiToken from "./ApiToken/index.ts";
|
|
18
19
|
import * as Artifacts from "./Artifacts/index.ts";
|
|
19
20
|
import { CloudflareAuth } from "./Auth/AuthProvider.ts";
|
|
21
|
+
import * as BrowserRendering from "./BrowserRendering/index.ts";
|
|
20
22
|
import * as CloudflareEnvironment from "./CloudflareEnvironment.ts";
|
|
21
23
|
import * as Containers from "./Container/index.ts";
|
|
22
24
|
import * as Credentials from "./Credentials.ts";
|
|
@@ -32,6 +34,7 @@ import * as Tunnel from "./Tunnel/index.ts";
|
|
|
32
34
|
import * as VpcService from "./VpcService/index.ts";
|
|
33
35
|
import * as Workers from "./Workers/index.ts";
|
|
34
36
|
import * as Workflows from "./Workers/Workflow.ts";
|
|
37
|
+
import * as Zaraz from "./Zaraz/index.ts";
|
|
35
38
|
|
|
36
39
|
export { Credentials } from "@distilled.cloud/cloudflare/Credentials";
|
|
37
40
|
|
|
@@ -54,6 +57,7 @@ export const providers = () =>
|
|
|
54
57
|
AiGateway.AiGatewayBindingPolicy,
|
|
55
58
|
AnalyticsEngine.AnalyticsEngineDatasetBindingPolicy,
|
|
56
59
|
Artifacts.ArtifactsBindingPolicy,
|
|
60
|
+
BrowserRendering.BrowserRenderingBindingPolicy,
|
|
57
61
|
Command,
|
|
58
62
|
Containers.Container,
|
|
59
63
|
D1.D1ConnectionPolicy,
|
|
@@ -78,12 +82,14 @@ export const providers = () =>
|
|
|
78
82
|
SecretsStore.Secret,
|
|
79
83
|
Tunnel.Tunnel,
|
|
80
84
|
VpcService.VpcService,
|
|
85
|
+
KeyPair,
|
|
81
86
|
Random,
|
|
82
87
|
Workers.BindWorkerPolicy,
|
|
83
88
|
Workers.CronEventSourcePolicy,
|
|
84
89
|
Workers.FetchPolicy,
|
|
85
90
|
Workers.Worker,
|
|
86
91
|
Workflows.WorkflowResource,
|
|
92
|
+
Zaraz.ZarazConfig,
|
|
87
93
|
]),
|
|
88
94
|
).pipe(
|
|
89
95
|
Layer.provide(
|
|
@@ -94,6 +100,7 @@ export const providers = () =>
|
|
|
94
100
|
AiGateway.AiGatewayBindingPolicyLive,
|
|
95
101
|
AnalyticsEngine.AnalyticsEngineDatasetBindingPolicyLive,
|
|
96
102
|
Artifacts.ArtifactsBindingPolicyLive,
|
|
103
|
+
BrowserRendering.BrowserRenderingBindingPolicyLive,
|
|
97
104
|
Containers.ContainerProvider(),
|
|
98
105
|
D1.D1ConnectionPolicyLive,
|
|
99
106
|
D1.DatabaseProvider(),
|
|
@@ -122,10 +129,15 @@ export const providers = () =>
|
|
|
122
129
|
Workers.FetchPolicyLive,
|
|
123
130
|
Workers.WorkerProvider(),
|
|
124
131
|
Workflows.WorkflowProvider(),
|
|
132
|
+
Zaraz.ZarazConfigProvider(),
|
|
125
133
|
),
|
|
126
134
|
),
|
|
127
135
|
Layer.provideMerge(
|
|
128
|
-
Layer.mergeAll(
|
|
136
|
+
Layer.mergeAll(
|
|
137
|
+
Build.CommandProvider(),
|
|
138
|
+
KeyPairProvider(),
|
|
139
|
+
RandomProvider(),
|
|
140
|
+
),
|
|
129
141
|
),
|
|
130
142
|
Layer.provideMerge(Credentials.fromAuthProvider()),
|
|
131
143
|
Layer.provideMerge(CloudflareEnvironment.fromProfile()),
|
|
@@ -154,19 +166,6 @@ export const providers = () =>
|
|
|
154
166
|
Layer.orDie,
|
|
155
167
|
);
|
|
156
168
|
|
|
157
|
-
const isMisleadinglyTaggedTransient = (error: unknown): boolean => {
|
|
158
|
-
if (!error || typeof error !== "object") return false;
|
|
159
|
-
const tag = (error as { _tag?: unknown })._tag;
|
|
160
|
-
const message = ((error as { message?: unknown }).message ?? "") as string;
|
|
161
|
-
// CF code 10001: "Method not allowed for token" is a real permission
|
|
162
|
-
// failure (NOT retryable), but the same code is also returned with
|
|
163
|
-
// message "internal error" during Cloudflare-side hiccups. The two
|
|
164
|
-
// messages are unambiguously distinct, so we can safely retry only
|
|
165
|
-
// the internal-error variant.
|
|
166
|
-
if (tag === "Forbidden" && /internal error/i.test(message)) return true;
|
|
167
|
-
return false;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
169
|
const cloudflareRetryFactory: Retry.Factory = (lastError) => {
|
|
171
170
|
const defaults = Retry.makeDefault(lastError);
|
|
172
171
|
return {
|
|
@@ -193,3 +192,16 @@ const cloudflareRetryFactory: Retry.Factory = (lastError) => {
|
|
|
193
192
|
),
|
|
194
193
|
};
|
|
195
194
|
};
|
|
195
|
+
|
|
196
|
+
const isMisleadinglyTaggedTransient = (error: unknown): boolean => {
|
|
197
|
+
if (!error || typeof error !== "object") return false;
|
|
198
|
+
const tag = (error as { _tag?: unknown })._tag;
|
|
199
|
+
const message = ((error as { message?: unknown }).message ?? "") as string;
|
|
200
|
+
// CF code 10001: "Method not allowed for token" is a real permission
|
|
201
|
+
// failure (NOT retryable), but the same code is also returned with
|
|
202
|
+
// message "internal error" during Cloudflare-side hiccups. The two
|
|
203
|
+
// messages are unambiguously distinct, so we can safely retry only
|
|
204
|
+
// the internal-error variant.
|
|
205
|
+
if (tag === "Forbidden" && /internal error/i.test(message)) return true;
|
|
206
|
+
return false;
|
|
207
|
+
};
|
|
@@ -10,6 +10,9 @@ import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
|
10
10
|
import type { Providers } from "../Providers.ts";
|
|
11
11
|
import { QueueBinding } from "./QueueBinding.ts";
|
|
12
12
|
|
|
13
|
+
export const isQueue = (value: unknown): value is Queue =>
|
|
14
|
+
typeof value === "object" && (value as any)?.Type === "Cloudflare.Queue";
|
|
15
|
+
|
|
13
16
|
export type QueueProps = {
|
|
14
17
|
/**
|
|
15
18
|
* Name of the queue. If omitted, a unique name will be generated.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as queues from "@distilled.cloud/cloudflare/queues";
|
|
2
|
+
import * as Console from "effect/Console";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
3
4
|
import * as Option from "effect/Option";
|
|
4
5
|
import * as Schedule from "effect/Schedule";
|
|
@@ -118,11 +119,11 @@ type ObservedConsumer = {
|
|
|
118
119
|
|
|
119
120
|
const toObserved = (c: {
|
|
120
121
|
consumerId?: string | null;
|
|
121
|
-
|
|
122
|
+
scriptName?: string | null;
|
|
122
123
|
type?: "worker" | "http_pull" | null;
|
|
123
124
|
}): ObservedConsumer | undefined =>
|
|
124
125
|
c.consumerId && c.type === "worker"
|
|
125
|
-
? { consumerId: c.consumerId, script: c.
|
|
126
|
+
? { consumerId: c.consumerId, script: c.scriptName ?? undefined }
|
|
126
127
|
: undefined;
|
|
127
128
|
|
|
128
129
|
export const QueueConsumerProvider = () =>
|
|
@@ -139,10 +140,7 @@ export const QueueConsumerProvider = () =>
|
|
|
139
140
|
// first match in the paginated stream is the only one. Using
|
|
140
141
|
// `.items` defeats single-page lookups that would otherwise
|
|
141
142
|
// miss late-arriving consumers under eventual consistency.
|
|
142
|
-
const findWorkerConsumer = (
|
|
143
|
-
acct: string,
|
|
144
|
-
queueId: string,
|
|
145
|
-
): Effect.Effect<ObservedConsumer | undefined, any, any> =>
|
|
143
|
+
const findWorkerConsumer = (acct: string, queueId: string) =>
|
|
146
144
|
queues.listConsumers.items({ accountId: acct, queueId }).pipe(
|
|
147
145
|
Stream.map(toObserved),
|
|
148
146
|
Stream.filter((c): c is ObservedConsumer => c !== undefined),
|
|
@@ -367,6 +365,22 @@ export const QueueConsumerProvider = () =>
|
|
|
367
365
|
}),
|
|
368
366
|
);
|
|
369
367
|
|
|
368
|
+
yield* getConsumer({ accountId: acct, queueId, consumerId }).pipe(
|
|
369
|
+
Effect.tap(Console.log),
|
|
370
|
+
Effect.flatMap((fetched) =>
|
|
371
|
+
toObserved(fetched)?.script === news.scriptName
|
|
372
|
+
? Effect.void
|
|
373
|
+
: Effect.fail("ScriptUnbound" as const),
|
|
374
|
+
),
|
|
375
|
+
Effect.catchTag("ConsumerNotFound", () =>
|
|
376
|
+
Effect.fail("ScriptUnbound" as const),
|
|
377
|
+
),
|
|
378
|
+
Effect.retry({
|
|
379
|
+
while: (e) => e === "ScriptUnbound",
|
|
380
|
+
schedule: queueHandlerReadinessSchedule,
|
|
381
|
+
}),
|
|
382
|
+
);
|
|
383
|
+
|
|
370
384
|
return {
|
|
371
385
|
consumerId,
|
|
372
386
|
queueId,
|
|
@@ -418,8 +432,9 @@ export const QueueConsumerProvider = () =>
|
|
|
418
432
|
consumerId: fetched.consumerId!,
|
|
419
433
|
queueId: output.queueId,
|
|
420
434
|
scriptName:
|
|
421
|
-
("
|
|
422
|
-
|
|
435
|
+
("scriptName" in fetched &&
|
|
436
|
+
typeof fetched.scriptName === "string"
|
|
437
|
+
? fetched.scriptName
|
|
423
438
|
: output.scriptName) ?? output.scriptName,
|
|
424
439
|
accountId: output.accountId,
|
|
425
440
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as cf from "@cloudflare/workers-types";
|
|
2
2
|
import * as Cause from "effect/Cause";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
|
+
import * as Duration from "effect/Duration";
|
|
4
5
|
import * as Effect from "effect/Effect";
|
|
5
6
|
import * as Layer from "effect/Layer";
|
|
6
7
|
import * as Stream from "effect/Stream";
|
|
@@ -8,6 +9,7 @@ import * as Binding from "../../Binding.ts";
|
|
|
8
9
|
import type { ResourceLike } from "../../Resource.ts";
|
|
9
10
|
import { RuntimeContext } from "../../RuntimeContext.ts";
|
|
10
11
|
import type { FunctionContext } from "../../Serverless/Function.ts";
|
|
12
|
+
import * as DurationUtil from "../../Util/Duration.ts";
|
|
11
13
|
import { isWorker, isWorkerEvent } from "../Workers/Worker.ts";
|
|
12
14
|
import type { Queue } from "./Queue.ts";
|
|
13
15
|
import { QueueConsumer } from "./QueueConsumer.ts";
|
|
@@ -25,14 +27,37 @@ export interface MessagesProps {
|
|
|
25
27
|
maxConcurrency?: number;
|
|
26
28
|
/** Maximum delivery attempts before dead-lettering. */
|
|
27
29
|
maxRetries?: number;
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Wait time before flushing a partial batch. Rounded up to whole
|
|
32
|
+
* milliseconds when forwarded to Cloudflare.
|
|
33
|
+
*/
|
|
34
|
+
maxWaitTime?: Duration.Input;
|
|
35
|
+
/**
|
|
36
|
+
* Backoff applied to a retry. Rounded up to whole seconds when
|
|
37
|
+
* forwarded to Cloudflare.
|
|
38
|
+
*/
|
|
39
|
+
retryDelay?: Duration.Input;
|
|
32
40
|
/** Optional dead-letter queue name. */
|
|
33
41
|
deadLetterQueue?: string;
|
|
34
42
|
}
|
|
35
43
|
|
|
44
|
+
/**
|
|
45
|
+
* Convert a {@link MessagesProps} (with `Duration.Input` time fields)
|
|
46
|
+
* into the numeric settings shape Cloudflare's `QueueConsumer` API
|
|
47
|
+
* expects. `maxWaitTime` is rounded up to whole milliseconds and
|
|
48
|
+
* `retryDelay` to whole seconds.
|
|
49
|
+
*
|
|
50
|
+
* Exposed for testing and for callers that want to mirror the
|
|
51
|
+
* conversion when wiring `QueueConsumer` directly.
|
|
52
|
+
*/
|
|
53
|
+
export const toConsumerSettings = (props: MessagesProps) => ({
|
|
54
|
+
batchSize: props.batchSize,
|
|
55
|
+
maxConcurrency: props.maxConcurrency,
|
|
56
|
+
maxRetries: props.maxRetries,
|
|
57
|
+
maxWaitTimeMs: DurationUtil.toMillis(props.maxWaitTime),
|
|
58
|
+
retryDelay: DurationUtil.toSeconds(props.retryDelay),
|
|
59
|
+
});
|
|
60
|
+
|
|
36
61
|
/**
|
|
37
62
|
* A single queue message handed to the subscribe handler. Mirrors
|
|
38
63
|
* Cloudflare's runtime `Message<Body>` shape so per-message
|
|
@@ -63,12 +88,15 @@ export type QueueMessage<Body = unknown> = cf.Message<Body>;
|
|
|
63
88
|
* @example
|
|
64
89
|
* ```typescript
|
|
65
90
|
* import * as Cloudflare from "alchemy/Cloudflare";
|
|
91
|
+
* import * as Duration from "effect/Duration";
|
|
66
92
|
* import * as Effect from "effect/Effect";
|
|
67
93
|
* import * as Stream from "effect/Stream";
|
|
68
94
|
*
|
|
69
95
|
* yield* Cloudflare.messages<MyEvent>(queueResource, {
|
|
70
96
|
* batchSize: 25,
|
|
71
97
|
* maxRetries: 3,
|
|
98
|
+
* maxWaitTime: "5 seconds",
|
|
99
|
+
* retryDelay: Duration.seconds(30),
|
|
72
100
|
* }).subscribe((stream) =>
|
|
73
101
|
* Stream.runForEach(stream, (msg) =>
|
|
74
102
|
* Effect.log(`event ${msg.body.id}`),
|
|
@@ -148,7 +176,7 @@ export const QueueEventSourcePolicyLive = QueueEventSourcePolicy.layer.succeed(
|
|
|
148
176
|
yield* QueueConsumer(`${queue.LogicalId}Consumer`, {
|
|
149
177
|
queueId: queue.queueId,
|
|
150
178
|
scriptName: host.workerName,
|
|
151
|
-
settings: props,
|
|
179
|
+
settings: toConsumerSettings(props),
|
|
152
180
|
deadLetterQueue: props.deadLetterQueue,
|
|
153
181
|
});
|
|
154
182
|
})) as unknown as (
|
|
@@ -12,6 +12,9 @@ import type * as Cloudflare from "../Providers.ts";
|
|
|
12
12
|
import * as Zone from "../Zone.ts";
|
|
13
13
|
import { R2BucketBinding } from "./R2BucketBinding.ts";
|
|
14
14
|
|
|
15
|
+
export const isR2Bucket = (value: unknown): value is R2Bucket =>
|
|
16
|
+
typeof value === "object" && (value as any)?.Type === "Cloudflare.R2Bucket";
|
|
17
|
+
|
|
15
18
|
export type R2BucketName = string;
|
|
16
19
|
|
|
17
20
|
export type R2BucketCustomDomainZone = Zone.ZoneReference;
|
|
@@ -520,6 +523,10 @@ export const R2BucketProvider = () =>
|
|
|
520
523
|
while: isNoSuchBucket,
|
|
521
524
|
schedule: r2BucketEndpointConsistencySchedule,
|
|
522
525
|
}),
|
|
526
|
+
Effect.retry({
|
|
527
|
+
while: isDomainInUseConflict,
|
|
528
|
+
schedule: r2CustomDomainConflictSchedule,
|
|
529
|
+
}),
|
|
523
530
|
);
|
|
524
531
|
return toCustomDomainAttributes({ ...created, zoneId });
|
|
525
532
|
}
|
|
@@ -842,3 +849,22 @@ const isNoSuchBucket = (error: unknown): boolean =>
|
|
|
842
849
|
error !== null &&
|
|
843
850
|
"_tag" in error &&
|
|
844
851
|
(error as { _tag: unknown })._tag === "NoSuchBucket";
|
|
852
|
+
|
|
853
|
+
// Cloudflare keys a custom domain to a single bucket at the zone level. After a
|
|
854
|
+
// domain is deleted, re-attaching the same hostname can transiently 409 with
|
|
855
|
+
// "Domain already in use" until the prior association is fully released. Treat
|
|
856
|
+
// that narrow conflict as eventual consistency and retry it on create.
|
|
857
|
+
const isDomainInUseConflict = (error: unknown): boolean =>
|
|
858
|
+
typeof error === "object" &&
|
|
859
|
+
error !== null &&
|
|
860
|
+
"_tag" in error &&
|
|
861
|
+
(error as { _tag: unknown })._tag === "Conflict" &&
|
|
862
|
+
"message" in error &&
|
|
863
|
+
typeof (error as { message: unknown }).message === "string" &&
|
|
864
|
+
(error as { message: string }).message.toLowerCase().includes("in use");
|
|
865
|
+
|
|
866
|
+
// Releasing a custom domain after delete can lag a few seconds, so give the
|
|
867
|
+
// conflict a longer, bounded budget than the bucket-endpoint lag above.
|
|
868
|
+
const r2CustomDomainConflictSchedule = Schedule.spaced("2 seconds").pipe(
|
|
869
|
+
Schedule.both(Schedule.recurs(8)),
|
|
870
|
+
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as secretsStore from "@distilled.cloud/cloudflare/secrets-store";
|
|
2
|
+
import * as Console from "effect/Console";
|
|
2
3
|
import * as Effect from "effect/Effect";
|
|
3
4
|
import * as Option from "effect/Option";
|
|
4
5
|
import * as Redacted from "effect/Redacted";
|
|
@@ -100,9 +101,6 @@ export const StoreSecretProvider = () =>
|
|
|
100
101
|
const getStoreSecret = yield* secretsStore.getStoreSecret;
|
|
101
102
|
const listStoreSecrets = secretsStore.listStoreSecrets;
|
|
102
103
|
|
|
103
|
-
const arraysEqual = (a: string[], b: string[]) =>
|
|
104
|
-
a.length === b.length && a.every((v, i) => v === b[i]);
|
|
105
|
-
|
|
106
104
|
return {
|
|
107
105
|
stables: ["secretId", "secretName", "storeId", "accountId"],
|
|
108
106
|
diff: Effect.fn(function* ({ id, olds = {} as any, news, output }) {
|
|
@@ -117,7 +115,7 @@ export const StoreSecretProvider = () =>
|
|
|
117
115
|
const oldValue = olds.value ? Redacted.value(olds.value) : undefined;
|
|
118
116
|
const newValue = Redacted.value(news.value);
|
|
119
117
|
if (oldValue !== newValue) {
|
|
120
|
-
return { action: "
|
|
118
|
+
return { action: "update" } as const;
|
|
121
119
|
}
|
|
122
120
|
}),
|
|
123
121
|
reconcile: Effect.fn(function* ({ id, news, output }) {
|
|
@@ -212,49 +210,22 @@ export const StoreSecretProvider = () =>
|
|
|
212
210
|
observed = existing;
|
|
213
211
|
}
|
|
214
212
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
!output ||
|
|
224
|
-
(output.comment ?? undefined) !== (news.comment ?? undefined);
|
|
225
|
-
if (scopesChanged || commentChanged) {
|
|
226
|
-
const patched = yield* patchStoreSecret({
|
|
227
|
-
accountId,
|
|
228
|
-
storeId,
|
|
229
|
-
secretId: observed.id,
|
|
230
|
-
scopes: scopesChanged ? scopes : undefined,
|
|
231
|
-
comment: commentChanged ? news.comment : undefined,
|
|
232
|
-
}).pipe(
|
|
233
|
-
Effect.catchTag("SecretNotFound", () =>
|
|
234
|
-
Effect.succeed(undefined),
|
|
235
|
-
),
|
|
236
|
-
);
|
|
237
|
-
if (patched) {
|
|
238
|
-
return {
|
|
239
|
-
secretId: observed.id,
|
|
240
|
-
secretName: observed.name,
|
|
241
|
-
storeId: observed.storeId,
|
|
242
|
-
accountId,
|
|
243
|
-
status: patched.status,
|
|
244
|
-
scopes,
|
|
245
|
-
comment: patched.comment ?? undefined,
|
|
246
|
-
};
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
|
|
213
|
+
const patched = yield* patchStoreSecret({
|
|
214
|
+
accountId,
|
|
215
|
+
storeId,
|
|
216
|
+
secretId: observed.id,
|
|
217
|
+
scopes,
|
|
218
|
+
comment: news.comment,
|
|
219
|
+
value: Redacted.value(news.value),
|
|
220
|
+
});
|
|
250
221
|
return {
|
|
251
222
|
secretId: observed.id,
|
|
252
223
|
secretName: observed.name,
|
|
253
224
|
storeId: observed.storeId,
|
|
254
225
|
accountId,
|
|
255
|
-
status:
|
|
226
|
+
status: patched.status,
|
|
256
227
|
scopes,
|
|
257
|
-
comment:
|
|
228
|
+
comment: patched.comment ?? undefined,
|
|
258
229
|
};
|
|
259
230
|
}),
|
|
260
231
|
delete: Effect.fn(function* ({ output }) {
|
|
@@ -263,6 +234,8 @@ export const StoreSecretProvider = () =>
|
|
|
263
234
|
storeId: output.storeId,
|
|
264
235
|
secretId: output.secretId,
|
|
265
236
|
}).pipe(
|
|
237
|
+
Effect.tap(() => Effect.log(`deleted ${output.secretId}`)),
|
|
238
|
+
Effect.tapError(Console.log),
|
|
266
239
|
Effect.catchTag("SecretNotFound", () => Effect.void),
|
|
267
240
|
Effect.catchTag("StoreNotFound", () => Effect.void),
|
|
268
241
|
Effect.catchTag("NotFound", () => Effect.void),
|