alchemy 2.0.0-beta.60 → 2.0.0-beta.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +9 -1
- package/bin/exec.js +15 -5
- package/bin/exec.js.map +1 -1
- package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
- package/lib/AWS/ACM/Certificate.js +9 -2
- package/lib/AWS/ACM/Certificate.js.map +1 -1
- package/lib/AWS/AutoScaling/AutoScalingGroup.d.ts.map +1 -1
- package/lib/AWS/AutoScaling/AutoScalingGroup.js +18 -11
- package/lib/AWS/AutoScaling/AutoScalingGroup.js.map +1 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.js +6 -1
- package/lib/AWS/AutoScaling/LaunchTemplate.js.map +1 -1
- package/lib/AWS/AutoScaling/ScalingPolicy.d.ts.map +1 -1
- package/lib/AWS/AutoScaling/ScalingPolicy.js +28 -10
- package/lib/AWS/AutoScaling/ScalingPolicy.js.map +1 -1
- package/lib/AWS/CloudFront/PublicKey.d.ts.map +1 -1
- package/lib/AWS/CloudFront/PublicKey.js +5 -1
- package/lib/AWS/CloudFront/PublicKey.js.map +1 -1
- package/lib/AWS/DynamoDB/Table.js +1 -1
- package/lib/AWS/DynamoDB/Table.js.map +1 -1
- package/lib/AWS/ECS/Service.d.ts.map +1 -1
- package/lib/AWS/ECS/Service.js +29 -4
- package/lib/AWS/ECS/Service.js.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.d.ts.map +1 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.js +9 -1
- package/lib/AWS/IAM/OpenIDConnectProvider.js.map +1 -1
- package/lib/AWS/Lambda/Alias.d.ts +26 -0
- package/lib/AWS/Lambda/Alias.d.ts.map +1 -1
- package/lib/AWS/Lambda/Alias.js +31 -0
- package/lib/AWS/Lambda/Alias.js.map +1 -1
- package/lib/AWS/Lambda/EventInvokeConfig.d.ts +36 -0
- package/lib/AWS/Lambda/EventInvokeConfig.d.ts.map +1 -0
- package/lib/AWS/Lambda/EventInvokeConfig.js +76 -0
- package/lib/AWS/Lambda/EventInvokeConfig.js.map +1 -0
- package/lib/AWS/Lambda/Function.d.ts +27 -2
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +23 -2
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Lambda/index.d.ts +1 -0
- package/lib/AWS/Lambda/index.d.ts.map +1 -1
- package/lib/AWS/Lambda/index.js +1 -0
- package/lib/AWS/Lambda/index.js.map +1 -1
- package/lib/AWS/Organizations/DelegatedAdministrator.d.ts.map +1 -1
- package/lib/AWS/Organizations/DelegatedAdministrator.js +10 -2
- package/lib/AWS/Organizations/DelegatedAdministrator.js.map +1 -1
- package/lib/AWS/Organizations/PolicyAttachment.d.ts.map +1 -1
- package/lib/AWS/Organizations/PolicyAttachment.js +10 -4
- package/lib/AWS/Organizations/PolicyAttachment.js.map +1 -1
- package/lib/AWS/Organizations/RootPolicyType.d.ts.map +1 -1
- package/lib/AWS/Organizations/RootPolicyType.js +9 -4
- package/lib/AWS/Organizations/RootPolicyType.js.map +1 -1
- package/lib/AWS/Organizations/TrustedServiceAccess.d.ts.map +1 -1
- package/lib/AWS/Organizations/TrustedServiceAccess.js +8 -1
- package/lib/AWS/Organizations/TrustedServiceAccess.js.map +1 -1
- package/lib/AWS/Route53/HostedZone.d.ts.map +1 -1
- package/lib/AWS/Route53/HostedZone.js +20 -4
- package/lib/AWS/Route53/HostedZone.js.map +1 -1
- package/lib/AWS/Route53/Record.d.ts.map +1 -1
- package/lib/AWS/Route53/Record.js +32 -9
- package/lib/AWS/Route53/Record.js.map +1 -1
- package/lib/Apply.js +7 -1
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/Lock.d.ts +17 -0
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +53 -18
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Bundle/PurePlugin.d.ts.map +1 -1
- package/lib/Bundle/PurePlugin.js +15 -2
- package/lib/Bundle/PurePlugin.js.map +1 -1
- package/lib/Cli/commands/sync.d.ts +22 -0
- package/lib/Cli/commands/sync.d.ts.map +1 -0
- package/lib/Cli/commands/sync.js +64 -0
- package/lib/Cli/commands/sync.js.map +1 -0
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +2 -0
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cloudflare/AI/CustomTopics.d.ts.map +1 -1
- package/lib/Cloudflare/AI/CustomTopics.js +3 -1
- package/lib/Cloudflare/AI/CustomTopics.js.map +1 -1
- package/lib/Cloudflare/AI/Dataset.d.ts.map +1 -1
- package/lib/Cloudflare/AI/Dataset.js +3 -1
- package/lib/Cloudflare/AI/Dataset.js.map +1 -1
- package/lib/Cloudflare/AI/Evaluation.d.ts.map +1 -1
- package/lib/Cloudflare/AI/Evaluation.js +3 -1
- package/lib/Cloudflare/AI/Evaluation.js.map +1 -1
- package/lib/Cloudflare/AI/Gateway.d.ts.map +1 -1
- package/lib/Cloudflare/AI/Gateway.js +5 -6
- package/lib/Cloudflare/AI/Gateway.js.map +1 -1
- package/lib/Cloudflare/AI/GatewayDynamicRouting.d.ts.map +1 -1
- package/lib/Cloudflare/AI/GatewayDynamicRouting.js +3 -1
- package/lib/Cloudflare/AI/GatewayDynamicRouting.js.map +1 -1
- package/lib/Cloudflare/AI/GatewayProvider.d.ts +2 -1
- package/lib/Cloudflare/AI/GatewayProvider.d.ts.map +1 -1
- package/lib/Cloudflare/AI/GatewayProvider.js +5 -2
- package/lib/Cloudflare/AI/GatewayProvider.js.map +1 -1
- package/lib/Cloudflare/AI/ProviderKey.d.ts +135 -0
- package/lib/Cloudflare/AI/ProviderKey.d.ts.map +1 -0
- package/lib/Cloudflare/AI/ProviderKey.js +90 -0
- package/lib/Cloudflare/AI/ProviderKey.js.map +1 -0
- package/lib/Cloudflare/AI/SearchInstance.d.ts.map +1 -1
- package/lib/Cloudflare/AI/SearchInstance.js +5 -4
- package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
- package/lib/Cloudflare/AI/SearchNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/AI/SearchNamespace.js +5 -4
- package/lib/Cloudflare/AI/SearchNamespace.js.map +1 -1
- package/lib/Cloudflare/AI/SearchToken.d.ts.map +1 -1
- package/lib/Cloudflare/AI/SearchToken.js +3 -1
- package/lib/Cloudflare/AI/SearchToken.js.map +1 -1
- package/lib/Cloudflare/AI/SecuritySettings.d.ts.map +1 -1
- package/lib/Cloudflare/AI/SecuritySettings.js +3 -1
- package/lib/Cloudflare/AI/SecuritySettings.js.map +1 -1
- package/lib/Cloudflare/AI/index.d.ts +1 -0
- package/lib/Cloudflare/AI/index.d.ts.map +1 -1
- package/lib/Cloudflare/AI/index.js +1 -0
- package/lib/Cloudflare/AI/index.js.map +1 -1
- package/lib/Cloudflare/Access/InfrastructureTarget.d.ts.map +1 -1
- package/lib/Cloudflare/Access/InfrastructureTarget.js +3 -1
- package/lib/Cloudflare/Access/InfrastructureTarget.js.map +1 -1
- package/lib/Cloudflare/Access/Organization.d.ts.map +1 -1
- package/lib/Cloudflare/Access/Organization.js +1 -1
- package/lib/Cloudflare/Access/Organization.js.map +1 -1
- package/lib/Cloudflare/Access/Policy.d.ts.map +1 -1
- package/lib/Cloudflare/Access/Policy.js +3 -1
- package/lib/Cloudflare/Access/Policy.js.map +1 -1
- package/lib/Cloudflare/Account/Account.d.ts.map +1 -1
- package/lib/Cloudflare/Account/Account.js +3 -1
- package/lib/Cloudflare/Account/Account.js.map +1 -1
- package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
- package/lib/Cloudflare/ApiToken/AccountApiToken.js +1 -1
- package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
- package/lib/Cloudflare/ApiToken/UserApiToken.d.ts.map +1 -1
- package/lib/Cloudflare/ApiToken/UserApiToken.js +1 -1
- package/lib/Cloudflare/ApiToken/UserApiToken.js.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.d.ts +3 -0
- package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Auth/AuthProvider.js +51 -14
- package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
- package/lib/Cloudflare/BotManagement/BotManagement.d.ts.map +1 -1
- package/lib/Cloudflare/BotManagement/BotManagement.js +3 -1
- package/lib/Cloudflare/BotManagement/BotManagement.js.map +1 -1
- package/lib/Cloudflare/Cache/Reserve.d.ts.map +1 -1
- package/lib/Cloudflare/Cache/Reserve.js +3 -1
- package/lib/Cloudflare/Cache/Reserve.js.map +1 -1
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.js +3 -1
- package/lib/Cloudflare/ClientCertificate/ClientCertificate.js.map +1 -1
- package/lib/Cloudflare/Containers/Container.d.ts +2 -2
- package/lib/Cloudflare/Containers/Container.js +2 -2
- package/lib/Cloudflare/ContentScanning/ContentScanning.d.ts.map +1 -1
- package/lib/Cloudflare/ContentScanning/ContentScanning.js +3 -1
- package/lib/Cloudflare/ContentScanning/ContentScanning.js.map +1 -1
- package/lib/Cloudflare/CustomCertificate/CustomCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/CustomCertificate/CustomCertificate.js +3 -1
- package/lib/Cloudflare/CustomCertificate/CustomCertificate.js.map +1 -1
- package/lib/Cloudflare/CustomHostname/CustomHostname.d.ts.map +1 -1
- package/lib/Cloudflare/CustomHostname/CustomHostname.js +1 -1
- package/lib/Cloudflare/CustomHostname/CustomHostname.js.map +1 -1
- package/lib/Cloudflare/CustomHostname/FallbackOrigin.d.ts.map +1 -1
- package/lib/Cloudflare/CustomHostname/FallbackOrigin.js +1 -1
- package/lib/Cloudflare/CustomHostname/FallbackOrigin.js.map +1 -1
- package/lib/Cloudflare/CustomNameserver/CustomNameserver.d.ts.map +1 -1
- package/lib/Cloudflare/CustomNameserver/CustomNameserver.js +3 -1
- package/lib/Cloudflare/CustomNameserver/CustomNameserver.js.map +1 -1
- package/lib/Cloudflare/D1/Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/Database.js +2 -2
- package/lib/Cloudflare/D1/Database.js.map +1 -1
- package/lib/Cloudflare/DNS/AccountSettings.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/AccountSettings.js +3 -1
- package/lib/Cloudflare/DNS/AccountSettings.js.map +1 -1
- package/lib/Cloudflare/DNS/Dnssec.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/Dnssec.js +3 -1
- package/lib/Cloudflare/DNS/Dnssec.js.map +1 -1
- package/lib/Cloudflare/DNS/Firewall.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/Firewall.js +3 -1
- package/lib/Cloudflare/DNS/Firewall.js.map +1 -1
- package/lib/Cloudflare/DNS/Record.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/Record.js +3 -1
- package/lib/Cloudflare/DNS/Record.js.map +1 -1
- package/lib/Cloudflare/DNS/View.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/View.js +3 -1
- package/lib/Cloudflare/DNS/View.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneSettings.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneSettings.js +3 -1
- package/lib/Cloudflare/DNS/ZoneSettings.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferAcl.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferAcl.js +3 -1
- package/lib/Cloudflare/DNS/ZoneTransferAcl.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferIncoming.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferIncoming.js +3 -1
- package/lib/Cloudflare/DNS/ZoneTransferIncoming.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferOutgoing.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferOutgoing.js +3 -1
- package/lib/Cloudflare/DNS/ZoneTransferOutgoing.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferPeer.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferPeer.js +3 -1
- package/lib/Cloudflare/DNS/ZoneTransferPeer.js.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferTsig.d.ts.map +1 -1
- package/lib/Cloudflare/DNS/ZoneTransferTsig.js +3 -1
- package/lib/Cloudflare/DNS/ZoneTransferTsig.js.map +1 -1
- package/lib/Cloudflare/Email/Address.d.ts.map +1 -1
- package/lib/Cloudflare/Email/Address.js +3 -1
- package/lib/Cloudflare/Email/Address.js.map +1 -1
- package/lib/Cloudflare/Email/AllowPolicy.d.ts.map +1 -1
- package/lib/Cloudflare/Email/AllowPolicy.js +1 -1
- package/lib/Cloudflare/Email/AllowPolicy.js.map +1 -1
- package/lib/Cloudflare/Email/BlockSender.d.ts.map +1 -1
- package/lib/Cloudflare/Email/BlockSender.js +1 -1
- package/lib/Cloudflare/Email/BlockSender.js.map +1 -1
- package/lib/Cloudflare/Email/CatchAll.d.ts.map +1 -1
- package/lib/Cloudflare/Email/CatchAll.js +8 -2
- package/lib/Cloudflare/Email/CatchAll.js.map +1 -1
- package/lib/Cloudflare/Email/Domain.d.ts.map +1 -1
- package/lib/Cloudflare/Email/Domain.js +3 -1
- package/lib/Cloudflare/Email/Domain.js.map +1 -1
- package/lib/Cloudflare/Email/ImpersonationRegistryEntry.d.ts.map +1 -1
- package/lib/Cloudflare/Email/ImpersonationRegistryEntry.js +1 -1
- package/lib/Cloudflare/Email/ImpersonationRegistryEntry.js.map +1 -1
- package/lib/Cloudflare/Email/Routing.d.ts.map +1 -1
- package/lib/Cloudflare/Email/Routing.js +3 -1
- package/lib/Cloudflare/Email/Routing.js.map +1 -1
- package/lib/Cloudflare/Email/Rule.d.ts.map +1 -1
- package/lib/Cloudflare/Email/Rule.js +3 -1
- package/lib/Cloudflare/Email/Rule.js.map +1 -1
- package/lib/Cloudflare/Email/SendingSubdomain.d.ts.map +1 -1
- package/lib/Cloudflare/Email/SendingSubdomain.js +1 -1
- package/lib/Cloudflare/Email/SendingSubdomain.js.map +1 -1
- package/lib/Cloudflare/Email/TrustedDomain.d.ts.map +1 -1
- package/lib/Cloudflare/Email/TrustedDomain.js +1 -1
- package/lib/Cloudflare/Email/TrustedDomain.js.map +1 -1
- package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
- package/lib/Cloudflare/Fetcher.js +10 -3
- package/lib/Cloudflare/Fetcher.js.map +1 -1
- package/lib/Cloudflare/Flagship/App.d.ts.map +1 -1
- package/lib/Cloudflare/Flagship/App.js +2 -3
- package/lib/Cloudflare/Flagship/App.js.map +1 -1
- package/lib/Cloudflare/Fraud/DetectionSettings.d.ts.map +1 -1
- package/lib/Cloudflare/Fraud/DetectionSettings.js +3 -1
- package/lib/Cloudflare/Fraud/DetectionSettings.js.map +1 -1
- package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.d.ts.map +1 -1
- package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js +8 -2
- package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js.map +1 -1
- package/lib/Cloudflare/Healthcheck/Healthcheck.d.ts.map +1 -1
- package/lib/Cloudflare/Healthcheck/Healthcheck.js +3 -1
- package/lib/Cloudflare/Healthcheck/Healthcheck.js.map +1 -1
- package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.d.ts.map +1 -1
- package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js +3 -1
- package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Connection.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Connection.js +2 -4
- package/lib/Cloudflare/Hyperdrive/Connection.js.map +1 -1
- package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -1
- package/lib/Cloudflare/KV/Namespace.js +5 -4
- package/lib/Cloudflare/KV/Namespace.js.map +1 -1
- package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.js +3 -1
- package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.js.map +1 -1
- package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.d.ts.map +1 -1
- package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.js +3 -1
- package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.js.map +1 -1
- package/lib/Cloudflare/LoadBalancer/LoadBalancer.d.ts.map +1 -1
- package/lib/Cloudflare/LoadBalancer/LoadBalancer.js +3 -1
- package/lib/Cloudflare/LoadBalancer/LoadBalancer.js.map +1 -1
- package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.d.ts.map +1 -1
- package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.js +3 -1
- package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.js.map +1 -1
- package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.js +3 -1
- package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.js.map +1 -1
- package/lib/Cloudflare/Organization/Organization.d.ts.map +1 -1
- package/lib/Cloudflare/Organization/Organization.js +3 -1
- package/lib/Cloudflare/Organization/Organization.js.map +1 -1
- package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.js +7 -2
- package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.js.map +1 -1
- package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.d.ts.map +1 -1
- package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.js +3 -1
- package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.js.map +1 -1
- package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.d.ts.map +1 -1
- package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.js +5 -1
- package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.js.map +1 -1
- package/lib/Cloudflare/PageRule/PageRule.d.ts.map +1 -1
- package/lib/Cloudflare/PageRule/PageRule.js +3 -1
- package/lib/Cloudflare/PageRule/PageRule.js.map +1 -1
- package/lib/Cloudflare/Providers.d.ts +29 -0
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +30 -19
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Consumer.js +3 -1
- package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
- package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Queue.js +5 -4
- package/lib/Cloudflare/Queues/Queue.js.map +1 -1
- package/lib/Cloudflare/Queues/Subscription.d.ts.map +1 -1
- package/lib/Cloudflare/Queues/Subscription.js +3 -1
- package/lib/Cloudflare/Queues/Subscription.js.map +1 -1
- package/lib/Cloudflare/R2/Bucket.d.ts +98 -0
- package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/Bucket.js +141 -3
- package/lib/Cloudflare/R2/Bucket.js.map +1 -1
- package/lib/Cloudflare/RegionalHostname/RegionalHostname.d.ts.map +1 -1
- package/lib/Cloudflare/RegionalHostname/RegionalHostname.js +3 -1
- package/lib/Cloudflare/RegionalHostname/RegionalHostname.js.map +1 -1
- package/lib/Cloudflare/Ruleset/Ruleset.d.ts.map +1 -1
- package/lib/Cloudflare/Ruleset/Ruleset.js +8 -3
- package/lib/Cloudflare/Ruleset/Ruleset.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.js +31 -5
- package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
- package/lib/Cloudflare/SecurityTxt/SecurityTxt.d.ts.map +1 -1
- package/lib/Cloudflare/SecurityTxt/SecurityTxt.js +3 -1
- package/lib/Cloudflare/SecurityTxt/SecurityTxt.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +15 -0
- package/lib/Cloudflare/StateStore/State.d.ts +30 -1
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +85 -16
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/Tags/AccountResourceTags.d.ts.map +1 -1
- package/lib/Cloudflare/Tags/AccountResourceTags.js +8 -3
- package/lib/Cloudflare/Tags/AccountResourceTags.js.map +1 -1
- package/lib/Cloudflare/Tunnel/Route.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/Route.js +3 -1
- package/lib/Cloudflare/Tunnel/Route.js.map +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.d.ts.map +1 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js +3 -1
- package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +3 -1
- package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
- package/lib/Cloudflare/Vectorize/VectorizeIndex.d.ts.map +1 -1
- package/lib/Cloudflare/Vectorize/VectorizeIndex.js +2 -3
- package/lib/Cloudflare/Vectorize/VectorizeIndex.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcService.d.ts.map +1 -1
- package/lib/Cloudflare/VpcService/VpcService.js +1 -1
- package/lib/Cloudflare/VpcService/VpcService.js.map +1 -1
- package/lib/Cloudflare/WaitingRoom/WaitingRoom.d.ts.map +1 -1
- package/lib/Cloudflare/WaitingRoom/WaitingRoom.js +3 -1
- package/lib/Cloudflare/WaitingRoom/WaitingRoom.js.map +1 -1
- package/lib/Cloudflare/Web3/ContentList.d.ts.map +1 -1
- package/lib/Cloudflare/Web3/ContentList.js +3 -1
- package/lib/Cloudflare/Web3/ContentList.js.map +1 -1
- package/lib/Cloudflare/Web3/Hostname.d.ts.map +1 -1
- package/lib/Cloudflare/Web3/Hostname.js +3 -1
- package/lib/Cloudflare/Web3/Hostname.js.map +1 -1
- package/lib/Cloudflare/Workers/Cache.d.ts +71 -0
- package/lib/Cloudflare/Workers/Cache.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/Cache.js +64 -0
- package/lib/Cloudflare/Workers/Cache.js.map +1 -0
- package/lib/Cloudflare/Workers/CronEventSource.d.ts +180 -6
- package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/CronEventSource.js +180 -6
- package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.d.ts +36 -1
- package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObject.js +36 -1
- package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts +11 -0
- package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectState.js +7 -0
- package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
- package/lib/Cloudflare/Workers/Fetch.js +2 -2
- package/lib/Cloudflare/Workers/Fetch.js.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +3 -0
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +230 -4
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +161 -7
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +9 -0
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +15 -0
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +30 -0
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +27 -5
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerLoader.js +9 -1
- 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 +365 -18
- package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +20 -3
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.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/WorkersForPlatforms/DispatchNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js +2 -3
- package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.d.ts +200 -24
- package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/Workflow.js +126 -28
- package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workflows/WorkflowBridge.js +42 -3
- package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
- package/lib/Cloudflare/Zaraz/Config.d.ts +1 -0
- package/lib/Cloudflare/Zaraz/Config.d.ts.map +1 -1
- package/lib/Cloudflare/Zaraz/Config.js +8 -2
- package/lib/Cloudflare/Zaraz/Config.js.map +1 -1
- package/lib/Cloudflare/Zone/Zone.d.ts.map +1 -1
- package/lib/Cloudflare/Zone/Zone.js +1 -0
- package/lib/Cloudflare/Zone/Zone.js.map +1 -1
- package/lib/Docker/Container.d.ts.map +1 -1
- package/lib/Docker/Container.js +11 -1
- package/lib/Docker/Container.js.map +1 -1
- package/lib/Drizzle/Schema.d.ts.map +1 -1
- package/lib/Drizzle/Schema.js +12 -5
- package/lib/Drizzle/Schema.js.map +1 -1
- package/lib/Neon/Branch.d.ts.map +1 -1
- package/lib/Neon/Branch.js +15 -3
- package/lib/Neon/Branch.js.map +1 -1
- package/lib/Output.d.ts +13 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +17 -3
- package/lib/Output.js.map +1 -1
- package/lib/Planetscale/Postgres/PostgresRole.js +2 -2
- package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -1
- package/lib/Provider.d.ts +8 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +38 -3
- package/lib/Provider.js.map +1 -1
- package/lib/Ref.d.ts +9 -1
- package/lib/Ref.d.ts.map +1 -1
- package/lib/Ref.js +2 -1
- package/lib/Ref.js.map +1 -1
- package/lib/Resource.d.ts +44 -0
- package/lib/Resource.d.ts.map +1 -1
- package/lib/Resource.js +22 -1
- package/lib/Resource.js.map +1 -1
- package/lib/Stack.js +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +4 -4
- package/lib/State/HttpStateStore.d.ts +12 -0
- package/lib/State/HttpStateStore.d.ts.map +1 -1
- package/lib/State/HttpStateStore.js +46 -5
- package/lib/State/HttpStateStore.js.map +1 -1
- package/lib/Sync.d.ts +109 -0
- package/lib/Sync.d.ts.map +1 -0
- package/lib/Sync.js +312 -0
- package/lib/Sync.js.map +1 -0
- package/lib/Test/Bun.d.ts +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +1 -1
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Http.d.ts +67 -0
- package/lib/Test/Http.d.ts.map +1 -1
- package/lib/Test/Http.js +69 -0
- package/lib/Test/Http.js.map +1 -1
- package/lib/Test/Vitest.d.ts +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +1 -0
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/proxy-chain.js +14 -15
- package/lib/Util/proxy-chain.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +19 -19
- package/src/AWS/ACM/Certificate.ts +13 -2
- package/src/AWS/AutoScaling/AutoScalingGroup.ts +21 -15
- package/src/AWS/AutoScaling/LaunchTemplate.ts +6 -1
- package/src/AWS/AutoScaling/ScalingPolicy.ts +31 -17
- package/src/AWS/CloudFront/PublicKey.ts +4 -0
- package/src/AWS/DynamoDB/Table.ts +1 -1
- package/src/AWS/ECS/Service.ts +35 -6
- package/src/AWS/IAM/OpenIDConnectProvider.ts +9 -1
- package/src/AWS/Lambda/Alias.ts +42 -0
- package/src/AWS/Lambda/EventInvokeConfig.ts +150 -0
- package/src/AWS/Lambda/Function.ts +35 -2
- package/src/AWS/Lambda/index.ts +1 -0
- package/src/AWS/Organizations/DelegatedAdministrator.ts +11 -3
- package/src/AWS/Organizations/PolicyAttachment.ts +10 -4
- package/src/AWS/Organizations/RootPolicyType.ts +9 -4
- package/src/AWS/Organizations/TrustedServiceAccess.ts +9 -3
- package/src/AWS/Route53/HostedZone.ts +30 -13
- package/src/AWS/Route53/Record.ts +44 -22
- package/src/Apply.ts +7 -1
- package/src/Auth/Lock.ts +62 -18
- package/src/Bundle/PurePlugin.ts +15 -2
- package/src/Cli/commands/sync.ts +123 -0
- package/src/Cli/main.ts +2 -0
- package/src/Cloudflare/AI/CustomTopics.ts +3 -1
- package/src/Cloudflare/AI/Dataset.ts +3 -1
- package/src/Cloudflare/AI/Evaluation.ts +3 -1
- package/src/Cloudflare/AI/Gateway.ts +5 -6
- package/src/Cloudflare/AI/GatewayDynamicRouting.ts +3 -1
- package/src/Cloudflare/AI/GatewayProvider.ts +5 -2
- package/src/Cloudflare/AI/ProviderKey.ts +161 -0
- package/src/Cloudflare/AI/SearchInstance.ts +5 -4
- package/src/Cloudflare/AI/SearchNamespace.ts +5 -4
- package/src/Cloudflare/AI/SearchToken.ts +3 -1
- package/src/Cloudflare/AI/SecuritySettings.ts +3 -0
- package/src/Cloudflare/AI/index.ts +1 -0
- package/src/Cloudflare/Access/InfrastructureTarget.ts +4 -1
- package/src/Cloudflare/Access/Organization.ts +1 -0
- package/src/Cloudflare/Access/Policy.ts +3 -1
- package/src/Cloudflare/Account/Account.ts +3 -1
- package/src/Cloudflare/ApiToken/AccountApiToken.ts +1 -0
- package/src/Cloudflare/ApiToken/UserApiToken.ts +1 -0
- package/src/Cloudflare/Auth/AuthProvider.ts +69 -8
- package/src/Cloudflare/BotManagement/BotManagement.ts +3 -1
- package/src/Cloudflare/Cache/Reserve.ts +3 -1
- package/src/Cloudflare/ClientCertificate/ClientCertificate.ts +3 -1
- package/src/Cloudflare/Containers/Container.ts +2 -2
- package/src/Cloudflare/ContentScanning/ContentScanning.ts +3 -1
- package/src/Cloudflare/CustomCertificate/CustomCertificate.ts +3 -1
- package/src/Cloudflare/CustomHostname/CustomHostname.ts +1 -0
- package/src/Cloudflare/CustomHostname/FallbackOrigin.ts +1 -0
- package/src/Cloudflare/CustomNameserver/CustomNameserver.ts +3 -1
- package/src/Cloudflare/D1/Database.ts +2 -2
- package/src/Cloudflare/DNS/AccountSettings.ts +3 -1
- package/src/Cloudflare/DNS/Dnssec.ts +3 -1
- package/src/Cloudflare/DNS/Firewall.ts +3 -1
- package/src/Cloudflare/DNS/Record.ts +3 -1
- package/src/Cloudflare/DNS/View.ts +3 -1
- package/src/Cloudflare/DNS/ZoneSettings.ts +3 -1
- package/src/Cloudflare/DNS/ZoneTransferAcl.ts +3 -1
- package/src/Cloudflare/DNS/ZoneTransferIncoming.ts +3 -1
- package/src/Cloudflare/DNS/ZoneTransferOutgoing.ts +3 -1
- package/src/Cloudflare/DNS/ZoneTransferPeer.ts +3 -1
- package/src/Cloudflare/DNS/ZoneTransferTsig.ts +3 -1
- package/src/Cloudflare/Email/Address.ts +3 -1
- package/src/Cloudflare/Email/AllowPolicy.ts +1 -0
- package/src/Cloudflare/Email/BlockSender.ts +1 -0
- package/src/Cloudflare/Email/CatchAll.ts +7 -2
- package/src/Cloudflare/Email/Domain.ts +3 -1
- package/src/Cloudflare/Email/ImpersonationRegistryEntry.ts +1 -0
- package/src/Cloudflare/Email/Routing.ts +3 -1
- package/src/Cloudflare/Email/Rule.ts +3 -1
- package/src/Cloudflare/Email/SendingSubdomain.ts +1 -0
- package/src/Cloudflare/Email/TrustedDomain.ts +1 -0
- package/src/Cloudflare/Fetcher.ts +12 -5
- package/src/Cloudflare/Flagship/App.ts +2 -3
- package/src/Cloudflare/Fraud/DetectionSettings.ts +3 -1
- package/src/Cloudflare/GoogleTagGateway/GoogleTagGateway.ts +7 -2
- package/src/Cloudflare/Healthcheck/Healthcheck.ts +3 -1
- package/src/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.ts +3 -1
- package/src/Cloudflare/Hyperdrive/Connection.ts +2 -4
- package/src/Cloudflare/KV/Namespace.ts +5 -4
- package/src/Cloudflare/KeylessCertificate/KeylessCertificate.ts +3 -1
- package/src/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.ts +3 -1
- package/src/Cloudflare/LoadBalancer/LoadBalancer.ts +3 -1
- package/src/Cloudflare/ManagedTransforms/ManagedTransforms.ts +3 -1
- package/src/Cloudflare/MtlsCertificate/MtlsCertificate.ts +3 -1
- package/src/Cloudflare/Organization/Organization.ts +3 -1
- package/src/Cloudflare/OriginCaCertificate/OriginCaCertificate.ts +7 -2
- package/src/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.ts +3 -1
- package/src/Cloudflare/OriginTlsClientAuth/HostnameCertificate.ts +5 -1
- package/src/Cloudflare/PageRule/PageRule.ts +3 -1
- package/src/Cloudflare/Providers.ts +34 -19
- package/src/Cloudflare/Queues/Consumer.ts +3 -1
- package/src/Cloudflare/Queues/Queue.ts +5 -4
- package/src/Cloudflare/Queues/Subscription.ts +3 -1
- package/src/Cloudflare/R2/Bucket.ts +230 -3
- package/src/Cloudflare/RegionalHostname/RegionalHostname.ts +3 -1
- package/src/Cloudflare/Ruleset/Ruleset.ts +9 -4
- package/src/Cloudflare/SecretsStore/Secret.ts +46 -5
- package/src/Cloudflare/SecurityTxt/SecurityTxt.ts +3 -1
- package/src/Cloudflare/StateStore/State.ts +89 -24
- package/src/Cloudflare/Tags/AccountResourceTags.ts +9 -5
- package/src/Cloudflare/Tunnel/Route.ts +3 -1
- package/src/Cloudflare/Tunnel/Tunnel.ts +3 -1
- package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +3 -1
- package/src/Cloudflare/Vectorize/VectorizeIndex.ts +2 -3
- package/src/Cloudflare/VpcService/VpcService.ts +1 -0
- package/src/Cloudflare/WaitingRoom/WaitingRoom.ts +3 -1
- package/src/Cloudflare/Web3/ContentList.ts +3 -1
- package/src/Cloudflare/Web3/Hostname.ts +3 -1
- package/src/Cloudflare/Workers/Cache.ts +102 -0
- package/src/Cloudflare/Workers/CronEventSource.ts +180 -6
- package/src/Cloudflare/Workers/DurableObject.ts +36 -1
- package/src/Cloudflare/Workers/DurableObjectState.ts +25 -0
- package/src/Cloudflare/Workers/Fetch.ts +2 -2
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +3 -0
- package/src/Cloudflare/Workers/Worker.ts +315 -9
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +18 -0
- package/src/Cloudflare/Workers/WorkerBridge.ts +37 -10
- package/src/Cloudflare/Workers/WorkerLoader.ts +10 -1
- package/src/Cloudflare/Workers/WorkerProvider.ts +576 -40
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +23 -2
- package/src/Cloudflare/Workers/index.ts +1 -0
- package/src/Cloudflare/WorkersForPlatforms/DispatchNamespace.ts +2 -4
- package/src/Cloudflare/Workflows/Workflow.ts +296 -38
- package/src/Cloudflare/Workflows/WorkflowBridge.ts +62 -12
- package/src/Cloudflare/Zaraz/Config.ts +7 -2
- package/src/Cloudflare/Zone/Zone.ts +1 -0
- package/src/Docker/Container.ts +10 -1
- package/src/Drizzle/Schema.ts +12 -5
- package/src/Neon/Branch.ts +15 -3
- package/src/Output.ts +18 -2
- package/src/Planetscale/Postgres/PostgresRole.ts +2 -2
- package/src/Provider.ts +53 -3
- package/src/Ref.ts +10 -0
- package/src/Resource.ts +50 -1
- package/src/Stack.ts +1 -1
- package/src/State/HttpStateStore.ts +47 -5
- package/src/Sync.ts +494 -0
- package/src/Test/Bun.ts +4 -0
- package/src/Test/Http.ts +133 -0
- package/src/Test/Vitest.ts +11 -0
- package/src/Util/proxy-chain.ts +9 -12
- package/src/index.ts +1 -0
|
@@ -18,14 +18,16 @@ import * as ProviderLayer from "../../Local/ProviderLayer.ts";
|
|
|
18
18
|
import * as Provider from "../../Provider.ts";
|
|
19
19
|
import { type ResourceBinding } from "../../Resource.ts";
|
|
20
20
|
import { Stack } from "../../Stack.ts";
|
|
21
|
+
import { sha256Object } from "../../Util/sha256.ts";
|
|
21
22
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
22
23
|
import { CloudflareLogs } from "../Logs.ts";
|
|
24
|
+
import { listAllZones, resolveZoneId } from "../Zone/lookup.ts";
|
|
23
25
|
import { readAssets, uploadAssets } from "./Assets.ts";
|
|
24
26
|
import { getCompatibility } from "./Compatibility.ts";
|
|
25
27
|
import { isDurableObjectExport } from "./DurableObject.ts";
|
|
26
28
|
import { LocalWorkerProvider } from "./LocalWorkerProvider.ts";
|
|
27
|
-
import { Worker, type WorkerProps } from "./Worker.ts";
|
|
28
|
-
import { getCronBindings } from "./WorkerAsyncBindings.ts";
|
|
29
|
+
import { Worker, type WorkerProps, type WorkerRouteConfig } from "./Worker.ts";
|
|
30
|
+
import { getCacheBinding, getCronBindings } from "./WorkerAsyncBindings.ts";
|
|
29
31
|
import type { WorkerBinding, WorkerSettingsBinding } from "./WorkerBinding.ts";
|
|
30
32
|
import { readPrebuiltWorkerBundle, WorkerBundle } from "./WorkerBundle.ts";
|
|
31
33
|
import { isWorkerLoader } from "./WorkerLoader.ts";
|
|
@@ -91,9 +93,45 @@ const getScriptSettings = (
|
|
|
91
93
|
});
|
|
92
94
|
});
|
|
93
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Deploy-time binding validation rejects an upload whose bindings
|
|
98
|
+
* reference a resource Cloudflare can't see (each resource type has
|
|
99
|
+
* its own typed not-found error, verified against the live API).
|
|
100
|
+
* Every bound resource is provisioned before the Worker deploys —
|
|
101
|
+
* dependency order for KV/R2/D1/queues/etc., a pre-created stub
|
|
102
|
+
* (which exports the Durable Object classes) for circular
|
|
103
|
+
* Worker↔Worker references — so a not-found here is either
|
|
104
|
+
* propagation lag on a just-created resource (a Secrets Store secret
|
|
105
|
+
* still `pending`, a stub script not yet in the registry) that
|
|
106
|
+
* retrying converges, or a genuine misconfiguration that keeps
|
|
107
|
+
* failing and surfaces as the typed error once the bounded budget is
|
|
108
|
+
* exhausted.
|
|
109
|
+
*/
|
|
110
|
+
const isBindingTargetNotFound = (
|
|
111
|
+
e:
|
|
112
|
+
| Effect.Error<ReturnType<typeof workers.putScript>>
|
|
113
|
+
| Effect.Error<ReturnType<typeof wfp.putDispatchNamespaceScript>>,
|
|
114
|
+
): boolean =>
|
|
115
|
+
e._tag === "SecretsStoreBindingNotFound" ||
|
|
116
|
+
e._tag === "KVNamespaceNotFound" ||
|
|
117
|
+
e._tag === "R2BucketNotFound" ||
|
|
118
|
+
e._tag === "D1DatabaseNotFound" ||
|
|
119
|
+
e._tag === "QueueNotFound" ||
|
|
120
|
+
e._tag === "ServiceBindingNotFound" ||
|
|
121
|
+
e._tag === "DurableObjectClassNotFound" ||
|
|
122
|
+
e._tag === "HyperdriveConfigNotFound" ||
|
|
123
|
+
e._tag === "VectorizeIndexNotFound" ||
|
|
124
|
+
e._tag === "DispatchNamespaceNotFound" ||
|
|
125
|
+
e._tag === "MtlsCertificateNotFound";
|
|
126
|
+
|
|
127
|
+
const bindingTargetNotFoundRetrySchedule = () =>
|
|
128
|
+
Schedule.fixed("2 seconds").pipe(Schedule.both(Schedule.recurs(10)));
|
|
129
|
+
|
|
94
130
|
/**
|
|
95
131
|
* Upsert a Worker script, routing to the dispatch-namespace endpoint when
|
|
96
|
-
* `dispatchNamespace` is set. The metadata/files contract is identical
|
|
132
|
+
* `dispatchNamespace` is set. The metadata/files contract is identical, and
|
|
133
|
+
* both endpoints run the same binding validation (see
|
|
134
|
+
* {@link isBindingTargetNotFound}), so both get the same bounded retry.
|
|
97
135
|
*
|
|
98
136
|
* @internal
|
|
99
137
|
*/
|
|
@@ -106,21 +144,35 @@ const putWorkerScript = (params: {
|
|
|
106
144
|
}) =>
|
|
107
145
|
Effect.gen(function* () {
|
|
108
146
|
if (params.dispatchNamespace) {
|
|
109
|
-
return yield* wfp
|
|
147
|
+
return yield* wfp
|
|
148
|
+
.putDispatchNamespaceScript({
|
|
149
|
+
accountId: params.accountId,
|
|
150
|
+
dispatchNamespace: params.dispatchNamespace,
|
|
151
|
+
scriptName: params.scriptName,
|
|
152
|
+
metadata:
|
|
153
|
+
params.metadata as unknown as wfp.PutDispatchNamespaceScriptRequest["metadata"],
|
|
154
|
+
files: params.files,
|
|
155
|
+
})
|
|
156
|
+
.pipe(
|
|
157
|
+
Effect.retry({
|
|
158
|
+
while: isBindingTargetNotFound,
|
|
159
|
+
schedule: bindingTargetNotFoundRetrySchedule(),
|
|
160
|
+
}),
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
return yield* workers
|
|
164
|
+
.putScript({
|
|
110
165
|
accountId: params.accountId,
|
|
111
|
-
dispatchNamespace: params.dispatchNamespace,
|
|
112
166
|
scriptName: params.scriptName,
|
|
113
|
-
metadata:
|
|
114
|
-
params.metadata as unknown as wfp.PutDispatchNamespaceScriptRequest["metadata"],
|
|
167
|
+
metadata: params.metadata,
|
|
115
168
|
files: params.files,
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
});
|
|
169
|
+
})
|
|
170
|
+
.pipe(
|
|
171
|
+
Effect.retry({
|
|
172
|
+
while: isBindingTargetNotFound,
|
|
173
|
+
schedule: bindingTargetNotFoundRetrySchedule(),
|
|
174
|
+
}),
|
|
175
|
+
);
|
|
124
176
|
});
|
|
125
177
|
|
|
126
178
|
/**
|
|
@@ -167,6 +219,146 @@ export const normalizeStateDomains = (
|
|
|
167
219
|
return typeof hostname === "string" ? [`https://${hostname}`] : [];
|
|
168
220
|
});
|
|
169
221
|
|
|
222
|
+
type MetadataHashValue =
|
|
223
|
+
| string
|
|
224
|
+
| number
|
|
225
|
+
| boolean
|
|
226
|
+
| null
|
|
227
|
+
| undefined
|
|
228
|
+
| readonly MetadataHashValue[]
|
|
229
|
+
| { readonly [key: string]: MetadataHashValue };
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Deeply materialize an arbitrary value into a JSON-stable shape for hashing:
|
|
233
|
+
* unwrap `Redacted` secrets by value, ISO-stringify `Date`s, keep plain
|
|
234
|
+
* objects/arrays/primitives, and drop Effects, functions, `undefined`, and
|
|
235
|
+
* class instances (which don't round-trip through `JSON.stringify`). Redacted
|
|
236
|
+
* values contribute by value, not by reference identity, so two
|
|
237
|
+
* independently-constructed secrets with the same contents hash identically.
|
|
238
|
+
*
|
|
239
|
+
* Effects are dropped, never executed: resource-typed `env` entries (Worker
|
|
240
|
+
* effect-classes, R2 buckets, Provider/Context tags, ...) are all Effects
|
|
241
|
+
* whose evaluation requires plan-phase context that is not available inside
|
|
242
|
+
* lifecycle operations (running one here fails with `Service not found:
|
|
243
|
+
* Cloudflare.Worker`). Their deploy-time identity is already captured by the
|
|
244
|
+
* resolved `bindings` data hashed alongside `env`, so skipping them loses no
|
|
245
|
+
* change-detection.
|
|
246
|
+
*/
|
|
247
|
+
const resolveMetadataHashValue = (
|
|
248
|
+
value: unknown,
|
|
249
|
+
): Effect.Effect<MetadataHashValue> =>
|
|
250
|
+
Effect.gen(function* () {
|
|
251
|
+
if (Effect.isEffect(value)) {
|
|
252
|
+
return undefined;
|
|
253
|
+
}
|
|
254
|
+
const resolved = Redacted.isRedacted(value) ? Redacted.value(value) : value;
|
|
255
|
+
|
|
256
|
+
if (
|
|
257
|
+
resolved === null ||
|
|
258
|
+
Predicate.isString(resolved) ||
|
|
259
|
+
Predicate.isNumber(resolved) ||
|
|
260
|
+
Predicate.isBoolean(resolved)
|
|
261
|
+
) {
|
|
262
|
+
return resolved;
|
|
263
|
+
}
|
|
264
|
+
if (resolved === undefined || Predicate.isFunction(resolved)) {
|
|
265
|
+
return undefined;
|
|
266
|
+
}
|
|
267
|
+
if (Predicate.isDate(resolved)) {
|
|
268
|
+
return resolved.toISOString();
|
|
269
|
+
}
|
|
270
|
+
if (Array.isArray(resolved)) {
|
|
271
|
+
return yield* Effect.all(
|
|
272
|
+
resolved.map((item) => resolveMetadataHashValue(item)),
|
|
273
|
+
{ concurrency: "unbounded" },
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
if (Predicate.isObject(resolved)) {
|
|
277
|
+
// Only plain objects round-trip predictably. A class instance would
|
|
278
|
+
// serialize to `{}` (or throw), so drop it rather than hash a lie.
|
|
279
|
+
const prototype = Object.getPrototypeOf(resolved);
|
|
280
|
+
if (prototype !== Object.prototype && prototype !== null) {
|
|
281
|
+
return undefined;
|
|
282
|
+
}
|
|
283
|
+
const entries = yield* Effect.all(
|
|
284
|
+
Object.entries(resolved).map(([key, nested]) =>
|
|
285
|
+
resolveMetadataHashValue(nested).pipe(
|
|
286
|
+
Effect.map(
|
|
287
|
+
(materializedNested) => [key, materializedNested] as const,
|
|
288
|
+
),
|
|
289
|
+
),
|
|
290
|
+
),
|
|
291
|
+
{ concurrency: "unbounded" },
|
|
292
|
+
);
|
|
293
|
+
return Object.fromEntries(
|
|
294
|
+
entries.filter(([, nested]) => nested !== undefined),
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
return undefined;
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
/**
|
|
301
|
+
* The deploy-time metadata surface of a Worker whose changes must trigger an
|
|
302
|
+
* update but that never touch the bundle/vite/asset-content hashes:
|
|
303
|
+
* compatibility, env literals, bindings, asset routing config, cache,
|
|
304
|
+
* limits, logpush, observability, placement, subdomain, and tags. See #745.
|
|
305
|
+
*/
|
|
306
|
+
interface WorkerMetadataHashInput {
|
|
307
|
+
readonly props: WorkerProps;
|
|
308
|
+
readonly bindings: readonly ResourceBinding<Worker["Binding"]>[];
|
|
309
|
+
readonly accountId: string;
|
|
310
|
+
readonly stack: { readonly name: string; readonly stage: string };
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// The asset router config the resource declares (htmlHandling,
|
|
314
|
+
// notFoundHandling, ...), minus the local `directory` path (machine-specific,
|
|
315
|
+
// would break hash stability across machines) and the precomputed `hash`
|
|
316
|
+
// (already compared via `output.hash.assets`). A bare string `assets` is just
|
|
317
|
+
// a directory path, so it contributes nothing here.
|
|
318
|
+
const workerAssetConfigForHash = (assets: WorkerProps["assets"]) => {
|
|
319
|
+
if (!assets || typeof assets === "string") {
|
|
320
|
+
return undefined;
|
|
321
|
+
}
|
|
322
|
+
const { directory: _directory, ...config } = assets;
|
|
323
|
+
if (Predicate.hasProperty(config, "hash")) {
|
|
324
|
+
const { hash: _hash, ...configWithoutHash } = config;
|
|
325
|
+
return configWithoutHash;
|
|
326
|
+
}
|
|
327
|
+
return config;
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Hash a Worker's deploy-time metadata surface so metadata-only edits are
|
|
332
|
+
* detected by the diff (#745). Previously the update decision compared only
|
|
333
|
+
* the bundle/vite/asset-content hashes, so a change to e.g. a compatibility
|
|
334
|
+
* flag or observability config planned as a noop and silently never deployed.
|
|
335
|
+
*/
|
|
336
|
+
const resolveWorkerMetadataHash = ({
|
|
337
|
+
props,
|
|
338
|
+
bindings,
|
|
339
|
+
accountId,
|
|
340
|
+
stack,
|
|
341
|
+
}: WorkerMetadataHashInput): Effect.Effect<string> =>
|
|
342
|
+
resolveMetadataHashValue({
|
|
343
|
+
accountId,
|
|
344
|
+
stack: { name: stack.name, stage: stack.stage },
|
|
345
|
+
compatibility: getCompatibility(props),
|
|
346
|
+
env: props.env,
|
|
347
|
+
bindings: bindings.map((binding) => ({
|
|
348
|
+
sid: binding.sid,
|
|
349
|
+
data: binding.data,
|
|
350
|
+
})),
|
|
351
|
+
assets: workerAssetConfigForHash(props.assets),
|
|
352
|
+
cache: props.cache,
|
|
353
|
+
limits: props.limits,
|
|
354
|
+
logpush: props.logpush,
|
|
355
|
+
observability: props.observability,
|
|
356
|
+
placement: props.placement,
|
|
357
|
+
subdomain: props.subdomain,
|
|
358
|
+
tags: props.tags,
|
|
359
|
+
url: props.url,
|
|
360
|
+
}).pipe(Effect.flatMap((metadata) => sha256Object({ metadata })));
|
|
361
|
+
|
|
170
362
|
export const WorkerProvider = () =>
|
|
171
363
|
ProviderLayer.select({
|
|
172
364
|
live: () => LiveWorkerProvider(),
|
|
@@ -466,6 +658,226 @@ export const LiveWorkerProvider = () =>
|
|
|
466
658
|
return applied;
|
|
467
659
|
});
|
|
468
660
|
|
|
661
|
+
type NormalizedWorkerRoute = {
|
|
662
|
+
pattern: string;
|
|
663
|
+
zoneId: string;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
const routeKey = (route: { pattern: string; zoneId: string }) =>
|
|
667
|
+
`${route.zoneId}:${route.pattern}`;
|
|
668
|
+
|
|
669
|
+
// Derive a concrete hostname inside the zone from a route pattern so
|
|
670
|
+
// zone inference can walk the DNS label hierarchy. A wildcard label
|
|
671
|
+
// (`*.example.com/*`) is replaced with a stand-in label — only the
|
|
672
|
+
// parent labels matter for finding the zone.
|
|
673
|
+
const hostnameFromPattern = (pattern: string): string => {
|
|
674
|
+
const hostPart = pattern.split("/")[0] ?? pattern;
|
|
675
|
+
return hostPart.startsWith("*.")
|
|
676
|
+
? `routes.${hostPart.slice(2)}`
|
|
677
|
+
: hostPart;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
// Resolve each route's zone to a concrete zone id: an explicit
|
|
681
|
+
// `zoneId` wins, then `zone` / `zoneName` via `resolveZoneId`, and
|
|
682
|
+
// finally inference from the pattern's hostname. Duplicate
|
|
683
|
+
// `(zoneId, pattern)` pairs are dropped — Cloudflare enforces one
|
|
684
|
+
// route per pattern per zone.
|
|
685
|
+
const normalizeRoutes = (routes: WorkerRouteConfig[] | undefined) =>
|
|
686
|
+
Effect.gen(function* () {
|
|
687
|
+
if (!routes?.length) return [] as NormalizedWorkerRoute[];
|
|
688
|
+
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
689
|
+
const zoneCache = new Map<string, string>();
|
|
690
|
+
const normalized: NormalizedWorkerRoute[] = [];
|
|
691
|
+
const seen = new Set<string>();
|
|
692
|
+
for (const route of routes) {
|
|
693
|
+
const pattern = route.pattern.trim();
|
|
694
|
+
const zoneId = route.zoneId
|
|
695
|
+
? route.zoneId
|
|
696
|
+
: route.zone || route.zoneName
|
|
697
|
+
? yield* resolveZoneId({
|
|
698
|
+
accountId,
|
|
699
|
+
zone: route.zone ?? route.zoneName!,
|
|
700
|
+
hostname: hostnameFromPattern(pattern),
|
|
701
|
+
})
|
|
702
|
+
: yield* inferZoneIdForHostname(
|
|
703
|
+
hostnameFromPattern(pattern),
|
|
704
|
+
zoneCache,
|
|
705
|
+
);
|
|
706
|
+
const key = routeKey({ pattern, zoneId });
|
|
707
|
+
if (seen.has(key)) continue;
|
|
708
|
+
seen.add(key);
|
|
709
|
+
normalized.push({ pattern, zoneId });
|
|
710
|
+
}
|
|
711
|
+
return normalized;
|
|
712
|
+
});
|
|
713
|
+
|
|
714
|
+
// List the routes attached to `scriptName` across the given zones.
|
|
715
|
+
// Routes without an id/pattern or owned by another script are
|
|
716
|
+
// ignored. Zones the token can't read are skipped rather than
|
|
717
|
+
// failing the whole listing.
|
|
718
|
+
const listWorkerRoutesInZones = (
|
|
719
|
+
scriptName: string,
|
|
720
|
+
zoneIds: readonly string[],
|
|
721
|
+
) => {
|
|
722
|
+
const uniqueZoneIds = Array.from(new Set(zoneIds));
|
|
723
|
+
if (uniqueZoneIds.length === 0) {
|
|
724
|
+
return Effect.succeed([] as Worker["Attributes"]["routes"]);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
const routesByZone = Effect.all(
|
|
728
|
+
uniqueZoneIds.map((zoneId) =>
|
|
729
|
+
workers.listRoutes({ zoneId }).pipe(
|
|
730
|
+
Effect.map((response) =>
|
|
731
|
+
(response.result ?? []).flatMap((route) =>
|
|
732
|
+
route.id && route.pattern && route.script === scriptName
|
|
733
|
+
? [{ id: route.id, pattern: route.pattern, zoneId }]
|
|
734
|
+
: [],
|
|
735
|
+
),
|
|
736
|
+
),
|
|
737
|
+
Effect.catch(() => Effect.succeed([])),
|
|
738
|
+
),
|
|
739
|
+
),
|
|
740
|
+
{ concurrency: "unbounded" },
|
|
741
|
+
);
|
|
742
|
+
|
|
743
|
+
return Effect.map(routesByZone, (routes) => routes.flat());
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
// Observe every route attached to `scriptName` account-wide. Routes
|
|
747
|
+
// are zone-scoped with no account-level enumeration API, so fan out
|
|
748
|
+
// over all of the account's zones. Any failure to enumerate zones
|
|
749
|
+
// (e.g. a token without zone read scope) degrades to "no routes"
|
|
750
|
+
// rather than failing the read.
|
|
751
|
+
const readWorkerRoutes = (scriptName: string) =>
|
|
752
|
+
Effect.gen(function* () {
|
|
753
|
+
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
754
|
+
const accountZones = yield* listAllZones(accountId).pipe(
|
|
755
|
+
Effect.catch(() => Effect.succeed([])),
|
|
756
|
+
);
|
|
757
|
+
return yield* listWorkerRoutesInZones(
|
|
758
|
+
scriptName,
|
|
759
|
+
accountZones.map((zone) => zone.id),
|
|
760
|
+
);
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
// Converge the zone routes attached to `scriptName` to `desired`.
|
|
764
|
+
// Observed cloud state (not `previous`) is the diff baseline —
|
|
765
|
+
// `previous` only contributes zone ids so routes moved out of a zone
|
|
766
|
+
// are still cleaned up after state loss or an interrupted apply.
|
|
767
|
+
const reconcileRoutes = (
|
|
768
|
+
scriptName: string,
|
|
769
|
+
desired: NormalizedWorkerRoute[],
|
|
770
|
+
previous: Worker["Attributes"]["routes"],
|
|
771
|
+
) =>
|
|
772
|
+
Effect.gen(function* () {
|
|
773
|
+
const zoneIds = Array.from(
|
|
774
|
+
new Set([
|
|
775
|
+
...desired.map((route) => route.zoneId),
|
|
776
|
+
...previous.map((route) => route.zoneId),
|
|
777
|
+
]),
|
|
778
|
+
);
|
|
779
|
+
const liveAll = yield* listWorkerRoutesInZones(scriptName, zoneIds);
|
|
780
|
+
const desiredKeys = new Set(desired.map(routeKey));
|
|
781
|
+
const liveByKey = new Map(
|
|
782
|
+
liveAll.map((route) => [routeKey(route), route]),
|
|
783
|
+
);
|
|
784
|
+
|
|
785
|
+
const toRemove = liveAll.filter(
|
|
786
|
+
(route) => !desiredKeys.has(routeKey(route)),
|
|
787
|
+
);
|
|
788
|
+
yield* Effect.all(
|
|
789
|
+
toRemove.map((route) =>
|
|
790
|
+
workers
|
|
791
|
+
.deleteRoute({ zoneId: route.zoneId, routeId: route.id })
|
|
792
|
+
.pipe(Effect.catchTag("RouteNotFound", () => Effect.void)),
|
|
793
|
+
),
|
|
794
|
+
{ concurrency: "unbounded" },
|
|
795
|
+
);
|
|
796
|
+
|
|
797
|
+
if (desired.length === 0) return [];
|
|
798
|
+
|
|
799
|
+
const attachRoute = Effect.fn(function* (
|
|
800
|
+
route: NormalizedWorkerRoute,
|
|
801
|
+
) {
|
|
802
|
+
const existing = liveByKey.get(routeKey(route));
|
|
803
|
+
if (existing) return existing;
|
|
804
|
+
|
|
805
|
+
const zoneRoutes = yield* workers
|
|
806
|
+
.listRoutes({ zoneId: route.zoneId })
|
|
807
|
+
.pipe(
|
|
808
|
+
Effect.map((response) => response.result ?? []),
|
|
809
|
+
Effect.catch(() => Effect.succeed([])),
|
|
810
|
+
);
|
|
811
|
+
const otherOwner = zoneRoutes.find(
|
|
812
|
+
(candidate) =>
|
|
813
|
+
candidate.pattern === route.pattern &&
|
|
814
|
+
candidate.script &&
|
|
815
|
+
candidate.script !== scriptName,
|
|
816
|
+
);
|
|
817
|
+
if (otherOwner) {
|
|
818
|
+
return yield* Effect.die(
|
|
819
|
+
new Error(
|
|
820
|
+
`Cannot attach route '${route.pattern}' to Worker '${scriptName}': ` +
|
|
821
|
+
`it is already attached to Worker '${otherOwner.script}'. ` +
|
|
822
|
+
`Remove it from that Worker first, or pick a different pattern.`,
|
|
823
|
+
),
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// A duplicate-pattern failure means another actor (or a crashed
|
|
828
|
+
// previous reconcile) created the route between our observation
|
|
829
|
+
// and now — re-list and converge if it points at this script.
|
|
830
|
+
const created = yield* workers
|
|
831
|
+
.createRoute({
|
|
832
|
+
zoneId: route.zoneId,
|
|
833
|
+
pattern: route.pattern,
|
|
834
|
+
script: scriptName,
|
|
835
|
+
})
|
|
836
|
+
.pipe(
|
|
837
|
+
// Same eventual-consistency window as `putDomain`: creating
|
|
838
|
+
// a route right after `putScript` can race Cloudflare's
|
|
839
|
+
// script registry, which rejects with code 10019 ("Cannot
|
|
840
|
+
// configure a route for a Worker which does not exist") —
|
|
841
|
+
// typed as `RouteScriptNotFound` via the createRoute patch.
|
|
842
|
+
Effect.retry({
|
|
843
|
+
while: (error) => error._tag === "RouteScriptNotFound",
|
|
844
|
+
schedule: Schedule.exponential(200).pipe(
|
|
845
|
+
Schedule.both(Schedule.recurs(15)),
|
|
846
|
+
),
|
|
847
|
+
}),
|
|
848
|
+
Effect.catchTag("InvalidRoute", (originalError) =>
|
|
849
|
+
Effect.gen(function* () {
|
|
850
|
+
const match = yield* workers
|
|
851
|
+
.listRoutes({ zoneId: route.zoneId })
|
|
852
|
+
.pipe(
|
|
853
|
+
Effect.map((response) =>
|
|
854
|
+
(response.result ?? []).find(
|
|
855
|
+
(candidate) =>
|
|
856
|
+
candidate.pattern === route.pattern &&
|
|
857
|
+
candidate.script === scriptName,
|
|
858
|
+
),
|
|
859
|
+
),
|
|
860
|
+
Effect.catch(() => Effect.succeed(undefined)),
|
|
861
|
+
);
|
|
862
|
+
if (!match?.id) {
|
|
863
|
+
return yield* Effect.fail(originalError);
|
|
864
|
+
}
|
|
865
|
+
return { id: match.id, pattern: match.pattern };
|
|
866
|
+
}),
|
|
867
|
+
),
|
|
868
|
+
);
|
|
869
|
+
return {
|
|
870
|
+
id: created.id,
|
|
871
|
+
pattern: created.pattern,
|
|
872
|
+
zoneId: route.zoneId,
|
|
873
|
+
};
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
return yield* Effect.all(desired.map(attachRoute), {
|
|
877
|
+
concurrency: "unbounded",
|
|
878
|
+
});
|
|
879
|
+
});
|
|
880
|
+
|
|
469
881
|
const createAlchemyWorkerTags = (id: string) => [
|
|
470
882
|
`alchemy:stack:${stack.name}`,
|
|
471
883
|
`alchemy:stage:${stack.stage}`,
|
|
@@ -794,9 +1206,16 @@ export const LiveWorkerProvider = () =>
|
|
|
794
1206
|
// hash that `readAssets` produces is the manifest-derived
|
|
795
1207
|
// hash, which is shaped differently from any upstream
|
|
796
1208
|
// build-input hash and will never match it on the next pass.
|
|
1209
|
+
const metadataHash = yield* resolveWorkerMetadataHash({
|
|
1210
|
+
props: news,
|
|
1211
|
+
bindings,
|
|
1212
|
+
accountId,
|
|
1213
|
+
stack: { name: stack.name, stage: stack.stage },
|
|
1214
|
+
});
|
|
797
1215
|
const hash = {
|
|
798
1216
|
...preparedHash,
|
|
799
1217
|
assets: prebuiltAssets?.hash ?? preparedHash.assets,
|
|
1218
|
+
metadata: metadataHash,
|
|
800
1219
|
} satisfies Worker["Attributes"]["hash"];
|
|
801
1220
|
const metadataBindings = bindings.flatMap((b) => b.data.bindings ?? []);
|
|
802
1221
|
const expectedDurableObjectClassNames =
|
|
@@ -1081,6 +1500,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1081
1500
|
assets: metadataAssets,
|
|
1082
1501
|
bindings: metadataBindings,
|
|
1083
1502
|
bodyPart: undefined,
|
|
1503
|
+
cache: news.cache ?? getCacheBinding(bindings),
|
|
1084
1504
|
compatibilityDate: compatibility.date,
|
|
1085
1505
|
compatibilityFlags: compatibility.flags,
|
|
1086
1506
|
containers:
|
|
@@ -1152,7 +1572,8 @@ export const LiveWorkerProvider = () =>
|
|
|
1152
1572
|
);
|
|
1153
1573
|
// Workers for Platforms user workers are invoked via dynamic dispatch,
|
|
1154
1574
|
// never routed directly — they have no workers.dev subdomain, custom
|
|
1155
|
-
// domains, or cron triggers. Skip all of that
|
|
1575
|
+
// domains, zone routes, or cron triggers. Skip all of that
|
|
1576
|
+
// reconciliation.
|
|
1156
1577
|
if (dispatchNamespace) {
|
|
1157
1578
|
return {
|
|
1158
1579
|
workerId: worker.id ?? name,
|
|
@@ -1164,6 +1585,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1164
1585
|
durableObjectNamespaces,
|
|
1165
1586
|
accountId,
|
|
1166
1587
|
domains: [],
|
|
1588
|
+
routes: [],
|
|
1167
1589
|
crons: [],
|
|
1168
1590
|
hash,
|
|
1169
1591
|
} satisfies Worker["Attributes"];
|
|
@@ -1230,6 +1652,18 @@ export const LiveWorkerProvider = () =>
|
|
|
1230
1652
|
...reconciled.map((d) => `https://${d.hostname}`),
|
|
1231
1653
|
...(workersDevUrl ? [workersDevUrl] : []),
|
|
1232
1654
|
];
|
|
1655
|
+
const desiredRoutes = yield* normalizeRoutes(news.routes);
|
|
1656
|
+
const previousRoutes = output?.routes ?? [];
|
|
1657
|
+
if (desiredRoutes.length > 0 || previousRoutes.length > 0) {
|
|
1658
|
+
yield* session.note(
|
|
1659
|
+
`Reconciling worker routes (${desiredRoutes.length}) ...`,
|
|
1660
|
+
);
|
|
1661
|
+
}
|
|
1662
|
+
const routes = yield* reconcileRoutes(
|
|
1663
|
+
name,
|
|
1664
|
+
desiredRoutes,
|
|
1665
|
+
previousRoutes,
|
|
1666
|
+
);
|
|
1233
1667
|
const crons = yield* reconcileCrons(
|
|
1234
1668
|
name,
|
|
1235
1669
|
normalizeCrons([...getCronBindings(bindings), ...(news.crons ?? [])]),
|
|
@@ -1246,6 +1680,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1246
1680
|
durableObjectNamespaces,
|
|
1247
1681
|
accountId,
|
|
1248
1682
|
domains,
|
|
1683
|
+
routes,
|
|
1249
1684
|
crons,
|
|
1250
1685
|
hash,
|
|
1251
1686
|
} satisfies Worker["Attributes"];
|
|
@@ -1255,7 +1690,26 @@ export const LiveWorkerProvider = () =>
|
|
|
1255
1690
|
id: string,
|
|
1256
1691
|
props: WorkerProps,
|
|
1257
1692
|
output: Worker["Attributes"],
|
|
1693
|
+
bindings: readonly ResourceBinding<Worker["Binding"]>[] | undefined,
|
|
1694
|
+
accountId: string,
|
|
1258
1695
|
) {
|
|
1696
|
+
// #745: metadata-only edits (compatibility, observability, placement,
|
|
1697
|
+
// limits, logpush, env literals, bindings, subdomain config, tags)
|
|
1698
|
+
// don't touch the bundle/vite/asset-content hashes below, so compare a
|
|
1699
|
+
// hash of that surface first. Skipped when bindings are still
|
|
1700
|
+
// unresolved: the hash can't be computed deterministically here, and
|
|
1701
|
+
// the eventual apply stores it once bindings resolve.
|
|
1702
|
+
if (bindings) {
|
|
1703
|
+
const metadataHash = yield* resolveWorkerMetadataHash({
|
|
1704
|
+
props,
|
|
1705
|
+
bindings,
|
|
1706
|
+
accountId,
|
|
1707
|
+
stack: { name: stack.name, stage: stack.stage },
|
|
1708
|
+
});
|
|
1709
|
+
if (metadataHash !== output.hash?.metadata) {
|
|
1710
|
+
return true;
|
|
1711
|
+
}
|
|
1712
|
+
}
|
|
1259
1713
|
if (props.script !== undefined) {
|
|
1260
1714
|
const scriptHash = yield* hashScript(props.script);
|
|
1261
1715
|
if (scriptHash !== output.hash?.bundle) {
|
|
@@ -1357,6 +1811,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1357
1811
|
tags: script.tags ?? undefined,
|
|
1358
1812
|
durableObjectNamespaces: {},
|
|
1359
1813
|
domains: [],
|
|
1814
|
+
routes: [],
|
|
1360
1815
|
crons: [],
|
|
1361
1816
|
},
|
|
1362
1817
|
]
|
|
@@ -1412,6 +1867,13 @@ export const LiveWorkerProvider = () =>
|
|
|
1412
1867
|
const cronsChanged =
|
|
1413
1868
|
newCrons.length !== oldCrons.length ||
|
|
1414
1869
|
newCrons.some((cron, index) => cron !== oldCrons[index]);
|
|
1870
|
+
const newRouteKeys = (yield* normalizeRoutes(news.routes))
|
|
1871
|
+
.map(routeKey)
|
|
1872
|
+
.sort();
|
|
1873
|
+
const oldRouteKeys = (output?.routes ?? []).map(routeKey).sort();
|
|
1874
|
+
const routesChanged =
|
|
1875
|
+
newRouteKeys.length !== oldRouteKeys.length ||
|
|
1876
|
+
newRouteKeys.some((key, index) => key !== oldRouteKeys[index]);
|
|
1415
1877
|
// `url` is `domains[0]`: the first custom domain in user order if
|
|
1416
1878
|
// any, otherwise the workers.dev URL (derived from the stable
|
|
1417
1879
|
// worker name + account subdomain). It's stable across this update
|
|
@@ -1465,8 +1927,17 @@ export const LiveWorkerProvider = () =>
|
|
|
1465
1927
|
newDoClassNames.every((name, i) => name === oldDoClassNames[i]);
|
|
1466
1928
|
if (
|
|
1467
1929
|
domainsChanged ||
|
|
1930
|
+
routesChanged ||
|
|
1468
1931
|
cronsChanged ||
|
|
1469
|
-
(yield* hasChanged(
|
|
1932
|
+
(yield* hasChanged(
|
|
1933
|
+
id,
|
|
1934
|
+
news,
|
|
1935
|
+
output,
|
|
1936
|
+
Array.isArray(newBindings)
|
|
1937
|
+
? (newBindings as ResourceBinding<Worker["Binding"]>[])
|
|
1938
|
+
: undefined,
|
|
1939
|
+
accountId,
|
|
1940
|
+
))
|
|
1470
1941
|
) {
|
|
1471
1942
|
// `workerId` is always stable across an update; seed it so it
|
|
1472
1943
|
// survives now that `diff.stables` overrides `provider.stables`
|
|
@@ -1487,7 +1958,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1487
1958
|
};
|
|
1488
1959
|
}
|
|
1489
1960
|
}),
|
|
1490
|
-
precreate: Effect.fn(function* ({ id, news, session }) {
|
|
1961
|
+
precreate: Effect.fn(function* ({ id, news, session, bindings }) {
|
|
1491
1962
|
const { accountId } = yield* yield* CloudflareEnvironment;
|
|
1492
1963
|
const name = yield* createWorkerName(id, news.name);
|
|
1493
1964
|
// A Workers for Platforms user worker can't be pre-created: precreate
|
|
@@ -1513,19 +1984,41 @@ export const LiveWorkerProvider = () =>
|
|
|
1513
1984
|
durableObjectNamespaces: {},
|
|
1514
1985
|
accountId,
|
|
1515
1986
|
domains: [],
|
|
1987
|
+
routes: [],
|
|
1516
1988
|
crons: [],
|
|
1517
1989
|
} satisfies Worker["Attributes"];
|
|
1518
1990
|
}
|
|
1519
1991
|
const dispatchNamespace = resolveNamespaceName(news.namespace);
|
|
1520
1992
|
const exportMap = news.exports ?? {};
|
|
1521
|
-
|
|
1993
|
+
// A worker hosts Durable Object classes from two independent sources:
|
|
1994
|
+
// Effect-native DO *exports* (classes defined in the worker entry) and
|
|
1995
|
+
// DO *bindings* declared in `env` — e.g. a bare `Cloudflare.DurableObject`
|
|
1996
|
+
// that fronts a Container image. The placeholder must declare *every*
|
|
1997
|
+
// hosted class so each namespace is created here. A class that exists
|
|
1998
|
+
// only as a binding (a container-fronted DO) is otherwise absent from
|
|
1999
|
+
// this stub, and a resource caught in a worker<->container dependency
|
|
2000
|
+
// cycle — which resolves `worker.durableObjectNamespaces[className]`
|
|
2001
|
+
// against the precreate stub rather than the final reconcile output —
|
|
2002
|
+
// fails because the namespace id it needs never surfaced.
|
|
2003
|
+
const exportDerived = Object.keys(exportMap)
|
|
1522
2004
|
.filter((logicalId) => isDurableObjectExport(exportMap[logicalId]))
|
|
1523
|
-
.map((logicalId) => ({
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
2005
|
+
.map((logicalId) => ({ logicalId, className: logicalId }));
|
|
2006
|
+
const durableObjects = mergeDurableObjectClasses(
|
|
2007
|
+
exportDerived,
|
|
2008
|
+
getDurableObjectBindings(bindings, name),
|
|
2009
|
+
);
|
|
1527
2010
|
const doClasses = durableObjects.map((binding) => binding.className);
|
|
1528
|
-
|
|
2011
|
+
// Only attach container metadata for classes actually fronted by a
|
|
2012
|
+
// Container binding (mirrors reconcile's `containerClassNames`).
|
|
2013
|
+
// Mapping every DO class to a container would wrongly mark plain DOs
|
|
2014
|
+
// as container-backed in the placeholder.
|
|
2015
|
+
const containers = Array.from(
|
|
2016
|
+
new Set(
|
|
2017
|
+
bindings.flatMap((b) =>
|
|
2018
|
+
(b.data.containers ?? []).map((c) => c.className),
|
|
2019
|
+
),
|
|
2020
|
+
),
|
|
2021
|
+
).map((className) => ({ className }));
|
|
1529
2022
|
const alchemyDoTags = durableObjects.map(
|
|
1530
2023
|
({ logicalId, className }) =>
|
|
1531
2024
|
`alchemy:do:${logicalId}:${className}`,
|
|
@@ -1675,6 +2168,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1675
2168
|
durableObjectNamespaces,
|
|
1676
2169
|
accountId,
|
|
1677
2170
|
domains: [],
|
|
2171
|
+
routes: [],
|
|
1678
2172
|
crons: [],
|
|
1679
2173
|
} satisfies Worker["Attributes"];
|
|
1680
2174
|
}),
|
|
@@ -1711,6 +2205,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1711
2205
|
tags: settings.tags ?? undefined,
|
|
1712
2206
|
durableObjectNamespaces: getDurableObjects(settings.bindings),
|
|
1713
2207
|
domains: [],
|
|
2208
|
+
routes: [],
|
|
1714
2209
|
crons: [],
|
|
1715
2210
|
} satisfies Worker["Attributes"];
|
|
1716
2211
|
return hasAlchemyWorkerTags(id, settings.tags ?? [])
|
|
@@ -1726,22 +2221,27 @@ export const LiveWorkerProvider = () =>
|
|
|
1726
2221
|
// `WorkerNotFound` if the script doesn't exist, which the
|
|
1727
2222
|
// surrounding `Effect.catchTag` turns into `undefined` — that's
|
|
1728
2223
|
// all the existence check we need.
|
|
1729
|
-
const [subdomain, settings, domainsList] =
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
2224
|
+
const [subdomain, settings, domainsList, routesList] =
|
|
2225
|
+
yield* Effect.all(
|
|
2226
|
+
[
|
|
2227
|
+
workers.getScriptSubdomain({
|
|
2228
|
+
accountId,
|
|
2229
|
+
scriptName: workerName,
|
|
2230
|
+
}),
|
|
2231
|
+
workers.getScriptScriptAndVersionSetting({
|
|
2232
|
+
accountId,
|
|
2233
|
+
scriptName: workerName,
|
|
2234
|
+
}),
|
|
2235
|
+
workers
|
|
2236
|
+
.listDomains({
|
|
2237
|
+
accountId,
|
|
2238
|
+
service: workerName,
|
|
2239
|
+
})
|
|
2240
|
+
.pipe(Effect.map((r) => r.result ?? [])),
|
|
2241
|
+
readWorkerRoutes(workerName),
|
|
2242
|
+
],
|
|
2243
|
+
{ concurrency: "unbounded" },
|
|
2244
|
+
);
|
|
1745
2245
|
// Preserve the order the user provided in `olds.domain`. The
|
|
1746
2246
|
// Cloudflare API returns domains in non-deterministic order,
|
|
1747
2247
|
// which would cause downstream `worker.domains[0]` reads to flip
|
|
@@ -1780,6 +2280,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1780
2280
|
tags: settings.tags ?? undefined,
|
|
1781
2281
|
durableObjectNamespaces: getDurableObjects(settings.bindings),
|
|
1782
2282
|
domains,
|
|
2283
|
+
routes: routesList,
|
|
1783
2284
|
crons,
|
|
1784
2285
|
} satisfies Worker["Attributes"];
|
|
1785
2286
|
|
|
@@ -1946,6 +2447,22 @@ export const LiveWorkerProvider = () =>
|
|
|
1946
2447
|
{ concurrency: "unbounded" },
|
|
1947
2448
|
);
|
|
1948
2449
|
}
|
|
2450
|
+
// Routes are zone-scoped; enumerating every zone live is
|
|
2451
|
+
// expensive, so trust the persisted route ids (refreshed by
|
|
2452
|
+
// `read`) and tolerate already-deleted routes.
|
|
2453
|
+
if (output.routes?.length) {
|
|
2454
|
+
yield* Effect.all(
|
|
2455
|
+
output.routes.map((route) =>
|
|
2456
|
+
workers
|
|
2457
|
+
.deleteRoute({
|
|
2458
|
+
zoneId: route.zoneId,
|
|
2459
|
+
routeId: route.id,
|
|
2460
|
+
})
|
|
2461
|
+
.pipe(Effect.catchTag("RouteNotFound", () => Effect.void)),
|
|
2462
|
+
),
|
|
2463
|
+
{ concurrency: "unbounded" },
|
|
2464
|
+
);
|
|
2465
|
+
}
|
|
1949
2466
|
yield* deleteWorkerScript(
|
|
1950
2467
|
output.accountId,
|
|
1951
2468
|
output.workerName,
|
|
@@ -2006,6 +2523,25 @@ function bumpMigrationTagVersion(
|
|
|
2006
2523
|
return `alchemy:v${parseInt(version, 10) + 1}`;
|
|
2007
2524
|
}
|
|
2008
2525
|
|
|
2526
|
+
/**
|
|
2527
|
+
* Merges a worker's export-derived and binding-derived Durable Object class
|
|
2528
|
+
* lists for the precreate placeholder, deduping by class name. The
|
|
2529
|
+
* binding-derived entry wins on a collision so the `alchemy:do:` tag keys off
|
|
2530
|
+
* the same logical id (the binding sid) that `reconcile` writes.
|
|
2531
|
+
*/
|
|
2532
|
+
function mergeDurableObjectClasses(
|
|
2533
|
+
exportDerived: ReadonlyArray<{ logicalId: string; className: string }>,
|
|
2534
|
+
bindingDerived: ReadonlyArray<{ logicalId: string; className: string }>,
|
|
2535
|
+
) {
|
|
2536
|
+
return Array.from(
|
|
2537
|
+
new Map(
|
|
2538
|
+
[...exportDerived, ...bindingDerived].map(
|
|
2539
|
+
(binding) => [binding.className, binding] as const,
|
|
2540
|
+
),
|
|
2541
|
+
).values(),
|
|
2542
|
+
);
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2009
2545
|
function getDurableObjectBindings(
|
|
2010
2546
|
bindings: ReadonlyArray<ResourceBinding>,
|
|
2011
2547
|
workerName: string,
|