better-supabase 0.7.1 → 0.8.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 (499) hide show
  1. package/README.md +6 -2
  2. package/dist/{access-sql-B0dF-SoF.js → access-sql-CrSbK1q-.js} +1 -1
  3. package/dist/{adapter-iKgjHVPx.js → adapter-CN45ibbV.js} +658 -157
  4. package/dist/{agents-CVHGd7It.d.ts → agents-BY_LQXtQ.d.ts} +4 -4
  5. package/dist/{ai-cache-CBWs1W0k.js → ai-cache-Dfgk8nBT.js} +2 -1
  6. package/dist/{ai-cache-DaDu_G5L.d.ts → ai-cache-DrUMMgp6.d.ts} +4 -4
  7. package/dist/{ai-chat-B24UI962.js → ai-chat-CVLRWbtS.js} +4 -3
  8. package/dist/{ai-chat-7amvXjmQ.d.ts → ai-chat-DXkMy74O.d.ts} +5 -5
  9. package/dist/{ai-files-CSPNswUY.js → ai-files-CioLu5du.js} +5 -4
  10. package/dist/ai-message-DfaP8sis.js +14 -0
  11. package/dist/ai-sdk/agents/index.d.ts +4 -4
  12. package/dist/ai-sdk/batches/index.d.ts +4 -4
  13. package/dist/ai-sdk/batches/index.js +4 -4
  14. package/dist/ai-sdk/cache/index.d.ts +2 -2
  15. package/dist/ai-sdk/cache/index.js +2 -2
  16. package/dist/ai-sdk/chat/index.d.ts +1 -1
  17. package/dist/ai-sdk/chat/index.js +8 -20
  18. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  19. package/dist/ai-sdk/files/index.d.ts +3 -3
  20. package/dist/ai-sdk/files/index.js +4 -4
  21. package/dist/ai-sdk/index.d.ts +37 -9
  22. package/dist/ai-sdk/index.js +3 -2
  23. package/dist/ai-sdk/mcp/index.d.ts +43 -6
  24. package/dist/ai-sdk/mcp/index.js +36 -7
  25. package/dist/ai-sdk/memory/index.d.ts +2 -2
  26. package/dist/ai-sdk/memory/index.js +1 -1
  27. package/dist/ai-sdk/workflow/index.d.ts +6 -6
  28. package/dist/ai-sdk/workflow/index.js +13 -24
  29. package/dist/{ai-tasks-Cd1HMFvB.d.ts → ai-tasks-BRQ6iQLc.d.ts} +4 -4
  30. package/dist/{announcements-ZRGnScWI.d.ts → announcements-Bouy0Ski.d.ts} +3 -3
  31. package/dist/{announcements-CiyOs-xP.js → announcements-p_BFofiR.js} +1 -1
  32. package/dist/api-Dnf2q-Ht.d.ts +370 -0
  33. package/dist/api-DtHFC037.js +676 -0
  34. package/dist/{api-keys-CIjghYjV.d.ts → api-keys-C8BlF3L2.d.ts} +4 -4
  35. package/dist/arazzo/index.d.ts +255 -0
  36. package/dist/arazzo/index.js +622 -0
  37. package/dist/{assistant-DwdpDH1q.d.ts → assistant-DBlFDZsi.d.ts} +5 -5
  38. package/dist/astro/index.d.ts +7 -7
  39. package/dist/astro/index.js +7 -7
  40. package/dist/asyncapi/index.d.ts +103 -0
  41. package/dist/asyncapi/index.js +569 -0
  42. package/dist/authorizer-ayxUDXXP.js +126 -0
  43. package/dist/authorizer-eiOjo-3l.d.ts +73 -0
  44. package/dist/better-result/index.d.ts +118 -0
  45. package/dist/better-result/index.js +64 -0
  46. package/dist/{bind-l4kAvYSv.js → bind-ButSzrHe.js} +1 -1
  47. package/dist/{bind-Bu_ZNa3W.d.ts → bind-CQ5mPyX1.d.ts} +3 -3
  48. package/dist/{block-events-CrT8r7Fe.js → block-events-DTxU5tfr.js} +18 -3
  49. package/dist/{block-fields-GFkxl4dP.js → block-fields-CroxUuF2.js} +3 -3
  50. package/dist/{block-fields-SJ6fEf3o.d.ts → block-fields-D1pfrcIY.d.ts} +2 -2
  51. package/dist/{block-helpers-CKtbFcRv.d.ts → block-helpers-C0Xj8War.d.ts} +2 -2
  52. package/dist/{block-helpers-DWHxHsEQ.js → block-helpers-Cy3pB96I.js} +41 -9
  53. package/dist/{block-hooks-BmjMyXTa.js → block-hooks-BPNMIlLl.js} +3 -3
  54. package/dist/{block-hooks-plbZ0AbJ.d.ts → block-hooks-DaOVC7SC.d.ts} +3 -3
  55. package/dist/{block-transport-BLr-ZgLc.js → block-transport-bAKh-dGc.js} +28 -2
  56. package/dist/{block-transport-DvaoPuZ9.d.ts → block-transport-inD4fFq-.d.ts} +24 -2
  57. package/dist/blocks/agents/index.d.ts +3 -3
  58. package/dist/blocks/agents/index.js +5 -4
  59. package/dist/blocks/ai-cache/index.d.ts +3 -3
  60. package/dist/blocks/ai-cache/index.js +3 -3
  61. package/dist/blocks/ai-chat/index.d.ts +9 -4
  62. package/dist/blocks/ai-chat/index.js +5 -5
  63. package/dist/blocks/ai-chat/react/index.d.ts +3 -3
  64. package/dist/blocks/ai-chat/react/index.js +5 -5
  65. package/dist/blocks/ai-files/index.d.ts +3 -3
  66. package/dist/blocks/ai-files/index.js +3 -3
  67. package/dist/blocks/ai-providers/index.d.ts +3 -3
  68. package/dist/blocks/ai-providers/index.js +8 -7
  69. package/dist/blocks/ai-tasks/index.d.ts +3 -3
  70. package/dist/blocks/ai-tasks/index.js +7 -6
  71. package/dist/blocks/announcements/index.d.ts +3 -3
  72. package/dist/blocks/announcements/index.js +3 -3
  73. package/dist/blocks/announcements/react/index.d.ts +3 -3
  74. package/dist/blocks/announcements/react/index.js +3 -3
  75. package/dist/blocks/api-keys/index.d.ts +5 -5
  76. package/dist/blocks/api-keys/index.js +8 -8
  77. package/dist/blocks/attachments/index.d.ts +12 -8
  78. package/dist/blocks/attachments/index.js +22 -13
  79. package/dist/blocks/audit/index.d.ts +21 -10
  80. package/dist/blocks/audit/index.js +30 -11
  81. package/dist/blocks/billing/index.d.ts +11 -9
  82. package/dist/blocks/billing/index.js +15 -15
  83. package/dist/blocks/comments/index.d.ts +8 -8
  84. package/dist/blocks/comments/index.js +8 -7
  85. package/dist/blocks/connectors/index.d.ts +3 -3
  86. package/dist/blocks/connectors/index.js +7 -6
  87. package/dist/blocks/data-lifecycle/index.d.ts +12 -8
  88. package/dist/blocks/data-lifecycle/index.js +13 -8
  89. package/dist/blocks/entitlements/index.d.ts +3 -3
  90. package/dist/blocks/entitlements/index.js +1 -1
  91. package/dist/blocks/flags/index.d.ts +4 -4
  92. package/dist/blocks/flags/index.js +4 -3
  93. package/dist/blocks/inbox/index.d.ts +3 -3
  94. package/dist/blocks/inbox/index.js +4 -5
  95. package/dist/blocks/inbox/react/index.d.ts +1 -1
  96. package/dist/blocks/inbox/react/index.js +1 -1
  97. package/dist/blocks/inbox/react/server.d.ts +1 -1
  98. package/dist/blocks/index.d.ts +10 -10
  99. package/dist/blocks/index.js +6 -6
  100. package/dist/blocks/jobs/index.d.ts +48 -32
  101. package/dist/blocks/jobs/index.js +44 -287
  102. package/dist/blocks/knowledge/index.d.ts +3 -3
  103. package/dist/blocks/knowledge/index.js +3 -3
  104. package/dist/blocks/memory/index.d.ts +4 -4
  105. package/dist/blocks/memory/index.js +7 -6
  106. package/dist/blocks/notifications/index.d.ts +11 -9
  107. package/dist/blocks/notifications/index.js +20 -25
  108. package/dist/blocks/notifications/react/index.d.ts +1 -1
  109. package/dist/blocks/notifications/react/index.js +1 -1
  110. package/dist/blocks/onboarding/index.d.ts +3 -3
  111. package/dist/blocks/onboarding/index.js +3 -3
  112. package/dist/blocks/onboarding/react/index.d.ts +2 -2
  113. package/dist/blocks/onboarding/react/index.js +2 -2
  114. package/dist/blocks/onboarding/react/server.d.ts +1 -1
  115. package/dist/blocks/organizations/index.d.ts +9 -9
  116. package/dist/blocks/organizations/index.js +11 -18
  117. package/dist/blocks/outbox/index.d.ts +2 -2
  118. package/dist/blocks/outbox/index.js +16 -25
  119. package/dist/blocks/profiles/index.d.ts +7 -7
  120. package/dist/blocks/profiles/index.js +7 -6
  121. package/dist/blocks/push/index.d.ts +4 -4
  122. package/dist/blocks/push/index.js +3 -3
  123. package/dist/blocks/settings/index.d.ts +4 -4
  124. package/dist/blocks/settings/index.js +7 -6
  125. package/dist/blocks/sso/index.d.ts +5 -5
  126. package/dist/blocks/sso/index.js +6 -5
  127. package/dist/blocks/usage/index.d.ts +3 -3
  128. package/dist/blocks/usage/index.js +5 -4
  129. package/dist/blocks/waitlist/index.d.ts +5 -5
  130. package/dist/blocks/waitlist/index.js +5 -4
  131. package/dist/blocks/webhooks/index.d.ts +22 -13
  132. package/dist/blocks/webhooks/index.js +41 -70
  133. package/dist/blocks/workflow-builder/index.d.ts +4 -4
  134. package/dist/blocks/workflow-builder/index.js +3 -3
  135. package/dist/blocks/workflow-builder/react/index.d.ts +4 -4
  136. package/dist/blocks/workflow-builder/react/index.js +4 -4
  137. package/dist/blocks/workflows/index.d.ts +3 -3
  138. package/dist/blocks/workflows/index.js +3 -3
  139. package/dist/blocks/workflows/react/index.d.ts +3 -3
  140. package/dist/blocks/workflows/react/index.js +3 -3
  141. package/dist/build-hPwk3_X5.js +1296 -0
  142. package/dist/{build-BXIzE6Xv.js → build-meLuYGri.js} +3 -3
  143. package/dist/casing-DdFWEtqr.js +16 -0
  144. package/dist/chat-sdk/index.d.ts +6 -6
  145. package/dist/chat-sdk/index.js +5 -4
  146. package/dist/chat-sdk/react/index.d.ts +1 -1
  147. package/dist/chat-sdk/react/server.d.ts +1 -1
  148. package/dist/{claims-DDBQT6BK.js → claims-0KZVT804.js} +1 -1
  149. package/dist/cli/add-1dc5wM5k.js +69 -0
  150. package/dist/cli/arazzo-1.0-BalU61-_.js +532 -0
  151. package/dist/cli/arazzo-1.1-Bnfasbun.js +705 -0
  152. package/dist/cli/asyncapi-3.0.0-C78dBjR6.js +5593 -0
  153. package/dist/cli/asyncapi-3.1.0-g-7aIfV1.js +5833 -0
  154. package/dist/cli/bin.js +4 -4
  155. package/dist/cli/cache-CIfA-jBV.js +483 -0
  156. package/dist/cli/{codemod-Bl_tQpHn.js → codemod-JVlTQQG2.js} +4 -4
  157. package/dist/cli/{command-CK14fP91.js → command-DV-StG1x.js} +5 -0
  158. package/dist/cli/{config-DU7EJImt.js → config-C2Pz2_4A.js} +7 -4
  159. package/dist/cli/config-DpbF8ML3.js +2 -0
  160. package/dist/cli/{config-NiPxAmUF.js → config-M-WzL9O2.js} +116 -18
  161. package/dist/cli/{db-DOBPt660.js → db-BkcfOlyB.js} +2 -1
  162. package/dist/cli/{diff-SjkO5rNr.js → diff-D1jGdb3Y.js} +1 -1
  163. package/dist/cli/{doctor-DJk0aeBi.js → doctor-VcDtuusV.js} +316 -221
  164. package/dist/cli/emit-BHHfwUoT.js +1136 -0
  165. package/dist/cli/{env-qXgyMV6r.js → env-B--LMhEe.js} +13 -10
  166. package/dist/cli/env-vzBG90Um.js +2 -0
  167. package/dist/cli/{env-CJLbUVPB.js → env-zHJtMIBo.js} +11 -3
  168. package/dist/cli/{errors-4v4DTtda.js → errors-CqTLXe2M.js} +18 -2
  169. package/dist/cli/{fastest-levenshtein-CFN-lNDv.js → fastest-levenshtein-CF7BCi9l.js} +1 -1
  170. package/dist/cli/files-BVupXPIC.js +34 -0
  171. package/dist/cli/gen-DmVj3u4L.js +322 -0
  172. package/dist/cli/{init-BHuEQrQK.js → glue-C1UE8gQN.js} +16 -313
  173. package/dist/cli/index.d.ts +59 -31
  174. package/dist/cli/index.js +8 -6
  175. package/dist/cli/init-CVZ3s5kl.js +258 -0
  176. package/dist/cli/{introspect-DzR2nyQb.js → introspect-BToGNfm-.js} +14 -14
  177. package/dist/cli/{io-DI1mTdSA.js → io-CFzJVJ68.js} +5 -1
  178. package/dist/cli/{keys-BGCnnb-s.js → keys-CJhtIxJ3.js} +4 -4
  179. package/dist/cli/metadata-DSRKCaf-.js +133 -0
  180. package/dist/cli/names-D6LrQnOv.js +6 -0
  181. package/dist/cli/openapi-3.0-t7xwkuRH.js +928 -0
  182. package/dist/cli/openapi-3.1-CVze7tBS.js +870 -0
  183. package/dist/cli/openapi-3.2-CFoMYM01.js +1031 -0
  184. package/dist/cli/{openapi-BlRJ18s3.js → openapi-DWa4Ir1q.js} +8 -14
  185. package/dist/cli/prompts-BdeVmVpg.js +2 -0
  186. package/dist/cli/{prompts-BNcNfAve.js → prompts-DZJB1nTw.js} +6 -6
  187. package/dist/cli/{rolldown-runtime-BPOCksWG.js → rolldown-runtime-CMFfr-1z.js} +3 -1
  188. package/dist/cli/run-DA6_lg3w.js +389 -0
  189. package/dist/cli/run-DuN1MX-7.js +705 -0
  190. package/dist/cli/scaffold-5DenHSxF.js +292 -0
  191. package/dist/cli/scaffold-CwQUMFRb.js +2 -0
  192. package/dist/cli/{seed-DQzqT7LP.js → seed-CzBmrGON.js} +14 -18
  193. package/dist/cli/seed-DOmit9Hq.js +2 -0
  194. package/dist/cli/{skills-QQs4q68J.js → skills-CnO8QFS7.js} +7 -6
  195. package/dist/cli/snapshot-Bstk6ulj.js +287 -0
  196. package/dist/cli/source-args-BYfq6imV.js +31 -0
  197. package/dist/cli/spec-CzosTYm3.js +7438 -0
  198. package/dist/cli/spec-T_0Bcyw7.js +2 -0
  199. package/dist/cli/{sql-B8csQPyn.js → sql-BKOOQAX3.js} +240 -218
  200. package/dist/cli/sql-DJrNDxQm.js +3 -0
  201. package/dist/cli/{style-C0NFdJRL.js → style-CB3vxgh0.js} +3 -3
  202. package/dist/cli/typegen-Demi5-VQ.js +486 -0
  203. package/dist/cli/validate-Ca13ktgz.js +7522 -0
  204. package/dist/cli/{version-59gcepIG.js → version-B4k0aUxS.js} +1 -1
  205. package/dist/client/index.d.ts +4 -3
  206. package/dist/client/index.js +60 -3
  207. package/dist/client/native/index.d.ts +3 -3
  208. package/dist/client/native/index.js +3 -3
  209. package/dist/{client-CI0Z2zWX.js → client-wxeTQFtB.js} +36 -3
  210. package/dist/{clone-BfgmLU90.js → clone-dN9XOL1K.js} +9 -1
  211. package/dist/{cloud-event-BnmD5fb9.js → cloud-event-CTh9Sr5w.js} +16 -2
  212. package/dist/{cloud-event-C1JCc1bH.d.ts → cloud-event-Dune0KI7.d.ts} +16 -2
  213. package/dist/{compiler-DY_wkj4R.d.ts → compiler-V1qvcST1.d.ts} +2 -2
  214. package/dist/{compose-BIBNgAnq.js → compose-BHej1acw.js} +3 -3
  215. package/dist/{composite--yqry7uW.d.ts → composite-CWAJTRBF.d.ts} +6 -6
  216. package/dist/{composite-DXVUibdi.js → composite-zTe0TCqj.js} +4 -4
  217. package/dist/config/index.d.ts +3 -4
  218. package/dist/config/index.js +4 -4
  219. package/dist/config-DlKvtt95.js +540 -0
  220. package/dist/{connector-Dv8kK0MO.d.ts → connector-CySQEFcW.d.ts} +1 -1
  221. package/dist/{connectors-CrpknU0P.d.ts → connectors--PGhmiu0.d.ts} +4 -4
  222. package/dist/{context-BCrWe7ow.d.ts → context-DsV2SueA.d.ts} +11 -2
  223. package/dist/context-nPDvQ-Zl.js +41 -0
  224. package/dist/credentials/index.d.ts +5 -5
  225. package/dist/credentials/index.js +9 -17
  226. package/dist/{cron-DVPUg5k3.js → cron-D25Ukpxy.js} +1 -1
  227. package/dist/cron-route-D2AN9SA1.js +24 -0
  228. package/dist/{csv-DCK-PT1n.js → csv-BZnHA1Py.js} +1 -1
  229. package/dist/{define-B-TVjC25.js → define-CFQcvM20.js} +263 -229
  230. package/dist/{define-CJJkkr1-.d.ts → define-DmcfoNXB.d.ts} +136 -111
  231. package/dist/edge/index.d.ts +66 -13
  232. package/dist/edge/index.js +65 -39
  233. package/dist/elysia/index.d.ts +1 -1
  234. package/dist/elysia/index.js +1 -1
  235. package/dist/{embeddings-C9KGQnXt.d.ts → embeddings-B4vhS-dY.d.ts} +1 -1
  236. package/dist/{ended-XjeGQ5XW.d.ts → ended-CcvcRqEd.d.ts} +7 -1
  237. package/dist/{entitlements-DRl6ZJUm.js → entitlements-BYFf0Cdh.js} +2 -2
  238. package/dist/{entitlements-BKSVGtrG.d.ts → entitlements-Ds8qoYZ-.d.ts} +1 -1
  239. package/dist/env/index.d.ts +1 -1
  240. package/dist/env/index.js +9 -2
  241. package/dist/{errors-B11Duf73.js → errors-2M6CKMP4.js} +5 -0
  242. package/dist/{errors-DLjJHPLK.js → errors-rZ7VIqp6.js} +2 -2
  243. package/dist/{escape-like-ImTK0ps_.d.ts → escape-like-DDWoHzh_.d.ts} +1 -1
  244. package/dist/eve/index.d.ts +5 -5
  245. package/dist/eve/index.js +5 -11
  246. package/dist/{eve-gT2Fpjut.d.ts → eve-CoAIcCkq.d.ts} +2 -2
  247. package/dist/events/index.d.ts +4 -4
  248. package/dist/events/index.js +7 -2
  249. package/dist/{events-DWDhx77e.d.ts → events-D1BOCll8.d.ts} +6 -4
  250. package/dist/{executor-Bq28caBo.js → executor-B-fD7DLt.js} +52 -35
  251. package/dist/executor-B_Hfobee.js +162 -0
  252. package/dist/{executor-BVBFM86G.d.ts → executor-CpxLPCiz.d.ts} +1 -1
  253. package/dist/{executor-CaWigTyR.d.ts → executor-DfEtf0cq.d.ts} +43 -27
  254. package/dist/{executor-DvsBbNBS.d.ts → executor-Drzu3dBK.d.ts} +2 -2
  255. package/dist/{executor-DbvExCFC.d.ts → executor-ngjKL_Pe.d.ts} +2 -2
  256. package/dist/expo/index.d.ts +4 -4
  257. package/dist/expo/index.js +6 -6
  258. package/dist/expo-sqlite/index.d.ts +3 -3
  259. package/dist/expo-sqlite/index.js +2 -2
  260. package/dist/extra-CGQ2_q3S.js +10 -0
  261. package/dist/{field-errors-BFOa7WhB.d.ts → field-errors-DIe9XYWL.d.ts} +17 -7
  262. package/dist/{field-errors-VF1yb8yI.js → field-errors-DZVRWRkf.js} +1 -1
  263. package/dist/format-DTXdu8ya.d.ts +70 -0
  264. package/dist/{framework-BmzgK32X.d.ts → framework-148t1m3C.d.ts} +5 -5
  265. package/dist/{framework-a7aRCIqv.js → framework-3ey3QmrO.js} +2 -2
  266. package/dist/function-contract-BcZenXMO.d.ts +8 -0
  267. package/dist/{gateway-C1ssRHnf.d.ts → gateway-S9vicgeo.d.ts} +4 -4
  268. package/dist/{guards-BnzDvFrz.js → guards-6F2bCtQR.js} +3 -1
  269. package/dist/h3/index.d.ts +1 -1
  270. package/dist/h3/index.js +1 -1
  271. package/dist/h3/v1/index.d.ts +1 -1
  272. package/dist/h3/v1/index.js +1 -1
  273. package/dist/{message-CaKlqdsX.js → history-GH1HJWQV.js} +65 -13
  274. package/dist/hmac-DCud0myt.js +22 -0
  275. package/dist/hono/index.d.ts +19 -14
  276. package/dist/hono/index.js +21 -16
  277. package/dist/{hooks-1BTCJsiw.js → hooks-Bhza9Hnr.js} +68 -100
  278. package/dist/http-sbmBe5d2.js +25 -0
  279. package/dist/{inbox-i7E1ppo6.d.ts → inbox-Cd1KCEBL.d.ts} +3 -3
  280. package/dist/index-B72Rvv_j.d.ts +89 -0
  281. package/dist/{index-DunNRdnT.d.ts → index-BCHR4Ucl.d.ts} +4 -4
  282. package/dist/{index-CLg87OBW.d.ts → index-BUK7jUzR.d.ts} +6 -0
  283. package/dist/{config-D44Y7PAv.d.ts → index-Ba1SI-uO.d.ts} +625 -278
  284. package/dist/{index-D48jVS-N.d.ts → index-BfxOaOYs.d.ts} +4 -5
  285. package/dist/{index-ClmjK_o-.d.ts → index-CicIyqOe.d.ts} +4 -4
  286. package/dist/{index-ACiNPN4Z.d.ts → index-D69h4QqD.d.ts} +1 -1
  287. package/dist/index-DG2SUXDQ.d.ts +58 -0
  288. package/dist/{index-Bepi-Hgg.d.ts → index-DoNVLHOU.d.ts} +3 -3
  289. package/dist/{index-CdZKQF98.d.ts → index-R274XFlg.d.ts} +1 -1
  290. package/dist/{index-CewnYSpv.d.ts → index-_4R4b01v.d.ts} +8 -18
  291. package/dist/index.d.ts +89 -14
  292. package/dist/index.js +12 -11
  293. package/dist/{json-schema-CvER4kgT.js → json-schema-CT4tvrkA.js} +148 -102
  294. package/dist/{kit-Fm-Fv7q5.js → kit-BhHr9T9v.js} +36 -10
  295. package/dist/{kit-CkNzZUqv.d.ts → kit-W99LCPBS.d.ts} +13 -7
  296. package/dist/{knowledge-BXBbT0Tr.d.ts → knowledge-CAReFpRA.d.ts} +5 -5
  297. package/dist/{knowledge-CDmiMLew.js → knowledge-DnHtb64A.js} +4 -3
  298. package/dist/list/index.d.ts +1 -2
  299. package/dist/{list-query-BRt-zDF7.d.ts → list-query-D3JQeEL7.d.ts} +4 -4
  300. package/dist/mcp/index.d.ts +49 -19
  301. package/dist/mcp/index.js +158 -94
  302. package/dist/mcp/sdk/index.d.ts +38 -6
  303. package/dist/mcp/sdk/index.js +88 -6
  304. package/dist/{message-CfDoR0Y6.d.ts → message-B0fNJgq8.d.ts} +1 -2
  305. package/dist/{messages-B9-5887d.js → messages-CJoHHCWT.js} +4 -205
  306. package/dist/{mfa-Daak8ukG.d.ts → mfa-SZc9YYyb.d.ts} +1 -1
  307. package/dist/model-OgBxvk3N.d.ts +300 -0
  308. package/dist/model-messages-Cxw_Up4f.js +206 -0
  309. package/dist/model-messages-D4GZllOD.d.ts +34 -0
  310. package/dist/modules-DksjZyMW.js +77 -0
  311. package/dist/nestjs/index.d.ts +2 -2
  312. package/dist/nestjs/index.js +1 -1
  313. package/dist/next/index.d.ts +105 -55
  314. package/dist/next/index.js +204 -170
  315. package/dist/node/index.d.ts +2 -2
  316. package/dist/node/index.js +1 -1
  317. package/dist/{onboarding-BZGHYJks.d.ts → onboarding-LZvlK1P4.d.ts} +3 -3
  318. package/dist/openapi/index.d.ts +4 -2
  319. package/dist/openapi/index.js +21 -343
  320. package/dist/optional-peer-D1pi-skw.js +24 -0
  321. package/dist/orpc/index.d.ts +8 -8
  322. package/dist/orpc/index.js +21 -20
  323. package/dist/otel/index.d.ts +3 -3
  324. package/dist/otel/index.js +7 -7
  325. package/dist/{outbox-Cq7pPYvl.d.ts → outbox-DZfAvfzC.d.ts} +6 -6
  326. package/dist/overlay/index.d.ts +233 -0
  327. package/dist/overlay/index.js +554 -0
  328. package/dist/{plugin-FGY8UhYm.d.ts → plugin-CPK2HsbY.d.ts} +42 -3
  329. package/dist/plugins/actor/index.d.ts +1 -1
  330. package/dist/plugins/actor/index.js +1 -1
  331. package/dist/plugins/rules/index.d.ts +2 -2
  332. package/dist/plugins/rules/index.js +1 -1
  333. package/dist/plugins/soft-delete/index.d.ts +3 -3
  334. package/dist/plugins/soft-delete/index.js +9 -2
  335. package/dist/plugins/tenant/index.d.ts +7 -2
  336. package/dist/plugins/tenant/index.js +16 -2
  337. package/dist/plugins/timestamps/index.d.ts +1 -1
  338. package/dist/plugins/timestamps/index.js +8 -1
  339. package/dist/plugins/validation/index.d.ts +2 -2
  340. package/dist/plugins/validation/index.js +4 -4
  341. package/dist/{pool-CAu2nLrL.d.ts → pool-gkhbGp2E.d.ts} +2 -2
  342. package/dist/postgres/index.d.ts +4 -4
  343. package/dist/postgres/index.js +2 -1
  344. package/dist/{postgrest-BLVdEnfe.d.ts → postgrest-BUqLag2Q.d.ts} +1 -1
  345. package/dist/powersync/index.d.ts +5 -5
  346. package/dist/powersync/index.js +4 -4
  347. package/dist/powersync/react/index.d.ts +3 -3
  348. package/dist/powersync/react/index.js +1 -1
  349. package/dist/{problem-BreOl8b8.js → problem-CJvFeGu7.js} +13 -2
  350. package/dist/{problem-DD8LZFjc.d.ts → problem-TvGdxO1t.d.ts} +7 -1
  351. package/dist/{provider-Di3sRutW.js → provider-DxRTex4x.js} +1 -1
  352. package/dist/{provider-D-UEMvSD.d.ts → provider-ib9wzUDz.d.ts} +2 -2
  353. package/dist/query/index.d.ts +2 -2
  354. package/dist/query/index.js +1 -1
  355. package/dist/{query-BQ-NaZon.js → query-Ctz-qKRx.js} +1 -1
  356. package/dist/rate-limit-Bw7HgmFj.js +260 -0
  357. package/dist/react/index.d.ts +9 -9
  358. package/dist/react/index.js +4 -4
  359. package/dist/react/native/index.d.ts +1 -1
  360. package/dist/react/native/index.js +2 -2
  361. package/dist/react/server.d.ts +10 -10
  362. package/dist/react/server.js +3 -3
  363. package/dist/react/session.d.ts +2 -2
  364. package/dist/{react-F80mF4-t.js → react-Bmpo59D7.js} +4 -4
  365. package/dist/react-router/index.d.ts +6 -6
  366. package/dist/react-router/index.js +9 -11
  367. package/dist/{read-set-DuKWC9Mj.js → read-set-DAeWhqPf.js} +2 -2
  368. package/dist/realtime/index.d.ts +3 -3
  369. package/dist/realtime/index.js +30 -36
  370. package/dist/{refusal-DhSU2Vvr.d.ts → refusal-CFI8-5nf.d.ts} +4 -1
  371. package/dist/{refusal-CeJWxmkH.js → refusal-K78A1Vmq.js} +5 -5
  372. package/dist/{resolve-tJZY3FEa.js → resolve-Bvgf3ut_.js} +131 -42
  373. package/dist/{resolve-ChTYeTEl.d.ts → resolve-MxXVWyhd.d.ts} +12 -8
  374. package/dist/resource--vTrBe6I.d.ts +103 -0
  375. package/dist/resource-BqNqlYg9.js +91 -0
  376. package/dist/resource-DA811u_4.js +463 -0
  377. package/dist/resource-execute-rbKvuCsY.d.ts +12 -0
  378. package/dist/resource-schemas-BJ518zFH.js +79 -0
  379. package/dist/resource-types-CqB6GWGT.d.ts +141 -0
  380. package/dist/resources-BVYPnuLo.js +56 -0
  381. package/dist/resources-DZSk8tXJ.d.ts +7 -0
  382. package/dist/{respond-DprrgyXX.d.ts → respond-Cw-zanCm.d.ts} +3 -3
  383. package/dist/{respond-BUgsXNgk.js → respond-volM3ByS.js} +4 -4
  384. package/dist/{result-D7y2fT87.d.ts → result-BchM1XZn.d.ts} +7 -1
  385. package/dist/{result-DzUbqgdW.js → result-DEqHCMKP.js} +1 -1
  386. package/dist/server/index.d.ts +81 -19
  387. package/dist/server/index.js +16 -14
  388. package/dist/{server-Bh0EVSwU.d.ts → server-types-CrAmZ8jv.d.ts} +92 -36
  389. package/dist/{shared-CxWmcyqB.js → shared-DHjhfRdV.js} +2 -15
  390. package/dist/shared-DTneRoxi.js +14 -0
  391. package/dist/{sign-in-Cb1mwv6X.js → sign-in-D_yoP0PF.js} +1 -1
  392. package/dist/signatures-BRS_p3WD.d.ts +34 -0
  393. package/dist/signatures-DsWv_bYR.js +103 -0
  394. package/dist/{signers-4y62_VIi.d.ts → signers-cpdmZYrv.d.ts} +1 -1
  395. package/dist/solid/index.d.ts +9 -18
  396. package/dist/solid/index.js +2 -2
  397. package/dist/solid-start/index.d.ts +6 -6
  398. package/dist/solid-start/index.js +7 -7
  399. package/dist/spec/index.d.ts +134 -0
  400. package/dist/spec/index.js +353 -0
  401. package/dist/{spec-pins-C89s6DyW.d.ts → spec-pins-CwzDY25w.d.ts} +18 -1
  402. package/dist/{spec-pins--j6mTok4.js → spec-pins-DsLfUH7l.js} +14 -1
  403. package/dist/sql/index.d.ts +145 -119
  404. package/dist/sql/index.js +19921 -19798
  405. package/dist/{executor-De1Of3m3.js → sql-CwuqaQ4Y.js} +34 -169
  406. package/dist/ssr/index.d.ts +4 -4
  407. package/dist/ssr/index.js +3 -2
  408. package/dist/{standard-BK0cqJ7y.js → standard-DkzZUneg.js} +2 -2
  409. package/dist/{standard-CYsm7xpT.d.ts → standard-lmkbOtPB.d.ts} +1 -1
  410. package/dist/{stats-D_AD9GGu.js → stats-DhU78Ctf.js} +8 -4
  411. package/dist/storage/index.d.ts +4 -6
  412. package/dist/storage/index.js +16 -17
  413. package/dist/{bucket-Cl46E3jS.d.ts → storage-api-CB7Zl1Ci.d.ts} +243 -8
  414. package/dist/{store-CGjgWu5n.d.ts → store-DsIYEBnv.d.ts} +1 -1
  415. package/dist/streams/index.d.ts +4 -4
  416. package/dist/streams/index.js +5 -4
  417. package/dist/streams/redis/index.d.ts +1 -1
  418. package/dist/streams/redis/index.js +5 -11
  419. package/dist/{stripe-BMj5LtsT.js → stripe-v-Y2lmop.js} +2 -8
  420. package/dist/supabase-mcp-C6tMoEjn.d.ts +43 -0
  421. package/dist/supabase-mcp-Cpn5A4i-.js +28 -0
  422. package/dist/{support-ig_K4PvS.js → support-D1pFFouF.js} +71 -35
  423. package/dist/{support-view-CVOJJLpc.d.ts → support-view-scqMgtOo.d.ts} +1 -1
  424. package/dist/svelte/index.d.ts +8 -17
  425. package/dist/svelte/index.js +2 -2
  426. package/dist/sveltekit/index.d.ts +7 -7
  427. package/dist/sveltekit/index.js +10 -12
  428. package/dist/table-schema-htM_SbCW.js +286 -0
  429. package/dist/{tags-Cx-LnIQP.d.ts → tags-BO9LjtWG.d.ts} +1 -1
  430. package/dist/tanstack-db/index.d.ts +2 -2
  431. package/dist/tanstack-db/supabase/index.d.ts +52 -0
  432. package/dist/tanstack-db/supabase/index.js +97 -0
  433. package/dist/tanstack-start/index.d.ts +6 -6
  434. package/dist/tanstack-start/index.js +8 -12
  435. package/dist/{tee-CoEppCER.js → tee-Cb98Vn3b.js} +1 -1
  436. package/dist/{template--jDkl3UP.js → template-lPVh-EwW.js} +11 -2
  437. package/dist/{temporal-required-BVvW7SYJ.js → temporal-required-BtynQtM-.js} +1 -1
  438. package/dist/{tenant-BxNFk9bx.d.ts → tenant-CM368LXb.d.ts} +2 -2
  439. package/dist/testing/index.d.ts +249 -118
  440. package/dist/testing/index.js +1418 -870
  441. package/dist/ttl-cache-XzZ-Q2eX.js +29 -0
  442. package/dist/types-BRTSpOIh.js +5 -0
  443. package/dist/{types-C05bxW-W.d.ts → types-Bb_4-vdW.d.ts} +4 -4
  444. package/dist/{types-AYOvcyep.d.ts → types-CD6yCDx3.d.ts} +5 -5
  445. package/dist/{types-6rocye-y.d.ts → types-CbOUc5IH.d.ts} +4 -4
  446. package/dist/{types-6BdhkmZe.d.ts → types-CoE5Zwy4.d.ts} +8 -0
  447. package/dist/{types-DGs5L0VN.d.ts → types-DSJ3-m9X.d.ts} +4 -4
  448. package/dist/{queue-CLJurhdy.d.ts → types-D__3EN0q.d.ts} +17 -19
  449. package/dist/{usage-CrvrL2vw.d.ts → usage-D0NNUFfr.d.ts} +3 -3
  450. package/dist/{vault-wlbBhqm7.d.ts → vault-BpmApxxW.d.ts} +3 -3
  451. package/dist/vercel-connect/index.d.ts +1 -1
  452. package/dist/vercel-connect/index.js +5 -11
  453. package/dist/{verify-DPuWngD4.d.ts → verify-C91Wyp40.d.ts} +5 -35
  454. package/dist/verify-CJbYfADA.js +124 -0
  455. package/dist/{version-C6OfRAIn.js → version-Cq8gfDbd.js} +1 -1
  456. package/dist/{view-BeFcRV6G.js → view-D5ryq3gz.js} +1 -1
  457. package/dist/{view-CF7ihnkg.d.ts → view-TpXEUcVN.d.ts} +3 -3
  458. package/dist/vue/index.d.ts +9 -18
  459. package/dist/vue/index.js +2 -2
  460. package/dist/{watch-Xuxrvxq-.js → watch-BcvtAHOd.js} +2 -2
  461. package/dist/{watch-DI34G86j.d.ts → watch-COzRWvVN.d.ts} +23 -9
  462. package/dist/{wire-DtZQ4sdE.js → wire-Df3EWkG8.js} +2 -2
  463. package/dist/{workflow-builder-DJ1oHn8g.js → workflow-builder-CHqHpAVt.js} +6 -5
  464. package/dist/workflow-sdk/builder/index.d.ts +3 -3
  465. package/dist/workflow-sdk/index.d.ts +1 -1
  466. package/dist/workflow-sdk/world/index.d.ts +23 -17
  467. package/dist/workflow-sdk/world/index.js +59 -76
  468. package/dist/{workflow-sdk-B3yLD6Br.d.ts → workflow-sdk-DTZyrvNo.d.ts} +3 -3
  469. package/dist/{workflow-sdk-world-D-prir6O.js → workflow-sdk-world-CMV1ahFW.js} +528 -526
  470. package/dist/{workflows-B0j9WKPu.d.ts → workflows-CcpCBfIe.d.ts} +3 -3
  471. package/dist/{workflows-wu1WWBn7.js → workflows-IvxzG2cl.js} +5 -4
  472. package/package.json +54 -3
  473. package/schemas/config-v1.json +243 -0
  474. package/schemas/doctor-report-v1.json +4 -1
  475. package/schemas/spec-manifest-v1.json +95 -0
  476. package/skills/better-supabase/SKILL.md +8 -4
  477. package/skills/better-supabase/references/troubleshooting.md +20 -20
  478. package/skills/better-supabase-api/references/expo.md +6 -3
  479. package/skills/better-supabase-api/references/powersync.md +2 -1
  480. package/dist/cli/config-B9HkL8nF.js +0 -2
  481. package/dist/cli/gen-CCMc39Dx.js +0 -3100
  482. package/dist/cli/gen-DRmzPI75.js +0 -2
  483. package/dist/cli/prompts-BTYQGunc.js +0 -2
  484. package/dist/cli/run-BqDPh9UH.js +0 -361
  485. package/dist/config-Dn7F5k9A.js +0 -202
  486. package/dist/history-BZih6SFP.js +0 -64
  487. package/dist/index-BkWT_uBO.d.ts +0 -51
  488. package/dist/index-Bxih3l0u.d.ts +0 -81
  489. package/dist/index-CaxrMD1A.d.ts +0 -1
  490. package/dist/index-DQh4VCc9.d.ts +0 -98
  491. package/dist/keys-4MnkWTTh.js +0 -35
  492. package/dist/messages-DYP0sUTe.d.ts +0 -59
  493. package/dist/modules-dxrVK3ID.js +0 -228
  494. package/dist/path-Cv__-OTj.d.ts +0 -17
  495. package/dist/resource-BsvzCMlX.js +0 -212
  496. package/dist/resource-IPS5xi9q.d.ts +0 -74
  497. package/dist/template-CwO38Do8.d.ts +0 -6
  498. package/dist/verify-DL41hbvY.js +0 -232
  499. package/dist/cli/{read-sets-CETOSFx4.js → read-sets-DjJrm8Wj.js} +1 -1
@@ -1,7 +1,60 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { P as SchemaMeta, U as BucketLifecycle, c as Casing, s as BucketPolicyName, t as AccessBucketPolicy } from "./types-6BdhkmZe.js";
2
+ import { P as SchemaMeta, U as BucketLifecycle, c as Casing, s as BucketPolicyName, t as AccessBucketPolicy, u as ClaimsMeta } from "./types-CoE5Zwy4.js";
3
3
  import { s as ModulesConfig } from "./modules-DpPwzC7E.js";
4
4
  import { i as AuthorizationProvider } from "./authorization-BFCqamMs.js";
5
+ //#region src/config/defaults.d.ts
6
+ /**
7
+ * Every default `resolveConfig` fills in. Other modules (the SQL module
8
+ * registry, the CLI) read their fallbacks from here instead of repeating the
9
+ * literals.
10
+ */
11
+ declare const CONFIG_DEFAULTS: {
12
+ readonly output: string;
13
+ readonly schemas: readonly string[];
14
+ readonly casing: "snake";
15
+ readonly postgrestVersion: string;
16
+ readonly codecs: {
17
+ readonly timestamptz: "string";
18
+ readonly int8: "number";
19
+ readonly numeric: "number";
20
+ };
21
+ readonly sql: {
22
+ readonly dir: string;
23
+ readonly prefix: string;
24
+ readonly testsDir: string;
25
+ };
26
+ readonly seed: {
27
+ readonly entry: string;
28
+ readonly output: string;
29
+ };
30
+ readonly openapi: {
31
+ readonly entry: string;
32
+ readonly output: string;
33
+ };
34
+ readonly specs: {
35
+ readonly failOn: "error";
36
+ };
37
+ readonly doctor: {
38
+ readonly format: "text";
39
+ readonly sources: readonly string[];
40
+ readonly policyHelperLimit: number;
41
+ };
42
+ readonly gen: {
43
+ readonly watchInterval: number;
44
+ };
45
+ readonly env: {
46
+ readonly output: string;
47
+ };
48
+ };
49
+ //#endregion
50
+ //#region src/config/names.d.ts
51
+ /** The steps `better-supabase gen` runs, in the order it runs them. */
52
+ declare const GEN_TASKS: readonly ["types", "sql", "spec", "seed", "scaffold", "env"];
53
+ /** Glue `better-supabase init` and `add` write for a framework or runtime. */
54
+ declare const INTEGRATION_NAMES: readonly ["next", "hono", "orpc", "edge", "expo", "mcp", "client", "react"];
55
+ /** The agent folders `better-supabase skills install` writes to. */
56
+ declare const SKILLS_AGENTS: readonly ["cursor", "claude", "agents"];
57
+ //#endregion
5
58
  //#region src/config/generator-metadata.d.ts
6
59
  /**
7
60
  * A copy of `@supabase/postgrest-typegen`'s `GeneratorMetadata` contract
@@ -402,107 +455,35 @@ interface CatalogFunctionArg {
402
455
  readonly hasDefault: boolean;
403
456
  }
404
457
  //#endregion
405
- //#region src/config/config.d.ts
406
- /**
407
- * Where codegen reads the database from. Without any of these, `$DATABASE_URL`
408
- * and then the local stack (`supabase start`) are used.
409
- */
410
- interface SourceConfig {
411
- /** Postgres connection string. */
412
- readonly dbUrl?: string;
413
- /**
414
- * Hosted project ref. Read through the Management API's read-only SQL
415
- * endpoint, so no database password is needed.
416
- */
417
- readonly projectRef?: string;
418
- /**
419
- * Management API token for `projectRef`. Defaults to
420
- * `$SUPABASE_ACCESS_TOKEN`; prefer the env var over committing a token.
421
- */
422
- readonly accessToken?: string;
423
- /** Read a saved `better-supabase introspect` snapshot instead of connecting. */
424
- readonly snapshot?: string;
425
- }
458
+ //#region src/config/expose.d.ts
459
+ /** A privilege the Data API roles can be granted on a table or view. */
460
+ type Privilege = "select" | "insert" | "update" | "delete";
461
+ type ColumnPrivilege = `${"select" | "insert" | "update"}(${string})`;
462
+ type ExposePrivilege = Privilege | ColumnPrivilege;
463
+ /** A role the `grants` module writes privileges for. */
464
+ type ExposeRole = "anon" | "authenticated" | "service_role";
426
465
  /**
427
- * A JSON Schema object, or a Standard JSON Schema value (zod 4, valibot,
428
- * arktype, ...) that can produce one.
466
+ * Data API grants for one table: privileges for `authenticated`, or per
467
+ * role. `serviceRole` defaults to every privilege. For a function, keyed by
468
+ * its signature (`search_notes(text, integer)`), `execute` lists the roles
469
+ * that may call it; `service_role` is added unless `serviceRole` is false.
429
470
  */
430
- type JsonSchemaSource = Readonly<Record<string, unknown>> | {
431
- readonly "~standard": {
432
- readonly jsonSchema: {
433
- readonly input: (options: {
434
- readonly target: string;
435
- }) => Record<string, unknown>;
436
- };
437
- };
438
- };
439
- type JsonTypeConfig = ({
440
- readonly import: string;
471
+ type ExposeConfig = readonly ExposePrivilege[] | {
472
+ readonly anon?: readonly ExposePrivilege[];
473
+ readonly authenticated?: readonly ExposePrivilege[];
474
+ readonly serviceRole?: readonly ExposePrivilege[];
441
475
  } | {
442
- readonly type: string;
443
- }) & {
444
- /** Enforced in the database by `sql add jsonb-schemas` (pg_jsonschema). */
445
- readonly schema?: JsonSchemaSource;
446
- };
447
- /** The JSON Schema document for a `json[...].schema` entry. */
448
- declare function resolveJsonSchema(source: JsonSchemaSource): Readonly<Record<string, unknown>>;
449
- interface TableConfig {
450
- readonly casing?: Casing;
451
- /** Leave the table out of the generated models. */
452
- readonly exclude?: boolean;
453
- /**
454
- * Keep the table off the Data API on purpose: only `service_role` reaches
455
- * it. The models are still generated for admin clients, and doctor (BS106)
456
- * checks that `anon` and `authenticated` have no grants instead of
457
- * requiring them.
458
- */
476
+ readonly execute: readonly ("anon" | "authenticated")[];
459
477
  readonly serviceRole?: boolean;
460
- /** Rename generated relations: `{ primaryContact: 'contact' }`. */
461
- readonly relations?: Readonly<Record<string, string>>;
462
- /**
463
- * Database names of not-null columns an insert may leave out because the
464
- * database fills them, for example from a `before insert` trigger. `gen`
465
- * makes them optional in `InsertOf` and the insert validators.
466
- */
467
- readonly insertOptional?: readonly string[];
468
- }
469
- interface FunctionConfig {
470
- /** `true`, or the `returns table` columns (database names) that are never null. */
471
- readonly notNull?: true | readonly string[];
472
- }
473
- interface TimestampsConfig {
474
- readonly createdAt?: string;
475
- readonly updatedAt?: string;
476
- }
477
- interface SoftDeleteConfig {
478
- readonly column?: string;
479
- }
480
- interface TenantConfig {
481
- readonly column?: string;
482
- }
483
- /** Claim names shared by the SQL modules, codegen and the runtime defaults. */
484
- interface ClaimsConfig {
485
- /** Top-level claim holding the active tenant id. Defaults to `tenant_id`. */
486
- readonly tenant?: string;
487
- /** `scope` of the tenant entries `membership_claims()` writes. Defaults to `tenant`. */
488
- readonly scope?: string;
489
- /** Claim holding plan features per tenant (`{ [tenantId]: string[] }`). Defaults to `features`. */
490
- readonly features?: string;
491
- /** Claim the memberships hook (`membership_claims()` or the provider's) writes. Defaults to `memberships`. */
492
- readonly memberships?: string;
493
- }
494
- interface ActorConfig {
495
- readonly createdBy?: string;
496
- readonly updatedBy?: string;
497
- /** Defaults to `impersonated_by`, the column the SQL modules' `track_actor` fills. */
498
- readonly impersonatedBy?: string;
499
- }
500
- interface PluginFlagsConfig {
501
- readonly timestamps?: boolean | TimestampsConfig;
502
- readonly softDelete?: boolean | SoftDeleteConfig;
503
- readonly tenant?: boolean | TenantConfig;
504
- readonly actor?: boolean | ActorConfig;
478
+ };
479
+ /** Resolved grants for one table. */
480
+ interface ResolvedExpose {
481
+ readonly anon: readonly ExposePrivilege[];
482
+ readonly authenticated: readonly ExposePrivilege[];
483
+ readonly serviceRole: readonly ExposePrivilege[];
505
484
  }
485
+ //#endregion
486
+ //#region src/config/types/database.d.ts
506
487
  interface BucketConfig {
507
488
  readonly id?: string;
508
489
  readonly public?: boolean;
@@ -549,117 +530,6 @@ interface SeedConfig {
549
530
  /** SQL file `better-supabase seed` writes. Add it to `[db.seed] sql_paths`. */
550
531
  readonly output?: string;
551
532
  }
552
- interface OpenApiConfig {
553
- /** Module exporting the document (or a function returning it) as `openapi` or default. */
554
- readonly entry?: string;
555
- /** JSON file `better-supabase openapi emit` writes. */
556
- readonly output?: string;
557
- }
558
- interface DoctorConfig {
559
- /** Finding codes to skip, e.g. `['BS204']`. */
560
- readonly ignore?: readonly string[];
561
- /** Treat warnings as errors. */
562
- readonly strict?: boolean;
563
- /**
564
- * App source files doctor scans for API use (BS210). Globs relative to the
565
- * root. Defaults to `['src/**\/*.{ts,tsx}']`.
566
- */
567
- readonly sources?: readonly string[];
568
- /**
569
- * How many policies a security definer helper may appear in before BS206
570
- * asks for an inlinable `language sql stable` function. Defaults to 5.
571
- */
572
- readonly policyHelperLimit?: number;
573
- /**
574
- * The BS405 limit in bytes. When the authorization provider's token hook
575
- * has a budget, it replaces that budget and the whole token keeps 2048.
576
- * Otherwise it limits the whole token's claims (default 2048).
577
- */
578
- readonly claimsLimit?: number;
579
- }
580
- /**
581
- * Runtime types for columns whose JSON form loses information. Defaults
582
- * match `supabase gen types`: timestamps as ISO strings, `int8` and
583
- * `numeric` as numbers.
584
- */
585
- interface CodecsConfig {
586
- /**
587
- * `'instant'` decodes `timestamptz` columns to `Temporal.Instant` and
588
- * `timestamp` columns to `Temporal.PlainDateTime`.
589
- */
590
- readonly timestamptz?: "string" | "instant";
591
- /** `'bigint'` or `'string'` read `int8` exactly (above 2^53). */
592
- readonly int8?: "number" | "string" | "bigint";
593
- /** `'string'` reads `numeric` exactly. */
594
- readonly numeric?: "number" | "string";
595
- }
596
- interface GeneratedFile {
597
- /** Path relative to the project root. */
598
- readonly path: string;
599
- readonly contents: string;
600
- }
601
- interface GeneratorInput {
602
- readonly meta: SchemaMeta;
603
- /**
604
- * The `@supabase/postgrest-typegen` metadata for the configured schemas,
605
- * the same contract `supabase gen types` is built on.
606
- */
607
- readonly introspection: GeneratorMetadata;
608
- /** Constraints, indexes, policies, triggers and grants typegen leaves out. */
609
- readonly extras: SnapshotExtras;
610
- readonly config: ResolvedConfig;
611
- /** Absolute path of the main generated module. */
612
- readonly output: string;
613
- /** Import path from `from` (a generated file) to `to`, with extension. */
614
- readonly importPath: (from: string, to: string) => string;
615
- /**
616
- * The tables and enums `gen` emits, with the TypeScript type it wrote for
617
- * each column (after `json` overrides, codecs and enum unions). Frozen.
618
- */
619
- readonly model: GeneratorModel;
620
- }
621
- interface GeneratorColumn {
622
- /** Name in rows, after casing. */
623
- readonly app: string;
624
- /** Database name. */
625
- readonly db: string;
626
- /** TypeScript type without `| null`. */
627
- readonly tsType: string;
628
- readonly nullable: boolean;
629
- /** Optional on insert. */
630
- readonly optional: boolean;
631
- /** Generated or identity always: never written. */
632
- readonly readonly: boolean;
633
- /** Enum or check-constraint values, when the column has a closed set. */
634
- readonly values: readonly string[] | undefined;
635
- readonly json: boolean;
636
- }
637
- interface GeneratorTable {
638
- /** Key in `schema.tables` and on the client. */
639
- readonly key: string;
640
- readonly schema: string;
641
- readonly name: string;
642
- readonly casing: Casing;
643
- readonly columns: readonly GeneratorColumn[];
644
- }
645
- interface GeneratorModel {
646
- readonly tables: readonly GeneratorTable[];
647
- readonly enums: readonly {
648
- readonly schema: string;
649
- readonly name: string;
650
- readonly values: readonly string[];
651
- }[];
652
- }
653
- /**
654
- * Codegen extension point. First-party generators: `zod()`, `valibot()`,
655
- * `jsonSchema()`. Prove custom ones with `testGenerator`.
656
- */
657
- interface Generator {
658
- /** The generator contract it targets. `gen` refuses versions it doesn't know. */
659
- readonly apiVersion?: 1;
660
- readonly name: string;
661
- generate(input: GeneratorInput): readonly GeneratedFile[] | Promise<readonly GeneratedFile[]>;
662
- }
663
533
  interface RealtimeConfig {
664
534
  /**
665
535
  * Tables that broadcast a change signal for live queries (`table` or
@@ -694,12 +564,50 @@ interface TopicPoliciesConfig {
694
564
  /** The SQL file to write, such as `supabase/schemas/905_topics.sql`. */
695
565
  readonly output: string;
696
566
  }
697
- interface EntitlementsConfig {
567
+ /** pgvector distance: `<=>` (cosine), `<->` (l2) or `<#>` (negative inner product). */
568
+ type VectorDistance = "cosine" | "l2" | "inner_product";
569
+ /** The embedding column, or the column and its distance (default `cosine`). */
570
+ type VectorSearchConfig = string | {
571
+ readonly column: string;
572
+ readonly distance?: VectorDistance;
573
+ /** The column's pgvector type. Defaults to `vector`. */
574
+ readonly type?: "vector" | "halfvec";
575
+ /** The primary key column `db.$search({ score: true })` merges by. Defaults to `id`. */
576
+ readonly key?: string;
698
577
  /**
699
- * `table.column` (or `schema.table.column`) holding each tenant's Stripe
700
- * customer id, read by the `entitlements` SQL module. Required
701
- * without the `organizations` module; with it, defaults to the
702
- * `stripe_customer_id` column that module adds.
578
+ * Fuses a full-text ranking over a `tsvector` column with the vector
579
+ * ranking (reciprocal rank fusion), for `db.$search({ text })`.
580
+ */
581
+ readonly hybrid?: {
582
+ readonly tsvector: string;
583
+ /** The query's text search configuration. Defaults to `simple`. */
584
+ readonly config?: string;
585
+ /** The RRF constant. Defaults to 60. */
586
+ readonly k?: number;
587
+ };
588
+ /** A SQL expression over the row `t` the score is multiplied by, such as `t.priority`. */
589
+ readonly boost?: string;
590
+ /** Columns `db.$search({ filter })` narrows before ranking. */
591
+ readonly prefilter?: readonly string[];
592
+ /**
593
+ * A SQL condition over the row `t` every candidate must meet, applied
594
+ * before ranking: ranges, a parent row, such as
595
+ * `t.expires_at > now() and exists (select 1 from public.folders f where f.id = t.folder_id and not f.disabled)`.
596
+ */
597
+ readonly predicate?: string;
598
+ /** How `boost` combines with the score: `multiply` (default) or `add`. */
599
+ readonly boostMode?: "multiply" | "add";
600
+ /** A SQL `order by` list over the row `t` that breaks score ties, such as `t.created_at desc`. */
601
+ readonly order?: string;
602
+ };
603
+ //#endregion
604
+ //#region src/config/types/entitlements.d.ts
605
+ interface EntitlementsConfig {
606
+ /**
607
+ * `table.column` (or `schema.table.column`) holding each tenant's Stripe
608
+ * customer id, read by the `entitlements` SQL module. Required
609
+ * without the `organizations` module; with it, defaults to the
610
+ * `stripe_customer_id` column that module adds.
703
611
  */
704
612
  readonly customer?: string;
705
613
  /** The tenant id column of that table. Defaults to `id`. */
@@ -764,77 +672,122 @@ interface EntitlementPlansSource {
764
672
  };
765
673
  };
766
674
  }
767
- /** pgvector distance: `<=>` (cosine), `<->` (l2) or `<#>` (negative inner product). */
768
- type VectorDistance = "cosine" | "l2" | "inner_product";
769
- /** The embedding column, or the column and its distance (default `cosine`). */
770
- type VectorSearchConfig = string | {
771
- readonly column: string;
772
- readonly distance?: VectorDistance;
773
- /** The column's pgvector type. Defaults to `vector`. */
774
- readonly type?: "vector" | "halfvec";
775
- /** The primary key column `db.$search({ score: true })` merges by. Defaults to `id`. */
776
- readonly key?: string;
675
+ //#endregion
676
+ //#region src/config/types/tooling.d.ts
677
+ interface OpenApiConfig {
678
+ /** Module exporting the document (or a function returning it) as `openapi` or default. */
679
+ readonly entry?: string;
680
+ /** JSON file `better-supabase openapi emit` writes. */
681
+ readonly output?: string;
682
+ }
683
+ /** A docs UI `spec emit --ui` writes next to an OpenAPI document. */
684
+ type SpecUiName = "scalar" | "swagger" | "redoc" | "elements" | "rapidoc";
685
+ /** One document `better-supabase spec emit` writes. */
686
+ interface SpecOutputConfig {
687
+ /** A format id: `openapi`, `asyncapi` or `arazzo`. */
688
+ readonly format: string;
689
+ /** Defaults to the format's default version, e.g. `3.1` for OpenAPI. */
690
+ readonly version?: string;
691
+ /** File to write, relative to the root. Defaults to the format's file name. */
692
+ readonly output?: string;
693
+ /** Overlay files (JSON or YAML), applied in order. */
694
+ readonly overlays?: readonly string[];
695
+ /** Defaults to `yaml` when `output` ends in `.yaml` or `.yml`, otherwise `json`. */
696
+ readonly serialize?: "json" | "yaml";
697
+ /** Also writes a reference page (`openapi.html` for `openapi.json`) next to OpenAPI outputs. */
698
+ readonly ui?: SpecUiName;
699
+ }
700
+ interface SpecsConfig {
701
+ /** Module exporting a `defineApi()` result (or a function returning one) as `api` or default. */
702
+ readonly entry?: string;
703
+ /** The documents to write. Defaults to one OpenAPI document. */
704
+ readonly outputs?: readonly SpecOutputConfig[];
705
+ /** The lowest severity that fails `spec emit`, `check` and `validate`. Defaults to `error`. */
706
+ readonly failOn?: "error" | "warning" | "never";
707
+ /** Also write the diagnostics manifest (JSON) to this file, like `spec --manifest`. */
708
+ readonly manifest?: string;
709
+ }
710
+ /** A step `better-supabase gen` runs. */
711
+ type GenTask = (typeof GEN_TASKS)[number];
712
+ interface GenConfig {
777
713
  /**
778
- * Fuses a full-text ranking over a `tsvector` column with the vector
779
- * ranking (reciprocal rank fusion), for `db.$search({ text })`.
714
+ * The steps `better-supabase gen` runs, in this order: `types` (the
715
+ * generated modules and `generators`), `sql` (`sql sync`), `spec` (`spec
716
+ * emit`), `seed`, `scaffold` (`scaffold api`, its generated file only) and
717
+ * `env`. Without a list, `types` runs, plus `sql` when `sql.modules` or
718
+ * `realtime.policies` is set, `spec` and `seed` when their entry file
719
+ * exists, and `scaffold` when `scaffold.api` is set. `env` runs only when
720
+ * listed, because it needs the local stack. A listed step always runs.
780
721
  */
781
- readonly hybrid?: {
782
- readonly tsvector: string;
783
- /** The query's text search configuration. Defaults to `simple`. */
784
- readonly config?: string;
785
- /** The RRF constant. Defaults to 60. */
786
- readonly k?: number;
787
- };
788
- /** A SQL expression over the row `t` the score is multiplied by, such as `t.priority`. */
789
- readonly boost?: string;
790
- /** Columns `db.$search({ filter })` narrows before ranking. */
791
- readonly prefilter?: readonly string[];
722
+ readonly tasks?: readonly GenTask[];
723
+ /** Milliseconds between checks in `gen --watch` and `spec emit --watch`. */
724
+ readonly watchInterval?: number;
725
+ }
726
+ /** Glue `better-supabase init` and `add` write for a framework or runtime. */
727
+ type IntegrationName = (typeof INTEGRATION_NAMES)[number];
728
+ interface EnvFileConfig {
729
+ /** Env file `better-supabase env` writes. Defaults to `.env.local`. */
730
+ readonly output?: string;
792
731
  /**
793
- * A SQL condition over the row `t` every candidate must meet, applied
794
- * before ranking: ranges, a parent row, such as
795
- * `t.expires_at > now() and exists (select 1 from public.folders f where f.id = t.folder_id and not f.disabled)`.
732
+ * Prefix for the browser variables, such as `NEXT_PUBLIC_`; `'none'` for
733
+ * no prefix. Detected from the framework by default.
796
734
  */
797
- readonly predicate?: string;
798
- /** How `boost` combines with the score: `multiply` (default) or `add`. */
799
- readonly boostMode?: "multiply" | "add";
800
- /** A SQL `order by` list over the row `t` that breaks score ties, such as `t.created_at desc`. */
801
- readonly order?: string;
802
- };
803
- /** A privilege the Data API roles can be granted on a table or view. */
804
- type Privilege = "select" | "insert" | "update" | "delete";
805
- type ColumnPrivilege = `${"select" | "insert" | "update"}(${string})`;
806
- type ExposePrivilege = Privilege | ColumnPrivilege;
807
- /** A role the `grants` module writes privileges for. */
808
- type ExposeRole = "anon" | "authenticated" | "service_role";
809
- /**
810
- * Data API grants for one table: privileges for `authenticated`, or per
811
- * role. `serviceRole` defaults to every privilege. For a function, keyed by
812
- * its signature (`search_notes(text, integer)`), `execute` lists the roles
813
- * that may call it; `service_role` is added unless `serviceRole` is false.
814
- */
815
- type ExposeConfig = readonly ExposePrivilege[] | {
816
- readonly anon?: readonly ExposePrivilege[];
817
- readonly authenticated?: readonly ExposePrivilege[];
818
- readonly serviceRole?: readonly ExposePrivilege[];
819
- } | {
820
- readonly execute: readonly ("anon" | "authenticated")[];
821
- readonly serviceRole?: boolean;
822
- };
823
- /** Resolved grants for one table. */
824
- interface ResolvedExpose {
825
- readonly anon: readonly ExposePrivilege[];
826
- readonly authenticated: readonly ExposePrivilege[];
827
- readonly serviceRole: readonly ExposePrivilege[];
735
+ readonly prefix?: string;
828
736
  }
829
- interface RelationsConfig {
737
+ interface ScaffoldApiConfig {
738
+ /** Detected from `package.json` when the project has exactly one of them. */
739
+ readonly framework?: "hono" | "next";
740
+ /** Tables to serve. Defaults to every table and view in the public schema. */
741
+ readonly tables?: readonly string[];
742
+ /** The API module's name: `lib/<name>.ts` and `lib/<name>.generated.ts`. Defaults to `api`. */
743
+ readonly name?: string;
744
+ /** Where the resources are served. Defaults to `/api`. */
745
+ readonly basePath?: string;
746
+ }
747
+ interface ScaffoldConfig {
748
+ /** What `better-supabase scaffold api` writes; the `scaffold` gen step keeps its generated file current. */
749
+ readonly api?: ScaffoldApiConfig;
750
+ }
751
+ /** An agent folder `better-supabase skills install` writes to. */
752
+ type SkillsAgent = (typeof SKILLS_AGENTS)[number];
753
+ interface SkillsConfig {
754
+ /** Defaults to the agent folders the project has, else `agents`. */
755
+ readonly agents?: readonly SkillsAgent[];
756
+ }
757
+ interface KeysConfig {
758
+ /** Signing key file `better-supabase keys` writes. Defaults to `supabase/signing_keys.json`. */
759
+ readonly output?: string;
760
+ }
761
+ interface DoctorConfig {
762
+ /** Finding codes to skip, e.g. `['BS204']`. */
763
+ readonly ignore?: readonly string[];
764
+ /** Run only these checks, e.g. `['BS100', 'BS304']`. */
765
+ readonly only?: readonly string[];
766
+ /** Treat warnings as errors. */
767
+ readonly strict?: boolean;
768
+ /** Report format: `text` (default), `sarif` (code scanning) or `github` (workflow annotations). `--json` still wins. */
769
+ readonly format?: "text" | "sarif" | "github";
770
+ /** Write the report to this file. */
771
+ readonly output?: string;
830
772
  /**
831
- * Type a to-one include as `| null` when the related table has row level
832
- * security, even over a `not null` foreign key, since a policy can hide
833
- * the related row. `required: true` on the include keeps it non-null.
834
- * Defaults to `false`.
773
+ * App source files doctor scans for API use (BS210). Globs relative to the
774
+ * root. Defaults to `['src/**\/*.{ts,tsx}']`.
835
775
  */
836
- readonly nullableUnderRls?: boolean;
776
+ readonly sources?: readonly string[];
777
+ /**
778
+ * How many policies a security definer helper may appear in before BS206
779
+ * asks for an inlinable `language sql stable` function. Defaults to 5.
780
+ */
781
+ readonly policyHelperLimit?: number;
782
+ /**
783
+ * The BS405 limit in bytes. When the authorization provider's token hook
784
+ * has a budget, it replaces that budget and the whole token keeps 2048.
785
+ * Otherwise it limits the whole token's claims (default 2048).
786
+ */
787
+ readonly claimsLimit?: number;
837
788
  }
789
+ //#endregion
790
+ //#region src/config/types/config.d.ts
838
791
  interface BetterSupabaseConfig {
839
792
  readonly $schema?: string;
840
793
  readonly source?: SourceConfig;
@@ -917,9 +870,36 @@ interface BetterSupabaseConfig {
917
870
  readonly vectorSearch?: Readonly<Record<string, VectorSearchConfig>>;
918
871
  readonly sql?: SqlConfig;
919
872
  readonly seed?: SeedConfig;
873
+ /** @deprecated Use `specs`; `openapi.entry` and `openapi.output` map onto it. */
920
874
  readonly openapi?: OpenApiConfig;
875
+ /** The documents `better-supabase spec emit` writes (OpenAPI, AsyncAPI, Arazzo). */
876
+ readonly specs?: SpecsConfig;
921
877
  readonly doctor?: DoctorConfig;
878
+ /** What `better-supabase gen` runs. */
879
+ readonly gen?: GenConfig;
880
+ readonly env?: EnvFileConfig;
881
+ readonly scaffold?: ScaffoldConfig;
882
+ /** The integrations `init` and `add` wrote; `add` without a name sets up the ones that have no files yet. */
883
+ readonly integrations?: readonly IntegrationName[];
884
+ readonly skills?: SkillsConfig;
885
+ readonly keys?: KeysConfig;
886
+ /**
887
+ * Overrides per environment, keyed by name. The CLI applies the block
888
+ * for `--env <name>`, else `$BETTER_SUPABASE_ENV`, else `ci` when `$CI`
889
+ * is set. Objects merge into the config; arrays and other values replace.
890
+ */
891
+ readonly $env?: Readonly<Record<string, EnvironmentConfig>>;
892
+ /** Shorthand for `$env.development`. */
893
+ readonly $development?: EnvironmentConfig;
894
+ /** Shorthand for `$env.production`. */
895
+ readonly $production?: EnvironmentConfig;
896
+ /** Shorthand for `$env.test`. */
897
+ readonly $test?: EnvironmentConfig;
898
+ /** Shorthand for `$env.ci`, which the CLI picks when `$CI` is set. */
899
+ readonly $ci?: EnvironmentConfig;
922
900
  }
901
+ /** The keys an environment block may override. */
902
+ type EnvironmentConfig = Omit<BetterSupabaseConfig, "$schema" | "$env" | "$development" | "$production" | "$test" | "$ci">;
923
903
  /** The config with defaults applied. */
924
904
  interface ResolvedConfig {
925
905
  readonly root: string;
@@ -973,12 +953,379 @@ interface ResolvedConfig {
973
953
  readonly sql: ResolvedSqlConfig;
974
954
  readonly seed: Required<SeedConfig>;
975
955
  readonly openapi: Required<OpenApiConfig>;
976
- readonly doctor: Required<Omit<DoctorConfig, "claimsLimit">> & Pick<DoctorConfig, "claimsLimit">;
956
+ readonly specs: {
957
+ readonly entry: string;
958
+ readonly outputs: readonly SpecOutputConfig[];
959
+ readonly failOn: NonNullable<SpecsConfig["failOn"]>;
960
+ readonly manifest?: string;
961
+ };
962
+ readonly doctor: Required<Omit<DoctorConfig, "claimsLimit" | "output">> & Pick<DoctorConfig, "claimsLimit" | "output">;
963
+ /** `tasks` stays unset without a list, so `gen` picks the steps the project uses. */
964
+ readonly gen: GenConfig;
965
+ readonly env: {
966
+ readonly output: string;
967
+ readonly prefix?: string;
968
+ };
969
+ readonly scaffold: ScaffoldConfig;
970
+ readonly integrations: readonly IntegrationName[];
971
+ readonly skills: SkillsConfig;
972
+ readonly keys: KeysConfig;
973
+ /** The environment block the CLI applied, when one was active. */
974
+ readonly environment?: string;
977
975
  }
976
+ //#endregion
977
+ //#region src/config/types/codegen.d.ts
978
+ /**
979
+ * Where codegen reads the database from. Without any of these, `$DATABASE_URL`,
980
+ * `$SUPABASE_DB_URL` and then the local stack (`supabase start`) are used.
981
+ */
982
+ interface SourceConfig {
983
+ /** Postgres connection string. */
984
+ readonly dbUrl?: string;
985
+ /**
986
+ * Hosted project ref. Read through the Management API's read-only SQL
987
+ * endpoint, so no database password is needed.
988
+ */
989
+ readonly projectRef?: string;
990
+ /**
991
+ * Management API token for `projectRef`. Defaults to
992
+ * `$SUPABASE_ACCESS_TOKEN`; prefer the env var over committing a token.
993
+ */
994
+ readonly accessToken?: string;
995
+ /** Read a saved `better-supabase introspect` snapshot instead of connecting. */
996
+ readonly snapshot?: string;
997
+ /**
998
+ * Read a Supabase Lite project's schema the way Lite runs it, from
999
+ * `[db] driver` in `supabase/config.toml`. On by default when that key is
1000
+ * present; `false` reads the database like any other project.
1001
+ */
1002
+ readonly lite?: boolean;
1003
+ }
1004
+ /**
1005
+ * A JSON Schema object, or a Standard JSON Schema value (zod 4, valibot,
1006
+ * arktype, ...) that can produce one.
1007
+ */
1008
+ type JsonSchemaSource = Readonly<Record<string, unknown>> | {
1009
+ readonly "~standard": {
1010
+ readonly jsonSchema: {
1011
+ readonly input: (options: {
1012
+ readonly target: string;
1013
+ }) => Record<string, unknown>;
1014
+ };
1015
+ };
1016
+ };
1017
+ type JsonTypeConfig = ({
1018
+ readonly import: string;
1019
+ } | {
1020
+ readonly type: string;
1021
+ }) & {
1022
+ /** Enforced in the database by `sql add jsonb-schemas` (pg_jsonschema). */
1023
+ readonly schema?: JsonSchemaSource;
1024
+ };
1025
+ interface TableConfig {
1026
+ readonly casing?: Casing;
1027
+ /** Leave the table out of the generated models. */
1028
+ readonly exclude?: boolean;
1029
+ /**
1030
+ * Keep the table off the Data API on purpose: only `service_role` reaches
1031
+ * it. The models are still generated for admin clients, and doctor (BS106)
1032
+ * checks that `anon` and `authenticated` have no grants instead of
1033
+ * requiring them.
1034
+ */
1035
+ readonly serviceRole?: boolean;
1036
+ /** Rename generated relations: `{ primaryContact: 'contact' }`. */
1037
+ readonly relations?: Readonly<Record<string, string>>;
1038
+ /**
1039
+ * Database names of not-null columns an insert may leave out because the
1040
+ * database fills them, for example from a `before insert` trigger. `gen`
1041
+ * makes them optional in `InsertOf` and the insert validators.
1042
+ */
1043
+ readonly insertOptional?: readonly string[];
1044
+ }
1045
+ interface FunctionConfig {
1046
+ /** `true`, or the `returns table` columns (database names) that are never null. */
1047
+ readonly notNull?: true | readonly string[];
1048
+ }
1049
+ interface TimestampsConfig {
1050
+ readonly createdAt?: string;
1051
+ readonly updatedAt?: string;
1052
+ }
1053
+ interface SoftDeleteConfig {
1054
+ readonly column?: string;
1055
+ }
1056
+ interface TenantConfig {
1057
+ readonly column?: string;
1058
+ }
1059
+ /** Claim names shared by the SQL modules, codegen and the runtime defaults. */
1060
+ interface ClaimsConfig {
1061
+ /** Top-level claim holding the active tenant id. Defaults to `tenant_id`. */
1062
+ readonly tenant?: string;
1063
+ /** `scope` of the tenant entries `membership_claims()` writes. Defaults to `tenant`. */
1064
+ readonly scope?: string;
1065
+ /** Claim holding plan features per tenant (`{ [tenantId]: string[] }`). Defaults to `features`. */
1066
+ readonly features?: string;
1067
+ /** Claim the memberships hook (`membership_claims()` or the provider's) writes. Defaults to `memberships`. */
1068
+ readonly memberships?: string;
1069
+ }
1070
+ interface ActorConfig {
1071
+ readonly createdBy?: string;
1072
+ readonly updatedBy?: string;
1073
+ /** Defaults to `impersonated_by`, the column the SQL modules' `track_actor` fills. */
1074
+ readonly impersonatedBy?: string;
1075
+ }
1076
+ interface PluginFlagsConfig {
1077
+ readonly timestamps?: boolean | TimestampsConfig;
1078
+ readonly softDelete?: boolean | SoftDeleteConfig;
1079
+ readonly tenant?: boolean | TenantConfig;
1080
+ readonly actor?: boolean | ActorConfig;
1081
+ }
1082
+ /**
1083
+ * Runtime types for columns whose JSON form loses information. Defaults
1084
+ * match `supabase gen types`: timestamps as ISO strings, `int8` and
1085
+ * `numeric` as numbers.
1086
+ */
1087
+ interface CodecsConfig {
1088
+ /**
1089
+ * `'instant'` decodes `timestamptz` columns to `Temporal.Instant` and
1090
+ * `timestamp` columns to `Temporal.PlainDateTime`.
1091
+ */
1092
+ readonly timestamptz?: "string" | "instant";
1093
+ /** `'bigint'` or `'string'` read `int8` exactly (above 2^53). */
1094
+ readonly int8?: "number" | "string" | "bigint";
1095
+ /** `'string'` reads `numeric` exactly. */
1096
+ readonly numeric?: "number" | "string";
1097
+ }
1098
+ interface GeneratedFile {
1099
+ /** Path relative to the project root. */
1100
+ readonly path: string;
1101
+ readonly contents: string;
1102
+ }
1103
+ interface GeneratorInput {
1104
+ readonly meta: SchemaMeta;
1105
+ /**
1106
+ * The `@supabase/postgrest-typegen` metadata for the configured schemas,
1107
+ * the same contract `supabase gen types` is built on.
1108
+ */
1109
+ readonly introspection: GeneratorMetadata;
1110
+ /** Constraints, indexes, policies, triggers and grants typegen leaves out. */
1111
+ readonly extras: SnapshotExtras;
1112
+ readonly config: ResolvedConfig;
1113
+ /** Absolute path of the main generated module. */
1114
+ readonly output: string;
1115
+ /** Import path from `from` (a generated file) to `to`, with extension. */
1116
+ readonly importPath: (from: string, to: string) => string;
1117
+ /**
1118
+ * Where generated files import `better-supabase` runtime helpers from.
1119
+ * Defaults to `better-supabase`.
1120
+ */
1121
+ readonly runtimeImport?: string;
1122
+ /**
1123
+ * The tables and enums `gen` emits, with the TypeScript type it wrote for
1124
+ * each column (after `json` overrides, codecs and enum unions). Frozen.
1125
+ */
1126
+ readonly model: GeneratorModel;
1127
+ }
1128
+ interface GeneratorColumn {
1129
+ /** Name in rows, after casing. */
1130
+ readonly app: string;
1131
+ /** Database name. */
1132
+ readonly db: string;
1133
+ /** TypeScript type without `| null`. */
1134
+ readonly tsType: string;
1135
+ readonly nullable: boolean;
1136
+ /** Optional on insert. */
1137
+ readonly optional: boolean;
1138
+ /** Generated or identity always: never written. */
1139
+ readonly readonly: boolean;
1140
+ /** Enum or check-constraint values, when the column has a closed set. */
1141
+ readonly values: readonly string[] | undefined;
1142
+ readonly json: boolean;
1143
+ }
1144
+ interface GeneratorTable {
1145
+ /** Key in `schema.tables` and on the client. */
1146
+ readonly key: string;
1147
+ readonly schema: string;
1148
+ readonly name: string;
1149
+ readonly casing: Casing;
1150
+ readonly columns: readonly GeneratorColumn[];
1151
+ }
1152
+ interface GeneratorModel {
1153
+ readonly tables: readonly GeneratorTable[];
1154
+ readonly enums: readonly {
1155
+ readonly schema: string;
1156
+ readonly name: string;
1157
+ readonly values: readonly string[];
1158
+ }[];
1159
+ }
1160
+ /**
1161
+ * Codegen extension point. First-party generators: `zod()`, `valibot()`,
1162
+ * `jsonSchema()`, `standardSchema()`. Prove custom ones with `testGenerator`.
1163
+ */
1164
+ interface Generator {
1165
+ /** The generator contract it targets. `gen` refuses versions it doesn't know. */
1166
+ readonly apiVersion?: 1;
1167
+ readonly name: string;
1168
+ generate(input: GeneratorInput): readonly GeneratedFile[] | Promise<readonly GeneratedFile[]>;
1169
+ }
1170
+ interface RelationsConfig {
1171
+ /**
1172
+ * Type a to-one include as `| null` when the related table has row level
1173
+ * security, even over a `not null` foreign key, since a policy can hide
1174
+ * the related row. `required: true` on the include keeps it non-null.
1175
+ * Defaults to `false`.
1176
+ */
1177
+ readonly nullableUnderRls?: boolean;
1178
+ }
1179
+ //#endregion
1180
+ //#region src/config/json.d.ts
1181
+ /**
1182
+ * The JSON Schema document for a `json[...].schema` entry. A Standard
1183
+ * Schema converts for `target` (2020-12 by default); a JSON Schema object is
1184
+ * returned as it is.
1185
+ */
1186
+ declare function resolveJsonSchema(source: JsonSchemaSource, target?: "draft-2020-12" | "draft-07" | "openapi-3.0"): Readonly<Record<string, unknown>>;
1187
+ //#endregion
1188
+ //#region src/config/resolve.d.ts
978
1189
  declare const CONFIG_SCHEMA_URL = "https://unpkg.com/better-supabase/schemas/config-v1.json";
979
1190
  /** Identity helper that types `better-supabase.config.ts`. */
980
1191
  declare function defineConfig(config: BetterSupabaseConfig): BetterSupabaseConfig;
981
1192
  /** Applies defaults. Paths stay relative to `root`. */
982
1193
  declare function resolveConfig(config: BetterSupabaseConfig, root: string): ResolvedConfig;
983
1194
  //#endregion
984
- export { CatalogTable as $, SeedConfig as A, resolveConfig as B, PluginFlagsConfig as C, ResolvedConfig as D, RelationsConfig as E, TenantConfig as F, CatalogColumnGrant as G, Catalog as H, TimestampsConfig as I, CatalogFunction as J, CatalogEnum as K, VectorDistance as L, SourceConfig as M, SqlConfig as N, ResolvedExpose as O, TableConfig as P, CatalogPolicy as Q, VectorSearchConfig as R, OpenApiConfig as S, RealtimeConfig as T, CatalogCheck as U, resolveJsonSchema as V, CatalogColumn as W, CatalogGrant as X, CatalogFunctionArg as Y, CatalogIndex as Z, GeneratorInput as _, ClaimsConfig as a, ExtrasTable as at, JsonSchemaSource as b, DoctorConfig as c, SnapshotBucket as ct, ExposeConfig as d, PostgresColumn as dt, CatalogTrigger as et, ExposePrivilege as f, PostgresFunction as ft, GeneratorColumn as g, Generator as h, CONFIG_SCHEMA_URL as i, ExtrasHookFunction as it, SoftDeleteConfig as j, ResolvedSqlConfig as k, EntitlementPlansSource as l, SnapshotExtras as lt, GeneratedFile as m, BetterSupabaseConfig as n, ExtrasFunction as nt, CodecsConfig as o, ForeignKeyAction as ot, ExposeRole as p, PostgresFunctionArg as pt, CatalogForeignKey as q, BucketConfig as r, ExtrasHook as rt, ColumnPrivilege as s, Snapshot as st, ActorConfig as t, CatalogUnique as tt, EntitlementsConfig as u, GeneratorMetadata as ut, GeneratorModel as v, Privilege as w, JsonTypeConfig as x, GeneratorTable as y, defineConfig as z };
1195
+ //#region src/core/claims.d.ts
1196
+ declare const DEFAULT_CLAIMS: ClaimsMeta;
1197
+ /** Where an adapter reads each claim the SQL modules and the provider's hook write. */
1198
+ interface ClaimPaths {
1199
+ /** The active tenant: the top-level claim, then the same key in `app_metadata`. */
1200
+ readonly tenant: readonly [string, string];
1201
+ /** `{ [tenantId]: string[] }` of plan features. */
1202
+ readonly features: string;
1203
+ /** The caller's memberships, a list of `{ scope, id, roles }` or a map of tenant id to role. */
1204
+ readonly memberships: string;
1205
+ /** The `scope` of tenant entries in the memberships list. */
1206
+ readonly scope: string;
1207
+ }
1208
+ /**
1209
+ * The claim paths for `config.claims`, with defaults. For a generated
1210
+ * schema, pass `claimsOf(meta)`.
1211
+ */
1212
+ declare function claimPaths(claims?: Partial<ClaimsMeta>): ClaimPaths;
1213
+ /** Where the active tenant is read from: the top-level claim, then `app_metadata`. */
1214
+ declare function tenantClaimPaths(tenant?: string): readonly [string, string];
1215
+ //#endregion
1216
+ //#region src/generators/json-schema-target.d.ts
1217
+ /** The JSON Schema dialects the generators and MCP emit. */
1218
+ type JsonSchemaTarget = "draft-2020-12" | "draft-07" | "openapi-3.0";
1219
+ //#endregion
1220
+ //#region src/generators/shared.d.ts
1221
+ /** What field planning reads: the metadata and the typed-jsonb config. */
1222
+ interface SchemaSource {
1223
+ readonly meta: SchemaMeta;
1224
+ readonly config: {
1225
+ readonly json: Readonly<Record<string, unknown>>;
1226
+ };
1227
+ readonly runtimeImport?: string;
1228
+ }
1229
+ interface CommentEntry {
1230
+ readonly id: number;
1231
+ readonly schema: string;
1232
+ readonly name: string;
1233
+ readonly comment: string | null;
1234
+ }
1235
+ /**
1236
+ * The catalog parts docs read: `GeneratorInput` satisfies it. Runtime callers
1237
+ * that only have `meta` (OpenAPI, MCP) pass none and get no docs.
1238
+ */
1239
+ interface DocsSource extends SchemaSource {
1240
+ readonly introspection?: {
1241
+ readonly tables: readonly CommentEntry[];
1242
+ readonly views: readonly CommentEntry[];
1243
+ readonly materializedViews?: readonly CommentEntry[];
1244
+ readonly columns: readonly {
1245
+ readonly table_id: number;
1246
+ readonly name: string;
1247
+ readonly comment: string | null;
1248
+ readonly check: string | null;
1249
+ }[];
1250
+ };
1251
+ readonly extras?: {
1252
+ readonly tables: readonly {
1253
+ readonly schema: string;
1254
+ readonly name: string;
1255
+ readonly checks: readonly {
1256
+ readonly definition: string;
1257
+ }[];
1258
+ }[];
1259
+ };
1260
+ }
1261
+ //#endregion
1262
+ //#region src/generators/json-schema.d.ts
1263
+ interface JsonSchemaGeneratorOptions {
1264
+ /** Output path relative to the project root. Defaults to `<output>.schema.json`. */
1265
+ readonly output?: string;
1266
+ /** `$id` of the document. */
1267
+ readonly id?: string;
1268
+ /**
1269
+ * The dialect. `draft-2020-12` (the default) writes `$defs`; `draft-07`
1270
+ * and `openapi-3.0` (`nullable`, `example`) write `definitions`.
1271
+ */
1272
+ readonly target?: JsonSchemaTarget;
1273
+ }
1274
+ type JsonSchema = Record<string, unknown>;
1275
+ /**
1276
+ * JSON Schema `$defs` for every table: `customersRow`, `customersInsert`,
1277
+ * ... `target` lowers the document to draft-07 or the OpenAPI 3.0 dialect,
1278
+ * which keep the schemas under `definitions`.
1279
+ */
1280
+ declare function buildJsonSchema(input: DocsSource, id?: string, target?: JsonSchemaTarget): JsonSchema;
1281
+ /** Writes the JSON Schema document; `createOpenApi` reuses the same `$defs`. */
1282
+ declare function jsonSchema(options?: JsonSchemaGeneratorOptions): Generator;
1283
+ //#endregion
1284
+ //#region src/generators/standard-schema.d.ts
1285
+ interface StandardSchemaGeneratorOptions {
1286
+ /** Output path relative to the project root. Defaults to `<output>.standard.ts`. */
1287
+ readonly output?: string;
1288
+ /**
1289
+ * Standard Schemas for typed jsonb columns:
1290
+ * `{ 'customers.metadata': './schemas.ts#metadata' }`.
1291
+ */
1292
+ readonly json?: Readonly<Record<string, string>>;
1293
+ }
1294
+ /**
1295
+ * Standard Schemas for every table's Row, Insert and Update shape, with no
1296
+ * validation library. Each one also converts to JSON Schema (Standard JSON
1297
+ * Schema), and `validators` plugs into the validation plugin.
1298
+ */
1299
+ declare function standardSchema(options?: StandardSchemaGeneratorOptions): Generator;
1300
+ //#endregion
1301
+ //#region src/generators/valibot.d.ts
1302
+ interface ValibotGeneratorOptions {
1303
+ /** Output path relative to the project root. Defaults to `<output>.valibot.ts`. */
1304
+ readonly output?: string;
1305
+ /** Schemas for typed jsonb columns: `{ 'customers.metadata': './schemas.ts#metadata' }`. */
1306
+ readonly json?: Readonly<Record<string, string>>;
1307
+ }
1308
+ /** Valibot schemas for every table's Row, Insert and Update shape. */
1309
+ declare function valibot(options?: ValibotGeneratorOptions): Generator;
1310
+ //#endregion
1311
+ //#region src/generators/zod.d.ts
1312
+ interface ZodGeneratorOptions {
1313
+ /** Output path relative to the project root. Defaults to `<output>.zod.ts`. */
1314
+ readonly output?: string;
1315
+ /** Schemas for typed jsonb columns: `{ 'customers.metadata': './schemas.ts#metadata' }`. */
1316
+ readonly json?: Readonly<Record<string, string>>;
1317
+ /**
1318
+ * `classic` (the default) imports `zod` and chains methods; `mini` imports
1319
+ * `zod/mini` and uses its functional API (`z.nullable(...)`, `.check(...)`),
1320
+ * which tree-shakes to a smaller bundle. Both need zod 4.
1321
+ */
1322
+ readonly flavor?: ZodFlavor;
1323
+ }
1324
+ type ZodFlavor = "classic" | "mini";
1325
+ /**
1326
+ * Zod 4 schemas for every table's Row, Insert and Update shape, for `zod`
1327
+ * or, with `flavor: 'mini'`, `zod/mini`.
1328
+ */
1329
+ declare function zod(options?: ZodGeneratorOptions): Generator;
1330
+ //#endregion
1331
+ export { EntitlementsConfig as $, JsonTypeConfig as A, ExtrasTable as At, ResolvedConfig as B, INTEGRATION_NAMES as Bt, GeneratedFile as C, CatalogPolicy as Ct, GeneratorModel as D, ExtrasFunction as Dt, GeneratorInput as E, CatalogUnique as Et, TableConfig as F, GeneratorMetadata as Ft, IntegrationName as G, EnvFileConfig as H, CONFIG_DEFAULTS as Ht, TenantConfig as I, PostgresColumn as It, ScaffoldApiConfig as J, KeysConfig as K, TimestampsConfig as L, PostgresFunction as Lt, RelationsConfig as M, Snapshot as Mt, SoftDeleteConfig as N, SnapshotBucket as Nt, GeneratorTable as O, ExtrasHook as Ot, SourceConfig as P, SnapshotExtras as Pt, EntitlementPlansSource as Q, BetterSupabaseConfig as R, PostgresFunctionArg as Rt, CodecsConfig as S, CatalogIndex as St, GeneratorColumn as T, CatalogTrigger as Tt, GenConfig as U, DoctorConfig as V, SKILLS_AGENTS as Vt, GenTask as W, SkillsAgent as X, ScaffoldConfig as Y, SkillsConfig as Z, defineConfig as _, CatalogEnum as _t, valibot as a, VectorDistance as at, ActorConfig as b, CatalogFunctionArg as bt, JsonSchemaGeneratorOptions as c, ExposeConfig as ct, JsonSchemaTarget as d, Privilege as dt, BucketConfig as et, ClaimPaths as f, ResolvedExpose as ft, CONFIG_SCHEMA_URL as g, CatalogColumnGrant as gt, tenantClaimPaths as h, CatalogColumn as ht, ValibotGeneratorOptions as i, SqlConfig as it, PluginFlagsConfig as j, ForeignKeyAction as jt, JsonSchemaSource as k, ExtrasHookFunction as kt, buildJsonSchema as l, ExposePrivilege as lt, claimPaths as m, CatalogCheck as mt, ZodGeneratorOptions as n, ResolvedSqlConfig as nt, StandardSchemaGeneratorOptions as o, VectorSearchConfig as ot, DEFAULT_CLAIMS as p, Catalog as pt, OpenApiConfig as q, zod as r, SeedConfig as rt, standardSchema as s, ColumnPrivilege as st, ZodFlavor as t, RealtimeConfig as tt, jsonSchema as u, ExposeRole as ut, resolveConfig as v, CatalogForeignKey as vt, Generator as w, CatalogTable as wt, ClaimsConfig as x, CatalogGrant as xt, resolveJsonSchema as y, CatalogFunction as yt, EnvironmentConfig as z, GEN_TASKS as zt };