alchemy 0.25.0 → 0.26.1

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 (499) hide show
  1. package/README.md +7 -0
  2. package/lib/ai/astro-file.d.ts.map +1 -1
  3. package/lib/ai/astro-file.js +2 -1
  4. package/lib/ai/astro-file.js.map +1 -1
  5. package/lib/ai/client.d.ts.map +1 -1
  6. package/lib/ai/client.js +3 -2
  7. package/lib/ai/client.js.map +1 -1
  8. package/lib/alchemy.d.ts +7 -0
  9. package/lib/alchemy.d.ts.map +1 -1
  10. package/lib/alchemy.js +19 -3
  11. package/lib/alchemy.js.map +1 -1
  12. package/lib/apply.d.ts.map +1 -1
  13. package/lib/apply.js +63 -5
  14. package/lib/apply.js.map +1 -1
  15. package/lib/aws/control/client.js +4 -3
  16. package/lib/aws/control/client.js.map +1 -1
  17. package/lib/aws/control/properties.d.ts +6 -0
  18. package/lib/aws/control/properties.d.ts.map +1 -1
  19. package/lib/aws/control/properties.js +48 -0
  20. package/lib/aws/control/properties.js.map +1 -1
  21. package/lib/aws/control/resource.d.ts.map +1 -1
  22. package/lib/aws/control/resource.js +3 -2
  23. package/lib/aws/control/resource.js.map +1 -1
  24. package/lib/aws/control/types.d.ts +3969 -4862
  25. package/lib/aws/control/types.d.ts.map +1 -1
  26. package/lib/aws/control/types.js.map +1 -1
  27. package/lib/aws/function.d.ts.map +1 -1
  28. package/lib/aws/function.js +9 -8
  29. package/lib/aws/function.js.map +1 -1
  30. package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
  31. package/lib/aws/oidc/oidc-provider.js +3 -2
  32. package/lib/aws/oidc/oidc-provider.js.map +1 -1
  33. package/lib/aws/queue.d.ts.map +1 -1
  34. package/lib/aws/queue.js +3 -2
  35. package/lib/aws/queue.js.map +1 -1
  36. package/lib/aws/role.d.ts.map +1 -1
  37. package/lib/aws/role.js +3 -1
  38. package/lib/aws/role.js.map +1 -1
  39. package/lib/aws/ssm-parameter.d.ts.map +1 -1
  40. package/lib/aws/ssm-parameter.js +2 -1
  41. package/lib/aws/ssm-parameter.js.map +1 -1
  42. package/lib/cloudflare/account-api-token.d.ts.map +1 -1
  43. package/lib/cloudflare/account-api-token.js +3 -2
  44. package/lib/cloudflare/account-api-token.js.map +1 -1
  45. package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
  46. package/lib/cloudflare/ai-gateway.js +4 -3
  47. package/lib/cloudflare/ai-gateway.js.map +1 -1
  48. package/lib/cloudflare/api-error.d.ts +0 -9
  49. package/lib/cloudflare/api-error.d.ts.map +1 -1
  50. package/lib/cloudflare/api-error.js +24 -0
  51. package/lib/cloudflare/api-error.js.map +1 -1
  52. package/lib/cloudflare/api.d.ts.map +1 -1
  53. package/lib/cloudflare/api.js +5 -4
  54. package/lib/cloudflare/api.js.map +1 -1
  55. package/lib/cloudflare/assets.d.ts.map +1 -1
  56. package/lib/cloudflare/assets.js +26 -6
  57. package/lib/cloudflare/assets.js.map +1 -1
  58. package/lib/cloudflare/astro.d.ts +63 -0
  59. package/lib/cloudflare/astro.d.ts.map +1 -0
  60. package/lib/cloudflare/astro.js +133 -0
  61. package/lib/cloudflare/astro.js.map +1 -0
  62. package/lib/cloudflare/auth.d.ts.map +1 -1
  63. package/lib/cloudflare/auth.js +3 -2
  64. package/lib/cloudflare/auth.js.map +1 -1
  65. package/lib/cloudflare/bindings.d.ts +24 -2
  66. package/lib/cloudflare/bindings.d.ts.map +1 -1
  67. package/lib/cloudflare/bindings.js.map +1 -1
  68. package/lib/cloudflare/bound.d.ts +10 -1
  69. package/lib/cloudflare/bound.d.ts.map +1 -1
  70. package/lib/cloudflare/bucket.d.ts.map +1 -1
  71. package/lib/cloudflare/bucket.js +12 -8
  72. package/lib/cloudflare/bucket.js.map +1 -1
  73. package/lib/cloudflare/bundle/bundle-worker.d.ts.map +1 -1
  74. package/lib/cloudflare/bundle/bundle-worker.js +2 -1
  75. package/lib/cloudflare/bundle/bundle-worker.js.map +1 -1
  76. package/lib/cloudflare/bundle/nodejs-compat-mode.d.ts.map +1 -1
  77. package/lib/cloudflare/bundle/nodejs-compat-mode.js +2 -1
  78. package/lib/cloudflare/bundle/nodejs-compat-mode.js.map +1 -1
  79. package/lib/cloudflare/custom-domain.d.ts.map +1 -1
  80. package/lib/cloudflare/custom-domain.js +10 -9
  81. package/lib/cloudflare/custom-domain.js.map +1 -1
  82. package/lib/cloudflare/d1-database.d.ts.map +1 -1
  83. package/lib/cloudflare/d1-database.js +11 -10
  84. package/lib/cloudflare/d1-database.js.map +1 -1
  85. package/lib/cloudflare/d1-export.d.ts.map +1 -1
  86. package/lib/cloudflare/d1-export.js +2 -1
  87. package/lib/cloudflare/d1-export.js.map +1 -1
  88. package/lib/cloudflare/d1-import.d.ts.map +1 -1
  89. package/lib/cloudflare/d1-import.js +2 -1
  90. package/lib/cloudflare/d1-import.js.map +1 -1
  91. package/lib/cloudflare/d1-migrations.d.ts.map +1 -1
  92. package/lib/cloudflare/d1-migrations.js +2 -1
  93. package/lib/cloudflare/d1-migrations.js.map +1 -1
  94. package/lib/cloudflare/dispatch-namespace.d.ts +94 -0
  95. package/lib/cloudflare/dispatch-namespace.d.ts.map +1 -0
  96. package/lib/cloudflare/dispatch-namespace.js +143 -0
  97. package/lib/cloudflare/dispatch-namespace.js.map +1 -0
  98. package/lib/cloudflare/dns-records.d.ts.map +1 -1
  99. package/lib/cloudflare/dns-records.js +5 -4
  100. package/lib/cloudflare/dns-records.js.map +1 -1
  101. package/lib/cloudflare/do-state-store/worker.d.ts.map +1 -1
  102. package/lib/cloudflare/do-state-store/worker.js +4 -0
  103. package/lib/cloudflare/do-state-store/worker.js.map +1 -1
  104. package/lib/cloudflare/email-address.d.ts +79 -0
  105. package/lib/cloudflare/email-address.d.ts.map +1 -0
  106. package/lib/cloudflare/email-address.js +112 -0
  107. package/lib/cloudflare/email-address.js.map +1 -0
  108. package/lib/cloudflare/email-catch-all.d.ts +123 -0
  109. package/lib/cloudflare/email-catch-all.d.ts.map +1 -0
  110. package/lib/cloudflare/email-catch-all.js +124 -0
  111. package/lib/cloudflare/email-catch-all.js.map +1 -0
  112. package/lib/cloudflare/email-routing.d.ts +89 -0
  113. package/lib/cloudflare/email-routing.d.ts.map +1 -0
  114. package/lib/cloudflare/email-routing.js +120 -0
  115. package/lib/cloudflare/email-routing.js.map +1 -0
  116. package/lib/cloudflare/email-rule.d.ts +196 -0
  117. package/lib/cloudflare/email-rule.d.ts.map +1 -0
  118. package/lib/cloudflare/email-rule.js +153 -0
  119. package/lib/cloudflare/email-rule.js.map +1 -0
  120. package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
  121. package/lib/cloudflare/hyperdrive.js +5 -4
  122. package/lib/cloudflare/hyperdrive.js.map +1 -1
  123. package/lib/cloudflare/images.d.ts +60 -0
  124. package/lib/cloudflare/images.d.ts.map +1 -0
  125. package/lib/cloudflare/images.js +60 -0
  126. package/lib/cloudflare/images.js.map +1 -0
  127. package/lib/cloudflare/index.d.ts +10 -0
  128. package/lib/cloudflare/index.d.ts.map +1 -1
  129. package/lib/cloudflare/index.js +10 -0
  130. package/lib/cloudflare/index.js.map +1 -1
  131. package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
  132. package/lib/cloudflare/kv-namespace.js +2 -1
  133. package/lib/cloudflare/kv-namespace.js.map +1 -1
  134. package/lib/cloudflare/pipeline.d.ts +7 -0
  135. package/lib/cloudflare/pipeline.d.ts.map +1 -1
  136. package/lib/cloudflare/pipeline.js +28 -2
  137. package/lib/cloudflare/pipeline.js.map +1 -1
  138. package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
  139. package/lib/cloudflare/queue-consumer.js +2 -1
  140. package/lib/cloudflare/queue-consumer.js.map +1 -1
  141. package/lib/cloudflare/queue.d.ts.map +1 -1
  142. package/lib/cloudflare/queue.js +0 -8
  143. package/lib/cloudflare/queue.js.map +1 -1
  144. package/lib/cloudflare/route.d.ts +26 -1
  145. package/lib/cloudflare/route.d.ts.map +1 -1
  146. package/lib/cloudflare/route.js +84 -16
  147. package/lib/cloudflare/route.js.map +1 -1
  148. package/lib/cloudflare/secret.d.ts +137 -0
  149. package/lib/cloudflare/secret.d.ts.map +1 -0
  150. package/lib/cloudflare/secret.js +122 -0
  151. package/lib/cloudflare/secret.js.map +1 -0
  152. package/lib/cloudflare/secrets-store.d.ts +145 -0
  153. package/lib/cloudflare/secrets-store.d.ts.map +1 -0
  154. package/lib/cloudflare/secrets-store.js +213 -0
  155. package/lib/cloudflare/secrets-store.js.map +1 -0
  156. package/lib/cloudflare/sveltekit.d.ts +49 -0
  157. package/lib/cloudflare/sveltekit.d.ts.map +1 -0
  158. package/lib/cloudflare/sveltekit.js +56 -0
  159. package/lib/cloudflare/sveltekit.js.map +1 -0
  160. package/lib/cloudflare/user.d.ts.map +1 -1
  161. package/lib/cloudflare/user.js +2 -1
  162. package/lib/cloudflare/user.js.map +1 -1
  163. package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
  164. package/lib/cloudflare/vectorize-index.js +6 -5
  165. package/lib/cloudflare/vectorize-index.js.map +1 -1
  166. package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
  167. package/lib/cloudflare/vectorize-metadata-index.js +2 -1
  168. package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
  169. package/lib/cloudflare/website.d.ts.map +1 -1
  170. package/lib/cloudflare/website.js +7 -2
  171. package/lib/cloudflare/website.js.map +1 -1
  172. package/lib/cloudflare/worker-assets.d.ts +18 -0
  173. package/lib/cloudflare/worker-assets.d.ts.map +1 -1
  174. package/lib/cloudflare/worker-assets.js +61 -67
  175. package/lib/cloudflare/worker-assets.js.map +1 -1
  176. package/lib/cloudflare/worker-metadata.d.ts.map +1 -1
  177. package/lib/cloudflare/worker-metadata.js +23 -1
  178. package/lib/cloudflare/worker-metadata.js.map +1 -1
  179. package/lib/cloudflare/worker.d.ts +43 -2
  180. package/lib/cloudflare/worker.d.ts.map +1 -1
  181. package/lib/cloudflare/worker.js +50 -11
  182. package/lib/cloudflare/worker.js.map +1 -1
  183. package/lib/cloudflare/wrangler.json.d.ts +21 -0
  184. package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
  185. package/lib/cloudflare/wrangler.json.js +33 -0
  186. package/lib/cloudflare/wrangler.json.js.map +1 -1
  187. package/lib/cloudflare/zone.d.ts.map +1 -1
  188. package/lib/cloudflare/zone.js +4 -3
  189. package/lib/cloudflare/zone.js.map +1 -1
  190. package/lib/destroy.d.ts.map +1 -1
  191. package/lib/destroy.js +30 -13
  192. package/lib/destroy.js.map +1 -1
  193. package/lib/dns/godaddy.d.ts.map +1 -1
  194. package/lib/dns/godaddy.js +3 -2
  195. package/lib/dns/godaddy.js.map +1 -1
  196. package/lib/dns/import-dns.d.ts.map +1 -1
  197. package/lib/dns/import-dns.js +2 -1
  198. package/lib/dns/import-dns.js.map +1 -1
  199. package/lib/esbuild/bundle.d.ts +1 -1
  200. package/lib/esbuild/bundle.d.ts.map +1 -1
  201. package/lib/esbuild/bundle.js +2 -1
  202. package/lib/esbuild/bundle.js.map +1 -1
  203. package/lib/fs/copy-file.d.ts.map +1 -1
  204. package/lib/fs/copy-file.js +2 -1
  205. package/lib/fs/copy-file.js.map +1 -1
  206. package/lib/fs/file.d.ts.map +1 -1
  207. package/lib/fs/file.js +2 -1
  208. package/lib/fs/file.js.map +1 -1
  209. package/lib/github/client.d.ts.map +1 -1
  210. package/lib/github/client.js +11 -10
  211. package/lib/github/client.js.map +1 -1
  212. package/lib/github/repository-environment.d.ts.map +1 -1
  213. package/lib/github/repository-environment.js +5 -4
  214. package/lib/github/repository-environment.js.map +1 -1
  215. package/lib/github/secret.d.ts.map +1 -1
  216. package/lib/github/secret.js +7 -6
  217. package/lib/github/secret.js.map +1 -1
  218. package/lib/index.d.ts +2 -1
  219. package/lib/index.d.ts.map +1 -1
  220. package/lib/index.js +1 -0
  221. package/lib/index.js.map +1 -1
  222. package/lib/neon/project.d.ts.map +1 -1
  223. package/lib/neon/project.js +3 -2
  224. package/lib/neon/project.js.map +1 -1
  225. package/lib/planetscale/api.d.ts +53 -0
  226. package/lib/planetscale/api.d.ts.map +1 -0
  227. package/lib/planetscale/api.js +84 -0
  228. package/lib/planetscale/api.js.map +1 -0
  229. package/lib/planetscale/branch.d.ts +129 -0
  230. package/lib/planetscale/branch.d.ts.map +1 -0
  231. package/lib/planetscale/branch.js +161 -0
  232. package/lib/planetscale/branch.js.map +1 -0
  233. package/lib/planetscale/database.d.ts +143 -0
  234. package/lib/planetscale/database.d.ts.map +1 -0
  235. package/lib/planetscale/database.js +184 -0
  236. package/lib/planetscale/database.js.map +1 -0
  237. package/lib/planetscale/index.d.ts +5 -0
  238. package/lib/planetscale/index.d.ts.map +1 -0
  239. package/lib/planetscale/index.js +5 -0
  240. package/lib/planetscale/index.js.map +1 -0
  241. package/lib/planetscale/utils.d.ts +15 -0
  242. package/lib/planetscale/utils.d.ts.map +1 -0
  243. package/lib/planetscale/utils.js +95 -0
  244. package/lib/planetscale/utils.js.map +1 -0
  245. package/lib/resource.js +7 -1
  246. package/lib/resource.js.map +1 -1
  247. package/lib/runtime/plugin.d.ts.map +1 -1
  248. package/lib/runtime/plugin.js +2 -1
  249. package/lib/runtime/plugin.js.map +1 -1
  250. package/lib/scope.d.ts +13 -2
  251. package/lib/scope.d.ts.map +1 -1
  252. package/lib/scope.js +53 -10
  253. package/lib/scope.js.map +1 -1
  254. package/lib/sentry/client-key.d.ts.map +1 -1
  255. package/lib/sentry/client-key.js +5 -4
  256. package/lib/sentry/client-key.js.map +1 -1
  257. package/lib/sentry/project.d.ts.map +1 -1
  258. package/lib/sentry/project.js +5 -4
  259. package/lib/sentry/project.js.map +1 -1
  260. package/lib/sentry/team.d.ts.map +1 -1
  261. package/lib/sentry/team.js +5 -4
  262. package/lib/sentry/team.js.map +1 -1
  263. package/lib/stripe/card.d.ts.map +1 -1
  264. package/lib/stripe/card.js +2 -1
  265. package/lib/stripe/card.js.map +1 -1
  266. package/lib/stripe/client.d.ts.map +1 -1
  267. package/lib/stripe/client.js +3 -2
  268. package/lib/stripe/client.js.map +1 -1
  269. package/lib/stripe/coupon.d.ts.map +1 -1
  270. package/lib/stripe/coupon.js +2 -1
  271. package/lib/stripe/coupon.js.map +1 -1
  272. package/lib/stripe/customer.d.ts.map +1 -1
  273. package/lib/stripe/customer.js +2 -1
  274. package/lib/stripe/customer.js.map +1 -1
  275. package/lib/stripe/entitlements-feature.d.ts.map +1 -1
  276. package/lib/stripe/entitlements-feature.js +2 -1
  277. package/lib/stripe/entitlements-feature.js.map +1 -1
  278. package/lib/stripe/file.d.ts.map +1 -1
  279. package/lib/stripe/file.js +2 -1
  280. package/lib/stripe/file.js.map +1 -1
  281. package/lib/stripe/meter.d.ts.map +1 -1
  282. package/lib/stripe/meter.js +4 -2
  283. package/lib/stripe/meter.js.map +1 -1
  284. package/lib/stripe/portal-configuration.d.ts.map +1 -1
  285. package/lib/stripe/portal-configuration.js +2 -1
  286. package/lib/stripe/portal-configuration.js.map +1 -1
  287. package/lib/stripe/price.d.ts.map +1 -1
  288. package/lib/stripe/price.js +2 -1
  289. package/lib/stripe/price.js.map +1 -1
  290. package/lib/stripe/product-feature.d.ts.map +1 -1
  291. package/lib/stripe/product-feature.js +2 -1
  292. package/lib/stripe/product-feature.js.map +1 -1
  293. package/lib/stripe/product.d.ts.map +1 -1
  294. package/lib/stripe/product.js +2 -1
  295. package/lib/stripe/product.js.map +1 -1
  296. package/lib/stripe/promotion-code.d.ts.map +1 -1
  297. package/lib/stripe/promotion-code.js +2 -1
  298. package/lib/stripe/promotion-code.js.map +1 -1
  299. package/lib/stripe/shipping-rate.d.ts.map +1 -1
  300. package/lib/stripe/shipping-rate.js +2 -1
  301. package/lib/stripe/shipping-rate.js.map +1 -1
  302. package/lib/stripe/tax-rate.d.ts.map +1 -1
  303. package/lib/stripe/tax-rate.js +2 -1
  304. package/lib/stripe/tax-rate.js.map +1 -1
  305. package/lib/stripe/webhook.d.ts.map +1 -1
  306. package/lib/stripe/webhook.js +3 -2
  307. package/lib/stripe/webhook.js.map +1 -1
  308. package/lib/test/bun.d.ts.map +1 -1
  309. package/lib/test/bun.js +6 -1
  310. package/lib/test/bun.js.map +1 -1
  311. package/lib/test/prune.js +7 -1
  312. package/lib/test/prune.js.map +1 -1
  313. package/lib/test/vitest.d.ts.map +1 -1
  314. package/lib/test/vitest.js +10 -3
  315. package/lib/test/vitest.js.map +1 -1
  316. package/lib/upstash/redis.d.ts.map +1 -1
  317. package/lib/upstash/redis.js +2 -1
  318. package/lib/upstash/redis.js.map +1 -1
  319. package/lib/util/async-queue.d.ts +35 -0
  320. package/lib/util/async-queue.d.ts.map +1 -0
  321. package/lib/util/async-queue.js +87 -0
  322. package/lib/util/async-queue.js.map +1 -0
  323. package/lib/util/cli.d.ts +37 -0
  324. package/lib/util/cli.d.ts.map +1 -0
  325. package/lib/util/cli.js +90 -0
  326. package/lib/util/cli.js.map +1 -0
  327. package/lib/util/ignore-matcher.d.ts +94 -0
  328. package/lib/util/ignore-matcher.d.ts.map +1 -0
  329. package/lib/util/ignore-matcher.js +616 -0
  330. package/lib/util/ignore-matcher.js.map +1 -0
  331. package/lib/util/logger.d.ts +3 -0
  332. package/lib/util/logger.d.ts.map +1 -0
  333. package/lib/util/logger.js +15 -0
  334. package/lib/util/logger.js.map +1 -0
  335. package/lib/util/retry.d.ts.map +1 -1
  336. package/lib/util/retry.js +0 -1
  337. package/lib/util/retry.js.map +1 -1
  338. package/lib/util/safe-fetch.d.ts.map +1 -1
  339. package/lib/util/safe-fetch.js +2 -1
  340. package/lib/util/safe-fetch.js.map +1 -1
  341. package/lib/util/telemetry/client.d.ts +32 -0
  342. package/lib/util/telemetry/client.d.ts.map +1 -0
  343. package/lib/util/telemetry/client.js +94 -0
  344. package/lib/util/telemetry/client.js.map +1 -0
  345. package/lib/util/telemetry/constants.d.ts +4 -0
  346. package/lib/util/telemetry/constants.d.ts.map +1 -0
  347. package/lib/util/telemetry/constants.js +8 -0
  348. package/lib/util/telemetry/constants.js.map +1 -0
  349. package/lib/util/telemetry/context.d.ts +15 -0
  350. package/lib/util/telemetry/context.d.ts.map +1 -0
  351. package/lib/util/telemetry/context.js +128 -0
  352. package/lib/util/telemetry/context.js.map +1 -0
  353. package/lib/util/telemetry/index.d.ts +3 -0
  354. package/lib/util/telemetry/index.d.ts.map +1 -0
  355. package/lib/util/telemetry/index.js +3 -0
  356. package/lib/util/telemetry/index.js.map +1 -0
  357. package/lib/util/telemetry/types.d.ts +59 -0
  358. package/lib/util/telemetry/types.d.ts.map +1 -0
  359. package/lib/util/telemetry/types.js +1 -0
  360. package/lib/util/telemetry/types.js.map +1 -0
  361. package/lib/util/xdg-paths.d.ts +9 -0
  362. package/lib/util/xdg-paths.d.ts.map +1 -0
  363. package/lib/util/xdg-paths.js +41 -0
  364. package/lib/util/xdg-paths.js.map +1 -0
  365. package/lib/vercel/project.d.ts.map +1 -1
  366. package/lib/vercel/project.js +2 -1
  367. package/lib/vercel/project.js.map +1 -1
  368. package/lib/web/astro.d.ts.map +1 -1
  369. package/lib/web/astro.js +2 -1
  370. package/lib/web/astro.js.map +1 -1
  371. package/lib/web/shadcn.d.ts.map +1 -1
  372. package/lib/web/shadcn.js +2 -1
  373. package/lib/web/shadcn.js.map +1 -1
  374. package/lib/web/vite.d.ts.map +1 -1
  375. package/lib/web/vite.js +3 -2
  376. package/lib/web/vite.js.map +1 -1
  377. package/lib/web/vitepress/dependencies.d.ts.map +1 -1
  378. package/lib/web/vitepress/dependencies.js +2 -1
  379. package/lib/web/vitepress/dependencies.js.map +1 -1
  380. package/lib/web/vitepress/vitepress.d.ts.map +1 -1
  381. package/lib/web/vitepress/vitepress.js +2 -1
  382. package/lib/web/vitepress/vitepress.js.map +1 -1
  383. package/package.json +6 -4
  384. package/src/ai/astro-file.ts +2 -1
  385. package/src/ai/client.ts +3 -2
  386. package/src/alchemy.ts +28 -3
  387. package/src/apply.ts +66 -5
  388. package/src/aws/control/client.ts +4 -4
  389. package/src/aws/control/properties.ts +48 -0
  390. package/src/aws/control/resource.ts +3 -2
  391. package/src/aws/control/types.ts +3988 -6301
  392. package/src/aws/function.ts +9 -8
  393. package/src/aws/oidc/oidc-provider.ts +3 -2
  394. package/src/aws/queue.ts +3 -2
  395. package/src/aws/role.ts +3 -1
  396. package/src/aws/ssm-parameter.ts +2 -1
  397. package/src/cloudflare/account-api-token.ts +3 -2
  398. package/src/cloudflare/ai-gateway.ts +4 -3
  399. package/src/cloudflare/api-error.ts +36 -0
  400. package/src/cloudflare/api.ts +9 -4
  401. package/src/cloudflare/assets.ts +30 -6
  402. package/src/cloudflare/astro.ts +176 -0
  403. package/src/cloudflare/auth.ts +3 -2
  404. package/src/cloudflare/bindings.ts +29 -0
  405. package/src/cloudflare/bound.ts +38 -21
  406. package/src/cloudflare/bucket.ts +15 -8
  407. package/src/cloudflare/bundle/bundle-worker.ts +2 -1
  408. package/src/cloudflare/bundle/nodejs-compat-mode.ts +2 -1
  409. package/src/cloudflare/custom-domain.ts +10 -9
  410. package/src/cloudflare/d1-database.ts +11 -10
  411. package/src/cloudflare/d1-export.ts +2 -1
  412. package/src/cloudflare/d1-import.ts +2 -1
  413. package/src/cloudflare/d1-migrations.ts +2 -1
  414. package/src/cloudflare/dispatch-namespace.ts +281 -0
  415. package/src/cloudflare/dns-records.ts +5 -4
  416. package/src/cloudflare/do-state-store/worker.ts +4 -0
  417. package/src/cloudflare/email-address.ts +203 -0
  418. package/src/cloudflare/email-catch-all.ts +248 -0
  419. package/src/cloudflare/email-routing.ts +230 -0
  420. package/src/cloudflare/email-rule.ts +322 -0
  421. package/src/cloudflare/hyperdrive.ts +5 -4
  422. package/src/cloudflare/images.ts +59 -0
  423. package/src/cloudflare/index.ts +10 -0
  424. package/src/cloudflare/kv-namespace.ts +2 -1
  425. package/src/cloudflare/pipeline.ts +38 -2
  426. package/src/cloudflare/queue-consumer.ts +2 -1
  427. package/src/cloudflare/queue.ts +0 -12
  428. package/src/cloudflare/route.ts +118 -18
  429. package/src/cloudflare/secret.ts +253 -0
  430. package/src/cloudflare/secrets-store.ts +420 -0
  431. package/src/cloudflare/sveltekit.ts +72 -0
  432. package/src/cloudflare/user.ts +2 -1
  433. package/src/cloudflare/vectorize-index.ts +6 -5
  434. package/src/cloudflare/vectorize-metadata-index.ts +2 -1
  435. package/src/cloudflare/website.ts +76 -66
  436. package/src/cloudflare/worker-assets.ts +95 -89
  437. package/src/cloudflare/worker-metadata.ts +20 -1
  438. package/src/cloudflare/worker.ts +116 -18
  439. package/src/cloudflare/wrangler.json.ts +63 -0
  440. package/src/cloudflare/zone.ts +4 -3
  441. package/src/destroy.ts +35 -17
  442. package/src/dns/godaddy.ts +3 -2
  443. package/src/dns/import-dns.ts +2 -1
  444. package/src/esbuild/bundle.ts +2 -1
  445. package/src/fs/copy-file.ts +2 -1
  446. package/src/fs/file.ts +3 -1
  447. package/src/github/client.ts +11 -10
  448. package/src/github/repository-environment.ts +5 -4
  449. package/src/github/secret.ts +7 -6
  450. package/src/index.ts +2 -1
  451. package/src/neon/project.ts +3 -2
  452. package/src/planetscale/api.ts +115 -0
  453. package/src/planetscale/branch.ts +352 -0
  454. package/src/planetscale/database.ts +394 -0
  455. package/src/planetscale/index.ts +4 -0
  456. package/src/planetscale/utils.ts +189 -0
  457. package/src/resource.ts +7 -1
  458. package/src/runtime/plugin.ts +2 -1
  459. package/src/scope.ts +64 -13
  460. package/src/sentry/client-key.ts +5 -4
  461. package/src/sentry/project.ts +5 -4
  462. package/src/sentry/team.ts +5 -4
  463. package/src/stripe/card.ts +2 -1
  464. package/src/stripe/client.ts +3 -2
  465. package/src/stripe/coupon.ts +2 -1
  466. package/src/stripe/customer.ts +2 -1
  467. package/src/stripe/entitlements-feature.ts +2 -1
  468. package/src/stripe/file.ts +2 -1
  469. package/src/stripe/meter.ts +4 -2
  470. package/src/stripe/portal-configuration.ts +2 -1
  471. package/src/stripe/price.ts +2 -1
  472. package/src/stripe/product-feature.ts +2 -1
  473. package/src/stripe/product.ts +2 -1
  474. package/src/stripe/promotion-code.ts +2 -1
  475. package/src/stripe/shipping-rate.ts +2 -1
  476. package/src/stripe/tax-rate.ts +2 -1
  477. package/src/stripe/webhook.ts +3 -2
  478. package/src/test/bun.ts +6 -1
  479. package/src/test/prune.ts +7 -1
  480. package/src/test/vitest.ts +14 -3
  481. package/src/upstash/redis.ts +2 -1
  482. package/src/util/async-queue.ts +97 -0
  483. package/src/util/cli.tsx +221 -0
  484. package/src/util/ignore-matcher.ts +873 -0
  485. package/src/util/logger.ts +17 -0
  486. package/src/util/retry.ts +0 -1
  487. package/src/util/safe-fetch.ts +2 -1
  488. package/src/util/telemetry/client.ts +127 -0
  489. package/src/util/telemetry/constants.ts +13 -0
  490. package/src/util/telemetry/context.ts +154 -0
  491. package/src/util/telemetry/index.ts +2 -0
  492. package/src/util/telemetry/types.ts +83 -0
  493. package/src/util/xdg-paths.ts +48 -0
  494. package/src/vercel/project.ts +2 -1
  495. package/src/web/astro.ts +2 -1
  496. package/src/web/shadcn.ts +2 -1
  497. package/src/web/vite.ts +3 -2
  498. package/src/web/vitepress/dependencies.ts +2 -1
  499. package/src/web/vitepress/vitepress.ts +2 -1
@@ -2,6 +2,7 @@ import sodium from "libsodium-wrappers";
2
2
  import type { Context } from "../context.ts";
3
3
  import { Resource } from "../resource.ts";
4
4
  import type { Secret } from "../secret.ts";
5
+ import { logger } from "../util/logger.ts";
5
6
  import { createGitHubClient, verifyGitHubAuth } from "./client.ts";
6
7
  /**
7
8
  * Properties for creating or updating a GitHub Secret
@@ -172,7 +173,7 @@ export const GitHubSecret = Resource(
172
173
  } catch (error: any) {
173
174
  // Ignore 404 errors (secret already deleted)
174
175
  if (error.status === 404) {
175
- console.log("Secret doesn't exist, ignoring");
176
+ logger.log("Secret doesn't exist, ignoring");
176
177
  } else {
177
178
  throw error;
178
179
  }
@@ -190,7 +191,7 @@ export const GitHubSecret = Resource(
190
191
 
191
192
  // If secret type changed, we need to delete the old one first
192
193
  if (secretTypeChanged) {
193
- console.log(
194
+ logger.log(
194
195
  `Secret type changed from ${wasEnvironmentSecret ? "environment" : "repository"} to ${isEnvironmentSecret ? "environment" : "repository"} secret. Deleting the old secret first.`,
195
196
  );
196
197
 
@@ -214,7 +215,7 @@ export const GitHubSecret = Resource(
214
215
  } catch (error: any) {
215
216
  // Log but don't fail if the old secret doesn't exist or can't be deleted
216
217
  if (error.status === 404) {
217
- console.log(
218
+ logger.log(
218
219
  "Old secret not found, continuing with creation of new secret",
219
220
  );
220
221
  } else {
@@ -293,14 +294,14 @@ export const GitHubSecret = Resource(
293
294
  error.status === 403 &&
294
295
  error.message?.includes("Must have admin rights")
295
296
  ) {
296
- console.error(
297
+ logger.error(
297
298
  "\n⚠️ Error creating/updating GitHub secret: You must have admin rights to the repository.",
298
299
  );
299
- console.error(
300
+ logger.error(
300
301
  "Make sure your GitHub token has the required permissions (repo scope for private repos).\n",
301
302
  );
302
303
  } else {
303
- console.error("Error creating/updating GitHub secret:", error.message);
304
+ logger.error("Error creating/updating GitHub secret:", error.message);
304
305
  }
305
306
  throw error;
306
307
  }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { AlchemyOptions } from "./alchemy.ts";
1
+ export type { AlchemyOptions, Phase } from "./alchemy.ts";
2
2
  export type * from "./context.ts";
3
3
  export * from "./resource.ts";
4
4
  export type * from "./scope.ts";
@@ -7,6 +7,7 @@ export * from "./serde.ts";
7
7
  export * from "./state.ts";
8
8
  export * from "./type.ts";
9
9
  export * from "./util/ignore.ts";
10
+ export * from "./util/logger.ts";
10
11
 
11
12
  import { alchemy } from "./alchemy.ts";
12
13
  export default alchemy;
@@ -2,6 +2,7 @@ import { alchemy } from "../alchemy.ts";
2
2
  import type { Context } from "../context.ts";
3
3
  import { Resource } from "../resource.ts";
4
4
  import type { Secret } from "../secret.ts";
5
+ import { logger } from "../util/logger.ts";
5
6
  import { handleApiError } from "./api-error.ts";
6
7
  import { createNeonApi, type NeonApiOptions } from "./api.ts";
7
8
 
@@ -525,7 +526,7 @@ export const NeonProject = Resource(
525
526
  }
526
527
  }
527
528
  } catch (error) {
528
- console.error(`Error deleting Neon project ${id}:`, error);
529
+ logger.error(`Error deleting Neon project ${id}:`, error);
529
530
  throw error;
530
531
  }
531
532
  return this.destroy();
@@ -628,7 +629,7 @@ export const NeonProject = Resource(
628
629
  endpoints: response.endpoints,
629
630
  });
630
631
  } catch (error) {
631
- console.error(`Error ${this.phase} Neon project '${id}':`, error);
632
+ logger.error(`Error ${this.phase} Neon project '${id}':`, error);
632
633
  throw error;
633
634
  }
634
635
  },
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Options for PlanetScale API requests
3
+ */
4
+ export interface PlanetScaleApiOptions {
5
+ /**
6
+ * PlanetScale API token (overrides environment variable)
7
+ */
8
+ apiKey?: string;
9
+ }
10
+
11
+ /**
12
+ * Minimal API client for PlanetScale using raw fetch
13
+ */
14
+ export class PlanetScaleApi {
15
+ /** Base URL for API */
16
+ readonly baseUrl: string;
17
+
18
+ /** API token */
19
+ readonly apiToken: string;
20
+
21
+ /**
22
+ * Create a new API client
23
+ *
24
+ * @param options API options
25
+ */
26
+ constructor(options: PlanetScaleApiOptions = {}) {
27
+ this.baseUrl = "https://api.planetscale.com/v1";
28
+ this.apiToken = options.apiKey || process.env.PLANETSCALE_API_TOKEN || "";
29
+ if (!this.apiToken) {
30
+ throw new Error("PLANETSCALE_API_TOKEN environment variable is required");
31
+ }
32
+ }
33
+
34
+ /**
35
+ * Make a request to the API
36
+ *
37
+ * @param path API path (without base URL)
38
+ * @param init Fetch init options
39
+ * @returns Raw Response object from fetch
40
+ */
41
+ private async fetch(path: string, init: RequestInit = {}): Promise<Response> {
42
+ const headers: Record<string, string> = {
43
+ Authorization: `${this.apiToken}`,
44
+ "Content-Type": "application/json",
45
+ };
46
+
47
+ if (init.headers) {
48
+ Object.assign(headers, init.headers);
49
+ }
50
+
51
+ return fetch(`${this.baseUrl}${path}`, {
52
+ ...init,
53
+ headers,
54
+ });
55
+ }
56
+
57
+ /**
58
+ * Helper for GET requests
59
+ */
60
+ async get(path: string, init: RequestInit = {}): Promise<Response> {
61
+ return this.fetch(path, { ...init, method: "GET" });
62
+ }
63
+
64
+ /**
65
+ * Helper for POST requests
66
+ */
67
+ async post(
68
+ path: string,
69
+ body?: any,
70
+ init: RequestInit = {},
71
+ ): Promise<Response> {
72
+ return this.fetch(path, {
73
+ ...init,
74
+ method: "POST",
75
+ body: body ? JSON.stringify(body) : undefined,
76
+ });
77
+ }
78
+
79
+ /**
80
+ * Helper for PUT requests
81
+ */
82
+ async put(
83
+ path: string,
84
+ body?: any,
85
+ init: RequestInit = {},
86
+ ): Promise<Response> {
87
+ return this.fetch(path, {
88
+ ...init,
89
+ method: "PUT",
90
+ body: body ? JSON.stringify(body) : undefined,
91
+ });
92
+ }
93
+
94
+ /**
95
+ * Helper for PATCH requests
96
+ */
97
+ async patch(
98
+ path: string,
99
+ body?: any,
100
+ init: RequestInit = {},
101
+ ): Promise<Response> {
102
+ return this.fetch(path, {
103
+ ...init,
104
+ method: "PATCH",
105
+ body: body ? JSON.stringify(body) : undefined,
106
+ });
107
+ }
108
+
109
+ /**
110
+ * Helper for DELETE requests
111
+ */
112
+ async delete(path: string, init: RequestInit = {}): Promise<Response> {
113
+ return this.fetch(path, { ...init, method: "DELETE" });
114
+ }
115
+ }
@@ -0,0 +1,352 @@
1
+ import type { Context } from "../context.ts";
2
+ import { Resource } from "../resource.ts";
3
+ import type { Secret } from "../secret.ts";
4
+ import { PlanetScaleApi } from "./api.ts";
5
+ import {
6
+ fixClusterSize,
7
+ waitForDatabaseReady,
8
+ type PlanetScaleClusterSize,
9
+ } from "./utils.ts";
10
+
11
+ /**
12
+ * Properties for creating or updating a PlanetScale Branch
13
+ */
14
+ export interface BranchProps {
15
+ /**
16
+ * The name of the branch
17
+ */
18
+ name: string;
19
+
20
+ /**
21
+ * The organization ID
22
+ */
23
+ organizationId: string;
24
+
25
+ /**
26
+ * The database name
27
+ */
28
+ databaseName: string;
29
+
30
+ /**
31
+ * PlanetScale API token (overrides environment variable)
32
+ */
33
+ apiKey?: Secret;
34
+
35
+ /**
36
+ * Whether or not the branch should be set to a production branch or not.
37
+ */
38
+
39
+ isProduction: boolean;
40
+
41
+ /**
42
+ * Whether to adopt an existing branch if it exists.
43
+ * If false and the branch exists, an error will be thrown.
44
+ * If true and the branch exists, it will be updated with the provided properties.
45
+ */
46
+ adopt?: boolean;
47
+
48
+ /**
49
+ * The parent branch name or Branch object
50
+ */
51
+ parentBranch?: string | Branch;
52
+
53
+ /**
54
+ * If provided, restores the backup's schema and data to the new branch.
55
+ * Must have restore_production_branch_backup(s) or restore_backup(s) access.
56
+ *
57
+ * Ignored if the branch already exists.
58
+ */
59
+ backupId?: string;
60
+
61
+ /**
62
+ * If provided, restores the last successful backup's schema and data to the new branch.
63
+ * Must have restore_production_branch_backup(s) or restore_backup(s) access,
64
+ * in addition to Data Branching being enabled for the branch.
65
+ * Use 'last_successful_backup' or empty string.
66
+ *
67
+ * Ignored if the branch already exists.
68
+ */
69
+ seedData?: string;
70
+
71
+ /**
72
+ * The database cluster size is required if a backup_id is provided. If the branch is not a production branch, the cluster size MUST be "PS_DEV".
73
+ */
74
+ clusterSize?: PlanetScaleClusterSize;
75
+
76
+ /**
77
+ * Enable or disable safe migrations on this branch
78
+ */
79
+ safeMigrations?: boolean;
80
+ }
81
+
82
+ /**
83
+ * Represents a PlanetScale Branch
84
+ */
85
+ export interface Branch extends Resource<"planetscale::Branch">, BranchProps {
86
+ /**
87
+ * The name of the branch
88
+ */
89
+ name: string;
90
+
91
+ /**
92
+ * The name of the parent branch
93
+ */
94
+ parentBranch: string;
95
+
96
+ /**
97
+ * Time at which the branch was created
98
+ */
99
+ createdAt: string;
100
+
101
+ /**
102
+ * Time at which the branch was last updated
103
+ */
104
+ updatedAt: string;
105
+
106
+ /**
107
+ * HTML URL to access the branch
108
+ */
109
+ htmlUrl: string;
110
+ }
111
+
112
+ /**
113
+ * Create or manage a PlanetScale database branch
114
+ *
115
+ * @example
116
+ * // Create a branch from 'main'
117
+ * const branch = await Branch("feature-123", {
118
+ * name: "feature-123",
119
+ * organizationId: "my-org",
120
+ * databaseName: "my-database",
121
+ * parentBranch: "main"
122
+ * });
123
+ *
124
+ * @example
125
+ * // Create a branch from another branch object
126
+ * const parentBranch = await Branch("staging", {
127
+ * name: "staging",
128
+ * organizationId: "my-org",
129
+ * databaseName: "my-database",
130
+ * parentBranch: "main"
131
+ * });
132
+ *
133
+ * const featureBranch = await Branch("feature-456", {
134
+ * name: "feature-456",
135
+ * organizationId: "my-org",
136
+ * databaseName: "my-database",
137
+ * parentBranch: parentBranch // Using Branch object instead of string
138
+ * });
139
+ *
140
+ * @example
141
+ * // Create a branch from a backup
142
+ * const branch = await Branch("restored-branch", {
143
+ * name: "restored-branch",
144
+ * organizationId: "my-org",
145
+ * databaseName: "my-database",
146
+ * parentBranch: "main",
147
+ * backupId: "backup-123",
148
+ * clusterSize: "PS_10"
149
+ * });
150
+ */
151
+ export const Branch = Resource(
152
+ "planetscale::Branch",
153
+ async function (
154
+ this: Context<Branch>,
155
+ _id: string,
156
+ props: BranchProps,
157
+ ): Promise<Branch> {
158
+ const apiKey =
159
+ props.apiKey?.unencrypted || process.env.PLANETSCALE_API_TOKEN;
160
+ if (!apiKey) {
161
+ throw new Error("PLANETSCALE_API_TOKEN environment variable is required");
162
+ }
163
+
164
+ const api = new PlanetScaleApi({ apiKey });
165
+
166
+ if (this.phase === "delete") {
167
+ try {
168
+ if (this.output?.name) {
169
+ const response = await api.delete(
170
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches/${this.output.name}`,
171
+ );
172
+
173
+ if (!response.ok && response.status !== 404) {
174
+ throw new Error(
175
+ `Failed to delete branch: ${response.statusText} ${await response.text()}`,
176
+ );
177
+ }
178
+ }
179
+ } catch (error) {
180
+ console.error("Error deleting branch:", error);
181
+ throw error;
182
+ }
183
+ return this.destroy();
184
+ }
185
+
186
+ try {
187
+ const parentBranchName = !props.parentBranch
188
+ ? "main"
189
+ : typeof props.parentBranch === "string"
190
+ ? props.parentBranch
191
+ : props.parentBranch.name;
192
+
193
+ if (typeof props.parentBranch !== "string" && props.parentBranch) {
194
+ await waitForDatabaseReady(
195
+ api,
196
+ props.organizationId,
197
+ props.databaseName,
198
+ props.parentBranch.name,
199
+ );
200
+ }
201
+
202
+ // Check if branch exists
203
+ const getResponse = await api.get(
204
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches/${props.name}`,
205
+ );
206
+
207
+ if (!getResponse.ok && getResponse.status !== 404) {
208
+ // Error getting branch
209
+ throw new Error(
210
+ `Failed to get branch: ${getResponse.statusText} ${await getResponse.text()}`,
211
+ );
212
+ }
213
+
214
+ if (getResponse.ok) {
215
+ // Branch exists
216
+ if (!props.adopt) {
217
+ throw new Error(
218
+ `Branch ${props.name} already exists and adopt is false`,
219
+ );
220
+ }
221
+
222
+ const data = await getResponse.json<any>();
223
+ const currentParentBranch = data.parent_branch || "main";
224
+
225
+ // Check immutable properties
226
+ if (props.parentBranch && parentBranchName !== currentParentBranch) {
227
+ throw new Error(
228
+ `Cannot change parent branch from ${currentParentBranch} to ${parentBranchName}`,
229
+ );
230
+ }
231
+ if (this.output?.backupId) {
232
+ console.warn(
233
+ "BackupID is set, but branch already exists, so it will be ignored",
234
+ );
235
+ }
236
+
237
+ if (this.output?.seedData) {
238
+ console.warn(
239
+ "SeedData is set, but branch already exists, so it will be ignored",
240
+ );
241
+ }
242
+
243
+ // Update mutable properties if they've changed
244
+ if (props.safeMigrations !== undefined) {
245
+ const safeMigrationsResponse = await api[
246
+ props.safeMigrations ? "post" : "delete"
247
+ ](
248
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches/${props.name}/safe-migrations`,
249
+ );
250
+
251
+ if (!safeMigrationsResponse.ok) {
252
+ throw new Error(
253
+ `Failed to ${props.safeMigrations ? "enable" : "disable"} safe migrations: ${safeMigrationsResponse.statusText}`,
254
+ );
255
+ }
256
+ }
257
+
258
+ if (props.clusterSize && data.cluster_size !== props.clusterSize) {
259
+ const clusterResponse = await api.patch(
260
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches/${props.name}/cluster`,
261
+ {
262
+ cluster_size: props.clusterSize,
263
+ },
264
+ );
265
+
266
+ if (!clusterResponse.ok) {
267
+ throw new Error(
268
+ `Failed to update cluster size: ${clusterResponse.statusText}`,
269
+ );
270
+ }
271
+ }
272
+
273
+ return this({
274
+ ...props,
275
+ name: props.name,
276
+ parentBranch: currentParentBranch,
277
+ createdAt: data.created_at,
278
+ updatedAt: data.updated_at,
279
+ htmlUrl: data.html_url,
280
+ });
281
+ }
282
+ await waitForDatabaseReady(api, props.organizationId, props.databaseName);
283
+
284
+ // Branch doesn't exist, create it
285
+ const createResponse = await api.post(
286
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches`,
287
+ {
288
+ name: props.name,
289
+ parent_branch: parentBranchName,
290
+ backup_id: props.backupId,
291
+ seed_data: props.seedData,
292
+ cluster_size: props.clusterSize,
293
+ },
294
+ );
295
+
296
+ if (!createResponse.ok) {
297
+ throw new Error(
298
+ `Failed to create branch: ${createResponse.statusText} ${await createResponse.text()}`,
299
+ );
300
+ }
301
+
302
+ const data = await createResponse.json<any>();
303
+
304
+ // Handle safe migrations if specified
305
+ if (props.safeMigrations !== undefined) {
306
+ // We can't change the migrations mode if the database is not ready
307
+ await waitForDatabaseReady(
308
+ api,
309
+ props.organizationId,
310
+ props.databaseName,
311
+ props.name,
312
+ );
313
+ const safeMigrationsResponse = await api[
314
+ props.safeMigrations ? "post" : "delete"
315
+ ](
316
+ `/organizations/${props.organizationId}/databases/${props.databaseName}/branches/${props.name}/safe-migrations`,
317
+ );
318
+
319
+ if (!safeMigrationsResponse.ok) {
320
+ throw new Error(
321
+ `Failed to ${props.safeMigrations ? "enable" : "disable"} safe migrations: ${safeMigrationsResponse.statusText} : ${await safeMigrationsResponse.text()}`,
322
+ );
323
+ }
324
+ }
325
+
326
+ // Handle cluster size update if specified
327
+ if (props.clusterSize) {
328
+ // Wait for database to be ready before modifying cluster size
329
+ await fixClusterSize(
330
+ api,
331
+ props.organizationId,
332
+ props.databaseName,
333
+ props.name,
334
+ props.clusterSize,
335
+ true,
336
+ );
337
+ }
338
+
339
+ return this({
340
+ ...props,
341
+ name: props.name,
342
+ parentBranch: data.parent_branch,
343
+ createdAt: data.created_at,
344
+ updatedAt: data.updated_at,
345
+ htmlUrl: data.html_url,
346
+ });
347
+ } catch (error) {
348
+ console.error("Error managing branch:", error);
349
+ throw error;
350
+ }
351
+ },
352
+ );