better-supabase 0.15.1 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ai-schedules-D_Hz-ik5.d.ts → ai-schedules-Dk9H3kAp.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/{api-DxAPqMrE.d.ts → api-CpL3hm87.d.ts} +1 -1
- package/dist/{app-tables-D29Rahtg.js → app-tables-Q0TYfeih.js} +1 -0
- package/dist/{app-tables-CbCFSXLG.d.ts → app-tables-dS02piE7.d.ts} +1 -1
- package/dist/astro/index.d.ts +4 -4
- package/dist/{auth-module-BEFESDC4.js → auth-module-BbmX-N4L.js} +12 -4
- package/dist/{authorization-HZdJCaVm.d.ts → authorization-CNsvnwle.d.ts} +19 -3
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-h5jre2K0.d.ts → bind-C801IaK-.d.ts} +4 -4
- package/dist/{block-env-BrfRvPrj.d.ts → block-env-BeG4DiiO.d.ts} +4 -4
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/activities/index.d.ts +1 -1
- package/dist/blocks/agents/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-chat/index.d.ts +4 -4
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/api-keys/index.d.ts +2 -2
- package/dist/blocks/approvals/index.d.ts +1 -1
- package/dist/blocks/assets/index.d.ts +1 -1
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +2 -2
- package/dist/blocks/audit/index.d.ts +5 -5
- package/dist/blocks/automations/index.d.ts +3 -3
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +2 -2
- package/dist/blocks/catalog/index.d.ts +1 -1
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/comments/index.d.ts +5 -5
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/contacts/index.d.ts +1 -1
- package/dist/blocks/content/index.d.ts +1 -1
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/courses/index.d.ts +1 -1
- package/dist/blocks/created-by/index.d.ts +4 -3
- package/dist/blocks/created-by/index.js +2 -2
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +1 -1
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/dispatch/index.d.ts +1 -1
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/drive/index.d.ts +1 -1
- package/dist/blocks/employees/index.d.ts +2 -2
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +1 -1
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +2 -2
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/identities/index.d.ts +1 -1
- package/dist/blocks/imports/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +5 -5
- package/dist/blocks/incidents/index.d.ts +1 -1
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +1 -1
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/mail-sync/index.d.ts +1 -1
- package/dist/blocks/memberships/index.d.ts +1 -1
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +1 -1
- package/dist/blocks/notifications/index.d.ts +4 -4
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +2 -2
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/passes/index.d.ts +1 -1
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/posts/index.d.ts +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/queue/index.d.ts +29 -2
- package/dist/blocks/queue/index.js +1 -1
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/scores/index.d.ts +1 -1
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/segments/index.d.ts +1 -1
- package/dist/blocks/sequences/index.d.ts +1 -1
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/shipments/index.d.ts +1 -1
- package/dist/blocks/signatures/index.d.ts +1 -1
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/templates/index.d.ts +1 -1
- package/dist/blocks/time-tracking/index.d.ts +1 -1
- package/dist/blocks/timeline/index.d.ts +3 -3
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +7 -4
- package/dist/blocks/updated-at/index.js +2 -2
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.d.ts +2 -2
- package/dist/blocks/webhooks/index.js +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +4 -4
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{bucket-CiNi8sIw.d.ts → bucket-vc-QRrva.d.ts} +40 -1
- package/dist/cli/{add-C04vkBk9.js → add-BinNYhFD.js} +2 -2
- package/dist/cli/{add-DNOL9PDu.js → add-DMcrsWjC.js} +13 -11
- package/dist/cli/add-z-3pXI6C.js +1 -0
- package/dist/cli/{backfill-VFzf-TJP.js → backfill-DxBB62Zr.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-Cb7mILFU.js → blocks-DSgTifw0.js} +1 -1
- package/dist/cli/{blocks-Bn7WUca5.js → blocks-rxOS-Mzz.js} +1 -1
- package/dist/cli/{cache-DkplpIGe.js → cache-oU0yHKf0.js} +1 -1
- package/dist/cli/{codemod-BbaE5dL_.js → codemod-Dsrv_3gQ.js} +1 -1
- package/dist/cli/{config-9t5ec_N7.js → config-2rwFHbwj.js} +3 -1
- package/dist/cli/{config-CBqkQjjN.js → config-C6XylzKz.js} +1 -1
- package/dist/cli/{content-mapper-Cdx6arxu.js → content-mapper-DLbXilBz.js} +2 -2
- package/dist/cli/{db-DrBI_HNv.js → db-Bwrr3GHM.js} +2 -2
- package/dist/cli/{doctor-C-VO-QQ2.js → doctor-CKt5Yyl4.js} +184 -142
- package/dist/cli/{gen-yRHOHW1b.js → gen-CeG6lbka.js} +13 -13
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-BOw0SX65.js → init-DrQlf9RL.js} +6 -6
- package/dist/cli/{live-Lmg-hYyO.js → live-BvWGM4c3.js} +2 -2
- package/dist/cli/{mcp-DQ1zR2eA.js → mcp-BrOnGB15.js} +2 -2
- package/dist/cli/{metadata-CZaxkv21.js → metadata-BNSdPuKp.js} +3 -3
- package/dist/cli/{migration-safety-BbhLu2fo.js → migration-safety-NtB3dsRU.js} +2 -2
- package/dist/cli/{module-migration-DOn6EmNz.js → module-migration-mKhX88V_.js} +1 -1
- package/dist/cli/{print-D_xf8PPj.js → print-Dh8iuPK3.js} +1 -1
- package/dist/cli/{remove-BY_TOTRj.js → remove-DfFXVBRr.js} +5 -5
- package/dist/cli/{render-lJmHr0y9.js → render-ChIwdIOJ.js} +10 -4
- package/dist/cli/{run-BJ6IMs_H.js → run-CLSHSVYo.js} +7 -7
- package/dist/cli/{run-DkB0fhc9.js → run-D48ZEU58.js} +24 -24
- package/dist/cli/{seed-Cz8PcXeT.js → seed-CG-pA-5N.js} +2 -2
- package/dist/cli/seed-CUxW5Dks.js +1 -0
- package/dist/cli/{shared-Bh-6IqJS.js → shared-D0XBFSlz.js} +1 -1
- package/dist/cli/{snapshot-Bzcigm7T.js → snapshot-C6vh_n3t.js} +3 -3
- package/dist/cli/{source-WoLdcQzN.js → source-BZbEK5if.js} +1 -1
- package/dist/cli/{source-args-IpJRJO5t.js → source-args-MTLYpifA.js} +1 -1
- package/dist/cli/{spec-CZMiLhv_.js → spec-B4LhpI6t.js} +2 -2
- package/dist/cli/{spec-BF_dpwzW.js → spec-C-dhdKwa.js} +1 -1
- package/dist/cli/{sql-layout-rFP0oq1N.js → sql-layout-26LSoifK.js} +2 -2
- package/dist/cli/{sync-mANmYYoL.js → sync-CHGMZCJ5.js} +2 -2
- package/dist/cli/{upgrade-B0Q9wMs-.js → upgrade-C0dVsqNX.js} +3 -3
- package/dist/cli/{upgrade-BrNLt92u.js → upgrade-GB9rqUGT.js} +2 -2
- package/dist/cli/{version-CyavsyGA.js → version-T507a49w.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +1 -1
- package/dist/{client-BAEbEA7t.js → client-C_mlji5R.js} +6 -5
- package/dist/{composite-BZYXlVBN.d.ts → composite-B7f1MMgr.d.ts} +4 -3
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-DWGgUQCh.js → config-BVNNJwGC.js} +7 -6
- package/dist/{config-CcehOvbz.js → config-CIBc79_8.js} +1 -1
- package/dist/{context-TGX2eDS5.d.ts → context-CKCgjEDF.d.ts} +9 -2
- package/dist/{controller-DyPPMFSw.d.ts → controller-CJUXhshv.d.ts} +1 -1
- package/dist/{conversion-O-kyhXcC.d.ts → conversion-DgHdDlTK.d.ts} +1 -1
- package/dist/create/index.d.ts +2 -2
- package/dist/create/index.js +5 -5
- package/dist/{define-DFBnQyYg.d.ts → define-Cgru0_kF.d.ts} +2 -2
- package/dist/{define-block-DvvcM54N.d.ts → define-block-Xxw8Hroe.d.ts} +2 -2
- package/dist/edge/index.d.ts +5 -5
- package/dist/{entitlements-BnhDBxLW.d.ts → entitlements-B0jmjNLD.d.ts} +1 -1
- package/dist/{executor-CVIn6JHa.d.ts → executor-BWFfz0ik.d.ts} +2 -2
- package/dist/expo/index.d.ts +2 -2
- package/dist/{extension-B-lajjex.js → extension-DTaHjwdc.js} +3 -2
- package/dist/{extension-B0EjCYhO.js → extension-mGylYROs.js} +2 -10
- package/dist/{field-errors-DYtg1mwv.d.ts → field-errors-DqlebtTE.d.ts} +12 -12
- package/dist/{framework-h5lP_5yj.d.ts → framework-CF6zFU7a.d.ts} +3 -3
- package/dist/hono/index.d.ts +4 -4
- package/dist/{index-BfkltrGJ.d.ts → index-B8YjrfVl.d.ts} +2 -2
- package/dist/{index-BAHGLvGD.d.ts → index-BCeTYhFk.d.ts} +1 -1
- package/dist/{index-Do2ChN_y.d.ts → index-CQhPHHDF.d.ts} +20 -2
- package/dist/{index-Ab4UeEn_.d.ts → index-ClMN0f98.d.ts} +44 -12
- package/dist/{index-B4gcStOz.d.ts → index-DUxXdQN_.d.ts} +3 -3
- package/dist/{index-BfK6olKm.d.ts → index-Dbb7BQdi.d.ts} +9 -4
- package/dist/{index-DN9mfmhA.d.ts → index-lB-8iPmY.d.ts} +51 -3
- package/dist/index.d.ts +2 -2
- package/dist/{instances-BHjCZoF8.js → instances-QOzIz9-q.js} +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/{list-query-BDVutLFr.d.ts → list-query-DxjuIHEL.d.ts} +1 -1
- package/dist/mapper/bin.js +6 -6
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/sdk/index.d.ts +2 -2
- package/dist/next/client/index.d.ts +81 -1
- package/dist/next/client/index.js +178 -2
- package/dist/next/index.d.ts +15 -14
- package/dist/{operations-CSc_IsHO.d.ts → operations-Dc07aV_H.d.ts} +1 -1
- package/dist/{options-DChZoVfs.d.ts → options-B_NrjVDt.d.ts} +1 -0
- package/dist/{options-B2swWnJW.js → options-CCUaRLgd.js} +2 -1
- package/dist/{options-CM6-18FQ.d.ts → options-CDSCkYxu.d.ts} +1 -0
- package/dist/{options-C-dQHH5-.js → options-tSsUF0-7.js} +2 -1
- package/dist/orpc/index.d.ts +4 -4
- package/dist/otel/index.js +4 -4
- package/dist/{ports-DOhtuw3c.js → ports-CaVRXjxq.js} +1 -1
- package/dist/{ports-CpdiQv1D.d.ts → ports-DnpAuTvB.d.ts} +1 -1
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-CsHnIBJF.js → preset-BIANzB5p.js} +2 -2
- package/dist/{push-token-B3m3pWAv.d.ts → push-token-C_mFkYfq.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{rate-limit-o44SYkVY.js → rate-limit-Dt9vAY4E.js} +53 -0
- package/dist/react/index.d.ts +6 -6
- package/dist/react/index.js +3 -3
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/native/index.js +1 -1
- package/dist/react/server.d.ts +12 -7
- package/dist/react/server.js +8 -3
- package/dist/react/session.d.ts +5 -0
- package/dist/react/session.js +9 -1
- package/dist/{react-BuDYI62C.js → react-CZUZYn9E.js} +41 -4
- package/dist/react-router/index.d.ts +3 -3
- package/dist/realtime/index.d.ts +5 -5
- package/dist/realtime/index.js +2 -1
- package/dist/{record-form-DB_5Ue_B.d.ts → record-form-xWvVcb86.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/relay-gKvKJ3xf.js +208 -0
- package/dist/{resource-execute-CzHuDsil.d.ts → resource-execute-DqWfEc56.d.ts} +1 -1
- package/dist/{resource-types-DnKiH4G2.d.ts → resource-types-BIoz_ElD.d.ts} +1 -1
- package/dist/{resources-B9cQxhjw.d.ts → resources-Bt2PDKE7.d.ts} +1 -1
- package/dist/server/index.d.ts +147 -9
- package/dist/server/index.js +396 -1
- package/dist/{server-types-7QPzW2bF.d.ts → server-types-gR4Q1aM0.d.ts} +5 -354
- package/dist/{session-CfBCJGgc.d.ts → session-C1OuXbtN.d.ts} +2 -1
- package/dist/session-status-qQLm7jzh.d.ts +82 -0
- package/dist/{sign-in-BsIaNx2C.js → sign-in-CmPK1AgM.js} +20 -10
- package/dist/solid/index.d.ts +7 -7
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/spec/index.d.ts +1 -1
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +3 -3
- package/dist/{sql-OLVW4t08.js → sql-ClTmzHs8.js} +199 -31
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +54 -1
- package/dist/support-B4ZBVxt3.d.ts +357 -0
- package/dist/svelte/index.d.ts +7 -7
- package/dist/svelte/index.js +1 -1
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/{tags-BjHflcHF.d.ts → tags-sM-CH9Mn.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/{tenant-DzFsg0Pc.d.ts → tenant-DVvjw9H-.d.ts} +1 -1
- package/dist/testing/index.d.ts +9 -8
- package/dist/testing/index.js +3 -3
- package/dist/{timeline-WrFMgd3U.d.ts → timeline-BBfKuMVL.d.ts} +3 -3
- package/dist/{topic-DNFEFGKI.d.ts → topic-BtLz-qTI.d.ts} +3 -3
- package/dist/{verify-CMou8dWZ.d.ts → verify-DEqY__0N.d.ts} +1 -1
- package/dist/vue/index.d.ts +7 -7
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-Bo9S2R4P.d.ts → watch-topic-tnfOTa3-.d.ts} +1 -1
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +22 -0
- package/schemas/doctor-report-v1.json +1 -0
- package/skills/better-supabase-api/SKILL.md +3 -1
- package/skills/better-supabase-auth/SKILL.md +7 -0
- package/dist/cli/add-CUH0rORo.js +0 -1
- package/dist/cli/seed-D6XijwbR.js +0 -1
package/schemas/config-v1.json
CHANGED
|
@@ -217,6 +217,12 @@
|
|
|
217
217
|
"type": "string",
|
|
218
218
|
"description": "Who a block's rows belong to, unless the block sets its own scope: tenant (the default), user (the signed-in user, no tenants) or none (one shared space every signed-in user uses).",
|
|
219
219
|
"default": "tenant"
|
|
220
|
+
},
|
|
221
|
+
"ownTablePolicies": {
|
|
222
|
+
"enum": ["block", "app"],
|
|
223
|
+
"type": "string",
|
|
224
|
+
"description": "Whose policies govern the app's tables a block runs over, unless the block sets its own ownTablePolicies: block (the default) lets a block add its bsb_ policies where none of the app's covers them, and app keeps every bsb_ policy, permissive or restrictive, off them.",
|
|
225
|
+
"default": "block"
|
|
220
226
|
}
|
|
221
227
|
},
|
|
222
228
|
"additionalProperties": false
|
|
@@ -3050,6 +3056,11 @@
|
|
|
3050
3056
|
"type": "string",
|
|
3051
3057
|
"description": "Who the block's rows belong to: tenant, user or none. Defaults to database.sql.owner, then tenant."
|
|
3052
3058
|
},
|
|
3059
|
+
"ownTablePolicies": {
|
|
3060
|
+
"enum": ["block", "app"],
|
|
3061
|
+
"type": "string",
|
|
3062
|
+
"description": "Whose policies govern the app's tables this block runs over: block lets it add its bsb_ policies where none of the app's covers them, app keeps every bsb_ policy, permissive or restrictive, off them. Applies to every app table of the block. Defaults to database.sql.ownTablePolicies, then block."
|
|
3063
|
+
},
|
|
3053
3064
|
"functions": {
|
|
3054
3065
|
"type": "object",
|
|
3055
3066
|
"additionalProperties": {
|
|
@@ -3231,6 +3242,11 @@
|
|
|
3231
3242
|
"type": "string",
|
|
3232
3243
|
"description": "Who the block's rows belong to: tenant, user or none. Defaults to database.sql.owner, then tenant."
|
|
3233
3244
|
},
|
|
3245
|
+
"ownTablePolicies": {
|
|
3246
|
+
"enum": ["block", "app"],
|
|
3247
|
+
"type": "string",
|
|
3248
|
+
"description": "Whose policies govern the app's tables this block runs over: block lets it add its bsb_ policies where none of the app's covers them, app keeps every bsb_ policy, permissive or restrictive, off them. Applies to every app table of the block. Defaults to database.sql.ownTablePolicies, then block."
|
|
3249
|
+
},
|
|
3234
3250
|
"functions": {
|
|
3235
3251
|
"type": "object",
|
|
3236
3252
|
"properties": {
|
|
@@ -4257,6 +4273,9 @@
|
|
|
4257
4273
|
"impersonatedBy": {
|
|
4258
4274
|
"type": "string",
|
|
4259
4275
|
"default": "impersonated_by"
|
|
4276
|
+
},
|
|
4277
|
+
"stamp": {
|
|
4278
|
+
"default": "client"
|
|
4260
4279
|
}
|
|
4261
4280
|
}
|
|
4262
4281
|
}
|
|
@@ -6152,6 +6171,9 @@
|
|
|
6152
6171
|
"updatedAt": {
|
|
6153
6172
|
"type": "string",
|
|
6154
6173
|
"default": "updated_at"
|
|
6174
|
+
},
|
|
6175
|
+
"stamp": {
|
|
6176
|
+
"default": "client"
|
|
6155
6177
|
}
|
|
6156
6178
|
}
|
|
6157
6179
|
}
|
|
@@ -144,11 +144,13 @@ and upload through `bsb.db`, as in [references/powersync.md](references/powersyn
|
|
|
144
144
|
|
|
145
145
|
- `createQueue({ sql: postgres.admin, queues: { queue_name: zodSchema } })` runs on Supabase Queues (pgmq): `enqueue(queue, payload, { context: db.$context })` in the request, then `work` or `drain` in a worker, where `const db = await bsb.forContext(job.context).orThrow()` runs the work as the enqueuing user with RLS (it fails with `forbidden` for a job without a user; use `bsb.admin(job.context)` only for work no user owns). The handler throws to retry. `schedule(name, cron, queue, payload, { timeZone })` uses pg_cron, or with `blocks.queue.options.scheduler: "drain"` a `jobs.drainRoute({ secret: process.env.CRON_SECRET, handlers })` route that Vercel Cron calls; `blocks.queue.options.backend: "table"` runs without pgmq. Queue names are lowercase letters, digits and underscores. With a service-role Supabase client instead of SQL, it uses the `pgmq_public` RPCs (no dedupe or schedules).
|
|
146
146
|
- `createIdempotency({ sql: postgres.admin }).handle(request, handler)` for POST endpoints that clients retry.
|
|
147
|
+
- `createRateLimit({ sql: postgres.admin })` limits keys that aren't claims: `check(scope, key, rule?)` for one limit, `checkAll([{ scope, key, rule? }, ...])` for several in one round trip that counts only when all allow (each limit its own scope; `blocked` names the refusing one). Answer a refusal with `rateLimited(decision)`.
|
|
148
|
+
- Large browser uploads: `bucket.connect(client).reserveResumable(target)` (`better-supabase/storage`) signs a TUS upload and returns `{ tusEndpoint, headers, metadata, expiresAt, bucket, path, token }`; hand `endpoint: tusEndpoint`, `headers` (`x-signature`, `x-upsert`) and `metadata` (plus `contentType`) to `tus-js-client`, so the browser needs no access token. Call `claimReserved(reservation)` afterwards, which a support session needs.
|
|
147
149
|
- `createWebhookInbox({ transport: sqlTransport(postgres.admin), source, secrets }).receive(request)` for webhooks; `process(handler)` later. `createInbox` is the conversation inbox (`blocks/inbox`), not this.
|
|
148
150
|
- Times are `Temporal.Instant`: `EnqueueOptions.runAt`, `Job.enqueuedAt`, `Job.visibleUntil`, `WebhookInboxMessage.receivedAt` and webhook timestamps.
|
|
149
151
|
- Schedule cleanup with pg_cron at a quiet hour: `better_supabase.purge_job_archive('<queue>')`, `purge_webhooks()`, `purge_audit_log()`, `purge_idempotency_keys()`, `purge_rate_limits()`, `purge_outbox()`, `purge_notifications()` and `purge_webhook_deliveries()`, for the modules you installed. Only `service_role` can execute them.
|
|
150
152
|
- Audit a table with `better_supabase.audit('public.t', redact => '{secret}', event_prefix => 't')`. Each call replaces all of the table's settings, so a second call without `ignore` and `redact` clears them; read `audit_settings('public.t')` first when another package also registers the table; record non-row events with `better_supabase.audit_event(event_type, ...)` and an `idempotency_key`. For per-tenant retention, write an `audit_retention(tenant)` SQL function or call `purgeAuditLog(sql, { retention })` from `better-supabase/blocks/audit`, which also has `auditListQuery` and `exportAuditLog` (NDJSON or OCSF). `upgrade` writes a pgTAP file per audited table, and doctor BS315 lists tables without the trigger; exempt the rest with `blocks.audit.options.exempt` globs.
|
|
151
|
-
- For a "view as user" support mode, add the `impersonation` SQL module, pass `support: supportSessions({ store: sqlSupportStore(postgres) })` to `createServer`, call `bsb.startSupport({ targetUserId, reason })` and `bsb.stopSupport()` from server actions, and show a banner with `useSupportSession()`. Sessions are read-only by default; grant admins the `support.start` platform permission.
|
|
153
|
+
- For a "view as user" support mode, add the `impersonation` SQL module, pass `support: supportSessions({ store: sqlSupportStore(postgres) })` to `createServer`, call `bsb.startSupport({ targetUserId, reason })` and `bsb.stopSupport()` from server actions, and show a banner with `useSupportSession()`. Sessions are read-only by default; grant admins the `support.start` platform permission. Realtime in a support session (or with httpOnly cookies) goes through `export const { GET, POST } = realtimeRelay(bsb, { topics: [myTopic, liveRelayTopic], postgres })` from `better-supabase/server`, which checks each topic's `realtime.messages` policies as the viewed user; pass `realtime={useRealtimeRelay("/api/realtime")}` to `<BetterSupabaseProvider>` (or `relayRealtimeClient(url)` / `relayTopicPort(url)` from `better-supabase/realtime`) so `subscribe`, `useBroadcast`, `usePresence` and `useLiveQuery` work unchanged. Never subscribe in the browser with the admin's own client during a support session.
|
|
152
154
|
- For teams, add the `organizations` and `invitations` SQL modules and call them through `createOrganizations({ transport: sqlTransport(postgres.asUser(claims)), events: betterSupabase.events, onInvite })` from `better-supabase/blocks/organizations`. Send the invitation email in `onInvite`, show `previewInvitation(token)` on the accept page, and switch with `organizations.switch(id)`, refreshing the session when it returns `refresh: true`. Errors carry codes such as `ORGANIZATION_SLUG_TAKEN` in `hint`. Tables your schema already has are detected and kept; map other names with `tables` and `columns`.
|
|
153
155
|
- For user profiles, add the `profiles` SQL module: sign-up creates the row from auth metadata with a unique username and mirrors the email; users update only the `updatable` columns. An existing `profiles` table is detected and kept: the block adds only the columns it lacks, `tables` and `columns` map other names, and `syncTrigger: false` leaves profile creation to your own trigger. Use `avatarBucket()` and `organizationLogoBucket()` from `better-supabase/storage` for uploads; `policy: { access: { read, write } }` checks any bucket through the access contract.
|
|
154
156
|
- For events other systems must see, add the `outbox` SQL module and write events with `emit_event(type, payload, subject, tenant, key)` inside the same transaction as the change (the SQL modules emit theirs automatically). Relay them with `createOutbox({ transport: sqlTransport(postgres.admin), source }).relayRoute({ secret, consumers: { name: httpSink(url) } })` from `better-supabase/blocks/outbox` after `outbox.register(name, { types })`. Delivery is at least once; receivers deduplicate on the CloudEvent `id`.
|
|
@@ -118,6 +118,13 @@ A proxy or middleware with its own Supabase client calls
|
|
|
118
118
|
`sessionStatus(request, { url, publishableKey })` from `better-supabase/ssr`
|
|
119
119
|
(`"ended"` on a 401 or 403 from Auth; treat `"unknown"` as active) and
|
|
120
120
|
`clearSessionCookies(request, response, { url })` before redirecting.
|
|
121
|
+
An app with httpOnly session cookies and no browser Supabase client watches
|
|
122
|
+
an open page with `export const GET = sessionStatusRoute(bsb)` (from
|
|
123
|
+
`better-supabase/server`) and `useSessionWatch({ redirect: "/login" })` (from
|
|
124
|
+
`better-supabase/next/client`): it checks on focus, visibility and an
|
|
125
|
+
interval, reloads on `ended`, `banned` or `signed_out`, refreshes the router
|
|
126
|
+
on `claims_changed` (the claims fingerprint, support target included, moved)
|
|
127
|
+
and tells the other tabs over a `BroadcastChannel`.
|
|
121
128
|
|
|
122
129
|
Done when the irreversible action returns `SESSION_REVOKED` for a signed-out
|
|
123
130
|
session in a test.
|
package/dist/cli/add-CUH0rORo.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as addCommand } from "./add-DNOL9PDu.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { n as seedCommand } from "./seed-Cz8PcXeT.js";
|