alchemy 0.16.9 → 0.17.0

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 (429) hide show
  1. package/lib/ai/astro-file.d.ts +1 -1
  2. package/lib/ai/astro-file.d.ts.map +1 -1
  3. package/lib/ai/astro-file.js +1 -1
  4. package/lib/ai/astro-file.js.map +1 -1
  5. package/lib/ai/client.js +2 -2
  6. package/lib/ai/client.js.map +1 -1
  7. package/lib/ai/css-file.d.ts +1 -1
  8. package/lib/ai/css-file.d.ts.map +1 -1
  9. package/lib/ai/css-file.js +1 -1
  10. package/lib/ai/css-file.js.map +1 -1
  11. package/lib/ai/data.d.ts +1 -1
  12. package/lib/ai/data.d.ts.map +1 -1
  13. package/lib/ai/data.js +1 -1
  14. package/lib/ai/data.js.map +1 -1
  15. package/lib/ai/html-file.d.ts +1 -1
  16. package/lib/ai/html-file.d.ts.map +1 -1
  17. package/lib/ai/html-file.js +1 -1
  18. package/lib/ai/html-file.js.map +1 -1
  19. package/lib/ai/json-file.d.ts +1 -1
  20. package/lib/ai/json-file.d.ts.map +1 -1
  21. package/lib/ai/json-file.js +1 -1
  22. package/lib/ai/json-file.js.map +1 -1
  23. package/lib/ai/typescript-file.d.ts +1 -1
  24. package/lib/ai/typescript-file.d.ts.map +1 -1
  25. package/lib/ai/typescript-file.js +1 -1
  26. package/lib/ai/typescript-file.js.map +1 -1
  27. package/lib/ai/vue-file.d.ts +1 -1
  28. package/lib/ai/vue-file.d.ts.map +1 -1
  29. package/lib/ai/vue-file.js +1 -1
  30. package/lib/ai/vue-file.js.map +1 -1
  31. package/lib/ai/yaml-file.d.ts +1 -1
  32. package/lib/ai/yaml-file.d.ts.map +1 -1
  33. package/lib/ai/yaml-file.js +2 -2
  34. package/lib/ai/yaml-file.js.map +1 -1
  35. package/lib/alchemy.d.ts +4 -0
  36. package/lib/alchemy.d.ts.map +1 -1
  37. package/lib/alchemy.js +14 -4
  38. package/lib/alchemy.js.map +1 -1
  39. package/lib/apply.d.ts +2 -0
  40. package/lib/apply.d.ts.map +1 -1
  41. package/lib/apply.js +17 -2
  42. package/lib/apply.js.map +1 -1
  43. package/lib/aws/bucket.d.ts +1 -1
  44. package/lib/aws/bucket.d.ts.map +1 -1
  45. package/lib/aws/bucket.js +1 -1
  46. package/lib/aws/bucket.js.map +1 -1
  47. package/lib/aws/function.d.ts +1 -1
  48. package/lib/aws/function.d.ts.map +1 -1
  49. package/lib/aws/function.js +2 -2
  50. package/lib/aws/function.js.map +1 -1
  51. package/lib/aws/oidc/oidc-provider.d.ts +1 -1
  52. package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
  53. package/lib/aws/oidc/oidc-provider.js +1 -1
  54. package/lib/aws/oidc/oidc-provider.js.map +1 -1
  55. package/lib/aws/policy-attachment.d.ts +1 -1
  56. package/lib/aws/policy-attachment.d.ts.map +1 -1
  57. package/lib/aws/policy-attachment.js +1 -1
  58. package/lib/aws/policy-attachment.js.map +1 -1
  59. package/lib/aws/policy.d.ts +1 -1
  60. package/lib/aws/policy.d.ts.map +1 -1
  61. package/lib/aws/policy.js +1 -1
  62. package/lib/aws/policy.js.map +1 -1
  63. package/lib/aws/queue.d.ts +1 -1
  64. package/lib/aws/queue.d.ts.map +1 -1
  65. package/lib/aws/queue.js +20 -25
  66. package/lib/aws/queue.js.map +1 -1
  67. package/lib/aws/role.d.ts +1 -1
  68. package/lib/aws/role.d.ts.map +1 -1
  69. package/lib/aws/role.js +1 -1
  70. package/lib/aws/role.js.map +1 -1
  71. package/lib/aws/ses.d.ts +1 -1
  72. package/lib/aws/ses.d.ts.map +1 -1
  73. package/lib/aws/ses.js +1 -1
  74. package/lib/aws/ses.js.map +1 -1
  75. package/lib/aws/table.d.ts +1 -1
  76. package/lib/aws/table.d.ts.map +1 -1
  77. package/lib/aws/table.js +1 -1
  78. package/lib/aws/table.js.map +1 -1
  79. package/lib/cloudflare/account-api-token.d.ts +1 -1
  80. package/lib/cloudflare/account-api-token.d.ts.map +1 -1
  81. package/lib/cloudflare/account-api-token.js +1 -1
  82. package/lib/cloudflare/account-api-token.js.map +1 -1
  83. package/lib/cloudflare/ai-gateway.d.ts +4 -3
  84. package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
  85. package/lib/cloudflare/ai-gateway.js +13 -1
  86. package/lib/cloudflare/ai-gateway.js.map +1 -1
  87. package/lib/cloudflare/analytics-engine.d.ts +21 -0
  88. package/lib/cloudflare/analytics-engine.d.ts.map +1 -0
  89. package/lib/cloudflare/analytics-engine.js +17 -0
  90. package/lib/cloudflare/analytics-engine.js.map +1 -0
  91. package/lib/cloudflare/api-error.js +1 -1
  92. package/lib/cloudflare/api-error.js.map +1 -1
  93. package/lib/cloudflare/assets.js +2 -2
  94. package/lib/cloudflare/assets.js.map +1 -1
  95. package/lib/cloudflare/auth.js +1 -1
  96. package/lib/cloudflare/auth.js.map +1 -1
  97. package/lib/cloudflare/bindings.d.ts +18 -11
  98. package/lib/cloudflare/bindings.d.ts.map +1 -1
  99. package/lib/cloudflare/bindings.js +6 -0
  100. package/lib/cloudflare/bindings.js.map +1 -1
  101. package/lib/cloudflare/bound.d.ts +12 -10
  102. package/lib/cloudflare/bound.d.ts.map +1 -1
  103. package/lib/cloudflare/bucket.d.ts +6 -4
  104. package/lib/cloudflare/bucket.d.ts.map +1 -1
  105. package/lib/cloudflare/bucket.js +22 -2
  106. package/lib/cloudflare/bucket.js.map +1 -1
  107. package/lib/cloudflare/bundle/bundle-worker.d.ts +1 -0
  108. package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
  109. package/lib/cloudflare/bundle/bundle-worker.js +4 -2
  110. package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
  111. package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts +1 -1
  112. package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -1
  113. package/lib/cloudflare/bundle/nodejs-compat-mode.js +2 -2
  114. package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -1
  115. package/lib/cloudflare/bundle/nodejs-compat.js +1 -1
  116. package/lib/cloudflare/bundle/nodejs-compat.js.map +1 -1
  117. package/lib/cloudflare/custom-domain.js +1 -1
  118. package/lib/cloudflare/custom-domain.js.map +1 -1
  119. package/lib/cloudflare/d1-database.d.ts +4 -62
  120. package/lib/cloudflare/d1-database.d.ts.map +1 -1
  121. package/lib/cloudflare/d1-database.js +27 -11
  122. package/lib/cloudflare/d1-database.js.map +1 -1
  123. package/lib/cloudflare/dns-records.d.ts +1 -1
  124. package/lib/cloudflare/dns-records.d.ts.map +1 -1
  125. package/lib/cloudflare/dns-records.js +2 -2
  126. package/lib/cloudflare/dns-records.js.map +1 -1
  127. package/lib/cloudflare/event-source.d.ts +3 -3
  128. package/lib/cloudflare/event-source.d.ts.map +1 -1
  129. package/lib/cloudflare/hyperdrive.d.ts +4 -3
  130. package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
  131. package/lib/cloudflare/hyperdrive.js +9 -1
  132. package/lib/cloudflare/hyperdrive.js.map +1 -1
  133. package/lib/cloudflare/kv-namespace.d.ts +9 -5
  134. package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
  135. package/lib/cloudflare/kv-namespace.js +26 -6
  136. package/lib/cloudflare/kv-namespace.js.map +1 -1
  137. package/lib/cloudflare/permission-groups.d.ts +1 -1
  138. package/lib/cloudflare/permission-groups.d.ts.map +1 -1
  139. package/lib/cloudflare/permission-groups.js +1 -1
  140. package/lib/cloudflare/permission-groups.js.map +1 -1
  141. package/lib/cloudflare/pipeline.d.ts +5 -3
  142. package/lib/cloudflare/pipeline.d.ts.map +1 -1
  143. package/lib/cloudflare/pipeline.js +16 -2
  144. package/lib/cloudflare/pipeline.js.map +1 -1
  145. package/lib/cloudflare/queue-consumer.d.ts +3 -3
  146. package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
  147. package/lib/cloudflare/queue-consumer.js +1 -1
  148. package/lib/cloudflare/queue-consumer.js.map +1 -1
  149. package/lib/cloudflare/queue.d.ts +34 -22
  150. package/lib/cloudflare/queue.d.ts.map +1 -1
  151. package/lib/cloudflare/queue.js +66 -4
  152. package/lib/cloudflare/queue.js.map +1 -1
  153. package/lib/cloudflare/route.d.ts +1 -1
  154. package/lib/cloudflare/route.d.ts.map +1 -1
  155. package/lib/cloudflare/route.js +1 -1
  156. package/lib/cloudflare/route.js.map +1 -1
  157. package/lib/cloudflare/types.js +1 -1
  158. package/lib/cloudflare/types.js.map +1 -1
  159. package/lib/cloudflare/vectorize-index.d.ts +6 -4
  160. package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
  161. package/lib/cloudflare/vectorize-index.js +20 -3
  162. package/lib/cloudflare/vectorize-index.js.map +1 -1
  163. package/lib/cloudflare/vectorize-metadata-index.d.ts +4 -3
  164. package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
  165. package/lib/cloudflare/vectorize-metadata-index.js +5 -2
  166. package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
  167. package/lib/cloudflare/website.d.ts.map +1 -1
  168. package/lib/cloudflare/website.js +3 -0
  169. package/lib/cloudflare/website.js.map +1 -1
  170. package/lib/cloudflare/worker-assets.d.ts +32 -0
  171. package/lib/cloudflare/worker-assets.d.ts.map +1 -0
  172. package/lib/cloudflare/worker-assets.js +143 -0
  173. package/lib/cloudflare/worker-assets.js.map +1 -0
  174. package/lib/cloudflare/worker-metadata.d.ts +31 -0
  175. package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
  176. package/lib/cloudflare/worker-metadata.js +248 -0
  177. package/lib/cloudflare/worker-metadata.js.map +1 -1
  178. package/lib/cloudflare/worker-stub.d.ts +40 -0
  179. package/lib/cloudflare/worker-stub.d.ts.map +1 -0
  180. package/lib/cloudflare/worker-stub.js +86 -0
  181. package/lib/cloudflare/worker-stub.js.map +1 -0
  182. package/lib/cloudflare/worker.d.ts +57 -28
  183. package/lib/cloudflare/worker.d.ts.map +1 -1
  184. package/lib/cloudflare/worker.js +203 -472
  185. package/lib/cloudflare/worker.js.map +1 -1
  186. package/lib/cloudflare/wrangler.json.d.ts +29 -1
  187. package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
  188. package/lib/cloudflare/wrangler.json.js +50 -2
  189. package/lib/cloudflare/wrangler.json.js.map +1 -1
  190. package/lib/cloudflare/zone.d.ts +1 -1
  191. package/lib/cloudflare/zone.d.ts.map +1 -1
  192. package/lib/cloudflare/zone.js +1 -1
  193. package/lib/cloudflare/zone.js.map +1 -1
  194. package/lib/destroy.d.ts +1 -4
  195. package/lib/destroy.d.ts.map +1 -1
  196. package/lib/destroy.js +10 -21
  197. package/lib/destroy.js.map +1 -1
  198. package/lib/dns/import-dns.d.ts +1 -1
  199. package/lib/dns/import-dns.d.ts.map +1 -1
  200. package/lib/dns/import-dns.js +1 -1
  201. package/lib/dns/import-dns.js.map +1 -1
  202. package/lib/encrypt.d.ts.map +1 -1
  203. package/lib/encrypt.js +2 -1
  204. package/lib/encrypt.js.map +1 -1
  205. package/lib/env.js +14 -8
  206. package/lib/env.js.map +1 -1
  207. package/lib/esbuild/bundle.d.ts +2 -2
  208. package/lib/esbuild/bundle.d.ts.map +1 -1
  209. package/lib/esbuild/bundle.js +3 -3
  210. package/lib/esbuild/bundle.js.map +1 -1
  211. package/lib/fs/copy-file.d.ts +1 -1
  212. package/lib/fs/copy-file.d.ts.map +1 -1
  213. package/lib/fs/copy-file.js +1 -1
  214. package/lib/fs/copy-file.js.map +1 -1
  215. package/lib/github/client.js +1 -1
  216. package/lib/github/client.js.map +1 -1
  217. package/lib/github/repository-environment.d.ts +1 -1
  218. package/lib/github/repository-environment.d.ts.map +1 -1
  219. package/lib/github/repository-environment.js +2 -2
  220. package/lib/github/repository-environment.js.map +1 -1
  221. package/lib/github/secret.d.ts +1 -1
  222. package/lib/github/secret.d.ts.map +1 -1
  223. package/lib/github/secret.js +1 -1
  224. package/lib/github/secret.js.map +1 -1
  225. package/lib/internal/docs/providers.d.ts +1 -1
  226. package/lib/internal/docs/providers.d.ts.map +1 -1
  227. package/lib/internal/docs/providers.js +3 -1
  228. package/lib/internal/docs/providers.js.map +1 -1
  229. package/lib/neon/api-error.js +2 -2
  230. package/lib/neon/api-error.js.map +1 -1
  231. package/lib/os/exec.js +1 -1
  232. package/lib/os/exec.js.map +1 -1
  233. package/lib/resource.d.ts +13 -11
  234. package/lib/resource.d.ts.map +1 -1
  235. package/lib/resource.js +10 -5
  236. package/lib/resource.js.map +1 -1
  237. package/lib/runtime/bind.d.ts +25 -0
  238. package/lib/runtime/bind.d.ts.map +1 -0
  239. package/lib/runtime/bind.js +76 -0
  240. package/lib/runtime/bind.js.map +1 -0
  241. package/lib/runtime/global.d.ts +8 -0
  242. package/lib/runtime/global.d.ts.map +1 -0
  243. package/lib/runtime/global.js +3 -0
  244. package/lib/runtime/global.js.map +1 -0
  245. package/lib/runtime/plugin.d.ts +35 -0
  246. package/lib/runtime/plugin.d.ts.map +1 -0
  247. package/lib/runtime/plugin.js +133 -0
  248. package/lib/runtime/plugin.js.map +1 -0
  249. package/lib/runtime/shims.d.ts +6 -0
  250. package/lib/runtime/shims.d.ts.map +1 -0
  251. package/lib/runtime/shims.js +27 -0
  252. package/lib/runtime/shims.js.map +1 -0
  253. package/lib/runtime/state.d.ts +5 -0
  254. package/lib/runtime/state.d.ts.map +1 -0
  255. package/lib/runtime/state.js +4 -0
  256. package/lib/runtime/state.js.map +1 -0
  257. package/lib/scope.d.ts +16 -2
  258. package/lib/scope.d.ts.map +1 -1
  259. package/lib/scope.js +56 -9
  260. package/lib/scope.js.map +1 -1
  261. package/lib/secret.d.ts +7 -2
  262. package/lib/secret.d.ts.map +1 -1
  263. package/lib/secret.js +19 -4
  264. package/lib/secret.js.map +1 -1
  265. package/lib/sentry/client-key.d.ts +1 -1
  266. package/lib/sentry/client-key.d.ts.map +1 -1
  267. package/lib/sentry/client-key.js +1 -1
  268. package/lib/sentry/client-key.js.map +1 -1
  269. package/lib/sentry/project.d.ts +1 -1
  270. package/lib/sentry/project.d.ts.map +1 -1
  271. package/lib/sentry/project.js +1 -1
  272. package/lib/sentry/project.js.map +1 -1
  273. package/lib/sentry/team.d.ts +1 -1
  274. package/lib/sentry/team.d.ts.map +1 -1
  275. package/lib/sentry/team.js +1 -1
  276. package/lib/sentry/team.js.map +1 -1
  277. package/lib/serde.d.ts +26 -1
  278. package/lib/serde.d.ts.map +1 -1
  279. package/lib/serde.js +53 -8
  280. package/lib/serde.js.map +1 -1
  281. package/lib/stripe/meter.d.ts +1 -1
  282. package/lib/stripe/meter.d.ts.map +1 -1
  283. package/lib/stripe/meter.js +1 -1
  284. package/lib/stripe/meter.js.map +1 -1
  285. package/lib/stripe/price.d.ts +1 -1
  286. package/lib/stripe/price.d.ts.map +1 -1
  287. package/lib/stripe/price.js +1 -1
  288. package/lib/stripe/price.js.map +1 -1
  289. package/lib/stripe/product.d.ts +1 -1
  290. package/lib/stripe/product.d.ts.map +1 -1
  291. package/lib/stripe/product.js +1 -1
  292. package/lib/stripe/product.js.map +1 -1
  293. package/lib/stripe/webhook.d.ts +1 -1
  294. package/lib/stripe/webhook.d.ts.map +1 -1
  295. package/lib/stripe/webhook.js +1 -1
  296. package/lib/stripe/webhook.js.map +1 -1
  297. package/lib/test/bun.js +1 -1
  298. package/lib/test/bun.js.map +1 -1
  299. package/lib/test/prune.js +1 -1
  300. package/lib/test/prune.js.map +1 -1
  301. package/lib/upstash/redis.d.ts +1 -1
  302. package/lib/upstash/redis.d.ts.map +1 -1
  303. package/lib/upstash/redis.js +1 -1
  304. package/lib/upstash/redis.js.map +1 -1
  305. package/lib/util/assert-never.d.ts +2 -0
  306. package/lib/util/assert-never.d.ts.map +1 -0
  307. package/lib/util/assert-never.js +4 -0
  308. package/lib/util/assert-never.js.map +1 -0
  309. package/lib/util/content-type.d.ts +1 -1
  310. package/lib/util/content-type.d.ts.map +1 -1
  311. package/lib/util/content-type.js +1 -2
  312. package/lib/util/content-type.js.map +1 -1
  313. package/lib/util/retry.d.ts.map +1 -1
  314. package/lib/util/retry.js +1 -0
  315. package/lib/util/retry.js.map +1 -1
  316. package/lib/vercel/project-domain.d.ts +1 -1
  317. package/lib/vercel/project-domain.d.ts.map +1 -1
  318. package/lib/vercel/project-domain.js +1 -1
  319. package/lib/vercel/project-domain.js.map +1 -1
  320. package/lib/vercel/project.js +1 -1
  321. package/lib/vercel/project.js.map +1 -1
  322. package/lib/web/shadcn-component.d.ts +1 -1
  323. package/lib/web/shadcn-component.d.ts.map +1 -1
  324. package/lib/web/shadcn-component.js +1 -1
  325. package/lib/web/shadcn-component.js.map +1 -1
  326. package/lib/web/shadcn.d.ts +1 -1
  327. package/lib/web/shadcn.d.ts.map +1 -1
  328. package/lib/web/shadcn.js +1 -1
  329. package/lib/web/shadcn.js.map +1 -1
  330. package/lib/web/vitepress/dependencies.d.ts +1 -1
  331. package/lib/web/vitepress/dependencies.d.ts.map +1 -1
  332. package/lib/web/vitepress/dependencies.js +1 -1
  333. package/lib/web/vitepress/dependencies.js.map +1 -1
  334. package/lib/web/vitepress/vitepress.js +1 -1
  335. package/lib/web/vitepress/vitepress.js.map +1 -1
  336. package/package.json +2 -1
  337. package/src/ai/astro-file.ts +1 -1
  338. package/src/ai/client.ts +2 -2
  339. package/src/ai/css-file.ts +1 -1
  340. package/src/ai/data.ts +1 -1
  341. package/src/ai/html-file.ts +1 -1
  342. package/src/ai/json-file.ts +1 -1
  343. package/src/ai/typescript-file.ts +1 -1
  344. package/src/ai/vue-file.ts +1 -1
  345. package/src/ai/yaml-file.ts +2 -2
  346. package/src/alchemy.ts +18 -4
  347. package/src/apply.ts +27 -2
  348. package/src/aws/bucket.ts +1 -1
  349. package/src/aws/function.ts +2 -2
  350. package/src/aws/oidc/oidc-provider.ts +1 -1
  351. package/src/aws/policy-attachment.ts +1 -1
  352. package/src/aws/policy.ts +1 -1
  353. package/src/aws/queue.ts +28 -29
  354. package/src/aws/role.ts +1 -1
  355. package/src/aws/ses.ts +1 -1
  356. package/src/aws/table.ts +1 -1
  357. package/src/cloudflare/account-api-token.ts +1 -1
  358. package/src/cloudflare/ai-gateway.ts +23 -4
  359. package/src/cloudflare/analytics-engine.ts +26 -0
  360. package/src/cloudflare/api-error.ts +1 -1
  361. package/src/cloudflare/assets.ts +2 -2
  362. package/src/cloudflare/auth.ts +1 -1
  363. package/src/cloudflare/bindings.ts +35 -18
  364. package/src/cloudflare/bound.ts +27 -23
  365. package/src/cloudflare/bucket.ts +52 -24
  366. package/src/cloudflare/bundle/bundle-worker.ts +5 -2
  367. package/src/cloudflare/bundle/nodejs-compat-mode.ts +3 -3
  368. package/src/cloudflare/bundle/nodejs-compat.ts +1 -1
  369. package/src/cloudflare/custom-domain.ts +1 -1
  370. package/src/cloudflare/d1-database.ts +40 -19
  371. package/src/cloudflare/dns-records.ts +2 -2
  372. package/src/cloudflare/event-source.ts +3 -3
  373. package/src/cloudflare/hyperdrive.ts +19 -4
  374. package/src/cloudflare/kv-namespace.ts +46 -15
  375. package/src/cloudflare/permission-groups.ts +1 -1
  376. package/src/cloudflare/pipeline.ts +29 -6
  377. package/src/cloudflare/queue-consumer.ts +3 -3
  378. package/src/cloudflare/queue.ts +124 -23
  379. package/src/cloudflare/route.ts +1 -1
  380. package/src/cloudflare/types.ts +1 -1
  381. package/src/cloudflare/vectorize-index.ts +36 -8
  382. package/src/cloudflare/vectorize-metadata-index.ts +10 -4
  383. package/src/cloudflare/website.ts +3 -0
  384. package/src/cloudflare/worker-assets.ts +237 -0
  385. package/src/cloudflare/worker-metadata.ts +287 -0
  386. package/src/cloudflare/worker-stub.ts +153 -0
  387. package/src/cloudflare/worker.ts +386 -586
  388. package/src/cloudflare/wrangler.json.ts +75 -2
  389. package/src/cloudflare/zone.ts +1 -1
  390. package/src/destroy.ts +12 -23
  391. package/src/dns/import-dns.ts +1 -1
  392. package/src/encrypt.ts +2 -2
  393. package/src/env.ts +15 -8
  394. package/src/esbuild/bundle.ts +4 -3
  395. package/src/fs/copy-file.ts +1 -1
  396. package/src/github/client.ts +1 -1
  397. package/src/github/repository-environment.ts +2 -2
  398. package/src/github/secret.ts +1 -1
  399. package/src/internal/docs/providers.ts +1 -1
  400. package/src/neon/api-error.ts +2 -2
  401. package/src/os/exec.ts +1 -1
  402. package/src/resource.ts +22 -31
  403. package/src/runtime/bind.ts +95 -0
  404. package/src/runtime/global.ts +10 -0
  405. package/src/runtime/plugin.ts +162 -0
  406. package/src/runtime/shims.js +34 -0
  407. package/src/runtime/state.ts +9 -0
  408. package/src/scope.ts +72 -11
  409. package/src/secret.ts +29 -4
  410. package/src/sentry/client-key.ts +1 -1
  411. package/src/sentry/project.ts +1 -1
  412. package/src/sentry/team.ts +1 -1
  413. package/src/serde.ts +126 -10
  414. package/src/stripe/meter.ts +1 -1
  415. package/src/stripe/price.ts +1 -1
  416. package/src/stripe/product.ts +1 -1
  417. package/src/stripe/webhook.ts +1 -1
  418. package/src/test/bun.ts +1 -1
  419. package/src/test/prune.ts +1 -1
  420. package/src/upstash/redis.ts +1 -1
  421. package/src/util/assert-never.ts +3 -0
  422. package/src/util/content-type.ts +2 -3
  423. package/src/util/retry.ts +1 -0
  424. package/src/vercel/project-domain.ts +1 -1
  425. package/src/vercel/project.ts +1 -1
  426. package/src/web/shadcn-component.ts +1 -1
  427. package/src/web/shadcn.ts +1 -1
  428. package/src/web/vitepress/dependencies.ts +1 -1
  429. package/src/web/vitepress/vitepress.ts +1 -1
@@ -0,0 +1,162 @@
1
+ import type {
2
+ CallExpression,
3
+ Declaration,
4
+ Expression,
5
+ FunctionDeclaration,
6
+ TsType,
7
+ VariableDeclaration,
8
+ } from "@swc/core";
9
+ import type { Plugin } from "esbuild";
10
+ import fs from "node:fs/promises";
11
+
12
+ /**
13
+ * Bundles a single Worker function entrypoint by:
14
+ * 1. Evaluate the script and detect which resources are included in its bundle.
15
+ * 2. Create a static map of Resource ID -> State
16
+ * 3. Apply esbuild with {@link bootstrapPlugin} to erase Resource lifecycle operations
17
+ * 4. The final bundle should then tree-shake away all infrastructure-code, leaving only runtime code.
18
+ *
19
+ * TODO(sam): should we inline the state map in the bundle or bind to a Cloudflare Worker with a blob?
20
+ * TODO(sam): what should we do with secrets? Seems like we could auto-bind them and resolve without requiring encryption logic.
21
+ *
22
+ * @param file the `.ts` file containing an `export default function`
23
+ */
24
+ export function bundleEntrypoint(_file: string) {}
25
+
26
+ /**
27
+ * This is a plugin that bootstraps Alchemy Infrastructure into Runtime by replacing Resources
28
+ * with a stub that loads from a statically bundled state.
29
+ *
30
+ * Take the following table for example:
31
+ * ```ts
32
+ * const Table = Resource(
33
+ * "dynamodb::Table",
34
+ * async function(this, id, props) {
35
+ * // lifecycle logic in here
36
+ * }
37
+ * );
38
+ * ```
39
+ *
40
+ * The plugin replaces the Resource with a stub:
41
+ * ```ts
42
+ * const Table = (id, props) => STATE.get(id)
43
+ * ```
44
+ */
45
+ export const bootstrapPlugin: Plugin = {
46
+ name: "alchemy-bootstrap",
47
+ async setup(build) {
48
+ const { parse, print } = await import("@swc/core");
49
+ const { Visitor } = await import("@swc/core/Visitor.js");
50
+
51
+ async function expr(expr: string) {
52
+ return (
53
+ (await parse(`const __temp__ = ${expr}`)).body[0] as VariableDeclaration
54
+ ).declarations[0].init!;
55
+ }
56
+ async function decl(decl: string) {
57
+ return (await parse(decl)).body[0] as Declaration;
58
+ }
59
+
60
+ const Provider = await decl("async function Resource() {}");
61
+ const Resource = await expr("(id) => STATE.get(id)");
62
+ // const alchemy = await expr("(async () => {})");
63
+
64
+ // Add a global STATE object to bundle for resource lookup
65
+ build.onLoad(
66
+ {
67
+ filter: /.*\.(ts|js)x?/,
68
+ },
69
+ async (args) => {
70
+ try {
71
+ const source = await fs.readFile(args.path, "utf-8");
72
+
73
+ function transformed(code: string) {
74
+ return {
75
+ contents: code,
76
+ loader: args.path.endsWith(".ts")
77
+ ? args.path.endsWith(".tsx")
78
+ ? "tsx"
79
+ : "ts"
80
+ : args.path.endsWith(".jsx")
81
+ ? "jsx"
82
+ : "js",
83
+ } as const;
84
+ }
85
+
86
+ // Parse the source code using SWC
87
+ const ast = await parse(source, {
88
+ syntax: "typescript",
89
+ tsx: args.path.endsWith(".tsx"),
90
+ decorators: true,
91
+ dynamicImport: true,
92
+ });
93
+
94
+ // function text({ span }: HasSpan) {
95
+ // return source.slice(
96
+ // span.start - ast.span.start,
97
+ // span.end - ast.span.start,
98
+ // );
99
+ // }
100
+
101
+ // Create visitor to transform Resource calls
102
+ class ResourceTransformer extends Visitor {
103
+ visitTsType(n: TsType): TsType {
104
+ return n;
105
+ }
106
+ visitFunctionDeclaration(decl: FunctionDeclaration): Declaration {
107
+ const param = decl.params[0];
108
+ if (
109
+ decl.identifier.value === "Resource" &&
110
+ param?.pat.type === "Identifier" &&
111
+ param.pat.value === "type" &&
112
+ decl.body
113
+ ) {
114
+ return Provider;
115
+ }
116
+ return decl;
117
+ }
118
+ visitCallExpression(expr: CallExpression): Expression {
119
+ // Check if this is a Resource call
120
+ if (
121
+ expr.callee.type === "Identifier" &&
122
+ expr.callee.value === "Resource" &&
123
+ expr.arguments.length >= 2
124
+ ) {
125
+ return Resource;
126
+ // } else if (
127
+ // expr.callee.type === "Identifier" &&
128
+ // expr.callee.value === "alchemy"
129
+ // ) {
130
+ // return alchemy;
131
+ }
132
+
133
+ return super.visitCallExpression(expr);
134
+ }
135
+ }
136
+
137
+ // Apply the transformation
138
+ const visitor = new ResourceTransformer();
139
+ const program = visitor.visitProgram(ast);
140
+
141
+ // Print the transformed AST back to code
142
+ const { code } = await print(program, {
143
+ sourceMaps: true,
144
+ minify: false,
145
+ });
146
+
147
+ return transformed(code);
148
+ } catch (error: unknown) {
149
+ console.error(`Error transforming ${args.path}:`, error);
150
+ return {
151
+ errors: [
152
+ {
153
+ text: `Failed to transform: ${error instanceof Error ? error.message : String(error)}`,
154
+ location: { file: args.path },
155
+ },
156
+ ],
157
+ };
158
+ }
159
+ },
160
+ );
161
+ },
162
+ };
@@ -0,0 +1,34 @@
1
+ import { env } from "cloudflare:workers";
2
+ import { Scope } from "../scope.js";
3
+ import { Secret } from "../secret.js";
4
+ import { deserialize } from "../serde.js";
5
+
6
+ globalThis.process.env = env;
7
+
8
+ export const __ALCHEMY_RUNTIME__ = true;
9
+
10
+ export var __ALCHEMY_SERIALIZED_SCOPE__ = JSON.parse(
11
+ env.__ALCHEMY_SERIALIZED_SCOPE__,
12
+ );
13
+
14
+ export const STATE = {
15
+ async get(id) {
16
+ const fqn = globalThis.__ALCHEMY_SCOPE__.current.fqn(id);
17
+ const state = __ALCHEMY_SERIALIZED_SCOPE__[fqn];
18
+ if (!state) {
19
+ throw new Error(
20
+ `Resource ${fqn} not found in __ALCHEMY_SERIALIZED_SCOPE__\n${JSON.stringify(__ALCHEMY_SERIALIZED_SCOPE__, null, 2)}`,
21
+ );
22
+ }
23
+ return await deserialize(Scope.current, state, {
24
+ transform: (value) => {
25
+ if (value && typeof value === "object" && value["@secret-env"]) {
26
+ return {
27
+ value: new Secret(env[value["@secret-env"]]),
28
+ };
29
+ }
30
+ },
31
+ });
32
+ },
33
+ };
34
+ // export const process = { env };
@@ -0,0 +1,9 @@
1
+ import type { Resource } from "../resource.js";
2
+
3
+ export interface RuntimeState {
4
+ get(id: string): Resource;
5
+ }
6
+
7
+ // /**
8
+ // * Runtime state injected into the environment.
9
+ // */
package/src/scope.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
2
  import type { Phase } from "./alchemy.js";
3
- import { destroy } from "./destroy.js";
3
+ import { destroyAll } from "./destroy.js";
4
4
  import { FileSystemStateStore } from "./fs/file-system-state-store.js";
5
5
  import { ResourceID, type PendingResource } from "./resource.js";
6
6
  import type { StateStore, StateStoreType } from "./state.js";
7
7
 
8
- const scopeStorage = new AsyncLocalStorage<Scope>();
9
-
10
8
  export type ScopeOptions = {
11
9
  appName?: string;
12
10
  stage?: string;
@@ -24,19 +22,30 @@ const DEFAULT_STAGE = process.env.ALCHEMY_STAGE ?? process.env.USER ?? "dev";
24
22
  export class Scope {
25
23
  public static readonly KIND = "alchemy::Scope" as const;
26
24
 
25
+ public static storage = new AsyncLocalStorage<Scope>();
26
+ public static globals: Scope[] = [];
27
+
27
28
  public static get(): Scope | undefined {
28
- return scopeStorage.getStore();
29
+ return Scope.storage.getStore();
30
+ }
31
+
32
+ public static get root(): Scope {
33
+ return Scope.current.root;
29
34
  }
30
35
 
31
36
  public static get current(): Scope {
32
37
  const scope = Scope.get();
33
38
  if (!scope) {
39
+ if (Scope.globals.length > 0) {
40
+ return Scope.globals[Scope.globals.length - 1];
41
+ }
34
42
  throw new Error("Not running within an Alchemy Scope");
35
43
  }
36
44
  return scope;
37
45
  }
38
46
 
39
47
  public readonly resources = new Map<ResourceID, PendingResource>();
48
+ public readonly children: Map<ResourceID, Scope> = new Map();
40
49
  public readonly appName: string | undefined;
41
50
  public readonly stage: string;
42
51
  public readonly scopeName: string | null;
@@ -48,10 +57,12 @@ export class Scope {
48
57
  public readonly phase: Phase;
49
58
 
50
59
  private isErrored = false;
60
+ private finalized = false;
61
+
62
+ private deferred: (() => Promise<any>)[] = [];
51
63
 
52
64
  constructor(options: ScopeOptions) {
53
65
  this.appName = options.appName;
54
- this.stage = options?.stage ?? DEFAULT_STAGE;
55
66
  this.scopeName = options.scopeName ?? null;
56
67
  if (this.scopeName?.includes(":")) {
57
68
  throw new Error(
@@ -59,6 +70,8 @@ export class Scope {
59
70
  );
60
71
  }
61
72
  this.parent = options.parent ?? Scope.get();
73
+ this.stage = options?.stage ?? this.parent?.stage ?? DEFAULT_STAGE;
74
+ this.parent?.children.set(this.scopeName!, this);
62
75
  this.quiet = options.quiet ?? this.parent?.quiet ?? false;
63
76
  if (this.parent && !this.scopeName) {
64
77
  throw new Error("Scope name is required when creating a child scope");
@@ -77,6 +90,14 @@ export class Scope {
77
90
  this.state = this.stateStore(this);
78
91
  }
79
92
 
93
+ public get root(): Scope {
94
+ let root: Scope = this;
95
+ while (root.parent) {
96
+ root = root.parent;
97
+ }
98
+ return root;
99
+ }
100
+
80
101
  public async delete(resourceID: ResourceID) {
81
102
  await this.state.delete(resourceID);
82
103
  this.resources.delete(resourceID);
@@ -102,10 +123,6 @@ export class Scope {
102
123
  this.isErrored = true;
103
124
  }
104
125
 
105
- public enter() {
106
- scopeStorage.enterWith(this);
107
- }
108
-
109
126
  public async init() {
110
127
  await this.state.init?.();
111
128
  }
@@ -120,7 +137,7 @@ export class Scope {
120
137
  }
121
138
 
122
139
  public async run<T>(fn: (scope: Scope) => Promise<T>): Promise<T> {
123
- return scopeStorage.run(this, () => fn(this));
140
+ return Scope.storage.run(this, () => fn(this));
124
141
  }
125
142
 
126
143
  [Symbol.asyncDispose]() {
@@ -131,6 +148,20 @@ export class Scope {
131
148
  if (this.phase === "read") {
132
149
  return;
133
150
  }
151
+ if (this.finalized) {
152
+ return;
153
+ }
154
+ if (this.parent === undefined && Scope.globals.length > 0) {
155
+ const last = Scope.globals.pop();
156
+ if (last !== this) {
157
+ throw new Error(
158
+ "Running in AsyncLocaStorage.enterWith emultation mode and attempted to finalize a global Scope that wasn't top of the stack",
159
+ );
160
+ }
161
+ }
162
+ this.finalized = true;
163
+ // trigger and await all deferred promises
164
+ await Promise.all(this.deferred.map((fn) => fn()));
134
165
  if (!this.isErrored) {
135
166
  // TODO: need to detect if it is in error
136
167
  const resourceIds = await this.state.list();
@@ -141,7 +172,7 @@ export class Scope {
141
172
  const orphans = await Promise.all(
142
173
  orphanIds.map(async (id) => (await this.state.get(id))!.output),
143
174
  );
144
- await destroy.all(orphans, {
175
+ await destroyAll(orphans, {
145
176
  quiet: this.quiet,
146
177
  strategy: "sequential",
147
178
  });
@@ -150,6 +181,28 @@ export class Scope {
150
181
  }
151
182
  }
152
183
 
184
+ /**
185
+ * Defers execution of a function until the Alchemy application finalizes.
186
+ */
187
+ public defer<T>(fn: () => Promise<T>): Promise<T> {
188
+ let _resolve: (value: T) => void;
189
+ let _reject: (reason?: any) => void;
190
+ const promise = new Promise<T>((resolve, reject) => {
191
+ _resolve = resolve;
192
+ _reject = reject;
193
+ });
194
+ this.deferred.push(() => {
195
+ if (!this.finalized) {
196
+ throw new Error(
197
+ "Attempted to await a deferred Promise before finalization",
198
+ );
199
+ }
200
+ // lazily trigger the worker on first await
201
+ return this.run(() => fn()).then(_resolve, _reject);
202
+ });
203
+ return promise;
204
+ }
205
+
153
206
  /**
154
207
  * Returns a string representation of the scope.
155
208
  */
@@ -162,3 +215,11 @@ export class Scope {
162
215
  )`;
163
216
  }
164
217
  }
218
+
219
+ declare global {
220
+ // for runtime
221
+ // TODO(sam): maybe inject is a better way to achieve this
222
+ var __ALCHEMY_SCOPE__: typeof Scope;
223
+ }
224
+
225
+ globalThis.__ALCHEMY_SCOPE__ = Scope;
package/src/secret.ts CHANGED
@@ -1,5 +1,15 @@
1
1
  import { alchemy } from "./alchemy.js";
2
2
 
3
+ // a global registry of all secrets that we will use when serializing an application
4
+ const globalSecrets: {
5
+ [name: string]: Secret;
6
+ } = {};
7
+
8
+ let i = 0;
9
+ function nextName() {
10
+ return `alchemy:anonymous-secret-${i++}`;
11
+ }
12
+
3
13
  /**
4
14
  * Internal wrapper for sensitive values like API keys and credentials.
5
15
  * When stored in alchemy state files, the value is automatically encrypted
@@ -36,8 +46,20 @@ import { alchemy } from "./alchemy.js";
36
46
  * }
37
47
  */
38
48
  export class Secret {
49
+ /**
50
+ * @internal
51
+ */
52
+ public static all(): Secret[] {
53
+ return Object.values(globalSecrets);
54
+ }
55
+
39
56
  public readonly type = "secret";
40
- constructor(readonly unencrypted: string) {}
57
+ constructor(
58
+ readonly unencrypted: string,
59
+ readonly name: string = nextName(),
60
+ ) {
61
+ globalSecrets[name] = this;
62
+ }
41
63
  }
42
64
 
43
65
  /**
@@ -79,11 +101,14 @@ export function isSecret(binding: any): binding is Secret {
79
101
  * @throws {Error} If the value is undefined
80
102
  * @throws {Error} If no password is set in the alchemy application options or current scope
81
103
  */
82
- export function secret<S extends string | undefined>(unencrypted: S): Secret {
104
+ export function secret<S extends string | undefined>(
105
+ unencrypted: S,
106
+ name?: string,
107
+ ): Secret {
83
108
  if (unencrypted === undefined) {
84
109
  throw new Error("Secret cannot be undefined");
85
110
  }
86
- return new Secret(unencrypted);
111
+ return new Secret(unencrypted, name);
87
112
  }
88
113
 
89
114
  export namespace secret {
@@ -104,7 +129,7 @@ export namespace secret {
104
129
  ): Promise<Secret> {
105
130
  const result = await alchemy.env(name, value, error);
106
131
  if (typeof result === "string") {
107
- return secret(result);
132
+ return secret(result, name);
108
133
  }
109
134
  throw new Error(`Secret environment variable ${name} is not a string`);
110
135
  }
@@ -179,7 +179,7 @@ export const ClientKey = Resource(
179
179
  "sentry::ClientKey",
180
180
  async function (
181
181
  this: Context<ClientKey>,
182
- id: string,
182
+ _id: string,
183
183
  props: ClientKeyProps,
184
184
  ): Promise<ClientKey> {
185
185
  const api = new SentryApi({ authToken: props.authToken });
@@ -281,7 +281,7 @@ export const Project = Resource(
281
281
  "sentry::Project",
282
282
  async function (
283
283
  this: Context<Project>,
284
- id: string,
284
+ _id: string,
285
285
  props: ProjectProps,
286
286
  ): Promise<Project> {
287
287
  const api = new SentryApi({ authToken: props.authToken });
@@ -126,7 +126,7 @@ export const Team = Resource(
126
126
  "sentry::Team",
127
127
  async function (
128
128
  this: Context<Team>,
129
- id: string,
129
+ _id: string,
130
130
  props: TeamProps,
131
131
  ): Promise<Team> {
132
132
  const api = new SentryApi({ authToken: props.authToken });
package/src/serde.ts CHANGED
@@ -1,4 +1,10 @@
1
1
  import { decryptWithKey, encrypt } from "./encrypt.js";
2
+ import {
3
+ InnerResourceScope,
4
+ ResourceFQN,
5
+ ResourceKind,
6
+ type Resource,
7
+ } from "./resource.js";
2
8
  import { Scope } from "./scope.js";
3
9
  import { Secret } from "./secret.js";
4
10
 
@@ -13,13 +19,96 @@ function isType(value: any): value is Type<any, any> {
13
19
  );
14
20
  }
15
21
 
22
+ export type Serialized<T> = T extends
23
+ | undefined
24
+ | null
25
+ | boolean
26
+ | number
27
+ | string
28
+ | bigint
29
+ ? T
30
+ : T extends Type<any, any>
31
+ ? {
32
+ "@schema": string;
33
+ }
34
+ : T extends Secret
35
+ ? {
36
+ "@secret": string;
37
+ }
38
+ : T extends Date
39
+ ? {
40
+ "@date": string;
41
+ }
42
+ : T extends Symbol
43
+ ? {
44
+ "@symbol": string;
45
+ }
46
+ : T extends Scope
47
+ ? {
48
+ "@scope": null;
49
+ }
50
+ : T extends Function
51
+ ? undefined
52
+ : T extends Array<infer U>
53
+ ? Array<Serialized<U>>
54
+ : T extends object
55
+ ? {
56
+ [K in keyof T as K extends symbol
57
+ ? string
58
+ : K]: Serialized<T[K]>;
59
+ }
60
+ : T;
61
+
62
+ export type SerializedScope = {
63
+ [fqn: ResourceFQN]: Serialized<Resource>;
64
+ };
65
+
66
+ export async function serializeScope(scope: Scope): Promise<SerializedScope> {
67
+ const map: SerializedScope = {};
68
+
69
+ return serializeScope(scope);
70
+
71
+ async function serializeScope(scope: Scope): Promise<SerializedScope> {
72
+ await Promise.all(
73
+ Array.from(scope.resources.values()).map(async (resource) => {
74
+ if (resource[ResourceKind] === Scope.KIND) {
75
+ return;
76
+ }
77
+ map[resource[ResourceFQN]] = await serialize(scope, await resource, {
78
+ transform: (value) => {
79
+ if (value instanceof Secret) {
80
+ return {
81
+ "@secret-env": value.name,
82
+ };
83
+ }
84
+ return value;
85
+ },
86
+ });
87
+ const innerScope = await resource[InnerResourceScope];
88
+ if (innerScope) {
89
+ await serializeScope(innerScope);
90
+ }
91
+ }),
92
+ );
93
+ await Promise.all(
94
+ Array.from(scope.children.values()).map((scope) => serializeScope(scope)),
95
+ );
96
+ return map;
97
+ }
98
+ }
99
+
16
100
  export async function serialize(
17
101
  scope: Scope,
18
102
  value: any,
19
103
  options?: {
20
104
  encrypt?: boolean;
105
+ transform?: (value: any) => any;
21
106
  },
22
107
  ): Promise<any> {
108
+ if (options?.transform) {
109
+ value = options.transform(value);
110
+ }
111
+
23
112
  if (Array.isArray(value)) {
24
113
  return Promise.all(value.map((value) => serialize(scope, value, options)));
25
114
  } else if (value instanceof Secret) {
@@ -49,17 +138,19 @@ export async function serialize(
49
138
  return {
50
139
  "@scope": null,
51
140
  };
141
+ } else if (isImportMeta(value)) {
142
+ // ImportMeta serialized as {}, so we are mapping it
143
+ // TODO(sam):
144
+ return Object.fromEntries(
145
+ Object.keys(Object.getPrototypeOf(value))
146
+ // exlcude import.meta.env
147
+ .filter((prop) => prop === "env")
148
+ .map((prop) => [prop, (value as any)[prop]]),
149
+ );
52
150
  } else if (value && typeof value === "object") {
53
151
  for (const symbol of Object.getOwnPropertySymbols(value)) {
54
152
  assertNotUniqueSymbol(symbol);
55
153
  }
56
- for (const key of Object.keys(value)) {
57
- if (parseSymbol(key)) {
58
- throw new Error(
59
- `Cannot serialize property '${key}' because it looks like a stringified symbol.`,
60
- );
61
- }
62
- }
63
154
  return Object.fromEntries(
64
155
  await Promise.all(
65
156
  [...Object.getOwnPropertySymbols(value), ...Object.keys(value)].map(
@@ -77,10 +168,35 @@ export async function serialize(
77
168
  return value;
78
169
  }
79
170
 
80
- export async function deserialize(scope: Scope, value: any): Promise<any> {
171
+ function isImportMeta(value: any): value is ImportMeta {
172
+ return (
173
+ value &&
174
+ typeof value === "object" &&
175
+ typeof value.dirname === "string" &&
176
+ typeof value.filename === "string" &&
177
+ typeof value.url === "string"
178
+ );
179
+ }
180
+
181
+ export async function deserialize(
182
+ scope: Scope,
183
+ value: any,
184
+ options?: {
185
+ transform?: (value: any) =>
186
+ | undefined
187
+ | {
188
+ value: any;
189
+ };
190
+ },
191
+ ): Promise<any> {
192
+ const replacement = options?.transform?.(value);
193
+ if (replacement) {
194
+ return replacement.value;
195
+ }
196
+
81
197
  if (Array.isArray(value)) {
82
198
  return await Promise.all(
83
- value.map(async (item) => await deserialize(scope, item)),
199
+ value.map(async (item) => await deserialize(scope, item, options)),
84
200
  );
85
201
  }
86
202
  if (value && typeof value === "object") {
@@ -103,7 +219,7 @@ export async function deserialize(scope: Scope, value: any): Promise<any> {
103
219
  await Promise.all(
104
220
  Object.entries(value).map(async ([key, value]) => [
105
221
  parseSymbol(key) ?? key,
106
- await deserialize(scope, value),
222
+ await deserialize(scope, value, options),
107
223
  ]),
108
224
  ),
109
225
  );
@@ -141,7 +141,7 @@ export const Meter = Resource(
141
141
  "stripe::Meter",
142
142
  async function (
143
143
  this: Context<Meter>,
144
- logicalId: string,
144
+ _logicalId: string,
145
145
  props: MeterProps,
146
146
  ): Promise<Meter> {
147
147
  const apiKey = process.env.STRIPE_API_KEY;
@@ -192,7 +192,7 @@ export const Price = Resource(
192
192
  "stripe::Price",
193
193
  async function (
194
194
  this: Context<Price>,
195
- id: string,
195
+ _id: string,
196
196
  props: PriceProps,
197
197
  ): Promise<Price> {
198
198
  // Get Stripe API key from context or environment
@@ -141,7 +141,7 @@ export const Product = Resource(
141
141
  "stripe::Product",
142
142
  async function (
143
143
  this: Context<Product>,
144
- id: string,
144
+ _id: string,
145
145
  props: ProductProps,
146
146
  ): Promise<Product> {
147
147
  // Get Stripe API key from context or environment
@@ -135,7 +135,7 @@ export const WebhookEndpoint = Resource(
135
135
  "stripe::WebhookEndpoint",
136
136
  async function (
137
137
  this: Context<WebhookEndpoint>,
138
- id: string,
138
+ _id: string,
139
139
  props: WebhookEndpointProps,
140
140
  ) {
141
141
  // Get Stripe API key from context or environment