| 1 | import * as Layer from "effect/Layer"; |
| 2 | import { CredentialsStoreLive } from "../Auth/Credentials.ts"; |
| 3 | import { ProfileStoreLive } from "../Auth/Profile.ts"; |
| 4 | import * as Command from "../Command/index.ts"; |
| 5 | import { DockerLive } from "../Docker/Docker.ts"; |
| 6 | import { KeyPair, KeyPairProvider } from "../KeyPair.ts"; |
| 7 | import * as Provider from "../Provider.ts"; |
| 8 | import { Random, RandomProvider } from "../Random.ts"; |
| 9 | import * as Access from "./Access.ts"; |
| 10 | import * as AccessApp from "./Access/Application.ts"; |
| 11 | import * as Bookmark from "./Access/Bookmark.ts"; |
| 12 | import * as AccessCert from "./Access/Certificate.ts"; |
| 13 | import * as CustomPage from "./Access/CustomPage.ts"; |
| 14 | import { GetIdentityProviderHttp } from "./Access/GetIdentityProviderHttp.ts"; |
| 15 | import * as Group from "./Access/Group.ts"; |
| 16 | import * as AccessIdp from "./Access/IdentityProvider.ts"; |
| 17 | import * as AccessInfraTarget from "./Access/InfrastructureTarget.ts"; |
| 18 | import * as AccessKeyConfig from "./Access/KeyConfiguration.ts"; |
| 19 | import * as McpPortal from "./Access/McpPortal.ts"; |
| 20 | import * as McpServer from "./Access/McpServer.ts"; |
| 21 | import * as AccessOrg from "./Access/Organization.ts"; |
| 22 | import * as AccessPol from "./Access/Policy.ts"; |
| 23 | import * as AccessSvcToken from "./Access/ServiceToken.ts"; |
| 24 | import * as Tag from "./Access/Tag.ts"; |
| 25 | import * as Account from "./Account/index.ts"; |
| 26 | import * as Acm from "./Acm/index.ts"; |
| 27 | import * as Addressing from "./Addressing/index.ts"; |
| 28 | import * as AI from "./AI/index.ts"; |
| 29 | import * as Alerting from "./Alerting/index.ts"; |
| 30 | import * as ApiShield from "./ApiShield/index.ts"; |
| 31 | import * as ApiToken from "./ApiToken/index.ts"; |
| 32 | import * as Argo from "./Argo/index.ts"; |
| 33 | import { CloudflareAuth } from "./Auth/AuthProvider.ts"; |
| 34 | import * as BotManagement from "./BotManagement/index.ts"; |
| 35 | import * as Cache from "./Cache/index.ts"; |
| 36 | import * as Calls from "./Calls/index.ts"; |
| 37 | import * as CertificateAuthorities from "./CertificateAuthorities/index.ts"; |
| 38 | import * as ClientCertificate from "./ClientCertificate/index.ts"; |
| 39 | import * as CloudConnector from "./CloudConnector/index.ts"; |
| 40 | import * as CloudflareEnvironment from "./CloudflareEnvironment.ts"; |
| 41 | import * as CloudforceOne from "./CloudforceOne/index.ts"; |
| 42 | import * as Connectivity from "./Connectivity/index.ts"; |
| 43 | import * as Containers from "./Containers/index.ts"; |
| 44 | import * as ContentScanning from "./ContentScanning/index.ts"; |
| 45 | import * as Credentials from "./Credentials.ts"; |
| 46 | import * as CustomCertificates from "./CustomCertificate/index.ts"; |
| 47 | import * as CustomHostnames from "./CustomHostname/index.ts"; |
| 48 | import * as CustomNameservers from "./CustomNameserver/index.ts"; |
| 49 | import * as D1 from "./D1/index.ts"; |
| 50 | import * as DdosProtection from "./DdosProtection/index.ts"; |
| 51 | import * as Devices from "./Devices/index.ts"; |
| 52 | import * as Diagnostics from "./Diagnostics/index.ts"; |
| 53 | import * as Dlp from "./Dlp/index.ts"; |
| 54 | import * as Dns from "./DNS/index.ts"; |
| 55 | import * as Email from "./Email/index.ts"; |
| 56 | import * as Firewall from "./Firewall/index.ts"; |
| 57 | import * as Flagship from "./Flagship/index.ts"; |
| 58 | import * as Fraud from "./Fraud/index.ts"; |
| 59 | import * as Certificate from "./Gateway/Certificate.ts"; |
| 60 | import * as Configuration from "./Gateway/Configuration.ts"; |
| 61 | import * as List from "./Gateway/List.ts"; |
| 62 | import * as Location from "./Gateway/Location.ts"; |
| 63 | import * as Logging from "./Gateway/Logging.ts"; |
| 64 | import * as ProxyEndpoint from "./Gateway/ProxyEndpoint.ts"; |
| 65 | import * as Rule from "./Gateway/Rule.ts"; |
| 66 | import * as GoogleTagGateway from "./GoogleTagGateway/index.ts"; |
| 67 | import * as Healthcheck from "./Healthcheck/index.ts"; |
| 68 | import * as HostnameTlsSetting from "./HostnameTlsSetting/index.ts"; |
| 69 | import * as Hyperdrive from "./Hyperdrive/index.ts"; |
| 70 | import * as Iam from "./Iam/index.ts"; |
| 71 | import * as Images from "./Images/index.ts"; |
| 72 | import * as Intel from "./Intel/index.ts"; |
| 73 | import * as KeylessCertificate from "./KeylessCertificate/index.ts"; |
| 74 | import * as KV from "./KV/index.ts"; |
| 75 | import * as LeakedCredentialCheck from "./LeakedCredentialCheck/index.ts"; |
| 76 | import * as LoadBalancer from "./LoadBalancer/index.ts"; |
| 77 | import * as Logpush from "./Logpush/index.ts"; |
| 78 | import * as LogsControl from "./LogsControl/index.ts"; |
| 79 | import * as MagicCloudNetworking from "./MagicCloudNetworking/index.ts"; |
| 80 | import * as MagicNetworkMonitoring from "./MagicNetworkMonitoring/index.ts"; |
| 81 | import * as MagicTransit from "./MagicTransit/index.ts"; |
| 82 | import * as ManagedTransforms from "./ManagedTransforms/index.ts"; |
| 83 | import * as MtlsCertificate from "./MtlsCertificate/index.ts"; |
| 84 | import * as NetworkInterconnects from "./NetworkInterconnects/index.ts"; |
| 85 | import * as Organization from "./Organization/index.ts"; |
| 86 | import * as OriginCaCertificate from "./OriginCaCertificate/index.ts"; |
| 87 | import * as OriginPostQuantumEncryption from "./OriginPostQuantumEncryption/index.ts"; |
| 88 | import * as OriginTlsClientAuth from "./OriginTlsClientAuth/index.ts"; |
| 89 | import * as PageRule from "./PageRule/index.ts"; |
| 90 | import * as Pages from "./Pages/index.ts"; |
| 91 | import * as PageShield from "./PageShield/index.ts"; |
| 92 | import * as Pipelines from "./Pipelines/index.ts"; |
| 93 | import * as Queue from "./Queues/index.ts"; |
| 94 | import * as R2 from "./R2/index.ts"; |
| 95 | import * as RealtimeKit from "./RealtimeKit/index.ts"; |
| 96 | import * as RegionalHostname from "./RegionalHostname/index.ts"; |
| 97 | import * as Registrar from "./Registrar/index.ts"; |
| 98 | import * as ResourceSharing from "./ResourceSharing/index.ts"; |
| 99 | import * as RiskScoring from "./RiskScoring/index.ts"; |
| 100 | import * as Rules from "./Rules/index.ts"; |
| 101 | import * as Ruleset from "./Ruleset/index.ts"; |
| 102 | import * as Rum from "./Rum/index.ts"; |
| 103 | import * as SchemaValidation from "./SchemaValidation/index.ts"; |
| 104 | import * as SecretsStore from "./SecretsStore/index.ts"; |
| 105 | import * as SecurityTxt from "./SecurityTxt/index.ts"; |
| 106 | import * as Snippets from "./Snippets/index.ts"; |
| 107 | import * as Spectrum from "./Spectrum/index.ts"; |
| 108 | import * as Speed from "./Speed/index.ts"; |
| 109 | import * as Ssl from "./Ssl/index.ts"; |
| 110 | import * as Stream from "./Stream/index.ts"; |
| 111 | import * as Tags from "./Tags/index.ts"; |
| 112 | import * as TokenValidation from "./TokenValidation/index.ts"; |
| 113 | import * as Tunnel from "./Tunnel/index.ts"; |
| 114 | import * as Turnstile from "./Turnstile/index.ts"; |
| 115 | import * as UrlNorm from "./UrlNormalization/index.ts"; |
| 116 | import * as Vectorize from "./Vectorize/index.ts"; |
| 117 | import * as VpcService from "./VpcService/index.ts"; |
| 118 | import * as VulnScanner from "./VulnerabilityScanner/index.ts"; |
| 119 | import * as WaitingRoom from "./WaitingRoom/index.ts"; |
| 120 | import * as Web3 from "./Web3/index.ts"; |
| 121 | import * as Workers from "./Workers/index.ts"; |
| 122 | import * as WorkersForPlatforms from "./WorkersForPlatforms/index.ts"; |
| 123 | import * as Workflows from "./Workflows/Workflow.ts"; |
| 124 | import * as Zaraz from "./Zaraz/index.ts"; |
| 125 | import * as Zone from "./Zone/index.ts"; |
| 126 | |
| 127 | export { Credentials } from "@distilled.cloud/cloudflare/Credentials"; |
| 128 | |
| 129 | export class Providers extends Provider.ProviderCollection<Providers>()( |
| 130 | "Cloudflare", |
| 131 | ) {} |
| 132 | |
| 133 | export type ProviderRequirements = Layer.Services<ReturnType<typeof providers>>; |
| 134 | |
| 135 | /** |
| 136 | * Cloudflare providers, bindings, and credentials for Worker-based stacks. |
| 137 | */ |
| 138 | export const providers = () => |
| 139 | Layer.effect( |
| 140 | Providers, |
| 141 | Provider.collection([ |
| 142 | AccessApp.Application, |
| 143 | AccessCert.Certificate, |
| 144 | AccessIdp.IdentityProvider, |
| 145 | AccessInfraTarget.InfrastructureTarget, |
| 146 | AccessKeyConfig.KeyConfiguration, |
| 147 | AccessOrg.Organization, |
| 148 | AccessPol.Policy, |
| 149 | AccessSvcToken.ServiceToken, |
| 150 | Account.Account, |
| 151 | Account.Member, |
| 152 | Acm.CustomTrustStore, |
| 153 | Acm.TotalTls, |
| 154 | Addressing.AddressMap, |
| 155 | Addressing.BgpPrefix, |
| 156 | Addressing.Prefix, |
| 157 | Addressing.PrefixDelegation, |
| 158 | Addressing.ServiceBinding, |
| 159 | AI.CustomTopics, |
| 160 | AI.Dataset, |
| 161 | AI.Model, |
| 162 | AI.Evaluation, |
| 163 | AI.Gateway, |
| 164 | AI.GatewayDynamicRouting, |
| 165 | AI.GatewayProvider, |
| 166 | AI.SearchInstance, |
| 167 | AI.SearchNamespace, |
| 168 | AI.SearchToken, |
| 169 | AI.SecuritySettings, |
| 170 | Alerting.NotificationPolicy, |
| 171 | Alerting.NotificationWebhook, |
| 172 | Alerting.Silence, |
| 173 | ApiShield.Configuration, |
| 174 | ApiShield.Label, |
| 175 | ApiShield.Operation, |
| 176 | ApiShield.UserSchema, |
| 177 | ApiToken.AccountApiToken, |
| 178 | ApiToken.UserApiToken, |
| 179 | Argo.SmartRouting, |
| 180 | Argo.TieredCaching, |
| 181 | Bookmark.Bookmark, |
| 182 | BotManagement.BotManagement, |
| 183 | Cache.OriginCloudRegion, |
| 184 | Cache.RegionalTieredCache, |
| 185 | Cache.Reserve, |
| 186 | Cache.SmartTieredCache, |
| 187 | Cache.Variants, |
| 188 | Calls.App, |
| 189 | Calls.TurnKey, |
| 190 | Certificate.Certificate, |
| 191 | CertificateAuthorities.HostnameAssociation, |
| 192 | ClientCertificate.ClientCertificate, |
| 193 | CloudConnector.Rules, |
| 194 | CloudforceOne.ScanConfig, |
| 195 | Configuration.Configuration, |
| 196 | Connectivity.DirectoryService, |
| 197 | Containers.ContainerPlatform, |
| 198 | ContentScanning.ContentScanning, |
| 199 | ContentScanning.Expression, |
| 200 | CustomCertificates.CustomCertificate, |
| 201 | CustomHostnames.CustomHostname, |
| 202 | CustomHostnames.FallbackOrigin, |
| 203 | CustomNameservers.CustomNameserver, |
| 204 | CustomPage.CustomPage, |
| 205 | D1.Database, |
| 206 | DdosProtection.DdosAllowlistEntry, |
| 207 | DdosProtection.SynProtectionFilter, |
| 208 | DdosProtection.SynProtectionRule, |
| 209 | DdosProtection.TcpFlowProtectionFilter, |
| 210 | DdosProtection.TcpFlowProtectionRule, |
| 211 | Devices.DeviceCustomProfile, |
| 212 | Devices.DeviceDefaultProfile, |
| 213 | Devices.DeviceDexTest, |
| 214 | Devices.DeviceManagedNetwork, |
| 215 | Devices.DevicePostureIntegration, |
| 216 | Devices.DevicePostureRule, |
| 217 | Devices.DeviceSettings, |
| 218 | Diagnostics.EndpointHealthcheck, |
| 219 | Dlp.Entry, |
| 220 | Dlp.Profile, |
| 221 | Dns.AccountDnsSettings, |
| 222 | Dns.Dnssec, |
| 223 | Dns.Firewall, |
| 224 | Dns.Record, |
| 225 | Dns.View, |
| 226 | Dns.ZoneDnsSettings, |
| 227 | Dns.ZoneTransferAcl, |
| 228 | Dns.ZoneTransferIncoming, |
| 229 | Dns.ZoneTransferOutgoing, |
| 230 | Dns.ZoneTransferPeer, |
| 231 | Dns.ZoneTransferTsig, |
| 232 | Email.Address, |
| 233 | Email.AllowPolicy, |
| 234 | Email.BlockSender, |
| 235 | Email.CatchAll, |
| 236 | Email.Domain, |
| 237 | Email.ImpersonationRegistryEntry, |
| 238 | Email.Routing, |
| 239 | Email.Rule, |
| 240 | Email.SendingSubdomain, |
| 241 | Email.TrustedDomain, |
| 242 | Firewall.AccessRule, |
| 243 | Firewall.Lockdown, |
| 244 | Firewall.UaRule, |
| 245 | Flagship.App, |
| 246 | Flagship.Flag, |
| 247 | Fraud.DetectionSettings, |
| 248 | GoogleTagGateway.GoogleTagGateway, |
| 249 | Group.Group, |
| 250 | Healthcheck.Healthcheck, |
| 251 | HostnameTlsSetting.HostnameTlsSetting, |
| 252 | Hyperdrive.Connection, |
| 253 | Iam.ResourceGroup, |
| 254 | Iam.UserGroup, |
| 255 | Iam.UserGroupMembership, |
| 256 | Images.SigningKey, |
| 257 | Images.Variant, |
| 258 | Intel.IndicatorFeed, |
| 259 | Intel.IndicatorFeedPermission, |
| 260 | KeylessCertificate.KeylessCertificate, |
| 261 | KeyPair, |
| 262 | KV.Namespace, |
| 263 | LeakedCredentialCheck.LeakedCredentialCheck, |
| 264 | LeakedCredentialCheck.LeakedCredentialDetection, |
| 265 | List.List, |
| 266 | LoadBalancer.LoadBalancer, |
| 267 | LoadBalancer.Monitor, |
| 268 | LoadBalancer.MonitorGroup, |
| 269 | LoadBalancer.Pool, |
| 270 | Location.Location, |
| 271 | Logging.Logging, |
| 272 | Logpush.Job, |
| 273 | LogsControl.CmbConfig, |
| 274 | LogsControl.LogsRetentionFlag, |
| 275 | MagicCloudNetworking.CatalogSync, |
| 276 | MagicCloudNetworking.CloudIntegration, |
| 277 | MagicCloudNetworking.OnRamp, |
| 278 | MagicNetworkMonitoring.Config, |
| 279 | MagicNetworkMonitoring.Rule, |
| 280 | MagicTransit.GreTunnel, |
| 281 | MagicTransit.IpsecTunnel, |
| 282 | MagicTransit.MagicApp, |
| 283 | MagicTransit.MagicSite, |
| 284 | MagicTransit.MagicSiteAcl, |
| 285 | MagicTransit.MagicSiteLan, |
| 286 | MagicTransit.MagicSiteWan, |
| 287 | MagicTransit.MagicStaticRoute, |
| 288 | ManagedTransforms.ManagedTransforms, |
| 289 | McpPortal.McpPortal, |
| 290 | McpServer.McpServer, |
| 291 | MtlsCertificate.MtlsCertificate, |
| 292 | NetworkInterconnects.NetworkInterconnectSettings, |
| 293 | Organization.Organization, |
| 294 | OriginCaCertificate.OriginCaCertificate, |
| 295 | OriginPostQuantumEncryption.OriginPostQuantumEncryption, |
| 296 | OriginTlsClientAuth.Certificate, |
| 297 | OriginTlsClientAuth.HostnameAssociation, |
| 298 | OriginTlsClientAuth.HostnameCertificate, |
| 299 | OriginTlsClientAuth.Setting, |
| 300 | PageRule.PageRule, |
| 301 | Pages.Deployment, |
| 302 | Pages.Domain, |
| 303 | Pages.Project, |
| 304 | PageShield.Policy, |
| 305 | PageShield.Settings, |
| 306 | Pipelines.LegacyPipeline, |
| 307 | Pipelines.Pipeline, |
| 308 | Pipelines.Sink, |
| 309 | Pipelines.Stream, |
| 310 | ProxyEndpoint.ProxyEndpoint, |
| 311 | Queue.Consumer, |
| 312 | Queue.Queue, |
| 313 | Queue.Subscription, |
| 314 | R2.Bucket, |
| 315 | R2.BucketEventNotification, |
| 316 | R2.BucketSippy, |
| 317 | R2.DataCatalog, |
| 318 | R2.SuperSlurperJob, |
| 319 | Random, |
| 320 | RealtimeKit.App, |
| 321 | RealtimeKit.Preset, |
| 322 | RealtimeKit.Webhook, |
| 323 | RegionalHostname.RegionalHostname, |
| 324 | Registrar.Domain, |
| 325 | ResourceSharing.Share, |
| 326 | ResourceSharing.ShareRecipient, |
| 327 | ResourceSharing.ShareResource, |
| 328 | RiskScoring.Integration, |
| 329 | Rule.Rule, |
| 330 | Rules.List, |
| 331 | Ruleset.AccountEntrypoint, |
| 332 | Ruleset.CustomRuleset, |
| 333 | Ruleset.Ruleset, |
| 334 | Rum.Rule, |
| 335 | Rum.Site, |
| 336 | SchemaValidation.OperationSetting, |
| 337 | SchemaValidation.SchemaValidationSchema, |
| 338 | SchemaValidation.Settings, |
| 339 | SecretsStore.Secret, |
| 340 | SecretsStore.Store, |
| 341 | SecurityTxt.SecurityTxt, |
| 342 | Snippets.Snippet, |
| 343 | Snippets.SnippetRules, |
| 344 | Spectrum.Application, |
| 345 | Speed.TestSchedule, |
| 346 | Ssl.CertificatePack, |
| 347 | Ssl.UniversalSsl, |
| 348 | Stream.LiveInput, |
| 349 | Stream.LiveInputOutput, |
| 350 | Stream.SigningKey, |
| 351 | Stream.Watermark, |
| 352 | Stream.Webhook, |
| 353 | Tag.Tag, |
| 354 | Tags.AccountResourceTags, |
| 355 | Tags.ZoneResourceTags, |
| 356 | TokenValidation.Rule, |
| 357 | TokenValidation.TokenConfiguration, |
| 358 | Tunnel.Configuration, |
| 359 | Tunnel.HostnameRoute, |
| 360 | Tunnel.Route, |
| 361 | Tunnel.Tunnel, |
| 362 | Tunnel.VirtualNetwork, |
| 363 | Tunnel.WarpConnector, |
| 364 | Turnstile.Widget, |
| 365 | UrlNorm.UrlNormalization, |
| 366 | Vectorize.Index, |
| 367 | Vectorize.MetadataIndex, |
| 368 | VpcService.VpcService, |
| 369 | VulnScanner.VulnScannerCredential, |
| 370 | VulnScanner.VulnScannerCredentialSet, |
| 371 | VulnScanner.VulnScannerTargetEnvironment, |
| 372 | WaitingRoom.Settings, |
| 373 | WaitingRoom.WaitingRoom, |
| 374 | Web3.Hostname, |
| 375 | Web3.HostnameContentList, |
| 376 | Workers.AccountSetting, |
| 377 | Workers.ObservabilityDestination, |
| 378 | Workers.Subdomain, |
| 379 | Workers.Worker, |
| 380 | Workers.WorkerRoute, |
| 381 | WorkersForPlatforms.DispatchNamespace, |
| 382 | Workflows.WorkflowResource, |
| 383 | Zaraz.Config, |
| 384 | Zone.CustomNameservers, |
| 385 | Zone.Hold, |
| 386 | Zone.Setting, |
| 387 | Zone.Zone, |
| 388 | ]), |
| 389 | ).pipe( |
| 390 | Layer.provide( |
| 391 | Layer.mergeAll( |
| 392 | AccessApp.ApplicationProvider(), |
| 393 | AccessCert.CertificateProvider(), |
| 394 | AccessIdp.IdentityProviderProvider(), |
| 395 | AccessInfraTarget.InfrastructureTargetProvider(), |
| 396 | AccessKeyConfig.KeyConfigurationProvider(), |
| 397 | AccessOrg.OrganizationProvider(), |
| 398 | AccessPol.PolicyProvider(), |
| 399 | AccessSvcToken.ServiceTokenProvider(), |
| 400 | Account.AccountProvider(), |
| 401 | Account.MemberProvider(), |
| 402 | Acm.CustomTrustStoreProvider(), |
| 403 | Acm.TotalTlsProvider(), |
| 404 | Addressing.AddressMapProvider(), |
| 405 | Addressing.BgpPrefixProvider(), |
| 406 | Addressing.PrefixDelegationProvider(), |
| 407 | Addressing.PrefixProvider(), |
| 408 | Addressing.ServiceBindingProvider(), |
| 409 | AI.CustomTopicsProvider(), |
| 410 | AI.DatasetProvider(), |
| 411 | AI.ModelProvider(), |
| 412 | AI.DynamicRoutingProvider(), |
| 413 | AI.EvaluationProvider(), |
| 414 | AI.GatewayProviderProvider(), |
| 415 | AI.GatewayResourceProvider(), |
| 416 | AI.SearchInstanceProvider(), |
| 417 | AI.SearchNamespaceProvider(), |
| 418 | AI.SearchTokenProvider(), |
| 419 | AI.SecuritySettingsProvider(), |
| 420 | Alerting.NotificationPolicyProvider(), |
| 421 | Alerting.NotificationWebhookProvider(), |
| 422 | Alerting.SilenceProvider(), |
| 423 | ApiShield.ConfigurationProvider(), |
| 424 | ApiShield.LabelProvider(), |
| 425 | ApiShield.OperationProvider(), |
| 426 | ApiShield.UserSchemaProvider(), |
| 427 | ApiToken.AccountApiTokenProvider(), |
| 428 | ApiToken.UserApiTokenProvider(), |
| 429 | Argo.SmartRoutingProvider(), |
| 430 | Argo.TieredCachingProvider(), |
| 431 | Bookmark.BookmarkProvider(), |
| 432 | BotManagement.BotManagementProvider(), |
| 433 | Cache.OriginCloudRegionProvider(), |
| 434 | Cache.RegionalTieredCacheProvider(), |
| 435 | Cache.ReserveProvider(), |
| 436 | Cache.SmartTieredCacheProvider(), |
| 437 | Cache.VariantsProvider(), |
| 438 | Calls.AppProvider(), |
| 439 | Calls.TurnKeyProvider(), |
| 440 | Certificate.CertificateProvider(), |
| 441 | CertificateAuthorities.HostnameAssociationProvider(), |
| 442 | ClientCertificate.ClientCertificateProvider(), |
| 443 | CloudConnector.RulesProvider(), |
| 444 | CloudforceOne.ScanConfigProvider(), |
| 445 | Configuration.ConfigurationProvider(), |
| 446 | Connectivity.DirectoryServiceProvider(), |
| 447 | Containers.ContainerProvider(), |
| 448 | ContentScanning.ContentScanningProvider(), |
| 449 | ContentScanning.ExpressionProvider(), |
| 450 | CustomCertificates.CustomCertificateProvider(), |
| 451 | CustomHostnames.CustomHostnameProvider(), |
| 452 | CustomHostnames.FallbackOriginProvider(), |
| 453 | CustomNameservers.CustomNameserverProvider(), |
| 454 | CustomPage.CustomPageProvider(), |
| 455 | D1.DatabaseProvider(), |
| 456 | DdosProtection.DdosAllowlistEntryProvider(), |
| 457 | DdosProtection.SynProtectionFilterProvider(), |
| 458 | DdosProtection.SynProtectionRuleProvider(), |
| 459 | DdosProtection.TcpFlowProtectionFilterProvider(), |
| 460 | DdosProtection.TcpFlowProtectionRuleProvider(), |
| 461 | Devices.DeviceCustomProfileProvider(), |
| 462 | Devices.DeviceDefaultProfileProvider(), |
| 463 | Devices.DeviceDexTestProvider(), |
| 464 | Devices.DeviceManagedNetworkProvider(), |
| 465 | Devices.DevicePostureIntegrationProvider(), |
| 466 | Devices.DevicePostureRuleProvider(), |
| 467 | Devices.DeviceSettingsProvider(), |
| 468 | |
| 469 | // Split into nested groups: a single flat mergeAll with ~200 |
| 470 | // arguments exceeds tsc's variadic inference ceiling and |
| 471 | // silently drops the tail layers from the inferred union. |
| 472 | Layer.mergeAll( |
| 473 | Diagnostics.EndpointHealthcheckProvider(), |
| 474 | Dlp.EntryProvider(), |
| 475 | Dlp.ProfileProvider(), |
| 476 | Dns.AccountDnsSettingsProvider(), |
| 477 | Dns.DnssecProvider(), |
| 478 | Dns.FirewallProvider(), |
| 479 | Dns.RecordProvider(), |
| 480 | Dns.ViewProvider(), |
| 481 | Dns.ZoneDnsSettingsProvider(), |
| 482 | Dns.ZoneTransferAclProvider(), |
| 483 | Dns.ZoneTransferIncomingProvider(), |
| 484 | Dns.ZoneTransferOutgoingProvider(), |
| 485 | Dns.ZoneTransferPeerProvider(), |
| 486 | Dns.ZoneTransferTsigProvider(), |
| 487 | Email.AddressProvider(), |
| 488 | Email.AllowPolicyProvider(), |
| 489 | Email.BlockSenderProvider(), |
| 490 | Email.CatchAllProvider(), |
| 491 | Email.DomainProvider(), |
| 492 | Email.ImpersonationRegistryEntryProvider(), |
| 493 | Email.RoutingProvider(), |
| 494 | Email.RuleProvider(), |
| 495 | Email.SendingSubdomainProvider(), |
| 496 | Email.TrustedDomainProvider(), |
| 497 | Firewall.AccessRuleProvider(), |
| 498 | Firewall.LockdownProvider(), |
| 499 | Firewall.UaRuleProvider(), |
| 500 | Flagship.AppProvider(), |
| 501 | Flagship.FlagProvider(), |
| 502 | Fraud.DetectionSettingsProvider(), |
| 503 | GoogleTagGateway.GoogleTagGatewayProvider(), |
| 504 | Group.GroupProvider(), |
| 505 | Healthcheck.HealthcheckProvider(), |
| 506 | HostnameTlsSetting.HostnameTlsSettingProvider(), |
| 507 | Hyperdrive.ConnectionProvider(), |
| 508 | Iam.ResourceGroupProvider(), |
| 509 | Iam.UserGroupMembershipProvider(), |
| 510 | Iam.UserGroupProvider(), |
| 511 | Images.SigningKeyProvider(), |
| 512 | Images.VariantProvider(), |
| 513 | Intel.IndicatorFeedPermissionProvider(), |
| 514 | Intel.IndicatorFeedProvider(), |
| 515 | KeylessCertificate.KeylessCertificateProvider(), |
| 516 | KV.NamespaceProvider(), |
| 517 | LeakedCredentialCheck.LeakedCredentialCheckProvider(), |
| 518 | LeakedCredentialCheck.LeakedCredentialDetectionProvider(), |
| 519 | List.ListProvider(), |
| 520 | Location.LocationProvider(), |
| 521 | Logging.LoggingProvider(), |
| 522 | Logpush.JobProvider(), |
| 523 | LogsControl.CmbConfigProvider(), |
| 524 | LogsControl.LogsRetentionFlagProvider(), |
| 525 | ), |
| 526 | Layer.mergeAll( |
| 527 | MagicCloudNetworking.CatalogSyncProvider(), |
| 528 | MagicCloudNetworking.CloudIntegrationProvider(), |
| 529 | MagicCloudNetworking.OnRampProvider(), |
| 530 | MagicNetworkMonitoring.ConfigProvider(), |
| 531 | MagicNetworkMonitoring.RuleProvider(), |
| 532 | MagicTransit.GreTunnelProvider(), |
| 533 | MagicTransit.IpsecTunnelProvider(), |
| 534 | MagicTransit.MagicAppProvider(), |
| 535 | MagicTransit.MagicSiteAclProvider(), |
| 536 | MagicTransit.MagicSiteLanProvider(), |
| 537 | MagicTransit.MagicSiteProvider(), |
| 538 | MagicTransit.MagicSiteWanProvider(), |
| 539 | MagicTransit.MagicStaticRouteProvider(), |
| 540 | ManagedTransforms.ManagedTransformsProvider(), |
| 541 | McpPortal.McpPortalProvider(), |
| 542 | McpServer.McpServerProvider(), |
| 543 | MtlsCertificate.MtlsCertificateProvider(), |
| 544 | NetworkInterconnects.NetworkInterconnectSettingsProvider(), |
| 545 | Organization.OrganizationProvider(), |
| 546 | OriginCaCertificate.OriginCaCertificateProvider(), |
| 547 | OriginPostQuantumEncryption.OriginPostQuantumEncryptionProvider(), |
| 548 | OriginTlsClientAuth.CertificateProvider(), |
| 549 | OriginTlsClientAuth.HostnameAssociationProvider(), |
| 550 | OriginTlsClientAuth.HostnameCertificateProvider(), |
| 551 | OriginTlsClientAuth.SettingProvider(), |
| 552 | PageRule.PageRuleProvider(), |
| 553 | Pages.DeploymentProvider(), |
| 554 | Pages.DomainProvider(), |
| 555 | Pages.ProjectProvider(), |
| 556 | PageShield.PolicyProvider(), |
| 557 | PageShield.SettingsProvider(), |
| 558 | Pipelines.LegacyPipelineProvider(), |
| 559 | Pipelines.PipelineProvider(), |
| 560 | Pipelines.SinkProvider(), |
| 561 | Pipelines.StreamProvider(), |
| 562 | ProxyEndpoint.ProxyEndpointProvider(), |
| 563 | Queue.ConsumerProvider(), |
| 564 | Queue.QueueProvider(), |
| 565 | Queue.SubscriptionProvider(), |
| 566 | R2.BucketEventNotificationProvider(), |
| 567 | R2.BucketProvider(), |
| 568 | R2.BucketSippyProvider(), |
| 569 | R2.DataCatalogProvider(), |
| 570 | R2.SuperSlurperJobProvider(), |
| 571 | RealtimeKit.AppProvider(), |
| 572 | RealtimeKit.PresetProvider(), |
| 573 | RealtimeKit.WebhookProvider(), |
| 574 | RegionalHostname.RegionalHostnameProvider(), |
| 575 | Registrar.DomainProvider(), |
| 576 | ResourceSharing.ShareProvider(), |
| 577 | ResourceSharing.ShareRecipientProvider(), |
| 578 | ResourceSharing.ShareResourceProvider(), |
| 579 | RiskScoring.IntegrationProvider(), |
| 580 | Rule.RuleProvider(), |
| 581 | Rules.ListProvider(), |
| 582 | Ruleset.AccountEntrypointProvider(), |
| 583 | Ruleset.CustomRulesetProvider(), |
| 584 | Ruleset.RulesetProvider(), |
| 585 | Rum.RuleProvider(), |
| 586 | Rum.SiteProvider(), |
| 587 | SchemaValidation.OperationSettingProvider(), |
| 588 | SchemaValidation.SchemaProvider(), |
| 589 | SchemaValidation.SettingsProvider(), |
| 590 | SecretsStore.SecretsStoreProvider(), |
| 591 | SecretsStore.StoreSecretProvider(), |
| 592 | SecurityTxt.SecurityTxtProvider(), |
| 593 | Snippets.SnippetProvider(), |
| 594 | Snippets.SnippetRulesProvider(), |
| 595 | Spectrum.ApplicationProvider(), |
| 596 | Speed.TestScheduleProvider(), |
| 597 | Ssl.CertificatePackProvider(), |
| 598 | Ssl.UniversalSslProvider(), |
| 599 | Stream.LiveInputOutputProvider(), |
| 600 | Stream.LiveInputProvider(), |
| 601 | Stream.SigningKeyProvider(), |
| 602 | Stream.WatermarkProvider(), |
| 603 | Stream.WebhookProvider(), |
| 604 | Tag.TagProvider(), |
| 605 | Tags.AccountResourceTagsProvider(), |
| 606 | Tags.ZoneResourceTagsProvider(), |
| 607 | TokenValidation.RuleProvider(), |
| 608 | TokenValidation.TokenConfigurationProvider(), |
| 609 | Tunnel.ConfigurationProvider(), |
| 610 | Tunnel.HostnameRouteProvider(), |
| 611 | Tunnel.RouteProvider(), |
| 612 | Tunnel.TunnelProvider(), |
| 613 | Tunnel.VirtualNetworkProvider(), |
| 614 | Tunnel.WarpConnectorProvider(), |
| 615 | ), |
| 616 | Layer.mergeAll( |
| 617 | Turnstile.WidgetProvider(), |
| 618 | UrlNorm.UrlNormalizationProvider(), |
| 619 | Vectorize.IndexProvider(), |
| 620 | Vectorize.MetadataIndexProvider(), |
| 621 | VpcService.VpcServiceProvider(), |
| 622 | VulnScanner.VulnScannerCredentialProvider(), |
| 623 | VulnScanner.VulnScannerCredentialSetProvider(), |
| 624 | VulnScanner.VulnScannerTargetEnvironmentProvider(), |
| 625 | WaitingRoom.SettingsProvider(), |
| 626 | WaitingRoom.WaitingRoomProvider(), |
| 627 | Web3.HostnameContentListProvider(), |
| 628 | Web3.HostnameProvider(), |
| 629 | Workers.AccountSettingProvider(), |
| 630 | Workers.ObservabilityDestinationProvider(), |
| 631 | Workers.SubdomainProvider(), |
| 632 | Workers.WorkerProvider(), |
| 633 | Workers.WorkerRouteProvider(), |
| 634 | WorkersForPlatforms.DispatchNamespaceProvider(), |
| 635 | Workflows.WorkflowProvider(), |
| 636 | Zaraz.ConfigProvider(), |
| 637 | Zone.CustomNameserversProvider(), |
| 638 | Zone.HoldProvider(), |
| 639 | Zone.SettingProvider(), |
| 640 | Zone.ZoneProvider(), |
| 641 | ), |
| 642 | ), |
| 643 | ), |
| 644 | Layer.provideMerge( |
| 645 | Layer.mergeAll( |
| 646 | LoadBalancer.LoadBalancerProvider(), |
| 647 | LoadBalancer.MonitorProvider(), |
| 648 | LoadBalancer.MonitorGroupProvider(), |
| 649 | LoadBalancer.PoolProvider(), |
| 650 | Command.providers(), |
| 651 | KeyPairProvider(), |
| 652 | RandomProvider(), |
| 653 | // DNS-01 solver for `ACME.Certificate` over this account's zones. |
| 654 | Dns.AcmeDnsSolverLive, |
| 655 | ), |
| 656 | ), |
| 657 | // Plan-executable data-source capabilities (`Binding.Service.execute`). |
| 658 | Layer.provideMerge(GetIdentityProviderHttp), |
| 659 | Layer.provide(DockerLive), |
| 660 | // Note: `localRuntimeServices()` is no longer provided globally — each |
| 661 | // local provider composes it into its `ProviderLayer.dual` local thunk, |
| 662 | // so workerd machinery only builds when a local variant is actually |
| 663 | // demanded (dev runs, or deleting a local-mode row during deploy). |
| 664 | Layer.provideMerge(CloudflareApiLive()), |
| 665 | Layer.orDie, |
| 666 | ); |
| 667 | |
| 668 | /** |
| 669 | * The foundation every effect tree that talks to the Cloudflare API |
| 670 | * shares — credentials resolved through the Alchemy auth provider, |
| 671 | * account environment, Access, profile + credential store. |
| 672 | * |
| 673 | * Used by {@link providers} and the Cloudflare state store |
| 674 | * ({@link ../Cloudflare/StateStore/State.ts state}) so that provider |
| 675 | * lifecycle operations and state-store init/bootstrap probes run under |
| 676 | * the same services. |
| 677 | * |
| 678 | * No retry policy is installed here: every Cloudflare API call already |
| 679 | * runs under the SDK's `makeDefault` (throttling / 5xx / network, server |
| 680 | * retry-after hints, bounded backoff) when no policy is in context, and |
| 681 | * the Cloudflare-specific misleadingly-tagged transient cases (10001 |
| 682 | * "internal error", 10001 "Unable to authenticate request", 10000 |
| 683 | * "Authentication error" under load) are tagged retryable at the source |
| 684 | * in the SDK's global error map, so that default covers them. |
| 685 | */ |
| 686 | export const CloudflareApiLive = () => |
| 687 | Credentials.fromAuthProvider().pipe( |
| 688 | Layer.provideMerge(CloudflareEnvironment.fromProfile()), |
| 689 | Layer.provideMerge(CloudflareAuth), |
| 690 | Layer.provideMerge(Access.AccessLive), |
| 691 | Layer.provideMerge(ProfileStoreLive), |
| 692 | Layer.provideMerge(CredentialsStoreLive), |
| 693 | ); |