better-supabase 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{adapter-CWzyKepA.js → adapter-ddQ9Hzka.js} +126 -91
- package/dist/{agents-DXiOPB3V.d.ts → agents-BwUHtvD6.d.ts} +4 -4
- package/dist/{ai-cache-CLiAXCPH.d.ts → ai-cache-CPOP2PYz.d.ts} +4 -4
- package/dist/{ai-chat-DlcBdOhJ.d.ts → ai-chat-BZhfCHHr.d.ts} +106 -25
- package/dist/{ai-schedules-Drx2KRTn.d.ts → ai-schedules-BZPmySUa.d.ts} +5 -5
- package/dist/ai-sdk/agents/index.d.ts +6 -6
- package/dist/ai-sdk/batches/index.d.ts +3 -3
- package/dist/ai-sdk/cache/index.d.ts +1 -1
- package/dist/ai-sdk/chat/index.d.ts +2 -2
- package/dist/ai-sdk/chat/index.js +3 -272
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts +5 -5
- package/dist/ai-sdk/index.js +2 -3
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +6 -5
- package/dist/ai-sdk/workflow/index.js +9 -9
- package/dist/{api-myq2e9t5.d.ts → api-XEaCJbgv.d.ts} +5 -5
- package/dist/{api-keys-DbIbkGxx.d.ts → api-keys-C82fMru4.d.ts} +4 -4
- package/dist/{app-tables-Don-aNOB.d.ts → app-tables-C0XVpQEJ.d.ts} +1 -1
- package/dist/{approvals-Da4uAANx.js → approvals-D8gR1R8R.js} +95 -11
- package/dist/{approvals-DZoGtNFv.d.ts → approvals-DqCv7f-G.d.ts} +101 -7
- package/dist/{assistant-BEbRPjhn.d.ts → assistant-5heV2GeR.d.ts} +7 -3
- package/dist/assistant-BHZ6fqBR.js +300 -0
- package/dist/astro/index.d.ts +7 -7
- package/dist/astro/index.js +5 -5
- package/dist/{auth-module-CqXdm8qD.js → auth-module-DkqapRZJ.js} +1 -1
- package/dist/{authorization-DpVtxuKM.d.ts → authorization-2Rv1AJQJ.d.ts} +151 -39
- package/dist/{authorization-hooks-CxwsRnfV.d.ts → authorization-hooks-C0GfMvFm.d.ts} +8 -2
- package/dist/authz-topic-D7fPUY4P.js +13 -0
- package/dist/{automations-Bw5cX7oj.js → automations-D4QTP8nI.js} +2 -1
- package/dist/{availability-CebEOfMN.d.ts → availability-CZlcrkqD.d.ts} +49 -8
- package/dist/{base64-CVyKHBBw.js → base64-CEBz6-Jj.js} +9 -2
- package/dist/better-result/index.d.ts +3 -3
- package/dist/{bind-BA05aoY9.d.ts → bind-C2XvMlfg.d.ts} +7 -7
- package/dist/{block-env-UX42PHLP.d.ts → block-env-BQrtLPyc.d.ts} +4 -4
- package/dist/{block-helpers-disoUWCp.d.ts → block-helpers-BNtM1tqy.d.ts} +1 -1
- package/dist/{block-hooks-DrA_d1dJ.d.ts → block-hooks-CtMsgLQr.d.ts} +2 -2
- package/dist/{block-subjects-Br2MQNFn.d.ts → block-subjects-Bkieh2Xk.d.ts} +1 -1
- package/dist/{block-tables-Bre1zjau.d.ts → block-tables-DPOgnT3y.d.ts} +1 -1
- package/dist/{block-transport-BEtC_Kis.d.ts → block-transport-CDmOUuLZ.d.ts} +2 -2
- package/dist/blocks/access-requests/index.d.ts +5 -5
- package/dist/blocks/activities/index.d.ts +9 -9
- package/dist/blocks/agents/index.d.ts +4 -4
- package/dist/blocks/ai-cache/index.d.ts +3 -3
- package/dist/blocks/ai-chat/index.d.ts +8 -8
- package/dist/blocks/ai-chat/index.js +80 -20
- package/dist/blocks/ai-files/index.d.ts +3 -3
- package/dist/blocks/ai-keys/index.d.ts +4 -4
- package/dist/blocks/ai-schedules/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +8 -8
- package/dist/blocks/api-keys/index.d.ts +3 -3
- package/dist/blocks/approvals/index.d.ts +16 -5
- package/dist/blocks/approvals/index.js +7 -4
- package/dist/blocks/assets/index.d.ts +6 -6
- package/dist/blocks/assignment/index.d.ts +7 -7
- package/dist/blocks/attachments/index.d.ts +4 -4
- package/dist/blocks/audit/index.d.ts +13 -13
- package/dist/blocks/audit/index.js +1 -1
- package/dist/blocks/automations/index.d.ts +12 -12
- package/dist/blocks/billable-time/index.d.ts +6 -6
- package/dist/blocks/billing/index.d.ts +9 -9
- package/dist/blocks/billing/index.js +1 -1
- package/dist/blocks/bookings/index.d.ts +6 -6
- package/dist/blocks/bulk/index.d.ts +4 -4
- package/dist/blocks/calendar/index.d.ts +46 -8
- package/dist/blocks/calendar/index.js +306 -47
- package/dist/blocks/catalog/index.d.ts +52 -15
- package/dist/blocks/catalog/index.js +53 -18
- package/dist/blocks/channels/index.d.ts +7 -7
- package/dist/blocks/collections/index.d.ts +6 -6
- package/dist/blocks/comments/index.d.ts +10 -10
- package/dist/blocks/compliance/index.d.ts +5 -5
- package/dist/blocks/connectors/index.d.ts +4 -4
- package/dist/blocks/contacts/index.d.ts +6 -6
- package/dist/blocks/content/index.d.ts +5 -5
- package/dist/blocks/contracts/index.d.ts +6 -6
- package/dist/blocks/courses/index.d.ts +5 -5
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/custom-fields/index.d.ts +6 -6
- package/dist/blocks/data-lifecycle/index.d.ts +8 -8
- package/dist/blocks/deals/index.d.ts +6 -6
- package/dist/blocks/deals/index.js +1 -1
- package/dist/blocks/dispatch/index.d.ts +6 -6
- package/dist/blocks/documents/index.d.ts +4 -4
- package/dist/blocks/documents/index.js +1 -1
- package/dist/blocks/domains/index.d.ts +6 -6
- package/dist/blocks/donations/index.d.ts +6 -6
- package/dist/blocks/drive/index.d.ts +6 -6
- package/dist/blocks/employees/index.d.ts +8 -8
- package/dist/blocks/enrichment/index.d.ts +6 -6
- package/dist/blocks/enrollments/index.d.ts +74 -9
- package/dist/blocks/enrollments/index.js +67 -3
- package/dist/blocks/entitlements/index.d.ts +6 -6
- package/dist/blocks/expenses/index.d.ts +93 -6
- package/dist/blocks/expenses/index.js +95 -4
- package/dist/blocks/field-history/index.d.ts +4 -4
- package/dist/blocks/flags/index.d.ts +5 -5
- package/dist/blocks/forecasts/index.d.ts +6 -6
- package/dist/blocks/forms/index.d.ts +6 -6
- package/dist/blocks/goals/index.d.ts +4 -4
- package/dist/blocks/guests/index.d.ts +6 -6
- package/dist/blocks/hiring/index.d.ts +6 -6
- package/dist/blocks/identities/index.d.ts +5 -5
- package/dist/blocks/imports/index.d.ts +5 -5
- package/dist/blocks/inbox/index.d.ts +11 -11
- package/dist/blocks/inbox/index.js +56 -1
- package/dist/blocks/incidents/index.d.ts +5 -5
- package/dist/blocks/index.d.ts +9 -9
- package/dist/blocks/inventory/index.d.ts +6 -6
- package/dist/blocks/invoices/index.d.ts +30 -10
- package/dist/blocks/invoices/index.js +28 -9
- package/dist/blocks/knowledge/index.d.ts +4 -4
- package/dist/blocks/knowledge/index.js +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +7 -7
- package/dist/blocks/leases/index.d.ts +6 -6
- package/dist/blocks/leave/index.d.ts +88 -15
- package/dist/blocks/leave/index.js +65 -14
- package/dist/blocks/ledger/index.d.ts +6 -6
- package/dist/blocks/mail-sync/index.d.ts +5 -5
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +5 -5
- package/dist/blocks/memory/index.js +30 -5
- package/dist/blocks/messaging/index.d.ts +11 -11
- package/dist/blocks/metrics/index.d.ts +6 -6
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +6 -6
- package/dist/blocks/notifications/index.d.ts +11 -11
- package/dist/blocks/notifications/index.js +1 -1
- package/dist/blocks/numbering/index.d.ts +4 -4
- package/dist/blocks/oauth-server/index.d.ts +5 -5
- package/dist/blocks/oauth-server/index.js +1 -1
- package/dist/blocks/onboarding/index.d.ts +5 -5
- package/dist/blocks/orders/index.d.ts +7 -7
- package/dist/blocks/organizations/index.d.ts +8 -8
- package/dist/blocks/outbox/index.d.ts +4 -4
- package/dist/blocks/outbox/index.js +1 -1
- package/dist/blocks/passes/index.d.ts +8 -8
- package/dist/blocks/passes/index.js +2 -2
- package/dist/blocks/permissions/index.d.ts +7 -7
- package/dist/blocks/pipelines/index.d.ts +6 -6
- package/dist/blocks/posts/index.d.ts +5 -5
- package/dist/blocks/profiles/index.d.ts +4 -4
- package/dist/blocks/promotions/index.d.ts +5 -5
- package/dist/blocks/push/index.d.ts +7 -7
- package/dist/blocks/queue/index.d.ts +6 -6
- package/dist/blocks/queue/index.js +2 -2
- package/dist/blocks/quotes/index.d.ts +119 -27
- package/dist/blocks/quotes/index.js +112 -18
- package/dist/blocks/rank/index.d.ts +4 -4
- package/dist/blocks/reactions/index.d.ts +9 -9
- package/dist/blocks/relations/index.d.ts +7 -7
- package/dist/blocks/reminders/index.d.ts +78 -11
- package/dist/blocks/reminders/index.js +118 -6
- package/dist/blocks/reviews/index.d.ts +5 -5
- package/dist/blocks/saved-views/index.d.ts +6 -6
- package/dist/blocks/scores/index.d.ts +5 -5
- package/dist/blocks/search/index.d.ts +7 -7
- package/dist/blocks/security-events/index.d.ts +7 -7
- package/dist/blocks/security-events/index.js +1 -1
- package/dist/blocks/segments/index.d.ts +7 -7
- package/dist/blocks/sequences/index.d.ts +6 -6
- package/dist/blocks/service-accounts/index.d.ts +5 -5
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/index.js +1 -1
- package/dist/blocks/settings/index.d.ts +6 -6
- package/dist/blocks/share-links/index.d.ts +5 -5
- package/dist/blocks/shipments/index.d.ts +6 -6
- package/dist/blocks/shipments/index.js +1 -1
- package/dist/blocks/signatures/index.d.ts +5 -5
- package/dist/blocks/signing-keys/index.d.ts +4 -4
- package/dist/blocks/signing-keys/index.js +2 -2
- package/dist/blocks/sla/index.d.ts +7 -7
- package/dist/blocks/sso/index.d.ts +6 -6
- package/dist/blocks/state-machine/index.d.ts +27 -7
- package/dist/blocks/state-machine/index.js +7 -2
- package/dist/blocks/subjects/index.d.ts +6 -6
- package/dist/blocks/tags/index.d.ts +6 -6
- package/dist/blocks/tasks/index.d.ts +9 -9
- package/dist/blocks/teams/index.d.ts +4 -4
- package/dist/blocks/templates/index.d.ts +7 -7
- package/dist/blocks/time-tracking/index.d.ts +7 -7
- package/dist/blocks/time-tracking/index.js +1 -1
- package/dist/blocks/timeline/index.d.ts +8 -8
- package/dist/blocks/trash/index.d.ts +6 -6
- package/dist/blocks/undo/index.d.ts +4 -4
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +4 -4
- package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
- package/dist/blocks/vercel-marketplace/index.js +3 -3
- package/dist/blocks/versions/index.d.ts +6 -6
- package/dist/blocks/waitlist/index.d.ts +5 -5
- package/dist/blocks/waitlist/index.js +1 -1
- package/dist/blocks/webhooks/index.d.ts +13 -13
- package/dist/blocks/webhooks/index.js +5 -5
- package/dist/blocks/workflow-editor/index.d.ts +10 -10
- package/dist/blocks/workflow-editor/index.js +65 -2
- package/dist/blocks/workflows/index.d.ts +7 -7
- package/dist/{bookings-Br0VXzaf.d.ts → bookings-Dj5cvXKv.d.ts} +4 -4
- package/dist/{bucket-DvG66r5G.d.ts → bucket-CrsJNHzi.d.ts} +1 -1
- package/dist/chat-sdk/index.d.ts +6 -6
- package/dist/claims/index.d.ts +6 -6
- package/dist/claims/index.js +2 -2
- package/dist/cli/{add-DoEtJhZG.js → add-D2CH8t_B.js} +2 -2
- package/dist/cli/add-De73Ghlh.js +1 -0
- package/dist/cli/{add-THXE7juv.js → add-Duf1-19E.js} +16 -14
- package/dist/cli/{agent-59XWXsRi.js → agent-Tqq3MAqx.js} +26 -1
- package/dist/cli/{app-table-files-BqLd5TuX.js → app-table-files-ha8X0rRE.js} +2 -2
- package/dist/cli/app-tables-BIyQcsHH.js +42 -0
- package/dist/cli/{backfill-D-2W0fNT.js → backfill-CLgA6-ll.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-BVU_FoLo.js → blocks-9AeouX4h.js} +2 -2
- package/dist/cli/{blocks-XwUHeyUH.js → blocks-BVB1fMMj.js} +1 -1
- package/dist/cli/{cache-D4nwCBXc.js → cache-aMk9vF1_.js} +1 -1
- package/dist/cli/{codemod-Dh4lf_k4.js → codemod-B5wrcnF2.js} +113 -4
- package/dist/cli/{command-BpZ4AuhR.js → command-DM_x_yzZ.js} +6 -0
- package/dist/cli/{completion-DHTT6rjI.js → completion-CusuUJNn.js} +1 -1
- package/dist/cli/{completion-B08Q0xB3.js → completion-Cx2UYd-y.js} +2 -2
- package/dist/cli/{completion-CwL7e93t.js → completion-DbYb3N8e.js} +2 -2
- package/dist/cli/{config-D-Upz3jV.js → config-BeuImpav.js} +1 -1
- package/dist/cli/{content-mapper-CwFH_PEn.js → content-mapper-CEtdbshU.js} +2 -2
- package/dist/cli/{db-Diy1OebO.js → db-CeiQzhPq.js} +2 -2
- package/dist/cli/{doctor-CyAMbZ_s.js → doctor-DaOUWfRN.js} +391 -54
- package/dist/cli/env-BfWbheiC.js +1 -0
- package/dist/cli/{env-BAJn6wCA.js → env-DVV10l_r.js} +1 -1
- package/dist/cli/{gen-EAUNnUY7.js → gen-BO-2NF-G.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-BRmmmGHJ.js → init-Xit9Hnbb.js} +9 -9
- package/dist/cli/{keys-CxajkV_7.js → keys-DJTN2Avl.js} +1 -1
- package/dist/cli/{live-CV9mn-xC.js → live-CuMpyRjF.js} +2 -2
- package/dist/cli/{mcp-CnaxcLWa.js → mcp-C7d4j5cq.js} +4 -4
- package/dist/cli/{metadata-CFQGBR5E.js → metadata-D2YvkY2D.js} +3 -3
- package/dist/cli/{migrate-z5oHDGNs.js → migrate-BCXxyTKt.js} +2 -2
- package/dist/cli/{migration-safety-BtAPMEZa.js → migration-safety-DfwTOBQ4.js} +1 -1
- package/dist/cli/{migrations-CNa62JSi.js → migrations-nomh4TBo.js} +2 -2
- package/dist/cli/{module-migration-CKJ8kRm1.js → module-migration--9T_T-zt.js} +2 -2
- package/dist/cli/{moved-BAFPdJz_.js → moved-CT6i1csY.js} +1 -1
- package/dist/cli/{parse-BueItuNJ.js → parse-qgJylE_A.js} +1 -1
- package/dist/cli/{powersync-BgoAWeRT.js → powersync-DB9WZsIv.js} +4 -4
- package/dist/cli/powersync-IBM_v_eJ.js +1 -0
- package/dist/cli/{print-CoqKHoy0.js → print-S6IF5rZm.js} +2 -2
- package/dist/cli/{providers-CfbFxUOQ.js → providers-BDTcal71.js} +1 -1
- package/dist/cli/{prune-workflows-BigCoXLw.js → prune-workflows-Zr2DjByi.js} +3 -3
- package/dist/cli/{remove-C9zwn-Kk.js → remove-CPX5Tg5s.js} +6 -6
- package/dist/cli/{render-DQCU_kBW.js → render-Bp7a7XQ9.js} +18 -4
- package/dist/cli/{run-DOD00FFl.js → run-BclCFEyP.js} +13 -41
- package/dist/cli/{run-dY9uOC3W.js → run-BlVaLnt_.js} +2 -2
- package/dist/cli/{run-CVaBuT18.js → run-kgG50x_Z.js} +44 -43
- package/dist/cli/{seed-BpaqqyO8.js → seed-Cn2R91cd.js} +2 -2
- package/dist/cli/seed-DGGjReq4.js +1 -0
- package/dist/cli/{shared-COtj7l3r.js → shared-D60W9NS-.js} +1 -1
- package/dist/cli/{skills-jZThjL3B.js → skills-DH-yPDny.js} +1 -1
- package/dist/cli/{snapshot-BvlEmTB0.js → snapshot-C3_eQUgY.js} +2 -2
- package/dist/cli/{source-BhZRCitG.js → source-Bk6XwIAK.js} +1 -1
- package/dist/cli/{spec-Bo2wIViH.js → spec-BDTpcBns.js} +1 -1
- package/dist/cli/{spec-DsMWuJLv.js → spec-C8ydQwZC.js} +3 -3
- package/dist/cli/{sql-layout-CA7xgRjR.js → sql-layout-DVQ20UMi.js} +3 -3
- package/dist/cli/{stack-147NqctC.js → stack-CmhSfY5V.js} +3 -2
- package/dist/cli/{sync-D9xSGdzO.js → sync-D-WO4Yvl.js} +4 -4
- package/dist/cli/{table-D9FbJS8h.js → table-k5OABwy3.js} +1 -1
- package/dist/cli/{upgrade-Ykf0LLEB.js → upgrade-DGe5Pv6v.js} +5 -5
- package/dist/cli/{upgrade-XK_CQKVJ.js → upgrade-XdhMuHAu.js} +3 -3
- package/dist/cli/{version-Dfdz7KSh.js → version-DKfeme2I.js} +1 -1
- package/dist/client/index.d.ts +6 -6
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +2 -2
- package/dist/{client-Bky2z09B.js → client-DrejIxsu.js} +1 -1
- package/dist/{cloud-event-DXWmXrus.d.ts → cloud-event-BEmAUdl1.d.ts} +1 -1
- package/dist/commerce/index.js +1 -1
- package/dist/{compiler-qlXlokKn.d.ts → compiler-BOW4yPcW.d.ts} +2 -2
- package/dist/{composite-CIxjVcL1.d.ts → composite-B-oAH16L.d.ts} +7 -7
- package/dist/{composite-D2JnIiHt.js → composite-BidYZWZY.js} +3 -3
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-Bu6pwqcO.js → config-BKxjItQ-.js} +3 -3
- package/dist/{config-MDRA2sre.js → config-BrRlSxhx.js} +1 -1
- package/dist/{connectors-Cf2LeAuZ.d.ts → connectors-CrLRW4Ol.d.ts} +4 -4
- package/dist/{context-BGC0J3t9.d.ts → context-yfOlyAqb.d.ts} +3 -3
- package/dist/contract/index.d.ts +9 -9
- package/dist/{controller-CQrkLoRX.d.ts → controller-CAcLEndc.d.ts} +1 -1
- package/dist/{conversion-C9rndpEI.d.ts → conversion-s1NtB6S-.d.ts} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +3 -3
- package/dist/create/lite/index.d.ts +4 -4
- package/dist/create/lite/index.js +2 -2
- package/dist/credentials/index.d.ts +4 -4
- package/dist/credentials/index.js +1 -1
- package/dist/{cron-route-DSITg1yC.js → cron-route-uTsC2BD0.js} +1 -1
- package/dist/{data-engine-CMENsp3d.d.ts → data-engine-CX1oYDZl.d.ts} +1 -1
- package/dist/{define-ITQA71fw.d.ts → define-BvkaC3Oh.d.ts} +5 -5
- package/dist/{define-B6D55cO0.js → define-Duh2mMYk.js} +1 -1
- package/dist/{define-block-COmMkx2x.d.ts → define-block-Ds3aLZwz.d.ts} +12 -12
- package/dist/{documents-DeZw83ue.d.ts → documents-Btk0MhC0.d.ts} +3 -3
- package/dist/edge/index.d.ts +9 -9
- package/dist/edge/index.js +7 -7
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{embeddings-rVR2AKVz.d.ts → embeddings-CI6P_mtD.d.ts} +1 -1
- package/dist/{ended-NC_ZesY4.d.ts → ended-iq2wp8fc.d.ts} +8 -3
- package/dist/{entitlements-BOWTZaRf.d.ts → entitlements-Dhu-4vlH.d.ts} +2 -2
- package/dist/env/index.d.ts +1 -1
- package/dist/{messages-CRk1g6oe.js → errors-0Qid9fGz.js} +107 -3
- package/dist/eve/index.d.ts +9 -9
- package/dist/eve/index.js +3 -3
- package/dist/{eve-DIKjuPp5.d.ts → eve-DleYrhwj.d.ts} +2 -2
- package/dist/{event-calendar-DUtFyRrv.d.ts → event-calendar-DPMcqy7Q.d.ts} +1 -1
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-DVt3Z9hw.d.ts → events-DCw3c6pj.d.ts} +1 -1
- package/dist/{executor-DqNRrFxx.d.ts → executor-B-o7QMPp.d.ts} +16 -2
- package/dist/{executor-CFmee_nV.d.ts → executor-DoSNec_H.d.ts} +1 -1
- package/dist/{executor-CHnoKOxk.d.ts → executor-H8ZLkeHj.d.ts} +4 -4
- package/dist/{executor-BDMqPbVU.js → executor-RYiR4z47.js} +71 -37
- package/dist/expo/index.d.ts +4 -4
- package/dist/expo/index.js +7 -7
- package/dist/{field-errors-DxPZYw2m.d.ts → field-errors-DXZk9Qjt.d.ts} +10 -10
- package/dist/{fields-CAVk9dxX.d.ts → fields-CP46SPNE.d.ts} +1 -1
- package/dist/{filter-evaluate-Bz3Fzhz2.d.ts → filter-evaluate-Bkbb0nuQ.d.ts} +1 -1
- package/dist/{filter-query-DV-x8fio.d.ts → filter-query-Xj40B5KT.d.ts} +1 -1
- package/dist/{flags-6emyAXly.d.ts → flags-Cuew4tGx.d.ts} +2 -2
- package/dist/flags-sdk/index.d.ts +2 -2
- package/dist/{framework-BFlaPuvv.d.ts → framework-Byr_j8G-.d.ts} +8 -8
- package/dist/{framework-ChzJYkJW.js → framework-z3KTPRjk.js} +4 -4
- package/dist/{gateway-DaekJ_Me.d.ts → gateway-B9k89AC4.d.ts} +3 -3
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/index.js +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/h3/v1/index.js +1 -1
- package/dist/hono/index.d.ts +9 -10
- package/dist/hono/index.js +8 -8
- package/dist/{inbox-DavCzW7b.d.ts → inbox-yGfUVQr2.d.ts} +61 -6
- package/dist/{index-Dvpu22CJ.d.ts → index-1uV69AZq.d.ts} +1 -1
- package/dist/{index-CJB50jzQ.d.ts → index-6H-8Ib1w.d.ts} +6 -6
- package/dist/{index-M1izbwbN.d.ts → index-Ag-T51Jl.d.ts} +1 -1
- package/dist/{index-DNAkWDXc.d.ts → index-BUluRi0b.d.ts} +6 -6
- package/dist/{index-QTZIopQj.d.ts → index-C78VPlXW.d.ts} +1 -1
- package/dist/{index-D18su_r5.d.ts → index-CY612vAg.d.ts} +10 -5
- package/dist/{index-BfU0KR0X.d.ts → index-CnzGRpeH.d.ts} +5 -5
- package/dist/{index-BIAtapnD.d.ts → index-Dbd1E5Au.d.ts} +5 -5
- package/dist/{index-Bhkag9ZE.d.ts → index-Dv6lfL5p.d.ts} +14 -14
- package/dist/{index-8w4OB5En.d.ts → index-F6lsRlsr.d.ts} +1 -1
- package/dist/{index-CeUwyJ3Z.d.ts → index-kkZwp5M1.d.ts} +6 -6
- package/dist/{index-Bz0WLuh_.d.ts → index-lMApFSAd.d.ts} +5 -5
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{instances-D31jrmKh.js → instances-xQ2lupVE.js} +246 -12
- package/dist/jwks-cache-CBKtICNV.js +114 -0
- package/dist/{jws-B8p0ppgh.js → jws-De9qjIPV.js} +1 -1
- package/dist/{kit-9pZP5iLU.js → kit-D5rRAKWJ.js} +2 -2
- package/dist/{kit-OgFOW9rX.d.ts → kit-DCuO1ZhB.d.ts} +4 -4
- package/dist/{knowledge-DdZzUTQ-.js → knowledge-CJnZOaix.js} +67 -7
- package/dist/{knowledge-BBC2sfAY.d.ts → knowledge-DWXAxvkN.d.ts} +82 -11
- package/dist/lint/index.d.ts +1 -1
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-C7V8kUaD.d.ts → list-query-D1h3Dmnk.d.ts} +3 -3
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +5 -5
- package/dist/mcp/sdk/index.d.ts +6 -6
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{messaging-D5z2TR37.d.ts → messaging-Bfe4p9Pm.d.ts} +4 -4
- package/dist/{model-messages-BcrkjsPE.js → model-messages-CIHqP7Z3.js} +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/nestjs/index.js +1 -1
- package/dist/next/client/index.d.ts +1 -1
- package/dist/next/index.d.ts +331 -79
- package/dist/next/index.js +520 -105
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{operations-BG6prEnh.d.ts → operations-SWpzGC_K.d.ts} +1 -1
- package/dist/{options-D4dxMGHF.js → options-Bgnm4pTD.js} +1 -0
- package/dist/{options-C13-dVMH.js → options-D-jiqb0l.js} +2 -0
- package/dist/{options-DjFbIRgV.js → options-DjdxZgHi.js} +2 -1
- package/dist/{options-CgMiQGOF.js → options-DqmTs2nv.js} +4 -1
- package/dist/{options-C-NFS6e3.js → options-DxgZ8tVc.js} +2 -1
- package/dist/{options-CuPWezcV.js → options-RYbyaVhv.js} +3 -1
- package/dist/options-SOjQVgfS.js +37 -0
- package/dist/{options-JnPEVbBJ.js → options-ScQ6Hnxo.js} +2 -1
- package/dist/{options-Sq4bYbf5.js → options-X61tvckX.js} +4 -1
- package/dist/orpc/index.d.ts +8 -8
- package/dist/orpc/index.js +6 -6
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-7zgh-7nw.d.ts → outbox-BFZS6Kvz.d.ts} +4 -4
- package/dist/{permissions-CoHsUtZS.d.ts → permissions-2UlVQDzY.d.ts} +1 -1
- package/dist/{pool-D-4HyhuW.d.ts → pool-yO-LzZAd.d.ts} +3 -3
- package/dist/{ports-CmEXVqhg.js → ports-CkygVOeE.js} +2 -2
- package/dist/{ports-XvgCe7ey.d.ts → ports-prqYrReN.d.ts} +1 -1
- package/dist/postgres/index.d.ts +4 -4
- package/dist/{postgrest-DZtM2nIS.d.ts → postgrest-Bjain6nf.d.ts} +1 -1
- package/dist/powersync/index.d.ts +6 -6
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-om2rbdYw.js → preset-BvHNleCo.js} +2 -2
- package/dist/{project-B7nqCzn5.js → project-CBvowdKY.js} +5 -5
- package/dist/{provider-BI0KC4u5.d.ts → provider-bIAzxVMB.d.ts} +1 -1
- package/dist/{push-token-kcc04ZaS.d.ts → push-token-DtqJeg8w.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/{rate-limit-CRhlLFhP.js → rate-limit-BJ4EMdAy.js} +1 -1
- package/dist/react/index.d.ts +9 -9
- 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 +9 -9
- package/dist/react/server.js +2 -2
- package/dist/react/session.d.ts +2 -32
- package/dist/react/session.js +1 -37
- package/dist/{react-COIov1yC.js → react-DZ7AW2yf.js} +2 -2
- package/dist/react-router/index.d.ts +6 -6
- package/dist/react-router/index.js +5 -5
- package/dist/realtime/index.d.ts +6 -6
- package/dist/{record-form-DU2EoVsv.d.ts → record-form-BQA-lawE.d.ts} +1 -1
- package/dist/{recordings-D69Va7gP.d.ts → recordings-Bw5LoocX.d.ts} +1 -1
- package/dist/records/index.d.ts +9 -9
- package/dist/{refusal-CGi-0Q18.d.ts → refusal-BX1EvmpJ.d.ts} +3 -3
- package/dist/{refusal-5c6UMpUP.js → refusal-rnbr6RZD.js} +2 -2
- package/dist/{refresh-B8t_KE3s.js → request-kind-tNDM5Z_o.js} +15 -31
- package/dist/{resolve--LfVoOMg.d.ts → resolve-BIpQRhvF.d.ts} +97 -36
- package/dist/{resolve-FW8oeXvh.js → resolve-CZV31iCm.js} +402 -392
- package/dist/{resolved-names-DYYyh35i.js → resolved-names-b6P2--jK.js} +1 -1
- package/dist/{resource-BbWk4hoP.js → resource-COaS9_i8.js} +1 -1
- package/dist/{resource-DWllVW8k.d.ts → resource-CaYpB07K.d.ts} +1 -1
- package/dist/{resource-execute-DUBYKTYU.d.ts → resource-execute-A1NbR-sd.d.ts} +2 -2
- package/dist/{resource-types-RgaljPs0.d.ts → resource-types-CTcc37WL.d.ts} +4 -4
- package/dist/{resources-Bki1J4jy.d.ts → resources-13ZFX1G6.d.ts} +2 -2
- package/dist/{resources-DYSx9NYM.js → resources-DhiK3yLO.js} +1 -1
- package/dist/{respond-DLH4tD2d.js → respond-8A3EOo61.js} +1 -1
- package/dist/{respond-BYOV7KZp.d.ts → respond-CAxhkwAi.d.ts} +15 -19
- package/dist/{sales-lines-DuNVoKHA.d.ts → sales-lines-wQHuL-pa.d.ts} +1 -1
- package/dist/{sandboxes-B2hBoBvJ.d.ts → sandboxes-BF9RxxCU.d.ts} +1 -1
- package/dist/{scores-FAORS4qU.d.ts → scores-Ce8MxQX9.d.ts} +5 -5
- package/dist/server/index.d.ts +58 -36
- package/dist/server/index.js +35 -41
- package/dist/{server-types-C2hlvhP4.d.ts → server-types-DEjva0MW.d.ts} +19 -17
- package/dist/{session-B4VasaAA.d.ts → session-BA0YDmjt.d.ts} +11 -12
- package/dist/session-BjPYE4dT.js +180 -0
- package/dist/session-CeYL3EPm.d.ts +77 -0
- package/dist/{session-status-D8CBxCqv.d.ts → session-status-Df6tuKY9.d.ts} +4 -3
- package/dist/{sign-in-CX1a5i2P.d.ts → sign-in-4u4vLtXG.d.ts} +16 -4
- package/dist/{sign-in-CxdoTEp5.js → sign-in-djgvab1X.js} +3 -3
- package/dist/{sign-in-BMm1xhKq.js → sign-in-k2lXELeC.js} +2 -2
- package/dist/{signatures-CBn7w4VR.js → signatures-DK01D2S7.js} +1 -1
- package/dist/{signers-6ih6i9aq.d.ts → signers-Dw9DBZjJ.d.ts} +4 -4
- package/dist/{signing-keys-De09WNJ3.d.ts → signing-keys-FglIQ6iL.d.ts} +2 -2
- package/dist/{signing-keys-BC5_hJN5.js → signing-keys-sGaXklwD.js} +1 -1
- package/dist/{snapshot-CVMSyTHH.js → snapshot-BOA7lkRg.js} +9 -17
- package/dist/solid/index.d.ts +10 -10
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +3 -3
- package/dist/{sql-DdtukoIm.js → sql-BChN3Hxv.js} +7594 -2269
- package/dist/sqlite/index.d.ts +3 -3
- package/dist/{sso-CuzAjsc8.d.ts → sso-B7w7h8RJ.d.ts} +3 -3
- package/dist/ssr/index.d.ts +5 -6
- package/dist/ssr/index.js +3 -3
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/{subject-readers-BlD8tALG.d.ts → subject-readers-YL8H9G8X.d.ts} +2 -2
- package/dist/{subjects-Bv2dPflD.d.ts → subjects-CVjAE7nz.d.ts} +3 -3
- package/dist/{support-DxYI6sDM.d.ts → support-BwtMgjVg.d.ts} +4 -4
- package/dist/{support-view-DSmCett7.d.ts → support-view-GykHOIQ2.d.ts} +1 -1
- package/dist/svelte/index.d.ts +9 -9
- package/dist/svelte/index.js +1 -1
- package/dist/sveltekit/index.d.ts +7 -7
- package/dist/sveltekit/index.js +5 -5
- package/dist/{tags--k2fbPfO.d.ts → tags-CAfvzA1U.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +3 -3
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-DkKbvK5T.d.ts → tenant-lBgoqg9T.d.ts} +1 -1
- package/dist/testing/index.d.ts +27 -28
- package/dist/testing/index.js +5 -5
- package/dist/{timeline-Bq658xsi.d.ts → timeline-CrO48Qa6.d.ts} +5 -5
- package/dist/{topic-B6zuexk7.d.ts → topic-x-mrN_Ff.d.ts} +5 -5
- package/dist/{types-C8UyJOPJ.d.ts → types-6PMaLIyw.d.ts} +3 -3
- package/dist/{types-Dh2OGEW5.d.ts → types-BdhE7I8Z.d.ts} +5 -5
- package/dist/{types-BkYEUWdz.d.ts → types-BzIYSSWK.d.ts} +16 -1
- package/dist/{types-DCoqai8o.d.ts → types-C7K8mu9B.d.ts} +45 -15
- package/dist/{types-d0JBRTAg.d.ts → types-C9XfFGmA.d.ts} +128 -13
- package/dist/{types-BvHw2cCS.d.ts → types-CJqNGQKb.d.ts} +2 -2
- package/dist/{types-TH3zlMiM.d.ts → types-D5uf0l4_.d.ts} +1 -1
- package/dist/{types-BBqP9H6w.d.ts → types-auvHrNWC.d.ts} +4 -4
- package/dist/{undo-22ofP6Zp.d.ts → undo-CdKp5_2X.d.ts} +2 -2
- package/dist/{usage-CNCT6_3D.d.ts → usage-DZ8j5Tm_.d.ts} +4 -4
- package/dist/{vault-yGQD5Rdl.d.ts → vault-DjbG4XQS.d.ts} +2 -2
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/vercel-sandbox/index.d.ts +2 -2
- package/dist/{verify-DY_j4GPZ.js → verify-96j8d5ps.js} +1 -1
- package/dist/{verify-BQu3eBNW.d.ts → verify-HOiu3lRR.d.ts} +2 -2
- package/dist/{view-BfEqjZJ_.js → view-Ch0Qtr36.js} +1 -1
- package/dist/{view-Cy2XxYp1.d.ts → view-DdDY88SC.d.ts} +1 -1
- package/dist/vue/index.d.ts +10 -10
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-YYSVJGDY.d.ts → watch-topic-D6bcqOrJ.d.ts} +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +29 -5
- package/dist/workflow-sdk/builder/index.js +39 -12
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/dist/workflow-sdk/index.js +2 -2
- package/dist/workflow-sdk/world/index.d.ts +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-BL3wzkdp.js → workflow-sdk-CBS8L2Ku.js} +5 -0
- package/dist/{workflow-sdk-yIkECybp.d.ts → workflow-sdk-D3H10W5h.d.ts} +3 -3
- package/dist/{workflows-BljkWRxE.d.ts → workflows-BI4yKqFh.d.ts} +3 -3
- package/dist/yjs/index.d.ts +2 -2
- package/dist/yjs/index.js +1 -1
- package/package.json +1 -1
- package/schemas/config-v1.json +162 -0
- package/schemas/doctor-report-v1.json +4 -0
- package/skills/better-supabase-auth/SKILL.md +45 -11
- package/dist/cli/add-C13ZqJ_N.js +0 -1
- package/dist/cli/env-UN6PJFX6.js +0 -1
- package/dist/cli/powersync-DoCruiOt.js +0 -1
- package/dist/cli/seed-ByLneY1H.js +0 -1
- package/dist/errors-D3-4c-XF.js +0 -102
- package/dist/http-BDC1IvBX.js +0 -27
- package/dist/jwks-cache-IZaiICAV.js +0 -48
- package/dist/options-Itq7QYoW.js +0 -20
- package/dist/refresh-BtbC2rZe.d.ts +0 -52
- package/dist/snapshot-BGsJw9xn.d.ts +0 -83
package/dist/next/index.d.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { b as DbError, f as Result } from "../result-DTOQRyGY.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { Qt as CacheAdapter, Y as DbStats, mt as QuerySpec, nt as ReadSet, t as BetterSupabase } from "../define-
|
|
5
|
-
import { a as authzVersionOf, c as sessionCacheKey, i as SessionSnapshot, o as isSessionSnapshot, s as issuedAtOf } from "../snapshot-BGsJw9xn.js";
|
|
2
|
+
import { O as AnyFunctions, Ut as AnyAuthorizer, et as RecordRef, k as AnyModels, nn as AuthzVersionCache, rn as PermissionRef } from "../types-BzIYSSWK.js";
|
|
3
|
+
import { C as CookieScope, _ as issuedAtOf, g as isSessionSnapshot, h as authzVersionOf, m as SessionSnapshot, r as AuthState, v as sessionCacheKey } from "../resolve-BIpQRhvF.js";
|
|
4
|
+
import { Qt as CacheAdapter, Y as DbStats, mt as QuerySpec, nt as ReadSet, t as BetterSupabase } from "../define-BvkaC3Oh.js";
|
|
6
5
|
import { n as Impersonator } from "../impersonation-BOCJcsmS.js";
|
|
7
6
|
import { n as AmrEntry, t as Aal } from "../mfa-CM5r904M.js";
|
|
8
|
-
import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-
|
|
9
|
-
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-
|
|
10
|
-
import { r as MembershipClaim } from "../entitlements-
|
|
11
|
-
import { t as tenantOf } from "../tenant-
|
|
12
|
-
import { r as permissionsOf, t as PermissionsOfOptions } from "../permissions-
|
|
13
|
-
import { n as AuthSession, o as toSession } from "../view-
|
|
14
|
-
import { i as ContextOptions, l as ServerOptions, o as ServerContext, r as BetterServer, u as SharedServer } from "../server-types-
|
|
15
|
-
import { a as SupportPolicy, c as supportSessions, i as SupportOptions, o as SupportSessions, s as SupportStartRequest, t as ActiveSupport } from "../support-
|
|
16
|
-
import { t as AuthOutageHook } from "../session-
|
|
17
|
-
import { n as AuthKind, r as GuardOptions } from "../respond-
|
|
18
|
-
import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-
|
|
19
|
-
import { c as ListParseOptions, m as ListSearchParams } from "../list-query-
|
|
20
|
-
import { r as LiveCountSeed, t as CountRunner } from "../index-
|
|
21
|
-
import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-
|
|
22
|
-
import { t as
|
|
23
|
-
import { t as
|
|
24
|
-
import {
|
|
7
|
+
import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-Ds3aLZwz.js";
|
|
8
|
+
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-Dbd1E5Au.js";
|
|
9
|
+
import { r as MembershipClaim } from "../entitlements-Dhu-4vlH.js";
|
|
10
|
+
import { t as tenantOf } from "../tenant-lBgoqg9T.js";
|
|
11
|
+
import { r as permissionsOf, t as PermissionsOfOptions } from "../permissions-2UlVQDzY.js";
|
|
12
|
+
import { n as AuthSession, o as toSession } from "../view-DdDY88SC.js";
|
|
13
|
+
import { i as ContextOptions, l as ServerOptions, o as ServerContext, r as BetterServer, u as SharedServer } from "../server-types-DEjva0MW.js";
|
|
14
|
+
import { a as SupportPolicy, c as supportSessions, i as SupportOptions, o as SupportSessions, s as SupportStartRequest, t as ActiveSupport } from "../support-BwtMgjVg.js";
|
|
15
|
+
import { t as AuthOutageHook } from "../session-BA0YDmjt.js";
|
|
16
|
+
import { n as AuthKind, r as GuardOptions } from "../respond-CAxhkwAi.js";
|
|
17
|
+
import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-DCuO1ZhB.js";
|
|
18
|
+
import { c as ListParseOptions, m as ListSearchParams } from "../list-query-D1h3Dmnk.js";
|
|
19
|
+
import { r as LiveCountSeed, t as CountRunner } from "../index-lMApFSAd.js";
|
|
20
|
+
import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-CTcc37WL.js";
|
|
21
|
+
import { t as Validated } from "../shared-DsBcvj6q.js";
|
|
22
|
+
import { t as ResourceMap } from "../resources-13ZFX1G6.js";
|
|
23
|
+
import { t as defineAction } from "../resource-execute-A1NbR-sd.js";
|
|
24
|
+
import { c as safeRedirectPath, i as OtpParams, n as EmailOtpType, o as SignOutScope, r as ExistingAccount, t as AuthorizeUrlParams } from "../sign-in-4u4vLtXG.js";
|
|
25
25
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-QSaPsL2P.js";
|
|
26
|
-
import { i as tagFor, t as TagOptions } from "../tags
|
|
27
|
-
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-
|
|
28
|
-
import { n as supportOf, t as SupportView } from "../support-view-
|
|
26
|
+
import { i as tagFor, t as TagOptions } from "../tags-CAfvzA1U.js";
|
|
27
|
+
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-CrO48Qa6.js";
|
|
28
|
+
import { n as supportOf, t as SupportView } from "../support-view-GykHOIQ2.js";
|
|
29
|
+
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
30
|
+
import { UserClaims } from "@supabase/server";
|
|
29
31
|
import { NextRequest } from "next/server.js";
|
|
30
32
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
31
|
-
import { UserClaims } from "@supabase/server";
|
|
32
33
|
/** Forwarded by the proxy so every scope of one render shares an id. */
|
|
33
34
|
export declare const REQUEST_ID_HEADER = "x-bsb-request-id";
|
|
34
35
|
interface DbBudget {
|
|
@@ -170,6 +171,23 @@ interface NextOptions extends ServerOptions {
|
|
|
170
171
|
* current scope.
|
|
171
172
|
*/
|
|
172
173
|
readonly cookieScopes?: readonly CookieScope[];
|
|
174
|
+
/**
|
|
175
|
+
* The getters from `next/root-params`, for `bsb.locale()`, `bsb.brand()` and
|
|
176
|
+
* `bsb.tenant()`. Without `tenant` in the options, the context takes the
|
|
177
|
+
* tenant from `rootParams.tenant`.
|
|
178
|
+
*
|
|
179
|
+
* ```ts
|
|
180
|
+
* import * as rootParams from "next/root-params";
|
|
181
|
+
* export const bsb = createNext(betterSupabase, { rootParams });
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
readonly rootParams?: NextRootParams;
|
|
185
|
+
/**
|
|
186
|
+
* The schema `bsb.bootstrap()` calls. Defaults to the one `gen` records from
|
|
187
|
+
* the sessions block (`blocks.sessions.api`, then `sql.api`, then its
|
|
188
|
+
* `schema`), else `better_supabase`.
|
|
189
|
+
*/
|
|
190
|
+
readonly bootstrapSchema?: string;
|
|
173
191
|
}
|
|
174
192
|
interface NextDebugOptions {
|
|
175
193
|
/** Collect outside development too, e.g. for e2e runs against `next start`. */
|
|
@@ -196,22 +214,16 @@ interface ProxyOptions<C = unknown, P = unknown> {
|
|
|
196
214
|
* are kept.
|
|
197
215
|
*/
|
|
198
216
|
readonly protect?: (auth: AuthState<C, P>, request: NextRequest) => Response | undefined | Promise<Response | undefined>;
|
|
199
|
-
/**
|
|
200
|
-
* A prefetch never refreshes, so a session cookie whose token expired
|
|
201
|
-
* resolves to `{ kind: 'none', reason: 'expired' }` there. `'redirect'` (the
|
|
202
|
-
* default) passes that to `protect` like any other caller. `'render'` skips
|
|
203
|
-
* `protect` for it, so the prefetch renders signed out instead of caching a
|
|
204
|
-
* redirect to sign-in; `sessionStale` keeps that view out of the App Shell,
|
|
205
|
-
* and the navigation itself refreshes the session.
|
|
206
|
-
*/
|
|
207
|
-
readonly onExpiredPrefetch?: "redirect" | "render";
|
|
208
217
|
/**
|
|
209
218
|
* Methods that run `protect`. Defaults to `GET` and `HEAD`, so a Server
|
|
210
219
|
* Action POST is not redirected before the action runs. Set `true` to include
|
|
211
220
|
* mutations, or pass the methods yourself.
|
|
212
221
|
*/
|
|
213
222
|
readonly protectMethods?: true | readonly string[];
|
|
214
|
-
/**
|
|
223
|
+
/**
|
|
224
|
+
* Post-processes the final response; return a new one to replace it. The
|
|
225
|
+
* session cookies and cache headers are added to a replacement too.
|
|
226
|
+
*/
|
|
215
227
|
readonly after?: (response: Response, auth: AuthState<C, P>) => Response | undefined | void | Promise<Response | undefined | void>;
|
|
216
228
|
/**
|
|
217
229
|
* Adds `Server-Timing` entries in ms: `bsb-proxy` (the whole proxy),
|
|
@@ -227,9 +239,11 @@ interface ProxyOptions<C = unknown, P = unknown> {
|
|
|
227
239
|
readonly leeway?: number;
|
|
228
240
|
/**
|
|
229
241
|
* Ask Auth whether the session still exists (one network call), on top-level
|
|
230
|
-
* document loads only. `true` checks every document load.
|
|
242
|
+
* document loads only. `true` checks every document load. `"bootstrap"` skips
|
|
243
|
+
* the call: `bsb.bootstrap()` checks `session_active()` in the same query as
|
|
244
|
+
* the page's data.
|
|
231
245
|
*/
|
|
232
|
-
readonly verifySession?: true | VerifySessionOptions;
|
|
246
|
+
readonly verifySession?: true | "bootstrap" | VerifySessionOptions;
|
|
233
247
|
/**
|
|
234
248
|
* Called when a refresh failed because the Auth server was unreachable, timed
|
|
235
249
|
* out or answered 5xx or 429. When the access token couldn't be kept
|
|
@@ -342,14 +356,13 @@ interface BetterNext<M extends AnyModels, F extends AnyFunctions, E, C = unknown
|
|
|
342
356
|
* `session` gives an `invalid` context.
|
|
343
357
|
*/
|
|
344
358
|
contextFromSession(snapshot: SessionSnapshot<C> | null, options?: ContextOptions): Promise<ServerContext<M, F, E, C, P, B>>;
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
*
|
|
352
|
-
* returns the caller's context plus `session`.
|
|
359
|
+
/**
|
|
360
|
+
* First statement of an app-authored cache function: sets `cacheLife`
|
|
361
|
+
* (`stale` 300 unless `life` says otherwise), tags the entry
|
|
362
|
+
* `bsb:session:<user id>` and `bsb:session-id:<session id>` plus `tags`, and
|
|
363
|
+
* returns the caller's context plus `session`. In `'use cache: private'` it
|
|
364
|
+
* reads the request's session; in `'use cache: remote'` pass `{ scope:
|
|
365
|
+
* "remote", key }` with the key `bsb.remote()` handed the function.
|
|
353
366
|
*
|
|
354
367
|
* ```ts
|
|
355
368
|
* async function getCustomers() {
|
|
@@ -360,6 +373,48 @@ interface BetterNext<M extends AnyModels, F extends AnyFunctions, E, C = unknown
|
|
|
360
373
|
* ```
|
|
361
374
|
*/
|
|
362
375
|
cached(options?: CachedOptions<Extract<keyof M, string>>): Promise<CachedContext<M, F, E, C, P, B>>;
|
|
376
|
+
/**
|
|
377
|
+
* Wraps a `'use cache: remote'` function so it can read as the caller: it
|
|
378
|
+
* verifies the session outside the boundary (a memo hit), hands the token
|
|
379
|
+
* over for the call, and passes the serializable key parts first. The token
|
|
380
|
+
* is never a key part, so a rotation keeps the entry.
|
|
381
|
+
*
|
|
382
|
+
* ```ts
|
|
383
|
+
* export const getReport = bsb.remote(async (key, year: number) => {
|
|
384
|
+
* "use cache: remote";
|
|
385
|
+
* const { db } = await bsb.cached({
|
|
386
|
+
* scope: "remote",
|
|
387
|
+
* key,
|
|
388
|
+
* tables: ["invoices"],
|
|
389
|
+
* });
|
|
390
|
+
* return db.invoices.list({ where: { year } }).orThrow();
|
|
391
|
+
* });
|
|
392
|
+
* ```
|
|
393
|
+
*/
|
|
394
|
+
remote<A extends readonly unknown[], R>(fn: (key: RemoteCacheKey, ...args: A) => Promise<R>, options?: RemoteOptions<C, A>): (...args: A) => Promise<R>;
|
|
395
|
+
/**
|
|
396
|
+
* One call for a page's user data: runs the sessions module's
|
|
397
|
+
* `bootstrap_<rpc>` wrapper, which checks `session_active()` and returns the
|
|
398
|
+
* caller's authorization version with the app function's data. Call it as the
|
|
399
|
+
* first statement of a cache function, like `bsb.cached()`; React's `cache()`
|
|
400
|
+
* runs the call once per request and key. A `false` `sessionActive` evicts
|
|
401
|
+
* the user's entries and redirects to `redirect` when it is set.
|
|
402
|
+
*/
|
|
403
|
+
bootstrap<T = unknown>(options: BootstrapOptions<Extract<keyof M, string>>): Promise<Bootstrap<C, P, T>>;
|
|
404
|
+
/**
|
|
405
|
+
* The context, tenant and permission checks for a bootstrap result (or a
|
|
406
|
+
* snapshot), bound to its authorization version, so islands stop rebuilding
|
|
407
|
+
* their context one by one. In a remote scope pass the key.
|
|
408
|
+
*/
|
|
409
|
+
getAccess(source?: Bootstrap<C, P> | SessionSnapshot<C> | null, options?: {
|
|
410
|
+
readonly key?: RemoteCacheKey;
|
|
411
|
+
}): Promise<Access<ServerContext<M, F, E, C, P, B>, C, P, Ref>>;
|
|
412
|
+
/** `rootParams.locale()`, or `undefined` without one or outside a render. */
|
|
413
|
+
locale(): Promise<string | undefined>;
|
|
414
|
+
/** `rootParams.brand()`, or `undefined` without one or outside a render. */
|
|
415
|
+
brand(): Promise<string | undefined>;
|
|
416
|
+
/** `rootParams.tenant()`, or `undefined` without one or outside a render. */
|
|
417
|
+
tenant(): Promise<string | undefined>;
|
|
363
418
|
/**
|
|
364
419
|
* Drops every `bsb.cached()` entry of a user, e.g. after a role change, and
|
|
365
420
|
* the entries tagged with `tags` (such as a permission snapshot's tag). In a
|
|
@@ -372,6 +427,14 @@ interface BetterNext<M extends AnyModels, F extends AnyFunctions, E, C = unknown
|
|
|
372
427
|
evictSession(userId: string, options?: {
|
|
373
428
|
readonly tags?: readonly string[];
|
|
374
429
|
}): Promise<void>;
|
|
430
|
+
/**
|
|
431
|
+
* A Server Action for `<SessionProvider onAuthzChange>`: drops the caller's
|
|
432
|
+
* own cached entries (the session and session id tags, plus the authorization
|
|
433
|
+
* provider's `sessionTags`) after the browser refreshed its token, and evicts
|
|
434
|
+
* them from the authorization version cache. Re-export it from a `"use
|
|
435
|
+
* server"` file. A signed-out caller is a no-op.
|
|
436
|
+
*/
|
|
437
|
+
refreshSessionCache(): Promise<void>;
|
|
375
438
|
/**
|
|
376
439
|
* Counts on the server and returns a serializable seed for
|
|
377
440
|
* `useLiveCount(seed)`, so the badge renders with a number and the client
|
|
@@ -665,34 +728,78 @@ interface SupportStarted {
|
|
|
665
728
|
/** ISO 8601. */
|
|
666
729
|
readonly expiresAt: string;
|
|
667
730
|
}
|
|
668
|
-
|
|
731
|
+
/**
|
|
732
|
+
* Where a `bsb.cached()` entry lives: `"use cache: private"` or `"use cache:
|
|
733
|
+
* remote"`.
|
|
734
|
+
*/
|
|
735
|
+
type CacheScope = "private" | "remote";
|
|
736
|
+
/** `cacheLife` for a `bsb.cached()` or `bsb.bootstrap()` entry. */
|
|
737
|
+
interface CachedLife {
|
|
738
|
+
/**
|
|
739
|
+
* Seconds the client router reuses the entry. Defaults to 300, the shortest
|
|
740
|
+
* time that keeps a private entry in the App Shell; the token's lifetime
|
|
741
|
+
* doesn't cap it, since the proxy refreshes prefetches and sign-out evicts
|
|
742
|
+
* the session tags. Below 300 the entry leaves the App Shell, below 30 the
|
|
743
|
+
* prerender (development warns about both).
|
|
744
|
+
*/
|
|
745
|
+
readonly stale?: number;
|
|
669
746
|
/**
|
|
670
|
-
*
|
|
671
|
-
*
|
|
672
|
-
* count as 30: the client router keeps any entry for at least 30 seconds, so
|
|
673
|
-
* a shorter stale time would outlive the token.
|
|
747
|
+
* Defaults to 300 in the remote scope, and to the profile's in the private
|
|
748
|
+
* one.
|
|
674
749
|
*/
|
|
675
|
-
readonly
|
|
676
|
-
/**
|
|
677
|
-
|
|
750
|
+
readonly revalidate?: number;
|
|
751
|
+
/**
|
|
752
|
+
* Defaults to 3600 in the remote scope, and to the profile's in the private
|
|
753
|
+
* one.
|
|
754
|
+
*/
|
|
755
|
+
readonly expire?: number;
|
|
756
|
+
/**
|
|
757
|
+
* Caps `stale` at the seconds left on the access token, and 0 once fewer than
|
|
758
|
+
* 30 are left: the behavior before 0.35.
|
|
759
|
+
*/
|
|
760
|
+
readonly capToToken?: boolean;
|
|
678
761
|
}
|
|
679
|
-
|
|
762
|
+
/**
|
|
763
|
+
* Who shares a remote entry. `"session"` keys it on the Auth session, `"user"`
|
|
764
|
+
* on the user across sessions. `{ key }` keys it on what the function returns
|
|
765
|
+
* for the caller, such as a tenant and role fingerprint: that is the app's own
|
|
766
|
+
* authorization decision, since every caller with the same key reads the
|
|
767
|
+
* entry.
|
|
768
|
+
*/
|
|
769
|
+
type CacheShare<C = unknown> = "session" | "user" | {
|
|
770
|
+
readonly key: (snapshot: SessionSnapshot<C> | null) => string;
|
|
771
|
+
};
|
|
772
|
+
/**
|
|
773
|
+
* The serializable key parts `bsb.remote()` passes to a `"use cache: remote"`
|
|
774
|
+
* function. They never hold the token; the function gets it through
|
|
775
|
+
* `bsb.cached({ scope: "remote", key })`, from a handoff only the verified
|
|
776
|
+
* caller's request filled.
|
|
777
|
+
*/
|
|
778
|
+
interface RemoteCacheKey {
|
|
779
|
+
readonly userId: string | null;
|
|
780
|
+
readonly sessionId: string | null;
|
|
781
|
+
readonly tenant: string | null;
|
|
782
|
+
readonly authzVersion: number | null;
|
|
783
|
+
/** The `{ key }` share's value. */
|
|
784
|
+
readonly shared: string | null;
|
|
785
|
+
/** The support session the caller acts in. */
|
|
786
|
+
readonly support: string | null;
|
|
787
|
+
}
|
|
788
|
+
interface RemoteOptions<C = unknown, A extends readonly unknown[] = readonly unknown[]> {
|
|
789
|
+
/** Defaults to `"session"`. */
|
|
790
|
+
readonly share?: CacheShare<C>;
|
|
680
791
|
/**
|
|
681
|
-
* The active tenant, as for `bsb.context({
|
|
682
|
-
*
|
|
683
|
-
* argument and pass it through; never read it from anywhere else.
|
|
792
|
+
* The active tenant from the function's arguments, as for `bsb.context({
|
|
793
|
+
* tenant })`.
|
|
684
794
|
*/
|
|
685
|
-
readonly tenant?: string;
|
|
795
|
+
readonly tenant?: (...args: A) => string | undefined;
|
|
796
|
+
}
|
|
797
|
+
interface CachedEntryOptions<T extends string = string> {
|
|
686
798
|
/**
|
|
687
|
-
* `cacheLife` for the entry.
|
|
688
|
-
*
|
|
689
|
-
* goes stale with the snapshot too.
|
|
799
|
+
* `cacheLife` for the entry. Pass a permission snapshot's lifetime as `stale`
|
|
800
|
+
* so the entry goes stale with the snapshot too.
|
|
690
801
|
*/
|
|
691
|
-
readonly life?:
|
|
692
|
-
readonly stale?: number;
|
|
693
|
-
readonly revalidate?: number;
|
|
694
|
-
readonly expire?: number;
|
|
695
|
-
};
|
|
802
|
+
readonly life?: CachedLife;
|
|
696
803
|
/** More tags for the entry, e.g. `snapshotTag(sub)` or `organization:<id>`. */
|
|
697
804
|
readonly tags?: readonly string[];
|
|
698
805
|
/**
|
|
@@ -704,6 +811,71 @@ interface CachedOptions<T extends string = string> extends ScopeOptions {
|
|
|
704
811
|
/** With `tables`, also tags the row `bsb:<first table>:<id>`. */
|
|
705
812
|
readonly id?: string | number;
|
|
706
813
|
}
|
|
814
|
+
interface PrivateCachedOptions<T extends string = string> extends ScopeOptions, CachedEntryOptions<T> {
|
|
815
|
+
/** Defaults to `"private"`. */
|
|
816
|
+
readonly scope?: "private";
|
|
817
|
+
/**
|
|
818
|
+
* The active tenant, as for `bsb.context({ tenant })`. Next.js keys the
|
|
819
|
+
* private cache on your function's arguments, so take the tenant as an
|
|
820
|
+
* argument and pass it through; never read it from anywhere else.
|
|
821
|
+
*/
|
|
822
|
+
readonly tenant?: string;
|
|
823
|
+
}
|
|
824
|
+
interface RemoteCachedOptions<T extends string = string> extends CachedEntryOptions<T> {
|
|
825
|
+
readonly scope: "remote";
|
|
826
|
+
/** The key `bsb.remote()` passed to the function. */
|
|
827
|
+
readonly key: RemoteCacheKey;
|
|
828
|
+
}
|
|
829
|
+
type CachedOptions<T extends string = string> = PrivateCachedOptions<T> | RemoteCachedOptions<T>;
|
|
830
|
+
type BootstrapOptions<T extends string = string> = CachedOptions<T> & {
|
|
831
|
+
/**
|
|
832
|
+
* The name in `blocks.sessions.options.bootstrap`; the call runs
|
|
833
|
+
* `bootstrap_<rpc>` in the sessions schema (its API schema when there is
|
|
834
|
+
* one).
|
|
835
|
+
*/
|
|
836
|
+
readonly rpc: string;
|
|
837
|
+
/** Passed to the app's function as its one `jsonb` argument. */
|
|
838
|
+
readonly args?: Readonly<Record<string, unknown>>;
|
|
839
|
+
/**
|
|
840
|
+
* The schema to call. Defaults to `NextOptions.bootstrapSchema`, then the
|
|
841
|
+
* schema `gen` records for the sessions block, else `better_supabase`.
|
|
842
|
+
*/
|
|
843
|
+
readonly schema?: string;
|
|
844
|
+
/**
|
|
845
|
+
* Where to send the caller when `session_active()` is false, with
|
|
846
|
+
* `?reason=session_not_found`. Without it the result has `sessionActive:
|
|
847
|
+
* false`, and the entry isn't kept.
|
|
848
|
+
*/
|
|
849
|
+
readonly redirect?: string;
|
|
850
|
+
};
|
|
851
|
+
/** What `bsb.bootstrap()` returns: plain data, safe across a cache boundary. */
|
|
852
|
+
interface Bootstrap<C = unknown, P = unknown, T = unknown> {
|
|
853
|
+
readonly session: AuthSession<C, P>;
|
|
854
|
+
readonly tenant: string | null;
|
|
855
|
+
readonly authzVersion: number | null;
|
|
856
|
+
readonly sessionActive: boolean;
|
|
857
|
+
readonly data: T | null;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* What `bsb.getAccess()` returns: one context and its checks, bound to one
|
|
861
|
+
* version.
|
|
862
|
+
*/
|
|
863
|
+
interface Access<Ctx, C = unknown, P = unknown, Ref = string> {
|
|
864
|
+
readonly context: Ctx;
|
|
865
|
+
readonly session: AuthSession<C, P>;
|
|
866
|
+
readonly tenant: string | null;
|
|
867
|
+
readonly authzVersion: number | null;
|
|
868
|
+
/** Whether the caller holds `permission` in the tenant; `false` signed out. */
|
|
869
|
+
can(permission: Ref): Promise<boolean>;
|
|
870
|
+
}
|
|
871
|
+
interface NextRootParams {
|
|
872
|
+
/** `locale` from `next/root-params`. */
|
|
873
|
+
readonly locale?: () => Promise<string | undefined>;
|
|
874
|
+
/** `brand` from `next/root-params`. */
|
|
875
|
+
readonly brand?: () => Promise<string | undefined>;
|
|
876
|
+
/** `tenant` from `next/root-params`; `NextOptions.tenant` falls back to it. */
|
|
877
|
+
readonly tenant?: () => Promise<string | undefined>;
|
|
878
|
+
}
|
|
707
879
|
type CachedContext<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, B = unknown> = ServerContext<M, F, E, C, P, B> & {
|
|
708
880
|
readonly session: AuthSession<C, P>;
|
|
709
881
|
};
|
|
@@ -752,16 +924,18 @@ export declare function createNext<M extends AnyModels, D, F extends AnyFunction
|
|
|
752
924
|
readonly authorizer?: A;
|
|
753
925
|
readonly versions?: V;
|
|
754
926
|
}): BetterNext<M, F, E, C, P, PermissionRef<A>, B, V>;
|
|
755
|
-
/** The tag `bsb.cached()` adds to entries rendered in a support session. */
|
|
756
|
-
export declare function supportTag(sessionId: string): string;
|
|
757
927
|
/**
|
|
758
|
-
*
|
|
759
|
-
*
|
|
760
|
-
*
|
|
761
|
-
*
|
|
762
|
-
*
|
|
928
|
+
* Where to send the user after signing in: the `next` value of the search
|
|
929
|
+
* params (a `URLSearchParams`, a page's `searchParams` object or a request)
|
|
930
|
+
* when it is a same-origin path, else `fallback`.
|
|
931
|
+
*
|
|
932
|
+
* ```ts
|
|
933
|
+
* redirect(postAuthPath(await searchParams, "/dashboard"));
|
|
934
|
+
* ```
|
|
763
935
|
*/
|
|
764
|
-
export declare function
|
|
936
|
+
export declare function postAuthPath(source: Request | URLSearchParams | Readonly<Record<string, string | readonly string[] | undefined>>, fallback: string): string;
|
|
937
|
+
/** The tag `bsb.cached()` adds to entries rendered in a support session. */
|
|
938
|
+
export declare function supportTag(sessionId: string): string;
|
|
765
939
|
/** The tag `bsb.cached()` puts on a user's entries. */
|
|
766
940
|
export declare function sessionTag(userId: string): string;
|
|
767
941
|
/**
|
|
@@ -797,12 +971,13 @@ export declare function invalidateBinding(subject: RecordRef, binding: string, o
|
|
|
797
971
|
}): void;
|
|
798
972
|
/** Response header with the URL of the request's totals on `bsb.debugRoute()`. */
|
|
799
973
|
export declare const STATS_URL_HEADER = "x-bsb-stats";
|
|
800
|
-
export declare function shouldCheckSession(request: NextRequest, options?: VerifySessionOptions): boolean;
|
|
801
974
|
/**
|
|
802
|
-
*
|
|
803
|
-
*
|
|
975
|
+
* Whether the proxy asks Auth if the session still exists: top-level document
|
|
976
|
+
* loads (`sec-fetch-dest: document`) on `options.paths`, else on every path.
|
|
977
|
+
* Next.js strips its router headers before the proxy runs, so client
|
|
978
|
+
* navigations and prefetches are told apart by the browser's own headers.
|
|
804
979
|
*/
|
|
805
|
-
export declare function
|
|
980
|
+
export declare function shouldCheckSession(request: NextRequest, options?: VerifySessionOptions): boolean;
|
|
806
981
|
/**
|
|
807
982
|
* A `proxy` `protect` that keeps signed-in users below `level` out of the
|
|
808
983
|
* matched paths. The JWT carries no factor list, so this also sends users
|
|
@@ -819,4 +994,81 @@ export declare function shouldRefresh(request: Request): boolean;
|
|
|
819
994
|
* ```
|
|
820
995
|
*/
|
|
821
996
|
export declare function requireAal(level: Aal, options?: RequireAalOptions): (auth: AuthState, request: NextRequest) => Response | undefined;
|
|
822
|
-
|
|
997
|
+
/** The second argument Next.js passes to a route handler. */
|
|
998
|
+
interface NextRouteContext<Params = Record<string, string | string[]>> {
|
|
999
|
+
readonly params: Promise<Params>;
|
|
1000
|
+
}
|
|
1001
|
+
/** A Next.js route handler (`export const GET = ...`). */
|
|
1002
|
+
type NextRouteHandler<Params = Record<string, string | string[]>> = (request: Request, context: NextRouteContext<Params>) => Promise<Response>;
|
|
1003
|
+
interface ToNextRouteOptions {
|
|
1004
|
+
/** The host's env object for `getEnv`, read per request. */
|
|
1005
|
+
readonly env?: (request: Request) => unknown;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Runs an entry array around a Next.js route handler. The handler gets the
|
|
1009
|
+
* entries' contributions as `ctx` and may return a `Response` or a value (sent
|
|
1010
|
+
* as JSON, `undefined` as 204). Response-phase entries (`withCors`, refreshed
|
|
1011
|
+
* cookies) see the handler's response.
|
|
1012
|
+
*
|
|
1013
|
+
* ```ts
|
|
1014
|
+
* // src/app/api/notes/route.ts
|
|
1015
|
+
* export const GET = toNextRoute(
|
|
1016
|
+
* [withCors(cors), withRequiredClaims(), withSupabaseClient()],
|
|
1017
|
+
* async (request, ctx) =>
|
|
1018
|
+
* (await ctx.supabase.from("notes").select()).data,
|
|
1019
|
+
* );
|
|
1020
|
+
* ```
|
|
1021
|
+
*/
|
|
1022
|
+
export declare function toNextRoute<const Entries extends readonly AnyEntry[], Params = Record<string, string | string[]>>(entries: Entries & Validated<Entries>, handler: (request: Request, ctx: Contributions<Entries>, context: NextRouteContext<Params>) => unknown, options?: ToNextRouteOptions): NextRouteHandler<Params>;
|
|
1023
|
+
/**
|
|
1024
|
+
* The attributes of a `Set-Cookie` header, as Next.js `cookies().set` takes
|
|
1025
|
+
* them.
|
|
1026
|
+
*/
|
|
1027
|
+
interface NextCookieWrite {
|
|
1028
|
+
readonly name: string;
|
|
1029
|
+
readonly value: string;
|
|
1030
|
+
readonly path?: string;
|
|
1031
|
+
readonly domain?: string;
|
|
1032
|
+
readonly maxAge?: number;
|
|
1033
|
+
readonly expires?: Date;
|
|
1034
|
+
readonly httpOnly?: boolean;
|
|
1035
|
+
readonly secure?: boolean;
|
|
1036
|
+
readonly sameSite?: "lax" | "strict" | "none";
|
|
1037
|
+
readonly partitioned?: boolean;
|
|
1038
|
+
}
|
|
1039
|
+
/**
|
|
1040
|
+
* Thrown by an action whose entries answered before the action ran, such as
|
|
1041
|
+
* `withRequiredClaims` with a 401 for a caller without a session.
|
|
1042
|
+
*/
|
|
1043
|
+
export declare class NextActionRejected extends Error {
|
|
1044
|
+
readonly status: number;
|
|
1045
|
+
readonly response: Response;
|
|
1046
|
+
constructor(response: Response);
|
|
1047
|
+
}
|
|
1048
|
+
interface ToNextActionOptions {
|
|
1049
|
+
/** The host's env object for `getEnv`, read per call. */
|
|
1050
|
+
readonly env?: (request: Request) => unknown;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* One `Set-Cookie` header as a cookie write, or `undefined` when it has no
|
|
1054
|
+
* name.
|
|
1055
|
+
*/
|
|
1056
|
+
export declare function parseSetCookie(header: string): NextCookieWrite | undefined;
|
|
1057
|
+
/**
|
|
1058
|
+
* Runs an entry array around a Server Action. The entries see a request built
|
|
1059
|
+
* from `headers()` (the session cookie included), cookies they set go through
|
|
1060
|
+
* `cookies().set`, and the action gets their contributions as `ctx`. When an
|
|
1061
|
+
* entry answers first (a 401 from `withRequiredClaims`), the call throws
|
|
1062
|
+
* `NextActionRejected` with that response.
|
|
1063
|
+
*
|
|
1064
|
+
* ```ts
|
|
1065
|
+
* "use server";
|
|
1066
|
+
* export const addNote = toNextAction(
|
|
1067
|
+
* [withRequiredClaims(), withSupabaseClient()],
|
|
1068
|
+
* async (ctx, body: string) =>
|
|
1069
|
+
* ctx.supabase.from("notes").insert({ body }),
|
|
1070
|
+
* );
|
|
1071
|
+
* ```
|
|
1072
|
+
*/
|
|
1073
|
+
export declare function toNextAction<const Entries extends readonly AnyEntry[], Args extends unknown[], Result>(entries: Entries & Validated<Entries>, action: (ctx: Contributions<Entries>, ...args: Args) => Promise<Result>, options?: ToNextActionOptions): (...args: Args) => Promise<Result>;
|
|
1074
|
+
export { type Aal, type Access, type ActionArgs, type ActionOptions, type ActionResult, type ActiveSupport, type AmrEntry, type AuthKind, type AuthSession, type AuthorizeOptions, type AuthorizeUrlParams, type AuthorizedContext, type BetterNext, type BlockActionArgs, type Bootstrap, type BootstrapOptions, type CacheScope, type CacheShare, type CachedContext, type CachedLife, type CachedOptions, type DbBudget, type DbStats, type EmailOtpType, type EmailRedirect, type ExchangeCodeParams, type ExistingAccount, type GuardOptions, type Impersonator, type LiveCountSeed, type MembershipClaim, type MfaVerification, type NextCacheOptions, type NextCookieWrite, type NextDebugOptions, type NextOptions, type NextResourceHandler, type NextResourceRoutes, type NextResourcesOptions, type NextRootParams, type NextRouteContext, type NextRouteHandler, type PermissionsOfOptions, type PrivateCachedOptions, type ProxyOptions, type RecordListServer, type RecordListView, type RecordLoadOptions, type RecordServer, type RecordServerActions, type RecordServerContext, type RecordTagOptions, type RecordTimelineOptions, type RecordView, type RemoteCacheKey, type RemoteCachedOptions, type RemoteOptions, type RequireAalOptions, type RequireOptions, type ResendParams, type ResetPasswordParams, type ResourceAction, type ResourceContext, type ResourceHooks, type ResourceLoaderContext, type ResourceMap, type ResourceRouteOptions, type RouteOptions, type ScopeOptions, type SessionSnapshot, type SignInCredentials, type SignInOptions, type SignInWithOAuthParams, type SignInWithOtpParams, type SignOutParams, type SignOutScope, type SignUpParams, type SignedIn, type SupportOptions, type SupportPolicy, type SupportSessions, type SupportStartRequest, type SupportStarted, type SupportView, type TagOptions, type ToNextActionOptions, type ToNextRouteOptions, type VerifyOtpParams, type VerifySessionOptions, authzVersionOf, defineAction, isSessionSnapshot, issuedAtOf, permissionsOf, safeRedirectPath, sessionCacheKey, supportOf, supportSessions, tagFor, tenantOf, toSession };
|