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.
Files changed (607) hide show
  1. package/bin/cli.js +9 -1
  2. package/bin/exec.js +15 -5
  3. package/bin/exec.js.map +1 -1
  4. package/lib/AWS/ACM/Certificate.d.ts.map +1 -1
  5. package/lib/AWS/ACM/Certificate.js +9 -2
  6. package/lib/AWS/ACM/Certificate.js.map +1 -1
  7. package/lib/AWS/AutoScaling/AutoScalingGroup.d.ts.map +1 -1
  8. package/lib/AWS/AutoScaling/AutoScalingGroup.js +18 -11
  9. package/lib/AWS/AutoScaling/AutoScalingGroup.js.map +1 -1
  10. package/lib/AWS/AutoScaling/LaunchTemplate.js +6 -1
  11. package/lib/AWS/AutoScaling/LaunchTemplate.js.map +1 -1
  12. package/lib/AWS/AutoScaling/ScalingPolicy.d.ts.map +1 -1
  13. package/lib/AWS/AutoScaling/ScalingPolicy.js +28 -10
  14. package/lib/AWS/AutoScaling/ScalingPolicy.js.map +1 -1
  15. package/lib/AWS/CloudFront/PublicKey.d.ts.map +1 -1
  16. package/lib/AWS/CloudFront/PublicKey.js +5 -1
  17. package/lib/AWS/CloudFront/PublicKey.js.map +1 -1
  18. package/lib/AWS/DynamoDB/Table.js +1 -1
  19. package/lib/AWS/DynamoDB/Table.js.map +1 -1
  20. package/lib/AWS/ECS/Service.d.ts.map +1 -1
  21. package/lib/AWS/ECS/Service.js +29 -4
  22. package/lib/AWS/ECS/Service.js.map +1 -1
  23. package/lib/AWS/IAM/OpenIDConnectProvider.d.ts.map +1 -1
  24. package/lib/AWS/IAM/OpenIDConnectProvider.js +9 -1
  25. package/lib/AWS/IAM/OpenIDConnectProvider.js.map +1 -1
  26. package/lib/AWS/Lambda/Alias.d.ts +26 -0
  27. package/lib/AWS/Lambda/Alias.d.ts.map +1 -1
  28. package/lib/AWS/Lambda/Alias.js +31 -0
  29. package/lib/AWS/Lambda/Alias.js.map +1 -1
  30. package/lib/AWS/Lambda/EventInvokeConfig.d.ts +36 -0
  31. package/lib/AWS/Lambda/EventInvokeConfig.d.ts.map +1 -0
  32. package/lib/AWS/Lambda/EventInvokeConfig.js +76 -0
  33. package/lib/AWS/Lambda/EventInvokeConfig.js.map +1 -0
  34. package/lib/AWS/Lambda/Function.d.ts +27 -2
  35. package/lib/AWS/Lambda/Function.d.ts.map +1 -1
  36. package/lib/AWS/Lambda/Function.js +23 -2
  37. package/lib/AWS/Lambda/Function.js.map +1 -1
  38. package/lib/AWS/Lambda/index.d.ts +1 -0
  39. package/lib/AWS/Lambda/index.d.ts.map +1 -1
  40. package/lib/AWS/Lambda/index.js +1 -0
  41. package/lib/AWS/Lambda/index.js.map +1 -1
  42. package/lib/AWS/Organizations/DelegatedAdministrator.d.ts.map +1 -1
  43. package/lib/AWS/Organizations/DelegatedAdministrator.js +10 -2
  44. package/lib/AWS/Organizations/DelegatedAdministrator.js.map +1 -1
  45. package/lib/AWS/Organizations/PolicyAttachment.d.ts.map +1 -1
  46. package/lib/AWS/Organizations/PolicyAttachment.js +10 -4
  47. package/lib/AWS/Organizations/PolicyAttachment.js.map +1 -1
  48. package/lib/AWS/Organizations/RootPolicyType.d.ts.map +1 -1
  49. package/lib/AWS/Organizations/RootPolicyType.js +9 -4
  50. package/lib/AWS/Organizations/RootPolicyType.js.map +1 -1
  51. package/lib/AWS/Organizations/TrustedServiceAccess.d.ts.map +1 -1
  52. package/lib/AWS/Organizations/TrustedServiceAccess.js +8 -1
  53. package/lib/AWS/Organizations/TrustedServiceAccess.js.map +1 -1
  54. package/lib/AWS/Route53/HostedZone.d.ts.map +1 -1
  55. package/lib/AWS/Route53/HostedZone.js +20 -4
  56. package/lib/AWS/Route53/HostedZone.js.map +1 -1
  57. package/lib/AWS/Route53/Record.d.ts.map +1 -1
  58. package/lib/AWS/Route53/Record.js +32 -9
  59. package/lib/AWS/Route53/Record.js.map +1 -1
  60. package/lib/Apply.js +7 -1
  61. package/lib/Apply.js.map +1 -1
  62. package/lib/Auth/Lock.d.ts +17 -0
  63. package/lib/Auth/Lock.d.ts.map +1 -1
  64. package/lib/Auth/Lock.js +53 -18
  65. package/lib/Auth/Lock.js.map +1 -1
  66. package/lib/Bundle/PurePlugin.d.ts.map +1 -1
  67. package/lib/Bundle/PurePlugin.js +15 -2
  68. package/lib/Bundle/PurePlugin.js.map +1 -1
  69. package/lib/Cli/commands/sync.d.ts +22 -0
  70. package/lib/Cli/commands/sync.d.ts.map +1 -0
  71. package/lib/Cli/commands/sync.js +64 -0
  72. package/lib/Cli/commands/sync.js.map +1 -0
  73. package/lib/Cli/main.d.ts.map +1 -1
  74. package/lib/Cli/main.js +2 -0
  75. package/lib/Cli/main.js.map +1 -1
  76. package/lib/Cloudflare/AI/CustomTopics.d.ts.map +1 -1
  77. package/lib/Cloudflare/AI/CustomTopics.js +3 -1
  78. package/lib/Cloudflare/AI/CustomTopics.js.map +1 -1
  79. package/lib/Cloudflare/AI/Dataset.d.ts.map +1 -1
  80. package/lib/Cloudflare/AI/Dataset.js +3 -1
  81. package/lib/Cloudflare/AI/Dataset.js.map +1 -1
  82. package/lib/Cloudflare/AI/Evaluation.d.ts.map +1 -1
  83. package/lib/Cloudflare/AI/Evaluation.js +3 -1
  84. package/lib/Cloudflare/AI/Evaluation.js.map +1 -1
  85. package/lib/Cloudflare/AI/Gateway.d.ts.map +1 -1
  86. package/lib/Cloudflare/AI/Gateway.js +5 -6
  87. package/lib/Cloudflare/AI/Gateway.js.map +1 -1
  88. package/lib/Cloudflare/AI/GatewayDynamicRouting.d.ts.map +1 -1
  89. package/lib/Cloudflare/AI/GatewayDynamicRouting.js +3 -1
  90. package/lib/Cloudflare/AI/GatewayDynamicRouting.js.map +1 -1
  91. package/lib/Cloudflare/AI/GatewayProvider.d.ts +2 -1
  92. package/lib/Cloudflare/AI/GatewayProvider.d.ts.map +1 -1
  93. package/lib/Cloudflare/AI/GatewayProvider.js +5 -2
  94. package/lib/Cloudflare/AI/GatewayProvider.js.map +1 -1
  95. package/lib/Cloudflare/AI/ProviderKey.d.ts +135 -0
  96. package/lib/Cloudflare/AI/ProviderKey.d.ts.map +1 -0
  97. package/lib/Cloudflare/AI/ProviderKey.js +90 -0
  98. package/lib/Cloudflare/AI/ProviderKey.js.map +1 -0
  99. package/lib/Cloudflare/AI/SearchInstance.d.ts.map +1 -1
  100. package/lib/Cloudflare/AI/SearchInstance.js +5 -4
  101. package/lib/Cloudflare/AI/SearchInstance.js.map +1 -1
  102. package/lib/Cloudflare/AI/SearchNamespace.d.ts.map +1 -1
  103. package/lib/Cloudflare/AI/SearchNamespace.js +5 -4
  104. package/lib/Cloudflare/AI/SearchNamespace.js.map +1 -1
  105. package/lib/Cloudflare/AI/SearchToken.d.ts.map +1 -1
  106. package/lib/Cloudflare/AI/SearchToken.js +3 -1
  107. package/lib/Cloudflare/AI/SearchToken.js.map +1 -1
  108. package/lib/Cloudflare/AI/SecuritySettings.d.ts.map +1 -1
  109. package/lib/Cloudflare/AI/SecuritySettings.js +3 -1
  110. package/lib/Cloudflare/AI/SecuritySettings.js.map +1 -1
  111. package/lib/Cloudflare/AI/index.d.ts +1 -0
  112. package/lib/Cloudflare/AI/index.d.ts.map +1 -1
  113. package/lib/Cloudflare/AI/index.js +1 -0
  114. package/lib/Cloudflare/AI/index.js.map +1 -1
  115. package/lib/Cloudflare/Access/InfrastructureTarget.d.ts.map +1 -1
  116. package/lib/Cloudflare/Access/InfrastructureTarget.js +3 -1
  117. package/lib/Cloudflare/Access/InfrastructureTarget.js.map +1 -1
  118. package/lib/Cloudflare/Access/Organization.d.ts.map +1 -1
  119. package/lib/Cloudflare/Access/Organization.js +1 -1
  120. package/lib/Cloudflare/Access/Organization.js.map +1 -1
  121. package/lib/Cloudflare/Access/Policy.d.ts.map +1 -1
  122. package/lib/Cloudflare/Access/Policy.js +3 -1
  123. package/lib/Cloudflare/Access/Policy.js.map +1 -1
  124. package/lib/Cloudflare/Account/Account.d.ts.map +1 -1
  125. package/lib/Cloudflare/Account/Account.js +3 -1
  126. package/lib/Cloudflare/Account/Account.js.map +1 -1
  127. package/lib/Cloudflare/ApiToken/AccountApiToken.d.ts.map +1 -1
  128. package/lib/Cloudflare/ApiToken/AccountApiToken.js +1 -1
  129. package/lib/Cloudflare/ApiToken/AccountApiToken.js.map +1 -1
  130. package/lib/Cloudflare/ApiToken/UserApiToken.d.ts.map +1 -1
  131. package/lib/Cloudflare/ApiToken/UserApiToken.js +1 -1
  132. package/lib/Cloudflare/ApiToken/UserApiToken.js.map +1 -1
  133. package/lib/Cloudflare/Auth/AuthProvider.d.ts +3 -0
  134. package/lib/Cloudflare/Auth/AuthProvider.d.ts.map +1 -1
  135. package/lib/Cloudflare/Auth/AuthProvider.js +51 -14
  136. package/lib/Cloudflare/Auth/AuthProvider.js.map +1 -1
  137. package/lib/Cloudflare/BotManagement/BotManagement.d.ts.map +1 -1
  138. package/lib/Cloudflare/BotManagement/BotManagement.js +3 -1
  139. package/lib/Cloudflare/BotManagement/BotManagement.js.map +1 -1
  140. package/lib/Cloudflare/Cache/Reserve.d.ts.map +1 -1
  141. package/lib/Cloudflare/Cache/Reserve.js +3 -1
  142. package/lib/Cloudflare/Cache/Reserve.js.map +1 -1
  143. package/lib/Cloudflare/ClientCertificate/ClientCertificate.d.ts.map +1 -1
  144. package/lib/Cloudflare/ClientCertificate/ClientCertificate.js +3 -1
  145. package/lib/Cloudflare/ClientCertificate/ClientCertificate.js.map +1 -1
  146. package/lib/Cloudflare/Containers/Container.d.ts +2 -2
  147. package/lib/Cloudflare/Containers/Container.js +2 -2
  148. package/lib/Cloudflare/ContentScanning/ContentScanning.d.ts.map +1 -1
  149. package/lib/Cloudflare/ContentScanning/ContentScanning.js +3 -1
  150. package/lib/Cloudflare/ContentScanning/ContentScanning.js.map +1 -1
  151. package/lib/Cloudflare/CustomCertificate/CustomCertificate.d.ts.map +1 -1
  152. package/lib/Cloudflare/CustomCertificate/CustomCertificate.js +3 -1
  153. package/lib/Cloudflare/CustomCertificate/CustomCertificate.js.map +1 -1
  154. package/lib/Cloudflare/CustomHostname/CustomHostname.d.ts.map +1 -1
  155. package/lib/Cloudflare/CustomHostname/CustomHostname.js +1 -1
  156. package/lib/Cloudflare/CustomHostname/CustomHostname.js.map +1 -1
  157. package/lib/Cloudflare/CustomHostname/FallbackOrigin.d.ts.map +1 -1
  158. package/lib/Cloudflare/CustomHostname/FallbackOrigin.js +1 -1
  159. package/lib/Cloudflare/CustomHostname/FallbackOrigin.js.map +1 -1
  160. package/lib/Cloudflare/CustomNameserver/CustomNameserver.d.ts.map +1 -1
  161. package/lib/Cloudflare/CustomNameserver/CustomNameserver.js +3 -1
  162. package/lib/Cloudflare/CustomNameserver/CustomNameserver.js.map +1 -1
  163. package/lib/Cloudflare/D1/Database.d.ts.map +1 -1
  164. package/lib/Cloudflare/D1/Database.js +2 -2
  165. package/lib/Cloudflare/D1/Database.js.map +1 -1
  166. package/lib/Cloudflare/DNS/AccountSettings.d.ts.map +1 -1
  167. package/lib/Cloudflare/DNS/AccountSettings.js +3 -1
  168. package/lib/Cloudflare/DNS/AccountSettings.js.map +1 -1
  169. package/lib/Cloudflare/DNS/Dnssec.d.ts.map +1 -1
  170. package/lib/Cloudflare/DNS/Dnssec.js +3 -1
  171. package/lib/Cloudflare/DNS/Dnssec.js.map +1 -1
  172. package/lib/Cloudflare/DNS/Firewall.d.ts.map +1 -1
  173. package/lib/Cloudflare/DNS/Firewall.js +3 -1
  174. package/lib/Cloudflare/DNS/Firewall.js.map +1 -1
  175. package/lib/Cloudflare/DNS/Record.d.ts.map +1 -1
  176. package/lib/Cloudflare/DNS/Record.js +3 -1
  177. package/lib/Cloudflare/DNS/Record.js.map +1 -1
  178. package/lib/Cloudflare/DNS/View.d.ts.map +1 -1
  179. package/lib/Cloudflare/DNS/View.js +3 -1
  180. package/lib/Cloudflare/DNS/View.js.map +1 -1
  181. package/lib/Cloudflare/DNS/ZoneSettings.d.ts.map +1 -1
  182. package/lib/Cloudflare/DNS/ZoneSettings.js +3 -1
  183. package/lib/Cloudflare/DNS/ZoneSettings.js.map +1 -1
  184. package/lib/Cloudflare/DNS/ZoneTransferAcl.d.ts.map +1 -1
  185. package/lib/Cloudflare/DNS/ZoneTransferAcl.js +3 -1
  186. package/lib/Cloudflare/DNS/ZoneTransferAcl.js.map +1 -1
  187. package/lib/Cloudflare/DNS/ZoneTransferIncoming.d.ts.map +1 -1
  188. package/lib/Cloudflare/DNS/ZoneTransferIncoming.js +3 -1
  189. package/lib/Cloudflare/DNS/ZoneTransferIncoming.js.map +1 -1
  190. package/lib/Cloudflare/DNS/ZoneTransferOutgoing.d.ts.map +1 -1
  191. package/lib/Cloudflare/DNS/ZoneTransferOutgoing.js +3 -1
  192. package/lib/Cloudflare/DNS/ZoneTransferOutgoing.js.map +1 -1
  193. package/lib/Cloudflare/DNS/ZoneTransferPeer.d.ts.map +1 -1
  194. package/lib/Cloudflare/DNS/ZoneTransferPeer.js +3 -1
  195. package/lib/Cloudflare/DNS/ZoneTransferPeer.js.map +1 -1
  196. package/lib/Cloudflare/DNS/ZoneTransferTsig.d.ts.map +1 -1
  197. package/lib/Cloudflare/DNS/ZoneTransferTsig.js +3 -1
  198. package/lib/Cloudflare/DNS/ZoneTransferTsig.js.map +1 -1
  199. package/lib/Cloudflare/Email/Address.d.ts.map +1 -1
  200. package/lib/Cloudflare/Email/Address.js +3 -1
  201. package/lib/Cloudflare/Email/Address.js.map +1 -1
  202. package/lib/Cloudflare/Email/AllowPolicy.d.ts.map +1 -1
  203. package/lib/Cloudflare/Email/AllowPolicy.js +1 -1
  204. package/lib/Cloudflare/Email/AllowPolicy.js.map +1 -1
  205. package/lib/Cloudflare/Email/BlockSender.d.ts.map +1 -1
  206. package/lib/Cloudflare/Email/BlockSender.js +1 -1
  207. package/lib/Cloudflare/Email/BlockSender.js.map +1 -1
  208. package/lib/Cloudflare/Email/CatchAll.d.ts.map +1 -1
  209. package/lib/Cloudflare/Email/CatchAll.js +8 -2
  210. package/lib/Cloudflare/Email/CatchAll.js.map +1 -1
  211. package/lib/Cloudflare/Email/Domain.d.ts.map +1 -1
  212. package/lib/Cloudflare/Email/Domain.js +3 -1
  213. package/lib/Cloudflare/Email/Domain.js.map +1 -1
  214. package/lib/Cloudflare/Email/ImpersonationRegistryEntry.d.ts.map +1 -1
  215. package/lib/Cloudflare/Email/ImpersonationRegistryEntry.js +1 -1
  216. package/lib/Cloudflare/Email/ImpersonationRegistryEntry.js.map +1 -1
  217. package/lib/Cloudflare/Email/Routing.d.ts.map +1 -1
  218. package/lib/Cloudflare/Email/Routing.js +3 -1
  219. package/lib/Cloudflare/Email/Routing.js.map +1 -1
  220. package/lib/Cloudflare/Email/Rule.d.ts.map +1 -1
  221. package/lib/Cloudflare/Email/Rule.js +3 -1
  222. package/lib/Cloudflare/Email/Rule.js.map +1 -1
  223. package/lib/Cloudflare/Email/SendingSubdomain.d.ts.map +1 -1
  224. package/lib/Cloudflare/Email/SendingSubdomain.js +1 -1
  225. package/lib/Cloudflare/Email/SendingSubdomain.js.map +1 -1
  226. package/lib/Cloudflare/Email/TrustedDomain.d.ts.map +1 -1
  227. package/lib/Cloudflare/Email/TrustedDomain.js +1 -1
  228. package/lib/Cloudflare/Email/TrustedDomain.js.map +1 -1
  229. package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
  230. package/lib/Cloudflare/Fetcher.js +10 -3
  231. package/lib/Cloudflare/Fetcher.js.map +1 -1
  232. package/lib/Cloudflare/Flagship/App.d.ts.map +1 -1
  233. package/lib/Cloudflare/Flagship/App.js +2 -3
  234. package/lib/Cloudflare/Flagship/App.js.map +1 -1
  235. package/lib/Cloudflare/Fraud/DetectionSettings.d.ts.map +1 -1
  236. package/lib/Cloudflare/Fraud/DetectionSettings.js +3 -1
  237. package/lib/Cloudflare/Fraud/DetectionSettings.js.map +1 -1
  238. package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.d.ts.map +1 -1
  239. package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js +8 -2
  240. package/lib/Cloudflare/GoogleTagGateway/GoogleTagGateway.js.map +1 -1
  241. package/lib/Cloudflare/Healthcheck/Healthcheck.d.ts.map +1 -1
  242. package/lib/Cloudflare/Healthcheck/Healthcheck.js +3 -1
  243. package/lib/Cloudflare/Healthcheck/Healthcheck.js.map +1 -1
  244. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.d.ts.map +1 -1
  245. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js +3 -1
  246. package/lib/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.js.map +1 -1
  247. package/lib/Cloudflare/Hyperdrive/Connection.d.ts.map +1 -1
  248. package/lib/Cloudflare/Hyperdrive/Connection.js +2 -4
  249. package/lib/Cloudflare/Hyperdrive/Connection.js.map +1 -1
  250. package/lib/Cloudflare/KV/Namespace.d.ts.map +1 -1
  251. package/lib/Cloudflare/KV/Namespace.js +5 -4
  252. package/lib/Cloudflare/KV/Namespace.js.map +1 -1
  253. package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.d.ts.map +1 -1
  254. package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.js +3 -1
  255. package/lib/Cloudflare/KeylessCertificate/KeylessCertificate.js.map +1 -1
  256. package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.d.ts.map +1 -1
  257. package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.js +3 -1
  258. package/lib/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.js.map +1 -1
  259. package/lib/Cloudflare/LoadBalancer/LoadBalancer.d.ts.map +1 -1
  260. package/lib/Cloudflare/LoadBalancer/LoadBalancer.js +3 -1
  261. package/lib/Cloudflare/LoadBalancer/LoadBalancer.js.map +1 -1
  262. package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.d.ts.map +1 -1
  263. package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.js +3 -1
  264. package/lib/Cloudflare/ManagedTransforms/ManagedTransforms.js.map +1 -1
  265. package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.d.ts.map +1 -1
  266. package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.js +3 -1
  267. package/lib/Cloudflare/MtlsCertificate/MtlsCertificate.js.map +1 -1
  268. package/lib/Cloudflare/Organization/Organization.d.ts.map +1 -1
  269. package/lib/Cloudflare/Organization/Organization.js +3 -1
  270. package/lib/Cloudflare/Organization/Organization.js.map +1 -1
  271. package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.d.ts.map +1 -1
  272. package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.js +7 -2
  273. package/lib/Cloudflare/OriginCaCertificate/OriginCaCertificate.js.map +1 -1
  274. package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.d.ts.map +1 -1
  275. package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.js +3 -1
  276. package/lib/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.js.map +1 -1
  277. package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.d.ts.map +1 -1
  278. package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.js +5 -1
  279. package/lib/Cloudflare/OriginTlsClientAuth/HostnameCertificate.js.map +1 -1
  280. package/lib/Cloudflare/PageRule/PageRule.d.ts.map +1 -1
  281. package/lib/Cloudflare/PageRule/PageRule.js +3 -1
  282. package/lib/Cloudflare/PageRule/PageRule.js.map +1 -1
  283. package/lib/Cloudflare/Providers.d.ts +29 -0
  284. package/lib/Cloudflare/Providers.d.ts.map +1 -1
  285. package/lib/Cloudflare/Providers.js +30 -19
  286. package/lib/Cloudflare/Providers.js.map +1 -1
  287. package/lib/Cloudflare/Queues/Consumer.d.ts.map +1 -1
  288. package/lib/Cloudflare/Queues/Consumer.js +3 -1
  289. package/lib/Cloudflare/Queues/Consumer.js.map +1 -1
  290. package/lib/Cloudflare/Queues/Queue.d.ts.map +1 -1
  291. package/lib/Cloudflare/Queues/Queue.js +5 -4
  292. package/lib/Cloudflare/Queues/Queue.js.map +1 -1
  293. package/lib/Cloudflare/Queues/Subscription.d.ts.map +1 -1
  294. package/lib/Cloudflare/Queues/Subscription.js +3 -1
  295. package/lib/Cloudflare/Queues/Subscription.js.map +1 -1
  296. package/lib/Cloudflare/R2/Bucket.d.ts +98 -0
  297. package/lib/Cloudflare/R2/Bucket.d.ts.map +1 -1
  298. package/lib/Cloudflare/R2/Bucket.js +141 -3
  299. package/lib/Cloudflare/R2/Bucket.js.map +1 -1
  300. package/lib/Cloudflare/RegionalHostname/RegionalHostname.d.ts.map +1 -1
  301. package/lib/Cloudflare/RegionalHostname/RegionalHostname.js +3 -1
  302. package/lib/Cloudflare/RegionalHostname/RegionalHostname.js.map +1 -1
  303. package/lib/Cloudflare/Ruleset/Ruleset.d.ts.map +1 -1
  304. package/lib/Cloudflare/Ruleset/Ruleset.js +8 -3
  305. package/lib/Cloudflare/Ruleset/Ruleset.js.map +1 -1
  306. package/lib/Cloudflare/SecretsStore/Secret.d.ts.map +1 -1
  307. package/lib/Cloudflare/SecretsStore/Secret.js +31 -5
  308. package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
  309. package/lib/Cloudflare/SecurityTxt/SecurityTxt.d.ts.map +1 -1
  310. package/lib/Cloudflare/SecurityTxt/SecurityTxt.js +3 -1
  311. package/lib/Cloudflare/SecurityTxt/SecurityTxt.js.map +1 -1
  312. package/lib/Cloudflare/StateStore/Api.d.ts +15 -0
  313. package/lib/Cloudflare/StateStore/State.d.ts +30 -1
  314. package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
  315. package/lib/Cloudflare/StateStore/State.js +85 -16
  316. package/lib/Cloudflare/StateStore/State.js.map +1 -1
  317. package/lib/Cloudflare/Tags/AccountResourceTags.d.ts.map +1 -1
  318. package/lib/Cloudflare/Tags/AccountResourceTags.js +8 -3
  319. package/lib/Cloudflare/Tags/AccountResourceTags.js.map +1 -1
  320. package/lib/Cloudflare/Tunnel/Route.d.ts.map +1 -1
  321. package/lib/Cloudflare/Tunnel/Route.js +3 -1
  322. package/lib/Cloudflare/Tunnel/Route.js.map +1 -1
  323. package/lib/Cloudflare/Tunnel/Tunnel.d.ts.map +1 -1
  324. package/lib/Cloudflare/Tunnel/Tunnel.js +3 -1
  325. package/lib/Cloudflare/Tunnel/Tunnel.js.map +1 -1
  326. package/lib/Cloudflare/UrlNormalization/UrlNormalization.d.ts.map +1 -1
  327. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js +3 -1
  328. package/lib/Cloudflare/UrlNormalization/UrlNormalization.js.map +1 -1
  329. package/lib/Cloudflare/Vectorize/VectorizeIndex.d.ts.map +1 -1
  330. package/lib/Cloudflare/Vectorize/VectorizeIndex.js +2 -3
  331. package/lib/Cloudflare/Vectorize/VectorizeIndex.js.map +1 -1
  332. package/lib/Cloudflare/VpcService/VpcService.d.ts.map +1 -1
  333. package/lib/Cloudflare/VpcService/VpcService.js +1 -1
  334. package/lib/Cloudflare/VpcService/VpcService.js.map +1 -1
  335. package/lib/Cloudflare/WaitingRoom/WaitingRoom.d.ts.map +1 -1
  336. package/lib/Cloudflare/WaitingRoom/WaitingRoom.js +3 -1
  337. package/lib/Cloudflare/WaitingRoom/WaitingRoom.js.map +1 -1
  338. package/lib/Cloudflare/Web3/ContentList.d.ts.map +1 -1
  339. package/lib/Cloudflare/Web3/ContentList.js +3 -1
  340. package/lib/Cloudflare/Web3/ContentList.js.map +1 -1
  341. package/lib/Cloudflare/Web3/Hostname.d.ts.map +1 -1
  342. package/lib/Cloudflare/Web3/Hostname.js +3 -1
  343. package/lib/Cloudflare/Web3/Hostname.js.map +1 -1
  344. package/lib/Cloudflare/Workers/Cache.d.ts +71 -0
  345. package/lib/Cloudflare/Workers/Cache.d.ts.map +1 -0
  346. package/lib/Cloudflare/Workers/Cache.js +64 -0
  347. package/lib/Cloudflare/Workers/Cache.js.map +1 -0
  348. package/lib/Cloudflare/Workers/CronEventSource.d.ts +180 -6
  349. package/lib/Cloudflare/Workers/CronEventSource.d.ts.map +1 -1
  350. package/lib/Cloudflare/Workers/CronEventSource.js +180 -6
  351. package/lib/Cloudflare/Workers/CronEventSource.js.map +1 -1
  352. package/lib/Cloudflare/Workers/DurableObject.d.ts +36 -1
  353. package/lib/Cloudflare/Workers/DurableObject.d.ts.map +1 -1
  354. package/lib/Cloudflare/Workers/DurableObject.js +36 -1
  355. package/lib/Cloudflare/Workers/DurableObject.js.map +1 -1
  356. package/lib/Cloudflare/Workers/DurableObjectState.d.ts +11 -0
  357. package/lib/Cloudflare/Workers/DurableObjectState.d.ts.map +1 -1
  358. package/lib/Cloudflare/Workers/DurableObjectState.js +7 -0
  359. package/lib/Cloudflare/Workers/DurableObjectState.js.map +1 -1
  360. package/lib/Cloudflare/Workers/Fetch.js +2 -2
  361. package/lib/Cloudflare/Workers/Fetch.js.map +1 -1
  362. package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
  363. package/lib/Cloudflare/Workers/LocalWorkerProvider.js +3 -0
  364. package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
  365. package/lib/Cloudflare/Workers/Worker.d.ts +230 -4
  366. package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
  367. package/lib/Cloudflare/Workers/Worker.js +161 -7
  368. package/lib/Cloudflare/Workers/Worker.js.map +1 -1
  369. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +9 -0
  370. package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
  371. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +15 -0
  372. package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
  373. package/lib/Cloudflare/Workers/WorkerBinding.d.ts +30 -0
  374. package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
  375. package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
  376. package/lib/Cloudflare/Workers/WorkerBridge.js +27 -5
  377. package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
  378. package/lib/Cloudflare/Workers/WorkerLoader.js +9 -1
  379. package/lib/Cloudflare/Workers/WorkerLoader.js.map +1 -1
  380. package/lib/Cloudflare/Workers/WorkerProvider.d.ts.map +1 -1
  381. package/lib/Cloudflare/Workers/WorkerProvider.js +365 -18
  382. package/lib/Cloudflare/Workers/WorkerProvider.js.map +1 -1
  383. package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
  384. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +20 -3
  385. package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
  386. package/lib/Cloudflare/Workers/index.d.ts +1 -0
  387. package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
  388. package/lib/Cloudflare/Workers/index.js +1 -0
  389. package/lib/Cloudflare/Workers/index.js.map +1 -1
  390. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.d.ts.map +1 -1
  391. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js +2 -3
  392. package/lib/Cloudflare/WorkersForPlatforms/DispatchNamespace.js.map +1 -1
  393. package/lib/Cloudflare/Workflows/Workflow.d.ts +200 -24
  394. package/lib/Cloudflare/Workflows/Workflow.d.ts.map +1 -1
  395. package/lib/Cloudflare/Workflows/Workflow.js +126 -28
  396. package/lib/Cloudflare/Workflows/Workflow.js.map +1 -1
  397. package/lib/Cloudflare/Workflows/WorkflowBridge.d.ts.map +1 -1
  398. package/lib/Cloudflare/Workflows/WorkflowBridge.js +42 -3
  399. package/lib/Cloudflare/Workflows/WorkflowBridge.js.map +1 -1
  400. package/lib/Cloudflare/Zaraz/Config.d.ts +1 -0
  401. package/lib/Cloudflare/Zaraz/Config.d.ts.map +1 -1
  402. package/lib/Cloudflare/Zaraz/Config.js +8 -2
  403. package/lib/Cloudflare/Zaraz/Config.js.map +1 -1
  404. package/lib/Cloudflare/Zone/Zone.d.ts.map +1 -1
  405. package/lib/Cloudflare/Zone/Zone.js +1 -0
  406. package/lib/Cloudflare/Zone/Zone.js.map +1 -1
  407. package/lib/Docker/Container.d.ts.map +1 -1
  408. package/lib/Docker/Container.js +11 -1
  409. package/lib/Docker/Container.js.map +1 -1
  410. package/lib/Drizzle/Schema.d.ts.map +1 -1
  411. package/lib/Drizzle/Schema.js +12 -5
  412. package/lib/Drizzle/Schema.js.map +1 -1
  413. package/lib/Neon/Branch.d.ts.map +1 -1
  414. package/lib/Neon/Branch.js +15 -3
  415. package/lib/Neon/Branch.js.map +1 -1
  416. package/lib/Output.d.ts +13 -1
  417. package/lib/Output.d.ts.map +1 -1
  418. package/lib/Output.js +17 -3
  419. package/lib/Output.js.map +1 -1
  420. package/lib/Planetscale/Postgres/PostgresRole.js +2 -2
  421. package/lib/Planetscale/Postgres/PostgresRole.js.map +1 -1
  422. package/lib/Provider.d.ts +8 -0
  423. package/lib/Provider.d.ts.map +1 -1
  424. package/lib/Provider.js +38 -3
  425. package/lib/Provider.js.map +1 -1
  426. package/lib/Ref.d.ts +9 -1
  427. package/lib/Ref.d.ts.map +1 -1
  428. package/lib/Ref.js +2 -1
  429. package/lib/Ref.js.map +1 -1
  430. package/lib/Resource.d.ts +44 -0
  431. package/lib/Resource.d.ts.map +1 -1
  432. package/lib/Resource.js +22 -1
  433. package/lib/Resource.js.map +1 -1
  434. package/lib/Stack.js +1 -1
  435. package/lib/Stack.js.map +1 -1
  436. package/lib/State/HttpStateApi.d.ts +4 -4
  437. package/lib/State/HttpStateStore.d.ts +12 -0
  438. package/lib/State/HttpStateStore.d.ts.map +1 -1
  439. package/lib/State/HttpStateStore.js +46 -5
  440. package/lib/State/HttpStateStore.js.map +1 -1
  441. package/lib/Sync.d.ts +109 -0
  442. package/lib/Sync.d.ts.map +1 -0
  443. package/lib/Sync.js +312 -0
  444. package/lib/Sync.js.map +1 -0
  445. package/lib/Test/Bun.d.ts +1 -1
  446. package/lib/Test/Bun.d.ts.map +1 -1
  447. package/lib/Test/Bun.js +1 -1
  448. package/lib/Test/Bun.js.map +1 -1
  449. package/lib/Test/Http.d.ts +67 -0
  450. package/lib/Test/Http.d.ts.map +1 -1
  451. package/lib/Test/Http.js +69 -0
  452. package/lib/Test/Http.js.map +1 -1
  453. package/lib/Test/Vitest.d.ts +1 -1
  454. package/lib/Test/Vitest.d.ts.map +1 -1
  455. package/lib/Test/Vitest.js +1 -0
  456. package/lib/Test/Vitest.js.map +1 -1
  457. package/lib/Util/proxy-chain.js +14 -15
  458. package/lib/Util/proxy-chain.js.map +1 -1
  459. package/lib/index.d.ts +1 -0
  460. package/lib/index.d.ts.map +1 -1
  461. package/lib/index.js +1 -0
  462. package/lib/index.js.map +1 -1
  463. package/package.json +19 -19
  464. package/src/AWS/ACM/Certificate.ts +13 -2
  465. package/src/AWS/AutoScaling/AutoScalingGroup.ts +21 -15
  466. package/src/AWS/AutoScaling/LaunchTemplate.ts +6 -1
  467. package/src/AWS/AutoScaling/ScalingPolicy.ts +31 -17
  468. package/src/AWS/CloudFront/PublicKey.ts +4 -0
  469. package/src/AWS/DynamoDB/Table.ts +1 -1
  470. package/src/AWS/ECS/Service.ts +35 -6
  471. package/src/AWS/IAM/OpenIDConnectProvider.ts +9 -1
  472. package/src/AWS/Lambda/Alias.ts +42 -0
  473. package/src/AWS/Lambda/EventInvokeConfig.ts +150 -0
  474. package/src/AWS/Lambda/Function.ts +35 -2
  475. package/src/AWS/Lambda/index.ts +1 -0
  476. package/src/AWS/Organizations/DelegatedAdministrator.ts +11 -3
  477. package/src/AWS/Organizations/PolicyAttachment.ts +10 -4
  478. package/src/AWS/Organizations/RootPolicyType.ts +9 -4
  479. package/src/AWS/Organizations/TrustedServiceAccess.ts +9 -3
  480. package/src/AWS/Route53/HostedZone.ts +30 -13
  481. package/src/AWS/Route53/Record.ts +44 -22
  482. package/src/Apply.ts +7 -1
  483. package/src/Auth/Lock.ts +62 -18
  484. package/src/Bundle/PurePlugin.ts +15 -2
  485. package/src/Cli/commands/sync.ts +123 -0
  486. package/src/Cli/main.ts +2 -0
  487. package/src/Cloudflare/AI/CustomTopics.ts +3 -1
  488. package/src/Cloudflare/AI/Dataset.ts +3 -1
  489. package/src/Cloudflare/AI/Evaluation.ts +3 -1
  490. package/src/Cloudflare/AI/Gateway.ts +5 -6
  491. package/src/Cloudflare/AI/GatewayDynamicRouting.ts +3 -1
  492. package/src/Cloudflare/AI/GatewayProvider.ts +5 -2
  493. package/src/Cloudflare/AI/ProviderKey.ts +161 -0
  494. package/src/Cloudflare/AI/SearchInstance.ts +5 -4
  495. package/src/Cloudflare/AI/SearchNamespace.ts +5 -4
  496. package/src/Cloudflare/AI/SearchToken.ts +3 -1
  497. package/src/Cloudflare/AI/SecuritySettings.ts +3 -0
  498. package/src/Cloudflare/AI/index.ts +1 -0
  499. package/src/Cloudflare/Access/InfrastructureTarget.ts +4 -1
  500. package/src/Cloudflare/Access/Organization.ts +1 -0
  501. package/src/Cloudflare/Access/Policy.ts +3 -1
  502. package/src/Cloudflare/Account/Account.ts +3 -1
  503. package/src/Cloudflare/ApiToken/AccountApiToken.ts +1 -0
  504. package/src/Cloudflare/ApiToken/UserApiToken.ts +1 -0
  505. package/src/Cloudflare/Auth/AuthProvider.ts +69 -8
  506. package/src/Cloudflare/BotManagement/BotManagement.ts +3 -1
  507. package/src/Cloudflare/Cache/Reserve.ts +3 -1
  508. package/src/Cloudflare/ClientCertificate/ClientCertificate.ts +3 -1
  509. package/src/Cloudflare/Containers/Container.ts +2 -2
  510. package/src/Cloudflare/ContentScanning/ContentScanning.ts +3 -1
  511. package/src/Cloudflare/CustomCertificate/CustomCertificate.ts +3 -1
  512. package/src/Cloudflare/CustomHostname/CustomHostname.ts +1 -0
  513. package/src/Cloudflare/CustomHostname/FallbackOrigin.ts +1 -0
  514. package/src/Cloudflare/CustomNameserver/CustomNameserver.ts +3 -1
  515. package/src/Cloudflare/D1/Database.ts +2 -2
  516. package/src/Cloudflare/DNS/AccountSettings.ts +3 -1
  517. package/src/Cloudflare/DNS/Dnssec.ts +3 -1
  518. package/src/Cloudflare/DNS/Firewall.ts +3 -1
  519. package/src/Cloudflare/DNS/Record.ts +3 -1
  520. package/src/Cloudflare/DNS/View.ts +3 -1
  521. package/src/Cloudflare/DNS/ZoneSettings.ts +3 -1
  522. package/src/Cloudflare/DNS/ZoneTransferAcl.ts +3 -1
  523. package/src/Cloudflare/DNS/ZoneTransferIncoming.ts +3 -1
  524. package/src/Cloudflare/DNS/ZoneTransferOutgoing.ts +3 -1
  525. package/src/Cloudflare/DNS/ZoneTransferPeer.ts +3 -1
  526. package/src/Cloudflare/DNS/ZoneTransferTsig.ts +3 -1
  527. package/src/Cloudflare/Email/Address.ts +3 -1
  528. package/src/Cloudflare/Email/AllowPolicy.ts +1 -0
  529. package/src/Cloudflare/Email/BlockSender.ts +1 -0
  530. package/src/Cloudflare/Email/CatchAll.ts +7 -2
  531. package/src/Cloudflare/Email/Domain.ts +3 -1
  532. package/src/Cloudflare/Email/ImpersonationRegistryEntry.ts +1 -0
  533. package/src/Cloudflare/Email/Routing.ts +3 -1
  534. package/src/Cloudflare/Email/Rule.ts +3 -1
  535. package/src/Cloudflare/Email/SendingSubdomain.ts +1 -0
  536. package/src/Cloudflare/Email/TrustedDomain.ts +1 -0
  537. package/src/Cloudflare/Fetcher.ts +12 -5
  538. package/src/Cloudflare/Flagship/App.ts +2 -3
  539. package/src/Cloudflare/Fraud/DetectionSettings.ts +3 -1
  540. package/src/Cloudflare/GoogleTagGateway/GoogleTagGateway.ts +7 -2
  541. package/src/Cloudflare/Healthcheck/Healthcheck.ts +3 -1
  542. package/src/Cloudflare/HostnameTlsSetting/HostnameTlsSetting.ts +3 -1
  543. package/src/Cloudflare/Hyperdrive/Connection.ts +2 -4
  544. package/src/Cloudflare/KV/Namespace.ts +5 -4
  545. package/src/Cloudflare/KeylessCertificate/KeylessCertificate.ts +3 -1
  546. package/src/Cloudflare/LeakedCredentialCheck/LeakedCredentialCheck.ts +3 -1
  547. package/src/Cloudflare/LoadBalancer/LoadBalancer.ts +3 -1
  548. package/src/Cloudflare/ManagedTransforms/ManagedTransforms.ts +3 -1
  549. package/src/Cloudflare/MtlsCertificate/MtlsCertificate.ts +3 -1
  550. package/src/Cloudflare/Organization/Organization.ts +3 -1
  551. package/src/Cloudflare/OriginCaCertificate/OriginCaCertificate.ts +7 -2
  552. package/src/Cloudflare/OriginPostQuantumEncryption/OriginPostQuantumEncryption.ts +3 -1
  553. package/src/Cloudflare/OriginTlsClientAuth/HostnameCertificate.ts +5 -1
  554. package/src/Cloudflare/PageRule/PageRule.ts +3 -1
  555. package/src/Cloudflare/Providers.ts +34 -19
  556. package/src/Cloudflare/Queues/Consumer.ts +3 -1
  557. package/src/Cloudflare/Queues/Queue.ts +5 -4
  558. package/src/Cloudflare/Queues/Subscription.ts +3 -1
  559. package/src/Cloudflare/R2/Bucket.ts +230 -3
  560. package/src/Cloudflare/RegionalHostname/RegionalHostname.ts +3 -1
  561. package/src/Cloudflare/Ruleset/Ruleset.ts +9 -4
  562. package/src/Cloudflare/SecretsStore/Secret.ts +46 -5
  563. package/src/Cloudflare/SecurityTxt/SecurityTxt.ts +3 -1
  564. package/src/Cloudflare/StateStore/State.ts +89 -24
  565. package/src/Cloudflare/Tags/AccountResourceTags.ts +9 -5
  566. package/src/Cloudflare/Tunnel/Route.ts +3 -1
  567. package/src/Cloudflare/Tunnel/Tunnel.ts +3 -1
  568. package/src/Cloudflare/UrlNormalization/UrlNormalization.ts +3 -1
  569. package/src/Cloudflare/Vectorize/VectorizeIndex.ts +2 -3
  570. package/src/Cloudflare/VpcService/VpcService.ts +1 -0
  571. package/src/Cloudflare/WaitingRoom/WaitingRoom.ts +3 -1
  572. package/src/Cloudflare/Web3/ContentList.ts +3 -1
  573. package/src/Cloudflare/Web3/Hostname.ts +3 -1
  574. package/src/Cloudflare/Workers/Cache.ts +102 -0
  575. package/src/Cloudflare/Workers/CronEventSource.ts +180 -6
  576. package/src/Cloudflare/Workers/DurableObject.ts +36 -1
  577. package/src/Cloudflare/Workers/DurableObjectState.ts +25 -0
  578. package/src/Cloudflare/Workers/Fetch.ts +2 -2
  579. package/src/Cloudflare/Workers/LocalWorkerProvider.ts +3 -0
  580. package/src/Cloudflare/Workers/Worker.ts +315 -9
  581. package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +18 -0
  582. package/src/Cloudflare/Workers/WorkerBridge.ts +37 -10
  583. package/src/Cloudflare/Workers/WorkerLoader.ts +10 -1
  584. package/src/Cloudflare/Workers/WorkerProvider.ts +576 -40
  585. package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +23 -2
  586. package/src/Cloudflare/Workers/index.ts +1 -0
  587. package/src/Cloudflare/WorkersForPlatforms/DispatchNamespace.ts +2 -4
  588. package/src/Cloudflare/Workflows/Workflow.ts +296 -38
  589. package/src/Cloudflare/Workflows/WorkflowBridge.ts +62 -12
  590. package/src/Cloudflare/Zaraz/Config.ts +7 -2
  591. package/src/Cloudflare/Zone/Zone.ts +1 -0
  592. package/src/Docker/Container.ts +10 -1
  593. package/src/Drizzle/Schema.ts +12 -5
  594. package/src/Neon/Branch.ts +15 -3
  595. package/src/Output.ts +18 -2
  596. package/src/Planetscale/Postgres/PostgresRole.ts +2 -2
  597. package/src/Provider.ts +53 -3
  598. package/src/Ref.ts +10 -0
  599. package/src/Resource.ts +50 -1
  600. package/src/Stack.ts +1 -1
  601. package/src/State/HttpStateStore.ts +47 -5
  602. package/src/Sync.ts +494 -0
  603. package/src/Test/Bun.ts +4 -0
  604. package/src/Test/Http.ts +133 -0
  605. package/src/Test/Vitest.ts +11 -0
  606. package/src/Util/proxy-chain.ts +9 -12
  607. 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 the {@link https://alchemy.run/guides/async-lambda | Async Lambda Guide}
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
- * {@link https://alchemy.run/guides/lambda | Effect Lambda Guide}
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,
@@ -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: output?.accountId ?? olds!.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
- return yield* readAttachment({
59
- policyId: output?.policyId ?? olds!.policyId,
60
- targetId: output?.targetId ?? olds!.targetId,
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
- return yield* readRootPolicyType({
58
- rootId: output?.rootId ?? olds!.rootId,
59
- policyType: output?.policyType ?? olds!.policyType,
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
- return yield* readTrustedServiceAccess(
49
- output?.servicePrincipal ?? olds!.servicePrincipal,
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.getChange({ Id: changeId }).pipe(
119
- Effect.map((r) => r.ChangeInfo.Status),
120
- Effect.catchTag("NoSuchChange", () => Effect.succeed("PENDING")),
121
- Effect.repeat({
122
- schedule: Schedule.fixed("2 seconds").pipe(
123
- Schedule.both(Schedule.recurs(60)),
124
- ),
125
- until: (status) => status === "INSYNC",
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
- normalizeName(olds.name) !== normalizeName(news.name) ||
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
- const zoneId = output?.id ?? (yield* findByName(olds!.name))?.Id;
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.getChange({ Id: changeId }).pipe(
482
- Effect.map((response) => response.ChangeInfo.Status),
483
- Effect.catchTag("NoSuchChange", () => Effect.succeed("PENDING")),
484
- Effect.repeat({
485
- schedule: Schedule.fixed("2 seconds").pipe(
486
- Schedule.both(Schedule.recurs(60)),
487
- ),
488
- until: (status) => status === "INSYNC",
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
- normalizeHostedZoneId(olds.hostedZoneId) !==
595
- normalizeHostedZoneId(news.hostedZoneId) ||
596
- normalizeName(olds.name) !== normalizeName(news.name) ||
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 recordSet = yield* findRecord(
605
- output?.hostedZoneId ?? olds!.hostedZoneId,
606
- {
607
- name: output?.name ?? olds!.name,
608
- type: output?.type ?? olds!.type,
609
- setIdentifier: output?.setIdentifier ?? olds!.setIdentifier,
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, output?.hostedZoneId ?? olds!.hostedZoneId);
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
- await fs.mkdir(lockDir, { recursive: true });
29
- return await lock(lockPath, {
30
- retries: { retries: 600, minTimeout: 50, maxTimeout: 50 },
31
- // The holder refreshes the lockfile mtime on a timer. Under heavy
32
- // load (e.g. a full test run saturating every core) that timer can
33
- // be starved for several seconds, so keep the stale threshold well
34
- // above any realistic starvation pause.
35
- stale: 30_000,
36
- realpath: false,
37
- // The library's default handler throws from a timer callback,
38
- // which surfaces as an uncaught exception and kills the process.
39
- // A compromised auth lock is benign here (worst case two refreshes
40
- // race), so log and continue.
41
- onCompromised: (err) => {
42
- console.warn(`auth lock compromised (continuing): ${err.message}`);
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(() => {})),
@@ -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
- cacheDescendants(cache, visited, foundRoot, foundInfo);
352
- return foundInfo;
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