better-supabase 0.30.0 → 0.31.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 (205) hide show
  1. package/dist/{adapter-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{app-tables-yyVncXEt.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
  4. package/dist/astro/index.js +2 -2
  5. package/dist/{authorization-CDU9tYA_.d.ts → authorization-DfEkyFt_.d.ts} +10 -3
  6. package/dist/{bind-p7asfI6H.d.ts → bind-DAx0bMSi.d.ts} +2 -2
  7. package/dist/{block-env-B8wG3xeh.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
  8. package/dist/blocks/ai-chat/index.d.ts +3 -3
  9. package/dist/blocks/announcements/index.d.ts +3 -3
  10. package/dist/blocks/api-keys/index.d.ts +1 -1
  11. package/dist/blocks/attachments/index.d.ts +1 -1
  12. package/dist/blocks/audit/index.d.ts +2 -2
  13. package/dist/blocks/automations/index.d.ts +1 -1
  14. package/dist/blocks/billing/index.d.ts +1 -1
  15. package/dist/blocks/bookings/index.d.ts +1 -1
  16. package/dist/blocks/calendar/index.d.ts +7 -3
  17. package/dist/blocks/calendar/index.js +5 -1
  18. package/dist/blocks/comments/index.d.ts +4 -4
  19. package/dist/blocks/employees/index.js +1 -4
  20. package/dist/blocks/entitlements/index.d.ts +2 -2
  21. package/dist/blocks/forms/index.d.ts +1 -1
  22. package/dist/blocks/inbox/index.d.ts +4 -4
  23. package/dist/blocks/index.d.ts +1 -1
  24. package/dist/blocks/messaging/index.d.ts +4 -4
  25. package/dist/blocks/mfa/index.d.ts +1 -1
  26. package/dist/blocks/notifications/index.d.ts +3 -3
  27. package/dist/blocks/notifications/index.js +5 -43
  28. package/dist/blocks/onboarding/index.d.ts +1 -1
  29. package/dist/blocks/organizations/index.d.ts +34 -21
  30. package/dist/blocks/organizations/index.js +5 -1
  31. package/dist/blocks/permissions/index.d.ts +32 -3
  32. package/dist/blocks/permissions/index.js +23 -2
  33. package/dist/blocks/push/index.d.ts +10 -2
  34. package/dist/blocks/push/index.js +23 -7
  35. package/dist/blocks/reactions/index.d.ts +3 -3
  36. package/dist/blocks/saved-views/index.d.ts +1 -1
  37. package/dist/blocks/search/index.d.ts +2 -2
  38. package/dist/blocks/sessions/index.d.ts +1 -1
  39. package/dist/blocks/settings/index.d.ts +1 -1
  40. package/dist/blocks/subjects/index.d.ts +1 -1
  41. package/dist/blocks/tags/index.d.ts +1 -1
  42. package/dist/blocks/tasks/index.js +1 -1
  43. package/dist/blocks/teams/index.d.ts +7 -1
  44. package/dist/blocks/teams/index.js +8 -7
  45. package/dist/blocks/undo/index.d.ts +1 -1
  46. package/dist/blocks/usage/index.d.ts +1 -1
  47. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  48. package/dist/blocks/workflows/index.d.ts +3 -3
  49. package/dist/cli/{add-Dggyehsy.js → add-B9wP0YGU.js} +2 -2
  50. package/dist/cli/{add-D4w-Axib.js → add-DjZXKd7X.js} +10 -10
  51. package/dist/cli/add-ZcEOEK23.js +1 -0
  52. package/dist/cli/{app-table-files-CiGuwLkO.js → app-table-files-mtvjHa48.js} +2 -2
  53. package/dist/cli/{backfill-DjVjXW_P.js → backfill-Coshdvh_.js} +2 -2
  54. package/dist/cli/bin.js +1 -1
  55. package/dist/cli/{blocks-jRL9K1R8.js → blocks-BWCuA0nq.js} +2 -2
  56. package/dist/cli/{blocks-Bbmb6W_F.js → blocks-hiSazThw.js} +1 -1
  57. package/dist/cli/{cache-BuoIFlUJ.js → cache-x2wWAy0h.js} +1 -1
  58. package/dist/cli/{codemod-DRavXBCb.js → codemod-BnjV7BpC.js} +210 -11
  59. package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
  60. package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
  61. package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
  62. package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
  63. package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
  64. package/dist/cli/{content-mapper-BCtyfKXl.js → content-mapper-DvOSOdTE.js} +2 -2
  65. package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
  66. package/dist/cli/{doctor-Di2ZekfN.js → doctor-Ywy8oJEU.js} +41 -16
  67. package/dist/cli/env-CNjT_uOV.js +1 -0
  68. package/dist/cli/{env-B2CbnbzD.js → env-XMiKvhtV.js} +1 -1
  69. package/dist/cli/{gen-STKC9vkK.js → gen-B-FbQmG1.js} +14 -14
  70. package/dist/cli/index.d.ts +1 -1
  71. package/dist/cli/index.js +7 -7
  72. package/dist/cli/{init-DW6_nIwj.js → init-fb9e1BKX.js} +9 -9
  73. package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
  74. package/dist/cli/{live-0G4Plw3K.js → live-DIt7TP-N.js} +2 -2
  75. package/dist/cli/{mcp-flKS8iU5.js → mcp-CVWwraga.js} +3 -3
  76. package/dist/cli/{metadata-VARUbXEe.js → metadata-CannIjel.js} +3 -3
  77. package/dist/cli/{migrate-Bkq07XcT.js → migrate-Ht2TzIQF.js} +2 -2
  78. package/dist/cli/{migration-safety-BfVeza5j.js → migration-safety-nNyB05I-.js} +1 -1
  79. package/dist/cli/{migrations-BCq7Zs2E.js → migrations-bAd7dpk1.js} +2 -2
  80. package/dist/cli/{module-migration-lbeUrsYv.js → module-migration-CkNux8dr.js} +2 -2
  81. package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
  82. package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
  83. package/dist/cli/{powersync-B15CfH5Y.js → powersync-B2v0tDwp.js} +100 -7
  84. package/dist/cli/powersync-D3mAQ6QE.js +1 -0
  85. package/dist/cli/{print-DjxpBRnv.js → print-CxQ0rBKT.js} +2 -2
  86. package/dist/cli/{providers-dyxcHQY3.js → providers-DtI90lSw.js} +1 -1
  87. package/dist/cli/{remove-BLq5gbal.js → remove-DYtE4IZ4.js} +6 -6
  88. package/dist/cli/{render-CizUf3RW.js → render-QGWfEoiB.js} +3 -3
  89. package/dist/cli/{run-ChEjR7yw.js → run-B5aMwErM.js} +2 -2
  90. package/dist/cli/{run-MwM__teL.js → run-BNoJKf5I.js} +40 -39
  91. package/dist/cli/{run-ChOY6s4o.js → run-DiYX1XEa.js} +8 -8
  92. package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
  93. package/dist/cli/seed-Cm-c0BDd.js +1 -0
  94. package/dist/cli/{shared-DV5wIv-7.js → shared-D_CFi5di.js} +1 -1
  95. package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
  96. package/dist/cli/{snapshot-B5LXkVMC.js → snapshot-BlQ4DDcJ.js} +9 -4
  97. package/dist/cli/{source-BoLNG_2A.js → source-CelMBQMj.js} +1 -1
  98. package/dist/cli/{spec-D6QeE2Zx.js → spec-BxcoGE0h.js} +1 -1
  99. package/dist/cli/{spec-Dz-PGCaM.js → spec-iBx1LcYO.js} +3 -3
  100. package/dist/cli/{sql-layout-zo02f3Dm.js → sql-layout-Dp4Rottt.js} +2 -2
  101. package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
  102. package/dist/cli/{sync-m-oZ_SyI.js → sync-BnORI43S.js} +4 -4
  103. package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
  104. package/dist/cli/{upgrade-C9sgVZ5z.js → upgrade-CR6-WmIc.js} +5 -5
  105. package/dist/cli/{upgrade-WwEJaX3i.js → upgrade-fz92aCnh.js} +3 -3
  106. package/dist/cli/{version-D2BQuqta.js → version-Dz8ZlOuh.js} +1 -1
  107. package/dist/client/index.d.ts +5 -5
  108. package/dist/client/native/index.d.ts +4 -4
  109. package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
  110. package/dist/config/index.d.ts +2 -2
  111. package/dist/config/index.js +4 -4
  112. package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
  113. package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
  114. package/dist/{context-nbYYjv7U.d.ts → context-DWWoP1wK.d.ts} +1 -1
  115. package/dist/{controller-TRocodqG.d.ts → controller-Br9dGKGe.d.ts} +1 -1
  116. package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
  117. package/dist/create/index.d.ts +3 -3
  118. package/dist/create/index.js +3 -3
  119. package/dist/create/lite/index.d.ts +3 -3
  120. package/dist/create/lite/index.js +3 -3
  121. package/dist/delivery-events-DbL8IHIY.js +53 -0
  122. package/dist/edge/index.js +3 -3
  123. package/dist/{entitlements-B1i1-wfe.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
  124. package/dist/eve/index.js +1 -1
  125. package/dist/expo/index.js +3 -2
  126. package/dist/{field-errors-tJvehEFc.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
  127. package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
  128. package/dist/hono/index.js +2 -2
  129. package/dist/{index-BkzXwuIN.d.ts → index-Clyd2Goi.d.ts} +1 -1
  130. package/dist/{index-zsgNmE8m.d.ts → index-D98bQs8a.d.ts} +7 -7
  131. package/dist/{index-BKrxynq9.d.ts → index-DIdPoQtO.d.ts} +2 -2
  132. package/dist/{index-CWAQRWY8.d.ts → index-I8YLxKq8.d.ts} +2 -2
  133. package/dist/{index-8US7qlvW.d.ts → index-eRBuKtMt.d.ts} +2 -2
  134. package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
  135. package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
  136. package/dist/mapper/bin.js +5 -5
  137. package/dist/mcp/index.d.ts +1 -1
  138. package/dist/mcp/index.js +1 -1
  139. package/dist/mcp/sdk/index.js +1 -1
  140. package/dist/next/index.d.ts +73 -6
  141. package/dist/next/index.js +88 -35
  142. package/dist/{operations-CB9atU2e.d.ts → operations-hm1Isvvs.d.ts} +1 -1
  143. package/dist/{options-BKBy5wM_.js → options-CF6EVF_G.js} +2 -1
  144. package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
  145. package/dist/orpc/index.js +2 -1
  146. package/dist/otel/index.js +4 -4
  147. package/dist/{ports-hpbyMySO.d.ts → ports-DOrPTJzl.d.ts} +1 -1
  148. package/dist/powersync/index.d.ts +204 -4
  149. package/dist/powersync/index.js +361 -4
  150. package/dist/preset/index.d.ts +3 -3
  151. package/dist/preset/index.js +3 -3
  152. package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
  153. package/dist/{project-B32wb5J6.js → project-DJ9Uo0sT.js} +5 -5
  154. package/dist/{push-token-DQ1ycFPU.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
  155. package/dist/query/index.d.ts +1 -1
  156. package/dist/query/index.js +1 -1
  157. package/dist/react/index.d.ts +5 -5
  158. package/dist/react/index.js +1 -1
  159. package/dist/react/native/index.d.ts +1 -1
  160. package/dist/react/server.d.ts +5 -5
  161. package/dist/react/server.js +1 -1
  162. package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
  163. package/dist/react-router/index.js +2 -2
  164. package/dist/realtime/index.d.ts +3 -3
  165. package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
  166. package/dist/records/index.d.ts +5 -5
  167. package/dist/records/index.js +3 -3
  168. package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
  169. package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
  170. package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
  171. package/dist/server/index.d.ts +1 -1
  172. package/dist/server/index.js +4 -4
  173. package/dist/{sign-in-Cyj3ZlFX.js → sign-in-CuZ1Ag7O.js} +17 -2
  174. package/dist/solid/index.d.ts +5 -5
  175. package/dist/solid-start/index.js +2 -2
  176. package/dist/spec/index.js +1 -1
  177. package/dist/sql/index.d.ts +4 -4
  178. package/dist/sql/index.js +3 -3
  179. package/dist/{sql-CyeDg3Yh.js → sql-DHp0L7zK.js} +404 -165
  180. package/dist/ssr/index.d.ts +1 -1
  181. package/dist/svelte/index.d.ts +5 -5
  182. package/dist/sveltekit/index.js +2 -2
  183. package/dist/tanstack-start/index.js +2 -2
  184. package/dist/{tenant-C9YE_kqK.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
  185. package/dist/testing/index.d.ts +13 -4
  186. package/dist/testing/index.js +17 -15
  187. package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
  188. package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
  189. package/dist/{topic-breZqx_4.d.ts → topic-BaUElNw2.d.ts} +1 -1
  190. package/dist/{types-C3I7S51U.d.ts → types-CMN0h_Ix.d.ts} +2 -2
  191. package/dist/vue/index.d.ts +5 -5
  192. package/dist/{watch-topic-ItO3dz8m.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
  193. package/dist/workflow-sdk/world/index.js +2 -2
  194. package/dist/{workflow-sdk-BWPsdzVK.js → workflow-sdk-DJJkP0dT.js} +12 -1
  195. package/dist/yjs/index.d.ts +1 -1
  196. package/package.json +1 -1
  197. package/schemas/config-v1.json +9 -1
  198. package/schemas/doctor-report-v1.json +1 -0
  199. package/skills/better-supabase/references/ui-recipes.md +524 -295
  200. package/skills/better-supabase-api/references/powersync.md +16 -0
  201. package/skills/better-supabase-auth/SKILL.md +4 -1
  202. package/dist/cli/add-BdhGOwkB.js +0 -1
  203. package/dist/cli/env-CynGCICL.js +0 -1
  204. package/dist/cli/powersync-DnBsDchT.js +0 -1
  205. package/dist/cli/seed-BOun22-k.js +0 -1
@@ -46,5 +46,21 @@ Never throw for a kind that can't succeed: it blocks the upload queue.
46
46
  - `uploadRoute(server.db.attachments, { put: "create" })` for write-once tables: a `PUT` calls `create` and a `conflict` counts as applied (the row is already on the server); a `PATCH` is discarded as `unsupported`.
47
47
  - `onError: (error, { phase }) => ...` logs a failed `getSession` (`phase: "credentials"`, kind `unauthorized` or `network`; `fetchCredentials` returns `null`) and uploads that stay queued for a retry (`phase: "upload"`).
48
48
 
49
+ ## Offline blocks
50
+
51
+ `gen.powersync.instances` syncs `notifications`, `attachments`, `memberships`,
52
+ `teams` and `profiles`. Give each block client a local transport with
53
+ `server: rpcTransport(supabase)`, and route its tables through a server client:
54
+
55
+ | Block | Transport | Upload routes |
56
+ | ------------- | --------------------------------- | -------------------------------------------------------------------------------- |
57
+ | notifications | `powersyncNotificationsTransport` | `notification_recipients: notificationRecipientsRoute(remote)` |
58
+ | organizations | `powersyncMembershipsTransport` | `memberships: membershipsRoute(remote)` |
59
+ | teams | `powersyncTeamsTransport` | `teams: teamsRoute(remote, powersync)`, `team_members: teamMembersRoute(remote)` |
60
+ | profiles | `powersyncProfilesTransport` | `profiles: profilesRoute(remote)` |
61
+
62
+ The synced rows are the user's own (memberships, their teams, their profile).
63
+ Switching organizations and creating or deleting a team need the network.
64
+
49
65
  Docs: https://bettersupabase.com/docs/frontend/powersync.md and
50
66
  https://bettersupabase.com/docs/guides/offline-first.md.
@@ -172,9 +172,12 @@ membership lasts until the next refresh. When that window matters:
172
172
  - Sign in and out from a Server Action with `bsb.signIn`, `verifyOtp`,
173
173
  `authorizeUrl` and `exchangeCode`, `verifyMfa` or `signOut`, then
174
174
  `redirect(result.data.redirectTo)`. The result is plain data
175
- (`redirectTo`, `mfa`); reads later in the action (`bsb.context()`,
175
+ (`redirectTo`, `mfa`, `user`); reads later in the action (`bsb.context()`,
176
176
  `bsb.getRequestSession()`) see the new session, so build the landing
177
177
  context from them.
178
+ - Start email link flows with `bsb.signInWithOtp`, `resetPasswordForEmail`,
179
+ `signUp` or `resend`, not supabase-js: they write the PKCE verifier cookie
180
+ that `exchangeCode` reads on the link's callback.
178
181
  - After signing in or out in the browser client: `useSessionChange(sessionChanged)` from
179
182
  `better-supabase/next/client`. After switching the active organization:
180
183
  `useSessionChange(sessionChanged, router, { refreshToken: supabase })`, so
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-D4w-Axib.js";
@@ -1 +0,0 @@
1
- export { n as envCommand } from "./env-B2CbnbzD.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-B15CfH5Y.js";
@@ -1 +0,0 @@
1
- export { n as seedCommand } from "./seed-CDnL4Tnc.js";