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
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
import { a as list, m as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DM_x_yzZ.js";
|
|
2
2
|
import { i as plain } from "./style-B5-nByxb.js";
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
3
|
+
import { t as VERSION$1 } from "./version-DKfeme2I.js";
|
|
4
4
|
import { n as CliError, r as errorText } from "./errors-DcJ_PayO.js";
|
|
5
|
-
import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-
|
|
5
|
+
import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-Tqq3MAqx.js";
|
|
6
6
|
import { a as sameText, t as display } from "./io-CQzy8PEZ.js";
|
|
7
|
-
import { t as CACHE_DIR } from "./cache-
|
|
7
|
+
import { t as CACHE_DIR } from "./cache-aMk9vF1_.js";
|
|
8
8
|
import { t as byCodePoint } from "./compare-yl4sSwVn.js";
|
|
9
|
-
import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError } from "./snapshot-
|
|
10
|
-
import { d as configFor, r as renderFiles, u as notNullTag } from "./render-
|
|
9
|
+
import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError, x as installedVersion } from "./snapshot-C3_eQUgY.js";
|
|
10
|
+
import { d as configFor, r as renderFiles, u as notNullTag } from "./render-Bp7a7XQ9.js";
|
|
11
11
|
import { o as providerLabel } from "./authorization-DJkkOjjG.js";
|
|
12
12
|
import { t as isRecord } from "./guards-DxwRG0Uv.js";
|
|
13
|
-
import { i as request } from "./source-
|
|
13
|
+
import { i as request } from "./source-Bk6XwIAK.js";
|
|
14
14
|
import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-DrrkMihk.js";
|
|
15
15
|
import { a as findRepoRoot, c as httpHooks, d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, n as declarativeSchemasDir, p as sqlWorkflow, u as pgFunctionHooks } from "./supabase-toml-B6-eEV5p.js";
|
|
16
16
|
import { t as PROCESS_ENV } from "./env-BCuUsWOh.js";
|
|
17
17
|
import { n as readStackStatus } from "./stack-status-Mxgqb3I4.js";
|
|
18
18
|
import { t as connect } from "./db-B8zfxjl2.js";
|
|
19
|
-
import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-
|
|
19
|
+
import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-CEtdbshU.js";
|
|
20
20
|
import { c as insideRoot, i as changeLines, r as applyPlan } from "./files-DQayErI8.js";
|
|
21
|
-
import {
|
|
22
|
-
import { n as
|
|
23
|
-
import {
|
|
24
|
-
import { a as
|
|
25
|
-
import {
|
|
26
|
-
import { o as
|
|
21
|
+
import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-DVQ20UMi.js";
|
|
22
|
+
import { a as permissionCatalogKeys, i as lineOf, l as tableObject, n as exposed, o as policyObject, r as exposedSchemas, s as qualified, t as catalogOf, u as workflowOf } from "./shared-D60W9NS-.js";
|
|
23
|
+
import { i as appViewsOf, n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-BIyQcsHH.js";
|
|
24
|
+
import { _ as BLOCK_PREFIX, a as METADATA_GAPS_TEXT, b as splinterTables, c as entitlementsModule, d as appliesTo, f as escape$3, g as withoutStrings, h as policyHelpers, l as COMMANDS$2, m as functionObject, p as functionBody, s as AUTHORIZATION_RULES, u as RLS_RULES, v as blockTargets, y as advisorRule } from "./run-BclCFEyP.js";
|
|
25
|
+
import { a as compiledReadSets } from "./providers-BDTcal71.js";
|
|
26
|
+
import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration--9T_T-zt.js";
|
|
27
|
+
import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-DfwTOBQ4.js";
|
|
27
28
|
import { t as orphanedBlockFiles } from "./orphans-CPcR85QN.js";
|
|
28
|
-
import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-
|
|
29
|
+
import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-CuMpyRjF.js";
|
|
29
30
|
import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-Bz5QQne2.js";
|
|
30
31
|
import { i as PLUGIN_SUBPATH_RENAMES, n as BLOCK_SUBPATH_RENAMES, o as SPEC_SUBPATH_RENAMES, t as BLOCK_EXPORT_RENAMES } from "./codemod-block-renames-Dt3X1Wvg.js";
|
|
31
32
|
import { n as PLATFORM_SCHEMAS } from "./in-stack-diff-huI7fGMX.js";
|
|
32
33
|
import { a as staleVariables, i as stackEnvValues, r as redactValue, t as PREFIX_NAMES } from "./stack-env-BQhbUFa7.js";
|
|
33
34
|
import { a as readSharedMemory, n as listStacks, t as branchName } from "./stacks-C5YL6Un9.js";
|
|
34
|
-
import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-
|
|
35
|
+
import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-D2YvkY2D.js";
|
|
35
36
|
import { existsSync } from "node:fs";
|
|
36
|
-
import { dirname, resolve } from "node:path";
|
|
37
|
+
import { dirname, join, relative, resolve } from "node:path";
|
|
37
38
|
import { createHash } from "node:crypto";
|
|
38
39
|
import { glob, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
39
40
|
import { DEFAULT_ACTIVE_TENANT, tenantClaimPaths, tenantNameOf } from "better-supabase/config";
|
|
40
|
-
import { SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_NAMES, TENANT_SCOPE_POLICY, adoptedTables, adoptedViews, appTablePolicyNotes, blockFileState, blockSqlVersion, contractSignature, customContracts, dataExportPlan, excludedColumns, expiredFlagsQuery, hasColumnAccess, migrationOptionUses, moduleDeprecations, moduleEventTriggers, moduleFileVersion, moduleLayout, notNullCheckName, renderBlocks, sameBlockFile, sameTenantColumn, sameTenantTrigger, scopePolicyName, sharedRolesProblems, subjectColumns, widenedCommands } from "better-supabase/sql";
|
|
41
|
+
import { SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_NAMES, TENANT_SCOPE_POLICY, adoptedTables, adoptedViews, appTablePolicyNotes, blockFileState, blockSqlVersion, blockTables, contractSignature, customContracts, dataExportPlan, excludedColumns, expiredFlagsQuery, hasColumnAccess, migrationOptionUses, moduleDeprecations, moduleEventTriggers, moduleFileVersion, moduleLayout, notNullCheckName, renderBlocks, sameBlockFile, sameTenantColumn, sameTenantTrigger, scopePolicyName, sharedRolesProblems, subjectColumns, widenedCommands } from "better-supabase/sql";
|
|
41
42
|
import { defineBucket, parseSize } from "better-supabase/storage";
|
|
42
43
|
// src/cli/doctor/env.ts
|
|
43
44
|
const PUBLIC_PREFIXES = [
|
|
@@ -235,7 +236,7 @@ async function fileState(context, file) {
|
|
|
235
236
|
* the block's to grant.
|
|
236
237
|
*/
|
|
237
238
|
function widenedAppTablePolicies(context) {
|
|
238
|
-
const tables = adoptedTables(context.config.blocks, appTablesOf(context),
|
|
239
|
+
const tables = adoptedTables(context.config.blocks, appTablesOf(context), adoptionContext(context));
|
|
239
240
|
if (tables.length === 0) return [];
|
|
240
241
|
const modules = /* @__PURE__ */ new Map();
|
|
241
242
|
for (const table of tables) {
|
|
@@ -325,7 +326,7 @@ async function keptUpdatedAtTriggers(context) {
|
|
|
325
326
|
* tables keep the app's names, as custom blocks' tables do.
|
|
326
327
|
*/
|
|
327
328
|
function keepsAppsName(context) {
|
|
328
|
-
const adopted = context.config.blockNames.some((name) => moduleDeprecations().some((entry) => entry.module === name && (entry.kind === "table" || entry.kind === "column"))) ? adoptedTables(context.config.blocks, appTablesOf(context),
|
|
329
|
+
const adopted = context.config.blockNames.some((name) => moduleDeprecations().some((entry) => entry.module === name && (entry.kind === "table" || entry.kind === "column"))) ? adoptedTables(context.config.blocks, appTablesOf(context), adoptionContext(context)) : [];
|
|
329
330
|
return (entry) => {
|
|
330
331
|
if (entry.kind !== "table" && entry.kind !== "column") return false;
|
|
331
332
|
if ((context.config.blocks[entry.module]?.mode ?? "managed") !== "managed") return true;
|
|
@@ -418,7 +419,7 @@ const ADOPTION_RULES = [
|
|
|
418
419
|
check: (context) => {
|
|
419
420
|
const { tables } = catalogOf(context);
|
|
420
421
|
const ownTables = Object.fromEntries(tables.map((table) => [qualified(table), "database"]));
|
|
421
|
-
return adoptedTables(context.config.blocks, ownTables,
|
|
422
|
+
return adoptedTables(context.config.blocks, ownTables, adoptionContext(context)).flatMap((adopted) => {
|
|
422
423
|
const table = tables.find((entry) => entry.schema === adopted.schema && entry.name === adopted.table);
|
|
423
424
|
if (table === void 0) return [];
|
|
424
425
|
return adopted.textColumns.flatMap((logical) => {
|
|
@@ -442,7 +443,7 @@ const ADOPTION_RULES = [
|
|
|
442
443
|
check: (context) => {
|
|
443
444
|
const block = context.config.blocks["webhooks-out"];
|
|
444
445
|
if (block === void 0 || block.options?.["defaultFormat"] !== void 0 || typeof block.columns?.["endpoints"]?.["format"] === "string") return [];
|
|
445
|
-
const adopted = adoptedTables(context.config.blocks, appTablesOf(context),
|
|
446
|
+
const adopted = adoptedTables(context.config.blocks, appTablesOf(context), adoptionContext(context)).find((entry) => entry.module === "webhooks-out" && entry.logical === "endpoints");
|
|
446
447
|
if (adopted === void 0) return [];
|
|
447
448
|
const table = catalogOf(context).tables.find((entry) => entry.schema === adopted.schema && entry.name === adopted.table);
|
|
448
449
|
return [{
|
|
@@ -668,6 +669,78 @@ const APP_TABLE_SCOPE_RULES = [{
|
|
|
668
669
|
return findings;
|
|
669
670
|
}
|
|
670
671
|
}];
|
|
672
|
+
// src/cli/doctor/block-writes.ts
|
|
673
|
+
/**
|
|
674
|
+
* A supabase-js write: `.from("x").insert(`, with an optional `.schema("s")`
|
|
675
|
+
* right before it. The groups are the schema, the table and the method.
|
|
676
|
+
*/
|
|
677
|
+
const DIRECT_WRITE = /(?:\.schema\(\s*["'`]([A-Za-z_][\w$]*)["'`]\s*\)\s*)?\.from\(\s*["'`]([A-Za-z_][\w$]*)["'`]\s*\)\s*\.(insert|update|upsert|delete)\s*\(/g;
|
|
678
|
+
/**
|
|
679
|
+
* The tables blocks create. Tables of the app's that a block runs over (ADR 0098)
|
|
680
|
+
* are the app's to write.
|
|
681
|
+
*/
|
|
682
|
+
function ownedTables(context) {
|
|
683
|
+
const own = appTablesOf(context);
|
|
684
|
+
const qualified = /* @__PURE__ */ new Map();
|
|
685
|
+
const named = /* @__PURE__ */ new Map();
|
|
686
|
+
for (const [block, tables] of Object.entries(blockTables(context.config).byBlock)) for (const [logical, table] of Object.entries(tables)) if (!Object.hasOwn(own, table.table)) {
|
|
687
|
+
qualified.set(table.table, {
|
|
688
|
+
block,
|
|
689
|
+
logical,
|
|
690
|
+
table
|
|
691
|
+
});
|
|
692
|
+
if (!named.has(table.name)) named.set(table.name, {
|
|
693
|
+
block,
|
|
694
|
+
logical,
|
|
695
|
+
table
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
return {
|
|
699
|
+
qualified,
|
|
700
|
+
named,
|
|
701
|
+
own
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* The block table a `.from()` writes. Without `.schema()`, a table of the app's
|
|
706
|
+
* in `public` wins; otherwise the name is the block's, reached through a client
|
|
707
|
+
* created with `db: { schema }`.
|
|
708
|
+
*/
|
|
709
|
+
function writtenTable(owned, schema, name) {
|
|
710
|
+
if (schema !== void 0) return owned.qualified.get(`${schema}.${name}`);
|
|
711
|
+
return owned.qualified.get(`public.${name}`) ?? (Object.hasOwn(owned.own, `public.${name}`) ? void 0 : owned.named.get(name));
|
|
712
|
+
}
|
|
713
|
+
const lineAt$2 = (text, index) => text.slice(0, index).split("\n").length;
|
|
714
|
+
/**
|
|
715
|
+
* App code that writes a block's table with supabase-js (BS351), which skips
|
|
716
|
+
* the block's functions: its events, hooks and checks.
|
|
717
|
+
*/
|
|
718
|
+
function directBlockWrites(context) {
|
|
719
|
+
if (context.config.blockNames.length === 0) return [];
|
|
720
|
+
const owned = ownedTables(context);
|
|
721
|
+
if (owned.qualified.size === 0) return [];
|
|
722
|
+
return context.sources.flatMap((file) => [...file.text.matchAll(DIRECT_WRITE)].flatMap((match) => {
|
|
723
|
+
const [, schema, name = "", method = ""] = match;
|
|
724
|
+
const entry = writtenTable(owned, schema, name);
|
|
725
|
+
if (entry === void 0) return [];
|
|
726
|
+
const line = lineAt$2(file.text, match.index);
|
|
727
|
+
return [{
|
|
728
|
+
message: `${file.path}:${String(line)} calls .${method}() on ${entry.table.table}, the ${entry.logical} table of blocks.${entry.block}. A direct write skips the block's functions, so its events, hooks and checks don't run. Write it through the ${entry.block} API that createBlocks returns.`,
|
|
729
|
+
target: `${file.path}:${String(line)}`,
|
|
730
|
+
location: {
|
|
731
|
+
file: file.path,
|
|
732
|
+
line
|
|
733
|
+
}
|
|
734
|
+
}];
|
|
735
|
+
}));
|
|
736
|
+
}
|
|
737
|
+
const BLOCK_WRITE_RULES = [{
|
|
738
|
+
code: "BS351",
|
|
739
|
+
severity: "warning",
|
|
740
|
+
title: "App code writes a block's table directly",
|
|
741
|
+
description: "A source file calls `.from(\"x\").insert()`, `.update()`, `.upsert()` or `.delete()` on a table a block creates (`blockTables(config).byBlock`). The write skips the block's functions, so its events, hooks and the checks it runs before a write don't run, and the block's other tables can disagree with the row. Write it through the block's API from `createBlocks`. Tables of yours that a block runs over are yours to write and are not reported.",
|
|
742
|
+
check: directBlockWrites
|
|
743
|
+
}];
|
|
671
744
|
// src/cli/doctor/claims.ts
|
|
672
745
|
const PERMISSIONS_AUTHORIZER = /\bpermissionsAuthorizer\s*\(/;
|
|
673
746
|
/**
|
|
@@ -756,6 +829,57 @@ const COOKIE_RULES = [{
|
|
|
756
829
|
check: encodingDrift
|
|
757
830
|
}];
|
|
758
831
|
// src/cli/doctor/dependencies.ts
|
|
832
|
+
/** `node_modules` holds a better-supabase the lockfile doesn't name. */
|
|
833
|
+
function installOffLock(context) {
|
|
834
|
+
const { installed, lock } = context.install ?? {};
|
|
835
|
+
if (installed === void 0 || lock === void 0 || lock.versions.length === 0 || lock.versions.includes(installed)) return [];
|
|
836
|
+
return [{
|
|
837
|
+
message: `node_modules has better-supabase@${installed}, but ${lock.path} locks ${lock.versions.join(", ")}. gen, add and upgrade then write the SQL and types of a release your teammates and CI don't run. Run \`${lock.install}\`.`,
|
|
838
|
+
target: lock.path
|
|
839
|
+
}];
|
|
840
|
+
}
|
|
841
|
+
const AHEAD = "A newer better-supabase release wrote it, so this install is behind: install the release your lockfile and teammates use, then run `better-supabase upgrade --check`.";
|
|
842
|
+
/** Block files or `better_supabase.blocks` rows newer than this release. */
|
|
843
|
+
async function blocksAhead(context) {
|
|
844
|
+
if (context.config.blockNames.length === 0) return [];
|
|
845
|
+
const ships = `better-supabase@${VERSION$1}`;
|
|
846
|
+
const findings = [];
|
|
847
|
+
for (const { file, path, installed } of await moduleFiles(context)) {
|
|
848
|
+
const version = moduleFileVersion(file.contents)?.version ?? 1;
|
|
849
|
+
if (file.kind !== "schema" || installed === void 0 || installed <= version) continue;
|
|
850
|
+
findings.push({
|
|
851
|
+
message: `${path} has ${file.instance ?? file.module} version ${String(installed)}; ${ships} ships version ${String(version)}. ${AHEAD}`,
|
|
852
|
+
target: path,
|
|
853
|
+
location: {
|
|
854
|
+
file: path,
|
|
855
|
+
line: 1
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
const db = context.database;
|
|
860
|
+
if (!db || "skipped" in db) return findings;
|
|
861
|
+
let rows;
|
|
862
|
+
try {
|
|
863
|
+
rows = await db.query("select name, to_jsonb(b) ->> 'block' as block, version from better_supabase.blocks b");
|
|
864
|
+
} catch {
|
|
865
|
+
return findings;
|
|
866
|
+
}
|
|
867
|
+
for (const row of rows) {
|
|
868
|
+
const instance = context.config.instances[row.name];
|
|
869
|
+
const module = SQL_MODULES[row.block ?? instance?.block ?? row.name];
|
|
870
|
+
if (!module || instance === void 0) continue;
|
|
871
|
+
const version = blockSqlVersion(module);
|
|
872
|
+
if (row.version <= version) continue;
|
|
873
|
+
findings.push({
|
|
874
|
+
message: `The database has ${row.name} version ${String(row.version)}; ${ships} ships version ${String(version)}. ${AHEAD}`,
|
|
875
|
+
target: `better_supabase.blocks.${row.name}`
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
return findings;
|
|
879
|
+
}
|
|
880
|
+
async function releaseMismatch(context) {
|
|
881
|
+
return [...installOffLock(context), ...await blocksAhead(context)];
|
|
882
|
+
}
|
|
759
883
|
function contentMapperSetup(context) {
|
|
760
884
|
const setup = context.contentMapper;
|
|
761
885
|
if (context.config.gen.contentMapper !== true || setup === void 0) return [];
|
|
@@ -774,22 +898,32 @@ function contentMapperSetup(context) {
|
|
|
774
898
|
});
|
|
775
899
|
return findings;
|
|
776
900
|
}
|
|
777
|
-
const DEPENDENCY_RULES = [
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
901
|
+
const DEPENDENCY_RULES = [
|
|
902
|
+
{
|
|
903
|
+
code: "BS601",
|
|
904
|
+
severity: "warning",
|
|
905
|
+
title: "Peer outside its range",
|
|
906
|
+
description: "An optional peer of better-supabase is installed at a version outside the range better-supabase declares. With strict peer checks the install fails, and the subpath that needs the peer can break at runtime.",
|
|
907
|
+
check: (context) => (context.peers ?? []).flatMap((peer) => peer.installed !== void 0 && satisfies(peer.installed, peer.range) === false ? [{
|
|
908
|
+
message: `${peer.name}@${peer.installed} is installed, but better-supabase needs ${peer.range}. Install a version in that range, or remove ${peer.name} if nothing imports it.`,
|
|
909
|
+
target: peer.name
|
|
910
|
+
}] : [])
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
code: "BS602",
|
|
914
|
+
severity: "error",
|
|
915
|
+
title: "Content mapper not set up",
|
|
916
|
+
description: "gen.contentMapper is on, but tsc can't load the content mapper: tsconfig.json has no contentMappers entry for better-supabase, the project resolves TypeScript older than 7.1, or the typecheck script runs tsc without --runExternalCode. Imports of schema.bsb then have no types.",
|
|
917
|
+
check: contentMapperSetup
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
code: "BS607",
|
|
921
|
+
severity: "warning",
|
|
922
|
+
title: "Installed better-supabase differs from the lockfile or the database",
|
|
923
|
+
description: "The better-supabase in `node_modules` is not a version the lockfile resolves, or a block file or `better_supabase.blocks` records a block version newer than the installed release ships. Either way the CLI renders SQL and types for another release than the one your team and CI run. Run the package manager's install, or install the release that wrote the newer blocks.",
|
|
924
|
+
check: releaseMismatch
|
|
925
|
+
}
|
|
926
|
+
];
|
|
793
927
|
// src/cli/doctor/flags.ts
|
|
794
928
|
/** Flags past their `expires_at` extra column that aren't archived. */
|
|
795
929
|
async function expiredFlags(context) {
|
|
@@ -1475,7 +1609,7 @@ function attachmentSubjects(context) {
|
|
|
1475
1609
|
* only with one of `keys`.
|
|
1476
1610
|
*/
|
|
1477
1611
|
function tenantOnly(expression, column, keys) {
|
|
1478
|
-
const col = `(?:"?\\w+"?\\.)?"?${escape$
|
|
1612
|
+
const col = `(?:"?\\w+"?\\.)?"?${escape$3(column)}"?(?:::\\w+)?`;
|
|
1479
1613
|
const key = `'([^']*)'(?:::text)?`;
|
|
1480
1614
|
const atoms = [
|
|
1481
1615
|
`${col}\\s*=\\s*\\(?\\s*(?:select\\s+)?better_supabase\\.current_tenant_id\\(\\)(?:\\s+as\\s+\\w+)?`,
|
|
@@ -1772,7 +1906,7 @@ async function missingAdoptedColumns(context) {
|
|
|
1772
1906
|
if (!db || "skipped" in db) return [];
|
|
1773
1907
|
const tables = adoptedTables(context.config.blocks, appTablesOf(context), {
|
|
1774
1908
|
...appViewsOf(context),
|
|
1775
|
-
|
|
1909
|
+
...adoptionContext(context)
|
|
1776
1910
|
});
|
|
1777
1911
|
if (tables.length === 0) return [];
|
|
1778
1912
|
const names = tables.map((table) => `(${literal$1(table.schema)}, ${literal$1(table.table)})`).join(", ");
|
|
@@ -2339,6 +2473,51 @@ function aal2WithoutMfa(context) {
|
|
|
2339
2473
|
}
|
|
2340
2474
|
}];
|
|
2341
2475
|
}
|
|
2476
|
+
// src/cli/doctor/next-cache.ts
|
|
2477
|
+
/** The `next.config` file names Next.js loads, in its order. */
|
|
2478
|
+
const NEXT_CONFIG_FILES = [
|
|
2479
|
+
"next.config.ts",
|
|
2480
|
+
"next.config.mts",
|
|
2481
|
+
"next.config.mjs",
|
|
2482
|
+
"next.config.js"
|
|
2483
|
+
];
|
|
2484
|
+
/** Files whose presence means the app deploys to Vercel. */
|
|
2485
|
+
const VERCEL_FILES = [
|
|
2486
|
+
"vercel.ts",
|
|
2487
|
+
"vercel.json",
|
|
2488
|
+
".vercel/project.json"
|
|
2489
|
+
];
|
|
2490
|
+
/** A remote cache scope that `bsb.cached()` or `bsb.bootstrap()` reads. */
|
|
2491
|
+
const REMOTE_SCOPE = /\bbsb\.remote\s*\(|\bscope\s*:\s*["'`]remote["'`]|["'`]use cache: remote["'`]/;
|
|
2492
|
+
/** `cacheHandlers.remote`, or `createNextConfig`'s `remoteCacheHandler`. */
|
|
2493
|
+
const REMOTE_HANDLER = /\bremoteCacheHandler\s*:|\bcacheHandlers\s*:\s*\{[^}]*\bremote\s*:/s;
|
|
2494
|
+
/**
|
|
2495
|
+
* `'use cache: remote'` entries without a remote handler outside Vercel
|
|
2496
|
+
* (BS608): Next.js keeps them in each instance's memory, so every instance and
|
|
2497
|
+
* every deploy misses on its own.
|
|
2498
|
+
*/
|
|
2499
|
+
function remoteWithoutHandler(context) {
|
|
2500
|
+
if (context.vercel === true) return [];
|
|
2501
|
+
const config = context.nextConfig;
|
|
2502
|
+
if (config && REMOTE_HANDLER.test(config.text)) return [];
|
|
2503
|
+
const file = context.sources.find((source) => REMOTE_SCOPE.test(source.text));
|
|
2504
|
+
if (!file) return [];
|
|
2505
|
+
return [{
|
|
2506
|
+
message: `${file.path} caches in the remote scope, but ${config?.path ?? "next.config"} sets no remote cache handler and the app doesn't deploy to Vercel. Each instance then keeps its own in-memory copy. Set \`remoteCacheHandler\` in createNextConfig (or \`cacheHandlers.remote\`) to a shared handler such as Redis.`,
|
|
2507
|
+
target: `${file.path}:remote`,
|
|
2508
|
+
location: {
|
|
2509
|
+
file: file.path,
|
|
2510
|
+
line: lineOf(file.text, REMOTE_SCOPE) ?? 1
|
|
2511
|
+
}
|
|
2512
|
+
}];
|
|
2513
|
+
}
|
|
2514
|
+
const NEXT_CACHE_RULES = [{
|
|
2515
|
+
code: "BS608",
|
|
2516
|
+
severity: "warning",
|
|
2517
|
+
title: "Remote cache scope without a remote cache handler",
|
|
2518
|
+
description: "`bsb.remote()` and `bsb.cached({ scope: \"remote\" })` run in `'use cache: remote'`. Vercel provides a shared remote handler; elsewhere Next.js falls back to an in-memory one per instance, so entries are never shared and every deploy starts cold. Set `cacheHandlers.remote` (`remoteCacheHandler` in `createNextConfig`).",
|
|
2519
|
+
check: remoteWithoutHandler
|
|
2520
|
+
}];
|
|
2342
2521
|
// src/cli/doctor/not-valid.ts
|
|
2343
2522
|
/** `(organization_id IS NOT NULL)` as `organization_id`. */
|
|
2344
2523
|
const NOT_NULL = /^\(*\s*("(?:[^"]|"")+"|[\w$]+)\s+is\s+not\s+null\s*\)*$/iu;
|
|
@@ -2562,6 +2741,60 @@ const PGDELTA_RULES = [
|
|
|
2562
2741
|
check: missingExtensions
|
|
2563
2742
|
}
|
|
2564
2743
|
];
|
|
2744
|
+
// src/cli/doctor/plain-secrets.ts
|
|
2745
|
+
/**
|
|
2746
|
+
* The blocks that keep a secret out of the row, in the order doctor offers
|
|
2747
|
+
* them.
|
|
2748
|
+
*/
|
|
2749
|
+
const SECRET_BLOCKS = ["field-encryption", "credentials"];
|
|
2750
|
+
/**
|
|
2751
|
+
* A column named for a secret: `credentials`, `access_token`, `client_secret`.
|
|
2752
|
+
* `token_hash`, `secret_id` and `credential_ref` end in another word, so they
|
|
2753
|
+
* don't match.
|
|
2754
|
+
*/
|
|
2755
|
+
const SECRET_NAME = /(?:^|_)(?:credentials?|tokens?|secrets?)$/i;
|
|
2756
|
+
/** Types that hold the value as written. */
|
|
2757
|
+
const PLAIN_TYPES = /* @__PURE__ */ new Set([
|
|
2758
|
+
"text",
|
|
2759
|
+
"varchar",
|
|
2760
|
+
"bpchar",
|
|
2761
|
+
"json",
|
|
2762
|
+
"jsonb"
|
|
2763
|
+
]);
|
|
2764
|
+
function remedy(block, table, column) {
|
|
2765
|
+
switch (block) {
|
|
2766
|
+
case "field-encryption": return `set \`encrypted: true\` on appTables.${table.name}.columns.${column} so field-encryption stores it as ciphertext under a Vault data key`;
|
|
2767
|
+
case "credentials": return "store the secret in Vault with the credentials block and keep a credential_ref jsonb in the row";
|
|
2768
|
+
default: return block;
|
|
2769
|
+
}
|
|
2770
|
+
}
|
|
2771
|
+
const encryptedInConfig = (context, table, column) => table.schema === "public" && context.config.appTables[table.name]?.columns?.[column.name]?.encrypted === true;
|
|
2772
|
+
/**
|
|
2773
|
+
* Plain secret columns in the app's tables while a block that would keep them
|
|
2774
|
+
* out of the row is installed (BS352).
|
|
2775
|
+
*/
|
|
2776
|
+
function plainSecretColumns(context) {
|
|
2777
|
+
const offered = SECRET_BLOCKS.filter((block) => context.config.blockNames.includes(block));
|
|
2778
|
+
if (offered.length === 0) return [];
|
|
2779
|
+
const own = appTablesOf(context);
|
|
2780
|
+
const blockOwned = new Set(Object.values(blockTables(context.config).byBlock).flatMap((tables) => Object.values(tables).map((table) => table.table)));
|
|
2781
|
+
return catalogOf(context).tables.filter((table) => table.kind === "table" && Object.hasOwn(own, qualified(table)) && !blockOwned.has(qualified(table))).flatMap((table) => table.columns.filter((column) => SECRET_NAME.test(column.name) && PLAIN_TYPES.has(column.udt) && !column.generated && !encryptedInConfig(context, table, column)).map((column) => {
|
|
2782
|
+
const target = `${qualified(table)}.${column.name}`;
|
|
2783
|
+
const fixes = offered.map((block) => remedy(block, table, column.name));
|
|
2784
|
+
return {
|
|
2785
|
+
message: `${target} stores a ${column.udt} value named like a secret in plain text, and ${offered.join(" and ")} ${offered.length === 1 ? "is" : "are"} installed. Anyone who can read the row or a backup reads the secret. To keep it out of the row, ${fixes.join(", or ")}.`,
|
|
2786
|
+
target,
|
|
2787
|
+
object: tableObject(table)
|
|
2788
|
+
};
|
|
2789
|
+
}));
|
|
2790
|
+
}
|
|
2791
|
+
const PLAIN_SECRET_RULES = [{
|
|
2792
|
+
code: "BS352",
|
|
2793
|
+
severity: "warning",
|
|
2794
|
+
title: "Plain secret column next to a block that encrypts it",
|
|
2795
|
+
description: "One of your tables has a `text`, `varchar` or `json` column whose name ends in `credentials`, `token` or `secret`, and `field-encryption` or `credentials` is installed. The value sits in the row as written, so every role that reads the row, and every backup, has the secret. Mark the column `encrypted: true` in `appTables` (field-encryption), or move the secret to Vault with the credentials block and store a `credential_ref` instead. Block tables, columns already marked `encrypted` and names such as `token_hash` or `secret_id` are not reported.",
|
|
2796
|
+
check: plainSecretColumns
|
|
2797
|
+
}];
|
|
2565
2798
|
// src/cli/doctor/policies.ts
|
|
2566
2799
|
const AUTH_ROLE = /\bauth"?\s*\.\s*"?role"?\s*\(\s*\)/i;
|
|
2567
2800
|
/** A check of who is calling: the JWT, the user id, or the session role. */
|
|
@@ -2803,7 +3036,7 @@ const POLICY_RULES = [
|
|
|
2803
3036
|
const dot = name.indexOf(".");
|
|
2804
3037
|
const schema = name.slice(0, dot);
|
|
2805
3038
|
if (schema === "auth" || volatility.get(name) === "immutable") return false;
|
|
2806
|
-
return new RegExp(`(?<!\\bselect\\s+)(?<![\\w."])(?:"?${escape$
|
|
3039
|
+
return new RegExp(`(?<!\\bselect\\s+)(?<![\\w."])(?:"?${escape$3(schema)}"?\\.)?"?${escape$3(name.slice(dot + 1))}"?\\s*\\(\\s*\\)`, "i").test(text);
|
|
2807
3040
|
});
|
|
2808
3041
|
if (bare.length === 0) return [];
|
|
2809
3042
|
return [{
|
|
@@ -2981,7 +3214,7 @@ const APP_COLUMN_FORMAT = {
|
|
|
2981
3214
|
*/
|
|
2982
3215
|
const skipsNullKeys = (predicate, columns) => {
|
|
2983
3216
|
if (!predicate) return false;
|
|
2984
|
-
return predicate.split(/\s+AND\s+/i).every((part) => columns.some((column) => new RegExp(`^\\(*\\s*"?${escape$
|
|
3217
|
+
return predicate.split(/\s+AND\s+/i).every((part) => columns.some((column) => new RegExp(`^\\(*\\s*"?${escape$3(column)}"?\\s+IS\\s+NOT\\s+NULL\\s*\\)*$`, "i").test(part.trim())));
|
|
2985
3218
|
};
|
|
2986
3219
|
/**
|
|
2987
3220
|
* Whether the first `columns.length` columns of an index are exactly `columns`,
|
|
@@ -3081,7 +3314,7 @@ const SCHEMA_DESIGN_RULES = [
|
|
|
3081
3314
|
if (table.kind !== "table") return [];
|
|
3082
3315
|
const column = table.columns.find((entry) => SOFT_DELETE.test(entry.name) && entry.nullable);
|
|
3083
3316
|
if (!column) return [];
|
|
3084
|
-
const isNull = new RegExp(`"?${escape$
|
|
3317
|
+
const isNull = new RegExp(`"?${escape$3(column.name)}"?\\s+IS\\s+NULL`, "i");
|
|
3085
3318
|
if (table.indexes.some((index) => index.partial && (index.predicate === void 0 || index.predicate !== null && isNull.test(index.predicate)))) return [];
|
|
3086
3319
|
return [{
|
|
3087
3320
|
message: `${qualified(table)} soft-deletes with ${column.name}, but no index has \`where ${column.name} is null\`. Index the live rows you list, for example \`create index on ${qualified(table)} (created_at desc) where ${column.name} is null;\`.`,
|
|
@@ -3106,7 +3339,7 @@ const SCHEMA_DESIGN_RULES = [
|
|
|
3106
3339
|
return table.columns.filter((column) => {
|
|
3107
3340
|
if (!column.isArray && column.udt !== "jsonb") return false;
|
|
3108
3341
|
if (table.indexes.some((index) => index.columns[0] === column.name && (index.method === void 0 || index.method === "gin"))) return false;
|
|
3109
|
-
const used = new RegExp(`"?${escape$
|
|
3342
|
+
const used = new RegExp(`"?${escape$3(column.name)}"?\\s*${CONTAINS}|${CONTAINS}\\s*[\\w."]*\\b${escape$3(column.name)}\\b`);
|
|
3110
3343
|
return filtered.has(column.name) || used.test(own) || functions.includes(table.name) && used.test(functions);
|
|
3111
3344
|
}).map((column) => ({
|
|
3112
3345
|
message: `${qualified(table)}.${column.name} is filtered by containment but has no GIN index, so each query scans the table. Run \`create index on ${qualified(table)} using gin (${column.name}${column.udt === "jsonb" ? " jsonb_path_ops" : ""});\`${column.udt === "jsonb" ? " (`jsonb_path_ops` supports `@>` only; drop it for `?`)" : ""}.`,
|
|
@@ -3364,13 +3597,13 @@ function listedKeys(files) {
|
|
|
3364
3597
|
})));
|
|
3365
3598
|
}
|
|
3366
3599
|
const camel = (name) => name.replaceAll(/-([a-z0-9])/g, (_, letter) => letter.toUpperCase());
|
|
3367
|
-
const escape$
|
|
3600
|
+
const escape$2 = (text) => text.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3368
3601
|
/**
|
|
3369
3602
|
* Whether a source line outside a comment passes the instance a provider:
|
|
3370
3603
|
* `enrichment: blocks.enrichment.with({ provider })` or `.using(...)`.
|
|
3371
3604
|
*/
|
|
3372
3605
|
function wired(sources, entry) {
|
|
3373
|
-
const keys = [.../* @__PURE__ */ new Set([entry.instance, camel(entry.instance)])].map(escape$
|
|
3606
|
+
const keys = [.../* @__PURE__ */ new Set([entry.instance, camel(entry.instance)])].map(escape$2);
|
|
3374
3607
|
const pattern = new RegExp(`(?:^|[\\s{,])["']?(?:${keys.join("|")})["']?\\s*:\\s*[\\w$.\\[\\]"'-]*\\.(?:with|using)\\(`);
|
|
3375
3608
|
return sources.some((file) => file.text.split("\n").some((line) => {
|
|
3376
3609
|
const code = line.trim();
|
|
@@ -3932,6 +4165,7 @@ const RULES = [
|
|
|
3932
4165
|
...SCHEMA_DESIGN_RULES,
|
|
3933
4166
|
...HOOK_RULES,
|
|
3934
4167
|
...COOKIE_RULES,
|
|
4168
|
+
...NEXT_CACHE_RULES,
|
|
3935
4169
|
...CLAIM_RULES,
|
|
3936
4170
|
...REMOVED_API_RULES,
|
|
3937
4171
|
...AUTHORIZATION_RULES,
|
|
@@ -3944,6 +4178,8 @@ const RULES = [
|
|
|
3944
4178
|
...FLAG_RULES,
|
|
3945
4179
|
...REALTIME_RULES,
|
|
3946
4180
|
...ADOPTION_RULES,
|
|
4181
|
+
...BLOCK_WRITE_RULES,
|
|
4182
|
+
...PLAIN_SECRET_RULES,
|
|
3947
4183
|
...MIGRATION_SAFETY_RULES,
|
|
3948
4184
|
...NOT_VALID_RULES,
|
|
3949
4185
|
...APP_TABLE_SCOPE_RULES,
|
|
@@ -4277,16 +4513,16 @@ function openLive(config, env, source, pg) {
|
|
|
4277
4513
|
};
|
|
4278
4514
|
}
|
|
4279
4515
|
// src/cli/doctor/locate.ts
|
|
4280
|
-
const escape = (name) => name.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4516
|
+
const escape$1 = (name) => name.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
4281
4517
|
/**
|
|
4282
4518
|
* Where a table, function or policy is declared: declarative schemas first,
|
|
4283
4519
|
* then the newest migration.
|
|
4284
4520
|
*/
|
|
4285
4521
|
function locate(files, object) {
|
|
4286
|
-
const name = `"?${escape(object.name)}"?`;
|
|
4287
|
-
const qualifiedName = `(?:"?${escape(object.schema)}"?\\.)?${name}`;
|
|
4522
|
+
const name = `"?${escape$1(object.name)}"?`;
|
|
4523
|
+
const qualifiedName = `(?:"?${escape$1(object.schema)}"?\\.)?${name}`;
|
|
4288
4524
|
if (object.kind === "policy" && object.table !== void 0) {
|
|
4289
|
-
const onTable = new RegExp(`create\\s+policy\\s+${name}\\s+on\\s+(?:only\\s+)?(?:"?${escape(object.schema)}"?\\.)?"?${escape(object.table)}"?(?:\\s|;|$)`, "i");
|
|
4525
|
+
const onTable = new RegExp(`create\\s+policy\\s+${name}\\s+on\\s+(?:only\\s+)?(?:"?${escape$1(object.schema)}"?\\.)?"?${escape$1(object.table)}"?(?:\\s|;|$)`, "i");
|
|
4290
4526
|
for (const file of files) {
|
|
4291
4527
|
const match = onTable.exec(file.text);
|
|
4292
4528
|
if (match) return {
|
|
@@ -4348,6 +4584,101 @@ function explainClaims(args) {
|
|
|
4348
4584
|
return { error: `--claims is not valid JSON: ${errorText(cause)}` };
|
|
4349
4585
|
}
|
|
4350
4586
|
}
|
|
4587
|
+
// src/cli/lockfile.ts
|
|
4588
|
+
/** The lockfiles doctor reads, in the order it looks for them in a folder. */
|
|
4589
|
+
const LOCKFILES = [
|
|
4590
|
+
"pnpm-lock.yaml",
|
|
4591
|
+
"package-lock.json",
|
|
4592
|
+
"yarn.lock",
|
|
4593
|
+
"bun.lock"
|
|
4594
|
+
];
|
|
4595
|
+
const INSTALL = {
|
|
4596
|
+
"pnpm-lock.yaml": "pnpm install",
|
|
4597
|
+
"package-lock.json": "npm install",
|
|
4598
|
+
"yarn.lock": "yarn install",
|
|
4599
|
+
"bun.lock": "bun install"
|
|
4600
|
+
};
|
|
4601
|
+
const escape = (text) => text.replaceAll(/[.*+?^${}()|[\]\\/]/g, String.raw`\$&`);
|
|
4602
|
+
/** A semver version at the start of a string, without pnpm's peer suffix. */
|
|
4603
|
+
const VERSION = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?/;
|
|
4604
|
+
function packageLockVersions(name, text) {
|
|
4605
|
+
let data;
|
|
4606
|
+
try {
|
|
4607
|
+
data = JSON.parse(text);
|
|
4608
|
+
} catch {
|
|
4609
|
+
return [];
|
|
4610
|
+
}
|
|
4611
|
+
const packages = typeof data === "object" && data !== null && "packages" in data ? data.packages : void 0;
|
|
4612
|
+
if (typeof packages !== "object" || packages === null) return [];
|
|
4613
|
+
return Object.entries(packages).flatMap(([path, entry]) => (path === `node_modules/${name}` || path.endsWith(`/node_modules/${name}`)) && typeof entry === "object" && entry !== null && "version" in entry && typeof entry.version === "string" && !("link" in entry && entry.link === true) ? [entry.version] : []);
|
|
4614
|
+
}
|
|
4615
|
+
/**
|
|
4616
|
+
* The registry versions of `name` that `text`, a lockfile of kind `kind`,
|
|
4617
|
+
* resolves. Each format names a package by its resolved version:
|
|
4618
|
+
* `name@1.2.3(peer@4)` keys in pnpm, `node_modules/name` entries in npm, a
|
|
4619
|
+
* `version` line under the `name@range` header in yarn, and `"name@1.2.3"` in
|
|
4620
|
+
* bun.
|
|
4621
|
+
*/
|
|
4622
|
+
function lockedVersions(kind, name, text) {
|
|
4623
|
+
const at = escape(name);
|
|
4624
|
+
let found;
|
|
4625
|
+
switch (kind) {
|
|
4626
|
+
case "pnpm-lock.yaml":
|
|
4627
|
+
found = [...text.matchAll(new RegExp(String.raw`^\s+['"]?/?${at}@([^:'"\s]+)['"]?:`, "gm"))].map((match) => match[1] ?? "");
|
|
4628
|
+
break;
|
|
4629
|
+
case "package-lock.json":
|
|
4630
|
+
found = packageLockVersions(name, text);
|
|
4631
|
+
break;
|
|
4632
|
+
case "yarn.lock":
|
|
4633
|
+
found = [...text.matchAll(new RegExp(String.raw`^"?${at}@(?!workspace:|link:|portal:|file:)[^\n]*:\n(?:[ \t]+[^\n]*\n)*?[ \t]+version:? "?([^"\n]+)"?`, "gm"))].map((match) => match[1] ?? "");
|
|
4634
|
+
break;
|
|
4635
|
+
case "bun.lock":
|
|
4636
|
+
found = [...text.matchAll(new RegExp(String.raw`"${at}@([^"]+)"`, "g"))].map((match) => match[1] ?? "");
|
|
4637
|
+
break;
|
|
4638
|
+
default: return kind;
|
|
4639
|
+
}
|
|
4640
|
+
return [...new Set(found.flatMap((version) => {
|
|
4641
|
+
const match = VERSION.exec(version);
|
|
4642
|
+
return match ? [match[0]] : [];
|
|
4643
|
+
}))];
|
|
4644
|
+
}
|
|
4645
|
+
async function readLockfile(dir) {
|
|
4646
|
+
for (const kind of LOCKFILES) {
|
|
4647
|
+
const path = join(dir, kind);
|
|
4648
|
+
const text = await readFile(path, "utf-8").catch(() => void 0);
|
|
4649
|
+
if (text !== void 0) return {
|
|
4650
|
+
kind,
|
|
4651
|
+
path,
|
|
4652
|
+
text
|
|
4653
|
+
};
|
|
4654
|
+
}
|
|
4655
|
+
}
|
|
4656
|
+
/**
|
|
4657
|
+
* The versions of `name` in the nearest lockfile at or above `root`, the one
|
|
4658
|
+
* the package manager installs from.
|
|
4659
|
+
*/
|
|
4660
|
+
async function lockedPackage(name, root) {
|
|
4661
|
+
let dir = root;
|
|
4662
|
+
for (;;) {
|
|
4663
|
+
const lockfile = await readLockfile(dir);
|
|
4664
|
+
if (lockfile) return {
|
|
4665
|
+
path: relative(root, lockfile.path),
|
|
4666
|
+
install: INSTALL[lockfile.kind],
|
|
4667
|
+
versions: lockedVersions(lockfile.kind, name, lockfile.text)
|
|
4668
|
+
};
|
|
4669
|
+
const parent = dirname(dir);
|
|
4670
|
+
if (parent === dir) return;
|
|
4671
|
+
dir = parent;
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
/** The better-supabase that `root` installs, next to the lockfile's (BS607). */
|
|
4675
|
+
async function betterSupabaseInstall(root) {
|
|
4676
|
+
const [installed, lock] = await Promise.all([installedVersion("better-supabase", root), lockedPackage("better-supabase", root)]);
|
|
4677
|
+
return {
|
|
4678
|
+
installed,
|
|
4679
|
+
lock
|
|
4680
|
+
};
|
|
4681
|
+
}
|
|
4351
4682
|
// src/cli/commands/doctor.ts
|
|
4352
4683
|
const ARGS = {
|
|
4353
4684
|
format: {
|
|
@@ -4497,7 +4828,8 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
4497
4828
|
...options.advisors === void 0 ? {} : { advisors: options.advisors },
|
|
4498
4829
|
...options.database === void 0 ? {} : { database: options.database }
|
|
4499
4830
|
};
|
|
4500
|
-
const
|
|
4831
|
+
const vercel = VERCEL_FILES.some((path) => existsSync(resolve(config.root, path)));
|
|
4832
|
+
const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers, contentMapper, stackEnv, localStacks, nextConfig, install] = await Promise.all([
|
|
4501
4833
|
options.snapshot ?? loadSnapshot(config, env, source, pg, opened.open),
|
|
4502
4834
|
Promise.all(ENV_FILES.map((path) => readText(config.root, path))).then((files) => files.filter((file) => file !== void 0)),
|
|
4503
4835
|
readSupabaseToml(config.root).then(async (toml) => [toml, await sqlFiles(config.root, toml, sqlWorkflow(config, toml))]),
|
|
@@ -4507,7 +4839,9 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
4507
4839
|
options.peers ?? peerVersions(config.root).catch(() => []),
|
|
4508
4840
|
options.contentMapper ?? (config.gen.contentMapper === true && rules.some((rule) => rule.code === "BS602") ? contentMapperSetup$1(config.root) : void 0),
|
|
4509
4841
|
options.stackEnv ?? (rules.some((rule) => rule.code === "BS503") ? loadStackEnvCheck(config.root, env, options.signal) : void 0),
|
|
4510
|
-
options.localStacks ?? (rules.some((rule) => rule.code === "BS700" || rule.code === "BS701") ? loadLocalStackCheck(config.root, env) : void 0)
|
|
4842
|
+
options.localStacks ?? (rules.some((rule) => rule.code === "BS700" || rule.code === "BS701") ? loadLocalStackCheck(config.root, env) : void 0),
|
|
4843
|
+
Promise.all(NEXT_CONFIG_FILES.map((path) => readText(config.root, path))).then((files) => files.find((file) => file !== void 0)),
|
|
4844
|
+
options.install ?? (rules.some((rule) => rule.code === "BS607") ? betterSupabaseInstall(config.root).catch(() => void 0) : void 0)
|
|
4511
4845
|
]).catch(async (cause) => {
|
|
4512
4846
|
await opened.close();
|
|
4513
4847
|
throw cause;
|
|
@@ -4527,10 +4861,13 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
4527
4861
|
sources,
|
|
4528
4862
|
readSets,
|
|
4529
4863
|
peers,
|
|
4864
|
+
...install ? { install } : {},
|
|
4530
4865
|
...contentMapper ? { contentMapper } : {},
|
|
4531
4866
|
...stackEnv ? { stackEnv } : {},
|
|
4532
4867
|
shellEnv: env[PROCESS_ENV] ?? {},
|
|
4533
4868
|
...localStacks ? { localStacks } : {},
|
|
4869
|
+
...nextConfig ? { nextConfig } : {},
|
|
4870
|
+
vercel,
|
|
4534
4871
|
...live.advisors ? { advisors: live.advisors } : {},
|
|
4535
4872
|
...live.database ? { database: live.database } : {},
|
|
4536
4873
|
...stats ? { stats } : {},
|
|
@@ -4584,7 +4921,7 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
4584
4921
|
} : finding) : findings, {
|
|
4585
4922
|
format,
|
|
4586
4923
|
rules,
|
|
4587
|
-
version: VERSION,
|
|
4924
|
+
version: VERSION$1,
|
|
4588
4925
|
fallbackFile: repoPath(context.configToml?.path ?? "package.json"),
|
|
4589
4926
|
...options.paint && !out ? { paint: options.paint } : {}
|
|
4590
4927
|
});
|
|
@@ -4620,7 +4957,7 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
4620
4957
|
}
|
|
4621
4958
|
return format === "json" ? {
|
|
4622
4959
|
code,
|
|
4623
|
-
data: jsonReport(findings, VERSION),
|
|
4960
|
+
data: jsonReport(findings, VERSION$1),
|
|
4624
4961
|
...failure
|
|
4625
4962
|
} : {
|
|
4626
4963
|
code,
|