alchemy 0.67.0 → 0.68.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 (750) hide show
  1. package/bin/alchemy.js +25563 -26265
  2. package/bin/alchemy.ts +6 -2
  3. package/bin/commands/configure.ts +194 -0
  4. package/bin/commands/login.ts +99 -55
  5. package/bin/commands/logout.ts +66 -0
  6. package/bin/trpc.ts +27 -2
  7. package/lib/apply.d.ts +2 -2
  8. package/lib/apply.d.ts.map +1 -1
  9. package/lib/apply.js +18 -15
  10. package/lib/apply.js.map +1 -1
  11. package/lib/auth.d.ts +72 -0
  12. package/lib/auth.d.ts.map +1 -0
  13. package/lib/auth.js +163 -0
  14. package/lib/auth.js.map +1 -0
  15. package/lib/aws/bucket.d.ts +12 -3
  16. package/lib/aws/bucket.d.ts.map +1 -1
  17. package/lib/aws/bucket.js +2 -2
  18. package/lib/aws/bucket.js.map +1 -1
  19. package/lib/aws/control/resource.d.ts +34 -3
  20. package/lib/aws/control/resource.d.ts.map +1 -1
  21. package/lib/aws/control/resource.js +3 -3
  22. package/lib/aws/control/resource.js.map +1 -1
  23. package/lib/aws/ec2/internet-gateway-attachment.d.ts +1 -2
  24. package/lib/aws/ec2/internet-gateway-attachment.d.ts.map +1 -1
  25. package/lib/aws/ec2/internet-gateway-attachment.js +4 -4
  26. package/lib/aws/ec2/internet-gateway-attachment.js.map +1 -1
  27. package/lib/aws/ec2/internet-gateway.d.ts +1 -2
  28. package/lib/aws/ec2/internet-gateway.d.ts.map +1 -1
  29. package/lib/aws/ec2/internet-gateway.js +2 -2
  30. package/lib/aws/ec2/internet-gateway.js.map +1 -1
  31. package/lib/aws/ec2/nat-gateway.d.ts +1 -2
  32. package/lib/aws/ec2/nat-gateway.d.ts.map +1 -1
  33. package/lib/aws/ec2/nat-gateway.js +2 -2
  34. package/lib/aws/ec2/nat-gateway.js.map +1 -1
  35. package/lib/aws/ec2/route-table-association.d.ts +1 -2
  36. package/lib/aws/ec2/route-table-association.d.ts.map +1 -1
  37. package/lib/aws/ec2/route-table-association.js +2 -2
  38. package/lib/aws/ec2/route-table-association.js.map +1 -1
  39. package/lib/aws/ec2/route-table.d.ts +1 -2
  40. package/lib/aws/ec2/route-table.d.ts.map +1 -1
  41. package/lib/aws/ec2/route-table.js +2 -2
  42. package/lib/aws/ec2/route-table.js.map +1 -1
  43. package/lib/aws/ec2/route.d.ts +1 -2
  44. package/lib/aws/ec2/route.d.ts.map +1 -1
  45. package/lib/aws/ec2/route.js +2 -2
  46. package/lib/aws/ec2/route.js.map +1 -1
  47. package/lib/aws/ec2/security-group-rule.d.ts +1 -2
  48. package/lib/aws/ec2/security-group-rule.d.ts.map +1 -1
  49. package/lib/aws/ec2/security-group-rule.js +2 -2
  50. package/lib/aws/ec2/security-group-rule.js.map +1 -1
  51. package/lib/aws/ec2/security-group.d.ts +1 -2
  52. package/lib/aws/ec2/security-group.d.ts.map +1 -1
  53. package/lib/aws/ec2/security-group.js +2 -2
  54. package/lib/aws/ec2/security-group.js.map +1 -1
  55. package/lib/aws/ec2/subnet.d.ts +1 -2
  56. package/lib/aws/ec2/subnet.d.ts.map +1 -1
  57. package/lib/aws/ec2/subnet.js +2 -2
  58. package/lib/aws/ec2/subnet.js.map +1 -1
  59. package/lib/aws/ec2/vpc.d.ts +1 -2
  60. package/lib/aws/ec2/vpc.d.ts.map +1 -1
  61. package/lib/aws/ec2/vpc.js +2 -2
  62. package/lib/aws/ec2/vpc.js.map +1 -1
  63. package/lib/aws/function.d.ts +116 -3
  64. package/lib/aws/function.d.ts.map +1 -1
  65. package/lib/aws/function.js +2 -2
  66. package/lib/aws/function.js.map +1 -1
  67. package/lib/aws/oidc/github-oidc-provider.d.ts +13 -2
  68. package/lib/aws/oidc/github-oidc-provider.d.ts.map +1 -1
  69. package/lib/aws/oidc/oidc-provider.d.ts +48 -3
  70. package/lib/aws/oidc/oidc-provider.d.ts.map +1 -1
  71. package/lib/aws/oidc/oidc-provider.js +2 -2
  72. package/lib/aws/oidc/oidc-provider.js.map +1 -1
  73. package/lib/aws/policy-attachment.d.ts +2 -3
  74. package/lib/aws/policy-attachment.d.ts.map +1 -1
  75. package/lib/aws/policy-attachment.js +1 -1
  76. package/lib/aws/policy-attachment.js.map +1 -1
  77. package/lib/aws/policy.d.ts +1 -2
  78. package/lib/aws/policy.d.ts.map +1 -1
  79. package/lib/aws/policy.js +4 -4
  80. package/lib/aws/policy.js.map +1 -1
  81. package/lib/aws/queue.d.ts +1 -2
  82. package/lib/aws/queue.d.ts.map +1 -1
  83. package/lib/aws/queue.js +4 -4
  84. package/lib/aws/queue.js.map +1 -1
  85. package/lib/aws/role.d.ts +1 -2
  86. package/lib/aws/role.d.ts.map +1 -1
  87. package/lib/aws/role.js +2 -2
  88. package/lib/aws/role.js.map +1 -1
  89. package/lib/aws/ses.d.ts +1 -2
  90. package/lib/aws/ses.d.ts.map +1 -1
  91. package/lib/aws/ses.js +2 -2
  92. package/lib/aws/ses.js.map +1 -1
  93. package/lib/aws/ssm-parameter.d.ts +1 -2
  94. package/lib/aws/ssm-parameter.d.ts.map +1 -1
  95. package/lib/aws/ssm-parameter.js +2 -2
  96. package/lib/aws/ssm-parameter.js.map +1 -1
  97. package/lib/aws/table.d.ts +1 -2
  98. package/lib/aws/table.d.ts.map +1 -1
  99. package/lib/aws/table.js +2 -2
  100. package/lib/aws/table.js.map +1 -1
  101. package/lib/cloudflare/account-api-token.d.ts +1 -2
  102. package/lib/cloudflare/account-api-token.d.ts.map +1 -1
  103. package/lib/cloudflare/account-api-token.js +2 -2
  104. package/lib/cloudflare/account-api-token.js.map +1 -1
  105. package/lib/cloudflare/ai-gateway.d.ts +1 -2
  106. package/lib/cloudflare/ai-gateway.d.ts.map +1 -1
  107. package/lib/cloudflare/ai-gateway.js +2 -2
  108. package/lib/cloudflare/ai-gateway.js.map +1 -1
  109. package/lib/cloudflare/api-gateway-operation.d.ts +1 -2
  110. package/lib/cloudflare/api-gateway-operation.d.ts.map +1 -1
  111. package/lib/cloudflare/api-gateway-operation.js +2 -2
  112. package/lib/cloudflare/api-gateway-operation.js.map +1 -1
  113. package/lib/cloudflare/api-schema.d.ts +1 -2
  114. package/lib/cloudflare/api-schema.d.ts.map +1 -1
  115. package/lib/cloudflare/api-schema.js +2 -2
  116. package/lib/cloudflare/api-schema.js.map +1 -1
  117. package/lib/cloudflare/api-shield.d.ts +1 -2
  118. package/lib/cloudflare/api-shield.d.ts.map +1 -1
  119. package/lib/cloudflare/api-shield.js +2 -2
  120. package/lib/cloudflare/api-shield.js.map +1 -1
  121. package/lib/cloudflare/api.d.ts +18 -10
  122. package/lib/cloudflare/api.d.ts.map +1 -1
  123. package/lib/cloudflare/api.js +93 -38
  124. package/lib/cloudflare/api.js.map +1 -1
  125. package/lib/cloudflare/assets.d.ts +21 -43
  126. package/lib/cloudflare/assets.d.ts.map +1 -1
  127. package/lib/cloudflare/assets.js +78 -70
  128. package/lib/cloudflare/assets.js.map +1 -1
  129. package/lib/cloudflare/auth.d.ts +91 -17
  130. package/lib/cloudflare/auth.d.ts.map +1 -1
  131. package/lib/cloudflare/auth.js +141 -62
  132. package/lib/cloudflare/auth.js.map +1 -1
  133. package/lib/cloudflare/bound.d.ts +1 -1
  134. package/lib/cloudflare/bound.d.ts.map +1 -1
  135. package/lib/cloudflare/bucket.d.ts +60 -8
  136. package/lib/cloudflare/bucket.d.ts.map +1 -1
  137. package/lib/cloudflare/bucket.js +161 -18
  138. package/lib/cloudflare/bucket.js.map +1 -1
  139. package/lib/cloudflare/bundle/plugin-wasm.js +4 -2
  140. package/lib/cloudflare/bundle/plugin-wasm.js.map +1 -1
  141. package/lib/cloudflare/certificate-pack.d.ts +1 -2
  142. package/lib/cloudflare/certificate-pack.d.ts.map +1 -1
  143. package/lib/cloudflare/certificate-pack.js +4 -4
  144. package/lib/cloudflare/certificate-pack.js.map +1 -1
  145. package/lib/cloudflare/compatibility-date.gen.d.ts +1 -1
  146. package/lib/cloudflare/compatibility-date.gen.js +1 -1
  147. package/lib/cloudflare/container.d.ts +1 -2
  148. package/lib/cloudflare/container.d.ts.map +1 -1
  149. package/lib/cloudflare/container.js +6 -6
  150. package/lib/cloudflare/container.js.map +1 -1
  151. package/lib/cloudflare/custom-domain.d.ts +1 -2
  152. package/lib/cloudflare/custom-domain.d.ts.map +1 -1
  153. package/lib/cloudflare/custom-domain.js +2 -2
  154. package/lib/cloudflare/custom-domain.js.map +1 -1
  155. package/lib/cloudflare/d1-database.d.ts +2 -3
  156. package/lib/cloudflare/d1-database.d.ts.map +1 -1
  157. package/lib/cloudflare/d1-database.js +5 -5
  158. package/lib/cloudflare/d1-database.js.map +1 -1
  159. package/lib/cloudflare/dispatch-namespace.d.ts +2 -3
  160. package/lib/cloudflare/dispatch-namespace.d.ts.map +1 -1
  161. package/lib/cloudflare/dispatch-namespace.js +3 -3
  162. package/lib/cloudflare/dispatch-namespace.js.map +1 -1
  163. package/lib/cloudflare/dns-records.d.ts +1 -2
  164. package/lib/cloudflare/dns-records.d.ts.map +1 -1
  165. package/lib/cloudflare/dns-records.js +4 -4
  166. package/lib/cloudflare/dns-records.js.map +1 -1
  167. package/lib/cloudflare/email-address.d.ts +1 -2
  168. package/lib/cloudflare/email-address.d.ts.map +1 -1
  169. package/lib/cloudflare/email-address.js +6 -6
  170. package/lib/cloudflare/email-address.js.map +1 -1
  171. package/lib/cloudflare/email-catch-all.d.ts +1 -2
  172. package/lib/cloudflare/email-catch-all.d.ts.map +1 -1
  173. package/lib/cloudflare/email-catch-all.js +4 -4
  174. package/lib/cloudflare/email-catch-all.js.map +1 -1
  175. package/lib/cloudflare/email-routing.d.ts +1 -2
  176. package/lib/cloudflare/email-routing.d.ts.map +1 -1
  177. package/lib/cloudflare/email-routing.js +4 -4
  178. package/lib/cloudflare/email-routing.js.map +1 -1
  179. package/lib/cloudflare/email-rule.d.ts +1 -2
  180. package/lib/cloudflare/email-rule.d.ts.map +1 -1
  181. package/lib/cloudflare/email-rule.js +4 -4
  182. package/lib/cloudflare/email-rule.js.map +1 -1
  183. package/lib/cloudflare/hyperdrive.d.ts +1 -2
  184. package/lib/cloudflare/hyperdrive.d.ts.map +1 -1
  185. package/lib/cloudflare/hyperdrive.js +4 -4
  186. package/lib/cloudflare/hyperdrive.js.map +1 -1
  187. package/lib/cloudflare/kv-namespace.d.ts +2 -3
  188. package/lib/cloudflare/kv-namespace.d.ts.map +1 -1
  189. package/lib/cloudflare/kv-namespace.js +5 -5
  190. package/lib/cloudflare/kv-namespace.js.map +1 -1
  191. package/lib/cloudflare/miniflare/delete.js +1 -1
  192. package/lib/cloudflare/miniflare/delete.js.map +1 -1
  193. package/lib/cloudflare/miniflare/miniflare-worker-proxy.d.ts.map +1 -1
  194. package/lib/cloudflare/miniflare/miniflare-worker-proxy.js +2 -7
  195. package/lib/cloudflare/miniflare/miniflare-worker-proxy.js.map +1 -1
  196. package/lib/cloudflare/miniflare/remote-binding-proxy.d.ts.map +1 -1
  197. package/lib/cloudflare/miniflare/remote-binding-proxy.js +15 -4
  198. package/lib/cloudflare/miniflare/remote-binding-proxy.js.map +1 -1
  199. package/lib/cloudflare/permission-groups.d.ts +1 -2
  200. package/lib/cloudflare/permission-groups.d.ts.map +1 -1
  201. package/lib/cloudflare/permission-groups.js +1 -1
  202. package/lib/cloudflare/permission-groups.js.map +1 -1
  203. package/lib/cloudflare/pipeline.d.ts +2 -3
  204. package/lib/cloudflare/pipeline.d.ts.map +1 -1
  205. package/lib/cloudflare/pipeline.js +5 -5
  206. package/lib/cloudflare/pipeline.js.map +1 -1
  207. package/lib/cloudflare/queue-consumer.d.ts +1 -2
  208. package/lib/cloudflare/queue-consumer.d.ts.map +1 -1
  209. package/lib/cloudflare/queue-consumer.js +4 -4
  210. package/lib/cloudflare/queue-consumer.js.map +1 -1
  211. package/lib/cloudflare/queue.d.ts +1 -2
  212. package/lib/cloudflare/queue.d.ts.map +1 -1
  213. package/lib/cloudflare/queue.js +4 -4
  214. package/lib/cloudflare/queue.js.map +1 -1
  215. package/lib/cloudflare/react-router/plugin.d.ts.map +1 -1
  216. package/lib/cloudflare/react-router/plugin.js +13 -0
  217. package/lib/cloudflare/react-router/plugin.js.map +1 -1
  218. package/lib/cloudflare/redirect-rule.d.ts +1 -2
  219. package/lib/cloudflare/redirect-rule.d.ts.map +1 -1
  220. package/lib/cloudflare/redirect-rule.js +4 -4
  221. package/lib/cloudflare/redirect-rule.js.map +1 -1
  222. package/lib/cloudflare/route.d.ts +1 -2
  223. package/lib/cloudflare/route.d.ts.map +1 -1
  224. package/lib/cloudflare/route.js +4 -4
  225. package/lib/cloudflare/route.js.map +1 -1
  226. package/lib/cloudflare/ruleset.d.ts +1 -2
  227. package/lib/cloudflare/ruleset.d.ts.map +1 -1
  228. package/lib/cloudflare/ruleset.js +2 -2
  229. package/lib/cloudflare/ruleset.js.map +1 -1
  230. package/lib/cloudflare/secret.d.ts +2 -3
  231. package/lib/cloudflare/secret.d.ts.map +1 -1
  232. package/lib/cloudflare/secret.js +3 -3
  233. package/lib/cloudflare/secret.js.map +1 -1
  234. package/lib/cloudflare/secrets-store.d.ts +2 -3
  235. package/lib/cloudflare/secrets-store.d.ts.map +1 -1
  236. package/lib/cloudflare/secrets-store.js +3 -3
  237. package/lib/cloudflare/secrets-store.js.map +1 -1
  238. package/lib/cloudflare/tunnel.d.ts +2 -3
  239. package/lib/cloudflare/tunnel.d.ts.map +1 -1
  240. package/lib/cloudflare/tunnel.js +3 -3
  241. package/lib/cloudflare/tunnel.js.map +1 -1
  242. package/lib/cloudflare/user.d.ts +3 -2
  243. package/lib/cloudflare/user.d.ts.map +1 -1
  244. package/lib/cloudflare/user.js +7 -5
  245. package/lib/cloudflare/user.js.map +1 -1
  246. package/lib/cloudflare/vectorize-index.d.ts +2 -3
  247. package/lib/cloudflare/vectorize-index.d.ts.map +1 -1
  248. package/lib/cloudflare/vectorize-index.js +6 -6
  249. package/lib/cloudflare/vectorize-index.js.map +1 -1
  250. package/lib/cloudflare/vectorize-metadata-index.d.ts +2 -3
  251. package/lib/cloudflare/vectorize-metadata-index.d.ts.map +1 -1
  252. package/lib/cloudflare/vectorize-metadata-index.js +4 -4
  253. package/lib/cloudflare/vectorize-metadata-index.js.map +1 -1
  254. package/lib/cloudflare/website.js +1 -1
  255. package/lib/cloudflare/website.js.map +1 -1
  256. package/lib/cloudflare/worker-assets.d.ts +1 -29
  257. package/lib/cloudflare/worker-assets.d.ts.map +1 -1
  258. package/lib/cloudflare/worker-assets.js +9 -42
  259. package/lib/cloudflare/worker-assets.js.map +1 -1
  260. package/lib/cloudflare/worker-stub.d.ts +2 -3
  261. package/lib/cloudflare/worker-stub.d.ts.map +1 -1
  262. package/lib/cloudflare/worker-stub.js +3 -3
  263. package/lib/cloudflare/worker-stub.js.map +1 -1
  264. package/lib/cloudflare/worker-subdomain.d.ts +4 -3
  265. package/lib/cloudflare/worker-subdomain.d.ts.map +1 -1
  266. package/lib/cloudflare/worker-subdomain.js +5 -5
  267. package/lib/cloudflare/worker-subdomain.js.map +1 -1
  268. package/lib/cloudflare/worker.d.ts +3 -4
  269. package/lib/cloudflare/worker.d.ts.map +1 -1
  270. package/lib/cloudflare/worker.js +6 -5
  271. package/lib/cloudflare/worker.js.map +1 -1
  272. package/lib/cloudflare/zone.d.ts +1 -2
  273. package/lib/cloudflare/zone.d.ts.map +1 -1
  274. package/lib/cloudflare/zone.js +2 -2
  275. package/lib/cloudflare/zone.js.map +1 -1
  276. package/lib/context.d.ts +8 -8
  277. package/lib/context.d.ts.map +1 -1
  278. package/lib/context.js.map +1 -1
  279. package/lib/destroy.d.ts +1 -1
  280. package/lib/destroy.d.ts.map +1 -1
  281. package/lib/destroy.js.map +1 -1
  282. package/lib/dns/import-dns.d.ts +1 -2
  283. package/lib/dns/import-dns.d.ts.map +1 -1
  284. package/lib/dns/import-dns.js +2 -2
  285. package/lib/dns/import-dns.js.map +1 -1
  286. package/lib/docker/container.d.ts +1 -2
  287. package/lib/docker/container.d.ts.map +1 -1
  288. package/lib/docker/container.js +2 -3
  289. package/lib/docker/container.js.map +1 -1
  290. package/lib/docker/image.d.ts +1 -2
  291. package/lib/docker/image.d.ts.map +1 -1
  292. package/lib/docker/image.js +9 -9
  293. package/lib/docker/image.js.map +1 -1
  294. package/lib/docker/network.d.ts +1 -2
  295. package/lib/docker/network.d.ts.map +1 -1
  296. package/lib/docker/network.js +2 -3
  297. package/lib/docker/network.js.map +1 -1
  298. package/lib/docker/remote-image.d.ts +1 -2
  299. package/lib/docker/remote-image.d.ts.map +1 -1
  300. package/lib/docker/remote-image.js +2 -3
  301. package/lib/docker/remote-image.js.map +1 -1
  302. package/lib/docker/volume.d.ts +1 -2
  303. package/lib/docker/volume.d.ts.map +1 -1
  304. package/lib/docker/volume.js +2 -3
  305. package/lib/docker/volume.js.map +1 -1
  306. package/lib/esbuild/bundle.d.ts +1 -2
  307. package/lib/esbuild/bundle.d.ts.map +1 -1
  308. package/lib/esbuild/bundle.js +4 -4
  309. package/lib/esbuild/bundle.js.map +1 -1
  310. package/lib/fs/copy-file.d.ts +1 -2
  311. package/lib/fs/copy-file.d.ts.map +1 -1
  312. package/lib/fs/copy-file.js +2 -2
  313. package/lib/fs/copy-file.js.map +1 -1
  314. package/lib/fs/file.d.ts +1 -2
  315. package/lib/fs/file.d.ts.map +1 -1
  316. package/lib/fs/file.js +2 -2
  317. package/lib/fs/file.js.map +1 -1
  318. package/lib/fs/folder.d.ts +1 -2
  319. package/lib/fs/folder.d.ts.map +1 -1
  320. package/lib/fs/folder.js +2 -2
  321. package/lib/fs/folder.js.map +1 -1
  322. package/lib/github/comment.d.ts +1 -2
  323. package/lib/github/comment.d.ts.map +1 -1
  324. package/lib/github/comment.js +4 -4
  325. package/lib/github/comment.js.map +1 -1
  326. package/lib/github/repository-environment.d.ts +1 -2
  327. package/lib/github/repository-environment.d.ts.map +1 -1
  328. package/lib/github/repository-environment.js +2 -2
  329. package/lib/github/repository-environment.js.map +1 -1
  330. package/lib/github/repository-webhook.d.ts +1 -2
  331. package/lib/github/repository-webhook.d.ts.map +1 -1
  332. package/lib/github/repository-webhook.js +2 -2
  333. package/lib/github/repository-webhook.js.map +1 -1
  334. package/lib/github/secret.d.ts +1 -2
  335. package/lib/github/secret.d.ts.map +1 -1
  336. package/lib/github/secret.js +2 -2
  337. package/lib/github/secret.js.map +1 -1
  338. package/lib/neon/api/client.gen.d.ts +13 -0
  339. package/lib/neon/api/client.gen.d.ts.map +1 -0
  340. package/lib/neon/api/client.gen.js +7 -0
  341. package/lib/neon/api/client.gen.js.map +1 -0
  342. package/lib/neon/api/sdk.gen.d.ts +880 -0
  343. package/lib/neon/api/sdk.gen.d.ts.map +1 -0
  344. package/lib/neon/api/sdk.gen.js +1527 -0
  345. package/lib/neon/api/sdk.gen.js.map +1 -0
  346. package/lib/neon/api/types.gen.d.ts +7250 -0
  347. package/lib/neon/api/types.gen.d.ts.map +1 -0
  348. package/lib/neon/api/types.gen.js +2 -0
  349. package/lib/neon/api/types.gen.js.map +1 -0
  350. package/lib/neon/api.d.ts +14 -49
  351. package/lib/neon/api.d.ts.map +1 -1
  352. package/lib/neon/api.js +36 -114
  353. package/lib/neon/api.js.map +1 -1
  354. package/lib/neon/branch.d.ts +141 -0
  355. package/lib/neon/branch.d.ts.map +1 -0
  356. package/lib/neon/branch.js +112 -0
  357. package/lib/neon/branch.js.map +1 -0
  358. package/lib/neon/index.d.ts +1 -1
  359. package/lib/neon/index.d.ts.map +1 -1
  360. package/lib/neon/index.js +1 -1
  361. package/lib/neon/index.js.map +1 -1
  362. package/lib/neon/project.d.ts +32 -242
  363. package/lib/neon/project.d.ts.map +1 -1
  364. package/lib/neon/project.js +90 -269
  365. package/lib/neon/project.js.map +1 -1
  366. package/lib/neon/utils.d.ts +49 -0
  367. package/lib/neon/utils.d.ts.map +1 -0
  368. package/lib/neon/utils.js +44 -0
  369. package/lib/neon/utils.js.map +1 -0
  370. package/lib/os/exec.d.ts +1 -2
  371. package/lib/os/exec.d.ts.map +1 -1
  372. package/lib/os/exec.js +2 -2
  373. package/lib/os/exec.js.map +1 -1
  374. package/lib/planetscale/api/client.gen.d.ts +12 -1749
  375. package/lib/planetscale/api/client.gen.d.ts.map +1 -1
  376. package/lib/planetscale/api/client.gen.js +6 -2400
  377. package/lib/planetscale/api/client.gen.js.map +1 -1
  378. package/lib/planetscale/api/sdk.gen.d.ts +1582 -0
  379. package/lib/planetscale/api/sdk.gen.d.ts.map +1 -0
  380. package/lib/planetscale/api/sdk.gen.js +2219 -0
  381. package/lib/planetscale/api/sdk.gen.js.map +1 -0
  382. package/lib/planetscale/api/types.gen.d.ts +594 -449
  383. package/lib/planetscale/api/types.gen.d.ts.map +1 -1
  384. package/lib/planetscale/api.d.ts +43 -0
  385. package/lib/planetscale/api.d.ts.map +1 -0
  386. package/lib/planetscale/api.js +53 -0
  387. package/lib/planetscale/api.js.map +1 -0
  388. package/lib/planetscale/branch.d.ts +2 -3
  389. package/lib/planetscale/branch.d.ts.map +1 -1
  390. package/lib/planetscale/branch.js +17 -15
  391. package/lib/planetscale/branch.js.map +1 -1
  392. package/lib/planetscale/database.d.ts +2 -3
  393. package/lib/planetscale/database.d.ts.map +1 -1
  394. package/lib/planetscale/database.js +34 -34
  395. package/lib/planetscale/database.js.map +1 -1
  396. package/lib/planetscale/index.d.ts +1 -1
  397. package/lib/planetscale/index.d.ts.map +1 -1
  398. package/lib/planetscale/index.js +1 -1
  399. package/lib/planetscale/index.js.map +1 -1
  400. package/lib/planetscale/password.d.ts +2 -3
  401. package/lib/planetscale/password.d.ts.map +1 -1
  402. package/lib/planetscale/password.js +11 -11
  403. package/lib/planetscale/password.js.map +1 -1
  404. package/lib/planetscale/role.d.ts +2 -3
  405. package/lib/planetscale/role.d.ts.map +1 -1
  406. package/lib/planetscale/role.js +18 -18
  407. package/lib/planetscale/role.js.map +1 -1
  408. package/lib/planetscale/utils.d.ts +1 -1
  409. package/lib/planetscale/utils.d.ts.map +1 -1
  410. package/lib/planetscale/utils.js +17 -33
  411. package/lib/planetscale/utils.js.map +1 -1
  412. package/lib/random/random-string.d.ts +1 -2
  413. package/lib/random/random-string.d.ts.map +1 -1
  414. package/lib/random/random-string.js +3 -3
  415. package/lib/random/random-string.js.map +1 -1
  416. package/lib/resource.d.ts +4 -1
  417. package/lib/resource.d.ts.map +1 -1
  418. package/lib/resource.js.map +1 -1
  419. package/lib/sentry/client-key.d.ts +1 -2
  420. package/lib/sentry/client-key.d.ts.map +1 -1
  421. package/lib/sentry/client-key.js +2 -2
  422. package/lib/sentry/client-key.js.map +1 -1
  423. package/lib/sentry/project.d.ts +1 -2
  424. package/lib/sentry/project.d.ts.map +1 -1
  425. package/lib/sentry/project.js +2 -2
  426. package/lib/sentry/project.js.map +1 -1
  427. package/lib/sentry/team.d.ts +1 -2
  428. package/lib/sentry/team.d.ts.map +1 -1
  429. package/lib/sentry/team.js +2 -2
  430. package/lib/sentry/team.js.map +1 -1
  431. package/lib/state/r2-rest-state-store.d.ts +1 -0
  432. package/lib/state/r2-rest-state-store.d.ts.map +1 -1
  433. package/lib/state/r2-rest-state-store.js +15 -34
  434. package/lib/state/r2-rest-state-store.js.map +1 -1
  435. package/lib/stripe/card.d.ts +1 -2
  436. package/lib/stripe/card.d.ts.map +1 -1
  437. package/lib/stripe/card.js +2 -2
  438. package/lib/stripe/card.js.map +1 -1
  439. package/lib/stripe/coupon.d.ts +1 -2
  440. package/lib/stripe/coupon.d.ts.map +1 -1
  441. package/lib/stripe/coupon.js +2 -2
  442. package/lib/stripe/coupon.js.map +1 -1
  443. package/lib/stripe/customer.d.ts +1 -2
  444. package/lib/stripe/customer.d.ts.map +1 -1
  445. package/lib/stripe/customer.js +2 -2
  446. package/lib/stripe/customer.js.map +1 -1
  447. package/lib/stripe/entitlements-feature.d.ts +1 -2
  448. package/lib/stripe/entitlements-feature.d.ts.map +1 -1
  449. package/lib/stripe/entitlements-feature.js +2 -2
  450. package/lib/stripe/entitlements-feature.js.map +1 -1
  451. package/lib/stripe/file.d.ts +1 -2
  452. package/lib/stripe/file.d.ts.map +1 -1
  453. package/lib/stripe/file.js +2 -2
  454. package/lib/stripe/file.js.map +1 -1
  455. package/lib/stripe/meter.d.ts +1 -2
  456. package/lib/stripe/meter.d.ts.map +1 -1
  457. package/lib/stripe/meter.js +1 -1
  458. package/lib/stripe/meter.js.map +1 -1
  459. package/lib/stripe/portal-configuration.d.ts +1 -2
  460. package/lib/stripe/portal-configuration.d.ts.map +1 -1
  461. package/lib/stripe/portal-configuration.js +2 -2
  462. package/lib/stripe/portal-configuration.js.map +1 -1
  463. package/lib/stripe/price.d.ts +1 -2
  464. package/lib/stripe/price.d.ts.map +1 -1
  465. package/lib/stripe/price.js +2 -2
  466. package/lib/stripe/price.js.map +1 -1
  467. package/lib/stripe/product-feature.d.ts +1 -2
  468. package/lib/stripe/product-feature.d.ts.map +1 -1
  469. package/lib/stripe/product-feature.js +2 -2
  470. package/lib/stripe/product-feature.js.map +1 -1
  471. package/lib/stripe/product.d.ts +1 -2
  472. package/lib/stripe/product.d.ts.map +1 -1
  473. package/lib/stripe/product.js +2 -2
  474. package/lib/stripe/product.js.map +1 -1
  475. package/lib/stripe/promotion-code.d.ts +1 -2
  476. package/lib/stripe/promotion-code.d.ts.map +1 -1
  477. package/lib/stripe/promotion-code.js +2 -2
  478. package/lib/stripe/promotion-code.js.map +1 -1
  479. package/lib/stripe/shipping-rate.d.ts +1 -2
  480. package/lib/stripe/shipping-rate.d.ts.map +1 -1
  481. package/lib/stripe/shipping-rate.js +2 -2
  482. package/lib/stripe/shipping-rate.js.map +1 -1
  483. package/lib/stripe/tax-rate.d.ts +1 -2
  484. package/lib/stripe/tax-rate.d.ts.map +1 -1
  485. package/lib/stripe/tax-rate.js +2 -2
  486. package/lib/stripe/tax-rate.js.map +1 -1
  487. package/lib/stripe/webhook.d.ts +16 -3
  488. package/lib/stripe/webhook.d.ts.map +1 -1
  489. package/lib/stripe/webhook.js +2 -2
  490. package/lib/stripe/webhook.js.map +1 -1
  491. package/lib/test/bun.d.ts.map +1 -1
  492. package/lib/test/bun.js +1 -0
  493. package/lib/test/bun.js.map +1 -1
  494. package/lib/test/options.d.ts +5 -0
  495. package/lib/test/options.d.ts.map +1 -1
  496. package/lib/test/vitest.d.ts.map +1 -1
  497. package/lib/test/vitest.js +1 -0
  498. package/lib/test/vitest.js.map +1 -1
  499. package/lib/upstash/redis.d.ts +1 -2
  500. package/lib/upstash/redis.d.ts.map +1 -1
  501. package/lib/upstash/redis.js.map +1 -1
  502. package/lib/util/api/client/client.gen.d.ts +3 -0
  503. package/lib/util/api/client/client.gen.d.ts.map +1 -0
  504. package/lib/util/api/client/client.gen.js +205 -0
  505. package/lib/util/api/client/client.gen.js.map +1 -0
  506. package/lib/util/api/client/index.d.ts +8 -0
  507. package/lib/util/api/client/index.d.ts.map +1 -0
  508. package/lib/util/api/client/index.js +6 -0
  509. package/lib/util/api/client/index.js.map +1 -0
  510. package/lib/util/api/client/types.gen.d.ts +125 -0
  511. package/lib/util/api/client/types.gen.d.ts.map +1 -0
  512. package/lib/util/api/client/types.gen.js +2 -0
  513. package/lib/util/api/client/types.gen.js.map +1 -0
  514. package/lib/util/api/client/utils.gen.d.ts +34 -0
  515. package/lib/util/api/client/utils.gen.d.ts.map +1 -0
  516. package/lib/util/api/client/utils.gen.js +231 -0
  517. package/lib/util/api/client/utils.gen.js.map +1 -0
  518. package/lib/util/api/core/auth.gen.d.ts +19 -0
  519. package/lib/util/api/core/auth.gen.d.ts.map +1 -0
  520. package/lib/util/api/core/auth.gen.js +15 -0
  521. package/lib/util/api/core/auth.gen.js.map +1 -0
  522. package/lib/util/api/core/bodySerializer.gen.d.ts +18 -0
  523. package/lib/util/api/core/bodySerializer.gen.d.ts.map +1 -0
  524. package/lib/util/api/core/bodySerializer.gen.js +58 -0
  525. package/lib/util/api/core/bodySerializer.gen.js.map +1 -0
  526. package/lib/util/api/core/params.gen.d.ts +34 -0
  527. package/lib/util/api/core/params.gen.d.ts.map +1 -0
  528. package/lib/util/api/core/params.gen.js +89 -0
  529. package/lib/util/api/core/params.gen.js.map +1 -0
  530. package/lib/util/api/core/pathSerializer.gen.d.ts +34 -0
  531. package/lib/util/api/core/pathSerializer.gen.d.ts.map +1 -0
  532. package/lib/util/api/core/pathSerializer.gen.js +115 -0
  533. package/lib/util/api/core/pathSerializer.gen.js.map +1 -0
  534. package/lib/util/api/core/serverSentEvents.gen.d.ts +72 -0
  535. package/lib/util/api/core/serverSentEvents.gen.d.ts.map +1 -0
  536. package/lib/util/api/core/serverSentEvents.gen.js +136 -0
  537. package/lib/util/api/core/serverSentEvents.gen.js.map +1 -0
  538. package/lib/util/api/core/types.gen.d.ts +79 -0
  539. package/lib/util/api/core/types.gen.d.ts.map +1 -0
  540. package/lib/util/api/core/types.gen.js +2 -0
  541. package/lib/util/api/core/types.gen.js.map +1 -0
  542. package/lib/util/api/core/utils.gen.d.ts +20 -0
  543. package/lib/util/api/core/utils.gen.d.ts.map +1 -0
  544. package/lib/util/api/core/utils.gen.js +88 -0
  545. package/lib/util/api/core/utils.gen.js.map +1 -0
  546. package/lib/util/http.d.ts +7 -2
  547. package/lib/util/http.d.ts.map +1 -1
  548. package/lib/util/http.js +29 -11
  549. package/lib/util/http.js.map +1 -1
  550. package/lib/util/lock.d.ts +20 -0
  551. package/lib/util/lock.d.ts.map +1 -0
  552. package/lib/util/lock.js +45 -0
  553. package/lib/util/lock.js.map +1 -0
  554. package/lib/util/memoize.d.ts +6 -0
  555. package/lib/util/memoize.d.ts.map +1 -1
  556. package/lib/util/memoize.js +23 -0
  557. package/lib/util/memoize.js.map +1 -1
  558. package/lib/util/oauth-client.d.ts +71 -0
  559. package/lib/util/oauth-client.d.ts.map +1 -0
  560. package/lib/util/oauth-client.js +188 -0
  561. package/lib/util/oauth-client.js.map +1 -0
  562. package/lib/util/poll.d.ts +33 -0
  563. package/lib/util/poll.d.ts.map +1 -0
  564. package/lib/util/poll.js +19 -0
  565. package/lib/util/poll.js.map +1 -0
  566. package/lib/vercel/project-domain.d.ts +1 -2
  567. package/lib/vercel/project-domain.d.ts.map +1 -1
  568. package/lib/vercel/project-domain.js.map +1 -1
  569. package/lib/vercel/project.d.ts +1 -2
  570. package/lib/vercel/project.d.ts.map +1 -1
  571. package/lib/vercel/project.js +2 -2
  572. package/lib/vercel/project.js.map +1 -1
  573. package/package.json +5 -1
  574. package/src/apply.ts +32 -29
  575. package/src/auth.ts +253 -0
  576. package/src/aws/bucket.ts +3 -3
  577. package/src/aws/control/resource.ts +4 -6
  578. package/src/aws/ec2/internet-gateway-attachment.ts +5 -6
  579. package/src/aws/ec2/internet-gateway.ts +3 -5
  580. package/src/aws/ec2/nat-gateway.ts +3 -5
  581. package/src/aws/ec2/route-table-association.ts +3 -5
  582. package/src/aws/ec2/route-table.ts +3 -5
  583. package/src/aws/ec2/route.ts +3 -3
  584. package/src/aws/ec2/security-group-rule.ts +3 -5
  585. package/src/aws/ec2/security-group.ts +3 -5
  586. package/src/aws/ec2/subnet.ts +3 -3
  587. package/src/aws/ec2/vpc.ts +3 -3
  588. package/src/aws/function.ts +3 -3
  589. package/src/aws/oidc/oidc-provider.ts +3 -5
  590. package/src/aws/policy-attachment.ts +2 -4
  591. package/src/aws/policy.ts +5 -5
  592. package/src/aws/queue.ts +5 -5
  593. package/src/aws/role.ts +3 -3
  594. package/src/aws/ses.ts +3 -3
  595. package/src/aws/ssm-parameter.ts +3 -3
  596. package/src/aws/table.ts +3 -3
  597. package/src/cloudflare/account-api-token.ts +3 -4
  598. package/src/cloudflare/ai-gateway.ts +3 -5
  599. package/src/cloudflare/api-gateway-operation.ts +3 -4
  600. package/src/cloudflare/api-schema.ts +25 -26
  601. package/src/cloudflare/api-shield.ts +3 -4
  602. package/src/cloudflare/api.ts +122 -57
  603. package/src/cloudflare/assets.ts +95 -136
  604. package/src/cloudflare/auth.ts +160 -95
  605. package/src/cloudflare/bound.ts +1 -1
  606. package/src/cloudflare/bucket.ts +321 -58
  607. package/src/cloudflare/bundle/plugin-wasm.ts +5 -5
  608. package/src/cloudflare/certificate-pack.ts +5 -6
  609. package/src/cloudflare/compatibility-date.gen.ts +1 -1
  610. package/src/cloudflare/container.ts +7 -8
  611. package/src/cloudflare/custom-domain.ts +3 -5
  612. package/src/cloudflare/d1-database.ts +33 -34
  613. package/src/cloudflare/dispatch-namespace.ts +5 -6
  614. package/src/cloudflare/dns-records.ts +5 -5
  615. package/src/cloudflare/email-address.ts +7 -7
  616. package/src/cloudflare/email-catch-all.ts +6 -6
  617. package/src/cloudflare/email-routing.ts +5 -5
  618. package/src/cloudflare/email-rule.ts +5 -5
  619. package/src/cloudflare/hyperdrive.ts +35 -36
  620. package/src/cloudflare/kv-namespace.ts +31 -32
  621. package/src/cloudflare/miniflare/delete.ts +1 -1
  622. package/src/cloudflare/miniflare/miniflare-worker-proxy.ts +2 -7
  623. package/src/cloudflare/miniflare/remote-binding-proxy.ts +16 -4
  624. package/src/cloudflare/permission-groups.ts +4 -6
  625. package/src/cloudflare/pipeline.ts +29 -30
  626. package/src/cloudflare/queue-consumer.ts +5 -7
  627. package/src/cloudflare/queue.ts +42 -43
  628. package/src/cloudflare/react-router/plugin.ts +20 -0
  629. package/src/cloudflare/redirect-rule.ts +5 -5
  630. package/src/cloudflare/route.ts +5 -5
  631. package/src/cloudflare/ruleset.ts +3 -4
  632. package/src/cloudflare/secret.ts +35 -36
  633. package/src/cloudflare/secrets-store.ts +5 -8
  634. package/src/cloudflare/tunnel.ts +5 -7
  635. package/src/cloudflare/user.ts +12 -9
  636. package/src/cloudflare/vectorize-index.ts +8 -12
  637. package/src/cloudflare/vectorize-metadata-index.ts +6 -8
  638. package/src/cloudflare/website.ts +1 -1
  639. package/src/cloudflare/worker-assets.ts +10 -56
  640. package/src/cloudflare/worker-stub.ts +5 -5
  641. package/src/cloudflare/worker-subdomain.ts +6 -7
  642. package/src/cloudflare/worker.ts +91 -91
  643. package/src/cloudflare/zone.ts +3 -3
  644. package/src/context.ts +9 -7
  645. package/src/destroy.ts +2 -2
  646. package/src/dns/import-dns.ts +3 -5
  647. package/src/docker/container.ts +3 -6
  648. package/src/docker/image.ts +13 -13
  649. package/src/docker/network.ts +3 -4
  650. package/src/docker/remote-image.ts +3 -6
  651. package/src/docker/volume.ts +3 -4
  652. package/src/esbuild/bundle.ts +10 -8
  653. package/src/fs/copy-file.ts +3 -3
  654. package/src/fs/file.ts +3 -3
  655. package/src/fs/folder.ts +3 -3
  656. package/src/github/comment.ts +5 -7
  657. package/src/github/repository-environment.ts +3 -5
  658. package/src/github/repository-webhook.ts +3 -5
  659. package/src/github/secret.ts +3 -5
  660. package/src/neon/api/client.gen.ts +28 -0
  661. package/src/neon/api/sdk.gen.ts +2596 -0
  662. package/src/neon/api/types.gen.ts +8287 -0
  663. package/src/neon/api.ts +51 -147
  664. package/src/neon/branch.ts +278 -0
  665. package/src/neon/index.ts +1 -1
  666. package/src/neon/project.ts +136 -721
  667. package/src/neon/utils.ts +105 -0
  668. package/src/os/exec.ts +3 -3
  669. package/src/planetscale/api/client.gen.ts +28 -2882
  670. package/src/planetscale/api/sdk.gen.ts +3336 -0
  671. package/src/planetscale/api/types.gen.ts +778 -450
  672. package/src/planetscale/api.ts +101 -0
  673. package/src/planetscale/branch.ts +20 -19
  674. package/src/planetscale/database.ts +69 -70
  675. package/src/planetscale/index.ts +1 -1
  676. package/src/planetscale/password.ts +18 -22
  677. package/src/planetscale/role.ts +21 -21
  678. package/src/planetscale/utils.ts +20 -74
  679. package/src/random/random-string.ts +4 -4
  680. package/src/resource.ts +6 -2
  681. package/src/sentry/client-key.ts +3 -5
  682. package/src/sentry/project.ts +3 -5
  683. package/src/sentry/team.ts +3 -3
  684. package/src/state/r2-rest-state-store.ts +15 -57
  685. package/src/stripe/card.ts +3 -3
  686. package/src/stripe/coupon.ts +3 -3
  687. package/src/stripe/customer.ts +3 -3
  688. package/src/stripe/entitlements-feature.ts +3 -5
  689. package/src/stripe/file.ts +3 -3
  690. package/src/stripe/meter.ts +3 -3
  691. package/src/stripe/portal-configuration.ts +3 -5
  692. package/src/stripe/price.ts +3 -3
  693. package/src/stripe/product-feature.ts +3 -5
  694. package/src/stripe/product.ts +3 -3
  695. package/src/stripe/promotion-code.ts +3 -5
  696. package/src/stripe/shipping-rate.ts +3 -5
  697. package/src/stripe/tax-rate.ts +3 -3
  698. package/src/stripe/webhook.ts +3 -5
  699. package/src/test/bun.ts +1 -0
  700. package/src/test/options.ts +6 -0
  701. package/src/test/vitest.ts +1 -0
  702. package/src/upstash/redis.ts +1 -3
  703. package/src/util/api/client/client.gen.ts +268 -0
  704. package/src/util/api/client/index.ts +25 -0
  705. package/src/util/api/client/types.gen.ts +268 -0
  706. package/src/util/api/client/utils.gen.ts +331 -0
  707. package/src/util/api/core/auth.gen.ts +42 -0
  708. package/src/util/api/core/bodySerializer.gen.ts +92 -0
  709. package/src/util/api/core/params.gen.ts +153 -0
  710. package/src/util/api/core/pathSerializer.gen.ts +181 -0
  711. package/src/util/api/core/serverSentEvents.gen.ts +264 -0
  712. package/src/util/api/core/types.gen.ts +118 -0
  713. package/src/util/api/core/utils.gen.ts +143 -0
  714. package/src/util/http.ts +38 -11
  715. package/src/util/lock.ts +48 -0
  716. package/src/util/memoize.ts +26 -0
  717. package/src/util/oauth-client.ts +238 -0
  718. package/src/util/poll.ts +55 -0
  719. package/src/vercel/project-domain.ts +1 -3
  720. package/src/vercel/project.ts +3 -3
  721. package/workers/cloudflare-state-store.js +8 -5619
  722. package/workers/dofs-state-store.js +2 -802
  723. package/workers/remote-binding-proxy.js +3 -39
  724. package/workers/remote-binding-proxy.ts +126 -35
  725. package/workers/tunnel-proxy.js +6 -73
  726. package/lib/cloudflare/asset-manifest.d.ts +0 -15
  727. package/lib/cloudflare/asset-manifest.d.ts.map +0 -1
  728. package/lib/cloudflare/asset-manifest.js +0 -1
  729. package/lib/cloudflare/asset-manifest.js.map +0 -1
  730. package/lib/cloudflare/oauth.d.ts +0 -22
  731. package/lib/cloudflare/oauth.d.ts.map +0 -1
  732. package/lib/cloudflare/oauth.js +0 -214
  733. package/lib/cloudflare/oauth.js.map +0 -1
  734. package/lib/neon/api-error.d.ts +0 -31
  735. package/lib/neon/api-error.d.ts.map +0 -1
  736. package/lib/neon/api-error.js +0 -73
  737. package/lib/neon/api-error.js.map +0 -1
  738. package/lib/planetscale/api/index.d.ts +0 -3
  739. package/lib/planetscale/api/index.d.ts.map +0 -1
  740. package/lib/planetscale/api/index.js +0 -4
  741. package/lib/planetscale/api/index.js.map +0 -1
  742. package/lib/util/neverthrow.d.ts +0 -16
  743. package/lib/util/neverthrow.d.ts.map +0 -1
  744. package/lib/util/neverthrow.js +0 -46
  745. package/lib/util/neverthrow.js.map +0 -1
  746. package/src/cloudflare/asset-manifest.ts +0 -16
  747. package/src/cloudflare/oauth.ts +0 -301
  748. package/src/neon/api-error.ts +0 -81
  749. package/src/planetscale/api/index.ts +0 -4
  750. package/src/util/neverthrow.ts +0 -64
@@ -0,0 +1,2596 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type {
4
+ Client,
5
+ Options as Options2,
6
+ TDataShape,
7
+ } from "../../util/api/client/index.ts";
8
+ import { client } from "./client.gen.ts";
9
+ import type {
10
+ AcceptProjectTransferRequestData,
11
+ AcceptProjectTransferRequestErrors,
12
+ AcceptProjectTransferRequestResponses,
13
+ AddNeonAuthDomainToRedirectUriWhitelistData,
14
+ AddNeonAuthDomainToRedirectUriWhitelistErrors,
15
+ AddNeonAuthDomainToRedirectUriWhitelistResponses,
16
+ AddNeonAuthOauthProviderData,
17
+ AddNeonAuthOauthProviderErrors,
18
+ AddNeonAuthOauthProviderResponses,
19
+ AddProjectJwksData,
20
+ AddProjectJwksErrors,
21
+ AddProjectJwksResponses,
22
+ AssignOrganizationVpcEndpointData,
23
+ AssignOrganizationVpcEndpointErrors,
24
+ AssignOrganizationVpcEndpointResponses,
25
+ AssignProjectVpcEndpointData,
26
+ AssignProjectVpcEndpointErrors,
27
+ AssignProjectVpcEndpointResponses,
28
+ CountProjectBranchesData,
29
+ CountProjectBranchesErrors,
30
+ CountProjectBranchesResponses,
31
+ CreateApiKeyData,
32
+ CreateApiKeyErrors,
33
+ CreateApiKeyResponses,
34
+ CreateNeonAuthIntegrationData,
35
+ CreateNeonAuthIntegrationErrors,
36
+ CreateNeonAuthIntegrationResponses,
37
+ CreateNeonAuthNewUserData,
38
+ CreateNeonAuthNewUserErrors,
39
+ CreateNeonAuthNewUserResponses,
40
+ CreateNeonAuthProviderSdkKeysData,
41
+ CreateNeonAuthProviderSdkKeysErrors,
42
+ CreateNeonAuthProviderSdkKeysResponses,
43
+ CreateOrganizationInvitationsData,
44
+ CreateOrganizationInvitationsErrors,
45
+ CreateOrganizationInvitationsResponses,
46
+ CreateOrgApiKeyData,
47
+ CreateOrgApiKeyErrors,
48
+ CreateOrgApiKeyResponses,
49
+ CreateProjectBranchData,
50
+ CreateProjectBranchDataApiData,
51
+ CreateProjectBranchDataApiErrors,
52
+ CreateProjectBranchDataApiResponses,
53
+ CreateProjectBranchDatabaseData,
54
+ CreateProjectBranchDatabaseErrors,
55
+ CreateProjectBranchDatabaseResponses,
56
+ CreateProjectBranchErrors,
57
+ CreateProjectBranchResponses,
58
+ CreateProjectBranchRoleData,
59
+ CreateProjectBranchRoleErrors,
60
+ CreateProjectBranchRoleResponses,
61
+ CreateProjectData,
62
+ CreateProjectEndpointData,
63
+ CreateProjectEndpointErrors,
64
+ CreateProjectEndpointResponses,
65
+ CreateProjectErrors,
66
+ CreateProjectResponses,
67
+ CreateProjectTransferRequestData,
68
+ CreateProjectTransferRequestErrors,
69
+ CreateProjectTransferRequestResponses,
70
+ CreateSnapshotData,
71
+ CreateSnapshotErrors,
72
+ CreateSnapshotResponses,
73
+ DeleteNeonAuthDomainFromRedirectUriWhitelistData,
74
+ DeleteNeonAuthDomainFromRedirectUriWhitelistErrors,
75
+ DeleteNeonAuthDomainFromRedirectUriWhitelistResponses,
76
+ DeleteNeonAuthIntegrationData,
77
+ DeleteNeonAuthIntegrationErrors,
78
+ DeleteNeonAuthIntegrationResponses,
79
+ DeleteNeonAuthOauthProviderData,
80
+ DeleteNeonAuthOauthProviderErrors,
81
+ DeleteNeonAuthOauthProviderResponses,
82
+ DeleteNeonAuthUserData,
83
+ DeleteNeonAuthUserErrors,
84
+ DeleteNeonAuthUserResponses,
85
+ DeleteOrganizationVpcEndpointData,
86
+ DeleteOrganizationVpcEndpointErrors,
87
+ DeleteOrganizationVpcEndpointResponses,
88
+ DeleteProjectBranchData,
89
+ DeleteProjectBranchDataApiData,
90
+ DeleteProjectBranchDataApiErrors,
91
+ DeleteProjectBranchDataApiResponses,
92
+ DeleteProjectBranchDatabaseData,
93
+ DeleteProjectBranchDatabaseErrors,
94
+ DeleteProjectBranchDatabaseResponses,
95
+ DeleteProjectBranchErrors,
96
+ DeleteProjectBranchResponses,
97
+ DeleteProjectBranchRoleData,
98
+ DeleteProjectBranchRoleErrors,
99
+ DeleteProjectBranchRoleResponses,
100
+ DeleteProjectData,
101
+ DeleteProjectEndpointData,
102
+ DeleteProjectEndpointErrors,
103
+ DeleteProjectEndpointResponses,
104
+ DeleteProjectErrors,
105
+ DeleteProjectJwksData,
106
+ DeleteProjectJwksErrors,
107
+ DeleteProjectJwksResponses,
108
+ DeleteProjectResponses,
109
+ DeleteProjectVpcEndpointData,
110
+ DeleteProjectVpcEndpointErrors,
111
+ DeleteProjectVpcEndpointResponses,
112
+ DeleteSnapshotData,
113
+ DeleteSnapshotErrors,
114
+ DeleteSnapshotResponses,
115
+ FinalizeRestoreBranchData,
116
+ FinalizeRestoreBranchErrors,
117
+ FinalizeRestoreBranchResponses,
118
+ GetActiveRegionsData,
119
+ GetActiveRegionsErrors,
120
+ GetActiveRegionsResponses,
121
+ GetAuthDetailsData,
122
+ GetAuthDetailsErrors,
123
+ GetAuthDetailsResponses,
124
+ GetAvailablePreloadLibrariesData,
125
+ GetAvailablePreloadLibrariesErrors,
126
+ GetAvailablePreloadLibrariesResponses,
127
+ GetConnectionUriData,
128
+ GetConnectionUriErrors,
129
+ GetConnectionUriResponses,
130
+ GetConsumptionHistoryPerAccountData,
131
+ GetConsumptionHistoryPerAccountErrors,
132
+ GetConsumptionHistoryPerAccountResponses,
133
+ GetConsumptionHistoryPerProjectData,
134
+ GetConsumptionHistoryPerProjectErrors,
135
+ GetConsumptionHistoryPerProjectResponses,
136
+ GetCurrentUserInfoData,
137
+ GetCurrentUserInfoErrors,
138
+ GetCurrentUserInfoResponses,
139
+ GetCurrentUserOrganizationsData,
140
+ GetCurrentUserOrganizationsErrors,
141
+ GetCurrentUserOrganizationsResponses,
142
+ GetNeonAuthEmailServerData,
143
+ GetNeonAuthEmailServerErrors,
144
+ GetNeonAuthEmailServerResponses,
145
+ GetOrganizationData,
146
+ GetOrganizationErrors,
147
+ GetOrganizationInvitationsData,
148
+ GetOrganizationInvitationsErrors,
149
+ GetOrganizationInvitationsResponses,
150
+ GetOrganizationMemberData,
151
+ GetOrganizationMemberErrors,
152
+ GetOrganizationMemberResponses,
153
+ GetOrganizationMembersData,
154
+ GetOrganizationMembersErrors,
155
+ GetOrganizationMembersResponses,
156
+ GetOrganizationResponses,
157
+ GetOrganizationVpcEndpointDetailsData,
158
+ GetOrganizationVpcEndpointDetailsErrors,
159
+ GetOrganizationVpcEndpointDetailsResponses,
160
+ GetProjectBranchData,
161
+ GetProjectBranchDataApiData,
162
+ GetProjectBranchDataApiErrors,
163
+ GetProjectBranchDataApiResponses,
164
+ GetProjectBranchDatabaseData,
165
+ GetProjectBranchDatabaseErrors,
166
+ GetProjectBranchDatabaseResponses,
167
+ GetProjectBranchErrors,
168
+ GetProjectBranchResponses,
169
+ GetProjectBranchRoleData,
170
+ GetProjectBranchRoleErrors,
171
+ GetProjectBranchRolePasswordData,
172
+ GetProjectBranchRolePasswordErrors,
173
+ GetProjectBranchRolePasswordResponses,
174
+ GetProjectBranchRoleResponses,
175
+ GetProjectBranchSchemaComparisonData,
176
+ GetProjectBranchSchemaComparisonErrors,
177
+ GetProjectBranchSchemaComparisonResponses,
178
+ GetProjectBranchSchemaData,
179
+ GetProjectBranchSchemaErrors,
180
+ GetProjectBranchSchemaResponses,
181
+ GetProjectData,
182
+ GetProjectEndpointData,
183
+ GetProjectEndpointErrors,
184
+ GetProjectEndpointResponses,
185
+ GetProjectErrors,
186
+ GetProjectJwksData,
187
+ GetProjectJwksErrors,
188
+ GetProjectJwksResponses,
189
+ GetProjectOperationData,
190
+ GetProjectOperationErrors,
191
+ GetProjectOperationResponses,
192
+ GetProjectResponses,
193
+ GrantPermissionToProjectData,
194
+ GrantPermissionToProjectErrors,
195
+ GrantPermissionToProjectResponses,
196
+ ListApiKeysData,
197
+ ListApiKeysErrors,
198
+ ListApiKeysResponses,
199
+ ListNeonAuthIntegrationsData,
200
+ ListNeonAuthIntegrationsErrors,
201
+ ListNeonAuthIntegrationsResponses,
202
+ ListNeonAuthOauthProvidersData,
203
+ ListNeonAuthOauthProvidersErrors,
204
+ ListNeonAuthOauthProvidersResponses,
205
+ ListNeonAuthRedirectUriWhitelistDomainsData,
206
+ ListNeonAuthRedirectUriWhitelistDomainsErrors,
207
+ ListNeonAuthRedirectUriWhitelistDomainsResponses,
208
+ ListOrganizationVpcEndpointsAllRegionsData,
209
+ ListOrganizationVpcEndpointsAllRegionsErrors,
210
+ ListOrganizationVpcEndpointsAllRegionsResponses,
211
+ ListOrganizationVpcEndpointsData,
212
+ ListOrganizationVpcEndpointsErrors,
213
+ ListOrganizationVpcEndpointsResponses,
214
+ ListOrgApiKeysData,
215
+ ListOrgApiKeysErrors,
216
+ ListOrgApiKeysResponses,
217
+ ListProjectBranchDatabasesData,
218
+ ListProjectBranchDatabasesErrors,
219
+ ListProjectBranchDatabasesResponses,
220
+ ListProjectBranchEndpointsData,
221
+ ListProjectBranchEndpointsErrors,
222
+ ListProjectBranchEndpointsResponses,
223
+ ListProjectBranchesData,
224
+ ListProjectBranchesErrors,
225
+ ListProjectBranchesResponses,
226
+ ListProjectBranchRolesData,
227
+ ListProjectBranchRolesErrors,
228
+ ListProjectBranchRolesResponses,
229
+ ListProjectEndpointsData,
230
+ ListProjectEndpointsErrors,
231
+ ListProjectEndpointsResponses,
232
+ ListProjectOperationsData,
233
+ ListProjectOperationsErrors,
234
+ ListProjectOperationsResponses,
235
+ ListProjectPermissionsData,
236
+ ListProjectPermissionsErrors,
237
+ ListProjectPermissionsResponses,
238
+ ListProjectsData,
239
+ ListProjectsErrors,
240
+ ListProjectsResponses,
241
+ ListProjectVpcEndpointsData,
242
+ ListProjectVpcEndpointsErrors,
243
+ ListProjectVpcEndpointsResponses,
244
+ ListSharedProjectsData,
245
+ ListSharedProjectsErrors,
246
+ ListSharedProjectsResponses,
247
+ ListSnapshotsData,
248
+ ListSnapshotsErrors,
249
+ ListSnapshotsResponses,
250
+ RefreshSchemaCacheDataApiData,
251
+ RefreshSchemaCacheDataApiErrors,
252
+ RefreshSchemaCacheDataApiResponses,
253
+ RemoveOrganizationMemberData,
254
+ RemoveOrganizationMemberErrors,
255
+ RemoveOrganizationMemberResponses,
256
+ ResetProjectBranchRolePasswordData,
257
+ ResetProjectBranchRolePasswordErrors,
258
+ ResetProjectBranchRolePasswordResponses,
259
+ RestartProjectEndpointData,
260
+ RestartProjectEndpointErrors,
261
+ RestartProjectEndpointResponses,
262
+ RestoreProjectBranchData,
263
+ RestoreProjectBranchErrors,
264
+ RestoreProjectBranchResponses,
265
+ RestoreSnapshotData,
266
+ RestoreSnapshotErrors,
267
+ RestoreSnapshotResponses,
268
+ RevokeApiKeyData,
269
+ RevokeApiKeyErrors,
270
+ RevokeApiKeyResponses,
271
+ RevokeOrgApiKeyData,
272
+ RevokeOrgApiKeyErrors,
273
+ RevokeOrgApiKeyResponses,
274
+ RevokePermissionFromProjectData,
275
+ RevokePermissionFromProjectErrors,
276
+ RevokePermissionFromProjectResponses,
277
+ SetDefaultProjectBranchData,
278
+ SetDefaultProjectBranchErrors,
279
+ SetDefaultProjectBranchResponses,
280
+ StartProjectEndpointData,
281
+ StartProjectEndpointErrors,
282
+ StartProjectEndpointResponses,
283
+ SuspendProjectEndpointData,
284
+ SuspendProjectEndpointErrors,
285
+ SuspendProjectEndpointResponses,
286
+ TransferNeonAuthProviderProjectData,
287
+ TransferNeonAuthProviderProjectErrors,
288
+ TransferNeonAuthProviderProjectResponses,
289
+ TransferProjectsFromOrgToOrgData,
290
+ TransferProjectsFromOrgToOrgErrors,
291
+ TransferProjectsFromOrgToOrgResponses,
292
+ TransferProjectsFromUserToOrgData,
293
+ TransferProjectsFromUserToOrgErrors,
294
+ TransferProjectsFromUserToOrgResponses,
295
+ UpdateNeonAuthEmailServerData,
296
+ UpdateNeonAuthEmailServerErrors,
297
+ UpdateNeonAuthEmailServerResponses,
298
+ UpdateNeonAuthOauthProviderData,
299
+ UpdateNeonAuthOauthProviderErrors,
300
+ UpdateNeonAuthOauthProviderResponses,
301
+ UpdateOrganizationMemberData,
302
+ UpdateOrganizationMemberErrors,
303
+ UpdateOrganizationMemberResponses,
304
+ UpdateProjectBranchData,
305
+ UpdateProjectBranchDatabaseData,
306
+ UpdateProjectBranchDatabaseErrors,
307
+ UpdateProjectBranchDatabaseResponses,
308
+ UpdateProjectBranchErrors,
309
+ UpdateProjectBranchResponses,
310
+ UpdateProjectData,
311
+ UpdateProjectEndpointData,
312
+ UpdateProjectEndpointErrors,
313
+ UpdateProjectEndpointResponses,
314
+ UpdateProjectErrors,
315
+ UpdateProjectResponses,
316
+ UpdateSnapshotData,
317
+ UpdateSnapshotErrors,
318
+ UpdateSnapshotResponses,
319
+ } from "./types.gen.ts";
320
+
321
+ export type Options<
322
+ TData extends TDataShape = TDataShape,
323
+ ThrowOnError extends boolean = boolean,
324
+ > = Options2<TData, ThrowOnError> & {
325
+ /**
326
+ * You can provide a client instance returned by `createClient()` instead of
327
+ * individual options. This might be also useful if you want to implement a
328
+ * custom client.
329
+ */
330
+ client?: Client;
331
+ /**
332
+ * You can pass arbitrary values through the `meta` object. This can be
333
+ * used to access values that aren't defined as part of the SDK function.
334
+ */
335
+ meta?: Record<string, unknown>;
336
+ };
337
+
338
+ class _HeyApiClient {
339
+ protected _client: Client = client;
340
+
341
+ constructor(args?: {
342
+ client?: Client;
343
+ }) {
344
+ if (args?.client) {
345
+ this._client = args.client;
346
+ }
347
+ }
348
+ }
349
+
350
+ export class NeonClient extends _HeyApiClient {
351
+ /**
352
+ * List API keys
353
+ * Retrieves the API keys for your Neon account.
354
+ * The response does not include API key tokens. A token is only provided when creating an API key.
355
+ * API keys can also be managed in the Neon Console.
356
+ * For more information, see [Manage API keys](https://neon.tech/docs/manage/api-keys/).
357
+ *
358
+ */
359
+ public listApiKeys<ThrowOnError extends boolean = true>(
360
+ options?: Options<ListApiKeysData, ThrowOnError>,
361
+ ) {
362
+ return (options?.client ?? this._client).get<
363
+ ListApiKeysResponses,
364
+ ListApiKeysErrors,
365
+ ThrowOnError
366
+ >({
367
+ url: "/api_keys",
368
+ ...options,
369
+ });
370
+ }
371
+
372
+ /**
373
+ * Create API key
374
+ * Creates an API key.
375
+ * The `key_name` is a user-specified name for the key.
376
+ * This method returns an `id` and `key`. The `key` is a randomly generated, 64-bit token required to access the Neon API.
377
+ * API keys can also be managed in the Neon Console.
378
+ * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
379
+ *
380
+ */
381
+ public createApiKey<ThrowOnError extends boolean = true>(
382
+ options: Options<CreateApiKeyData, ThrowOnError>,
383
+ ) {
384
+ return (options.client ?? this._client).post<
385
+ CreateApiKeyResponses,
386
+ CreateApiKeyErrors,
387
+ ThrowOnError
388
+ >({
389
+ url: "/api_keys",
390
+ ...options,
391
+ headers: {
392
+ "Content-Type": "application/json",
393
+ ...options.headers,
394
+ },
395
+ });
396
+ }
397
+
398
+ /**
399
+ * Revoke API key
400
+ * Revokes the specified API key.
401
+ * An API key that is no longer needed can be revoked.
402
+ * This action cannot be reversed.
403
+ * You can obtain `key_id` values by listing the API keys for your Neon account.
404
+ * API keys can also be managed in the Neon Console.
405
+ * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
406
+ *
407
+ */
408
+ public revokeApiKey<ThrowOnError extends boolean = true>(
409
+ options: Options<RevokeApiKeyData, ThrowOnError>,
410
+ ) {
411
+ return (options.client ?? this._client).delete<
412
+ RevokeApiKeyResponses,
413
+ RevokeApiKeyErrors,
414
+ ThrowOnError
415
+ >({
416
+ url: "/api_keys/{key_id}",
417
+ ...options,
418
+ });
419
+ }
420
+
421
+ /**
422
+ * Retrieve operation details
423
+ * Retrieves details for the specified operation.
424
+ * An operation is an action performed on a Neon project resource.
425
+ * You can obtain a `project_id` by listing the projects for your Neon account.
426
+ * You can obtain a `operation_id` by listing operations for the project.
427
+ *
428
+ */
429
+ public getProjectOperation<ThrowOnError extends boolean = true>(
430
+ options: Options<GetProjectOperationData, ThrowOnError>,
431
+ ) {
432
+ return (options.client ?? this._client).get<
433
+ GetProjectOperationResponses,
434
+ GetProjectOperationErrors,
435
+ ThrowOnError
436
+ >({
437
+ url: "/projects/{project_id}/operations/{operation_id}",
438
+ ...options,
439
+ });
440
+ }
441
+
442
+ /**
443
+ * List projects
444
+ * Retrieves a list of projects for an organization.
445
+ * You may need to specify an org_id parameter depending on your API key type.
446
+ * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
447
+ *
448
+ */
449
+ public listProjects<ThrowOnError extends boolean = true>(
450
+ options?: Options<ListProjectsData, ThrowOnError>,
451
+ ) {
452
+ return (options?.client ?? this._client).get<
453
+ ListProjectsResponses,
454
+ ListProjectsErrors,
455
+ ThrowOnError
456
+ >({
457
+ url: "/projects",
458
+ ...options,
459
+ });
460
+ }
461
+
462
+ /**
463
+ * Create project
464
+ * Creates a Neon project within an organization.
465
+ * You may need to specify an org_id parameter depending on your API key type.
466
+ * Plan limits define how many projects you can create.
467
+ * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
468
+ *
469
+ * You can specify a region and Postgres version in the request body.
470
+ * Neon currently supports PostgreSQL 14, 15, 16, and 17.
471
+ * For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
472
+ *
473
+ */
474
+ public createProject<ThrowOnError extends boolean = true>(
475
+ options: Options<CreateProjectData, ThrowOnError>,
476
+ ) {
477
+ return (options.client ?? this._client).post<
478
+ CreateProjectResponses,
479
+ CreateProjectErrors,
480
+ ThrowOnError
481
+ >({
482
+ url: "/projects",
483
+ ...options,
484
+ headers: {
485
+ "Content-Type": "application/json",
486
+ ...options.headers,
487
+ },
488
+ });
489
+ }
490
+
491
+ /**
492
+ * List shared projects
493
+ * Retrieves a list of projects shared with your Neon account.
494
+ * For more information, see [Manage projects](https://neon.tech/docs/manage/projects/).
495
+ *
496
+ */
497
+ public listSharedProjects<ThrowOnError extends boolean = true>(
498
+ options?: Options<ListSharedProjectsData, ThrowOnError>,
499
+ ) {
500
+ return (options?.client ?? this._client).get<
501
+ ListSharedProjectsResponses,
502
+ ListSharedProjectsErrors,
503
+ ThrowOnError
504
+ >({
505
+ url: "/projects/shared",
506
+ ...options,
507
+ });
508
+ }
509
+
510
+ /**
511
+ * Delete project
512
+ * Deletes the specified project.
513
+ * You can obtain a `project_id` by listing the projects for your Neon account.
514
+ * Deleting a project is a permanent action.
515
+ * Deleting a project also deletes endpoints, branches, databases, and users that belong to the project.
516
+ *
517
+ */
518
+ public deleteProject<ThrowOnError extends boolean = true>(
519
+ options: Options<DeleteProjectData, ThrowOnError>,
520
+ ) {
521
+ return (options.client ?? this._client).delete<
522
+ DeleteProjectResponses,
523
+ DeleteProjectErrors,
524
+ ThrowOnError
525
+ >({
526
+ url: "/projects/{project_id}",
527
+ ...options,
528
+ });
529
+ }
530
+
531
+ /**
532
+ * Retrieve project details
533
+ * Retrieves information about the specified project.
534
+ * You can obtain a `project_id` by listing the projects for an organization.
535
+ *
536
+ */
537
+ public getProject<ThrowOnError extends boolean = true>(
538
+ options: Options<GetProjectData, ThrowOnError>,
539
+ ) {
540
+ return (options.client ?? this._client).get<
541
+ GetProjectResponses,
542
+ GetProjectErrors,
543
+ ThrowOnError
544
+ >({
545
+ url: "/projects/{project_id}",
546
+ ...options,
547
+ });
548
+ }
549
+
550
+ /**
551
+ * Update project
552
+ * Updates the specified project.
553
+ * You can obtain a `project_id` by listing the projects for your Neon account.
554
+ *
555
+ */
556
+ public updateProject<ThrowOnError extends boolean = true>(
557
+ options: Options<UpdateProjectData, ThrowOnError>,
558
+ ) {
559
+ return (options.client ?? this._client).patch<
560
+ UpdateProjectResponses,
561
+ UpdateProjectErrors,
562
+ ThrowOnError
563
+ >({
564
+ url: "/projects/{project_id}",
565
+ ...options,
566
+ headers: {
567
+ "Content-Type": "application/json",
568
+ ...options.headers,
569
+ },
570
+ });
571
+ }
572
+
573
+ /**
574
+ * List operations
575
+ * Retrieves a list of operations for the specified Neon project.
576
+ * You can obtain a `project_id` by listing the projects for your Neon account.
577
+ * The number of operations returned can be large.
578
+ * To paginate the response, issue an initial request with a `limit` value.
579
+ * Then, add the `cursor` value that was returned in the response to the next request.
580
+ * Operations older than 6 months may be deleted from our systems.
581
+ * If you need more history than that, you should store your own history.
582
+ *
583
+ */
584
+ public listProjectOperations<ThrowOnError extends boolean = true>(
585
+ options: Options<ListProjectOperationsData, ThrowOnError>,
586
+ ) {
587
+ return (options.client ?? this._client).get<
588
+ ListProjectOperationsResponses,
589
+ ListProjectOperationsErrors,
590
+ ThrowOnError
591
+ >({
592
+ url: "/projects/{project_id}/operations",
593
+ ...options,
594
+ });
595
+ }
596
+
597
+ /**
598
+ * List project access
599
+ * Retrieves details about users who have access to the project, including the permission `id`, the granted-to email address, and the date project access was granted.
600
+ */
601
+ public listProjectPermissions<ThrowOnError extends boolean = true>(
602
+ options: Options<ListProjectPermissionsData, ThrowOnError>,
603
+ ) {
604
+ return (options.client ?? this._client).get<
605
+ ListProjectPermissionsResponses,
606
+ ListProjectPermissionsErrors,
607
+ ThrowOnError
608
+ >({
609
+ url: "/projects/{project_id}/permissions",
610
+ ...options,
611
+ });
612
+ }
613
+
614
+ /**
615
+ * Grant project access
616
+ * Grants project access to the account associated with the specified email address
617
+ */
618
+ public grantPermissionToProject<ThrowOnError extends boolean = true>(
619
+ options: Options<GrantPermissionToProjectData, ThrowOnError>,
620
+ ) {
621
+ return (options.client ?? this._client).post<
622
+ GrantPermissionToProjectResponses,
623
+ GrantPermissionToProjectErrors,
624
+ ThrowOnError
625
+ >({
626
+ url: "/projects/{project_id}/permissions",
627
+ ...options,
628
+ headers: {
629
+ "Content-Type": "application/json",
630
+ ...options.headers,
631
+ },
632
+ });
633
+ }
634
+
635
+ /**
636
+ * Revoke project access
637
+ * Revokes project access from the user associated with the specified permission `id`. You can retrieve a user's permission `id` by listing project access.
638
+ */
639
+ public revokePermissionFromProject<ThrowOnError extends boolean = true>(
640
+ options: Options<RevokePermissionFromProjectData, ThrowOnError>,
641
+ ) {
642
+ return (options.client ?? this._client).delete<
643
+ RevokePermissionFromProjectResponses,
644
+ RevokePermissionFromProjectErrors,
645
+ ThrowOnError
646
+ >({
647
+ url: "/projects/{project_id}/permissions/{permission_id}",
648
+ ...options,
649
+ });
650
+ }
651
+
652
+ /**
653
+ * Return available shared preload libraries
654
+ * Return available shared preload libraries
655
+ */
656
+ public getAvailablePreloadLibraries<ThrowOnError extends boolean = true>(
657
+ options: Options<GetAvailablePreloadLibrariesData, ThrowOnError>,
658
+ ) {
659
+ return (options.client ?? this._client).get<
660
+ GetAvailablePreloadLibrariesResponses,
661
+ GetAvailablePreloadLibrariesErrors,
662
+ ThrowOnError
663
+ >({
664
+ url: "/projects/{project_id}/available_preload_libraries",
665
+ ...options,
666
+ });
667
+ }
668
+
669
+ /**
670
+ * Create a project transfer request
671
+ * Creates a transfer request for the specified project. A transfer request allows
672
+ * the project to be transferred to another account or organization. The request
673
+ * has an expiration time after which it can no longer be used. To accept/claim
674
+ * the transfer request, the recipient user/organization must call the
675
+ * `/projects/{project_id}/transfer_requests/{request_id}` API endpoint, or visit
676
+ * `https://console.neon.tech/app/claim?p={project_id}&tr={request_id}&ru={redirect_url}`
677
+ * in the Neon Console. The `ru` parameter is optional and can be used to redirect
678
+ * the user after accepting the transfer request. This feature is currently in
679
+ * private preview. Get in touch with us to get access.
680
+ *
681
+ */
682
+ public createProjectTransferRequest<ThrowOnError extends boolean = true>(
683
+ options: Options<CreateProjectTransferRequestData, ThrowOnError>,
684
+ ) {
685
+ return (options.client ?? this._client).post<
686
+ CreateProjectTransferRequestResponses,
687
+ CreateProjectTransferRequestErrors,
688
+ ThrowOnError
689
+ >({
690
+ url: "/projects/{project_id}/transfer_requests",
691
+ ...options,
692
+ headers: {
693
+ "Content-Type": "application/json",
694
+ ...options.headers,
695
+ },
696
+ });
697
+ }
698
+
699
+ /**
700
+ * Accept a project transfer request
701
+ * Accepts a transfer request for the specified project, transferring it to the specified organization
702
+ * or user. If org_id is not passed, the project will be transferred to the current user or organization account.
703
+ *
704
+ */
705
+ public acceptProjectTransferRequest<ThrowOnError extends boolean = true>(
706
+ options: Options<AcceptProjectTransferRequestData, ThrowOnError>,
707
+ ) {
708
+ return (options.client ?? this._client).put<
709
+ AcceptProjectTransferRequestResponses,
710
+ AcceptProjectTransferRequestErrors,
711
+ ThrowOnError
712
+ >({
713
+ url: "/projects/{project_id}/transfer_requests/{request_id}",
714
+ ...options,
715
+ headers: {
716
+ "Content-Type": "application/json",
717
+ ...options.headers,
718
+ },
719
+ });
720
+ }
721
+
722
+ /**
723
+ * List JWKS URLs
724
+ * Returns the JWKS URLs available for verifying JWTs used as the authentication mechanism for the specified project.
725
+ *
726
+ */
727
+ public getProjectJwks<ThrowOnError extends boolean = true>(
728
+ options: Options<GetProjectJwksData, ThrowOnError>,
729
+ ) {
730
+ return (options.client ?? this._client).get<
731
+ GetProjectJwksResponses,
732
+ GetProjectJwksErrors,
733
+ ThrowOnError
734
+ >({
735
+ url: "/projects/{project_id}/jwks",
736
+ ...options,
737
+ });
738
+ }
739
+
740
+ /**
741
+ * Add JWKS URL
742
+ * Add a new JWKS URL to a project, such that it can be used for verifying JWTs used as the authentication mechanism for the specified project.
743
+ *
744
+ * The URL must be a valid HTTPS URL that returns a JSON Web Key Set.
745
+ *
746
+ * The `provider_name` field allows you to specify which authentication provider you're using (e.g., Clerk, Auth0, AWS Cognito, etc.).
747
+ *
748
+ * The `branch_id` can be used to specify on which branches the JWKS URL will be accepted. If not specified, then it will work on any branch.
749
+ *
750
+ * The `role_names` can be used to specify for which roles the JWKS URL will be accepted. If not specified, then default roles will be used (authenticator, authenticated and anonymous).
751
+ *
752
+ * The `jwt_audience` can be used to specify which "aud" values should be accepted by Neon in the JWTs that are used for authentication.
753
+ *
754
+ */
755
+ public addProjectJwks<ThrowOnError extends boolean = true>(
756
+ options: Options<AddProjectJwksData, ThrowOnError>,
757
+ ) {
758
+ return (options.client ?? this._client).post<
759
+ AddProjectJwksResponses,
760
+ AddProjectJwksErrors,
761
+ ThrowOnError
762
+ >({
763
+ url: "/projects/{project_id}/jwks",
764
+ ...options,
765
+ headers: {
766
+ "Content-Type": "application/json",
767
+ ...options.headers,
768
+ },
769
+ });
770
+ }
771
+
772
+ /**
773
+ * Delete JWKS URL
774
+ * Deletes a JWKS URL from the specified project
775
+ */
776
+ public deleteProjectJwks<ThrowOnError extends boolean = true>(
777
+ options: Options<DeleteProjectJwksData, ThrowOnError>,
778
+ ) {
779
+ return (options.client ?? this._client).delete<
780
+ DeleteProjectJwksResponses,
781
+ DeleteProjectJwksErrors,
782
+ ThrowOnError
783
+ >({
784
+ url: "/projects/{project_id}/jwks/{jwks_id}",
785
+ ...options,
786
+ });
787
+ }
788
+
789
+ /**
790
+ * Delete Neon Data API
791
+ * Deletes the Neon Data API for the specified branch.
792
+ * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
793
+ *
794
+ */
795
+ public deleteProjectBranchDataApi<ThrowOnError extends boolean = true>(
796
+ options: Options<DeleteProjectBranchDataApiData, ThrowOnError>,
797
+ ) {
798
+ return (options.client ?? this._client).delete<
799
+ DeleteProjectBranchDataApiResponses,
800
+ DeleteProjectBranchDataApiErrors,
801
+ ThrowOnError
802
+ >({
803
+ url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
804
+ ...options,
805
+ });
806
+ }
807
+
808
+ /**
809
+ * Get Neon Data API
810
+ * Retrieves the Neon Data API for the specified branch.
811
+ *
812
+ */
813
+ public getProjectBranchDataApi<ThrowOnError extends boolean = true>(
814
+ options: Options<GetProjectBranchDataApiData, ThrowOnError>,
815
+ ) {
816
+ return (options.client ?? this._client).get<
817
+ GetProjectBranchDataApiResponses,
818
+ GetProjectBranchDataApiErrors,
819
+ ThrowOnError
820
+ >({
821
+ url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
822
+ ...options,
823
+ });
824
+ }
825
+
826
+ /**
827
+ * Refresh schema cache
828
+ * Refreshes the schema cache for the Neon Data API in the specified branch.
829
+ * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
830
+ *
831
+ */
832
+ public refreshSchemaCacheDataApi<ThrowOnError extends boolean = true>(
833
+ options: Options<RefreshSchemaCacheDataApiData, ThrowOnError>,
834
+ ) {
835
+ return (options.client ?? this._client).patch<
836
+ RefreshSchemaCacheDataApiResponses,
837
+ RefreshSchemaCacheDataApiErrors,
838
+ ThrowOnError
839
+ >({
840
+ url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
841
+ ...options,
842
+ });
843
+ }
844
+
845
+ /**
846
+ * Create Neon Data API
847
+ * Creates a new instance of Neon Data API in the specified branch.
848
+ * You can obtain the `project_id` and `branch_id` by listing the projects and branches for your Neon account.
849
+ *
850
+ */
851
+ public createProjectBranchDataApi<ThrowOnError extends boolean = true>(
852
+ options: Options<CreateProjectBranchDataApiData, ThrowOnError>,
853
+ ) {
854
+ return (options.client ?? this._client).post<
855
+ CreateProjectBranchDataApiResponses,
856
+ CreateProjectBranchDataApiErrors,
857
+ ThrowOnError
858
+ >({
859
+ url: "/projects/{project_id}/branches/{branch_id}/data-api/{database_name}",
860
+ ...options,
861
+ headers: {
862
+ "Content-Type": "application/json",
863
+ ...options.headers,
864
+ },
865
+ });
866
+ }
867
+
868
+ /**
869
+ * Create Neon Auth integration
870
+ * Creates a project on a third-party authentication provider's platform for use with Neon Auth.
871
+ * Use this endpoint if the frontend integration flow can't be used.
872
+ *
873
+ */
874
+ public createNeonAuthIntegration<ThrowOnError extends boolean = true>(
875
+ options: Options<CreateNeonAuthIntegrationData, ThrowOnError>,
876
+ ) {
877
+ return (options.client ?? this._client).post<
878
+ CreateNeonAuthIntegrationResponses,
879
+ CreateNeonAuthIntegrationErrors,
880
+ ThrowOnError
881
+ >({
882
+ url: "/projects/auth/create",
883
+ ...options,
884
+ headers: {
885
+ "Content-Type": "application/json",
886
+ ...options.headers,
887
+ },
888
+ });
889
+ }
890
+
891
+ /**
892
+ * Delete domain from redirect_uri whitelist
893
+ * Deletes a domain from the redirect_uri whitelist for the specified project.
894
+ *
895
+ */
896
+ public deleteNeonAuthDomainFromRedirectUriWhitelist<
897
+ ThrowOnError extends boolean = true,
898
+ >(
899
+ options: Options<
900
+ DeleteNeonAuthDomainFromRedirectUriWhitelistData,
901
+ ThrowOnError
902
+ >,
903
+ ) {
904
+ return (options.client ?? this._client).delete<
905
+ DeleteNeonAuthDomainFromRedirectUriWhitelistResponses,
906
+ DeleteNeonAuthDomainFromRedirectUriWhitelistErrors,
907
+ ThrowOnError
908
+ >({
909
+ url: "/projects/{project_id}/auth/domains",
910
+ ...options,
911
+ headers: {
912
+ "Content-Type": "application/json",
913
+ ...options.headers,
914
+ },
915
+ });
916
+ }
917
+
918
+ /**
919
+ * List domains in redirect_uri whitelist
920
+ * Lists the domains in the redirect_uri whitelist for the specified project.
921
+ *
922
+ */
923
+ public listNeonAuthRedirectUriWhitelistDomains<
924
+ ThrowOnError extends boolean = true,
925
+ >(
926
+ options: Options<ListNeonAuthRedirectUriWhitelistDomainsData, ThrowOnError>,
927
+ ) {
928
+ return (options.client ?? this._client).get<
929
+ ListNeonAuthRedirectUriWhitelistDomainsResponses,
930
+ ListNeonAuthRedirectUriWhitelistDomainsErrors,
931
+ ThrowOnError
932
+ >({
933
+ url: "/projects/{project_id}/auth/domains",
934
+ ...options,
935
+ });
936
+ }
937
+
938
+ /**
939
+ * Add domain to redirect_uri whitelist
940
+ * Adds a domain to the redirect_uri whitelist for the specified project.
941
+ *
942
+ */
943
+ public addNeonAuthDomainToRedirectUriWhitelist<
944
+ ThrowOnError extends boolean = true,
945
+ >(
946
+ options: Options<AddNeonAuthDomainToRedirectUriWhitelistData, ThrowOnError>,
947
+ ) {
948
+ return (options.client ?? this._client).post<
949
+ AddNeonAuthDomainToRedirectUriWhitelistResponses,
950
+ AddNeonAuthDomainToRedirectUriWhitelistErrors,
951
+ ThrowOnError
952
+ >({
953
+ url: "/projects/{project_id}/auth/domains",
954
+ ...options,
955
+ headers: {
956
+ "Content-Type": "application/json",
957
+ ...options.headers,
958
+ },
959
+ });
960
+ }
961
+
962
+ /**
963
+ * Create Auth Provider SDK keys
964
+ * Generates SDK or API Keys for the auth provider. These might be called different things depending
965
+ * on the auth provider you're using, but are generally used for setting up the frontend and backend SDKs.
966
+ *
967
+ */
968
+ public createNeonAuthProviderSdkKeys<ThrowOnError extends boolean = true>(
969
+ options: Options<CreateNeonAuthProviderSdkKeysData, ThrowOnError>,
970
+ ) {
971
+ return (options.client ?? this._client).post<
972
+ CreateNeonAuthProviderSdkKeysResponses,
973
+ CreateNeonAuthProviderSdkKeysErrors,
974
+ ThrowOnError
975
+ >({
976
+ url: "/projects/auth/keys",
977
+ ...options,
978
+ headers: {
979
+ "Content-Type": "application/json",
980
+ ...options.headers,
981
+ },
982
+ });
983
+ }
984
+
985
+ /**
986
+ * Create new auth user
987
+ * Creates a new user in Neon Auth.
988
+ * The user will be created in your neon_auth.users_sync table and automatically propagated to your auth project, whether Neon-managed or provider-owned.
989
+ *
990
+ */
991
+ public createNeonAuthNewUser<ThrowOnError extends boolean = true>(
992
+ options: Options<CreateNeonAuthNewUserData, ThrowOnError>,
993
+ ) {
994
+ return (options.client ?? this._client).post<
995
+ CreateNeonAuthNewUserResponses,
996
+ CreateNeonAuthNewUserErrors,
997
+ ThrowOnError
998
+ >({
999
+ url: "/projects/auth/user",
1000
+ ...options,
1001
+ headers: {
1002
+ "Content-Type": "application/json",
1003
+ ...options.headers,
1004
+ },
1005
+ });
1006
+ }
1007
+
1008
+ /**
1009
+ * Delete auth user
1010
+ * Deletes the auth user for the specified project.
1011
+ *
1012
+ */
1013
+ public deleteNeonAuthUser<ThrowOnError extends boolean = true>(
1014
+ options: Options<DeleteNeonAuthUserData, ThrowOnError>,
1015
+ ) {
1016
+ return (options.client ?? this._client).delete<
1017
+ DeleteNeonAuthUserResponses,
1018
+ DeleteNeonAuthUserErrors,
1019
+ ThrowOnError
1020
+ >({
1021
+ url: "/projects/{project_id}/auth/users/{auth_user_id}",
1022
+ ...options,
1023
+ });
1024
+ }
1025
+
1026
+ /**
1027
+ * Transfer Neon-managed auth project to your own account
1028
+ * Transfer ownership of your Neon-managed auth project to your own auth provider account.
1029
+ *
1030
+ */
1031
+ public transferNeonAuthProviderProject<ThrowOnError extends boolean = true>(
1032
+ options: Options<TransferNeonAuthProviderProjectData, ThrowOnError>,
1033
+ ) {
1034
+ return (options.client ?? this._client).post<
1035
+ TransferNeonAuthProviderProjectResponses,
1036
+ TransferNeonAuthProviderProjectErrors,
1037
+ ThrowOnError
1038
+ >({
1039
+ url: "/projects/auth/transfer_ownership",
1040
+ ...options,
1041
+ headers: {
1042
+ "Content-Type": "application/json",
1043
+ ...options.headers,
1044
+ },
1045
+ });
1046
+ }
1047
+
1048
+ /**
1049
+ * Lists active integrations with auth providers
1050
+ */
1051
+ public listNeonAuthIntegrations<ThrowOnError extends boolean = true>(
1052
+ options: Options<ListNeonAuthIntegrationsData, ThrowOnError>,
1053
+ ) {
1054
+ return (options.client ?? this._client).get<
1055
+ ListNeonAuthIntegrationsResponses,
1056
+ ListNeonAuthIntegrationsErrors,
1057
+ ThrowOnError
1058
+ >({
1059
+ url: "/projects/{project_id}/auth/integrations",
1060
+ ...options,
1061
+ });
1062
+ }
1063
+
1064
+ /**
1065
+ * List OAuth providers
1066
+ * Lists the OAuth providers for the specified project.
1067
+ *
1068
+ */
1069
+ public listNeonAuthOauthProviders<ThrowOnError extends boolean = true>(
1070
+ options: Options<ListNeonAuthOauthProvidersData, ThrowOnError>,
1071
+ ) {
1072
+ return (options.client ?? this._client).get<
1073
+ ListNeonAuthOauthProvidersResponses,
1074
+ ListNeonAuthOauthProvidersErrors,
1075
+ ThrowOnError
1076
+ >({
1077
+ url: "/projects/{project_id}/auth/oauth_providers",
1078
+ ...options,
1079
+ });
1080
+ }
1081
+
1082
+ /**
1083
+ * Add a OAuth provider
1084
+ * Adds a OAuth provider to the specified project.
1085
+ *
1086
+ */
1087
+ public addNeonAuthOauthProvider<ThrowOnError extends boolean = true>(
1088
+ options: Options<AddNeonAuthOauthProviderData, ThrowOnError>,
1089
+ ) {
1090
+ return (options.client ?? this._client).post<
1091
+ AddNeonAuthOauthProviderResponses,
1092
+ AddNeonAuthOauthProviderErrors,
1093
+ ThrowOnError
1094
+ >({
1095
+ url: "/projects/{project_id}/auth/oauth_providers",
1096
+ ...options,
1097
+ headers: {
1098
+ "Content-Type": "application/json",
1099
+ ...options.headers,
1100
+ },
1101
+ });
1102
+ }
1103
+
1104
+ /**
1105
+ * Delete OAuth provider
1106
+ * Deletes a OAuth provider from the specified project.
1107
+ *
1108
+ */
1109
+ public deleteNeonAuthOauthProvider<ThrowOnError extends boolean = true>(
1110
+ options: Options<DeleteNeonAuthOauthProviderData, ThrowOnError>,
1111
+ ) {
1112
+ return (options.client ?? this._client).delete<
1113
+ DeleteNeonAuthOauthProviderResponses,
1114
+ DeleteNeonAuthOauthProviderErrors,
1115
+ ThrowOnError
1116
+ >({
1117
+ url: "/projects/{project_id}/auth/oauth_providers/{oauth_provider_id}",
1118
+ ...options,
1119
+ });
1120
+ }
1121
+
1122
+ /**
1123
+ * Update OAuth provider
1124
+ * Updates a OAuth provider for the specified project.
1125
+ *
1126
+ */
1127
+ public updateNeonAuthOauthProvider<ThrowOnError extends boolean = true>(
1128
+ options: Options<UpdateNeonAuthOauthProviderData, ThrowOnError>,
1129
+ ) {
1130
+ return (options.client ?? this._client).patch<
1131
+ UpdateNeonAuthOauthProviderResponses,
1132
+ UpdateNeonAuthOauthProviderErrors,
1133
+ ThrowOnError
1134
+ >({
1135
+ url: "/projects/{project_id}/auth/oauth_providers/{oauth_provider_id}",
1136
+ ...options,
1137
+ headers: {
1138
+ "Content-Type": "application/json",
1139
+ ...options.headers,
1140
+ },
1141
+ });
1142
+ }
1143
+
1144
+ /**
1145
+ * Get email server configuration
1146
+ * Gets the email server configuration for the specified project.
1147
+ *
1148
+ */
1149
+ public getNeonAuthEmailServer<ThrowOnError extends boolean = true>(
1150
+ options: Options<GetNeonAuthEmailServerData, ThrowOnError>,
1151
+ ) {
1152
+ return (options.client ?? this._client).get<
1153
+ GetNeonAuthEmailServerResponses,
1154
+ GetNeonAuthEmailServerErrors,
1155
+ ThrowOnError
1156
+ >({
1157
+ url: "/projects/{project_id}/auth/email_server",
1158
+ ...options,
1159
+ });
1160
+ }
1161
+
1162
+ /**
1163
+ * Update email server configuration
1164
+ * Updates the email server configuration for the specified project.
1165
+ *
1166
+ */
1167
+ public updateNeonAuthEmailServer<ThrowOnError extends boolean = true>(
1168
+ options: Options<UpdateNeonAuthEmailServerData, ThrowOnError>,
1169
+ ) {
1170
+ return (options.client ?? this._client).patch<
1171
+ UpdateNeonAuthEmailServerResponses,
1172
+ UpdateNeonAuthEmailServerErrors,
1173
+ ThrowOnError
1174
+ >({
1175
+ url: "/projects/{project_id}/auth/email_server",
1176
+ ...options,
1177
+ headers: {
1178
+ "Content-Type": "application/json",
1179
+ ...options.headers,
1180
+ },
1181
+ });
1182
+ }
1183
+
1184
+ /**
1185
+ * Delete integration with auth provider
1186
+ */
1187
+ public deleteNeonAuthIntegration<ThrowOnError extends boolean = true>(
1188
+ options: Options<DeleteNeonAuthIntegrationData, ThrowOnError>,
1189
+ ) {
1190
+ return (options.client ?? this._client).delete<
1191
+ DeleteNeonAuthIntegrationResponses,
1192
+ DeleteNeonAuthIntegrationErrors,
1193
+ ThrowOnError
1194
+ >({
1195
+ url: "/projects/{project_id}/auth/integration/{auth_provider}",
1196
+ ...options,
1197
+ headers: {
1198
+ "Content-Type": "application/json",
1199
+ ...options.headers,
1200
+ },
1201
+ });
1202
+ }
1203
+
1204
+ /**
1205
+ * Retrieve connection URI
1206
+ * Retrieves a connection URI for the specified database.
1207
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1208
+ * You can obtain the `database_name` by listing the databases for a branch.
1209
+ * You can obtain a `role_name` by listing the roles for a branch.
1210
+ *
1211
+ */
1212
+ public getConnectionUri<ThrowOnError extends boolean = true>(
1213
+ options: Options<GetConnectionUriData, ThrowOnError>,
1214
+ ) {
1215
+ return (options.client ?? this._client).get<
1216
+ GetConnectionUriResponses,
1217
+ GetConnectionUriErrors,
1218
+ ThrowOnError
1219
+ >({
1220
+ url: "/projects/{project_id}/connection_uri",
1221
+ ...options,
1222
+ });
1223
+ }
1224
+
1225
+ /**
1226
+ * List branches
1227
+ * Retrieves a list of branches for the specified project.
1228
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1229
+ *
1230
+ * Each Neon project has a root branch named `main`.
1231
+ * A `branch_id` value has a `br-` prefix.
1232
+ * A project may contain child branches that were branched from `main` or from another branch.
1233
+ * A parent branch is identified by the `parent_id` value, which is the `id` of the parent branch.
1234
+ * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1235
+ *
1236
+ */
1237
+ public listProjectBranches<ThrowOnError extends boolean = true>(
1238
+ options: Options<ListProjectBranchesData, ThrowOnError>,
1239
+ ) {
1240
+ return (options.client ?? this._client).get<
1241
+ ListProjectBranchesResponses,
1242
+ ListProjectBranchesErrors,
1243
+ ThrowOnError
1244
+ >({
1245
+ url: "/projects/{project_id}/branches",
1246
+ ...options,
1247
+ });
1248
+ }
1249
+
1250
+ /**
1251
+ * Create branch
1252
+ * Creates a branch in the specified project.
1253
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1254
+ * This method does not require a request body, but you can specify one to create a compute endpoint for the branch or to select a non-default parent branch.
1255
+ * By default, the branch is created from the project's default branch with no compute endpoint, and the branch name is auto-generated.
1256
+ * To access the branch, you must add an endpoint object. A `read_write` endpoint allows you to perform read and write operations on the branch.
1257
+ * Each branch supports one read-write endpoint and multiple read-only endpoints.
1258
+ * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1259
+ *
1260
+ */
1261
+ public createProjectBranch<ThrowOnError extends boolean = true>(
1262
+ options: Options<CreateProjectBranchData, ThrowOnError>,
1263
+ ) {
1264
+ return (options.client ?? this._client).post<
1265
+ CreateProjectBranchResponses,
1266
+ CreateProjectBranchErrors,
1267
+ ThrowOnError
1268
+ >({
1269
+ url: "/projects/{project_id}/branches",
1270
+ ...options,
1271
+ headers: {
1272
+ "Content-Type": "application/json",
1273
+ ...options.headers,
1274
+ },
1275
+ });
1276
+ }
1277
+
1278
+ /**
1279
+ * Retrieve number of branches
1280
+ * Retrieves the total number of branches in the specified project.
1281
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1282
+ *
1283
+ */
1284
+ public countProjectBranches<ThrowOnError extends boolean = true>(
1285
+ options: Options<CountProjectBranchesData, ThrowOnError>,
1286
+ ) {
1287
+ return (options.client ?? this._client).get<
1288
+ CountProjectBranchesResponses,
1289
+ CountProjectBranchesErrors,
1290
+ ThrowOnError
1291
+ >({
1292
+ url: "/projects/{project_id}/branches/count",
1293
+ ...options,
1294
+ });
1295
+ }
1296
+
1297
+ /**
1298
+ * Delete branch
1299
+ * Deletes the specified branch from a project, and places
1300
+ * all compute endpoints into an idle state, breaking existing client connections.
1301
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1302
+ * You can obtain a `branch_id` by listing the project's branches.
1303
+ * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1304
+ *
1305
+ * When a successful response status is received, the compute endpoints are still active,
1306
+ * and the branch is not yet deleted from storage.
1307
+ * The deletion occurs after all operations finish.
1308
+ * You cannot delete a project's root or default branch, and you cannot delete a branch that has a child branch.
1309
+ * A project must have at least one branch.
1310
+ *
1311
+ */
1312
+ public deleteProjectBranch<ThrowOnError extends boolean = true>(
1313
+ options: Options<DeleteProjectBranchData, ThrowOnError>,
1314
+ ) {
1315
+ return (options.client ?? this._client).delete<
1316
+ DeleteProjectBranchResponses,
1317
+ DeleteProjectBranchErrors,
1318
+ ThrowOnError
1319
+ >({
1320
+ url: "/projects/{project_id}/branches/{branch_id}",
1321
+ ...options,
1322
+ });
1323
+ }
1324
+
1325
+ /**
1326
+ * Retrieve branch details
1327
+ * Retrieves information about the specified branch.
1328
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1329
+ * You can obtain a `branch_id` by listing the project's branches.
1330
+ * A `branch_id` value has a `br-` prefix.
1331
+ *
1332
+ * Each Neon project is initially created with a root and default branch named `main`.
1333
+ * A project can contain one or more branches.
1334
+ * A parent branch is identified by a `parent_id` value, which is the `id` of the parent branch.
1335
+ * For related information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1336
+ *
1337
+ */
1338
+ public getProjectBranch<ThrowOnError extends boolean = true>(
1339
+ options: Options<GetProjectBranchData, ThrowOnError>,
1340
+ ) {
1341
+ return (options.client ?? this._client).get<
1342
+ GetProjectBranchResponses,
1343
+ GetProjectBranchErrors,
1344
+ ThrowOnError
1345
+ >({
1346
+ url: "/projects/{project_id}/branches/{branch_id}",
1347
+ ...options,
1348
+ });
1349
+ }
1350
+
1351
+ /**
1352
+ * Update branch
1353
+ * Updates the specified branch.
1354
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1355
+ * You can obtain the `branch_id` by listing the project's branches.
1356
+ * For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1357
+ *
1358
+ */
1359
+ public updateProjectBranch<ThrowOnError extends boolean = true>(
1360
+ options: Options<UpdateProjectBranchData, ThrowOnError>,
1361
+ ) {
1362
+ return (options.client ?? this._client).patch<
1363
+ UpdateProjectBranchResponses,
1364
+ UpdateProjectBranchErrors,
1365
+ ThrowOnError
1366
+ >({
1367
+ url: "/projects/{project_id}/branches/{branch_id}",
1368
+ ...options,
1369
+ headers: {
1370
+ "Content-Type": "application/json",
1371
+ ...options.headers,
1372
+ },
1373
+ });
1374
+ }
1375
+
1376
+ /**
1377
+ * Restore branch
1378
+ * Restores a branch to an earlier state in its own or another branch's history
1379
+ */
1380
+ public restoreProjectBranch<ThrowOnError extends boolean = true>(
1381
+ options: Options<RestoreProjectBranchData, ThrowOnError>,
1382
+ ) {
1383
+ return (options.client ?? this._client).post<
1384
+ RestoreProjectBranchResponses,
1385
+ RestoreProjectBranchErrors,
1386
+ ThrowOnError
1387
+ >({
1388
+ url: "/projects/{project_id}/branches/{branch_id}/restore",
1389
+ ...options,
1390
+ headers: {
1391
+ "Content-Type": "application/json",
1392
+ ...options.headers,
1393
+ },
1394
+ });
1395
+ }
1396
+
1397
+ /**
1398
+ * Retrieve database schema
1399
+ * Retrieves the schema from the specified database. The `lsn` and `timestamp` values cannot be specified at the same time. If both are omitted, the database schema is retrieved from database's head.
1400
+ */
1401
+ public getProjectBranchSchema<ThrowOnError extends boolean = true>(
1402
+ options: Options<GetProjectBranchSchemaData, ThrowOnError>,
1403
+ ) {
1404
+ return (options.client ?? this._client).get<
1405
+ GetProjectBranchSchemaResponses,
1406
+ GetProjectBranchSchemaErrors,
1407
+ ThrowOnError
1408
+ >({
1409
+ url: "/projects/{project_id}/branches/{branch_id}/schema",
1410
+ ...options,
1411
+ });
1412
+ }
1413
+
1414
+ /**
1415
+ * Compare database schema
1416
+ * Compares the schema from the specified database with another branch's schema.
1417
+ */
1418
+ public getProjectBranchSchemaComparison<ThrowOnError extends boolean = true>(
1419
+ options: Options<GetProjectBranchSchemaComparisonData, ThrowOnError>,
1420
+ ) {
1421
+ return (options.client ?? this._client).get<
1422
+ GetProjectBranchSchemaComparisonResponses,
1423
+ GetProjectBranchSchemaComparisonErrors,
1424
+ ThrowOnError
1425
+ >({
1426
+ url: "/projects/{project_id}/branches/{branch_id}/compare_schema",
1427
+ ...options,
1428
+ });
1429
+ }
1430
+
1431
+ /**
1432
+ * Set branch as default
1433
+ * Sets the specified branch as the project's default branch.
1434
+ * The default designation is automatically removed from the previous default branch.
1435
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1436
+ * You can obtain the `branch_id` by listing the project's branches.
1437
+ * For more information, see [Manage branches](https://neon.tech/docs/manage/branches/).
1438
+ *
1439
+ */
1440
+ public setDefaultProjectBranch<ThrowOnError extends boolean = true>(
1441
+ options: Options<SetDefaultProjectBranchData, ThrowOnError>,
1442
+ ) {
1443
+ return (options.client ?? this._client).post<
1444
+ SetDefaultProjectBranchResponses,
1445
+ SetDefaultProjectBranchErrors,
1446
+ ThrowOnError
1447
+ >({
1448
+ url: "/projects/{project_id}/branches/{branch_id}/set_as_default",
1449
+ ...options,
1450
+ });
1451
+ }
1452
+
1453
+ /**
1454
+ * Finalize restore
1455
+ * Finalize the restore operation for a branch created from a snapshot.
1456
+ * This operation updates the branch so it functions as the original branch it replaced.
1457
+ * This includes:
1458
+ * - Reassigning any computes from the original branch to the restored branch (this will restart the computes)
1459
+ * - Renaming the restored branch to the original branch's name
1460
+ * - Renaming the original branch so it no longer uses the original name
1461
+ *
1462
+ * This operation only applies to branches created using the `restoreSnapshot` endpoint with `finalize_restore: false`.
1463
+ *
1464
+ * **Note**: This endpoint is currently in Beta.
1465
+ *
1466
+ */
1467
+ public finalizeRestoreBranch<ThrowOnError extends boolean = true>(
1468
+ options: Options<FinalizeRestoreBranchData, ThrowOnError>,
1469
+ ) {
1470
+ return (options.client ?? this._client).post<
1471
+ FinalizeRestoreBranchResponses,
1472
+ FinalizeRestoreBranchErrors,
1473
+ ThrowOnError
1474
+ >({
1475
+ url: "/projects/{project_id}/branches/{branch_id}/finalize_restore",
1476
+ ...options,
1477
+ headers: {
1478
+ "Content-Type": "application/json",
1479
+ ...options.headers,
1480
+ },
1481
+ });
1482
+ }
1483
+
1484
+ /**
1485
+ * List branch endpoints
1486
+ * Retrieves a list of compute endpoints for the specified branch.
1487
+ * Neon permits only one read-write compute endpoint per branch.
1488
+ * A branch can have multiple read-only compute endpoints.
1489
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1490
+ * You can obtain the `branch_id` by listing the project's branches.
1491
+ *
1492
+ */
1493
+ public listProjectBranchEndpoints<ThrowOnError extends boolean = true>(
1494
+ options: Options<ListProjectBranchEndpointsData, ThrowOnError>,
1495
+ ) {
1496
+ return (options.client ?? this._client).get<
1497
+ ListProjectBranchEndpointsResponses,
1498
+ ListProjectBranchEndpointsErrors,
1499
+ ThrowOnError
1500
+ >({
1501
+ url: "/projects/{project_id}/branches/{branch_id}/endpoints",
1502
+ ...options,
1503
+ });
1504
+ }
1505
+
1506
+ /**
1507
+ * List databases
1508
+ * Retrieves a list of databases for the specified branch.
1509
+ * A branch can have multiple databases.
1510
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1511
+ * You can obtain the `branch_id` by listing the project's branches.
1512
+ * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
1513
+ *
1514
+ */
1515
+ public listProjectBranchDatabases<ThrowOnError extends boolean = true>(
1516
+ options: Options<ListProjectBranchDatabasesData, ThrowOnError>,
1517
+ ) {
1518
+ return (options.client ?? this._client).get<
1519
+ ListProjectBranchDatabasesResponses,
1520
+ ListProjectBranchDatabasesErrors,
1521
+ ThrowOnError
1522
+ >({
1523
+ url: "/projects/{project_id}/branches/{branch_id}/databases",
1524
+ ...options,
1525
+ });
1526
+ }
1527
+
1528
+ /**
1529
+ * Create database
1530
+ * Creates a database in the specified branch.
1531
+ * A branch can have multiple databases.
1532
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1533
+ * You can obtain the `branch_id` by listing the project's branches.
1534
+ * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
1535
+ *
1536
+ */
1537
+ public createProjectBranchDatabase<ThrowOnError extends boolean = true>(
1538
+ options: Options<CreateProjectBranchDatabaseData, ThrowOnError>,
1539
+ ) {
1540
+ return (options.client ?? this._client).post<
1541
+ CreateProjectBranchDatabaseResponses,
1542
+ CreateProjectBranchDatabaseErrors,
1543
+ ThrowOnError
1544
+ >({
1545
+ url: "/projects/{project_id}/branches/{branch_id}/databases",
1546
+ ...options,
1547
+ headers: {
1548
+ "Content-Type": "application/json",
1549
+ ...options.headers,
1550
+ },
1551
+ });
1552
+ }
1553
+
1554
+ /**
1555
+ * Delete database
1556
+ * Deletes the specified database from the branch.
1557
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1558
+ * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
1559
+ * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
1560
+ *
1561
+ */
1562
+ public deleteProjectBranchDatabase<ThrowOnError extends boolean = true>(
1563
+ options: Options<DeleteProjectBranchDatabaseData, ThrowOnError>,
1564
+ ) {
1565
+ return (options.client ?? this._client).delete<
1566
+ DeleteProjectBranchDatabaseResponses,
1567
+ DeleteProjectBranchDatabaseErrors,
1568
+ ThrowOnError
1569
+ >({
1570
+ url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
1571
+ ...options,
1572
+ });
1573
+ }
1574
+
1575
+ /**
1576
+ * Retrieve database details
1577
+ * Retrieves information about the specified database.
1578
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1579
+ * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
1580
+ * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
1581
+ *
1582
+ */
1583
+ public getProjectBranchDatabase<ThrowOnError extends boolean = true>(
1584
+ options: Options<GetProjectBranchDatabaseData, ThrowOnError>,
1585
+ ) {
1586
+ return (options.client ?? this._client).get<
1587
+ GetProjectBranchDatabaseResponses,
1588
+ GetProjectBranchDatabaseErrors,
1589
+ ThrowOnError
1590
+ >({
1591
+ url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
1592
+ ...options,
1593
+ });
1594
+ }
1595
+
1596
+ /**
1597
+ * Update database
1598
+ * Updates the specified database in the branch.
1599
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1600
+ * You can obtain the `branch_id` and `database_name` by listing the branch's databases.
1601
+ * For related information, see [Manage databases](https://neon.tech/docs/manage/databases/).
1602
+ *
1603
+ */
1604
+ public updateProjectBranchDatabase<ThrowOnError extends boolean = true>(
1605
+ options: Options<UpdateProjectBranchDatabaseData, ThrowOnError>,
1606
+ ) {
1607
+ return (options.client ?? this._client).patch<
1608
+ UpdateProjectBranchDatabaseResponses,
1609
+ UpdateProjectBranchDatabaseErrors,
1610
+ ThrowOnError
1611
+ >({
1612
+ url: "/projects/{project_id}/branches/{branch_id}/databases/{database_name}",
1613
+ ...options,
1614
+ headers: {
1615
+ "Content-Type": "application/json",
1616
+ ...options.headers,
1617
+ },
1618
+ });
1619
+ }
1620
+
1621
+ /**
1622
+ * List roles
1623
+ * Retrieves a list of Postgres roles from the specified branch.
1624
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1625
+ * You can obtain the `branch_id` by listing the project's branches.
1626
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1627
+ *
1628
+ */
1629
+ public listProjectBranchRoles<ThrowOnError extends boolean = true>(
1630
+ options: Options<ListProjectBranchRolesData, ThrowOnError>,
1631
+ ) {
1632
+ return (options.client ?? this._client).get<
1633
+ ListProjectBranchRolesResponses,
1634
+ ListProjectBranchRolesErrors,
1635
+ ThrowOnError
1636
+ >({
1637
+ url: "/projects/{project_id}/branches/{branch_id}/roles",
1638
+ ...options,
1639
+ });
1640
+ }
1641
+
1642
+ /**
1643
+ * Create role
1644
+ * Creates a Postgres role in the specified branch.
1645
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1646
+ * You can obtain the `branch_id` by listing the project's branches.
1647
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1648
+ *
1649
+ * Connections established to the active compute endpoint will be dropped.
1650
+ * If the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.
1651
+ *
1652
+ */
1653
+ public createProjectBranchRole<ThrowOnError extends boolean = true>(
1654
+ options: Options<CreateProjectBranchRoleData, ThrowOnError>,
1655
+ ) {
1656
+ return (options.client ?? this._client).post<
1657
+ CreateProjectBranchRoleResponses,
1658
+ CreateProjectBranchRoleErrors,
1659
+ ThrowOnError
1660
+ >({
1661
+ url: "/projects/{project_id}/branches/{branch_id}/roles",
1662
+ ...options,
1663
+ headers: {
1664
+ "Content-Type": "application/json",
1665
+ ...options.headers,
1666
+ },
1667
+ });
1668
+ }
1669
+
1670
+ /**
1671
+ * Delete role
1672
+ * Deletes the specified Postgres role from the branch.
1673
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1674
+ * You can obtain the `branch_id` by listing the project's branches.
1675
+ * You can obtain the `role_name` by listing the roles for a branch.
1676
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1677
+ *
1678
+ */
1679
+ public deleteProjectBranchRole<ThrowOnError extends boolean = true>(
1680
+ options: Options<DeleteProjectBranchRoleData, ThrowOnError>,
1681
+ ) {
1682
+ return (options.client ?? this._client).delete<
1683
+ DeleteProjectBranchRoleResponses,
1684
+ DeleteProjectBranchRoleErrors,
1685
+ ThrowOnError
1686
+ >({
1687
+ url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}",
1688
+ ...options,
1689
+ });
1690
+ }
1691
+
1692
+ /**
1693
+ * Retrieve role details
1694
+ * Retrieves details about the specified role.
1695
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1696
+ * You can obtain the `branch_id` by listing the project's branches.
1697
+ * You can obtain the `role_name` by listing the roles for a branch.
1698
+ * In Neon, the terms "role" and "user" are synonymous.
1699
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1700
+ *
1701
+ */
1702
+ public getProjectBranchRole<ThrowOnError extends boolean = true>(
1703
+ options: Options<GetProjectBranchRoleData, ThrowOnError>,
1704
+ ) {
1705
+ return (options.client ?? this._client).get<
1706
+ GetProjectBranchRoleResponses,
1707
+ GetProjectBranchRoleErrors,
1708
+ ThrowOnError
1709
+ >({
1710
+ url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}",
1711
+ ...options,
1712
+ });
1713
+ }
1714
+
1715
+ /**
1716
+ * Retrieve role password
1717
+ * Retrieves the password for the specified Postgres role, if possible.
1718
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1719
+ * You can obtain the `branch_id` by listing the project's branches.
1720
+ * You can obtain the `role_name` by listing the roles for a branch.
1721
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1722
+ *
1723
+ */
1724
+ public getProjectBranchRolePassword<ThrowOnError extends boolean = true>(
1725
+ options: Options<GetProjectBranchRolePasswordData, ThrowOnError>,
1726
+ ) {
1727
+ return (options.client ?? this._client).get<
1728
+ GetProjectBranchRolePasswordResponses,
1729
+ GetProjectBranchRolePasswordErrors,
1730
+ ThrowOnError
1731
+ >({
1732
+ url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password",
1733
+ ...options,
1734
+ });
1735
+ }
1736
+
1737
+ /**
1738
+ * Reset role password
1739
+ * Resets the password for the specified Postgres role.
1740
+ * Returns a new password and operations. The new password is ready to use when the last operation finishes.
1741
+ * The old password remains valid until last operation finishes.
1742
+ * Connections to the compute endpoint are dropped. If idle,
1743
+ * the compute endpoint becomes active for a short period of time.
1744
+ *
1745
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1746
+ * You can obtain the `branch_id` by listing the project's branches.
1747
+ * You can obtain the `role_name` by listing the roles for a branch.
1748
+ * For related information, see [Manage roles](https://neon.tech/docs/manage/roles/).
1749
+ *
1750
+ */
1751
+ public resetProjectBranchRolePassword<ThrowOnError extends boolean = true>(
1752
+ options: Options<ResetProjectBranchRolePasswordData, ThrowOnError>,
1753
+ ) {
1754
+ return (options.client ?? this._client).post<
1755
+ ResetProjectBranchRolePasswordResponses,
1756
+ ResetProjectBranchRolePasswordErrors,
1757
+ ThrowOnError
1758
+ >({
1759
+ url: "/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password",
1760
+ ...options,
1761
+ });
1762
+ }
1763
+
1764
+ /**
1765
+ * List VPC endpoint restrictions
1766
+ * Lists VPC endpoint restrictions for the specified Neon project.
1767
+ *
1768
+ */
1769
+ public listProjectVpcEndpoints<ThrowOnError extends boolean = true>(
1770
+ options: Options<ListProjectVpcEndpointsData, ThrowOnError>,
1771
+ ) {
1772
+ return (options.client ?? this._client).get<
1773
+ ListProjectVpcEndpointsResponses,
1774
+ ListProjectVpcEndpointsErrors,
1775
+ ThrowOnError
1776
+ >({
1777
+ url: "/projects/{project_id}/vpc_endpoints",
1778
+ ...options,
1779
+ });
1780
+ }
1781
+
1782
+ /**
1783
+ * Delete VPC endpoint restriction
1784
+ * Removes the specified VPC endpoint restriction from a Neon project.
1785
+ *
1786
+ */
1787
+ public deleteProjectVpcEndpoint<ThrowOnError extends boolean = true>(
1788
+ options: Options<DeleteProjectVpcEndpointData, ThrowOnError>,
1789
+ ) {
1790
+ return (options.client ?? this._client).delete<
1791
+ DeleteProjectVpcEndpointResponses,
1792
+ DeleteProjectVpcEndpointErrors,
1793
+ ThrowOnError
1794
+ >({
1795
+ url: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}",
1796
+ ...options,
1797
+ });
1798
+ }
1799
+
1800
+ /**
1801
+ * Set VPC endpoint restriction
1802
+ * Sets or updates a VPC endpoint restriction for a Neon project.
1803
+ * When a VPC endpoint restriction is set, the project only accepts connections
1804
+ * from the specified VPC.
1805
+ * A VPC endpoint can be set as a restriction only after it is assigned to the
1806
+ * parent organization of the Neon project.
1807
+ *
1808
+ */
1809
+ public assignProjectVpcEndpoint<ThrowOnError extends boolean = true>(
1810
+ options: Options<AssignProjectVpcEndpointData, ThrowOnError>,
1811
+ ) {
1812
+ return (options.client ?? this._client).post<
1813
+ AssignProjectVpcEndpointResponses,
1814
+ AssignProjectVpcEndpointErrors,
1815
+ ThrowOnError
1816
+ >({
1817
+ url: "/projects/{project_id}/vpc_endpoints/{vpc_endpoint_id}",
1818
+ ...options,
1819
+ headers: {
1820
+ "Content-Type": "application/json",
1821
+ ...options.headers,
1822
+ },
1823
+ });
1824
+ }
1825
+
1826
+ /**
1827
+ * List compute endpoints
1828
+ * Retrieves a list of compute endpoints for the specified project.
1829
+ * A compute endpoint is a Neon compute instance.
1830
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1831
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1832
+ *
1833
+ */
1834
+ public listProjectEndpoints<ThrowOnError extends boolean = true>(
1835
+ options: Options<ListProjectEndpointsData, ThrowOnError>,
1836
+ ) {
1837
+ return (options.client ?? this._client).get<
1838
+ ListProjectEndpointsResponses,
1839
+ ListProjectEndpointsErrors,
1840
+ ThrowOnError
1841
+ >({
1842
+ url: "/projects/{project_id}/endpoints",
1843
+ ...options,
1844
+ });
1845
+ }
1846
+
1847
+ /**
1848
+ * Create compute endpoint
1849
+ * Creates a compute endpoint for the specified branch.
1850
+ * An endpoint is a Neon compute instance.
1851
+ * There is a maximum of one read-write compute endpoint per branch.
1852
+ * If the specified branch already has a read-write compute endpoint, the operation fails.
1853
+ * A branch can have multiple read-only compute endpoints.
1854
+ *
1855
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1856
+ * You can obtain `branch_id` by listing the project's branches.
1857
+ * A `branch_id` has a `br-` prefix.
1858
+ * For supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).
1859
+ * For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1860
+ *
1861
+ */
1862
+ public createProjectEndpoint<ThrowOnError extends boolean = true>(
1863
+ options: Options<CreateProjectEndpointData, ThrowOnError>,
1864
+ ) {
1865
+ return (options.client ?? this._client).post<
1866
+ CreateProjectEndpointResponses,
1867
+ CreateProjectEndpointErrors,
1868
+ ThrowOnError
1869
+ >({
1870
+ url: "/projects/{project_id}/endpoints",
1871
+ ...options,
1872
+ headers: {
1873
+ "Content-Type": "application/json",
1874
+ ...options.headers,
1875
+ },
1876
+ });
1877
+ }
1878
+
1879
+ /**
1880
+ * Delete compute endpoint
1881
+ * Delete the specified compute endpoint.
1882
+ * A compute endpoint is a Neon compute instance.
1883
+ * Deleting a compute endpoint drops existing network connections to the compute endpoint.
1884
+ * The deletion is completed when last operation in the chain finishes successfully.
1885
+ *
1886
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1887
+ * You can obtain an `endpoint_id` by listing your project's compute endpoints.
1888
+ * An `endpoint_id` has an `ep-` prefix.
1889
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1890
+ *
1891
+ */
1892
+ public deleteProjectEndpoint<ThrowOnError extends boolean = true>(
1893
+ options: Options<DeleteProjectEndpointData, ThrowOnError>,
1894
+ ) {
1895
+ return (options.client ?? this._client).delete<
1896
+ DeleteProjectEndpointResponses,
1897
+ DeleteProjectEndpointErrors,
1898
+ ThrowOnError
1899
+ >({
1900
+ url: "/projects/{project_id}/endpoints/{endpoint_id}",
1901
+ ...options,
1902
+ });
1903
+ }
1904
+
1905
+ /**
1906
+ * Retrieve compute endpoint details
1907
+ * Retrieves information about the specified compute endpoint.
1908
+ * A compute endpoint is a Neon compute instance.
1909
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1910
+ * You can obtain an `endpoint_id` by listing your project's compute endpoints.
1911
+ * An `endpoint_id` has an `ep-` prefix.
1912
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1913
+ *
1914
+ */
1915
+ public getProjectEndpoint<ThrowOnError extends boolean = true>(
1916
+ options: Options<GetProjectEndpointData, ThrowOnError>,
1917
+ ) {
1918
+ return (options.client ?? this._client).get<
1919
+ GetProjectEndpointResponses,
1920
+ GetProjectEndpointErrors,
1921
+ ThrowOnError
1922
+ >({
1923
+ url: "/projects/{project_id}/endpoints/{endpoint_id}",
1924
+ ...options,
1925
+ });
1926
+ }
1927
+
1928
+ /**
1929
+ * Update compute endpoint
1930
+ * Updates the specified compute endpoint.
1931
+ *
1932
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1933
+ * You can obtain an `endpoint_id` and `branch_id` by listing your project's compute endpoints.
1934
+ * An `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix.
1935
+ * For more information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1936
+ *
1937
+ * If the returned list of operations is not empty, the compute endpoint is not ready to use.
1938
+ * The client must wait for the last operation to finish before using the compute endpoint.
1939
+ * If the compute endpoint was idle before the update, it becomes active for a short period of time,
1940
+ * and the control plane suspends it again after the update.
1941
+ *
1942
+ */
1943
+ public updateProjectEndpoint<ThrowOnError extends boolean = true>(
1944
+ options: Options<UpdateProjectEndpointData, ThrowOnError>,
1945
+ ) {
1946
+ return (options.client ?? this._client).patch<
1947
+ UpdateProjectEndpointResponses,
1948
+ UpdateProjectEndpointErrors,
1949
+ ThrowOnError
1950
+ >({
1951
+ url: "/projects/{project_id}/endpoints/{endpoint_id}",
1952
+ ...options,
1953
+ headers: {
1954
+ "Content-Type": "application/json",
1955
+ ...options.headers,
1956
+ },
1957
+ });
1958
+ }
1959
+
1960
+ /**
1961
+ * Start compute endpoint
1962
+ * Starts a compute endpoint. The compute endpoint is ready to use
1963
+ * after the last operation in chain finishes successfully.
1964
+ *
1965
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1966
+ * You can obtain an `endpoint_id` by listing your project's compute endpoints.
1967
+ * An `endpoint_id` has an `ep-` prefix.
1968
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1969
+ *
1970
+ */
1971
+ public startProjectEndpoint<ThrowOnError extends boolean = true>(
1972
+ options: Options<StartProjectEndpointData, ThrowOnError>,
1973
+ ) {
1974
+ return (options.client ?? this._client).post<
1975
+ StartProjectEndpointResponses,
1976
+ StartProjectEndpointErrors,
1977
+ ThrowOnError
1978
+ >({
1979
+ url: "/projects/{project_id}/endpoints/{endpoint_id}/start",
1980
+ ...options,
1981
+ });
1982
+ }
1983
+
1984
+ /**
1985
+ * Suspend compute endpoint
1986
+ * Suspend the specified compute endpoint
1987
+ * You can obtain a `project_id` by listing the projects for your Neon account.
1988
+ * You can obtain an `endpoint_id` by listing your project's compute endpoints.
1989
+ * An `endpoint_id` has an `ep-` prefix.
1990
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
1991
+ *
1992
+ */
1993
+ public suspendProjectEndpoint<ThrowOnError extends boolean = true>(
1994
+ options: Options<SuspendProjectEndpointData, ThrowOnError>,
1995
+ ) {
1996
+ return (options.client ?? this._client).post<
1997
+ SuspendProjectEndpointResponses,
1998
+ SuspendProjectEndpointErrors,
1999
+ ThrowOnError
2000
+ >({
2001
+ url: "/projects/{project_id}/endpoints/{endpoint_id}/suspend",
2002
+ ...options,
2003
+ });
2004
+ }
2005
+
2006
+ /**
2007
+ * Restart compute endpoint
2008
+ * Restart the specified compute endpoint: suspend immediately followed by start operations.
2009
+ * You can obtain a `project_id` by listing the projects for your Neon account.
2010
+ * You can obtain an `endpoint_id` by listing your project's compute endpoints.
2011
+ * An `endpoint_id` has an `ep-` prefix.
2012
+ * For information about compute endpoints, see [Manage computes](https://neon.tech/docs/manage/endpoints/).
2013
+ *
2014
+ */
2015
+ public restartProjectEndpoint<ThrowOnError extends boolean = true>(
2016
+ options: Options<RestartProjectEndpointData, ThrowOnError>,
2017
+ ) {
2018
+ return (options.client ?? this._client).post<
2019
+ RestartProjectEndpointResponses,
2020
+ RestartProjectEndpointErrors,
2021
+ ThrowOnError
2022
+ >({
2023
+ url: "/projects/{project_id}/endpoints/{endpoint_id}/restart",
2024
+ ...options,
2025
+ });
2026
+ }
2027
+
2028
+ /**
2029
+ * Retrieve account consumption metrics
2030
+ * Retrieves consumption metrics for Scale, Business, and Enterprise plan accounts. History begins at the time of upgrade.
2031
+ *
2032
+ */
2033
+ public getConsumptionHistoryPerAccount<ThrowOnError extends boolean = true>(
2034
+ options: Options<GetConsumptionHistoryPerAccountData, ThrowOnError>,
2035
+ ) {
2036
+ return (options.client ?? this._client).get<
2037
+ GetConsumptionHistoryPerAccountResponses,
2038
+ GetConsumptionHistoryPerAccountErrors,
2039
+ ThrowOnError
2040
+ >({
2041
+ url: "/consumption_history/account",
2042
+ ...options,
2043
+ });
2044
+ }
2045
+
2046
+ /**
2047
+ * Retrieve project consumption metrics
2048
+ * Retrieves consumption metrics for Scale, Business, and Enterprise plan projects. History begins at the time of upgrade.
2049
+ * Issuing a call to this API does not wake a project's compute endpoint.
2050
+ *
2051
+ */
2052
+ public getConsumptionHistoryPerProject<ThrowOnError extends boolean = true>(
2053
+ options: Options<GetConsumptionHistoryPerProjectData, ThrowOnError>,
2054
+ ) {
2055
+ return (options.client ?? this._client).get<
2056
+ GetConsumptionHistoryPerProjectResponses,
2057
+ GetConsumptionHistoryPerProjectErrors,
2058
+ ThrowOnError
2059
+ >({
2060
+ url: "/consumption_history/projects",
2061
+ ...options,
2062
+ });
2063
+ }
2064
+
2065
+ /**
2066
+ * Retrieve organization details
2067
+ * Retrieves information about the specified organization.
2068
+ *
2069
+ */
2070
+ public getOrganization<ThrowOnError extends boolean = true>(
2071
+ options: Options<GetOrganizationData, ThrowOnError>,
2072
+ ) {
2073
+ return (options.client ?? this._client).get<
2074
+ GetOrganizationResponses,
2075
+ GetOrganizationErrors,
2076
+ ThrowOnError
2077
+ >({
2078
+ url: "/organizations/{org_id}",
2079
+ ...options,
2080
+ });
2081
+ }
2082
+
2083
+ /**
2084
+ * List organization API keys
2085
+ * Retrieves the API keys for the specified organization.
2086
+ * The response does not include API key tokens. A token is only provided when creating an API key.
2087
+ * API keys can also be managed in the Neon Console.
2088
+ * For more information, see [Manage API keys](https://neon.tech/docs/manage/api-keys/).
2089
+ *
2090
+ */
2091
+ public listOrgApiKeys<ThrowOnError extends boolean = true>(
2092
+ options: Options<ListOrgApiKeysData, ThrowOnError>,
2093
+ ) {
2094
+ return (options.client ?? this._client).get<
2095
+ ListOrgApiKeysResponses,
2096
+ ListOrgApiKeysErrors,
2097
+ ThrowOnError
2098
+ >({
2099
+ url: "/organizations/{org_id}/api_keys",
2100
+ ...options,
2101
+ });
2102
+ }
2103
+
2104
+ /**
2105
+ * Create organization API key
2106
+ * Creates an API key for the specified organization.
2107
+ * The `key_name` is a user-specified name for the key.
2108
+ * This method returns an `id` and `key`. The `key` is a randomly generated, 64-bit token required to access the Neon API.
2109
+ * API keys can also be managed in the Neon Console.
2110
+ * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
2111
+ *
2112
+ */
2113
+ public createOrgApiKey<ThrowOnError extends boolean = true>(
2114
+ options: Options<CreateOrgApiKeyData, ThrowOnError>,
2115
+ ) {
2116
+ return (options.client ?? this._client).post<
2117
+ CreateOrgApiKeyResponses,
2118
+ CreateOrgApiKeyErrors,
2119
+ ThrowOnError
2120
+ >({
2121
+ url: "/organizations/{org_id}/api_keys",
2122
+ ...options,
2123
+ headers: {
2124
+ "Content-Type": "application/json",
2125
+ ...options.headers,
2126
+ },
2127
+ });
2128
+ }
2129
+
2130
+ /**
2131
+ * Revoke organization API key
2132
+ * Revokes the specified organization API key.
2133
+ * An API key that is no longer needed can be revoked.
2134
+ * This action cannot be reversed.
2135
+ * You can obtain `key_id` values by listing the API keys for an organization.
2136
+ * API keys can also be managed in the Neon Console.
2137
+ * See [Manage API keys](https://neon.tech/docs/manage/api-keys/).
2138
+ *
2139
+ */
2140
+ public revokeOrgApiKey<ThrowOnError extends boolean = true>(
2141
+ options: Options<RevokeOrgApiKeyData, ThrowOnError>,
2142
+ ) {
2143
+ return (options.client ?? this._client).delete<
2144
+ RevokeOrgApiKeyResponses,
2145
+ RevokeOrgApiKeyErrors,
2146
+ ThrowOnError
2147
+ >({
2148
+ url: "/organizations/{org_id}/api_keys/{key_id}",
2149
+ ...options,
2150
+ });
2151
+ }
2152
+
2153
+ /**
2154
+ * Retrieve organization members details
2155
+ * Retrieves information about the specified organization members.
2156
+ *
2157
+ */
2158
+ public getOrganizationMembers<ThrowOnError extends boolean = true>(
2159
+ options: Options<GetOrganizationMembersData, ThrowOnError>,
2160
+ ) {
2161
+ return (options.client ?? this._client).get<
2162
+ GetOrganizationMembersResponses,
2163
+ GetOrganizationMembersErrors,
2164
+ ThrowOnError
2165
+ >({
2166
+ url: "/organizations/{org_id}/members",
2167
+ ...options,
2168
+ });
2169
+ }
2170
+
2171
+ /**
2172
+ * Remove member from the organization
2173
+ * Remove member from the organization.
2174
+ * Only an admin of the organization can perform this action.
2175
+ * If another admin is being removed, it will not be allows in case it is the only admin left in the organization.
2176
+ *
2177
+ */
2178
+ public removeOrganizationMember<ThrowOnError extends boolean = true>(
2179
+ options: Options<RemoveOrganizationMemberData, ThrowOnError>,
2180
+ ) {
2181
+ return (options.client ?? this._client).delete<
2182
+ RemoveOrganizationMemberResponses,
2183
+ RemoveOrganizationMemberErrors,
2184
+ ThrowOnError
2185
+ >({
2186
+ url: "/organizations/{org_id}/members/{member_id}",
2187
+ ...options,
2188
+ });
2189
+ }
2190
+
2191
+ /**
2192
+ * Retrieve organization member details
2193
+ * Retrieves information about the specified organization member.
2194
+ *
2195
+ */
2196
+ public getOrganizationMember<ThrowOnError extends boolean = true>(
2197
+ options: Options<GetOrganizationMemberData, ThrowOnError>,
2198
+ ) {
2199
+ return (options.client ?? this._client).get<
2200
+ GetOrganizationMemberResponses,
2201
+ GetOrganizationMemberErrors,
2202
+ ThrowOnError
2203
+ >({
2204
+ url: "/organizations/{org_id}/members/{member_id}",
2205
+ ...options,
2206
+ });
2207
+ }
2208
+
2209
+ /**
2210
+ * Update role for organization member
2211
+ * Only an admin can perform this action.
2212
+ *
2213
+ */
2214
+ public updateOrganizationMember<ThrowOnError extends boolean = true>(
2215
+ options: Options<UpdateOrganizationMemberData, ThrowOnError>,
2216
+ ) {
2217
+ return (options.client ?? this._client).patch<
2218
+ UpdateOrganizationMemberResponses,
2219
+ UpdateOrganizationMemberErrors,
2220
+ ThrowOnError
2221
+ >({
2222
+ url: "/organizations/{org_id}/members/{member_id}",
2223
+ ...options,
2224
+ headers: {
2225
+ "Content-Type": "application/json",
2226
+ ...options.headers,
2227
+ },
2228
+ });
2229
+ }
2230
+
2231
+ /**
2232
+ * Retrieve organization invitation details
2233
+ * Retrieves information about extended invitations for the specified organization
2234
+ *
2235
+ */
2236
+ public getOrganizationInvitations<ThrowOnError extends boolean = true>(
2237
+ options: Options<GetOrganizationInvitationsData, ThrowOnError>,
2238
+ ) {
2239
+ return (options.client ?? this._client).get<
2240
+ GetOrganizationInvitationsResponses,
2241
+ GetOrganizationInvitationsErrors,
2242
+ ThrowOnError
2243
+ >({
2244
+ url: "/organizations/{org_id}/invitations",
2245
+ ...options,
2246
+ });
2247
+ }
2248
+
2249
+ /**
2250
+ * Create organization invitations
2251
+ * Creates invitations for a specific organization.
2252
+ * If the invited user has an existing account, they automatically join as a member.
2253
+ * If they don't yet have an account, they are invited to create one, after which they become a member.
2254
+ * Each invited user receives an email notification.
2255
+ *
2256
+ */
2257
+ public createOrganizationInvitations<ThrowOnError extends boolean = true>(
2258
+ options: Options<CreateOrganizationInvitationsData, ThrowOnError>,
2259
+ ) {
2260
+ return (options.client ?? this._client).post<
2261
+ CreateOrganizationInvitationsResponses,
2262
+ CreateOrganizationInvitationsErrors,
2263
+ ThrowOnError
2264
+ >({
2265
+ url: "/organizations/{org_id}/invitations",
2266
+ ...options,
2267
+ headers: {
2268
+ "Content-Type": "application/json",
2269
+ ...options.headers,
2270
+ },
2271
+ });
2272
+ }
2273
+
2274
+ /**
2275
+ * Transfer projects between organizations
2276
+ * Transfers selected projects, identified by their IDs, from your organization to another specified organization.
2277
+ *
2278
+ */
2279
+ public transferProjectsFromOrgToOrg<ThrowOnError extends boolean = true>(
2280
+ options: Options<TransferProjectsFromOrgToOrgData, ThrowOnError>,
2281
+ ) {
2282
+ return (options.client ?? this._client).post<
2283
+ TransferProjectsFromOrgToOrgResponses,
2284
+ TransferProjectsFromOrgToOrgErrors,
2285
+ ThrowOnError
2286
+ >({
2287
+ url: "/organizations/{source_org_id}/projects/transfer",
2288
+ ...options,
2289
+ headers: {
2290
+ "Content-Type": "application/json",
2291
+ ...options.headers,
2292
+ },
2293
+ });
2294
+ }
2295
+
2296
+ /**
2297
+ * List VPC endpoints across all regions
2298
+ * Retrieves the list of VPC endpoints for the specified Neon organization across all regions.
2299
+ *
2300
+ */
2301
+ public listOrganizationVpcEndpointsAllRegions<
2302
+ ThrowOnError extends boolean = true,
2303
+ >(
2304
+ options: Options<ListOrganizationVpcEndpointsAllRegionsData, ThrowOnError>,
2305
+ ) {
2306
+ return (options.client ?? this._client).get<
2307
+ ListOrganizationVpcEndpointsAllRegionsResponses,
2308
+ ListOrganizationVpcEndpointsAllRegionsErrors,
2309
+ ThrowOnError
2310
+ >({
2311
+ url: "/organizations/{org_id}/vpc/vpc_endpoints",
2312
+ ...options,
2313
+ });
2314
+ }
2315
+
2316
+ /**
2317
+ * List VPC endpoints
2318
+ * Retrieves the list of VPC endpoints for the specified Neon organization.
2319
+ *
2320
+ */
2321
+ public listOrganizationVpcEndpoints<ThrowOnError extends boolean = true>(
2322
+ options: Options<ListOrganizationVpcEndpointsData, ThrowOnError>,
2323
+ ) {
2324
+ return (options.client ?? this._client).get<
2325
+ ListOrganizationVpcEndpointsResponses,
2326
+ ListOrganizationVpcEndpointsErrors,
2327
+ ThrowOnError
2328
+ >({
2329
+ url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints",
2330
+ ...options,
2331
+ });
2332
+ }
2333
+
2334
+ /**
2335
+ * Delete VPC endpoint
2336
+ * Deletes the VPC endpoint from the specified Neon organization.
2337
+ * If you delete a VPC endpoint from a Neon organization, that VPC endpoint cannot
2338
+ * be added back to the Neon organization.
2339
+ *
2340
+ */
2341
+ public deleteOrganizationVpcEndpoint<ThrowOnError extends boolean = true>(
2342
+ options: Options<DeleteOrganizationVpcEndpointData, ThrowOnError>,
2343
+ ) {
2344
+ return (options.client ?? this._client).delete<
2345
+ DeleteOrganizationVpcEndpointResponses,
2346
+ DeleteOrganizationVpcEndpointErrors,
2347
+ ThrowOnError
2348
+ >({
2349
+ url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
2350
+ ...options,
2351
+ });
2352
+ }
2353
+
2354
+ /**
2355
+ * Retrieve VPC endpoint details
2356
+ * Retrieves the current state and configuration details of a specified VPC endpoint.
2357
+ *
2358
+ */
2359
+ public getOrganizationVpcEndpointDetails<ThrowOnError extends boolean = true>(
2360
+ options: Options<GetOrganizationVpcEndpointDetailsData, ThrowOnError>,
2361
+ ) {
2362
+ return (options.client ?? this._client).get<
2363
+ GetOrganizationVpcEndpointDetailsResponses,
2364
+ GetOrganizationVpcEndpointDetailsErrors,
2365
+ ThrowOnError
2366
+ >({
2367
+ url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
2368
+ ...options,
2369
+ });
2370
+ }
2371
+
2372
+ /**
2373
+ * Assign or update VPC endpoint
2374
+ * Assigns a VPC endpoint to a Neon organization or updates its existing assignment.
2375
+ *
2376
+ */
2377
+ public assignOrganizationVpcEndpoint<ThrowOnError extends boolean = true>(
2378
+ options: Options<AssignOrganizationVpcEndpointData, ThrowOnError>,
2379
+ ) {
2380
+ return (options.client ?? this._client).post<
2381
+ AssignOrganizationVpcEndpointResponses,
2382
+ AssignOrganizationVpcEndpointErrors,
2383
+ ThrowOnError
2384
+ >({
2385
+ url: "/organizations/{org_id}/vpc/region/{region_id}/vpc_endpoints/{vpc_endpoint_id}",
2386
+ ...options,
2387
+ headers: {
2388
+ "Content-Type": "application/json",
2389
+ ...options.headers,
2390
+ },
2391
+ });
2392
+ }
2393
+
2394
+ /**
2395
+ * List supported regions
2396
+ * Lists supported Neon regions
2397
+ *
2398
+ */
2399
+ public getActiveRegions<ThrowOnError extends boolean = true>(
2400
+ options?: Options<GetActiveRegionsData, ThrowOnError>,
2401
+ ) {
2402
+ return (options?.client ?? this._client).get<
2403
+ GetActiveRegionsResponses,
2404
+ GetActiveRegionsErrors,
2405
+ ThrowOnError
2406
+ >({
2407
+ url: "/regions",
2408
+ ...options,
2409
+ });
2410
+ }
2411
+
2412
+ /**
2413
+ * Retrieve current user details
2414
+ * Retrieves information about the current Neon user account.
2415
+ *
2416
+ */
2417
+ public getCurrentUserInfo<ThrowOnError extends boolean = true>(
2418
+ options?: Options<GetCurrentUserInfoData, ThrowOnError>,
2419
+ ) {
2420
+ return (options?.client ?? this._client).get<
2421
+ GetCurrentUserInfoResponses,
2422
+ GetCurrentUserInfoErrors,
2423
+ ThrowOnError
2424
+ >({
2425
+ url: "/users/me",
2426
+ ...options,
2427
+ });
2428
+ }
2429
+
2430
+ /**
2431
+ * Retrieve current user organizations list
2432
+ * Retrieves information about the current Neon user's organizations
2433
+ *
2434
+ */
2435
+ public getCurrentUserOrganizations<ThrowOnError extends boolean = true>(
2436
+ options?: Options<GetCurrentUserOrganizationsData, ThrowOnError>,
2437
+ ) {
2438
+ return (options?.client ?? this._client).get<
2439
+ GetCurrentUserOrganizationsResponses,
2440
+ GetCurrentUserOrganizationsErrors,
2441
+ ThrowOnError
2442
+ >({
2443
+ url: "/users/me/organizations",
2444
+ ...options,
2445
+ });
2446
+ }
2447
+
2448
+ /**
2449
+ * Transfer projects from personal account to organization
2450
+ * Transfers selected projects, identified by their IDs, from your personal account to a specified organization.
2451
+ *
2452
+ */
2453
+ public transferProjectsFromUserToOrg<ThrowOnError extends boolean = true>(
2454
+ options: Options<TransferProjectsFromUserToOrgData, ThrowOnError>,
2455
+ ) {
2456
+ return (options.client ?? this._client).post<
2457
+ TransferProjectsFromUserToOrgResponses,
2458
+ TransferProjectsFromUserToOrgErrors,
2459
+ ThrowOnError
2460
+ >({
2461
+ url: "/users/me/projects/transfer",
2462
+ ...options,
2463
+ headers: {
2464
+ "Content-Type": "application/json",
2465
+ ...options.headers,
2466
+ },
2467
+ });
2468
+ }
2469
+
2470
+ /**
2471
+ * Get request authentication details
2472
+ * Returns auth information about the passed credentials. It can refer to an API key, Bearer token or OAuth session.
2473
+ *
2474
+ */
2475
+ public getAuthDetails<ThrowOnError extends boolean = true>(
2476
+ options?: Options<GetAuthDetailsData, ThrowOnError>,
2477
+ ) {
2478
+ return (options?.client ?? this._client).get<
2479
+ GetAuthDetailsResponses,
2480
+ GetAuthDetailsErrors,
2481
+ ThrowOnError
2482
+ >({
2483
+ url: "/auth",
2484
+ ...options,
2485
+ });
2486
+ }
2487
+
2488
+ /**
2489
+ * Create snapshot
2490
+ * Create a snapshot from the specified branch using the provided parameters.
2491
+ * This endpoint may initiate an asynchronous operation.
2492
+ *
2493
+ * **Note**: This endpoint is currently in Beta.
2494
+ *
2495
+ */
2496
+ public createSnapshot<ThrowOnError extends boolean = true>(
2497
+ options: Options<CreateSnapshotData, ThrowOnError>,
2498
+ ) {
2499
+ return (options.client ?? this._client).post<
2500
+ CreateSnapshotResponses,
2501
+ CreateSnapshotErrors,
2502
+ ThrowOnError
2503
+ >({
2504
+ url: "/projects/{project_id}/branches/{branch_id}/snapshot",
2505
+ ...options,
2506
+ });
2507
+ }
2508
+
2509
+ /**
2510
+ * List project snapshots
2511
+ * List the snapshots for the specified project.
2512
+ *
2513
+ * **Note**: This endpoint is currently in Beta.
2514
+ *
2515
+ */
2516
+ public listSnapshots<ThrowOnError extends boolean = true>(
2517
+ options: Options<ListSnapshotsData, ThrowOnError>,
2518
+ ) {
2519
+ return (options.client ?? this._client).get<
2520
+ ListSnapshotsResponses,
2521
+ ListSnapshotsErrors,
2522
+ ThrowOnError
2523
+ >({
2524
+ url: "/projects/{project_id}/snapshots",
2525
+ ...options,
2526
+ });
2527
+ }
2528
+
2529
+ /**
2530
+ * Delete snapshot
2531
+ * Delete the specified snapshot.
2532
+ *
2533
+ * **Note**: This endpoint is currently in Beta.
2534
+ *
2535
+ */
2536
+ public deleteSnapshot<ThrowOnError extends boolean = true>(
2537
+ options: Options<DeleteSnapshotData, ThrowOnError>,
2538
+ ) {
2539
+ return (options.client ?? this._client).delete<
2540
+ DeleteSnapshotResponses,
2541
+ DeleteSnapshotErrors,
2542
+ ThrowOnError
2543
+ >({
2544
+ url: "/projects/{project_id}/snapshots/{snapshot_id}",
2545
+ ...options,
2546
+ });
2547
+ }
2548
+
2549
+ /**
2550
+ * Update snapshot
2551
+ * Update the specified snapshot.
2552
+ *
2553
+ * **Note**: This endpoint is currently in Beta.
2554
+ *
2555
+ */
2556
+ public updateSnapshot<ThrowOnError extends boolean = true>(
2557
+ options: Options<UpdateSnapshotData, ThrowOnError>,
2558
+ ) {
2559
+ return (options.client ?? this._client).patch<
2560
+ UpdateSnapshotResponses,
2561
+ UpdateSnapshotErrors,
2562
+ ThrowOnError
2563
+ >({
2564
+ url: "/projects/{project_id}/snapshots/{snapshot_id}",
2565
+ ...options,
2566
+ headers: {
2567
+ "Content-Type": "application/json",
2568
+ ...options.headers,
2569
+ },
2570
+ });
2571
+ }
2572
+
2573
+ /**
2574
+ * Restore snapshot
2575
+ * Restore the specified snapshot to a new branch and optionally finalize the restore operation.
2576
+ *
2577
+ * **Note**: This endpoint is currently in Beta.
2578
+ *
2579
+ */
2580
+ public restoreSnapshot<ThrowOnError extends boolean = true>(
2581
+ options: Options<RestoreSnapshotData, ThrowOnError>,
2582
+ ) {
2583
+ return (options.client ?? this._client).post<
2584
+ RestoreSnapshotResponses,
2585
+ RestoreSnapshotErrors,
2586
+ ThrowOnError
2587
+ >({
2588
+ url: "/projects/{project_id}/snapshots/{snapshot_id}/restore",
2589
+ ...options,
2590
+ headers: {
2591
+ "Content-Type": "application/json",
2592
+ ...options.headers,
2593
+ },
2594
+ });
2595
+ }
2596
+ }