better-supabase 0.31.0 → 0.32.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 (1687) hide show
  1. package/dist/access-sql-Dao1C0fz.js +383 -0
  2. package/dist/actor-B5b0i1Fs.js +149 -0
  3. package/dist/actor-DseNR02I.d.ts +104 -0
  4. package/dist/adapter-CPPN80mx.js +2231 -0
  5. package/dist/agents-BEiBtYmh.d.ts +115 -0
  6. package/dist/ai-cache-D9D36eh4.js +86 -0
  7. package/dist/ai-cache-FMYzw7lW.d.ts +80 -0
  8. package/dist/ai-chat-B_P--Ie2.d.ts +532 -0
  9. package/dist/ai-files-DCMVGSds.js +337 -0
  10. package/dist/ai-message-cnroprVB.js +13 -0
  11. package/dist/ai-schedules-D_q1iclL.d.ts +164 -0
  12. package/dist/ai-sdk/agents/index.d.ts +8 -12
  13. package/dist/ai-sdk/agents/index.js +10 -12
  14. package/dist/ai-sdk/batches/index.d.ts +12 -7
  15. package/dist/ai-sdk/batches/index.js +16 -9
  16. package/dist/ai-sdk/cache/index.d.ts +2 -4
  17. package/dist/ai-sdk/cache/index.js +3 -4
  18. package/dist/ai-sdk/chat/index.d.ts +77 -2
  19. package/dist/ai-sdk/chat/index.js +179 -28
  20. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  21. package/dist/ai-sdk/embeddings/index.js +1 -1
  22. package/dist/ai-sdk/files/index.d.ts +3 -5
  23. package/dist/ai-sdk/files/index.js +5 -6
  24. package/dist/ai-sdk/index.d.ts +75 -21
  25. package/dist/ai-sdk/index.js +112 -66
  26. package/dist/ai-sdk/mcp/index.d.ts +28 -13
  27. package/dist/ai-sdk/mcp/index.js +56 -17
  28. package/dist/ai-sdk/memory/index.d.ts +3 -5
  29. package/dist/ai-sdk/memory/index.js +3 -4
  30. package/dist/ai-sdk/react/index.d.ts +2 -2
  31. package/dist/ai-sdk/react/index.js +3 -1
  32. package/dist/ai-sdk/react/server.d.ts +7 -4
  33. package/dist/ai-sdk/react/server.js +10 -3
  34. package/dist/ai-sdk/workflow/index.d.ts +12 -13
  35. package/dist/ai-sdk/workflow/index.js +17 -17
  36. package/dist/ai-sdk/workflow/react/index.d.ts +1 -3
  37. package/dist/ai-sdk/workflow/react/index.js +3 -3
  38. package/dist/ai-sdk/workflow/react/server.d.ts +1 -3
  39. package/dist/ai-sdk/workflow/react/server.js +1 -2
  40. package/dist/anchors-sCLvYj-8.d.ts +36 -0
  41. package/dist/api-CwzVbbw4.d.ts +483 -0
  42. package/dist/api-keys-u2sXB-CZ.d.ts +211 -0
  43. package/dist/api-wwix_K5c.js +691 -0
  44. package/dist/app-tables-DomvYx5b.d.ts +26 -0
  45. package/dist/approvals-Da4uAANx.js +166 -0
  46. package/dist/approvals-idpuhILk.d.ts +127 -0
  47. package/dist/assistant-CMKsaeJd.d.ts +209 -0
  48. package/dist/astro/index.d.ts +8 -10
  49. package/dist/astro/index.js +8 -9
  50. package/dist/attachments-BWtUQgsL.js +375 -0
  51. package/dist/attributes-BZNkR2z2.js +51 -0
  52. package/dist/auth-link-BmJsQG4a.js +117 -0
  53. package/dist/auth-link-DRjtI1Ky.d.ts +102 -0
  54. package/dist/auth-module-CVo86UKh.js +50 -0
  55. package/dist/auth-reply-BMPJQssh.d.ts +9 -0
  56. package/dist/auth-reply-Cnwn3I_q.js +30 -0
  57. package/dist/auth-wFlGgwTZ.js +19 -0
  58. package/dist/authorization-CYu_UKX4.d.ts +3723 -0
  59. package/dist/authorization-hooks-CldgvzBZ.d.ts +219 -0
  60. package/dist/authorizer-AswD5q6g.d.ts +116 -0
  61. package/dist/authorizer-D6po_XZA.js +171 -0
  62. package/dist/automation-acq3iK9y.js +74 -0
  63. package/dist/automations-BfH8GJqv.js +27 -0
  64. package/dist/automations-Bw5cX7oj.js +29 -0
  65. package/dist/automations-CCc5RUw-.js +31 -0
  66. package/dist/automations-Dou1t3lt.js +313 -0
  67. package/dist/availability-CebEOfMN.d.ts +236 -0
  68. package/dist/base64-CVyKHBBw.js +41 -0
  69. package/dist/batch-limit-DqQ3d6op.js +4 -0
  70. package/dist/before-route-Ra3OhI2x.js +29 -0
  71. package/dist/better-result/index.d.ts +4 -6
  72. package/dist/better-result/index.js +2 -3
  73. package/dist/bind-8LYVJE5W.d.ts +102 -0
  74. package/dist/block-authors-C5z3tGVu.d.ts +10 -0
  75. package/dist/block-authors-DCQ4zl8e.js +13 -0
  76. package/dist/block-env-BsLgZL2l.d.ts +30 -0
  77. package/dist/block-event-listener-DCi7c89M.js +15 -0
  78. package/dist/block-events-Bp6GPIBN.js +82 -0
  79. package/dist/block-fields-Bjcv6_zc.js +139 -0
  80. package/dist/block-fields-Puv5m5D3.d.ts +56 -0
  81. package/dist/block-helpers-I7UzjNEf.js +435 -0
  82. package/dist/block-helpers-JxiD1iw4.d.ts +56 -0
  83. package/dist/block-hooks-CJP5kGEa.d.ts +115 -0
  84. package/dist/block-hooks-CadxQ9-_.js +129 -0
  85. package/dist/block-method-DIbWG4Mj.js +20 -0
  86. package/dist/block-method-QSaPsL2P.d.ts +12 -0
  87. package/dist/block-subjects-SyJwfgrX.d.ts +4 -0
  88. package/dist/block-subjects-cRlVtKDO.js +54 -0
  89. package/dist/block-tenant-Bun03JuO.js +13 -0
  90. package/dist/block-transport-Bbf1ZZre.d.ts +67 -0
  91. package/dist/blocks/access-requests/index.d.ts +9 -15
  92. package/dist/blocks/access-requests/index.js +11 -14
  93. package/dist/blocks/activities/index.d.ts +13 -21
  94. package/dist/blocks/activities/index.js +16 -21
  95. package/dist/blocks/agents/index.d.ts +4 -8
  96. package/dist/blocks/agents/index.js +11 -14
  97. package/dist/blocks/ai-cache/index.d.ts +3 -5
  98. package/dist/blocks/ai-cache/index.js +5 -6
  99. package/dist/blocks/ai-chat/index.d.ts +10 -19
  100. package/dist/blocks/ai-chat/index.js +20 -28
  101. package/dist/blocks/ai-files/index.d.ts +5 -9
  102. package/dist/blocks/ai-files/index.js +5 -6
  103. package/dist/blocks/ai-keys/index.d.ts +4 -10
  104. package/dist/blocks/ai-keys/index.js +14 -18
  105. package/dist/blocks/ai-schedules/index.d.ts +3 -5
  106. package/dist/blocks/ai-schedules/index.js +14 -16
  107. package/dist/blocks/announcements/index.d.ts +12 -20
  108. package/dist/blocks/announcements/index.js +12 -16
  109. package/dist/blocks/api-keys/index.d.ts +8 -16
  110. package/dist/blocks/api-keys/index.js +17 -22
  111. package/dist/blocks/approvals/index.d.ts +4 -8
  112. package/dist/blocks/approvals/index.js +7 -173
  113. package/dist/blocks/assets/index.d.ts +9 -17
  114. package/dist/blocks/assets/index.js +13 -17
  115. package/dist/blocks/assignment/index.d.ts +9 -17
  116. package/dist/blocks/assignment/index.js +10 -14
  117. package/dist/blocks/attachments/index.d.ts +6 -18
  118. package/dist/blocks/attachments/index.js +19 -24
  119. package/dist/blocks/audit/index.d.ts +15 -31
  120. package/dist/blocks/audit/index.js +27 -35
  121. package/dist/blocks/automations/index.d.ts +14 -26
  122. package/dist/blocks/automations/index.js +18 -23
  123. package/dist/blocks/billable-time/index.d.ts +9 -19
  124. package/dist/blocks/billable-time/index.js +15 -20
  125. package/dist/blocks/billing/index.d.ts +12 -22
  126. package/dist/blocks/billing/index.js +19 -24
  127. package/dist/blocks/bookings/index.d.ts +8 -18
  128. package/dist/blocks/bookings/index.js +17 -23
  129. package/dist/blocks/bulk/index.d.ts +6 -12
  130. package/dist/blocks/bulk/index.js +10 -13
  131. package/dist/blocks/calendar/index.d.ts +13 -23
  132. package/dist/blocks/calendar/index.js +35 -32
  133. package/dist/blocks/catalog/index.d.ts +12 -20
  134. package/dist/blocks/catalog/index.js +17 -21
  135. package/dist/blocks/channels/index.d.ts +9 -17
  136. package/dist/blocks/channels/index.js +11 -15
  137. package/dist/blocks/collections/index.d.ts +11 -17
  138. package/dist/blocks/collections/index.js +13 -16
  139. package/dist/blocks/comments/index.d.ts +16 -26
  140. package/dist/blocks/comments/index.js +21 -26
  141. package/dist/blocks/compliance/index.d.ts +9 -17
  142. package/dist/blocks/compliance/index.js +13 -17
  143. package/dist/blocks/connectors/index.d.ts +4 -8
  144. package/dist/blocks/connectors/index.js +13 -16
  145. package/dist/blocks/contacts/index.d.ts +10 -18
  146. package/dist/blocks/contacts/index.js +12 -16
  147. package/dist/blocks/content/index.d.ts +8 -16
  148. package/dist/blocks/content/index.js +13 -17
  149. package/dist/blocks/contracts/index.d.ts +11 -21
  150. package/dist/blocks/contracts/index.js +17 -22
  151. package/dist/blocks/courses/index.d.ts +11 -21
  152. package/dist/blocks/courses/index.js +17 -22
  153. package/dist/blocks/created-by/index.d.ts +3 -7
  154. package/dist/blocks/created-by/index.js +4 -5
  155. package/dist/blocks/custom-fields/index.d.ts +10 -16
  156. package/dist/blocks/custom-fields/index.js +13 -16
  157. package/dist/blocks/data-lifecycle/index.d.ts +10 -26
  158. package/dist/blocks/data-lifecycle/index.js +17 -23
  159. package/dist/blocks/deals/index.d.ts +12 -20
  160. package/dist/blocks/deals/index.js +18 -22
  161. package/dist/blocks/dispatch/index.d.ts +11 -23
  162. package/dist/blocks/dispatch/index.js +19 -24
  163. package/dist/blocks/documents/index.d.ts +4 -8
  164. package/dist/blocks/documents/index.js +9 -12
  165. package/dist/blocks/domains/index.d.ts +8 -14
  166. package/dist/blocks/domains/index.js +12 -15
  167. package/dist/blocks/donations/index.d.ts +13 -23
  168. package/dist/blocks/donations/index.js +21 -26
  169. package/dist/blocks/drive/index.d.ts +116 -20
  170. package/dist/blocks/drive/index.js +138 -26
  171. package/dist/blocks/employees/index.d.ts +13 -23
  172. package/dist/blocks/employees/index.js +18 -23
  173. package/dist/blocks/enrichment/index.d.ts +8 -16
  174. package/dist/blocks/enrichment/index.js +11 -15
  175. package/dist/blocks/enrollments/index.d.ts +9 -17
  176. package/dist/blocks/enrollments/index.js +13 -17
  177. package/dist/blocks/entitlements/index.d.ts +8 -14
  178. package/dist/blocks/entitlements/index.js +8 -11
  179. package/dist/blocks/expenses/index.d.ts +22 -19
  180. package/dist/blocks/expenses/index.js +25 -23
  181. package/dist/blocks/field-history/index.d.ts +6 -10
  182. package/dist/blocks/field-history/index.js +5 -7
  183. package/dist/blocks/flags/index.d.ts +49 -20
  184. package/dist/blocks/flags/index.js +65 -19
  185. package/dist/blocks/forecasts/index.d.ts +10 -16
  186. package/dist/blocks/forecasts/index.js +11 -14
  187. package/dist/blocks/forms/index.d.ts +11 -25
  188. package/dist/blocks/forms/index.js +17 -24
  189. package/dist/blocks/goals/index.d.ts +8 -12
  190. package/dist/blocks/goals/index.js +9 -11
  191. package/dist/blocks/guests/index.d.ts +9 -19
  192. package/dist/blocks/guests/index.js +14 -19
  193. package/dist/blocks/hiring/index.d.ts +10 -18
  194. package/dist/blocks/hiring/index.js +12 -15
  195. package/dist/blocks/identities/index.d.ts +7 -11
  196. package/dist/blocks/identities/index.js +7 -9
  197. package/dist/blocks/imports/index.d.ts +8 -18
  198. package/dist/blocks/imports/index.js +11 -16
  199. package/dist/blocks/inbox/index.d.ts +11 -21
  200. package/dist/blocks/inbox/index.js +26 -23
  201. package/dist/blocks/incidents/index.d.ts +9 -17
  202. package/dist/blocks/incidents/index.js +14 -18
  203. package/dist/blocks/index.d.ts +14 -20
  204. package/dist/blocks/index.js +17 -20
  205. package/dist/blocks/inventory/index.d.ts +11 -17
  206. package/dist/blocks/inventory/index.js +12 -15
  207. package/dist/blocks/invoices/index.d.ts +34 -21
  208. package/dist/blocks/invoices/index.js +31 -18
  209. package/dist/blocks/knowledge/index.d.ts +3 -5
  210. package/dist/blocks/knowledge/index.js +5 -6
  211. package/dist/blocks/lead-scoring/index.d.ts +10 -14
  212. package/dist/blocks/lead-scoring/index.js +11 -13
  213. package/dist/blocks/leases/index.d.ts +11 -21
  214. package/dist/blocks/leases/index.js +20 -25
  215. package/dist/blocks/leave/index.d.ts +50 -17
  216. package/dist/blocks/leave/index.js +35 -14
  217. package/dist/blocks/ledger/index.d.ts +9 -17
  218. package/dist/blocks/ledger/index.js +13 -17
  219. package/dist/blocks/mail-sync/index.d.ts +6 -12
  220. package/dist/blocks/mail-sync/index.js +26 -25
  221. package/dist/blocks/memberships/index.d.ts +5 -9
  222. package/dist/blocks/memberships/index.js +4 -5
  223. package/dist/blocks/memory/index.d.ts +4 -8
  224. package/dist/blocks/memory/index.js +12 -15
  225. package/dist/blocks/messaging/index.d.ts +14 -24
  226. package/dist/blocks/messaging/index.js +19 -24
  227. package/dist/blocks/metrics/index.d.ts +9 -17
  228. package/dist/blocks/metrics/index.js +14 -18
  229. package/dist/blocks/mfa/index.d.ts +5 -9
  230. package/dist/blocks/mfa/index.js +7 -9
  231. package/dist/blocks/moderation/index.d.ts +9 -17
  232. package/dist/blocks/moderation/index.js +13 -17
  233. package/dist/blocks/notifications/index.d.ts +18 -34
  234. package/dist/blocks/notifications/index.js +32 -42
  235. package/dist/blocks/numbering/index.d.ts +6 -12
  236. package/dist/blocks/numbering/index.js +8 -11
  237. package/dist/blocks/oauth-server/index.d.ts +7 -13
  238. package/dist/blocks/oauth-server/index.js +12 -15
  239. package/dist/blocks/onboarding/index.d.ts +7 -13
  240. package/dist/blocks/onboarding/index.js +8 -11
  241. package/dist/blocks/orders/index.d.ts +17 -29
  242. package/dist/blocks/orders/index.js +22 -28
  243. package/dist/blocks/organizations/index.d.ts +11 -21
  244. package/dist/blocks/organizations/index.js +16 -19
  245. package/dist/blocks/outbox/index.d.ts +4 -6
  246. package/dist/blocks/outbox/index.js +11 -13
  247. package/dist/blocks/passes/index.d.ts +12 -22
  248. package/dist/blocks/passes/index.js +20 -25
  249. package/dist/blocks/permissions/index.d.ts +45 -15
  250. package/dist/blocks/permissions/index.js +99 -19
  251. package/dist/blocks/pipelines/index.d.ts +12 -18
  252. package/dist/blocks/pipelines/index.js +12 -15
  253. package/dist/blocks/posts/index.d.ts +10 -18
  254. package/dist/blocks/posts/index.js +15 -19
  255. package/dist/blocks/profiles/index.d.ts +8 -12
  256. package/dist/blocks/profiles/index.js +9 -11
  257. package/dist/blocks/promotions/index.d.ts +11 -17
  258. package/dist/blocks/promotions/index.js +13 -16
  259. package/dist/blocks/push/index.d.ts +12 -18
  260. package/dist/blocks/push/index.js +13 -16
  261. package/dist/blocks/queue/index.d.ts +187 -39
  262. package/dist/blocks/queue/index.js +226 -60
  263. package/dist/blocks/quotes/index.d.ts +13 -21
  264. package/dist/blocks/quotes/index.js +14 -17
  265. package/dist/blocks/rank/index.d.ts +7 -13
  266. package/dist/blocks/rank/index.js +8 -10
  267. package/dist/blocks/reactions/index.d.ts +11 -19
  268. package/dist/blocks/reactions/index.js +13 -17
  269. package/dist/blocks/relations/index.d.ts +11 -21
  270. package/dist/blocks/relations/index.js +18 -23
  271. package/dist/blocks/reminders/index.d.ts +12 -22
  272. package/dist/blocks/reminders/index.js +21 -25
  273. package/dist/blocks/reviews/index.d.ts +9 -15
  274. package/dist/blocks/reviews/index.js +11 -14
  275. package/dist/blocks/saved-views/index.d.ts +11 -21
  276. package/dist/blocks/saved-views/index.js +16 -21
  277. package/dist/blocks/scores/index.d.ts +6 -12
  278. package/dist/blocks/scores/index.js +10 -13
  279. package/dist/blocks/search/index.d.ts +9 -19
  280. package/dist/blocks/search/index.js +15 -19
  281. package/dist/blocks/security-events/index.d.ts +10 -24
  282. package/dist/blocks/security-events/index.js +17 -23
  283. package/dist/blocks/segments/index.d.ts +10 -18
  284. package/dist/blocks/segments/index.js +11 -15
  285. package/dist/blocks/sequences/index.d.ts +9 -17
  286. package/dist/blocks/sequences/index.js +15 -19
  287. package/dist/blocks/service-accounts/index.d.ts +9 -15
  288. package/dist/blocks/service-accounts/index.js +11 -14
  289. package/dist/blocks/sessions/index.d.ts +4 -8
  290. package/dist/blocks/sessions/index.js +9 -11
  291. package/dist/blocks/settings/index.d.ts +8 -16
  292. package/dist/blocks/settings/index.js +14 -18
  293. package/dist/blocks/share-links/index.d.ts +9 -17
  294. package/dist/blocks/share-links/index.js +16 -20
  295. package/dist/blocks/shipments/index.d.ts +14 -24
  296. package/dist/blocks/shipments/index.js +25 -31
  297. package/dist/blocks/signatures/index.d.ts +10 -16
  298. package/dist/blocks/signatures/index.js +10 -13
  299. package/dist/blocks/signing-keys/index.d.ts +5 -9
  300. package/dist/blocks/signing-keys/index.js +8 -10
  301. package/dist/blocks/sla/index.d.ts +11 -19
  302. package/dist/blocks/sla/index.js +17 -21
  303. package/dist/blocks/sso/index.d.ts +7 -19
  304. package/dist/blocks/sso/index.js +14 -21
  305. package/dist/blocks/state-machine/index.d.ts +7 -13
  306. package/dist/blocks/state-machine/index.js +9 -12
  307. package/dist/blocks/subjects/index.d.ts +7 -11
  308. package/dist/blocks/subjects/index.js +12 -14
  309. package/dist/blocks/tags/index.d.ts +11 -21
  310. package/dist/blocks/tags/index.js +20 -25
  311. package/dist/blocks/tasks/index.d.ts +13 -27
  312. package/dist/blocks/tasks/index.js +22 -29
  313. package/dist/blocks/teams/index.d.ts +8 -14
  314. package/dist/blocks/teams/index.js +10 -13
  315. package/dist/blocks/templates/index.d.ts +12 -22
  316. package/dist/blocks/templates/index.js +16 -21
  317. package/dist/blocks/time-tracking/index.d.ts +31 -25
  318. package/dist/blocks/time-tracking/index.js +29 -29
  319. package/dist/blocks/timeline/index.d.ts +10 -14
  320. package/dist/blocks/timeline/index.js +11 -13
  321. package/dist/blocks/trash/index.d.ts +10 -18
  322. package/dist/blocks/trash/index.js +11 -14
  323. package/dist/blocks/undo/index.d.ts +4 -8
  324. package/dist/blocks/undo/index.js +6 -8
  325. package/dist/blocks/updated-at/index.d.ts +3 -7
  326. package/dist/blocks/updated-at/index.js +4 -5
  327. package/dist/blocks/usage/index.d.ts +6 -10
  328. package/dist/blocks/usage/index.js +10 -13
  329. package/dist/blocks/vercel-marketplace/index.d.ts +9 -17
  330. package/dist/blocks/vercel-marketplace/index.js +17 -21
  331. package/dist/blocks/versions/index.d.ts +10 -20
  332. package/dist/blocks/versions/index.js +17 -22
  333. package/dist/blocks/waitlist/index.d.ts +10 -16
  334. package/dist/blocks/waitlist/index.js +11 -14
  335. package/dist/blocks/webhooks/index.d.ts +16 -34
  336. package/dist/blocks/webhooks/index.js +33 -44
  337. package/dist/blocks/workflow-editor/index.d.ts +13 -21
  338. package/dist/blocks/workflow-editor/index.js +21 -27
  339. package/dist/blocks/workflows/index.d.ts +8 -14
  340. package/dist/blocks/workflows/index.js +14 -18
  341. package/dist/bookings-DG443336.d.ts +285 -0
  342. package/dist/bucket-Clq5xINQ.d.ts +693 -0
  343. package/dist/build-Ckxct2EX.js +2065 -0
  344. package/dist/build-D1-V9dd8.js +732 -0
  345. package/dist/carrier-D2b_028L.d.ts +165 -0
  346. package/dist/casing-DQzG9ANZ.js +15 -0
  347. package/dist/channel-B_kufDZy.d.ts +101 -0
  348. package/dist/channels-BxeTTtCY.js +113 -0
  349. package/dist/chat-sdk/index.d.ts +174 -41
  350. package/dist/chat-sdk/index.js +425 -83
  351. package/dist/claims-DRmafYVK.js +90 -0
  352. package/dist/claims-DouHL7ZL.js +62 -0
  353. package/dist/cli/_format-Ba0DoWjl.js +99 -0
  354. package/dist/cli/add-ChoHyBhz.js +1222 -0
  355. package/dist/cli/add-DlYL-1mF.js +1 -0
  356. package/dist/cli/add-fzRPyIED.js +98 -0
  357. package/dist/cli/agent-59XWXsRi.js +184 -0
  358. package/dist/cli/app-table-files-C0OtdUVu.js +343 -0
  359. package/dist/cli/arazzo-1.0-D3OaSeZw.js +531 -0
  360. package/dist/cli/arazzo-1.1-DaT2KAkP.js +704 -0
  361. package/dist/cli/args-_ZVgRBkx.js +26 -0
  362. package/dist/cli/asyncapi-3.0.0-Ca-UwtUW.js +5592 -0
  363. package/dist/cli/asyncapi-3.1.0-DUxf5zNu.js +5832 -0
  364. package/dist/cli/backfill-Dq2XMXf9.js +292 -0
  365. package/dist/cli/bin.js +5 -5
  366. package/dist/cli/blocks-CCzp0eAH.js +155 -0
  367. package/dist/cli/blocks-DVhJOzFj.js +1 -0
  368. package/dist/cli/cache-CoC-1i1O.js +643 -0
  369. package/dist/cli/codemod-block-renames-Dt3X1Wvg.js +238 -0
  370. package/dist/cli/codemod-pyf6HmS9.js +2883 -0
  371. package/dist/cli/command-BpZ4AuhR.js +1021 -0
  372. package/dist/cli/compare-yl4sSwVn.js +8 -0
  373. package/dist/cli/completion-B08Q0xB3.js +29 -0
  374. package/dist/cli/completion-CwL7e93t.js +210 -0
  375. package/dist/cli/completion-DHTT6rjI.js +1 -0
  376. package/dist/cli/config-D-Upz3jV.js +46 -0
  377. package/dist/cli/config-D0m2rQqk.js +1 -0
  378. package/dist/cli/config-Dyl3iX3u.js +2029 -0
  379. package/dist/cli/config-edit-C6sQ1MqT.js +619 -0
  380. package/dist/cli/config-group-D4JWh4kG.js +388 -0
  381. package/dist/cli/content-mapper-ChSVT9Tq.js +181 -0
  382. package/dist/cli/db-B8zfxjl2.js +77 -0
  383. package/dist/cli/db-dFzhcozO.js +246 -0
  384. package/dist/cli/detect-BcUDaO8I.js +83 -0
  385. package/dist/cli/dist-CYnD1kyT.js +128 -0
  386. package/dist/cli/dist-MKwjiW2w.js +1114 -0
  387. package/dist/cli/doctor-BKZsztFV.js +4647 -0
  388. package/dist/cli/env-BAJn6wCA.js +142 -0
  389. package/dist/cli/env-BCuUsWOh.js +1109 -0
  390. package/dist/cli/env-D70ihdbB.js +1 -0
  391. package/dist/cli/env-UN6PJFX6.js +1 -0
  392. package/dist/cli/errors-DcJ_PayO.js +97 -0
  393. package/dist/cli/exec-CXBufciC.js +461 -0
  394. package/dist/cli/fastest-levenshtein-B_QF6At5.js +119 -0
  395. package/dist/cli/files-DQayErI8.js +999 -0
  396. package/dist/cli/fresh-import-CdO2oQaQ.js +39 -0
  397. package/dist/cli/gen-BN_eh6rE.js +390 -0
  398. package/dist/cli/guards-DxwRG0Uv.js +7 -0
  399. package/dist/cli/in-stack-diff-huI7fGMX.js +185 -0
  400. package/dist/cli/index.d.ts +1 -53
  401. package/dist/cli/index.js +10 -11
  402. package/dist/cli/init-CaDDt8F6.js +556 -0
  403. package/dist/cli/io-CQzy8PEZ.js +36 -0
  404. package/dist/cli/json5-DhsZB2va.js +784 -0
  405. package/dist/cli/jsonc-DU9Clnrz.js +1 -0
  406. package/dist/cli/jsonc-u_UiXFxs.js +43 -0
  407. package/dist/cli/keys-CxajkV_7.js +105 -0
  408. package/dist/cli/legacy-prefix-D8Jfku6I.js +153 -0
  409. package/dist/cli/live-KU41LMGE.js +339 -0
  410. package/dist/cli/mcp-C_m-TpLJ.js +240 -0
  411. package/dist/cli/metadata-Bq4ra7zo.js +149 -0
  412. package/dist/cli/migrate-DHG2Qz_K.js +45 -0
  413. package/dist/cli/migration-safety-STVbiKhz.js +925 -0
  414. package/dist/cli/migrations-O1QZoMiH.js +116 -0
  415. package/dist/cli/module-migration-DB9ntWM-.js +118 -0
  416. package/dist/cli/moved-BAFPdJz_.js +253 -0
  417. package/dist/cli/ohash-imLR_J5Y.js +276 -0
  418. package/dist/cli/openapi-3.0-BJiTNq_x.js +927 -0
  419. package/dist/cli/openapi-3.1-BcWCoii2.js +869 -0
  420. package/dist/cli/openapi-3.2-MXPkeoTk.js +1030 -0
  421. package/dist/cli/orphans-CPcR85QN.js +27 -0
  422. package/dist/cli/parse-BueItuNJ.js +181 -0
  423. package/dist/cli/powersync-CN3QPF2K.js +375 -0
  424. package/dist/cli/powersync-DfeGl5N1.js +1 -0
  425. package/dist/cli/preset-BQnjDCSR.js +100 -0
  426. package/dist/cli/print-DG7TRCi8.js +66 -0
  427. package/dist/cli/prompts-D9b6uf21.js +1133 -0
  428. package/dist/cli/providers-DpfoF3VC.js +298 -0
  429. package/dist/cli/prune-workflows-DcNJUS1m.js +153 -0
  430. package/dist/cli/redact--zOGdWzo.js +37 -0
  431. package/dist/cli/remove-BpfYqP45.js +237 -0
  432. package/dist/cli/render-Q7jnLn_C.js +2213 -0
  433. package/dist/cli/rolldown-runtime-DegdyBIC.js +25 -0
  434. package/dist/cli/run-9NfabanB.js +703 -0
  435. package/dist/cli/run-D6K-qQIX.js +1450 -0
  436. package/dist/cli/run-dY9uOC3W.js +62 -0
  437. package/dist/cli/seed-B4H0Lco9.js +187 -0
  438. package/dist/cli/seed-BIB6-WPa.js +1 -0
  439. package/dist/cli/shared-PrvYREVy.js +150 -0
  440. package/dist/cli/shell-C1U618XA.js +9 -0
  441. package/dist/cli/skills-jZThjL3B.js +120 -0
  442. package/dist/cli/snapshot-UfJsqfys.js +728 -0
  443. package/dist/cli/source-F3YTVvFo.js +317 -0
  444. package/dist/cli/source-args-DJMrW_jW.js +58 -0
  445. package/dist/cli/spec-DsLQuJKp.js +7449 -0
  446. package/dist/cli/spec-HQOBVbEO.js +1 -0
  447. package/dist/cli/sql-layout-CZ66pY8j.js +260 -0
  448. package/dist/cli/stack-147NqctC.js +134 -0
  449. package/dist/cli/stack-env-BQhbUFa7.js +92 -0
  450. package/dist/cli/stack-status-Mxgqb3I4.js +45 -0
  451. package/dist/cli/stacks-C5YL6Un9.js +230 -0
  452. package/dist/cli/style-B5-nByxb.js +34 -0
  453. package/dist/cli/supabase-toml-B6-eEV5p.js +1155 -0
  454. package/dist/cli/sync-B12wbtFd.js +318 -0
  455. package/dist/cli/table-D9FbJS8h.js +88 -0
  456. package/dist/cli/toml-VX0BsvYq.js +422 -0
  457. package/dist/cli/topics-Cdg0V7Tt.js +29 -0
  458. package/dist/cli/trace-D3TNqWBg.js +6 -0
  459. package/dist/cli/upgrade-AgUXFDo6.js +270 -0
  460. package/dist/cli/upgrade-C20z49De.js +40 -0
  461. package/dist/cli/validate-C_WTnX1U.js +7426 -0
  462. package/dist/cli/version-DEUWW8cv.js +3 -0
  463. package/dist/cli/yaml-JsusTbcC.js +2250 -0
  464. package/dist/client/index.d.ts +7 -7
  465. package/dist/client/index.js +9 -12
  466. package/dist/client/native/index.d.ts +7 -23
  467. package/dist/client/native/index.js +15 -22
  468. package/dist/client-BLor58Je.js +290 -0
  469. package/dist/clone-H_gCsL29.js +32 -0
  470. package/dist/cloud-event-CLvsaPqH.js +62 -0
  471. package/dist/cloud-event-bcaMqEbN.d.ts +62 -0
  472. package/dist/codecs-B1VO2BGL.d.ts +220 -0
  473. package/dist/codecs-B9v5Y5HH.js +357 -0
  474. package/dist/commerce/index.d.ts +5 -13
  475. package/dist/commerce/index.js +13 -16
  476. package/dist/compiler-CWishtY2.d.ts +12 -0
  477. package/dist/compose-BRBlPSEY.js +52 -0
  478. package/dist/composite-BZMkWNOQ.js +125 -0
  479. package/dist/composite-ClLWZIwX.d.ts +79 -0
  480. package/dist/config/index.d.ts +6 -6
  481. package/dist/config/index.js +7 -7
  482. package/dist/config-BhExAhNK.js +1102 -0
  483. package/dist/config-MDRA2sre.js +1672 -0
  484. package/dist/connectors-BImAu75R.d.ts +145 -0
  485. package/dist/context-DSevnLrT.js +40 -0
  486. package/dist/context-DcxfrCml.d.ts +4267 -0
  487. package/dist/controller-BJmh7gFm.js +78 -0
  488. package/dist/controller-D_UJBaEU.d.ts +50 -0
  489. package/dist/controller-y1kSMuCU.js +72 -0
  490. package/dist/conversion-7U1WeLxK.d.ts +84 -0
  491. package/dist/conversion-Bj9j3KnG.js +76 -0
  492. package/dist/cookie-DDkqvqe4.d.ts +3 -0
  493. package/dist/cookie-DJI6xXJ9.js +4 -0
  494. package/dist/cors-9SDsndtb.d.ts +13 -0
  495. package/dist/cors-DrDFLMNn.js +23 -0
  496. package/dist/create/index.d.ts +4 -28
  497. package/dist/create/index.js +9 -15
  498. package/dist/create/lite/index.d.ts +5 -25
  499. package/dist/create/lite/index.js +14 -24
  500. package/dist/create/oauth/index.d.ts +1 -1
  501. package/dist/create/oauth/index.js +1 -2
  502. package/dist/create/supabase/index.d.ts +2 -4
  503. package/dist/create/supabase/index.js +3 -6
  504. package/dist/create-blocks-D7q1boXV.js +367 -0
  505. package/dist/credentials/index.d.ts +6 -10
  506. package/dist/credentials/index.js +11 -12
  507. package/dist/cron-BD8VrQQl.js +147 -0
  508. package/dist/cron-route-DSITg1yC.js +23 -0
  509. package/dist/csv-Bwn9insJ.js +88 -0
  510. package/dist/csv-Dd1iKsk-.d.ts +26 -0
  511. package/dist/data-engine-B-D6bdyx.d.ts +269 -0
  512. package/dist/data-engine-BbqQwso_.js +174 -0
  513. package/dist/data-hooks-BToeAcQ_.js +277 -0
  514. package/dist/db-exception-Dv18UZ-I.js +30 -0
  515. package/dist/deal-forecast-CN_BEy9s.d.ts +21 -0
  516. package/dist/deal-forecast-DsVFoMkJ.js +38 -0
  517. package/dist/define-3RbqoF1S.d.ts +1242 -0
  518. package/dist/define-B6D55cO0.js +2073 -0
  519. package/dist/define-block-22Jv4U_-.js +63 -0
  520. package/dist/define-block-B_i9VPcc.d.ts +1669 -0
  521. package/dist/delegation-BRHHXERz.js +152 -0
  522. package/dist/delivery-CWcbh87x.d.ts +69 -0
  523. package/dist/delivery-SmPHu2_H.js +28 -0
  524. package/dist/delivery-events-0mAEuscm.js +52 -0
  525. package/dist/documents-6ov2gWh3.d.ts +150 -0
  526. package/dist/edge/index.d.ts +17 -23
  527. package/dist/edge/index.js +18 -22
  528. package/dist/elysia/index.d.ts +2 -6
  529. package/dist/elysia/index.js +4 -6
  530. package/dist/email-BRm6wMWQ.d.ts +40 -0
  531. package/dist/embeddings--v4BJdUL.js +127 -0
  532. package/dist/embeddings-K0lH--nt.d.ts +76 -0
  533. package/dist/ended-CCoE7XXY.d.ts +22 -0
  534. package/dist/entitlements-XwpuBbKN.d.ts +52 -0
  535. package/dist/entitlements-sLoj3M6Y.js +44 -0
  536. package/dist/entity-naming-BES3pkQI.js +130 -0
  537. package/dist/entity-schema-DEIz0I8i.js +38 -0
  538. package/dist/env/index.d.ts +1 -1
  539. package/dist/env/index.js +1 -2
  540. package/dist/envelope-DAtaFJue.js +89 -0
  541. package/dist/errors-B7tCfCvX.js +327 -0
  542. package/dist/errors-BdjHv5SV.js +43 -0
  543. package/dist/errors-D3-4c-XF.js +102 -0
  544. package/dist/escape-like-CK6L7gkj.d.ts +26 -0
  545. package/dist/escape-like-gxNXs145.js +6 -0
  546. package/dist/eve/index.d.ts +247 -16
  547. package/dist/eve/index.js +334 -26
  548. package/dist/eve-Cf-QRGij.d.ts +213 -0
  549. package/dist/event-calendar-DUtFyRrv.d.ts +63 -0
  550. package/dist/event-map-DxfsFgQT.js +18 -0
  551. package/dist/events/index.d.ts +3 -3
  552. package/dist/events/index.js +7 -8
  553. package/dist/events-BRKIxVQD.js +25 -0
  554. package/dist/events-CfDdOwqg.d.ts +850 -0
  555. package/dist/events-Da482tiF.js +81 -0
  556. package/dist/executor-BDMqPbVU.js +482 -0
  557. package/dist/executor-C0_TT717.js +840 -0
  558. package/dist/executor-CAhykadW.d.ts +168 -0
  559. package/dist/executor-CbDX34I9.d.ts +99 -0
  560. package/dist/executor-Dc4Pl44u.js +207 -0
  561. package/dist/executor-ynEwaUZy.d.ts +35 -0
  562. package/dist/expo/index.d.ts +5 -9
  563. package/dist/expo/index.js +10 -12
  564. package/dist/extension-DQ9-oOVC.js +58 -0
  565. package/dist/extension-LgaDPMJs.js +120 -0
  566. package/dist/extension-WdHd5uqI.js +102 -0
  567. package/dist/extension-rdpYvpyN.js +52 -0
  568. package/dist/extension-shared-DJb_PfD4.js +59 -0
  569. package/dist/extra-Dz9n5y1s.js +9 -0
  570. package/dist/field-errors-tQr-anYL.d.ts +208 -0
  571. package/dist/field-formats-Cap-V7UP.js +101 -0
  572. package/dist/field-formats-DVukMbRa.d.ts +36 -0
  573. package/dist/fields-AKKMirg_.d.ts +76 -0
  574. package/dist/fields-BBcdKD-S.js +107 -0
  575. package/dist/filter-evaluate-Bhq99aEN.d.ts +35 -0
  576. package/dist/filter-evaluate-D_LLfdtE.js +216 -0
  577. package/dist/filter-query-B7A4l2xn.d.ts +131 -0
  578. package/dist/filter-query-Ds7Z6lgZ.js +565 -0
  579. package/dist/flags-B5B4mkZV.d.ts +315 -0
  580. package/dist/flags-D0npSE-5.js +361 -0
  581. package/dist/flags-sdk/index.d.ts +217 -28
  582. package/dist/flags-sdk/index.js +255 -35
  583. package/dist/form-definition-8cCCt5zj.js +362 -0
  584. package/dist/form-definition-BN8shngm.d.ts +117 -0
  585. package/dist/format-BT0Z3V54.d.ts +77 -0
  586. package/dist/framework-B1h-uquj.js +57 -0
  587. package/dist/framework-CyDn_SXR.d.ts +45 -0
  588. package/dist/function-contract-Bf6llTkE.js +7 -0
  589. package/dist/function-contract-DgDBYbXu.d.ts +25 -0
  590. package/dist/gateway-Cg_MgGen.d.ts +120 -0
  591. package/dist/gateway-options-DQGQzdkD.js +26 -0
  592. package/dist/gateway-options-Mut8jih_.d.ts +27 -0
  593. package/dist/guards-CsRa6v57.js +11 -0
  594. package/dist/guest-actions-CEwttioE.js +8 -0
  595. package/dist/guest-actions-DfHHp98H.d.ts +3 -0
  596. package/dist/h3/index.d.ts +2 -6
  597. package/dist/h3/index.js +4 -6
  598. package/dist/h3/v1/index.d.ts +3 -5
  599. package/dist/h3/v1/index.js +4 -5
  600. package/dist/history-6KiVNWdH.js +269 -0
  601. package/dist/hmac-DNcfpmI9.js +22 -0
  602. package/dist/hono/index.d.ts +14 -19
  603. package/dist/hono/index.js +14 -16
  604. package/dist/http-BDC1IvBX.js +27 -0
  605. package/dist/http-BRUI3qim.js +140 -0
  606. package/dist/http-D4lH1xqY.js +39 -0
  607. package/dist/image-url-bsGeybeg.js +83 -0
  608. package/dist/impersonation-BOCJcsmS.d.ts +26 -0
  609. package/dist/impersonation-D-quM36V.js +61 -0
  610. package/dist/inbox-BmSA9K01.d.ts +326 -0
  611. package/dist/index-8w4OB5En.d.ts +102 -0
  612. package/dist/index-B2871MHr.d.ts +234 -0
  613. package/dist/index-B5_J-MaK.d.ts +152 -0
  614. package/dist/index-BWR29Vvw.d.ts +76 -0
  615. package/dist/index-CRrBZtKm.d.ts +326 -0
  616. package/dist/index-CTpEQvIv.d.ts +291 -0
  617. package/dist/index-D2BGCjIz.d.ts +570 -0
  618. package/dist/index-D66_dYVi.d.ts +667 -0
  619. package/dist/index-Dj4VKpYZ.d.ts +49 -0
  620. package/dist/index-DzBFdI9I.d.ts +145 -0
  621. package/dist/index-lazpPVr0.d.ts +402 -0
  622. package/dist/index-xCpjvDVm.d.ts +637 -0
  623. package/dist/index.d.ts +13 -41
  624. package/dist/index.js +29 -34
  625. package/dist/instance-property-BlH7QSDl.js +6 -0
  626. package/dist/instances-D31jrmKh.js +16636 -0
  627. package/dist/invalidate-DAB9CaPm.d.ts +19 -0
  628. package/dist/iso4217-oKsif_hW.js +175 -0
  629. package/dist/json-O5vFw243.js +21 -0
  630. package/dist/json-schema-D9eVL_xi.js +884 -0
  631. package/dist/jwks-cache-IZaiICAV.js +48 -0
  632. package/dist/jws-B8p0ppgh.js +204 -0
  633. package/dist/jws-CxgTsbgG.d.ts +64 -0
  634. package/dist/kit-CJKo0soh.d.ts +92 -0
  635. package/dist/kit-CVZDd1X9.js +132 -0
  636. package/dist/knowledge-BUwbpS8I.d.ts +215 -0
  637. package/dist/knowledge-DdZzUTQ-.js +299 -0
  638. package/dist/lint/index.d.ts +1 -5
  639. package/dist/lint/index.js +8 -10
  640. package/dist/list/index.d.ts +3 -3
  641. package/dist/list/index.js +3 -3
  642. package/dist/list-query-CZ-K5aHX.d.ts +220 -0
  643. package/dist/list-query-D-tgs1eY.js +558 -0
  644. package/dist/live-BVi3q4bX.js +277 -0
  645. package/dist/logger-0LfhvwE4.d.ts +16 -0
  646. package/dist/logger-BkF8ukXV.js +20 -0
  647. package/dist/lookup-upE-e1zw.js +17 -0
  648. package/dist/management-DtX4ic1F.d.ts +55 -0
  649. package/dist/mapper/bin.js +13 -17
  650. package/dist/mcp/index.d.ts +8 -18
  651. package/dist/mcp/index.js +24 -29
  652. package/dist/mcp/sdk/index.d.ts +7 -11
  653. package/dist/mcp/sdk/index.js +12 -14
  654. package/dist/message-Cc4bkdNw.d.ts +97 -0
  655. package/dist/messages-CRk1g6oe.js +512 -0
  656. package/dist/messaging-DMhtGxVv.d.ts +295 -0
  657. package/dist/methods-BjfDv4Gy.js +9 -0
  658. package/dist/metric-definition-2KQYeUZ1.d.ts +67 -0
  659. package/dist/metric-definition-D4H6IQT7.js +116 -0
  660. package/dist/mfa-CM5r904M.d.ts +34 -0
  661. package/dist/model-Lxa_mOzB.d.ts +338 -0
  662. package/dist/model-messages-BcrkjsPE.js +205 -0
  663. package/dist/model-messages-CGSUU450.d.ts +32 -0
  664. package/dist/money-BgpAd7d3.d.ts +89 -0
  665. package/dist/money-DH--bbYr.js +196 -0
  666. package/dist/money-codec-SKPm8FPw.js +40 -0
  667. package/dist/my-work-kinds-DNPq3ccL.js +10 -0
  668. package/dist/nestjs/index.d.ts +3 -5
  669. package/dist/nestjs/index.js +5 -6
  670. package/dist/next/client/index.d.ts +1 -5
  671. package/dist/next/client/index.js +2 -4
  672. package/dist/next/image/index.d.ts +1 -3
  673. package/dist/next/image/index.js +2 -3
  674. package/dist/next/index.d.ts +93 -103
  675. package/dist/next/index.js +87 -87
  676. package/dist/node/index.d.ts +3 -3
  677. package/dist/node/index.js +6 -7
  678. package/dist/node-headers-C3FExlg9.js +54 -0
  679. package/dist/node-headers-TnS4T7V_.d.ts +25 -0
  680. package/dist/nuxt/index.d.ts +0 -2
  681. package/dist/nuxt/index.js +1 -2
  682. package/dist/operations-BNFbWv1t.js +28 -0
  683. package/dist/operations-D51ONRvR.d.ts +4 -0
  684. package/dist/optional-peer-5SOYr3lL.js +31 -0
  685. package/dist/options--rohtkkC.js +4 -0
  686. package/dist/options-1iHDmlZ5.js +8 -0
  687. package/dist/options-2QJXZPPS.js +4 -0
  688. package/dist/options-B-JqrC61.d.ts +8 -0
  689. package/dist/options-B3xH2JvJ.js +8 -0
  690. package/dist/options-B4sTqDrt.js +4 -0
  691. package/dist/options-B56njigZ.js +19 -0
  692. package/dist/options-B5A3UmKY.d.ts +17 -0
  693. package/dist/options-B6m9gYRH.d.ts +11 -0
  694. package/dist/options-B7Pl708M.js +8 -0
  695. package/dist/options-B7YrdiUc.js +11 -0
  696. package/dist/options-B8c2_hIB.js +9 -0
  697. package/dist/options-B9w_Y08G.d.ts +6 -0
  698. package/dist/options-BDF60ouf.js +4 -0
  699. package/dist/options-BDMPjyrI.js +4 -0
  700. package/dist/options-BHdHuY5r.js +14 -0
  701. package/dist/options-BLMeCbtT.js +31 -0
  702. package/dist/options-BLQePOPy.d.ts +8 -0
  703. package/dist/options-BLn1PFyu.js +4 -0
  704. package/dist/options-BMO-FnOT.js +7 -0
  705. package/dist/options-BNRvoEkj.js +4 -0
  706. package/dist/options-BPQOiVx2.js +7 -0
  707. package/dist/options-BSTJmfX4.js +10 -0
  708. package/dist/options-BTRH26MJ.js +9 -0
  709. package/dist/options-BTaQszYn.js +9 -0
  710. package/dist/options-BYo7hMHK.js +10 -0
  711. package/dist/options-B_bxCZYM.js +7 -0
  712. package/dist/options-BaBaVWS-.js +10 -0
  713. package/dist/options-BamaRO-q.d.ts +12 -0
  714. package/dist/options-BcBdiPSZ.js +7 -0
  715. package/dist/options-BfY4pyQE.js +23 -0
  716. package/dist/options-BgCS5ODi.js +9 -0
  717. package/dist/options-Bi96Lzuf.js +9 -0
  718. package/dist/options-BjEsSoFp.js +17 -0
  719. package/dist/options-Bkx8vwip.js +4 -0
  720. package/dist/options-BmFSI07A.js +4 -0
  721. package/dist/options-BmwDdKwE.js +7 -0
  722. package/dist/options-Bn3NjXfn.js +7 -0
  723. package/dist/options-BqK4xV67.js +13 -0
  724. package/dist/options-Bs2dC-at.js +11 -0
  725. package/dist/options-BvttpM1M.js +4 -0
  726. package/dist/options-Bwrwb8do.d.ts +10 -0
  727. package/dist/options-BxdqA2Ex.js +19 -0
  728. package/dist/options-BzxR82Tu.js +9 -0
  729. package/dist/options-C-NFS6e3.js +13 -0
  730. package/dist/options-C13-dVMH.js +7 -0
  731. package/dist/options-C1RIyAe1.js +7 -0
  732. package/dist/options-C1kZ3qLd.js +8 -0
  733. package/dist/options-C2RjdunU.js +27 -0
  734. package/dist/options-C4kpi6HE.js +8 -0
  735. package/dist/options-C5MfwOAO.js +8 -0
  736. package/dist/options-C5fKQ3EJ.d.ts +10 -0
  737. package/dist/options-CJR59q8s.js +17 -0
  738. package/dist/options-CJVYQue3.d.ts +10 -0
  739. package/dist/options-CLy7CcMn.js +8 -0
  740. package/dist/options-COfEYic3.js +8 -0
  741. package/dist/options-CRwTY_q2.d.ts +58 -0
  742. package/dist/options-CcW7h8mv.js +9 -0
  743. package/dist/options-Ceu2j1vv.js +7 -0
  744. package/dist/options-CgBKgmI8.js +7 -0
  745. package/dist/options-CgMiQGOF.js +9 -0
  746. package/dist/options-CptvcSmF.js +11 -0
  747. package/dist/options-CsLUAt04.js +8 -0
  748. package/dist/options-CtyjhSGk.js +15 -0
  749. package/dist/options-CuPWezcV.js +7 -0
  750. package/dist/options-CyDOOWlk.js +7 -0
  751. package/dist/options-CyYZvdSy.js +10 -0
  752. package/dist/options-CzIPn0fF.js +4 -0
  753. package/dist/options-CzWjw2HY.js +10 -0
  754. package/dist/options-CztbWdz9.js +4 -0
  755. package/dist/options-D4LuPM8a.js +4 -0
  756. package/dist/options-D4dxMGHF.js +7 -0
  757. package/dist/options-D5a9CHgP.js +7 -0
  758. package/dist/options-D6tpMRvp.d.ts +13 -0
  759. package/dist/options-D848Os4l.js +10 -0
  760. package/dist/options-DCZPW5gR.d.ts +15 -0
  761. package/dist/options-DFSHZFLN.js +4 -0
  762. package/dist/options-DFemc2im.js +9 -0
  763. package/dist/options-DFgHHwzD.js +12 -0
  764. package/dist/options-DNZ9r_Vo.d.ts +8 -0
  765. package/dist/options-DP7NwQPZ.js +4 -0
  766. package/dist/options-DPQaafyc.js +7 -0
  767. package/dist/options-DQkhhBLy.js +4 -0
  768. package/dist/options-DTTz33na.js +9 -0
  769. package/dist/options-DToWdVqW.js +4 -0
  770. package/dist/options-DUNUGuhM.js +4 -0
  771. package/dist/options-DWgpi5ns.js +7 -0
  772. package/dist/options-DeamnVOY.d.ts +12 -0
  773. package/dist/options-Dg7eK-_J.d.ts +8 -0
  774. package/dist/options-DiIlMZpc.js +8 -0
  775. package/dist/options-DjFbIRgV.js +16 -0
  776. package/dist/options-DjtCYRWb.js +4 -0
  777. package/dist/options-Dk6D88Zx.d.ts +6 -0
  778. package/dist/options-DpwRG4tO.js +8 -0
  779. package/dist/options-DvgKdZ2K.js +9 -0
  780. package/dist/options-DwIoRvic.js +4 -0
  781. package/dist/options-GwwLsKf5.js +8 -0
  782. package/dist/options-I1ZHfDP0.d.ts +58 -0
  783. package/dist/options-Itq7QYoW.js +20 -0
  784. package/dist/options-JnPEVbBJ.js +17 -0
  785. package/dist/options-Jwux4JDX.js +7 -0
  786. package/dist/options-Lg76d-cV.js +7 -0
  787. package/dist/options-Lh6uxepF.d.ts +24 -0
  788. package/dist/options-Oki2W_c3.js +4 -0
  789. package/dist/options-PM7IaIFP.js +10 -0
  790. package/dist/options-PTLBl6QT.js +7 -0
  791. package/dist/options-PheFo4JY.js +10 -0
  792. package/dist/options-SlC_jZ7y.js +4 -0
  793. package/dist/options-Sq4bYbf5.js +13 -0
  794. package/dist/options-XiD_Y3oK.js +14 -0
  795. package/dist/options-Z-bd_H1E.js +88 -0
  796. package/dist/options-ax_ssX_m.js +4 -0
  797. package/dist/options-bNB8_nlW.js +23 -0
  798. package/dist/options-eIEk0vqV.js +4 -0
  799. package/dist/options-eLIedotm.js +7 -0
  800. package/dist/options-jg0FMHA5.js +4 -0
  801. package/dist/options-mypVYaqR.js +9 -0
  802. package/dist/options-ompJjxkV.js +4 -0
  803. package/dist/options-pbc4H8_A.js +7 -0
  804. package/dist/options-uUGi0Phf.d.ts +14 -0
  805. package/dist/options-yRwYr4up.js +4 -0
  806. package/dist/options-z2Zhi97E.js +9 -0
  807. package/dist/options-zYV6M0vr.js +8 -0
  808. package/dist/orpc/index.d.ts +13 -19
  809. package/dist/orpc/index.js +20 -23
  810. package/dist/otel/index.d.ts +4 -6
  811. package/dist/otel/index.js +8 -10
  812. package/dist/outbox-C44Aa94K.d.ts +197 -0
  813. package/dist/payments-B4JchZuJ.js +15 -0
  814. package/dist/payments-BBGSGRQ7.d.ts +112 -0
  815. package/dist/permissions-B9aZZ9LR.js +43 -0
  816. package/dist/permissions-controller-B4uI5IPH.js +33 -0
  817. package/dist/pg-error-D92B6jlF.js +25 -0
  818. package/dist/plugin-Ca2qBiFZ.js +47 -0
  819. package/dist/pool-Bji4lnQM.d.ts +121 -0
  820. package/dist/pool-errors-JrZie6u3.js +26 -0
  821. package/dist/ports-C-hdygkZ.js +150 -0
  822. package/dist/ports-zFqRNXVJ.d.ts +87 -0
  823. package/dist/postgres/index.d.ts +5 -11
  824. package/dist/postgres/index.js +7 -9
  825. package/dist/postgrest-2WjRrtmX.d.ts +51 -0
  826. package/dist/postgrest-executor-lf8Mt4J0.js +1064 -0
  827. package/dist/powersync/index.d.ts +7 -25
  828. package/dist/powersync/index.js +14 -24
  829. package/dist/preset/index.d.ts +3 -3
  830. package/dist/preset/index.js +3 -3
  831. package/dist/preset-om2rbdYw.js +1038 -0
  832. package/dist/problem-C0SVHhd3.js +161 -0
  833. package/dist/problem-NGBjN-TO.d.ts +77 -0
  834. package/dist/project-oNHntJ6T.js +1749 -0
  835. package/dist/provider-B6qpleR9.js +56 -0
  836. package/dist/provider-CH8McX3b.d.ts +142 -0
  837. package/dist/providers-C9sBIBYE.js +62 -0
  838. package/dist/push-token-CO28k46S.js +15 -0
  839. package/dist/push-token-a3Ev1U3L.d.ts +22 -0
  840. package/dist/queries-BLrxg_GL.js +238 -0
  841. package/dist/query/index.d.ts +3 -3
  842. package/dist/query/index.js +11 -15
  843. package/dist/range-BN3kpJAE.d.ts +6 -0
  844. package/dist/range-Nrh_qtb_.js +6 -0
  845. package/dist/rank-keys-CEBzd9Xa.js +59 -0
  846. package/dist/rank-result-B_xLQCBV.d.ts +12 -0
  847. package/dist/rank-result-DzaTKKhH.js +17 -0
  848. package/dist/rate-limit-C89Yzwd9.d.ts +48 -0
  849. package/dist/rate-limit-CRhlLFhP.js +380 -0
  850. package/dist/rate-limit-DXJbLVg0.js +48 -0
  851. package/dist/ratelimit-headers-CpB-cDD6.js +61 -0
  852. package/dist/react/index.d.ts +11 -11
  853. package/dist/react/index.js +6 -6
  854. package/dist/react/native/index.d.ts +3 -5
  855. package/dist/react/native/index.js +5 -5
  856. package/dist/react/server.d.ts +13 -15
  857. package/dist/react/server.js +9 -10
  858. package/dist/react/session.d.ts +4 -6
  859. package/dist/react/session.js +2 -3
  860. package/dist/react-C40oomj7.js +1006 -0
  861. package/dist/react-CqOVutZj.js +80 -0
  862. package/dist/react-router/index.d.ts +8 -12
  863. package/dist/react-router/index.js +9 -11
  864. package/dist/read-set-DEDoIHMM.js +198 -0
  865. package/dist/realtime/index.d.ts +7 -7
  866. package/dist/realtime/index.js +6 -7
  867. package/dist/realtime-status-CocmAOPv.js +10 -0
  868. package/dist/realtime-status-D3oUx3o4.d.ts +6 -0
  869. package/dist/record-bindings-jTZw-GVe.js +25 -0
  870. package/dist/record-form-DCIui2Ol.d.ts +80 -0
  871. package/dist/record-type-oQxekQTX.js +219 -0
  872. package/dist/recordings-Dlpq8jUG.d.ts +117 -0
  873. package/dist/records/index.d.ts +10 -14
  874. package/dist/records/index.js +13 -16
  875. package/dist/refresh-B8t_KE3s.js +142 -0
  876. package/dist/refresh-BK9epzeC.d.ts +52 -0
  877. package/dist/refusal-DEuFVi4s.d.ts +30 -0
  878. package/dist/refusal-DhX7Xpfp.js +63 -0
  879. package/dist/relay-CllqA-lV.js +248 -0
  880. package/dist/resolve-DVOtYTAc.d.ts +287 -0
  881. package/dist/resolve-FW8oeXvh.js +927 -0
  882. package/dist/resolved-names-DYYyh35i.js +130 -0
  883. package/dist/resource-BfsTJnxZ.d.ts +119 -0
  884. package/dist/resource-Cn6Bn-_o.js +517 -0
  885. package/dist/resource-DQ4kIBpa.js +104 -0
  886. package/dist/resource-execute-DQRS7PFt.d.ts +13 -0
  887. package/dist/resource-schemas-Bq0g2RCQ.js +81 -0
  888. package/dist/resource-types-DF6KDAZM.d.ts +155 -0
  889. package/dist/resources-B0Vy7_wv.js +63 -0
  890. package/dist/resources-CeY53FiJ.d.ts +5 -0
  891. package/dist/respond-C2qvP1wv.js +106 -0
  892. package/dist/respond-CkwkvFdZ.d.ts +108 -0
  893. package/dist/result-8xza7w5W.js +145 -0
  894. package/dist/result-DTOQRyGY.d.ts +347 -0
  895. package/dist/rows-Ce8dsmfM.js +79 -0
  896. package/dist/rows-D-RqIsRz.js +38 -0
  897. package/dist/rrule-BLpe2449.js +289 -0
  898. package/dist/run-keys-BnzqxtYc.d.ts +59 -0
  899. package/dist/run-state-D0Tbl-nM.d.ts +11 -0
  900. package/dist/run-state-DGiyDQxH.js +12 -0
  901. package/dist/run-watch-DJk4Q603.js +52 -0
  902. package/dist/runtime-qslVrC9l.js +43 -0
  903. package/dist/sales-lines-Bde9cV5F.d.ts +36 -0
  904. package/dist/sales-lines-axwWhnLk.js +44 -0
  905. package/dist/sales-shared-CY3s_wBx.js +21 -0
  906. package/dist/sandboxes-DDWuD9fh.d.ts +85 -0
  907. package/dist/schemas-CpoEiAeT.js +213 -0
  908. package/dist/scope-dD_OAgRU.js +89 -0
  909. package/dist/scores-Bql-ABl0.d.ts +172 -0
  910. package/dist/scores-Bvk_JgXL.js +176 -0
  911. package/dist/search-DtbkD0h0.js +8 -0
  912. package/dist/server/index.d.ts +35 -69
  913. package/dist/server/index.js +51 -59
  914. package/dist/server-types-C3p3jUqr.d.ts +583 -0
  915. package/dist/session-BOch2y2z.d.ts +96 -0
  916. package/dist/session-status-DRBRnZHx.d.ts +80 -0
  917. package/dist/shared-Bmcnxwie.js +16 -0
  918. package/dist/shared-Ci1g9nl4.js +90 -0
  919. package/dist/shared-DsBcvj6q.d.ts +9 -0
  920. package/dist/sign-in-BmigClRh.js +730 -0
  921. package/dist/sign-in-C9pZE1kM.d.ts +53 -0
  922. package/dist/sign-in-CXOg2Dwb.js +399 -0
  923. package/dist/sign-in-Dxyi4aKu.d.ts +83 -0
  924. package/dist/signatures-CBn7w4VR.js +144 -0
  925. package/dist/signatures-jPr9JXyw.d.ts +41 -0
  926. package/dist/signers-Cz5ZhTHH.d.ts +380 -0
  927. package/dist/signing-keys-BC5_hJN5.js +163 -0
  928. package/dist/signing-keys-DS-rIVzz.d.ts +117 -0
  929. package/dist/simplify-BzThKn5b.js +82 -0
  930. package/dist/solid/index.d.ts +12 -22
  931. package/dist/solid/index.js +10 -16
  932. package/dist/solid-start/index.d.ts +7 -9
  933. package/dist/solid-start/index.js +8 -9
  934. package/dist/spec/index.d.ts +6 -48
  935. package/dist/spec/index.js +23 -39
  936. package/dist/spec-6Vr7sc0Z.js +123 -0
  937. package/dist/spec-pins-CuQ2anBw.d.ts +125 -0
  938. package/dist/spec-pins-FKUzgF6K.js +61 -0
  939. package/dist/sql/index.d.ts +4 -4
  940. package/dist/sql/index.js +4 -4
  941. package/dist/sql-BPV51R3A.js +140626 -0
  942. package/dist/sql-C1K5JALb.js +420 -0
  943. package/dist/sql-type-XWMeZRAl.js +33 -0
  944. package/dist/sqlite/index.d.ts +3 -9
  945. package/dist/sqlite/index.js +5 -8
  946. package/dist/sso-BEvNf1oW.d.ts +159 -0
  947. package/dist/sso-CRnaFJh0.js +216 -0
  948. package/dist/ssr/index.d.ts +5 -5
  949. package/dist/ssr/index.js +3 -3
  950. package/dist/standard-BD2aOUsf.js +24 -0
  951. package/dist/standard-DRX6Ch1j.d.ts +5 -0
  952. package/dist/stats-BTJgRMEp.js +82 -0
  953. package/dist/statuses-BTrQ5H4S.js +27 -0
  954. package/dist/statuses-Bv-0XoYC.js +27 -0
  955. package/dist/storage/index.d.ts +3 -3
  956. package/dist/storage/index.js +27 -40
  957. package/dist/storage-api-COQr77e8.js +9 -0
  958. package/dist/store-CKKzmsWB.js +68 -0
  959. package/dist/store-c7QxUHX-.d.ts +81 -0
  960. package/dist/streams/index.d.ts +3 -7
  961. package/dist/streams/index.js +5 -6
  962. package/dist/streams/redis/index.d.ts +1 -3
  963. package/dist/streams/redis/index.js +6 -7
  964. package/dist/stripe/index.d.ts +1 -3
  965. package/dist/stripe/index.js +3 -4
  966. package/dist/stripe-Bl-sjnl6.d.ts +154 -0
  967. package/dist/stripe-DKRwRWew.js +31 -0
  968. package/dist/subject-readers-BARV5rNp.js +48 -0
  969. package/dist/subject-readers-DWkVSbFr.d.ts +19 -0
  970. package/dist/subject-type-BarjdHZV.js +7 -0
  971. package/dist/subjects-BGwLJ3IB.d.ts +148 -0
  972. package/dist/subjects-vci6Wufh.d.ts +86 -0
  973. package/dist/subscribers-C57054Pc.js +32 -0
  974. package/dist/summaries-CUemsYwV.d.ts +67 -0
  975. package/dist/supabase-mcp-DY32eoax.d.ts +44 -0
  976. package/dist/supabase-mcp-QvebHckf.js +27 -0
  977. package/dist/support-rZbdU35s.d.ts +351 -0
  978. package/dist/support-view-CvDEgyGY.js +17 -0
  979. package/dist/support-view-WY4Y-A40.d.ts +15 -0
  980. package/dist/svelte/index.d.ts +11 -21
  981. package/dist/svelte/index.js +9 -15
  982. package/dist/sveltekit/index.d.ts +10 -14
  983. package/dist/sveltekit/index.js +12 -14
  984. package/dist/table-schema-CwXg7oBz.d.ts +77 -0
  985. package/dist/table-schema-D-ss9ozY.js +291 -0
  986. package/dist/tables-BSiVuKKx.js +72 -0
  987. package/dist/tags-BVLELhOf.d.ts +28 -0
  988. package/dist/tags-CW-KvjdL.js +38 -0
  989. package/dist/tanstack-db/index.d.ts +4 -8
  990. package/dist/tanstack-db/index.js +4 -6
  991. package/dist/tanstack-start/index.d.ts +8 -12
  992. package/dist/tanstack-start/index.js +8 -10
  993. package/dist/tax-BD9dN1rx.d.ts +168 -0
  994. package/dist/tax-BwckP5dv.js +139 -0
  995. package/dist/tee-CVOMhEX-.js +100 -0
  996. package/dist/template-CNq9xcfx.js +125 -0
  997. package/dist/temporal-DKTdGK9i.js +94 -0
  998. package/dist/temporal-required-w_2u4EDp.js +19 -0
  999. package/dist/tenant-BR7fvPj7.js +26 -0
  1000. package/dist/tenant-RKvGBB-U.d.ts +15 -0
  1001. package/dist/tenant-source-46lMuMEn.js +7 -0
  1002. package/dist/testing/index.d.ts +77 -123
  1003. package/dist/testing/index.js +145 -117
  1004. package/dist/timeline-Bs-FGMIJ.js +49 -0
  1005. package/dist/timeline-Ck8OFuAN.d.ts +147 -0
  1006. package/dist/timing-B6yHayKA.js +94 -0
  1007. package/dist/topic-BBBCVLyS.js +640 -0
  1008. package/dist/topic-Dr8VYE4D.d.ts +411 -0
  1009. package/dist/transport-CS4cVH4S.js +30 -0
  1010. package/dist/ttl-cache-C5S0L2wx.js +31 -0
  1011. package/dist/types-BiedVwz_.d.ts +192 -0
  1012. package/dist/types-CCmW3MqI.d.ts +449 -0
  1013. package/dist/types-CL-z0A4K.d.ts +660 -0
  1014. package/dist/types-CvlJNzX4.d.ts +215 -0
  1015. package/dist/types-D9FY9qSJ.d.ts +247 -0
  1016. package/dist/types-DWZubmwk.d.ts +648 -0
  1017. package/dist/types-DnrJ_crV.js +28 -0
  1018. package/dist/types-Pv5WPfIC.d.ts +175 -0
  1019. package/dist/types-WZUVlTXs.d.ts +907 -0
  1020. package/dist/undo-BdoEJ6Ot.d.ts +44 -0
  1021. package/dist/undo-Dki6Ujak.js +43 -0
  1022. package/dist/upload-claim-Bo2mpBz4.js +32 -0
  1023. package/dist/usage-D27Uw426.d.ts +230 -0
  1024. package/dist/user-change-Ngy8z1fZ.js +133 -0
  1025. package/dist/variants-BaMleC56.js +51 -0
  1026. package/dist/vault-Dx0LaNMX.d.ts +60 -0
  1027. package/dist/vercel-connect/index.d.ts +194 -20
  1028. package/dist/vercel-connect/index.js +265 -33
  1029. package/dist/vercel-sandbox/index.d.ts +166 -0
  1030. package/dist/vercel-sandbox/index.js +171 -0
  1031. package/dist/verify-DY_j4GPZ.js +129 -0
  1032. package/dist/verify-DnL0Fgu0.d.ts +144 -0
  1033. package/dist/view-DmEZA1fL.d.ts +95 -0
  1034. package/dist/view-YnesSUEa.js +244 -0
  1035. package/dist/vue/index.d.ts +12 -22
  1036. package/dist/vue/index.js +10 -16
  1037. package/dist/watch-topic-BB7T05sc.d.ts +29 -0
  1038. package/dist/watch-topic-C2KxpeaB.js +56 -0
  1039. package/dist/wire-DIoLA8VL.js +90 -0
  1040. package/dist/wiring-DJBSLdyF.js +12 -0
  1041. package/dist/workflow-sdk/builder/index.d.ts +12 -14
  1042. package/dist/workflow-sdk/builder/index.js +12 -11
  1043. package/dist/workflow-sdk/index.d.ts +62 -6
  1044. package/dist/workflow-sdk/index.js +75 -10
  1045. package/dist/workflow-sdk/world/index.d.ts +13 -20
  1046. package/dist/workflow-sdk/world/index.js +115 -26
  1047. package/dist/workflow-sdk-BL3wzkdp.js +2749 -0
  1048. package/dist/workflow-sdk-D5zRSwxh.js +302 -0
  1049. package/dist/workflow-sdk-DMpVSMB7.d.ts +171 -0
  1050. package/dist/workflows-DKTw2PZo.d.ts +256 -0
  1051. package/dist/yjs/index.d.ts +3 -5
  1052. package/dist/yjs/index.js +6 -7
  1053. package/package.json +45 -31
  1054. package/schemas/config-v1.json +57 -3
  1055. package/schemas/snapshot-v2.json +7 -0
  1056. package/skills/better-supabase/SKILL.md +4 -4
  1057. package/skills/better-supabase/references/block-extensions.md +2 -2
  1058. package/skills/better-supabase/references/troubleshooting.md +1 -1
  1059. package/skills/better-supabase/references/ui-recipes.md +73 -36
  1060. package/skills/better-supabase-api/SKILL.md +1 -1
  1061. package/skills/better-supabase-api/references/adapters.md +3 -3
  1062. package/skills/better-supabase-api/references/ai.md +8 -0
  1063. package/skills/better-supabase-auth/SKILL.md +19 -19
  1064. package/skills/better-supabase-auth/references/authorization-providers.md +1 -1
  1065. package/dist/access-sql-CTDNuxRv.js +0 -385
  1066. package/dist/actor-CoveJgya.d.ts +0 -106
  1067. package/dist/actor-go7p9-CJ.js +0 -150
  1068. package/dist/adapter-BTbj5N9C.js +0 -2251
  1069. package/dist/agents-CM_cCtcr.d.ts +0 -117
  1070. package/dist/ai-cache-BFRKxgZ4.js +0 -87
  1071. package/dist/ai-cache-BTGqckta.d.ts +0 -82
  1072. package/dist/ai-chat-B7_vQvxU.d.ts +0 -619
  1073. package/dist/ai-files-m_2z3rH1.js +0 -339
  1074. package/dist/ai-message-DfaP8sis.js +0 -14
  1075. package/dist/ai-schedules-CZEfo-_M.d.ts +0 -166
  1076. package/dist/anchors-7F34QyHa.d.ts +0 -40
  1077. package/dist/api-3C0AWFeP.js +0 -696
  1078. package/dist/api-59rv5hL6.d.ts +0 -495
  1079. package/dist/api-keys-JE-aykZE.d.ts +0 -213
  1080. package/dist/app-tables-B2mKMNRQ.d.ts +0 -28
  1081. package/dist/approvals-BfEafAzt.d.ts +0 -129
  1082. package/dist/assistant-B49qATbj.d.ts +0 -157
  1083. package/dist/attachments-BXbLnNxm.js +0 -376
  1084. package/dist/attributes-Bzf51_nc.js +0 -47
  1085. package/dist/auth-DyF_LRxd.js +0 -20
  1086. package/dist/auth-link-B4NL84XU.d.ts +0 -104
  1087. package/dist/auth-link-D3-bU6yz.js +0 -118
  1088. package/dist/auth-module-BbmX-N4L.js +0 -52
  1089. package/dist/auth-reply-Dj124sbX.d.ts +0 -11
  1090. package/dist/auth-reply-tlXB2FQ9.js +0 -31
  1091. package/dist/authorization-DfEkyFt_.d.ts +0 -3867
  1092. package/dist/authorization-hooks-BWhkMZfH.d.ts +0 -221
  1093. package/dist/authorizer-B6X09otb.d.ts +0 -118
  1094. package/dist/authorizer-BGhXaDmo.js +0 -172
  1095. package/dist/automation-D41DXyvT.js +0 -75
  1096. package/dist/automations-8L3NEuoq.js +0 -29
  1097. package/dist/automations-BKjJpktQ.js +0 -33
  1098. package/dist/automations-BMuqwZZn.js +0 -314
  1099. package/dist/automations-EzXteupo.js +0 -31
  1100. package/dist/availability-BdeKCHpl.d.ts +0 -236
  1101. package/dist/base64-B9Wlsdj7.js +0 -42
  1102. package/dist/batch-limit-DKVQDz4o.js +0 -5
  1103. package/dist/before-route-B23K2zYU.js +0 -30
  1104. package/dist/bind-DAx0bMSi.d.ts +0 -104
  1105. package/dist/block-authors-Bw3zdzgl.js +0 -14
  1106. package/dist/block-authors-DzXLUiIq.d.ts +0 -12
  1107. package/dist/block-env-Dz7Caxk0.d.ts +0 -32
  1108. package/dist/block-event-listener-Bu6G0TFH.js +0 -16
  1109. package/dist/block-events-IWAyafO3.js +0 -83
  1110. package/dist/block-fields-BE7pInWZ.d.ts +0 -58
  1111. package/dist/block-fields-BjXgX_5c.js +0 -140
  1112. package/dist/block-helpers-B0f0ZVb5.js +0 -437
  1113. package/dist/block-helpers-D5emQ2O6.d.ts +0 -62
  1114. package/dist/block-hooks-B8itxzEE.d.ts +0 -117
  1115. package/dist/block-hooks-DKtz0HRh.js +0 -130
  1116. package/dist/block-method-C9hWdHom.js +0 -21
  1117. package/dist/block-method-CiVa2G-J.d.ts +0 -14
  1118. package/dist/block-subjects-C1_9DkSA.d.ts +0 -6
  1119. package/dist/block-subjects-DFSuFY1a.js +0 -55
  1120. package/dist/block-tenant-DHp7subc.js +0 -14
  1121. package/dist/block-transport-9EUA3q_I.d.ts +0 -69
  1122. package/dist/bookings-xsmM2TA_.d.ts +0 -289
  1123. package/dist/bucket-SvRQwYS4.d.ts +0 -705
  1124. package/dist/build-CH2N3Yf0.js +0 -2073
  1125. package/dist/build-DbIRFcHQ.js +0 -735
  1126. package/dist/carrier-KzeYXVrW.d.ts +0 -169
  1127. package/dist/casing-DdFWEtqr.js +0 -16
  1128. package/dist/channel-JcMd5lNP.d.ts +0 -105
  1129. package/dist/channels-CfcFPuo_.js +0 -114
  1130. package/dist/claims-Bp9My7XP.js +0 -88
  1131. package/dist/claims-DTy6R6my.js +0 -63
  1132. package/dist/cli/_format-Cax5EsM9.js +0 -101
  1133. package/dist/cli/add-B9wP0YGU.js +0 -99
  1134. package/dist/cli/add-DjZXKd7X.js +0 -1231
  1135. package/dist/cli/add-ZcEOEK23.js +0 -1
  1136. package/dist/cli/agent-CbuPvI2x.js +0 -185
  1137. package/dist/cli/app-table-files-mtvjHa48.js +0 -346
  1138. package/dist/cli/arazzo-1.0-BalU61-_.js +0 -532
  1139. package/dist/cli/arazzo-1.1-Bnfasbun.js +0 -705
  1140. package/dist/cli/args-UEwg0l-N.js +0 -27
  1141. package/dist/cli/asyncapi-3.0.0-C78dBjR6.js +0 -5593
  1142. package/dist/cli/asyncapi-3.1.0-g-7aIfV1.js +0 -5833
  1143. package/dist/cli/backfill-Coshdvh_.js +0 -293
  1144. package/dist/cli/blocks-BWCuA0nq.js +0 -156
  1145. package/dist/cli/blocks-hiSazThw.js +0 -1
  1146. package/dist/cli/cache-x2wWAy0h.js +0 -607
  1147. package/dist/cli/codemod-BnjV7BpC.js +0 -2634
  1148. package/dist/cli/codemod-block-renames-BuSaTE_G.js +0 -239
  1149. package/dist/cli/command-CCAwhiOh.js +0 -1003
  1150. package/dist/cli/compare-BmIWVEui.js +0 -9
  1151. package/dist/cli/completion-BJaB84Pe.js +0 -211
  1152. package/dist/cli/completion-BkUhs1ms.js +0 -1
  1153. package/dist/cli/completion-DmUVsUVQ.js +0 -30
  1154. package/dist/cli/config-Cskysxp-.js +0 -2000
  1155. package/dist/cli/config-Df5cXWNN.js +0 -1
  1156. package/dist/cli/config-edit-CrWfk8s3.js +0 -621
  1157. package/dist/cli/config-group-CP-B9uRt.js +0 -390
  1158. package/dist/cli/config-zId1jkLx.js +0 -47
  1159. package/dist/cli/content-mapper-DvOSOdTE.js +0 -182
  1160. package/dist/cli/db-CQCLx7cx.js +0 -78
  1161. package/dist/cli/db-DXKyVEDF.js +0 -247
  1162. package/dist/cli/detect-D9JaAX20.js +0 -84
  1163. package/dist/cli/dist-D_VbPAMR.js +0 -129
  1164. package/dist/cli/dist-DuiMMRbJ.js +0 -1112
  1165. package/dist/cli/doctor-Ywy8oJEU.js +0 -4684
  1166. package/dist/cli/env-BK0xKMeU.js +0 -1113
  1167. package/dist/cli/env-Bat6ogep.js +0 -1
  1168. package/dist/cli/env-CNjT_uOV.js +0 -1
  1169. package/dist/cli/env-XMiKvhtV.js +0 -143
  1170. package/dist/cli/errors-BTe6A15O.js +0 -98
  1171. package/dist/cli/exec-Ca5s-ygi.js +0 -463
  1172. package/dist/cli/fastest-levenshtein-dhRRvrM2.js +0 -120
  1173. package/dist/cli/files-CX71yBm8.js +0 -1010
  1174. package/dist/cli/fresh-import-DzgsGHkX.js +0 -40
  1175. package/dist/cli/gen-B-FbQmG1.js +0 -394
  1176. package/dist/cli/guards-CUlDNYZs.js +0 -8
  1177. package/dist/cli/in-stack-diff-Cp-tVPj2.js +0 -186
  1178. package/dist/cli/init-fb9e1BKX.js +0 -559
  1179. package/dist/cli/io-DH1kcmmP.js +0 -37
  1180. package/dist/cli/json5-ChRycquj.js +0 -787
  1181. package/dist/cli/jsonc-C8M0EhHB.js +0 -1
  1182. package/dist/cli/jsonc-D5Fu67jw.js +0 -45
  1183. package/dist/cli/keys-ORiPz1sM.js +0 -106
  1184. package/dist/cli/legacy-prefix-R7UChFFl.js +0 -154
  1185. package/dist/cli/live-DIt7TP-N.js +0 -341
  1186. package/dist/cli/mcp-CVWwraga.js +0 -241
  1187. package/dist/cli/metadata-CannIjel.js +0 -150
  1188. package/dist/cli/migrate-Ht2TzIQF.js +0 -46
  1189. package/dist/cli/migration-safety-nNyB05I-.js +0 -928
  1190. package/dist/cli/migrations-bAd7dpk1.js +0 -117
  1191. package/dist/cli/module-migration-CkNux8dr.js +0 -119
  1192. package/dist/cli/moved-C3WyRHkA.js +0 -254
  1193. package/dist/cli/ohash-BjQY1cBb.js +0 -277
  1194. package/dist/cli/openapi-3.0-t7xwkuRH.js +0 -928
  1195. package/dist/cli/openapi-3.1-CVze7tBS.js +0 -870
  1196. package/dist/cli/openapi-3.2-CFoMYM01.js +0 -1031
  1197. package/dist/cli/orphans-BAboqyVM.js +0 -28
  1198. package/dist/cli/parse-DjHbTaFI.js +0 -182
  1199. package/dist/cli/powersync-B2v0tDwp.js +0 -377
  1200. package/dist/cli/powersync-D3mAQ6QE.js +0 -1
  1201. package/dist/cli/preset-BwmIfFnh.js +0 -101
  1202. package/dist/cli/print-CxQ0rBKT.js +0 -68
  1203. package/dist/cli/prompts-jqnr94b9.js +0 -1140
  1204. package/dist/cli/providers-DtI90lSw.js +0 -301
  1205. package/dist/cli/redact-KGAk2Ul9.js +0 -38
  1206. package/dist/cli/remove-DYtE4IZ4.js +0 -239
  1207. package/dist/cli/render-QGWfEoiB.js +0 -2225
  1208. package/dist/cli/rolldown-runtime-kJ_i4yPo.js +0 -26
  1209. package/dist/cli/run-B5aMwErM.js +0 -63
  1210. package/dist/cli/run-BNoJKf5I.js +0 -706
  1211. package/dist/cli/run-DiYX1XEa.js +0 -1459
  1212. package/dist/cli/seed-C-Hu2n_E.js +0 -188
  1213. package/dist/cli/seed-Cm-c0BDd.js +0 -1
  1214. package/dist/cli/shared-D_CFi5di.js +0 -151
  1215. package/dist/cli/shell-Btv_4Yhe.js +0 -10
  1216. package/dist/cli/skills-D98y0bSB.js +0 -121
  1217. package/dist/cli/snapshot-BlQ4DDcJ.js +0 -734
  1218. package/dist/cli/source-CelMBQMj.js +0 -320
  1219. package/dist/cli/source-args-v8ljFDfc.js +0 -59
  1220. package/dist/cli/spec-BxcoGE0h.js +0 -1
  1221. package/dist/cli/spec-iBx1LcYO.js +0 -7530
  1222. package/dist/cli/sql-layout-Dp4Rottt.js +0 -261
  1223. package/dist/cli/stack-B2slzrYH.js +0 -135
  1224. package/dist/cli/stack-env-3ziggrU3.js +0 -93
  1225. package/dist/cli/stack-status-BkkYRlXG.js +0 -46
  1226. package/dist/cli/stacks-CiDBH1dB.js +0 -232
  1227. package/dist/cli/style-Bm2X5JrN.js +0 -35
  1228. package/dist/cli/supabase-toml-CncmQbO0.js +0 -1164
  1229. package/dist/cli/sync-BnORI43S.js +0 -322
  1230. package/dist/cli/table-D6HUECKI.js +0 -89
  1231. package/dist/cli/toml-DB-MNnFs.js +0 -424
  1232. package/dist/cli/topics-BpdnYmWb.js +0 -30
  1233. package/dist/cli/trace-VbdO6bcN.js +0 -7
  1234. package/dist/cli/upgrade-CR6-WmIc.js +0 -272
  1235. package/dist/cli/upgrade-fz92aCnh.js +0 -41
  1236. package/dist/cli/validate-B3lF3-jB.js +0 -7522
  1237. package/dist/cli/version-Dz8ZlOuh.js +0 -4
  1238. package/dist/cli/yaml-CYCbJ6et.js +0 -2252
  1239. package/dist/client-C_mlji5R.js +0 -288
  1240. package/dist/clone-CkG0-hlI.js +0 -33
  1241. package/dist/cloud-event-0pQ9vFNS.d.ts +0 -64
  1242. package/dist/cloud-event-XsM53POL.js +0 -63
  1243. package/dist/codecs-CMWlhHZ0.d.ts +0 -222
  1244. package/dist/codecs-CSUFGrdP.js +0 -358
  1245. package/dist/compiler-BEeVWXPS.d.ts +0 -14
  1246. package/dist/compose-DKW0Tr3e.js +0 -53
  1247. package/dist/composite-B4qB6k31.js +0 -130
  1248. package/dist/composite-BJ9s-IJJ.d.ts +0 -83
  1249. package/dist/config-B7g-HDis.js +0 -1111
  1250. package/dist/config-R0m0fBiD.js +0 -1679
  1251. package/dist/connectors-uC5baoFV.d.ts +0 -147
  1252. package/dist/context-DBicfUNz.js +0 -41
  1253. package/dist/context-DWWoP1wK.d.ts +0 -4344
  1254. package/dist/controller-BEliOBOv.js +0 -79
  1255. package/dist/controller-Br9dGKGe.d.ts +0 -52
  1256. package/dist/controller-W97g2WGG.js +0 -73
  1257. package/dist/conversion-Dq1S7xzE.js +0 -77
  1258. package/dist/conversion-g8HzH9My.d.ts +0 -86
  1259. package/dist/cors-h_v7TPxl.js +0 -24
  1260. package/dist/cors-kLq6VM06.d.ts +0 -15
  1261. package/dist/create-blocks-BfrDUSM6.js +0 -370
  1262. package/dist/cron-DdT4ti8a.js +0 -148
  1263. package/dist/cron-route-FjKgRvTY.js +0 -24
  1264. package/dist/csv-2rXGPNtP.js +0 -89
  1265. package/dist/csv-DhHQS2x_.d.ts +0 -28
  1266. package/dist/data-engine-D1BkmBoR.js +0 -173
  1267. package/dist/data-engine-rvbR2C4F.d.ts +0 -273
  1268. package/dist/data-hooks-CdcZfVS1.js +0 -280
  1269. package/dist/db-exception-Lngc1W49.js +0 -31
  1270. package/dist/deal-forecast-CKBnRodz.js +0 -39
  1271. package/dist/deal-forecast-LwO-Z4_C.d.ts +0 -23
  1272. package/dist/define-D-dLADd5.js +0 -2084
  1273. package/dist/define-D8_9X5fZ.d.ts +0 -1263
  1274. package/dist/define-block-BGqOO8B3.js +0 -64
  1275. package/dist/define-block-DWVZSZv1.d.ts +0 -1687
  1276. package/dist/delegation-C7eWP2r8.d.ts +0 -14
  1277. package/dist/delegation-DGOIiT8k.js +0 -153
  1278. package/dist/delivery-Bm0jxmzI.js +0 -29
  1279. package/dist/delivery-events-DbL8IHIY.js +0 -53
  1280. package/dist/delivery-n6lZGuGx.d.ts +0 -71
  1281. package/dist/documents-BbwYyynk.d.ts +0 -152
  1282. package/dist/email-B3YxEzwC.d.ts +0 -42
  1283. package/dist/embeddings-I3s5sTDt.d.ts +0 -78
  1284. package/dist/embeddings-vVzseUw0.js +0 -128
  1285. package/dist/ended-EZzN9QTM.d.ts +0 -26
  1286. package/dist/entitlements-CBjm2lvD.d.ts +0 -54
  1287. package/dist/entitlements-tGL6-69B.js +0 -45
  1288. package/dist/entity-naming-Dtyq5sKE.js +0 -131
  1289. package/dist/entity-schema-B1YmMtP8.js +0 -39
  1290. package/dist/envelope-DEI2iX-d.js +0 -90
  1291. package/dist/errors-BVFgt8BZ.js +0 -328
  1292. package/dist/errors-CyxMxzlu.js +0 -44
  1293. package/dist/escape-like-DHfx6jRr.js +0 -7
  1294. package/dist/escape-like-PReMbEEU.d.ts +0 -30
  1295. package/dist/eve-BfhVFV33.d.ts +0 -157
  1296. package/dist/event-calendar-DVLs2wUO.d.ts +0 -65
  1297. package/dist/event-map-CtPFhcOp.js +0 -19
  1298. package/dist/events-B2qbZps6.d.ts +0 -854
  1299. package/dist/events-D6IZ5CE8.js +0 -82
  1300. package/dist/events-DuLhzjP6.js +0 -26
  1301. package/dist/executor-BfirBzOr.d.ts +0 -174
  1302. package/dist/executor-BlS0kCrN.d.ts +0 -104
  1303. package/dist/executor-C2Ne-Scm.js +0 -208
  1304. package/dist/executor-DXQIx4sW.d.ts +0 -37
  1305. package/dist/executor-DqIci3Jb.js +0 -486
  1306. package/dist/executor-WolvKszH.js +0 -843
  1307. package/dist/extension-DTaHjwdc.js +0 -59
  1308. package/dist/extension-DeAd_MqI.js +0 -121
  1309. package/dist/extension-DzCc0IOd.js +0 -103
  1310. package/dist/extension-mGylYROs.js +0 -53
  1311. package/dist/extension-shared-Djm8mGHD.js +0 -60
  1312. package/dist/extra-CGQ2_q3S.js +0 -10
  1313. package/dist/field-errors-CEjsMAgd.d.ts +0 -216
  1314. package/dist/field-formats-C6QKA3UR.js +0 -102
  1315. package/dist/field-formats-CAFNkKSN.d.ts +0 -38
  1316. package/dist/fields-BBm49w-E.js +0 -108
  1317. package/dist/fields-snbaZ14h.d.ts +0 -78
  1318. package/dist/filter-evaluate-BRpNiNPG.d.ts +0 -37
  1319. package/dist/filter-evaluate-lCToXzZI.js +0 -217
  1320. package/dist/filter-query-CQ6d5GnQ.js +0 -566
  1321. package/dist/filter-query-DBt7OKuH.d.ts +0 -133
  1322. package/dist/flags-DDKTThrO.d.ts +0 -246
  1323. package/dist/flags-DF_SCqp5.js +0 -279
  1324. package/dist/form-definition-BTpM_tz1.js +0 -363
  1325. package/dist/form-definition-BjEtH8BT.d.ts +0 -119
  1326. package/dist/format-u-65igKI.d.ts +0 -79
  1327. package/dist/framework-CqiZk89W.js +0 -58
  1328. package/dist/framework-DVYTtQXA.d.ts +0 -47
  1329. package/dist/function-contract-DxFNOmsm.d.ts +0 -27
  1330. package/dist/function-contract-pEmsaUIf.js +0 -8
  1331. package/dist/gateway-Ve7cByEr.d.ts +0 -115
  1332. package/dist/gateway-options-BlVCqgb8.d.ts +0 -29
  1333. package/dist/gateway-options-Cl74B7k6.js +0 -27
  1334. package/dist/guards-6F2bCtQR.js +0 -12
  1335. package/dist/guest-actions-1T1DeS5Y.d.ts +0 -5
  1336. package/dist/guest-actions-B7zdhfnh.js +0 -9
  1337. package/dist/history-GH1HJWQV.js +0 -271
  1338. package/dist/hmac-B3CTTlfv.js +0 -23
  1339. package/dist/http-7-UvHjQe.js +0 -28
  1340. package/dist/http-BjjojWg3.js +0 -40
  1341. package/dist/http-DzbloBR-.js +0 -141
  1342. package/dist/image-url-_d7xYsXK.js +0 -84
  1343. package/dist/impersonation-DM3oWNoD.js +0 -62
  1344. package/dist/impersonation-YTa9dZUv.d.ts +0 -28
  1345. package/dist/inbox-c8B86Trp.d.ts +0 -321
  1346. package/dist/index-B4wttiLh.d.ts +0 -407
  1347. package/dist/index-Clyd2Goi.d.ts +0 -338
  1348. package/dist/index-Cxsnd-OL.d.ts +0 -305
  1349. package/dist/index-D98bQs8a.d.ts +0 -665
  1350. package/dist/index-DIdPoQtO.d.ts +0 -240
  1351. package/dist/index-DbyDZZlc.d.ts +0 -53
  1352. package/dist/index-I8YLxKq8.d.ts +0 -729
  1353. package/dist/index-NRMMhhEi.d.ts +0 -104
  1354. package/dist/index-X2fkPUwb.d.ts +0 -51
  1355. package/dist/index-eRBuKtMt.d.ts +0 -158
  1356. package/dist/index-pZn6S_iq.d.ts +0 -149
  1357. package/dist/index-uIU65iEn.d.ts +0 -588
  1358. package/dist/instance-property-hRh88y_s.js +0 -7
  1359. package/dist/instances-DY_ORk5g.js +0 -16605
  1360. package/dist/invalidate-DMp4eqfF.d.ts +0 -21
  1361. package/dist/iso4217-B-durg_y.js +0 -176
  1362. package/dist/json-DaByVJpw.js +0 -22
  1363. package/dist/json-schema-DHJxiizN.js +0 -888
  1364. package/dist/jwks-cache-DEsKI0hJ.js +0 -49
  1365. package/dist/jws-D0toeQlA.d.ts +0 -66
  1366. package/dist/jws-DOgHJKHb.js +0 -205
  1367. package/dist/kit-B8yWCRN7.d.ts +0 -94
  1368. package/dist/kit-Bcd9wYCV.js +0 -133
  1369. package/dist/knowledge-CsLPACGJ.d.ts +0 -217
  1370. package/dist/knowledge-tCrrU99q.js +0 -300
  1371. package/dist/list-query-BcU8NnNL.d.ts +0 -222
  1372. package/dist/list-query-BnpA2BDg.js +0 -559
  1373. package/dist/live-C21DgbsD.js +0 -275
  1374. package/dist/logger-DWVYUmwi.d.ts +0 -18
  1375. package/dist/logger-glM28NVN.js +0 -21
  1376. package/dist/lookup-BaP5bI27.js +0 -18
  1377. package/dist/management-wtecfrNf.d.ts +0 -57
  1378. package/dist/message-Bg4TKA12.d.ts +0 -99
  1379. package/dist/messages-ecPW_nOv.js +0 -492
  1380. package/dist/messaging-DQP09JsY.d.ts +0 -297
  1381. package/dist/methods-Cund9ZBe.js +0 -11
  1382. package/dist/metric-definition-BjxVn4R5.js +0 -117
  1383. package/dist/metric-definition-EAYI1r2n.d.ts +0 -69
  1384. package/dist/mfa-oIOYTpvc.d.ts +0 -36
  1385. package/dist/model-hwpvole9.d.ts +0 -340
  1386. package/dist/model-messages-CkZSDDHP.js +0 -206
  1387. package/dist/model-messages-DrR4lZ_c.d.ts +0 -34
  1388. package/dist/money-BNRdJQzA.d.ts +0 -91
  1389. package/dist/money-BZl985O-.js +0 -197
  1390. package/dist/money-codec-BJuS2zEW.js +0 -41
  1391. package/dist/my-work-kinds-BU3SlA-6.js +0 -11
  1392. package/dist/node-headers-BPtMP4_V.d.ts +0 -27
  1393. package/dist/node-headers-C71zNQHe.js +0 -55
  1394. package/dist/operations-DVHRHvv6.js +0 -29
  1395. package/dist/operations-hm1Isvvs.d.ts +0 -6
  1396. package/dist/optional-peer-C1NbBRJm.js +0 -32
  1397. package/dist/options-3OYOU56e.js +0 -11
  1398. package/dist/options-56zYYXxc.js +0 -10
  1399. package/dist/options-5WvWOkAm.d.ts +0 -26
  1400. package/dist/options-62woPFn3.js +0 -12
  1401. package/dist/options-7ixoOoap.js +0 -10
  1402. package/dist/options-9dSU5RML.js +0 -5
  1403. package/dist/options-B0YZtAkb.d.ts +0 -15
  1404. package/dist/options-B2Kz_tCx.js +0 -10
  1405. package/dist/options-B5E2MGIz.js +0 -15
  1406. package/dist/options-B685YSzQ.js +0 -5
  1407. package/dist/options-B692WoK6.js +0 -9
  1408. package/dist/options-BHU1wc74.js +0 -5
  1409. package/dist/options-BHy0Z5Zd.js +0 -5
  1410. package/dist/options-BJtdsK7b.js +0 -8
  1411. package/dist/options-BKDxrPvE.js +0 -5
  1412. package/dist/options-BLfymS4s.js +0 -5
  1413. package/dist/options-BOCRbzh3.js +0 -5
  1414. package/dist/options-BOqfYsM1.js +0 -13
  1415. package/dist/options-BQWJqwHO.js +0 -9
  1416. package/dist/options-BQunK6_Y.js +0 -8
  1417. package/dist/options-BQyrZjwM.js +0 -28
  1418. package/dist/options-BR9xTHZW.js +0 -5
  1419. package/dist/options-BRUdd5jY.js +0 -8
  1420. package/dist/options-BSsYXjhC.js +0 -9
  1421. package/dist/options-BTmaRzx2.d.ts +0 -60
  1422. package/dist/options-BUCQYAeJ.d.ts +0 -10
  1423. package/dist/options-B_NrjVDt.d.ts +0 -12
  1424. package/dist/options-BawzwlmC.js +0 -11
  1425. package/dist/options-BbLDAp7G.d.ts +0 -10
  1426. package/dist/options-BfPsL7E2.js +0 -9
  1427. package/dist/options-Bfmwwc78.js +0 -8
  1428. package/dist/options-BhsdveDk.js +0 -21
  1429. package/dist/options-BomoTH-8.js +0 -5
  1430. package/dist/options-BtjkzIVh.js +0 -8
  1431. package/dist/options-Bvi9bl4H.js +0 -5
  1432. package/dist/options-BwKNmaJo.js +0 -5
  1433. package/dist/options-BxpLtyk-.js +0 -18
  1434. package/dist/options-BzB2QxL3.js +0 -5
  1435. package/dist/options-C078wBP0.js +0 -5
  1436. package/dist/options-C3AdsFJ6.js +0 -9
  1437. package/dist/options-C7C5OhmL.d.ts +0 -8
  1438. package/dist/options-C87u6eSa.js +0 -10
  1439. package/dist/options-CBAEGxwS.js +0 -8
  1440. package/dist/options-CDSCkYxu.d.ts +0 -14
  1441. package/dist/options-CDUr8zzX.js +0 -8
  1442. package/dist/options-CF6EVF_G.js +0 -17
  1443. package/dist/options-CFjGxfa8.js +0 -5
  1444. package/dist/options-CI6P0xhV.js +0 -10
  1445. package/dist/options-CJFMK9A_.js +0 -8
  1446. package/dist/options-CLpgx7en.js +0 -10
  1447. package/dist/options-CSCXNYJO.d.ts +0 -8
  1448. package/dist/options-CTXHj9zr.js +0 -16
  1449. package/dist/options-CTl8T88w.js +0 -11
  1450. package/dist/options-CUIOOv4z.js +0 -15
  1451. package/dist/options-CZDmtsbV.js +0 -8
  1452. package/dist/options-CZTscdPB.js +0 -5
  1453. package/dist/options-CZdKndeo.js +0 -9
  1454. package/dist/options-C_7g9TTq.d.ts +0 -12
  1455. package/dist/options-Cb2FOFj5.js +0 -5
  1456. package/dist/options-CbOstLa7.js +0 -5
  1457. package/dist/options-CcXgWlvm.js +0 -24
  1458. package/dist/options-CfVPctAw.js +0 -89
  1459. package/dist/options-Cjgaf8ub.js +0 -8
  1460. package/dist/options-CoSPgWKy.js +0 -9
  1461. package/dist/options-CpZ2HlSU.js +0 -32
  1462. package/dist/options-CsSe8Nba.js +0 -8
  1463. package/dist/options-CsvJR-r2.js +0 -9
  1464. package/dist/options-Cucv6sWP.js +0 -12
  1465. package/dist/options-CyjL9lTf.js +0 -5
  1466. package/dist/options-D-OOO9V2.d.ts +0 -10
  1467. package/dist/options-D0Y6ZMe8.js +0 -5
  1468. package/dist/options-D0bzZx9a.d.ts +0 -10
  1469. package/dist/options-D0sj5abR.js +0 -9
  1470. package/dist/options-D1hSuf50.d.ts +0 -12
  1471. package/dist/options-D610Fa6T.js +0 -5
  1472. package/dist/options-D96dScev.js +0 -24
  1473. package/dist/options-DFpyP1bg.js +0 -5
  1474. package/dist/options-DJEcS4DX.js +0 -5
  1475. package/dist/options-DJbN3bi9.js +0 -11
  1476. package/dist/options-DKoQoRCy.js +0 -13
  1477. package/dist/options-DM1qaMMQ.js +0 -9
  1478. package/dist/options-DNgSwhsm.js +0 -11
  1479. package/dist/options-DOIwzRXL.js +0 -16
  1480. package/dist/options-DRIgHh4O.d.ts +0 -16
  1481. package/dist/options-DRrZmJyI.js +0 -8
  1482. package/dist/options-DSCW40_5.js +0 -12
  1483. package/dist/options-DUMUsvml.js +0 -5
  1484. package/dist/options-DWwL5Kaz.js +0 -9
  1485. package/dist/options-DZHZYlpD.js +0 -10
  1486. package/dist/options-DZLkeqWn.js +0 -9
  1487. package/dist/options-DZRpXKQE.js +0 -5
  1488. package/dist/options-DZen3UiC.js +0 -14
  1489. package/dist/options-D_9Vxx7f.js +0 -8
  1490. package/dist/options-DcHl59RC.js +0 -11
  1491. package/dist/options-Dcaql09y.js +0 -11
  1492. package/dist/options-DcnBNYmV.js +0 -8
  1493. package/dist/options-DdpM-fiP.js +0 -9
  1494. package/dist/options-DhoLMknl.js +0 -10
  1495. package/dist/options-DlohRAYd.d.ts +0 -13
  1496. package/dist/options-Dpy-Ruo-.js +0 -14
  1497. package/dist/options-DsVuVRH3.d.ts +0 -17
  1498. package/dist/options-DtAJxfHS.js +0 -8
  1499. package/dist/options-Dz9Yo52Z.js +0 -8
  1500. package/dist/options-HnfETSHr.d.ts +0 -19
  1501. package/dist/options-LqUXTpML.js +0 -8
  1502. package/dist/options-MsloEAIB.js +0 -5
  1503. package/dist/options-P2FxqYpd.js +0 -17
  1504. package/dist/options-_1gAIMq7.d.ts +0 -60
  1505. package/dist/options-aT89JqlB.js +0 -5
  1506. package/dist/options-cVKZu9b0.js +0 -9
  1507. package/dist/options-eTepQ1rZ.js +0 -15
  1508. package/dist/options-fkShrmGQ.js +0 -8
  1509. package/dist/options-gUvfr3no.js +0 -11
  1510. package/dist/options-hynwKWuf.js +0 -20
  1511. package/dist/options-jsOCvLUz.js +0 -10
  1512. package/dist/options-o5wCw8H7.d.ts +0 -14
  1513. package/dist/options-p49DFg3H.js +0 -8
  1514. package/dist/options-pYNpXKcg.js +0 -8
  1515. package/dist/options-qtETCHzW.js +0 -10
  1516. package/dist/options-rnKlqYEr.js +0 -5
  1517. package/dist/options-sU_zGkiV.js +0 -10
  1518. package/dist/options-xq4MXG1M.js +0 -5
  1519. package/dist/options-zzlznRA7.js +0 -10
  1520. package/dist/outbox-BZ712Z3X.d.ts +0 -199
  1521. package/dist/payments-BXvabJOw.js +0 -16
  1522. package/dist/payments-BYcN34Fp.d.ts +0 -114
  1523. package/dist/permissions-controller-BMsqIE5T.js +0 -34
  1524. package/dist/pg-error-B5QLDcbG.js +0 -26
  1525. package/dist/plugin-AKwwe2gF.js +0 -48
  1526. package/dist/pool-DDR1ndk7.d.ts +0 -123
  1527. package/dist/pool-errors-JUBcGrre.js +0 -27
  1528. package/dist/ports-DOrPTJzl.d.ts +0 -89
  1529. package/dist/ports-DvpNseap.js +0 -152
  1530. package/dist/postgrest-AJc8hnJU.d.ts +0 -53
  1531. package/dist/postgrest-executor-B_Uezhrm.js +0 -1068
  1532. package/dist/preset-CXhpPmPV.js +0 -1042
  1533. package/dist/problem-Bf0cJ7tk.js +0 -162
  1534. package/dist/problem-DNwN8iGz.d.ts +0 -79
  1535. package/dist/project-DJ9Uo0sT.js +0 -1760
  1536. package/dist/provider-B6g7rBZX.js +0 -57
  1537. package/dist/provider-CWjzAIX9.d.ts +0 -112
  1538. package/dist/push-token-B4vcIU4s.d.ts +0 -24
  1539. package/dist/push-token-D6REHMMw.js +0 -16
  1540. package/dist/queries-BWYYS9um.js +0 -239
  1541. package/dist/range-DwpWe8e7.js +0 -7
  1542. package/dist/range-p5V4rBhZ.d.ts +0 -8
  1543. package/dist/rank-keys-DcPMt_Jk.js +0 -60
  1544. package/dist/rank-result-BBJIK-k_.js +0 -18
  1545. package/dist/rank-result-Bwe7igy-.d.ts +0 -14
  1546. package/dist/rate-limit-BWKGlhTM.js +0 -49
  1547. package/dist/rate-limit-Bztf32cl.d.ts +0 -50
  1548. package/dist/rate-limit-fZ_d8gSE.js +0 -380
  1549. package/dist/ratelimit-headers-kEcXyO3H.js +0 -62
  1550. package/dist/react-BKCnIuZs.js +0 -79
  1551. package/dist/react-mdVjpewL.js +0 -1016
  1552. package/dist/read-set-B1sDib5O.js +0 -199
  1553. package/dist/realtime-status-BhNkb-Ow.d.ts +0 -8
  1554. package/dist/realtime-status-asHvhiOh.js +0 -11
  1555. package/dist/record-bindings-Z51mGfhB.js +0 -26
  1556. package/dist/record-form-CubgBrtI.d.ts +0 -82
  1557. package/dist/record-type-BEUyEsFx.js +0 -221
  1558. package/dist/recordings-DeZYx-Kv.d.ts +0 -119
  1559. package/dist/refresh-D02Pbf5B.d.ts +0 -54
  1560. package/dist/refresh-DLBgnxjL.js +0 -144
  1561. package/dist/refusal-B0VmlAxF.d.ts +0 -32
  1562. package/dist/refusal-DDlInPff.js +0 -64
  1563. package/dist/relay-CIKcAVjf.js +0 -248
  1564. package/dist/resolve-B0mW2m7f.js +0 -932
  1565. package/dist/resolve-CtX6T0c0.d.ts +0 -288
  1566. package/dist/resolved-names-kMRjmSIy.js +0 -133
  1567. package/dist/resource-BUJcZKiW.js +0 -520
  1568. package/dist/resource-DvgXqZB_.js +0 -105
  1569. package/dist/resource-WxN0IsvB.d.ts +0 -123
  1570. package/dist/resource-execute-BzqR8DdD.d.ts +0 -15
  1571. package/dist/resource-schemas-up6bKOUi.js +0 -82
  1572. package/dist/resource-types-BVbHgTPg.d.ts +0 -157
  1573. package/dist/resources-BSbRa0Ab.d.ts +0 -7
  1574. package/dist/resources-jb3R6rEa.js +0 -64
  1575. package/dist/respond-CZMWbUs3.js +0 -107
  1576. package/dist/respond-Dzu_-EPH.d.ts +0 -112
  1577. package/dist/result-DZeA5KS6.d.ts +0 -351
  1578. package/dist/result-ntFBW2p2.js +0 -146
  1579. package/dist/rows-BdqXmiB-.js +0 -80
  1580. package/dist/rows-jijHLVE_.js +0 -39
  1581. package/dist/rrule-C9Ot6ax8.js +0 -290
  1582. package/dist/run-state-BMCD_1Lt.d.ts +0 -13
  1583. package/dist/run-state-CgBKzYMW.js +0 -13
  1584. package/dist/run-watch-B-LoK5m1.js +0 -53
  1585. package/dist/runtime-LRJM7UqY.js +0 -44
  1586. package/dist/sales-lines-BsmrNHe9.d.ts +0 -38
  1587. package/dist/sales-lines-DO7oRu1o.js +0 -45
  1588. package/dist/sales-shared-BuTA8JK7.js +0 -22
  1589. package/dist/schemas-CLOTvdsC.js +0 -216
  1590. package/dist/scope-DgWjuXUw.js +0 -90
  1591. package/dist/scores-Y8TvyJi1.d.ts +0 -174
  1592. package/dist/scores-bY2Is0kx.js +0 -177
  1593. package/dist/search-Cn_DGluL.js +0 -9
  1594. package/dist/server-types-BkTIxW_H.d.ts +0 -597
  1595. package/dist/session-BOzx2qHC.d.ts +0 -100
  1596. package/dist/session-status-BP8eYVnA.d.ts +0 -82
  1597. package/dist/shared-BeHTi8Fu.js +0 -17
  1598. package/dist/shared-Bf-I13Ht.js +0 -91
  1599. package/dist/shared-CRRfQAKG.d.ts +0 -11
  1600. package/dist/sign-in-BzihC_8k.d.ts +0 -50
  1601. package/dist/sign-in-CmPK1AgM.js +0 -402
  1602. package/dist/sign-in-CuZ1Ag7O.js +0 -718
  1603. package/dist/sign-in-D54FLMQy.d.ts +0 -55
  1604. package/dist/signatures-CX1b4WHa.js +0 -145
  1605. package/dist/signatures-Dkx9OE8j.d.ts +0 -43
  1606. package/dist/signers-ZmxO1I05.d.ts +0 -390
  1607. package/dist/signing-keys-CWtpMask.js +0 -164
  1608. package/dist/signing-keys-udgP7Aod.d.ts +0 -119
  1609. package/dist/simplify-DDO0j0LI.js +0 -83
  1610. package/dist/spec-BMvCCNnd.js +0 -124
  1611. package/dist/spec-pins-BZkKfwY8.d.ts +0 -127
  1612. package/dist/spec-pins-D3zDek-u.js +0 -62
  1613. package/dist/sql-CYt7EhH0.js +0 -421
  1614. package/dist/sql-DHp0L7zK.js +0 -138385
  1615. package/dist/sql-type-iUSZpaUu.js +0 -34
  1616. package/dist/sso-CkU_4mtK.d.ts +0 -161
  1617. package/dist/sso-DdDpJQzw.js +0 -217
  1618. package/dist/standard-BA3mLh6w.js +0 -25
  1619. package/dist/standard-DBV730sF.d.ts +0 -7
  1620. package/dist/stats-BHl1-zj9.js +0 -83
  1621. package/dist/statuses-Alll5Ip6.js +0 -29
  1622. package/dist/statuses-zRcc2TeZ.js +0 -28
  1623. package/dist/storage-api-Dg78Wqsg.js +0 -10
  1624. package/dist/store-CpheI-lN.d.ts +0 -83
  1625. package/dist/store-McN-2esd.js +0 -69
  1626. package/dist/stripe-BJUfp5jM.js +0 -32
  1627. package/dist/stripe-X22LjuH-.d.ts +0 -156
  1628. package/dist/subject-readers-CB5Te02u.d.ts +0 -21
  1629. package/dist/subject-readers-VHcrWhmq.js +0 -49
  1630. package/dist/subject-type-BRnK7Av3.js +0 -8
  1631. package/dist/subjects-BYCL-6hA.d.ts +0 -145
  1632. package/dist/subjects-CiBNKy2y.d.ts +0 -90
  1633. package/dist/subscribers-BvZxcd63.js +0 -33
  1634. package/dist/summaries-8jQTELIX.d.ts +0 -69
  1635. package/dist/supabase-mcp-Dz9DgrKP.js +0 -28
  1636. package/dist/supabase-mcp-Z4vtsuoO.d.ts +0 -46
  1637. package/dist/support-BxyPOFk4.d.ts +0 -357
  1638. package/dist/support-view-g4YLBeqX.js +0 -18
  1639. package/dist/support-view-nqUWKHEs.d.ts +0 -17
  1640. package/dist/table-schema-BlF6k62Q.d.ts +0 -81
  1641. package/dist/table-schema-C80xItaV.js +0 -293
  1642. package/dist/tables-Cb-3_VWc.js +0 -73
  1643. package/dist/tags-CIZTqtlY.js +0 -39
  1644. package/dist/tags-Cm48BsOa.d.ts +0 -30
  1645. package/dist/tax-BkCNWWMc.js +0 -140
  1646. package/dist/tax-DPShHual.d.ts +0 -170
  1647. package/dist/tee-V97_v1ZS.js +0 -101
  1648. package/dist/template-Drgg3v2J.js +0 -126
  1649. package/dist/temporal-Dbo0fLzc.js +0 -95
  1650. package/dist/temporal-required-DcLhnDhQ.js +0 -20
  1651. package/dist/tenant-BgIiMQpo.js +0 -27
  1652. package/dist/tenant-FfgNhd5x.d.ts +0 -17
  1653. package/dist/tenant-source-bqWpSr86.js +0 -8
  1654. package/dist/timeline-DqEoD8bb.d.ts +0 -151
  1655. package/dist/timeline-Dz3hO2I6.js +0 -50
  1656. package/dist/timing-dypS0nxW.js +0 -95
  1657. package/dist/topic-BaUElNw2.d.ts +0 -415
  1658. package/dist/topic-DnsNG4Kj.js +0 -643
  1659. package/dist/ttl-cache-Bhr9swjT.js +0 -32
  1660. package/dist/types-B-D6fYx2.d.ts +0 -194
  1661. package/dist/types-CK2X2wCB.d.ts +0 -618
  1662. package/dist/types-CMN0h_Ix.d.ts +0 -461
  1663. package/dist/types-CPl9uJ0G.d.ts +0 -912
  1664. package/dist/types-CwQgFo8c.d.ts +0 -177
  1665. package/dist/types-DMihLukJ.d.ts +0 -251
  1666. package/dist/types-R6syp1el.js +0 -29
  1667. package/dist/types-iCyZ3lMx.d.ts +0 -217
  1668. package/dist/types-nspa5I-a.d.ts +0 -664
  1669. package/dist/undo-0HkWXASn.d.ts +0 -46
  1670. package/dist/undo-BbftL9-4.js +0 -44
  1671. package/dist/upload-claim-B1ZU8ydB.js +0 -33
  1672. package/dist/usage-BkWAPkg2.d.ts +0 -232
  1673. package/dist/user-change-DgWC6RRC.js +0 -135
  1674. package/dist/variants-Cy--Ub-a.js +0 -53
  1675. package/dist/vault-BkdPmL7f.d.ts +0 -62
  1676. package/dist/verify-41mZmspj.d.ts +0 -146
  1677. package/dist/verify-7EucfCnv.js +0 -130
  1678. package/dist/view-C8Ve14ja.js +0 -247
  1679. package/dist/view-C8_xvD-j.d.ts +0 -97
  1680. package/dist/watch-topic-BabDTZ-L.d.ts +0 -31
  1681. package/dist/watch-topic-CuaWfCuv.js +0 -57
  1682. package/dist/wire-ChYn1g21.js +0 -91
  1683. package/dist/wiring-CDNuQoJJ.js +0 -13
  1684. package/dist/workflow-sdk-Cf0LAOFF.js +0 -242
  1685. package/dist/workflow-sdk-DJJkP0dT.js +0 -2545
  1686. package/dist/workflow-sdk-rg3IbCZC.d.ts +0 -163
  1687. package/dist/workflows-xL6t0TXx.d.ts +0 -258
@@ -1,4344 +0,0 @@
1
- /// <reference lib="esnext.temporal" />
2
- import { M as Casing, P as ClaimsMeta, T as AccessBucketPolicy, _t as BucketLifecycle, j as BucketPolicyName, ot as SchemaMeta } from "./types-CPl9uJ0G.js";
3
- import { D as OwnTablePolicies, E as NamedInstance, I as TablesOf, L as BlockNameRegistry, O as ResolvedBlock, T as InstanceOn, _ as BlockName, a as AuthorizationProvider, d as AccessBlockConfig, g as BlockMode, h as BlockConfigOf, m as BlockConfig, n as AuthorizationMembership, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, v as BlockScope, w as InstanceKeys, x as DisabledRow, y as BlocksConfig } from "./authorization-DfEkyFt_.js";
4
- import { Mn as EntityNames, Nn as EntityNoun, Pn as EntityRename, R as PortName, Ut as ActionDescriptor, Xt as BlockSchedule, Zt as DefaultAutomation, _ as BlockProvider, g as BlockEnvKey, i as BlockCategory, y as BlockWorker } from "./define-block-DWVZSZv1.js";
5
- import { a as ScalarKind, i as FieldSpec } from "./table-schema-BlF6k62Q.js";
6
- import { i as SubjectsConfig } from "./subjects-BYCL-6hA.js";
7
- import { i as FIELD_FORMAT_NAMES, s as FieldFormatName } from "./field-formats-CAFNkKSN.js";
8
- import { t as GuestAction } from "./guest-actions-1T1DeS5Y.js";
9
- //#region src/config/names.d.ts
10
- /** The steps `better-supabase gen` runs, in the order it runs them. */
11
- declare const GEN_TASKS: readonly ["types", "sql", "powersync", "spec", "seed", "env"];
12
- /** Glue `better-supabase init` and `add` write for a framework or runtime. */
13
- declare const INTEGRATION_NAMES: readonly ["next", "hono", "orpc", "edge", "expo", "mcp", "client", "react"];
14
- /**
15
- * An integration as `init`, `add` and `/create` show it, and the integrations
16
- * it needs.
17
- */
18
- interface IntegrationInfo {
19
- readonly title: string;
20
- /** What `init` or `add` writes, one sentence. */
21
- readonly description: string;
22
- readonly requires: readonly (typeof INTEGRATION_NAMES)[number][];
23
- }
24
- declare const INTEGRATION_INFO: Readonly<Record<(typeof INTEGRATION_NAMES)[number], IntegrationInfo>>;
25
- /** The agent folders `better-supabase skills install` writes to. */
26
- declare const SKILLS_AGENTS: readonly ["cursor", "claude", "agents"];
27
- //#endregion
28
- //#region src/config/types/tooling.d.ts
29
- interface OpenApiConfig {
30
- /**
31
- * Module exporting the document (or a function returning it) as `openapi` or
32
- * default.
33
- */
34
- readonly entry?: string;
35
- /** JSON file `better-supabase spec emit openapi` writes. */
36
- readonly output?: string;
37
- }
38
- /** A docs UI `spec emit --ui` writes next to an OpenAPI document. */
39
- type SpecUiName = "scalar" | "swagger" | "redoc" | "elements" | "rapidoc";
40
- /** One document `better-supabase spec emit` writes. */
41
- interface SpecOutputConfig {
42
- /** A format id: `openapi`, `asyncapi` or `arazzo`. */
43
- readonly format: string;
44
- /** Defaults to the format's default version, e.g. `3.1` for OpenAPI. */
45
- readonly version?: string;
46
- /** File to write, relative to the root. Defaults to the format's file name. */
47
- readonly output?: string;
48
- /** Overlay files (JSON or YAML), applied in order. */
49
- readonly overlays?: readonly string[];
50
- /**
51
- * Defaults to `yaml` when `output` ends in `.yaml` or `.yml`, otherwise
52
- * `json`.
53
- */
54
- readonly serialize?: "json" | "yaml";
55
- /**
56
- * Also writes a reference page (`openapi.html` for `openapi.json`) next to
57
- * OpenAPI outputs.
58
- */
59
- readonly ui?: SpecUiName;
60
- }
61
- interface SpecsConfig {
62
- /**
63
- * Module exporting a `defineApi()` result (or a function returning one) as
64
- * `api` or default.
65
- */
66
- readonly entry?: string;
67
- /** The documents to write. Defaults to one OpenAPI document. */
68
- readonly outputs?: readonly SpecOutputConfig[];
69
- /**
70
- * The lowest severity that fails `spec emit`, `check` and `validate`.
71
- * Defaults to `error`.
72
- */
73
- readonly failOn?: "error" | "warning" | "never";
74
- /**
75
- * Also write the diagnostics manifest (JSON) to this file, like `spec
76
- * --manifest`.
77
- */
78
- readonly manifest?: string;
79
- }
80
- /** A step `better-supabase gen` runs. */
81
- type GenTask = (typeof GEN_TASKS)[number];
82
- interface GenConfig {
83
- /**
84
- * The steps `better-supabase gen` runs, in this order: `types` (the generated
85
- * modules and `generators`), `sql` (`upgrade`), `spec` (`spec emit`), `seed`
86
- * and `env`. Without a list, `types` runs, plus `sql` when `blocks` or
87
- * `realtime.policies` is set, and `spec` and `seed` when their entry file
88
- * exists. `env` runs only when listed, because it needs the local stack. A
89
- * listed step always runs.
90
- */
91
- readonly tasks?: readonly GenTask[];
92
- /** Milliseconds between checks in `gen --watch` and `spec emit --watch`. */
93
- readonly watchInterval?: number;
94
- /**
95
- * Serves the schema types through the TypeScript 7.1 content mapper instead
96
- * of writing them. `gen` then writes a slim `generated.ts` with the runtime
97
- * values and a `schema.bsb` next to it, and no `database.types.ts`. The app
98
- * still imports from `./generated`. Needs a `contentMappers` entry in
99
- * `tsconfig.json` and `tsc --runExternalCode`. Defaults to `false`.
100
- */
101
- readonly contentMapper?: boolean;
102
- /**
103
- * Writes PowerSync sync streams for these block instances:
104
- * `sync-streams.yaml` and `schema.ts` in `out`, and a migration that adds
105
- * their tables to the `powersync` publication. Runs as the `powersync` task,
106
- * and as `better-supabase powersync streams`.
107
- */
108
- readonly powersync?: PowerSyncGenConfig;
109
- }
110
- interface PowerSyncGenConfig {
111
- /**
112
- * The block instances to sync, by their key in `blocks`: instances of
113
- * `notifications` and `attachments`.
114
- */
115
- readonly instances: readonly string[];
116
- /**
117
- * The folder for `sync-streams.yaml` and `schema.ts`. Defaults to
118
- * `powersync`.
119
- */
120
- readonly out?: string;
121
- /**
122
- * The module `schema.ts` imports `column` and `Table` from. Defaults to
123
- * `@powersync/common`.
124
- */
125
- readonly import?: string;
126
- }
127
- /** Glue `better-supabase init` and `add` write for a framework or runtime. */
128
- type IntegrationName = (typeof INTEGRATION_NAMES)[number];
129
- interface EnvFileConfig {
130
- /** Env file `better-supabase dev env` writes. Defaults to `.env.local`. */
131
- readonly output?: string;
132
- /**
133
- * Prefix for the browser variables, such as `NEXT_PUBLIC_`; `'none'` for no
134
- * prefix. Detected from the framework by default.
135
- */
136
- readonly prefix?: string;
137
- }
138
- /** An agent folder `better-supabase skills install` writes to. */
139
- type SkillsAgent = (typeof SKILLS_AGENTS)[number];
140
- interface SkillsConfig {
141
- /** Defaults to the agent folders the project has, else `agents`. */
142
- readonly agents?: readonly SkillsAgent[];
143
- }
144
- interface KeysConfig {
145
- /**
146
- * Signing key file `better-supabase dev keys` writes. Defaults to
147
- * `supabase/signing_keys.json`.
148
- */
149
- readonly output?: string;
150
- }
151
- interface DoctorConfig {
152
- /** Finding codes to skip, e.g. `['BS204']`. */
153
- readonly ignore?: readonly string[];
154
- /** Run only these checks, e.g. `['BS100', 'BS304']`. */
155
- readonly only?: readonly string[];
156
- /** Treat warnings as errors. */
157
- readonly strict?: boolean;
158
- /**
159
- * Report format: `text` (default), `sarif` (code scanning) or `github`
160
- * (workflow annotations). `--json` still wins.
161
- */
162
- readonly format?: "text" | "sarif" | "github";
163
- /** Write the report to this file. */
164
- readonly output?: string;
165
- /**
166
- * App source files doctor scans for API use (BS210). Globs relative to the
167
- * root. Defaults to `['src/**\/*.{ts,tsx}']`.
168
- */
169
- readonly sources?: readonly string[];
170
- /**
171
- * How many policies a security definer helper may appear in before BS206 asks
172
- * for an inlinable `language sql stable` function. Defaults to 5.
173
- */
174
- readonly policyHelperLimit?: number;
175
- /**
176
- * The BS405 limit in bytes. When the authorization provider's token hook has
177
- * a budget, it replaces that budget and the whole token keeps 2048. Otherwise
178
- * it limits the whole token's claims (default 2048).
179
- */
180
- readonly claimsLimit?: number;
181
- /** Which migrations the lock checks (BS229 to BS235) read. */
182
- readonly migrationSafety?: MigrationSafetyConfig;
183
- }
184
- interface MigrationSafetyConfig {
185
- /**
186
- * The newest migration that is already applied everywhere, by file name
187
- * (`20260101000000_init.sql`) or version (`20260101000000`). Offline, doctor
188
- * checks only the migrations after it; with `--db-url` it checks the ones the
189
- * database hasn't applied. `init` and `add --adopt` set it to the latest
190
- * migration.
191
- */
192
- readonly since?: string;
193
- }
194
- //#endregion
195
- //#region src/preset/fields.d.ts
196
- /**
197
- * How `/create` and `init` show one value: its label and, where the label is
198
- * not enough, a hint.
199
- */
200
- interface PresetValueInfo {
201
- readonly label: string;
202
- readonly hint?: string;
203
- }
204
- /** One convention a preset sets, with the names `/create` and `init` show. */
205
- interface PresetField<K extends string = string, V extends string = string> {
206
- readonly key: K;
207
- readonly values: readonly V[];
208
- readonly default: V | readonly V[];
209
- /** The field takes several values (`integrations`). */
210
- readonly multi?: true;
211
- readonly label: string;
212
- readonly labels: { readonly [P in V]: PresetValueInfo; };
213
- }
214
- /** The value each convention field takes. */
215
- interface PresetConventions {
216
- readonly framework: PresetFramework;
217
- readonly platforms: "web" | "native" | "both";
218
- readonly casing: "snake" | "camel";
219
- readonly idType: "uuid" | "text" | "bigint" | "integer";
220
- readonly scope: "tenant" | "user" | "none";
221
- readonly tenantName: PresetTenantName;
222
- readonly access: "roles" | "catalog" | "provider" | "custom";
223
- readonly api: "none" | "api";
224
- readonly integrations: readonly IntegrationName[];
225
- }
226
- /** A convention field's key. */
227
- type PresetFieldKey = keyof PresetConventions;
228
- /** The values a convention field takes. */
229
- type PresetFieldValue<K extends PresetFieldKey> = ValueOf<K>;
230
- type ValueOf<K extends PresetFieldKey> = PresetConventions[K] extends readonly (infer V extends string)[] ? V : Extract<PresetConventions[K], string>;
231
- /** The tenant names a preset can set (`blocks.memberships.names.organization`). */
232
- declare const PRESET_TENANT_NAMES: readonly ["organization", "workspace", "team"];
233
- type PresetTenantName = (typeof PRESET_TENANT_NAMES)[number];
234
- /** The frameworks `/create` and `init --preset` set up glue for. */
235
- declare const PRESET_FRAMEWORKS: readonly ["next", "vite", "tanstack-start", "expo", "sveltekit", "nuxt", "hono", "astro", "react-router"];
236
- type PresetFramework = (typeof PRESET_FRAMEWORKS)[number];
237
- /** The convention fields, in the order `/create` and `init` show them. */
238
- declare const CONVENTION_FIELDS: readonly PresetField<PresetFieldKey>[];
239
- /** A convention field by key, with its values and labels typed. */
240
- declare function presetField<K extends PresetFieldKey>(key: K): PresetField<K, ValueOf<K>>;
241
- /** A field value's label, or the value itself when it has none. */
242
- declare function presetValueLabel(key: PresetFieldKey, value: string): PresetValueInfo;
243
- /**
244
- * The integrations `init --preset` adds for a framework whatever the selection
245
- * says: the framework's own one, when it has one, then what that one requires.
246
- */
247
- declare function integrationsForFramework(framework: PresetFramework): readonly IntegrationName[];
248
- type PresetPlatforms = PresetConventions["platforms"];
249
- type PresetScope = PresetConventions["scope"];
250
- type PresetAccess = PresetConventions["access"];
251
- /** A block selection and its conventions. */
252
- interface Preset extends PresetConventions {
253
- /**
254
- * Block names (`blocks` keys in the config), as selected; `resolvePreset`
255
- * adds what they require.
256
- */
257
- readonly blocks: readonly string[];
258
- /**
259
- * `blocks` entries the preset writes: a selected block's names and options
260
- * (`tasks: { names: { work_item: "ticket" } }`), or another instance of a
261
- * block (`maintenance: { block: "tasks" }`).
262
- */
263
- readonly instances?: Readonly<Record<string, PresetInstance>>;
264
- }
265
- /** A `blocks` entry a preset writes, with the keys a config file uses. */
266
- interface PresetInstance extends InstanceKeys {
267
- readonly names?: Readonly<Record<string, string>>;
268
- readonly options?: Readonly<Record<string, unknown>>;
269
- readonly tables?: Readonly<Record<string, string | null>>;
270
- }
271
- /** Every convention at its default. */
272
- declare const DEFAULT_CONVENTIONS: PresetConventions;
273
- //#endregion
274
- //#region src/preset/catalog-types.d.ts
275
- /** One SQL module in the preset catalog: a key of `blocks` in the config. */
276
- interface PresetCatalogBlock {
277
- readonly name: string;
278
- readonly title: string;
279
- readonly category: BlockCategory;
280
- /** The modules it needs with the default options. */
281
- readonly requires: readonly string[];
282
- /** What it needs instead under an access model, where that differs. */
283
- readonly requiresByAccess?: Partial<Readonly<Record<PresetAccess, readonly string[]>>>;
284
- /** The scopes it runs in; unset, every scope. */
285
- readonly scopes?: readonly PresetScope[];
286
- /** Tenant names that would rename a table or column to a name it already uses. */
287
- readonly tenantNameClashes?: readonly PresetTenantName[];
288
- /**
289
- * The logical table `options.extraColumns` adds columns to, when it takes
290
- * them.
291
- */
292
- readonly extraColumns?: string;
293
- /**
294
- * The nouns `blocks.<name>.names` renames, with what config resolution needs
295
- * to name them and register their subjects.
296
- */
297
- readonly entities?: PresetCatalogEntities;
298
- /** Modules it works with when installed; `*` is every module. */
299
- readonly integrates: readonly string[];
300
- /** The manifest that installs it, a key of `manifests`. */
301
- readonly manifest: string;
302
- }
303
- /** A block's entities as the catalog carries them. */
304
- interface PresetCatalogEntities {
305
- readonly specs: Readonly<Record<string, BlockSqlEntitySpec>>;
306
- /** The tables that hold them, with their default names and columns. */
307
- readonly tables: Readonly<Record<string, Pick<BlockSqlTableSpec, "name" | "columns">>>;
308
- /** The default permission key of each module action. */
309
- readonly keys: Readonly<Record<string, string>>;
310
- }
311
- /** One block manifest (ADR 0029): what `lib/blocks.ts` wires. */
312
- interface PresetCatalogManifest {
313
- readonly name: string;
314
- /** The SQL modules it installs. */
315
- readonly sql: readonly string[];
316
- readonly category: BlockCategory;
317
- /** Its export and subpath, when it has a TypeScript client. */
318
- readonly client: {
319
- readonly export: string;
320
- readonly subpath: string;
321
- } | null;
322
- readonly consumes: Partial<Readonly<Record<PortName, "optional" | "required">>>;
323
- readonly provides: readonly PortName[];
324
- /** The export of its subpath that builds its repository extension. */
325
- readonly extension?: string;
326
- /**
327
- * The types its subpath exports that carry one of its entities' names, which
328
- * `gen` aliases under the renamed names.
329
- */
330
- readonly entityTypes?: readonly PresetCatalogEntityType[];
331
- /**
332
- * JSON Schemas of the inputs its client takes, by entity key, from the
333
- * Standard Schemas the block exports.
334
- */
335
- readonly entitySchemas?: Readonly<Record<string, PresetCatalogEntitySchemas>>;
336
- /**
337
- * The block's events: the event map type its subpath exports and the event
338
- * types, in its default names.
339
- */
340
- readonly events?: {
341
- readonly type: string;
342
- readonly types: readonly string[];
343
- };
344
- /**
345
- * The write names of its record binding (`block.record`), present when the
346
- * block binds to records; `gen` puts the block on each served record type.
347
- */
348
- readonly record?: readonly string[];
349
- /** The env keys it reads, for `.env.example` and doctor's BS504. */
350
- readonly env?: readonly BlockEnvKey[];
351
- /** The interfaces the app implements for it, for `providers.ts` and BS505. */
352
- readonly providers?: readonly BlockProvider[];
353
- /** The registry items that hold its routes, without the framework suffix. */
354
- readonly routes?: readonly string[];
355
- /** The crons or processes it needs. */
356
- readonly workers?: readonly BlockWorker[];
357
- /** The action kinds it ships, for the action registry. */
358
- readonly actions?: readonly ActionDescriptor[];
359
- /** The timers it runs on the queue's `block_ticks`. */
360
- readonly schedules?: readonly BlockSchedule[];
361
- }
362
- /** One entity's input schemas, in the block's default names. */
363
- interface PresetCatalogEntitySchemas {
364
- readonly input?: PresetCatalogInputSchema;
365
- readonly change?: PresetCatalogInputSchema;
366
- readonly listFilter?: PresetCatalogInputSchema;
367
- }
368
- /** One input schema: its fields as `entitySchema` takes them, and JSON Schema. */
369
- interface PresetCatalogInputSchema {
370
- readonly title: string;
371
- readonly fields: Readonly<Record<string, FieldSpec>>;
372
- readonly jsonSchema: Readonly<Record<string, unknown>>;
373
- }
374
- /** A block type named after one of its entities, such as `WorkItem`. */
375
- interface PresetCatalogEntityType {
376
- readonly name: string;
377
- /** Takes the extra columns as its first type parameter, `F`. */
378
- readonly fields?: true;
379
- }
380
- /**
381
- * One item of the `@better-supabase` shadcn registry: glue the app copies (`npx
382
- * shadcn add @better-supabase/<name>`), for some blocks, frameworks and
383
- * platforms.
384
- */
385
- interface PresetGlueItem {
386
- readonly name: string;
387
- readonly title: string;
388
- /** The SQL modules the item needs. */
389
- readonly blocks: readonly string[];
390
- readonly frameworks: readonly string[];
391
- readonly platforms: readonly ("web" | "native")[];
392
- /** Where its files go, as shadcn targets (`@lib/blocks.ts`, `~/app/...`). */
393
- readonly targets: readonly string[];
394
- /** The env keys its files read. */
395
- readonly envVars?: readonly string[];
396
- /** The named preset a bundle item (`registry:item`) installs the glue of. */
397
- readonly preset?: string;
398
- }
399
- /** What `scripts/build-catalog.ts` writes to `catalog.generated.ts`. */
400
- interface PresetCatalog {
401
- readonly blocks: readonly PresetCatalogBlock[];
402
- readonly manifests: readonly PresetCatalogManifest[];
403
- readonly glue: readonly PresetGlueItem[];
404
- }
405
- //#endregion
406
- //#region src/config/instances.d.ts
407
- /**
408
- * Blocks that install once: they hold the app's identity, tenancy, access and
409
- * plumbing, so a second copy would split what every other block reads.
410
- */
411
- declare const CORE_BLOCKS: ReadonlySet<string>;
412
- /** One named install of a block. */
413
- interface ResolvedInstance {
414
- /** The key in `blocks`. */
415
- readonly name: string;
416
- /** The block it installs. */
417
- readonly block: string;
418
- /** The record types it attaches to; unset, every record type. */
419
- readonly on?: InstanceOn;
420
- /**
421
- * Each dependency block to the instance it resolves to, when that is not the
422
- * instance named after the block: what `uses` sets, and a dependency's only
423
- * instance when it has another name.
424
- */
425
- readonly uses: Readonly<Record<string, string>>;
426
- /** Its config, without `block`. */
427
- readonly config: BlockConfig;
428
- }
429
- declare const INSTANCE_NAME: RegExp;
430
- /**
431
- * The prefix an instance gives the names its block's renames leave unchanged:
432
- * `hiring-pipelines` and `hiringPipelines` both give `hiring_pipelines`.
433
- */
434
- declare function instancePrefix(name: string): string;
435
- //#endregion
436
- //#region src/sql/contributions.d.ts
437
- /**
438
- * What a block adds to a generic block's SQL through `contributes`, keyed by
439
- * the generic block. The generic block reads the contributions of every
440
- * installed instance whose `uses` names it, so it never names its consumers.
441
- */
442
- interface BlockContributions {
443
- readonly approvals: ApprovalContribution;
444
- readonly bulk: BulkActionContribution;
445
- readonly numbering: NumberingContribution;
446
- readonly pipelines: PipelineContribution;
447
- readonly "share-links": ShareLinkContribution;
448
- readonly subjects: SubjectContribution;
449
- }
450
- /** `BlockSql.contributes`: one function per generic block it adds to. */
451
- type BlockContributes = { readonly [K in keyof BlockContributions]?: (own: BlockSqlContext, target: BlockSqlContext) => readonly BlockContributions[K][]; };
452
- /** SQL expressions for the approval request being decided. */
453
- interface ApprovalRequestSql {
454
- /** The request's subject id, as text. */
455
- readonly subjectId: string;
456
- /** The decision's comment. */
457
- readonly comment: string;
458
- }
459
- /** Requests of one subject type the contributing block files with approvals. */
460
- interface ApprovalContribution {
461
- readonly subject: string;
462
- /**
463
- * `declared`: whoever reads the organization's requests reads these.
464
- * `linked`: the contributing block decides them, so only the requester and
465
- * eligible approvers read them, they can't be delegated, and
466
- * `approval_settle` closes them.
467
- */
468
- readonly access: "declared" | "linked";
469
- /** Statements `approval_finalize` runs once a request is approved. */
470
- readonly approve: (request: ApprovalRequestSql) => string;
471
- /** Statements `decide_approval` runs when a request is rejected. */
472
- readonly reject?: (request: ApprovalRequestSql) => string;
473
- /** A boolean expression: whether the request can still be decided. */
474
- readonly approvable?: (request: ApprovalRequestSql) => string;
475
- }
476
- /** A bulk action the contributing block runs on one row. */
477
- interface BulkActionContribution {
478
- /** The action name callers pass, such as `tags.set`. */
479
- readonly name: string;
480
- /**
481
- * PL/pgSQL statements for one row, reading `bulk_row.tenant`,
482
- * `bulk_row.subject_type`, `bulk_row.subject_id` and `bulk_row.args`.
483
- */
484
- readonly run: string;
485
- /** Variables the statements declare, such as `v_tag uuid;`. */
486
- readonly declare?: string;
487
- }
488
- /**
489
- * A number sequence the contributing block draws from, for when the app doesn't
490
- * configure `blocks.numbering.options.entities.<entity>` itself.
491
- */
492
- interface NumberingContribution {
493
- /** The entity name, after the instance's entity names. */
494
- readonly entity: string;
495
- /** The default entry: `{ period, format }` and the other entity keys. */
496
- readonly entry: Readonly<Record<string, unknown>>;
497
- }
498
- /** A record table of the contributing block that runs on pipelines. */
499
- interface PipelineContribution {
500
- /** The subject type, after the instance's entity names. */
501
- readonly type: string;
502
- /** The qualified table its records live in. */
503
- readonly table: string;
504
- /** Its tenant column, unquoted, as the block names it. */
505
- readonly tenant: string;
506
- /** The binding; an app's own `on` entry is merged over it. */
507
- readonly entry: Readonly<Record<string, unknown>>;
508
- }
509
- /** SQL expressions for the subject a new share link names. */
510
- interface ShareLinkSubjectSql {
511
- readonly id: string;
512
- readonly tenant: string;
513
- }
514
- /** A subject type the contributing block owns and share links can name. */
515
- interface ShareLinkContribution {
516
- readonly subject: string;
517
- /**
518
- * A boolean expression: the subject exists in the tenant, and the caller may
519
- * share it.
520
- */
521
- readonly exists: (subject: ShareLinkSubjectSql) => string;
522
- /** Statements share-links adds for this subject type, such as wrappers. */
523
- readonly sql?: string;
524
- }
525
- /** One section `record_summary` counts. */
526
- interface SummarySection {
527
- readonly name: string;
528
- /** The `from` clause; rows are aliased `x`. */
529
- readonly from: string;
530
- readonly subjectType: string;
531
- readonly subjectId: string;
532
- /** The row's time, for the unread check. */
533
- readonly latest: string;
534
- /** Extra conditions a counted row meets, such as not being deleted. */
535
- readonly live?: string;
536
- /**
537
- * When the caller last read the section, as a SQL expression; the `seen_at`
538
- * argument is the fallback.
539
- */
540
- readonly readAt?: string;
541
- }
542
- /** What the contributing block adds to the subject functions. */
543
- interface SubjectContribution {
544
- /** A section `record_summary` counts. */
545
- readonly summary?: SummarySection;
546
- /**
547
- * A `my_work` branch selecting `kind, subject_type, subject_id, ref, title,
548
- * at`; `my_work.tenant` filters by organization and `v_me` is the caller.
549
- */
550
- readonly work?: string;
551
- /** Statements the subjects block adds ahead of `my_work`. */
552
- readonly sql?: string;
553
- }
554
- //#endregion
555
- //#region src/config/generator-metadata.d.ts
556
- /**
557
- * A copy of `@supabase/postgrest-typegen`'s `GeneratorMetadata` contract
558
- * (version 1), so the published types don't reference the package: it is an
559
- * optional peer that only the CLI loads.
560
- * `tests/config/generator-metadata.test-d.ts` checks the copy against the
561
- * pinned version.
562
- */
563
- interface PostgresColumn {
564
- table_id: number;
565
- schema: string;
566
- table: string;
567
- id: string;
568
- ordinal_position: number;
569
- name: string;
570
- default_value: unknown;
571
- data_type: string;
572
- format: string;
573
- type_schema: string;
574
- is_identity: boolean;
575
- identity_generation: "ALWAYS" | "BY DEFAULT" | null;
576
- is_generated: boolean;
577
- is_nullable: boolean;
578
- is_updatable: boolean;
579
- is_unique: boolean;
580
- enums: string[];
581
- check: string | null;
582
- comment: string | null;
583
- }
584
- interface PostgresFunctionArg {
585
- mode: "in" | "inout" | "out" | "table" | "variadic";
586
- name: string;
587
- type_id: number;
588
- has_default: boolean | null;
589
- }
590
- interface PostgresFunction {
591
- id: number;
592
- schema: string;
593
- name: string;
594
- language: string;
595
- definition: string;
596
- complete_statement: string;
597
- args: PostgresFunctionArg[];
598
- argument_types: string;
599
- identity_argument_types: string;
600
- return_type_id: number;
601
- return_type: string;
602
- return_type_relation_id: number | null;
603
- is_set_returning_function: boolean;
604
- prorows: number | null;
605
- behavior: "IMMUTABLE" | "STABLE" | "VOLATILE";
606
- security_definer: boolean;
607
- config_params: {
608
- [x: string]: string;
609
- } | null;
610
- }
611
- /**
612
- * A reference to a `types` entry by oid; `null` names when it is not in
613
- * `types`.
614
- */
615
- interface RpcTypeReference {
616
- type_id: number;
617
- format: string | null;
618
- type_schema: string | null;
619
- }
620
- interface RpcFunctionArg extends RpcTypeReference {
621
- name: string;
622
- mode: "in" | "inout" | "variadic";
623
- has_default: boolean;
624
- relation_id: number | null;
625
- }
626
- interface RpcReturnColumn extends RpcTypeReference {
627
- name: string;
628
- }
629
- interface RpcFunctionReturns extends RpcTypeReference {
630
- relation_id: number | null;
631
- columns: RpcReturnColumn[] | null;
632
- }
633
- interface RpcFunctionOverload {
634
- function_id: number;
635
- args: RpcFunctionArg[];
636
- returns: RpcFunctionReturns;
637
- is_set_returning: boolean;
638
- rows_estimate: number | null;
639
- setof_options: {
640
- from: string;
641
- to: string;
642
- is_one_to_one: boolean;
643
- is_setof_return: boolean;
644
- } | null;
645
- computed_field_of: number | null;
646
- error: string | null;
647
- }
648
- /** A function PostgREST exposes under `/rpc`, with its overloads resolved. */
649
- interface RpcFunction {
650
- schema: string;
651
- name: string;
652
- overloads: RpcFunctionOverload[];
653
- }
654
- interface GeneratorMetadata {
655
- version: 1;
656
- schemas: {
657
- id: number;
658
- name: string;
659
- owner: string;
660
- }[];
661
- tables: {
662
- bytes: number;
663
- comment: string | null;
664
- dead_rows_estimate: number;
665
- id: number;
666
- live_rows_estimate: number;
667
- name: string;
668
- replica_identity: "DEFAULT" | "FULL" | "INDEX" | "NOTHING";
669
- rls_enabled: boolean;
670
- rls_forced: boolean;
671
- schema: string;
672
- size: string;
673
- }[];
674
- foreignTables: {
675
- comment: string | null;
676
- id: number;
677
- name: string;
678
- schema: string;
679
- }[];
680
- views: {
681
- comment: string | null;
682
- id: number;
683
- is_insert_enabled?: boolean | undefined;
684
- is_updatable: boolean;
685
- is_update_enabled?: boolean | undefined;
686
- name: string;
687
- schema: string;
688
- }[];
689
- materializedViews: {
690
- comment: string | null;
691
- id: number;
692
- is_populated: boolean;
693
- name: string;
694
- schema: string;
695
- }[];
696
- columns: PostgresColumn[];
697
- primaryKeys: {
698
- schema: string;
699
- table_name: string;
700
- name: string;
701
- table_id: number;
702
- }[];
703
- relationships: {
704
- foreign_key_name: string;
705
- schema: string;
706
- relation: string;
707
- columns: string[];
708
- is_one_to_one: boolean;
709
- referenced_schema: string;
710
- referenced_relation: string;
711
- referenced_columns: string[];
712
- }[];
713
- functions: PostgresFunction[];
714
- types: {
715
- id: number;
716
- name: string;
717
- schema: string;
718
- format: string;
719
- enums: string[];
720
- attributes: {
721
- name: string;
722
- type_id: number;
723
- }[];
724
- comment: string | null;
725
- type_relation_id: number | null;
726
- }[];
727
- /**
728
- * Derived from `functions`; generators resolve it themselves when it is
729
- * absent, which is how better-supabase stores metadata.
730
- */
731
- rpcFunctions?: RpcFunction[] | undefined;
732
- }
733
- //#endregion
734
- //#region src/config/snapshot.d.ts
735
- /**
736
- * What `better-supabase gen --save-snapshot` reads from Postgres. `generator`
737
- * is the `@supabase/postgrest-typegen` contract (the same metadata behind
738
- * `supabase gen types`); `extras` holds what that contract leaves out. Codegen
739
- * and doctor both work from this snapshot, so either can run offline from a
740
- * saved file.
741
- */
742
- interface Snapshot {
743
- readonly $schema?: string;
744
- readonly version: 2;
745
- /** Every schema that was read, including helper schemas for doctor. */
746
- readonly schemas: readonly string[];
747
- readonly generator: GeneratorMetadata;
748
- readonly extras: SnapshotExtras;
749
- }
750
- /** Catalog details `GeneratorMetadata` does not carry. */
751
- interface SnapshotExtras {
752
- readonly tables: readonly ExtrasTable[];
753
- readonly buckets: readonly SnapshotBucket[];
754
- /** Tables in the `supabase_realtime` publication, as `schema.table`. */
755
- readonly realtime: readonly string[];
756
- /**
757
- * `alter role ... set` values for the Data API roles (`authenticator`), such
758
- * as `pgrst.db_aggregates_enabled`. Absent in older snapshots.
759
- */
760
- readonly roleSettings?: Readonly<Record<string, Readonly<Record<string, string>>>>;
761
- /**
762
- * Functions that policies in the read schemas call, plus functions in those
763
- * schemas with `set` options. Absent in older snapshots.
764
- */
765
- readonly functions?: readonly ExtrasFunction[];
766
- /**
767
- * The Postgres functions `supabase/config.toml` configures as Auth hooks, in
768
- * any schema. Absent in older snapshots and without a `config.toml`.
769
- */
770
- readonly hooks?: readonly ExtrasHook[];
771
- /**
772
- * Comments of the functions in the read schemas that carry a gen tag
773
- * (`@notNull`), keyed by `schema.name(signature)`. Absent when none do.
774
- */
775
- readonly functionComments?: Readonly<Record<string, string>>;
776
- /**
777
- * Domains that the read schemas' functions take or return, with their base
778
- * type. Typegen leaves them `unknown`; `gen` types them by the base type, and
779
- * a `returns table` column of a NOT NULL domain is never null. Absent when no
780
- * function uses a domain.
781
- */
782
- readonly domains?: readonly ExtrasDomain[];
783
- /**
784
- * Set when the snapshot comes from a `GeneratorMetadata` document alone (`gen
785
- * --metadata`): unique keys, checks and foreign keys are inferred from the
786
- * columns and relationships, and the rest is empty, so doctor skips the rules
787
- * that read it.
788
- */
789
- readonly fromMetadata?: true;
790
- }
791
- interface ExtrasDomain {
792
- readonly schema: string;
793
- readonly name: string;
794
- /** The base type's name (`uuid`, `_text`). */
795
- readonly baseType: string;
796
- readonly baseSchema: string;
797
- /** Declared `not null`. */
798
- readonly notNull: boolean;
799
- }
800
- /** An `[auth.hook.<name>]` with a `pg-functions://` URI. */
801
- interface ExtrasHook {
802
- /** `custom_access_token`, `send_email`, ... */
803
- readonly hook: string;
804
- readonly schema: string;
805
- readonly name: string;
806
- /** Every overload with that name; empty when the function does not exist. */
807
- readonly functions: readonly ExtrasHookFunction[];
808
- }
809
- interface ExtrasHookFunction extends ExtrasFunction {
810
- /**
811
- * Of `supabase_auth_admin`, `authenticated` and `anon`, the roles that may
812
- * execute it (directly or through `public`).
813
- */
814
- readonly execute: readonly string[];
815
- /** Whether `public` may execute it (the default until revoked). */
816
- readonly publicExecute: boolean;
817
- /** Of the same roles, those with `usage` on its schema. */
818
- readonly schemaUsage: readonly string[];
819
- /** The function body (`pg_proc.prosrc`). Absent in snapshots that predate it. */
820
- readonly source?: string;
821
- }
822
- /** A function as doctor needs it for RLS checks, in any schema. */
823
- interface ExtrasFunction {
824
- readonly schema: string;
825
- readonly name: string;
826
- /** Identity arguments, e.g. `organization uuid`. */
827
- readonly signature: string;
828
- /** `sql`, `plpgsql`, `c`, ... */
829
- readonly language: string;
830
- readonly volatility: "immutable" | "stable" | "volatile";
831
- readonly securityDefiner: boolean;
832
- /** `set` options, e.g. `{ statement_timeout: '5s' }`. */
833
- readonly settings: Readonly<Record<string, string>>;
834
- /**
835
- * Which of `anon` and `authenticated` may execute it. Absent in older
836
- * snapshots.
837
- */
838
- readonly execute?: readonly string[];
839
- }
840
- interface ExtrasTable {
841
- /** Table oid, matching `GeneratorMetadata.tables[].id`. */
842
- readonly id: number;
843
- readonly schema: string;
844
- readonly name: string;
845
- /** Primary key columns in key order. */
846
- readonly primaryKey: readonly string[];
847
- readonly uniques: readonly CatalogUnique[];
848
- readonly foreignKeys: readonly {
849
- readonly name: string;
850
- readonly onDelete: ForeignKeyAction;
851
- readonly onUpdate: ForeignKeyAction;
852
- }[];
853
- readonly checks: readonly CatalogCheck[];
854
- readonly indexes: readonly CatalogIndex[];
855
- readonly policies: readonly CatalogPolicy[];
856
- readonly triggers: readonly CatalogTrigger[];
857
- readonly grants: readonly CatalogGrant[];
858
- /** Absent in snapshots taken before column grants were introspected. */
859
- readonly columnGrants?: readonly CatalogColumnGrant[];
860
- /**
861
- * Postgres estimates at least `LARGE_TABLE_ROWS` rows; the `unbounded-read`
862
- * lint reads it.
863
- */
864
- readonly large?: true;
865
- /** The partitioned parent as `schema.name`, when the table is a partition. */
866
- readonly partitionOf?: string;
867
- }
868
- type ForeignKeyAction = "no action" | "restrict" | "cascade" | "set null" | "set default";
869
- interface CatalogUnique {
870
- readonly name: string;
871
- readonly columns: readonly string[];
872
- }
873
- interface CatalogCheck {
874
- readonly name: string;
875
- readonly definition: string;
876
- }
877
- interface CatalogIndex {
878
- readonly name: string;
879
- readonly columns: readonly string[];
880
- readonly unique: boolean;
881
- readonly primary: boolean;
882
- readonly partial: boolean;
883
- /** Access method (`btree`, `gin`, `gist`, ...). Absent in older snapshots. */
884
- readonly method?: string;
885
- /**
886
- * The `where` of a partial index, as Postgres prints it. Absent in older
887
- * snapshots.
888
- */
889
- readonly predicate?: string | null;
890
- }
891
- interface CatalogPolicy {
892
- readonly name: string;
893
- readonly command: "all" | "select" | "insert" | "update" | "delete";
894
- readonly roles: readonly string[];
895
- readonly permissive: boolean;
896
- readonly using: string | null;
897
- readonly check: string | null;
898
- /**
899
- * Functions the policy expressions call, as `schema.name`, from `pg_depend`.
900
- * Absent in older snapshots.
901
- */
902
- readonly functions?: readonly string[];
903
- }
904
- interface CatalogTrigger {
905
- readonly name: string;
906
- readonly timing: "before" | "after" | "instead of";
907
- readonly events: readonly ("insert" | "update" | "delete" | "truncate")[];
908
- readonly level: "row" | "statement";
909
- readonly function: string;
910
- /** The `create trigger` arguments, when there are any. */
911
- readonly args?: readonly string[];
912
- /**
913
- * The function's body, only for functions that call `realtime.send()` or
914
- * `realtime.broadcast_changes()`, other than `broadcast_topic()`.
915
- */
916
- readonly source?: string;
917
- /** The function's comment, for the same functions as `source`. */
918
- readonly comment?: string;
919
- }
920
- interface CatalogGrant {
921
- readonly role: string;
922
- readonly privileges: readonly string[];
923
- }
924
- /**
925
- * A column-level `select`, `insert` or `update` grant to `anon` or
926
- * `authenticated`.
927
- */
928
- interface CatalogColumnGrant {
929
- readonly column: string;
930
- readonly role: string;
931
- readonly privileges: readonly string[];
932
- }
933
- interface SnapshotBucket {
934
- readonly id: string;
935
- readonly public: boolean;
936
- readonly fileSizeLimit: number | null;
937
- readonly allowedMimeTypes: readonly string[] | null;
938
- /** `versioning_status`; absent when Storage has no versioning. */
939
- readonly versioning?: "DISABLED" | "ENABLED" | "SUSPENDED" | null;
940
- /** `lifecycle_configuration`; absent when Storage has no lifecycles. */
941
- readonly lifecycle?: unknown;
942
- }
943
- /**
944
- * The snapshot joined into one record per table, function and enum. Codegen and
945
- * doctor read this view rather than the raw snapshot.
946
- */
947
- interface Catalog {
948
- readonly schemas: readonly string[];
949
- readonly tables: readonly CatalogTable[];
950
- readonly enums: readonly CatalogEnum[];
951
- readonly functions: readonly CatalogFunction[];
952
- readonly buckets: readonly SnapshotBucket[];
953
- readonly realtime: readonly string[];
954
- }
955
- interface CatalogTable {
956
- readonly id: number;
957
- readonly schema: string;
958
- readonly name: string;
959
- /** Materialized views count as views; foreign tables as tables. */
960
- readonly kind: "table" | "view";
961
- readonly rls: boolean;
962
- readonly forceRls: boolean;
963
- readonly replicaIdentity: "DEFAULT" | "INDEX" | "FULL" | "NOTHING" | null;
964
- /** Inserts work (always true for tables). */
965
- readonly insertable: boolean;
966
- /** Updates work (always true for tables). */
967
- readonly updatable: boolean;
968
- readonly comment: string | null;
969
- readonly columns: readonly CatalogColumn[];
970
- readonly primaryKey: readonly string[];
971
- readonly uniques: readonly CatalogUnique[];
972
- readonly foreignKeys: readonly CatalogForeignKey[];
973
- readonly checks: readonly CatalogCheck[];
974
- readonly indexes: readonly CatalogIndex[];
975
- readonly policies: readonly CatalogPolicy[];
976
- readonly triggers: readonly CatalogTrigger[];
977
- readonly grants: readonly CatalogGrant[];
978
- /** Absent in snapshots taken before column grants were introspected. */
979
- readonly columnGrants?: readonly CatalogColumnGrant[];
980
- /** The partitioned parent as `schema.name`, when the table is a partition. */
981
- readonly partitionOf?: string;
982
- }
983
- interface CatalogColumn {
984
- readonly name: string;
985
- /** Type name; the element type for arrays (`uuid`, `int8`, `note_kind`). */
986
- readonly udt: string;
987
- /** Raw type name as Postgres reports it (`_text` for `text[]`). */
988
- readonly format: string;
989
- readonly typeSchema: string;
990
- readonly isArray: boolean;
991
- readonly isEnum: boolean;
992
- readonly nullable: boolean;
993
- readonly hasDefault: boolean;
994
- readonly default: string | null;
995
- readonly identity: "always" | "by default" | null;
996
- readonly generated: boolean;
997
- readonly updatable: boolean;
998
- readonly comment: string | null;
999
- }
1000
- interface CatalogForeignKey {
1001
- readonly name: string;
1002
- readonly columns: readonly string[];
1003
- readonly refSchema: string;
1004
- readonly refTable: string;
1005
- readonly refColumns: readonly string[];
1006
- readonly oneToOne: boolean;
1007
- readonly onDelete: ForeignKeyAction;
1008
- readonly onUpdate: ForeignKeyAction;
1009
- }
1010
- interface CatalogEnum {
1011
- readonly schema: string;
1012
- readonly name: string;
1013
- readonly values: readonly string[];
1014
- }
1015
- interface CatalogFunction {
1016
- readonly schema: string;
1017
- readonly name: string;
1018
- /** Signature that tells overloads apart, e.g. `a integer, b text`. */
1019
- readonly signature: string;
1020
- readonly args: readonly CatalogFunctionArg[];
1021
- /** Columns for `returns table (...)` functions. */
1022
- readonly returnsTable: readonly {
1023
- readonly name: string;
1024
- readonly udt: string;
1025
- /** Schema of the column's type, when typegen knows it. */
1026
- readonly typeSchema?: string;
1027
- /** The column's type is a NOT NULL domain. */
1028
- readonly notNull?: true;
1029
- }[] | null;
1030
- /** Return type name (`int4`, `_text`, a table's row type). */
1031
- readonly returns: string;
1032
- /** Schema of the return type, when typegen knows it. */
1033
- readonly returnsSchema?: string;
1034
- /** `schema.table` when the function returns rows of a table or view. */
1035
- readonly returnsRelation: string | null;
1036
- readonly returnsSet: boolean;
1037
- readonly volatility: "immutable" | "stable" | "volatile";
1038
- readonly securityDefiner: boolean;
1039
- readonly language: string;
1040
- /** `search_path` from `SET search_path`, or `null` when unset. */
1041
- readonly searchPath: string | null;
1042
- /** The function's comment, when it carries a gen tag such as `@notNull`. */
1043
- readonly comment?: string;
1044
- }
1045
- interface CatalogFunctionArg {
1046
- readonly name: string;
1047
- readonly udt: string;
1048
- /** Schema of the argument's type, when typegen knows it. */
1049
- readonly typeSchema?: string;
1050
- readonly isArray: boolean;
1051
- readonly hasDefault: boolean;
1052
- }
1053
- //#endregion
1054
- //#region src/config/types/app-tables.d.ts
1055
- /**
1056
- * The column types an app table may use. Money is a `bigint` of minor units
1057
- * next to a `text` currency column (ADR 0024 and 0037), never `numeric`.
1058
- */
1059
- declare const APP_COLUMN_TYPES: readonly ["text", "uuid", "integer", "bigint", "numeric", "boolean", "timestamptz", "date", "jsonb", "text[]"];
1060
- type AppColumnType = (typeof APP_COLUMN_TYPES)[number];
1061
- /**
1062
- * What a reference does when the row it points at is deleted
1063
- * (`references.onDelete`).
1064
- */
1065
- declare const APP_ON_DELETE_ACTIONS: readonly ["cascade", "restrict", "set null", "no action"];
1066
- type AppOnDeleteAction = (typeof APP_ON_DELETE_ACTIONS)[number];
1067
- /**
1068
- * What a column references: another app table, `auth.users` (`{ table:
1069
- * "auth.users" }`), or a logical table of an installed block (`{ block: "crm",
1070
- * table: "contacts" }`), which follows the block's renames.
1071
- */
1072
- type AppReferenceTarget = {
1073
- readonly table: string;
1074
- } | {
1075
- readonly block: string;
1076
- readonly table: string;
1077
- };
1078
- type AppReference = AppReferenceTarget & {
1079
- /** Defaults to `no action`. */
1080
- readonly onDelete?: AppOnDeleteAction;
1081
- };
1082
- /**
1083
- * What a column holds, beyond its Postgres type. `email`, `url`, `rating` and
1084
- * `percent` add a check; the others tell the UI and `gen` how to show the
1085
- * value. `FIELD_FORMATS` lists the types each fits and its input.
1086
- */
1087
- declare const APP_COLUMN_FORMATS: typeof FIELD_FORMAT_NAMES;
1088
- type AppColumnFormat = FieldFormatName;
1089
- interface AppColumnConfig {
1090
- readonly type: AppColumnType;
1091
- /** Defaults to true. */
1092
- readonly nullable?: boolean;
1093
- /**
1094
- * The column default, from an allowlist: `now()`, `gen_random_uuid()`,
1095
- * `auth.uid()`, `true`, `false`, a number, a `'quoted'` text literal, and
1096
- * `'{}'` or `'[]'` for `jsonb` and `text[]`.
1097
- */
1098
- readonly default?: string;
1099
- readonly unique?: boolean;
1100
- readonly references?: AppReference;
1101
- /** What the column holds; see `APP_COLUMN_FORMATS`. */
1102
- readonly format?: AppColumnFormat;
1103
- /**
1104
- * The schema-qualified domain the column takes as its type, such as
1105
- * `bsb.email`, in place of the format's inline check. Only `migrate
1106
- * schema-first` and the preset writers set it (ADR 0102); it isn't a config
1107
- * key.
1108
- */
1109
- readonly domain?: string;
1110
- /**
1111
- * The values a `text` column (single select) or each element of a `text[]`
1112
- * column (multi-select) may take, checked by the database.
1113
- */
1114
- readonly options?: readonly string[];
1115
- /** The smallest value of a number column, or the shortest `text`. */
1116
- readonly min?: number;
1117
- /** The largest value of a number column, or the longest `text`. */
1118
- readonly max?: number;
1119
- /** Rendered as `comment on column`. */
1120
- readonly comment?: string;
1121
- /**
1122
- * An `integer` or `bigint` the database numbers (`generated by default as
1123
- * identity`).
1124
- */
1125
- readonly identity?: boolean;
1126
- /**
1127
- * Who reaches the column, through column grants (ADR 0051). By default
1128
- * signed-in users read and write it, within the row's policies. `read` lets
1129
- * them read it while only the service role, triggers and defaults write it;
1130
- * `server` hides it from them, so only the service role reads and writes it.
1131
- */
1132
- readonly access?: AppColumnAccess;
1133
- /**
1134
- * Stores the column encrypted with the row's tenant (or user) data key from
1135
- * Supabase Vault, through the `field-encryption` block. Signed-in users write
1136
- * plaintext and never select the column; they read it through
1137
- * `public.<table>_reveal(ids)`, which checks the row's policy and decrypts.
1138
- * It can't be unique, a reference, an identity, indexed or searched.
1139
- */
1140
- readonly encrypted?: boolean;
1141
- }
1142
- declare const APP_COLUMN_ACCESS: readonly ["read", "server"];
1143
- type AppColumnAccess = (typeof APP_COLUMN_ACCESS)[number];
1144
- /**
1145
- * A table the app owns, created in `public` by `better-supabase upgrade` next
1146
- * to the block files. Every table gets `id`, the scope column and (unless
1147
- * `timestamps: false`) `created_at` and `updated_at`.
1148
- */
1149
- interface AppTableConfig {
1150
- /** The table's own columns, keyed by lower snake name. */
1151
- readonly columns?: Readonly<Record<string, AppColumnConfig>>;
1152
- /**
1153
- * Who reaches a row. `inherit` (the default) follows `sql.scope`: per tenant,
1154
- * members of the row's tenant; per user, the row's user. `user` keeps rows
1155
- * per user in any scope, and `none` lets signed-in users read every row while
1156
- * only the service role writes.
1157
- */
1158
- readonly scope?: "inherit" | "user" | "none";
1159
- /** `created_at` and `updated_at`. Defaults to true. */
1160
- readonly timestamps?: boolean;
1161
- /**
1162
- * The id's type: `uuid` (the default, `gen_random_uuid()`) or `bigint` (an
1163
- * identity). A reference to the table needs a column of the same type.
1164
- */
1165
- readonly id?: "uuid" | "bigint";
1166
- /** Sets of columns that are unique together, each a unique constraint. */
1167
- readonly unique?: readonly (readonly string[])[];
1168
- /**
1169
- * Sets of columns to index, in order. Reference and scope columns already
1170
- * have one.
1171
- */
1172
- readonly indexes?: readonly (readonly string[])[];
1173
- /** Rendered as `comment on table`. */
1174
- readonly comment?: string;
1175
- /**
1176
- * Registers the table as a subject (ADR 0043), so blocks that attach rows to
1177
- * subjects (comments, attachments, tags, versions, search and others) reach
1178
- * its rows without a `subjects` entry.
1179
- */
1180
- readonly subject?: AppTableSubject;
1181
- /**
1182
- * Values computed from the rows of another app table that references this
1183
- * one, keyed by the column name they get in `public.<table>_view` (ADR
1184
- * 0044).
1185
- */
1186
- readonly rollups?: Readonly<Record<string, AppRollupConfig>>;
1187
- /**
1188
- * Columns of the row a reference points at, keyed by the column name they get
1189
- * in `public.<table>_view` (ADR 0044).
1190
- */
1191
- readonly lookups?: Readonly<Record<string, AppLookupConfig>>;
1192
- /**
1193
- * Emits an outbox event for each insert, update and delete (ADR 0048):
1194
- * `<subject type or table>.created`, `.updated` and `.deleted`. Needs the
1195
- * `outbox` block.
1196
- */
1197
- readonly events?: true | AppTableEvents;
1198
- /**
1199
- * Writes an audit log entry in the `read` category for each call of
1200
- * `public.<table>_reveal`: who read which rows and when, one entry per tenant
1201
- * per call. Needs an `encrypted` column and the `audit` block.
1202
- */
1203
- readonly auditReads?: boolean;
1204
- }
1205
- declare const APP_TABLE_EVENT_KINDS: readonly ["created", "updated", "deleted"];
1206
- type AppTableEventKind = (typeof APP_TABLE_EVENT_KINDS)[number];
1207
- /** Which writes emit an event and which column values its payload carries. */
1208
- interface AppTableEvents {
1209
- /** Defaults to all three. */
1210
- readonly on?: readonly AppTableEventKind[];
1211
- /**
1212
- * Columns whose values go in the payload. By default it holds the row id and,
1213
- * for updates, the names of the changed columns.
1214
- */
1215
- readonly include?: readonly string[];
1216
- }
1217
- declare const APP_ROLLUP_AGGREGATES: readonly ["count", "sum", "min", "max", "avg"];
1218
- type AppRollupAggregate = (typeof APP_ROLLUP_AGGREGATES)[number];
1219
- /**
1220
- * An aggregate over the rows of `table` whose `via` column references this
1221
- * table: `{ table: "tasks", via: "project_id", aggregate: "count" }`.
1222
- */
1223
- interface AppRollupConfig {
1224
- /** The app table whose rows are aggregated. */
1225
- readonly table: string;
1226
- /** The column of `table` that references this table. */
1227
- readonly via: string;
1228
- /** `sum` of no rows is 0; `min`, `max` and `avg` of no rows are null. */
1229
- readonly aggregate: AppRollupAggregate;
1230
- /**
1231
- * The column of `table` the aggregate reads: a number for `sum` and `avg`, a
1232
- * number, date, time or text for `min` and `max`. `count` takes none and
1233
- * counts rows.
1234
- */
1235
- readonly column?: string;
1236
- /**
1237
- * Only the rows whose select column (a `text` column with `options`) holds
1238
- * `equals`.
1239
- */
1240
- readonly where?: {
1241
- readonly column: string;
1242
- readonly equals: string;
1243
- };
1244
- }
1245
- /** The `column` of the app table row that this table's `via` column references. */
1246
- interface AppLookupConfig {
1247
- /** A column of this table that references another app table. */
1248
- readonly via: string;
1249
- /** A column of the referenced table. */
1250
- readonly column: string;
1251
- }
1252
- /**
1253
- * The subject an app table registers. The table, id type and tenant column come
1254
- * from the table itself.
1255
- */
1256
- interface AppTableSubject {
1257
- /** The subject type, lowercase letters, digits and underscores. */
1258
- readonly type: string;
1259
- /** The column `subject_title` returns. */
1260
- readonly title?: string;
1261
- /**
1262
- * The path `subject_url` returns, with `{column}` placeholders:
1263
- * `/projects/{id}`.
1264
- */
1265
- readonly url?: string;
1266
- /** The columns a search index reads. */
1267
- readonly search?: {
1268
- readonly title?: string;
1269
- readonly body?: readonly string[];
1270
- };
1271
- /**
1272
- * A permission key per action that `can_subject` checks; see
1273
- * `SubjectConfig.permissions`.
1274
- */
1275
- readonly permissions?: Readonly<Record<string, string>>;
1276
- /**
1277
- * Adds a `rank text collate "C"` column for `move()` (ADR 0021), ordered
1278
- * within `group` when set.
1279
- */
1280
- readonly rank?: true | {
1281
- readonly group?: string;
1282
- };
1283
- /**
1284
- * Adds a `deleted_at timestamptz` column that blocks treat as the soft-delete
1285
- * time.
1286
- */
1287
- readonly softDelete?: boolean;
1288
- /**
1289
- * Registers the table with the versions block: `true` snapshots every column
1290
- * of the table on each change; `columns` and `auto` narrow it.
1291
- */
1292
- readonly versions?: true | AppTableVersions;
1293
- }
1294
- /** What the versions block keeps of an app table's rows. */
1295
- interface AppTableVersions {
1296
- /**
1297
- * The columns a snapshot copies and a restore writes back; every column of
1298
- * the table by default.
1299
- */
1300
- readonly columns?: readonly string[];
1301
- /** Snapshot on each change to `columns`, debounced; `true` by default. */
1302
- readonly auto?: boolean;
1303
- }
1304
- type AppTablesConfig = Readonly<Record<string, AppTableConfig>>;
1305
- //#endregion
1306
- //#region src/sql/audit-registrations.d.ts
1307
- /** A table registered with `better_supabase.audit(...)` in a SQL file. */
1308
- interface AuditedTable {
1309
- /** `schema.table`, unquoted; an unqualified name is in `public`. */
1310
- readonly target: string;
1311
- readonly ignore: readonly string[];
1312
- readonly redact: readonly string[];
1313
- }
1314
- /**
1315
- * The tables `files` register with `better_supabase.audit(...)` or a static
1316
- * `create trigger bsb_audit ... execute function
1317
- * better_supabase.audit_row_change('{...}')`, in file order: a later
1318
- * registration for the same table replaces the earlier one, and `unaudit(...)`
1319
- * or a `drop table` removes it. Calls with non-literal arguments are skipped.
1320
- */
1321
- declare function auditRegistrations(files: readonly {
1322
- readonly text: string;
1323
- }[]): AuditedTable[];
1324
- //#endregion
1325
- //#region src/sql/foreign-keys.d.ts
1326
- /** A foreign key the schema files declare. */
1327
- interface DeclaredForeignKey {
1328
- /** `schema.table`, unquoted. */
1329
- readonly table: string;
1330
- readonly columns: readonly string[];
1331
- /** The referenced `schema.table`, unquoted. */
1332
- readonly references: string;
1333
- /**
1334
- * The referenced columns. Without a column list, the referenced table's
1335
- * declared primary key, or `id` when the files don't declare one.
1336
- */
1337
- readonly referencedColumns: readonly string[];
1338
- }
1339
- /**
1340
- * The layout fields `blocks.memberships.options.sameTenant.auto` derives its
1341
- * entries from.
1342
- */
1343
- declare function sameTenantLayout(files: readonly {
1344
- readonly text: string;
1345
- }[], schemas: readonly string[]): Required<Pick<BlockSqlLayout, "foreignKeys" | "declaredColumns">>;
1346
- //#endregion
1347
- //#region src/config/defaults.d.ts
1348
- /**
1349
- * Every default `resolveConfig` fills in. Other modules (the SQL module
1350
- * registry, the CLI) read their fallbacks from here instead of repeating the
1351
- * literals.
1352
- */
1353
- declare const CONFIG_DEFAULTS: {
1354
- readonly output: string;
1355
- readonly schemas: readonly string[];
1356
- readonly casing: "snake";
1357
- readonly postgrestVersion: string;
1358
- readonly codecs: {
1359
- readonly timestamptz: "string";
1360
- readonly int8: "number";
1361
- readonly numeric: "number";
1362
- };
1363
- readonly sql: {
1364
- readonly dir: string;
1365
- readonly prefix: string;
1366
- readonly testsDir: string;
1367
- };
1368
- readonly seed: {
1369
- readonly entry: string;
1370
- readonly output: string;
1371
- readonly perTenant: string;
1372
- };
1373
- readonly openapi: {
1374
- readonly entry: string;
1375
- readonly output: string;
1376
- };
1377
- readonly specs: {
1378
- readonly failOn: "error";
1379
- };
1380
- readonly doctor: {
1381
- readonly format: "text";
1382
- readonly sources: readonly string[];
1383
- readonly policyHelperLimit: number;
1384
- };
1385
- readonly gen: {
1386
- readonly watchInterval: number;
1387
- };
1388
- readonly env: {
1389
- readonly output: string;
1390
- };
1391
- };
1392
- //#endregion
1393
- //#region src/preset/presets.d.ts
1394
- /** Where a named preset sits in the `/create` and `init` pickers. */
1395
- type PresetGroup = "starters" | "products" | "verticals" | "ai" | "platforms" | "everything";
1396
- /** The preset groups in display order, with their headings. */
1397
- declare const PRESET_GROUPS: Readonly<Record<PresetGroup, string>>;
1398
- /** A named starting point: a block selection with the default conventions. */
1399
- interface NamedPreset {
1400
- readonly name: string;
1401
- readonly title: string;
1402
- readonly description: string;
1403
- readonly group: PresetGroup;
1404
- /** The blocks it selects; `resolvePreset` adds what they require. */
1405
- readonly blocks: readonly string[];
1406
- /** The conventions it sets over the defaults, such as a user scope. */
1407
- readonly conventions?: Partial<PresetConventions>;
1408
- /** The `blocks` entries it writes: its nouns and extra instances. */
1409
- readonly instances?: Preset["instances"];
1410
- }
1411
- /** A named preset's name. */
1412
- type PresetName = "minimal" | "saas" | "consumer" | "crm" | "projects" | "helpdesk" | "chat" | "commerce" | "cms" | "erp" | "pim" | "marketplace" | "scheduling" | "people" | "drive" | "docs" | "invoicing" | "forms" | "property" | "field-service" | "clinic" | "lms" | "events" | "legal" | "spend" | "contracts" | "customer-success" | "logistics" | "pos" | "fitness" | "nonprofit" | "itsm" | "compliance" | "construction" | "claims" | "community" | "feedback" | "ai" | "ai-chat" | "ai-agents" | "developer-api" | "automation" | "enterprise" | "admin" | "everything";
1413
- /** The named presets, for `defineConfig({ preset })` and `/create`. */
1414
- declare const PRESETS: Readonly<Record<PresetName, NamedPreset>>;
1415
- /** The named presets in display order, grouped by `group`. */
1416
- declare const PRESET_NAMES: readonly PresetName[];
1417
- declare function isPresetName(value: unknown): value is PresetName;
1418
- /** The named preset as a `Preset`: the default conventions, then its own. */
1419
- declare function namedPreset(name: PresetName): Preset;
1420
- /** The preset `/create` and `init` start from. */
1421
- declare const DEFAULT_PRESET_NAME: "saas";
1422
- /** The default preset as a `Preset`, so a new design can start from it. */
1423
- declare function defaultPreset(): Preset;
1424
- //#endregion
1425
- //#region src/preset/spec.d.ts
1426
- /**
1427
- * A preset written out: the conventions that differ from the defaults and the
1428
- * selected blocks. It is what the config's `preset` key and a design's `preset`
1429
- * key hold when the selection isn't a named preset.
1430
- */
1431
- type PresetSpec = Partial<PresetConventions> & {
1432
- readonly blocks?: readonly string[];
1433
- readonly instances?: Readonly<Record<string, PresetInstance>>;
1434
- };
1435
- /**
1436
- * The preset as the config or a design writes it: its name when it is a named
1437
- * preset as it ships, otherwise the conventions that differ from the defaults
1438
- * and the selected blocks.
1439
- */
1440
- declare function presetSpec(preset: Preset): PresetName | PresetSpec;
1441
- /**
1442
- * Reads a preset object (`PresetSpec`) into a `Preset`, with the conventions it
1443
- * leaves out at their defaults. Throws a TypeError naming the first key or
1444
- * value that isn't one.
1445
- */
1446
- declare function presetFromSpec(value: unknown): Preset;
1447
- /** A preset name or object as a `Preset`. */
1448
- declare function presetOfSpec(value: unknown): Preset;
1449
- //#endregion
1450
- //#region src/config/expose.d.ts
1451
- /** A privilege the Data API roles can be granted on a table or view. */
1452
- type Privilege = "select" | "insert" | "update" | "delete";
1453
- type ColumnPrivilege = `${"select" | "insert" | "update"}(${string})`;
1454
- type ExposePrivilege = Privilege | ColumnPrivilege;
1455
- /** A role the `grants` module writes privileges for. */
1456
- type ExposeRole = "anon" | "authenticated" | "service_role";
1457
- /**
1458
- * Data API grants for one table: privileges for `authenticated`, or per role.
1459
- * `serviceRole` defaults to every privilege. For a function, keyed by its
1460
- * signature (`search_notes(text, integer)`), `execute` lists the roles that may
1461
- * call it; `service_role` is added unless `serviceRole` is false.
1462
- */
1463
- type ExposeConfig = readonly ExposePrivilege[] | {
1464
- readonly anon?: readonly ExposePrivilege[];
1465
- readonly authenticated?: readonly ExposePrivilege[];
1466
- readonly serviceRole?: readonly ExposePrivilege[];
1467
- } | {
1468
- readonly execute: readonly ("anon" | "authenticated")[];
1469
- readonly serviceRole?: boolean;
1470
- };
1471
- /** Resolved grants for one table. */
1472
- interface ResolvedExpose {
1473
- readonly anon: readonly ExposePrivilege[];
1474
- readonly authenticated: readonly ExposePrivilege[];
1475
- readonly serviceRole: readonly ExposePrivilege[];
1476
- }
1477
- //#endregion
1478
- //#region src/config/types/database.d.ts
1479
- interface BucketConfig {
1480
- readonly id?: string;
1481
- readonly public?: boolean;
1482
- /**
1483
- * Path template with `{placeholders}`, e.g.
1484
- * `{organizationId}/{customerId}/logo.webp`, or several when the bucket
1485
- * stores objects in more than one layout. A last segment `{...rest}` matches
1486
- * one or more segments.
1487
- */
1488
- readonly path: string | readonly [string, ...string[]];
1489
- /** Generated storage policy, or an access contract policy (`{ access }`). */
1490
- readonly policy?: BucketPolicyName | AccessBucketPolicy;
1491
- readonly fileSizeLimit?: string;
1492
- readonly allowedMimeTypes?: readonly string[];
1493
- /**
1494
- * Keep earlier object versions. `bucket.apply()` sets it; doctor (BS302)
1495
- * compares it.
1496
- */
1497
- readonly versioning?: boolean;
1498
- /** When noncurrent versions expire. Needs `versioning: true`. */
1499
- readonly lifecycle?: BucketLifecycle;
1500
- }
1501
- /**
1502
- * How the SQL modules reach the database: `pg-delta` (Supabase Declarative
1503
- * Schemas 2.0, `supabase db schema declarative sync`), `migra` (declarative
1504
- * schemas 1.0, `supabase db diff`) or `migrations` (no declarative schemas: the
1505
- * `sql` commands write the modules into a migration).
1506
- */
1507
- type SqlWorkflow = "pg-delta" | "migra" | "migrations";
1508
- interface SqlConfig {
1509
- /**
1510
- * The workflow. Unset, better-supabase reads `supabase/config.toml`: pg-delta
1511
- * when it enables it or nothing says otherwise, migra when it turns pg-delta
1512
- * off or the project keeps migra's declarative schemas.
1513
- */
1514
- readonly workflow?: SqlWorkflow;
1515
- /** Directory declarative schema files are written to. */
1516
- readonly dir?: string;
1517
- /** File name prefix, so generated files sort after yours. */
1518
- readonly prefix?: string;
1519
- /** Directory pgTAP files (the `pgtap` module) are written to. */
1520
- readonly testsDir?: string;
1521
- /**
1522
- * The schema every module writes its functions and managed tables to, unless
1523
- * `blocks.<name>.schema` sets its own. Defaults to `better_supabase`.
1524
- */
1525
- readonly schema?: string;
1526
- /**
1527
- * The Data API schema, such as `api`, every module writes its `security
1528
- * invoker` wrappers to, unless `blocks.<name>.api` sets its own or `false`.
1529
- */
1530
- readonly api?: string;
1531
- /**
1532
- * Who a block's rows belong to, unless `blocks.<name>.owner` sets its own:
1533
- * `tenant` (a tenant, checked through the access contract; the default),
1534
- * `user` (the signed-in user, with no tenants) or `none` (one shared space
1535
- * every signed-in user reads and writes).
1536
- */
1537
- readonly scope?: BlockScope;
1538
- /**
1539
- * Whose policies govern the app's tables a block runs over, unless
1540
- * `blocks.<name>.ownTablePolicies` sets its own: `block` (the default) or
1541
- * `app`, which keeps every `bsb_` policy, permissive or restrictive, off
1542
- * them.
1543
- */
1544
- readonly ownTablePolicies?: OwnTablePolicies;
1545
- readonly tenantColumn?: string;
1546
- }
1547
- /** `sql` with defaults applied. */
1548
- interface ResolvedSqlConfig {
1549
- /** Unset when the config leaves it to `supabase/config.toml`. */
1550
- readonly workflow?: SqlWorkflow;
1551
- readonly dir: string;
1552
- readonly prefix: string;
1553
- readonly testsDir: string;
1554
- /** Unset means `tenant`. */
1555
- readonly scope?: BlockScope;
1556
- readonly tenantColumn?: string;
1557
- }
1558
- interface SeedConfig {
1559
- /** Module exporting `defineSeed(...)` as `seed` or default. */
1560
- readonly entry?: string;
1561
- /** SQL file `better-supabase db seed` writes. Add it to `[db.seed] sql_paths`. */
1562
- readonly output?: string;
1563
- /**
1564
- * Module exporting `defineTenantSeed(...)` as `seed` or default.
1565
- * `better-supabase db seed --tenant <slug>` applies it to one tenant.
1566
- */
1567
- readonly perTenant?: string;
1568
- }
1569
- interface RealtimeConfig {
1570
- /**
1571
- * Tables that broadcast a change signal for live queries (`table` or
1572
- * `schema.table`). Tenant tables broadcast per tenant. Install the triggers
1573
- * with `better-supabase add realtime-tables`.
1574
- */
1575
- readonly tables?: readonly string[];
1576
- /**
1577
- * Tables in `tables` without a tenant column. They broadcast on one topic
1578
- * every signed-in user receives. With the `tenant` plugin, a table that lacks
1579
- * the tenant column and is not listed here fails to install.
1580
- */
1581
- readonly global?: readonly string[];
1582
- /**
1583
- * Tables in `tables` whose rows belong to one user: table to its user column
1584
- * (`{ notifications: "user_id" }`). They broadcast on a topic per user,
1585
- * `bsb:t:<schema>.<table>:u:<user id>`, which only that user receives,
1586
- * instead of the tenant's topic.
1587
- */
1588
- readonly users?: Readonly<Record<string, string>>;
1589
- /**
1590
- * Writes the `realtime.messages` policies of the topics that `from` exports
1591
- * (`defineTopic`) to `output`, a file in `supabase/schemas`, on
1592
- * `better-supabase upgrade`; `upgrade --check` fails when it is stale.
1593
- */
1594
- readonly policies?: TopicPoliciesConfig;
1595
- /**
1596
- * Broadcast triggers that `upgrade` writes to `policies.output` next to the
1597
- * policies, through the topic's `trigger()`, for topics that `policies.from`
1598
- * exports. A trigger with column values, one topic, a `keys` or `row` payload
1599
- * and one event name calls `better_supabase.broadcast_topic()` (the
1600
- * `realtime-tables` module); any other gets a generated function.
1601
- */
1602
- readonly triggers?: readonly TopicTriggerConfig[];
1603
- }
1604
- interface TopicTriggerLookupConfig {
1605
- readonly from: string;
1606
- readonly via: TopicTriggerValueConfig;
1607
- readonly select: string;
1608
- readonly key?: string;
1609
- }
1610
- type TopicTriggerValueConfig = string | TopicTriggerLookupConfig;
1611
- type TopicTriggerPayloadValueConfig = TopicTriggerValueConfig | {
1612
- readonly sql: string;
1613
- };
1614
- interface TopicTriggerTopicConfig {
1615
- readonly topic: string;
1616
- readonly values?: Readonly<Record<string, TopicTriggerValueConfig>>;
1617
- }
1618
- /** One `realtime.triggers` entry: a table whose row changes go to a topic. */
1619
- interface TopicTriggerConfig {
1620
- /** The template of a topic that `realtime.policies.from` exports. */
1621
- readonly topic: string;
1622
- /** `table` or `schema.table`. */
1623
- readonly table: string;
1624
- /**
1625
- * The column or lookup per placeholder. Defaults to the placeholder in
1626
- * snake_case. A row whose topic comes out null is not sent to it.
1627
- */
1628
- readonly values?: Readonly<Record<string, TopicTriggerValueConfig>>;
1629
- /** Defaults to all three. */
1630
- readonly events?: readonly ("insert" | "update" | "delete")[];
1631
- /**
1632
- * The broadcast event name, or one per operation (`{ insert: "created",
1633
- * delete: "deleted" }`). Defaults to the operation.
1634
- */
1635
- readonly event?: string | {
1636
- readonly insert?: string;
1637
- readonly update?: string;
1638
- readonly delete?: string;
1639
- };
1640
- /**
1641
- * `"keys"` (default) sends the primary key and the placeholder values.
1642
- * `"row"` sends the whole row, which bypasses column grants. An object is the
1643
- * payload itself: each key is a column, a lookup, or `{ sql }`, an expression
1644
- * on the row `{row}` (`tg_op` is the operation).
1645
- */
1646
- readonly payload?: "keys" | "row" | Readonly<Record<string, TopicTriggerPayloadValueConfig>>;
1647
- readonly topics?: readonly TopicTriggerTopicConfig[];
1648
- readonly functionSchema?: string;
1649
- /**
1650
- * `{ changed: ["status"] }` sends an UPDATE only when one of these columns
1651
- * changed. Inserts and deletes always send.
1652
- */
1653
- readonly when?: {
1654
- readonly changed: readonly string[];
1655
- };
1656
- }
1657
- /** `realtime.policies`: where topic policies come from and go. */
1658
- interface TopicPoliciesConfig {
1659
- /** Modules that export `defineTopic` results. Node imports them. */
1660
- readonly from: readonly string[];
1661
- /** The SQL file to write, such as `supabase/schemas/905_topics.sql`. */
1662
- readonly output: string;
1663
- }
1664
- /**
1665
- * Pgvector distance: `<=>` (cosine), `<->` (l2) or `<#>` (negative inner
1666
- * product).
1667
- */
1668
- type VectorDistance = "cosine" | "l2" | "inner_product";
1669
- /** The embedding column, or the column and its distance (default `cosine`). */
1670
- type VectorSearchConfig = string | {
1671
- readonly column: string;
1672
- readonly distance?: VectorDistance;
1673
- /** The column's pgvector type. Defaults to `vector`. */
1674
- readonly type?: "vector" | "halfvec";
1675
- /**
1676
- * The primary key column `db.$search({ score: true })` merges by.
1677
- * Defaults to `id`.
1678
- */
1679
- readonly key?: string;
1680
- /**
1681
- * Fuses a full-text ranking over a `tsvector` column with the vector
1682
- * ranking (reciprocal rank fusion), for `db.$search({ text })`.
1683
- */
1684
- readonly hybrid?: {
1685
- readonly tsvector: string;
1686
- /** The query's text search configuration. Defaults to `simple`. */
1687
- readonly config?: string;
1688
- /** The RRF constant. Defaults to 60. */
1689
- readonly k?: number;
1690
- };
1691
- /**
1692
- * A SQL expression over the row `t` the score is multiplied by, such as
1693
- * `t.priority`.
1694
- */
1695
- readonly boost?: string;
1696
- /** Columns `db.$search({ filter })` narrows before ranking. */
1697
- readonly prefilter?: readonly string[];
1698
- /**
1699
- * A SQL condition over the row `t` every candidate must meet, applied
1700
- * before ranking: ranges, a parent row, such as `t.expires_at > now() and
1701
- * exists (select 1 from public.folders f where f.id = t.folder_id and not
1702
- * f.disabled)`.
1703
- */
1704
- readonly predicate?: string;
1705
- /** How `boost` combines with the score: `multiply` (default) or `add`. */
1706
- readonly boostMode?: "multiply" | "add";
1707
- /**
1708
- * A SQL `order by` list over the row `t` that breaks score ties, such as
1709
- * `t.created_at desc`.
1710
- */
1711
- readonly order?: string;
1712
- };
1713
- //#endregion
1714
- //#region src/config/types/entitlements.d.ts
1715
- interface EntitlementsConfig {
1716
- /**
1717
- * `table.column` (or `schema.table.column`) holding each tenant's Stripe
1718
- * customer id, read by the `entitlements` SQL module. Required without the
1719
- * `organizations` module; with it, defaults to the `stripe_customer_id`
1720
- * column that module adds.
1721
- */
1722
- readonly customer?: string;
1723
- /** The tenant id column of that table. Defaults to `id`. */
1724
- readonly key?: string;
1725
- /**
1726
- * Where `has_entitlement` and `feature_claims` read memberships from.
1727
- * `"provider"` calls the authorization provider's `memberIds` and
1728
- * `memberIdsFor` functions; `"tenant"` reads `better_supabase.memberships`.
1729
- * Defaults to `"provider"` when `authorization` is set, else `"tenant"`.
1730
- */
1731
- readonly memberships?: "tenant" | "provider";
1732
- /**
1733
- * Where each tenant's entitlements come from. `"stripe-sync"` (the default)
1734
- * reads the Stripe Sync Engine's `stripe.active_entitlements` through
1735
- * `customer`. `{ plans }` reads a plan catalog: the tenant's active
1736
- * subscription and the features its plan includes. `"custom"` leaves
1737
- * `better_supabase.tenant_entitlements(tenant)` to you; the module writes the
1738
- * checks and the claim over it.
1739
- */
1740
- readonly source?: "stripe-sync" | "custom" | EntitlementPlansSource;
1741
- /**
1742
- * The shape of the features claim `feature_claims` writes, which every token
1743
- * carries. `false` writes `{}` (check entitlements in SQL with
1744
- * `has_entitlement` only); `maxTenants` keeps at most that many tenants;
1745
- * `keys` writes short codes instead of the feature keys. Pass the same `keys`
1746
- * to `hasEntitlement`.
1747
- */
1748
- readonly claim?: false | {
1749
- readonly maxTenants?: number;
1750
- readonly keys?: Readonly<Record<string, string>>;
1751
- };
1752
- }
1753
- /** `entitlements.source.plans`: a plan catalog in your own tables. */
1754
- interface EntitlementPlansSource {
1755
- readonly plans: {
1756
- readonly subscriptions: {
1757
- /** `table` or `schema.table`. */
1758
- readonly table: string;
1759
- /** The tenant id column. */
1760
- readonly tenant: string;
1761
- /** The plan key column. */
1762
- readonly plan: string;
1763
- /** A status column; with it, only rows in `activeStatuses` count. */
1764
- readonly status?: string;
1765
- /** Defaults to `["active", "trialing"]`. */
1766
- readonly activeStatuses?: readonly string[];
1767
- };
1768
- readonly features: {
1769
- /** `table` or `schema.table`. */
1770
- readonly table: string;
1771
- /** The plan key column. */
1772
- readonly plan: string;
1773
- /** The feature key column: what `has_entitlement` and the claim name. */
1774
- readonly feature: string;
1775
- /** A boolean column; with it, only included features count. */
1776
- readonly included?: string;
1777
- /**
1778
- * A column with the feature's value (a number, text or jsonb), such as a
1779
- * limit, that `tenant_entitlement_value` returns.
1780
- */
1781
- readonly value?: string;
1782
- };
1783
- };
1784
- }
1785
- //#endregion
1786
- //#region src/config/types/groups.d.ts
1787
- interface LegacyBlockKeys {
1788
- readonly mode?: unknown;
1789
- readonly scope?: unknown;
1790
- readonly entities?: unknown;
1791
- readonly hooks?: unknown;
1792
- }
1793
- /**
1794
- * One `blocks.<name>` entry as the config writes it: the block settings with
1795
- * `ownership`, `owner`, `names` and `callbacks`.
1796
- */
1797
- type BlockInput<T extends LegacyBlockKeys> = Omit<T, keyof LegacyBlockKeys> & {
1798
- /**
1799
- * Who owns the block's tables: `managed` (better-supabase writes them, the
1800
- * default) or `custom` (your functions behind the block's contract). A block
1801
- * leaves alone every table your schema already has, mapped through `tables`
1802
- * and `columns`.
1803
- */
1804
- readonly ownership?: T["mode"];
1805
- /**
1806
- * Who the block's rows belong to. Defaults to `database.sql.owner`, then
1807
- * `tenant`.
1808
- */
1809
- readonly owner?: T["scope"];
1810
- /** New names for the block's entities. */
1811
- readonly names?: T["entities"];
1812
- /**
1813
- * The app's optional `before_*` and `after_*` functions the block calls when
1814
- * they exist, e.g. `after_organization_create(organization, user)`.
1815
- */
1816
- readonly callbacks?: T["hooks"];
1817
- };
1818
- /**
1819
- * `blocks` keyed by instance, as the config writes it: a block name installs
1820
- * that block, and any other key names an instance with `block`.
1821
- */
1822
- type BlocksInput = { readonly [M in BlockName]?: BlockInput<BlockConfigOf<M>>; } & {
1823
- readonly [instance: string]: NamedInstance | undefined;
1824
- };
1825
- /** One `tables.<name>` entry: an app table with `owner`. */
1826
- type AppTableInput = Omit<AppTableConfig, "scope"> & {
1827
- /**
1828
- * Who reaches a row. `inherit` (the default) follows `database.sql.owner`;
1829
- * `user` keeps rows per user, and `none` lets signed-in users read every row
1830
- * while only the service role writes.
1831
- */
1832
- readonly owner?: AppTableConfig["scope"];
1833
- };
1834
- type AppTablesInput = Readonly<Record<string, AppTableInput>>;
1835
- /** `database.sql`: SQL-wide settings with `owner`. */
1836
- type SqlInput = Omit<SqlConfig, "scope"> & {
1837
- /**
1838
- * Who a block's rows belong to, unless `blocks.<name>.owner` sets its own:
1839
- * `tenant` (the default), `user` or `none`.
1840
- */
1841
- readonly owner?: SqlConfig["scope"];
1842
- };
1843
- /** Where the active organization of a request comes from. */
1844
- interface OrganizationConfig {
1845
- /**
1846
- * Top-level claim holding the active organization id. Defaults to
1847
- * `tenant_id`.
1848
- */
1849
- readonly claim?: string;
1850
- /**
1851
- * The column holding the organization id on organization tables, which the
1852
- * `memberships` extension scopes and fills. Defaults to `organization_id`, or
1853
- * `<name>_id` when `blocks.memberships.names.organization` renames it.
1854
- * Setting it without the `memberships` block turns the extension on for an
1855
- * app's own tenancy.
1856
- */
1857
- readonly column?: string;
1858
- /**
1859
- * A request without an organization on an organization table: `skip`
1860
- * (default) leaves it to RLS, `error` fails it with `forbidden`.
1861
- */
1862
- readonly onMissing?: "error" | "skip";
1863
- /**
1864
- * The request header an app's resolver reads the organization from; the API
1865
- * spec documents it on organization tables.
1866
- */
1867
- readonly header?: string;
1868
- }
1869
- /** The database: where it is read from, its SQL and what it exposes. */
1870
- interface DatabaseConfig {
1871
- readonly source?: SourceConfig;
1872
- /** Postgres schemas to generate. Defaults to `['public']`. */
1873
- readonly schemas?: readonly string[];
1874
- /**
1875
- * SQL-wide settings: the workflow, paths, and the `schema`, `api` and `owner`
1876
- * every block inherits.
1877
- */
1878
- readonly sql?: SqlInput;
1879
- readonly seed?: SeedConfig;
1880
- /**
1881
- * Data API grants, keyed by `table` or `schema.table`, and function `execute`
1882
- * grants, keyed by `name(argument types)` or `schema.name(argument types)`.
1883
- */
1884
- readonly expose?: Readonly<Record<string, ExposeConfig>>;
1885
- readonly buckets?: Readonly<Record<string, BucketConfig>>;
1886
- readonly realtime?: RealtimeConfig;
1887
- /**
1888
- * Realtime topic templates: `{ notifications:
1889
- * 'organization:{organizationId}:notifications' }`.
1890
- */
1891
- readonly topics?: Readonly<Record<string, string>>;
1892
- /**
1893
- * Embedding columns, keyed by `table` or `schema.table`. The `vector-search`
1894
- * block writes `search_<table>(query, k)` for each.
1895
- */
1896
- readonly vectorSearch?: Readonly<Record<string, VectorSearchConfig>>;
1897
- }
1898
- /** Who the caller is: the organization, claims and authorization. */
1899
- interface AuthConfig {
1900
- readonly organization?: OrganizationConfig;
1901
- /** Claim names shared by the SQL, codegen and the runtime. */
1902
- readonly claims?: Omit<ClaimsConfig, "tenant">;
1903
- /**
1904
- * An authorization system the blocks, policies and doctor delegate to: the
1905
- * `provider` access model, `entitlements.memberships` and the hook and policy
1906
- * checks.
1907
- */
1908
- readonly authorization?: AuthorizationProvider;
1909
- readonly entitlements?: EntitlementsConfig;
1910
- }
1911
- /** What `better-supabase gen` writes and how. */
1912
- interface GenGroupConfig extends GenConfig {
1913
- /**
1914
- * Main generated module. Defaults to `src/lib/supabase/generated.ts`;
1915
- * `database.types.ts` is written next to it.
1916
- */
1917
- readonly output?: string;
1918
- /** Casing of generated models and returned rows. Defaults to `'snake'`. */
1919
- readonly casing?: Casing;
1920
- /**
1921
- * PostgREST major version, written to `__InternalSupabase` in
1922
- * `database.types.ts`. Defaults to `'13'`.
1923
- */
1924
- readonly postgrestVersion?: string;
1925
- /**
1926
- * Write one `records/<type>.ts` next to `output` per record type that an
1927
- * installed block binds to (`defineRecordType`). Defaults to `true`.
1928
- */
1929
- readonly recordTypes?: boolean;
1930
- /**
1931
- * Write `hooks.ts` next to `output`: `defineDataHooks` from this framework's
1932
- * entry, once per block instance and table (`useTickets`, `useTicket`).
1933
- * Defaults to `react` when the adapters include `next`, `react` or `expo`,
1934
- * and to `false` otherwise.
1935
- */
1936
- readonly hooks?: DataHooksFramework | false;
1937
- /** Overrides per generated table, keyed by `table` or `schema.table`. */
1938
- readonly tables?: Readonly<Record<string, TableConfig>>;
1939
- /** Types for jsonb columns, keyed by `table.column`. */
1940
- readonly json?: Readonly<Record<string, JsonTypeConfig>>;
1941
- readonly codecs?: CodecsConfig;
1942
- readonly relations?: RelationsConfig;
1943
- /**
1944
- * Columns that must not be read by accident (`table.column` or
1945
- * `schema.table.column`, database names), for the `noSensitiveSelect` rule.
1946
- */
1947
- readonly sensitive?: readonly string[];
1948
- /**
1949
- * Text columns that hold an object path, keyed by `table.column` or
1950
- * `schema.table.column`, with the bucket as the value (a `database.buckets`
1951
- * key or a bucket id).
1952
- */
1953
- readonly storagePaths?: Readonly<Record<string, string>>;
1954
- /** Function results `gen` may type as not null, keyed by function name. */
1955
- readonly functions?: Readonly<Record<string, FunctionConfig>>;
1956
- readonly generators?: readonly Generator[];
1957
- /**
1958
- * Modules that export `defineReadSet` results, compiled to functions in the
1959
- * `read-sets` block.
1960
- */
1961
- readonly readSets?: readonly string[];
1962
- }
1963
- /** The API documents `better-supabase spec emit` writes. */
1964
- interface ApiConfig {
1965
- /** @deprecated Use `specs`; `openapi.entry` and `openapi.output` map onto it. */
1966
- readonly openapi?: OpenApiConfig;
1967
- /** The documents `spec emit` writes (OpenAPI, AsyncAPI, Arazzo). */
1968
- readonly specs?: SpecsConfig;
1969
- }
1970
- /** Project tooling: doctor, env files, keys and skills. */
1971
- interface ToolingConfig {
1972
- readonly doctor?: DoctorConfig;
1973
- readonly env?: EnvFileConfig;
1974
- readonly keys?: KeysConfig;
1975
- readonly skills?: SkillsConfig;
1976
- }
1977
- /** `better-supabase.config.ts`, grouped by what each key configures. */
1978
- interface BetterSupabaseConfig {
1979
- readonly $schema?: string;
1980
- /**
1981
- * A named preset (`saas`, `crm`, ...), or a preset object: the conventions
1982
- * that differ from the defaults and the blocks. It expands into `blocks`,
1983
- * with the blocks they require, and the conventions it sets; the keys you set
1984
- * win.
1985
- */
1986
- readonly preset?: PresetName | (string & {}) | PresetSpec;
1987
- readonly database?: DatabaseConfig;
1988
- readonly auth?: AuthConfig;
1989
- /**
1990
- * The app's subject types: the entities blocks attach tags, comments, fields
1991
- * and ranks to, keyed by type name. A table the app owns becomes a subject
1992
- * with an `@bsb subject` tag in its table comment (ADR 0102).
1993
- */
1994
- readonly subjects?: SubjectsConfig;
1995
- /**
1996
- * The blocks to install and keep in sync: a list of names, or an object keyed
1997
- * by block name whose values set each block's ownership, names and options.
1998
- */
1999
- readonly blocks?: readonly string[] | BlocksInput;
2000
- /** The framework and runtime adapters `init` and `add` wrote. */
2001
- readonly adapters?: readonly IntegrationName[];
2002
- readonly gen?: GenGroupConfig;
2003
- readonly api?: ApiConfig;
2004
- readonly tooling?: ToolingConfig;
2005
- /**
2006
- * Overrides per environment, keyed by name. The CLI applies the block for
2007
- * `--env <name>`, else `$BETTER_SUPABASE_ENV`, else `ci` when `$CI` is set.
2008
- * Objects merge into the config; arrays and other values replace.
2009
- */
2010
- readonly $env?: Readonly<Record<string, EnvironmentConfig>>;
2011
- /** Shorthand for `$env.development`. */
2012
- readonly $development?: EnvironmentConfig;
2013
- /** Shorthand for `$env.production`. */
2014
- readonly $production?: EnvironmentConfig;
2015
- /** Shorthand for `$env.test`. */
2016
- readonly $test?: EnvironmentConfig;
2017
- /** Shorthand for `$env.ci`, which the CLI picks when `$CI` is set. */
2018
- readonly $ci?: EnvironmentConfig;
2019
- }
2020
- /** The keys an environment block may override. */
2021
- type EnvironmentConfig = Omit<BetterSupabaseConfig, "$schema" | "$env" | "$development" | "$production" | "$test" | "$ci" | "preset">;
2022
- //#endregion
2023
- //#region src/config/types/config.d.ts
2024
- /** The frameworks `gen.hooks` writes data hooks for. */
2025
- type DataHooksFramework = "react" | "vue" | "svelte" | "solid";
2026
- /**
2027
- * The config with every key at the top level, as `flattenConfig` returns it and
2028
- * `resolveConfig` reads it. Apps write the grouped `BetterSupabaseConfig`.
2029
- */
2030
- interface FlatConfig {
2031
- readonly $schema?: string;
2032
- readonly source?: SourceConfig;
2033
- /** Postgres schemas to generate. Defaults to `['public']`. */
2034
- readonly schemas?: readonly string[];
2035
- /** Casing of generated models and returned rows. Defaults to `'snake'`. */
2036
- readonly casing?: Casing;
2037
- readonly tables?: Readonly<Record<string, TableConfig>>;
2038
- /**
2039
- * Main generated module. Defaults to `src/lib/supabase/generated.ts`;
2040
- * `database.types.ts` is written next to it.
2041
- */
2042
- readonly output?: string;
2043
- /**
2044
- * PostgREST major version, written to `__InternalSupabase` in
2045
- * `database.types.ts` so `createClient` picks matching behavior. Defaults to
2046
- * `'13'`.
2047
- */
2048
- readonly postgrestVersion?: string;
2049
- /**
2050
- * Write one `records/<type>.ts` next to `output` per record type that an
2051
- * installed block binds to (`defineRecordType`). Defaults to `true`.
2052
- */
2053
- readonly recordTypes?: boolean;
2054
- /**
2055
- * Write `hooks.ts` next to `output`: `defineDataHooks` from this framework's
2056
- * entry, once per block instance and table (`useTickets`, `useTicket`).
2057
- * Defaults to `react` when the adapters include `next`, `react` or `expo`,
2058
- * and to `false` otherwise.
2059
- */
2060
- readonly hooks?: DataHooksFramework | false;
2061
- /** Types for jsonb columns, keyed by `table.column`. */
2062
- readonly json?: Readonly<Record<string, JsonTypeConfig>>;
2063
- readonly codecs?: CodecsConfig;
2064
- readonly relations?: RelationsConfig;
2065
- /**
2066
- * Columns that must not be read by accident (`table.column` or
2067
- * `schema.table.column`, database names), for the `noSensitiveSelect` rule.
2068
- */
2069
- readonly sensitive?: readonly string[];
2070
- /**
2071
- * Text columns that hold an object path, keyed by `table.column` or
2072
- * `schema.table.column` (database names), with the bucket as the value (a
2073
- * `buckets` key or a bucket id). Generated rows type them as
2074
- * `StoragePath<'bucket-id'>`.
2075
- */
2076
- readonly storagePaths?: Readonly<Record<string, string>>;
2077
- /**
2078
- * Function results `gen` may type as not null, keyed by function name.
2079
- * Results are `| null` by default, since Postgres can't promise a function
2080
- * returns a value. `notNull: true` covers the whole result (each element of a
2081
- * set, each column of `returns table`); a list names the `returns table`
2082
- * columns that are never null.
2083
- */
2084
- readonly functions?: Readonly<Record<string, FunctionConfig>>;
2085
- /**
2086
- * Data API grants, keyed by `table` or `schema.table`, and function `execute`
2087
- * grants, keyed by `name(argument types)` or `schema.name(argument types)`. A
2088
- * project with default privileges turned off grants new tables to no Data API
2089
- * role; the `grants` SQL module writes these as the complete privilege set
2090
- * (it revokes what is not listed), and doctor (BS106) checks them. Tables not
2091
- * listed need `select, insert, update, delete` for `authenticated` (`select`
2092
- * for views).
2093
- */
2094
- readonly expose?: Readonly<Record<string, ExposeConfig>>;
2095
- /**
2096
- * Modules that export `defineReadSet` results. `gen` compiles each set to a
2097
- * function in the `read-sets` SQL module. Node imports them, so relative
2098
- * imports need their `.ts` extension.
2099
- */
2100
- readonly readSets?: readonly string[];
2101
- readonly generators?: readonly Generator[];
2102
- /**
2103
- * `auth.organization` without its claim (that is `claims.tenant`): the
2104
- * organization column and how the `memberships` extension resolves it.
2105
- */
2106
- readonly organization?: Omit<OrganizationConfig, "claim">;
2107
- readonly claims?: ClaimsConfig;
2108
- readonly buckets?: Readonly<Record<string, BucketConfig>>;
2109
- /**
2110
- * Realtime topic templates: `{ notifications:
2111
- * 'organization:{organizationId}:notifications' }`.
2112
- */
2113
- readonly topics?: Readonly<Record<string, string>>;
2114
- readonly realtime?: RealtimeConfig;
2115
- readonly entitlements?: EntitlementsConfig;
2116
- /**
2117
- * An authorization system the SQL modules, policies and doctor delegate to:
2118
- * the `provider` access model, `entitlements.memberships` and the hook and
2119
- * policy checks.
2120
- */
2121
- readonly authorization?: AuthorizationProvider;
2122
- /**
2123
- * Embedding columns, keyed by `table` or `schema.table`. The `vector-search`
2124
- * SQL module writes `search_<table>(query, k)` for each, which
2125
- * `db.$search(table, { vector, k })` calls.
2126
- */
2127
- readonly vectorSearch?: Readonly<Record<string, VectorSearchConfig>>;
2128
- /**
2129
- * The app's subject types: the entities blocks attach tags, comments, fields
2130
- * and ranks to. Subject-bound SQL modules read this registry, the `subjects`
2131
- * module writes `subject_title`, `subject_url` and `can_subject` from it, and
2132
- * `gen` types `SubjectType` from its keys.
2133
- */
2134
- readonly subjects?: SubjectsConfig;
2135
- /**
2136
- * A named preset (`saas`, `crm`, ...), or a preset object: the conventions
2137
- * that differ from the defaults and the blocks. It expands into `blocks`,
2138
- * with the blocks they require, and the conventions it sets; the keys you set
2139
- * win.
2140
- */
2141
- readonly preset?: PresetName | (string & {}) | PresetSpec;
2142
- /**
2143
- * The blocks to install and keep in sync (`better-supabase add`): a list of
2144
- * names, or an object keyed by block name whose values set each block's mode,
2145
- * schema, table and column names, permission keys and options. The foundation
2146
- * blocks (`tenant`, `access`, `updated-at`, `rls-guard`, ...) are configured
2147
- * here too.
2148
- */
2149
- readonly blocks?: readonly string[] | BlocksConfig;
2150
- /**
2151
- * Tables the app owns, keyed by name, created in `public` by `better-supabase
2152
- * upgrade` with an `id`, the scope column, timestamps, row level security and
2153
- * policies for the scope. Columns reference each other, `auth.users` or a
2154
- * block's logical table. ADR 0040.
2155
- */
2156
- readonly appTables?: AppTablesConfig;
2157
- /**
2158
- * SQL-wide settings: the workflow, paths, and the `schema` and `api` every
2159
- * block inherits.
2160
- */
2161
- readonly sql?: SqlConfig;
2162
- readonly seed?: SeedConfig;
2163
- /** @deprecated Use `specs`; `openapi.entry` and `openapi.output` map onto it. */
2164
- readonly openapi?: OpenApiConfig;
2165
- /**
2166
- * The documents `better-supabase spec emit` writes (OpenAPI, AsyncAPI,
2167
- * Arazzo).
2168
- */
2169
- readonly specs?: SpecsConfig;
2170
- readonly doctor?: DoctorConfig;
2171
- /** What `better-supabase gen` runs. */
2172
- readonly gen?: GenConfig;
2173
- readonly env?: EnvFileConfig;
2174
- /**
2175
- * The integrations `init` and `add` wrote; `add` without a name sets up the
2176
- * ones that have no files yet.
2177
- */
2178
- readonly integrations?: readonly IntegrationName[];
2179
- readonly skills?: SkillsConfig;
2180
- readonly keys?: KeysConfig;
2181
- }
2182
- /** The config with defaults applied. */
2183
- interface ResolvedConfig {
2184
- readonly root: string;
2185
- readonly source: SourceConfig;
2186
- readonly schemas: readonly string[];
2187
- readonly casing: Casing;
2188
- readonly tables: Readonly<Record<string, TableConfig>>;
2189
- readonly output: string;
2190
- /** `database.types.ts` next to `output`. */
2191
- readonly databaseTypesOutput: string;
2192
- readonly postgrestVersion: string;
2193
- readonly recordTypes: boolean;
2194
- readonly hooks: DataHooksFramework | false;
2195
- readonly json: Readonly<Record<string, JsonTypeConfig>>;
2196
- readonly codecs: Required<CodecsConfig>;
2197
- readonly relations: Required<RelationsConfig>;
2198
- readonly sensitive: readonly string[];
2199
- readonly storagePaths: Readonly<Record<string, string>>;
2200
- readonly functions: Readonly<Record<string, FunctionConfig>>;
2201
- /** The table entries of `expose`. */
2202
- readonly expose: Readonly<Record<string, ResolvedExpose>>;
2203
- /** The function entries of `expose`: the roles that may execute each one. */
2204
- readonly exposeFunctions: Readonly<Record<string, readonly ExposeRole[]>>;
2205
- readonly readSets: readonly string[];
2206
- readonly generators: readonly Generator[];
2207
- /**
2208
- * The repository extensions of the installed blocks and the columns they
2209
- * manage; `gen` writes them as table flags.
2210
- */
2211
- readonly extensions: ResolvedExtensions;
2212
- readonly claims: Required<ClaimsConfig>;
2213
- readonly buckets: Readonly<Record<string, BucketConfig>>;
2214
- readonly entitlements: {
2215
- /** Unset without `entitlements.customer`. */
2216
- readonly table?: string;
2217
- readonly column?: string;
2218
- readonly key: string;
2219
- readonly memberships: "tenant" | "provider";
2220
- readonly source: NonNullable<EntitlementsConfig["source"]>;
2221
- readonly claim?: NonNullable<EntitlementsConfig["claim"]>;
2222
- };
2223
- readonly authorization?: AuthorizationProvider;
2224
- readonly vectorSearch: readonly ({
2225
- readonly table: string;
2226
- readonly column: string;
2227
- readonly distance: VectorDistance;
2228
- } & Omit<Exclude<VectorSearchConfig, string>, "column" | "distance">)[];
2229
- readonly subjects: SubjectsConfig;
2230
- readonly topics: Readonly<Record<string, string>>;
2231
- readonly realtime: Required<Omit<RealtimeConfig, "policies">> & {
2232
- readonly policies?: TopicPoliciesConfig;
2233
- };
2234
- /**
2235
- * The `preset` the config started from, as written; `blocks` already holds it
2236
- * expanded.
2237
- */
2238
- readonly preset?: string | PresetSpec;
2239
- /** `blocks` with `sql.schema` and `sql.api` applied, keyed by block name. */
2240
- readonly blocks: AnyBlocksConfig;
2241
- /** The installed blocks, in config order, each once. */
2242
- readonly blockNames: readonly string[];
2243
- /** Every install of a block, keyed by its key in `blocks`. */
2244
- readonly instances: Readonly<Record<string, ResolvedInstance>>;
2245
- /** `appTables`, checked; empty without any. */
2246
- readonly appTables: AppTablesConfig;
2247
- readonly sql: ResolvedSqlConfig;
2248
- readonly seed: Required<SeedConfig>;
2249
- readonly openapi: Required<OpenApiConfig>;
2250
- readonly specs: {
2251
- readonly entry: string;
2252
- readonly outputs: readonly SpecOutputConfig[];
2253
- readonly failOn: NonNullable<SpecsConfig["failOn"]>;
2254
- readonly manifest?: string;
2255
- };
2256
- readonly doctor: Required<Omit<DoctorConfig, "claimsLimit" | "output" | "migrationSafety">> & Pick<DoctorConfig, "claimsLimit" | "output" | "migrationSafety">;
2257
- /**
2258
- * `tasks` stays unset without a list, so `gen` picks the steps the project
2259
- * uses.
2260
- */
2261
- readonly gen: GenConfig;
2262
- readonly env: {
2263
- readonly output: string;
2264
- readonly prefix?: string;
2265
- };
2266
- readonly integrations: readonly IntegrationName[];
2267
- readonly skills: SkillsConfig;
2268
- readonly keys: KeysConfig;
2269
- /** The environment block the CLI applied, when one was active. */
2270
- readonly environment?: string;
2271
- }
2272
- /**
2273
- * The columns the repository extensions of the installed blocks manage, by
2274
- * extension; an extension whose block is not installed is `undefined`.
2275
- */
2276
- interface ResolvedExtensions {
2277
- /** `updated-at`: `blocks["updated-at"].options`. */
2278
- readonly timestamps: {
2279
- readonly createdAt: string;
2280
- readonly updatedAt: string;
2281
- } | undefined;
2282
- /** `trash`: `blocks.trash.options.deletedAt`. */
2283
- readonly softDelete: {
2284
- readonly column: string;
2285
- } | undefined;
2286
- /**
2287
- * `memberships`, or `auth.organization.column` without it: the organization
2288
- * column and how a request's organization is resolved.
2289
- */
2290
- readonly tenant: {
2291
- readonly column: string;
2292
- readonly onMissing?: "error" | "skip";
2293
- readonly header?: string;
2294
- } | undefined;
2295
- /** `created-by`: `blocks["created-by"].options`. */
2296
- readonly actor: {
2297
- readonly createdBy: string;
2298
- readonly updatedBy: string;
2299
- readonly impersonatedBy: string;
2300
- } | undefined;
2301
- }
2302
- //#endregion
2303
- //#region src/config/types/codegen.d.ts
2304
- /**
2305
- * Where codegen reads the database from. Without any of these, `$DATABASE_URL`,
2306
- * `$SUPABASE_DB_URL` and then the local stack (`supabase start`) are used.
2307
- */
2308
- interface SourceConfig {
2309
- /** Postgres connection string. */
2310
- readonly dbUrl?: string;
2311
- /**
2312
- * Hosted project ref. Read through the Management API's read-only SQL
2313
- * endpoint, so no database password is needed.
2314
- */
2315
- readonly projectRef?: string;
2316
- /**
2317
- * Management API token for `projectRef`. Defaults to
2318
- * `$SUPABASE_ACCESS_TOKEN`; prefer the env var over committing a token.
2319
- */
2320
- readonly accessToken?: string;
2321
- /**
2322
- * Read a saved `better-supabase gen --save-snapshot` snapshot instead of
2323
- * connecting.
2324
- */
2325
- readonly snapshot?: string;
2326
- /**
2327
- * Read a Supabase Lite project's schema the way Lite runs it, from `[db]
2328
- * driver` in `supabase/config.toml`. On by default when that key is present;
2329
- * `false` reads the database like any other project.
2330
- */
2331
- readonly lite?: boolean;
2332
- }
2333
- /**
2334
- * A JSON Schema object, or a Standard JSON Schema value (zod 4, valibot,
2335
- * arktype, ...) that can produce one.
2336
- */
2337
- type JsonSchemaSource = Readonly<Record<string, unknown>> | {
2338
- readonly "~standard": {
2339
- readonly jsonSchema: {
2340
- readonly input: (options: {
2341
- readonly target: string;
2342
- }) => Record<string, unknown>;
2343
- };
2344
- };
2345
- };
2346
- type JsonTypeConfig = ({
2347
- readonly import: string;
2348
- } | {
2349
- readonly type: string;
2350
- }) & {
2351
- /**
2352
- * Enforced in the database by `better-supabase add jsonb-schemas`
2353
- * (pg_jsonschema).
2354
- */
2355
- readonly schema?: JsonSchemaSource;
2356
- };
2357
- interface TableConfig {
2358
- readonly casing?: Casing;
2359
- /** Leave the table out of the generated models. */
2360
- readonly exclude?: boolean;
2361
- /**
2362
- * Keep the table off the Data API on purpose: only `service_role` reaches it.
2363
- * The models are still generated for admin clients, and doctor (BS106) checks
2364
- * that `anon` and `authenticated` have no grants instead of requiring them.
2365
- */
2366
- readonly serviceRole?: boolean;
2367
- /** Rename generated relations: `{ primaryContact: 'contact' }`. */
2368
- readonly relations?: Readonly<Record<string, string>>;
2369
- /**
2370
- * Database names of not-null columns an insert may leave out because the
2371
- * database fills them, for example from a `before insert` trigger. `gen`
2372
- * makes them optional in `InsertOf` and the insert validators.
2373
- */
2374
- readonly insertOptional?: readonly string[];
2375
- }
2376
- interface FunctionConfig {
2377
- /**
2378
- * `true`, or the `returns table` columns (database names) that are never
2379
- * null.
2380
- */
2381
- readonly notNull?: true | readonly string[];
2382
- }
2383
- /** Claim names shared by the SQL modules, codegen and the runtime defaults. */
2384
- interface ClaimsConfig {
2385
- /** Top-level claim holding the active tenant id. Defaults to `tenant_id`. */
2386
- readonly tenant?: string;
2387
- /**
2388
- * `scope` of the tenant entries `membership_claims()` writes. Defaults to
2389
- * `tenant`.
2390
- */
2391
- readonly scope?: string;
2392
- /**
2393
- * Claim holding plan features per tenant (`{ [tenantId]: string[] }`).
2394
- * Defaults to `features`.
2395
- */
2396
- readonly features?: string;
2397
- /**
2398
- * Claim the memberships hook (`membership_claims()` or the provider's)
2399
- * writes. Defaults to `memberships`.
2400
- */
2401
- readonly memberships?: string;
2402
- }
2403
- /**
2404
- * Runtime types for columns whose JSON form loses information. Defaults match
2405
- * `supabase gen types`: timestamps as ISO strings, `int8` and `numeric` as
2406
- * numbers.
2407
- */
2408
- interface CodecsConfig {
2409
- /**
2410
- * `'instant'` decodes `timestamptz` columns to `Temporal.Instant` and
2411
- * `timestamp` columns to `Temporal.PlainDateTime`. `'utc'` keeps
2412
- * `timestamptz` columns as strings, always in UTC as ISO 8601 with a `Z` and
2413
- * every fraction digit (`2026-10-21T05:10:00.123456Z`).
2414
- */
2415
- readonly timestamptz?: "string" | "instant" | "utc";
2416
- /** `'bigint'` or `'string'` read `int8` exactly (above 2^53). */
2417
- readonly int8?: "number" | "string" | "bigint";
2418
- /** `'string'` reads `numeric` exactly. */
2419
- readonly numeric?: "number" | "string";
2420
- }
2421
- interface GeneratedFile {
2422
- /** Path relative to the project root. */
2423
- readonly path: string;
2424
- readonly contents: string;
2425
- /**
2426
- * The file exports `validators` (`TableValidators`): `gen` imports them into
2427
- * the generated schema and installs `validation`, so writes are checked.
2428
- */
2429
- readonly validators?: boolean;
2430
- }
2431
- interface GeneratorInput {
2432
- readonly meta: SchemaMeta;
2433
- /**
2434
- * The `@supabase/postgrest-typegen` metadata for the configured schemas, the
2435
- * same contract `supabase gen types` is built on.
2436
- */
2437
- readonly introspection: GeneratorMetadata;
2438
- /** Constraints, indexes, policies, triggers and grants typegen leaves out. */
2439
- readonly extras: SnapshotExtras;
2440
- readonly config: ResolvedConfig;
2441
- /** Absolute path of the main generated module. */
2442
- readonly output: string;
2443
- /** Import path from `from` (a generated file) to `to`, with extension. */
2444
- readonly importPath: (from: string, to: string) => string;
2445
- /**
2446
- * Where generated files import `better-supabase` runtime helpers from.
2447
- * Defaults to `better-supabase`.
2448
- */
2449
- readonly runtimeImport?: string;
2450
- /**
2451
- * The tables and enums `gen` emits, with the TypeScript type it wrote for
2452
- * each column (after `json` overrides, codecs and enum unions). Frozen.
2453
- */
2454
- readonly model: GeneratorModel;
2455
- }
2456
- interface GeneratorColumn {
2457
- /** Name in rows, after casing. */
2458
- readonly app: string;
2459
- /** Database name. */
2460
- readonly db: string;
2461
- /** TypeScript type without `| null`. */
2462
- readonly tsType: string;
2463
- readonly nullable: boolean;
2464
- /** Optional on insert. */
2465
- readonly optional: boolean;
2466
- /** Generated or identity always: never written. */
2467
- readonly readonly: boolean;
2468
- /** Enum or check-constraint values, when the column has a closed set. */
2469
- readonly values: readonly string[] | undefined;
2470
- readonly json: boolean;
2471
- }
2472
- interface GeneratorTable {
2473
- /** Key in `schema.tables` and on the client. */
2474
- readonly key: string;
2475
- readonly schema: string;
2476
- readonly name: string;
2477
- readonly casing: Casing;
2478
- readonly columns: readonly GeneratorColumn[];
2479
- }
2480
- interface GeneratorFunctionArg {
2481
- readonly name: string;
2482
- /** TypeScript type, as `$rpc` takes it. */
2483
- readonly tsType: string;
2484
- /** Has a default, so callers may leave it out. */
2485
- readonly optional: boolean;
2486
- /** Enum values, when the argument is an enum (or an array of one). */
2487
- readonly values: readonly string[] | undefined;
2488
- }
2489
- /** A function `$rpc` calls, with the types `gen` wrote for it. */
2490
- interface GeneratorFunction {
2491
- /** Name on `$rpc`. */
2492
- readonly key: string;
2493
- readonly schema: string;
2494
- readonly args: readonly GeneratorFunctionArg[];
2495
- /** TypeScript type of the result, as `$rpc` returns it. */
2496
- readonly returns: string;
2497
- readonly returnsSet: boolean;
2498
- readonly volatility: "immutable" | "stable" | "volatile";
2499
- }
2500
- /** JSON Schema (draft 2020-12) for one value. */
2501
- type GeneratorJsonSchema = Readonly<Record<string, unknown>>;
2502
- /**
2503
- * One field of a block input schema: its scalar kind with the flags and bounds
2504
- * `entitySchema` takes. It never carries a nested `schema`.
2505
- */
2506
- type GeneratorField = FieldSpec;
2507
- /** One of a block's input schemas, in the block's default names. */
2508
- interface GeneratorInputSchema {
2509
- /** The type it validates (`WorkItemInput`). */
2510
- readonly title: string;
2511
- readonly fields: Readonly<Record<string, GeneratorField>>;
2512
- /** The same schema as JSON Schema (draft 2020-12), in its wire form. */
2513
- readonly jsonSchema: GeneratorJsonSchema;
2514
- }
2515
- /**
2516
- * The inputs a block's client takes for one entity. Each is absent when the
2517
- * block declares none.
2518
- */
2519
- interface GeneratorEntitySchemas {
2520
- /** What creating one takes (`WorkItemInput`). */
2521
- readonly input?: GeneratorInputSchema;
2522
- /** What updating one takes (`WorkItemChange`). */
2523
- readonly change?: GeneratorInputSchema;
2524
- /** What listing them takes (`WorkItemListOptions`). */
2525
- readonly listFilter?: GeneratorInputSchema;
2526
- }
2527
- interface GeneratorNoun {
2528
- readonly singular: string;
2529
- readonly plural: string;
2530
- }
2531
- /** One of an installed block's entities, under the name the config gives it. */
2532
- interface GeneratorBlockEntity {
2533
- /** The entity's key in the block's manifest: its default singular noun. */
2534
- readonly key: string;
2535
- /** The block's own noun (`work_item`). */
2536
- readonly from: GeneratorNoun;
2537
- /** The noun `blocks.<name>.names` gives it (`task`). */
2538
- readonly to: GeneratorNoun;
2539
- readonly primary: boolean;
2540
- /** The table that holds it, as the SQL names it; undefined when none. */
2541
- readonly table: string | undefined;
2542
- /** `blocks.<name>.names.<entity>.url`, with column placeholders. */
2543
- readonly url: string | undefined;
2544
- readonly schemas: GeneratorEntitySchemas;
2545
- }
2546
- /** An installed block, with its final names. */
2547
- interface GeneratorBlock {
2548
- readonly name: string;
2549
- /** The schema its tables and functions live in. */
2550
- readonly schema: string;
2551
- /**
2552
- * The block's client in `blocks.generated.ts` (`tasksBlock`) and the subpath
2553
- * its default export comes from, or undefined for blocks with only SQL.
2554
- */
2555
- readonly client: {
2556
- readonly export: string;
2557
- readonly subpath: string;
2558
- } | undefined;
2559
- readonly entities: readonly GeneratorBlockEntity[];
2560
- }
2561
- interface GeneratorModel {
2562
- readonly tables: readonly GeneratorTable[];
2563
- readonly enums: readonly {
2564
- readonly schema: string;
2565
- readonly name: string;
2566
- readonly values: readonly string[];
2567
- }[];
2568
- /** The functions `$rpc` calls, one entry per overload. */
2569
- readonly functions: readonly GeneratorFunction[];
2570
- /** The installed blocks, in config order. */
2571
- readonly blocks: readonly GeneratorBlock[];
2572
- }
2573
- /**
2574
- * Codegen extension point. First-party generators: `zod()`, `valibot()`,
2575
- * `jsonSchema()`, `standardSchema()`. Prove custom ones with `testGenerator`.
2576
- */
2577
- interface Generator {
2578
- /** The generator contract it targets. `gen` refuses versions it doesn't know. */
2579
- readonly apiVersion?: 1;
2580
- readonly name: string;
2581
- generate(input: GeneratorInput): readonly GeneratedFile[] | Promise<readonly GeneratedFile[]>;
2582
- }
2583
- interface RelationsConfig {
2584
- /**
2585
- * Type a to-one include as `| null` when the related table has row level
2586
- * security, even over a `not null` foreign key, since a policy can hide the
2587
- * related row. `required: true` on the include keeps it non-null. Defaults to
2588
- * `false`.
2589
- */
2590
- readonly nullableUnderRls?: boolean;
2591
- }
2592
- //#endregion
2593
- //#region src/config/json.d.ts
2594
- /**
2595
- * The JSON Schema document for a `json[...].schema` entry. A Standard Schema
2596
- * converts for `target` (2020-12 by default); a JSON Schema object is returned
2597
- * as it is.
2598
- */
2599
- declare function resolveJsonSchema(source: JsonSchemaSource, target?: "draft-2020-12" | "draft-07" | "openapi-3.0"): Readonly<Record<string, unknown>>;
2600
- //#endregion
2601
- //#region src/preset/resolve.d.ts
2602
- /** One block in a resolved preset, with why it is there. */
2603
- interface ResolvedPresetBlock {
2604
- readonly name: string;
2605
- readonly title: string;
2606
- readonly category: BlockCategory;
2607
- /** Whether the preset names it, rather than another block requiring it. */
2608
- readonly selected: boolean;
2609
- /** The blocks in the set that require it. */
2610
- readonly requiredBy: readonly string[];
2611
- /** "selected", or "required by comments and tags". */
2612
- readonly reason: string;
2613
- }
2614
- /** A soft integration between two blocks that are both in the set. */
2615
- interface PresetIntegration {
2616
- /** The block that works with `to`. */
2617
- readonly from: string;
2618
- readonly to: string;
2619
- }
2620
- /** Something in the preset that can't install, and why. */
2621
- interface PresetConflict {
2622
- readonly block?: string;
2623
- readonly field?: PresetFieldKey;
2624
- readonly reason: string;
2625
- }
2626
- /** What `resolvePreset` returns. */
2627
- interface ResolvedPreset {
2628
- readonly preset: Preset;
2629
- /** Every block to install, in install order; conflicting blocks are left out. */
2630
- readonly blocks: readonly ResolvedPresetBlock[];
2631
- /** The soft integrations active between blocks in the set. */
2632
- readonly integrations: readonly PresetIntegration[];
2633
- readonly conflicts: readonly PresetConflict[];
2634
- /** The manifests that cover `blocks`, for `lib/blocks.ts`. */
2635
- readonly manifests: readonly PresetCatalogManifest[];
2636
- }
2637
- /** "a", "a and b", "a, b and c". */
2638
- declare function listNames(names: readonly string[]): string;
2639
- /**
2640
- * Why `name` can't install with the preset's conventions, or undefined.
2641
- * `/create` disables a block with this reason before it is selected.
2642
- */
2643
- declare function presetBlockConflict(preset: Pick<Preset, "access" | "scope">, name: string, catalog?: PresetCatalog): string | undefined;
2644
- /**
2645
- * The full block set for a preset: the selected blocks and what they require, a
2646
- * reason per block, the soft integrations active between them, and what can't
2647
- * install. It reads the generated catalog, never the SQL renderers, so it runs
2648
- * in the browser.
2649
- */
2650
- declare function resolvePreset(preset: Preset, catalog?: PresetCatalog): ResolvedPreset;
2651
- //#endregion
2652
- //#region src/preset/config.d.ts
2653
- /** A named preset, a `/create?preset=` URL, or a preset object. */
2654
- type PresetInput = string | (Partial<Preset> & {
2655
- readonly blocks?: readonly string[];
2656
- });
2657
- /**
2658
- * Reads a named preset, a `/create?preset=<name>` URL or a preset object
2659
- * (`PresetSpec`) into a `Preset`. A preset code from 0.14 throws, naming the
2660
- * codemod that converts it.
2661
- */
2662
- declare function presetOf(input: PresetInput): Preset;
2663
- /**
2664
- * The conventions that map onto config keys; `tenantName` takes any name
2665
- * `blocks.memberships.names.organization` allows.
2666
- */
2667
- type ConfigConventions = Pick<Preset, "casing" | "idType" | "scope" | "access" | "api"> & {
2668
- readonly tenantName: string;
2669
- };
2670
- /**
2671
- * The config keys conventions set without a preset: `casing`, `sql`,
2672
- * `blocks.permissions` when the access model or id type differ from the
2673
- * defaults, and `blocks.memberships` when the tenant has another name.
2674
- */
2675
- declare function conventionConfig(conventions: ConfigConventions): Pick<FlatConfig, "casing" | "sql"> & {
2676
- readonly blocks?: {
2677
- readonly permissions?: AccessBlockConfig;
2678
- readonly memberships?: BlockConfig;
2679
- readonly "rls-guard": BlockConfig;
2680
- };
2681
- };
2682
- /**
2683
- * The config keys a resolved preset sets: its blocks and the conventions that
2684
- * differ from the defaults.
2685
- */
2686
- declare function presetConfig(resolved: ResolvedPreset): Pick<FlatConfig, "casing" | "sql" | "integrations"> & {
2687
- readonly blocks: BlocksConfig;
2688
- };
2689
- /**
2690
- * A literal config after `defineConfig`: the same type without a preset, and
2691
- * with one, every key but `blocks`, `database`, `gen` and `adapters` as
2692
- * written, those merged with the preset's.
2693
- */
2694
- type ExpandedConfig<C extends BetterSupabaseConfig> = C extends {
2695
- readonly preset: NonNullable<BetterSupabaseConfig["preset"]>;
2696
- } ? Omit<C, "blocks" | "database" | "gen" | "adapters"> & Pick<BetterSupabaseConfig, "blocks" | "database" | "gen" | "adapters"> : C;
2697
- /**
2698
- * `config` with its `preset` expanded: the preset's blocks (and what they
2699
- * require) and conventions first, then the config's own keys over them, so
2700
- * explicit config wins. A block in both keeps the preset's settings that the
2701
- * config's entry leaves unset. Expanding twice gives the same config.
2702
- */
2703
- declare function expandPreset<const C extends BetterSupabaseConfig>(config: C): ExpandedConfig<C>;
2704
- //#endregion
2705
- //#region src/config/references.d.ts
2706
- /**
2707
- * A logical table of a block the registry knows, as a column reference names
2708
- * it: `{ block: "tasks", table: "items" }`.
2709
- */
2710
- type BlockTableReference = { readonly [M in keyof BlockNameRegistry]: {
2711
- readonly block: M;
2712
- readonly table: TablesOf<M>;
2713
- }; }[keyof BlockNameRegistry];
2714
- type RolesOf<C> = C extends {
2715
- readonly blocks: {
2716
- readonly permissions: {
2717
- readonly roles: infer R extends object;
2718
- };
2719
- };
2720
- } ? keyof R & string : never;
2721
- /**
2722
- * The roles `blocks.permissions.roles` declares, or `string` when the config
2723
- * leaves them to the default list or another access model.
2724
- */
2725
- type RoleNames<C> = [RolesOf<C>] extends [never] ? string : RolesOf<C>;
2726
- type BucketsOf<C> = C extends {
2727
- readonly database: {
2728
- readonly buckets: infer B extends object;
2729
- };
2730
- } ? keyof B & string : never;
2731
- /**
2732
- * A bucket `gen.storagePaths` names: a `database.buckets` key, suggested first,
2733
- * or the id of a bucket the config doesn't declare.
2734
- */
2735
- type BucketName<C> = BucketsOf<C> | (string & {});
2736
- type RoleReferences<C> = [RolesOf<C>] extends [never] ? unknown : {
2737
- readonly blocks?: {
2738
- readonly sso?: {
2739
- readonly options?: {
2740
- readonly defaultRole?: RoleNames<C>;
2741
- readonly roleOrder?: readonly RoleNames<C>[];
2742
- };
2743
- };
2744
- readonly billing?: {
2745
- readonly options?: {
2746
- readonly seatRoles?: readonly RoleNames<C>[];
2747
- };
2748
- };
2749
- };
2750
- };
2751
- type BlocksOf<C> = C extends {
2752
- readonly blocks: infer B extends object;
2753
- } ? B extends readonly string[] ? Record<never, never> : B : Record<never, never>;
2754
- /** The instance keys a literal config declares in `blocks`. */
2755
- type InstanceNames<C> = keyof BlocksOf<C> & string;
2756
- /**
2757
- * Each named instance checked against the block it names in `block`, and every
2758
- * `uses` value against the config's instances.
2759
- */
2760
- type InstanceReferences<C> = {
2761
- readonly blocks?: { readonly [K in keyof BlocksOf<C>]?: (BlocksOf<C>[K] extends {
2762
- readonly block: infer B extends BlockName;
2763
- } ? BlockInput<BlockConfigOf<B>> : unknown) & {
2764
- readonly on?: InstanceOn;
2765
- readonly uses?: Readonly<Record<string, InstanceNames<C>>>;
2766
- }; };
2767
- };
2768
- /**
2769
- * What `defineConfig` checks a literal config against: bucket names in
2770
- * `gen.storagePaths`, the role names other blocks take from
2771
- * `blocks.permissions.roles`, and each named instance's options and `uses`.
2772
- */
2773
- type ConfigReferences<C> = {
2774
- readonly gen?: {
2775
- readonly storagePaths?: Readonly<Record<string, BucketName<C>>>;
2776
- };
2777
- } & RoleReferences<C> & InstanceReferences<C>;
2778
- //#endregion
2779
- //#region src/config/resolve.d.ts
2780
- declare const CONFIG_SCHEMA_URL = "https://unpkg.com/better-supabase/schemas/config-v1.json";
2781
- /**
2782
- * Types `better-supabase.config.ts` and returns it with its literal types. With
2783
- * `preset`, it expands the preset into `blocks` and its conventions first, and
2784
- * the keys you set win. It checks the references between keys against the
2785
- * config itself: block tables and app tables in `tables` references, the
2786
- * `database.buckets` in `gen.storagePaths`, and the `blocks.permissions.roles`
2787
- * other blocks name.
2788
- */
2789
- declare function defineConfig<const C extends BetterSupabaseConfig>(config: C & NoInfer<ConfigReferences<C>>): ExpandedConfig<C>;
2790
- /**
2791
- * The grouped config plus the app tables a Create design and `migrate
2792
- * schema-first` hand in. Tables are SQL files, so the public config has no key
2793
- * for them (ADR 0102).
2794
- */
2795
- type ResolveInput = BetterSupabaseConfig & {
2796
- readonly appTables?: AppTablesInput;
2797
- };
2798
- /** Applies defaults. Paths stay relative to `root`. */
2799
- declare function resolveConfig(input: ResolveInput, root: string): ResolvedConfig;
2800
- //#endregion
2801
- //#region src/config/groups.d.ts
2802
- type Entries = Record<string, unknown>;
2803
- type Pairs = readonly (readonly [grouped: string, flat: string])[];
2804
- /** The flat keys each group holds. `gen` and `auth` also keep their own keys. */
2805
- declare const CONFIG_GROUPS: Readonly<Record<string, readonly string[]>>;
2806
- /** Top-level keys renamed by the regrouping: the grouped name, then the flat. */
2807
- declare const RENAMED_CONFIG_KEYS: Pairs;
2808
- /** Keys renamed inside `blocks.<name>`: the grouped name, then the flat. */
2809
- declare const RENAMED_BLOCK_KEYS: Pairs;
2810
- /** A resolved block entry with the key names a config file writes. */
2811
- declare function blockEntrySource(entry: object): Entries;
2812
- /**
2813
- * The grouped config in the flat shape `resolveConfig` reads: every group's
2814
- * keys at the top level, `adapters` under its flat name, `auth.organization` as
2815
- * `claims.tenant` and `organization`, and the renamed block and app table keys
2816
- * under their flat names.
2817
- */
2818
- declare function flattenConfig(config: BetterSupabaseConfig): FlatConfig;
2819
- /** A flat config in the grouped shape: the inverse of `flattenConfig`. */
2820
- declare function groupConfig(config: FlatConfig): BetterSupabaseConfig;
2821
- /**
2822
- * Any object with the keys of a config written before 0.15, grouped: the keys
2823
- * it doesn't know stay where they are. `$env` blocks are grouped the same way.
2824
- * The 0.15 codemod uses it for JSON configs.
2825
- */
2826
- declare function groupEntries(config: object): Entries;
2827
- //#endregion
2828
- //#region src/config/block-subjects.d.ts
2829
- /**
2830
- * The entities `blocks.<module>.names` gives a new name, such as `work_item` to
2831
- * `task`, for the block's TypeScript client (`blocks.generated.ts`). Empty when
2832
- * the module renames none.
2833
- */
2834
- declare function blockEntityRenames(module: string, blocks: AnyBlocksConfig): readonly EntityRename[];
2835
- /** One installed block's entity under the name the config gives it. */
2836
- interface BlockEntity {
2837
- /** The entity's key in the block's manifest: its default singular noun. */
2838
- readonly key: string;
2839
- readonly from: EntityNoun;
2840
- readonly to: EntityNoun;
2841
- readonly primary: boolean;
2842
- /**
2843
- * The table that holds it as the SQL writes it (`tasks`, or the
2844
- * `blocks.<name>.tables` mapping), or undefined when it has none.
2845
- */
2846
- readonly table: string | undefined;
2847
- /** `blocks.<name>.names.<entity>.url`, with column placeholders. */
2848
- readonly url: string | undefined;
2849
- }
2850
- /** The entities one installed block declares, with their final names. */
2851
- declare function blockEntities(module: string, blocks: AnyBlocksConfig): readonly BlockEntity[];
2852
- /**
2853
- * The entities of every installed block that registers one (work items, deals,
2854
- * companies and people, products, employees), under their renamed type, then
2855
- * `subjects`. Throws when `subjects` already has a block's type.
2856
- */
2857
- /** The subject types one installed block registers, by renamed entity. */
2858
- declare function blockSubjectTypes(module: string, blocks: AnyBlocksConfig): readonly string[];
2859
- //#endregion
2860
- //#region src/core/claims.d.ts
2861
- declare const DEFAULT_CLAIMS: ClaimsMeta;
2862
- /**
2863
- * Where an adapter reads each claim the SQL modules and the provider's hook
2864
- * write.
2865
- */
2866
- interface ClaimPaths {
2867
- /**
2868
- * The active tenant: the top-level claim, then the same key in
2869
- * `app_metadata`.
2870
- */
2871
- readonly tenant: readonly [string, string];
2872
- /** `{ [tenantId]: string[] }` of plan features. */
2873
- readonly features: string;
2874
- /**
2875
- * The caller's memberships, a list of `{ scope, id, roles }` or a map of
2876
- * tenant id to role.
2877
- */
2878
- readonly memberships: string;
2879
- /** The `scope` of tenant entries in the memberships list. */
2880
- readonly scope: string;
2881
- }
2882
- /**
2883
- * The claim paths for `config.claims`, with defaults. For a generated schema,
2884
- * pass `claimsOf(meta)`.
2885
- */
2886
- declare function claimPaths(claims?: Partial<ClaimsMeta>): ClaimPaths;
2887
- /**
2888
- * Where the active tenant is read from: the top-level claim, then
2889
- * `app_metadata`.
2890
- */
2891
- declare function tenantClaimPaths(tenant?: string): readonly [string, string];
2892
- //#endregion
2893
- //#region src/generators/extras.d.ts
2894
- /** A schema for a function's arguments or one of a block's inputs. */
2895
- interface ExtraSchema {
2896
- /** Export name: `listTasksArgs`, `taskInput`. */
2897
- readonly name: string;
2898
- readonly title: string;
2899
- readonly description?: string;
2900
- readonly fields: Readonly<Record<string, FieldSpec>>;
2901
- }
2902
- /** What a function returns, when it is a table row or a scalar. */
2903
- interface ResultSchema {
2904
- /** Export name: `listTasksResult`. */
2905
- readonly name: string;
2906
- readonly title: string;
2907
- /** The function returns a set: the schema is an array. */
2908
- readonly set: boolean;
2909
- /** A single result may be `null`; for sets, each scalar item may be. */
2910
- readonly nullable: boolean;
2911
- readonly of: {
2912
- readonly kind: "row";
2913
- readonly table: string;
2914
- } | {
2915
- readonly kind: "scalar";
2916
- readonly scalar: ScalarKind;
2917
- };
2918
- }
2919
- interface ExtraSchemas {
2920
- readonly inputs: readonly ExtraSchema[];
2921
- readonly results: readonly ResultSchema[];
2922
- }
2923
- //#endregion
2924
- //#region src/generators/json-schema-target.d.ts
2925
- /** The JSON Schema dialects the generators and MCP emit. */
2926
- type JsonSchemaTarget = "draft-2020-12" | "draft-07" | "openapi-3.0";
2927
- //#endregion
2928
- //#region src/generators/shared.d.ts
2929
- /** What field planning reads: the metadata and the typed-jsonb config. */
2930
- interface SchemaSource {
2931
- readonly meta: SchemaMeta;
2932
- readonly config: {
2933
- readonly json: Readonly<Record<string, unknown>>;
2934
- };
2935
- readonly runtimeImport?: string;
2936
- }
2937
- interface CommentEntry {
2938
- readonly id: number;
2939
- readonly schema: string;
2940
- readonly name: string;
2941
- readonly comment: string | null;
2942
- }
2943
- /**
2944
- * The catalog parts docs read: `GeneratorInput` satisfies it. Runtime callers
2945
- * that only have `meta` (OpenAPI, MCP) pass none and get no docs.
2946
- */
2947
- interface DocsSource extends SchemaSource {
2948
- readonly introspection?: {
2949
- readonly tables: readonly CommentEntry[];
2950
- readonly views: readonly CommentEntry[];
2951
- readonly materializedViews?: readonly CommentEntry[];
2952
- readonly columns: readonly {
2953
- readonly table_id: number;
2954
- readonly name: string;
2955
- readonly comment: string | null;
2956
- readonly check: string | null;
2957
- }[];
2958
- };
2959
- readonly extras?: {
2960
- readonly tables: readonly {
2961
- readonly schema: string;
2962
- readonly name: string;
2963
- readonly checks: readonly {
2964
- readonly definition: string;
2965
- }[];
2966
- }[];
2967
- };
2968
- }
2969
- //#endregion
2970
- //#region src/generators/json-schema.d.ts
2971
- interface JsonSchemaGeneratorOptions {
2972
- /**
2973
- * Output path relative to the project root. Defaults to
2974
- * `<output>.schema.json`.
2975
- */
2976
- readonly output?: string;
2977
- /** `$id` of the document. */
2978
- readonly id?: string;
2979
- /**
2980
- * The dialect. `draft-2020-12` (the default) writes `$defs`; `draft-07` and
2981
- * `openapi-3.0` (`nullable`, `example`) write `definitions`.
2982
- */
2983
- readonly target?: JsonSchemaTarget;
2984
- /**
2985
- * Give each writable field a `title` label (from a short column comment or
2986
- * its name), for form builders that read JSON Schema.
2987
- */
2988
- readonly fieldMeta?: boolean;
2989
- }
2990
- type JsonSchema = Record<string, unknown>;
2991
- /**
2992
- * JSON Schema `$defs` for every table: `customersRow`, `customersInsert`, ...
2993
- * `target` lowers the document to draft-07 or the OpenAPI 3.0 dialect, which
2994
- * keep the schemas under `definitions`.
2995
- */
2996
- declare function buildJsonSchema(input: DocsSource, id?: string, target?: JsonSchemaTarget, extras?: ExtraSchemas): JsonSchema;
2997
- /** Writes the JSON Schema document; `createOpenApi` reuses the same `$defs`. */
2998
- declare function jsonSchema(options?: JsonSchemaGeneratorOptions): Generator;
2999
- //#endregion
3000
- //#region src/generators/factories.d.ts
3001
- interface FactoriesGeneratorOptions {
3002
- /**
3003
- * Output path relative to the project root. Defaults to
3004
- * `<output>.factories.ts`.
3005
- */
3006
- readonly output?: string;
3007
- /**
3008
- * The table keys to write factories for. Defaults to every table, block
3009
- * tables included under their final names.
3010
- */
3011
- readonly tables?: readonly string[];
3012
- /**
3013
- * Where the file imports the factory runtime from. Defaults to
3014
- * `better-supabase/testing` (under `runtimeImport`).
3015
- */
3016
- readonly testingImport?: string;
3017
- }
3018
- /**
3019
- * Test factories, one per table: `factories.customers({ name })` returns an
3020
- * insert row with valid defaults for the required columns. Defaults respect
3021
- * enums, check-constraint bounds and `StoragePath` buckets. A foreign key takes
3022
- * the parent row or its id, and a column without a safe default is a required
3023
- * input. Block entities also get a factory under their singular noun
3024
- * (`factories.task`). The file imports `better-supabase/testing`.
3025
- */
3026
- declare function factories(options?: FactoriesGeneratorOptions): Generator;
3027
- //#endregion
3028
- //#region src/generators/nuqs.d.ts
3029
- interface NuqsGeneratorOptions {
3030
- /** Output path relative to the project root. Defaults to `<output>.nuqs.ts`. */
3031
- readonly output?: string;
3032
- /**
3033
- * The table keys to write search params for (`tasks`, `customerTags`).
3034
- * Defaults to every table, block tables included under their final names.
3035
- */
3036
- readonly tables?: readonly string[];
3037
- /** The page size `limit` defaults to. Defaults to 25. */
3038
- readonly limit?: number;
3039
- }
3040
- /**
3041
- * Search-param parsers for nuqs, one set per table list: a filter for every
3042
- * column with a closed set of values, `orderBy` over the sortable columns,
3043
- * `direction`, `cursor` and `limit`, with a cache, a loader and a serializer.
3044
- * The file imports `nuqs/server`, which the app installs.
3045
- */
3046
- declare function nuqs(options?: NuqsGeneratorOptions): Generator;
3047
- //#endregion
3048
- //#region src/generators/standard-schema.d.ts
3049
- interface StandardSchemaGeneratorOptions {
3050
- /**
3051
- * Output path relative to the project root. Defaults to
3052
- * `<output>.standard.ts`.
3053
- */
3054
- readonly output?: string;
3055
- /**
3056
- * Standard Schemas for typed jsonb columns: `{ 'customers.metadata':
3057
- * './schemas.ts#metadata' }`.
3058
- */
3059
- readonly json?: Readonly<Record<string, string>>;
3060
- /**
3061
- * Also export `fieldMeta`: a label, a required flag, enum options and bounds
3062
- * for each writable field, for building forms.
3063
- */
3064
- readonly fieldMeta?: boolean;
3065
- }
3066
- /**
3067
- * Standard Schemas for every table's Row, Insert and Update shape, with no
3068
- * validation library. Each one also converts to JSON Schema (Standard JSON
3069
- * Schema), and `validators` is what the generated schema checks writes with.
3070
- */
3071
- declare function standardSchema(options?: StandardSchemaGeneratorOptions): Generator;
3072
- //#endregion
3073
- //#region src/generators/valibot.d.ts
3074
- interface ValibotGeneratorOptions {
3075
- /**
3076
- * Output path relative to the project root. Defaults to
3077
- * `<output>.valibot.ts`.
3078
- */
3079
- readonly output?: string;
3080
- /**
3081
- * Schemas for typed jsonb columns: `{ 'customers.metadata':
3082
- * './schemas.ts#metadata' }`.
3083
- */
3084
- readonly json?: Readonly<Record<string, string>>;
3085
- /**
3086
- * Also export `fieldMeta`: a label, a required flag, enum options and bounds
3087
- * for each writable field, for building forms.
3088
- */
3089
- readonly fieldMeta?: boolean;
3090
- }
3091
- /** Valibot schemas for every table's Row, Insert and Update shape. */
3092
- declare function valibot(options?: ValibotGeneratorOptions): Generator;
3093
- //#endregion
3094
- //#region src/generators/zod.d.ts
3095
- interface ZodGeneratorOptions {
3096
- /** Output path relative to the project root. Defaults to `<output>.zod.ts`. */
3097
- readonly output?: string;
3098
- /**
3099
- * Schemas for typed jsonb columns: `{ 'customers.metadata':
3100
- * './schemas.ts#metadata' }`.
3101
- */
3102
- readonly json?: Readonly<Record<string, string>>;
3103
- /**
3104
- * `classic` (the default) imports `zod` and chains methods; `mini` imports
3105
- * `zod/mini` and uses its functional API (`z.nullable(...)`, `.check(...)`),
3106
- * which tree-shakes to a smaller bundle. Both need zod 4.
3107
- */
3108
- readonly flavor?: ZodFlavor;
3109
- /**
3110
- * Also export `fieldMeta`: a label, a required flag, enum options and bounds
3111
- * for each writable field, for building forms.
3112
- */
3113
- readonly fieldMeta?: boolean;
3114
- }
3115
- type ZodFlavor = "classic" | "mini";
3116
- /**
3117
- * Zod 4 schemas for every table's Row, Insert and Update shape, for `zod` or,
3118
- * with `flavor: 'mini'`, `zod/mini`.
3119
- */
3120
- declare function zod(options?: ZodGeneratorOptions): Generator;
3121
- //#endregion
3122
- //#region src/sql/modules/entitlements-checks.d.ts
3123
- /** `entitlements.claim`: what `feature_claims` puts in the token. */
3124
- type FeatureClaimOption = false | {
3125
- /** At most this many tenants, the lowest ids first. */
3126
- readonly maxTenants?: number;
3127
- /** Short codes written instead of the feature keys: `{ exports: "x" }`. */
3128
- readonly keys?: Readonly<Record<string, string>>;
3129
- };
3130
- //#endregion
3131
- //#region src/sql/modules/entitlements-source.d.ts
3132
- /** The table holding each tenant's Stripe customer id. */
3133
- interface EntitlementsSource {
3134
- /** `table` or `schema.table`; unset uses the `organizations` module's. */
3135
- readonly table?: string;
3136
- /** Column with the Stripe customer id (`cus_...`). */
3137
- readonly column?: string;
3138
- /** Column with the tenant id. */
3139
- readonly key: string;
3140
- /**
3141
- * Where entitlements come from; the customer lookups are for `stripe-sync`
3142
- * only.
3143
- */
3144
- readonly source?: "stripe-sync" | "custom" | EntitlementPlansSource;
3145
- readonly claim?: FeatureClaimOption;
3146
- }
3147
- //#endregion
3148
- //#region src/sql/modules/grants.d.ts
3149
- /** Privileges one role gets on a table or view. */
3150
- interface TableGrant {
3151
- /** `table` or `schema.table`. */
3152
- readonly table: string;
3153
- readonly role: "anon" | "authenticated" | "service_role";
3154
- readonly privileges: readonly string[];
3155
- }
3156
- /** The roles that may execute a function. */
3157
- interface FunctionGrant {
3158
- /** `name(argument types)` or `schema.name(argument types)`. */
3159
- readonly function: string;
3160
- readonly roles: readonly ("anon" | "authenticated" | "service_role")[];
3161
- }
3162
- //#endregion
3163
- //#region src/sql/modules/vector-search.d.ts
3164
- /** An embedding column `db.$search` can query. */
3165
- interface VectorSearchTable {
3166
- /** `table` or `schema.table`. */
3167
- readonly table: string;
3168
- readonly column: string;
3169
- readonly distance: "cosine" | "l2" | "inner_product";
3170
- /** The column's type: pgvector's `vector` (default) or `halfvec`. */
3171
- readonly type?: "vector" | "halfvec";
3172
- /** The primary key column the scores function returns. Defaults to `id`. */
3173
- readonly key?: string;
3174
- /** Full-text ranking fused with the vector ranking (reciprocal rank fusion). */
3175
- readonly hybrid?: {
3176
- readonly tsvector: string;
3177
- /** The text search configuration of the query. Defaults to `simple`. */
3178
- readonly config?: string;
3179
- /** The RRF constant. Defaults to 60. */
3180
- readonly k?: number;
3181
- };
3182
- /**
3183
- * A SQL expression over the row `t` the score is multiplied by, such as
3184
- * `t.priority`.
3185
- */
3186
- readonly boost?: string;
3187
- /** Columns `filter` narrows before ranking, such as `organization_id`. */
3188
- readonly prefilter?: readonly string[];
3189
- /** A SQL condition over the row `t` every candidate must meet. */
3190
- readonly predicate?: string;
3191
- /** How `boost` combines with the score. Defaults to `multiply`. */
3192
- readonly boostMode?: "multiply" | "add";
3193
- /** A SQL `order by` list over the row `t` that breaks score ties. */
3194
- readonly order?: string;
3195
- }
3196
- //#endregion
3197
- //#region src/sql/schema-scan.d.ts
3198
- /** Privileges one role gets on a table, from the policies that name it. */
3199
- interface PolicyGrant {
3200
- /** `schema.table`, unquoted; an unqualified name is in `public`. */
3201
- readonly table: string;
3202
- readonly role: "anon" | "authenticated";
3203
- readonly privileges: readonly ("select" | "insert" | "update" | "delete")[];
3204
- }
3205
- /**
3206
- * The tables `files` create (`create table`), as `schema.table`, in the order
3207
- * they first appear. Only tables in `schemas` are kept.
3208
- */
3209
- declare function declaredTables(files: readonly {
3210
- readonly text: string;
3211
- }[], schemas: readonly string[]): string[];
3212
- /** A view the app's files create. */
3213
- interface DeclaredView {
3214
- /** Its columns, or `undefined` when they can't be read (`select *`). */
3215
- readonly columns: readonly string[] | undefined;
3216
- /** Whether `insert`, `update` and `delete` reach the table under it. */
3217
- readonly updatable: boolean;
3218
- }
3219
- /**
3220
- * The views and materialized views `files` create, as `schema.view`, with their
3221
- * columns and whether they are auto-updatable. A later `drop view` removes one.
3222
- * Only views in `schemas` are kept.
3223
- */
3224
- declare function declaredViews(files: readonly {
3225
- readonly text: string;
3226
- }[], schemas: readonly string[]): ReadonlyMap<string, DeclaredView>;
3227
- /**
3228
- * The tables in `schemas` that `files` leave with row level security on: `alter
3229
- * table ... enable row level security`, until a later `disable` or `drop
3230
- * table`.
3231
- */
3232
- declare function rlsTables(files: readonly {
3233
- readonly text: string;
3234
- }[], schemas: readonly string[]): string[];
3235
- /**
3236
- * Columns each `create table` in `files` declares, as `schema.table` to
3237
- * unquoted names. `like` and table constraints are skipped. Only tables in
3238
- * `schemas` are kept.
3239
- */
3240
- declare function declaredTableColumns(files: readonly {
3241
- readonly text: string;
3242
- }[], schemas: readonly string[]): ReadonlyMap<string, ReadonlySet<string>>;
3243
- /**
3244
- * The declared type of each column of each `create table` in `files`, as
3245
- * `schema.table` to unquoted column name to type. A type is lower-cased with
3246
- * its spacing normalised, and a quoted part keeps its case without quotes. Only
3247
- * tables in `schemas` are kept.
3248
- */
3249
- declare function declaredColumnTypes(files: readonly {
3250
- readonly text: string;
3251
- }[], schemas: readonly string[]): ReadonlyMap<string, ReadonlyMap<string, string>>;
3252
- /**
3253
- * The privileges the permissive policies in `files` imply, per table and role:
3254
- * `for all` gives the four commands, `to public` (or no `to`) counts for
3255
- * `authenticated` only, so `anon` needs a policy that names it. Restrictive
3256
- * policies grant nothing. Only tables in `schemas` are kept.
3257
- */
3258
- declare function policyGrants(files: readonly {
3259
- readonly text: string;
3260
- }[], schemas: readonly string[]): PolicyGrant[];
3261
- declare function extensionSchema(sources: readonly {
3262
- readonly text: string;
3263
- }[], extension: string): string | undefined;
3264
- /**
3265
- * The update trigger that keeps `updated_at` current on each table in `schemas`
3266
- * the files create one on, by `schema.table`: its function is named like one
3267
- * (`set_updated_at`, `moddatetime`, `touch_*`) or the files define it with
3268
- * `new.updated_at :=`. Block triggers (`bsb_*`) don't count.
3269
- */
3270
- declare function declaredUpdatedAtTriggers(files: readonly {
3271
- readonly text: string;
3272
- }[], schemas: readonly string[]): Readonly<Record<string, string>>;
3273
- /** A full btree index, by its name when it has one, and its leading columns. */
3274
- interface OwnIndex {
3275
- readonly name?: string;
3276
- readonly columns: readonly string[];
3277
- }
3278
- /**
3279
- * The leading columns of every full btree index the files give each table in
3280
- * `schemas`: `create index` statements, and the primary keys and unique
3281
- * constraints in `create table`. Partial indexes and other methods are left
3282
- * out, since they don't answer every lookup.
3283
- */
3284
- declare function declaredIndexes(files: readonly {
3285
- readonly text: string;
3286
- }[], schemas: readonly string[]): ReadonlyMap<string, readonly OwnIndex[]>;
3287
- //#endregion
3288
- //#region src/sql/shared.d.ts
3289
- /**
3290
- * The name `addNotNullCheck` gives the check on `column` of `table`, both
3291
- * quoted or bare, the table with or without its schema:
3292
- * `<table>_<column>_not_null`, shortened with a hash past 63 bytes.
3293
- */
3294
- declare function notNullCheckName(table: string, column: string): string;
3295
- /**
3296
- * A `pg_jsonschema` check on a jsonb column, for the `jsonb-schemas` module and
3297
- * key-value tables.
3298
- */
3299
- interface JsonSchemaCheck {
3300
- /** `table` or `schema.table`. */
3301
- readonly table: string;
3302
- readonly column: string;
3303
- readonly schema: Readonly<Record<string, unknown>>;
3304
- /**
3305
- * Checks only rows whose `where.column` equals `where.value` (a settings
3306
- * key).
3307
- */
3308
- readonly where?: {
3309
- readonly column: string;
3310
- readonly value: string;
3311
- };
3312
- }
3313
- //#endregion
3314
- //#region src/sql/module-types.d.ts
3315
- /** The step from one module version to the next, for `upgrade`. */
3316
- interface BlockSqlUpgrade {
3317
- /** The installed version this step upgrades from. */
3318
- readonly from: number;
3319
- readonly description: string;
3320
- /** SQL run before the module's current file, e.g. renames and backfills. */
3321
- readonly sql: (ctx: BlockSqlContext) => string;
3322
- }
3323
- /**
3324
- * A renamed module symbol. It keeps a compatibility wrapper for at least one
3325
- * minor release, then is removed; doctor reports uses of both (BS309), and the
3326
- * name stays reserved.
3327
- */
3328
- interface BlockSqlDeprecation {
3329
- readonly kind: "function" | "claim" | "table" | "column";
3330
- /**
3331
- * The old name: `schema.function`, a claim name, `schema.table` or
3332
- * `table.column`.
3333
- */
3334
- readonly symbol: string;
3335
- /** What to use instead. */
3336
- readonly use: string;
3337
- /** The package version that deprecated it. */
3338
- readonly since: string;
3339
- /** The package version that removed it; until then `wrapper` is written. */
3340
- readonly removed?: string;
3341
- /**
3342
- * The compatibility wrapper the module file keeps, e.g. a function with the
3343
- * old name that calls the new one and a `comment on function ... is
3344
- * 'deprecated: use X'`.
3345
- */
3346
- readonly wrapper?: (ctx: BlockSqlContext) => string;
3347
- }
3348
- /**
3349
- * SQL modules for `better-supabase add`. Every module is idempotent (`create or
3350
- * replace`, `if not exists`), so re-running it upgrades in place.
3351
- */
3352
- interface BlockSql {
3353
- readonly name: string;
3354
- readonly title: string;
3355
- readonly description: string;
3356
- /** Modules this one needs, added along with it. */
3357
- readonly requires: readonly string[];
3358
- /**
3359
- * The scopes the module runs in. A module that needs tenants declares
3360
- * `["tenant"]`; unset, it runs in every scope. Outside `tenant` scope a
3361
- * module needs neither `tenant` nor `access`, so they drop from `requires`.
3362
- */
3363
- readonly scopes?: readonly BlockScope[];
3364
- /**
3365
- * A module this one renders and is numbered ahead of, for a module that owns
3366
- * a subject table the `case` checks of `comments` or `attachments` name, or
3367
- * that `search` puts its index trigger on. The file takes the number before
3368
- * it, so later files keep theirs.
3369
- */
3370
- readonly before?: string;
3371
- /** What it needs instead when an authorization provider supplies memberships. */
3372
- readonly providerRequires?: readonly string[];
3373
- /**
3374
- * The optional `authorization.functions` templates it calls under the
3375
- * `provider` access model, such as `idsWithFor` to check another user. Doctor
3376
- * warns (BS411) when the provider doesn't set one.
3377
- */
3378
- readonly providerFunctions?: readonly (keyof AuthorizationFunctions)[];
3379
- /**
3380
- * Modules it works with when they are installed, without needing them.
3381
- * `ctx.installed` and `ctx.of` accept only these and what it requires;
3382
- * `record` reaches the outbox and the audit log without listing them. `*`
3383
- * stands for every module, for one that reads them all (`data-lifecycle`).
3384
- */
3385
- readonly integrates?: readonly string[];
3386
- /**
3387
- * What it adds to generic blocks (approvals, bulk actions, share links and
3388
- * the subject functions) that read it without naming it. Each function gets
3389
- * this block's context and the generic block's.
3390
- */
3391
- readonly contributes?: BlockContributes;
3392
- /**
3393
- * What it needs for this layout, e.g. per `blocks.permissions.model`;
3394
- * overrides both.
3395
- */
3396
- readonly dependencies?: (layout: BlockSqlLayout) => readonly string[];
3397
- /** `schema` files go with your schemas; `test` files go to `supabase/tests`. */
3398
- readonly target: "schema" | "test";
3399
- /** The module built for the default layout. */
3400
- readonly sql: string;
3401
- /** Bumped when installed databases need an upgrade step. Defaults to 1. */
3402
- readonly version?: number;
3403
- /** The modes `blocks.<name>.ownership` accepts. Defaults to `managed` only. */
3404
- readonly modes?: readonly BlockMode[];
3405
- /**
3406
- * The logical tables and columns `blocks.<name>.tables` and `columns` map. A
3407
- * table's entry is its spec; its `app` says whether it can be a table the app
3408
- * already has (`BlockSqlAppTable`).
3409
- */
3410
- readonly names?: BlockSqlNames;
3411
- /** The functions other modules and the TypeScript side call. */
3412
- readonly contract?: (ctx: BlockSqlContext) => readonly BlockSqlContractFunction[];
3413
- /** Renders the module for a layout. */
3414
- readonly build: (ctx: BlockSqlContext, layout: BlockSqlLayout) => string;
3415
- /**
3416
- * SQL appended after the module's body that depends on the whole layout, for
3417
- * example the grants for the tables in `expose`. Unlike `build`, it stays out
3418
- * of what `api` wrappers and extension scans read.
3419
- */
3420
- readonly extras?: (ctx: BlockSqlContext, layout: BlockSqlLayout) => string;
3421
- readonly upgrades?: readonly BlockSqlUpgrade[];
3422
- readonly deprecated?: readonly BlockSqlDeprecation[];
3423
- /**
3424
- * Rows, role settings and calls that a schema diff doesn't capture. They go
3425
- * to `better-supabase-data/` next to the schema folder and a migration (`sql
3426
- * data`) instead of the schema file.
3427
- */
3428
- readonly data?: (ctx: BlockSqlContext, layout: BlockSqlLayout) => string;
3429
- /**
3430
- * PgTAP files for this layout, written to the tests folder next to the
3431
- * `pgtap` module's.
3432
- */
3433
- readonly tests?: (ctx: BlockSqlContext, layout: BlockSqlLayout) => readonly BlockSqlTestFile[];
3434
- readonly topics?: (ctx: BlockSqlContext) => readonly string[];
3435
- readonly permissionKeys?: (ctx: BlockSqlContext) => readonly {
3436
- readonly action: string;
3437
- readonly key: string;
3438
- readonly scope: "tenant" | "platform";
3439
- readonly setting: string;
3440
- }[];
3441
- /**
3442
- * Actions of the module's `OPERATIONS` this config never checks, so their
3443
- * keys aren't reported to the authorization provider.
3444
- */
3445
- readonly unusedPermissions?: (ctx: BlockSqlContext) => readonly string[];
3446
- /**
3447
- * Functions granted to `anon` or `authenticated` only so the module's
3448
- * policies and triggers can call them as the client. `api` writes no entry
3449
- * point for them.
3450
- */
3451
- readonly internal?: readonly string[];
3452
- /**
3453
- * Soft-delete columns, as logical `table.column`: a write can set them to
3454
- * hide a row but never clear them again, so doctor BS213 doesn't count them
3455
- * as columns that grant access.
3456
- */
3457
- readonly hidingColumns?: readonly string[];
3458
- /** The app's tables outside `names.tables` that the module writes columns of. */
3459
- readonly appSubjectTables?: (ctx: BlockSqlContext) => readonly BlockSqlAppSubjectTable[];
3460
- }
3461
- /**
3462
- * How one of a module's tables can be a table the app already has (ADR 0098).
3463
- * It sits on the table's entry in `names.tables` (`app`), next to `columns`,
3464
- * `optional` and `typed`, which together make the table's spec:
3465
- *
3466
- * - The required columns are those in `columns` that aren't `optional` or
3467
- * `unused`. The module adds each one the app's table lacks with `add column
3468
- * if not exists`, nullable unless it has a default, and doctor (BS330) and
3469
- * `add --adopt` check and propose them.
3470
- * - The optional columns may be mapped to `null` in `blocks.<name>.columns`; the
3471
- * module then leaves out the feature that needs them.
3472
- * - The `typed` columns may be an enum or a domain on the app's table; the module
3473
- * writes them through `ctx.cast`.
3474
- *
3475
- * When `layout.ownTables` has the table, `ctx.owns(table)` is false: the module
3476
- * skips its `create table` and lays its functions, policies, triggers and
3477
- * indexes over the app's table. A table whose entry has no `app` is always the
3478
- * module's: it creates it, and a table of that name in the app's schema is an
3479
- * error.
3480
- */
3481
- interface BlockSqlAppTable {
3482
- /**
3483
- * The app's table only when `blocks.<name>.tables` maps it. Unmapped, the
3484
- * module creates its own, so an app table with the default name is an error.
3485
- */
3486
- readonly onlyWhenMapped?: boolean;
3487
- /**
3488
- * Logical columns this configuration doesn't use, such as the secret column
3489
- * when secrets live in Vault. They are neither required nor checked.
3490
- */
3491
- readonly unused?: (ctx: BlockSqlContext) => readonly string[];
3492
- /**
3493
- * Whether the block's TypeScript API inserts, updates or deletes rows of the
3494
- * table. Defaults to `true`. Doctor (BS349) reports such a table mapped to a
3495
- * view Postgres can't write through.
3496
- */
3497
- readonly writes?: boolean;
3498
- }
3499
- /** A view of the app's at a block table's name. */
3500
- interface OwnView {
3501
- /** Whether `insert`, `update` and `delete` reach the table under the view. */
3502
- readonly updatable: boolean;
3503
- }
3504
- /**
3505
- * A table of the app's outside `names.tables` that a module writes columns of,
3506
- * such as a subject table that `blocks.<name>.on.<type>` names. A null column
3507
- * is mapped away; doctor and `upgrade` check the others exist.
3508
- */
3509
- interface BlockSqlAppSubjectTable {
3510
- readonly logical: string;
3511
- readonly schema: string;
3512
- readonly table: string;
3513
- readonly columns: Readonly<Record<string, string | null>>;
3514
- }
3515
- /** A pgTAP file a module writes for the layout, e.g. one per audited table. */
3516
- interface BlockSqlTestFile {
3517
- /** The file name's suffix, after the module's slug. */
3518
- readonly name: string;
3519
- readonly sql: string;
3520
- }
3521
- declare const blockSqlVersion: (module: BlockSql) => number;
3522
- interface BlockSqlFile {
3523
- readonly module: string;
3524
- /** The instance, when it installs `module` under another name. */
3525
- readonly instance?: string;
3526
- /** `schema` and `test` files are diffed; `data` files go in a migration too. */
3527
- readonly kind: "schema" | "data" | "test";
3528
- readonly path: string;
3529
- readonly contents: string;
3530
- }
3531
- interface BlockSqlLayout {
3532
- /**
3533
- * `config.instances`. An instance that installs a block under another name
3534
- * renders its own files; `modules` holds the instances named after their
3535
- * block.
3536
- */
3537
- readonly instances?: Readonly<Record<string, ResolvedInstance>>;
3538
- /** Directory for schema modules. Defaults to `supabase/schemas`. */
3539
- readonly dir?: string;
3540
- /**
3541
- * The declarative schema folder the diff engine loads. Defaults to
3542
- * `supabase/schemas`.
3543
- */
3544
- readonly schemasDir?: string;
3545
- /** File prefix. Defaults to `900_better_supabase`. */
3546
- readonly prefix?: string;
3547
- /** Directory for pgTAP files. Defaults to `supabase/tests`. */
3548
- readonly testsDir?: string;
3549
- /**
3550
- * The `better_supabase.audit(...)` calls in the SQL files: the `audit` module
3551
- * writes a pgTAP file per table.
3552
- */
3553
- readonly auditedTables?: readonly AuditedTable[];
3554
- /**
3555
- * Ignored: the header names only the module, so a release doesn't rewrite
3556
- * every file. The `@bsb-block name@N` marker carries the module version.
3557
- *
3558
- * @deprecated Remove it; it has no effect.
3559
- */
3560
- readonly version?: string;
3561
- /**
3562
- * `config.realtime.tables`: registered at the end of the `realtime-tables`
3563
- * module.
3564
- */
3565
- readonly realtimeTables?: readonly string[];
3566
- /** `config.realtime.global`: tables registered with `tenant_column => null`. */
3567
- readonly realtimeGlobal?: readonly string[];
3568
- /** `config.realtime.users`: tables registered with `user_column`. */
3569
- readonly realtimeUsers?: Readonly<Record<string, string>>;
3570
- /** Tenant column passed to `track_realtime` for the other tables. */
3571
- readonly tenantColumn?: string;
3572
- /** Check constraints for the `jsonb-schemas` module. */
3573
- readonly jsonSchemas?: readonly JsonSchemaCheck[];
3574
- /** `config.expose`: the grants the `grants` module writes. */
3575
- readonly grants?: readonly TableGrant[];
3576
- /** `config.expose` functions: the roles that may execute each one. */
3577
- readonly functionGrants?: readonly FunctionGrant[];
3578
- /**
3579
- * Grants the permissive policies in the schema files imply, for
3580
- * `blocks['grants'].options.fromPolicies`. Tables in `grants` keep their
3581
- * listed privileges.
3582
- */
3583
- readonly policyGrants?: readonly TableGrant[];
3584
- /**
3585
- * The tables the schema files create, for
3586
- * `blocks['sessions'].options.policies`.
3587
- */
3588
- readonly declaredTables?: readonly string[];
3589
- /**
3590
- * `schema.table` of each table the app already has, to the schema file that
3591
- * creates it or `database`. A block leaves these tables alone and adds only
3592
- * the columns it needs, and an app table refuses their names.
3593
- */
3594
- readonly ownTables?: Readonly<Record<string, string>>;
3595
- /** The columns of the tables in `ownTables`, where they are known. */
3596
- readonly ownColumns?: Readonly<Record<string, readonly string[]>>;
3597
- /**
3598
- * The leading columns of each full btree index on a table in `ownTables`, by
3599
- * `schema.table`. A block adds no plain index that one of them covers.
3600
- */
3601
- readonly ownIndexes?: Readonly<Record<string, readonly OwnIndex[]>>;
3602
- /**
3603
- * The entries of `ownTables` that are views or materialized views, by
3604
- * `schema.view`, and whether Postgres can write through each one. A block
3605
- * writes no DDL over a view, only the functions that read it.
3606
- */
3607
- readonly ownViews?: Readonly<Record<string, OwnView>>;
3608
- /**
3609
- * The trigger that already keeps `updated_at` current on a table in
3610
- * `ownTables`, by `schema.table`. A block adds no `updated_at` trigger
3611
- * there.
3612
- */
3613
- readonly ownUpdatedAtTriggers?: Readonly<Record<string, string>>;
3614
- /**
3615
- * The app's own policies on a table in `ownTables`, by `schema.table`. A
3616
- * block adds no permissive policy that one of them already covers.
3617
- */
3618
- readonly ownPolicies?: Readonly<Record<string, readonly CatalogPolicy[]>>;
3619
- /**
3620
- * The declared tables with row level security on, for tables `fromPolicies`
3621
- * makes service-only.
3622
- */
3623
- readonly rlsTables?: readonly string[];
3624
- /**
3625
- * The foreign keys the schema files declare, for
3626
- * `blocks.memberships.options.sameTenant.auto`.
3627
- */
3628
- readonly foreignKeys?: readonly DeclaredForeignKey[];
3629
- /**
3630
- * Each declared table's columns, `schema.table` to names, for
3631
- * `sameTenant.auto`.
3632
- */
3633
- readonly declaredColumns?: Readonly<Record<string, readonly string[]>>;
3634
- /** `config.readSets`, compiled: the functions the `read-sets` module writes. */
3635
- readonly readSets?: readonly {
3636
- readonly name: string;
3637
- readonly sql: string;
3638
- }[];
3639
- /**
3640
- * `config.entitlements`: where the `entitlements` module finds each tenant's
3641
- * Stripe customer.
3642
- */
3643
- readonly entitlements?: EntitlementsSource;
3644
- /**
3645
- * `config.vectorSearch`: the tables the `vector-search` module writes a
3646
- * search function for.
3647
- */
3648
- readonly vectorSearch?: readonly VectorSearchTable[];
3649
- readonly vectorSchema?: string;
3650
- /** `config.claims`: claim names the modules read and write. */
3651
- readonly claims?: ClaimsMeta;
3652
- /**
3653
- * The authorization provider's memberships: `entitlements` reads them instead
3654
- * of `tenant`'s.
3655
- */
3656
- readonly entitlementsProvider?: BlockSqlEntitlementsProvider;
3657
- /** The authorization provider the `access` module's `provider` model calls. */
3658
- readonly accessProvider?: BlockSqlAccessProvider;
3659
- /** `config.blocks`: modes, names and permission keys per module. */
3660
- readonly modules?: AnyBlocksConfig;
3661
- /** `sql.scope`: the scope of every block that sets none. Defaults to `tenant`. */
3662
- readonly scope?: BlockScope;
3663
- readonly blockTenantColumn?: string;
3664
- /** `config.subjects`: the app-wide subject registry (ADR 0020). */
3665
- readonly subjects?: SubjectsConfig;
3666
- /**
3667
- * `config.appTables`: the tables the app owns, rendered after the blocks (ADR
3668
- * 0040).
3669
- */
3670
- readonly appTables?: AppTablesConfig;
3671
- /** The authorization provider's permission keys, for `api-keys` scopes. */
3672
- readonly permissionCatalog?: readonly string[];
3673
- /**
3674
- * `authorization.delegation.scopes`: the access module's `scope_permissions`
3675
- * (with `blocks.permissions.scopes` merged over it).
3676
- */
3677
- readonly delegationScopes?: Readonly<Record<string, readonly string[]>>;
3678
- }
3679
- /**
3680
- * Where the `entitlements` module reads the provider's memberships, and the
3681
- * tables behind them.
3682
- */
3683
- interface BlockSqlEntitlementsProvider {
3684
- /** The provider's name, for comments. */
3685
- readonly name: string;
3686
- /** The provider scope tenants are, e.g. `organization`. */
3687
- readonly scope: string;
3688
- readonly idType: BlockSqlIdType;
3689
- /** `authorization.functions.memberIds`. */
3690
- readonly memberIds: string;
3691
- /** `authorization.functions.memberIdsFor`. */
3692
- readonly memberIdsFor: string;
3693
- readonly memberships: readonly AuthorizationMembership[];
3694
- }
3695
- /** What the `access` module's `provider` model calls. */
3696
- interface BlockSqlAccessProvider {
3697
- /** The provider's name, for comments and errors. */
3698
- readonly name: string;
3699
- /** The provider scope tenants are. */
3700
- readonly scope: string;
3701
- /** Every scope it declares, for `on.<type>.scope`. */
3702
- readonly scopes?: readonly string[];
3703
- readonly idType: BlockSqlIdType;
3704
- readonly functions: AuthorizationFunctions;
3705
- /** The access module's `disabled` setting defaults to these. */
3706
- readonly suspension?: {
3707
- readonly user?: DisabledRow;
3708
- readonly tenant?: DisabledRow;
3709
- };
3710
- /**
3711
- * An adopted `tenant` module on one of these tables reads role names the same
3712
- * way.
3713
- */
3714
- readonly roleSources?: readonly AuthorizationRoleSource[];
3715
- /** How `ai-chat` applies `functions.canApprove`. */
3716
- readonly approvals?: {
3717
- readonly distinctApprover?: boolean;
3718
- };
3719
- /** The provider's operations table; `operationPermission` reads it. */
3720
- readonly operations?: Readonly<Record<string, AuthorizationOperation>>;
3721
- }
3722
- //#endregion
3723
- //#region src/sql/resolved-names.d.ts
3724
- /** One of a module's entities with the name the config gives it. */
3725
- interface ResolvedEntity {
3726
- readonly key: string;
3727
- /** The logical table that holds it; global entities may have none. */
3728
- readonly table?: string;
3729
- readonly from: EntityNoun;
3730
- readonly to: EntityNoun;
3731
- readonly primary: boolean;
3732
- /** Renamed in every module (the tenant). */
3733
- readonly global: boolean;
3734
- /** `blocks.<name>.entities.<entity>.url`, with logical column placeholders. */
3735
- readonly url?: string;
3736
- /**
3737
- * What makes the entity a subject, or undefined when it isn't one or the
3738
- * config sets `subject: false`.
3739
- */
3740
- readonly subject?: BlockSqlEntitySubject;
3741
- }
3742
- /**
3743
- * A module's final names for one config: its entities as renamed and the
3744
- * renamer every name goes through (the tenant rename, then the module's own).
3745
- */
3746
- interface ResolvedNames {
3747
- readonly module: string;
3748
- readonly entities: Readonly<Record<string, ResolvedEntity>>;
3749
- /** The tenant's noun, `organization` unless the tenant block renames it. */
3750
- readonly tenant: EntityNoun;
3751
- /** Tables, columns, functions, hooks and triggers: tenant and own entities. */
3752
- readonly naming: EntityNames;
3753
- /**
3754
- * Event types, payload keys, subjects, permission keys and TypeScript names:
3755
- * the module's own entities. The tenant rename leaves them alone, as it
3756
- * always has.
3757
- */
3758
- readonly entityNaming: EntityNames;
3759
- }
3760
- //#endregion
3761
- //#region src/sql/scope.d.ts
3762
- /**
3763
- * How a module checks who may reach a row, for the block's scope. Modules call
3764
- * these instead of naming the access contract (`can`, `tenant_ids_with`,
3765
- * `is_platform`) or the tenant module's helpers, so the same module runs per
3766
- * tenant, per user or in one shared space. In `tenant` scope each one renders
3767
- * the access contract call it replaces.
3768
- */
3769
- interface BlockSqlScope {
3770
- readonly kind: BlockScope;
3771
- /**
3772
- * The type of a scope id: the tenant id type, or `uuid` (a user id) in `user`
3773
- * scope.
3774
- */
3775
- readonly idType: BlockSqlIdType;
3776
- /**
3777
- * The type of a managed table's scope column: `<idType> not null` per tenant,
3778
- * nullable outside it (`uuid default auth.uid()` per user).
3779
- */
3780
- column(): string;
3781
- /** True when the caller holds `permission` (a SQL expression) in scope `id`. */
3782
- can(id: string, permission: string): string;
3783
- /** True when `user` (a uuid expression) holds `permission` in scope `id`. */
3784
- canUser(user: string, id: string, permission: string): string;
3785
- /**
3786
- * PL/pgSQL that sets the scope id parameter `param` for the scope: the
3787
- * caller's id per user (the service role keeps what it passes), null in the
3788
- * shared space. Empty per tenant.
3789
- */
3790
- bind(param: string): string;
3791
- /**
3792
- * A scope id argument as an expression: as passed per tenant, the caller's id
3793
- * when it is null per user, null in the shared space.
3794
- */
3795
- value(param: string): string;
3796
- /**
3797
- * A set-returning call of the scope ids the caller holds `permission` in,
3798
- * usable as `select ...`, `x in (select ...)` and `from ... x`.
3799
- */
3800
- ids(permission: string): string;
3801
- /** A row policy check: `column` is a scope the caller holds `permission` in. */
3802
- check(column: string, permission: string): string;
3803
- /** `a = b` for scope ids, null-safe in `none` scope where they are null. */
3804
- eq(a: string, b: string): string;
3805
- /**
3806
- * `is_platform(permission)`: whether the caller is platform staff holding
3807
- * `permission`. `false` outside `tenant` scope without the access module.
3808
- */
3809
- platform(permission: string): string;
3810
- /** A set-returning call of the tenants the caller is a member of. */
3811
- members(): string;
3812
- /**
3813
- * True when the caller holds a guest grant for `action` on record `type`/`id`
3814
- * in tenant `tenant` (ADR 0070). A guest is not a member, so `can` stays
3815
- * false for them. `false` without the `guests` module and without a provider
3816
- * that answers for guests, and outside `tenant` scope.
3817
- */
3818
- guest(tenant: string, type: string, id: string, action: GuestAction): string;
3819
- /**
3820
- * True when the caller is a guest of tenant `tenant` who represents the party
3821
- * `type`/`id`, such as the customer an invoice is addressed to. `false` where
3822
- * `guest` is.
3823
- */
3824
- guestParty(tenant: string, type: string, id: string): string;
3825
- }
3826
- //#endregion
3827
- //#region src/sql/value-maps.d.ts
3828
- /** The `BlockSqlContext` methods that cast and map a typed column's values. */
3829
- interface BlockSqlValueMethods {
3830
- /**
3831
- * `value`, a text expression, as the type of a logical column the table spec
3832
- * lists in `typed`. On a table the app has, the column may be an enum or
3833
- * another type with a text input, so the value goes through
3834
- * `better_supabase.as_column_type`; on the module's own table it stays as it
3835
- * is. With `invalid: "null"`, a value the type rejects, such as a label the
3836
- * enum lacks, becomes null through `better_supabase.try_column_type` instead
3837
- * of raising.
3838
- */
3839
- cast(table: string, column: string, value: string, invalid?: "raise" | "null"): string;
3840
- /**
3841
- * The label `label` of a typed logical column as the SQL literal the app's
3842
- * column stores, through `blocks.<name>.values`: the first mapped value, or a
3843
- * call that raises `VALUE_UNSUPPORTED` for a label mapped to `null`. The
3844
- * label itself without a map.
3845
- */
3846
- value(table: string, column: string, label: string): string;
3847
- /**
3848
- * Whether the column expression `value` holds one of `labels`, comparing
3849
- * against every app value each label maps to: `value = 'label'` for one
3850
- * label, `value in (...)` for several, `false` when none is supported.
3851
- */
3852
- is(table: string, column: string, value: string, labels: readonly string[], negate?: boolean): string;
3853
- /**
3854
- * The app values a label of a typed logical column reads from: `[label]`
3855
- * without a map, `[]` for a label mapped to `null`.
3856
- */
3857
- appValues(table: string, column: string, label: string): readonly string[];
3858
- /**
3859
- * The column expression `value` of a typed logical column as the block's
3860
- * label (mapped app values read back as their label), as text. `value` itself
3861
- * without a map.
3862
- */
3863
- label(table: string, column: string, value: string): string;
3864
- /**
3865
- * ` || jsonb_build_object(...)` that replaces each mapped typed column of
3866
- * `to_jsonb(alias)` with its label, keyed by the column's name; empty when no
3867
- * column of `table` maps values.
3868
- */
3869
- labelsJson(table: string, alias: string): string;
3870
- /**
3871
- * `to_jsonb(alias)` of a row of `table` keyed as on the module's own table:
3872
- * each logical column the app renames also under the module's column name,
3873
- * and each mapped typed column read back as its label, so a client parses the
3874
- * row the same way over the app's table (a mapped column's own key holds the
3875
- * label too). `as` gives the value of a renamed logical column from its
3876
- * column expression, such as an int8 as text. `to_jsonb(alias)` when nothing
3877
- * is renamed or mapped.
3878
- */
3879
- rowJson(table: string, alias: string, options?: {
3880
- readonly as?: Readonly<Record<string, (value: string) => string>>;
3881
- }): string;
3882
- /** Whether `blocks.<name>.values` maps any label of a typed logical column. */
3883
- mapsValues(table: string, column: string): boolean;
3884
- }
3885
- //#endregion
3886
- //#region src/sql/context.d.ts
3887
- /** The scope id types SQL modules render. */
3888
- declare const MODULE_ID_TYPES: readonly ["uuid", "text", "bigint", "integer"];
3889
- type BlockSqlIdType = (typeof MODULE_ID_TYPES)[number];
3890
- declare const isBlockSqlIdType: (value: string) => value is BlockSqlIdType;
3891
- /**
3892
- * A Postgres type name as one of `MODULE_ID_TYPES`: case and spacing are
3893
- * normalised and aliases such as `int8` resolved. `undefined` for any other
3894
- * type, so callers refuse it instead of guessing.
3895
- */
3896
- declare function moduleIdType(value: string): BlockSqlIdType | undefined;
3897
- /** One logical table of a module: its default name and logical columns. */
3898
- interface BlockSqlTableSpec {
3899
- /** Default name, in the module's schema. */
3900
- readonly name: string;
3901
- /** Logical column to default column name. */
3902
- readonly columns: Readonly<Record<string, string>>;
3903
- /**
3904
- * Logical columns an adopted table may lack (mapped to `null`): the module
3905
- * leaves out the feature that needs them.
3906
- */
3907
- readonly optional?: readonly string[];
3908
- /** The app may lack the whole table (`blocks.<name>.tables.<table>: null`). */
3909
- readonly optionalTable?: boolean;
3910
- /**
3911
- * How the table can be a table the app already has (ADR 0098). Without it the
3912
- * module always creates the table.
3913
- */
3914
- readonly app?: BlockSqlAppTable;
3915
- readonly lifecycle?: BlockSqlTableLifecycle;
3916
- /**
3917
- * Text columns an adopted table may declare with another type, such as an
3918
- * enum: the module writes and compares them through `ctx.cast`.
3919
- */
3920
- readonly typed?: readonly string[];
3921
- /**
3922
- * Text columns that take `blocks.<name>.values` like `typed` ones, but are
3923
- * written through `ctx.cast` only when the app gives them a values entry (an
3924
- * empty one casts without renaming labels), so a config without one renders
3925
- * as before.
3926
- */
3927
- readonly mappable?: readonly string[];
3928
- readonly yieldsToExtra?: readonly string[];
3929
- }
3930
- interface BlockSqlTableLifecycle {
3931
- readonly user?: string;
3932
- readonly tenant?: string;
3933
- readonly purge?: boolean;
3934
- readonly omit?: readonly string[];
3935
- readonly export?: boolean;
3936
- /**
3937
- * Columns that hold a `credential_ref`. Exports leave them out, and the
3938
- * organization purger revokes each ref that carries the row's tenant through
3939
- * the `CredentialProvider` before the purge deletes the row.
3940
- */
3941
- readonly credentials?: readonly string[];
3942
- /** Revoke for the row's `user` instead of the app. Default `app`. */
3943
- readonly credentialSubject?: "app" | "user";
3944
- }
3945
- /**
3946
- * What makes an entity a `config.subjects` entry when the block is installed.
3947
- * Columns are the table's logical columns; permissions are module actions.
3948
- */
3949
- interface BlockSqlEntitySubject {
3950
- readonly title: string;
3951
- readonly fallbackTitle?: string;
3952
- readonly deletedAt?: string;
3953
- readonly permissions: {
3954
- readonly read: string;
3955
- readonly write: string;
3956
- /**
3957
- * The action whose key `attachments` checks for files on the entity, in
3958
- * place of `attachments.upload`. Set it when the table's own write policies
3959
- * check more than tenant membership (doctor BS345).
3960
- */
3961
- readonly upload?: string;
3962
- };
3963
- readonly rank?: {
3964
- readonly column: string;
3965
- readonly group: string;
3966
- };
3967
- readonly search?: {
3968
- readonly title: string;
3969
- readonly body: readonly string[];
3970
- };
3971
- readonly url?: string;
3972
- readonly cascade?: boolean;
3973
- }
3974
- /**
3975
- * A noun the module names its tables, functions, events, permissions and hooks
3976
- * after (`work_item`), renamed through `blocks.<name>.entities`.
3977
- */
3978
- interface BlockSqlEntitySpec {
3979
- /** The logical table that holds the entity; global entities may have none. */
3980
- readonly table?: string;
3981
- readonly singular: string;
3982
- /** Defaults to the English plural of `singular`. */
3983
- readonly plural?: string;
3984
- /** The entity `entities: "<noun>"` renames. */
3985
- readonly primary?: boolean;
3986
- /** Renamed in every module, not only this one (the tenant). */
3987
- readonly global?: boolean;
3988
- readonly subject?: BlockSqlEntitySubject;
3989
- }
3990
- interface BlockSqlNames {
3991
- readonly tables: Readonly<Record<string, BlockSqlTableSpec>>;
3992
- readonly entities?: Readonly<Record<string, BlockSqlEntitySpec>>;
3993
- /**
3994
- * The `before_*` and `after_*` hooks the module calls, so
3995
- * `blocks.<name>.hooks.functions` is checked.
3996
- */
3997
- readonly hooks?: readonly string[];
3998
- /**
3999
- * The `blocks.<name>.options` keys the module reads; any other key is
4000
- * rejected.
4001
- */
4002
- readonly options?: readonly string[];
4003
- /**
4004
- * The events the module records, typed against its block's event map
4005
- * (`BlockSqlEvents<MessagingEvents>`); `record` rejects any other type.
4006
- */
4007
- readonly events?: Readonly<Record<string, CheckedEventSpec | undefined>>;
4008
- /**
4009
- * Tables and columns the module renamed between versions. `upgrade` renames
4010
- * them on installs below `from + 1`, after the config's entity and table
4011
- * renames, so a declared move needs no hand-written upgrade step.
4012
- */
4013
- readonly migrations?: readonly BlockSqlNameMigration[];
4014
- }
4015
- /**
4016
- * One version's table and column moves. Old names are the module's default
4017
- * names before the move; they go through the entity renames like every other
4018
- * name.
4019
- */
4020
- interface BlockSqlNameMigration {
4021
- /** The installed version this move upgrades from. */
4022
- readonly from: number;
4023
- readonly description: string;
4024
- /** The logical table, under its current key. */
4025
- readonly table: string;
4026
- /** The table's default name before the move, when the move renamed it. */
4027
- readonly was?: string;
4028
- /** Logical column to its default name before the move. */
4029
- readonly columns?: Readonly<Record<string, string>>;
4030
- }
4031
- interface CheckedEventSpec {
4032
- readonly subject: string;
4033
- readonly payload: readonly string[];
4034
- readonly retries?: boolean;
4035
- }
4036
- /** An event a module writes to the outbox, as SQL expressions. */
4037
- interface BlockSqlEmit {
4038
- /** The event type, e.g. `organization.created`. */
4039
- readonly type: string;
4040
- /** A `jsonb` expression. */
4041
- readonly payload: string;
4042
- /** A `text` expression, e.g. `'organizations/' || new_organization`. */
4043
- readonly subject?: string;
4044
- /** The tenant id expression; it is cast to text. */
4045
- readonly tenant?: string;
4046
- /** A `text` idempotency key expression. */
4047
- readonly key?: string;
4048
- }
4049
- /**
4050
- * The categories module actions are audited under. An adopted log with its own
4051
- * names maps them through `blocks.audit.options.values.category`.
4052
- */
4053
- declare const AUDIT_CATEGORIES: readonly ["membership", "access", "security", "configuration", "billing", "data", "ai", "integration", "read"];
4054
- type AuditCategory = (typeof AUDIT_CATEGORIES)[number];
4055
- /** How `record` writes an action to the audit log, as SQL expressions. */
4056
- interface BlockSqlAudit {
4057
- /** The audit category, mapped through `blocks.audit.options.values`. */
4058
- readonly category: AuditCategory;
4059
- /** What the action changed, e.g. `user` or `api_key`. */
4060
- readonly targetType?: string;
4061
- /** A `text` expression for the changed record's id. */
4062
- readonly recordId?: string;
4063
- /** A `text` expression people recognize the target by. */
4064
- readonly targetLabel?: string;
4065
- /** A `text` expression that says what happened. */
4066
- readonly summary?: string;
4067
- /** A `jsonb` expression; defaults to the event payload. */
4068
- readonly metadata?: string;
4069
- /** A `uuid` expression for the actor; defaults to the caller. */
4070
- readonly actor?: string;
4071
- /**
4072
- * A `uuid` expression for the support session the action belongs to. Defaults
4073
- * to the session in the caller's `act` claim, which wins when set.
4074
- */
4075
- readonly supportSession?: string;
4076
- /**
4077
- * A `uuid` expression for the admin acting as the user; defaults to
4078
- * `act.sub`.
4079
- */
4080
- readonly impersonatedBy?: string;
4081
- /**
4082
- * A `text` expression for why the admin acts as the user; defaults to
4083
- * `act.reason`.
4084
- */
4085
- readonly impersonationReason?: string;
4086
- }
4087
- /**
4088
- * An action a module records once: the outbox gets it as an event and the audit
4089
- * log as an entry, each when its module is installed.
4090
- */
4091
- interface BlockSqlAction extends BlockSqlEmit {
4092
- /**
4093
- * How the action is audited, or `false` for an event that is not an audited
4094
- * action, such as a chat message or a run status.
4095
- */
4096
- readonly audit: BlockSqlAudit | false;
4097
- }
4098
- /**
4099
- * A function of a module's contract: what other modules and the TypeScript side
4100
- * call.
4101
- */
4102
- interface BlockSqlContractFunction {
4103
- readonly name: string;
4104
- /** Argument types; `{id}` stands for the module's id type. */
4105
- readonly args: readonly string[];
4106
- readonly returns: string;
4107
- }
4108
- /** What a module's `build` reads: resolved names for one layout. */
4109
- interface BlockSqlContext extends BlockSqlValueMethods {
4110
- readonly module: string;
4111
- /**
4112
- * The instance being rendered: the module's name, or the `blocks` key of an
4113
- * instance that installs the module under another name.
4114
- */
4115
- readonly instance: string;
4116
- /**
4117
- * `blocks.<instance>.on`: the record types the instance attaches to, as a
4118
- * list or keyed by type with settings. Unset, it attaches to every one.
4119
- */
4120
- readonly on: InstanceOn | undefined;
4121
- readonly mode: BlockMode;
4122
- readonly config: ResolvedBlock;
4123
- /** The quoted schema of the module's functions and managed tables. */
4124
- readonly schema: string;
4125
- readonly schemaName: string;
4126
- readonly idType: BlockSqlIdType;
4127
- readonly claims: ClaimsMeta;
4128
- readonly modules: AnyBlocksConfig;
4129
- /** The app-wide subject registry (`config.subjects`). */
4130
- readonly subjects: SubjectsConfig;
4131
- /** The provider's `rowsWith` template under the `provider` model. */
4132
- readonly providerRowsWith: string | undefined;
4133
- /**
4134
- * The names of `config.appTables`, created in `public` after every block
4135
- * file, so a block can't put a trigger on one (ADR 0043).
4136
- */
4137
- readonly appTables: ReadonlySet<string>;
4138
- /**
4139
- * Who the module's rows belong to, and the checks for it: the port every
4140
- * tenant, user or shared-space check goes through.
4141
- */
4142
- readonly scope: BlockSqlScope;
4143
- /**
4144
- * The module's final names: its entities as `blocks.<name>.entities` and
4145
- * `blocks.memberships.names.organization` rename them.
4146
- */
4147
- readonly resolved: ResolvedNames;
4148
- /** The renamer every default name goes through (`resolved.naming`). */
4149
- readonly naming: EntityNames;
4150
- /**
4151
- * Every configured block's entity renames as one, for names that span blocks,
4152
- * such as the permission keys in the default roles.
4153
- */
4154
- blockNaming(): EntityNames;
4155
- /**
4156
- * The entity renames of each block installed under another name, such as
4157
- * `tickets` from `tasks`, for the permission keys each instance adds.
4158
- */
4159
- instanceNamings(): readonly EntityNames[];
4160
- /**
4161
- * What the installed instances whose `uses` names this instance add to it
4162
- * through `contributes`, in block order. Custom-mode instances add nothing.
4163
- */
4164
- contributions<K extends keyof BlockContributions>(block: K): readonly BlockContributions[K][];
4165
- /**
4166
- * `schema.name` of a module function, quoted. The name is the default one;
4167
- * `blocks.<name>.entities` and `blocks.<name>.functions` rename it.
4168
- */
4169
- fn(name: string): string;
4170
- /** The unquoted name a module function is written under (see `fn`). */
4171
- fnName(name: string): string;
4172
- /** `blocks.<name>.functions` keys no `fn` call has asked for yet. */
4173
- unusedFunctions(): readonly string[];
4174
- /** Default name to written name, for every function `fn` renamed so far. */
4175
- functionRenames(): ReadonlyMap<string, string>;
4176
- /** `schema.table` of a logical table, quoted. */
4177
- table(logical: string): string;
4178
- /** The unquoted schema and name of a logical table. */
4179
- tableName(logical: string): {
4180
- readonly schema: string;
4181
- readonly name: string;
4182
- };
4183
- /** A logical column, quoted. Throws when an adopted table lacks it. */
4184
- col(table: string, column: string): string;
4185
- /** A logical column, unquoted. Throws when an adopted table lacks it. */
4186
- colName(table: string, column: string): string;
4187
- /** Whether a logical column exists (adopted tables can map it to `null`). */
4188
- has(table: string, column: string): boolean;
4189
- /** Whether an optional logical table exists (it can be mapped to `null`). */
4190
- hasTable(table: string): boolean;
4191
- /** Whether the module renders its managed SQL (not adopt or custom mode). */
4192
- readonly manages: boolean;
4193
- /** Whether the module creates `table`, which the app doesn't have. */
4194
- owns(table: string): boolean;
4195
- /** The logical tables the app has; the module only adds their columns. */
4196
- readonly appOwned: readonly string[];
4197
- /**
4198
- * The entries of `appOwned` that are views: the module writes no DDL on them,
4199
- * only the functions that read them.
4200
- */
4201
- readonly appViews: readonly string[];
4202
- readonly names: BlockSqlNames;
4203
- readonly installedModules: readonly string[];
4204
- /** The permission key for a module action, as a SQL literal. */
4205
- permission(action: string, fallback: string): string;
4206
- /** The permission key for a module action. */
4207
- permissionKey(action: string, fallback: string): string;
4208
- /** A trigger name with the module's prefix, quoted. */
4209
- trigger(name: string): string;
4210
- /** Whether `module` is installed alongside this one. */
4211
- installed(module: string): boolean;
4212
- /** The context of another module in the same layout. */
4213
- of(module: string): BlockSqlContext;
4214
- /** A string module option (`blocks.<name>.options`). */
4215
- text(name: string, fallback: string): string;
4216
- number(name: string, fallback: number): number;
4217
- flag(name: string, fallback: boolean): boolean;
4218
- /** A module option that is a list of strings. */
4219
- list(name: string, fallback: readonly string[]): readonly string[];
4220
- /** A declared module option as configured, for object-shaped options. */
4221
- option(name: string): unknown;
4222
- /**
4223
- * `options.extraColumns` (column name to SQL type), checked: names are
4224
- * lower-case identifiers, types are SQL types, and no name shadows one of
4225
- * `table`'s mapped columns or a key in `reserved`, the stable keys the
4226
- * module's read functions return next to them.
4227
- */
4228
- extraColumns(table: string, reserved?: readonly string[], name?: string): readonly ExtraColumn[];
4229
- /**
4230
- * PL/pgSQL that calls the app's hook function when it exists, with `[type,
4231
- * expression]` arguments: `if to_regprocedure(...) is not null then execute
4232
- * format(...) using ...; end if;`. The name comes from `to_regprocedure`
4233
- * rather than a literal: plpgsql_check (`supabase db lint`) checks constant
4234
- * dynamic SQL and fails when the hook is missing.
4235
- */
4236
- hook(name: string, args: readonly (readonly [string, string])[]): string;
4237
- /** The app function a hook calls, quoted, for hooks that return a value. */
4238
- hookTarget(name: string): string;
4239
- /**
4240
- * PL/pgSQL that writes the event to the outbox (`emit_event`) when the
4241
- * `outbox` module is installed and `blocks.<name>.events` isn't false;
4242
- * otherwise an empty string. `record` without the audit entry.
4243
- */
4244
- emit(event: BlockSqlEmit): string;
4245
- /**
4246
- * PL/pgSQL that writes the action to the outbox (as `emit` does) and, when it
4247
- * carries `audit` and the `audit` module is installed, to the audit log
4248
- * (`audit_event`), with `key` as the idempotency key of both. `null;` when
4249
- * neither applies, so it is always a valid statement.
4250
- */
4251
- record(action: BlockSqlAction): string;
4252
- /**
4253
- * PL/pgSQL that writes the action to the audit log only, with no outbox
4254
- * event, for reads that leave no change behind. `null;` without the `audit`
4255
- * module or when `audit` is `false`.
4256
- */
4257
- audit(action: BlockSqlAction): string;
4258
- /**
4259
- * PL/pgSQL that calls `notify(fields)` as the service role, which `notify()`
4260
- * requires, then restores the caller's claims. The function declares
4261
- * `v_claims text`. `null;` without the `notifications` module.
4262
- */
4263
- notify(fields: string, options?: {
4264
- readonly indent?: string;
4265
- }): string;
4266
- /**
4267
- * PL/pgSQL that enqueues a job (`enqueue_job`); `null;` without the `jobs`
4268
- * module. `delay` is an integer expression of seconds before it runs.
4269
- */
4270
- enqueue(queue: string, payload: string, dedupe: string, options?: {
4271
- readonly delay?: string;
4272
- }): string;
4273
- /**
4274
- * Row SQL for `data` that ships an automation as a default rule
4275
- * (`rule_defaults`): every organization gets its own copy, which it may turn
4276
- * off or edit. The trigger and subject type follow the module's entity
4277
- * renames. `''` without the `automations` module or a block in `requires`.
4278
- */
4279
- automation(spec: DefaultAutomation): string;
4280
- /**
4281
- * The `text[]` of a tenant's entitlements, or `fallback` without the
4282
- * `entitlements` module.
4283
- */
4284
- entitlements(tenant: string): string | undefined;
4285
- entitlements(tenant: string, fallback: string): string;
4286
- /**
4287
- * How long rows of `kind` are kept for `tenant` (SQL expressions): the
4288
- * data-lifecycle policy for the tenant, its plan or every tenant, else
4289
- * `fallback`; just `fallback` without the `data-lifecycle` module.
4290
- */
4291
- retention(kind: string, tenant: string, fallback: string): string;
4292
- /**
4293
- * Whether a legal hold covers `kind` for `tenant`; `false` without the
4294
- * `data-lifecycle` module.
4295
- */
4296
- held(kind: string, tenant: string): string;
4297
- /**
4298
- * The condition a purge deletes on: the row's timestamp `at` is past
4299
- * `retention` and no hold covers it. With data-lifecycle it first bounds `at`
4300
- * by the shortest policy, so the timestamp index still serves.
4301
- */
4302
- expired(kind: string, row: {
4303
- readonly at: string;
4304
- readonly tenant: string;
4305
- readonly fallback: string;
4306
- }): string;
4307
- /**
4308
- * Before when every tenant's rows of `kind` may go (a timestamptz
4309
- * expression), for dropping whole partitions: null under any hold on the
4310
- * kind, else the longest policy or `fallback`; `now() - fallback` without the
4311
- * `data-lifecycle` module.
4312
- */
4313
- cutoff(kind: string, fallback: string): string;
4314
- /**
4315
- * PL/pgSQL that broadcasts on a Realtime topic when `realtime.send` exists:
4316
- * projects without Realtime skip it.
4317
- */
4318
- broadcast(topic: string, event: string, payload: string, options?: {
4319
- readonly indent?: string;
4320
- }): string;
4321
- /**
4322
- * `coalesce(better_supabase.can(scope, id, permission), false)`; `permission`
4323
- * is a SQL expression. The `tenant` scope goes through `scope.can`.
4324
- */
4325
- can(scope: string, id: string, permission: string): string;
4326
- /**
4327
- * True for the service role and platform staff holding `permission` (a SQL
4328
- * expression); the service role only without the `access` module.
4329
- */
4330
- staff(permission: string): string;
4331
- }
4332
- /** A column from `options.extraColumns`. */
4333
- interface ExtraColumn {
4334
- /** The column name, as reads return it. */
4335
- readonly name: string;
4336
- /** The name, quoted. */
4337
- readonly ident: string;
4338
- /** Its SQL type, such as `text not null default 'en'`. */
4339
- readonly type: string;
4340
- }
4341
- /** The contract's argument list with `{id}` resolved, as Postgres prints it. */
4342
- declare function contractSignature(fn: BlockSqlContractFunction, idType: string): string;
4343
- //#endregion
4344
- export { JsonSchemaTarget as $, PresetGroup as $n, SnapshotExtras as $r, GeneratorNoun as $t, declaredIndexes as A, PresetValueInfo as Ai, SqlWorkflow as An, AppTablesConfig as Ar, PresetConflict as At, ZodGeneratorOptions as B, MigrationSafetyConfig as Bi, ExposePrivilege as Bn, CatalogIndex as Br, GeneratedFile as Bt, OwnView as C, PresetConventions as Ci, EntitlementPlansSource as Cn, AppRollupAggregate as Cr, ConfigConventions as Ct, OwnIndex as D, PresetFramework as Di, ResolvedSqlConfig as Dn, AppTableEvents as Dr, expandPreset as Dt, DeclaredView as E, PresetFieldValue as Ei, RealtimeConfig as En, AppTableEventKind as Er, conventionConfig as Et, extensionSchema as F, EnvFileConfig as Fi, TopicTriggerValueConfig as Fn, CatalogEnum as Fr, presetBlockConflict as Ft, standardSchema as G, GEN_TASKS as Gi, presetFromSpec as Gn, ExtrasDomain as Gr, GeneratorEntitySchemas as Gt, ValibotGeneratorOptions as H, PowerSyncGenConfig as Hi, Privilege as Hn, CatalogTable as Hr, GeneratorBlock as Ht, policyGrants as I, GenConfig as Ii, VectorDistance as In, CatalogForeignKey as Ir, resolvePreset as It, FactoriesGeneratorOptions as J, IntegrationInfo as Ji, DEFAULT_PRESET_NAME as Jn, ExtrasHookFunction as Jr, GeneratorFunctionArg as Jt, NuqsGeneratorOptions as K, INTEGRATION_INFO as Ki, presetOfSpec as Kn, ExtrasFunction as Kr, GeneratorField as Kt, rlsTables as L, GenTask as Li, VectorSearchConfig as Ln, CatalogFunction as Lr, resolveJsonSchema as Lt, declaredTables as M, presetField as Mi, TopicTriggerLookupConfig as Mn, CatalogCheck as Mr, ResolvedPreset as Mt, declaredUpdatedAtTriggers as N, presetValueLabel as Ni, TopicTriggerPayloadValueConfig as Nn, CatalogColumn as Nr, ResolvedPresetBlock as Nt, PolicyGrant as O, PresetPlatforms as Oi, SeedConfig as On, AppTableSubject as Or, presetConfig as Ot, declaredViews as P, DoctorConfig as Pi, TopicTriggerTopicConfig as Pn, CatalogColumnGrant as Pr, listNames as Pt, jsonSchema as Q, PRESET_NAMES as Qn, SnapshotBucket as Qr, GeneratorModel as Qt, TableGrant as R, IntegrationName as Ri, ColumnPrivilege as Rn, CatalogFunctionArg as Rr, ClaimsConfig as Rt, BlockSqlUpgrade as S, PresetAccess as Si, ToolingConfig as Sn, AppReferenceTarget as Sr, RoleNames as St, notNullCheckName as T, PresetFieldKey as Ti, BucketConfig as Tn, AppTableConfig as Tr, PresetInput as Tt, valibot as U, SkillsAgent as Ui, ResolvedExpose as Un, CatalogTrigger as Ur, GeneratorBlockEntity as Ut, zod as V, OpenApiConfig as Vi, ExposeRole as Vn, CatalogPolicy as Vr, Generator as Vt, StandardSchemaGeneratorOptions as W, SkillsConfig as Wi, PresetSpec as Wn, CatalogUnique as Wr, GeneratorColumn as Wt, JsonSchemaGeneratorOptions as X, PRESETS as Xn, ForeignKeyAction as Xr, GeneratorInputSchema as Xt, factories as Y, SKILLS_AGENTS as Yi, NamedPreset as Yn, ExtrasTable as Yr, GeneratorInput as Yt, buildJsonSchema as Z, PRESET_GROUPS as Zn, Snapshot as Zr, GeneratorJsonSchema as Zt, BlockSqlDeprecation as _, CONVENTION_FIELDS as _i, DatabaseConfig as _n, AppColumnFormat as _r, defineConfig as _t, BlockSqlContext as a, RpcFunctionArg as ai, TableConfig as an, DeclaredForeignKey as ar, blockEntities as at, BlockSqlLayout as b, PRESET_TENANT_NAMES as bi, OrganizationConfig as bn, AppOnDeleteAction as br, BucketName as bt, BlockSqlIdType as c, RpcReturnColumn as ci, ResolvedConfig as cn, auditRegistrations as cr, CONFIG_GROUPS as ct, MODULE_ID_TYPES as d, INSTANCE_NAME as di, AppTableInput as dn, APP_COLUMN_TYPES as dr, blockEntrySource as dt, GeneratorMetadata as ei, GeneratorTable as en, PresetName as er, ClaimPaths as et, contractSignature as f, instancePrefix as fi, AppTablesInput as fn, APP_ON_DELETE_ACTIONS as fr, flattenConfig as ft, BlockSqlAccessProvider as g, PresetGlueItem as gi, BlocksInput as gn, AppColumnConfig as gr, ResolveInput as gt, BlockSql as h, PresetCatalogManifest as hi, BlockInput as hn, AppColumnAccess as hr, CONFIG_SCHEMA_URL as ht, BlockSqlAudit as i, RpcFunction as ii, SourceConfig as in, CONFIG_DEFAULTS as ir, BlockEntity as it, declaredTableColumns as j, integrationsForFramework as ji, TopicTriggerConfig as jn, Catalog as jr, PresetIntegration as jt, declaredColumnTypes as k, PresetScope as ki, SqlConfig as kn, AppTableVersions as kr, presetOf as kt, BlockSqlNames as l, RpcTypeReference as li, ResolvedExtensions as ln, APP_COLUMN_ACCESS as lr, RENAMED_BLOCK_KEYS as lt, moduleIdType as m, PresetCatalogBlock as mi, BetterSupabaseConfig as mn, APP_TABLE_EVENT_KINDS as mr, groupEntries as mt, AuditCategory as n, PostgresFunction as ni, JsonTypeConfig as nn, isPresetName as nr, claimPaths as nt, BlockSqlContractFunction as o, RpcFunctionOverload as oi, DataHooksFramework as on, sameTenantLayout as or, blockEntityRenames as ot, isBlockSqlIdType as p, PresetCatalog as pi, AuthConfig as pn, APP_ROLLUP_AGGREGATES as pr, groupConfig as pt, nuqs as q, INTEGRATION_NAMES as qi, presetSpec as qn, ExtrasHook as qr, GeneratorFunction as qt, BlockSqlAction as r, PostgresFunctionArg as ri, RelationsConfig as rn, namedPreset as rr, tenantClaimPaths as rt, BlockSqlEmit as s, RpcFunctionReturns as si, FlatConfig as sn, AuditedTable as sr, blockSubjectTypes as st, AUDIT_CATEGORIES as t, PostgresColumn as ti, JsonSchemaSource as tn, defaultPreset as tr, DEFAULT_CLAIMS as tt, BlockSqlTableSpec as u, CORE_BLOCKS as ui, ApiConfig as un, APP_COLUMN_FORMATS as ur, RENAMED_CONFIG_KEYS as ut, BlockSqlEntitlementsProvider as v, DEFAULT_CONVENTIONS as vi, EnvironmentConfig as vn, AppColumnType as vr, resolveConfig as vt, blockSqlVersion as w, PresetField as wi, EntitlementsConfig as wn, AppRollupConfig as wr, ExpandedConfig as wt, BlockSqlTestFile as x, Preset as xi, SqlInput as xn, AppReference as xr, ConfigReferences as xt, BlockSqlFile as y, PRESET_FRAMEWORKS as yi, GenGroupConfig as yn, AppLookupConfig as yr, BlockTableReference as yt, ZodFlavor as z, KeysConfig as zi, ExposeConfig as zn, CatalogGrant as zr, CodecsConfig as zt };