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
|
@@ -1,6 +1,124 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useCallback } from "react";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { useRouter } from "next/navigation.js";
|
|
4
|
+
//#region src/next/client/session-watch.ts
|
|
5
|
+
const REASONS = /* @__PURE__ */ new Set([
|
|
6
|
+
"ended",
|
|
7
|
+
"banned",
|
|
8
|
+
"signed_out",
|
|
9
|
+
"claims_changed"
|
|
10
|
+
]);
|
|
11
|
+
function isTabMessage(value) {
|
|
12
|
+
if (typeof value !== "object" || value === null) return false;
|
|
13
|
+
const message = value;
|
|
14
|
+
return message.type === "better-supabase:session" && typeof message.reason === "string" && REASONS.has(message.reason) && (message.fingerprint === null || typeof message.fingerprint === "string");
|
|
15
|
+
}
|
|
16
|
+
function isBody(value) {
|
|
17
|
+
if (typeof value !== "object" || value === null) return false;
|
|
18
|
+
const body = value;
|
|
19
|
+
return typeof body.status === "string" && (body.fingerprint === null || typeof body.fingerprint === "string");
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Watches the session through `sessionStatusRoute`: checks when the window gets
|
|
23
|
+
* focus or becomes visible and on an interval while visible, and calls
|
|
24
|
+
* `onChange` when the session ended, the user was banned or signed out, or the
|
|
25
|
+
* claims fingerprint changed. Each change is posted to the app's other tabs,
|
|
26
|
+
* which call their own `onChange` with `source: "tab"`. Failed checks are
|
|
27
|
+
* ignored and retried on the next trigger.
|
|
28
|
+
*/
|
|
29
|
+
function watchSession(onChange, options = {}) {
|
|
30
|
+
const url = options.url ?? "/api/session-status";
|
|
31
|
+
const intervalMs = options.intervalMs ?? 6e4;
|
|
32
|
+
const doFetch = options.fetch ?? globalThis.fetch.bind(globalThis);
|
|
33
|
+
const channelName = options.channel ?? "better-supabase:session";
|
|
34
|
+
let baseline = options.fingerprint;
|
|
35
|
+
let running;
|
|
36
|
+
let stopped = false;
|
|
37
|
+
const channel = channelName !== false && typeof BroadcastChannel === "function" ? new BroadcastChannel(channelName) : void 0;
|
|
38
|
+
const visible = () => !("document" in globalThis) || globalThis.document.visibilityState !== "hidden";
|
|
39
|
+
const report = (reason, status) => {
|
|
40
|
+
const message = {
|
|
41
|
+
type: "better-supabase:session",
|
|
42
|
+
reason,
|
|
43
|
+
fingerprint: status.fingerprint
|
|
44
|
+
};
|
|
45
|
+
channel?.postMessage(message);
|
|
46
|
+
onChange({
|
|
47
|
+
reason,
|
|
48
|
+
status,
|
|
49
|
+
source: "check"
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const settle = (status) => {
|
|
53
|
+
if (status.status === "expired") return;
|
|
54
|
+
const next = status.status === "active" ? status.fingerprint : null;
|
|
55
|
+
const previous = baseline;
|
|
56
|
+
baseline = next;
|
|
57
|
+
if (previous === void 0 || previous === next) return;
|
|
58
|
+
if (next === null) {
|
|
59
|
+
report(status.status === "ended" || status.status === "banned" ? status.status : "signed_out", status);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
report("claims_changed", status);
|
|
63
|
+
};
|
|
64
|
+
const run = async () => {
|
|
65
|
+
try {
|
|
66
|
+
const response = await doFetch(url, {
|
|
67
|
+
method: "GET",
|
|
68
|
+
credentials: "same-origin",
|
|
69
|
+
cache: "no-store",
|
|
70
|
+
headers: { accept: "application/json" }
|
|
71
|
+
});
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
await response.body?.cancel();
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const body = await response.json();
|
|
77
|
+
if (!isBody(body) || stopped) return;
|
|
78
|
+
options.onStatus?.(body);
|
|
79
|
+
settle(body);
|
|
80
|
+
return body;
|
|
81
|
+
} catch {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const check = () => {
|
|
86
|
+
running ??= run().finally(() => {
|
|
87
|
+
running = void 0;
|
|
88
|
+
});
|
|
89
|
+
return running;
|
|
90
|
+
};
|
|
91
|
+
const onVisible = () => {
|
|
92
|
+
if (visible()) check();
|
|
93
|
+
};
|
|
94
|
+
const onMessage = (event) => {
|
|
95
|
+
if (!isTabMessage(event.data)) return;
|
|
96
|
+
baseline = event.data.fingerprint;
|
|
97
|
+
onChange({
|
|
98
|
+
reason: event.data.reason,
|
|
99
|
+
status: null,
|
|
100
|
+
source: "tab"
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
channel?.addEventListener("message", onMessage);
|
|
104
|
+
if (typeof window !== "undefined") window.addEventListener("focus", onVisible);
|
|
105
|
+
if (typeof document !== "undefined") document.addEventListener("visibilitychange", onVisible);
|
|
106
|
+
const timer = intervalMs > 0 ? setInterval(onVisible, intervalMs) : void 0;
|
|
107
|
+
check();
|
|
108
|
+
return {
|
|
109
|
+
check,
|
|
110
|
+
stop: () => {
|
|
111
|
+
if (stopped) return;
|
|
112
|
+
stopped = true;
|
|
113
|
+
if (timer !== void 0) clearInterval(timer);
|
|
114
|
+
if (typeof window !== "undefined") window.removeEventListener("focus", onVisible);
|
|
115
|
+
if (typeof document !== "undefined") document.removeEventListener("visibilitychange", onVisible);
|
|
116
|
+
channel?.removeEventListener("message", onMessage);
|
|
117
|
+
channel?.close();
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
4
122
|
//#region src/next/client/index.ts
|
|
5
123
|
/**
|
|
6
124
|
* After a session change, expire the server cache (`changed`), navigate, then
|
|
@@ -33,5 +151,63 @@ function useSessionChange(changed, router, options = {}) {
|
|
|
33
151
|
refresher
|
|
34
152
|
]);
|
|
35
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Watches the session of an app that keeps it in httpOnly cookies, without a
|
|
156
|
+
* browser Supabase client: it asks `sessionStatusRoute` on focus, when the tab
|
|
157
|
+
* becomes visible and on an interval, and reacts when Auth ended the session,
|
|
158
|
+
* banned the user, the user signed out, or the claims or support target
|
|
159
|
+
* changed. Other tabs of the app hear each change through a `BroadcastChannel`.
|
|
160
|
+
* Returns the last answer.
|
|
161
|
+
*
|
|
162
|
+
* ```tsx
|
|
163
|
+
* useSessionWatch({ url: "/api/session-status", redirect: "/sign-in" });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
function useSessionWatch(options = {}) {
|
|
167
|
+
const nextRouter = useRouter();
|
|
168
|
+
const [last, setLast] = useState(void 0);
|
|
169
|
+
const latest = useRef({
|
|
170
|
+
options,
|
|
171
|
+
router: options.router ?? nextRouter
|
|
172
|
+
});
|
|
173
|
+
latest.current = {
|
|
174
|
+
options,
|
|
175
|
+
router: options.router ?? nextRouter
|
|
176
|
+
};
|
|
177
|
+
const { url, intervalMs, channel, fingerprint } = options;
|
|
178
|
+
const enabled = options.enabled ?? true;
|
|
179
|
+
useEffect(() => {
|
|
180
|
+
if (!enabled) return;
|
|
181
|
+
const watcher = watchSession((event) => {
|
|
182
|
+
const current = latest.current;
|
|
183
|
+
if (current.options.onChange) {
|
|
184
|
+
current.options.onChange(event);
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (event.reason === "claims_changed") {
|
|
188
|
+
current.router.refresh();
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
window.location.assign(current.options.redirect ?? window.location.href);
|
|
192
|
+
}, {
|
|
193
|
+
...url === void 0 ? {} : { url },
|
|
194
|
+
...intervalMs === void 0 ? {} : { intervalMs },
|
|
195
|
+
...channel === void 0 ? {} : { channel },
|
|
196
|
+
...fingerprint === void 0 ? {} : { fingerprint },
|
|
197
|
+
...latest.current.options.fetch ? { fetch: latest.current.options.fetch } : {},
|
|
198
|
+
onStatus: setLast
|
|
199
|
+
});
|
|
200
|
+
return () => {
|
|
201
|
+
watcher.stop();
|
|
202
|
+
};
|
|
203
|
+
}, [
|
|
204
|
+
enabled,
|
|
205
|
+
url,
|
|
206
|
+
intervalMs,
|
|
207
|
+
channel,
|
|
208
|
+
fingerprint
|
|
209
|
+
]);
|
|
210
|
+
return last;
|
|
211
|
+
}
|
|
36
212
|
//#endregion
|
|
37
|
-
export { useSessionChange };
|
|
213
|
+
export { useSessionChange, useSessionWatch, watchSession };
|
package/dist/next/index.d.ts
CHANGED
|
@@ -2,26 +2,27 @@ import { b as DbError, f as Result } from "../result-DZeA5KS6.js";
|
|
|
2
2
|
import { $ as RecordRef, O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
|
|
3
3
|
import { r as AuthState } from "../resolve-CXX6DHv3.js";
|
|
4
4
|
import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
|
|
5
|
-
import { J as DbStats, Zt as CacheAdapter, pt as QuerySpec, t as BetterSupabase, tt as ReadSet } from "../define-
|
|
6
|
-
import {
|
|
5
|
+
import { J as DbStats, Zt as CacheAdapter, pt as QuerySpec, t as BetterSupabase, tt as ReadSet } from "../define-Cgru0_kF.js";
|
|
6
|
+
import { A as isSessionSnapshot, M as sessionCacheKey, O as SessionSnapshot, a as ServerContext, c as ServerOptions, j as issuedAtOf, k as authzVersionOf, l as SharedServer, n as BetterServer, r as ContextOptions } from "../server-types-gR4Q1aM0.js";
|
|
7
7
|
import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
|
|
8
8
|
import { n as AmrEntry, t as Aal } from "../mfa-oIOYTpvc.js";
|
|
9
|
-
import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-
|
|
10
|
-
import { M as BindingName, N as BindingOf, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "../index-
|
|
11
|
-
import { t as tenantOf } from "../tenant-
|
|
9
|
+
import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-Xxw8Hroe.js";
|
|
10
|
+
import { M as BindingName, N as BindingOf, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "../index-B8YjrfVl.js";
|
|
11
|
+
import { t as tenantOf } from "../tenant-DVvjw9H-.js";
|
|
12
12
|
import { n as toSession, t as AuthSession } from "../view-DyFdMCqg.js";
|
|
13
|
-
import { t as
|
|
13
|
+
import { a as SupportPolicy, c as supportSessions, i as SupportOptions, o as SupportSessions, s as SupportStartRequest, t as ActiveSupport } from "../support-B4ZBVxt3.js";
|
|
14
|
+
import { t as AuthOutageHook } from "../session-C1OuXbtN.js";
|
|
14
15
|
import { n as AuthKind, r as GuardOptions } from "../respond-Dn1_YhC1.js";
|
|
15
16
|
import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-DOwKpSkA.js";
|
|
16
|
-
import { c as ListParseOptions, m as ListSearchParams } from "../list-query-
|
|
17
|
-
import { r as LiveCountSeed, t as CountRunner } from "../index-
|
|
18
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
19
|
-
import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-
|
|
20
|
-
import { t as ResourceMap } from "../resources-
|
|
21
|
-
import { t as defineAction } from "../resource-execute-
|
|
17
|
+
import { c as ListParseOptions, m as ListSearchParams } from "../list-query-DxjuIHEL.js";
|
|
18
|
+
import { r as LiveCountSeed, t as CountRunner } from "../index-lB-8iPmY.js";
|
|
19
|
+
import { r as MembershipClaim } from "../entitlements-B0jmjNLD.js";
|
|
20
|
+
import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-BIoz_ElD.js";
|
|
21
|
+
import { t as ResourceMap } from "../resources-Bt2PDKE7.js";
|
|
22
|
+
import { t as defineAction } from "../resource-execute-DqWfEc56.js";
|
|
22
23
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
|
|
23
|
-
import { i as tagFor, t as TagOptions } from "../tags-
|
|
24
|
-
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-
|
|
24
|
+
import { i as tagFor, t as TagOptions } from "../tags-sM-CH9Mn.js";
|
|
25
|
+
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-BBfKuMVL.js";
|
|
25
26
|
import { r as safeRedirectPath } from "../sign-in-BAjR49fq.js";
|
|
26
27
|
import { n as supportOf, t as SupportView } from "../support-view-BYOgwXsJ.js";
|
|
27
28
|
import { NextRequest } from "next/server.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as AuthorizationOperation } from "./authorization-
|
|
1
|
+
import { r as AuthorizationOperation } from "./authorization-CNsvnwle.js";
|
|
2
2
|
//#region src/core/operations.d.ts
|
|
3
3
|
/** Operations by name, as `authorization.operations` or a module's own defaults. */
|
|
4
4
|
type OperationTable = Readonly<Record<string, AuthorizationOperation>>;
|
|
@@ -3,7 +3,8 @@ import { n as blockOptions, r as option } from "./options-BMjcVuaI.js";
|
|
|
3
3
|
const createdBySqlOptions = blockOptions({
|
|
4
4
|
createdBy: option.string({ default: "created_by" }),
|
|
5
5
|
updatedBy: option.string({ default: "updated_by" }),
|
|
6
|
-
impersonatedBy: option.string({ default: "impersonated_by" })
|
|
6
|
+
impersonatedBy: option.string({ default: "impersonated_by" }),
|
|
7
|
+
stamp: option.unknown({ default: "client" })
|
|
7
8
|
});
|
|
8
9
|
//#endregion
|
|
9
10
|
export { createdBySqlOptions as t };
|
|
@@ -8,6 +8,7 @@ type CreatedBySqlOptions = {
|
|
|
8
8
|
readonly updatedBy?: string;
|
|
9
9
|
/** The admin behind an impersonated write; `track_actor` fills it. */
|
|
10
10
|
readonly impersonatedBy?: string;
|
|
11
|
+
readonly stamp?: "client" | "trigger";
|
|
11
12
|
};
|
|
12
13
|
//#endregion
|
|
13
14
|
export { CreatedBySqlOptions as t };
|
|
@@ -2,7 +2,8 @@ import { n as blockOptions, r as option } from "./options-BMjcVuaI.js";
|
|
|
2
2
|
//#region src/blocks/updated-at/options.ts
|
|
3
3
|
const updatedAtSqlOptions = blockOptions({
|
|
4
4
|
createdAt: option.string({ default: "created_at" }),
|
|
5
|
-
updatedAt: option.string({ default: "updated_at" })
|
|
5
|
+
updatedAt: option.string({ default: "updated_at" }),
|
|
6
|
+
stamp: option.unknown({ default: "client" })
|
|
6
7
|
});
|
|
7
8
|
//#endregion
|
|
8
9
|
export { updatedAtSqlOptions as t };
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -2,14 +2,14 @@ import { b as DbError, f as Result } from "../result-DZeA5KS6.js";
|
|
|
2
2
|
import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
|
|
3
3
|
import { r as AuthState } from "../resolve-CXX6DHv3.js";
|
|
4
4
|
import { i as ProblemDetails } from "../problem-DNwN8iGz.js";
|
|
5
|
-
import { t as BetterSupabase } from "../define-
|
|
6
|
-
import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-
|
|
5
|
+
import { t as BetterSupabase } from "../define-Cgru0_kF.js";
|
|
6
|
+
import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-gR4Q1aM0.js";
|
|
7
7
|
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-Dn1_YhC1.js";
|
|
8
8
|
import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-DOwKpSkA.js";
|
|
9
9
|
import { t as Validated } from "../shared-CRRfQAKG.js";
|
|
10
|
-
import { a as ResourceHandler } from "../resource-types-
|
|
10
|
+
import { a as ResourceHandler } from "../resource-types-BIoz_ElD.js";
|
|
11
11
|
import { i as RouteRateLimitRule, n as RateLimitVerdict, r as RateLimiter, t as RateLimitRouteOptions } from "../rate-limit-Bztf32cl.js";
|
|
12
|
-
import { t as Api } from "../api-
|
|
12
|
+
import { t as Api } from "../api-CpL3hm87.js";
|
|
13
13
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
14
14
|
import { AnySchema, BuilderWithMiddlewares, DecoratedMiddleware, DecoratedProcedure, MetaPlugin, ORPCError, Schema } from "@orpc/server";
|
|
15
15
|
//#region src/orpc/router.d.ts
|
package/dist/otel/index.js
CHANGED
|
@@ -40,9 +40,9 @@ function systemOf(executor) {
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
function otel(options = {}) {
|
|
43
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
43
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.17.0");
|
|
44
44
|
let histogram;
|
|
45
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.
|
|
45
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.17.0")).createHistogram("db.client.operation.duration", {
|
|
46
46
|
unit: "s",
|
|
47
47
|
description: "Duration of database client operations.",
|
|
48
48
|
advice: { explicitBucketBoundaries: [
|
|
@@ -219,7 +219,7 @@ function otel(options = {}) {
|
|
|
219
219
|
* `betterSupabase.events`. Returns a function that stops listening.
|
|
220
220
|
*/
|
|
221
221
|
function traceAuth(betterSupabase, options = {}) {
|
|
222
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
222
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.17.0");
|
|
223
223
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
224
224
|
const span = tracer.startSpan("auth.resolve", {
|
|
225
225
|
kind: SpanKind.INTERNAL,
|
|
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
257
257
|
* an error status. Returns a function that stops listening.
|
|
258
258
|
*/
|
|
259
259
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
260
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
260
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.17.0");
|
|
261
261
|
return betterSupabase.events.on("block", (event) => {
|
|
262
262
|
const attributes = {
|
|
263
263
|
...options.attributes,
|
|
@@ -2,7 +2,7 @@ import { a as ok, r as err, t as AsyncResult } from "./result-ntFBW2p2.js";
|
|
|
2
2
|
import { n as postgrestExecutor } from "./postgrest-executor-BFW4oWte.js";
|
|
3
3
|
import { n as decodeJwtPayload } from "./base64-B9Wlsdj7.js";
|
|
4
4
|
import { i as userContext } from "./impersonation-DM3oWNoD.js";
|
|
5
|
-
import { n as
|
|
5
|
+
import { n as hasAuthModule, r as claimedTenant } from "./auth-module-BbmX-N4L.js";
|
|
6
6
|
import { t as currentTenant } from "./tenant-source-bqWpSr86.js";
|
|
7
7
|
import { n as identityKey } from "./user-change-DgWC6RRC.js";
|
|
8
8
|
import { t as createQueries } from "./queries-BWYYS9um.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AsyncResult } from "./result-DZeA5KS6.js";
|
|
2
|
-
import { n as TopicPort } from "./watch-topic-
|
|
2
|
+
import { n as TopicPort } from "./watch-topic-tnfOTa3-.js";
|
|
3
3
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
4
4
|
//#region src/client/ports.d.ts
|
|
5
5
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Bt as Executor } from "../types-DFdg_4yN.js";
|
|
2
2
|
import { C as UploadRouteOptions, E as uploadRoute, S as UploadRoute, T as uploadOutcome, _ as UploadConnectorOptions, b as UploadOutcome, c as LocalTablesOption, d as CreateUploadRepository, f as CrudEntryLike, g as UploadConnector, h as RejectedStore, m as RejectedChange, n as DataEngine, p as CrudQueueLike, s as LiveEngineOptions, v as UploadErrorContext, w as createUploadConnector, x as UploadRepository, y as UploadFunction } from "../data-engine-BWoz9lED.js";
|
|
3
|
-
import { t as AuthSnapshot } from "../bind-
|
|
4
|
-
import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-
|
|
3
|
+
import { t as AuthSnapshot } from "../bind-C801IaK-.js";
|
|
4
|
+
import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-BWFfz0ik.js";
|
|
5
5
|
//#region src/powersync/sync.d.ts
|
|
6
6
|
/** The part of PowerSync's `SyncStatus` the engine reads. */
|
|
7
7
|
interface SyncStatusLike {
|
package/dist/preset/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bn as PRESETS, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetValueInfo, _t as expandPreset, ai as DEFAULT_CONVENTIONS, bi as presetValueLabel, bt as PresetConflict, ci as Preset, di as PresetField, ei as PresetCatalog, er as APP_COLUMN_FORMATS, fi as PresetFieldKey, gi as PresetScope, gt as conventionConfig, hi as PresetPlatforms, ht as PresetInput, ii as CONVENTION_FIELDS, li as PresetAccess, mi as PresetFramework, mt as ExpandedConfig, ni as PresetCatalogManifest, oi as PRESET_FRAMEWORKS, pi as PresetFieldValue, pt as ConfigConventions, qn as namedPreset, ri as PresetGlueItem, si as PRESET_TENANT_NAMES, sr as AppColumnFormat, ti as PresetCatalogBlock, ui as PresetConventions, vi as integrationsForFramework, vt as presetConfig, wt as listNames, xt as PresetIntegration, yi as presetField, yt as presetOf, zn as NamedPreset } from "../context-
|
|
2
|
-
import { A as presetAndDesignOf, C as designFileSource, D as encodeDesign, E as designSchema, F as safeDesignFileSource, I as safeParseDesign, L as appDefaultError, M as presetConfigSource, N as presetInstallCommand, O as isDesignCode, P as readDesignFile, R as isAppDefault, S as designConfig, T as designOf, _ as DesignParseResult, a as DesignChange, b as createUrl, c as diffAppTables, d as DESIGN_FILE, f as DESIGN_FORMAT, g as DesignParseIssue, h as DesignParseError, i as presetGlue, j as presetApplyCommand, k as parseDesign, l as diffDesigns, m as DesignFile, n as glueCommand, o as DesignChangeKind, p as DesignErrorCode, r as presetBlocksSource, s as DiffOptions, t as PROVIDER_COMMENT, u as CreateDesign, v as DesignTooLongError, w as designFormat, x as decodeDesign, y as MAX_DESIGN_CODE_LENGTH, z as PRESET_CATALOG } from "../index-
|
|
3
|
-
import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-
|
|
1
|
+
import { Bn as PRESETS, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetValueInfo, _t as expandPreset, ai as DEFAULT_CONVENTIONS, bi as presetValueLabel, bt as PresetConflict, ci as Preset, di as PresetField, ei as PresetCatalog, er as APP_COLUMN_FORMATS, fi as PresetFieldKey, gi as PresetScope, gt as conventionConfig, hi as PresetPlatforms, ht as PresetInput, ii as CONVENTION_FIELDS, li as PresetAccess, mi as PresetFramework, mt as ExpandedConfig, ni as PresetCatalogManifest, oi as PRESET_FRAMEWORKS, pi as PresetFieldValue, pt as ConfigConventions, qn as namedPreset, ri as PresetGlueItem, si as PRESET_TENANT_NAMES, sr as AppColumnFormat, ti as PresetCatalogBlock, ui as PresetConventions, vi as integrationsForFramework, vt as presetConfig, wt as listNames, xt as PresetIntegration, yi as presetField, yt as presetOf, zn as NamedPreset } from "../context-CKCgjEDF.js";
|
|
2
|
+
import { A as presetAndDesignOf, C as designFileSource, D as encodeDesign, E as designSchema, F as safeDesignFileSource, I as safeParseDesign, L as appDefaultError, M as presetConfigSource, N as presetInstallCommand, O as isDesignCode, P as readDesignFile, R as isAppDefault, S as designConfig, T as designOf, _ as DesignParseResult, a as DesignChange, b as createUrl, c as diffAppTables, d as DESIGN_FILE, f as DESIGN_FORMAT, g as DesignParseIssue, h as DesignParseError, i as presetGlue, j as presetApplyCommand, k as parseDesign, l as diffDesigns, m as DesignFile, n as glueCommand, o as DesignChangeKind, p as DesignErrorCode, r as presetBlocksSource, s as DiffOptions, t as PROVIDER_COMMENT, u as CreateDesign, v as DesignTooLongError, w as designFormat, x as decodeDesign, y as MAX_DESIGN_CODE_LENGTH, z as PRESET_CATALOG } from "../index-BCeTYhFk.js";
|
|
3
|
+
import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-dS02piE7.js";
|
|
4
4
|
export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, CONVENTION_FIELDS, type ConfigConventions, type CreateDesign, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, type DesignChange, type DesignChangeKind, type DesignErrorCode, type DesignFile, DesignParseError, type DesignParseIssue, type DesignParseResult, DesignTooLongError, type DiffOptions, type ExpandedConfig, MAX_DESIGN_CODE_LENGTH, type NamedPreset, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, type Preset, type PresetAccess, type PresetCatalog, type PresetCatalogBlock, type PresetCatalogManifest, type PresetConflict, type PresetConventions, type PresetField, type PresetFieldKey, type PresetFieldValue, type PresetFramework, type PresetGlueItem, type PresetGroup, type PresetInput, type PresetIntegration, type PresetName, type PresetPlatforms, type PresetScope, type PresetSpec, type PresetValueInfo, type ResolvedPreset, type ResolvedPresetBlock, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
|
package/dist/preset/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-
|
|
2
|
-
import { E as PRESET_CATALOG, a as appIdentifierError, m as isAppDefault, n as APP_NAME_MAX, o as appNameLengthError, p as appDefaultError, s as appReservedColumns, x as APP_COLUMN_FORMATS } from "../app-tables-
|
|
3
|
-
import { C as readDesignFile, D as glueCommand, E as PROVIDER_COMMENT, O as presetBlocksSource, S as presetInstallCommand, T as safeParseDesign, a as DesignParseError, b as presetApplyCommand, c as createUrl, d as designFileSource, f as designFormat, g as isDesignCode, h as encodeDesign, i as DESIGN_FORMAT, k as presetGlue, l as decodeDesign, m as designSchema, n as diffDesigns, o as DesignTooLongError, p as designOf, r as DESIGN_FILE, s as MAX_DESIGN_CODE_LENGTH, t as diffAppTables, u as designConfig, v as parseDesign, w as safeDesignFileSource, x as presetConfigSource, y as presetAndDesignOf } from "../preset-
|
|
1
|
+
import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-CIBc79_8.js";
|
|
2
|
+
import { E as PRESET_CATALOG, a as appIdentifierError, m as isAppDefault, n as APP_NAME_MAX, o as appNameLengthError, p as appDefaultError, s as appReservedColumns, x as APP_COLUMN_FORMATS } from "../app-tables-Q0TYfeih.js";
|
|
3
|
+
import { C as readDesignFile, D as glueCommand, E as PROVIDER_COMMENT, O as presetBlocksSource, S as presetInstallCommand, T as safeParseDesign, a as DesignParseError, b as presetApplyCommand, c as createUrl, d as designFileSource, f as designFormat, g as isDesignCode, h as encodeDesign, i as DESIGN_FORMAT, k as presetGlue, l as decodeDesign, m as designSchema, n as diffDesigns, o as DesignTooLongError, p as designOf, r as DESIGN_FILE, s as MAX_DESIGN_CODE_LENGTH, t as diffAppTables, u as designConfig, v as parseDesign, w as safeDesignFileSource, x as presetConfigSource, y as presetAndDesignOf } from "../preset-BIANzB5p.js";
|
|
4
4
|
export { APP_COLUMN_FORMATS, APP_NAME_MAX, CONVENTION_FIELDS, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, DesignParseError, DesignTooLongError, MAX_DESIGN_CODE_LENGTH, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as groupEntries, a as presetOf, c as presetSpec, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-
|
|
2
|
-
import { E as PRESET_CATALOG, d as appTablesOf, k as asBlocksConfig } from "./app-tables-
|
|
1
|
+
import { M as groupEntries, a as presetOf, c as presetSpec, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-CIBc79_8.js";
|
|
2
|
+
import { E as PRESET_CATALOG, d as appTablesOf, k as asBlocksConfig } from "./app-tables-Q0TYfeih.js";
|
|
3
3
|
import { r as FIELD_FORMATS } from "./field-formats-C6QKA3UR.js";
|
|
4
4
|
//#region src/preset/render.ts
|
|
5
5
|
/** The comment a config with the provider access model gets above `blocks`. */
|
package/dist/query/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-PReMbEEU.js";
|
|
2
2
|
import { n as invalidateTables, t as BetterQueryMeta } from "../invalidate-DMp4eqfF.js";
|
|
3
|
-
import { $ as invalidateOnBlockEvents, G as BLOCK_READ_PREFIXES, J as BlockInvalidation, K as BlockClientQueries, Q as blockQueries, X as BlockQueries, Y as BlockMethodQuery, Z as BlockVariablesOf, a as RecordBindingQueries, at as InfiniteOptionsOf, c as RecordWriteMutations, ct as QueryHelpers, dt as TableQueries, et as queryEngine, ft as createQueries, i as optimistic, it as InfiniteExtras, l as invalidateOnRecordEvents, lt as QueryKeyOf, mt as queryCache, n as OptimisticSnapshot, nt as clearOnUserChange, o as RecordQueries, ot as MutationOptionsOf, pt as invalidateOnMutation, q as BlockClients, r as OptimisticTarget, rt as BetterQueries, s as RecordQueriesOptions, st as QueriesOptions, t as OptimisticHandlers, tt as UserChangeSource, u as recordQueries, ut as QueryOptionsOf } from "../index-
|
|
3
|
+
import { $ as invalidateOnBlockEvents, G as BLOCK_READ_PREFIXES, J as BlockInvalidation, K as BlockClientQueries, Q as blockQueries, X as BlockQueries, Y as BlockMethodQuery, Z as BlockVariablesOf, a as RecordBindingQueries, at as InfiniteOptionsOf, c as RecordWriteMutations, ct as QueryHelpers, dt as TableQueries, et as queryEngine, ft as createQueries, i as optimistic, it as InfiniteExtras, l as invalidateOnRecordEvents, lt as QueryKeyOf, mt as queryCache, n as OptimisticSnapshot, nt as clearOnUserChange, o as RecordQueries, ot as MutationOptionsOf, pt as invalidateOnMutation, q as BlockClients, r as OptimisticTarget, rt as BetterQueries, s as RecordQueriesOptions, st as QueriesOptions, t as OptimisticHandlers, tt as UserChangeSource, u as recordQueries, ut as QueryOptionsOf } from "../index-B8YjrfVl.js";
|
|
4
4
|
export { BLOCK_READ_PREFIXES, type BetterQueries, type BetterQueryMeta, type BlockClientQueries, type BlockClients, type BlockInvalidation, type BlockMethodQuery, type BlockQueries, type BlockVariablesOf, type InfiniteExtras, type InfiniteOptionsOf, type MutationOptionsOf, type OptimisticHandlers, type OptimisticSnapshot, type OptimisticTarget, type QueriesOptions, type QueryHelpers, type QueryKeyOf, type QueryOptionsOf, type RecordBindingQueries, type RecordQueries, type RecordQueriesOptions, type RecordWriteMutations, type TableQueries, type UserChangeSource, blockQueries, clearOnUserChange, createQueries, escapeLike, invalidateOnBlockEvents, invalidateOnMutation, invalidateOnRecordEvents, invalidateTables, optimistic, queryCache, queryEngine, recordQueries };
|
|
@@ -271,12 +271,29 @@ function createRateLimit(options) {
|
|
|
271
271
|
applyTemporal(options);
|
|
272
272
|
const call = options.transport === void 0 ? blockCall(sqlTransport(options.sql), void 0, options.mappers) : blockCall(options.transport, options.schema, options.mappers);
|
|
273
273
|
const hit = options.transport === void 0 ? overSql(options.sql) : overTransport(call);
|
|
274
|
+
const hitAll = options.transport === void 0 ? (hits) => run(async () => decodeAll(await checkRateLimits(options.sql, hits), hits)) : (hits) => call("check_rate_limits", { hits }, (value) => decodeAll(value, hits));
|
|
274
275
|
const hooked = withBlockHooks({
|
|
275
276
|
purge: (purgeOptions = {}) => call("purge_rate_limits", { batch: purgeOptions.batch }, (value) => Number(value ?? 0)),
|
|
276
277
|
purgeJob: (jobOptions) => async () => hooked.purge(jobOptions).orThrow(),
|
|
277
278
|
check: (scope, key, rule) => {
|
|
278
279
|
if (rule !== void 0 && (!Number.isInteger(rule.max) || rule.max < 1)) return AsyncResult.err(dbError("invalid_input", "A rate limit's max must be a positive integer"));
|
|
279
280
|
return hit(scope, key, rule?.max ?? null, rule === void 0 ? null : seconds(rule.period));
|
|
281
|
+
},
|
|
282
|
+
checkAll: (hits) => {
|
|
283
|
+
if (hits.length === 0) return AsyncResult.err(dbError("invalid_input", "checkAll needs at least one limit"));
|
|
284
|
+
const rows = [];
|
|
285
|
+
for (const hit of hits) {
|
|
286
|
+
if (hit.rule !== void 0 && (!Number.isInteger(hit.rule.max) || hit.rule.max < 1)) return AsyncResult.err(dbError("invalid_input", "A rate limit's max must be a positive integer"));
|
|
287
|
+
rows.push({
|
|
288
|
+
scope: hit.scope,
|
|
289
|
+
key: hit.key,
|
|
290
|
+
...hit.rule === void 0 ? {} : {
|
|
291
|
+
max_requests: hit.rule.max,
|
|
292
|
+
period: seconds(hit.rule.period)
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
return hitAll(rows);
|
|
280
297
|
}
|
|
281
298
|
}, options.hooks, {
|
|
282
299
|
block: "rate-limit",
|
|
@@ -284,6 +301,42 @@ function createRateLimit(options) {
|
|
|
284
301
|
});
|
|
285
302
|
return hooked;
|
|
286
303
|
}
|
|
304
|
+
const numberOr = (value, fallback) => {
|
|
305
|
+
const parsed = Number(value ?? fallback);
|
|
306
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
307
|
+
};
|
|
308
|
+
function decodeOne(value) {
|
|
309
|
+
const row = isRecord(value) ? value : {};
|
|
310
|
+
return {
|
|
311
|
+
allowed: row["allowed"] === true,
|
|
312
|
+
remaining: numberOr(row["remaining"], 0),
|
|
313
|
+
retryAfter: numberOr(row["retry_after"], 0)
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
/** Reads `check_rate_limits`' answer; a missing one is a refusal. */
|
|
317
|
+
function decodeAll(value, hits) {
|
|
318
|
+
const row = isRecord(value) ? value : {};
|
|
319
|
+
const results = Array.isArray(row["results"]) ? row["results"].map(decodeOne) : [];
|
|
320
|
+
const allowed = row["allowed"] === true && results.length === hits.length;
|
|
321
|
+
const index = typeof row["blocked"] === "number" ? row["blocked"] : allowed ? -1 : 0;
|
|
322
|
+
const blocked = hits[index];
|
|
323
|
+
return {
|
|
324
|
+
allowed,
|
|
325
|
+
remaining: results.length === 0 ? 0 : Math.min(...results.map((each) => each.remaining)),
|
|
326
|
+
retryAfter: allowed ? 0 : numberOr(row["retry_after"], 0),
|
|
327
|
+
...allowed || blocked === void 0 ? {} : { blocked: {
|
|
328
|
+
index,
|
|
329
|
+
scope: blocked.scope,
|
|
330
|
+
key: blocked.key
|
|
331
|
+
} },
|
|
332
|
+
results
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
/** One `check_rate_limits` call over SQL. */
|
|
336
|
+
async function checkRateLimits(sql, hits) {
|
|
337
|
+
const [row] = await sql.queryRaw("select better_supabase.check_rate_limits($1::jsonb) as result", [JSON.stringify(hits)]);
|
|
338
|
+
return row?.result;
|
|
339
|
+
}
|
|
287
340
|
const overTransport = (call) => (scope, key, max, period) => call("check_rate_limit", {
|
|
288
341
|
scope,
|
|
289
342
|
key,
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-PReMbEEU.js";
|
|
2
2
|
import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
|
|
3
3
|
import { i as DataEntry, m as RejectedChange, n as DataEngine, o as DataSyncState } from "../data-engine-BWoz9lED.js";
|
|
4
|
-
import { t as tenantOf } from "../tenant-
|
|
4
|
+
import { t as tenantOf } from "../tenant-DVvjw9H-.js";
|
|
5
5
|
import { t as AuthSession } from "../view-DyFdMCqg.js";
|
|
6
|
-
import { r as LiveCountSeed } from "../index-
|
|
7
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
8
|
-
import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, l as BlockEventSource, m as BlockQueryState, o as DataSource, p as BlockQueryOptions, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-
|
|
6
|
+
import { r as LiveCountSeed } from "../index-lB-8iPmY.js";
|
|
7
|
+
import { r as MembershipClaim } from "../entitlements-B0jmjNLD.js";
|
|
8
|
+
import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, l as BlockEventSource, m as BlockQueryState, o as DataSource, p as BlockQueryOptions, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DqlebtTE.js";
|
|
9
9
|
import { n as supportOf, t as SupportView } from "../support-view-BYOgwXsJ.js";
|
|
10
|
-
import { $ as
|
|
10
|
+
import { $ as UseActionFormOptions, A as useController, B as RecordListUrl, C as useConflicts, D as defineDataHooks, E as DataView, F as RecordFormState, G as RecordInitial, H as useRecordListState, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm, M as useBlockEvent, N as useBlockMutation, O as useBlockEnv, P as useBlockQuery, Q as ActionHandle, R as RecordListQueryStates, S as Conflicts, T as DataHooks, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl, dt as useSupabase, et as useAction, f as useUpload, g as UseRealtimeRelayOptions, h as useDebouncedSearch, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest, k as useBlockTenant, l as UseUploadOptions, lt as useLiveCount, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, ot as createHooks, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, tt as useActionForm, u as useImage, ut as useLiveQuery, v as Presence, w as useSyncStatus, x as usePresence, y as PresenceHookOptions, z as RecordListState } from "../index-ClMN0f98.js";
|
|
11
11
|
import { SessionProvider, SessionProviderProps, useSession, useSupportSession } from "./session.js";
|
|
12
12
|
import { a as useSignIn, i as SignOut, n as PendingState, o as useSignOut, r as SignIn, t as AuthHookOptions } from "../sign-in-D54FLMQy.js";
|
|
13
|
-
export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BlockEventSource, type BlockMutationActions, type BlockMutationState, type BlockQueryActions, type BlockQueryOptions, type BlockQueryState, type BlockRefetchOn, type BroadcastOptions, type ClaimsOf, type ClientLike, type Conflicts, type DataEngine, type DataEntry, type DataHooks, type DataSource, type DataState, type DataSyncState, type DataView, type DataWrites, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, type RejectedChange, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRecordFormOptions, type UseUploadOptions, createHooks, createRecordProvider, defineDataHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
|
|
13
|
+
export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BlockEventSource, type BlockMutationActions, type BlockMutationState, type BlockQueryActions, type BlockQueryOptions, type BlockQueryState, type BlockRefetchOn, type BroadcastOptions, type ClaimsOf, type ClientLike, type Conflicts, type DataEngine, type DataEntry, type DataHooks, type DataSource, type DataState, type DataSyncState, type DataView, type DataWrites, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, type RejectedChange, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRealtimeRelayOptions, type UseRecordFormOptions, type UseUploadOptions, createHooks, createRecordProvider, defineDataHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRealtimeRelay, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
|
package/dist/react/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { t as escapeLike } from "../escape-like-DHfx6jRr.js";
|
|
3
|
-
import { a as createHooks, d as useSupabase, i as BetterSupabaseProvider, l as useLiveCount, n as useSignIn, o as useAuth, r as useSignOut, s as useBroadcast, u as useLiveQuery } from "../sign-in-
|
|
3
|
+
import { a as createHooks, d as useSupabase, i as BetterSupabaseProvider, l as useLiveCount, n as useSignIn, o as useAuth, r as useSignOut, s as useBroadcast, u as useLiveQuery } from "../sign-in-CmPK1AgM.js";
|
|
4
4
|
import { t as supportOf } from "../support-view-g4YLBeqX.js";
|
|
5
5
|
import { SessionProvider, useSession, useSupportSession } from "./session.js";
|
|
6
6
|
import { d as fieldErrorsOf } from "../data-hooks-tgF1Ct0F.js";
|
|
7
|
-
import { _ as
|
|
7
|
+
import { _ as useBlockTenant, a as useRealtimeRelay, b as useAction, c as useSyncStatus, d as useBlockMutation, f as useBlockQuery, g as useBlockEnv, h as createRecordProvider, i as useDebouncedSearch, l as defineDataHooks, m as useRecordListState, n as useSignedUrl, o as usePresence, p as useRecordForm, r as useUpload, s as useConflicts, t as useImage, u as useBlockEvent, v as useController, x as useActionForm, y as useLatest } from "../react-CZUZYn9E.js";
|
|
8
8
|
import { t as tenantOf } from "../tenant-BgIiMQpo.js";
|
|
9
|
-
export { BetterSupabaseProvider, SessionProvider, createHooks, createRecordProvider, defineDataHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
|
|
9
|
+
export { BetterSupabaseProvider, SessionProvider, createHooks, createRecordProvider, defineDataHooks, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRealtimeRelay, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as AuthSnapshot } from "../../bind-
|
|
1
|
+
import { t as AuthSnapshot } from "../../bind-C801IaK-.js";
|
|
2
2
|
import { a as OAuthSignInOptions, i as OAuthClient, n as AuthLinkClient, o as WebBrowserLike, r as AuthLinkResult, t as AuthFailure } from "../../auth-link-B4NL84XU.js";
|
|
3
3
|
import { n as PendingState } from "../../sign-in-D54FLMQy.js";
|
|
4
4
|
import { Provider } from "@supabase/supabase-js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as signInWithOAuthBrowser, t as handleAuthDeepLink } from "../../auth-link-D3-bU6yz.js";
|
|
2
|
-
import { f as ClientContext, o as useAuth, t as usePending } from "../../sign-in-
|
|
2
|
+
import { f as ClientContext, o as useAuth, t as usePending } from "../../sign-in-CmPK1AgM.js";
|
|
3
3
|
import { useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
//#region src/react/native/index.ts
|
|
5
5
|
function useClientOf(explicit, hook) {
|
package/dist/react/server.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as escapeLike } from "../escape-like-PReMbEEU.js";
|
|
2
|
-
import { pt as QuerySpec } from "../define-
|
|
2
|
+
import { pt as QuerySpec } from "../define-Cgru0_kF.js";
|
|
3
3
|
import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
|
|
4
|
-
import { t as tenantOf } from "../tenant-
|
|
4
|
+
import { t as tenantOf } from "../tenant-DVvjw9H-.js";
|
|
5
5
|
import { t as AuthSession } from "../view-DyFdMCqg.js";
|
|
6
|
-
import { r as LiveCountSeed } from "../index-
|
|
7
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
8
|
-
import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, g as ActionInputOf, t as fieldErrorsOf, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-
|
|
6
|
+
import { r as LiveCountSeed } from "../index-lB-8iPmY.js";
|
|
7
|
+
import { r as MembershipClaim } from "../entitlements-B0jmjNLD.js";
|
|
8
|
+
import { D as ProfileOf, O as UseActionOptions, S as LiveCountHookOptions, _ as ActionResultOf, b as ClaimsOf, g as ActionInputOf, t as fieldErrorsOf, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DqlebtTE.js";
|
|
9
9
|
import { n as supportOf, t as SupportView } from "../support-view-BYOgwXsJ.js";
|
|
10
|
-
import { A as
|
|
10
|
+
import { $ as UseActionFormOptions, A as useController$1, B as RecordListUrl, C as useConflicts$1, D as defineDataHooks$1, F as RecordFormState, G as RecordInitial, H as useRecordListState$1, I as UseRecordFormOptions, J as RecordState, K as RecordProviderKit, L as useRecordForm$1, M as useBlockEvent$1, N as useBlockMutation$1, O as useBlockEnv$1, P as useBlockQuery$1, Q as ActionHandle, R as RecordListQueryStates, U as RecordActionsOf, V as RecordListUrlState, W as RecordContextValue, X as createRecordProvider$1, Y as RecordWriteHandlers, Z as ActionForm, _ as useRealtimeRelay$1, a as Upload, at as LiveCount, b as PresenceTopic, c as UseImageOptions, ct as useBroadcast, d as useSignedUrl$1, dt as useSupabase, f as useUpload$1, g as UseRealtimeRelayOptions, h as useDebouncedSearch$1, i as StorageImage, it as BetterSupabaseProviderProps, j as useLatest$1, k as useBlockTenant$1, l as UseUploadOptions, m as DebouncedSearchOptions, n as SignedUrl, nt as BetterHooks, o as UploadStatus, p as DebouncedSearch, q as RecordProviderProps, r as SignedUrlSource, rt as BetterSupabaseProvider, s as UploadTarget, st as useAuth, t as ImageSource, u as useImage$1, ut as useLiveQuery, v as Presence, w as useSyncStatus$1, x as usePresence$1, y as PresenceHookOptions, z as RecordListState } from "../index-ClMN0f98.js";
|
|
11
11
|
import { SessionProvider, SessionProviderProps } from "./session.js";
|
|
12
12
|
import { a as useSignIn$1, i as SignOut, n as PendingState, o as useSignOut$1, r as SignIn, t as AuthHookOptions } from "../sign-in-D54FLMQy.js";
|
|
13
13
|
//#region src/react/server.d.ts
|
|
@@ -38,6 +38,11 @@ export declare const useActionForm: <T>(action: (input: FormData) => Promise<Act
|
|
|
38
38
|
* Component.
|
|
39
39
|
*/
|
|
40
40
|
export declare const usePresence: typeof usePresence$1;
|
|
41
|
+
/**
|
|
42
|
+
* The `react-server` build of `useRealtimeRelay`: create the relay client in a
|
|
43
|
+
* Client Component.
|
|
44
|
+
*/
|
|
45
|
+
export declare const useRealtimeRelay: typeof useRealtimeRelay$1;
|
|
41
46
|
/**
|
|
42
47
|
* The `react-server` build of `useSignIn`: sign in from a Client Component or a
|
|
43
48
|
* Server Action.
|
|
@@ -127,4 +132,4 @@ export declare const useBlockEnv: typeof useBlockEnv$1;
|
|
|
127
132
|
*/
|
|
128
133
|
export declare const useBlockTenant: typeof useBlockTenant$1;
|
|
129
134
|
//#endregion
|
|
130
|
-
export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BroadcastOptions, type ClaimsOf, type ClientLike, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRecordFormOptions, type UseUploadOptions, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAuth, useBroadcast, useLiveQuery, useSupabase };
|
|
135
|
+
export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BroadcastOptions, type ClaimsOf, type ClientLike, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRealtimeRelayOptions, type UseRecordFormOptions, type UseUploadOptions, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAuth, useBroadcast, useLiveQuery, useSupabase };
|