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
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as Lambda from "@distilled.cloud/aws/lambda";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Schedule from "effect/Schedule";
|
|
4
|
+
import { deepEqual } from "../../Diff.ts";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_MAXIMUM_RETRY_ATTEMPTS = 2;
|
|
7
|
+
const DEFAULT_MAXIMUM_EVENT_AGE_IN_SECONDS = 21_600;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Asynchronous invocation settings for a Lambda function or alias.
|
|
11
|
+
*
|
|
12
|
+
* Configured via {@link FunctionProps.eventInvokeConfig} for the unqualified
|
|
13
|
+
* function, or {@link AliasProps.eventInvokeConfig} for a specific alias.
|
|
14
|
+
*/
|
|
15
|
+
export interface EventInvokeConfig {
|
|
16
|
+
/**
|
|
17
|
+
* Maximum number of times Lambda retries an asynchronous invocation.
|
|
18
|
+
* @default 2
|
|
19
|
+
*/
|
|
20
|
+
maximumRetryAttempts?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Maximum age in seconds that Lambda retains an asynchronous event.
|
|
23
|
+
* @default 21600
|
|
24
|
+
*/
|
|
25
|
+
maximumEventAgeInSeconds?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Destinations for successful or failed asynchronous invocation records.
|
|
28
|
+
*/
|
|
29
|
+
destinationConfig?: Lambda.DestinationConfig;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const retryOnConflict = <A, E extends { _tag: string }, R>(
|
|
33
|
+
effect: Effect.Effect<A, E, R>,
|
|
34
|
+
) =>
|
|
35
|
+
effect.pipe(
|
|
36
|
+
Effect.retry({
|
|
37
|
+
while: (e) => e._tag === "ResourceConflictException",
|
|
38
|
+
schedule: Schedule.exponential(500).pipe(
|
|
39
|
+
Schedule.both(Schedule.recurs(10)),
|
|
40
|
+
),
|
|
41
|
+
}),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const normalizeDestinationConfig = (
|
|
45
|
+
config: Lambda.DestinationConfig | undefined,
|
|
46
|
+
): Lambda.DestinationConfig | undefined => {
|
|
47
|
+
const onSuccess = config?.OnSuccess?.Destination
|
|
48
|
+
? { Destination: config.OnSuccess.Destination }
|
|
49
|
+
: undefined;
|
|
50
|
+
const onFailure = config?.OnFailure?.Destination
|
|
51
|
+
? { Destination: config.OnFailure.Destination }
|
|
52
|
+
: undefined;
|
|
53
|
+
return onSuccess || onFailure
|
|
54
|
+
? {
|
|
55
|
+
OnSuccess: onSuccess,
|
|
56
|
+
OnFailure: onFailure,
|
|
57
|
+
}
|
|
58
|
+
: undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const observeConfig = (functionName: string, qualifier: string | undefined) =>
|
|
62
|
+
Lambda.getFunctionEventInvokeConfig({
|
|
63
|
+
FunctionName: functionName,
|
|
64
|
+
Qualifier: qualifier,
|
|
65
|
+
}).pipe(
|
|
66
|
+
Effect.catchTag("ResourceNotFoundException", () =>
|
|
67
|
+
Effect.succeed(undefined),
|
|
68
|
+
),
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Converge the async invocation config of a function or alias to the desired
|
|
73
|
+
* state: put it when set, delete it when omitted. Diffs against the observed
|
|
74
|
+
* cloud config so a no-op deploy skips the write entirely.
|
|
75
|
+
*/
|
|
76
|
+
export const syncEventInvokeConfig = Effect.fn(function* ({
|
|
77
|
+
functionName,
|
|
78
|
+
qualifier,
|
|
79
|
+
config,
|
|
80
|
+
}: {
|
|
81
|
+
functionName: string;
|
|
82
|
+
/** Alias name (or version) to scope the config to. Omit for `$LATEST`. */
|
|
83
|
+
qualifier?: string;
|
|
84
|
+
config: EventInvokeConfig | undefined;
|
|
85
|
+
}) {
|
|
86
|
+
const observed = yield* observeConfig(functionName, qualifier);
|
|
87
|
+
|
|
88
|
+
if (config === undefined) {
|
|
89
|
+
if (observed) {
|
|
90
|
+
yield* retryOnConflict(
|
|
91
|
+
Lambda.deleteFunctionEventInvokeConfig({
|
|
92
|
+
FunctionName: functionName,
|
|
93
|
+
Qualifier: qualifier,
|
|
94
|
+
}),
|
|
95
|
+
).pipe(Effect.catchTag("ResourceNotFoundException", () => Effect.void));
|
|
96
|
+
}
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const desired = {
|
|
101
|
+
maximumRetryAttempts:
|
|
102
|
+
config.maximumRetryAttempts ?? DEFAULT_MAXIMUM_RETRY_ATTEMPTS,
|
|
103
|
+
maximumEventAgeInSeconds:
|
|
104
|
+
config.maximumEventAgeInSeconds ?? DEFAULT_MAXIMUM_EVENT_AGE_IN_SECONDS,
|
|
105
|
+
destinationConfig: normalizeDestinationConfig(config.destinationConfig),
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
if (
|
|
109
|
+
observed &&
|
|
110
|
+
(observed.MaximumRetryAttempts ?? DEFAULT_MAXIMUM_RETRY_ATTEMPTS) ===
|
|
111
|
+
desired.maximumRetryAttempts &&
|
|
112
|
+
(observed.MaximumEventAgeInSeconds ??
|
|
113
|
+
DEFAULT_MAXIMUM_EVENT_AGE_IN_SECONDS) ===
|
|
114
|
+
desired.maximumEventAgeInSeconds &&
|
|
115
|
+
deepEqual(
|
|
116
|
+
normalizeDestinationConfig(observed.DestinationConfig),
|
|
117
|
+
desired.destinationConfig,
|
|
118
|
+
)
|
|
119
|
+
) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
yield* Lambda.putFunctionEventInvokeConfig({
|
|
124
|
+
FunctionName: functionName,
|
|
125
|
+
Qualifier: qualifier,
|
|
126
|
+
MaximumRetryAttempts: desired.maximumRetryAttempts,
|
|
127
|
+
MaximumEventAgeInSeconds: desired.maximumEventAgeInSeconds,
|
|
128
|
+
DestinationConfig: desired.destinationConfig,
|
|
129
|
+
}).pipe(
|
|
130
|
+
Effect.retry({
|
|
131
|
+
while: (
|
|
132
|
+
e,
|
|
133
|
+
): e is
|
|
134
|
+
| Lambda.ResourceConflictException
|
|
135
|
+
| Lambda.InvalidParameterValueException =>
|
|
136
|
+
e._tag === "ResourceConflictException" ||
|
|
137
|
+
// Destination validation races IAM policy propagation on the
|
|
138
|
+
// execution role — Lambda rejects the put until the role can reach
|
|
139
|
+
// the destination.
|
|
140
|
+
(e._tag === "InvalidParameterValueException" &&
|
|
141
|
+
(e.message?.includes(
|
|
142
|
+
"The function execution role does not have permissions to call",
|
|
143
|
+
) ??
|
|
144
|
+
false)),
|
|
145
|
+
schedule: Schedule.exponential(500).pipe(
|
|
146
|
+
Schedule.both(Schedule.recurs(10)),
|
|
147
|
+
),
|
|
148
|
+
}),
|
|
149
|
+
);
|
|
150
|
+
});
|
|
@@ -51,6 +51,10 @@ import { AWSEnvironment } from "../Environment.ts";
|
|
|
51
51
|
import * as IAM from "../IAM/index.ts";
|
|
52
52
|
import type { PolicyStatement } from "../IAM/Policy.ts";
|
|
53
53
|
import type { Providers } from "../Providers.ts";
|
|
54
|
+
import {
|
|
55
|
+
syncEventInvokeConfig,
|
|
56
|
+
type EventInvokeConfig,
|
|
57
|
+
} from "./EventInvokeConfig.ts";
|
|
54
58
|
import { makeFunctionHttpHandler } from "./HttpServer.ts";
|
|
55
59
|
|
|
56
60
|
export const FunctionTypeId = "AWS.Lambda.Function" as const;
|
|
@@ -159,6 +163,14 @@ export interface FunctionProps extends PlatformProps {
|
|
|
159
163
|
* Omit to remove the function-level reserved concurrency limit.
|
|
160
164
|
*/
|
|
161
165
|
reservedConcurrentExecutions?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Asynchronous invocation settings (retries, event age, destinations) for
|
|
168
|
+
* the unqualified function. Omit to remove any existing config and fall
|
|
169
|
+
* back to Lambda's defaults (2 retries, 6-hour max event age, no
|
|
170
|
+
* destinations). Use {@link AliasProps.eventInvokeConfig} to scope the
|
|
171
|
+
* config to an alias instead.
|
|
172
|
+
*/
|
|
173
|
+
eventInvokeConfig?: EventInvokeConfig;
|
|
162
174
|
}
|
|
163
175
|
|
|
164
176
|
/**
|
|
@@ -275,9 +287,9 @@ const matchesConfiguredExternal = (
|
|
|
275
287
|
* - **Async** — plain handler export, no Effect runtime in the bundle.
|
|
276
288
|
* - **Effect** — Effect implementation with typed bindings and event sources.
|
|
277
289
|
*
|
|
278
|
-
* See
|
|
290
|
+
* See [Effect handlers vs async handlers](/infrastructure-as-effects/functions-and-servers#effect-handlers-vs-async-handlers)
|
|
279
291
|
* for plain handler patterns, or the
|
|
280
|
-
*
|
|
292
|
+
* [Lambda guide](/aws/compute/lambda)
|
|
281
293
|
* for the full Effect-based approach with bindings, event sources, and sinks.
|
|
282
294
|
* @resource
|
|
283
295
|
* @section Async Functions
|
|
@@ -384,6 +396,22 @@ const matchesConfiguredExternal = (
|
|
|
384
396
|
* });
|
|
385
397
|
* ```
|
|
386
398
|
*
|
|
399
|
+
* @example Async invocation retries and failure destination
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const func = yield* AWS.Lambda.Function("AsyncFunction", {
|
|
402
|
+
* main: "./src/handler.ts",
|
|
403
|
+
* eventInvokeConfig: {
|
|
404
|
+
* maximumRetryAttempts: 0,
|
|
405
|
+
* maximumEventAgeInSeconds: 60,
|
|
406
|
+
* destinationConfig: {
|
|
407
|
+
* OnFailure: {
|
|
408
|
+
* Destination: queue.queueArn,
|
|
409
|
+
* },
|
|
410
|
+
* },
|
|
411
|
+
* },
|
|
412
|
+
* });
|
|
413
|
+
* ```
|
|
414
|
+
*
|
|
387
415
|
* @section S3 Bindings
|
|
388
416
|
* Bind S3 operations in the init phase to give the function IAM
|
|
389
417
|
* permissions and inject the bucket name as an environment variable.
|
|
@@ -1667,6 +1695,11 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
1667
1695
|
reservedConcurrentExecutions: news.reservedConcurrentExecutions,
|
|
1668
1696
|
});
|
|
1669
1697
|
|
|
1698
|
+
yield* syncEventInvokeConfig({
|
|
1699
|
+
functionName,
|
|
1700
|
+
config: news.eventInvokeConfig,
|
|
1701
|
+
});
|
|
1702
|
+
|
|
1670
1703
|
const functionUrl = yield* createOrUpdateFunctionUrl({
|
|
1671
1704
|
functionName,
|
|
1672
1705
|
url: news.url,
|
package/src/AWS/Lambda/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./CreateShellAuthTokenHttp.ts";
|
|
|
7
7
|
export * from "./DeleteMicrovmImageVersion.ts";
|
|
8
8
|
export * from "./DeleteMicrovmImageVersionHttp.ts";
|
|
9
9
|
export * from "./EventBridgeEventSource.ts";
|
|
10
|
+
export * from "./EventInvokeConfig.ts";
|
|
10
11
|
export * from "./EventSourceMapping.ts";
|
|
11
12
|
export * from "./Function.ts";
|
|
12
13
|
export * from "./GetMicrovm.ts";
|
|
@@ -56,10 +56,18 @@ export const DelegatedAdministratorProvider = () =>
|
|
|
56
56
|
}
|
|
57
57
|
}),
|
|
58
58
|
read: Effect.fn(function* ({ olds, output }) {
|
|
59
|
+
const accountId = output?.accountId ?? olds?.accountId;
|
|
60
|
+
const servicePrincipal =
|
|
61
|
+
output?.servicePrincipal ?? olds?.servicePrincipal;
|
|
62
|
+
if (accountId === undefined || servicePrincipal === undefined) {
|
|
63
|
+
// Output-valued props don't survive a `creating`-state round-trip
|
|
64
|
+
// (they deserialize as `undefined`) — report "not found" so the
|
|
65
|
+
// engine re-drives the create.
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
59
68
|
return yield* readDelegatedAdministrator({
|
|
60
|
-
accountId
|
|
61
|
-
servicePrincipal
|
|
62
|
-
output?.servicePrincipal ?? olds!.servicePrincipal,
|
|
69
|
+
accountId,
|
|
70
|
+
servicePrincipal,
|
|
63
71
|
});
|
|
64
72
|
}),
|
|
65
73
|
list: () =>
|
|
@@ -55,10 +55,16 @@ export const PolicyAttachmentProvider = () =>
|
|
|
55
55
|
}
|
|
56
56
|
}),
|
|
57
57
|
read: Effect.fn(function* ({ olds, output }) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
const policyId = output?.policyId ?? olds?.policyId;
|
|
59
|
+
const targetId = output?.targetId ?? olds?.targetId;
|
|
60
|
+
if (policyId === undefined || targetId === undefined) {
|
|
61
|
+
// A `creating` row persisted before upstream Outputs resolved
|
|
62
|
+
// can't round-trip Output-valued ids — they deserialize as
|
|
63
|
+
// `undefined`. Report "not found" so the engine re-drives the
|
|
64
|
+
// create (reconcile observes before attaching).
|
|
65
|
+
return undefined;
|
|
66
|
+
}
|
|
67
|
+
return yield* readAttachment({ policyId, targetId });
|
|
62
68
|
}),
|
|
63
69
|
// Enumerate every (policy, target) attachment. There is no direct
|
|
64
70
|
// "list attachments" API, so we fan out: for each policy type, list the
|
|
@@ -54,10 +54,15 @@ export const RootPolicyTypeProvider = () =>
|
|
|
54
54
|
}
|
|
55
55
|
}),
|
|
56
56
|
read: Effect.fn(function* ({ olds, output }) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
const rootId = output?.rootId ?? olds?.rootId;
|
|
58
|
+
const policyType = output?.policyType ?? olds?.policyType;
|
|
59
|
+
if (rootId === undefined || policyType === undefined) {
|
|
60
|
+
// Output-valued props don't survive a `creating`-state round-trip
|
|
61
|
+
// (they deserialize as `undefined`) — report "not found" so the
|
|
62
|
+
// engine re-drives the create.
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
return yield* readRootPolicyType({ rootId, policyType });
|
|
61
66
|
}),
|
|
62
67
|
// A RootPolicyType is the enable/disable state of one policy type on
|
|
63
68
|
// one organization root. `listRoots` already returns each root's
|
|
@@ -45,9 +45,15 @@ export const TrustedServiceAccessProvider = () =>
|
|
|
45
45
|
}
|
|
46
46
|
}),
|
|
47
47
|
read: Effect.fn(function* ({ olds, output }) {
|
|
48
|
-
|
|
49
|
-
output?.servicePrincipal ?? olds
|
|
50
|
-
)
|
|
48
|
+
const servicePrincipal =
|
|
49
|
+
output?.servicePrincipal ?? olds?.servicePrincipal;
|
|
50
|
+
if (servicePrincipal === undefined) {
|
|
51
|
+
// Output-valued props don't survive a `creating`-state round-trip
|
|
52
|
+
// (they deserialize as `undefined`) — report "not found" so the
|
|
53
|
+
// engine re-drives the create.
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
return yield* readTrustedServiceAccess(servicePrincipal);
|
|
51
57
|
}),
|
|
52
58
|
list: () =>
|
|
53
59
|
Effect.gen(function* () {
|
|
@@ -114,17 +114,22 @@ export const HostedZoneProvider = () =>
|
|
|
114
114
|
// Poll `getChange` until the change reaches INSYNC. `getChange` is
|
|
115
115
|
// eventually consistent and can briefly return `NoSuchChange` right after
|
|
116
116
|
// submit, so coalesce that to a non-INSYNC status and keep polling.
|
|
117
|
+
// `ChangeInfo.Id` comes back as "/change/C..." but `getChange` only
|
|
118
|
+
// accepts the bare id — the prefixed form returns `NoSuchChange`
|
|
119
|
+
// forever, silently burning the full repeat cap on every change.
|
|
117
120
|
const waitForChange = Effect.fn(function* (changeId: string) {
|
|
118
|
-
return yield* route53
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
return yield* route53
|
|
122
|
+
.getChange({ Id: changeId.replace(/^\/change\//, "") })
|
|
123
|
+
.pipe(
|
|
124
|
+
Effect.map((r) => r.ChangeInfo.Status),
|
|
125
|
+
Effect.catchTag("NoSuchChange", () => Effect.succeed("PENDING")),
|
|
126
|
+
Effect.repeat({
|
|
127
|
+
schedule: Schedule.fixed("2 seconds").pipe(
|
|
128
|
+
Schedule.both(Schedule.recurs(60)),
|
|
129
|
+
),
|
|
130
|
+
until: (status) => status === "INSYNC",
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
128
133
|
});
|
|
129
134
|
|
|
130
135
|
const findByName = Effect.fn(function* (name: string) {
|
|
@@ -242,8 +247,13 @@ export const HostedZoneProvider = () =>
|
|
|
242
247
|
),
|
|
243
248
|
diff: Effect.fn(function* ({ olds, news }) {
|
|
244
249
|
if (!isResolved(news)) return undefined;
|
|
250
|
+
// Name change → replace, but only when the old name is known — a
|
|
251
|
+
// half-created state row can't round-trip an Output-valued `name`
|
|
252
|
+
// (it deserializes as `undefined`), and an unknown old name must
|
|
253
|
+
// fall through to the create/update recovery path.
|
|
245
254
|
if (
|
|
246
|
-
|
|
255
|
+
(olds.name !== undefined &&
|
|
256
|
+
normalizeName(olds.name) !== normalizeName(news.name)) ||
|
|
247
257
|
(olds.privateZone ?? false) !== (news.privateZone ?? false) ||
|
|
248
258
|
olds.delegationSetId !== news.delegationSetId ||
|
|
249
259
|
olds.vpc?.vpcId !== news.vpc?.vpcId
|
|
@@ -253,8 +263,15 @@ export const HostedZoneProvider = () =>
|
|
|
253
263
|
}),
|
|
254
264
|
read: Effect.fn(function* ({ olds, output }) {
|
|
255
265
|
// Resolve the zone id: prefer the stored output, else look up by name
|
|
256
|
-
// (adoption / state-loss recovery).
|
|
257
|
-
|
|
266
|
+
// (adoption / state-loss recovery). The persisted `name` may be
|
|
267
|
+
// `undefined` when a `creating` row was written before upstream
|
|
268
|
+
// Outputs resolved — report "not found" and let the engine
|
|
269
|
+
// re-drive the create.
|
|
270
|
+
const zoneId =
|
|
271
|
+
output?.id ??
|
|
272
|
+
(olds?.name !== undefined
|
|
273
|
+
? (yield* findByName(olds.name))?.Id
|
|
274
|
+
: undefined);
|
|
258
275
|
if (zoneId === undefined) {
|
|
259
276
|
return undefined;
|
|
260
277
|
}
|
|
@@ -477,17 +477,22 @@ export const RecordProvider = () =>
|
|
|
477
477
|
// Poll `getChange` until the change reaches INSYNC. `getChange` is
|
|
478
478
|
// eventually consistent and can briefly return `NoSuchChange` right after
|
|
479
479
|
// submit, so coalesce that to a non-INSYNC status and keep polling.
|
|
480
|
+
// `ChangeInfo.Id` comes back as "/change/C..." but `getChange` only
|
|
481
|
+
// accepts the bare id — the prefixed form returns `NoSuchChange`
|
|
482
|
+
// forever, silently burning the full repeat cap on every change.
|
|
480
483
|
const waitForChange = Effect.fn(function* (changeId: string) {
|
|
481
|
-
return yield* route53
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
484
|
+
return yield* route53
|
|
485
|
+
.getChange({ Id: changeId.replace(/^\/change\//, "") })
|
|
486
|
+
.pipe(
|
|
487
|
+
Effect.map((response) => response.ChangeInfo.Status),
|
|
488
|
+
Effect.catchTag("NoSuchChange", () => Effect.succeed("PENDING")),
|
|
489
|
+
Effect.repeat({
|
|
490
|
+
schedule: Schedule.fixed("2 seconds").pipe(
|
|
491
|
+
Schedule.both(Schedule.recurs(60)),
|
|
492
|
+
),
|
|
493
|
+
until: (status) => status === "INSYNC",
|
|
494
|
+
}),
|
|
495
|
+
);
|
|
491
496
|
});
|
|
492
497
|
|
|
493
498
|
const findRecord = Effect.fn(function* (
|
|
@@ -590,10 +595,16 @@ export const RecordProvider = () =>
|
|
|
590
595
|
}),
|
|
591
596
|
diff: Effect.fn(function* ({ olds, news }) {
|
|
592
597
|
if (!isResolved(news)) return undefined;
|
|
598
|
+
// Identity change → replace, but only when the old value is known —
|
|
599
|
+
// a half-created state row can't round-trip Output-valued props
|
|
600
|
+
// (they deserialize as `undefined`), and an unknown old identity
|
|
601
|
+
// must fall through to the create/update recovery path.
|
|
593
602
|
if (
|
|
594
|
-
|
|
595
|
-
normalizeHostedZoneId(
|
|
596
|
-
|
|
603
|
+
(olds.hostedZoneId !== undefined &&
|
|
604
|
+
normalizeHostedZoneId(olds.hostedZoneId) !==
|
|
605
|
+
normalizeHostedZoneId(news.hostedZoneId)) ||
|
|
606
|
+
(olds.name !== undefined &&
|
|
607
|
+
normalizeName(olds.name) !== normalizeName(news.name)) ||
|
|
597
608
|
olds.type !== news.type ||
|
|
598
609
|
olds.setIdentifier !== news.setIdentifier
|
|
599
610
|
) {
|
|
@@ -601,20 +612,31 @@ export const RecordProvider = () =>
|
|
|
601
612
|
}
|
|
602
613
|
}),
|
|
603
614
|
read: Effect.fn(function* ({ olds, output }) {
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
)
|
|
615
|
+
const hostedZoneId = output?.hostedZoneId ?? olds?.hostedZoneId;
|
|
616
|
+
const name = output?.name ?? olds?.name;
|
|
617
|
+
const type = output?.type ?? olds?.type;
|
|
618
|
+
if (
|
|
619
|
+
hostedZoneId === undefined ||
|
|
620
|
+
name === undefined ||
|
|
621
|
+
type === undefined
|
|
622
|
+
) {
|
|
623
|
+
// Output-valued props don't survive a `creating`-state round-trip
|
|
624
|
+
// — without the record's identity we can't look it up. Report
|
|
625
|
+
// "not found" so the engine re-drives the create (the UPSERT in
|
|
626
|
+
// reconcile converges on any half-created record).
|
|
627
|
+
return undefined;
|
|
628
|
+
}
|
|
629
|
+
const recordSet = yield* findRecord(hostedZoneId, {
|
|
630
|
+
name,
|
|
631
|
+
type,
|
|
632
|
+
setIdentifier: output?.setIdentifier ?? olds?.setIdentifier,
|
|
633
|
+
});
|
|
612
634
|
|
|
613
635
|
if (!recordSet) {
|
|
614
636
|
return undefined;
|
|
615
637
|
}
|
|
616
638
|
|
|
617
|
-
return toAttrs(recordSet,
|
|
639
|
+
return toAttrs(recordSet, hostedZoneId);
|
|
618
640
|
}),
|
|
619
641
|
reconcile: Effect.fn(function* ({ news, session }) {
|
|
620
642
|
// Route 53 `changeResourceRecordSets` with `UPSERT` is naturally
|
package/src/Apply.ts
CHANGED
|
@@ -465,7 +465,13 @@ const executeNode = (
|
|
|
465
465
|
// ── noop ──
|
|
466
466
|
|
|
467
467
|
if (node.action === "noop") {
|
|
468
|
-
// No work to do — the persisted attr is already stable.
|
|
468
|
+
// No work to do — the persisted attr is already stable. If the row was
|
|
469
|
+
// persisted under a legacy type name (the type was since renamed and
|
|
470
|
+
// carries the old name as an alias), migrate it to the canonical type
|
|
471
|
+
// so the state stops depending on the alias.
|
|
472
|
+
if (node.state.resourceType !== node.resource.Type) {
|
|
473
|
+
yield* commit({ ...node.state, resourceType: node.resource.Type });
|
|
474
|
+
}
|
|
469
475
|
yield* signalReadyStable;
|
|
470
476
|
yield* storeAndSignal({
|
|
471
477
|
output: node.state.attr,
|
package/src/Auth/Lock.ts
CHANGED
|
@@ -4,6 +4,23 @@ import * as fs from "node:fs/promises";
|
|
|
4
4
|
import * as path from "pathe";
|
|
5
5
|
import { rootDir } from "./Profile.ts";
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Make a lock key safe to use as a file name on every platform.
|
|
9
|
+
*
|
|
10
|
+
* Keys are derived from user-controlled values (profile names), which
|
|
11
|
+
* have shown up in production containing shell placeholders like
|
|
12
|
+
* `${ALCHEMY_PROFILE:-default}` — `:`/`{`/`$` are invalid in Windows
|
|
13
|
+
* file names and mkdir fails with EINVAL. Collapse anything outside a
|
|
14
|
+
* conservative allow-list to `_`.
|
|
15
|
+
*
|
|
16
|
+
* @internal exported for unit testing.
|
|
17
|
+
*/
|
|
18
|
+
export const sanitizeLockKey = (key: string): string =>
|
|
19
|
+
key.replace(/[^A-Za-z0-9._-]/g, "_");
|
|
20
|
+
|
|
21
|
+
/** File-system errors that mean "we cannot lock here at all". */
|
|
22
|
+
const UNLOCKABLE_FS_CODES = new Set(["EROFS", "EACCES", "EPERM", "ENOSPC"]);
|
|
23
|
+
|
|
7
24
|
/**
|
|
8
25
|
* Serialise execution of `effect` so no two callers ever run inside the
|
|
9
26
|
* critical section concurrently for the same `key`, both within this
|
|
@@ -13,6 +30,11 @@ import { rootDir } from "./Profile.ts";
|
|
|
13
30
|
* holders by path (so same-process callers wait via `retries`) and uses
|
|
14
31
|
* an OS file lock for cross-process coordination, with stale-lock
|
|
15
32
|
* detection at 60s.
|
|
33
|
+
*
|
|
34
|
+
* Locking is best-effort: on file systems where the lock directory
|
|
35
|
+
* cannot be created at all (read-only home in containers/CI), the
|
|
36
|
+
* effect runs unserialised with a warning instead of failing — a
|
|
37
|
+
* missed lock only risks a redundant credential refresh.
|
|
16
38
|
*/
|
|
17
39
|
export const withLock = <A, E, R>(
|
|
18
40
|
key: string,
|
|
@@ -22,26 +44,48 @@ export const withLock = <A, E, R>(
|
|
|
22
44
|
// `Profile -> AuthProvider -> Lock -> Profile` import cycle never reads
|
|
23
45
|
// `rootDir` before `Profile.ts` has finished initialising it.
|
|
24
46
|
const lockDir = path.join(rootDir, "lock");
|
|
25
|
-
const lockPath = path.join(lockDir, `${key}.lock`);
|
|
47
|
+
const lockPath = path.join(lockDir, `${sanitizeLockKey(key)}.lock`);
|
|
26
48
|
return Effect.acquireUseRelease(
|
|
27
49
|
Effect.promise(async () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
try {
|
|
51
|
+
await fs.mkdir(lockDir, { recursive: true });
|
|
52
|
+
return await lock(lockPath, {
|
|
53
|
+
retries: { retries: 600, minTimeout: 50, maxTimeout: 50 },
|
|
54
|
+
// The holder refreshes the lockfile mtime on a timer. Under heavy
|
|
55
|
+
// load (e.g. a full test run saturating every core) that timer can
|
|
56
|
+
// be starved for several seconds, so keep the stale threshold well
|
|
57
|
+
// above any realistic starvation pause.
|
|
58
|
+
stale: 30_000,
|
|
59
|
+
realpath: false,
|
|
60
|
+
// The library's default handler throws from a timer callback,
|
|
61
|
+
// which surfaces as an uncaught exception and kills the process.
|
|
62
|
+
// A compromised auth lock is benign here (worst case two refreshes
|
|
63
|
+
// race), so log and continue.
|
|
64
|
+
onCompromised: (err) => {
|
|
65
|
+
console.warn(`auth lock compromised (continuing): ${err.message}`);
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
} catch (err) {
|
|
69
|
+
const code = (err as NodeJS.ErrnoException).code;
|
|
70
|
+
if (code !== undefined && UNLOCKABLE_FS_CODES.has(code)) {
|
|
71
|
+
console.warn(
|
|
72
|
+
`auth lock unavailable (${code} at '${lockPath}') — continuing without cross-process locking`,
|
|
73
|
+
);
|
|
74
|
+
return async () => {};
|
|
75
|
+
}
|
|
76
|
+
if (
|
|
77
|
+
err instanceof Error &&
|
|
78
|
+
err.message.includes("already being held")
|
|
79
|
+
) {
|
|
80
|
+
throw new Error(
|
|
81
|
+
`Timed out waiting for the alchemy auth lock '${lockPath}' — another alchemy ` +
|
|
82
|
+
`process has held it for over 30s. If no other alchemy process is running, ` +
|
|
83
|
+
`delete the lock file and retry.`,
|
|
84
|
+
{ cause: err },
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
throw err;
|
|
88
|
+
}
|
|
45
89
|
}),
|
|
46
90
|
() => effect,
|
|
47
91
|
(release) => Effect.promise(() => release().catch(() => {})),
|
package/src/Bundle/PurePlugin.ts
CHANGED
|
@@ -314,6 +314,11 @@ export async function resolvePackageInfo(
|
|
|
314
314
|
let foundInfo: PackageInfo | null = null;
|
|
315
315
|
// Hard ceiling to prevent runaway walks on weird ids.
|
|
316
316
|
for (let i = 0; i < 64; i++) {
|
|
317
|
+
// Never walk above a `node_modules` boundary: the owning package of a
|
|
318
|
+
// `node_modules/<pkg>/...` id lives at or below `<pkg>`. Climbing past
|
|
319
|
+
// it can latch onto an unrelated package.json higher up (e.g. a stray
|
|
320
|
+
// one at the filesystem root) and poison the shared-ancestor cache.
|
|
321
|
+
if (path.basename(dir) === "node_modules") break;
|
|
317
322
|
const cached = cache.get(dir);
|
|
318
323
|
if (cached !== undefined) {
|
|
319
324
|
cacheDescendants(cache, visited, dir, cached);
|
|
@@ -348,8 +353,16 @@ export async function resolvePackageInfo(
|
|
|
348
353
|
dir = parent;
|
|
349
354
|
}
|
|
350
355
|
if (foundInfo !== null && foundRoot !== null) {
|
|
351
|
-
|
|
352
|
-
|
|
356
|
+
// A nameless package.json (e.g. a nested `dist/package.json` holding
|
|
357
|
+
// only `{"type": "module"}`, or a stray file high up the tree) can't be
|
|
358
|
+
// matched against the configured patterns — prefer the path-derived
|
|
359
|
+
// `node_modules/<pkg>` name when one exists.
|
|
360
|
+
const info =
|
|
361
|
+
foundInfo.name === null && fastName !== null
|
|
362
|
+
? { name: fastName, sideEffects: foundInfo.sideEffects }
|
|
363
|
+
: foundInfo;
|
|
364
|
+
cacheDescendants(cache, visited, foundRoot, info);
|
|
365
|
+
return info;
|
|
353
366
|
}
|
|
354
367
|
// No `package.json` found on disk. If we have a path-derived name
|
|
355
368
|
// (from a `node_modules/<pkg>/...` segment), use it with no
|