better-supabase 0.32.0 → 0.33.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/README.md +11 -10
- package/codemods/0.32.json +31 -0
- package/dist/{adapter-CPPN80mx.js → adapter-CWzyKepA.js} +45 -16
- package/dist/{agents-BEiBtYmh.d.ts → agents-DXiOPB3V.d.ts} +4 -4
- package/dist/{ai-cache-FMYzw7lW.d.ts → ai-cache-CLiAXCPH.d.ts} +4 -4
- package/dist/{ai-chat-B_P--Ie2.d.ts → ai-chat-DlcBdOhJ.d.ts} +4 -4
- package/dist/{ai-schedules-D_q1iclL.d.ts → ai-schedules-Drx2KRTn.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/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/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +3 -3
- package/dist/{api-keys-u2sXB-CZ.d.ts → api-keys-DbIbkGxx.d.ts} +4 -4
- package/dist/{api-CwzVbbw4.d.ts → api-myq2e9t5.d.ts} +5 -6
- package/dist/{app-tables-DomvYx5b.d.ts → app-tables-IrglDJCs.d.ts} +1 -1
- package/dist/{approvals-idpuhILk.d.ts → approvals-DZoGtNFv.d.ts} +5 -5
- package/dist/{assistant-CMKsaeJd.d.ts → assistant-BEbRPjhn.d.ts} +2 -2
- package/dist/astro/index.d.ts +7 -8
- package/dist/astro/index.js +5 -5
- package/dist/{auth-module-CVo86UKh.js → auth-module-CqXdm8qD.js} +1 -1
- package/dist/{authorization-CYu_UKX4.d.ts → authorization-BlmDNI2b.d.ts} +12 -1
- package/dist/{authorization-hooks-CldgvzBZ.d.ts → authorization-hooks-CxwsRnfV.d.ts} +2 -2
- package/dist/{authorizer-D6po_XZA.js → authorizer-BtIPDO-c.js} +33 -10
- package/dist/better-result/index.d.ts +3 -3
- package/dist/{bind-8LYVJE5W.d.ts → bind-DP-KLgYI.d.ts} +7 -7
- package/dist/{block-env-BsLgZL2l.d.ts → block-env-CJ38ZSTP.d.ts} +4 -4
- package/dist/{block-helpers-JxiD1iw4.d.ts → block-helpers-disoUWCp.d.ts} +1 -1
- package/dist/{block-hooks-CJP5kGEa.d.ts → block-hooks-DrA_d1dJ.d.ts} +2 -2
- package/dist/{block-subjects-SyJwfgrX.d.ts → block-subjects-Br2MQNFn.d.ts} +1 -1
- package/dist/block-tables-CQTU71zn.d.ts +34 -0
- package/dist/{block-transport-Bbf1ZZre.d.ts → block-transport-BEtC_Kis.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-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 +4 -108
- package/dist/blocks/approvals/index.d.ts +4 -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/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/bookings/index.d.ts +4 -4
- package/dist/blocks/bulk/index.d.ts +4 -4
- package/dist/blocks/calendar/index.d.ts +5 -5
- package/dist/blocks/catalog/index.d.ts +6 -6
- 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/dispatch/index.d.ts +6 -6
- package/dist/blocks/documents/index.d.ts +4 -4
- 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 +6 -6
- package/dist/blocks/entitlements/index.d.ts +6 -6
- package/dist/blocks/entitlements/index.js +2 -23
- package/dist/blocks/expenses/index.d.ts +5 -5
- package/dist/blocks/field-history/index.d.ts +4 -4
- package/dist/blocks/flags/index.d.ts +5 -5
- package/dist/blocks/flags/index.js +1 -1
- 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 +10 -10
- 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 +8 -8
- package/dist/blocks/knowledge/index.d.ts +3 -3
- 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 +5 -5
- 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/memberships/index.js +1 -1
- package/dist/blocks/memory/index.d.ts +4 -4
- 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/numbering/index.d.ts +4 -4
- package/dist/blocks/oauth-server/index.d.ts +5 -5
- 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/organizations/index.js +1 -1
- package/dist/blocks/outbox/index.d.ts +4 -4
- package/dist/blocks/passes/index.d.ts +8 -8
- package/dist/blocks/permissions/index.d.ts +12 -7
- package/dist/blocks/permissions/index.js +6 -6
- 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 +8 -8
- 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 +8 -8
- 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/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/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/signatures/index.d.ts +5 -5
- package/dist/blocks/signing-keys/index.d.ts +4 -4
- 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 +5 -5
- 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/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/versions/index.d.ts +6 -6
- package/dist/blocks/waitlist/index.d.ts +5 -5
- package/dist/blocks/webhooks/index.d.ts +13 -13
- package/dist/blocks/workflow-editor/index.d.ts +9 -9
- package/dist/blocks/workflow-editor/index.js +2 -1
- package/dist/blocks/workflows/index.d.ts +7 -7
- package/dist/{bookings-DG443336.d.ts → bookings-Br0VXzaf.d.ts} +3 -3
- package/dist/{bucket-Clq5xINQ.d.ts → bucket-DvG66r5G.d.ts} +1 -1
- package/dist/chat-sdk/index.d.ts +6 -6
- package/dist/claim-names-BKig1LOk.js +24 -0
- package/dist/claims/index.d.ts +8 -0
- package/dist/claims/index.js +8 -0
- package/dist/{claims-DRmafYVK.js → claims-CqTr_N1n.js} +13 -5
- package/dist/cli/{add-fzRPyIED.js → add-BDLLVLI8.js} +3 -2
- package/dist/cli/add-BaOCKKt6.js +1 -0
- package/dist/cli/{add-ChoHyBhz.js → add-D2pKTbPw.js} +11 -11
- package/dist/cli/{app-table-files-C0OtdUVu.js → app-table-files-CimWi_eh.js} +3 -3
- package/dist/cli/{providers-DpfoF3VC.js → authorization-DJkkOjjG.js} +25 -93
- package/dist/cli/{backfill-Dq2XMXf9.js → backfill-B1xAsdL4.js} +3 -3
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-DVhJOzFj.js → blocks-DtZtn-R4.js} +1 -1
- package/dist/cli/{blocks-CCzp0eAH.js → blocks-rBeis04I.js} +1 -1
- package/dist/cli/{cache-CoC-1i1O.js → cache-CvBRwv02.js} +1 -1
- package/dist/cli/{codemod-pyf6HmS9.js → codemod-DYbVbJ-e.js} +5 -4
- package/dist/cli/{config-D0m2rQqk.js → config-CrwCec-B.js} +1 -1
- package/dist/cli/{config-Dyl3iX3u.js → config-DrrkMihk.js} +1 -0
- package/dist/cli/{content-mapper-ChSVT9Tq.js → content-mapper-DrhtDsAm.js} +2 -2
- package/dist/cli/{db-dFzhcozO.js → db-Diy1OebO.js} +2 -2
- package/dist/cli/{doctor-BKZsztFV.js → doctor-Dn4TzGmw.js} +59 -19
- package/dist/cli/{gen-BN_eh6rE.js → gen-BbeS0KgF.js} +14 -14
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-CaDDt8F6.js → init-C30xdMSs.js} +9 -9
- package/dist/cli/{live-KU41LMGE.js → live-Ctc8Qh9Y.js} +2 -2
- package/dist/cli/{mcp-C_m-TpLJ.js → mcp-5J0kUOtD.js} +2 -2
- package/dist/cli/{metadata-Bq4ra7zo.js → metadata-DxhUNctA.js} +3 -3
- package/dist/cli/{migrate-DHG2Qz_K.js → migrate-ockrh3UX.js} +1 -1
- package/dist/cli/{migration-safety-STVbiKhz.js → migration-safety-CLrqC0D-.js} +2 -2
- package/dist/cli/{migrations-O1QZoMiH.js → migrations-CZTg2UJM.js} +2 -2
- package/dist/cli/{module-migration-DB9ntWM-.js → module-migration-BptQzmj2.js} +2 -2
- package/dist/cli/powersync-CmsXOuui.js +1 -0
- package/dist/cli/{powersync-CN3QPF2K.js → powersync-DIvsipKr.js} +3 -3
- package/dist/cli/{print-DG7TRCi8.js → print-DdHt8xCc.js} +2 -2
- package/dist/cli/providers-k-1cEna6.js +99 -0
- package/dist/cli/{prune-workflows-DcNJUS1m.js → prune-workflows-Ddv-GfkO.js} +3 -3
- package/dist/cli/{remove-BpfYqP45.js → remove-DEEQDoc7.js} +5 -5
- package/dist/cli/{render-Q7jnLn_C.js → render-SjSVz8yK.js} +7 -4
- package/dist/cli/{run-D6K-qQIX.js → run-DdhIK7-K.js} +9 -8
- package/dist/cli/{run-9NfabanB.js → run-Ixt9mEb6.js} +29 -29
- package/dist/cli/{seed-B4H0Lco9.js → seed-BpaqqyO8.js} +2 -2
- package/dist/cli/seed-ByLneY1H.js +1 -0
- package/dist/cli/{shared-PrvYREVy.js → shared-p6sxli_5.js} +1 -1
- package/dist/cli/{snapshot-UfJsqfys.js → snapshot-Dd_8B9g-.js} +3 -3
- package/dist/cli/{source-F3YTVvFo.js → source-BYvVe_Es.js} +1 -1
- package/dist/cli/{source-args-DJMrW_jW.js → source-args-Bz5QQne2.js} +1 -1
- package/dist/cli/{spec-DsLQuJKp.js → spec-BxQgllJY.js} +2 -2
- package/dist/cli/{spec-HQOBVbEO.js → spec-liRzcZTa.js} +1 -1
- package/dist/cli/{sql-layout-CZ66pY8j.js → sql-layout-DHwiUOaD.js} +2 -2
- package/dist/cli/{sync-B12wbtFd.js → sync-CreQWj53.js} +4 -4
- package/dist/cli/{upgrade-AgUXFDo6.js → upgrade-3NQOUO1_.js} +5 -5
- package/dist/cli/{upgrade-C20z49De.js → upgrade-U7IKj45h.js} +2 -2
- package/dist/cli/{version-DEUWW8cv.js → version-mBwP-aMG.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 +1 -1
- package/dist/{client-BLor58Je.js → client-Bky2z09B.js} +1 -1
- package/dist/{cloud-event-bcaMqEbN.d.ts → cloud-event-DXWmXrus.d.ts} +1 -1
- package/dist/{compiler-CWishtY2.d.ts → compiler-qlXlokKn.d.ts} +2 -2
- package/dist/{composite-ClLWZIwX.d.ts → composite-CIxjVcL1.d.ts} +7 -7
- package/dist/{composite-BZMkWNOQ.js → composite-D2JnIiHt.js} +2 -2
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +2 -2
- package/dist/{config-BhExAhNK.js → config-Bu6pwqcO.js} +1 -1
- package/dist/{connectors-BImAu75R.d.ts → connectors-Cf2LeAuZ.d.ts} +4 -4
- package/dist/{context-DcxfrCml.d.ts → context-D7jICqdN.d.ts} +15 -3
- package/dist/contract/index.d.ts +16 -0
- package/dist/contract/index.js +0 -0
- package/dist/{controller-D_UJBaEU.d.ts → controller-DxtxeYdf.d.ts} +1 -1
- package/dist/{conversion-7U1WeLxK.d.ts → conversion-C9rndpEI.d.ts} +1 -1
- package/dist/create/index.d.ts +3 -3
- package/dist/create/index.js +1 -1
- package/dist/create/lite/index.d.ts +4 -4
- package/dist/create/lite/index.js +1 -1
- package/dist/credentials/index.d.ts +4 -4
- package/dist/{data-engine-B-D6bdyx.d.ts → data-engine-CMENsp3d.d.ts} +1 -1
- package/dist/{define-3RbqoF1S.d.ts → define-ITQA71fw.d.ts} +5 -5
- package/dist/{define-block-B_i9VPcc.d.ts → define-block-COmMkx2x.d.ts} +12 -12
- package/dist/{delegation-BRHHXERz.js → delegation-C2rLpkHO.js} +2 -7
- package/dist/{documents-6ov2gWh3.d.ts → documents-DeZw83ue.d.ts} +3 -3
- package/dist/edge/index.d.ts +13 -13
- package/dist/edge/index.js +9 -9
- package/dist/elysia/index.d.ts +1 -1
- package/dist/elysia/index.js +1 -1
- package/dist/{embeddings-K0lH--nt.d.ts → embeddings-rVR2AKVz.d.ts} +1 -1
- package/dist/{ended-CCoE7XXY.d.ts → ended-NC_ZesY4.d.ts} +2 -2
- package/dist/entitlements-Dydkg-TV.js +47 -0
- package/dist/{entitlements-XwpuBbKN.d.ts → entitlements-w04ivvAy.d.ts} +21 -3
- package/dist/{envelope-DAtaFJue.js → envelope-CapD-JtH.js} +3 -2
- package/dist/eve/index.d.ts +9 -9
- package/dist/eve/index.js +2 -2
- package/dist/{eve-Cf-QRGij.d.ts → eve-DIKjuPp5.d.ts} +2 -2
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-CfDdOwqg.d.ts → events-DVt3Z9hw.d.ts} +1 -1
- package/dist/{executor-ynEwaUZy.d.ts → executor-CFmee_nV.d.ts} +1 -1
- package/dist/{executor-CAhykadW.d.ts → executor-CHnoKOxk.d.ts} +4 -4
- package/dist/{executor-CbDX34I9.d.ts → executor-DqNRrFxx.d.ts} +1 -1
- package/dist/expo/index.d.ts +4 -4
- package/dist/expo/index.js +3 -3
- package/dist/{extension-LgaDPMJs.js → extension-Z8Pe7fXA.js} +1 -1
- package/dist/{field-errors-tQr-anYL.d.ts → field-errors-DKCaSlZw.d.ts} +10 -10
- package/dist/{fields-AKKMirg_.d.ts → fields-CAVk9dxX.d.ts} +1 -1
- package/dist/{filter-evaluate-Bhq99aEN.d.ts → filter-evaluate-Bz3Fzhz2.d.ts} +1 -1
- package/dist/{filter-query-B7A4l2xn.d.ts → filter-query-DV-x8fio.d.ts} +1 -1
- package/dist/{flags-D0npSE-5.js → flags-0EXDD3Iz.js} +1 -1
- package/dist/{flags-B5B4mkZV.d.ts → flags-6emyAXly.d.ts} +2 -2
- package/dist/flags-sdk/index.d.ts +2 -2
- package/dist/flags-sdk/index.js +1 -1
- package/dist/{framework-CyDn_SXR.d.ts → framework-BFlaPuvv.d.ts} +8 -7
- package/dist/{framework-B1h-uquj.js → framework-ChzJYkJW.js} +3 -2
- package/dist/{gateway-Cg_MgGen.d.ts → gateway-DaekJ_Me.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 +14 -13
- package/dist/hono/index.js +9 -8
- package/dist/{inbox-BmSA9K01.d.ts → inbox-DavCzW7b.d.ts} +5 -5
- package/dist/{index-D2BGCjIz.d.ts → index-BIAtapnD.d.ts} +5 -5
- package/dist/{index-B2871MHr.d.ts → index-BZCmy767.d.ts} +5 -5
- package/dist/{index-B5_J-MaK.d.ts → index-BdC2IqkU.d.ts} +5 -5
- package/dist/{index-xCpjvDVm.d.ts → index-BgkHbf9C.d.ts} +14 -14
- package/dist/{index-CRrBZtKm.d.ts → index-BvcMQYL-.d.ts} +1 -1
- package/dist/index-CbUXFzQV.d.ts +107 -0
- package/dist/index-CiE37wKX.d.ts +289 -0
- package/dist/{index-lazpPVr0.d.ts → index-D18su_r5.d.ts} +3 -3
- package/dist/{index-D66_dYVi.d.ts → index-DU0UwWvL.d.ts} +4 -4
- package/dist/{index-CTpEQvIv.d.ts → index-Dvpu22CJ.d.ts} +1 -1
- package/dist/index-IKfbX_39.d.ts +23 -0
- package/dist/{index-DzBFdI9I.d.ts → index-M1izbwbN.d.ts} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/{kit-CVZDd1X9.js → kit-9pZP5iLU.js} +42 -11
- package/dist/{kit-CJKo0soh.d.ts → kit-OgFOW9rX.d.ts} +4 -4
- package/dist/{knowledge-BUwbpS8I.d.ts → knowledge-BBC2sfAY.d.ts} +5 -5
- package/dist/lint/index.d.ts +1 -1
- package/dist/lint/index.js +1 -1
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-CZ-K5aHX.d.ts → list-query-C7V8kUaD.d.ts} +3 -3
- package/dist/mapper/bin.js +6 -6
- package/dist/mcp/index.d.ts +4 -289
- package/dist/mcp/index.js +52 -18
- package/dist/mcp/sdk/index.d.ts +6 -6
- package/dist/mcp/sdk/index.js +2 -2
- package/dist/{messaging-DMhtGxVv.d.ts → messaging-D5z2TR37.d.ts} +4 -4
- 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 +28 -26
- package/dist/next/index.js +11 -10
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/{operations-D51ONRvR.d.ts → operations-CsCwruKT.d.ts} +1 -1
- package/dist/orpc/index.d.ts +8 -8
- package/dist/orpc/index.js +8 -8
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-C44Aa94K.d.ts → outbox-7zgh-7nw.d.ts} +4 -4
- package/dist/{permissions-B9aZZ9LR.js → permissions-BDt27oYF.js} +19 -14
- package/dist/permissions-BP593xxk.d.ts +44 -0
- package/dist/{pool-Bji4lnQM.d.ts → pool-D-4HyhuW.d.ts} +3 -3
- package/dist/{ports-zFqRNXVJ.d.ts → ports-BVLhLUvR.d.ts} +1 -1
- package/dist/{ports-C-hdygkZ.js → ports-CmEXVqhg.js} +1 -1
- package/dist/postgres/index.d.ts +4 -4
- package/dist/{postgrest-2WjRrtmX.d.ts → postgrest-DZtM2nIS.d.ts} +1 -1
- package/dist/powersync/index.d.ts +6 -6
- package/dist/preset/index.d.ts +3 -3
- package/dist/{project-oNHntJ6T.js → project-D4ArwcS5.js} +2 -2
- package/dist/{provider-CH8McX3b.d.ts → provider-BI0KC4u5.d.ts} +1 -1
- package/dist/{push-token-a3Ev1U3L.d.ts → push-token-B0j171on.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +8 -8
- 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 +8 -8
- package/dist/react/server.js +3 -3
- package/dist/react/session.d.ts +2 -2
- package/dist/{react-C40oomj7.js → react-COIov1yC.js} +1 -1
- package/dist/react-router/index.d.ts +6 -7
- package/dist/react-router/index.js +6 -6
- package/dist/realtime/index.d.ts +6 -6
- package/dist/realtime/index.js +1 -1
- package/dist/{record-form-DCIui2Ol.d.ts → record-form-DU2EoVsv.d.ts} +1 -1
- package/dist/{recordings-Dlpq8jUG.d.ts → recordings-D69Va7gP.d.ts} +1 -1
- package/dist/records/index.d.ts +9 -9
- package/dist/{refresh-BK9epzeC.d.ts → refresh-BtbC2rZe.d.ts} +1 -1
- package/dist/{refusal-DhX7Xpfp.js → refusal-5c6UMpUP.js} +3 -3
- package/dist/{refusal-DEuFVi4s.d.ts → refusal-CGi-0Q18.d.ts} +3 -3
- package/dist/{resolve-DVOtYTAc.d.ts → resolve--LfVoOMg.d.ts} +1 -1
- package/dist/{resource-Cn6Bn-_o.js → resource-BbWk4hoP.js} +59 -15
- package/dist/{resource-BfsTJnxZ.d.ts → resource-DWllVW8k.d.ts} +6 -1
- package/dist/{resource-execute-DQRS7PFt.d.ts → resource-execute-DUBYKTYU.d.ts} +2 -2
- package/dist/{resource-types-DF6KDAZM.d.ts → resource-types-RgaljPs0.d.ts} +4 -4
- package/dist/{resources-CeY53FiJ.d.ts → resources-Bki1J4jy.d.ts} +2 -2
- package/dist/{resources-B0Vy7_wv.js → resources-DYSx9NYM.js} +1 -1
- package/dist/{respond-CkwkvFdZ.d.ts → respond-BYOV7KZp.d.ts} +1 -1
- package/dist/{respond-C2qvP1wv.js → respond-DLH4tD2d.js} +1 -1
- package/dist/{sales-lines-Bde9cV5F.d.ts → sales-lines-DuNVoKHA.d.ts} +1 -1
- package/dist/{sandboxes-DDWuD9fh.d.ts → sandboxes-B2hBoBvJ.d.ts} +1 -1
- package/dist/{scores-Bql-ABl0.d.ts → scores-FAORS4qU.d.ts} +5 -5
- package/dist/server/index.d.ts +31 -28
- package/dist/server/index.js +15 -11
- package/dist/{server-types-C3p3jUqr.d.ts → server-types-C2hlvhP4.d.ts} +39 -101
- package/dist/{session-BOch2y2z.d.ts → session-B4VasaAA.d.ts} +6 -6
- package/dist/{session-status-DRBRnZHx.d.ts → session-status-D8CBxCqv.d.ts} +2 -2
- package/dist/{sign-in-BmigClRh.js → sign-in-BMm1xhKq.js} +1 -1
- package/dist/{sign-in-Dxyi4aKu.d.ts → sign-in-CX1a5i2P.d.ts} +3 -34
- package/dist/{sign-in-CXOg2Dwb.js → sign-in-CxdoTEp5.js} +2 -2
- package/dist/{signers-Cz5ZhTHH.d.ts → signers-6ih6i9aq.d.ts} +4 -4
- package/dist/{signing-keys-DS-rIVzz.d.ts → signing-keys-De09WNJ3.d.ts} +2 -2
- package/dist/snapshot-BGsJw9xn.d.ts +83 -0
- package/dist/{view-YnesSUEa.js → snapshot-CVMSyTHH.js} +3 -109
- package/dist/solid/index.d.ts +10 -10
- package/dist/solid/index.js +1 -1
- package/dist/solid-start/index.d.ts +6 -7
- package/dist/solid-start/index.js +5 -5
- package/dist/spec/index.d.ts +2 -2
- package/dist/sql/index.d.ts +6 -5
- package/dist/sql/index.js +2 -2
- package/dist/{sql-BPV51R3A.js → sql-DiUP7fKX.js} +162 -77
- package/dist/sqlite/index.d.ts +3 -3
- package/dist/{sso-BEvNf1oW.d.ts → sso-CuzAjsc8.d.ts} +3 -3
- package/dist/ssr/index.d.ts +5 -5
- package/dist/ssr/index.js +1 -1
- 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-DWkVSbFr.d.ts → subject-readers-BlD8tALG.d.ts} +2 -2
- package/dist/{subjects-vci6Wufh.d.ts → subjects-Bv2dPflD.d.ts} +3 -3
- package/dist/{support-rZbdU35s.d.ts → support-DxYI6sDM.d.ts} +4 -4
- package/dist/{support-view-WY4Y-A40.d.ts → support-view-DSmCett7.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 -8
- package/dist/sveltekit/index.js +5 -5
- package/dist/{tags-BVLELhOf.d.ts → tags--k2fbPfO.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +3 -3
- package/dist/tanstack-start/index.d.ts +6 -7
- package/dist/tanstack-start/index.js +5 -5
- package/dist/{tenant-RKvGBB-U.d.ts → tenant-B3IIq8Eq.d.ts} +4 -5
- package/dist/tenant-Beqd7TTq.js +48 -0
- package/dist/testing/index.d.ts +71 -32
- package/dist/testing/index.js +136 -16
- package/dist/{timeline-Ck8OFuAN.d.ts → timeline-Bq658xsi.d.ts} +5 -5
- package/dist/{topic-Dr8VYE4D.d.ts → topic-D2MyBeaI.d.ts} +5 -5
- package/dist/{topic-BBBCVLyS.js → topic-k17VvXRj.js} +1 -1
- package/dist/{types-Pv5WPfIC.d.ts → types-BBqP9H6w.d.ts} +4 -4
- package/dist/{types-CCmW3MqI.d.ts → types-BFEKRmEK.d.ts} +2 -2
- package/dist/{types-WZUVlTXs.d.ts → types-BkYEUWdz.d.ts} +189 -1
- package/dist/{types-D9FY9qSJ.d.ts → types-C8UyJOPJ.d.ts} +3 -3
- package/dist/{types-CvlJNzX4.d.ts → types-DCoqai8o.d.ts} +4 -4
- package/dist/{types-DWZubmwk.d.ts → types-Dh2OGEW5.d.ts} +10 -10
- package/dist/{types-BiedVwz_.d.ts → types-TH3zlMiM.d.ts} +1 -1
- package/dist/{types-CL-z0A4K.d.ts → types-d0JBRTAg.d.ts} +7 -7
- package/dist/{undo-BdoEJ6Ot.d.ts → undo-22ofP6Zp.d.ts} +2 -2
- package/dist/{usage-D27Uw426.d.ts → usage-CNCT6_3D.d.ts} +4 -4
- package/dist/{vault-Dx0LaNMX.d.ts → vault-yGQD5Rdl.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-DnL0Fgu0.d.ts → verify-BQu3eBNW.d.ts} +2 -2
- package/dist/view-BfEqjZJ_.js +117 -0
- package/dist/{view-DmEZA1fL.d.ts → view-Cy2XxYp1.d.ts} +14 -2
- package/dist/vue/index.d.ts +10 -10
- package/dist/vue/index.js +1 -1
- package/dist/{watch-topic-BB7T05sc.d.ts → watch-topic-q6krNw0T.d.ts} +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +3 -3
- package/dist/workflow-sdk/builder/index.js +1 -1
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/dist/workflow-sdk/index.js +1 -1
- package/dist/workflow-sdk/world/index.d.ts +1 -1
- package/dist/{workflow-sdk-D5zRSwxh.js → workflow-sdk-q2jnEaAJ.js} +2 -2
- package/dist/{workflow-sdk-DMpVSMB7.d.ts → workflow-sdk-yIkECybp.d.ts} +3 -3
- package/dist/{workflows-DKTw2PZo.d.ts → workflows-BljkWRxE.d.ts} +3 -3
- package/dist/yjs/index.d.ts +2 -2
- package/dist/yjs/index.js +1 -1
- package/package.json +12 -1
- package/schemas/config-v1.json +3 -0
- package/schemas/doctor-report-v1.json +1 -0
- package/dist/authorizer-AswD5q6g.d.ts +0 -116
- package/dist/cli/add-DlYL-1mF.js +0 -1
- package/dist/cli/powersync-DfeGl5N1.js +0 -1
- package/dist/cli/seed-BIB6-WPa.js +0 -1
- package/dist/tenant-BR7fvPj7.js +0 -26
package/dist/mcp/index.js
CHANGED
|
@@ -8,12 +8,12 @@ import { r as toDraft07, t as buildJsonSchema } from "../json-schema-D9eVL_xi.js
|
|
|
8
8
|
import { r as operationPermission, t as OPERATION_PREFIXES } from "../operations-BNFbWv1t.js";
|
|
9
9
|
import { r as pageSchema, t as pageInputSchema } from "../resource-schemas-Bq0g2RCQ.js";
|
|
10
10
|
import { n as jsonResponse, t as jsonReplacer } from "../json-O5vFw243.js";
|
|
11
|
-
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-
|
|
12
|
-
import {
|
|
13
|
-
import { i as guard, n as defaultExpose, s as settle } from "../respond-
|
|
11
|
+
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-CWzyKepA.js";
|
|
12
|
+
import { a as isRequestMemo, o as outcomesOf, r as checkPermission } from "../authorizer-BtIPDO-c.js";
|
|
13
|
+
import { i as guard, n as defaultExpose, s as settle } from "../respond-DLH4tD2d.js";
|
|
14
14
|
import { t as boundedTtlCache } from "../ttl-cache-C5S0L2wx.js";
|
|
15
|
-
import { t as defineResource } from "../resource-
|
|
16
|
-
import { r as hasRole } from "../kit-
|
|
15
|
+
import { t as defineResource } from "../resource-BbWk4hoP.js";
|
|
16
|
+
import { r as hasRole } from "../kit-9pZP5iLU.js";
|
|
17
17
|
import { t as withExtra } from "../extra-Dz9n5y1s.js";
|
|
18
18
|
import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "../http-BRUI3qim.js";
|
|
19
19
|
import { resourceMetadataResponse, unauthorizedResponse } from "@supabase/server/oauth-protected-resource";
|
|
@@ -108,6 +108,17 @@ function missingRole(auth, required) {
|
|
|
108
108
|
function toolPermission(operations, name, declared, operation = `${OPERATION_PREFIXES.mcpTool}${name}`) {
|
|
109
109
|
return operationPermission(operations, operation, typeof declared === "string" ? declared : void 0) ?? declared;
|
|
110
110
|
}
|
|
111
|
+
/** A tool's purpose: `readOnlyHint` makes it a read. */
|
|
112
|
+
function toolPurpose(info) {
|
|
113
|
+
return {
|
|
114
|
+
operation: "tool",
|
|
115
|
+
intent: info?.annotations?.readOnlyHint === true ? "read" : "write"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
/** The context's memo as the authorizer runtime, when it has one. */
|
|
119
|
+
function runtimeOf(context) {
|
|
120
|
+
return isRequestMemo(context?.memo) ? { memo: context.memo } : void 0;
|
|
121
|
+
}
|
|
111
122
|
/** The context of a `tools/call` or `tools/list` request, if the client has one. */
|
|
112
123
|
function contextOf(db) {
|
|
113
124
|
if (typeof db !== "object" || db === null || !("$context" in db)) return;
|
|
@@ -120,20 +131,28 @@ function contextOf(db) {
|
|
|
120
131
|
async function checkTool(authorizer, tool, args, db) {
|
|
121
132
|
if (tool.permission === void 0) return ok(void 0);
|
|
122
133
|
const properties = typeof args === "object" && args !== null && !Array.isArray(args) ? args : void 0;
|
|
134
|
+
const context = contextOf(db);
|
|
135
|
+
const runtime = runtimeOf(context);
|
|
123
136
|
return checkPermission({
|
|
124
137
|
authorizer,
|
|
125
138
|
permission: tool.permission,
|
|
126
139
|
resource: {
|
|
127
140
|
type: "mcp_tool",
|
|
128
141
|
id: tool.info.name,
|
|
129
|
-
...properties ? {
|
|
142
|
+
...properties ? {
|
|
143
|
+
properties,
|
|
144
|
+
source: "input"
|
|
145
|
+
} : {}
|
|
130
146
|
},
|
|
131
|
-
context
|
|
147
|
+
context,
|
|
148
|
+
...toolPurpose(tool.info),
|
|
149
|
+
...runtime ? { runtime } : {}
|
|
132
150
|
});
|
|
133
151
|
}
|
|
134
152
|
/**
|
|
135
153
|
* Which tools the caller may see, in `tools` order: one batch per permission,
|
|
136
|
-
* and a tool without a permission is always shown.
|
|
154
|
+
* and a tool without a permission is always shown. A tool that needs an
|
|
155
|
+
* approval stays listed, so the client can call it and resume.
|
|
137
156
|
*/
|
|
138
157
|
async function permittedTools(authorizer, tools, context) {
|
|
139
158
|
const shown = tools.map((tool) => tool.permission === void 0);
|
|
@@ -146,19 +165,25 @@ async function permittedTools(authorizer, tools, context) {
|
|
|
146
165
|
} catch {
|
|
147
166
|
continue;
|
|
148
167
|
}
|
|
149
|
-
const
|
|
168
|
+
const purpose = toolPurpose(tool.info);
|
|
169
|
+
const groupKey = `${purpose.intent ?? ""} ${key}`;
|
|
170
|
+
const group = groups.get(groupKey) ?? {
|
|
150
171
|
permission: tool.permission,
|
|
172
|
+
purpose,
|
|
151
173
|
indexes: []
|
|
152
174
|
};
|
|
153
175
|
group.indexes.push(index);
|
|
154
|
-
groups.set(
|
|
176
|
+
groups.set(groupKey, group);
|
|
155
177
|
}
|
|
156
|
-
await Promise.all([...groups.values()].map(async ({ permission, indexes }) => {
|
|
157
|
-
const
|
|
178
|
+
await Promise.all([...groups.values()].map(async ({ permission, purpose, indexes }) => {
|
|
179
|
+
const outcomes = await outcomesOf(authorizer, permission, indexes.map((index) => ({
|
|
158
180
|
type: "mcp_tool",
|
|
159
181
|
id: tools[index].name
|
|
160
|
-
})), context);
|
|
161
|
-
for (const [position, index] of indexes.entries())
|
|
182
|
+
})), context, runtimeOf(context), purpose);
|
|
183
|
+
for (const [position, index] of indexes.entries()) {
|
|
184
|
+
const outcome = outcomes[position];
|
|
185
|
+
shown[index] = outcome === "granted" || outcome === "approval-required";
|
|
186
|
+
}
|
|
162
187
|
}));
|
|
163
188
|
return shown;
|
|
164
189
|
}
|
|
@@ -431,7 +456,7 @@ function createMcp(betterSupabase, options) {
|
|
|
431
456
|
const key = table;
|
|
432
457
|
const entry = raw;
|
|
433
458
|
const { meta, ...route } = entry === true ? {} : entry;
|
|
434
|
-
const resource = defineResource(betterSupabase, key, route,
|
|
459
|
+
const resource = defineResource(betterSupabase, key, route, server.authorizer);
|
|
435
460
|
for (const { info, operation } of tableTools(resource, defs)) {
|
|
436
461
|
const ref = {
|
|
437
462
|
info,
|
|
@@ -477,7 +502,7 @@ function createMcp(betterSupabase, options) {
|
|
|
477
502
|
if (!parsed.ok) return failure(parsed.error);
|
|
478
503
|
value = parsed.data;
|
|
479
504
|
}
|
|
480
|
-
const checked = await checkTool(
|
|
505
|
+
const checked = await checkTool(server.authorizer, tool, value, ctx.db);
|
|
481
506
|
if (!checked.ok) return failure(checked.error);
|
|
482
507
|
const refusal = await refused(ref, value, ctx);
|
|
483
508
|
if (refusal) return refusal;
|
|
@@ -527,7 +552,7 @@ function createMcp(betterSupabase, options) {
|
|
|
527
552
|
const token = ctx.auth.kind === "user" ? ctx.auth.token : void 0;
|
|
528
553
|
const cached = token === void 0 ? void 0 : visibleLists.get(token);
|
|
529
554
|
if (cached?.generation === generation) return cached.entries.map((entry) => entry.infoFor(target));
|
|
530
|
-
const [shown, permitted] = await Promise.all([Promise.all(all.map((entry) => isVisible(entry, ctx))), permittedTools(
|
|
555
|
+
const [shown, permitted] = await Promise.all([Promise.all(all.map((entry) => isVisible(entry, ctx))), permittedTools(server.authorizer, all.map((entry) => ({
|
|
531
556
|
name: entry.info.name,
|
|
532
557
|
...entry
|
|
533
558
|
})), contextOf(ctx.db))]);
|
|
@@ -550,6 +575,8 @@ function createMcp(betterSupabase, options) {
|
|
|
550
575
|
}
|
|
551
576
|
};
|
|
552
577
|
const isRefusal = (value) => "refusal" in value;
|
|
578
|
+
/** The approval id a client resumes with in `params._meta.approval`. */
|
|
579
|
+
const approvalOf = (meta) => isObject(meta) && typeof meta["approval"] === "string" ? meta["approval"] : void 0;
|
|
553
580
|
const call = async (name, args, ctx) => {
|
|
554
581
|
const outcome = await invoke(name, args, ctx);
|
|
555
582
|
return isRefusal(outcome) ? failure(dbError("forbidden", outcome.refusal)) : outcome;
|
|
@@ -667,7 +694,14 @@ function createMcp(betterSupabase, options) {
|
|
|
667
694
|
case "tools/call": {
|
|
668
695
|
const name = message.params?.["name"];
|
|
669
696
|
const entry = typeof name === "string" ? registry.get(name) : void 0;
|
|
670
|
-
const
|
|
697
|
+
const resume = approvalOf(message.params?.["_meta"]);
|
|
698
|
+
const context = resume === void 0 ? toolContext() : withExtra(await server.context(request, {
|
|
699
|
+
cookies: options.cookies ?? false,
|
|
700
|
+
approval: resume
|
|
701
|
+
}), {
|
|
702
|
+
request,
|
|
703
|
+
signal: request.signal
|
|
704
|
+
});
|
|
671
705
|
if (!entry || !await isVisible(entry, context)) return rpcError(message.id, INVALID_PARAMS, `Unknown tool ${JSON.stringify(name)}`);
|
|
672
706
|
const outcome = await invoke(entry.info.name, message.params?.["arguments"], context, false);
|
|
673
707
|
if (!isRefusal(outcome)) return reply(outcome);
|
package/dist/mcp/sdk/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { O as AnyFunctions, k as AnyModels } from "../../types-
|
|
2
|
-
import { r as AuthState } from "../../resolve
|
|
3
|
-
import { i as CredentialRef, r as CredentialProvider } from "../../provider-
|
|
1
|
+
import { O as AnyFunctions, k as AnyModels } from "../../types-BkYEUWdz.js";
|
|
2
|
+
import { r as AuthState } from "../../resolve--LfVoOMg.js";
|
|
3
|
+
import { i as CredentialRef, r as CredentialProvider } from "../../provider-BI0KC4u5.js";
|
|
4
4
|
import { i as SupabaseMcpScope, n as SupabaseMcpModule, r as SupabaseMcpPlatformModule, t as SupabaseMcpFeature } from "../../supabase-mcp-DY32eoax.js";
|
|
5
|
-
import { t as BetterSupabase } from "../../define-
|
|
6
|
-
import {
|
|
7
|
-
import { r as GuardOptions, t as AllowedCaller } from "../../respond-
|
|
5
|
+
import { t as BetterSupabase } from "../../define-ITQA71fw.js";
|
|
6
|
+
import { l as ServerOptions, o as ServerContext$1, r as BetterServer } from "../../server-types-C2hlvhP4.js";
|
|
7
|
+
import { r as GuardOptions, t as AllowedCaller } from "../../respond-BYOV7KZp.js";
|
|
8
8
|
import { AuthInfo, CallToolResult, Icon, InputRequiredResult, OAuthTokenVerifier, RegisteredTool, ScopeChallengeHandler, ServerContext, StandardSchemaWithJSON, ToolAnnotations } from "@modelcontextprotocol/server";
|
|
9
9
|
interface McpAuthOptions extends ServerOptions, Omit<GuardOptions, "scopes"> {
|
|
10
10
|
/**
|
package/dist/mcp/sdk/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as dbError } from "../../errors-B7tCfCvX.js";
|
|
2
2
|
import { o as problemResponse } from "../../problem-C0SVHhd3.js";
|
|
3
3
|
import { i as delegationOf } from "../../actor-B5b0i1Fs.js";
|
|
4
|
-
import { c as extendServer, i as resolveToken, n as flushEvents, s as createServer } from "../../adapter-
|
|
5
|
-
import { i as guard } from "../../respond-
|
|
4
|
+
import { c as extendServer, i as resolveToken, n as flushEvents, s as createServer } from "../../adapter-CWzyKepA.js";
|
|
5
|
+
import { i as guard } from "../../respond-DLH4tD2d.js";
|
|
6
6
|
import { t as withExtra } from "../../extra-Dz9n5y1s.js";
|
|
7
7
|
import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "../../http-BRUI3qim.js";
|
|
8
8
|
import { n as loadSupabaseMcp, r as loadSupabaseMcpPlatform, t as isRecord } from "../../supabase-mcp-QvebHckf.js";
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import { T as ErrorMapper, t as AsyncResult } from "./result-DTOQRyGY.js";
|
|
3
3
|
import { t as StandardSchemaV1 } from "./standard-DRX6Ch1j.js";
|
|
4
4
|
import { n as ExtraFields, r as FieldsOf } from "./block-fields-Puv5m5D3.js";
|
|
5
|
-
import { $ as RecordRef } from "./types-
|
|
5
|
+
import { $ as RecordRef } from "./types-BkYEUWdz.js";
|
|
6
6
|
import { n as Logger } from "./logger-0LfhvwE4.js";
|
|
7
|
-
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "./block-helpers-
|
|
8
|
-
import { t as BlockTransport } from "./block-transport-
|
|
9
|
-
import { n as BlockHooks } from "./block-hooks-
|
|
7
|
+
import { a as BlockTenantOptions, r as BlockTemporalOptions } from "./block-helpers-disoUWCp.js";
|
|
8
|
+
import { t as BlockTransport } from "./block-transport-BEtC_Kis.js";
|
|
9
|
+
import { n as BlockHooks } from "./block-hooks-DrA_d1dJ.js";
|
|
10
10
|
import { t as Author } from "./block-authors-C5z3tGVu.js";
|
|
11
11
|
import { a as ThreadSummary, i as ThreadSummarizer, r as SummaryTarget, t as SummarizeOptions } from "./summaries-CUemsYwV.js";
|
|
12
12
|
/** What a conversation is for. */
|
package/dist/nestjs/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../refusal-CGi-0Q18.js";
|
|
2
2
|
import { t as Validated } from "../shared-DsBcvj6q.js";
|
|
3
|
-
import { l as ToNodeOptions } from "../index-
|
|
3
|
+
import { l as ToNodeOptions } from "../index-M1izbwbN.js";
|
|
4
4
|
import { AnyEntry } from "@supabase/middleware";
|
|
5
5
|
import { IncomingMessage, ServerResponse } from "node:http";
|
|
6
6
|
/**
|
package/dist/nestjs/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-
|
|
1
|
+
import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-5c6UMpUP.js";
|
|
2
2
|
import { t as beforeRoute } from "../before-route-Ra3OhI2x.js";
|
|
3
3
|
import { t as applyWebHeaders } from "../node-headers-C3FExlg9.js";
|
|
4
4
|
import { n as toWebRequest, t as sendWebResponse } from "../http-D4lH1xqY.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as SessionWatchStatus, t as SessionStatusBody } from "../../session-status-
|
|
1
|
+
import { i as SessionWatchStatus, t as SessionStatusBody } from "../../session-status-D8CBxCqv.js";
|
|
2
2
|
/**
|
|
3
3
|
* Why the session changed: Auth ended it or banned the user, the user signed
|
|
4
4
|
* out, or the claims or support target behind the session changed.
|
package/dist/next/index.d.ts
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import { b as DbError, f as Result } from "../result-DTOQRyGY.js";
|
|
2
|
-
import { $ as RecordRef, O as AnyFunctions, k as AnyModels } from "../types-
|
|
3
|
-
import { m as CookieScope, r as AuthState } from "../resolve
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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-C3p3jUqr.js";
|
|
2
|
+
import { $ as RecordRef, Ht as AnyAuthorizer, O as AnyFunctions, k as AnyModels, nn as PermissionRef, tn as AuthzVersionCache } from "../types-BkYEUWdz.js";
|
|
3
|
+
import { m as CookieScope, r as AuthState } from "../resolve--LfVoOMg.js";
|
|
4
|
+
import { Qt as CacheAdapter, Y as DbStats, mt as QuerySpec, nt as ReadSet, t as BetterSupabase } from "../define-ITQA71fw.js";
|
|
5
|
+
import { a as authzVersionOf, c as sessionCacheKey, i as SessionSnapshot, o as isSessionSnapshot, s as issuedAtOf } from "../snapshot-BGsJw9xn.js";
|
|
7
6
|
import { n as Impersonator } from "../impersonation-BOCJcsmS.js";
|
|
8
7
|
import { n as AmrEntry, t as Aal } from "../mfa-CM5r904M.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 {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { r as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { t as
|
|
23
|
-
import { t as
|
|
8
|
+
import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-COmMkx2x.js";
|
|
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-BIAtapnD.js";
|
|
10
|
+
import { r as MembershipClaim } from "../entitlements-w04ivvAy.js";
|
|
11
|
+
import { t as tenantOf } from "../tenant-B3IIq8Eq.js";
|
|
12
|
+
import { r as permissionsOf, t as PermissionsOfOptions } from "../permissions-BP593xxk.js";
|
|
13
|
+
import { n as AuthSession, o as toSession } from "../view-Cy2XxYp1.js";
|
|
14
|
+
import { i as ContextOptions, l as ServerOptions, o as ServerContext, r as BetterServer, u as SharedServer } from "../server-types-C2hlvhP4.js";
|
|
15
|
+
import { a as SupportPolicy, c as supportSessions, i as SupportOptions, o as SupportSessions, s as SupportStartRequest, t as ActiveSupport } from "../support-DxYI6sDM.js";
|
|
16
|
+
import { t as AuthOutageHook } from "../session-B4VasaAA.js";
|
|
17
|
+
import { n as AuthKind, r as GuardOptions } from "../respond-BYOV7KZp.js";
|
|
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-OgFOW9rX.js";
|
|
19
|
+
import { c as ListParseOptions, m as ListSearchParams } from "../list-query-C7V8kUaD.js";
|
|
20
|
+
import { r as LiveCountSeed, t as CountRunner } from "../index-BZCmy767.js";
|
|
21
|
+
import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-RgaljPs0.js";
|
|
22
|
+
import { t as ResourceMap } from "../resources-Bki1J4jy.js";
|
|
23
|
+
import { t as defineAction } from "../resource-execute-DUBYKTYU.js";
|
|
24
|
+
import { c as safeRedirectPath, i as OtpParams, n as EmailOtpType, o as SignOutScope, r as ExistingAccount, t as AuthorizeUrlParams } from "../sign-in-CX1a5i2P.js";
|
|
24
25
|
import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-QSaPsL2P.js";
|
|
25
|
-
import { i as tagFor, t as TagOptions } from "../tags
|
|
26
|
-
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-
|
|
27
|
-
import { n as supportOf, t as SupportView } from "../support-view-
|
|
26
|
+
import { i as tagFor, t as TagOptions } from "../tags--k2fbPfO.js";
|
|
27
|
+
import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-Bq658xsi.js";
|
|
28
|
+
import { n as supportOf, t as SupportView } from "../support-view-DSmCett7.js";
|
|
28
29
|
import { NextRequest } from "next/server.js";
|
|
29
30
|
import { StandardSchemaV1 } from "@standard-schema/spec";
|
|
30
31
|
import { UserClaims } from "@supabase/server";
|
|
@@ -297,7 +298,7 @@ interface ScopeOptions {
|
|
|
297
298
|
*/
|
|
298
299
|
readonly tenant?: string;
|
|
299
300
|
}
|
|
300
|
-
interface BetterNext<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, Ref = string, B = unknown> extends BetterServer<M, F, E, C, P, B> {
|
|
301
|
+
interface BetterNext<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P = unknown, Ref = string, B = unknown, V extends AuthzVersionCache = AuthzVersionCache> extends BetterServer<M, F, E, C, P, B, V> {
|
|
301
302
|
/** `proxy.ts`: refreshes sessions for page loads and server actions. */
|
|
302
303
|
proxy(request: NextRequest, options?: ProxyOptions<C, P>): Promise<Response>;
|
|
303
304
|
/**
|
|
@@ -747,9 +748,10 @@ type NextResource<M extends AnyModels, F extends AnyFunctions, E, C = unknown, P
|
|
|
747
748
|
* export const bsb = createNext(betterSupabase);
|
|
748
749
|
* ```
|
|
749
750
|
*/
|
|
750
|
-
export declare function createNext<M extends AnyModels, D, F extends AnyFunctions, E, C = unknown, P = unknown, A extends AnyAuthorizer | undefined = undefined, B = unknown>(betterSupabase: BetterSupabase<M, D, F, E, C, P, B>, options?: NextOptions & {
|
|
751
|
+
export declare function createNext<M extends AnyModels, D, F extends AnyFunctions, E, C = unknown, P = unknown, A extends AnyAuthorizer<V> | undefined = undefined, B = unknown, V extends AuthzVersionCache = AuthzVersionCache>(betterSupabase: BetterSupabase<M, D, F, E, C, P, B>, options?: NextOptions & {
|
|
751
752
|
readonly authorizer?: A;
|
|
752
|
-
|
|
753
|
+
readonly versions?: V;
|
|
754
|
+
}): BetterNext<M, F, E, C, P, PermissionRef<A>, B, V>;
|
|
753
755
|
/** The tag `bsb.cached()` adds to entries rendered in a support session. */
|
|
754
756
|
export declare function supportTag(sessionId: string): string;
|
|
755
757
|
/**
|
package/dist/next/index.js
CHANGED
|
@@ -7,25 +7,26 @@ import { o as isReadSet } from "../read-set-DEDoIHMM.js";
|
|
|
7
7
|
import { n as validate } from "../standard-BD2aOUsf.js";
|
|
8
8
|
import { n as StatsRecorder, t as EMPTY_STATS } from "../stats-BTJgRMEp.js";
|
|
9
9
|
import { o as problemResponse } from "../problem-C0SVHhd3.js";
|
|
10
|
-
import { i as claimsOf } from "../claims-
|
|
10
|
+
import { i as claimsOf } from "../claims-CqTr_N1n.js";
|
|
11
11
|
import { t as supportOf } from "../support-view-CvDEgyGY.js";
|
|
12
12
|
import { n as createBlockClient } from "../create-blocks-D7q1boXV.js";
|
|
13
13
|
import { a as recordCan, c as recordWriteInput, i as plainData, l as runBindingWrite, o as recordPermissionKeys, p as loadBindings, r as findBindingWrite, s as recordSubject, t as bindingWrites } from "../record-type-oQxekQTX.js";
|
|
14
14
|
import { n as methodOf } from "../block-method-DIbWG4Mj.js";
|
|
15
|
-
import { t as tenantOf } from "../tenant-
|
|
15
|
+
import { t as tenantOf } from "../tenant-Beqd7TTq.js";
|
|
16
16
|
import { t as loadTimeline } from "../timeline-Bs-FGMIJ.js";
|
|
17
|
-
import {
|
|
17
|
+
import { r as permissionsOf } from "../permissions-BDt27oYF.js";
|
|
18
|
+
import { a as sessionCacheKey, i as issuedAtOf, n as authzVersionOf, r as isSessionSnapshot, s as snapshotOf, t as authOfSnapshot } from "../snapshot-CVMSyTHH.js";
|
|
19
|
+
import { i as toSession, s as checkAal } from "../view-BfEqjZJ_.js";
|
|
20
|
+
import { c as extendServer, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as outageResponse, x as serverCore } from "../adapter-CWzyKepA.js";
|
|
18
21
|
import { t as isPrefetch } from "../refresh-B8t_KE3s.js";
|
|
19
22
|
import { d as clearSessionAtScopes, g as sessionCookieName, t as clientIp, u as applyCookieWrites, v as writeSession } from "../resolve-FW8oeXvh.js";
|
|
20
|
-
import {
|
|
21
|
-
import { n as
|
|
22
|
-
import { i as
|
|
23
|
-
import { a as needsMfa, c as pkceGrant, d as safeRedirectPath, f as supportSessions, i as mfaGrant, l as pkcePair, n as emailFlow, o as otpGrant, r as isExistingAccount, s as passwordGrant, t as authorizeUrlFor, u as revokeSession } from "../sign-in-BmigClRh.js";
|
|
24
|
-
import { i as defineAction } from "../resource-Cn6Bn-_o.js";
|
|
23
|
+
import { i as guard, n as defaultExpose, s as settle } from "../respond-DLH4tD2d.js";
|
|
24
|
+
import { a as needsMfa, c as pkceGrant, d as safeRedirectPath, f as supportSessions, i as mfaGrant, l as pkcePair, n as emailFlow, o as otpGrant, r as isExistingAccount, s as passwordGrant, t as authorizeUrlFor, u as revokeSession } from "../sign-in-BMm1xhKq.js";
|
|
25
|
+
import { i as defineAction } from "../resource-BbWk4hoP.js";
|
|
25
26
|
import { r as tagFor, t as cacheTagsOf } from "../tags-CW-KvjdL.js";
|
|
26
|
-
import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-
|
|
27
|
+
import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-9pZP5iLU.js";
|
|
27
28
|
import { t as withExtra } from "../extra-Dz9n5y1s.js";
|
|
28
|
-
import { n as resourceRouter } from "../resources-
|
|
29
|
+
import { n as resourceRouter } from "../resources-DYSx9NYM.js";
|
|
29
30
|
import { cache } from "react";
|
|
30
31
|
import { cacheLife, cacheTag, io, revalidateTag, updateTag } from "next/cache.js";
|
|
31
32
|
import { cookies, headers } from "next/headers.js";
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as RouteGuardOptions } from "../refusal-
|
|
1
|
+
import { n as RouteGuardOptions } from "../refusal-CGi-0Q18.js";
|
|
2
2
|
import { i as toWebHeaders, r as applyWebHeaders, t as NodeHeaderTarget } from "../node-headers-TnS4T7V_.js";
|
|
3
|
-
import { _ as toNodeHandler, a as FastifyReplyLike, b as toWebRequest, c as KoaMiddleware, d as guard, f as koaGuard, g as toKoa, h as toFastify, i as FastifyHook, l as ToNodeOptions, m as toExpress, n as ExpressMiddleware, o as FastifyRequestLike, p as problemErrorHandler, r as ExpressResponse, s as KoaContextLike, t as ExpressErrorHandler, u as fastifyGuard, v as WebRequestOptions, y as sendWebResponse } from "../index-
|
|
3
|
+
import { _ as toNodeHandler, a as FastifyReplyLike, b as toWebRequest, c as KoaMiddleware, d as guard, f as koaGuard, g as toKoa, h as toFastify, i as FastifyHook, l as ToNodeOptions, m as toExpress, n as ExpressMiddleware, o as FastifyRequestLike, p as problemErrorHandler, r as ExpressResponse, s as KoaContextLike, t as ExpressErrorHandler, u as fastifyGuard, v as WebRequestOptions, y as sendWebResponse } from "../index-M1izbwbN.js";
|
|
4
4
|
export { ExpressErrorHandler, ExpressMiddleware, ExpressResponse, FastifyHook, FastifyReplyLike, FastifyRequestLike, KoaContextLike, KoaMiddleware, type NodeHeaderTarget, type RouteGuardOptions, ToNodeOptions, type WebRequestOptions, applyWebHeaders, fastifyGuard, guard, koaGuard, problemErrorHandler, sendWebResponse, toExpress, toFastify, toKoa, toNodeHandler, toWebHeaders, toWebRequest };
|
package/dist/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as toResponse, t as around } from "../shared-Ci1g9nl4.js";
|
|
2
|
-
import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-
|
|
2
|
+
import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-5c6UMpUP.js";
|
|
3
3
|
import { t as beforeRoute } from "../before-route-Ra3OhI2x.js";
|
|
4
4
|
import { i as toWebHeaders, t as applyWebHeaders } from "../node-headers-C3FExlg9.js";
|
|
5
5
|
import { n as toWebRequest, t as sendWebResponse } from "../http-D4lH1xqY.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as AuthorizationOperation } from "./authorization-
|
|
1
|
+
import { r as AuthorizationOperation } from "./authorization-BlmDNI2b.js";
|
|
2
2
|
/** Operations by name, as `authorization.operations` or a module's own defaults. */
|
|
3
3
|
type OperationTable = Readonly<Record<string, AuthorizationOperation>>;
|
|
4
4
|
export { OperationTable as t };
|
package/dist/orpc/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { b as DbError, f as Result } from "../result-DTOQRyGY.js";
|
|
2
|
-
import { O as AnyFunctions, k as AnyModels } from "../types-
|
|
3
|
-
import { r as AuthState } from "../resolve
|
|
2
|
+
import { O as AnyFunctions, k as AnyModels } from "../types-BkYEUWdz.js";
|
|
3
|
+
import { r as AuthState } from "../resolve--LfVoOMg.js";
|
|
4
4
|
import { i as ProblemDetails } from "../problem-NGBjN-TO.js";
|
|
5
|
-
import { t as BetterSupabase } from "../define-
|
|
6
|
-
import {
|
|
7
|
-
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-
|
|
8
|
-
import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-
|
|
5
|
+
import { t as BetterSupabase } from "../define-ITQA71fw.js";
|
|
6
|
+
import { l as ServerOptions, o as ServerContext, r as BetterServer } from "../server-types-C2hlvhP4.js";
|
|
7
|
+
import { i as MiddlewareOptions, r as GuardOptions } from "../respond-BYOV7KZp.js";
|
|
8
|
+
import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-OgFOW9rX.js";
|
|
9
|
+
import { a as ResourceHandler } from "../resource-types-RgaljPs0.js";
|
|
9
10
|
import { t as Validated } from "../shared-DsBcvj6q.js";
|
|
10
|
-
import { a as ResourceHandler } from "../resource-types-DF6KDAZM.js";
|
|
11
11
|
import { i as RouteRateLimitRule, n as RateLimitVerdict, r as RateLimiter, t as RateLimitRouteOptions } from "../rate-limit-C89Yzwd9.js";
|
|
12
|
-
import { t as Api } from "../api-
|
|
12
|
+
import { t as Api } from "../api-myq2e9t5.js";
|
|
13
13
|
import { AnyEntry, Contributions } from "@supabase/middleware";
|
|
14
14
|
import { AnySchema, BuilderWithMiddlewares, DecoratedMiddleware, DecoratedProcedure, MetaPlugin, ORPCError, Schema } from "@orpc/server";
|
|
15
15
|
/** The route `router()` gives one operation of the API model. */
|
package/dist/orpc/index.js
CHANGED
|
@@ -3,17 +3,17 @@ import { n as isRecord } from "../guards-CsRa6v57.js";
|
|
|
3
3
|
import { r as err } from "../result-8xza7w5W.js";
|
|
4
4
|
import { t as instanceProperty } from "../instance-property-BlH7QSDl.js";
|
|
5
5
|
import { c as toProblem } from "../problem-C0SVHhd3.js";
|
|
6
|
-
import { i as claimsOf } from "../claims-
|
|
6
|
+
import { i as claimsOf } from "../claims-CqTr_N1n.js";
|
|
7
7
|
import { t as TABLE_VERBS } from "../resource-DQ4kIBpa.js";
|
|
8
8
|
import { t as callWithInput } from "../block-method-DIbWG4Mj.js";
|
|
9
|
-
import { t as tenantOf } from "../tenant-
|
|
10
|
-
import {
|
|
9
|
+
import { t as tenantOf } from "../tenant-Beqd7TTq.js";
|
|
10
|
+
import { i as toSession } from "../view-BfEqjZJ_.js";
|
|
11
|
+
import { c as extendServer, n as flushEvents, s as createServer } from "../adapter-CWzyKepA.js";
|
|
11
12
|
import { n as refreshFor } from "../refresh-B8t_KE3s.js";
|
|
12
|
-
import { r as checkPermission } from "../authorizer-
|
|
13
|
-
import { n as
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as authorizeCaller } from "../kit-CVZDd1X9.js";
|
|
13
|
+
import { r as checkPermission } from "../authorizer-BtIPDO-c.js";
|
|
14
|
+
import { i as guard, n as defaultExpose, s as settle, t as assertCookieRefresh } from "../respond-DLH4tD2d.js";
|
|
15
|
+
import { r as contextOf, t as defineResource } from "../resource-BbWk4hoP.js";
|
|
16
|
+
import { t as authorizeCaller } from "../kit-9pZP5iLU.js";
|
|
17
17
|
import { t as rateLimitGate } from "../rate-limit-DXJbLVg0.js";
|
|
18
18
|
import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
|
|
19
19
|
import { COMMON_ERROR_STATUS_MAP, ORPCError, os } from "@orpc/server";
|
package/dist/otel/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Mt as Plugin } from "../types-
|
|
2
|
-
import { o as EventHub } from "../events-
|
|
1
|
+
import { Mt as Plugin } from "../types-BkYEUWdz.js";
|
|
2
|
+
import { o as EventHub } from "../events-DVt3Z9hw.js";
|
|
3
3
|
import { t as SPEC_PINS } from "../spec-pins-CuQ2anBw.js";
|
|
4
4
|
import { Attributes, Meter, Tracer } from "@opentelemetry/api";
|
|
5
5
|
export declare const INSTRUMENTATION_NAME = "better-supabase";
|
package/dist/otel/index.js
CHANGED
|
@@ -39,9 +39,9 @@ function systemOf(executor) {
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
function otel(options = {}) {
|
|
42
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
42
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.33.0");
|
|
43
43
|
let histogram;
|
|
44
|
-
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.
|
|
44
|
+
if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.33.0")).createHistogram("db.client.operation.duration", {
|
|
45
45
|
unit: "s",
|
|
46
46
|
description: "Duration of database client operations.",
|
|
47
47
|
advice: { explicitBucketBoundaries: [
|
|
@@ -218,7 +218,7 @@ function otel(options = {}) {
|
|
|
218
218
|
* `betterSupabase.events`. Returns a function that stops listening.
|
|
219
219
|
*/
|
|
220
220
|
function traceAuth(betterSupabase, options = {}) {
|
|
221
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
221
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.33.0");
|
|
222
222
|
const offAuth = betterSupabase.events.on("auth", (event) => {
|
|
223
223
|
const span = tracer.startSpan("auth.resolve", {
|
|
224
224
|
kind: SpanKind.INTERNAL,
|
|
@@ -256,7 +256,7 @@ function traceAuth(betterSupabase, options = {}) {
|
|
|
256
256
|
* an error status. Returns a function that stops listening.
|
|
257
257
|
*/
|
|
258
258
|
function traceBlockEvents(betterSupabase, options = {}) {
|
|
259
|
-
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.
|
|
259
|
+
const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.33.0");
|
|
260
260
|
return betterSupabase.events.on("block", (event) => {
|
|
261
261
|
const attributes = {
|
|
262
262
|
...options.attributes,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference lib="esnext.temporal" />
|
|
2
2
|
import { b as DbError, t as AsyncResult } from "./result-DTOQRyGY.js";
|
|
3
3
|
import { n as Logger } from "./logger-0LfhvwE4.js";
|
|
4
|
-
import { i as CursorPageOptions, n as BlockOptions } from "./block-helpers-
|
|
5
|
-
import { n as BlockHooks } from "./block-hooks-
|
|
4
|
+
import { i as CursorPageOptions, n as BlockOptions } from "./block-helpers-disoUWCp.js";
|
|
5
|
+
import { n as BlockHooks } from "./block-hooks-DrA_d1dJ.js";
|
|
6
6
|
import { t as BlockProblemOptions } from "./problem-NGBjN-TO.js";
|
|
7
|
-
import { i as EventSink, t as CloudEvent } from "./cloud-event-
|
|
8
|
-
import { g as SubscriberPolicy, i as AuthorizationHooks } from "./authorization-hooks-
|
|
7
|
+
import { i as EventSink, t as CloudEvent } from "./cloud-event-DXWmXrus.js";
|
|
8
|
+
import { g as SubscriberPolicy, i as AuthorizationHooks } from "./authorization-hooks-CxwsRnfV.js";
|
|
9
9
|
/** One row of the outbox, as `outbox_claim` and `outbox_history` return it. */
|
|
10
10
|
interface OutboxEvent {
|
|
11
11
|
/** The cursor value: increases with every event. */
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { t as DEFAULT_CLAIMS } from "./claims-
|
|
2
|
-
import { t as tenantOf } from "./tenant-
|
|
1
|
+
import { c as truncatedMarker, t as DEFAULT_CLAIMS } from "./claims-CqTr_N1n.js";
|
|
2
|
+
import { n as claimsFrom, t as tenantOf } from "./tenant-Beqd7TTq.js";
|
|
3
3
|
// src/auth/permissions.ts
|
|
4
4
|
/**
|
|
5
5
|
* The permission keys the token grants in `tenant` (the active tenant by
|
|
6
|
-
* default), from the `permissions` claim `permission_claims()` writes.
|
|
6
|
+
* default), from the `permissions` claim `permission_claims()` writes. Takes a
|
|
7
|
+
* server session, the client's `useAuth()` snapshot or verified claims.
|
|
7
8
|
*
|
|
8
9
|
* `undefined` means the token can't answer: no claim, no entry for the tenant,
|
|
9
|
-
* or the hook set
|
|
10
|
+
* or the hook set the truncated marker because the keys didn't fit. Ask the
|
|
10
11
|
* database then (`my_permissions`). An empty list means the token says the
|
|
11
12
|
* caller holds no permission there. The claim is a cache the `authz_ver` bump
|
|
12
13
|
* invalidates; RLS stays the authority.
|
|
@@ -17,14 +18,22 @@ import { t as tenantOf } from "./tenant-BR7fvPj7.js";
|
|
|
17
18
|
* ```
|
|
18
19
|
*/
|
|
19
20
|
function permissionsOf(session, tenant, options = {}) {
|
|
20
|
-
const claims =
|
|
21
|
+
const claims = claimsFrom(session);
|
|
21
22
|
if (claims === void 0) return;
|
|
22
|
-
const id = tenant ?? tenantOf(
|
|
23
|
-
return id === void 0 ? void 0 : keysFromClaims(claims, id, options.claim ?? DEFAULT_CLAIMS.permissions);
|
|
23
|
+
const id = tenant ?? tenantOf(claims, options.tenantClaim);
|
|
24
|
+
return id === void 0 ? void 0 : keysFromClaims(claims, id, options.claim ?? DEFAULT_CLAIMS.permissions, options.truncatedClaim);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Whether the hook left entries out of `claim` to stay within its budget.
|
|
28
|
+
* `marker` is the provider's `tokenHook.truncatedClaim`; without it the marker
|
|
29
|
+
* is `<claim>_truncated`. A truncated claim can't answer "not granted".
|
|
30
|
+
*/
|
|
31
|
+
function isTruncated(claims, claim = DEFAULT_CLAIMS.permissions, options = {}) {
|
|
32
|
+
return claims[truncatedMarker(claim, options.marker)] === true;
|
|
24
33
|
}
|
|
25
34
|
/** The keys `claims` grants in `tenant`, or `undefined` when it can't say. */
|
|
26
|
-
function keysFromClaims(claims, tenant, claim) {
|
|
27
|
-
if (claims
|
|
35
|
+
function keysFromClaims(claims, tenant, claim, marker) {
|
|
36
|
+
if (isTruncated(claims, claim, { marker })) return;
|
|
28
37
|
const byTenant = claims[claim];
|
|
29
38
|
if (!isRecord(byTenant)) return;
|
|
30
39
|
const keys = byTenant[tenant];
|
|
@@ -33,11 +42,7 @@ function keysFromClaims(claims, tenant, claim) {
|
|
|
33
42
|
function isKeyList(value) {
|
|
34
43
|
return Array.isArray(value) && value.every((key) => typeof key === "string");
|
|
35
44
|
}
|
|
36
|
-
function claimsOf(session) {
|
|
37
|
-
if ("kind" in session) return session.kind === "user" ? session.claims : void 0;
|
|
38
|
-
return session.status === "signed-in" ? session.claims : void 0;
|
|
39
|
-
}
|
|
40
45
|
function isRecord(value) {
|
|
41
46
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
42
47
|
}
|
|
43
|
-
export {
|
|
48
|
+
export { keysFromClaims as n, permissionsOf as r, isTruncated as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { o as ClaimsRecord, s as ClaimsSource } from "./entitlements-w04ivvAy.js";
|
|
2
|
+
interface PermissionsOfOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The claim holding `{ [tenantId]: string[] }`, as
|
|
5
|
+
* `config.claims.permissions`. Defaults to `permissions`.
|
|
6
|
+
*/
|
|
7
|
+
readonly claim?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The claim the hook sets to `true` when it left keys out: the provider's
|
|
10
|
+
* `tokenHook.truncatedClaim`. Defaults to `<claim>_truncated`.
|
|
11
|
+
*/
|
|
12
|
+
readonly truncatedClaim?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The active tenant claim, as `config.claims.tenant`, when `tenant` is left
|
|
15
|
+
* out.
|
|
16
|
+
*/
|
|
17
|
+
readonly tenantClaim?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The permission keys the token grants in `tenant` (the active tenant by
|
|
21
|
+
* default), from the `permissions` claim `permission_claims()` writes. Takes a
|
|
22
|
+
* server session, the client's `useAuth()` snapshot or verified claims.
|
|
23
|
+
*
|
|
24
|
+
* `undefined` means the token can't answer: no claim, no entry for the tenant,
|
|
25
|
+
* or the hook set the truncated marker because the keys didn't fit. Ask the
|
|
26
|
+
* database then (`my_permissions`). An empty list means the token says the
|
|
27
|
+
* caller holds no permission there. The claim is a cache the `authz_ver` bump
|
|
28
|
+
* invalidates; RLS stays the authority.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* const keys = permissionsOf(await bsb.claims());
|
|
32
|
+
* if (keys !== undefined && !keys.includes("billing.manage")) forbidden();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
declare function permissionsOf<C, P>(session: ClaimsSource<C, P>, tenant?: string, options?: PermissionsOfOptions): readonly string[] | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the hook left entries out of `claim` to stay within its budget.
|
|
38
|
+
* `marker` is the provider's `tokenHook.truncatedClaim`; without it the marker
|
|
39
|
+
* is `<claim>_truncated`. A truncated claim can't answer "not granted".
|
|
40
|
+
*/
|
|
41
|
+
declare function isTruncated(claims: ClaimsRecord, claim?: string, options?: {
|
|
42
|
+
readonly marker?: string | undefined;
|
|
43
|
+
}): boolean;
|
|
44
|
+
export { isTruncated as n, permissionsOf as r, PermissionsOfOptions as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Bt as Executor } from "./types-
|
|
2
|
-
import { o as EventHub } from "./events-
|
|
1
|
+
import { Bt as Executor } from "./types-BkYEUWdz.js";
|
|
2
|
+
import { o as EventHub } from "./events-DVt3Z9hw.js";
|
|
3
3
|
import { n as Logger } from "./logger-0LfhvwE4.js";
|
|
4
|
-
import { n as SqlClient } from "./executor-
|
|
4
|
+
import { n as SqlClient } from "./executor-CFmee_nV.js";
|
|
5
5
|
/** The part of a `pg` pool client `createPostgres` uses. */
|
|
6
6
|
interface PgPoolClient {
|
|
7
7
|
query(text: string, values?: unknown[]): Promise<{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AsyncResult } from "./result-DTOQRyGY.js";
|
|
2
|
-
import { n as TopicPort } from "./watch-topic-
|
|
2
|
+
import { n as TopicPort } from "./watch-topic-q6krNw0T.js";
|
|
3
3
|
import { SupabaseClient } from "@supabase/supabase-js";
|
|
4
4
|
/**
|
|
5
5
|
* A string store: `localStorage` on the web (`webStorage()`), AsyncStorage,
|
|
@@ -2,7 +2,7 @@ import { a as ok, r as err, t as AsyncResult } from "./result-8xza7w5W.js";
|
|
|
2
2
|
import { n as postgrestExecutor } from "./postgrest-executor-lf8Mt4J0.js";
|
|
3
3
|
import { n as decodeJwtPayload } from "./base64-CVyKHBBw.js";
|
|
4
4
|
import { i as userContext } from "./impersonation-D-quM36V.js";
|
|
5
|
-
import { n as hasAuthModule, r as claimedTenant } from "./auth-module-
|
|
5
|
+
import { n as hasAuthModule, r as claimedTenant } from "./auth-module-CqXdm8qD.js";
|
|
6
6
|
import { t as currentTenant } from "./tenant-source-46lMuMEn.js";
|
|
7
7
|
import { n as identityKey } from "./user-change-Ngy8z1fZ.js";
|
|
8
8
|
import { t as createQueries } from "./queries-BLrxg_GL.js";
|