better-supabase 0.29.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.
- package/dist/{adapter-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/{app-tables-DekyKNQ8.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
- package/dist/astro/index.js +2 -2
- package/dist/{authorization-C7nuWMuB.d.ts → authorization-DfEkyFt_.d.ts} +24 -3
- package/dist/{bind-DmUGUsBd.d.ts → bind-DAx0bMSi.d.ts} +2 -2
- package/dist/{block-env-DWtZsqhH.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
- package/dist/blocks/ai-chat/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +3 -3
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +1 -1
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/automations/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +1 -1
- package/dist/blocks/bookings/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +7 -3
- package/dist/blocks/calendar/index.js +5 -1
- package/dist/blocks/comments/index.d.ts +4 -4
- package/dist/blocks/employees/index.js +1 -4
- package/dist/blocks/entitlements/index.d.ts +2 -2
- package/dist/blocks/forms/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +4 -4
- package/dist/blocks/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +4 -4
- package/dist/blocks/mfa/index.d.ts +1 -1
- package/dist/blocks/notifications/index.d.ts +3 -3
- package/dist/blocks/notifications/index.js +5 -43
- package/dist/blocks/onboarding/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +34 -21
- package/dist/blocks/organizations/index.js +5 -1
- package/dist/blocks/permissions/index.d.ts +32 -3
- package/dist/blocks/permissions/index.js +23 -2
- package/dist/blocks/push/index.d.ts +10 -2
- package/dist/blocks/push/index.js +23 -7
- package/dist/blocks/reactions/index.d.ts +3 -3
- package/dist/blocks/saved-views/index.d.ts +1 -1
- package/dist/blocks/search/index.d.ts +2 -2
- package/dist/blocks/sessions/index.d.ts +1 -1
- package/dist/blocks/settings/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +1 -1
- package/dist/blocks/tags/index.d.ts +1 -1
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +7 -1
- package/dist/blocks/teams/index.js +8 -7
- package/dist/blocks/undo/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +3 -3
- package/dist/blocks/workflows/index.d.ts +3 -3
- package/dist/cli/{add-BKkV99g9.js → add-B9wP0YGU.js} +2 -2
- package/dist/cli/{add-CrQ3jS7t.js → add-DjZXKd7X.js} +10 -10
- package/dist/cli/add-ZcEOEK23.js +1 -0
- package/dist/cli/{app-table-files-PnPOpuB4.js → app-table-files-mtvjHa48.js} +2 -2
- package/dist/cli/{backfill-DDDLhinm.js → backfill-Coshdvh_.js} +2 -2
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-tRfYx_mh.js → blocks-BWCuA0nq.js} +2 -2
- package/dist/cli/{blocks-BCVcjvbm.js → blocks-hiSazThw.js} +1 -1
- package/dist/cli/{cache-DQZ09YOg.js → cache-x2wWAy0h.js} +1 -1
- package/dist/cli/{codemod-HKuwQmi_.js → codemod-BnjV7BpC.js} +210 -11
- package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
- package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
- package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
- package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
- package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
- package/dist/cli/{content-mapper-B0ehR7K-.js → content-mapper-DvOSOdTE.js} +2 -2
- package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
- package/dist/cli/{doctor-CXJOhwLB.js → doctor-Ywy8oJEU.js} +76 -18
- package/dist/cli/env-CNjT_uOV.js +1 -0
- package/dist/cli/{env-BM242BCV.js → env-XMiKvhtV.js} +2 -2
- package/dist/cli/{gen-B7rw4j19.js → gen-B-FbQmG1.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-C1bXXB_P.js → init-fb9e1BKX.js} +9 -9
- package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
- package/dist/cli/{live-PpAh9pAc.js → live-DIt7TP-N.js} +2 -2
- package/dist/cli/{mcp-BRNAchdH.js → mcp-CVWwraga.js} +3 -3
- package/dist/cli/{metadata-dAAKb_kR.js → metadata-CannIjel.js} +3 -3
- package/dist/cli/{migrate-BWYXFnaW.js → migrate-Ht2TzIQF.js} +2 -2
- package/dist/cli/{migration-safety-DGQswWZy.js → migration-safety-nNyB05I-.js} +1 -1
- package/dist/cli/{migrations-Cqk-lJwu.js → migrations-bAd7dpk1.js} +2 -2
- package/dist/cli/{module-migration-8-hMiZtW.js → module-migration-CkNux8dr.js} +2 -2
- package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
- package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
- package/dist/cli/{powersync-BWQ-8T3G.js → powersync-B2v0tDwp.js} +100 -7
- package/dist/cli/powersync-D3mAQ6QE.js +1 -0
- package/dist/cli/{print-DSTnq5xz.js → print-CxQ0rBKT.js} +2 -2
- package/dist/cli/{providers-Cjf5iOp5.js → providers-DtI90lSw.js} +1 -1
- package/dist/cli/{remove-CwG8cPv1.js → remove-DYtE4IZ4.js} +6 -6
- package/dist/cli/{render-B18iAdsT.js → render-QGWfEoiB.js} +3 -3
- package/dist/cli/{run-CvPl8iQd.js → run-B5aMwErM.js} +3 -3
- package/dist/cli/{run-C2Yg5MWt.js → run-BNoJKf5I.js} +40 -39
- package/dist/cli/{run-Wx_2Acgv.js → run-DiYX1XEa.js} +8 -8
- package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
- package/dist/cli/seed-Cm-c0BDd.js +1 -0
- package/dist/cli/{shared-BHbtUOvh.js → shared-D_CFi5di.js} +1 -1
- package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
- package/dist/cli/{snapshot-CXgsUPGj.js → snapshot-BlQ4DDcJ.js} +9 -4
- package/dist/cli/{source-B6aMAoEK.js → source-CelMBQMj.js} +1 -1
- package/dist/cli/{spec-EO0TP84d.js → spec-BxcoGE0h.js} +1 -1
- package/dist/cli/{spec-BcYic005.js → spec-iBx1LcYO.js} +3 -3
- package/dist/cli/{sql-layout-CkxDNVEH.js → sql-layout-Dp4Rottt.js} +2 -2
- package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
- package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
- package/dist/cli/{sync-pq6gmlhG.js → sync-BnORI43S.js} +4 -4
- package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
- package/dist/cli/{upgrade-Dp9p7A69.js → upgrade-CR6-WmIc.js} +5 -5
- package/dist/cli/{upgrade-BoHb4h9P.js → upgrade-fz92aCnh.js} +3 -3
- package/dist/cli/{version-CQHFm-ak.js → version-Dz8ZlOuh.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/index.js +4 -4
- package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
- package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
- package/dist/{context-B4TsE2gY.d.ts → context-DWWoP1wK.d.ts} +13 -1
- package/dist/{controller-CtwAsnVV.d.ts → controller-Br9dGKGe.d.ts} +1 -1
- package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +3 -3
- package/dist/create/lite/index.js +3 -3
- package/dist/delivery-events-DbL8IHIY.js +53 -0
- package/dist/edge/index.js +3 -3
- package/dist/{entitlements-Bw3eYGKJ.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
- package/dist/eve/index.js +1 -1
- package/dist/expo/index.js +3 -2
- package/dist/{field-errors-DkzFduux.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
- package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
- package/dist/hono/index.js +2 -2
- package/dist/{index-CB66nl14.d.ts → index-Clyd2Goi.d.ts} +1 -1
- package/dist/{index-Cw5gGSP8.d.ts → index-D98bQs8a.d.ts} +7 -7
- package/dist/{index-BNgpz_BV.d.ts → index-DIdPoQtO.d.ts} +2 -2
- package/dist/{index-BxckmAFc.d.ts → index-I8YLxKq8.d.ts} +2 -2
- package/dist/{index-CBQT_nXf.d.ts → index-eRBuKtMt.d.ts} +2 -2
- package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
- package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +1 -1
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/next/index.d.ts +155 -13
- package/dist/next/index.js +245 -52
- package/dist/{operations-CqmQrTKw.d.ts → operations-hm1Isvvs.d.ts} +1 -1
- package/dist/{options-C4LuqmdG.js → options-CF6EVF_G.js} +3 -1
- package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
- package/dist/orpc/index.js +2 -1
- package/dist/otel/index.js +4 -4
- package/dist/{ports-6LBgr1Aa.d.ts → ports-DOrPTJzl.d.ts} +1 -1
- package/dist/powersync/index.d.ts +204 -4
- package/dist/powersync/index.js +361 -4
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
- package/dist/{project-C4NA_van.js → project-DJ9Uo0sT.js} +5 -5
- package/dist/{push-token-BXsrJ7W9.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/query/index.js +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/index.js +1 -1
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +5 -5
- package/dist/react/server.js +1 -1
- package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
- package/dist/react-router/index.js +2 -2
- package/dist/realtime/index.d.ts +3 -3
- package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
- package/dist/records/index.d.ts +5 -5
- package/dist/records/index.js +3 -3
- package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
- package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
- package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +4 -4
- package/dist/sign-in-BzihC_8k.d.ts +50 -0
- package/dist/{sign-in-NO7LWlw4.js → sign-in-CuZ1Ag7O.js} +136 -26
- package/dist/solid/index.d.ts +5 -5
- package/dist/solid-start/index.js +2 -2
- package/dist/spec/index.js +1 -1
- package/dist/sql/index.d.ts +4 -4
- package/dist/sql/index.js +3 -3
- package/dist/{sql-CoBySj2F.js → sql-DHp0L7zK.js} +680 -333
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +5 -5
- package/dist/sveltekit/index.js +2 -2
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-Ded341Qz.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
- package/dist/testing/index.d.ts +13 -4
- package/dist/testing/index.js +17 -15
- package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
- package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
- package/dist/{topic-XDdKzlrn.d.ts → topic-BaUElNw2.d.ts} +1 -1
- package/dist/{types-BFwB-E1j.d.ts → types-CMN0h_Ix.d.ts} +2 -2
- package/dist/vue/index.d.ts +5 -5
- package/dist/{watch-topic-DpN_GEoS.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
- package/dist/workflow-sdk/world/index.js +2 -2
- package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-DJJkP0dT.js} +47 -8
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +10 -1
- package/schemas/doctor-report-v1.json +2 -0
- package/skills/better-supabase/references/ui-recipes.md +524 -295
- package/skills/better-supabase-api/references/powersync.md +16 -0
- package/skills/better-supabase-auth/SKILL.md +11 -1
- package/dist/cli/add-CwhrRJz5.js +0 -1
- package/dist/cli/env-uqfUbUzk.js +0 -1
- package/dist/cli/powersync-CbYxLsjv.js +0 -1
- package/dist/cli/seed-BOun22-k.js +0 -1
- package/dist/sign-in-CfwJAJJL.d.ts +0 -24
|
@@ -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.
|
|
@@ -169,7 +169,16 @@ membership lasts until the next refresh. When that window matters:
|
|
|
169
169
|
- `bsb.invalidateSession(userId)` reaches the server caches and the caller's
|
|
170
170
|
router only; another user's browser keeps its private entries until they
|
|
171
171
|
go stale.
|
|
172
|
-
-
|
|
172
|
+
- Sign in and out from a Server Action with `bsb.signIn`, `verifyOtp`,
|
|
173
|
+
`authorizeUrl` and `exchangeCode`, `verifyMfa` or `signOut`, then
|
|
174
|
+
`redirect(result.data.redirectTo)`. The result is plain data
|
|
175
|
+
(`redirectTo`, `mfa`, `user`); reads later in the action (`bsb.context()`,
|
|
176
|
+
`bsb.getRequestSession()`) see the new session, so build the landing
|
|
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.
|
|
181
|
+
- After signing in or out in the browser client: `useSessionChange(sessionChanged)` from
|
|
173
182
|
`better-supabase/next/client`. After switching the active organization:
|
|
174
183
|
`useSessionChange(sessionChanged, router, { refreshToken: supabase })`, so
|
|
175
184
|
the new token reaches the server before it renders.
|
|
@@ -206,6 +215,7 @@ before touching the hook, claims, tenant or entitlements.
|
|
|
206
215
|
|
|
207
216
|
https://bettersupabase.com/docs/auth.md,
|
|
208
217
|
https://bettersupabase.com/docs/frameworks/next.md (bearer callers),
|
|
218
|
+
https://bettersupabase.com/docs/frameworks/next-auth.md (sign-in and sign-out),
|
|
209
219
|
https://bettersupabase.com/docs/auth/account-deletion.md,
|
|
210
220
|
https://bettersupabase.com/docs/frameworks/next-cache-components.md and
|
|
211
221
|
https://bettersupabase.com/docs/extending/authorization-providers.md.
|
package/dist/cli/add-CwhrRJz5.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as addCommand } from "./add-CrQ3jS7t.js";
|
package/dist/cli/env-uqfUbUzk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { n as envCommand } from "./env-BM242BCV.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as powersyncStreamsCommand } from "./powersync-BWQ-8T3G.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { n as seedCommand } from "./seed-CDnL4Tnc.js";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { f as Result } from "./result-DZeA5KS6.js";
|
|
2
|
-
import { _ as StoredSession } from "./resolve-CtX6T0c0.js";
|
|
3
|
-
import { t as RefreshOptions } from "./refresh-D02Pbf5B.js";
|
|
4
|
-
//#region src/auth/sign-in.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* `next` when it is a same-origin path (`/dashboard?tab=1`), else `fallback`.
|
|
7
|
-
* Use it on any `?next=` or `redirectTo` value a request carries, so the value
|
|
8
|
-
* can't send the user to another origin.
|
|
9
|
-
*/
|
|
10
|
-
declare function safeRedirectPath(next: string | null | undefined, fallback: string): string;
|
|
11
|
-
type PasswordGrantOptions = Omit<RefreshOptions, "now"> & {
|
|
12
|
-
readonly now?: () => number;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Signs in with an email and a password against the Auth server's password
|
|
16
|
-
* grant, without a supabase-js client. Returns the session to write as
|
|
17
|
-
* cookies.
|
|
18
|
-
*/
|
|
19
|
-
declare function passwordGrant(credentials: {
|
|
20
|
-
readonly email: string;
|
|
21
|
-
readonly password: string;
|
|
22
|
-
}, options: PasswordGrantOptions): Promise<Result<StoredSession>>;
|
|
23
|
-
//#endregion
|
|
24
|
-
export { passwordGrant as n, safeRedirectPath as r, PasswordGrantOptions as t };
|