alchemy 2.0.0-beta.76 → 2.0.0-beta.77
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/README.md +1 -1
- package/THIRD_PARTY_LICENSES.md +11 -11
- package/bin/cli.js +88 -11
- package/bin/exec.js +11828 -5720
- package/bin/exec.js.map +1 -1
- package/bin/register-oxc.js +27 -0
- package/lib/AWS/AMP/Scraper.js +1 -1
- package/lib/AWS/AMP/Scraper.js.map +1 -1
- package/lib/AWS/AppRunner/Service.d.ts +11 -27
- package/lib/AWS/AppRunner/Service.d.ts.map +1 -1
- package/lib/AWS/AppRunner/Service.js +7 -21
- package/lib/AWS/AppRunner/Service.js.map +1 -1
- package/lib/AWS/Assets.d.ts +1 -1
- package/lib/AWS/Assets.js +2 -2
- package/lib/AWS/Assets.js.map +1 -1
- package/lib/AWS/AuthProvider.d.ts +40 -53
- package/lib/AWS/AuthProvider.d.ts.map +1 -1
- package/lib/AWS/AuthProvider.js +480 -215
- package/lib/AWS/AuthProvider.js.map +1 -1
- package/lib/AWS/Batch/JobDefinition.d.ts +11 -27
- package/lib/AWS/Batch/JobDefinition.d.ts.map +1 -1
- package/lib/AWS/Batch/JobDefinition.js +7 -21
- package/lib/AWS/Batch/JobDefinition.js.map +1 -1
- package/lib/AWS/EC2/GetAmi.d.ts +2 -0
- package/lib/AWS/EC2/GetAmi.d.ts.map +1 -1
- package/lib/AWS/EC2/Instance.d.ts +11 -27
- package/lib/AWS/EC2/Instance.d.ts.map +1 -1
- package/lib/AWS/EC2/Instance.js +7 -21
- package/lib/AWS/EC2/Instance.js.map +1 -1
- package/lib/AWS/EC2/hosted.d.ts +5 -6
- package/lib/AWS/EC2/hosted.d.ts.map +1 -1
- package/lib/AWS/EC2/hosted.js.map +1 -1
- package/lib/AWS/ECR/Image.d.ts +1 -1
- package/lib/AWS/ECR/ImageSource.d.ts +4 -5
- package/lib/AWS/ECR/ImageSource.d.ts.map +1 -1
- package/lib/AWS/ECR/ImageSource.js.map +1 -1
- package/lib/AWS/ECS/Service.d.ts +7 -21
- package/lib/AWS/ECS/Service.d.ts.map +1 -1
- package/lib/AWS/ECS/Service.js +7 -21
- package/lib/AWS/ECS/Service.js.map +1 -1
- package/lib/AWS/ECS/Task.d.ts +7 -21
- package/lib/AWS/ECS/Task.d.ts.map +1 -1
- package/lib/AWS/ECS/Task.js +7 -21
- package/lib/AWS/ECS/Task.js.map +1 -1
- package/lib/AWS/ElastiCache/CacheCluster.d.ts +60 -0
- package/lib/AWS/ElastiCache/CacheCluster.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/CacheCluster.js +199 -0
- package/lib/AWS/ElastiCache/CacheCluster.js.map +1 -0
- package/lib/AWS/ElastiCache/ConnectCacheCluster.d.ts +46 -0
- package/lib/AWS/ElastiCache/ConnectCacheCluster.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/ConnectCacheCluster.js +5 -0
- package/lib/AWS/ElastiCache/ConnectCacheCluster.js.map +1 -0
- package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.d.ts +4 -0
- package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.js +52 -0
- package/lib/AWS/ElastiCache/ConnectCacheClusterHttp.js.map +1 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroup.d.ts +47 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroup.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroup.js +5 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroup.js.map +1 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.d.ts +4 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.js +77 -0
- package/lib/AWS/ElastiCache/ConnectReplicationGroupHttp.js.map +1 -0
- package/lib/AWS/ElastiCache/ReplicationGroup.d.ts +95 -0
- package/lib/AWS/ElastiCache/ReplicationGroup.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/ReplicationGroup.js +383 -0
- package/lib/AWS/ElastiCache/ReplicationGroup.js.map +1 -0
- package/lib/AWS/ElastiCache/SubnetGroup.d.ts +39 -0
- package/lib/AWS/ElastiCache/SubnetGroup.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/SubnetGroup.js +136 -0
- package/lib/AWS/ElastiCache/SubnetGroup.js.map +1 -0
- package/lib/AWS/ElastiCache/index.d.ts +7 -0
- package/lib/AWS/ElastiCache/index.d.ts.map +1 -1
- package/lib/AWS/ElastiCache/index.js +7 -0
- package/lib/AWS/ElastiCache/index.js.map +1 -1
- package/lib/AWS/ElastiCache/internal.d.ts +13 -0
- package/lib/AWS/ElastiCache/internal.d.ts.map +1 -0
- package/lib/AWS/ElastiCache/internal.js +19 -0
- package/lib/AWS/ElastiCache/internal.js.map +1 -0
- package/lib/AWS/Environment.d.ts +2 -3
- package/lib/AWS/Environment.d.ts.map +1 -1
- package/lib/AWS/Environment.js +11 -41
- package/lib/AWS/Environment.js.map +1 -1
- package/lib/AWS/IAM/actions.generated.js +1 -1
- package/lib/AWS/IAM/actions.generated.js.map +1 -1
- package/lib/AWS/IdentityCenter/AccountAssignment.js +6 -0
- package/lib/AWS/IdentityCenter/AccountAssignment.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +14 -23
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +15 -20
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/MicrovmImage.d.ts +12 -28
- package/lib/AWS/Lambda/MicrovmImage.d.ts.map +1 -1
- package/lib/AWS/Lambda/MicrovmImage.js +8 -22
- package/lib/AWS/Lambda/MicrovmImage.js.map +1 -1
- package/lib/AWS/Local/DevWatchProvider.d.ts.map +1 -1
- package/lib/AWS/Local/DevWatchProvider.js +10 -1
- package/lib/AWS/Local/DevWatchProvider.js.map +1 -1
- package/lib/AWS/Organizations/Account.d.ts +2 -2
- package/lib/AWS/Organizations/Account.d.ts.map +1 -1
- package/lib/AWS/Organizations/Account.js +16 -8
- package/lib/AWS/Organizations/Account.js.map +1 -1
- package/lib/AWS/Organizations/DelegatedAdministrator.d.ts +2 -3
- package/lib/AWS/Organizations/DelegatedAdministrator.d.ts.map +1 -1
- package/lib/AWS/Organizations/DelegatedAdministrator.js +5 -5
- package/lib/AWS/Organizations/DelegatedAdministrator.js.map +1 -1
- package/lib/AWS/Organizations/Organization.d.ts +1 -1
- package/lib/AWS/Organizations/Organization.d.ts.map +1 -1
- package/lib/AWS/Organizations/Organization.js +2 -2
- package/lib/AWS/Organizations/Organization.js.map +1 -1
- package/lib/AWS/Organizations/common.d.ts +9 -0
- package/lib/AWS/Organizations/common.d.ts.map +1 -1
- package/lib/AWS/Organizations/common.js +13 -0
- package/lib/AWS/Organizations/common.js.map +1 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +4 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/AWS/StateStore/State.d.ts +1 -1
- package/lib/AWS/StateStore/State.d.ts.map +1 -1
- package/lib/Alchemist/Errors.d.ts +31 -0
- package/lib/Alchemist/Errors.d.ts.map +1 -0
- package/lib/Alchemist/Errors.js +19 -0
- package/lib/Alchemist/Errors.js.map +1 -0
- package/lib/Alchemist/Progress.d.ts +16 -0
- package/lib/Alchemist/Progress.d.ts.map +1 -0
- package/lib/Alchemist/Progress.js +129 -0
- package/lib/Alchemist/Progress.js.map +1 -0
- package/lib/Alchemist/Runtime.d.ts +22 -0
- package/lib/Alchemist/Runtime.d.ts.map +1 -0
- package/lib/Alchemist/Runtime.js +28 -0
- package/lib/Alchemist/Runtime.js.map +1 -0
- package/lib/Alchemist/Session.d.ts +124 -0
- package/lib/Alchemist/Session.d.ts.map +1 -0
- package/lib/Alchemist/Session.js +223 -0
- package/lib/Alchemist/Session.js.map +1 -0
- package/lib/Alchemist/index.d.ts +15 -0
- package/lib/Alchemist/index.d.ts.map +1 -0
- package/lib/Alchemist/index.js +15 -0
- package/lib/Alchemist/index.js.map +1 -0
- package/lib/Alchemist/routes/aws.d.ts +21 -0
- package/lib/Alchemist/routes/aws.d.ts.map +1 -0
- package/lib/Alchemist/routes/aws.js +54 -0
- package/lib/Alchemist/routes/aws.js.map +1 -0
- package/lib/Alchemist/routes/cloudflare.d.ts +63 -0
- package/lib/Alchemist/routes/cloudflare.d.ts.map +1 -0
- package/lib/Alchemist/routes/cloudflare.js +113 -0
- package/lib/Alchemist/routes/cloudflare.js.map +1 -0
- package/lib/Alchemist/routes/cloudflareToken.d.ts +93 -0
- package/lib/Alchemist/routes/cloudflareToken.d.ts.map +1 -0
- package/lib/Alchemist/routes/cloudflareToken.js +111 -0
- package/lib/Alchemist/routes/cloudflareToken.js.map +1 -0
- package/lib/Alchemist/routes/drift.d.ts +55 -0
- package/lib/Alchemist/routes/drift.d.ts.map +1 -0
- package/lib/Alchemist/routes/drift.js +52 -0
- package/lib/Alchemist/routes/drift.js.map +1 -0
- package/lib/Alchemist/routes/logs.d.ts +41 -0
- package/lib/Alchemist/routes/logs.d.ts.map +1 -0
- package/lib/Alchemist/routes/logs.js +112 -0
- package/lib/Alchemist/routes/logs.js.map +1 -0
- package/lib/Alchemist/routes/nuke.d.ts +46 -0
- package/lib/Alchemist/routes/nuke.d.ts.map +1 -0
- package/lib/Alchemist/routes/nuke.js +80 -0
- package/lib/Alchemist/routes/nuke.js.map +1 -0
- package/lib/Alchemist/routes/profile.d.ts +133 -0
- package/lib/Alchemist/routes/profile.d.ts.map +1 -0
- package/lib/Alchemist/routes/profile.js +257 -0
- package/lib/Alchemist/routes/profile.js.map +1 -0
- package/lib/Alchemist/routes/provider.d.ts +33 -0
- package/lib/Alchemist/routes/provider.d.ts.map +1 -0
- package/lib/Alchemist/routes/provider.js +65 -0
- package/lib/Alchemist/routes/provider.js.map +1 -0
- package/lib/Alchemist/routes/stack.d.ts +78 -0
- package/lib/Alchemist/routes/stack.d.ts.map +1 -0
- package/lib/Alchemist/routes/stack.js +67 -0
- package/lib/Alchemist/routes/stack.js.map +1 -0
- package/lib/Alchemist/routes/state.d.ts +35 -0
- package/lib/Alchemist/routes/state.d.ts.map +1 -0
- package/lib/Alchemist/routes/state.js +42 -0
- package/lib/Alchemist/routes/state.js.map +1 -0
- package/lib/Apply.d.ts +8 -6
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +209 -103
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +201 -25
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +180 -40
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/BrowserOAuth.d.ts +27 -0
- package/lib/Auth/BrowserOAuth.d.ts.map +1 -0
- package/lib/Auth/BrowserOAuth.js +41 -0
- package/lib/Auth/BrowserOAuth.js.map +1 -0
- package/lib/Auth/Credentials.d.ts +11 -6
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +62 -23
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/CredentialsCache.d.ts +15 -0
- package/lib/Auth/CredentialsCache.d.ts.map +1 -0
- package/lib/Auth/CredentialsCache.js +34 -0
- package/lib/Auth/CredentialsCache.js.map +1 -0
- package/lib/Auth/Demand.d.ts +59 -34
- package/lib/Auth/Demand.d.ts.map +1 -1
- package/lib/Auth/Demand.js +150 -60
- package/lib/Auth/Demand.js.map +1 -1
- package/lib/Auth/Env.d.ts +4 -4
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +18 -9
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Auth/Inspect.d.ts +33 -0
- package/lib/Auth/Inspect.d.ts.map +1 -0
- package/lib/Auth/Inspect.js +67 -0
- package/lib/Auth/Inspect.js.map +1 -0
- package/lib/Auth/Lock.d.ts +6 -0
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +22 -11
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +119 -0
- package/lib/Auth/OAuthFlow.d.ts.map +1 -0
- package/lib/Auth/OAuthFlow.js +314 -0
- package/lib/Auth/OAuthFlow.js.map +1 -0
- package/lib/Auth/Paths.d.ts +18 -0
- package/lib/Auth/Paths.d.ts.map +1 -0
- package/lib/Auth/Paths.js +20 -0
- package/lib/Auth/Paths.js.map +1 -0
- package/lib/Auth/Profile.d.ts +91 -67
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +449 -92
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/Resolve.d.ts +42 -0
- package/lib/Auth/Resolve.d.ts.map +1 -0
- package/lib/Auth/Resolve.js +90 -0
- package/lib/Auth/Resolve.js.map +1 -0
- package/lib/Auth/StoredAuthProvider.d.ts +84 -0
- package/lib/Auth/StoredAuthProvider.d.ts.map +1 -0
- package/lib/Auth/StoredAuthProvider.js +179 -0
- package/lib/Auth/StoredAuthProvider.js.map +1 -0
- package/lib/Auth/index.d.ts +1 -0
- package/lib/Auth/index.d.ts.map +1 -1
- package/lib/Auth/index.js +1 -0
- package/lib/Auth/index.js.map +1 -1
- package/lib/Axiom/AuthProvider.d.ts +17 -26
- package/lib/Axiom/AuthProvider.d.ts.map +1 -1
- package/lib/Axiom/AuthProvider.js +89 -172
- package/lib/Axiom/AuthProvider.js.map +1 -1
- package/lib/Axiom/Credentials.d.ts +2 -4
- package/lib/Axiom/Credentials.d.ts.map +1 -1
- package/lib/Axiom/Credentials.js +5 -10
- package/lib/Axiom/Credentials.js.map +1 -1
- package/lib/Axiom/Providers.d.ts +2 -2
- package/lib/Axiom/Providers.d.ts.map +1 -1
- package/lib/Axiom/Providers.js +3 -3
- package/lib/Axiom/Providers.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +3 -5
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Cli/CliKit/CliKit.d.ts +92 -0
- package/lib/Cli/CliKit/CliKit.d.ts.map +1 -0
- package/lib/Cli/CliKit/CliKit.js +27 -0
- package/lib/Cli/CliKit/CliKit.js.map +1 -0
- package/lib/Cli/CliKit/index.d.ts +9 -0
- package/lib/Cli/CliKit/index.d.ts.map +1 -0
- package/lib/Cli/CliKit/index.js +9 -0
- package/lib/Cli/CliKit/index.js.map +1 -0
- package/lib/Cli/CliKit/interaction.d.ts +13 -0
- package/lib/Cli/CliKit/interaction.d.ts.map +1 -0
- package/lib/Cli/CliKit/interaction.js +17 -0
- package/lib/Cli/CliKit/interaction.js.map +1 -0
- package/lib/Cli/CliKit/layer.d.ts +7 -0
- package/lib/Cli/CliKit/layer.d.ts.map +1 -0
- package/lib/Cli/CliKit/layer.js +34 -0
- package/lib/Cli/CliKit/layer.js.map +1 -0
- package/lib/Cli/DevOptions.d.ts +17 -0
- package/lib/Cli/DevOptions.d.ts.map +1 -0
- package/lib/Cli/DevOptions.js +16 -0
- package/lib/Cli/DevOptions.js.map +1 -0
- package/lib/Cli/Format.d.ts +5 -0
- package/lib/Cli/Format.d.ts.map +1 -0
- package/lib/Cli/Format.js +27 -0
- package/lib/Cli/Format.js.map +1 -0
- package/lib/Cli/GlobalLog.d.ts +41 -0
- package/lib/Cli/GlobalLog.d.ts.map +1 -0
- package/lib/Cli/GlobalLog.js +112 -0
- package/lib/Cli/GlobalLog.js.map +1 -0
- package/lib/Cli/LoggingCli.d.ts +4 -3
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +240 -100
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/ModeTag.d.ts +1 -1
- package/lib/Cli/ModeTag.js +1 -1
- package/lib/Cli/NamespaceTree.d.ts +18 -8
- package/lib/Cli/NamespaceTree.d.ts.map +1 -1
- package/lib/Cli/NamespaceTree.js +52 -11
- package/lib/Cli/NamespaceTree.js.map +1 -1
- package/lib/Cli/PlainCliFormatter.d.ts +11 -0
- package/lib/Cli/PlainCliFormatter.d.ts.map +1 -0
- package/lib/Cli/PlainCliFormatter.js +70 -0
- package/lib/Cli/PlainCliFormatter.js.map +1 -0
- package/lib/Cli/PropertyDiff.d.ts +37 -0
- package/lib/Cli/PropertyDiff.d.ts.map +1 -0
- package/lib/Cli/PropertyDiff.js +162 -0
- package/lib/Cli/PropertyDiff.js.map +1 -0
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +10 -6
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/aws.d.ts +2 -4
- package/lib/Cli/commands/aws.d.ts.map +1 -1
- package/lib/Cli/commands/aws.js +43 -55
- package/lib/Cli/commands/aws.js.map +1 -1
- package/lib/Cli/commands/cloudflare.d.ts +6 -7
- package/lib/Cli/commands/cloudflare.d.ts.map +1 -1
- package/lib/Cli/commands/cloudflare.js +149 -307
- package/lib/Cli/commands/cloudflare.js.map +1 -1
- package/lib/Cli/commands/compat.d.ts +11 -0
- package/lib/Cli/commands/compat.d.ts.map +1 -0
- package/lib/Cli/commands/compat.js +19 -0
- package/lib/Cli/commands/compat.js.map +1 -0
- package/lib/Cli/commands/confirm.d.ts +33 -0
- package/lib/Cli/commands/confirm.d.ts.map +1 -0
- package/lib/Cli/commands/confirm.js +39 -0
- package/lib/Cli/commands/confirm.js.map +1 -0
- package/lib/Cli/commands/deploy.d.ts +20 -32
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +140 -140
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts +5 -4
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +52 -26
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +12 -0
- package/lib/Cli/commands/drift.d.ts.map +1 -0
- package/lib/Cli/commands/drift.js +68 -0
- package/lib/Cli/commands/drift.js.map +1 -0
- package/lib/Cli/commands/errors.d.ts +35 -0
- package/lib/Cli/commands/errors.d.ts.map +1 -0
- package/lib/Cli/commands/errors.js +106 -0
- package/lib/Cli/commands/errors.js.map +1 -0
- package/lib/Cli/commands/flags.d.ts +46 -0
- package/lib/Cli/commands/flags.d.ts.map +1 -0
- package/lib/Cli/commands/flags.js +98 -0
- package/lib/Cli/commands/flags.js.map +1 -0
- package/lib/Cli/commands/instrument.d.ts +3 -0
- package/lib/Cli/commands/instrument.d.ts.map +1 -0
- package/lib/Cli/commands/instrument.js +6 -0
- package/lib/Cli/commands/instrument.js.map +1 -0
- package/lib/Cli/commands/logs.d.ts +5 -4
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +63 -88
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts +3 -2
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +89 -588
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile/commands.d.ts +9 -0
- package/lib/Cli/commands/profile/commands.d.ts.map +1 -0
- package/lib/Cli/commands/profile/commands.js +276 -0
- package/lib/Cli/commands/profile/commands.js.map +1 -0
- package/lib/Cli/commands/profile/flows.d.ts +36 -0
- package/lib/Cli/commands/profile/flows.d.ts.map +1 -0
- package/lib/Cli/commands/profile/flows.js +155 -0
- package/lib/Cli/commands/profile/flows.js.map +1 -0
- package/lib/Cli/commands/profile/hub.d.ts +8 -0
- package/lib/Cli/commands/profile/hub.d.ts.map +1 -0
- package/lib/Cli/commands/profile/hub.js +154 -0
- package/lib/Cli/commands/profile/hub.js.map +1 -0
- package/lib/Cli/commands/profile/index.d.ts +2 -0
- package/lib/Cli/commands/profile/index.d.ts.map +1 -0
- package/lib/Cli/commands/profile/index.js +2 -0
- package/lib/Cli/commands/profile/index.js.map +1 -0
- package/lib/Cli/commands/provider.d.ts +17 -0
- package/lib/Cli/commands/provider.d.ts.map +1 -0
- package/lib/Cli/commands/provider.js +44 -0
- package/lib/Cli/commands/provider.js.map +1 -0
- package/lib/Cli/commands/render.d.ts +12 -0
- package/lib/Cli/commands/render.d.ts.map +1 -0
- package/lib/Cli/commands/render.js +82 -0
- package/lib/Cli/commands/render.js.map +1 -0
- package/lib/Cli/commands/state.d.ts +8 -1
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +125 -248
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/components/types.d.ts +104 -0
- package/lib/Cli/components/types.d.ts.map +1 -0
- package/lib/Cli/components/types.js +4 -0
- package/lib/Cli/components/types.js.map +1 -0
- package/lib/Cli/components/ui/Data.d.ts +15 -0
- package/lib/Cli/components/ui/Data.d.ts.map +1 -0
- package/lib/Cli/components/ui/Data.js +8 -0
- package/lib/Cli/components/ui/Data.js.map +1 -0
- package/lib/Cli/components/ui/Environment.d.ts +45 -0
- package/lib/Cli/components/ui/Environment.d.ts.map +1 -0
- package/lib/Cli/components/ui/Environment.js +38 -0
- package/lib/Cli/components/ui/Environment.js.map +1 -0
- package/lib/Cli/components/ui/Feedback.d.ts +57 -0
- package/lib/Cli/components/ui/Feedback.d.ts.map +1 -0
- package/lib/Cli/components/ui/Feedback.js +83 -0
- package/lib/Cli/components/ui/Feedback.js.map +1 -0
- package/lib/Cli/components/ui/Interactive.d.ts +157 -0
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -0
- package/lib/Cli/components/ui/Interactive.js +527 -0
- package/lib/Cli/components/ui/Interactive.js.map +1 -0
- package/lib/Cli/components/ui/Layout.d.ts +74 -0
- package/lib/Cli/components/ui/Layout.d.ts.map +1 -0
- package/lib/Cli/components/ui/Layout.js +91 -0
- package/lib/Cli/components/ui/Layout.js.map +1 -0
- package/lib/Cli/components/ui/Live.d.ts +49 -0
- package/lib/Cli/components/ui/Live.d.ts.map +1 -0
- package/lib/Cli/components/ui/Live.js +43 -0
- package/lib/Cli/components/ui/Live.js.map +1 -0
- package/lib/Cli/components/ui/ProgressBar.d.ts +16 -0
- package/lib/Cli/components/ui/ProgressBar.d.ts.map +1 -0
- package/lib/Cli/components/ui/ProgressBar.js +17 -0
- package/lib/Cli/components/ui/ProgressBar.js.map +1 -0
- package/lib/Cli/components/ui/Transcript.d.ts +12 -0
- package/lib/Cli/components/ui/Transcript.d.ts.map +1 -0
- package/lib/Cli/components/ui/Transcript.js +14 -0
- package/lib/Cli/components/ui/Transcript.js.map +1 -0
- package/lib/Cli/components/ui/Typography.d.ts +17 -0
- package/lib/Cli/components/ui/Typography.d.ts.map +1 -0
- package/lib/Cli/components/ui/Typography.js +21 -0
- package/lib/Cli/components/ui/Typography.js.map +1 -0
- package/lib/Cli/components/ui/index.d.ts +16 -0
- package/lib/Cli/components/ui/index.d.ts.map +1 -0
- package/lib/Cli/components/ui/index.js +16 -0
- package/lib/Cli/components/ui/index.js.map +1 -0
- package/lib/Cli/components/view/ApprovePlan.d.ts +17 -0
- package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -0
- package/lib/Cli/components/view/ApprovePlan.js +59 -0
- package/lib/Cli/components/view/ApprovePlan.js.map +1 -0
- package/lib/Cli/components/view/Help.d.ts +4 -0
- package/lib/Cli/components/view/Help.d.ts.map +1 -0
- package/lib/Cli/components/view/Help.js +116 -0
- package/lib/Cli/components/view/Help.js.map +1 -0
- package/lib/Cli/components/view/Logo.d.ts +7 -0
- package/lib/Cli/components/view/Logo.d.ts.map +1 -0
- package/lib/Cli/components/view/Logo.js +118 -0
- package/lib/Cli/components/view/Logo.js.map +1 -0
- package/lib/Cli/components/view/Nuke.d.ts +36 -0
- package/lib/Cli/components/view/Nuke.d.ts.map +1 -0
- package/lib/Cli/components/view/Nuke.js +148 -0
- package/lib/Cli/components/view/Nuke.js.map +1 -0
- package/lib/Cli/components/view/PlanDecision.d.ts +15 -0
- package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -0
- package/lib/Cli/components/view/PlanDecision.js +26 -0
- package/lib/Cli/components/view/PlanDecision.js.map +1 -0
- package/lib/Cli/components/view/PlanRow.d.ts +17 -0
- package/lib/Cli/components/view/PlanRow.d.ts.map +1 -0
- package/lib/Cli/components/view/PlanRow.js +14 -0
- package/lib/Cli/components/view/PlanRow.js.map +1 -0
- package/lib/Cli/components/view/PlanTree.d.ts +116 -0
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -0
- package/lib/Cli/components/view/PlanTree.js +207 -0
- package/lib/Cli/components/view/PlanTree.js.map +1 -0
- package/lib/Cli/components/view/PlanView.d.ts +42 -0
- package/lib/Cli/components/view/PlanView.d.ts.map +1 -0
- package/lib/Cli/components/view/PlanView.js +310 -0
- package/lib/Cli/components/view/PlanView.js.map +1 -0
- package/lib/Cli/components/view/Profile.d.ts +130 -0
- package/lib/Cli/components/view/Profile.d.ts.map +1 -0
- package/lib/Cli/components/view/Profile.js +147 -0
- package/lib/Cli/components/view/Profile.js.map +1 -0
- package/lib/Cli/components/view/ProfileDashboard.d.ts +152 -0
- package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -0
- package/lib/Cli/components/view/ProfileDashboard.js +485 -0
- package/lib/Cli/components/view/ProfileDashboard.js.map +1 -0
- package/lib/Cli/components/view/Prompts.d.ts +10 -0
- package/lib/Cli/components/view/Prompts.d.ts.map +1 -0
- package/lib/Cli/components/view/Prompts.js +440 -0
- package/lib/Cli/components/view/Prompts.js.map +1 -0
- package/lib/Cli/components/view/Runtime.d.ts +8 -0
- package/lib/Cli/components/view/Runtime.d.ts.map +1 -0
- package/lib/Cli/components/view/Runtime.js +670 -0
- package/lib/Cli/components/view/Runtime.js.map +1 -0
- package/lib/Cli/components/view/SigilCli.d.ts +5 -0
- package/lib/Cli/components/view/SigilCli.d.ts.map +1 -0
- package/lib/Cli/components/view/SigilCli.js +134 -0
- package/lib/Cli/components/view/SigilCli.js.map +1 -0
- package/lib/Cli/components/view/StackOutputs.d.ts +10 -0
- package/lib/Cli/components/view/StackOutputs.d.ts.map +1 -0
- package/lib/Cli/components/view/StackOutputs.js +14 -0
- package/lib/Cli/components/view/StackOutputs.js.map +1 -0
- package/lib/Cli/components/view/StateExplorer.d.ts +118 -0
- package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -0
- package/lib/Cli/components/view/StateExplorer.js +664 -0
- package/lib/Cli/components/view/StateExplorer.js.map +1 -0
- package/lib/Cli/components/view/statusStyle.d.ts +18 -0
- package/lib/Cli/components/view/statusStyle.d.ts.map +1 -0
- package/lib/Cli/components/view/statusStyle.js +69 -0
- package/lib/Cli/components/view/statusStyle.js.map +1 -0
- package/lib/Cli/components/view/usePlanPresentation.d.ts +25 -0
- package/lib/Cli/components/view/usePlanPresentation.d.ts.map +1 -0
- package/lib/Cli/components/view/usePlanPresentation.js +54 -0
- package/lib/Cli/components/view/usePlanPresentation.js.map +1 -0
- package/lib/Cli/components/view/usePlanViewport.d.ts +31 -0
- package/lib/Cli/components/view/usePlanViewport.d.ts.map +1 -0
- package/lib/Cli/components/view/usePlanViewport.js +113 -0
- package/lib/Cli/components/view/usePlanViewport.js.map +1 -0
- package/lib/Cli/exec.d.ts +5 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +173 -19
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts +4 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +129 -38
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +5 -3
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +16 -9
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Cloudflare/ApiToken/UserApiToken.d.ts +1 -1
- package/lib/Cloudflare/ApiToken/UserApiToken.js +1 -1
- package/lib/Cloudflare/Auth/AuthConfig.d.ts +60 -0
- package/lib/Cloudflare/Auth/AuthConfig.d.ts.map +1 -0
- package/lib/Cloudflare/Auth/AuthConfig.js +68 -0
- package/lib/Cloudflare/Auth/AuthConfig.js.map +1 -0
- package/lib/Cloudflare/Auth/AuthProvider.d.ts +2 -142
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +473 -327
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.d.ts +16 -48
- package/lib/Cloudflare/Auth/OAuthClient.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/OAuthClient.js +25 -260
- package/lib/Cloudflare/Auth/OAuthClient.js.map +1 -1
- package/lib/Cloudflare/Auth/OAuthScopes.d.ts +88 -0
- package/lib/Cloudflare/Auth/OAuthScopes.d.ts.map +1 -0
- package/lib/Cloudflare/Auth/OAuthScopes.js +887 -0
- package/lib/Cloudflare/Auth/OAuthScopes.js.map +1 -0
- package/lib/Cloudflare/Auth/TokenPolicy.d.ts +34 -0
- package/lib/Cloudflare/Auth/TokenPolicy.d.ts.map +1 -0
- package/lib/Cloudflare/Auth/TokenPolicy.js +51 -0
- package/lib/Cloudflare/Auth/TokenPolicy.js.map +1 -0
- package/lib/Cloudflare/CloudflareEnvironment.d.ts +2 -3
- package/lib/Cloudflare/CloudflareEnvironment.d.ts.map +1 -1
- package/lib/Cloudflare/CloudflareEnvironment.js +7 -11
- package/lib/Cloudflare/CloudflareEnvironment.js.map +1 -1
- package/lib/Cloudflare/Containers/Container.d.ts +10 -25
- package/lib/Cloudflare/Containers/Container.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/Container.js +9 -23
- package/lib/Cloudflare/Containers/Container.js.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts +12 -27
- package/lib/Cloudflare/Containers/ContainerApplication.d.ts.map +1 -1
- package/lib/Cloudflare/Containers/ContainerApplication.js.map +1 -1
- package/lib/Cloudflare/Containers/StartContainer.d.ts +1 -1
- package/lib/Cloudflare/Containers/StartContainer.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.d.ts +6 -20
- package/lib/Cloudflare/Credentials.d.ts.map +1 -1
- package/lib/Cloudflare/Credentials.js +12 -54
- package/lib/Cloudflare/Credentials.js.map +1 -1
- package/lib/Cloudflare/D1/ImportDatabase.d.ts +1 -1
- package/lib/Cloudflare/D1/ImportDatabase.d.ts.map +1 -1
- package/lib/Cloudflare/EdgeSession.d.ts +1 -1
- package/lib/Cloudflare/EdgeSession.d.ts.map +1 -1
- package/lib/Cloudflare/EdgeSession.js +1 -1
- package/lib/Cloudflare/EdgeSession.js.map +1 -1
- package/lib/Cloudflare/Logs.d.ts.map +1 -1
- package/lib/Cloudflare/Logs.js +10 -6
- package/lib/Cloudflare/Logs.js.map +1 -1
- package/lib/Cloudflare/Pages/Project.d.ts +1 -1
- package/lib/Cloudflare/Pages/Project.js +1 -1
- package/lib/Cloudflare/Providers.d.ts +2 -2
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +2 -2
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +3 -0
- package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Api.js +2 -2
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/CredentialsFile.d.ts +10 -6
- package/lib/Cloudflare/StateStore/CredentialsFile.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/CredentialsFile.js +23 -1
- package/lib/Cloudflare/StateStore/CredentialsFile.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts +9 -5
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +132 -99
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js +1 -1
- package/lib/Cloudflare/Vectorize/SearchIndexHttpClient.js.map +1 -1
- package/lib/Cloudflare/Website/Nextjs.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Nextjs.js +4 -12
- package/lib/Cloudflare/Website/Nextjs.js.map +1 -1
- package/lib/Cloudflare/Website/Vocs.d.ts +1 -1
- package/lib/Cloudflare/Website/Vocs.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Vocs.js +3 -7
- package/lib/Cloudflare/Website/Vocs.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts +2 -2
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +74 -26
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts +2 -2
- package/lib/Cloudflare/Workers/BrowserHttpClient.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/BrowserHttpClient.js +10 -3
- package/lib/Cloudflare/Workers/BrowserHttpClient.js.map +1 -1
- package/lib/Cloudflare/Workers/CloudflareTracer.d.ts +9 -0
- package/lib/Cloudflare/Workers/CloudflareTracer.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/CloudflareTracer.js +87 -0
- package/lib/Cloudflare/Workers/CloudflareTracer.js.map +1 -0
- package/lib/Cloudflare/Workers/Compatibility.d.ts +13 -0
- package/lib/Cloudflare/Workers/Compatibility.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Compatibility.js +31 -6
- package/lib/Cloudflare/Workers/Compatibility.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.d.ts +50 -4
- package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.js +44 -3
- package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +4 -0
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts +25 -2
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.js +7 -2
- package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts +7 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.js +6 -1
- package/lib/Cloudflare/Workers/DurableObjectStorage.js.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +125 -58
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcWorker.d.ts +12 -5
- package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/RpcWorker.js +8 -2
- package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -1
- package/lib/Cloudflare/Workers/Source.d.ts +3 -0
- package/lib/Cloudflare/Workers/Source.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Source.js +3 -1
- package/lib/Cloudflare/Workers/Source.js.map +1 -1
- package/lib/Cloudflare/Workers/Sources/Python.d.ts +2 -0
- package/lib/Cloudflare/Workers/Sources/Python.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Sources/Python.js +16 -12
- package/lib/Cloudflare/Workers/Sources/Python.js.map +1 -1
- package/lib/Cloudflare/Workers/Sources/Rolldown.js +1 -1
- package/lib/Cloudflare/Workers/Sources/Rolldown.js.map +1 -1
- package/lib/Cloudflare/Workers/Sources/Vite.d.ts +1 -1
- package/lib/Cloudflare/Workers/Sources/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Sources/Vite.js +6 -4
- package/lib/Cloudflare/Workers/Sources/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Telemetry.d.ts +113 -0
- package/lib/Cloudflare/Workers/Telemetry.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/Telemetry.js +129 -0
- package/lib/Cloudflare/Workers/Telemetry.js.map +1 -0
- package/lib/Cloudflare/Workers/ViteBuildChildRunner.js +6 -1
- package/lib/Cloudflare/Workers/ViteBuildChildRunner.js.map +1 -1
- package/lib/Cloudflare/Workers/ViteChild.d.ts +2 -2
- package/lib/Cloudflare/Workers/ViteChild.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/ViteChild.js +19 -17
- package/lib/Cloudflare/Workers/ViteChild.js.map +1 -1
- package/lib/Cloudflare/Workers/ViteChild.shared.d.ts +1 -0
- package/lib/Cloudflare/Workers/ViteChild.shared.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/ViteChild.shared.js.map +1 -1
- package/lib/Cloudflare/Workers/ViteChildRunner.js +2 -1
- package/lib/Cloudflare/Workers/ViteChildRunner.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +101 -52
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +91 -50
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +9 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +23 -0
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +6 -0
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerLoader.d.ts +30 -4
- package/lib/Cloudflare/Workers/WorkerLoader.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerLoader.js +36 -5
- package/lib/Cloudflare/Workers/WorkerLoader.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerProvider.js +52 -45
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/cloudflare_workers.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/cloudflare_workers.js +4 -1
- package/lib/Cloudflare/Workers/cloudflare_workers.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +1 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +1 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.d.ts +84 -0
- package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.js +47 -0
- package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.js +7 -4
- package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
- package/lib/Command/Command.d.ts +1 -1
- package/lib/Command/Command.d.ts.map +1 -1
- package/lib/Command/Command.js +2 -2
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +5 -2
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +31 -7
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Deploy.d.ts +1 -1
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Destroy.d.ts +1 -1
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Docker/BuildHash.d.ts +13 -0
- package/lib/Docker/BuildHash.d.ts.map +1 -1
- package/lib/Docker/BuildHash.js +53 -3
- package/lib/Docker/BuildHash.js.map +1 -1
- package/lib/Docker/Docker.d.ts +1 -1
- package/lib/Docker/Docker.d.ts.map +1 -1
- package/lib/Docker/Docker.js +1 -1
- package/lib/Docker/Docker.js.map +1 -1
- package/lib/Docker/Service.d.ts +7 -21
- package/lib/Docker/Service.d.ts.map +1 -1
- package/lib/Docker/Service.js +7 -21
- package/lib/Docker/Service.js.map +1 -1
- package/lib/Docker/ServiceImage.d.ts +4 -5
- package/lib/Docker/ServiceImage.d.ts.map +1 -1
- package/lib/Docker/ServiceImage.js.map +1 -1
- package/lib/Drift.d.ts +91 -0
- package/lib/Drift.d.ts.map +1 -0
- package/lib/{Sync.js → Drift.js} +98 -29
- package/lib/Drift.js.map +1 -0
- package/lib/Drizzle/Schema.d.ts.map +1 -1
- package/lib/Drizzle/Schema.js +5 -5
- package/lib/Drizzle/Schema.js.map +1 -1
- package/lib/Fly/App.d.ts +1 -1
- package/lib/Fly/App.d.ts.map +1 -1
- package/lib/Fly/AuthProvider.d.ts +6 -20
- package/lib/Fly/AuthProvider.d.ts.map +1 -1
- package/lib/Fly/AuthProvider.js +32 -124
- package/lib/Fly/AuthProvider.js.map +1 -1
- package/lib/Fly/Bucket.d.ts +1 -1
- package/lib/Fly/Bucket.d.ts.map +1 -1
- package/lib/Fly/Catalog.d.ts +1 -1
- package/lib/Fly/Catalog.d.ts.map +1 -1
- package/lib/Fly/CheckpointHttp.d.ts.map +1 -1
- package/lib/Fly/CheckpointHttp.js +2 -2
- package/lib/Fly/CheckpointHttp.js.map +1 -1
- package/lib/Fly/Credentials.d.ts +15 -6
- package/lib/Fly/Credentials.d.ts.map +1 -1
- package/lib/Fly/Credentials.js +25 -13
- package/lib/Fly/Credentials.js.map +1 -1
- package/lib/Fly/DecryptHttp.d.ts.map +1 -1
- package/lib/Fly/DecryptHttp.js +2 -2
- package/lib/Fly/DecryptHttp.js.map +1 -1
- package/lib/Fly/EncryptHttp.d.ts.map +1 -1
- package/lib/Fly/EncryptHttp.js +2 -2
- package/lib/Fly/EncryptHttp.js.map +1 -1
- package/lib/Fly/Environment.d.ts +1 -1
- package/lib/Fly/Environment.d.ts.map +1 -1
- package/lib/Fly/ExecHttp.d.ts.map +1 -1
- package/lib/Fly/ExecHttp.js +2 -2
- package/lib/Fly/ExecHttp.js.map +1 -1
- package/lib/Fly/GetSecretHttp.d.ts.map +1 -1
- package/lib/Fly/GetSecretHttp.js +2 -2
- package/lib/Fly/GetSecretHttp.js.map +1 -1
- package/lib/Fly/ListSecretsHttp.d.ts.map +1 -1
- package/lib/Fly/ListSecretsHttp.js +2 -2
- package/lib/Fly/ListSecretsHttp.js.map +1 -1
- package/lib/Fly/Machine.d.ts +65 -0
- package/lib/Fly/Machine.d.ts.map +1 -1
- package/lib/Fly/Machine.js +34 -19
- package/lib/Fly/Machine.js.map +1 -1
- package/lib/Fly/Postgres.d.ts +1 -1
- package/lib/Fly/Postgres.d.ts.map +1 -1
- package/lib/Fly/Providers.d.ts +1 -1
- package/lib/Fly/Providers.d.ts.map +1 -1
- package/lib/Fly/Providers.js +2 -2
- package/lib/Fly/Providers.js.map +1 -1
- package/lib/Fly/Redis.d.ts +1 -1
- package/lib/Fly/Redis.d.ts.map +1 -1
- package/lib/Fly/Service.d.ts +43 -0
- package/lib/Fly/Service.d.ts.map +1 -1
- package/lib/Fly/Service.js +44 -19
- package/lib/Fly/Service.js.map +1 -1
- package/lib/Fly/SignHttp.d.ts.map +1 -1
- package/lib/Fly/SignHttp.js +2 -2
- package/lib/Fly/SignHttp.js.map +1 -1
- package/lib/Fly/VerifyHttp.d.ts.map +1 -1
- package/lib/Fly/VerifyHttp.js +2 -2
- package/lib/Fly/VerifyHttp.js.map +1 -1
- package/lib/Fly/Volume.d.ts +8 -8
- package/lib/Fly/Volume.d.ts.map +1 -1
- package/lib/Fly/WriteSecretHttp.d.ts.map +1 -1
- package/lib/Fly/WriteSecretHttp.js +2 -2
- package/lib/Fly/WriteSecretHttp.js.map +1 -1
- package/lib/Fly/replicas.d.ts +12 -10
- package/lib/Fly/replicas.d.ts.map +1 -1
- package/lib/Fly/replicas.js +35 -0
- package/lib/Fly/replicas.js.map +1 -1
- package/lib/GitHub/AuthProvider.d.ts +20 -29
- package/lib/GitHub/AuthProvider.d.ts.map +1 -1
- package/lib/GitHub/AuthProvider.js +141 -75
- package/lib/GitHub/AuthProvider.js.map +1 -1
- package/lib/GitHub/Credentials.d.ts +2 -3
- package/lib/GitHub/Credentials.d.ts.map +1 -1
- package/lib/GitHub/Credentials.js +6 -10
- package/lib/GitHub/Credentials.js.map +1 -1
- package/lib/GitHub/Providers.d.ts +3 -3
- package/lib/GitHub/Providers.d.ts.map +1 -1
- package/lib/GitHub/Providers.js +4 -4
- package/lib/GitHub/Providers.js.map +1 -1
- package/lib/Hetzner/AuthProvider.d.ts +7 -20
- package/lib/Hetzner/AuthProvider.d.ts.map +1 -1
- package/lib/Hetzner/AuthProvider.js +42 -130
- package/lib/Hetzner/AuthProvider.js.map +1 -1
- package/lib/Hetzner/Catalog.d.ts +5 -5
- package/lib/Hetzner/Catalog.d.ts.map +1 -1
- package/lib/Hetzner/Credentials.d.ts +1 -3
- package/lib/Hetzner/Credentials.d.ts.map +1 -1
- package/lib/Hetzner/Credentials.js +4 -9
- package/lib/Hetzner/Credentials.js.map +1 -1
- package/lib/Hetzner/PlacementGroup.d.ts +1 -1
- package/lib/Hetzner/PlacementGroup.d.ts.map +1 -1
- package/lib/Hetzner/Providers.d.ts +1 -1
- package/lib/Hetzner/Providers.d.ts.map +1 -1
- package/lib/Hetzner/Providers.js +2 -2
- package/lib/Hetzner/Providers.js.map +1 -1
- package/lib/Hetzner/hosted.d.ts +1 -1
- package/lib/Interaction.d.ts +186 -0
- package/lib/Interaction.d.ts.map +1 -0
- package/lib/Interaction.js +149 -0
- package/lib/Interaction.js.map +1 -0
- package/lib/Kubernetes/ClusterAdapter.d.ts +4 -5
- package/lib/Kubernetes/ClusterAdapter.d.ts.map +1 -1
- package/lib/Kubernetes/ClusterAdapter.js.map +1 -1
- package/lib/Kubernetes/Deployment.d.ts +7 -21
- package/lib/Kubernetes/Deployment.d.ts.map +1 -1
- package/lib/Kubernetes/Deployment.js +7 -21
- package/lib/Kubernetes/Deployment.js.map +1 -1
- package/lib/Kubernetes/Job.d.ts +7 -21
- package/lib/Kubernetes/Job.d.ts.map +1 -1
- package/lib/Kubernetes/Job.js +7 -21
- package/lib/Kubernetes/Job.js.map +1 -1
- package/lib/Local/DevLog.d.ts +32 -0
- package/lib/Local/DevLog.d.ts.map +1 -0
- package/lib/Local/DevLog.js +114 -0
- package/lib/Local/DevLog.js.map +1 -0
- package/lib/Local/LocalProvider.d.ts +1 -1
- package/lib/Local/LocalProvider.d.ts.map +1 -1
- package/lib/Local/LocalProvider.js +2 -2
- package/lib/Local/LocalProvider.js.map +1 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +10 -1
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerEnvironment.d.ts +2 -2
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
- package/lib/Local/RpcServerEnvironment.js +3 -2
- package/lib/Local/RpcServerEnvironment.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts +14 -5
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +105 -38
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Neon/AuthProvider.d.ts +4 -13
- package/lib/Neon/AuthProvider.d.ts.map +1 -1
- package/lib/Neon/AuthProvider.js +24 -107
- package/lib/Neon/AuthProvider.js.map +1 -1
- package/lib/Neon/Credentials.d.ts +1 -3
- package/lib/Neon/Credentials.d.ts.map +1 -1
- package/lib/Neon/Credentials.js +4 -9
- package/lib/Neon/Credentials.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 +2 -2
- package/lib/Neon/Providers.js.map +1 -1
- package/lib/Nuke.d.ts +89 -0
- package/lib/Nuke.d.ts.map +1 -0
- package/lib/Nuke.js +265 -0
- package/lib/Nuke.js.map +1 -0
- package/lib/Plan.d.ts +27 -5
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +167 -21
- package/lib/Plan.js.map +1 -1
- package/lib/Planetscale/AuthProvider.d.ts +25 -37
- package/lib/Planetscale/AuthProvider.d.ts.map +1 -1
- package/lib/Planetscale/AuthProvider.js +267 -150
- package/lib/Planetscale/AuthProvider.js.map +1 -1
- package/lib/Planetscale/Credentials.d.ts +2 -3
- package/lib/Planetscale/Credentials.d.ts.map +1 -1
- package/lib/Planetscale/Credentials.js +16 -13
- package/lib/Planetscale/Credentials.js.map +1 -1
- package/lib/Planetscale/OAuthClient.d.ts +8 -52
- package/lib/Planetscale/OAuthClient.d.ts.map +1 -1
- package/lib/Planetscale/OAuthClient.js +18 -240
- package/lib/Planetscale/OAuthClient.js.map +1 -1
- package/lib/Planetscale/Providers.d.ts +1 -1
- package/lib/Planetscale/Providers.d.ts.map +1 -1
- package/lib/Planetscale/Providers.js +2 -2
- package/lib/Planetscale/Providers.js.map +1 -1
- package/lib/Planetscale/Util.d.ts +1 -1
- package/lib/Planetscale/Util.d.ts.map +1 -1
- package/lib/Prisma/AuthProvider.d.ts +7 -15
- package/lib/Prisma/AuthProvider.d.ts.map +1 -1
- package/lib/Prisma/AuthProvider.js +54 -121
- package/lib/Prisma/AuthProvider.js.map +1 -1
- package/lib/Prisma/Compute.d.ts +7 -21
- package/lib/Prisma/Compute.d.ts.map +1 -1
- package/lib/Prisma/Compute.js +7 -21
- package/lib/Prisma/Compute.js.map +1 -1
- package/lib/Prisma/PrismaEnvironment.d.ts +1 -2
- package/lib/Prisma/PrismaEnvironment.d.ts.map +1 -1
- package/lib/Prisma/PrismaEnvironment.js +3 -8
- package/lib/Prisma/PrismaEnvironment.js.map +1 -1
- package/lib/Prisma/Providers.d.ts +3 -3
- package/lib/Prisma/Providers.d.ts.map +1 -1
- package/lib/Prisma/Providers.js +7 -7
- package/lib/Prisma/Providers.js.map +1 -1
- package/lib/Provider.d.ts +10 -2
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +9 -10
- package/lib/Provider.js.map +1 -1
- package/lib/Railway/AuditLog.d.ts +2 -2
- package/lib/Railway/AuditLog.d.ts.map +1 -1
- package/lib/Railway/AuthProvider.d.ts +19 -19
- package/lib/Railway/AuthProvider.d.ts.map +1 -1
- package/lib/Railway/AuthProvider.js +193 -127
- package/lib/Railway/AuthProvider.js.map +1 -1
- package/lib/Railway/Bucket.js +2 -2
- package/lib/Railway/CloudAgent.js +2 -2
- package/lib/Railway/Credentials.d.ts +2 -5
- package/lib/Railway/Credentials.d.ts.map +1 -1
- package/lib/Railway/Credentials.js +5 -11
- package/lib/Railway/Credentials.js.map +1 -1
- package/lib/Railway/CustomDomain.js +3 -3
- package/lib/Railway/Function.js +6 -6
- package/lib/Railway/Group.js +2 -2
- package/lib/Railway/LoginSession.d.ts +3 -3
- package/lib/Railway/LoginSession.js +5 -5
- package/lib/Railway/Mongo.js +13 -13
- package/lib/Railway/MySQL.js +13 -13
- package/lib/Railway/Postgres.js +13 -13
- package/lib/Railway/PrivateNetwork.js +2 -2
- package/lib/Railway/Project.d.ts +3 -3
- package/lib/Railway/Project.d.ts.map +1 -1
- package/lib/Railway/Project.js +3 -3
- package/lib/Railway/ProjectEnvironment.js +3 -3
- package/lib/Railway/Providers.d.ts +1 -1
- package/lib/Railway/Providers.d.ts.map +1 -1
- package/lib/Railway/Providers.js +2 -2
- package/lib/Railway/Providers.js.map +1 -1
- package/lib/Railway/Redis.js +5 -5
- package/lib/Railway/Sandbox.d.ts +6 -6
- package/lib/Railway/Sandbox.js +5 -5
- package/lib/Railway/Service.d.ts +72 -1
- package/lib/Railway/Service.d.ts.map +1 -1
- package/lib/Railway/Service.js +42 -0
- package/lib/Railway/Service.js.map +1 -1
- package/lib/Railway/ServiceDomain.d.ts +28 -2
- package/lib/Railway/ServiceDomain.d.ts.map +1 -1
- package/lib/Railway/ServiceDomain.js +134 -17
- package/lib/Railway/ServiceDomain.js.map +1 -1
- package/lib/Railway/ServiceProvider.d.ts +2 -10
- package/lib/Railway/ServiceProvider.d.ts.map +1 -1
- package/lib/Railway/ServiceProvider.js +170 -64
- package/lib/Railway/ServiceProvider.js.map +1 -1
- package/lib/Railway/TcpProxy.js +2 -2
- package/lib/Railway/Template.js +2 -2
- package/lib/Railway/Usage.js +2 -2
- package/lib/Railway/Variable.js +2 -2
- package/lib/Railway/Volume.d.ts +1 -1
- package/lib/Railway/Volume.d.ts.map +1 -1
- package/lib/Railway/Volume.js +4 -4
- package/lib/Railway/VolumeBackup.d.ts +2 -2
- package/lib/Railway/VolumeBackup.js +8 -8
- package/lib/Railway/local-context.d.ts +125 -0
- package/lib/Railway/local-context.d.ts.map +1 -0
- package/lib/Railway/local-context.js +254 -0
- package/lib/Railway/local-context.js.map +1 -0
- package/lib/Report.d.ts +248 -0
- package/lib/Report.d.ts.map +1 -0
- package/lib/Report.js +18 -0
- package/lib/Report.js.map +1 -0
- package/lib/Stack.d.ts +7 -6
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +2 -4
- package/lib/Stack.js.map +1 -1
- package/lib/State/Export.d.ts +6 -4
- package/lib/State/Export.d.ts.map +1 -1
- package/lib/State/Export.js +13 -18
- package/lib/State/Export.js.map +1 -1
- package/lib/State/HttpStateStore.d.ts +1 -1
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +10 -6
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +6 -13
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Tree.d.ts +62 -0
- package/lib/State/Tree.d.ts.map +1 -0
- package/lib/State/Tree.js +166 -0
- package/lib/State/Tree.js.map +1 -0
- package/lib/State/index.d.ts +1 -0
- package/lib/State/index.d.ts.map +1 -1
- package/lib/State/index.js +1 -0
- package/lib/State/index.js.map +1 -1
- package/lib/Telemetry/Layer.d.ts +6 -0
- package/lib/Telemetry/Layer.d.ts.map +1 -1
- package/lib/Telemetry/Layer.js +16 -5
- package/lib/Telemetry/Layer.js.map +1 -1
- package/lib/Telemetry.d.ts +5 -0
- package/lib/Telemetry.d.ts.map +1 -1
- package/lib/Telemetry.js +6 -1
- package/lib/Telemetry.js.map +1 -1
- package/lib/Test/Core.d.ts +4 -3
- package/lib/Test/Core.d.ts.map +1 -1
- package/lib/Test/Core.js +5 -3
- package/lib/Test/Core.js.map +1 -1
- package/lib/UserFacingError.d.ts +26 -0
- package/lib/UserFacingError.d.ts.map +1 -0
- package/lib/UserFacingError.js +25 -0
- package/lib/UserFacingError.js.map +1 -0
- package/lib/Util/AtomicFile.d.ts +19 -0
- package/lib/Util/AtomicFile.d.ts.map +1 -0
- package/lib/Util/AtomicFile.js +22 -0
- package/lib/Util/AtomicFile.js.map +1 -0
- package/lib/Util/ConsoleSink.d.ts +4 -0
- package/lib/Util/ConsoleSink.d.ts.map +1 -0
- package/lib/Util/ConsoleSink.js +24 -0
- package/lib/Util/ConsoleSink.js.map +1 -0
- package/lib/Util/LineBuffer.d.ts +9 -0
- package/lib/Util/LineBuffer.d.ts.map +1 -0
- package/lib/Util/LineBuffer.js +23 -0
- package/lib/Util/LineBuffer.js.map +1 -0
- package/lib/Util/Memoize.d.ts +20 -0
- package/lib/Util/Memoize.d.ts.map +1 -0
- package/lib/Util/Memoize.js +38 -0
- package/lib/Util/Memoize.js.map +1 -0
- package/lib/Util/Node.d.ts +22 -5
- package/lib/Util/Node.d.ts.map +1 -1
- package/lib/Util/Node.js +30 -10
- package/lib/Util/Node.js.map +1 -1
- package/lib/Util/PlatformServices.d.ts +6 -2
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +6 -2
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +30 -0
- package/lib/Util/ResourceOutput.d.ts.map +1 -0
- package/lib/Util/ResourceOutput.js +60 -0
- package/lib/Util/ResourceOutput.js.map +1 -0
- package/lib/Util/Terminal.d.ts +23 -0
- package/lib/Util/Terminal.d.ts.map +1 -0
- package/lib/Util/Terminal.js +57 -0
- package/lib/Util/Terminal.js.map +1 -0
- package/lib/Util/Theme.d.ts +123 -0
- package/lib/Util/Theme.d.ts.map +1 -0
- package/lib/Util/Theme.js +133 -0
- package/lib/Util/Theme.js.map +1 -0
- package/lib/Util/interactive.d.ts +17 -12
- package/lib/Util/interactive.d.ts.map +1 -1
- package/lib/Util/interactive.js +81 -13
- package/lib/Util/interactive.js.map +1 -1
- package/lib/Util/scc.d.ts +11 -3
- package/lib/Util/scc.d.ts.map +1 -1
- package/lib/Util/scc.js +35 -22
- package/lib/Util/scc.js.map +1 -1
- package/lib/Util/tarGzip.d.ts +3 -1
- package/lib/Util/tarGzip.d.ts.map +1 -1
- package/lib/Util/tarGzip.js +15 -5
- package/lib/Util/tarGzip.js.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/package.json +40 -38
- package/src/AWS/AGENTS.md +1 -1
- package/src/AWS/AMP/Scraper.ts +1 -1
- package/src/AWS/AppRunner/Service.ts +11 -27
- package/src/AWS/Assets.ts +2 -2
- package/src/AWS/AuthProvider.ts +748 -429
- package/src/AWS/Batch/JobDefinition.ts +11 -27
- package/src/AWS/EC2/Instance.ts +12 -28
- package/src/AWS/EC2/InternetGateway.ts +1 -1
- package/src/AWS/EC2/NatGateway.ts +1 -1
- package/src/AWS/EC2/NetworkInterface.ts +1 -1
- package/src/AWS/EC2/NetworkInterfaceAttachment.ts +1 -1
- package/src/AWS/EC2/RouteTable.ts +1 -1
- package/src/AWS/EC2/RouteTableAssociation.ts +1 -1
- package/src/AWS/EC2/Snapshot.ts +1 -1
- package/src/AWS/EC2/Subnet.ts +1 -1
- package/src/AWS/EC2/Volume.ts +1 -1
- package/src/AWS/EC2/VolumeAttachment.ts +1 -1
- package/src/AWS/EC2/Vpc.ts +1 -1
- package/src/AWS/EC2/VpcEndpoint.ts +1 -1
- package/src/AWS/EC2/hosted.ts +5 -6
- package/src/AWS/ECR/ImageSource.ts +4 -5
- package/src/AWS/ECS/Service.ts +7 -21
- package/src/AWS/ECS/Task.ts +7 -21
- package/src/AWS/ElastiCache/CacheCluster.ts +323 -0
- package/src/AWS/ElastiCache/ConnectCacheCluster.ts +58 -0
- package/src/AWS/ElastiCache/ConnectCacheClusterHttp.ts +77 -0
- package/src/AWS/ElastiCache/ConnectReplicationGroup.ts +62 -0
- package/src/AWS/ElastiCache/ConnectReplicationGroupHttp.ts +110 -0
- package/src/AWS/ElastiCache/ReplicationGroup.ts +594 -0
- package/src/AWS/ElastiCache/SubnetGroup.ts +208 -0
- package/src/AWS/ElastiCache/index.ts +7 -0
- package/src/AWS/ElastiCache/internal.ts +36 -0
- package/src/AWS/Environment.ts +15 -48
- package/src/AWS/IAM/actions.generated.ts +1 -1
- package/src/AWS/IdentityCenter/AccountAssignment.ts +7 -0
- package/src/AWS/Lambda/Function.ts +26 -28
- package/src/AWS/Lambda/MicrovmImage.ts +12 -28
- package/src/AWS/Lambda/MicrovmProvider.ts +1 -1
- package/src/AWS/Lambda/NetworkConnector.ts +1 -1
- package/src/AWS/Local/DevWatchProvider.ts +10 -1
- package/src/AWS/Organizations/Account.ts +18 -10
- package/src/AWS/Organizations/DelegatedAdministrator.ts +7 -7
- package/src/AWS/Organizations/Organization.ts +3 -5
- package/src/AWS/Organizations/common.ts +17 -0
- package/src/AWS/Providers.ts +12 -0
- package/src/AWS/S3/Bucket.ts +1 -1
- package/src/Alchemist/Errors.ts +36 -0
- package/src/Alchemist/Progress.ts +175 -0
- package/src/Alchemist/Runtime.ts +40 -0
- package/src/Alchemist/Session.ts +460 -0
- package/src/Alchemist/index.ts +24 -0
- package/src/Alchemist/routes/aws.ts +88 -0
- package/src/Alchemist/routes/cloudflare.ts +188 -0
- package/src/Alchemist/routes/cloudflareToken.ts +215 -0
- package/src/Alchemist/routes/drift.ts +94 -0
- package/src/Alchemist/routes/logs.ts +185 -0
- package/src/Alchemist/routes/nuke.ts +146 -0
- package/src/Alchemist/routes/profile.ts +427 -0
- package/src/Alchemist/routes/provider.ts +107 -0
- package/src/Alchemist/routes/stack.ts +137 -0
- package/src/Alchemist/routes/state.ts +77 -0
- package/src/Apply.ts +312 -173
- package/src/Auth/AuthProvider.ts +416 -158
- package/src/Auth/BrowserOAuth.ts +68 -0
- package/src/Auth/Credentials.ts +155 -46
- package/src/Auth/CredentialsCache.ts +57 -0
- package/src/Auth/Demand.ts +208 -83
- package/src/Auth/Env.ts +38 -14
- package/src/Auth/Inspect.ts +129 -0
- package/src/Auth/Lock.ts +26 -11
- package/src/Auth/OAuthFlow.ts +551 -0
- package/src/Auth/Paths.ts +30 -0
- package/src/Auth/Profile.ts +768 -164
- package/src/Auth/Resolve.ts +136 -0
- package/src/Auth/StoredAuthProvider.ts +291 -0
- package/src/Auth/index.ts +1 -0
- package/src/Axiom/AuthProvider.ts +112 -314
- package/src/Axiom/Credentials.ts +5 -13
- package/src/Axiom/Providers.ts +3 -3
- package/src/Bundle/Bundle.ts +3 -5
- package/src/Cli/CliKit/CliKit.ts +183 -0
- package/src/Cli/CliKit/index.ts +50 -0
- package/src/Cli/CliKit/interaction.ts +19 -0
- package/src/Cli/CliKit/layer.ts +50 -0
- package/src/Cli/DevOptions.ts +19 -0
- package/src/Cli/Format.ts +31 -0
- package/src/Cli/GlobalLog.ts +147 -0
- package/src/Cli/LoggingCli.ts +312 -108
- package/src/Cli/ModeTag.ts +1 -1
- package/src/Cli/NamespaceTree.ts +94 -21
- package/src/Cli/PlainCliFormatter.ts +75 -0
- package/src/Cli/PropertyDiff.ts +229 -0
- package/src/Cli/checkVersion.ts +19 -6
- package/src/Cli/commands/aws.ts +67 -100
- package/src/Cli/commands/cloudflare.ts +195 -435
- package/src/Cli/commands/compat.ts +25 -0
- package/src/Cli/commands/confirm.ts +46 -0
- package/src/Cli/commands/deploy.ts +225 -212
- package/src/Cli/commands/dev.ts +72 -34
- package/src/Cli/commands/drift.ts +107 -0
- package/src/Cli/commands/errors.ts +162 -0
- package/src/Cli/commands/flags.ts +199 -0
- package/src/Cli/commands/instrument.ts +18 -0
- package/src/Cli/commands/logs.ts +125 -143
- package/src/Cli/commands/nuke.ts +138 -811
- package/src/Cli/commands/profile/commands.ts +482 -0
- package/src/Cli/commands/profile/flows.ts +218 -0
- package/src/Cli/commands/profile/hub.ts +191 -0
- package/src/Cli/commands/profile/index.ts +1 -0
- package/src/Cli/commands/provider.ts +63 -0
- package/src/Cli/commands/render.ts +121 -0
- package/src/Cli/commands/state.ts +250 -387
- package/src/Cli/components/types.ts +141 -0
- package/src/Cli/components/ui/Data.tsx +44 -0
- package/src/Cli/components/ui/Environment.tsx +86 -0
- package/src/Cli/components/ui/Feedback.tsx +269 -0
- package/src/Cli/components/ui/Interactive.tsx +1062 -0
- package/src/Cli/components/ui/Layout.tsx +252 -0
- package/src/Cli/components/ui/Live.tsx +131 -0
- package/src/Cli/components/ui/ProgressBar.tsx +57 -0
- package/src/Cli/components/ui/Transcript.tsx +42 -0
- package/src/Cli/components/ui/Typography.tsx +83 -0
- package/src/Cli/components/ui/index.ts +68 -0
- package/src/Cli/components/view/ApprovePlan.tsx +101 -0
- package/src/Cli/components/view/Help.tsx +381 -0
- package/src/Cli/components/view/Logo.tsx +168 -0
- package/src/Cli/components/view/Nuke.tsx +258 -0
- package/src/Cli/components/view/PlanDecision.tsx +80 -0
- package/src/Cli/components/view/PlanRow.tsx +39 -0
- package/src/Cli/components/view/PlanTree.ts +354 -0
- package/src/Cli/components/view/PlanView.tsx +825 -0
- package/src/Cli/components/view/Profile.tsx +446 -0
- package/src/Cli/components/view/ProfileDashboard.tsx +929 -0
- package/src/Cli/components/view/Prompts.tsx +793 -0
- package/src/Cli/components/view/Runtime.tsx +975 -0
- package/src/Cli/components/view/SigilCli.tsx +186 -0
- package/src/Cli/components/view/StackOutputs.tsx +38 -0
- package/src/Cli/components/view/StateExplorer.tsx +1179 -0
- package/src/Cli/components/view/statusStyle.ts +97 -0
- package/src/Cli/components/view/usePlanPresentation.ts +82 -0
- package/src/Cli/components/view/usePlanViewport.ts +172 -0
- package/src/Cli/exec.ts +278 -32
- package/src/Cli/main.ts +189 -42
- package/src/Cli/selectCli.ts +30 -15
- package/src/Cloudflare/ApiToken/UserApiToken.ts +1 -1
- package/src/Cloudflare/Auth/AuthConfig.ts +117 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +712 -608
- package/src/Cloudflare/Auth/OAuthClient.ts +40 -366
- package/src/Cloudflare/Auth/OAuthScopes.ts +921 -0
- package/src/Cloudflare/Auth/TokenPolicy.ts +79 -0
- package/src/Cloudflare/CloudflareEnvironment.ts +7 -17
- package/src/Cloudflare/Containers/Container.ts +12 -24
- package/src/Cloudflare/Containers/ContainerApplication.ts +12 -27
- package/src/Cloudflare/Credentials.ts +18 -72
- package/src/Cloudflare/EdgeSession.ts +2 -3
- package/src/Cloudflare/Logs.ts +16 -10
- package/src/Cloudflare/Pages/Project.ts +1 -1
- package/src/Cloudflare/Providers.ts +2 -2
- package/src/Cloudflare/StateStore/Api.ts +2 -2
- package/src/Cloudflare/StateStore/CredentialsFile.ts +11 -6
- package/src/Cloudflare/StateStore/State.ts +247 -194
- package/src/Cloudflare/Vectorize/SearchIndexHttpClient.ts +2 -2
- package/src/Cloudflare/Website/Nextjs.ts +4 -15
- package/src/Cloudflare/Website/Vocs.ts +3 -7
- package/src/Cloudflare/Workers/Assets.ts +106 -38
- package/src/Cloudflare/Workers/BrowserHttpClient.ts +10 -3
- package/src/Cloudflare/Workers/CloudflareTracer.ts +113 -0
- package/src/Cloudflare/Workers/Compatibility.ts +37 -7
- package/src/Cloudflare/Workers/DurableObject.ts +50 -4
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +8 -0
- package/src/Cloudflare/Workers/DurableObjectState.ts +46 -9
- package/src/Cloudflare/Workers/DurableObjectStorage.ts +25 -12
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +172 -58
- package/src/Cloudflare/Workers/RpcWorker.ts +44 -18
- package/src/Cloudflare/Workers/Source.ts +9 -1
- package/src/Cloudflare/Workers/Sources/Python.ts +18 -12
- package/src/Cloudflare/Workers/Sources/Rolldown.ts +1 -1
- package/src/Cloudflare/Workers/Sources/Vite.ts +42 -34
- package/src/Cloudflare/Workers/Telemetry.ts +170 -0
- package/src/Cloudflare/Workers/ViteBuildChildRunner.ts +6 -1
- package/src/Cloudflare/Workers/ViteChild.shared.ts +1 -0
- package/src/Cloudflare/Workers/ViteChild.ts +21 -19
- package/src/Cloudflare/Workers/ViteChildRunner.ts +2 -1
- package/src/Cloudflare/Workers/Worker.ts +101 -50
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +29 -0
- package/src/Cloudflare/Workers/WorkerLoader.ts +40 -8
- package/src/Cloudflare/Workers/WorkerProvider.ts +64 -29
- package/src/Cloudflare/Workers/cloudflare_workers.ts +5 -1
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Cloudflare/Workflows/Workflow.ts +105 -0
- package/src/Cloudflare/Workflows/WorkflowBridge.ts +5 -3
- package/src/Command/Command.ts +11 -3
- package/src/Command/Dev.ts +33 -8
- package/src/Docker/BuildHash.ts +75 -8
- package/src/Docker/Docker.ts +7 -2
- package/src/Docker/Service.ts +7 -21
- package/src/Docker/ServiceImage.ts +4 -5
- package/src/{Sync.ts → Drift.ts} +161 -59
- package/src/Drizzle/Schema.ts +5 -7
- package/src/Fly/AuthProvider.ts +44 -232
- package/src/Fly/CheckpointHttp.ts +5 -2
- package/src/Fly/Credentials.ts +29 -16
- package/src/Fly/DecryptHttp.ts +5 -2
- package/src/Fly/EncryptHttp.ts +5 -2
- package/src/Fly/ExecHttp.ts +5 -2
- package/src/Fly/GetSecretHttp.ts +5 -2
- package/src/Fly/ListSecretsHttp.ts +5 -2
- package/src/Fly/Machine.ts +67 -20
- package/src/Fly/Providers.ts +2 -2
- package/src/Fly/Service.ts +44 -20
- package/src/Fly/SignHttp.ts +5 -2
- package/src/Fly/VerifyHttp.ts +5 -2
- package/src/Fly/WriteSecretHttp.ts +5 -2
- package/src/Fly/replicas.ts +47 -1
- package/src/GitHub/AuthProvider.ts +225 -143
- package/src/GitHub/Credentials.ts +6 -13
- package/src/GitHub/Providers.ts +4 -4
- package/src/Hetzner/AuthProvider.ts +50 -238
- package/src/Hetzner/Credentials.ts +4 -12
- package/src/Hetzner/Providers.ts +2 -2
- package/src/Interaction.ts +354 -0
- package/src/Kubernetes/ClusterAdapter.ts +4 -5
- package/src/Kubernetes/Deployment.ts +7 -21
- package/src/Kubernetes/Job.ts +7 -21
- package/src/Local/DevLog.ts +135 -0
- package/src/Local/LocalProvider.ts +3 -3
- package/src/Local/RpcServer.ts +11 -0
- package/src/Local/RpcServerEnvironment.ts +3 -2
- package/src/Local/RpcSpawner.ts +161 -78
- package/src/Neon/AuthProvider.ts +31 -203
- package/src/Neon/Credentials.ts +4 -12
- package/src/Neon/Providers.ts +2 -2
- package/src/Nuke.ts +463 -0
- package/src/Plan.ts +920 -708
- package/src/Planetscale/AuthProvider.ts +397 -324
- package/src/Planetscale/Credentials.ts +21 -19
- package/src/Planetscale/OAuthClient.ts +34 -328
- package/src/Planetscale/Providers.ts +2 -2
- package/src/Planetscale/Util.ts +1 -1
- package/src/Prisma/AuthProvider.ts +62 -240
- package/src/Prisma/Compute.ts +7 -21
- package/src/Prisma/PrismaEnvironment.ts +6 -14
- package/src/Prisma/Providers.ts +7 -7
- package/src/Provider.ts +12 -13
- package/src/Railway/AuthProvider.ts +291 -235
- package/src/Railway/Bucket.ts +6 -6
- package/src/Railway/CloudAgent.ts +4 -4
- package/src/Railway/Credentials.ts +5 -14
- package/src/Railway/CustomDomain.ts +5 -5
- package/src/Railway/Function.ts +10 -10
- package/src/Railway/Group.ts +2 -2
- package/src/Railway/LoginSession.ts +5 -5
- package/src/Railway/Mongo.ts +19 -19
- package/src/Railway/MySQL.ts +19 -19
- package/src/Railway/Postgres.ts +19 -19
- package/src/Railway/PrivateNetwork.ts +2 -2
- package/src/Railway/Project.ts +7 -7
- package/src/Railway/ProjectEnvironment.ts +7 -7
- package/src/Railway/Providers.ts +2 -2
- package/src/Railway/Redis.ts +9 -9
- package/src/Railway/Sandbox.ts +10 -10
- package/src/Railway/Service.ts +72 -1
- package/src/Railway/ServiceDomain.ts +253 -27
- package/src/Railway/ServiceProvider.ts +234 -87
- package/src/Railway/TcpProxy.ts +4 -4
- package/src/Railway/Template.ts +12 -12
- package/src/Railway/Usage.ts +2 -2
- package/src/Railway/Variable.ts +2 -2
- package/src/Railway/Volume.ts +4 -4
- package/src/Railway/VolumeBackup.ts +11 -11
- package/src/Railway/local-context.ts +333 -0
- package/src/Report.ts +365 -0
- package/src/Stack.ts +12 -8
- package/src/State/Export.ts +28 -47
- package/src/State/HttpStateStore.ts +15 -8
- package/src/State/LocalState.ts +6 -16
- package/src/State/Tree.ts +277 -0
- package/src/State/index.ts +1 -0
- package/src/Telemetry/Layer.ts +16 -5
- package/src/Telemetry.ts +6 -1
- package/src/Test/Core.ts +10 -4
- package/src/UserFacingError.ts +35 -0
- package/src/Util/AtomicFile.ts +36 -0
- package/src/Util/ConsoleSink.ts +23 -0
- package/src/Util/LineBuffer.ts +20 -0
- package/src/Util/Memoize.ts +48 -0
- package/src/Util/Node.ts +35 -14
- package/src/Util/PlatformServices.ts +11 -1
- package/src/Util/ResourceOutput.ts +77 -0
- package/src/Util/Terminal.ts +81 -0
- package/src/Util/Theme.ts +150 -0
- package/src/Util/interactive.ts +103 -16
- package/src/Util/scc.ts +43 -23
- package/src/Util/tarGzip.ts +33 -5
- package/src/index.ts +4 -2
- package/lib/Cli/Cli.d.ts +0 -21
- package/lib/Cli/Cli.d.ts.map +0 -1
- package/lib/Cli/Cli.js +0 -5
- package/lib/Cli/Cli.js.map +0 -1
- package/lib/Cli/Event.d.ts +0 -29
- package/lib/Cli/Event.d.ts.map +0 -1
- package/lib/Cli/Event.js +0 -1
- package/lib/Cli/Event.js.map +0 -1
- package/lib/Cli/commands/_shared.d.ts +0 -138
- package/lib/Cli/commands/_shared.d.ts.map +0 -1
- package/lib/Cli/commands/_shared.js +0 -298
- package/lib/Cli/commands/_shared.js.map +0 -1
- package/lib/Cli/commands/login.d.ts +0 -14
- package/lib/Cli/commands/login.d.ts.map +0 -1
- package/lib/Cli/commands/login.js +0 -115
- package/lib/Cli/commands/login.js.map +0 -1
- package/lib/Cli/commands/profile.d.ts +0 -25
- package/lib/Cli/commands/profile.d.ts.map +0 -1
- package/lib/Cli/commands/profile.js +0 -83
- package/lib/Cli/commands/profile.js.map +0 -1
- package/lib/Cli/commands/sync.d.ts +0 -22
- package/lib/Cli/commands/sync.d.ts.map +0 -1
- package/lib/Cli/commands/sync.js +0 -64
- package/lib/Cli/commands/sync.js.map +0 -1
- package/lib/Cli/commands/tail.d.ts +0 -9
- package/lib/Cli/commands/tail.d.ts.map +0 -1
- package/lib/Cli/commands/tail.js +0 -97
- package/lib/Cli/commands/tail.js.map +0 -1
- package/lib/Cli/tui/InkCLI.d.ts +0 -4
- package/lib/Cli/tui/InkCLI.d.ts.map +0 -1
- package/lib/Cli/tui/InkCLI.js +0 -53
- package/lib/Cli/tui/InkCLI.js.map +0 -1
- package/lib/Cli/tui/components/ApprovePlan.d.ts +0 -9
- package/lib/Cli/tui/components/ApprovePlan.d.ts.map +0 -1
- package/lib/Cli/tui/components/ApprovePlan.js +0 -21
- package/lib/Cli/tui/components/ApprovePlan.js.map +0 -1
- package/lib/Cli/tui/components/Nuke.d.ts +0 -36
- package/lib/Cli/tui/components/Nuke.d.ts.map +0 -1
- package/lib/Cli/tui/components/Nuke.js +0 -132
- package/lib/Cli/tui/components/Nuke.js.map +0 -1
- package/lib/Cli/tui/components/Plan.d.ts +0 -8
- package/lib/Cli/tui/components/Plan.d.ts.map +0 -1
- package/lib/Cli/tui/components/Plan.js +0 -87
- package/lib/Cli/tui/components/Plan.js.map +0 -1
- package/lib/Cli/tui/components/PlanProgress.d.ts +0 -55
- package/lib/Cli/tui/components/PlanProgress.d.ts.map +0 -1
- package/lib/Cli/tui/components/PlanProgress.js +0 -292
- package/lib/Cli/tui/components/PlanProgress.js.map +0 -1
- package/lib/Sync.d.ts +0 -109
- package/lib/Sync.d.ts.map +0 -1
- package/lib/Sync.js.map +0 -1
- package/lib/Util/Clank.d.ts +0 -45
- package/lib/Util/Clank.d.ts.map +0 -1
- package/lib/Util/Clank.js +0 -79
- package/lib/Util/Clank.js.map +0 -1
- package/src/Cli/Cli.ts +0 -23
- package/src/Cli/Event.ts +0 -51
- package/src/Cli/commands/_shared.ts +0 -498
- package/src/Cli/commands/login.ts +0 -169
- package/src/Cli/commands/profile.ts +0 -132
- package/src/Cli/commands/sync.ts +0 -123
- package/src/Cli/commands/tail.ts +0 -155
- package/src/Cli/tui/InkCLI.tsx +0 -69
- package/src/Cli/tui/components/ApprovePlan.tsx +0 -44
- package/src/Cli/tui/components/Nuke.tsx +0 -273
- package/src/Cli/tui/components/Plan.tsx +0 -211
- package/src/Cli/tui/components/PlanProgress.tsx +0 -455
- package/src/Util/Clank.ts +0 -103
|
@@ -1,93 +1,84 @@
|
|
|
1
1
|
import * as cfAccounts from "@distilled.cloud/cloudflare/accounts";
|
|
2
|
+
import * as cfMemberships from "@distilled.cloud/cloudflare/memberships";
|
|
2
3
|
import * as CfCredentialsModule from "@distilled.cloud/cloudflare/Credentials";
|
|
3
|
-
import * as
|
|
4
|
+
import * as Clock from "effect/Clock";
|
|
4
5
|
import * as Duration from "effect/Duration";
|
|
5
6
|
import * as Effect from "effect/Effect";
|
|
6
7
|
import * as Layer from "effect/Layer";
|
|
7
8
|
import * as Match from "effect/Match";
|
|
8
9
|
import * as Redacted from "effect/Redacted";
|
|
10
|
+
import * as Schema from "effect/Schema";
|
|
9
11
|
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient";
|
|
10
12
|
import * as HttpClient from "effect/unstable/http/HttpClient";
|
|
11
13
|
import {
|
|
12
14
|
AuthError,
|
|
13
15
|
AuthProviderLayer,
|
|
14
|
-
|
|
16
|
+
NeedsReauth,
|
|
17
|
+
reconfigureHint,
|
|
18
|
+
refreshHint,
|
|
19
|
+
type ConfigureField,
|
|
20
|
+
type ConfigureMethod,
|
|
21
|
+
type ProviderDetails,
|
|
15
22
|
} from "../../Auth/AuthProvider.ts";
|
|
23
|
+
import {
|
|
24
|
+
storedSecret,
|
|
25
|
+
storedValueText,
|
|
26
|
+
validateFieldValues,
|
|
27
|
+
} from "../../Auth/StoredAuthProvider.ts";
|
|
16
28
|
import { CredentialsStore, displayRedacted } from "../../Auth/Credentials.ts";
|
|
29
|
+
import { withProfileCredentialsLock } from "../../Auth/Lock.ts";
|
|
17
30
|
import {
|
|
18
|
-
getEnv,
|
|
19
31
|
getEnvRedacted,
|
|
20
32
|
getEnvRequired,
|
|
21
|
-
|
|
33
|
+
mapPromptCancellation,
|
|
22
34
|
} from "../../Auth/Env.ts";
|
|
23
|
-
import
|
|
35
|
+
import { browserOAuth } from "../../Auth/BrowserOAuth.ts";
|
|
36
|
+
import * as Interaction from "../../Interaction.ts";
|
|
24
37
|
import { CREDENTIALS_FILE as STATE_STORE_CREDENTIALS_FILE } from "../StateStore/CredentialsFile.ts";
|
|
25
38
|
import * as OAuthClient from "./OAuthClient.ts";
|
|
39
|
+
import {
|
|
40
|
+
CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
41
|
+
CloudflareAuthConfigSchema,
|
|
42
|
+
validateAccountId,
|
|
43
|
+
validateAccountIdField,
|
|
44
|
+
type CloudflareAuthConfig,
|
|
45
|
+
type CloudflareResolvedCredentials,
|
|
46
|
+
} from "./AuthConfig.ts";
|
|
47
|
+
import {
|
|
48
|
+
ALL_SCOPE_IDS,
|
|
49
|
+
BASIC_SCOPES,
|
|
50
|
+
customOAuthScopeDefaults,
|
|
51
|
+
OAUTH_SCOPE_GROUPS,
|
|
52
|
+
OAUTH_SCOPE_NAMES,
|
|
53
|
+
partitionOAuthScopes,
|
|
54
|
+
} from "./OAuthScopes.ts";
|
|
26
55
|
|
|
27
56
|
const options: Array<{
|
|
28
57
|
value: CloudflareAuthConfig["method"];
|
|
29
58
|
label: string;
|
|
30
|
-
|
|
59
|
+
description?: string;
|
|
31
60
|
}> = [
|
|
32
61
|
{
|
|
33
62
|
value: "oauth",
|
|
34
63
|
label: "OAuth",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{
|
|
38
|
-
value: "env",
|
|
39
|
-
label: "Environment Variables",
|
|
40
|
-
hint: "CLOUDFLARE_API_TOKEN or CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL",
|
|
64
|
+
description:
|
|
65
|
+
"recommended — browser-based login with automatic token refresh",
|
|
41
66
|
},
|
|
42
67
|
{
|
|
43
68
|
value: "stored",
|
|
44
69
|
label: "API Token or API Key",
|
|
45
|
-
|
|
70
|
+
description: "use an API token or global API key",
|
|
46
71
|
},
|
|
47
72
|
];
|
|
48
73
|
|
|
49
|
-
|
|
50
|
-
| { method: "env" }
|
|
51
|
-
| { method: "stored"; credentialType: "apiToken" }
|
|
52
|
-
| { method: "stored"; credentialType: "apiKey" }
|
|
53
|
-
| { method: "oauth"; scopes: string[]; accountId: string };
|
|
54
|
-
|
|
55
|
-
export type CloudflareStoredCredentials =
|
|
56
|
-
| { type: "apiToken"; apiToken: string; accountId: string }
|
|
57
|
-
| { type: "apiKey"; apiKey: string; email: string; accountId: string };
|
|
58
|
-
|
|
59
|
-
export type CloudflareResolvedCredentials =
|
|
60
|
-
| {
|
|
61
|
-
type: "apiToken";
|
|
62
|
-
apiToken: Redacted.Redacted<string>;
|
|
63
|
-
accountId: string;
|
|
64
|
-
source: { type: CloudflareAuthConfig["method"]; details?: string };
|
|
65
|
-
}
|
|
66
|
-
| {
|
|
67
|
-
type: "apiKey";
|
|
68
|
-
apiKey: Redacted.Redacted<string>;
|
|
69
|
-
email: Redacted.Redacted<string>;
|
|
70
|
-
accountId: string;
|
|
71
|
-
source: { type: CloudflareAuthConfig["method"]; details?: string };
|
|
72
|
-
}
|
|
73
|
-
| {
|
|
74
|
-
type: "oauth";
|
|
75
|
-
accessToken: Redacted.Redacted<string>;
|
|
76
|
-
expires: number;
|
|
77
|
-
accountId: string;
|
|
78
|
-
source: { type: CloudflareAuthConfig["method"]; details?: string };
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
export const CLOUDFLARE_AUTH_PROVIDER_NAME = "Cloudflare";
|
|
82
|
-
|
|
83
|
-
const withOAuthCredentials = <A, E>(
|
|
74
|
+
const withOAuthCredentials = <A, E, R>(
|
|
84
75
|
accessToken: string,
|
|
85
76
|
effect: Effect.Effect<
|
|
86
77
|
A,
|
|
87
78
|
E,
|
|
88
|
-
CfCredentialsModule.Credentials | HttpClient.HttpClient
|
|
79
|
+
R | CfCredentialsModule.Credentials | HttpClient.HttpClient
|
|
89
80
|
>,
|
|
90
|
-
): Effect.Effect<A, E> =>
|
|
81
|
+
): Effect.Effect<A, E, R> =>
|
|
91
82
|
Effect.provide(
|
|
92
83
|
effect,
|
|
93
84
|
Layer.mergeAll(
|
|
@@ -100,113 +91,168 @@ const withOAuthCredentials = <A, E>(
|
|
|
100
91
|
),
|
|
101
92
|
);
|
|
102
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Accounts visible to a user-scoped OAuth token. `GET /accounts` returns an
|
|
96
|
+
* EMPTY list for these tokens (it only lists accounts an account-scoped
|
|
97
|
+
* credential can read), so memberships are the authoritative account list —
|
|
98
|
+
* the same endpoint wrangler uses. `GET /accounts` remains as a fallback for
|
|
99
|
+
* tokens authorized without `memberships.read` (custom scope selections).
|
|
100
|
+
*/
|
|
101
|
+
const listVisibleAccounts: Effect.Effect<
|
|
102
|
+
ReadonlyArray<{ id: string; name: string }>,
|
|
103
|
+
unknown,
|
|
104
|
+
CfCredentialsModule.Credentials | HttpClient.HttpClient
|
|
105
|
+
> = Effect.gen(function* () {
|
|
106
|
+
const listMemberships = yield* cfMemberships.listMemberships;
|
|
107
|
+
const membershipAccounts = yield* listMemberships({}).pipe(
|
|
108
|
+
Effect.map((response) =>
|
|
109
|
+
response.result.flatMap((membership) =>
|
|
110
|
+
membership.account != null &&
|
|
111
|
+
(membership.status == null || membership.status === "accepted")
|
|
112
|
+
? [membership.account]
|
|
113
|
+
: [],
|
|
114
|
+
),
|
|
115
|
+
),
|
|
116
|
+
Effect.catch((error) =>
|
|
117
|
+
Effect.logDebug("Cloudflare: listing memberships failed", error).pipe(
|
|
118
|
+
Effect.as([] as Array<{ id: string; name: string }>),
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
);
|
|
122
|
+
if (membershipAccounts.length > 0) return membershipAccounts;
|
|
123
|
+
const listAccounts = yield* cfAccounts.listAccounts;
|
|
124
|
+
const response = yield* listAccounts({});
|
|
125
|
+
yield* Effect.logDebug(
|
|
126
|
+
`Cloudflare: memberships listed 0 accounts; /accounts listed ${response.result.length}`,
|
|
127
|
+
);
|
|
128
|
+
return response.result;
|
|
129
|
+
});
|
|
130
|
+
|
|
103
131
|
const selectAccount = (accessToken: string) =>
|
|
104
132
|
Effect.gen(function* () {
|
|
105
|
-
const
|
|
106
|
-
const
|
|
107
|
-
const accounts = response.result;
|
|
133
|
+
const interaction = Interaction.accessors;
|
|
134
|
+
const accounts = yield* listVisibleAccounts;
|
|
108
135
|
if (accounts.length === 0) {
|
|
109
136
|
return yield* new AuthError({
|
|
110
|
-
message:
|
|
137
|
+
message:
|
|
138
|
+
"No Cloudflare accounts are visible to this credential. " +
|
|
139
|
+
"Ensure the authorized OAuth scopes include 'memberships.read'.",
|
|
111
140
|
});
|
|
112
141
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
yield*
|
|
116
|
-
`Cloudflare
|
|
142
|
+
const [account] = accounts;
|
|
143
|
+
if (accounts.length === 1 && account !== undefined) {
|
|
144
|
+
yield* interaction.output.info(
|
|
145
|
+
`Using Cloudflare account ${account.name}.`,
|
|
117
146
|
);
|
|
118
147
|
return account.id;
|
|
119
148
|
}
|
|
120
|
-
return yield*
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
149
|
+
return yield* interaction.prompt
|
|
150
|
+
.select({
|
|
151
|
+
message: "Select a Cloudflare account",
|
|
152
|
+
searchable: true,
|
|
153
|
+
options: accounts.map((a) => ({
|
|
154
|
+
value: a.id,
|
|
155
|
+
label: a.name,
|
|
156
|
+
description: a.id,
|
|
157
|
+
})),
|
|
158
|
+
})
|
|
159
|
+
.pipe(mapPromptCancellation);
|
|
128
160
|
}).pipe((e) => withOAuthCredentials(accessToken, e));
|
|
129
161
|
|
|
162
|
+
const promptAccountId = () =>
|
|
163
|
+
Effect.gen(function* () {
|
|
164
|
+
const interaction = yield* Interaction.Interaction;
|
|
165
|
+
return yield* interaction.prompt
|
|
166
|
+
.text({
|
|
167
|
+
message: "Cloudflare Account ID",
|
|
168
|
+
validate: validateAccountIdField,
|
|
169
|
+
})
|
|
170
|
+
.pipe(mapPromptCancellation);
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
const accountIdField: ConfigureField = {
|
|
174
|
+
name: "accountId",
|
|
175
|
+
label: "Cloudflare Account ID",
|
|
176
|
+
validate: validateAccountIdField,
|
|
177
|
+
};
|
|
178
|
+
|
|
130
179
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* /accounts/<value>/...` errors, so reject them up front with an
|
|
135
|
-
* actionable message instead.
|
|
180
|
+
* `--set` fields for `--method stored`. The persisted `credentialType` is
|
|
181
|
+
* inferred from which secret is supplied: `apiToken` alone, or `apiKey`
|
|
182
|
+
* together with `email`.
|
|
136
183
|
*/
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
"Set CLOUDFLARE_ACCOUNT_ID or re-run 'alchemy login' and provide your account ID " +
|
|
150
|
-
"(found in the Cloudflare dashboard under Workers & Pages → Account details).",
|
|
151
|
-
}),
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
if (!ACCOUNT_ID_PATTERN.test(trimmed)) {
|
|
155
|
-
return Effect.fail(
|
|
156
|
-
new AuthError({
|
|
157
|
-
message:
|
|
158
|
-
`'${trimmed}' is not a valid Cloudflare account ID (${source}) — expected 32 hex characters. ` +
|
|
159
|
-
"Copy the account ID from the Cloudflare dashboard (Workers & Pages → Account details) " +
|
|
160
|
-
"into CLOUDFLARE_ACCOUNT_ID or re-run 'alchemy login'.",
|
|
161
|
-
}),
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
return Effect.succeed(trimmed.toLowerCase());
|
|
165
|
-
};
|
|
184
|
+
const storedFields: ReadonlyArray<ConfigureField> = [
|
|
185
|
+
{
|
|
186
|
+
name: "apiToken",
|
|
187
|
+
label: "Cloudflare API Token",
|
|
188
|
+
description: "Pass either apiToken, or apiKey together with email.",
|
|
189
|
+
secret: true,
|
|
190
|
+
optional: true,
|
|
191
|
+
},
|
|
192
|
+
{ name: "apiKey", label: "Cloudflare API Key", secret: true, optional: true },
|
|
193
|
+
{ name: "email", label: "Cloudflare Email", optional: true },
|
|
194
|
+
accountIdField,
|
|
195
|
+
];
|
|
166
196
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
validate: (v) =>
|
|
175
|
-
v.trim().length === 0 || ACCOUNT_ID_PATTERN.test(v.trim())
|
|
176
|
-
? undefined
|
|
177
|
-
: "Expected a 32-character hex account ID (Workers & Pages → Account details)",
|
|
178
|
-
}).pipe(retryOnce),
|
|
179
|
-
),
|
|
180
|
-
);
|
|
197
|
+
/**
|
|
198
|
+
* Flag-driven configuration methods. OAuth is deliberately absent — it is
|
|
199
|
+
* interactive-only (browser grant).
|
|
200
|
+
*/
|
|
201
|
+
const configureMethods: ReadonlyArray<ConfigureMethod> = [
|
|
202
|
+
{ method: "stored", fields: storedFields },
|
|
203
|
+
];
|
|
181
204
|
|
|
182
|
-
const promptOAuthScopes = () =>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
205
|
+
const promptOAuthScopes = (currentConfig?: CloudflareAuthConfig) =>
|
|
206
|
+
Effect.gen(function* () {
|
|
207
|
+
const interaction = yield* Interaction.Interaction;
|
|
208
|
+
const mode = yield* interaction.prompt
|
|
209
|
+
.select({
|
|
210
|
+
message: "Cloudflare OAuth scopes",
|
|
211
|
+
initialValue: "all" as const,
|
|
212
|
+
options: [
|
|
213
|
+
{
|
|
214
|
+
value: "all" as const,
|
|
215
|
+
label: "All Scopes",
|
|
216
|
+
description: "authorize every available Cloudflare permission",
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
value: "basic" as const,
|
|
220
|
+
label: "Basic Scopes",
|
|
221
|
+
description: "covers typical Alchemy use cases",
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
value: "custom" as const,
|
|
225
|
+
label: "Custom Scopes",
|
|
226
|
+
description: "choose individual permissions",
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
})
|
|
230
|
+
.pipe(mapPromptCancellation);
|
|
231
|
+
if (mode === "basic") return [...BASIC_SCOPES];
|
|
232
|
+
if (mode === "all") return [...ALL_SCOPE_IDS];
|
|
233
|
+
return yield* interaction.prompt
|
|
234
|
+
.multiSelect({
|
|
191
235
|
message: "Select OAuth scopes",
|
|
192
|
-
initialValues:
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
236
|
+
initialValues: customOAuthScopeDefaults(currentConfig),
|
|
237
|
+
searchable: true,
|
|
238
|
+
descriptionPlacement: "inline",
|
|
239
|
+
options: OAUTH_SCOPE_GROUPS.flatMap((group) =>
|
|
240
|
+
group.scopes.map((value) => ({
|
|
241
|
+
value,
|
|
242
|
+
label: OAUTH_SCOPE_NAMES[value],
|
|
243
|
+
description: value,
|
|
244
|
+
group: group.label,
|
|
245
|
+
})),
|
|
246
|
+
),
|
|
198
247
|
required: true,
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
);
|
|
203
|
-
}),
|
|
204
|
-
);
|
|
248
|
+
})
|
|
249
|
+
.pipe(mapPromptCancellation);
|
|
250
|
+
});
|
|
205
251
|
|
|
206
252
|
/**
|
|
207
253
|
* Layer that registers the Cloudflare {@link AuthProvider} into the
|
|
208
254
|
* {@link AuthProviders} registry when built. Include this in the Cloudflare
|
|
209
|
-
* `providers()` layer so
|
|
255
|
+
* `providers()` layer so the alchemy CLI can discover it.
|
|
210
256
|
*/
|
|
211
257
|
export const CloudflareAuth = AuthProviderLayer<
|
|
212
258
|
CloudflareAuthConfig,
|
|
@@ -214,103 +260,88 @@ export const CloudflareAuth = AuthProviderLayer<
|
|
|
214
260
|
>()(
|
|
215
261
|
CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
216
262
|
Effect.gen(function* () {
|
|
263
|
+
const interaction = Interaction.accessors;
|
|
217
264
|
const store = yield* CredentialsStore;
|
|
218
265
|
|
|
219
|
-
const oauthLogin = (
|
|
266
|
+
const oauthLogin = (_profileName: string, scopes: string[]) =>
|
|
220
267
|
Effect.gen(function* () {
|
|
221
|
-
const authorization = OAuthClient.authorize([
|
|
268
|
+
const authorization = yield* OAuthClient.authorize([
|
|
222
269
|
...scopes,
|
|
223
270
|
"offline_access",
|
|
224
271
|
]);
|
|
225
272
|
|
|
226
|
-
yield*
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
yield* Clank.info(
|
|
236
|
-
"Cloudflare: waiting for authorization (up to 5 minutes).",
|
|
237
|
-
);
|
|
238
|
-
|
|
239
|
-
const credentials = yield* Effect.raceFirst(
|
|
240
|
-
OAuthClient.callback(authorization),
|
|
241
|
-
Clank.text({
|
|
242
|
-
message: "Paste the authorization code or callback URL",
|
|
243
|
-
placeholder:
|
|
244
|
-
"The browser will complete this automatically when local",
|
|
245
|
-
validate: (value) =>
|
|
246
|
-
value.trim().length > 0 ? undefined : "Paste a code or URL",
|
|
247
|
-
}).pipe(
|
|
248
|
-
Effect.flatMap((input) =>
|
|
249
|
-
OAuthClient.exchangeCallbackInput(input, authorization),
|
|
250
|
-
),
|
|
251
|
-
),
|
|
273
|
+
const credentials = yield* browserOAuth({
|
|
274
|
+
provider: "Cloudflare",
|
|
275
|
+
url: authorization.url,
|
|
276
|
+
callback: OAuthClient.callback(authorization),
|
|
277
|
+
exchange: (input) =>
|
|
278
|
+
OAuthClient.exchangeCallbackInput(input, authorization),
|
|
279
|
+
});
|
|
280
|
+
yield* interaction.output.success(
|
|
281
|
+
"Connected to Cloudflare with OAuth.",
|
|
252
282
|
);
|
|
253
|
-
yield* store.write(profileName, "cf-oauth", credentials);
|
|
254
|
-
yield* Clank.success("Cloudflare: OAuth credentials saved.");
|
|
255
283
|
return credentials;
|
|
256
284
|
});
|
|
257
285
|
|
|
258
286
|
const loginStored = Effect.fn(function* (profileName: string) {
|
|
259
|
-
const credentialType = yield*
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
287
|
+
const credentialType = yield* interaction.prompt
|
|
288
|
+
.select({
|
|
289
|
+
message: "Cloudflare credential type",
|
|
290
|
+
options: [
|
|
291
|
+
{
|
|
292
|
+
value: "apiToken" as const,
|
|
293
|
+
label: "API Token",
|
|
294
|
+
description: "recommended",
|
|
295
|
+
},
|
|
296
|
+
{ value: "apiKey" as const, label: "API Key + Email" },
|
|
297
|
+
],
|
|
298
|
+
})
|
|
299
|
+
.pipe(mapPromptCancellation);
|
|
270
300
|
|
|
271
301
|
return yield* Match.value(credentialType).pipe(
|
|
272
302
|
Match.when("apiToken", () =>
|
|
273
303
|
Effect.gen(function* () {
|
|
274
|
-
const apiToken = yield*
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
304
|
+
const apiToken = yield* interaction.prompt
|
|
305
|
+
.password({
|
|
306
|
+
message: "Cloudflare API Token",
|
|
307
|
+
validate: (v) => (v.length === 0 ? "Required" : undefined),
|
|
308
|
+
})
|
|
309
|
+
.pipe(mapPromptCancellation, Effect.map(Redacted.make));
|
|
278
310
|
const accountId = yield* promptAccountId();
|
|
279
311
|
|
|
280
|
-
yield*
|
|
281
|
-
profileName,
|
|
282
|
-
"cf-stored",
|
|
283
|
-
{ type: "apiToken", apiToken, accountId },
|
|
284
|
-
);
|
|
285
|
-
yield* Clank.success("Cloudflare: credentials saved.");
|
|
312
|
+
yield* interaction.output.success("Cloudflare: credentials saved.");
|
|
286
313
|
return {
|
|
287
314
|
method: "stored" as const,
|
|
288
315
|
credentialType: "apiToken" as const,
|
|
316
|
+
apiToken: Redacted.value(apiToken),
|
|
317
|
+
accountId,
|
|
289
318
|
};
|
|
290
319
|
}),
|
|
291
320
|
),
|
|
292
321
|
Match.when("apiKey", () =>
|
|
293
322
|
Effect.gen(function* () {
|
|
294
|
-
const apiKey = yield*
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
323
|
+
const apiKey = yield* interaction.prompt
|
|
324
|
+
.password({
|
|
325
|
+
message: "Cloudflare API Key",
|
|
326
|
+
validate: (v) => (v.length === 0 ? "Required" : undefined),
|
|
327
|
+
})
|
|
328
|
+
.pipe(mapPromptCancellation, Effect.map(Redacted.make));
|
|
329
|
+
|
|
330
|
+
const email = yield* interaction.prompt
|
|
331
|
+
.text({
|
|
332
|
+
message: "Cloudflare Email",
|
|
333
|
+
validate: (v) => (v.length === 0 ? "Required" : undefined),
|
|
334
|
+
})
|
|
335
|
+
.pipe(mapPromptCancellation, Effect.map(Redacted.make));
|
|
303
336
|
const accountId = yield* promptAccountId();
|
|
304
337
|
|
|
305
|
-
yield*
|
|
306
|
-
profileName,
|
|
307
|
-
"cf-stored",
|
|
308
|
-
{ type: "apiKey", apiKey, email, accountId },
|
|
309
|
-
);
|
|
310
|
-
yield* Clank.success("Cloudflare: credentials saved.");
|
|
338
|
+
yield* interaction.output.success("Cloudflare: credentials saved.");
|
|
311
339
|
return {
|
|
312
340
|
method: "stored" as const,
|
|
313
341
|
credentialType: "apiKey" as const,
|
|
342
|
+
apiKey: Redacted.value(apiKey),
|
|
343
|
+
email: Redacted.value(email),
|
|
344
|
+
accountId,
|
|
314
345
|
};
|
|
315
346
|
}),
|
|
316
347
|
),
|
|
@@ -318,48 +349,67 @@ export const CloudflareAuth = AuthProviderLayer<
|
|
|
318
349
|
);
|
|
319
350
|
});
|
|
320
351
|
|
|
321
|
-
const configureOAuth = Effect.fn(function* (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
352
|
+
const configureOAuth = Effect.fn(function* (
|
|
353
|
+
profileName: string,
|
|
354
|
+
currentConfig?: CloudflareAuthConfig,
|
|
355
|
+
) {
|
|
356
|
+
const scopes = yield* promptOAuthScopes(currentConfig);
|
|
357
|
+
|
|
358
|
+
const oauthCreds = yield* oauthLogin(profileName, [...scopes]);
|
|
359
|
+
|
|
360
|
+
const accountId = yield* selectAccount(
|
|
361
|
+
Redacted.value(oauthCreds.access),
|
|
362
|
+
).pipe(
|
|
363
|
+
// Keep AuthError messages intact — they carry the actionable
|
|
364
|
+
// diagnosis (e.g. "no accounts visible"); only wrap raw API errors.
|
|
365
|
+
Effect.mapError((e) =>
|
|
366
|
+
e instanceof AuthError
|
|
367
|
+
? e
|
|
368
|
+
: new AuthError({
|
|
369
|
+
message: "Cloudflare: could not list accounts",
|
|
370
|
+
cause: e,
|
|
371
|
+
}),
|
|
333
372
|
),
|
|
334
373
|
);
|
|
335
374
|
|
|
336
375
|
return {
|
|
337
376
|
method: "oauth" as const,
|
|
338
|
-
scopes,
|
|
377
|
+
scopes: [...scopes],
|
|
339
378
|
accountId,
|
|
379
|
+
clientId: oauthCreds.clientId,
|
|
380
|
+
access: Redacted.value(oauthCreds.access),
|
|
381
|
+
refresh: Redacted.value(oauthCreds.refresh),
|
|
382
|
+
expires: oauthCreds.expires,
|
|
340
383
|
};
|
|
341
384
|
});
|
|
342
385
|
|
|
343
|
-
const configureInteractive = (
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
386
|
+
const configureInteractive = (
|
|
387
|
+
profileName: string,
|
|
388
|
+
currentConfig?: CloudflareAuthConfig,
|
|
389
|
+
) =>
|
|
390
|
+
interaction.prompt
|
|
391
|
+
.select({
|
|
392
|
+
message: "Cloudflare authentication method",
|
|
393
|
+
options,
|
|
394
|
+
})
|
|
395
|
+
.pipe(
|
|
396
|
+
Effect.flatMap((method) =>
|
|
397
|
+
Match.value(method).pipe(
|
|
398
|
+
Match.when("oauth", () =>
|
|
399
|
+
configureOAuth(profileName, currentConfig),
|
|
400
|
+
),
|
|
401
|
+
Match.when("stored", () => loginStored(profileName)),
|
|
402
|
+
Match.exhaustive,
|
|
403
|
+
),
|
|
354
404
|
),
|
|
355
|
-
)
|
|
356
|
-
);
|
|
405
|
+
);
|
|
357
406
|
|
|
358
|
-
const configureCredentials = (
|
|
407
|
+
const configureCredentials = (
|
|
408
|
+
profileName: string,
|
|
409
|
+
currentConfig?: CloudflareAuthConfig,
|
|
410
|
+
) =>
|
|
359
411
|
Effect.gen(function* () {
|
|
360
|
-
const config =
|
|
361
|
-
? { method: "env" as const }
|
|
362
|
-
: yield* configureInteractive(profileName);
|
|
412
|
+
const config = yield* configureInteractive(profileName, currentConfig);
|
|
363
413
|
// Re-configuring auth may point this profile at a different
|
|
364
414
|
// Cloudflare account. The cached state-store credentials
|
|
365
415
|
// (`~/.alchemy/credentials/{profile}/cloudflare-state-store.json`)
|
|
@@ -370,182 +420,190 @@ export const CloudflareAuth = AuthProviderLayer<
|
|
|
370
420
|
.pipe(Effect.ignore);
|
|
371
421
|
return config;
|
|
372
422
|
}).pipe(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
423
|
+
// AuthError messages are already user-facing; re-wrapping them in a
|
|
424
|
+
// generic banner is what hid "no accounts visible" behind
|
|
425
|
+
// "failed to configure credentials".
|
|
426
|
+
Effect.mapError((e) =>
|
|
427
|
+
e instanceof AuthError
|
|
428
|
+
? e
|
|
429
|
+
: new AuthError({
|
|
430
|
+
message: "failed to configure credentials",
|
|
431
|
+
cause: e,
|
|
432
|
+
}),
|
|
379
433
|
),
|
|
380
434
|
);
|
|
381
435
|
|
|
382
436
|
const resolveCredentials = (
|
|
383
437
|
profileName: string,
|
|
384
438
|
config: CloudflareAuthConfig,
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
439
|
+
updateConfig?: (
|
|
440
|
+
config: CloudflareAuthConfig,
|
|
441
|
+
) => Effect.Effect<void, AuthError>,
|
|
442
|
+
) =>
|
|
443
|
+
Effect.gen(function* () {
|
|
444
|
+
const reauth = refreshHint(CLOUDFLARE_AUTH_PROVIDER_NAME, profileName);
|
|
445
|
+
return yield* Match.value(config).pipe(
|
|
446
|
+
Match.when({ method: "stored", credentialType: "apiToken" }, (c) =>
|
|
447
|
+
validateAccountId(
|
|
448
|
+
c.accountId,
|
|
449
|
+
`stored for profile '${profileName}'`,
|
|
392
450
|
).pipe(
|
|
393
|
-
Effect.
|
|
394
|
-
validateAccountId(id, "from the CLOUDFLARE_ACCOUNT_ID env var"),
|
|
395
|
-
),
|
|
396
|
-
);
|
|
397
|
-
const apiToken = yield* getEnvRedacted("CLOUDFLARE_API_TOKEN");
|
|
398
|
-
if (apiToken) {
|
|
399
|
-
return {
|
|
451
|
+
Effect.map((accountId) => ({
|
|
400
452
|
type: "apiToken" as const,
|
|
401
|
-
apiToken,
|
|
453
|
+
apiToken: Redacted.make(c.apiToken),
|
|
402
454
|
accountId,
|
|
403
|
-
source: { type: "
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
455
|
+
source: { type: "stored" as const },
|
|
456
|
+
})),
|
|
457
|
+
),
|
|
458
|
+
),
|
|
459
|
+
Match.when({ method: "stored", credentialType: "apiKey" }, (c) =>
|
|
460
|
+
validateAccountId(
|
|
461
|
+
c.accountId,
|
|
462
|
+
`stored for profile '${profileName}'`,
|
|
463
|
+
).pipe(
|
|
464
|
+
Effect.map((accountId) => ({
|
|
410
465
|
type: "apiKey" as const,
|
|
411
|
-
apiKey,
|
|
412
|
-
email,
|
|
466
|
+
apiKey: Redacted.make(c.apiKey),
|
|
467
|
+
email: Redacted.make(c.email),
|
|
413
468
|
accountId,
|
|
414
|
-
source: { type: "
|
|
415
|
-
}
|
|
416
|
-
}
|
|
417
|
-
return yield* new AuthError({
|
|
418
|
-
message:
|
|
419
|
-
"Cloudflare env credentials not found. Set CLOUDFLARE_API_TOKEN or CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL.",
|
|
420
|
-
});
|
|
421
|
-
}),
|
|
422
|
-
),
|
|
423
|
-
Match.when({ method: "stored" }, () =>
|
|
424
|
-
store
|
|
425
|
-
.read<CloudflareStoredCredentials>(profileName, "cf-stored")
|
|
426
|
-
.pipe(
|
|
427
|
-
Effect.flatMap((creds) =>
|
|
428
|
-
creds == null
|
|
429
|
-
? Effect.fail(
|
|
430
|
-
new AuthError({
|
|
431
|
-
message:
|
|
432
|
-
"Cloudflare stored credentials not found. Run: alchemy login --configure",
|
|
433
|
-
}),
|
|
434
|
-
)
|
|
435
|
-
: Effect.gen(function* () {
|
|
436
|
-
// The account ID prompt is skippable, so stored
|
|
437
|
-
// credentials may carry an empty accountId; fall
|
|
438
|
-
// back to the env var before validating.
|
|
439
|
-
const envAccountId = yield* getEnv(
|
|
440
|
-
"CLOUDFLARE_ACCOUNT_ID",
|
|
441
|
-
);
|
|
442
|
-
const accountId = yield* validateAccountId(
|
|
443
|
-
creds.accountId?.trim() || envAccountId,
|
|
444
|
-
`stored for profile '${profileName}'`,
|
|
445
|
-
);
|
|
446
|
-
return Match.value(creds).pipe(
|
|
447
|
-
Match.when({ type: "apiToken" }, (c) => ({
|
|
448
|
-
type: "apiToken" as const,
|
|
449
|
-
apiToken: Redacted.make(c.apiToken),
|
|
450
|
-
accountId,
|
|
451
|
-
source: { type: "stored" as const },
|
|
452
|
-
})),
|
|
453
|
-
Match.when({ type: "apiKey" }, (c) => ({
|
|
454
|
-
type: "apiKey" as const,
|
|
455
|
-
apiKey: Redacted.make(c.apiKey),
|
|
456
|
-
email: Redacted.make(c.email),
|
|
457
|
-
accountId,
|
|
458
|
-
source: { type: "stored" as const },
|
|
459
|
-
})),
|
|
460
|
-
Match.exhaustive,
|
|
461
|
-
);
|
|
462
|
-
}),
|
|
463
|
-
),
|
|
469
|
+
source: { type: "stored" as const },
|
|
470
|
+
})),
|
|
464
471
|
),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
"Cloudflare OAuth credentials not found. Run: alchemy login",
|
|
481
|
-
}),
|
|
472
|
+
),
|
|
473
|
+
Match.when({ method: "oauth" }, (cfg) =>
|
|
474
|
+
Effect.gen(function* () {
|
|
475
|
+
if (!("scopes" in cfg)) {
|
|
476
|
+
return yield* Effect.fail(
|
|
477
|
+
new NeedsReauth({
|
|
478
|
+
provider: CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
479
|
+
profile: profileName,
|
|
480
|
+
message: `Cloudflare OAuth scopes need to be selected. ${reauth}`,
|
|
481
|
+
}),
|
|
482
|
+
);
|
|
483
|
+
}
|
|
484
|
+
const accountId = yield* validateAccountId(
|
|
485
|
+
cfg.accountId,
|
|
486
|
+
`configured for profile '${profileName}'`,
|
|
482
487
|
);
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
488
|
+
const creds: OAuthClient.OAuthCredentials = {
|
|
489
|
+
type: "oauth",
|
|
490
|
+
clientId: cfg.clientId,
|
|
491
|
+
access: Redacted.make(cfg.access),
|
|
492
|
+
refresh: Redacted.make(cfg.refresh),
|
|
493
|
+
expires: cfg.expires,
|
|
494
|
+
scopes: cfg.scopes,
|
|
495
|
+
};
|
|
496
|
+
if (!OAuthClient.usesCurrentClient(creds)) {
|
|
497
|
+
return yield* Effect.fail(
|
|
498
|
+
new NeedsReauth({
|
|
499
|
+
provider: CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
500
|
+
profile: profileName,
|
|
501
|
+
message: `Cloudflare OAuth credentials for profile '${profileName}' were issued to an incompatible OAuth client and have been removed. ${reauth}`,
|
|
502
|
+
}),
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
// Refresh proactively if the token has expired (or is within
|
|
506
|
+
// 10s of expiring). Persist the refreshed creds so subsequent
|
|
507
|
+
// resolves don't repeat the round-trip.
|
|
508
|
+
const now = yield* Clock.currentTimeMillis;
|
|
509
|
+
const fresh =
|
|
510
|
+
creds.expires > now + 10_000
|
|
511
|
+
? creds
|
|
512
|
+
: yield* OAuthClient.refresh(creds).pipe(
|
|
513
|
+
Effect.mapError(
|
|
514
|
+
(e) =>
|
|
515
|
+
new NeedsReauth({
|
|
516
|
+
provider: CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
517
|
+
profile: profileName,
|
|
518
|
+
message: `Cloudflare OAuth refresh failed. ${reauth}`,
|
|
519
|
+
cause: e,
|
|
520
|
+
}),
|
|
521
|
+
),
|
|
522
|
+
);
|
|
523
|
+
if (fresh !== creds) {
|
|
524
|
+
yield* (
|
|
525
|
+
updateConfig?.({
|
|
526
|
+
method: "oauth",
|
|
527
|
+
accountId,
|
|
528
|
+
clientId: fresh.clientId,
|
|
529
|
+
access: Redacted.value(fresh.access),
|
|
530
|
+
refresh: Redacted.value(fresh.refresh),
|
|
531
|
+
expires: fresh.expires,
|
|
532
|
+
scopes: fresh.scopes,
|
|
533
|
+
}) ?? Effect.void
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
type: "oauth" as const,
|
|
538
|
+
accessToken: fresh.access,
|
|
539
|
+
expires: fresh.expires,
|
|
540
|
+
accountId,
|
|
541
|
+
source: { type: "oauth" as const },
|
|
542
|
+
};
|
|
543
|
+
}),
|
|
544
|
+
),
|
|
545
|
+
Match.exhaustive,
|
|
546
|
+
);
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
const readEnvironment = Effect.gen(function* () {
|
|
550
|
+
const accountId = yield* getEnvRequired("CLOUDFLARE_ACCOUNT_ID").pipe(
|
|
551
|
+
Effect.flatMap((id) =>
|
|
552
|
+
validateAccountId(id, "from CLOUDFLARE_ACCOUNT_ID"),
|
|
511
553
|
),
|
|
512
|
-
Match.exhaustive,
|
|
513
554
|
);
|
|
555
|
+
const apiToken = yield* getEnvRedacted("CLOUDFLARE_API_TOKEN");
|
|
556
|
+
if (apiToken) {
|
|
557
|
+
return {
|
|
558
|
+
type: "apiToken" as const,
|
|
559
|
+
apiToken,
|
|
560
|
+
accountId,
|
|
561
|
+
source: { type: "env" as const },
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
const apiKey = yield* getEnvRedacted("CLOUDFLARE_API_KEY");
|
|
565
|
+
const email =
|
|
566
|
+
(yield* getEnvRedacted("CLOUDFLARE_EMAIL")) ??
|
|
567
|
+
(yield* getEnvRedacted("CLOUDFLARE_ACCOUNT_EMAIL"));
|
|
568
|
+
if (apiKey && email) {
|
|
569
|
+
return {
|
|
570
|
+
type: "apiKey" as const,
|
|
571
|
+
apiKey,
|
|
572
|
+
email,
|
|
573
|
+
accountId,
|
|
574
|
+
source: { type: "env" as const },
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
return yield* new AuthError({
|
|
578
|
+
message:
|
|
579
|
+
"Cloudflare CI credentials not found. Set CLOUDFLARE_API_TOKEN, or CLOUDFLARE_API_KEY with CLOUDFLARE_EMAIL/CLOUDFLARE_ACCOUNT_EMAIL.",
|
|
580
|
+
});
|
|
581
|
+
});
|
|
514
582
|
|
|
515
583
|
const logout = (profileName: string, config: CloudflareAuthConfig) =>
|
|
516
584
|
Match.value(config)
|
|
517
585
|
.pipe(
|
|
518
|
-
Match.when({ method: "
|
|
519
|
-
Match.when({ method: "
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
),
|
|
540
|
-
)
|
|
541
|
-
: Effect.void,
|
|
542
|
-
),
|
|
543
|
-
Effect.andThen(store.delete(profileName, "cf-oauth")),
|
|
544
|
-
Effect.andThen(
|
|
545
|
-
Clank.success("Cloudflare: OAuth credentials removed."),
|
|
546
|
-
),
|
|
547
|
-
),
|
|
548
|
-
),
|
|
586
|
+
Match.when({ method: "stored" }, () => Effect.void),
|
|
587
|
+
Match.when({ method: "oauth" }, (config) => {
|
|
588
|
+
if (!("scopes" in config)) return Effect.void;
|
|
589
|
+
const credentials: OAuthClient.OAuthCredentials = {
|
|
590
|
+
type: "oauth",
|
|
591
|
+
clientId: config.clientId,
|
|
592
|
+
access: Redacted.make(config.access),
|
|
593
|
+
refresh: Redacted.make(config.refresh),
|
|
594
|
+
expires: config.expires,
|
|
595
|
+
scopes: config.scopes,
|
|
596
|
+
};
|
|
597
|
+
return OAuthClient.usesCurrentClient(credentials)
|
|
598
|
+
? OAuthClient.revoke(credentials).pipe(
|
|
599
|
+
Effect.catchTag("OAuthError", (err) =>
|
|
600
|
+
interaction.output.warning(
|
|
601
|
+
`Cloudflare: could not revoke OAuth token: ${err.errorDescription}`,
|
|
602
|
+
),
|
|
603
|
+
),
|
|
604
|
+
)
|
|
605
|
+
: Effect.void;
|
|
606
|
+
}),
|
|
549
607
|
Match.exhaustive,
|
|
550
608
|
)
|
|
551
609
|
// The cached state-store credentials are derived from the account we
|
|
@@ -558,248 +616,294 @@ export const CloudflareAuth = AuthProviderLayer<
|
|
|
558
616
|
),
|
|
559
617
|
);
|
|
560
618
|
|
|
561
|
-
const login = (
|
|
619
|
+
const login = (
|
|
620
|
+
profileName: string,
|
|
621
|
+
config: CloudflareAuthConfig,
|
|
622
|
+
updateConfig?: (
|
|
623
|
+
config: CloudflareAuthConfig,
|
|
624
|
+
) => Effect.Effect<void, AuthError>,
|
|
625
|
+
) =>
|
|
562
626
|
Match.value(config)
|
|
563
627
|
.pipe(
|
|
564
|
-
Match.when({ method: "
|
|
565
|
-
Match.when({ method: "stored" }, () =>
|
|
566
|
-
store
|
|
567
|
-
.read<CloudflareStoredCredentials>(profileName, "cf-stored")
|
|
568
|
-
.pipe(
|
|
569
|
-
Effect.flatMap((creds) =>
|
|
570
|
-
creds == null ? loginStored(profileName) : Effect.void,
|
|
571
|
-
),
|
|
572
|
-
),
|
|
573
|
-
),
|
|
628
|
+
Match.when({ method: "stored" }, (config) => Effect.succeed(config)),
|
|
574
629
|
Match.when({ method: "oauth" }, (c) =>
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
630
|
+
"scopes" in c
|
|
631
|
+
? Effect.gen(function* () {
|
|
632
|
+
const creds: OAuthClient.OAuthCredentials = {
|
|
633
|
+
type: "oauth",
|
|
634
|
+
clientId: c.clientId,
|
|
635
|
+
access: Redacted.make(c.access),
|
|
636
|
+
refresh: Redacted.make(c.refresh),
|
|
637
|
+
expires: c.expires,
|
|
638
|
+
scopes: c.scopes,
|
|
639
|
+
};
|
|
640
|
+
const reconfigure = reconfigureHint(
|
|
641
|
+
CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
642
|
+
profileName,
|
|
643
|
+
);
|
|
644
|
+
// Any path that falls back to a full browser login rebuilds the
|
|
645
|
+
// authorize URL from the profile's stored scopes. Those scopes
|
|
646
|
+
// may predate the current OAuth client (or a catalog change), and
|
|
647
|
+
// one unknown scope makes the whole authorize URL invalid — so
|
|
648
|
+
// sanitize before generating a URL, never after it fails.
|
|
649
|
+
const fullLogin = Effect.gen(function* () {
|
|
650
|
+
const { valid, dropped } = partitionOAuthScopes(c.scopes);
|
|
651
|
+
if (valid.length === 0) {
|
|
652
|
+
return yield* Effect.fail(
|
|
653
|
+
new AuthError({
|
|
654
|
+
message:
|
|
655
|
+
`The OAuth scopes stored for profile '${profileName}' are no longer offered by Alchemy's Cloudflare OAuth client. ` +
|
|
656
|
+
`Scopes must be picked again. ${reconfigure}`,
|
|
657
|
+
}),
|
|
658
|
+
);
|
|
659
|
+
}
|
|
660
|
+
const refreshed = yield* (
|
|
661
|
+
dropped.length === 0
|
|
662
|
+
? Effect.void
|
|
663
|
+
: interaction.output.warning(
|
|
664
|
+
`Cloudflare: dropping ${dropped.length} stored scope${dropped.length === 1 ? "" : "s"} no longer offered by the current OAuth client (${dropped.join(", ")}). ` +
|
|
665
|
+
`Scopes must be picked again. ${reconfigure}`,
|
|
666
|
+
)
|
|
667
|
+
).pipe(Effect.andThen(oauthLogin(profileName, valid)));
|
|
668
|
+
return {
|
|
669
|
+
...c,
|
|
670
|
+
scopes: valid,
|
|
671
|
+
clientId: refreshed.clientId,
|
|
672
|
+
access: Redacted.value(refreshed.access),
|
|
673
|
+
refresh: Redacted.value(refreshed.refresh),
|
|
674
|
+
expires: refreshed.expires,
|
|
675
|
+
};
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// The silent refresh rotates a single-use refresh token, so
|
|
679
|
+
// its read-refresh-persist section runs under the profile
|
|
680
|
+
// lock — a concurrent `read` refreshing the same token would
|
|
681
|
+
// double-spend it. The lock is held only for this API
|
|
682
|
+
// round-trip, never across the browser wait below.
|
|
683
|
+
const outcome =
|
|
684
|
+
creds.type === "oauth" &&
|
|
685
|
+
OAuthClient.usesCurrentClient(creds)
|
|
686
|
+
? yield* withProfileCredentialsLock(
|
|
687
|
+
profileName,
|
|
688
|
+
interaction.output
|
|
689
|
+
.info("Cloudflare: refreshing OAuth credentials...")
|
|
690
|
+
.pipe(
|
|
691
|
+
Effect.andThen(OAuthClient.refresh(creds)),
|
|
692
|
+
Effect.flatMap((credentials) => {
|
|
693
|
+
const config = {
|
|
694
|
+
...c,
|
|
695
|
+
clientId: credentials.clientId,
|
|
696
|
+
access: Redacted.value(credentials.access),
|
|
697
|
+
refresh: Redacted.value(credentials.refresh),
|
|
698
|
+
expires: credentials.expires,
|
|
699
|
+
scopes: credentials.scopes,
|
|
700
|
+
};
|
|
701
|
+
return (
|
|
702
|
+
updateConfig?.(config) ?? Effect.void
|
|
703
|
+
).pipe(
|
|
704
|
+
Effect.as({
|
|
705
|
+
type: "refreshed" as const,
|
|
706
|
+
config,
|
|
707
|
+
}),
|
|
708
|
+
);
|
|
709
|
+
}),
|
|
710
|
+
Effect.tap(() =>
|
|
711
|
+
interaction.output.success(
|
|
712
|
+
"Cloudflare: OAuth credentials refreshed.",
|
|
713
|
+
),
|
|
714
|
+
),
|
|
715
|
+
Effect.catchTag("OAuthError", () =>
|
|
716
|
+
Effect.succeed({ type: "browser" as const }),
|
|
717
|
+
),
|
|
718
|
+
),
|
|
719
|
+
)
|
|
720
|
+
: yield* Effect.gen(function* () {
|
|
721
|
+
if (creds.type === "oauth") {
|
|
722
|
+
yield* interaction.output.warning(
|
|
723
|
+
"Cloudflare: removed OAuth credentials issued to the previous client.",
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
return { type: "browser" as const };
|
|
727
|
+
});
|
|
728
|
+
if (outcome.type === "browser") {
|
|
729
|
+
return yield* fullLogin;
|
|
730
|
+
}
|
|
731
|
+
return outcome.config;
|
|
732
|
+
})
|
|
733
|
+
: configureOAuth(profileName, c),
|
|
606
734
|
),
|
|
607
735
|
Match.exhaustive,
|
|
608
736
|
)
|
|
609
737
|
.pipe(
|
|
610
|
-
|
|
611
|
-
|
|
738
|
+
// A blanket mapError must never swallow the NeedsReauth tag —
|
|
739
|
+
// the profile UI matches on it to render "needs re-login".
|
|
740
|
+
Effect.mapError((e) =>
|
|
741
|
+
e instanceof NeedsReauth
|
|
742
|
+
? e
|
|
743
|
+
: new AuthError({ message: "login failed", cause: e }),
|
|
612
744
|
),
|
|
613
745
|
);
|
|
614
746
|
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
747
|
+
const details = (
|
|
748
|
+
profileName: string,
|
|
749
|
+
config: CloudflareAuthConfig,
|
|
750
|
+
updateConfig?: (
|
|
751
|
+
config: CloudflareAuthConfig,
|
|
752
|
+
) => Effect.Effect<void, AuthError>,
|
|
753
|
+
) =>
|
|
754
|
+
Effect.all([
|
|
755
|
+
resolveCredentials(profileName, config, updateConfig),
|
|
756
|
+
Clock.currentTimeMillis,
|
|
757
|
+
]).pipe(
|
|
758
|
+
Effect.map(([creds, now]) => {
|
|
759
|
+
const source = {
|
|
760
|
+
key: "source",
|
|
761
|
+
value:
|
|
762
|
+
"details" in creds.source && creds.source.details
|
|
763
|
+
? `${creds.source.type} - ${creds.source.details}`
|
|
764
|
+
: creds.source.type,
|
|
765
|
+
};
|
|
766
|
+
return {
|
|
767
|
+
lines: Match.value(creds).pipe(
|
|
768
|
+
Match.when({ type: "apiToken" }, (c) => [
|
|
769
|
+
{ key: "apiToken", value: displayRedacted(c.apiToken, 9) },
|
|
770
|
+
{ key: "accountId", value: c.accountId },
|
|
771
|
+
source,
|
|
627
772
|
]),
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
Console.log(` accountId: ${c.accountId}`),
|
|
634
|
-
Console.log(` source: ${sourceStr}`),
|
|
773
|
+
Match.when({ type: "apiKey" }, (c) => [
|
|
774
|
+
{ key: "apiKey", value: displayRedacted(c.apiKey) },
|
|
775
|
+
{ key: "email", value: displayRedacted(c.email) },
|
|
776
|
+
{ key: "accountId", value: c.accountId },
|
|
777
|
+
source,
|
|
635
778
|
]),
|
|
779
|
+
Match.when({ type: "oauth" }, (c) => {
|
|
780
|
+
const remainingMs = c.expires - now;
|
|
781
|
+
const expiresAt = new Date(c.expires).toISOString();
|
|
782
|
+
const expiresStr =
|
|
783
|
+
remainingMs <= 0
|
|
784
|
+
? `expired (${expiresAt})`
|
|
785
|
+
: `in ${Duration.format(Duration.millis(remainingMs))} (${expiresAt})`;
|
|
786
|
+
return [
|
|
787
|
+
{ key: "accessToken", value: displayRedacted(c.accessToken) },
|
|
788
|
+
{ key: "expires", value: expiresStr },
|
|
789
|
+
{ key: "accountId", value: c.accountId },
|
|
790
|
+
source,
|
|
791
|
+
];
|
|
792
|
+
}),
|
|
793
|
+
Match.exhaustive,
|
|
636
794
|
),
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
795
|
+
};
|
|
796
|
+
}),
|
|
797
|
+
);
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Persist flag-provided stored credentials (`--method stored`). Writes
|
|
801
|
+
* the same `cloudflare-stored` file the interactive stored path writes;
|
|
802
|
+
* OAuth is interactive-only and not accepted here.
|
|
803
|
+
*/
|
|
804
|
+
const configureWith = (
|
|
805
|
+
profileName: string,
|
|
806
|
+
input: {
|
|
807
|
+
readonly method: string;
|
|
808
|
+
readonly values: Record<string, string>;
|
|
809
|
+
},
|
|
810
|
+
): Effect.Effect<CloudflareAuthConfig, AuthError> => {
|
|
811
|
+
const persist = (config: CloudflareAuthConfig) =>
|
|
812
|
+
store
|
|
813
|
+
.delete(profileName, STATE_STORE_CREDENTIALS_FILE)
|
|
814
|
+
.pipe(Effect.ignore, Effect.as(config));
|
|
815
|
+
if (input.method !== "stored") {
|
|
816
|
+
return Effect.fail(
|
|
817
|
+
new AuthError({
|
|
818
|
+
message: `Cloudflare: unknown method '${input.method}'. Valid methods: stored. (OAuth is interactive-only.)`,
|
|
819
|
+
}),
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
return validateFieldValues(
|
|
823
|
+
CLOUDFLARE_AUTH_PROVIDER_NAME,
|
|
824
|
+
storedFields,
|
|
825
|
+
input.values,
|
|
826
|
+
).pipe(
|
|
827
|
+
Effect.flatMap((values) => {
|
|
828
|
+
const accountId = (storedValueText(values.accountId) ?? "")
|
|
829
|
+
.trim()
|
|
830
|
+
.toLowerCase();
|
|
831
|
+
const apiToken = storedSecret(values.apiToken);
|
|
832
|
+
const apiKey = storedSecret(values.apiKey);
|
|
833
|
+
const email = storedValueText(values.email);
|
|
834
|
+
if (
|
|
835
|
+
apiToken !== undefined &&
|
|
836
|
+
apiKey === undefined &&
|
|
837
|
+
email === undefined
|
|
838
|
+
) {
|
|
839
|
+
return persist({
|
|
840
|
+
method: "stored",
|
|
841
|
+
credentialType: "apiToken",
|
|
842
|
+
apiToken: Redacted.value(apiToken),
|
|
843
|
+
accountId,
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
if (
|
|
847
|
+
apiToken === undefined &&
|
|
848
|
+
apiKey !== undefined &&
|
|
849
|
+
email !== undefined
|
|
850
|
+
) {
|
|
851
|
+
return persist({
|
|
852
|
+
method: "stored",
|
|
853
|
+
credentialType: "apiKey",
|
|
854
|
+
apiKey: Redacted.value(apiKey),
|
|
855
|
+
email,
|
|
856
|
+
accountId,
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
return Effect.fail(
|
|
860
|
+
new AuthError({
|
|
861
|
+
message:
|
|
862
|
+
"Cloudflare: pass either --set apiToken=<token>, or both --set apiKey=<key> and --set email=<email>.",
|
|
650
863
|
}),
|
|
651
|
-
Match.exhaustive,
|
|
652
864
|
);
|
|
653
865
|
}),
|
|
654
866
|
);
|
|
867
|
+
};
|
|
655
868
|
|
|
656
869
|
return {
|
|
870
|
+
configSchema: CloudflareAuthConfigSchema,
|
|
657
871
|
configure: configureCredentials,
|
|
872
|
+
configureWith,
|
|
873
|
+
configureMethods,
|
|
658
874
|
logout,
|
|
659
875
|
login,
|
|
660
|
-
|
|
876
|
+
details,
|
|
661
877
|
read: resolveCredentials,
|
|
878
|
+
readEnvironment,
|
|
879
|
+
environment: [
|
|
880
|
+
{
|
|
881
|
+
name: "CLOUDFLARE_ACCOUNT_ID",
|
|
882
|
+
required: true,
|
|
883
|
+
description: "Account the stack deploys into.",
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: "CLOUDFLARE_API_TOKEN",
|
|
887
|
+
required: true,
|
|
888
|
+
secret: true,
|
|
889
|
+
alternatives: ["CLOUDFLARE_API_KEY"],
|
|
890
|
+
description:
|
|
891
|
+
"API token (preferred). Not consulted when unset and CLOUDFLARE_API_KEY + CLOUDFLARE_EMAIL are provided instead.",
|
|
892
|
+
},
|
|
893
|
+
{
|
|
894
|
+
name: "CLOUDFLARE_API_KEY",
|
|
895
|
+
required: false,
|
|
896
|
+
secret: true,
|
|
897
|
+
description:
|
|
898
|
+
"Global API key; used with CLOUDFLARE_EMAIL when no API token is set.",
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: "CLOUDFLARE_EMAIL",
|
|
902
|
+
required: false,
|
|
903
|
+
alternatives: ["CLOUDFLARE_ACCOUNT_EMAIL"],
|
|
904
|
+
description: "Account email paired with CLOUDFLARE_API_KEY.",
|
|
905
|
+
},
|
|
906
|
+
],
|
|
662
907
|
};
|
|
663
908
|
}),
|
|
664
909
|
);
|
|
665
|
-
|
|
666
|
-
export const ALL_SCOPES = {
|
|
667
|
-
"access:read":
|
|
668
|
-
"See Cloudflare Access data such as zones, applications, certificates, device postures, groups, identity providers, login counts, organizations, policies, service tokens, and users",
|
|
669
|
-
"access:write":
|
|
670
|
-
"See and change Cloudflare Access data such as zones, applications, certificates, device postures, groups, identity providers, login counts, organizations, policies, service tokens, and users",
|
|
671
|
-
"account:read":
|
|
672
|
-
"See your account info such as account details, analytics, and memberships",
|
|
673
|
-
"agw:read": "Grants read level access to Agents Gateway",
|
|
674
|
-
"agw:run": "Grants run level access to Agents Gateway",
|
|
675
|
-
"agw:write": "Grants read and write level access to Agents Gateway",
|
|
676
|
-
"ai:read": "Grants read level access to Workers AI",
|
|
677
|
-
"ai:write": "Grants write level access to Workers AI",
|
|
678
|
-
"aiaudit:read": "Grants read level access to AI Audit",
|
|
679
|
-
"aiaudit:write": "Grants write level access to AI Audit",
|
|
680
|
-
"aig:read": "Grants read level access to AI Gateway",
|
|
681
|
-
"aig:write": "Grants write level access to AI Gateway",
|
|
682
|
-
"auditlogs:read": "View Cloudflare Account Audit Logs",
|
|
683
|
-
"browser:read": "Grants read level access to Browser Rendering",
|
|
684
|
-
"browser:write": "Grants write level access to Browser Rendering",
|
|
685
|
-
"cfone:read": "Grants read level access to Cloudforce One data",
|
|
686
|
-
"cfone:write": "Grants write level access to Cloudforce One data",
|
|
687
|
-
"cloudchamber:write": "See and make changes to Cloudchamber",
|
|
688
|
-
"connectivity:admin":
|
|
689
|
-
"See, change, and bind to Connectivity Directory services, including creating services targeting Cloudflare Tunnel",
|
|
690
|
-
"connectivity:bind":
|
|
691
|
-
"read, list, and bind to Connectivity Directory services, as well as read and list Cloudflare Tunnels",
|
|
692
|
-
"connectivity:read":
|
|
693
|
-
"See Connectivity Directory services and Cloudflare Tunnels",
|
|
694
|
-
"constellation:write":
|
|
695
|
-
"Grants write access to Constellation configuration and models",
|
|
696
|
-
"containers:write": "See and make changes to Workers Containers",
|
|
697
|
-
"d1:write": "See and make changes to D1",
|
|
698
|
-
"dex:read": "Grants read level access to Cloudflare DEX",
|
|
699
|
-
"dex:write": "Grants write level access to Cloudflare DEX",
|
|
700
|
-
"dns_analytics:read": "Grants read level access to Cloudflare DNS Analytics",
|
|
701
|
-
"dns_records:edit": "Grants edit level access to dns records",
|
|
702
|
-
"dns_records:read": "Grants read level access to dns records",
|
|
703
|
-
"dns_settings:read": "Grants read level access to Cloudflare DNS Settings",
|
|
704
|
-
"firstpartytags:write":
|
|
705
|
-
"Can see, edit and publish Google tag gateway configuration.",
|
|
706
|
-
"lb:edit": "Grants edit level access to lb and lb pools",
|
|
707
|
-
"lb:read": "Grants read level access to lb and lb pools",
|
|
708
|
-
"logpush:read": "See Cloudflare Logpush data",
|
|
709
|
-
"logpush:write": "See and change Cloudflare Logpush data",
|
|
710
|
-
"notification:read": "View Cloudflare Notifications",
|
|
711
|
-
"notification:write": "View and Modify Cloudflare Notifications",
|
|
712
|
-
"pages:read": "See Cloudflare Pages projects, settings and deployments",
|
|
713
|
-
"pages:write":
|
|
714
|
-
"See and change Cloudflare Pages projects, settings and deployments",
|
|
715
|
-
"pipelines:read": "Grants read level access to Cloudflare Pipelines",
|
|
716
|
-
"pipelines:setup":
|
|
717
|
-
"Grants permission to generate R2 tokens for Workers Pipelines",
|
|
718
|
-
"pipelines:write": "Grants write level access to Cloudflare Pipelines",
|
|
719
|
-
"query_cache:write": "See and make changes to Hyperdrive",
|
|
720
|
-
"queues:write": "See and change Cloudflare Queues settings and data",
|
|
721
|
-
"r2_catalog:write": "Grants write level access to R2 Data Catalog",
|
|
722
|
-
"radar:read": "Grants access to read Cloudflare Radar data",
|
|
723
|
-
"ai-search:read": "Grants read level access to AI Search",
|
|
724
|
-
"ai-search:write": "Grants write level access to AI Search",
|
|
725
|
-
"ai-search:run": "Grants run level access to AI Search",
|
|
726
|
-
"secrets_store:read": "Grants read level access to Secrets Store",
|
|
727
|
-
"secrets_store:write": "Grants write level access to Secrets Store",
|
|
728
|
-
"ssl_certs:write":
|
|
729
|
-
"Grants read and write access to SSL MTLS certificates or Certificate Store",
|
|
730
|
-
"sso-connector:read": "See Cloudflare SSO connectors",
|
|
731
|
-
"sso-connector:write":
|
|
732
|
-
"See Cloudflare SSO connectors to toggle activation and deactivation of SSO",
|
|
733
|
-
"teams:pii": "See personally identifiable Cloudflare Teams data",
|
|
734
|
-
"teams:read":
|
|
735
|
-
"See Cloudflare Teams data such as zones, gateway, and argo tunnel details",
|
|
736
|
-
"teams:secure_location":
|
|
737
|
-
"See all DNS Location data but can only change secure DNS Locations",
|
|
738
|
-
"teams:write":
|
|
739
|
-
"See and change Cloudflare Teams data such as zones, gateway, and argo tunnel details",
|
|
740
|
-
"url_scanner:read": "Grants read level access to URL Scanner",
|
|
741
|
-
"url_scanner:write": "Grants write level access to URL Scanner",
|
|
742
|
-
"user:read":
|
|
743
|
-
"See your user info such as name, email address, and account memberships",
|
|
744
|
-
"vectorize:write": "See and make changes to Vectorize",
|
|
745
|
-
"workers:read":
|
|
746
|
-
"See Cloudflare Workers data such as zones, KV storage, R2 storage, scripts, and routes",
|
|
747
|
-
"workers:write":
|
|
748
|
-
"See and change Cloudflare Workers data such as zones, KV storage, R2 storage, scripts, and routes",
|
|
749
|
-
"workers_builds:read":
|
|
750
|
-
"See Cloudflare Workers Builds data such as builds, build configuration, and build logs",
|
|
751
|
-
"workers_builds:write":
|
|
752
|
-
"See and change Cloudflare Workers Builds data such as builds, build configuration, and build logs",
|
|
753
|
-
"workers_kv:write":
|
|
754
|
-
"See and change Cloudflare Workers KV Storage data such as keys and namespaces",
|
|
755
|
-
"workers_observability:read":
|
|
756
|
-
"Grants read access to Cloudflare Workers Observability",
|
|
757
|
-
"workers_observability:write":
|
|
758
|
-
"Grants read and write access to Cloudflare Workers Observability",
|
|
759
|
-
"workers_observability_telemetry:write":
|
|
760
|
-
"Grants write access to Cloudflare Workers Observability Telemetry API",
|
|
761
|
-
"workers_routes:write":
|
|
762
|
-
"See and change Cloudflare Workers data such as filters and routes",
|
|
763
|
-
"workers_scripts:write":
|
|
764
|
-
"See and change Cloudflare Workers scripts, durable objects, subdomains, triggers, and tail data",
|
|
765
|
-
"workers_tail:read": "See Cloudflare Workers tail and script data",
|
|
766
|
-
"zone:read": "Grants read level access to account zone",
|
|
767
|
-
};
|
|
768
|
-
|
|
769
|
-
export const DEFAULT_SCOPES = [
|
|
770
|
-
"account:read",
|
|
771
|
-
"ai-search:write",
|
|
772
|
-
"ai-search:run",
|
|
773
|
-
"ai:write",
|
|
774
|
-
"aig:read",
|
|
775
|
-
"aig:write",
|
|
776
|
-
"cloudchamber:write",
|
|
777
|
-
"connectivity:admin",
|
|
778
|
-
"containers:write",
|
|
779
|
-
"d1:write",
|
|
780
|
-
"pages:write",
|
|
781
|
-
"pipelines:write",
|
|
782
|
-
"queues:write",
|
|
783
|
-
"secrets_store:write",
|
|
784
|
-
"ssl_certs:write",
|
|
785
|
-
"user:read",
|
|
786
|
-
"vectorize:write",
|
|
787
|
-
"workers_kv:write",
|
|
788
|
-
"workers_observability:read",
|
|
789
|
-
"workers_observability:write",
|
|
790
|
-
"workers_observability_telemetry:write",
|
|
791
|
-
"workers_routes:write",
|
|
792
|
-
"workers_scripts:write",
|
|
793
|
-
"workers_tail:read",
|
|
794
|
-
"workers:write",
|
|
795
|
-
"zone:read",
|
|
796
|
-
];
|
|
797
|
-
|
|
798
|
-
export const OAUTH_CLIENT_ID = "6d8c2255-0773-45f6-b376-2914632e6f91";
|
|
799
|
-
export const OAUTH_REDIRECT_URI = "https://alchemy.run/auth/callback";
|
|
800
|
-
export const OAUTH_LOCAL_CALLBACK_URI = "http://localhost:9976/auth/callback";
|
|
801
|
-
export const OAUTH_ENDPOINTS = {
|
|
802
|
-
authorize: "https://dash.cloudflare.com/oauth2/authorize",
|
|
803
|
-
token: "https://dash.cloudflare.com/oauth2/token",
|
|
804
|
-
revoke: "https://dash.cloudflare.com/oauth2/revoke",
|
|
805
|
-
};
|