better-supabase 0.15.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/{ai-schedules-D_Hz-ik5.d.ts → ai-schedules-Dk9H3kAp.d.ts} +1 -1
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{api-DxAPqMrE.d.ts → api-CpL3hm87.d.ts} +1 -1
  4. package/dist/{app-tables-D29Rahtg.js → app-tables-Q0TYfeih.js} +1 -0
  5. package/dist/{app-tables-CbCFSXLG.d.ts → app-tables-dS02piE7.d.ts} +1 -1
  6. package/dist/astro/index.d.ts +4 -4
  7. package/dist/{auth-module-BEFESDC4.js → auth-module-BbmX-N4L.js} +12 -4
  8. package/dist/{authorization-HZdJCaVm.d.ts → authorization-CNsvnwle.d.ts} +19 -3
  9. package/dist/better-result/index.d.ts +2 -2
  10. package/dist/{bind-h5jre2K0.d.ts → bind-C801IaK-.d.ts} +4 -4
  11. package/dist/{block-env-BrfRvPrj.d.ts → block-env-BeG4DiiO.d.ts} +4 -4
  12. package/dist/blocks/access-requests/index.d.ts +1 -1
  13. package/dist/blocks/activities/index.d.ts +1 -1
  14. package/dist/blocks/agents/index.d.ts +1 -1
  15. package/dist/blocks/ai-cache/index.d.ts +1 -1
  16. package/dist/blocks/ai-chat/index.d.ts +4 -4
  17. package/dist/blocks/ai-files/index.d.ts +1 -1
  18. package/dist/blocks/ai-keys/index.d.ts +1 -1
  19. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  20. package/dist/blocks/announcements/index.d.ts +4 -4
  21. package/dist/blocks/api-keys/index.d.ts +2 -2
  22. package/dist/blocks/approvals/index.d.ts +1 -1
  23. package/dist/blocks/assets/index.d.ts +1 -1
  24. package/dist/blocks/assignment/index.d.ts +1 -1
  25. package/dist/blocks/attachments/index.d.ts +2 -2
  26. package/dist/blocks/audit/index.d.ts +5 -5
  27. package/dist/blocks/automations/index.d.ts +3 -3
  28. package/dist/blocks/billable-time/index.d.ts +1 -1
  29. package/dist/blocks/billing/index.d.ts +3 -3
  30. package/dist/blocks/bookings/index.d.ts +2 -2
  31. package/dist/blocks/bulk/index.d.ts +1 -1
  32. package/dist/blocks/calendar/index.d.ts +2 -2
  33. package/dist/blocks/catalog/index.d.ts +1 -1
  34. package/dist/blocks/channels/index.d.ts +1 -1
  35. package/dist/blocks/collections/index.d.ts +1 -1
  36. package/dist/blocks/comments/index.d.ts +5 -5
  37. package/dist/blocks/compliance/index.d.ts +1 -1
  38. package/dist/blocks/connectors/index.d.ts +1 -1
  39. package/dist/blocks/contacts/index.d.ts +1 -1
  40. package/dist/blocks/content/index.d.ts +1 -1
  41. package/dist/blocks/contracts/index.d.ts +1 -1
  42. package/dist/blocks/courses/index.d.ts +1 -1
  43. package/dist/blocks/created-by/index.d.ts +4 -3
  44. package/dist/blocks/created-by/index.js +2 -2
  45. package/dist/blocks/custom-fields/index.d.ts +1 -1
  46. package/dist/blocks/data-lifecycle/index.d.ts +1 -1
  47. package/dist/blocks/deals/index.d.ts +1 -1
  48. package/dist/blocks/dispatch/index.d.ts +1 -1
  49. package/dist/blocks/documents/index.d.ts +1 -1
  50. package/dist/blocks/domains/index.d.ts +1 -1
  51. package/dist/blocks/donations/index.d.ts +1 -1
  52. package/dist/blocks/drive/index.d.ts +1 -1
  53. package/dist/blocks/employees/index.d.ts +2 -2
  54. package/dist/blocks/enrichment/index.d.ts +1 -1
  55. package/dist/blocks/enrollments/index.d.ts +1 -1
  56. package/dist/blocks/entitlements/index.d.ts +3 -3
  57. package/dist/blocks/expenses/index.d.ts +1 -1
  58. package/dist/blocks/field-history/index.d.ts +1 -1
  59. package/dist/blocks/flags/index.d.ts +1 -1
  60. package/dist/blocks/forecasts/index.d.ts +1 -1
  61. package/dist/blocks/forms/index.d.ts +2 -2
  62. package/dist/blocks/goals/index.d.ts +1 -1
  63. package/dist/blocks/guests/index.d.ts +1 -1
  64. package/dist/blocks/hiring/index.d.ts +1 -1
  65. package/dist/blocks/identities/index.d.ts +1 -1
  66. package/dist/blocks/imports/index.d.ts +1 -1
  67. package/dist/blocks/inbox/index.d.ts +5 -5
  68. package/dist/blocks/incidents/index.d.ts +1 -1
  69. package/dist/blocks/index.d.ts +2 -2
  70. package/dist/blocks/inventory/index.d.ts +1 -1
  71. package/dist/blocks/invoices/index.d.ts +1 -1
  72. package/dist/blocks/knowledge/index.d.ts +1 -1
  73. package/dist/blocks/lead-scoring/index.d.ts +1 -1
  74. package/dist/blocks/leases/index.d.ts +1 -1
  75. package/dist/blocks/leave/index.d.ts +1 -1
  76. package/dist/blocks/ledger/index.d.ts +1 -1
  77. package/dist/blocks/mail-sync/index.d.ts +1 -1
  78. package/dist/blocks/memberships/index.d.ts +1 -1
  79. package/dist/blocks/memory/index.d.ts +1 -1
  80. package/dist/blocks/messaging/index.d.ts +5 -5
  81. package/dist/blocks/metrics/index.d.ts +1 -1
  82. package/dist/blocks/mfa/index.d.ts +2 -2
  83. package/dist/blocks/moderation/index.d.ts +1 -1
  84. package/dist/blocks/notifications/index.d.ts +4 -4
  85. package/dist/blocks/numbering/index.d.ts +1 -1
  86. package/dist/blocks/oauth-server/index.d.ts +1 -1
  87. package/dist/blocks/onboarding/index.d.ts +2 -2
  88. package/dist/blocks/orders/index.d.ts +2 -2
  89. package/dist/blocks/organizations/index.d.ts +2 -2
  90. package/dist/blocks/outbox/index.d.ts +1 -1
  91. package/dist/blocks/passes/index.d.ts +1 -1
  92. package/dist/blocks/permissions/index.d.ts +3 -3
  93. package/dist/blocks/pipelines/index.d.ts +1 -1
  94. package/dist/blocks/posts/index.d.ts +1 -1
  95. package/dist/blocks/profiles/index.d.ts +1 -1
  96. package/dist/blocks/promotions/index.d.ts +1 -1
  97. package/dist/blocks/push/index.d.ts +2 -2
  98. package/dist/blocks/queue/index.d.ts +29 -2
  99. package/dist/blocks/queue/index.js +1 -1
  100. package/dist/blocks/quotes/index.d.ts +1 -1
  101. package/dist/blocks/rank/index.d.ts +1 -1
  102. package/dist/blocks/reactions/index.d.ts +4 -4
  103. package/dist/blocks/relations/index.d.ts +1 -1
  104. package/dist/blocks/reminders/index.d.ts +1 -1
  105. package/dist/blocks/reviews/index.d.ts +1 -1
  106. package/dist/blocks/saved-views/index.d.ts +3 -3
  107. package/dist/blocks/scores/index.d.ts +1 -1
  108. package/dist/blocks/search/index.d.ts +3 -3
  109. package/dist/blocks/security-events/index.d.ts +1 -1
  110. package/dist/blocks/segments/index.d.ts +1 -1
  111. package/dist/blocks/sequences/index.d.ts +1 -1
  112. package/dist/blocks/service-accounts/index.d.ts +1 -1
  113. package/dist/blocks/sessions/index.d.ts +2 -2
  114. package/dist/blocks/settings/index.d.ts +2 -2
  115. package/dist/blocks/share-links/index.d.ts +1 -1
  116. package/dist/blocks/shipments/index.d.ts +1 -1
  117. package/dist/blocks/signatures/index.d.ts +1 -1
  118. package/dist/blocks/signing-keys/index.d.ts +1 -1
  119. package/dist/blocks/sla/index.d.ts +1 -1
  120. package/dist/blocks/sso/index.d.ts +1 -1
  121. package/dist/blocks/state-machine/index.d.ts +1 -1
  122. package/dist/blocks/subjects/index.d.ts +2 -2
  123. package/dist/blocks/tags/index.d.ts +2 -2
  124. package/dist/blocks/tasks/index.d.ts +2 -2
  125. package/dist/blocks/teams/index.d.ts +1 -1
  126. package/dist/blocks/templates/index.d.ts +1 -1
  127. package/dist/blocks/time-tracking/index.d.ts +1 -1
  128. package/dist/blocks/timeline/index.d.ts +3 -3
  129. package/dist/blocks/trash/index.d.ts +1 -1
  130. package/dist/blocks/undo/index.d.ts +2 -2
  131. package/dist/blocks/updated-at/index.d.ts +7 -4
  132. package/dist/blocks/updated-at/index.js +2 -2
  133. package/dist/blocks/usage/index.d.ts +2 -2
  134. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  135. package/dist/blocks/versions/index.d.ts +1 -1
  136. package/dist/blocks/waitlist/index.d.ts +1 -1
  137. package/dist/blocks/webhooks/index.d.ts +2 -2
  138. package/dist/blocks/webhooks/index.js +1 -1
  139. package/dist/blocks/workflow-editor/index.d.ts +4 -4
  140. package/dist/blocks/workflows/index.d.ts +4 -4
  141. package/dist/{bucket-CiNi8sIw.d.ts → bucket-vc-QRrva.d.ts} +40 -1
  142. package/dist/cli/{add-C04vkBk9.js → add-BinNYhFD.js} +2 -2
  143. package/dist/cli/{add-DNOL9PDu.js → add-DMcrsWjC.js} +13 -11
  144. package/dist/cli/add-z-3pXI6C.js +1 -0
  145. package/dist/cli/{backfill-VFzf-TJP.js → backfill-DxBB62Zr.js} +3 -3
  146. package/dist/cli/bin.js +1 -1
  147. package/dist/cli/{blocks-Cb7mILFU.js → blocks-DSgTifw0.js} +1 -1
  148. package/dist/cli/{blocks-Bn7WUca5.js → blocks-rxOS-Mzz.js} +1 -1
  149. package/dist/cli/{cache-DkplpIGe.js → cache-oU0yHKf0.js} +1 -1
  150. package/dist/cli/{codemod-BbaE5dL_.js → codemod-Dsrv_3gQ.js} +1 -1
  151. package/dist/cli/{config-9t5ec_N7.js → config-2rwFHbwj.js} +3 -1
  152. package/dist/cli/{config-CBqkQjjN.js → config-C6XylzKz.js} +1 -1
  153. package/dist/cli/{content-mapper-Cdx6arxu.js → content-mapper-DLbXilBz.js} +2 -2
  154. package/dist/cli/{db-DrBI_HNv.js → db-Bwrr3GHM.js} +2 -2
  155. package/dist/cli/{doctor-C-VO-QQ2.js → doctor-CKt5Yyl4.js} +184 -142
  156. package/dist/cli/{gen-yRHOHW1b.js → gen-CeG6lbka.js} +13 -13
  157. package/dist/cli/index.d.ts +1 -1
  158. package/dist/cli/index.js +7 -7
  159. package/dist/cli/{init-BOw0SX65.js → init-DrQlf9RL.js} +6 -6
  160. package/dist/cli/{live-Lmg-hYyO.js → live-BvWGM4c3.js} +2 -2
  161. package/dist/cli/{mcp-DQ1zR2eA.js → mcp-BrOnGB15.js} +2 -2
  162. package/dist/cli/{metadata-CZaxkv21.js → metadata-BNSdPuKp.js} +3 -3
  163. package/dist/cli/{migration-safety-BbhLu2fo.js → migration-safety-NtB3dsRU.js} +2 -2
  164. package/dist/cli/{module-migration-DOn6EmNz.js → module-migration-mKhX88V_.js} +1 -1
  165. package/dist/cli/{print-D_xf8PPj.js → print-Dh8iuPK3.js} +1 -1
  166. package/dist/cli/{remove-BY_TOTRj.js → remove-DfFXVBRr.js} +5 -5
  167. package/dist/cli/{render-lJmHr0y9.js → render-ChIwdIOJ.js} +10 -4
  168. package/dist/cli/{run-BJ6IMs_H.js → run-CLSHSVYo.js} +7 -7
  169. package/dist/cli/{run-DkB0fhc9.js → run-D48ZEU58.js} +24 -24
  170. package/dist/cli/{seed-Cz8PcXeT.js → seed-CG-pA-5N.js} +2 -2
  171. package/dist/cli/seed-CUxW5Dks.js +1 -0
  172. package/dist/cli/{shared-Bh-6IqJS.js → shared-D0XBFSlz.js} +1 -1
  173. package/dist/cli/{snapshot-Bzcigm7T.js → snapshot-C6vh_n3t.js} +3 -3
  174. package/dist/cli/{source-WoLdcQzN.js → source-BZbEK5if.js} +1 -1
  175. package/dist/cli/{source-args-IpJRJO5t.js → source-args-MTLYpifA.js} +1 -1
  176. package/dist/cli/{spec-CZMiLhv_.js → spec-B4LhpI6t.js} +2 -2
  177. package/dist/cli/{spec-BF_dpwzW.js → spec-C-dhdKwa.js} +1 -1
  178. package/dist/cli/{sql-layout-rFP0oq1N.js → sql-layout-26LSoifK.js} +2 -2
  179. package/dist/cli/{sync-mANmYYoL.js → sync-CHGMZCJ5.js} +2 -2
  180. package/dist/cli/{upgrade-B0Q9wMs-.js → upgrade-C0dVsqNX.js} +3 -3
  181. package/dist/cli/{upgrade-BrNLt92u.js → upgrade-GB9rqUGT.js} +2 -2
  182. package/dist/cli/{version-CyavsyGA.js → version-T507a49w.js} +1 -1
  183. package/dist/client/index.d.ts +5 -5
  184. package/dist/client/index.js +1 -1
  185. package/dist/client/native/index.d.ts +5 -5
  186. package/dist/client/native/index.js +1 -1
  187. package/dist/{client-BAEbEA7t.js → client-C_mlji5R.js} +6 -5
  188. package/dist/{composite-BZYXlVBN.d.ts → composite-B7f1MMgr.d.ts} +4 -3
  189. package/dist/config/index.d.ts +3 -3
  190. package/dist/config/index.js +4 -4
  191. package/dist/{config-DWGgUQCh.js → config-BVNNJwGC.js} +7 -6
  192. package/dist/{config-CcehOvbz.js → config-CIBc79_8.js} +1 -1
  193. package/dist/{context-TGX2eDS5.d.ts → context-CKCgjEDF.d.ts} +9 -2
  194. package/dist/{controller-DyPPMFSw.d.ts → controller-CJUXhshv.d.ts} +1 -1
  195. package/dist/{conversion-O-kyhXcC.d.ts → conversion-DgHdDlTK.d.ts} +1 -1
  196. package/dist/create/index.d.ts +2 -2
  197. package/dist/create/index.js +5 -5
  198. package/dist/{define-DFBnQyYg.d.ts → define-Cgru0_kF.d.ts} +2 -2
  199. package/dist/{define-block-DvvcM54N.d.ts → define-block-Xxw8Hroe.d.ts} +2 -2
  200. package/dist/edge/index.d.ts +5 -5
  201. package/dist/{entitlements-BnhDBxLW.d.ts → entitlements-B0jmjNLD.d.ts} +1 -1
  202. package/dist/{executor-CVIn6JHa.d.ts → executor-BWFfz0ik.d.ts} +2 -2
  203. package/dist/expo/index.d.ts +2 -2
  204. package/dist/{extension-B-lajjex.js → extension-DTaHjwdc.js} +3 -2
  205. package/dist/{extension-B0EjCYhO.js → extension-mGylYROs.js} +2 -10
  206. package/dist/{field-errors-DYtg1mwv.d.ts → field-errors-DqlebtTE.d.ts} +12 -12
  207. package/dist/{framework-h5lP_5yj.d.ts → framework-CF6zFU7a.d.ts} +3 -3
  208. package/dist/hono/index.d.ts +4 -4
  209. package/dist/{index-BfkltrGJ.d.ts → index-B8YjrfVl.d.ts} +2 -2
  210. package/dist/{index-BAHGLvGD.d.ts → index-BCeTYhFk.d.ts} +1 -1
  211. package/dist/{index-Do2ChN_y.d.ts → index-CQhPHHDF.d.ts} +20 -2
  212. package/dist/{index-Ab4UeEn_.d.ts → index-ClMN0f98.d.ts} +44 -12
  213. package/dist/{index-B4gcStOz.d.ts → index-DUxXdQN_.d.ts} +3 -3
  214. package/dist/{index-BfK6olKm.d.ts → index-Dbb7BQdi.d.ts} +9 -4
  215. package/dist/{index-DN9mfmhA.d.ts → index-lB-8iPmY.d.ts} +51 -3
  216. package/dist/index.d.ts +2 -2
  217. package/dist/{instances-BHjCZoF8.js → instances-QOzIz9-q.js} +1 -1
  218. package/dist/list/index.d.ts +1 -1
  219. package/dist/{list-query-BDVutLFr.d.ts → list-query-DxjuIHEL.d.ts} +1 -1
  220. package/dist/mapper/bin.js +6 -6
  221. package/dist/mcp/index.d.ts +4 -4
  222. package/dist/mcp/sdk/index.d.ts +2 -2
  223. package/dist/next/client/index.d.ts +81 -1
  224. package/dist/next/client/index.js +178 -2
  225. package/dist/next/index.d.ts +15 -14
  226. package/dist/{operations-CSc_IsHO.d.ts → operations-Dc07aV_H.d.ts} +1 -1
  227. package/dist/{options-DChZoVfs.d.ts → options-B_NrjVDt.d.ts} +1 -0
  228. package/dist/{options-B2swWnJW.js → options-CCUaRLgd.js} +2 -1
  229. package/dist/{options-CM6-18FQ.d.ts → options-CDSCkYxu.d.ts} +1 -0
  230. package/dist/{options-C-dQHH5-.js → options-tSsUF0-7.js} +2 -1
  231. package/dist/orpc/index.d.ts +4 -4
  232. package/dist/otel/index.js +4 -4
  233. package/dist/{ports-DOhtuw3c.js → ports-CaVRXjxq.js} +1 -1
  234. package/dist/{ports-CpdiQv1D.d.ts → ports-DnpAuTvB.d.ts} +1 -1
  235. package/dist/powersync/index.d.ts +2 -2
  236. package/dist/preset/index.d.ts +3 -3
  237. package/dist/preset/index.js +3 -3
  238. package/dist/{preset-CsHnIBJF.js → preset-BIANzB5p.js} +2 -2
  239. package/dist/{push-token-B3m3pWAv.d.ts → push-token-C_mFkYfq.d.ts} +1 -1
  240. package/dist/query/index.d.ts +1 -1
  241. package/dist/{rate-limit-o44SYkVY.js → rate-limit-Dt9vAY4E.js} +53 -0
  242. package/dist/react/index.d.ts +6 -6
  243. package/dist/react/index.js +3 -3
  244. package/dist/react/native/index.d.ts +1 -1
  245. package/dist/react/native/index.js +1 -1
  246. package/dist/react/server.d.ts +12 -7
  247. package/dist/react/server.js +8 -3
  248. package/dist/react/session.d.ts +5 -0
  249. package/dist/react/session.js +9 -1
  250. package/dist/{react-BuDYI62C.js → react-CZUZYn9E.js} +41 -4
  251. package/dist/react-router/index.d.ts +3 -3
  252. package/dist/realtime/index.d.ts +5 -5
  253. package/dist/realtime/index.js +2 -1
  254. package/dist/{record-form-DB_5Ue_B.d.ts → record-form-xWvVcb86.d.ts} +1 -1
  255. package/dist/records/index.d.ts +7 -7
  256. package/dist/relay-gKvKJ3xf.js +208 -0
  257. package/dist/{resource-execute-CzHuDsil.d.ts → resource-execute-DqWfEc56.d.ts} +1 -1
  258. package/dist/{resource-types-DnKiH4G2.d.ts → resource-types-BIoz_ElD.d.ts} +1 -1
  259. package/dist/{resources-B9cQxhjw.d.ts → resources-Bt2PDKE7.d.ts} +1 -1
  260. package/dist/server/index.d.ts +147 -9
  261. package/dist/server/index.js +396 -1
  262. package/dist/{server-types-7QPzW2bF.d.ts → server-types-gR4Q1aM0.d.ts} +5 -354
  263. package/dist/{session-CfBCJGgc.d.ts → session-C1OuXbtN.d.ts} +2 -1
  264. package/dist/session-status-qQLm7jzh.d.ts +82 -0
  265. package/dist/{sign-in-BsIaNx2C.js → sign-in-CmPK1AgM.js} +20 -10
  266. package/dist/solid/index.d.ts +7 -7
  267. package/dist/solid/index.js +1 -1
  268. package/dist/solid-start/index.d.ts +3 -3
  269. package/dist/spec/index.d.ts +1 -1
  270. package/dist/sql/index.d.ts +5 -5
  271. package/dist/sql/index.js +3 -3
  272. package/dist/{sql-OLVW4t08.js → sql-ClTmzHs8.js} +199 -31
  273. package/dist/sqlite/index.d.ts +1 -1
  274. package/dist/ssr/index.d.ts +1 -1
  275. package/dist/storage/index.d.ts +3 -3
  276. package/dist/storage/index.js +54 -1
  277. package/dist/support-B4ZBVxt3.d.ts +357 -0
  278. package/dist/svelte/index.d.ts +7 -7
  279. package/dist/svelte/index.js +1 -1
  280. package/dist/sveltekit/index.d.ts +4 -4
  281. package/dist/{tags-BjHflcHF.d.ts → tags-sM-CH9Mn.d.ts} +1 -1
  282. package/dist/tanstack-db/index.d.ts +1 -1
  283. package/dist/tanstack-start/index.d.ts +3 -3
  284. package/dist/{tenant-DzFsg0Pc.d.ts → tenant-DVvjw9H-.d.ts} +1 -1
  285. package/dist/testing/index.d.ts +9 -8
  286. package/dist/testing/index.js +3 -3
  287. package/dist/{timeline-WrFMgd3U.d.ts → timeline-BBfKuMVL.d.ts} +3 -3
  288. package/dist/{topic-DNFEFGKI.d.ts → topic-BtLz-qTI.d.ts} +3 -3
  289. package/dist/{verify-CMou8dWZ.d.ts → verify-DEqY__0N.d.ts} +1 -1
  290. package/dist/vue/index.d.ts +7 -7
  291. package/dist/vue/index.js +1 -1
  292. package/dist/{watch-topic-Bo9S2R4P.d.ts → watch-topic-tnfOTa3-.d.ts} +1 -1
  293. package/dist/yjs/index.d.ts +1 -1
  294. package/package.json +1 -1
  295. package/schemas/config-v1.json +22 -0
  296. package/schemas/doctor-report-v1.json +1 -0
  297. package/skills/better-supabase-api/SKILL.md +3 -1
  298. package/skills/better-supabase-auth/SKILL.md +7 -0
  299. package/dist/cli/add-CUH0rORo.js +0 -1
  300. package/dist/cli/seed-D6XijwbR.js +0 -1
@@ -14,8 +14,8 @@ function defaultActor(context) {
14
14
  * stamp, like the block's `track_actor` trigger. Without an actor (anonymous
15
15
  * requests) nothing is set.
16
16
  */
17
- function createdByExtension(options = {}) {
18
- const resolve = options.resolve ?? defaultActor;
17
+ function createdByExtension(extension = {}) {
18
+ const resolve = extension.resolve ?? defaultActor;
19
19
  return definePlugin({
20
20
  name: "actor",
21
21
  beforeMutation(op, { table, context, options }) {
@@ -29,6 +29,7 @@ function createdByExtension(options = {}) {
29
29
  updated,
30
30
  impersonated
31
31
  ], "actor", options);
32
+ if (extension.stamp === "trigger") return op;
32
33
  const id = resolve(context);
33
34
  if (id === void 0) return op;
34
35
  const impersonator = context.actor?.impersonator;
@@ -1,15 +1,7 @@
1
1
  import { r as definePlugin } from "./plugin-AKwwe2gF.js";
2
2
  import { a as insertsOnly, c as withDefault, i as guardManaged, t as dbName } from "./extension-shared-Djm8mGHD.js";
3
3
  //#region src/blocks/updated-at/extension.ts
4
- /**
5
- * The `updated-at` block's repository extension. Stamps the columns generated
6
- * as `Flags.timestamps`: `createdAt` on insert, `updatedAt` on insert and
7
- * update. A call that sets either column fails with `invalid_request` unless it
8
- * passes `{ override: true }`, which keeps the caller's values. The block's
9
- * `track_updated_at` trigger covers writes that bypass the app, and every write
10
- * when the runtime has no Temporal.
11
- */
12
- function updatedAtExtension() {
4
+ function updatedAtExtension(extension = {}) {
13
5
  return definePlugin({
14
6
  name: "timestamps",
15
7
  describe(api) {
@@ -25,7 +17,7 @@ function updatedAtExtension() {
25
17
  const created = dbName(table, flags.createdAt);
26
18
  const updated = dbName(table, flags.updatedAt);
27
19
  guardManaged(op, [created, updated], "timestamps", options);
28
- if (op.kind === "delete") return op;
20
+ if (op.kind === "delete" || extension.stamp === "trigger") return op;
29
21
  const stamp = readClock(now);
30
22
  if (stamp === void 0) return op;
31
23
  switch (op.kind) {
@@ -1,14 +1,14 @@
1
1
  import { b as DbError, f as Result } from "./result-DZeA5KS6.js";
2
2
  import { o as EventHub } from "./events-vcqenSYU.js";
3
3
  import { o as BlockTenant } from "./block-helpers-CRpAHrp_.js";
4
- import { pt as QuerySpec } from "./define-DFBnQyYg.js";
5
- import { $ as TemplateValues } from "./bucket-CiNi8sIw.js";
4
+ import { pt as QuerySpec } from "./define-Cgru0_kF.js";
5
+ import { tt as TemplateValues } from "./bucket-vc-QRrva.js";
6
6
  import { n as DataEngine } from "./data-engine-BWoz9lED.js";
7
- import { Dn as GeneratedBlocks } from "./define-block-DvvcM54N.js";
8
- import { _ as TopicMessage, c as RealtimeClient, d as SubscribeOptions, i as PresenceOptions, s as PresenceSubscription } from "./topic-DNFEFGKI.js";
9
- import { t as ClientPorts } from "./ports-CpdiQv1D.js";
10
- import { a as ClientAuth } from "./bind-h5jre2K0.js";
11
- import { a as LiveSource, r as LiveCountSeed } from "./index-DN9mfmhA.js";
7
+ import { Dn as GeneratedBlocks } from "./define-block-Xxw8Hroe.js";
8
+ import { _ as TopicMessage, c as RealtimeClient, d as SubscribeOptions, i as PresenceOptions, s as PresenceSubscription } from "./topic-BtLz-qTI.js";
9
+ import { t as ClientPorts } from "./ports-DnpAuTvB.js";
10
+ import { a as ClientAuth } from "./bind-C801IaK-.js";
11
+ import { a as LiveSource, r as LiveCountSeed } from "./index-lB-8iPmY.js";
12
12
  import { SupabaseClient } from "@supabase/supabase-js";
13
13
  import { QueryClient } from "@tanstack/query-core";
14
14
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -50,11 +50,11 @@ interface UseActionOptions<I, T> {
50
50
  }
51
51
  interface BroadcastOptions extends Omit<SubscribeOptions, "onStatus"> {
52
52
  /**
53
- * A supabase-js client to subscribe with, for apps without the provider. It
54
- * resubscribes when the client's user changes. Defaults to the provider's
55
- * client.
53
+ * A supabase-js client to subscribe with, for apps without the provider, or a
54
+ * `relayRealtimeClient(url)`. It resubscribes when the client's user changes.
55
+ * Defaults to the provider's `realtime`, then its client.
56
56
  */
57
- readonly client?: SupabaseClient;
57
+ readonly client?: RealtimeClient;
58
58
  /** The query client `invalidate` refetches with. Defaults to the provider's. */
59
59
  readonly queryClient?: QueryClient;
60
60
  /**
@@ -84,7 +84,7 @@ interface PresenceHookOptions<I> {
84
84
  */
85
85
  readonly state?: I | null;
86
86
  /** A supabase-js client for apps without the provider. */
87
- readonly client?: SupabaseClient;
87
+ readonly client?: RealtimeClient;
88
88
  }
89
89
  /** The parts of a `defineTopic(..., { presence })` topic the bindings use. */
90
90
  interface PresenceTopic<P extends string, I, O> {
@@ -1,8 +1,8 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "./types-DFdg_4yN.js";
2
- import { c as ServerOptions, et as SessionSnapshot } from "./server-types-7QPzW2bF.js";
2
+ import { O as SessionSnapshot, c as ServerOptions } from "./server-types-gR4Q1aM0.js";
3
3
  import { t as AuthSession } from "./view-DyFdMCqg.js";
4
- import { n as SessionEntryConfig } from "./session-CfBCJGgc.js";
5
- import { n as BetterSupabaseContributions } from "./composite-BZYXlVBN.js";
4
+ import { n as SessionEntryConfig } from "./session-C1OuXbtN.js";
5
+ import { n as BetterSupabaseContributions } from "./composite-B7f1MMgr.js";
6
6
  import { c as ResourceLoaderContext } from "./kit-DOwKpSkA.js";
7
7
  import { t as RefusalRedirects } from "./refusal-CSntB_x8.js";
8
8
  //#region src/server/framework.d.ts
@@ -1,14 +1,14 @@
1
1
  import { O as AnyFunctions, k as AnyModels, ut as TableKey } from "../types-DFdg_4yN.js";
2
2
  import { r as AuthState } from "../resolve-CXX6DHv3.js";
3
3
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
4
- import { t as BetterSupabase } from "../define-DFBnQyYg.js";
5
- import { a as ServerContext, c as ServerOptions, et as SessionSnapshot, l as SharedServer, n as BetterServer } from "../server-types-7QPzW2bF.js";
4
+ import { t as BetterSupabase } from "../define-Cgru0_kF.js";
5
+ import { O as SessionSnapshot, a as ServerContext, c as ServerOptions, l as SharedServer, n as BetterServer } from "../server-types-gR4Q1aM0.js";
6
6
  import { t as AuthSession } from "../view-DyFdMCqg.js";
7
7
  import { i as MiddlewareOptions, r as GuardOptions } from "../respond-Dn1_YhC1.js";
8
8
  import { c as ResourceLoaderContext, s as BlockRequireOptions } from "../kit-DOwKpSkA.js";
9
9
  import { t as CorsOptions } from "../cors-kLq6VM06.js";
10
- import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-DnKiH4G2.js";
11
- import { t as defineAction } from "../resource-execute-CzHuDsil.js";
10
+ import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-BIoz_ElD.js";
11
+ import { t as defineAction } from "../resource-execute-DqWfEc56.js";
12
12
  import { i as RouteRateLimitRule, n as RateLimitVerdict, r as RateLimiter, t as RateLimitRouteOptions } from "../rate-limit-Bztf32cl.js";
13
13
  import { AnyEntry, Contributions, ValidateEntries } from "@supabase/middleware";
14
14
  import { Context, ErrorHandler, Hono, MiddlewareHandler } from "hono";
@@ -3,9 +3,9 @@ import { n as DbException } from "./escape-like-PReMbEEU.js";
3
3
  import { f as Result, t as AsyncResult } from "./result-DZeA5KS6.js";
4
4
  import { $ as RecordRef, K as Insert, O as AnyFunctions, Z as PrimaryKeyValue, ht as Update, k as AnyModels, ut as TableKey } from "./types-DFdg_4yN.js";
5
5
  import { o as EventHub } from "./events-vcqenSYU.js";
6
- import { A as OffsetRangeArgs, Bt as Payload, C as GetKey, Dt as CountArgs, K as WriteArgs, Nt as ListArgs, O as OffsetPage, S as FindExt, St as AggregateResult, U as UpdateArgs, W as UpsertArgs, Zt as CacheAdapter, _ as CursorPageArgs, b as DeleteArgs, ft as InferResult, g as CursorPage, k as OffsetPageArgs, kt as GetArgs, pt as QuerySpec, t as BetterSupabase, v as Db, x as DeleteExt, yt as AggregateArgs, z as Returned } from "./define-DFBnQyYg.js";
6
+ import { A as OffsetRangeArgs, Bt as Payload, C as GetKey, Dt as CountArgs, K as WriteArgs, Nt as ListArgs, O as OffsetPage, S as FindExt, St as AggregateResult, U as UpdateArgs, W as UpsertArgs, Zt as CacheAdapter, _ as CursorPageArgs, b as DeleteArgs, ft as InferResult, g as CursorPage, k as OffsetPageArgs, kt as GetArgs, pt as QuerySpec, t as BetterSupabase, v as Db, x as DeleteExt, yt as AggregateArgs, z as Returned } from "./define-Cgru0_kF.js";
7
7
  import { n as DataEngine, r as DataEngineOptions } from "./data-engine-BWoz9lED.js";
8
- import { Dn as GeneratedBlocks, cn as RecordBindingResult, dn as RecordBindingWriteName, fn as RecordBindingWriteOutput, in as RecordBindingData, nn as AnyRecordBindingWrite, on as RecordBindingOptions, t as AnyBlock, tn as AnyRecordBinding, un as RecordBindingWriteInput } from "./define-block-DvvcM54N.js";
8
+ import { Dn as GeneratedBlocks, cn as RecordBindingResult, dn as RecordBindingWriteName, fn as RecordBindingWriteOutput, in as RecordBindingData, nn as AnyRecordBindingWrite, on as RecordBindingOptions, t as AnyBlock, tn as AnyRecordBinding, un as RecordBindingWriteInput } from "./define-block-Xxw8Hroe.js";
9
9
  import { t as BetterQueryMeta } from "./invalidate-DMp4eqfF.js";
10
10
  import { DataTag, InfiniteData, QueryClient, SkipToken } from "@tanstack/query-core";
11
11
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -1,4 +1,4 @@
1
- import { Pn as PresetSpec, St as ResolvedPreset, Wn as PresetName, br as AppTablesConfig, ci as Preset, cr as AppColumnType, ei as PresetCatalog, hr as AppTableConfig, or as AppColumnConfig, ri as PresetGlueItem, vt as presetConfig } from "./context-TGX2eDS5.js";
1
+ import { Pn as PresetSpec, St as ResolvedPreset, Wn as PresetName, br as AppTablesConfig, ci as Preset, cr as AppColumnType, ei as PresetCatalog, hr as AppTableConfig, or as AppColumnConfig, ri as PresetGlueItem, vt as presetConfig } from "./context-CKCgjEDF.js";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/preset/catalog.generated.d.ts
4
4
  declare const PRESET_CATALOG: PresetCatalog;
@@ -1,5 +1,5 @@
1
1
  import { b as DbError, f as Result, t as AsyncResult } from "./result-DZeA5KS6.js";
2
- import { X as StoragePath, a as BucketConnectOptions, g as StorageAdminClient, i as BucketConfig, j as StorageClient, n as Bucket, r as BucketClient, s as BucketPolicy, x as TransformOptions } from "./bucket-CiNi8sIw.js";
2
+ import { C as TransformOptions, N as StorageClient, Q as StoragePath, a as BucketConnectOptions, i as BucketConfig, n as Bucket, r as BucketClient, s as BucketPolicy, v as StorageAdminClient } from "./bucket-vc-QRrva.js";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  //#region src/storage/errors.d.ts
5
5
  /** Maps a Storage error (`StorageApiError`, fetch failures) to a `DbError`. */
@@ -284,4 +284,22 @@ interface VectorBucket<Id extends string, I extends Readonly<Record<string, Vect
284
284
  */
285
285
  declare function defineVectorBucket<const Id extends string, const I extends Readonly<Record<string, VectorIndexConfig>>>(config: VectorBucketConfig<Id, I>): VectorBucket<Id, I>;
286
286
  //#endregion
287
- export { StoredRef as A, AnyBucket as C, Buckets as D, BucketWithId as E, storageImageUrl as F, fromStorageError as I, StorageImageOptions as M, StorageImageSize as N, ConnectedRef as O, storageImageSrcSet as P, organizationLogoBucket as S, BucketMap as T, IMAGE_TYPES as _, VectorHit as a, OrganizationLogoBucketOptions as b, VectorMetadata as c, defineVectorBucket as d, AnalyticsBucket as f, AvatarBucketOptions as g, defineAnalyticsBucket as h, VectorDistance as i, defineBuckets as j, ResolvedRef as k, VectorQueryOptions as l, AnalyticsCatalog as m, VectorBucketClient as n, VectorIndexClient as o, AnalyticsBucketClient as p, VectorBucketConfig as r, VectorIndexConfig as s, VectorBucket as t, VectorRecord as u, ImageBucketOptions as v, BucketIdOf as w, avatarBucket as x, ImageVariant as y };
287
+ //#region src/storage/resumable.d.ts
288
+ interface ResumableEndpointOptions {
289
+ /**
290
+ * On a hosted project, send the upload to the direct Storage host
291
+ * (`<project-ref>.storage.supabase.co`), which Supabase recommends for large
292
+ * files. Defaults to true; other hosts, such as a local stack or a custom
293
+ * domain, are kept.
294
+ */
295
+ readonly direct?: boolean;
296
+ }
297
+ /**
298
+ * The TUS endpoint for a signed resumable upload,
299
+ * `<storage>/upload/resumable/sign`. `url` is the project URL (`SUPABASE_URL`),
300
+ * the Storage URL (`.../storage/v1`) or a signed upload URL from
301
+ * `createSignedUploadUrl`.
302
+ */
303
+ declare function resumableEndpoint(url: string, options?: ResumableEndpointOptions): string;
304
+ //#endregion
305
+ export { ConnectedRef as A, avatarBucket as C, BucketMap as D, BucketIdOf as E, StorageImageSize as F, storageImageSrcSet as I, storageImageUrl as L, StoredRef as M, defineBuckets as N, BucketWithId as O, StorageImageOptions as P, fromStorageError as R, OrganizationLogoBucketOptions as S, AnyBucket as T, defineAnalyticsBucket as _, VectorBucketConfig as a, ImageBucketOptions as b, VectorIndexClient as c, VectorQueryOptions as d, VectorRecord as f, AnalyticsCatalog as g, AnalyticsBucketClient as h, VectorBucketClient as i, ResolvedRef as j, Buckets as k, VectorIndexConfig as l, AnalyticsBucket as m, resumableEndpoint as n, VectorDistance as o, defineVectorBucket as p, VectorBucket as r, VectorHit as s, ResumableEndpointOptions as t, VectorMetadata as u, AvatarBucketOptions as v, organizationLogoBucket as w, ImageVariant as x, IMAGE_TYPES as y };
@@ -1,19 +1,19 @@
1
1
  import { b as DbError, f as Result, t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { $ as RecordRef } from "./types-DFdg_4yN.js";
3
3
  import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "./events-vcqenSYU.js";
4
- import { pt as QuerySpec } from "./define-DFBnQyYg.js";
5
- import { $ as TemplateValues, C as UploadOptions, O as TtlPreset, S as UploadBody, l as ImageTransform, w as UrlOptions, x as TransformOptions } from "./bucket-CiNi8sIw.js";
4
+ import { pt as QuerySpec } from "./define-Cgru0_kF.js";
5
+ import { A as TtlPreset, C as TransformOptions, E as UrlOptions, T as UploadOptions, l as ImageTransform, tt as TemplateValues, w as UploadBody } from "./bucket-vc-QRrva.js";
6
6
  import { m as RejectedChange, o as DataSyncState } from "./data-engine-BWoz9lED.js";
7
- import { M as BindingName, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "./index-BfkltrGJ.js";
8
- import { c as RealtimeClient, d as SubscribeOptions, g as TopicHandlers, i as PresenceOptions, m as Topic, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas } from "./topic-DNFEFGKI.js";
9
- import { t as AuthSnapshot } from "./bind-h5jre2K0.js";
7
+ import { M as BindingName, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "./index-B8YjrfVl.js";
8
+ import { c as RealtimeClient, d as SubscribeOptions, g as TopicHandlers, i as PresenceOptions, m as Topic, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas } from "./topic-BtLz-qTI.js";
9
+ import { t as AuthSnapshot } from "./bind-C801IaK-.js";
10
10
  import { t as AuthSession } from "./view-DyFdMCqg.js";
11
- import { r as LiveCountSeed } from "./index-DN9mfmhA.js";
12
- import { n as Controller } from "./controller-DyPPMFSw.js";
13
- import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "./field-errors-DYtg1mwv.js";
14
- import { t as BlockEnv } from "./block-env-BrfRvPrj.js";
11
+ import { r as LiveCountSeed, v as RelayClientOptions } from "./index-lB-8iPmY.js";
12
+ import { n as Controller } from "./controller-CJUXhshv.js";
13
+ import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "./field-errors-DqlebtTE.js";
14
+ import { t as BlockEnv } from "./block-env-BeG4DiiO.js";
15
15
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "./block-method-CiVa2G-J.js";
16
- import { s as RecordFormValues, t as RecordForm } from "./record-form-DB_5Ue_B.js";
16
+ import { s as RecordFormValues, t as RecordForm } from "./record-form-xWvVcb86.js";
17
17
  import { SupabaseClient } from "@supabase/supabase-js";
18
18
  import { DependencyList, ReactNode, SubmitEvent } from "react";
19
19
  import { QueryClient } from "@tanstack/query-core";
@@ -22,6 +22,11 @@ interface BetterSupabaseProviderProps {
22
22
  readonly client: ClientLike;
23
23
  /** Better-supabase queries are removed when the user signs out or changes. */
24
24
  readonly queryClient?: QueryClient;
25
+ /**
26
+ * The Realtime client the hooks join with instead of the client's `supabase`,
27
+ * such as `useRealtimeRelay(url)` in a support session.
28
+ */
29
+ readonly realtime?: RealtimeClient;
25
30
  readonly children?: ReactNode;
26
31
  }
27
32
  /** Provides the better-supabase client to the hooks. */
@@ -450,7 +455,7 @@ interface PresenceHookOptions<I> {
450
455
  */
451
456
  readonly state?: I | null;
452
457
  /** A supabase-js client for apps without `<BetterSupabaseProvider>`. */
453
- readonly client?: SupabaseClient;
458
+ readonly client?: RealtimeClient;
454
459
  }
455
460
  interface Presence<I, O> {
456
461
  /** Everyone on the topic, this client included, from the last sync. */
@@ -480,6 +485,33 @@ interface PresenceTopic<P extends string, I, O> {
480
485
  */
481
486
  declare function usePresence<P extends string, I, O>(topic: PresenceTopic<P, I, O>, values: TemplateValues<P> | null | undefined, options?: PresenceHookOptions<I>): Presence<I, O>;
482
487
  //#endregion
488
+ //#region src/react/relay.d.ts
489
+ interface UseRealtimeRelayOptions extends RelayClientOptions {
490
+ /**
491
+ * `support` (the default): the relay only while a support session runs, as
492
+ * `useSupportSession()` reports it from the nearest `<SessionProvider>`.
493
+ * `always`: for apps that keep sessions in httpOnly cookies.
494
+ */
495
+ readonly when?: "support" | "always";
496
+ }
497
+ /**
498
+ * A `relayRealtimeClient(url)` while it is needed, else `undefined`. Pass it to
499
+ * `<BetterSupabaseProvider realtime={...}>`, and `useBroadcast`, `usePresence`,
500
+ * `useLiveQuery` and `useLiveCount` join through the server's `realtimeRelay`
501
+ * route, as the viewed user in a support session. The client is created once
502
+ * per `url` and options, so pass a stable `fetch` and `EventSource`.
503
+ *
504
+ * ```tsx
505
+ * const realtime = useRealtimeRelay("/api/realtime");
506
+ * return (
507
+ * <BetterSupabaseProvider client={bsb} realtime={realtime}>
508
+ * {children}
509
+ * </BetterSupabaseProvider>
510
+ * );
511
+ * ```
512
+ */
513
+ declare function useRealtimeRelay(url: string, options?: UseRealtimeRelayOptions): RealtimeClient | undefined;
514
+ //#endregion
483
515
  //#region src/react/search.d.ts
484
516
  interface DebouncedSearchOptions {
485
517
  /** Defaults to 250 ms. */
@@ -630,4 +662,4 @@ interface UseUploadOptions<R> {
630
662
  */
631
663
  declare function useUpload<T, R>(bucket: UploadTarget<T, R>, options?: UseUploadOptions<R>): Upload<T, R>;
632
664
  //#endregion
633
- export { useActionForm as $, useBlockEvent as A, useRecordListState as B, DataHooks as C, useBlockTenant as D, useBlockEnv as E, useRecordForm as F, RecordProviderProps as G, RecordContextValue as H, RecordListQueryStates as I, createRecordProvider as J, RecordState as K, RecordListState as L, useBlockQuery as M, RecordFormState as N, useController as O, UseRecordFormOptions as P, useAction as Q, RecordListUrl as R, useSyncStatus as S, defineDataHooks as T, RecordInitial as U, RecordActionsOf as V, RecordProviderKit as W, ActionHandle as X, ActionForm as Y, UseActionFormOptions as Z, PresenceHookOptions as _, Upload as a, useAuth as at, Conflicts as b, UseImageOptions as c, useLiveQuery as ct, useSignedUrl as d, BetterHooks as et, useUpload as f, Presence as g, useDebouncedSearch as h, StorageImage as i, createHooks as it, useBlockMutation as j, useLatest as k, UseUploadOptions as l, useSupabase as lt, DebouncedSearchOptions as m, SignedUrl as n, BetterSupabaseProviderProps as nt, UploadStatus as o, useBroadcast as ot, DebouncedSearch as p, RecordWriteHandlers as q, SignedUrlSource as r, LiveCount as rt, UploadTarget as s, useLiveCount as st, ImageSource as t, BetterSupabaseProvider as tt, useImage as u, PresenceTopic as v, DataView as w, useConflicts as x, usePresence as y, RecordListUrlState as z };
665
+ export { UseActionFormOptions as $, useController as A, RecordListUrl as B, useConflicts as C, defineDataHooks as D, DataView as E, RecordFormState as F, RecordInitial as G, useRecordListState as H, UseRecordFormOptions as I, RecordState as J, RecordProviderKit as K, useRecordForm as L, useBlockEvent as M, useBlockMutation as N, useBlockEnv as O, useBlockQuery as P, ActionHandle as Q, RecordListQueryStates as R, Conflicts as S, DataHooks as T, RecordActionsOf as U, RecordListUrlState as V, RecordContextValue as W, createRecordProvider as X, RecordWriteHandlers as Y, ActionForm as Z, useRealtimeRelay as _, Upload as a, LiveCount as at, PresenceTopic as b, UseImageOptions as c, useBroadcast as ct, useSignedUrl as d, useSupabase as dt, useAction as et, useUpload as f, UseRealtimeRelayOptions as g, useDebouncedSearch as h, StorageImage as i, BetterSupabaseProviderProps as it, useLatest as j, useBlockTenant as k, UseUploadOptions as l, useLiveCount as lt, DebouncedSearchOptions as m, SignedUrl as n, BetterHooks as nt, UploadStatus as o, createHooks as ot, DebouncedSearch as p, RecordProviderProps as q, SignedUrlSource as r, BetterSupabaseProvider as rt, UploadTarget as s, useAuth as st, ImageSource as t, useActionForm as tt, useImage as u, useLiveQuery as ut, Presence as v, useSyncStatus as w, usePresence as x, PresenceHookOptions as y, RecordListState as z };
@@ -2,9 +2,9 @@ import { t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { O as AnyFunctions, k as AnyModels } from "./types-DFdg_4yN.js";
3
3
  import { l as PublicEnv } from "./index-NRMMhhEi.js";
4
4
  import { g as SessionEncoding } from "./resolve-CXX6DHv3.js";
5
- import { t as BetterSupabase } from "./define-DFBnQyYg.js";
6
- import { i as KeyboardPort, l as StoragePort, n as DeepLinkPort, r as FilePickerPort, s as PushTokenPort, t as ClientPorts } from "./ports-CpdiQv1D.js";
7
- import { i as BindClientOptions, r as BetterClient } from "./bind-h5jre2K0.js";
5
+ import { t as BetterSupabase } from "./define-Cgru0_kF.js";
6
+ import { i as KeyboardPort, l as StoragePort, n as DeepLinkPort, r as FilePickerPort, s as PushTokenPort, t as ClientPorts } from "./ports-DnpAuTvB.js";
7
+ import { i as BindClientOptions, r as BetterClient } from "./bind-C801IaK-.js";
8
8
  import { n as FunctionContract } from "./function-contract-DxFNOmsm.js";
9
9
  import { FunctionInvokeOptions, SupabaseClient, SupabaseClientOptions } from "@supabase/supabase-js";
10
10
  //#region src/client/functions.d.ts
@@ -1,7 +1,7 @@
1
1
  import { E as AccessPolicySql } from "./types-DFdg_4yN.js";
2
- import { p as AnyBlocksConfig, t as AuthorizationFunctions } from "./authorization-HZdJCaVm.js";
3
- import { tt as ReadSet } from "./define-DFBnQyYg.js";
4
- import { E as TableGrant, Qt as ResolvedConfig, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, g as BlockSqlAccessProvider, h as BlockSql, hr as AppTableConfig, jr as CatalogPolicy, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-TGX2eDS5.js";
2
+ import { p as AnyBlocksConfig, t as AuthorizationFunctions } from "./authorization-CNsvnwle.js";
3
+ import { tt as ReadSet } from "./define-Cgru0_kF.js";
4
+ import { E as TableGrant, Qt as ResolvedConfig, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, g as BlockSqlAccessProvider, h as BlockSql, hr as AppTableConfig, jr as CatalogPolicy, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-CKCgjEDF.js";
5
5
  import { t as SubjectConfig } from "./subjects-DvmQeF_F.js";
6
6
  //#region src/sql/render.d.ts
7
7
  /** A module's SQL for `layout`, without header; `undefined` in custom mode. */
@@ -534,6 +534,11 @@ type PolicyCommand = "select" | "insert" | "update" | "delete";
534
534
  * app has no policy for is the block's to grant.
535
535
  */
536
536
  declare function widenedCommands(block: CatalogPolicy, apps: readonly CatalogPolicy[]): PolicyCommand[];
537
+ declare function appTablePolicyNotes(sql: string): {
538
+ readonly table: string;
539
+ readonly policy: string;
540
+ readonly commands: readonly PolicyCommand[];
541
+ }[];
537
542
  /**
538
543
  * The policies `sources` leave on each `schema.table` in `schemas`, in order: a
539
544
  * later `drop policy` removes one, and a later `create policy` of the same name
@@ -543,4 +548,4 @@ declare function declaredPolicies(sources: readonly {
543
548
  readonly text: string;
544
549
  }[], schemas: readonly string[]): Record<string, CatalogPolicy[]>;
545
550
  //#endregion
546
- export { modulePermissionKeys as $, sameTenantColumn as A, adoptedTables as B, extensionSchema as C, TenantQuery as D, subjectColumns as E, excludedColumns as F, DEFAULT_ROLES as G, APP_TABLES_MARKER as H, resolveExposeColumns as I, resolveBlocks as J, instanceFunctions as K, AdoptedTable as L, DataExportPlan as M, SECRET_COLUMNS as N, tenantsQuery as O, dataExportPlan as P, moduleHidingColumns as Q, AdoptedView as R, declaredViews as S, renderBlocks as St, rlsTables as T, APP_TABLES_MODULE as U, adoptedViews as V, appTablesFiles as W, BlockSqlPermissionKey as X, BlockSqlExtension as Y, moduleEventTriggers as Z, DeclaredView as _, upgradePlan as _t, hasColumnAccess as a, moduleDataDir as at, declaredTables as b, moduleBody as bt, compileReadSets as c, EntityRenameStep as ct, migrationOptionUses as d, currentBlockName as dt, moduleSchemaExtensions as et, moduleLayout as f, formerBlockName as ft, templateFunctions as g, moduleDeprecations as gt, scopeProblems as h, InstalledBlock as ht, scopePolicyName as i, sameBlockFile as it, sameTenantTrigger as j, expiredFlagsQuery as k, sharedRolesProblems as l, entityRenamePlan as lt, resolveProviderSql as m, BlockSqlUpgradePlan as mt, widenedCommands as n, isModuleDataFile as nt, CompiledReadSet as o, moduleFilePaths as ot, SCOPE_ID_TYPES as p, renamedBlock as pt, SQL_MODULES as q, TENANT_SCOPE_POLICY as r, moduleFileVersion as rt, compileReadSet as s, EntityRenamePlan as st, declaredPolicies as t, blockFileState as tt, MigrationOptionUse as u, BLOCK_RENAMES as ut, PolicyGrant as v, BlockSqlTopic as vt, policyGrants as w, declaredUpdatedAtTriggers as x, moduleTopics as xt, declaredTableColumns as y, customContracts as yt, adoptedColumnProblems as z };
551
+ export { moduleHidingColumns as $, expiredFlagsQuery as A, adoptedColumnProblems as B, declaredViews as C, renderBlocks as Ct, subjectColumns as D, rlsTables as E, dataExportPlan as F, appTablesFiles as G, adoptedViews as H, excludedColumns as I, SQL_MODULES as J, DEFAULT_ROLES as K, resolveExposeColumns as L, sameTenantTrigger as M, DataExportPlan as N, TenantQuery as O, SECRET_COLUMNS as P, moduleEventTriggers as Q, AdoptedTable as R, declaredUpdatedAtTriggers as S, moduleTopics as St, policyGrants as T, APP_TABLES_MARKER as U, adoptedTables as V, APP_TABLES_MODULE as W, BlockSqlExtension as X, resolveBlocks as Y, BlockSqlPermissionKey as Z, templateFunctions as _, moduleDeprecations as _t, scopePolicyName as a, sameBlockFile as at, declaredTableColumns as b, customContracts as bt, compileReadSet as c, EntityRenamePlan as ct, MigrationOptionUse as d, BLOCK_RENAMES as dt, modulePermissionKeys as et, migrationOptionUses as f, currentBlockName as ft, scopeProblems as g, InstalledBlock as gt, resolveProviderSql as h, BlockSqlUpgradePlan as ht, TENANT_SCOPE_POLICY as i, moduleFileVersion as it, sameTenantColumn as j, tenantsQuery as k, compileReadSets as l, EntityRenameStep as lt, SCOPE_ID_TYPES as m, renamedBlock as mt, declaredPolicies as n, blockFileState as nt, hasColumnAccess as o, moduleDataDir as ot, moduleLayout as p, formerBlockName as pt, instanceFunctions as q, widenedCommands as r, isModuleDataFile as rt, CompiledReadSet as s, moduleFilePaths as st, appTablePolicyNotes as t, moduleSchemaExtensions as tt, sharedRolesProblems as u, entityRenamePlan as ut, DeclaredView as v, upgradePlan as vt, extensionSchema as w, declaredTables as x, moduleBody as xt, PolicyGrant as y, BlockSqlTopic as yt, AdoptedView as z };
@@ -1,9 +1,57 @@
1
1
  import { b as DbError, f as Result } from "./result-DZeA5KS6.js";
2
2
  import { $ as RecordRef, ot as SchemaMeta } from "./types-DFdg_4yN.js";
3
- import { pt as QuerySpec } from "./define-DFBnQyYg.js";
3
+ import { pt as QuerySpec } from "./define-Cgru0_kF.js";
4
4
  import { t as DataChanges } from "./data-engine-BWoz9lED.js";
5
- import { c as RealtimeClient, m as Topic, p as SubscriptionStatus } from "./topic-DNFEFGKI.js";
5
+ import { c as RealtimeClient, m as Topic, p as SubscriptionStatus } from "./topic-BtLz-qTI.js";
6
+ import { n as TopicPort } from "./watch-topic-tnfOTa3-.js";
6
7
  import { StandardSchemaV1 } from "@standard-schema/spec";
8
+ //#region src/realtime/relay.d.ts
9
+ /** The `EventSource` the relay client reads with; the browser's fits. */
10
+ interface RelayEventSource {
11
+ readonly readyState: number;
12
+ addEventListener(type: string, listener: (event: {
13
+ readonly data?: unknown;
14
+ }) => void): void;
15
+ close(): void;
16
+ }
17
+ type RelayEventSourceConstructor = new (url: string, init?: {
18
+ withCredentials?: boolean;
19
+ }) => RelayEventSource;
20
+ interface RelayClientOptions {
21
+ /** Defaults to the global `EventSource`. */
22
+ readonly EventSource?: RelayEventSourceConstructor;
23
+ /** `fetch` for broadcasts; defaults to the global one. */
24
+ readonly fetch?: typeof fetch;
25
+ /**
26
+ * Milliseconds to wait for the first join before reporting `TIMED_OUT`.
27
+ * Defaults to 15000.
28
+ */
29
+ readonly timeoutMs?: number;
30
+ /** The longest wait between reconnects after the relay refused. Defaults to 30000. */
31
+ readonly maxBackoffMs?: number;
32
+ }
33
+ /**
34
+ * A Realtime client that joins topics through `realtimeRelay` on the server
35
+ * instead of a browser connection with the user's token: for support sessions
36
+ * ("view as user") and apps that keep sessions in httpOnly cookies. It has the
37
+ * `RealtimeClient` surface, so `defineTopic(...).subscribe`, `send`,
38
+ * `liveQuery`, `watchTopic` and the React hooks take it unchanged. Each topic
39
+ * is one server-sent event stream that reconnects on its own and reports a
40
+ * rejoin after a gap, so live queries refetch. Presence states arrive, but
41
+ * `track` answers `error`: presence is not relayed upstream.
42
+ *
43
+ * ```ts
44
+ * const realtime = relayRealtimeClient("/api/realtime");
45
+ * using sub = notifications.subscribe(realtime, { userId }, handlers);
46
+ * ```
47
+ */
48
+ declare function relayRealtimeClient(url: string, options?: RelayClientOptions): RealtimeClient;
49
+ /**
50
+ * The block controllers' realtime port over `realtimeRelay`:
51
+ * `topicPort(relayRealtimeClient(url, options))`.
52
+ */
53
+ declare function relayTopicPort(url: string, options?: RelayClientOptions): TopicPort;
54
+ //#endregion
7
55
  //#region src/realtime/subject-presence.d.ts
8
56
  /** The presence topic template; the subjects module's policies authorize it. */
9
57
  declare const SUBJECT_PRESENCE_TEMPLATE = "presence:{subjectType}:{subjectId}";
@@ -185,4 +233,4 @@ interface RealtimeChangesOptions {
185
233
  */
186
234
  declare function realtimeChanges(betterSupabase: LiveSource, client: RealtimeClient, options?: RealtimeChangesOptions): DataChanges;
187
235
  //#endregion
188
- export { subjectPresenceValues as _, LiveSource as a, liveCount as c, realtimeChanges as d, SUBJECT_PRESENCE_TEMPLATE as f, subjectPresenceTopic as g, subjectPresence as h, LiveQueryOptions as i, liveQuery as l, SubjectPresenceValues as m, LiveCountOptions as n, LiveSubscription as o, SubjectPresenceTopic as p, LiveCountSeed as r, RealtimeChangesOptions as s, CountRunner as t, liveTopic as u };
236
+ export { relayTopicPort as S, subjectPresenceValues as _, LiveSource as a, RelayEventSourceConstructor as b, liveCount as c, realtimeChanges as d, SUBJECT_PRESENCE_TEMPLATE as f, subjectPresenceTopic as g, subjectPresence as h, LiveQueryOptions as i, liveQuery as l, SubjectPresenceValues as m, LiveCountOptions as n, LiveSubscription as o, SubjectPresenceTopic as p, LiveCountSeed as r, RealtimeChangesOptions as s, CountRunner as t, liveTopic as u, RelayClientOptions as v, relayRealtimeClient as x, RelayEventSource as y };
package/dist/index.d.ts CHANGED
@@ -6,8 +6,8 @@ import { $ as RecordRef, A as BucketMeta, At as NoExtension, B as FunctionMeta,
6
6
  import { Ct as Events, O as BlockEventType, T as BlockEvent, a as EventHandler, bt as EventMap, c as MutationNotice, d as RpcNotice, i as ErrorEvent, l as QueryEvent, n as AuthOutageEvent, o as EventHub, r as BetterSupabaseEvents, s as EventName, t as AuthEvent, u as RefreshEvent } from "./events-vcqenSYU.js";
7
7
  import { i as silentLogger, n as Logger, r as consoleLogger, t as LogFields } from "./logger-DWVYUmwi.js";
8
8
  import { a as ProblemFormat, c as fromProblem, d as toProblem, i as ProblemDetails, l as isProblem, n as PROBLEM_CONTENT_TYPE, o as ProblemOptions, r as PROBLEM_TYPE_BASE, s as ProblemResponseOptions, t as BlockProblemOptions, u as problemResponse } from "./problem-DNwN8iGz.js";
9
- import { $t as MemoryCache, A as OffsetRangeArgs, At as IncludeArg, B as RowFilter, Bt as Payload, C as GetKey, Ct as AggregateRow, Dt as CountArgs, E as ManyWriteArgs, Et as CountArg, Ft as MeasureKey, G as UpsertManyArgs, Gt as SortDirection, H as RpcOptions, Ht as RelationMeasureArg, It as MutableWhere, J as DbStats, Jt as WhereInput, K as WriteArgs, Kt as SortSpec, L as Repository, Lt as NumericMeasureArg, Mt as JsonPathOps, Nt as ListArgs, O as OffsetPage, Ot as FieldFilter, P as PageOf, Pt as MeasureArg, Q as SearchArgs, Qt as CacheTarget, R as RepositoryOf, Rt as OrderByArg, S as FindExt, St as AggregateResult, T as ManyResult, Tt as ColumnOrderByArg, U as UpdateArgs, Ut as RequestArgs, Vt as ReadArgs, W as UpsertArgs, Wt as SelectArg, X as StatsRecorder, Xt as BucketsHelper, Y as EMPTY_STATS, Yt as BucketRegistry, Z as recordStats, Zt as CacheAdapter, _ as CursorPageArgs, _t as isQuerySpec, a as explainPostgrest, at as ReadSetParamTypes, b as DeleteArgs, bt as AggregateOrderBy, c as RpcDefinition, ct as ReadSetResult, d as BlocksHelper, dt as readSetTables, en as cacheTargetOf, et as InferReadSetParams, f as DbBlockSource, ft as InferResult, g as CursorPage, gt as TableSpecs, h as ConflictTarget, ht as Specs, i as PostgrestExecutorOptions, it as ReadSetParamType, jt as IncludeArgs, k as OffsetPageArgs, kt as GetArgs, l as SupabaseOptions, lt as defineReadSet, m as DbOf, mt as ReadMethod, n as defineSupabase, nn as rowKey, nt as ReadSetAuth, o as postgrestExecutor, ot as ReadSetParamValue, p as DbExtras, pt as QuerySpec, q as WriteManyArgs, qt as WhereArg, r as PostgrestClientLike, rn as rpcCacheTargets, rt as ReadSetOptions, s as ConnectOptions, st as ReadSetParams, t as BetterSupabase, tn as memoryCache, tt as ReadSet, ut as isReadSet, v as Db, vt as specTables, wt as ColumnOrderBy, x as DeleteExt, xt as AggregateOrderByArg, y as DbHelpers, yt as AggregateArgs, z as Returned, zt as OrderByInput } from "./define-DFBnQyYg.js";
10
- import { X as StoragePath } from "./bucket-CiNi8sIw.js";
9
+ import { $t as MemoryCache, A as OffsetRangeArgs, At as IncludeArg, B as RowFilter, Bt as Payload, C as GetKey, Ct as AggregateRow, Dt as CountArgs, E as ManyWriteArgs, Et as CountArg, Ft as MeasureKey, G as UpsertManyArgs, Gt as SortDirection, H as RpcOptions, Ht as RelationMeasureArg, It as MutableWhere, J as DbStats, Jt as WhereInput, K as WriteArgs, Kt as SortSpec, L as Repository, Lt as NumericMeasureArg, Mt as JsonPathOps, Nt as ListArgs, O as OffsetPage, Ot as FieldFilter, P as PageOf, Pt as MeasureArg, Q as SearchArgs, Qt as CacheTarget, R as RepositoryOf, Rt as OrderByArg, S as FindExt, St as AggregateResult, T as ManyResult, Tt as ColumnOrderByArg, U as UpdateArgs, Ut as RequestArgs, Vt as ReadArgs, W as UpsertArgs, Wt as SelectArg, X as StatsRecorder, Xt as BucketsHelper, Y as EMPTY_STATS, Yt as BucketRegistry, Z as recordStats, Zt as CacheAdapter, _ as CursorPageArgs, _t as isQuerySpec, a as explainPostgrest, at as ReadSetParamTypes, b as DeleteArgs, bt as AggregateOrderBy, c as RpcDefinition, ct as ReadSetResult, d as BlocksHelper, dt as readSetTables, en as cacheTargetOf, et as InferReadSetParams, f as DbBlockSource, ft as InferResult, g as CursorPage, gt as TableSpecs, h as ConflictTarget, ht as Specs, i as PostgrestExecutorOptions, it as ReadSetParamType, jt as IncludeArgs, k as OffsetPageArgs, kt as GetArgs, l as SupabaseOptions, lt as defineReadSet, m as DbOf, mt as ReadMethod, n as defineSupabase, nn as rowKey, nt as ReadSetAuth, o as postgrestExecutor, ot as ReadSetParamValue, p as DbExtras, pt as QuerySpec, q as WriteManyArgs, qt as WhereArg, r as PostgrestClientLike, rn as rpcCacheTargets, rt as ReadSetOptions, s as ConnectOptions, st as ReadSetParams, t as BetterSupabase, tn as memoryCache, tt as ReadSet, ut as isReadSet, v as Db, vt as specTables, wt as ColumnOrderBy, x as DeleteExt, xt as AggregateOrderByArg, y as DbHelpers, yt as AggregateArgs, z as Returned, zt as OrderByInput } from "./define-Cgru0_kF.js";
10
+ import { Q as StoragePath } from "./bucket-vc-QRrva.js";
11
11
  import { a as PostgrestPlan, n as PlanLimit, o as compilePostgrest, r as PlanOrder, t as PlanFilter } from "./postgrest-z-T0l23T.js";
12
12
  import { i as FieldSpec, n as TableSchema, o as TableSchemaSpec, r as tableSchema, t as StandardJSONSchemaV1 } from "./table-schema-BlF6k62Q.js";
13
13
  import { n as postgrestCompiler, t as Compiler } from "./compiler-D3UmE7ao.js";
@@ -1,5 +1,5 @@
1
1
  import { a as entityNoun, i as entityNames, n as checkEntityName, s as tenantRename, t as DEFAULT_TENANT } from "./entity-naming-Dtyq5sKE.js";
2
- import { E as PRESET_CATALOG, j as tenantNameOf } from "./app-tables-D29Rahtg.js";
2
+ import { E as PRESET_CATALOG, j as tenantNameOf } from "./app-tables-Q0TYfeih.js";
3
3
  //#region src/config/defaults.ts
4
4
  /**
5
5
  * Every default `resolveConfig` fills in. Other modules (the SQL module
@@ -1,4 +1,4 @@
1
1
  import { _ as FilterRule, a as FilterDateValue, b as encodeFilterQuery, c as FilterFieldLabels, d as FilterLimits, f as FilterNode, g as FilterRelativeDate, h as FilterQuery, i as FilterCombinator, l as FilterFieldType, m as FilterOperatorSpec, n as FILTER_OPERATOR_LABELS, o as FilterField, p as FilterOperatorArity, r as FilterClock, s as FilterFieldInfo, t as FILTER_OPERATORS, u as FilterGroupNode, v as ListFilterConfig, y as decodeFilterQuery } from "../filter-query-BXLs72G9.js";
2
- import { _ as UNSET, a as ListExtra, c as ListParseOptions, d as ListQuery, f as ListQueryConfig, g as ParserSpec, h as OpenApiParameter, i as ListDefinition, l as ListParseResult, m as ListSearchParams, n as FacetCounts, o as ListPage, p as ListQueryInput, r as FacetInfo, s as ListPagination, t as FacetCountFields, u as ListParsers, v as defineListQuery } from "../list-query-BDVutLFr.js";
2
+ import { _ as UNSET, a as ListExtra, c as ListParseOptions, d as ListQuery, f as ListQueryConfig, g as ParserSpec, h as OpenApiParameter, i as ListDefinition, l as ListParseResult, m as ListSearchParams, n as FacetCounts, o as ListPage, p as ListQueryInput, r as FacetInfo, s as ListPagination, t as FacetCountFields, u as ListParsers, v as defineListQuery } from "../list-query-DxjuIHEL.js";
3
3
  import { n as FilterRecordField, r as evaluateFilterQuery, t as FilterEvaluation } from "../filter-evaluate-CPxeae5X.js";
4
4
  export { FILTER_OPERATORS, FILTER_OPERATOR_LABELS, type FacetCountFields, type FacetCounts, type FacetInfo, type FilterClock, type FilterCombinator, type FilterDateValue, type FilterEvaluation, type FilterField, type FilterFieldInfo, type FilterFieldLabels, type FilterFieldType, type FilterGroupNode, type FilterLimits, type FilterNode, type FilterOperatorArity, type FilterOperatorSpec, type FilterQuery, type FilterRecordField, type FilterRelativeDate, type FilterRule, type ListDefinition, type ListExtra, type ListFilterConfig, type ListPage, type ListPagination, type ListParseOptions, type ListParseResult, type ListParsers, type ListQuery, type ListQueryConfig, type ListQueryInput, type ListSearchParams, type OpenApiParameter, type ParserSpec, UNSET, decodeFilterQuery, defineListQuery, encodeFilterQuery, evaluateFilterQuery };
@@ -1,6 +1,6 @@
1
1
  import { D as ValidationIssue, t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { O as AnyFunctions, a as CountMode, it as Row, k as AnyModels, ut as TableKey } from "./types-DFdg_4yN.js";
3
- import { At as IncludeArg, Bt as Payload, Jt as WhereInput, O as OffsetPage, R as RepositoryOf, Rt as OrderByArg, S as FindExt, Wt as SelectArg, _ as CursorPageArgs, g as CursorPage, k as OffsetPageArgs, t as BetterSupabase } from "./define-DFBnQyYg.js";
3
+ import { At as IncludeArg, Bt as Payload, Jt as WhereInput, O as OffsetPage, R as RepositoryOf, Rt as OrderByArg, S as FindExt, Wt as SelectArg, _ as CursorPageArgs, g as CursorPage, k as OffsetPageArgs, t as BetterSupabase } from "./define-Cgru0_kF.js";
4
4
  import { c as FilterFieldLabels, h as FilterQuery, o as FilterField, r as FilterClock, s as FilterFieldInfo, v as ListFilterConfig } from "./filter-query-BXLs72G9.js";
5
5
  import { StandardSchemaV1 } from "@standard-schema/spec";
6
6
  //#region src/list/list-query.d.ts
@@ -1,10 +1,10 @@
1
- import { t as VERSION } from "../cli/version-CyavsyGA.js";
2
- import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-DkplpIGe.js";
3
- import { t as loadSnapshot } from "../cli/snapshot-Bzcigm7T.js";
4
- import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-lJmHr0y9.js";
5
- import { i as discoverConfig, s as loadConfig } from "../cli/config-9t5ec_N7.js";
1
+ import { t as VERSION } from "../cli/version-T507a49w.js";
2
+ import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-oU0yHKf0.js";
3
+ import { t as loadSnapshot } from "../cli/snapshot-C6vh_n3t.js";
4
+ import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-ChIwdIOJ.js";
5
+ import { i as discoverConfig, s as loadConfig } from "../cli/config-2rwFHbwj.js";
6
6
  import { i as parseEnv, n as configEnvironment } from "../cli/env-DMgjB_4y.js";
7
- import { s as schemaStampPath } from "../cli/content-mapper-Cdx6arxu.js";
7
+ import { s as schemaStampPath } from "../cli/content-mapper-DLbXilBz.js";
8
8
  import { existsSync, realpathSync } from "node:fs";
9
9
  import { basename, dirname, join, resolve } from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -1,11 +1,11 @@
1
1
  import { O as AnyFunctions, k as AnyModels, ut as TableKey } from "../types-DFdg_4yN.js";
2
- import { t as OperationTable } from "../operations-CSc_IsHO.js";
2
+ import { t as OperationTable } from "../operations-Dc07aV_H.js";
3
3
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
4
- import { t as BetterSupabase } from "../define-DFBnQyYg.js";
5
- import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-7QPzW2bF.js";
4
+ import { t as BetterSupabase } from "../define-Cgru0_kF.js";
5
+ import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-gR4Q1aM0.js";
6
6
  import { r as GuardOptions } from "../respond-Dn1_YhC1.js";
7
7
  import { D as ResourceOperation } from "../model-hwpvole9.js";
8
- import { l as ResourceRouteOptions } from "../resource-types-DnKiH4G2.js";
8
+ import { l as ResourceRouteOptions } from "../resource-types-BIoz_ElD.js";
9
9
  import { StandardSchemaV1 } from "@standard-schema/spec";
10
10
  //#region src/mcp/dialect.d.ts
11
11
  /**
@@ -2,8 +2,8 @@ import { O as AnyFunctions, k as AnyModels } from "../../types-DFdg_4yN.js";
2
2
  import { r as AuthState } from "../../resolve-CXX6DHv3.js";
3
3
  import { i as CredentialRef, r as CredentialProvider } from "../../provider-CqwEOLCA.js";
4
4
  import { i as SupabaseMcpScope, n as SupabaseMcpModule, r as SupabaseMcpPlatformModule, t as SupabaseMcpFeature } from "../../supabase-mcp-Z4vtsuoO.js";
5
- import { t as BetterSupabase } from "../../define-DFBnQyYg.js";
6
- import { a as ServerContext$1, c as ServerOptions, n as BetterServer } from "../../server-types-7QPzW2bF.js";
5
+ import { t as BetterSupabase } from "../../define-Cgru0_kF.js";
6
+ import { a as ServerContext$1, c as ServerOptions, n as BetterServer } from "../../server-types-gR4Q1aM0.js";
7
7
  import { r as GuardOptions, t as AllowedCaller } from "../../respond-Dn1_YhC1.js";
8
8
  import { AuthInfo, CallToolResult, Icon, InputRequiredResult, OAuthTokenVerifier, RegisteredTool, ScopeChallengeHandler, ServerContext, StandardSchemaWithJSON, ToolAnnotations } from "@modelcontextprotocol/server";
9
9
  //#region src/mcp/sdk/sdk.d.ts
@@ -1,3 +1,54 @@
1
+ import { i as SessionWatchStatus, t as SessionStatusBody } from "../../session-status-qQLm7jzh.js";
2
+ //#region src/next/client/session-watch.d.ts
3
+ /**
4
+ * Why the session changed: Auth ended it or banned the user, the user signed
5
+ * out, or the claims or support target behind the session changed.
6
+ */
7
+ type SessionChangeReason = "ended" | "banned" | "signed_out" | "claims_changed";
8
+ interface SessionWatchEvent {
9
+ readonly reason: SessionChangeReason;
10
+ /** The route's answer; `null` when another tab reported the change. */
11
+ readonly status: SessionStatusBody | null;
12
+ /** `check`: this tab saw it. `tab`: another tab of the app did. */
13
+ readonly source: "check" | "tab";
14
+ }
15
+ interface SessionWatchOptions {
16
+ /** Where `sessionStatusRoute` is mounted. Defaults to `/api/session-status`. */
17
+ readonly url?: string;
18
+ /**
19
+ * Milliseconds between checks while the page is visible. Defaults to 60000; 0
20
+ * checks on focus and visibility only.
21
+ */
22
+ readonly intervalMs?: number;
23
+ /**
24
+ * The fingerprint the page rendered with, such as from the session status of
25
+ * the server render. Without it the first check sets it.
26
+ */
27
+ readonly fingerprint?: string | null;
28
+ /**
29
+ * The `BroadcastChannel` that tells the app's other tabs, or `false` for
30
+ * none. Defaults to `better-supabase:session`.
31
+ */
32
+ readonly channel?: string | false;
33
+ readonly fetch?: typeof fetch;
34
+ /** Called with every answer of the route, changed or not. */
35
+ readonly onStatus?: (status: SessionStatusBody) => void;
36
+ }
37
+ interface SessionWatcher {
38
+ /** Checks now; a check already running is reused. */
39
+ check(): Promise<SessionStatusBody | undefined>;
40
+ stop(): void;
41
+ }
42
+ /**
43
+ * Watches the session through `sessionStatusRoute`: checks when the window gets
44
+ * focus or becomes visible and on an interval while visible, and calls
45
+ * `onChange` when the session ended, the user was banned or signed out, or the
46
+ * claims fingerprint changed. Each change is posted to the app's other tabs,
47
+ * which call their own `onChange` with `source: "tab"`. Failed checks are
48
+ * ignored and retried on the next trigger.
49
+ */
50
+ export declare function watchSession(onChange: (event: SessionWatchEvent) => void, options?: SessionWatchOptions): SessionWatcher;
51
+ //#endregion
1
52
  //#region src/next/client/index.d.ts
2
53
  /** The `push` and `refresh` `useSessionChange` needs; next-intl's router fits. */
3
54
  export interface SessionChangeRouter {
@@ -33,4 +84,33 @@ export interface SessionChangeOptions {
33
84
  * ```
34
85
  */
35
86
  export declare function useSessionChange(changed: () => Promise<void>, router?: SessionChangeRouter, options?: SessionChangeOptions): (to?: string) => Promise<void>;
36
- //#endregion
87
+ export interface UseSessionWatchOptions extends SessionWatchOptions {
88
+ /**
89
+ * Replaces the default reaction. By default an ended, banned or signed-out
90
+ * session loads `redirect` (or the current page, which the proxy then sends
91
+ * to sign-in) as a full document load, and a claims change refreshes the
92
+ * router so Server Components render with the new claims.
93
+ */
94
+ readonly onChange?: (event: SessionWatchEvent) => void;
95
+ /** Where an ended session goes. Defaults to reloading the current page. */
96
+ readonly redirect?: string;
97
+ /** The router a claims change refreshes. Defaults to Next.js's. */
98
+ readonly router?: Pick<SessionChangeRouter, "refresh">;
99
+ /** Pauses the watch, e.g. on pages without a session. */
100
+ readonly enabled?: boolean;
101
+ }
102
+ /**
103
+ * Watches the session of an app that keeps it in httpOnly cookies, without a
104
+ * browser Supabase client: it asks `sessionStatusRoute` on focus, when the tab
105
+ * becomes visible and on an interval, and reacts when Auth ended the session,
106
+ * banned the user, the user signed out, or the claims or support target
107
+ * changed. Other tabs of the app hear each change through a `BroadcastChannel`.
108
+ * Returns the last answer.
109
+ *
110
+ * ```tsx
111
+ * useSessionWatch({ url: "/api/session-status", redirect: "/sign-in" });
112
+ * ```
113
+ */
114
+ export declare function useSessionWatch(options?: UseSessionWatchOptions): SessionStatusBody | undefined;
115
+ //#endregion
116
+ export type { SessionChangeReason, SessionStatusBody, SessionWatchEvent, SessionWatchOptions, SessionWatchStatus, SessionWatcher };