better-supabase 0.43.0 → 0.45.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 (472) hide show
  1. package/dist/{access-sql-Dao1C0fz.js → access-sql-BHat-brX.js} +1 -0
  2. package/dist/{adapter-ddQ9Hzka.js → adapter-C0C4jIwI.js} +153 -4
  3. package/dist/{agents-BAiLeoR-.d.ts → agents-DxhGxwDS.d.ts} +4 -4
  4. package/dist/{ai-cache-B94R1da7.d.ts → ai-cache-OkvpE7L-.d.ts} +4 -4
  5. package/dist/{ai-chat-rQ7Ftq9W.d.ts → ai-chat-LHWztFya.d.ts} +4 -4
  6. package/dist/{ai-schedules-DIiPmFgn.d.ts → ai-schedules-BP0PBKhY.d.ts} +5 -5
  7. package/dist/ai-sdk/agents/index.d.ts +6 -6
  8. package/dist/ai-sdk/batches/index.d.ts +3 -3
  9. package/dist/ai-sdk/cache/index.d.ts +1 -1
  10. package/dist/ai-sdk/chat/index.d.ts +2 -2
  11. package/dist/ai-sdk/embeddings/index.d.ts +2 -2
  12. package/dist/ai-sdk/files/index.d.ts +1 -1
  13. package/dist/ai-sdk/index.d.ts +5 -5
  14. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  15. package/dist/ai-sdk/memory/index.d.ts +3 -3
  16. package/dist/ai-sdk/memory/index.js +1 -1
  17. package/dist/ai-sdk/workflow/index.d.ts +3 -3
  18. package/dist/{api-CbY2qdzT.d.ts → api-CgO8Gin7.d.ts} +6 -6
  19. package/dist/{api-wwix_K5c.js → api-DXCaMM2S.js} +1 -1
  20. package/dist/{api-keys-U3JQ8IlM.d.ts → api-keys-DINjcAaY.d.ts} +4 -4
  21. package/dist/{app-tables-CVMn4c4b.d.ts → app-tables-Dg9lERHb.d.ts} +1 -1
  22. package/dist/{approvals-CYbTzQ7v.d.ts → approvals-CoBe9E2b.d.ts} +6 -6
  23. package/dist/{assistant-B1p5mYaM.d.ts → assistant-DMaZZFps.d.ts} +2 -2
  24. package/dist/astro/index.d.ts +7 -7
  25. package/dist/astro/index.js +4 -5
  26. package/dist/{authorization-hGBtxrnQ.d.ts → authorization-CcWVJSsN.d.ts} +82 -22
  27. package/dist/{authorization-hooks-CR8TVvqo.d.ts → authorization-hooks-u2Z18CAM.d.ts} +2 -2
  28. package/dist/authz-refresh-C_zK-BdX.js +115 -0
  29. package/dist/authz-refresh-DIqPTJZe.d.ts +79 -0
  30. package/dist/{auth-link-BmJsQG4a.js → authz-refresh-DQ0Q_1_V.js} +87 -1
  31. package/dist/authz-refresh-Nc-38Xeh.d.ts +38 -0
  32. package/dist/authz-topic-C7n3kIm_.d.ts +21 -0
  33. package/dist/{automations-K0O3En6E.js → automations-Bk-_P7Zp.js} +2 -1
  34. package/dist/better-result/index.d.ts +3 -3
  35. package/dist/{bind-DWAIKYvJ.d.ts → bind-BieIoT6r.d.ts} +7 -7
  36. package/dist/{block-env-C6OEu9Xk.d.ts → block-env-YzSHv579.d.ts} +4 -4
  37. package/dist/{block-helpers-Sj-efEhC.d.ts → block-helpers-DzIR3Ob8.d.ts} +1 -1
  38. package/dist/{block-hooks-VW4knarE.d.ts → block-hooks-D9NKzUqW.d.ts} +2 -2
  39. package/dist/{block-subjects-B1zfhFWC.js → block-subjects-CTIsFATg.js} +1 -1
  40. package/dist/{block-subjects-Bkieh2Xk.d.ts → block-subjects-hcIVjfyD.d.ts} +1 -1
  41. package/dist/{block-tables-BIExrL2J.d.ts → block-tables-D-UjSTXa.d.ts} +1 -1
  42. package/dist/{block-transport-CDmOUuLZ.d.ts → block-transport-Do7J4MsA.d.ts} +2 -2
  43. package/dist/blocks/access-requests/index.d.ts +5 -5
  44. package/dist/blocks/activities/index.d.ts +10 -10
  45. package/dist/blocks/activities/index.js +1 -1
  46. package/dist/blocks/agents/index.d.ts +4 -4
  47. package/dist/blocks/ai-cache/index.d.ts +3 -3
  48. package/dist/blocks/ai-chat/index.d.ts +8 -8
  49. package/dist/blocks/ai-files/index.d.ts +3 -3
  50. package/dist/blocks/ai-keys/index.d.ts +4 -4
  51. package/dist/blocks/ai-schedules/index.d.ts +3 -3
  52. package/dist/blocks/announcements/index.d.ts +8 -8
  53. package/dist/blocks/api-keys/index.d.ts +3 -3
  54. package/dist/blocks/approvals/index.d.ts +4 -4
  55. package/dist/blocks/assets/index.d.ts +6 -6
  56. package/dist/blocks/assignment/index.d.ts +7 -7
  57. package/dist/blocks/attachments/index.d.ts +4 -4
  58. package/dist/blocks/audit/index.d.ts +13 -13
  59. package/dist/blocks/audit/index.js +1 -1
  60. package/dist/blocks/automations/index.d.ts +12 -12
  61. package/dist/blocks/billable-time/index.d.ts +6 -6
  62. package/dist/blocks/billing/index.d.ts +9 -9
  63. package/dist/blocks/bookings/index.d.ts +4 -4
  64. package/dist/blocks/bulk/index.d.ts +4 -4
  65. package/dist/blocks/calendar/index.d.ts +5 -5
  66. package/dist/blocks/catalog/index.d.ts +6 -6
  67. package/dist/blocks/channels/index.d.ts +7 -7
  68. package/dist/blocks/collections/index.d.ts +6 -6
  69. package/dist/blocks/comments/index.d.ts +10 -10
  70. package/dist/blocks/compliance/index.d.ts +26 -10
  71. package/dist/blocks/compliance/index.js +38 -4
  72. package/dist/blocks/connectors/index.d.ts +4 -4
  73. package/dist/blocks/contacts/index.d.ts +52 -9
  74. package/dist/blocks/contacts/index.js +48 -5
  75. package/dist/blocks/content/index.d.ts +5 -5
  76. package/dist/blocks/contracts/index.d.ts +6 -6
  77. package/dist/blocks/courses/index.d.ts +22 -7
  78. package/dist/blocks/courses/index.js +11 -0
  79. package/dist/blocks/created-by/index.d.ts +2 -2
  80. package/dist/blocks/custom-fields/index.d.ts +7 -7
  81. package/dist/blocks/custom-fields/index.js +1 -1
  82. package/dist/blocks/data-lifecycle/index.d.ts +8 -8
  83. package/dist/blocks/deals/index.d.ts +6 -6
  84. package/dist/blocks/dispatch/index.d.ts +6 -6
  85. package/dist/blocks/documents/index.d.ts +4 -4
  86. package/dist/blocks/domains/index.d.ts +6 -6
  87. package/dist/blocks/donations/index.d.ts +6 -6
  88. package/dist/blocks/drive/index.d.ts +6 -6
  89. package/dist/blocks/employees/index.d.ts +8 -8
  90. package/dist/blocks/enrichment/index.d.ts +6 -6
  91. package/dist/blocks/enrollments/index.d.ts +6 -6
  92. package/dist/blocks/entitlements/index.d.ts +6 -6
  93. package/dist/blocks/expenses/index.d.ts +5 -5
  94. package/dist/blocks/field-history/index.d.ts +4 -4
  95. package/dist/blocks/flags/index.d.ts +5 -5
  96. package/dist/blocks/forecasts/index.d.ts +6 -6
  97. package/dist/blocks/forms/index.d.ts +6 -6
  98. package/dist/blocks/goals/index.d.ts +5 -5
  99. package/dist/blocks/goals/index.js +1 -1
  100. package/dist/blocks/guests/index.d.ts +6 -6
  101. package/dist/blocks/guests/index.js +2 -2
  102. package/dist/blocks/hiring/index.d.ts +6 -6
  103. package/dist/blocks/identities/index.d.ts +5 -5
  104. package/dist/blocks/imports/index.d.ts +5 -5
  105. package/dist/blocks/inbox/index.d.ts +10 -10
  106. package/dist/blocks/incidents/index.d.ts +5 -5
  107. package/dist/blocks/index.d.ts +9 -9
  108. package/dist/blocks/inventory/index.d.ts +6 -6
  109. package/dist/blocks/invoices/index.d.ts +13 -8
  110. package/dist/blocks/invoices/index.js +2 -1
  111. package/dist/blocks/knowledge/index.d.ts +3 -3
  112. package/dist/blocks/lead-scoring/index.d.ts +7 -7
  113. package/dist/blocks/leases/index.d.ts +6 -6
  114. package/dist/blocks/leave/index.d.ts +5 -5
  115. package/dist/blocks/ledger/index.d.ts +6 -6
  116. package/dist/blocks/mail-sync/index.d.ts +5 -5
  117. package/dist/blocks/memberships/index.d.ts +2 -2
  118. package/dist/blocks/memory/index.d.ts +4 -4
  119. package/dist/blocks/messaging/index.d.ts +11 -11
  120. package/dist/blocks/metrics/index.d.ts +6 -6
  121. package/dist/blocks/mfa/index.d.ts +2 -2
  122. package/dist/blocks/moderation/index.d.ts +6 -6
  123. package/dist/blocks/notifications/index.d.ts +11 -11
  124. package/dist/blocks/numbering/index.d.ts +4 -4
  125. package/dist/blocks/oauth-server/index.d.ts +64 -38
  126. package/dist/blocks/oauth-server/index.js +6 -3
  127. package/dist/blocks/onboarding/index.d.ts +5 -5
  128. package/dist/blocks/orders/index.d.ts +7 -7
  129. package/dist/blocks/organizations/index.d.ts +8 -8
  130. package/dist/blocks/outbox/index.d.ts +4 -4
  131. package/dist/blocks/passes/index.d.ts +8 -8
  132. package/dist/blocks/permissions/index.d.ts +7 -7
  133. package/dist/blocks/pipelines/index.d.ts +6 -6
  134. package/dist/blocks/posts/index.d.ts +5 -5
  135. package/dist/blocks/profiles/index.d.ts +4 -4
  136. package/dist/blocks/promotions/index.d.ts +5 -5
  137. package/dist/blocks/push/index.d.ts +7 -7
  138. package/dist/blocks/queue/index.d.ts +7 -7
  139. package/dist/blocks/queue/index.js +4 -4
  140. package/dist/blocks/quotes/index.d.ts +20 -13
  141. package/dist/blocks/quotes/index.js +3 -2
  142. package/dist/blocks/rank/index.d.ts +4 -4
  143. package/dist/blocks/reactions/index.d.ts +9 -9
  144. package/dist/blocks/relations/index.d.ts +7 -7
  145. package/dist/blocks/reminders/index.d.ts +8 -8
  146. package/dist/blocks/reviews/index.d.ts +5 -5
  147. package/dist/blocks/saved-views/index.d.ts +6 -6
  148. package/dist/blocks/scores/index.d.ts +5 -5
  149. package/dist/blocks/search/index.d.ts +7 -7
  150. package/dist/blocks/security-events/index.d.ts +7 -7
  151. package/dist/blocks/segments/index.d.ts +7 -7
  152. package/dist/blocks/sequences/index.d.ts +6 -6
  153. package/dist/blocks/service-accounts/index.d.ts +5 -5
  154. package/dist/blocks/service-accounts/index.js +1 -1
  155. package/dist/blocks/sessions/index.d.ts +2 -2
  156. package/dist/blocks/settings/index.d.ts +6 -6
  157. package/dist/blocks/share-links/index.d.ts +5 -5
  158. package/dist/blocks/shipments/index.d.ts +6 -6
  159. package/dist/blocks/signatures/index.d.ts +14 -6
  160. package/dist/blocks/signatures/index.js +3 -1
  161. package/dist/blocks/signing-keys/index.d.ts +4 -4
  162. package/dist/blocks/sla/index.d.ts +7 -7
  163. package/dist/blocks/sso/index.d.ts +6 -6
  164. package/dist/blocks/state-machine/index.d.ts +5 -5
  165. package/dist/blocks/subjects/index.d.ts +6 -6
  166. package/dist/blocks/tags/index.d.ts +6 -6
  167. package/dist/blocks/tasks/index.d.ts +9 -9
  168. package/dist/blocks/teams/index.d.ts +4 -4
  169. package/dist/blocks/templates/index.d.ts +8 -8
  170. package/dist/blocks/time-tracking/index.d.ts +7 -7
  171. package/dist/blocks/timeline/index.d.ts +9 -9
  172. package/dist/blocks/timeline/index.js +1 -1
  173. package/dist/blocks/trash/index.d.ts +6 -6
  174. package/dist/blocks/undo/index.d.ts +4 -4
  175. package/dist/blocks/updated-at/index.d.ts +2 -2
  176. package/dist/blocks/usage/index.d.ts +4 -4
  177. package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
  178. package/dist/blocks/versions/index.d.ts +6 -6
  179. package/dist/blocks/waitlist/index.d.ts +5 -5
  180. package/dist/blocks/webhooks/index.d.ts +13 -13
  181. package/dist/blocks/workflow-editor/index.d.ts +9 -9
  182. package/dist/blocks/workflows/index.d.ts +7 -7
  183. package/dist/{bookings-CHUzFwOI.d.ts → bookings-Du1lvUg1.d.ts} +3 -3
  184. package/dist/{bucket-CrsJNHzi.d.ts → bucket-CjIhrluq.d.ts} +1 -1
  185. package/dist/cache-tags-C5Oivuxo.js +27 -0
  186. package/dist/{sign-in-D5Bg7R47.d.ts → cache-tags-DrywUP3I.d.ts} +16 -2
  187. package/dist/chat-sdk/index.d.ts +6 -6
  188. package/dist/claims/index.d.ts +6 -6
  189. package/dist/claims/index.js +1 -1
  190. package/dist/cli/{add-fdZAY8C_.js → add-B5Gq34wX.js} +12 -12
  191. package/dist/cli/add-D_JV6V6k.js +1 -0
  192. package/dist/cli/{add-uwUI80aZ.js → add-DcLNy2oN.js} +2 -2
  193. package/dist/cli/{app-table-files-BR_7lT4u.js → app-table-files-CcGWy0qX.js} +14 -6
  194. package/dist/cli/{app-tables-DoxrhJb1.js → app-tables-RbPMD2M3.js} +2 -2
  195. package/dist/cli/{backfill-BTMgDL6X.js → backfill-BJterqcQ.js} +3 -3
  196. package/dist/cli/bin.js +1 -1
  197. package/dist/cli/{blocks-Bj0LS3rF.js → blocks-BBALfFv-.js} +1 -1
  198. package/dist/cli/{blocks-BgPbXNhB.js → blocks-DsAwI_4v.js} +1 -1
  199. package/dist/cli/{cache-CEGpAmXJ.js → cache-DRb1xVPh.js} +1 -1
  200. package/dist/cli/{codemod-CaXGpQ10.js → codemod-Cpd4DnrL.js} +1 -1
  201. package/dist/cli/{config-CrwCec-B.js → config-CGVmcEZa.js} +1 -1
  202. package/dist/cli/{config-DrrkMihk.js → config-Dy-BAGel.js} +34 -5
  203. package/dist/cli/{content-mapper-BJRfCnFX.js → content-mapper-D0riSMnP.js} +2 -2
  204. package/dist/cli/{db-bK5eCLaE.js → db-BCVXzXDA.js} +2 -2
  205. package/dist/cli/{doctor-CHQDLcwL.js → doctor-CHmX2gau.js} +273 -230
  206. package/dist/cli/{gen-DSK152A3.js → gen-DB0svRc8.js} +14 -14
  207. package/dist/cli/index.d.ts +1 -1
  208. package/dist/cli/index.js +7 -7
  209. package/dist/cli/{init-CPC1ceqC.js → init-B4fQNe4C.js} +9 -9
  210. package/dist/cli/{live-BFXisTDf.js → live-Bft5EE70.js} +2 -2
  211. package/dist/cli/{mcp-CrulrTBs.js → mcp-BKcS-LZw.js} +2 -2
  212. package/dist/cli/{metadata-yePOltZY.js → metadata-CgKNmMsc.js} +3 -3
  213. package/dist/cli/{migrate-kjYx7du-.js → migrate-ehxT23Gg.js} +1 -1
  214. package/dist/cli/{migration-safety-DnvCYRsw.js → migration-safety-D2gG-dDs.js} +2 -2
  215. package/dist/cli/{migrations-ZYHA0gks.js → migrations-CQ1Sgz_X.js} +2 -2
  216. package/dist/cli/{module-migration-Du7UHsO9.js → module-migration-BOPJUkIX.js} +2 -2
  217. package/dist/cli/powersync-B8GWjT_L.js +1 -0
  218. package/dist/cli/{powersync-BOxy1_xW.js → powersync-BTari5WF.js} +20 -4
  219. package/dist/cli/{print-B4OqfSML.js → print-BMJnlJ8k.js} +2 -2
  220. package/dist/cli/{providers-KYOKi_jp.js → providers-BNZ-OqMI.js} +1 -1
  221. package/dist/cli/{prune-workflows-7JISyAI7.js → prune-workflows-BG55npqs.js} +3 -3
  222. package/dist/cli/{remove-DvncDSRp.js → remove-BIqGDE0A.js} +5 -5
  223. package/dist/cli/{render-C6dQ0C0Y.js → render-BIC4Wctz.js} +4 -4
  224. package/dist/cli/{run-BYiApqFR.js → run-BJ4_rmHy.js} +9 -9
  225. package/dist/cli/{run-DWDRg4vp.js → run-C_slJx8m.js} +32 -32
  226. package/dist/cli/{seed-DSC6f0oh.js → seed-0r_0aD8_.js} +2 -2
  227. package/dist/cli/seed-DX1NTTOK.js +1 -0
  228. package/dist/cli/{shared-DC86fQYk.js → shared-DhpBDjRa.js} +1 -1
  229. package/dist/cli/{snapshot-CwCG_YX2.js → snapshot-CMJksw-t.js} +3 -3
  230. package/dist/cli/{source-DDxRHVzk.js → source-CJilfcq-.js} +1 -1
  231. package/dist/cli/{source-args-Bz5QQne2.js → source-args-CgCX8KUJ.js} +1 -1
  232. package/dist/cli/{spec-Cnxqc7kC.js → spec-Br9cWMbU.js} +2 -2
  233. package/dist/cli/{spec-CvKJ6GpI.js → spec-CnjHA0br.js} +1 -1
  234. package/dist/cli/{sql-layout-BwbfVSR8.js → sql-layout-BCiEl_G5.js} +32 -13
  235. package/dist/cli/{sync-lpbLqJly.js → sync-Bulv1zyy.js} +4 -4
  236. package/dist/cli/{table-BIQA9Hdt.js → table-BAR0cLmU.js} +1 -1
  237. package/dist/cli/{upgrade-34ZODJZj.js → upgrade-C8fiTE3r.js} +2 -2
  238. package/dist/cli/{upgrade-Cq4EFBH7.js → upgrade-DTBvTAAV.js} +5 -5
  239. package/dist/cli/{version-BGN5319Z.js → version-hhuwVLKj.js} +1 -1
  240. package/dist/client/index.d.ts +6 -6
  241. package/dist/client/native/index.d.ts +7 -31
  242. package/dist/client/native/index.js +2 -2
  243. package/dist/{cloud-event-BjgxkfJJ.d.ts → cloud-event-LTUGgt6D.d.ts} +1 -1
  244. package/dist/{compiler-BOW4yPcW.d.ts → compiler-CJorTlU7.d.ts} +2 -2
  245. package/dist/{composite-DPN4SFud.d.ts → composite-BCUNxZCd.d.ts} +7 -7
  246. package/dist/{composite-BidYZWZY.js → composite-C3lLpMys.js} +2 -2
  247. package/dist/config/index.d.ts +5 -5
  248. package/dist/config/index.js +5 -5
  249. package/dist/{config-C-eXOuhp.js → config-DA_R9O_y.js} +3 -3
  250. package/dist/{config-BN17nVp1.js → config-HOXkrND2.js} +1 -1
  251. package/dist/{connectors-OMJkoAP6.d.ts → connectors-DTxDzUzD.d.ts} +4 -4
  252. package/dist/{context-Dga2sgyx.d.ts → context-BJK9_ppk.d.ts} +38 -4
  253. package/dist/contract/index.d.ts +11 -10
  254. package/dist/{controller-BFOCK5AG.d.ts → controller-TplPQG5m.d.ts} +1 -1
  255. package/dist/{conversion-BShzA-u-.d.ts → conversion-DwDBNeWT.d.ts} +1 -1
  256. package/dist/create/index.d.ts +3 -3
  257. package/dist/create/index.js +18 -3
  258. package/dist/create/lite/index.d.ts +4 -4
  259. package/dist/create/lite/index.js +3 -3
  260. package/dist/credentials/index.d.ts +4 -4
  261. package/dist/{data-engine-CX1oYDZl.d.ts → data-engine-ZcGeVz1i.d.ts} +7 -1
  262. package/dist/{define-C_He1bQO.d.ts → define-DXQHQ2Qy.d.ts} +5 -5
  263. package/dist/{define-block-DBD7yhQg.d.ts → define-block-tFQZ8936.d.ts} +12 -12
  264. package/dist/{documents-CNVPrE_0.d.ts → documents-Ciijx56T.d.ts} +3 -3
  265. package/dist/edge/index.d.ts +9 -9
  266. package/dist/edge/index.js +6 -7
  267. package/dist/elysia/index.d.ts +1 -1
  268. package/dist/elysia/index.js +1 -1
  269. package/dist/{embeddings-C2PBJ2Lx.d.ts → embeddings-LhxY3bUD.d.ts} +1 -1
  270. package/dist/{ended-BwpmNC5k.d.ts → ended-CpyW7_0h.d.ts} +2 -2
  271. package/dist/{entitlements-C5k_9hHt.d.ts → entitlements-SqfT4gk_.d.ts} +2 -2
  272. package/dist/eve/index.d.ts +9 -9
  273. package/dist/eve/index.js +1 -1
  274. package/dist/{eve-CtQd4iaO.d.ts → eve-DmbLji3M.d.ts} +2 -2
  275. package/dist/events/index.d.ts +3 -3
  276. package/dist/{events-DddDlibJ.d.ts → events-BrgD2StJ.d.ts} +3 -1
  277. package/dist/{executor-CxMHiDp_.d.ts → executor-DlAtlYxY.d.ts} +4 -4
  278. package/dist/{executor-DL7cZ-3T.d.ts → executor-kfUaLlQr.d.ts} +1 -1
  279. package/dist/{executor-DoSNec_H.d.ts → executor-rs231gO_.d.ts} +1 -1
  280. package/dist/expo/index.d.ts +51 -8
  281. package/dist/expo/index.js +89 -4
  282. package/dist/{field-errors-LVBXokQN.d.ts → field-errors-DyWpuH1q.d.ts} +10 -10
  283. package/dist/{field-formats-DVukMbRa.d.ts → field-formats-BJeg-rv8.d.ts} +13 -3
  284. package/dist/{field-formats-Cap-V7UP.js → field-formats-sLYMh1ZK.js} +52 -4
  285. package/dist/{fields-CP46SPNE.d.ts → fields-OVgN0HOy.d.ts} +1 -1
  286. package/dist/{filter-evaluate-Bkbb0nuQ.d.ts → filter-evaluate-BzyMp2LO.d.ts} +1 -1
  287. package/dist/{filter-query-Xj40B5KT.d.ts → filter-query-BcheQ5zK.d.ts} +1 -1
  288. package/dist/{flags-BrXfCmGB.d.ts → flags-D71LTDHR.d.ts} +2 -2
  289. package/dist/flags-sdk/index.d.ts +2 -2
  290. package/dist/{framework-B6JAPr1i.d.ts → framework-C8HFM1bX.d.ts} +8 -8
  291. package/dist/{framework-z3KTPRjk.js → framework-DydnLrMk.js} +1 -1
  292. package/dist/{gateway-DJX-XUWl.d.ts → gateway-DQirTFOg.d.ts} +3 -3
  293. package/dist/guest-actions-Du1ph4dE.js +11 -0
  294. package/dist/h3/index.d.ts +1 -1
  295. package/dist/h3/index.js +1 -1
  296. package/dist/h3/v1/index.d.ts +1 -1
  297. package/dist/h3/v1/index.js +1 -1
  298. package/dist/hono/index.d.ts +9 -9
  299. package/dist/hono/index.js +5 -6
  300. package/dist/{inbox-DiQ8KhG8.d.ts → inbox-nk8pqL8V.d.ts} +5 -5
  301. package/dist/{index-1_-lg9Gc.d.ts → index-0erPlzHd.d.ts} +5 -5
  302. package/dist/{index-1uV69AZq.d.ts → index-BKDvrKDl.d.ts} +1 -1
  303. package/dist/{index-CjN6kzvL.d.ts → index-BjN_IQQd.d.ts} +5 -5
  304. package/dist/{index-DjJUamhw.d.ts → index-Brzh6XAW.d.ts} +5 -4
  305. package/dist/{index-CvLTqmdq.d.ts → index-CwDdMCdH.d.ts} +1 -1
  306. package/dist/{index-BA8sPQ49.d.ts → index-DCyNdhEC.d.ts} +5 -5
  307. package/dist/{index-DBbdaYAH.d.ts → index-DcmDWojr.d.ts} +1 -1
  308. package/dist/{index-DUmsXPdh.d.ts → index-Ddjcn6i7.d.ts} +5 -5
  309. package/dist/{index-DwP65vFk.d.ts → index-DkmorC1b.d.ts} +5 -5
  310. package/dist/{index-D-SIdOiL.d.ts → index-vGZZjCW7.d.ts} +14 -14
  311. package/dist/{index-BhmjjkMu.d.ts → index-x2YRPbXr.d.ts} +6 -6
  312. package/dist/index.d.ts +7 -7
  313. package/dist/index.js +1 -1
  314. package/dist/{instances-Bx94JGSW.js → instances-DGtu3S0m.js} +111 -15
  315. package/dist/{kit-lHFpu2_1.d.ts → kit-C1GVbhtg.d.ts} +4 -4
  316. package/dist/{kit-D5rRAKWJ.js → kit-CB3AfM9W.js} +106 -4
  317. package/dist/{knowledge-DtECa_QW.d.ts → knowledge-CCOSNGJp.d.ts} +5 -5
  318. package/dist/lint/index.d.ts +1 -1
  319. package/dist/list/index.d.ts +3 -3
  320. package/dist/{list-query-BkbLV-Yc.d.ts → list-query-CF-5EUVX.d.ts} +3 -3
  321. package/dist/mapper/bin.js +7 -6
  322. package/dist/mcp/index.d.ts +3 -3
  323. package/dist/mcp/index.js +4 -5
  324. package/dist/mcp/sdk/index.d.ts +6 -6
  325. package/dist/mcp/sdk/index.js +2 -2
  326. package/dist/{messaging-CpQIhkFi.d.ts → messaging-2-SIPAp-.d.ts} +4 -4
  327. package/dist/nestjs/index.d.ts +2 -2
  328. package/dist/nestjs/index.js +1 -1
  329. package/dist/next/client/index.d.ts +1 -1
  330. package/dist/next/index.d.ts +29 -76
  331. package/dist/next/index.js +29 -117
  332. package/dist/node/index.d.ts +2 -2
  333. package/dist/node/index.js +1 -1
  334. package/dist/{operations-J0PkKTaF.d.ts → operations-CkgwsViz.d.ts} +1 -1
  335. package/dist/options-Cdr6Ac4-.d.ts +12 -0
  336. package/dist/{options-DUNUGuhM.js → options-CpSqyI8k.js} +4 -1
  337. package/dist/orpc/index.d.ts +8 -8
  338. package/dist/orpc/index.js +3 -4
  339. package/dist/otel/index.d.ts +3 -3
  340. package/dist/otel/index.js +5 -5
  341. package/dist/{outbox-Cpxpzcue.d.ts → outbox-DL2737I0.d.ts} +4 -4
  342. package/dist/{permissions-Cp2qvVJo.d.ts → permissions-vbtGrV26.d.ts} +1 -1
  343. package/dist/{pool-BJAjQcrJ.d.ts → pool-DfDolmmm.d.ts} +3 -3
  344. package/dist/{ports-C61eesjD.d.ts → ports-ClyPs0q6.d.ts} +1 -1
  345. package/dist/postgres/index.d.ts +4 -4
  346. package/dist/{postgrest-Bjain6nf.d.ts → postgrest-CF0ekbC-.d.ts} +1 -1
  347. package/dist/powersync/index.d.ts +44 -10
  348. package/dist/powersync/index.js +52 -5
  349. package/dist/preset/index.d.ts +3 -3
  350. package/dist/preset/index.js +3 -3
  351. package/dist/{preset-yRJgGbn9.js → preset-His18bto.js} +3 -3
  352. package/dist/{project-ps9mOsLx.js → project-D81NwLP6.js} +13 -7
  353. package/dist/{provider-CVlXXbda.d.ts → provider-DxJWo8yD.d.ts} +1 -1
  354. package/dist/{push-token-2LRdwl_8.d.ts → push-token-DMOeO8cU.d.ts} +1 -1
  355. package/dist/query/index.d.ts +1 -1
  356. package/dist/react/index.d.ts +9 -10
  357. package/dist/react/index.js +3 -3
  358. package/dist/react/native/index.d.ts +38 -1
  359. package/dist/react/native/index.js +47 -3
  360. package/dist/react/server.d.ts +9 -10
  361. package/dist/react/server.js +2 -2
  362. package/dist/react/session.d.ts +64 -2
  363. package/dist/react/session.js +1 -1
  364. package/dist/{react-DZ7AW2yf.js → react-DkGGh9FE.js} +2 -2
  365. package/dist/react-router/index.d.ts +6 -6
  366. package/dist/react-router/index.js +4 -5
  367. package/dist/realtime/index.d.ts +6 -6
  368. package/dist/realtime/index.js +1 -1
  369. package/dist/{record-form-C-1TPtMG.d.ts → record-form-BRtDkhLZ.d.ts} +1 -1
  370. package/dist/{recordings-BVuri85k.d.ts → recordings-fWDldPuP.d.ts} +1 -1
  371. package/dist/records/index.d.ts +9 -9
  372. package/dist/records/index.js +1 -1
  373. package/dist/{refusal-rnbr6RZD.js → refusal-B9w5Bapa.js} +1 -2
  374. package/dist/{refusal-CjUUBfhY.d.ts → refusal-DjCQCcCj.d.ts} +3 -3
  375. package/dist/representatives-DRNDAf0i.js +22 -0
  376. package/dist/{resolve-XlMQRUeG.d.ts → resolve-CKJMUYRc.d.ts} +8 -1
  377. package/dist/{resolve-CZV31iCm.js → resolve-nj0eZ44A.js} +38 -1
  378. package/dist/{resource-CaYpB07K.d.ts → resource-C_rLLwNU.d.ts} +1 -1
  379. package/dist/{resource-COaS9_i8.js → resource-CrmhNagD.js} +1 -1
  380. package/dist/{resource-execute-B7-QaS6R.d.ts → resource-execute-DZeWkyIU.d.ts} +2 -2
  381. package/dist/{resource-types-CF3Uc6OW.d.ts → resource-types-D3gmBOeY.d.ts} +4 -4
  382. package/dist/{resources-DhiK3yLO.js → resources-B2i_nIgJ.js} +1 -1
  383. package/dist/{resources-DnHSmJIM.d.ts → resources-CSjwmcFs.d.ts} +2 -2
  384. package/dist/{respond-D7kUatjc.d.ts → respond-DxS_8bzC.d.ts} +1 -1
  385. package/dist/{sales-lines-wQHuL-pa.d.ts → sales-lines-DFQ9oIO-.d.ts} +1 -1
  386. package/dist/{sandboxes-DKgJZYUZ.d.ts → sandboxes-Xh_uNXU4.d.ts} +1 -1
  387. package/dist/{scores-BXuSVczw.d.ts → scores-DaGD79BY.d.ts} +5 -5
  388. package/dist/server/index.d.ts +29 -38
  389. package/dist/server/index.js +9 -9
  390. package/dist/{server-types-DpI82uNq.d.ts → server-types-DCC-dWKF.d.ts} +91 -17
  391. package/dist/{session-s-mUZ8RQ.d.ts → session-Ca4clB30.d.ts} +6 -6
  392. package/dist/{session-BjPYE4dT.js → session-CaoAgv8e.js} +58 -51
  393. package/dist/{session-status-CJjTuFtA.d.ts → session-status-CYtwZBi5.d.ts} +2 -2
  394. package/dist/{sign-in-k2lXELeC.js → sign-in-BUiy6unD.js} +1 -1
  395. package/dist/{sign-in-djgvab1X.js → sign-in-Dhd16x_j.js} +1 -1
  396. package/dist/{signers-UANxMfH-.d.ts → signers-CtrTcr3i.d.ts} +4 -4
  397. package/dist/{signing-keys-DhBSWFy_.d.ts → signing-keys-BAyNlJE4.d.ts} +2 -2
  398. package/dist/solid/index.d.ts +10 -10
  399. package/dist/solid-start/index.d.ts +6 -6
  400. package/dist/solid-start/index.js +4 -5
  401. package/dist/spec/index.d.ts +3 -3
  402. package/dist/spec/index.js +2 -2
  403. package/dist/{spec-pins-CuQ2anBw.d.ts → spec-pins-CRJEZYBW.d.ts} +5 -0
  404. package/dist/{spec-pins-FKUzgF6K.js → spec-pins-Dd1Qj3Sj.js} +1 -0
  405. package/dist/sql/index.d.ts +5 -5
  406. package/dist/sql/index.js +3 -3
  407. package/dist/{sql-CWzlxS6f.js → sql-D3ihagTr.js} +1048 -305
  408. package/dist/sqlite/index.d.ts +3 -3
  409. package/dist/{sso-Frh3sbJ1.d.ts → sso-BVYSNVmk.d.ts} +3 -3
  410. package/dist/ssr/index.d.ts +4 -4
  411. package/dist/ssr/index.js +1 -1
  412. package/dist/storage/index.d.ts +3 -3
  413. package/dist/storage/index.js +1 -1
  414. package/dist/streams/index.d.ts +1 -1
  415. package/dist/{subject-readers-D1Km_Q42.d.ts → subject-readers-nnYmRpv8.d.ts} +2 -2
  416. package/dist/{subjects-DNFE2rMl.d.ts → subjects-DgP5x73R.d.ts} +3 -3
  417. package/dist/{support-Dj5V2WTs.d.ts → support-BzXcdRLG.d.ts} +4 -4
  418. package/dist/{support-view-DKZkZeM5.d.ts → support-view-DNZh8-wA.d.ts} +1 -1
  419. package/dist/svelte/index.d.ts +9 -9
  420. package/dist/sveltekit/index.d.ts +7 -7
  421. package/dist/sveltekit/index.js +4 -5
  422. package/dist/{tags-BihwKkTT.d.ts → tags-CpFIpRw8.d.ts} +1 -1
  423. package/dist/tanstack-db/index.d.ts +3 -3
  424. package/dist/tanstack-start/index.d.ts +6 -6
  425. package/dist/tanstack-start/index.js +4 -5
  426. package/dist/{tenant-P7mo0ulH.d.ts → tenant-DyZZDYmm.d.ts} +1 -1
  427. package/dist/testing/index.d.ts +56 -30
  428. package/dist/testing/index.js +58 -7
  429. package/dist/{timeline-BB9fKT_r.d.ts → timeline-Df8GMPkZ.d.ts} +5 -5
  430. package/dist/{topic-CjKlzHD-.d.ts → topic-B4fSui6P.d.ts} +5 -5
  431. package/dist/{topic-k17VvXRj.js → topic-BtoL1fKf.js} +1 -1
  432. package/dist/{types-VwM7DBvC.d.ts → types-BeXhugiI.d.ts} +2 -2
  433. package/dist/{types-DU_nNO7U.d.ts → types-BgvKQUuy.d.ts} +3 -3
  434. package/dist/{types-LLCyr-xs.d.ts → types-ByApBdXv.d.ts} +5 -5
  435. package/dist/{types-BzIYSSWK.d.ts → types-CF5j7kOm.d.ts} +4 -2
  436. package/dist/{types-kq8S5HVE.d.ts → types-CeV22tnf.d.ts} +1 -1
  437. package/dist/{types-DCzgSAlU.d.ts → types-D6GlpLD9.d.ts} +4 -4
  438. package/dist/{types-z31g0-5T.d.ts → types-DJfGy-40.d.ts} +5 -5
  439. package/dist/{types-D--4dv5K.d.ts → types-mYxPduXR.d.ts} +7 -7
  440. package/dist/{undo-BCQMqIQN.d.ts → undo-CbLZkEny.d.ts} +2 -2
  441. package/dist/{usage-CJDj5j15.d.ts → usage-BcD0X7qJ.d.ts} +4 -4
  442. package/dist/{vault-CbhvnoVC.d.ts → vault-nYFV6WUD.d.ts} +2 -2
  443. package/dist/vercel-connect/index.d.ts +1 -1
  444. package/dist/vercel-sandbox/index.d.ts +2 -2
  445. package/dist/{verify-Cpc1upDA.d.ts → verify-DxTccsBh.d.ts} +2 -2
  446. package/dist/{view-eHgOOyRS.d.ts → view-DwXy8N6Y.d.ts} +27 -3
  447. package/dist/vue/index.d.ts +10 -10
  448. package/dist/{watch-topic-jqBMNMs3.d.ts → watch-topic-DShzD8ul.d.ts} +1 -1
  449. package/dist/workflow-sdk/builder/index.d.ts +3 -3
  450. package/dist/workflow-sdk/index.d.ts +1 -1
  451. package/dist/workflow-sdk/world/index.d.ts +1 -1
  452. package/dist/{workflow-sdk-DzKQo265.d.ts → workflow-sdk-ClwzLwNe.d.ts} +3 -3
  453. package/dist/{workflows-D7HvWeNu.d.ts → workflows-ZGDa9twb.d.ts} +3 -3
  454. package/dist/yjs/index.d.ts +2 -2
  455. package/dist/yjs/index.js +1 -1
  456. package/package.json +1 -1
  457. package/schemas/config-v1.json +24 -1
  458. package/schemas/design-v1.json +7 -1
  459. package/schemas/doctor-report-v1.json +1 -0
  460. package/skills/better-supabase/SKILL.md +1 -0
  461. package/skills/better-supabase/references/ui-recipes.md +13 -15
  462. package/skills/better-supabase-auth/SKILL.md +26 -2
  463. package/skills/better-supabase-auth/references/native.md +115 -0
  464. package/dist/cli/add-CjSPssgL.js +0 -1
  465. package/dist/cli/powersync-BurpZLJB.js +0 -1
  466. package/dist/cli/seed-CLlvrV8I.js +0 -1
  467. package/dist/guest-actions-CEwttioE.js +0 -8
  468. package/dist/impersonation-BOCJcsmS.d.ts +0 -26
  469. package/dist/options-B7Pl708M.js +0 -8
  470. package/dist/options-B9w_Y08G.d.ts +0 -6
  471. package/dist/respond-8A3EOo61.js +0 -106
  472. package/dist/session-JV1z0kxa.d.ts +0 -77
@@ -1,5 +1,5 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { o as Message } from "./messaging-CpQIhkFi.js";
2
+ import { o as Message } from "./messaging-2-SIPAp-.js";
3
3
  /** The channels an inbox can sit on. */
4
4
  type InboxChannel = "in_app" | "email" | "slack" | "teams" | "discord" | "telegram" | "whatsapp" | "messenger" | "instagram" | "sms" | "github" | "linear" | "other";
5
5
  /** `bot`: the bot answers; `human`: staff answer; `paused`: nobody answers. */
@@ -1,10 +1,10 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
3
3
  import { n as Logger } from "./logger-0LfhvwE4.js";
4
- import { i as CredentialRef, r as CredentialProvider } from "./provider-CVlXXbda.js";
5
- import { i as CursorPageOptions, r as BlockTemporalOptions } from "./block-helpers-Sj-efEhC.js";
6
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
7
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
4
+ import { i as CredentialRef, r as CredentialProvider } from "./provider-DxJWo8yD.js";
5
+ import { i as CursorPageOptions, r as BlockTemporalOptions } from "./block-helpers-DzIR3Ob8.js";
6
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
7
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
8
8
  /**
9
9
  * A tenant's own key for a provider. The key itself stays in the credential
10
10
  * provider.
@@ -1,11 +1,11 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
3
- import { et as RecordRef } from "./types-BzIYSSWK.js";
3
+ import { et as RecordRef } from "./types-CF5j7kOm.js";
4
4
  import { n as Logger } from "./logger-0LfhvwE4.js";
5
- import { r as BlockTemporalOptions } from "./block-helpers-Sj-efEhC.js";
6
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
7
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
8
- import { n as Embedder } from "./knowledge-DtECa_QW.js";
5
+ import { r as BlockTemporalOptions } from "./block-helpers-DzIR3Ob8.js";
6
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
7
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
8
+ import { n as Embedder } from "./knowledge-CCOSNGJp.js";
9
9
  type MemoryScope = "user" | "agent" | "chat" | "project" | "organization" | "record";
10
10
  type MemoryKind = "core" | "archival";
11
11
  /**
@@ -3,13 +3,13 @@ import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
3
3
  import { t as StandardSchemaV1 } from "./standard-DRX6Ch1j.js";
4
4
  import { n as ExtraFields, r as FieldsOf } from "./block-fields-Puv5m5D3.js";
5
5
  import { n as Logger } from "./logger-0LfhvwE4.js";
6
- import { i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "./provider-CVlXXbda.js";
7
- import { r as BlockTemporalOptions } from "./block-helpers-Sj-efEhC.js";
8
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
9
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
10
- import { h as FilterQuery, l as FilterFieldType } from "./filter-query-Xj40B5KT.js";
11
- import { f as WorkflowStarter, g as Workflows, p as WorkflowSubject, r as WorkflowRunMode, s as WorkflowSchedule } from "./workflows-D7HvWeNu.js";
12
- import { i as AuthorizationHooks } from "./authorization-hooks-CR8TVvqo.js";
6
+ import { i as CredentialRef, o as CredentialToken, r as CredentialProvider } from "./provider-DxJWo8yD.js";
7
+ import { r as BlockTemporalOptions } from "./block-helpers-DzIR3Ob8.js";
8
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
9
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
10
+ import { h as FilterQuery, l as FilterFieldType } from "./filter-query-BcheQ5zK.js";
11
+ import { f as WorkflowStarter, g as Workflows, p as WorkflowSubject, r as WorkflowRunMode, s as WorkflowSchedule } from "./workflows-ZGDa9twb.js";
12
+ import { i as AuthorizationHooks } from "./authorization-hooks-u2Z18CAM.js";
13
13
  /** The node kinds every graph may use. */
14
14
  type WorkflowBuiltinNodeKind = "trigger" | "step" | "sleep" | "approval" | "condition";
15
15
  /** A built-in kind, or the app's own kind from `defineNodeKind`. */
@@ -1,7 +1,7 @@
1
1
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
2
2
  import { n as Logger } from "./logger-0LfhvwE4.js";
3
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
4
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
3
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
4
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
5
5
  /** One call that reverses part of a change. */
6
6
  interface UndoCall {
7
7
  readonly fn: string;
@@ -1,10 +1,10 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { t as AsyncResult } from "./result-DTOQRyGY.js";
3
3
  import { n as Logger } from "./logger-0LfhvwE4.js";
4
- import { i as CursorPageOptions, n as BlockOptions } from "./block-helpers-Sj-efEhC.js";
5
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
6
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
7
- import { _ as JobHandler } from "./types-LLCyr-xs.js";
4
+ import { i as CursorPageOptions, n as BlockOptions } from "./block-helpers-DzIR3Ob8.js";
5
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
6
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
7
+ import { _ as JobHandler } from "./types-ByApBdXv.js";
8
8
  import { n as StripeSource } from "./stripe-Bl-sjnl6.js";
9
9
  interface UsageOptions extends BlockOptions {
10
10
  /**
@@ -1,6 +1,6 @@
1
1
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
2
- import { c as SetCredentialOptions, i as CredentialRef, r as CredentialProvider } from "./provider-CVlXXbda.js";
3
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
2
+ import { c as SetCredentialOptions, i as CredentialRef, r as CredentialProvider } from "./provider-DxJWo8yD.js";
3
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
4
4
  /** How a request the third party sends is signed with the stored secret. */
5
5
  type VaultInboundScheme = "standard-webhooks" | "hmac-sha256" | "shared-secret";
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import { f as Result, t as AsyncResult } from "../result-DTOQRyGY.js";
2
- import { a as CredentialSubject, i as CredentialRef, o as CredentialToken, r as CredentialProvider, s as GetTokenOptions } from "../provider-CVlXXbda.js";
2
+ import { a as CredentialSubject, i as CredentialRef, o as CredentialToken, r as CredentialProvider, s as GetTokenOptions } from "../provider-DxJWo8yD.js";
3
3
  /** An RFC 9396 authorization detail; `type` names its kind. */
4
4
  interface VercelConnectAuthorizationDetail {
5
5
  type: string;
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { b as DbError, t as AsyncResult } from "../result-DTOQRyGY.js";
3
- import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../provider-CVlXXbda.js";
4
- import { i as AiSandboxes, t as AiSandbox } from "../sandboxes-DKgJZYUZ.js";
3
+ import { a as CredentialSubject, i as CredentialRef, r as CredentialProvider } from "../provider-DxJWo8yD.js";
4
+ import { i as AiSandboxes, t as AiSandbox } from "../sandboxes-Xh_uNXU4.js";
5
5
  import { Experimental_SandboxSession } from "ai";
6
6
  /** The `provider` an adapter's rows carry in `ai_sandboxes`. */
7
7
  export declare const VERCEL_SANDBOX_PROVIDER = "vercel";
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { f as Result } from "./result-DTOQRyGY.js";
3
- import { O as AnyFunctions, at as Row, dt as TableKey, k as AnyModels } from "./types-BzIYSSWK.js";
4
- import { t as BetterSupabase } from "./define-C_He1bQO.js";
3
+ import { O as AnyFunctions, at as Row, dt as TableKey, k as AnyModels } from "./types-CF5j7kOm.js";
4
+ import { t as BetterSupabase } from "./define-DXQHQ2Qy.js";
5
5
  import { n as VerifyOptions, r as WebhookInput, t as VerifiedWebhook } from "./signatures-jPr9JXyw.js";
6
6
  /** The `Stripe-Signature` header for `body`, for tests and local replays. */
7
7
  declare function signStripeWebhook(secret: string, body: string, timestamp?: Temporal.Instant): Promise<string>;
@@ -1,9 +1,33 @@
1
1
  import { b as DbError } from "./result-DTOQRyGY.js";
2
- import { i as InvalidReason, r as AuthState } from "./resolve-XlMQRUeG.js";
2
+ import { i as InvalidReason, r as AuthState } from "./resolve-CKJMUYRc.js";
3
3
  import { a as SessionActor, o as SessionDelegation } from "./actor-DseNR02I.js";
4
- import { n as Impersonator } from "./impersonation-BOCJcsmS.js";
5
4
  import { n as AmrEntry, t as Aal } from "./mfa-CM5r904M.js";
6
5
  import { JWTClaims, UserClaims } from "@supabase/server";
6
+ /** The admin acting as the user, from the RFC 8693 `act` claim. */
7
+ interface Impersonator {
8
+ /** `act.kind`: a support session or an impersonated session. */
9
+ readonly kind: "support" | "impersonation";
10
+ readonly id: string;
11
+ readonly reason?: string;
12
+ /** The support session, when the admin started one (`act.session_id`). */
13
+ readonly sessionId?: string;
14
+ /** Whether the support session blocks writes (`act.read_only`). */
15
+ readonly readOnly?: boolean;
16
+ }
17
+ /**
18
+ * `actingAs(userId, claims, { actor, reason })`: who acts, and why (recorded by
19
+ * the audit module).
20
+ */
21
+ interface ImpersonationOptions {
22
+ readonly actor: string;
23
+ readonly reason: string;
24
+ }
25
+ /**
26
+ * The admin in `claims.act`: a support session or an impersonated session
27
+ * (`actorOf` reads the same level, so the two always agree). `undefined` for a
28
+ * normal session, an OAuth client or agent chain, and an invalid `act`.
29
+ */
30
+ declare function impersonatorOf(claims: Readonly<Record<string, unknown>>): Impersonator | undefined;
7
31
  /**
8
32
  * The verified caller as plain data: no token, no clients. Safe to return from
9
33
  * a `'use cache: private'` function and to pass to Client Components.
@@ -104,4 +128,4 @@ declare function isUserSession<C, P>(session: AuthSession<C, P>): session is Use
104
128
  declare function isApiKeySession<C, P>(session: AuthSession<C, P>): session is ApiKeySession & AuthSession<C, P>;
105
129
  /** Drops the token from an `AuthState`, leaving only serializable fields. */
106
130
  declare function toSession<C, P>(auth: AuthState<C, P>): AuthSession<C, P>;
107
- export { isUserSession as a, isApiKeySession as i, AuthSession as n, toSession as o, UserSession as r, ApiKeySession as t };
131
+ export { isUserSession as a, Impersonator as c, isApiKeySession as i, impersonatorOf as l, AuthSession as n, toSession as o, UserSession as r, ImpersonationOptions as s, ApiKeySession as t };
@@ -1,15 +1,15 @@
1
1
  import { b as DbError } from "../result-DTOQRyGY.js";
2
- import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-DddDlibJ.js";
3
- import { mt as QuerySpec } from "../define-C_He1bQO.js";
4
- import { tt as TemplateValues } from "../bucket-CrsJNHzi.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-CjKlzHD-.js";
6
- import { t as AuthSnapshot } from "../bind-DWAIKYvJ.js";
7
- import { n as AuthSession } from "../view-eHgOOyRS.js";
8
- import { n as Controller } from "../controller-BFOCK5AG.js";
9
- import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-LVBXokQN.js";
10
- import { n as BlockOptions } from "../block-env-C6OEu9Xk.js";
2
+ import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-BrgD2StJ.js";
3
+ import { mt as QuerySpec } from "../define-DXQHQ2Qy.js";
4
+ import { tt as TemplateValues } from "../bucket-CjIhrluq.js";
5
+ import { n as AuthSession } from "../view-DwXy8N6Y.js";
6
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-B4fSui6P.js";
7
+ import { t as AuthSnapshot } from "../bind-BieIoT6r.js";
8
+ import { n as Controller } from "../controller-TplPQG5m.js";
9
+ import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DyWpuH1q.js";
10
+ import { n as BlockOptions } from "../block-env-YzSHv579.js";
11
11
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-QSaPsL2P.js";
12
- import { t as SupportView } from "../support-view-DKZkZeM5.js";
12
+ import { t as SupportView } from "../support-view-DNZh8-wA.js";
13
13
  import { SupabaseClient } from "@supabase/supabase-js";
14
14
  import { QueryClient } from "@tanstack/query-core";
15
15
  import { App, ComputedRef, MaybeRefOrGetter, Ref, ShallowRef } from "vue";
@@ -1,4 +1,4 @@
1
- import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-CjKlzHD-.js";
1
+ import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-B4fSui6P.js";
2
2
  interface TopicWatch {
3
3
  readonly onMessage: (event: string, payload: unknown) => void;
4
4
  readonly onRejoin: () => void;
@@ -1,6 +1,6 @@
1
- import { G as WorkflowGraph, Z as WorkflowNodeKindInfo, i as BuilderStarter, l as NodeRunRecord } from "../../types-D--4dv5K.js";
2
- import { a as GraphStepCall, i as GraphRuntime, n as GraphNodeCall, o as GraphSubject, s as executeGraph, t as GraphApprovalCall } from "../../executor-DL7cZ-3T.js";
3
- import { c as WorkflowFn } from "../../workflow-sdk-DzKQo265.js";
1
+ import { G as WorkflowGraph, Z as WorkflowNodeKindInfo, i as BuilderStarter, l as NodeRunRecord } from "../../types-mYxPduXR.js";
2
+ import { a as GraphStepCall, i as GraphRuntime, n as GraphNodeCall, o as GraphSubject, s as executeGraph, t as GraphApprovalCall } from "../../executor-kfUaLlQr.js";
3
+ import { c as WorkflowFn } from "../../workflow-sdk-ClwzLwNe.js";
4
4
  import { World } from "@workflow/world";
5
5
  /** The env flag the Workflow SDK reads before it starts or runs dynamic source. */
6
6
  export declare const DYNAMIC_WORKFLOWS_ENV = "WORKFLOW_EXPERIMENTAL_DYNAMIC_WORKFLOWS";
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { n as VerifyOptions, r as WebhookInput } from "../signatures-jPr9JXyw.js";
3
- import { _ as startOnEvent, a as StartOnEventOptions, b as workflowStarter, c as WorkflowFn, d as WorkflowStarterOptions, f as authorizeHook, g as startFor, h as protectWebHandler, i as StartForOptions, l as WorkflowRunAs, m as hookMetadata, n as HookForbiddenError, o as StartOnceOptions, p as contextAttributes, r as ProtectWebHandlerOptions, s as WorkflowContextOptions, t as AuthorizeHookOptions, u as WorkflowRunAsFor, v as startOnce, y as workflowContext } from "../workflow-sdk-DzKQo265.js";
3
+ import { _ as startOnEvent, a as StartOnEventOptions, b as workflowStarter, c as WorkflowFn, d as WorkflowStarterOptions, f as authorizeHook, g as startFor, h as protectWebHandler, i as StartForOptions, l as WorkflowRunAs, m as hookMetadata, n as HookForbiddenError, o as StartOnceOptions, p as contextAttributes, r as ProtectWebHandlerOptions, s as WorkflowContextOptions, t as AuthorizeHookOptions, u as WorkflowRunAsFor, v as startOnce, y as workflowContext } from "../workflow-sdk-ClwzLwNe.js";
4
4
  import { a as WorkflowMaintenance, i as RunKeyClaim, n as OpenWorkflowHook, o as WorkflowRunKeys, r as PurgeRunsOptions, s as WorkflowTerminalStatus, t as OpenHooksOptions } from "../run-keys-BnzqxtYc.js";
5
5
  import { Run } from "workflow/api";
6
6
  /** How `approvalWaiter.wait` ended. */
@@ -1,4 +1,4 @@
1
- import { o as EventHub } from "../../events-DddDlibJ.js";
1
+ import { o as EventHub } from "../../events-BrgD2StJ.js";
2
2
  import { n as Logger } from "../../logger-0LfhvwE4.js";
3
3
  import { a as WorkflowMaintenance } from "../../run-keys-BnzqxtYc.js";
4
4
  import { Pool } from "pg";
@@ -1,6 +1,6 @@
1
- import { It as RequestContext } from "./types-BzIYSSWK.js";
2
- import { f as WorkflowStarter, l as WorkflowStartCall, p as WorkflowSubject, t as WorkflowPrincipalKind } from "./workflows-D7HvWeNu.js";
3
- import { a as OutboxEvent, o as OutboxHandler } from "./outbox-Cpxpzcue.js";
1
+ import { It as RequestContext } from "./types-CF5j7kOm.js";
2
+ import { f as WorkflowStarter, l as WorkflowStartCall, p as WorkflowSubject, t as WorkflowPrincipalKind } from "./workflows-ZGDa9twb.js";
3
+ import { a as OutboxEvent, o as OutboxHandler } from "./outbox-DL2737I0.js";
4
4
  import { Hook, Run } from "workflow/api";
5
5
  import { World } from "@workflow/world";
6
6
  /** A workflow function (a `"use workflow"` export), typed structurally. */
@@ -1,9 +1,9 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
3
3
  import { n as Logger } from "./logger-0LfhvwE4.js";
4
- import { i as CursorPageOptions, r as BlockTemporalOptions } from "./block-helpers-Sj-efEhC.js";
5
- import { t as BlockTransport } from "./block-transport-CDmOUuLZ.js";
6
- import { n as BlockHooks } from "./block-hooks-VW4knarE.js";
4
+ import { i as CursorPageOptions, r as BlockTemporalOptions } from "./block-helpers-DzIR3Ob8.js";
5
+ import { t as BlockTransport } from "./block-transport-Do7J4MsA.js";
6
+ import { n as BlockHooks } from "./block-hooks-D9NKzUqW.js";
7
7
  import { r as RunState } from "./run-state-D0Tbl-nM.js";
8
8
  /** A workflow run's state, in the words ai-chat and ai-schedules runs share. */
9
9
  type WorkflowRunStatus = Exclude<RunState, "cancel_requested">;
@@ -1,6 +1,6 @@
1
1
  import { t as AsyncResult } from "../result-DTOQRyGY.js";
2
- import { c as RealtimeClient, r as PresenceMember } from "../topic-CjKlzHD-.js";
3
- import { a as DocumentSuggestion, d as OpenedDocument, l as Documents, r as DocumentRef, t as DecidedSuggestion } from "../documents-CNVPrE_0.js";
2
+ import { c as RealtimeClient, r as PresenceMember } from "../topic-B4fSui6P.js";
3
+ import { a as DocumentSuggestion, d as OpenedDocument, l as Documents, r as DocumentRef, t as DecidedSuggestion } from "../documents-Ciijx56T.js";
4
4
  type PresenceState = Readonly<Record<string, unknown>>;
5
5
  /** The part of a `Y.Doc` the provider uses. */
6
6
  interface YDocLike {
package/dist/yjs/index.js CHANGED
@@ -2,7 +2,7 @@ import { n as isRecord } from "../guards-CsRa6v57.js";
2
2
  import { a as ok, r as err, t as AsyncResult } from "../result-8xza7w5W.js";
3
3
  import { a as toBase64, i as fromBase64 } from "../base64-CEBz6-Jj.js";
4
4
  import { t as importOptionalPeer } from "../optional-peer-5SOYr3lL.js";
5
- import { t as defineTopic } from "../topic-k17VvXRj.js";
5
+ import { t as defineTopic } from "../topic-BtoL1fKf.js";
6
6
  // src/yjs/yjs.ts
7
7
  function isYjs(value) {
8
8
  return isRecord(value) && typeof value["applyUpdate"] === "function" && typeof value["mergeUpdates"] === "function";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue, framework integrations and the better-supabase CLI.",
5
5
  "keywords": [
6
6
  "cli",
@@ -1186,6 +1186,17 @@
1186
1186
  "required": ["function", "ownedClaims"],
1187
1187
  "additionalProperties": false
1188
1188
  },
1189
+ "versions": {
1190
+ "type": "object",
1191
+ "properties": {
1192
+ "function": {
1193
+ "type": "string",
1194
+ "pattern": "^[a-z_][a-z0-9_$]*\\.[a-z_][a-z0-9_$]*$"
1195
+ }
1196
+ },
1197
+ "required": ["function"],
1198
+ "additionalProperties": false
1199
+ },
1189
1200
  "delegation": {
1190
1201
  "type": "object",
1191
1202
  "properties": {
@@ -4940,7 +4951,9 @@
4940
4951
  "options": {
4941
4952
  "type": "object",
4942
4953
  "additionalProperties": false,
4943
- "properties": {}
4954
+ "properties": {
4955
+ "representation": {}
4956
+ }
4944
4957
  }
4945
4958
  }
4946
4959
  },
@@ -6052,6 +6065,10 @@
6052
6065
  "resend": {
6053
6066
  "type": "boolean",
6054
6067
  "default": false
6068
+ },
6069
+ "notifications": {
6070
+ "type": "boolean",
6071
+ "default": true
6055
6072
  }
6056
6073
  }
6057
6074
  }
@@ -6461,6 +6478,12 @@
6461
6478
  "additionalProperties": {
6462
6479
  "type": "string"
6463
6480
  }
6481
+ },
6482
+ "meanings": {
6483
+ "type": "array",
6484
+ "items": {
6485
+ "type": "string"
6486
+ }
6464
6487
  }
6465
6488
  }
6466
6489
  }
@@ -229,11 +229,14 @@
229
229
  "email",
230
230
  "url",
231
231
  "phone",
232
+ "phone_e164",
232
233
  "long_text",
233
234
  "color",
234
235
  "rating",
235
236
  "percent",
236
- "currency"
237
+ "currency",
238
+ "bsn",
239
+ "iban"
237
240
  ],
238
241
  "type": "string"
239
242
  },
@@ -261,6 +264,9 @@
261
264
  },
262
265
  "encrypted": {
263
266
  "type": "boolean"
267
+ },
268
+ "lookup": {
269
+ "type": "boolean"
264
270
  }
265
271
  },
266
272
  "required": ["type"],
@@ -159,6 +159,7 @@
159
159
  "BS417",
160
160
  "BS418",
161
161
  "BS419",
162
+ "BS420",
162
163
  "BS501",
163
164
  "BS502",
164
165
  "BS503",
@@ -111,6 +111,7 @@ Name the definition `betterSupabase` (in `lib/supabase/index.ts`) and every runt
111
111
  - Astro: `bsb.locals(Astro).db`; SolidStart: `(await bsb.require()).db`
112
112
  - A supabase-js client on the server (Storage, Realtime, a call no repository covers): `bsb.contextClient(ctx.auth)` sends the caller's token to PostgREST, Storage and Realtime, so RLS applies. `bsb.admin().$client` is the shared secret-key client, for work no user owns
113
113
  - Browser: `bsb.db`, or the hooks from `createHooks<typeof bsb>()`
114
+ - Expo Router loaders: `bsb.loader(fn)` from `createExpo`, with `bsb.bootstrap(request, { rpc })` for the session, the live authorization version and the page data in one call. iOS and Android with PowerSync: `syncWithAuth` plus the native `SessionProvider`; the `better-supabase-auth` skill's `references/native.md` has both
114
115
  - Vue, Solid and Svelte, TanStack DB collections and a local SQLite database: [references/frontend.md](references/frontend.md)
115
116
  - UI for a block (notification bell, notification list, command search, onboarding checklist): build it from the app's shadcn or React Native components and the block's hook, following [references/ui-recipes.md](references/ui-recipes.md). There is no better-supabase UI package; install glue with `npx shadcn add @better-supabase/<item>`.
116
117
 
@@ -1162,7 +1162,7 @@ import type { OrganizationMembership } from "better-supabase/blocks/organization
1162
1162
 
1163
1163
  import { ActivityIndicator, Pressable, Text, View } from "react-native";
1164
1164
 
1165
- import type { OrganizationSource } from "../hooks/use-organizations";
1165
+ import type { UseOrganizationsOptions } from "../hooks/use-organizations";
1166
1166
 
1167
1167
  import { useOrganizations } from "../hooks/use-organizations";
1168
1168
  import { API_SCHEMA } from "../lib/blocks";
@@ -1170,19 +1170,17 @@ import { API_SCHEMA } from "../lib/blocks";
1170
1170
  /**
1171
1171
  * The caller's organizations. Pressing one switches to it, refreshes the
1172
1172
  * session so the token carries the new tenant, and loads the list again. `load`
1173
- * reads them elsewhere, such as from the PowerSync database.
1173
+ * reads them elsewhere, such as from the PowerSync database, and `onSwitched`
1174
+ * replaces the refresh, such as one that also reconnects sync.
1174
1175
  */
1175
- export function OrganizationSwitcher({
1176
- load,
1177
- }: {
1178
- readonly load?: OrganizationSource<OrganizationMembership>;
1179
- }) {
1176
+ export function OrganizationSwitcher(
1177
+ props: Pick<
1178
+ UseOrganizationsOptions<OrganizationMembership>,
1179
+ "load" | "onSwitched"
1180
+ >,
1181
+ ) {
1180
1182
  const { organizations, activeId, switching, error, switchTo } =
1181
- useOrganizations(
1182
- load === undefined
1183
- ? { schema: API_SCHEMA }
1184
- : { schema: API_SCHEMA, load },
1185
- );
1183
+ useOrganizations({ ...props, schema: API_SCHEMA });
1186
1184
 
1187
1185
  if (organizations === undefined) {
1188
1186
  return <ActivityIndicator />;
@@ -20793,9 +20791,9 @@ export function WebhookEndpointsSkeleton() {
20793
20791
  }
20794
20792
  ```
20795
20793
 
20796
- ## Service principals table
20794
+ ## Service accounts table
20797
20795
 
20798
- Machine identities with their scopes, last use and a button to disable one. It loads its data on the server through the block's client; the [service-accounts block](https://bettersupabase.com/blocks/service-accounts) must be installed (`npx better-supabase add service-accounts`). Page: https://bettersupabase.com/recipes/service-principals-table.
20796
+ Machine identities with their scopes, last use and a button to disable one. It loads its data on the server through the block's client; the [service-accounts block](https://bettersupabase.com/blocks/service-accounts) must be installed (`npx better-supabase add service-accounts`). Page: https://bettersupabase.com/recipes/service-accounts-table.
20799
20797
 
20800
20798
  Web, with shadcn components:
20801
20799
 
@@ -20860,7 +20858,7 @@ export async function ServicePrincipalsTable() {
20860
20858
  ]);
20861
20859
 
20862
20860
  return (
20863
- <Card data-recipe="service-principals-table">
20861
+ <Card data-recipe="service-accounts-table">
20864
20862
  <CardHeader>
20865
20863
  <CardTitle>{t("Service principals")}</CardTitle>
20866
20864
  <CardDescription>
@@ -180,8 +180,9 @@ membership lasts until the next refresh. When that window matters:
180
180
  - For a page whose islands all need the session and some data, read them in
181
181
  one query: name an app function in `blocks.sessions.options.bootstrap` and
182
182
  call `bsb.bootstrap({ rpc, tenant, redirect })` in each island. It checks
183
- `session_active()`, returns the token's authorization version, the tenant
184
- and the data, and runs once per request for the same arguments. With it,
183
+ `session_active()`, returns the live authorization version
184
+ (`authzVersion`) next to the token's (`tokenAuthzVersion`, `stale` when the
185
+ live one is ahead), the tenant and the data, and runs once per request for the same arguments. With it,
185
186
  `bsb.proxy(request, { verifySession: "bootstrap" })` skips the proxy's
186
187
  Auth call.
187
188
  - `bsb.getAccess(boot)` gives `context`, `session`, `tenant`,
@@ -221,6 +222,27 @@ membership lasts until the next refresh. When that window matters:
221
222
  `<SessionProvider session={...}>` and read it with `useSession()`. The
222
223
  provider holds the session in a store; `sessionPromise` is the 0.34 name.
223
224
 
225
+ ## Native and Expo
226
+
227
+ On iOS, Android and Expo web routes, read
228
+ [references/native.md](references/native.md) first. The short version:
229
+
230
+ 1. Turn on `blocks.sessions.options.authzVersions`.
231
+ 2. Render `<SessionProvider appState={AppState} powersync={sync}>` from
232
+ `better-supabase/react/native` inside `<BetterSupabaseProvider>`. It
233
+ listens on `authz:<uid>` in the foreground, catches up when the app
234
+ becomes active, refreshes the token and reconnects PowerSync.
235
+ 3. Keep one `syncWithAuth(powersync, bsb.auth, { connector })` for the app.
236
+ It reconnects when the token's tenant or `authz_ver` changes; after a
237
+ tenant switch, call `supabase.auth.refreshSession()`, then
238
+ `await sync.reconnect()`.
239
+ 4. In Expo web loaders, read the session, the live version and the page data
240
+ with `bsb.bootstrap(request, { rpc })`, check permissions with
241
+ `bsb.getAccess(request, { bootstrap })`, and tag app-side caches with
242
+ `bsb.cached(request, { tables })`.
243
+ 5. On an emulator or a phone against the local stack, add the LAN address to
244
+ `auth.loopbackAliases`; `10.0.2.2` and `10.0.3.2` are accepted already.
245
+
224
246
  ## Authorization providers
225
247
 
226
248
  When `better-supabase.config.ts` has an `authorization` key, another package
@@ -251,5 +273,7 @@ https://bettersupabase.com/docs/frameworks/next-auth.md (sign-in and sign-out),
251
273
  https://bettersupabase.com/docs/auth/account-deletion.md,
252
274
  https://bettersupabase.com/docs/frameworks/next-cache-components.md,
253
275
  https://bettersupabase.com/docs/frameworks/next-islands.md,
276
+ https://bettersupabase.com/docs/frontend/authorization-refresh-native.md,
277
+ https://bettersupabase.com/docs/frameworks/expo.md,
254
278
  https://bettersupabase.com/docs/migration/0.35-to-0.37.md and
255
279
  https://bettersupabase.com/docs/extending/authorization-providers.md.
@@ -0,0 +1,115 @@
1
+ # Native and Expo
2
+
3
+ ## Refresh the token when roles change
4
+
5
+ With `blocks.sessions.options.authzVersions`, the database bumps a user's
6
+ version when their memberships, roles or grants change, writes it to the
7
+ token as `authz_ver` and broadcasts it on the private topic `authz:<uid>`.
8
+
9
+ ```tsx
10
+ // src/app/_layout.native.tsx
11
+ import { SessionProvider } from "better-supabase/react/native";
12
+ import { AppState } from "react-native";
13
+
14
+ export default function RootLayout() {
15
+ return (
16
+ <AppShell>
17
+ <SessionProvider appState={AppState} powersync={sync}>
18
+ <Stack />
19
+ </SessionProvider>
20
+ </AppShell>
21
+ );
22
+ }
23
+ ```
24
+
25
+ - `AppShell` renders `<BetterSupabaseProvider client={bsb}>`; the provider
26
+ reads its supabase-js client, or takes `client`.
27
+ - It subscribes only while `AppState` is `active`. Each join reads the live
28
+ version, so a change made in the background applies when the app returns.
29
+ - It refreshes only when the live version is ahead of the token's; an equal
30
+ version makes no Auth call.
31
+ - `onAuthzChange` runs after the refresh: invalidate the screen's queries
32
+ there.
33
+ - `topic`, `event` and `source` are for a library that broadcasts on its own
34
+ channel. Pass a stable `topic` function.
35
+ - Outside React: `startNativeAuthzRefresh({ client, userId, appState,
36
+ powersync })` from `better-supabase/client/native` returns the cleanup.
37
+
38
+ Use the browser `SessionProvider` from `better-supabase/react` only on the
39
+ web; it follows tab visibility and `BroadcastChannel`, which React Native
40
+ doesn't have.
41
+
42
+ ## PowerSync
43
+
44
+ ```ts
45
+ // src/lib/powersync/sync.ts
46
+ export const sync: AuthSync = syncWithAuth(powersync, bsb.auth, { connector });
47
+
48
+ export async function afterSwitch(result: SwitchResult): Promise<void> {
49
+ if (result.refresh) {
50
+ const { error } = await supabase.auth.refreshSession();
51
+ if (error) throw error;
52
+ }
53
+ await sync.reconnect();
54
+ }
55
+ ```
56
+
57
+ - The sync service reads claims only on connect, so a refreshed token needs a
58
+ reconnect before the device drops rows the user lost. `syncWithAuth` does
59
+ it when the user, tenant or `authz_ver` fingerprint changes.
60
+ - `sync.reconnect()` forces one. Concurrent calls share one reconnect, and a
61
+ sign-out skips it.
62
+ - `fetchCredentials` must read the current session each call
63
+ (`createUploadConnector` does). A cached token reconnects with old claims.
64
+ - Pass `tenantClaim` when `config.claims.tenant` is renamed, or `fingerprint`
65
+ for other claims.
66
+ - Create one `sync` for the app at module scope, not one per screen.
67
+ - `better-supabase powersync streams` (or `gen` with `gen.powersync`) writes
68
+ streams for blocks over the app's own tables too; it reads their columns
69
+ from the saved snapshot.
70
+
71
+ ## Expo web loaders
72
+
73
+ ```ts
74
+ export const loader = bsb.loader(
75
+ async (_ctx, params, request) => {
76
+ const boot = await bsb.bootstrap<Counts>(request, {
77
+ rpc: "islands",
78
+ tenant: String(params.org),
79
+ });
80
+ const access = await bsb.getAccess(request, { bootstrap: boot });
81
+ return {
82
+ counts: boot.data,
83
+ stale: boot.stale,
84
+ canWrite: await access.can("customers.write"),
85
+ };
86
+ },
87
+ { allow: ["user"] },
88
+ );
89
+ ```
90
+
91
+ - `rpc` names an entry in `blocks.sessions.options.bootstrap`.
92
+ - One navigation's layout and page loaders share the call for 10 seconds.
93
+ - `authzVersion` is live, `tokenAuthzVersion` the token's, `stale` when the
94
+ first is ahead. `getAccess` with `bootstrap` checks against the live one.
95
+ - `bsb.cached(request, { tables, tags, tenant })` returns the context and the
96
+ tags for an app-side cache. Purge it from a cache adapter
97
+ (`betterSupabase.cache({ name, invalidate: (t) => purge(cacheTagsOf(t)) })`,
98
+ `cacheTagsOf` from `better-supabase/server`).
99
+ - Expo has no `next/cache`; don't import it from Expo code.
100
+
101
+ ## Local stack on devices
102
+
103
+ The default issuer check accepts `127.0.0.1`, `localhost`, `[::1]`,
104
+ `10.0.2.2` and `10.0.3.2` on the same scheme, port and path when the project
105
+ URL is local. Add a LAN address with
106
+ `createExpo(betterSupabase, { auth: { loopbackAliases: ["192.168.1.20"] } })`.
107
+ A public project URL accepts none of them.
108
+
109
+ ## Don't
110
+
111
+ - Don't refresh the token on a timer to pick up role changes; use
112
+ `authzVersions` and `SessionProvider`.
113
+ - Don't reconnect PowerSync by disconnecting and connecting by hand; call
114
+ `sync.reconnect()`, which runs in order with sign-in and sign-out.
115
+ - Don't set `issuer: false` to make an emulator work; use `loopbackAliases`.
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-fdZAY8C_.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-BOxy1_xW.js";