alchemy 2.0.0-beta.34 → 2.0.0-beta.35
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 +226 -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 +17 -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/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 +4 -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 +94 -0
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +186 -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/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 +9 -7
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +62 -142
- 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/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/Util/PlatformServices.js +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +15 -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 +20 -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/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 +6 -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 +337 -2
- package/src/Cloudflare/StateStore/State.ts +25 -16
- package/src/Cloudflare/Website/StaticSite.ts +11 -1
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +9 -1
- package/src/Cloudflare/Workers/Worker.ts +83 -203
- package/src/Cloudflare/Workers/WorkerBundle.ts +38 -12
- package/src/Cloudflare/Zone.ts +88 -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/Util/PlatformServices.ts +1 -1
- package/lib/Cli/commands/bootstrap.d.ts +0 -20
- package/lib/Cli/commands/bootstrap.d.ts.map +0 -1
- package/lib/Cli/commands/bootstrap.js +0 -107
- package/lib/Cli/commands/bootstrap.js.map +0 -1
- package/lib/Sidecar/RpcTransport.d.ts +0 -22
- package/lib/Sidecar/RpcTransport.d.ts.map +0 -1
- package/lib/Sidecar/RpcTransport.js +0 -81
- package/lib/Sidecar/RpcTransport.js.map +0 -1
- package/lib/Test/TestCli.d.ts +0 -19
- package/lib/Test/TestCli.d.ts.map +0 -1
- package/lib/Test/TestCli.js +0 -175
- package/lib/Test/TestCli.js.map +0 -1
- package/src/Cli/commands/bootstrap.ts +0 -216
- package/src/Sidecar/RpcTransport.ts +0 -85
- package/src/Test/TestCli.ts +0 -221
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import * as r2 from "@distilled.cloud/cloudflare/r2";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Schedule from "effect/Schedule";
|
|
3
4
|
|
|
4
|
-
import { isResolved } from "../../Diff.ts";
|
|
5
|
+
import { deepEqual, isResolved } from "../../Diff.ts";
|
|
5
6
|
import { createPhysicalName } from "../../PhysicalName.ts";
|
|
6
7
|
import * as Provider from "../../Provider.ts";
|
|
7
8
|
import { Resource } from "../../Resource.ts";
|
|
8
9
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
9
10
|
import type * as Cloudflare from "../Providers.ts";
|
|
11
|
+
import * as Zone from "../Zone.ts";
|
|
10
12
|
import { R2BucketBinding } from "./R2BucketBinding.ts";
|
|
11
13
|
|
|
12
14
|
export type R2BucketName = string;
|
|
13
15
|
|
|
16
|
+
export type R2BucketCustomDomainZone = Zone.ZoneReference;
|
|
17
|
+
|
|
18
|
+
export type R2BucketCustomDomain = {
|
|
19
|
+
/**
|
|
20
|
+
* Custom domain name to attach to the bucket.
|
|
21
|
+
*/
|
|
22
|
+
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* Zone that contains the custom domain. If omitted, the zone is inferred
|
|
25
|
+
* from `domain`. Pass a zone ID string, a hostname in the zone, or any object
|
|
26
|
+
* with a `zoneId` attribute such as `Cloudflare.Zone`.
|
|
27
|
+
*/
|
|
28
|
+
zone?: R2BucketCustomDomainZone;
|
|
29
|
+
/**
|
|
30
|
+
* Whether public bucket access is enabled at this custom domain.
|
|
31
|
+
* @default true
|
|
32
|
+
*/
|
|
33
|
+
enabled?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Allowlist of TLS ciphers in BoringSSL format.
|
|
36
|
+
*/
|
|
37
|
+
ciphers?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* Minimum TLS version accepted by the custom domain.
|
|
40
|
+
* @default "1.0"
|
|
41
|
+
*/
|
|
42
|
+
minTLS?: "1.0" | "1.1" | "1.2" | "1.3";
|
|
43
|
+
};
|
|
44
|
+
|
|
14
45
|
export type R2BucketProps = {
|
|
15
46
|
/**
|
|
16
47
|
* Name of the bucket. If omitted, a unique name will be generated.
|
|
@@ -31,6 +62,11 @@ export type R2BucketProps = {
|
|
|
31
62
|
* Location hint for the bucket.
|
|
32
63
|
*/
|
|
33
64
|
locationHint?: R2Bucket.Location;
|
|
65
|
+
/**
|
|
66
|
+
* Custom domains to attach to the bucket. Pass an empty array (or omit)
|
|
67
|
+
* to remove all custom domains.
|
|
68
|
+
*/
|
|
69
|
+
domains?: R2BucketCustomDomain[];
|
|
34
70
|
};
|
|
35
71
|
|
|
36
72
|
export type R2Bucket = Resource<
|
|
@@ -42,6 +78,7 @@ export type R2Bucket = Resource<
|
|
|
42
78
|
jurisdiction: R2Bucket.Jurisdiction;
|
|
43
79
|
location: R2Bucket.Location | undefined;
|
|
44
80
|
accountId: string;
|
|
81
|
+
domains: R2Bucket.CustomDomain[];
|
|
45
82
|
},
|
|
46
83
|
never,
|
|
47
84
|
Cloudflare.Providers
|
|
@@ -89,6 +126,55 @@ export type R2Bucket = Resource<
|
|
|
89
126
|
* contentLength: Number(request.headers["content-length"] ?? 0),
|
|
90
127
|
* });
|
|
91
128
|
* ```
|
|
129
|
+
*
|
|
130
|
+
* @section Custom Domains
|
|
131
|
+
*
|
|
132
|
+
* Attach one or more custom domains to serve bucket objects from a hostname
|
|
133
|
+
* you control. The domain's zone must already exist in your Cloudflare
|
|
134
|
+
* account; the zone is inferred from the hostname when omitted, or you can
|
|
135
|
+
* pass a `Cloudflare.Zone` resource, a zone ID, or any hostname inside the
|
|
136
|
+
* zone via the `zone` field.
|
|
137
|
+
*
|
|
138
|
+
* @example Single custom domain
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
141
|
+
* domains: [{ name: "assets.example.com" }],
|
|
142
|
+
* });
|
|
143
|
+
* ```
|
|
144
|
+
*
|
|
145
|
+
* @example Multiple custom domains
|
|
146
|
+
* ```typescript
|
|
147
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
148
|
+
* domains: [
|
|
149
|
+
* { name: "assets.example.com" },
|
|
150
|
+
* { name: "static.example.com" },
|
|
151
|
+
* ],
|
|
152
|
+
* });
|
|
153
|
+
* ```
|
|
154
|
+
*
|
|
155
|
+
* @example Disable a custom domain without removing it
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
158
|
+
* domains: [{ name: "assets.example.com", enabled: false }],
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*
|
|
162
|
+
* @example Custom domain with explicit zone and TLS settings
|
|
163
|
+
* ```typescript
|
|
164
|
+
* const zone = yield* Cloudflare.Zone("ExampleZone", {
|
|
165
|
+
* name: "example.com",
|
|
166
|
+
* });
|
|
167
|
+
*
|
|
168
|
+
* const bucket = yield* Cloudflare.R2Bucket("MyBucket", {
|
|
169
|
+
* domains: [
|
|
170
|
+
* {
|
|
171
|
+
* name: "assets.example.com",
|
|
172
|
+
* zone,
|
|
173
|
+
* minTLS: "1.2",
|
|
174
|
+
* },
|
|
175
|
+
* ],
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
92
178
|
*/
|
|
93
179
|
export const R2Bucket = Resource<R2Bucket>("Cloudflare.R2Bucket")({
|
|
94
180
|
bind: R2BucketBinding.bind,
|
|
@@ -98,6 +184,31 @@ export declare namespace R2Bucket {
|
|
|
98
184
|
export type StorageClass = "Standard" | "InfrequentAccess";
|
|
99
185
|
export type Jurisdiction = "default" | "eu" | "fedramp";
|
|
100
186
|
export type Location = "apac" | "eeur" | "enam" | "weur" | "wnam" | "oc";
|
|
187
|
+
export type CustomDomain = {
|
|
188
|
+
domain: string;
|
|
189
|
+
zoneId: string | undefined;
|
|
190
|
+
enabled: boolean;
|
|
191
|
+
ciphers: string[] | undefined;
|
|
192
|
+
minTLS: "1.0" | "1.1" | "1.2" | "1.3" | undefined;
|
|
193
|
+
status:
|
|
194
|
+
| {
|
|
195
|
+
ownership:
|
|
196
|
+
| "pending"
|
|
197
|
+
| "active"
|
|
198
|
+
| "deactivated"
|
|
199
|
+
| "blocked"
|
|
200
|
+
| "error"
|
|
201
|
+
| "unknown";
|
|
202
|
+
ssl:
|
|
203
|
+
| "initializing"
|
|
204
|
+
| "pending"
|
|
205
|
+
| "active"
|
|
206
|
+
| "deactivated"
|
|
207
|
+
| "error"
|
|
208
|
+
| "unknown";
|
|
209
|
+
}
|
|
210
|
+
| undefined;
|
|
211
|
+
};
|
|
101
212
|
}
|
|
102
213
|
|
|
103
214
|
export const R2BucketProvider = () =>
|
|
@@ -109,6 +220,10 @@ export const R2BucketProvider = () =>
|
|
|
109
220
|
const patchBucket = yield* r2.patchBucket;
|
|
110
221
|
const deleteBucket = yield* r2.deleteBucket;
|
|
111
222
|
const getBucket = yield* r2.getBucket;
|
|
223
|
+
const listBucketDomainCustoms = yield* r2.listBucketDomainCustoms;
|
|
224
|
+
const createBucketDomainCustom = yield* r2.createBucketDomainCustom;
|
|
225
|
+
const updateBucketDomainCustom = yield* r2.updateBucketDomainCustom;
|
|
226
|
+
const deleteBucketDomainCustom = yield* r2.deleteBucketDomainCustom;
|
|
112
227
|
|
|
113
228
|
const createBucketName = (id: string, name: string | undefined) =>
|
|
114
229
|
Effect.gen(function* () {
|
|
@@ -126,6 +241,148 @@ export const R2BucketProvider = () =>
|
|
|
126
241
|
return location.toLowerCase() as R2Bucket.Location;
|
|
127
242
|
};
|
|
128
243
|
|
|
244
|
+
const listCustomDomains = (
|
|
245
|
+
bucketName: string,
|
|
246
|
+
jurisdiction: R2Bucket.Jurisdiction,
|
|
247
|
+
) =>
|
|
248
|
+
listBucketDomainCustoms({
|
|
249
|
+
accountId,
|
|
250
|
+
bucketName,
|
|
251
|
+
jurisdiction,
|
|
252
|
+
}).pipe(
|
|
253
|
+
Effect.retry({
|
|
254
|
+
while: isNoSuchBucket,
|
|
255
|
+
schedule: r2CustomDomainConsistencySchedule,
|
|
256
|
+
}),
|
|
257
|
+
Effect.map((response) =>
|
|
258
|
+
response.domains.map(toCustomDomainAttributes),
|
|
259
|
+
),
|
|
260
|
+
Effect.catchTag("NoSuchBucket", () => Effect.succeed(undefined)),
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
const reconcileCustomDomains = (
|
|
264
|
+
bucketName: string,
|
|
265
|
+
jurisdiction: R2Bucket.Jurisdiction,
|
|
266
|
+
desired: R2BucketCustomDomain[],
|
|
267
|
+
previous: R2Bucket.CustomDomain[],
|
|
268
|
+
) =>
|
|
269
|
+
Effect.gen(function* () {
|
|
270
|
+
const observed = yield* listCustomDomains(bucketName, jurisdiction);
|
|
271
|
+
if (!observed) {
|
|
272
|
+
return yield* Effect.fail(
|
|
273
|
+
new Error(
|
|
274
|
+
`Cannot reconcile custom domains for missing R2 bucket "${bucketName}"`,
|
|
275
|
+
),
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
const observedByDomain = new Map(
|
|
279
|
+
observed.map((domain) => [domain.domain, domain]),
|
|
280
|
+
);
|
|
281
|
+
const desiredDomains = new Set(desired.map((domain) => domain.name));
|
|
282
|
+
|
|
283
|
+
// Remove domains that are no longer desired. Domains that keep the
|
|
284
|
+
// same hostname but move zones are intentionally skipped here and
|
|
285
|
+
// handled in the per-domain flow below.
|
|
286
|
+
yield* Effect.forEach(
|
|
287
|
+
previous,
|
|
288
|
+
(previousDomain) =>
|
|
289
|
+
desiredDomains.has(previousDomain.domain)
|
|
290
|
+
? Effect.void
|
|
291
|
+
: deleteBucketDomainCustom({
|
|
292
|
+
accountId,
|
|
293
|
+
bucketName,
|
|
294
|
+
domain: previousDomain.domain,
|
|
295
|
+
jurisdiction,
|
|
296
|
+
}).pipe(
|
|
297
|
+
Effect.catchIf(
|
|
298
|
+
isMissingCustomDomainOrBucket,
|
|
299
|
+
() => Effect.void,
|
|
300
|
+
),
|
|
301
|
+
),
|
|
302
|
+
{ concurrency: "unbounded" },
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
const applied = yield* Effect.forEach(
|
|
306
|
+
desired,
|
|
307
|
+
(domain) =>
|
|
308
|
+
Effect.gen(function* () {
|
|
309
|
+
const zoneId = yield* Zone.resolveZoneId({
|
|
310
|
+
accountId,
|
|
311
|
+
zone: domain.zone,
|
|
312
|
+
hostname: domain.name,
|
|
313
|
+
});
|
|
314
|
+
const observedDomain = observedByDomain.get(domain.name);
|
|
315
|
+
|
|
316
|
+
if (
|
|
317
|
+
observedDomain &&
|
|
318
|
+
sameCustomDomainConfig(observedDomain, domain, zoneId)
|
|
319
|
+
) {
|
|
320
|
+
return observedDomain;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (observedDomain && observedDomain.zoneId !== zoneId) {
|
|
324
|
+
// Cloudflare does not mutate the zone for an existing custom
|
|
325
|
+
// domain. This is not a duplicate of the stale-domain prune
|
|
326
|
+
// above: the hostname is still desired, so that prune skips it
|
|
327
|
+
// and this branch deletes only to recreate it in the new zone.
|
|
328
|
+
yield* deleteBucketDomainCustom({
|
|
329
|
+
accountId,
|
|
330
|
+
bucketName,
|
|
331
|
+
domain: domain.name,
|
|
332
|
+
jurisdiction,
|
|
333
|
+
}).pipe(
|
|
334
|
+
Effect.catchIf(
|
|
335
|
+
isMissingCustomDomainOrBucket,
|
|
336
|
+
() => Effect.void,
|
|
337
|
+
),
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (!observedDomain || observedDomain.zoneId !== zoneId) {
|
|
342
|
+
const created = yield* createBucketDomainCustom({
|
|
343
|
+
accountId,
|
|
344
|
+
bucketName,
|
|
345
|
+
jurisdiction,
|
|
346
|
+
domain: domain.name,
|
|
347
|
+
enabled: domain.enabled ?? true,
|
|
348
|
+
zoneId,
|
|
349
|
+
ciphers: domain.ciphers,
|
|
350
|
+
minTLS: domain.minTLS,
|
|
351
|
+
}).pipe(
|
|
352
|
+
Effect.retry({
|
|
353
|
+
while: isNoSuchBucket,
|
|
354
|
+
schedule: r2CustomDomainConsistencySchedule,
|
|
355
|
+
}),
|
|
356
|
+
);
|
|
357
|
+
return toCustomDomainAttributes({ ...created, zoneId });
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const updated = yield* updateBucketDomainCustom({
|
|
361
|
+
accountId,
|
|
362
|
+
bucketName,
|
|
363
|
+
domain: domain.name,
|
|
364
|
+
jurisdiction,
|
|
365
|
+
enabled: domain.enabled ?? true,
|
|
366
|
+
ciphers: domain.ciphers,
|
|
367
|
+
minTLS: domain.minTLS,
|
|
368
|
+
}).pipe(
|
|
369
|
+
Effect.retry({
|
|
370
|
+
while: isNoSuchBucket,
|
|
371
|
+
schedule: r2CustomDomainConsistencySchedule,
|
|
372
|
+
}),
|
|
373
|
+
);
|
|
374
|
+
return toCustomDomainAttributes({
|
|
375
|
+
...updated,
|
|
376
|
+
enabled: updated.enabled ?? domain.enabled ?? true,
|
|
377
|
+
zoneId,
|
|
378
|
+
});
|
|
379
|
+
}),
|
|
380
|
+
{ concurrency: "unbounded" },
|
|
381
|
+
);
|
|
382
|
+
|
|
383
|
+
return applied.sort((a, b) => a.domain.localeCompare(b.domain));
|
|
384
|
+
});
|
|
385
|
+
|
|
129
386
|
return {
|
|
130
387
|
stables: ["bucketName", "accountId"],
|
|
131
388
|
diff: Effect.fn(function* ({ id, olds = {}, news = {}, output }) {
|
|
@@ -152,6 +409,9 @@ export const R2BucketProvider = () =>
|
|
|
152
409
|
stables: oldName === name ? ["bucketName"] : undefined,
|
|
153
410
|
} as const;
|
|
154
411
|
}
|
|
412
|
+
if (!deepEqual(olds.domains, news.domains)) {
|
|
413
|
+
return { action: "update" } as const;
|
|
414
|
+
}
|
|
155
415
|
}),
|
|
156
416
|
reconcile: Effect.fn(function* ({ id, news = {}, output }) {
|
|
157
417
|
const name = yield* createBucketName(id, news.name);
|
|
@@ -206,15 +466,37 @@ export const R2BucketProvider = () =>
|
|
|
206
466
|
});
|
|
207
467
|
}
|
|
208
468
|
|
|
209
|
-
|
|
469
|
+
const attrs = {
|
|
210
470
|
bucketName: observed.name!,
|
|
211
471
|
storageClass: observed.storageClass ?? "Standard",
|
|
212
472
|
jurisdiction: observed.jurisdiction ?? "default",
|
|
213
473
|
location: normalizeLocation(observed.location),
|
|
214
474
|
accountId: acct,
|
|
215
475
|
};
|
|
476
|
+
|
|
477
|
+
const domains = yield* reconcileCustomDomains(
|
|
478
|
+
attrs.bucketName,
|
|
479
|
+
attrs.jurisdiction,
|
|
480
|
+
news.domains ?? [],
|
|
481
|
+
output?.domains ?? [],
|
|
482
|
+
);
|
|
483
|
+
|
|
484
|
+
return {
|
|
485
|
+
...attrs,
|
|
486
|
+
domains,
|
|
487
|
+
};
|
|
216
488
|
}),
|
|
217
489
|
delete: Effect.fn(function* ({ output }) {
|
|
490
|
+
for (const domain of output.domains ?? []) {
|
|
491
|
+
yield* deleteBucketDomainCustom({
|
|
492
|
+
accountId: output.accountId,
|
|
493
|
+
bucketName: output.bucketName,
|
|
494
|
+
domain: domain.domain,
|
|
495
|
+
jurisdiction: output.jurisdiction,
|
|
496
|
+
}).pipe(
|
|
497
|
+
Effect.catchIf(isMissingCustomDomainOrBucket, () => Effect.void),
|
|
498
|
+
);
|
|
499
|
+
}
|
|
218
500
|
yield* deleteBucket({
|
|
219
501
|
accountId: output.accountId,
|
|
220
502
|
bucketName: output.bucketName,
|
|
@@ -236,6 +518,7 @@ export const R2BucketProvider = () =>
|
|
|
236
518
|
jurisdiction: bucket.jurisdiction ?? "default",
|
|
237
519
|
location: normalizeLocation(bucket.location),
|
|
238
520
|
accountId: acct,
|
|
521
|
+
domains: output?.domains ?? [],
|
|
239
522
|
})),
|
|
240
523
|
Effect.catchTag("NoSuchBucket", () => Effect.succeed(undefined)),
|
|
241
524
|
);
|
|
@@ -243,3 +526,55 @@ export const R2BucketProvider = () =>
|
|
|
243
526
|
};
|
|
244
527
|
}),
|
|
245
528
|
);
|
|
529
|
+
|
|
530
|
+
// R2 can make a newly-created bucket visible to `getBucket` before the custom
|
|
531
|
+
// domain endpoints accept it. Retry only that narrow `NoSuchBucket` lag here;
|
|
532
|
+
// not-found domains are still treated as terminal for idempotent deletes.
|
|
533
|
+
const r2CustomDomainConsistencySchedule = Schedule.exponential(100).pipe(
|
|
534
|
+
Schedule.both(Schedule.recurs(5)),
|
|
535
|
+
);
|
|
536
|
+
|
|
537
|
+
type CustomDomainResponse = {
|
|
538
|
+
domain: string;
|
|
539
|
+
zoneId?: string | null;
|
|
540
|
+
enabled?: boolean | null;
|
|
541
|
+
ciphers?: string[] | null;
|
|
542
|
+
minTLS?: "1.0" | "1.1" | "1.2" | "1.3" | null;
|
|
543
|
+
status?: R2Bucket.CustomDomain["status"];
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
const toCustomDomainAttributes = (
|
|
547
|
+
domain: CustomDomainResponse,
|
|
548
|
+
): R2Bucket.CustomDomain => ({
|
|
549
|
+
domain: domain.domain,
|
|
550
|
+
zoneId: domain.zoneId ?? undefined,
|
|
551
|
+
enabled: domain.enabled ?? true,
|
|
552
|
+
ciphers: domain.ciphers ?? undefined,
|
|
553
|
+
minTLS: domain.minTLS ?? undefined,
|
|
554
|
+
status: domain.status,
|
|
555
|
+
});
|
|
556
|
+
|
|
557
|
+
const sameCustomDomainConfig = (
|
|
558
|
+
observed: R2Bucket.CustomDomain | undefined,
|
|
559
|
+
desired: R2BucketCustomDomain,
|
|
560
|
+
zoneId: string,
|
|
561
|
+
): boolean =>
|
|
562
|
+
observed !== undefined &&
|
|
563
|
+
observed.zoneId === zoneId &&
|
|
564
|
+
observed.enabled === (desired.enabled ?? true) &&
|
|
565
|
+
deepEqual(observed.ciphers, desired.ciphers) &&
|
|
566
|
+
observed.minTLS === desired.minTLS;
|
|
567
|
+
|
|
568
|
+
const isMissingCustomDomainOrBucket = (error: unknown): boolean =>
|
|
569
|
+
typeof error === "object" &&
|
|
570
|
+
error !== null &&
|
|
571
|
+
(("status" in error && (error as { status: unknown }).status === 404) ||
|
|
572
|
+
("_tag" in error &&
|
|
573
|
+
((error as { _tag: unknown })._tag === "DomainNotFound" ||
|
|
574
|
+
(error as { _tag: unknown })._tag === "NoSuchBucket")));
|
|
575
|
+
|
|
576
|
+
const isNoSuchBucket = (error: unknown): boolean =>
|
|
577
|
+
typeof error === "object" &&
|
|
578
|
+
error !== null &&
|
|
579
|
+
"_tag" in error &&
|
|
580
|
+
(error as { _tag: unknown })._tag === "NoSuchBucket";
|
|
@@ -13,8 +13,11 @@ import * as Output from "../../Output.ts";
|
|
|
13
13
|
import * as Config from "effect/Config";
|
|
14
14
|
import { adopt } from "../../AdoptPolicy.ts";
|
|
15
15
|
import { AuthError } from "../../Auth/AuthProvider.ts";
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
CredentialsStore,
|
|
18
|
+
CredentialsStoreLive,
|
|
19
|
+
} from "../../Auth/Credentials.ts";
|
|
20
|
+
import { ALCHEMY_PROFILE, ProfileLive } from "../../Auth/Profile.ts";
|
|
18
21
|
import * as Cloudflare from "../../Cloudflare/Providers.ts";
|
|
19
22
|
import { deploy } from "../../Deploy.ts";
|
|
20
23
|
import * as Alchemy from "../../Stack.ts";
|
|
@@ -162,7 +165,8 @@ export const bootstrap = (options: BootstrapOptions = {}) =>
|
|
|
162
165
|
);
|
|
163
166
|
const credentials = yield* loginWithCloudflare();
|
|
164
167
|
if (!isCI) {
|
|
165
|
-
yield*
|
|
168
|
+
const store = yield* CredentialsStore;
|
|
169
|
+
yield* store.write<HttpStateStoreCredentials>(
|
|
166
170
|
profileName,
|
|
167
171
|
CREDENTIALS_FILE,
|
|
168
172
|
credentials,
|
|
@@ -206,7 +210,8 @@ export const state = () =>
|
|
|
206
210
|
const isCI = yield* Config.boolean("CI").pipe(Config.withDefault(false));
|
|
207
211
|
const alchemyContext = yield* AlchemyContext;
|
|
208
212
|
const profileName = yield* ALCHEMY_PROFILE;
|
|
209
|
-
const
|
|
213
|
+
const store = yield* CredentialsStore;
|
|
214
|
+
const credentials = yield* store.read<HttpStateStoreCredentials>(
|
|
210
215
|
profileName,
|
|
211
216
|
CREDENTIALS_FILE,
|
|
212
217
|
);
|
|
@@ -293,7 +298,7 @@ export const state = () =>
|
|
|
293
298
|
// it exists, so fetch the secret token
|
|
294
299
|
const credentials = yield* loginWithCloudflare();
|
|
295
300
|
if (!isCI) {
|
|
296
|
-
yield*
|
|
301
|
+
yield* store.write<HttpStateStoreCredentials>(
|
|
297
302
|
profileName,
|
|
298
303
|
CREDENTIALS_FILE,
|
|
299
304
|
credentials,
|
|
@@ -348,6 +353,8 @@ export const state = () =>
|
|
|
348
353
|
Layer.provideMerge(CloudflareEnvironment.fromProfile()),
|
|
349
354
|
Layer.provideMerge(CloudflareAuth),
|
|
350
355
|
Layer.provideMerge(Access.AccessLive),
|
|
356
|
+
Layer.provideMerge(ProfileLive),
|
|
357
|
+
Layer.provideMerge(CredentialsStoreLive),
|
|
351
358
|
Layer.orDie,
|
|
352
359
|
);
|
|
353
360
|
|
|
@@ -584,19 +591,21 @@ export const loginWithCloudflare = () =>
|
|
|
584
591
|
if (!isCI) {
|
|
585
592
|
// 4. Persist credentials. The profile entry is managed by
|
|
586
593
|
// `loadOrConfigure` when this is invoked through `configure`.
|
|
587
|
-
yield*
|
|
588
|
-
|
|
589
|
-
CREDENTIALS_FILE,
|
|
590
|
-
{
|
|
594
|
+
const credStore = yield* CredentialsStore;
|
|
595
|
+
yield* credStore
|
|
596
|
+
.write<HttpStateStoreCredentials>(profileName, CREDENTIALS_FILE, {
|
|
591
597
|
url,
|
|
592
598
|
authToken: authToken.trim(),
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
599
|
+
})
|
|
600
|
+
.pipe(
|
|
601
|
+
Effect.mapError(
|
|
602
|
+
(e) =>
|
|
603
|
+
new AuthError({
|
|
604
|
+
message: "Failed to write credentials",
|
|
605
|
+
cause: e,
|
|
606
|
+
}),
|
|
607
|
+
),
|
|
608
|
+
);
|
|
600
609
|
|
|
601
610
|
yield* Clank.success(
|
|
602
611
|
`HTTP state store credentials saved for '${profileName}'.`,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
|
+
import * as Redacted from "effect/Redacted";
|
|
2
3
|
import { Command, type CommandProps } from "../../Build/Command.ts";
|
|
3
4
|
import type { InputProps } from "../../Input.ts";
|
|
4
5
|
import * as Namespace from "../../Namespace.ts";
|
|
@@ -135,7 +136,16 @@ export const StaticSite = <
|
|
|
135
136
|
cwd: props.cwd,
|
|
136
137
|
memo: props.memo,
|
|
137
138
|
outdir: props.outdir,
|
|
138
|
-
env: props.env
|
|
139
|
+
env: props.env
|
|
140
|
+
? Object.fromEntries(
|
|
141
|
+
Object.entries(props.env).flatMap(([k, v]) => {
|
|
142
|
+
if (v === undefined) return [];
|
|
143
|
+
if (typeof v === "string" || Redacted.isRedacted(v))
|
|
144
|
+
return [[k, v]];
|
|
145
|
+
return [[k, JSON.stringify(v)]];
|
|
146
|
+
}),
|
|
147
|
+
)
|
|
148
|
+
: undefined,
|
|
139
149
|
})),
|
|
140
150
|
);
|
|
141
151
|
|
|
@@ -51,18 +51,25 @@ export const LocalWorkerProvider = () =>
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
for (const [key, value] of Object.entries(props.env ?? {})) {
|
|
54
|
+
if (value === undefined) continue;
|
|
54
55
|
if (Redacted.isRedacted(value)) {
|
|
55
56
|
workerBindings.push({
|
|
56
57
|
type: "secret_text",
|
|
57
58
|
name: key,
|
|
58
59
|
text: Redacted.value(value),
|
|
59
60
|
});
|
|
60
|
-
} else {
|
|
61
|
+
} else if (typeof value === "string") {
|
|
61
62
|
workerBindings.push({
|
|
62
63
|
type: "plain_text",
|
|
63
64
|
name: key,
|
|
64
65
|
text: value,
|
|
65
66
|
});
|
|
67
|
+
} else {
|
|
68
|
+
workerBindings.push({
|
|
69
|
+
type: "json",
|
|
70
|
+
name: key,
|
|
71
|
+
json: value,
|
|
72
|
+
});
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
const result = yield* sidecar.serve({
|
|
@@ -88,6 +95,7 @@ export const LocalWorkerProvider = () =>
|
|
|
88
95
|
sql: true,
|
|
89
96
|
}),
|
|
90
97
|
),
|
|
98
|
+
userOptions: props.build,
|
|
91
99
|
});
|
|
92
100
|
return {
|
|
93
101
|
workerId: name,
|