better-supabase 0.11.0 → 0.12.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-B2WRsRIg.js → adapter-CRNH2aX_.js} +362 -253
- package/dist/{agents-CbUIrH-w.d.ts → agents-CGP2AQge.d.ts} +1 -1
- package/dist/{ai-files-DXbgWA5M.js → ai-files-ChFDkMLN.js} +12 -4
- package/dist/ai-sdk/agents/index.d.ts +3 -3
- package/dist/ai-sdk/batches/index.d.ts +1 -1
- package/dist/ai-sdk/embeddings/index.d.ts +2 -2
- package/dist/ai-sdk/files/index.d.ts +1 -1
- package/dist/ai-sdk/files/index.js +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/memory/index.d.ts +2 -2
- package/dist/{ai-tasks-BJJChl-D.d.ts → ai-tasks-ZvPnNudQ.d.ts} +1 -1
- package/dist/{api-keys-qnM63qjS.d.ts → api-keys-AgDXbcql.d.ts} +1 -1
- package/dist/{approvals-CRZtzxNt.d.ts → approvals-CyX709B-.d.ts} +1 -1
- package/dist/astro/index.d.ts +6 -6
- package/dist/astro/index.js +2 -2
- package/dist/{attachments-Bk3tyeUF.js → attachments-CK8D8bIV.js} +8 -2
- package/dist/{authorization-hooks-mLi894KH.d.ts → authorization-hooks-WDQMKIsc.d.ts} +1 -1
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-CTNKpBM6.d.ts → bind-Bfo40o63.d.ts} +3 -3
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/agents/index.d.ts +2 -2
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-chat/index.d.ts +2 -2
- package/dist/blocks/ai-chat/react/index.d.ts +1 -1
- package/dist/blocks/ai-chat/solid/index.d.ts +2 -2
- package/dist/blocks/ai-chat/svelte/index.d.ts +2 -2
- package/dist/blocks/ai-chat/vue/index.d.ts +2 -2
- package/dist/blocks/ai-files/index.d.ts +2 -2
- package/dist/blocks/ai-files/index.js +1 -1
- package/dist/blocks/ai-providers/index.d.ts +2 -2
- package/dist/blocks/ai-tasks/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +2 -2
- package/dist/blocks/announcements/react/index.d.ts +1 -1
- package/dist/blocks/announcements/solid/index.d.ts +2 -2
- package/dist/blocks/announcements/svelte/index.d.ts +2 -2
- package/dist/blocks/announcements/vue/index.d.ts +2 -2
- package/dist/blocks/api-keys/index.d.ts +4 -4
- package/dist/blocks/api-keys/react/index.d.ts +1 -1
- package/dist/blocks/api-keys/react/server.d.ts +1 -1
- package/dist/blocks/api-keys/solid/index.d.ts +2 -2
- package/dist/blocks/api-keys/svelte/index.d.ts +2 -2
- package/dist/blocks/api-keys/vue/index.d.ts +2 -2
- package/dist/blocks/approvals/index.d.ts +2 -2
- package/dist/blocks/attachments/index.d.ts +2 -2
- package/dist/blocks/attachments/index.js +1 -1
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/audit/react/index.d.ts +1 -1
- package/dist/blocks/audit/react/server.d.ts +1 -1
- package/dist/blocks/audit/solid/index.d.ts +2 -2
- package/dist/blocks/audit/svelte/index.d.ts +2 -2
- package/dist/blocks/audit/vue/index.d.ts +2 -2
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/billing/react/index.d.ts +1 -1
- package/dist/blocks/billing/react/server.d.ts +1 -1
- package/dist/blocks/billing/solid/index.d.ts +2 -2
- package/dist/blocks/billing/svelte/index.d.ts +2 -2
- package/dist/blocks/billing/vue/index.d.ts +2 -2
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bookings/react/index.d.ts +1 -1
- package/dist/blocks/bookings/solid/index.d.ts +2 -2
- package/dist/blocks/bookings/svelte/index.d.ts +2 -2
- package/dist/blocks/bookings/vue/index.d.ts +2 -2
- package/dist/blocks/bulk/index.d.ts +1 -1
- package/dist/blocks/calendar/index.d.ts +2 -2
- package/dist/blocks/calendar/react/index.d.ts +1 -1
- package/dist/blocks/calendar/solid/index.d.ts +2 -2
- package/dist/blocks/calendar/svelte/index.d.ts +2 -2
- package/dist/blocks/calendar/vue/index.d.ts +2 -2
- package/dist/blocks/catalog/index.d.ts +1 -1
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/comments/index.d.ts +2 -2
- package/dist/blocks/comments/react/index.d.ts +1 -1
- package/dist/blocks/comments/react/server.d.ts +1 -1
- package/dist/blocks/comments/solid/index.d.ts +2 -2
- package/dist/blocks/comments/svelte/index.d.ts +2 -2
- package/dist/blocks/comments/vue/index.d.ts +2 -2
- package/dist/blocks/connectors/index.d.ts +2 -2
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +2 -2
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/drive/index.d.ts +2 -3
- package/dist/blocks/drive/index.js +14 -5
- package/dist/blocks/employees/index.d.ts +1 -1
- package/dist/blocks/engagements/index.d.ts +1 -1
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/entitlements/react/index.d.ts +2 -2
- package/dist/blocks/entitlements/solid/index.d.ts +2 -2
- package/dist/blocks/entitlements/svelte/index.d.ts +2 -2
- package/dist/blocks/entitlements/vue/index.d.ts +2 -2
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +2 -2
- package/dist/blocks/forms/react/index.d.ts +1 -1
- package/dist/blocks/forms/solid/index.d.ts +2 -2
- package/dist/blocks/forms/svelte/index.d.ts +2 -2
- package/dist/blocks/forms/vue/index.d.ts +2 -2
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/identities/index.d.ts +2 -2
- package/dist/blocks/imports/index.d.ts +1 -1
- package/dist/blocks/inbox/index.d.ts +2 -2
- package/dist/blocks/inbox/react/index.d.ts +2 -2
- package/dist/blocks/inbox/react/server.d.ts +2 -2
- package/dist/blocks/inbox/solid/index.d.ts +2 -2
- package/dist/blocks/inbox/svelte/index.d.ts +2 -2
- package/dist/blocks/inbox/vue/index.d.ts +2 -2
- package/dist/blocks/index.d.ts +2 -2
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/invoices/index.d.ts +1 -1
- package/dist/blocks/jobs/index.d.ts +1 -1
- package/dist/blocks/knowledge/index.d.ts +2 -2
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/memory/index.d.ts +3 -3
- package/dist/blocks/metrics/index.d.ts +1 -1
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/mfa/react/index.d.ts +1 -1
- package/dist/blocks/mfa/react/server.d.ts +1 -1
- package/dist/blocks/mfa/solid/index.d.ts +2 -2
- package/dist/blocks/mfa/svelte/index.d.ts +2 -2
- package/dist/blocks/mfa/vue/index.d.ts +2 -2
- package/dist/blocks/notifications/index.d.ts +3 -3
- package/dist/blocks/notifications/react/index.d.ts +1 -1
- package/dist/blocks/notifications/react/server.d.ts +1 -1
- package/dist/blocks/notifications/solid/index.d.ts +2 -2
- package/dist/blocks/notifications/svelte/index.d.ts +2 -2
- package/dist/blocks/notifications/vue/index.d.ts +2 -2
- package/dist/blocks/number-sequences/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/onboarding/react/index.d.ts +1 -1
- package/dist/blocks/onboarding/react/server.d.ts +1 -1
- package/dist/blocks/onboarding/solid/index.d.ts +2 -2
- package/dist/blocks/onboarding/svelte/index.d.ts +2 -2
- package/dist/blocks/onboarding/vue/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/organizations/react/index.d.ts +1 -1
- package/dist/blocks/organizations/react/server.d.ts +1 -1
- package/dist/blocks/organizations/solid/index.d.ts +2 -2
- package/dist/blocks/organizations/svelte/index.d.ts +2 -2
- package/dist/blocks/organizations/vue/index.d.ts +2 -2
- package/dist/blocks/outbox/index.d.ts +2 -2
- package/dist/blocks/parties/index.d.ts +1 -1
- package/dist/blocks/pipelines/index.d.ts +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +2 -2
- package/dist/blocks/reactions/react/index.d.ts +1 -1
- package/dist/blocks/reactions/solid/index.d.ts +2 -2
- package/dist/blocks/reactions/svelte/index.d.ts +2 -2
- package/dist/blocks/reactions/vue/index.d.ts +2 -2
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/reminders/index.d.ts +3 -3
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/rules/index.d.ts +4 -4
- package/dist/blocks/rules/react/index.d.ts +1 -1
- package/dist/blocks/rules/solid/index.d.ts +2 -2
- package/dist/blocks/rules/svelte/index.d.ts +2 -2
- package/dist/blocks/rules/vue/index.d.ts +2 -2
- package/dist/blocks/saved-views/index.d.ts +2 -2
- package/dist/blocks/saved-views/react/index.d.ts +1 -1
- package/dist/blocks/saved-views/react/server.d.ts +1 -1
- package/dist/blocks/saved-views/solid/index.d.ts +2 -2
- package/dist/blocks/saved-views/svelte/index.d.ts +2 -2
- package/dist/blocks/saved-views/vue/index.d.ts +2 -2
- package/dist/blocks/search/index.d.ts +2 -2
- package/dist/blocks/search/react/index.d.ts +1 -1
- package/dist/blocks/search/react/server.d.ts +1 -1
- package/dist/blocks/search/solid/index.d.ts +2 -2
- package/dist/blocks/search/svelte/index.d.ts +2 -2
- package/dist/blocks/search/vue/index.d.ts +2 -2
- package/dist/blocks/service-principals/index.d.ts +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/sessions/react/index.d.ts +1 -1
- package/dist/blocks/sessions/react/server.d.ts +1 -1
- package/dist/blocks/sessions/solid/index.d.ts +2 -2
- package/dist/blocks/sessions/svelte/index.d.ts +2 -2
- package/dist/blocks/sessions/vue/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/settings/react/index.d.ts +1 -1
- package/dist/blocks/settings/react/server.d.ts +1 -1
- package/dist/blocks/settings/solid/index.d.ts +2 -2
- package/dist/blocks/settings/svelte/index.d.ts +2 -2
- package/dist/blocks/settings/vue/index.d.ts +2 -2
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/shared-signals/index.d.ts +2 -2
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +2 -2
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tags/react/index.d.ts +1 -1
- package/dist/blocks/tags/react/server.d.ts +1 -1
- package/dist/blocks/tags/solid/index.d.ts +2 -2
- package/dist/blocks/tags/svelte/index.d.ts +2 -2
- package/dist/blocks/tags/vue/index.d.ts +2 -2
- package/dist/blocks/targets/index.d.ts +1 -1
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/templates/index.d.ts +3 -3
- package/dist/blocks/time-tracking/index.d.ts +1 -1
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/undo/react/index.d.ts +1 -1
- package/dist/blocks/undo/react/server.d.ts +1 -1
- package/dist/blocks/undo/solid/index.d.ts +2 -2
- package/dist/blocks/undo/svelte/index.d.ts +2 -2
- package/dist/blocks/undo/vue/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/usage/react/index.d.ts +1 -1
- package/dist/blocks/usage/react/server.d.ts +1 -1
- package/dist/blocks/usage/solid/index.d.ts +2 -2
- package/dist/blocks/usage/svelte/index.d.ts +2 -2
- package/dist/blocks/usage/vue/index.d.ts +2 -2
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.d.ts +4 -4
- package/dist/blocks/work-items/index.d.ts +1 -1
- package/dist/blocks/workflow-builder/index.d.ts +4 -4
- package/dist/blocks/workflow-builder/react/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/solid/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/svelte/index.d.ts +2 -2
- package/dist/blocks/workflow-builder/vue/index.d.ts +2 -2
- package/dist/blocks/workflows/index.d.ts +2 -2
- package/dist/blocks/workflows/react/index.d.ts +1 -1
- package/dist/blocks/workflows/solid/index.d.ts +2 -2
- package/dist/blocks/workflows/svelte/index.d.ts +2 -2
- package/dist/blocks/workflows/vue/index.d.ts +2 -2
- package/dist/{bucket-BBSNDFNH.d.ts → bucket-BbePDVwc.d.ts} +16 -0
- package/dist/chat-sdk/index.d.ts +2 -2
- package/dist/chat-sdk/react/index.d.ts +2 -2
- package/dist/chat-sdk/react/server.d.ts +2 -2
- package/dist/cli/add-DnAyR9w_.js +1 -0
- package/dist/cli/{add-B5V6uokQ.js → add-TT72pQk6.js} +3 -3
- package/dist/cli/adopt-BuS-DC7_.js +1 -0
- package/dist/cli/{adopt-Ht34C3QD.js → adopt-mbB1bcIG.js} +4 -4
- package/dist/cli/{apply-4BmTvj2A.js → apply-CiBFOFGw.js} +15 -21
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-jIvPqPtw.js → blocks-5-JGzwXX.js} +1 -1
- package/dist/cli/{blocks-bBI050w6.js → blocks-DeLQOlUK.js} +1 -1
- package/dist/cli/{cache-CVJmPGpd.js → cache-DQwgb3rg.js} +1 -1
- package/dist/cli/{codemod-vsknM1Ue.js → codemod-BzAMX4el.js} +2 -2
- package/dist/cli/{command-DLCZeHdo.js → command-dfdVhU_2.js} +16 -1
- package/dist/cli/{completion-CEZ-c3ja.js → completion-4lLjtI49.js} +1 -1
- package/dist/cli/{completion-D2BObVth.js → completion-D4InNrxw.js} +2 -2
- package/dist/cli/{completion-BAm8SwGQ.js → completion-zsp5s0zI.js} +2 -2
- package/dist/cli/{config-CynctXbc.js → config-CCyweX7Y.js} +1 -1
- package/dist/cli/{config-CC5DXgKX.js → config-DI6ielsx.js} +1 -1
- package/dist/cli/{config-C4e_RrmL.js → config-yZ55rsKZ.js} +1 -1
- package/dist/cli/{db-BxMRcHrY.js → db-TRymMyAW.js} +3 -3
- package/dist/cli/{design-edit-B-WsnhUF.js → design-edit-0U9iCTiS.js} +29 -2
- package/dist/cli/{doctor-D47sFjh9.js → doctor-DOfy6kjt.js} +119 -70
- package/dist/cli/env-Cmu99uKR.js +1 -0
- package/dist/cli/{env--JFvv45k.js → env-Dh5K5t2U.js} +32 -31
- package/dist/cli/{gen-D2E8osBE.js → gen-D3sC5jDn.js} +11 -11
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +6 -6
- package/dist/cli/{init-Cx7DDAdQ.js → init-DNomoycJ.js} +12 -18
- package/dist/cli/{introspect-Ck7aa6v0.js → introspect-kYX06Q2g.js} +3 -3
- package/dist/cli/{keys-6ufnWeZl.js → keys-B8dIJwwi.js} +1 -1
- package/dist/cli/{live-CLxJNC0r.js → live-CkV3d3yp.js} +1 -1
- package/dist/cli/{mcp-BVWvEoKo.js → mcp-DrxB2Wuw.js} +3 -3
- package/dist/cli/{metadata-BRywyPvv.js → metadata-BGkle6WM.js} +1 -1
- package/dist/cli/{moved-BmtFuMK3.js → moved-BMQu1YNY.js} +1 -1
- package/dist/cli/{parse-ksnw4phM.js → parse-QzDvMpXH.js} +1 -1
- package/dist/cli/{preset-B1o6KbFp.js → preset-CfIs24cc.js} +1 -1
- package/dist/cli/run-Bck-p0MI.js +63 -0
- package/dist/cli/{run-Bb8Nn8Ax.js → run-BhJKAanr.js} +2 -2
- package/dist/cli/{run-nX5ffQM_.js → run-DRZ10srj.js} +51 -43
- package/dist/cli/{scaffold-DcXr4z7M.js → scaffold-DoURlDEI.js} +1 -1
- package/dist/cli/{scaffold-fO-FJGoO.js → scaffold-mzy3OsN5.js} +1 -1
- package/dist/cli/seed-C5q4UUIL.js +1 -0
- package/dist/cli/{seed-BmOC6_iz.js → seed-CIdg6s7m.js} +3 -3
- package/dist/cli/{skills-CUx7S0bk.js → skills-D3zwIlGA.js} +1 -1
- package/dist/cli/{snapshot-ClgWGd-b.js → snapshot-BBKFojqM.js} +3 -3
- package/dist/cli/{source-args-BDiUhsH8.js → source-args-Cwo7zwvq.js} +1 -1
- package/dist/cli/{spec-DjHpWZJM.js → spec-DOgQUZwM.js} +1 -1
- package/dist/cli/{spec-CM7iyRnE.js → spec-DZeIP9ta.js} +3 -3
- package/dist/cli/{sql-C4ymac2h.js → sql-CL_Lbhwl.js} +1 -1
- package/dist/cli/{sql-ybcjbz20.js → sql-DLOvvnBV.js} +1 -1
- package/dist/cli/stack-env-_uWWNHWq.js +87 -0
- package/dist/cli/{stack-status-Cb_D79ZR.js → stack-status-_NUgd-g5.js} +41 -1
- package/dist/cli/{version-CUKjFbNd.js → version-B7akdvDv.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +5 -5
- package/dist/{client-GdJH4XJM.d.ts → client-BAOZuBhz.d.ts} +1 -1
- package/dist/{client-B9_8yzct.d.ts → client-BJN0IMEp.d.ts} +2 -2
- package/dist/{client-QvuCfO4b.d.ts → client-BMcjLG0V.d.ts} +5 -5
- package/dist/{client-CeH7vd-g.d.ts → client-BN_fXOs7.d.ts} +1 -1
- package/dist/{client-CCGSn7m5.d.ts → client-BONsuFYf.d.ts} +4 -4
- package/dist/{client-CBQ2TV0r.d.ts → client-BPn9XhAM.d.ts} +1 -1
- package/dist/{client-ehjQ2tIT.d.ts → client-BtC-r4hE.d.ts} +3 -3
- package/dist/{client-DarDYaQj.d.ts → client-BuneNd-C.d.ts} +1 -1
- package/dist/{client-B_vHBwB6.d.ts → client-CHwNV8Kz.d.ts} +3 -3
- package/dist/{client-DbxvLC9Y.d.ts → client-CLQHsa-2.d.ts} +1 -1
- package/dist/{client-9ZOirdtr.d.ts → client-CMxxwT3N.d.ts} +3 -3
- package/dist/{client-B4a7f5ma.d.ts → client-CU7aNN_B.d.ts} +2 -2
- package/dist/{client-cWUWrgis.d.ts → client-CYEdJKjk.d.ts} +1 -1
- package/dist/{client-CNh-pjkT.d.ts → client-CYhSGlCN.d.ts} +3 -3
- package/dist/{client-5YAtJjyT.d.ts → client-D3gRTNSi.d.ts} +1 -1
- package/dist/{client-BqoYuTK3.d.ts → client-DB34f_7i.d.ts} +2 -2
- package/dist/{client-eCtwzCbQ.d.ts → client-DCawyopp.d.ts} +3 -3
- package/dist/{client-Bovn6-M9.d.ts → client-Dqa4XyJ5.d.ts} +1 -1
- package/dist/{client-CXTDJCIs.d.ts → client-Dr5h2r9r.d.ts} +1 -1
- package/dist/{client-CrZKZVbb.d.ts → client-DrTqKgvy.d.ts} +1 -1
- package/dist/{client-BNy-K6XT.d.ts → client-GCCRI9ge.d.ts} +1 -1
- package/dist/{client-DLz68Qga.d.ts → client-P6v3h7vh.d.ts} +1 -1
- package/dist/{client-CJT3xiuI.d.ts → client-P8l8ncxV.d.ts} +3 -3
- package/dist/{client-BXv09wO1.d.ts → client-kWg4OqIr.d.ts} +2 -2
- package/dist/{client-C3rmP3b0.d.ts → client-tvG258_1.d.ts} +4 -4
- package/dist/{client-Dft5Vq6m.d.ts → client-wKmX-f3r.d.ts} +1 -1
- package/dist/{composite-BFatHqOU.js → composite-1kPAxXto.js} +1 -1
- package/dist/{composite-B1Mmo4TU.d.ts → composite-DzvBL5nb.d.ts} +5 -5
- package/dist/{connectors-CR9FJGzV.d.ts → connectors-BwPNt-ZG.d.ts} +1 -1
- package/dist/{controller-BBXX1RMw.d.ts → controller-BZhiIb-N.d.ts} +1 -1
- package/dist/create/index.d.ts +24 -2
- package/dist/create/index.js +1001 -914
- package/dist/credentials/index.d.ts +2 -2
- package/dist/{define-M_r1d2AT.d.ts → define-DYZnvAbs.d.ts} +1 -1
- package/dist/{define-block-CPyJ95rq.d.ts → define-block-BHxLHLys.d.ts} +2 -2
- package/dist/edge/index.d.ts +8 -8
- package/dist/edge/index.js +3 -3
- package/dist/elysia/index.d.ts +1 -1
- package/dist/{embeddings-lTUwzvW4.d.ts → embeddings-CKhygw4C.d.ts} +1 -1
- package/dist/{ended-DQmwYosO.d.ts → ended-De6H52nX.d.ts} +1 -1
- package/dist/{entitlements-DgkeStXd.d.ts → entitlements-CtBGXb3B.d.ts} +2 -2
- package/dist/eve/index.d.ts +3 -3
- package/dist/eve/index.js +1 -1
- package/dist/{eve-C_Onyk_j.d.ts → eve-B6ru2Bt4.d.ts} +2 -2
- package/dist/{executor-DfdC00xr.d.ts → executor-BWgJNbGh.d.ts} +1 -1
- package/dist/expo/index.d.ts +3 -3
- package/dist/expo/index.js +3 -3
- package/dist/expo-sqlite/index.d.ts +1 -1
- package/dist/{field-errors-DmJICh93.d.ts → field-errors-Z-sgsdoN.d.ts} +6 -6
- package/dist/{framework-D6IFkuAg.d.ts → framework-BQhTsLX-.d.ts} +5 -5
- package/dist/{framework-Ch8bMmQY.js → framework-C6PKBgme.js} +1 -1
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/hono/index.d.ts +8 -8
- package/dist/hono/index.js +2 -2
- package/dist/{index-DgobXyil.d.ts → index-1Vsg-7YV.d.ts} +1 -1
- package/dist/{index-D8yhOz_4.d.ts → index-BJLPQr2s.d.ts} +36 -3
- package/dist/{index-CK0Sxx57.d.ts → index-C-_fs7EI.d.ts} +7 -7
- package/dist/{index-F6XTTkC9.d.ts → index-CXFf-c-j.d.ts} +4 -4
- package/dist/{index-CEcDqDhc.d.ts → index-Cm2-g_4H.d.ts} +1 -1
- package/dist/{index-qCG78-Rf.d.ts → index-DTQSeHx2.d.ts} +2 -2
- package/dist/{index-DHReeV74.d.ts → index-Hc4tetmB.d.ts} +1 -1
- package/dist/{index-Bq409YZn.d.ts → index-QWTq2o31.d.ts} +1 -1
- package/dist/{index-Csi8jD-m.d.ts → index-XcTBR4Gb.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/{kit-BeZX2pR_.d.ts → kit-De-EVRhw.d.ts} +3 -3
- package/dist/{knowledge-CRk1jOAJ.d.ts → knowledge-B5zdpDD-.d.ts} +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/{list-query-FhFXzObg.d.ts → list-query-aXr2WkGA.d.ts} +1 -1
- package/dist/mcp/index.d.ts +4 -4
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +5 -5
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/next/index.d.ts +15 -15
- package/dist/next/index.js +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/orpc/index.d.ts +5 -5
- package/dist/orpc/index.js +1 -1
- package/dist/otel/index.js +5 -5
- package/dist/{outbox-njgoVzFA.d.ts → outbox-B1hZ7PPY.d.ts} +1 -1
- package/dist/{ports-DCAcG26M.d.ts → ports-BCDIbC_U.d.ts} +1 -1
- package/dist/{ports-DGe1vzF2.d.ts → ports-P0A5wo_-.d.ts} +2 -2
- package/dist/powersync/index.d.ts +2 -2
- package/dist/preset/index.d.ts +2 -2
- package/dist/preset/index.js +2 -2
- package/dist/{preset-Cqwlwx6G.js → preset-Cf0T9GRt.js} +49 -6
- package/dist/{provider-CNs0Jx0I.d.ts → provider-DXgx5oSA.d.ts} +1 -1
- package/dist/{push-token-D2sDxSNN.d.ts → push-token-y1Gnz5bQ.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +7 -7
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +8 -8
- package/dist/react/session.d.ts +2 -2
- package/dist/react-router/index.d.ts +5 -5
- package/dist/react-router/index.js +2 -2
- package/dist/realtime/index.d.ts +5 -5
- package/dist/{refusal-CufncwaN.d.ts → refusal-C7geIBRl.d.ts} +1 -1
- package/dist/{resolve-f8QNuYI3.js → resolve-AtncaPTU.js} +12 -5
- package/dist/{resolve-Bqb8TMTt.d.ts → resolve-Ceft-18-.d.ts} +6 -2
- package/dist/{resource-execute-ruP2L1op.d.ts → resource-execute-Bxvgmx-n.d.ts} +1 -1
- package/dist/{resource-types-CGr0BbL-.d.ts → resource-types-LW1i5-h3.d.ts} +2 -2
- package/dist/{resources-BiQpsM6O.d.ts → resources-D3_FAz_H.d.ts} +1 -1
- package/dist/{respond-CEBC6KUX.d.ts → respond-BSL36dQp.d.ts} +1 -1
- package/dist/server/index.d.ts +27 -19
- package/dist/server/index.js +4 -4
- package/dist/{server-types-BKN_R4Ws.d.ts → server-types-fLdep4gb.d.ts} +11 -9
- package/dist/{session-CwpfitmI.d.ts → session-DObioXpX.d.ts} +3 -3
- package/dist/solid/index.d.ts +7 -7
- package/dist/{solid-controller-Uqi5ef6z.d.ts → solid-controller-CWotGxcG.d.ts} +1 -1
- package/dist/solid-start/index.d.ts +5 -5
- package/dist/solid-start/index.js +2 -2
- package/dist/sql/index.d.ts +1 -1
- package/dist/sql/index.js +1 -1
- package/dist/{sql-DCfCbS2j.js → sql-CT1Jnwp8.js} +1 -1
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -1
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.js +11 -0
- package/dist/{subject-readers-BNQzBDN9.d.ts → subject-readers-BUChuOxL.d.ts} +1 -1
- package/dist/{support-BAhTqI7y.js → support-C2wPYwD7.js} +1 -1
- package/dist/{support-view-IRnDLuGN.d.ts → support-view-Bj_lZ8Wr.d.ts} +1 -1
- package/dist/svelte/index.d.ts +6 -6
- package/dist/{svelte-controller-BQOIXWEw.d.ts → svelte-controller-sS4X66yL.d.ts} +1 -1
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/sveltekit/index.js +2 -2
- package/dist/{tags-AUpl4Ob9.d.ts → tags-BrGopDVG.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-db/supabase/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +5 -5
- package/dist/tanstack-start/index.js +2 -2
- package/dist/{tenant-BNp3kBAG.d.ts → tenant-DZMLVuyQ.d.ts} +2 -2
- package/dist/testing/index.d.ts +13 -15
- package/dist/{topic-1WTkDnPd.d.ts → topic-DAY_HOX2.d.ts} +3 -3
- package/dist/{types-DDQ-Rsep.d.ts → types-BA1eTvy4.d.ts} +1 -1
- package/dist/{types-Bq64h5nY.d.ts → types-Bels39_u.d.ts} +2 -2
- package/dist/{types-DO9xWsGC.d.ts → types-DOC7wnh6.d.ts} +11 -2
- package/dist/{types-B4zhT6dq.d.ts → types-D_2rClz-.d.ts} +1 -1
- package/dist/upload-claim-BBFCZbBF.js +33 -0
- package/dist/{vault-DR2-zOjz.d.ts → vault-ClkzMGTP.d.ts} +1 -1
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/{verify-BucYsoKq.d.ts → verify-DU4p9-Ve.d.ts} +1 -1
- package/dist/{version-TXpQEfh1.js → version-DSWxci83.js} +1 -1
- package/dist/{view-Bf7e07rQ.d.ts → view-KQhe6eNc.d.ts} +1 -1
- package/dist/vue/index.d.ts +7 -7
- package/dist/{vue-controller-Cav6Wt_r.d.ts → vue-controller-BUo1oove.d.ts} +1 -1
- package/dist/{watch-ry70AEm6.d.ts → watch-5btote1y.d.ts} +2 -2
- package/dist/{watch-topic-DWHy63ZJ.d.ts → watch-topic-C79ZW5-R.d.ts} +1 -1
- package/dist/workflow-sdk/builder/index.d.ts +3 -3
- package/dist/workflow-sdk/index.d.ts +1 -1
- package/dist/{workflow-sdk-DM7T3sF4.d.ts → workflow-sdk-CWdCWj7M.d.ts} +1 -1
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/schemas/cli-commands-v1.json +15 -0
- package/schemas/config-v1.json +1 -1
- package/schemas/doctor-report-v1.json +1 -0
- package/dist/cli/add-DzRJEHzD.js +0 -1
- package/dist/cli/adopt-DDy50yz9.js +0 -1
- package/dist/cli/env-D-O91RK1.js +0 -1
- package/dist/cli/seed-C_BmN498.js +0 -1
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
2
2
|
import { t as isRecord } from "./guards-CUlDNYZs.js";
|
|
3
3
|
import { f as setPathInConfig, p as setPathInJson } from "./config-edit-Ct1lXe8a.js";
|
|
4
|
-
import {
|
|
4
|
+
import { existsSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { readFile } from "node:fs/promises";
|
|
7
|
+
import { DEFAULT_CONVENTIONS, PRESET_TENANT_NAMES, designOf, isPresetName, presetField, presetOf, presetValueLabel, readDesignFile, withPresetField } from "better-supabase/preset";
|
|
5
8
|
//#region src/cli/conventions.ts
|
|
6
9
|
const arg = (key, description) => ({
|
|
7
10
|
type: "string",
|
|
@@ -123,6 +126,30 @@ function createUrlParam(input, name) {
|
|
|
123
126
|
/** What `init` and `apply` print for a URL with `&authz=`. */
|
|
124
127
|
const AUTHZ_NOTE = "The authorization library chosen on Create isn't part of the preset. Open Get code on Create for its setup, then set `authorization` in the config to its adapter.";
|
|
125
128
|
//#endregion
|
|
129
|
+
//#region src/cli/preset-input.ts
|
|
130
|
+
/** Whether `--preset` names a design file rather than a preset or URL. */
|
|
131
|
+
const isDesignFilePath = (input) => input.endsWith(".json");
|
|
132
|
+
/**
|
|
133
|
+
* Reads `--preset`: a named preset, a code, a `/create` URL, or the path of
|
|
134
|
+
* a design file Create downloaded (relative to `root`). Throws a usage
|
|
135
|
+
* error naming the problem.
|
|
136
|
+
*/
|
|
137
|
+
async function readPresetInput(input, root) {
|
|
138
|
+
try {
|
|
139
|
+
if (isDesignFilePath(input)) {
|
|
140
|
+
const path = resolve(root, input);
|
|
141
|
+
if (!existsSync(path)) throw new TypeError(`${input} doesn't exist. Download the design file from Create, or pass a preset name, code or URL.`);
|
|
142
|
+
return readDesignFile(await readFile(path, "utf-8"));
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
preset: presetOf(input),
|
|
146
|
+
design: isPresetName(input) ? void 0 : await designOf(input)
|
|
147
|
+
};
|
|
148
|
+
} catch (error) {
|
|
149
|
+
throw new CliError("usage", error instanceof Error ? error.message : String(error));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
//#endregion
|
|
126
153
|
//#region src/cli/sql/design-edit.ts
|
|
127
154
|
/** The `extraColumns` a block already has in the config, as plain strings. */
|
|
128
155
|
function currentExtraColumns(config, module) {
|
|
@@ -172,4 +199,4 @@ function writeDesign(file, source, design, config) {
|
|
|
172
199
|
};
|
|
173
200
|
}
|
|
174
201
|
//#endregion
|
|
175
|
-
export {
|
|
202
|
+
export { CONVENTION_ARGS as a, defaultConventions as c, withConventions as d, createUrlParam as i, hasConventionFlags as l, readPresetInput as n, CONVENTION_COMPLETIONS as o, AUTHZ_NOTE as r, conventionFlags as s, writeDesign as t, promptConventions as u };
|
|
@@ -1,25 +1,28 @@
|
|
|
1
|
-
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { i as plain } from "./style-2JfIPVMQ.js";
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
3
|
+
import { t as VERSION } from "./version-B7akdvDv.js";
|
|
4
4
|
import { n as CliError, r as errorText } from "./errors-Caiz_0so.js";
|
|
5
5
|
import { a as sameText, t as display } from "./io-BiPX-_J1.js";
|
|
6
|
-
import { t as CACHE_DIR } from "./cache-
|
|
6
|
+
import { t as CACHE_DIR } from "./cache-DQwgb3rg.js";
|
|
7
7
|
import { t as byCodePoint } from "./compare-BmIWVEui.js";
|
|
8
8
|
import { h as satisfies, m as peerVersions, t as MetadataRejectedError } from "./typegen--TfvOPLh.js";
|
|
9
9
|
import { t as isRecord } from "./guards-CUlDNYZs.js";
|
|
10
10
|
import { c as configFor, s as notNullTag } from "./emit-56LAG_Px.js";
|
|
11
|
-
import { _ as withoutStrings, a as METADATA_GAPS_TEXT, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$1, s as AUTHORIZATION_RULES, u as COMMANDS$1, v as advisorRule, x as renderFiles, y as splinterTables } from "./run-
|
|
11
|
+
import { _ as withoutStrings, a as METADATA_GAPS_TEXT, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$1, s as AUTHORIZATION_RULES, u as COMMANDS$1, v as advisorRule, x as renderFiles, y as splinterTables } from "./run-BhJKAanr.js";
|
|
12
12
|
import { D as providerLabel, a as migrationModules, i as migrationHolds, r as latestMigration, t as MODULES_SUFFIX, v as migrationsDir, x as compiledReadSets, y as moduleLayoutFor } from "./module-migration-CPhuiY8C.js";
|
|
13
|
-
import { l as stdinDatabaseUrl } from "./config-
|
|
13
|
+
import { l as stdinDatabaseUrl } from "./config-yZ55rsKZ.js";
|
|
14
14
|
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-BC5sNVKU.js";
|
|
15
|
+
import { t as PROCESS_ENV } from "./env-C8R7Nf0a.js";
|
|
16
|
+
import { n as readStackStatus } from "./stack-status-_NUgd-g5.js";
|
|
15
17
|
import { t as connect } from "./db-DT1bGB02.js";
|
|
16
|
-
import { c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, p as request, r as openSource, s as liteDriverOf, t as loadSnapshot } from "./snapshot-
|
|
18
|
+
import { c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, p as request, r as openSource, s as liteDriverOf, t as loadSnapshot } from "./snapshot-BBKFojqM.js";
|
|
17
19
|
import { n as applyPlan, o as insideRoot, r as changeLines } from "./files-DDvAwTko.js";
|
|
18
20
|
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-DKLuA1Tp.js";
|
|
19
21
|
import { t as MIGRATION_SAFETY_RULES } from "./migration-safety-DjVpz2D6.js";
|
|
20
|
-
import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-
|
|
21
|
-
import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-
|
|
22
|
-
import { i as
|
|
22
|
+
import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-Cwo7zwvq.js";
|
|
23
|
+
import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-CkV3d3yp.js";
|
|
24
|
+
import { i as staleVariables, r as stackEnvValues, t as PREFIX_NAMES } from "./stack-env-_uWWNHWq.js";
|
|
25
|
+
import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-BGkle6WM.js";
|
|
23
26
|
import { existsSync } from "node:fs";
|
|
24
27
|
import { dirname, resolve } from "node:path";
|
|
25
28
|
import { createHash } from "node:crypto";
|
|
@@ -27,6 +30,107 @@ import { glob, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
|
|
|
27
30
|
import { SECRET_COLUMNS, SQL_MODULES, adoptedTables, contractSignature, customContracts, dataExportPlan, excludedColumns, expiredFlagsQuery, migrationOptionUses, moduleDeprecations, moduleEventTriggers, moduleFileVersion, moduleLayout, moduleVersion, renderModules, sameModuleFile, sameTenantColumn, sameTenantTrigger, sharedRolesProblems, subjectColumns } from "better-supabase/sql";
|
|
28
31
|
import { DEFAULT_ACTIVE_TENANT, tenantClaimPaths } from "better-supabase/config";
|
|
29
32
|
import { defineBucket, parseSize } from "better-supabase/storage";
|
|
33
|
+
//#region src/cli/doctor/env.ts
|
|
34
|
+
const PUBLIC_PREFIXES = [
|
|
35
|
+
"NEXT_PUBLIC_",
|
|
36
|
+
"VITE_",
|
|
37
|
+
"PUBLIC_",
|
|
38
|
+
"EXPO_PUBLIC_",
|
|
39
|
+
"NUXT_PUBLIC_"
|
|
40
|
+
];
|
|
41
|
+
function envEntries(file) {
|
|
42
|
+
return file.text.split("\n").flatMap((raw, index) => {
|
|
43
|
+
const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(raw);
|
|
44
|
+
if (!match) return [];
|
|
45
|
+
const value = match[2].trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
46
|
+
return [{
|
|
47
|
+
key: match[1],
|
|
48
|
+
value,
|
|
49
|
+
line: index + 1
|
|
50
|
+
}];
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
const PREFIXES = [...new Set(Object.values(PREFIX_NAMES).filter((prefix) => prefix !== ""))];
|
|
54
|
+
/** The names `stackEnvValues` writes, with or without a browser prefix; not the CLI's own `SUPABASE_BIN` or `SUPABASE_ACCESS_TOKEN`. */
|
|
55
|
+
const STACK_VARIABLE = /(?:^|_)SUPABASE_(?:URL|PUBLISHABLE_KEY|SECRET_KEY|JWKS_URL|DB_URL|JWT_SECRET)$/;
|
|
56
|
+
const exportsStackVariable = (shell) => Object.entries(shell).some(([name, value]) => value !== void 0 && value !== "" && STACK_VARIABLE.test(name));
|
|
57
|
+
/**
|
|
58
|
+
* Reads the running stack only when the shell exports a `SUPABASE_*`
|
|
59
|
+
* variable, so a doctor run without one never starts `supabase status`.
|
|
60
|
+
*/
|
|
61
|
+
async function loadStackEnvCheck(root, env, signal) {
|
|
62
|
+
const shell = env[PROCESS_ENV] ?? {};
|
|
63
|
+
if (!exportsStackVariable(shell)) return { skipped: "No SUPABASE_* variable is exported." };
|
|
64
|
+
try {
|
|
65
|
+
const result = await readStackStatus(root, env, { signal });
|
|
66
|
+
if (!result.ok) return { skipped: "The local stack is not running." };
|
|
67
|
+
const values = { ...stackEnvValues(result.status, "") };
|
|
68
|
+
if (values["SUPABASE_URL"] === void 0) return { skipped: "supabase status has no API_URL." };
|
|
69
|
+
for (const prefix of PREFIXES) {
|
|
70
|
+
values[`${prefix}SUPABASE_URL`] = values["SUPABASE_URL"];
|
|
71
|
+
if (values["SUPABASE_PUBLISHABLE_KEY"] !== void 0) values[`${prefix}SUPABASE_PUBLISHABLE_KEY`] = values["SUPABASE_PUBLISHABLE_KEY"];
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
shell,
|
|
75
|
+
values
|
|
76
|
+
};
|
|
77
|
+
} catch (cause) {
|
|
78
|
+
return { skipped: errorText(cause) };
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/** Checks on env files and the variables the shell exports (BS501 to BS503). */
|
|
82
|
+
const ENV_RULES = [
|
|
83
|
+
{
|
|
84
|
+
code: "BS501",
|
|
85
|
+
severity: "error",
|
|
86
|
+
title: "Secret in a browser variable",
|
|
87
|
+
description: "Variables with a public prefix are bundled into client code. A secret key there gives every visitor full access.",
|
|
88
|
+
check: (context) => context.envFiles.flatMap((file) => envEntries(file).filter((entry) => PUBLIC_PREFIXES.some((prefix) => entry.key.startsWith(prefix)) && (entry.value.startsWith("sb_secret_") || /SECRET|SERVICE_ROLE/.test(entry.key))).map((entry) => ({
|
|
89
|
+
message: `${entry.key} in ${file.path} is exposed to the browser but holds a secret. Rename it without the public prefix and rotate the key.`,
|
|
90
|
+
target: `${file.path}:${entry.key}`,
|
|
91
|
+
location: {
|
|
92
|
+
file: file.path,
|
|
93
|
+
line: entry.line
|
|
94
|
+
}
|
|
95
|
+
})))
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
code: "BS502",
|
|
99
|
+
severity: "warning",
|
|
100
|
+
title: "Env file with secrets is not ignored by git",
|
|
101
|
+
description: "Env files holding a secret key or database password should never be committed.",
|
|
102
|
+
check: (context) => {
|
|
103
|
+
const patterns = context.gitignore.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
104
|
+
const ignored = (path) => patterns.some((pattern) => {
|
|
105
|
+
const source = pattern.replace(/^\//, "").replaceAll(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("*", ".*");
|
|
106
|
+
return new RegExp(`^${source}$`).test(path) || new RegExp(`(^|/)${source}$`).test(path);
|
|
107
|
+
});
|
|
108
|
+
return context.envFiles.flatMap((file) => {
|
|
109
|
+
const secret = envEntries(file).find((entry) => entry.value.startsWith("sb_secret_") || /SECRET_KEY|SERVICE_ROLE|DB_URL|DATABASE_URL/.test(entry.key));
|
|
110
|
+
if (!secret || ignored(file.path) || file.path.endsWith(".example")) return [];
|
|
111
|
+
return [{
|
|
112
|
+
message: `${file.path} contains ${secret.key} but isn't in .gitignore.`,
|
|
113
|
+
target: file.path,
|
|
114
|
+
location: {
|
|
115
|
+
file: file.path,
|
|
116
|
+
line: secret.line
|
|
117
|
+
}
|
|
118
|
+
}];
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
code: "BS503",
|
|
124
|
+
severity: "warning",
|
|
125
|
+
title: "Exported Supabase variable differs from the running stack",
|
|
126
|
+
description: "A SUPABASE_* variable exported in the shell has another value than the local stack, so the app talks to a stale stack (often another worktree's port). Values are redacted: host and port for URLs, a SHA-256 fingerprint for keys. Unset the variable, or start the app with `better-supabase run -- <cmd>`, which overrides it.",
|
|
127
|
+
check: ({ stackEnv }) => stackEnv === void 0 || "skipped" in stackEnv ? [] : staleVariables(stackEnv.shell, stackEnv.values).map((stale) => ({
|
|
128
|
+
target: stale.variable,
|
|
129
|
+
message: `${stale.message} Unset it or start the app with better-supabase run -- <cmd>.`
|
|
130
|
+
}))
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
//#endregion
|
|
30
134
|
//#region src/cli/doctor/adoption.ts
|
|
31
135
|
const tagText = (notNull) => notNull === true ? "@notNull" : `@notNull(${notNull.join(", ")})`;
|
|
32
136
|
const sameNotNull = (a, b) => a === true || b === true ? a === b : a !== void 0 && a.length === b.length && a.every((name) => b.includes(name));
|
|
@@ -2544,25 +2648,6 @@ function tomlLocation(context, key) {
|
|
|
2544
2648
|
line
|
|
2545
2649
|
} : void 0;
|
|
2546
2650
|
}
|
|
2547
|
-
const PUBLIC_PREFIXES = [
|
|
2548
|
-
"NEXT_PUBLIC_",
|
|
2549
|
-
"VITE_",
|
|
2550
|
-
"PUBLIC_",
|
|
2551
|
-
"EXPO_PUBLIC_",
|
|
2552
|
-
"NUXT_PUBLIC_"
|
|
2553
|
-
];
|
|
2554
|
-
function envEntries(file) {
|
|
2555
|
-
return file.text.split("\n").flatMap((raw, index) => {
|
|
2556
|
-
const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(raw);
|
|
2557
|
-
if (!match) return [];
|
|
2558
|
-
const value = match[2].trim().replace(/^(['"])(.*)\1$/, "$2");
|
|
2559
|
-
return [{
|
|
2560
|
-
key: match[1],
|
|
2561
|
-
value,
|
|
2562
|
-
line: index + 1
|
|
2563
|
-
}];
|
|
2564
|
-
});
|
|
2565
|
-
}
|
|
2566
2651
|
/**
|
|
2567
2652
|
* `db.x.aggregate(`, an `_sum:`/`_avg:`/`_min:`/`_max:` include or a list
|
|
2568
2653
|
* with `facetCounts: true`.
|
|
@@ -2968,45 +3053,6 @@ const RULES = [
|
|
|
2968
3053
|
target: `${qualified(table)}.${key.name}`,
|
|
2969
3054
|
object: tableObject(table)
|
|
2970
3055
|
})))
|
|
2971
|
-
},
|
|
2972
|
-
{
|
|
2973
|
-
code: "BS501",
|
|
2974
|
-
severity: "error",
|
|
2975
|
-
title: "Secret in a browser variable",
|
|
2976
|
-
description: "Variables with a public prefix are bundled into client code. A secret key there gives every visitor full access.",
|
|
2977
|
-
check: (context) => context.envFiles.flatMap((file) => envEntries(file).filter((entry) => PUBLIC_PREFIXES.some((prefix) => entry.key.startsWith(prefix)) && (entry.value.startsWith("sb_secret_") || /SECRET|SERVICE_ROLE/.test(entry.key))).map((entry) => ({
|
|
2978
|
-
message: `${entry.key} in ${file.path} is exposed to the browser but holds a secret. Rename it without the public prefix and rotate the key.`,
|
|
2979
|
-
target: `${file.path}:${entry.key}`,
|
|
2980
|
-
location: {
|
|
2981
|
-
file: file.path,
|
|
2982
|
-
line: entry.line
|
|
2983
|
-
}
|
|
2984
|
-
})))
|
|
2985
|
-
},
|
|
2986
|
-
{
|
|
2987
|
-
code: "BS502",
|
|
2988
|
-
severity: "warning",
|
|
2989
|
-
title: "Env file with secrets is not ignored by git",
|
|
2990
|
-
description: "Env files holding a secret key or database password should never be committed.",
|
|
2991
|
-
check: (context) => {
|
|
2992
|
-
const patterns = context.gitignore.split("\n").map((line) => line.trim()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
2993
|
-
const ignored = (path) => patterns.some((pattern) => {
|
|
2994
|
-
const source = pattern.replace(/^\//, "").replaceAll(/[.+^${}()|[\]\\]/g, "\\$&").replaceAll("*", ".*");
|
|
2995
|
-
return new RegExp(`^${source}$`).test(path) || new RegExp(`(^|/)${source}$`).test(path);
|
|
2996
|
-
});
|
|
2997
|
-
return context.envFiles.flatMap((file) => {
|
|
2998
|
-
const secret = envEntries(file).find((entry) => entry.value.startsWith("sb_secret_") || /SECRET_KEY|SERVICE_ROLE|DB_URL|DATABASE_URL/.test(entry.key));
|
|
2999
|
-
if (!secret || ignored(file.path) || file.path.endsWith(".example")) return [];
|
|
3000
|
-
return [{
|
|
3001
|
-
message: `${file.path} contains ${secret.key} but isn't in .gitignore.`,
|
|
3002
|
-
target: file.path,
|
|
3003
|
-
location: {
|
|
3004
|
-
file: file.path,
|
|
3005
|
-
line: secret.line
|
|
3006
|
-
}
|
|
3007
|
-
}];
|
|
3008
|
-
});
|
|
3009
|
-
}
|
|
3010
3056
|
}
|
|
3011
3057
|
],
|
|
3012
3058
|
...RLS_RULES,
|
|
@@ -3024,7 +3070,8 @@ const RULES = [
|
|
|
3024
3070
|
...FLAG_RULES,
|
|
3025
3071
|
...REALTIME_RULES,
|
|
3026
3072
|
...ADOPTION_RULES,
|
|
3027
|
-
...MIGRATION_SAFETY_RULES
|
|
3073
|
+
...MIGRATION_SAFETY_RULES,
|
|
3074
|
+
...ENV_RULES
|
|
3028
3075
|
].sort((a, b) => byCodePoint(a.code, b.code));
|
|
3029
3076
|
const RULE_CODES = RULES.map((rule) => rule.code);
|
|
3030
3077
|
async function runRules(context, rules = RULES) {
|
|
@@ -3512,14 +3559,15 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
3512
3559
|
...options.advisors === void 0 ? {} : { advisors: options.advisors },
|
|
3513
3560
|
...options.database === void 0 ? {} : { database: options.database }
|
|
3514
3561
|
};
|
|
3515
|
-
const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers] = await Promise.all([
|
|
3562
|
+
const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers, stackEnv] = await Promise.all([
|
|
3516
3563
|
options.snapshot ?? loadSnapshot(config, env, source, pg, opened.open),
|
|
3517
3564
|
Promise.all(ENV_FILES.map((path) => readText(config.root, path))).then((files) => files.filter((file) => file !== void 0)),
|
|
3518
3565
|
readSupabaseToml(config.root).then(async (toml) => [toml, await sqlFiles(config.root, toml, sqlWorkflow(config, toml))]),
|
|
3519
3566
|
readText(config.root, ".gitignore"),
|
|
3520
3567
|
sourceFiles(config),
|
|
3521
3568
|
compiledReadSets(config).catch((cause) => ({ skipped: errorText(cause) })),
|
|
3522
|
-
options.peers ?? peerVersions(config.root).catch(() => [])
|
|
3569
|
+
options.peers ?? peerVersions(config.root).catch(() => []),
|
|
3570
|
+
options.stackEnv ?? (rules.some((rule) => rule.code === "BS503") ? loadStackEnvCheck(config.root, env, options.signal) : void 0)
|
|
3523
3571
|
]).catch(async (cause) => {
|
|
3524
3572
|
await opened.close();
|
|
3525
3573
|
throw cause;
|
|
@@ -3539,6 +3587,7 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
3539
3587
|
sources,
|
|
3540
3588
|
readSets,
|
|
3541
3589
|
peers,
|
|
3590
|
+
...stackEnv ? { stackEnv } : {},
|
|
3542
3591
|
...live.advisors ? { advisors: live.advisors } : {},
|
|
3543
3592
|
...live.database ? { database: live.database } : {},
|
|
3544
3593
|
...stats ? { stats } : {},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as envCommand } from "./env-Dh5K5t2U.js";
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
3
3
|
import { r as readIfExists, t as display } from "./io-BiPX-_J1.js";
|
|
4
|
-
import { n as readStackStatus, t as parseStackStatus } from "./stack-status-
|
|
4
|
+
import { n as readStackStatus, t as parseStackStatus } from "./stack-status-_NUgd-g5.js";
|
|
5
5
|
import { n as applyPlan, o as insideRoot, r as changeLines, s as planResult, t as PLAN_ARGS } from "./files-DDvAwTko.js";
|
|
6
6
|
import { r as publicPrefix, t as detectProject } from "./detect-DQsVeBHg.js";
|
|
7
|
+
import { n as prefixFromFlag, r as stackEnvValues } from "./stack-env-_uWWNHWq.js";
|
|
7
8
|
import { existsSync } from "node:fs";
|
|
8
9
|
import { resolve } from "node:path";
|
|
9
10
|
import { readFile } from "node:fs/promises";
|
|
10
11
|
//#region src/cli/commands/env.ts
|
|
11
12
|
const ARGS = {
|
|
12
|
-
|
|
13
|
+
write: {
|
|
13
14
|
type: "string",
|
|
15
|
+
alias: "out",
|
|
14
16
|
description: "Env file to write, or - to print the variables. Defaults to env.output, then .env.local",
|
|
15
17
|
valueHint: "file"
|
|
16
18
|
},
|
|
17
19
|
prefix: {
|
|
18
20
|
type: "string",
|
|
19
|
-
description: "
|
|
21
|
+
description: "Browser variable prefix: next, vite, expo, nuxt, astro, sveltekit, a literal prefix, or \"none\". Defaults to env.prefix, then one detected from your framework",
|
|
20
22
|
valueHint: "prefix"
|
|
21
23
|
},
|
|
22
24
|
"status-file": {
|
|
@@ -40,12 +42,22 @@ async function readStatus(config, args, env, signal) {
|
|
|
40
42
|
if (!result.ok) throw new CliError("supabase_cli_failed", `supabase status failed (${result.code}). Is the local stack running (supabase start)?`, { suggestion: "supabase start" });
|
|
41
43
|
return result.status;
|
|
42
44
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
/** The browser prefix: `--prefix`, then `env.prefix`, then the framework's. */
|
|
46
|
+
async function browserPrefix(config, flag) {
|
|
47
|
+
const prefix = flag ?? config.env.prefix;
|
|
48
|
+
return prefix === void 0 ? publicPrefix(await detectProject(config.root)) : prefixFromFlag(prefix);
|
|
49
|
+
}
|
|
50
|
+
/** The running stack's variables, as `env` writes them and `run` sets them. */
|
|
51
|
+
async function readStackEnv(config, args, env, signal) {
|
|
52
|
+
const status = await readStatus(config, args, env, signal);
|
|
53
|
+
const prefix = await browserPrefix(config, args.prefix);
|
|
54
|
+
const values = stackEnvValues(status, prefix);
|
|
55
|
+
if (!values) throw new CliError("supabase_cli_failed", "supabase status has no API_URL or publishable key. Is the stack running?", { suggestion: "supabase start" });
|
|
56
|
+
return {
|
|
57
|
+
status,
|
|
58
|
+
values
|
|
59
|
+
};
|
|
60
|
+
}
|
|
49
61
|
/** Replaces `KEY=` lines in place and appends the rest under a header. */
|
|
50
62
|
function mergeEnv(current, values) {
|
|
51
63
|
const pending = new Map(Object.entries(values));
|
|
@@ -65,32 +77,20 @@ function mergeEnv(current, values) {
|
|
|
65
77
|
}
|
|
66
78
|
async function runEnv(config, args, env, signal) {
|
|
67
79
|
const status = await readStatus(config, args, env, signal);
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const url = text(status, "API_URL");
|
|
72
|
-
const publishableKey = text(status, "PUBLISHABLE_KEY", "ANON_KEY");
|
|
73
|
-
const secretKey = text(status, "SECRET_KEY", "SERVICE_ROLE_KEY");
|
|
74
|
-
if (!url || !publishableKey) return {
|
|
80
|
+
const prefix = await browserPrefix(config, args.prefix);
|
|
81
|
+
const values = stackEnvValues(status, prefix);
|
|
82
|
+
if (!values) return {
|
|
75
83
|
code: 1,
|
|
76
84
|
error: "supabase status has no API_URL or publishable key. Is the stack running?"
|
|
77
85
|
};
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
[`${prefix}SUPABASE_PUBLISHABLE_KEY`]: publishableKey
|
|
81
|
-
};
|
|
82
|
-
if (secretKey) values["SUPABASE_SECRET_KEY"] = secretKey;
|
|
83
|
-
const dbUrl = text(status, "DB_URL");
|
|
84
|
-
if (dbUrl) values["SUPABASE_DB_URL"] = dbUrl;
|
|
85
|
-
const jwtSecret = text(status, "JWT_SECRET");
|
|
86
|
-
if (jwtSecret) values["SUPABASE_JWT_SECRET"] = jwtSecret;
|
|
87
|
-
if (args.out === "-") return {
|
|
86
|
+
const write = args.write;
|
|
87
|
+
if (write === "-") return {
|
|
88
88
|
code: 0,
|
|
89
89
|
output: Object.entries(values).map(([key, value]) => `${key}=${value}`).join("\n"),
|
|
90
90
|
data: { values }
|
|
91
91
|
};
|
|
92
|
-
const out =
|
|
93
|
-
const path = insideRoot(config.root, out,
|
|
92
|
+
const out = write ?? config.env.output;
|
|
93
|
+
const path = insideRoot(config.root, out, write ? "--write" : "env.output");
|
|
94
94
|
const current = await readIfExists(path) ?? "";
|
|
95
95
|
const file = display(config.root, out);
|
|
96
96
|
const plan = {
|
|
@@ -110,7 +110,8 @@ async function runEnv(config, args, env, signal) {
|
|
|
110
110
|
keys: Object.keys(values)
|
|
111
111
|
} });
|
|
112
112
|
const warnings = [];
|
|
113
|
-
|
|
113
|
+
const publishable = status["PUBLISHABLE_KEY"];
|
|
114
|
+
if (typeof publishable !== "string" || publishable.length === 0) warnings.push("This Supabase CLI prints only legacy JWT keys. Upgrade it to get sb_publishable_/sb_secret_ keys.");
|
|
114
115
|
const gitignore = resolve(config.root, ".gitignore");
|
|
115
116
|
if (!(existsSync(gitignore) && (await readFile(gitignore, "utf-8")).split("\n").some((line) => [
|
|
116
117
|
out,
|
|
@@ -139,4 +140,4 @@ const envCommand = defineCliCommand({
|
|
|
139
140
|
run: (args, { config, env, signal }) => runEnv(config, args, env, signal)
|
|
140
141
|
});
|
|
141
142
|
//#endregion
|
|
142
|
-
export {
|
|
143
|
+
export { runEnv as a, readStackEnv as i, envCommand as n, mergeEnv as r, browserPrefix as t };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { i as plain } from "./style-2JfIPVMQ.js";
|
|
3
3
|
import { a as parseNames, i as failedResult, n as CliError } from "./errors-Caiz_0so.js";
|
|
4
|
-
import { a as catalogFingerprint } from "./cache-
|
|
5
|
-
import { n as runGen } from "./run-
|
|
4
|
+
import { a as catalogFingerprint } from "./cache-DQwgb3rg.js";
|
|
5
|
+
import { n as runGen } from "./run-BhJKAanr.js";
|
|
6
6
|
import { r as isGenTask, t as GEN_TASKS } from "./names-D6LrQnOv.js";
|
|
7
|
-
import { o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-
|
|
8
|
-
import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-
|
|
9
|
-
import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-
|
|
10
|
-
import {
|
|
11
|
-
import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-
|
|
12
|
-
import { t as runScaffoldApi } from "./scaffold-
|
|
13
|
-
import { t as runSeed } from "./seed-
|
|
14
|
-
import { t as runSql } from "./sql-
|
|
7
|
+
import { o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-BBKFojqM.js";
|
|
8
|
+
import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-Cwo7zwvq.js";
|
|
9
|
+
import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-BGkle6WM.js";
|
|
10
|
+
import { a as runEnv } from "./env-Dh5K5t2U.js";
|
|
11
|
+
import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-DZeIP9ta.js";
|
|
12
|
+
import { t as runScaffoldApi } from "./scaffold-DoURlDEI.js";
|
|
13
|
+
import { t as runSeed } from "./seed-CIdg6s7m.js";
|
|
14
|
+
import { t as runSql } from "./sql-DLOvvnBV.js";
|
|
15
15
|
import { existsSync } from "node:fs";
|
|
16
16
|
import { resolve } from "node:path";
|
|
17
17
|
//#region src/cli/commands/gen-pipeline.ts
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -688,6 +688,6 @@ export declare function emitModule(model: Model, options: EmitOptions): string;
|
|
|
688
688
|
export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined): Promise<ResolvedConfig>;
|
|
689
689
|
//#endregion
|
|
690
690
|
//#region src/cli/version.d.ts
|
|
691
|
-
export declare const VERSION = "0.
|
|
691
|
+
export declare const VERSION = "0.12.0";
|
|
692
692
|
//#endregion
|
|
693
693
|
export type { Catalog, CatalogCheck, CatalogColumn, CatalogColumnGrant, CatalogEnum, CatalogForeignKey, CatalogFunction, CatalogFunctionArg, CatalogGrant, CatalogIndex, CatalogPolicy, CatalogTable, CatalogTrigger, CatalogUnique, Choice, Cli, CliArgs, CliCommand, CliCommandDef, CliContext, CliEnv, CliErrorCode, CliErrorOptions, CliIo, CliLog, CliProblem, CliProblemExtensions, CommandResult, CreateCliOptions, ExitCode, ExtrasFunction, ExtrasHook, ExtrasHookFunction, ExtrasTable, ForeignKeyAction, Format, GeneratorMetadata, IntrospectionSource, ManagementSourceOptions, NextStep, Paint, Prompter, Queryable, RunOptions, RunResult, Snapshot, SnapshotBucket, SnapshotExtras };
|
package/dist/cli/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { a as list, r as defineCliCommand } from "./command-
|
|
2
|
-
import { i as run, n as createCli, r as help, t as commandNames } from "./run-
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
1
|
+
import { a as list, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
|
+
import { i as run, n as createCli, r as help, t as commandNames } from "./run-DRZ10srj.js";
|
|
3
|
+
import { t as VERSION } from "./version-B7akdvDv.js";
|
|
4
4
|
import { n as CliError, t as CLI_ERRORS_URL } from "./errors-Caiz_0so.js";
|
|
5
5
|
import { t as toCatalog } from "./catalog-Cm6BtquM.js";
|
|
6
6
|
import { a as buildModel, r as emitModule, t as GENERATED_HEADER } from "./emit-56LAG_Px.js";
|
|
7
|
-
import { S as emitBlockConfig, n as runGen, x as renderFiles } from "./run-
|
|
8
|
-
import { s as loadConfig } from "./config-
|
|
9
|
-
import { a as serializeSnapshot, d as managementSource, f as pgSource, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-
|
|
7
|
+
import { S as emitBlockConfig, n as runGen, x as renderFiles } from "./run-BhJKAanr.js";
|
|
8
|
+
import { s as loadConfig } from "./config-yZ55rsKZ.js";
|
|
9
|
+
import { a as serializeSnapshot, d as managementSource, f as pgSource, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-BBKFojqM.js";
|
|
10
10
|
//#region src/cli/introspect/from-catalog.ts
|
|
11
11
|
/**
|
|
12
12
|
* Builds a snapshot from catalog records: the inverse of `toCatalog`. Tests
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { a as list, p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { i as plain } from "./style-2JfIPVMQ.js";
|
|
3
3
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
4
4
|
import { t as TYPEGEN_VERSION } from "./typegen-version-BNBPI4Eu.js";
|
|
5
|
-
import { a as findConfig, s as loadConfig } from "./config-
|
|
5
|
+
import { a as findConfig, s as loadConfig } from "./config-yZ55rsKZ.js";
|
|
6
6
|
import { n as applyPlan, r as changeLines, s as planResult, t as PLAN_ARGS } from "./files-DDvAwTko.js";
|
|
7
|
-
import { _ as suggestedIntegrations, a as CANCELLED, c as overwrite, d as templateContextFor, f as templatePlan, g as resolveIntegrations, h as needsLib, l as packagesFor, m as baseFiles, n as blockConfigImport, o as chooseIntegrations, p as TEMPLATES, r as blocksWiringPath, s as integrationFiles, u as parseIntegrations } from "./add-
|
|
7
|
+
import { _ as suggestedIntegrations, a as CANCELLED, c as overwrite, d as templateContextFor, f as templatePlan, g as resolveIntegrations, h as needsLib, l as packagesFor, m as baseFiles, n as blockConfigImport, o as chooseIntegrations, p as TEMPLATES, r as blocksWiringPath, s as integrationFiles, u as parseIntegrations } from "./add-TT72pQk6.js";
|
|
8
8
|
import { n as installCommand, t as detectProject } from "./detect-DQsVeBHg.js";
|
|
9
9
|
import { s as enablePgDelta } from "./write-VZljwoTB.js";
|
|
10
10
|
import { n as latestMigrationVersion } from "./migration-safety-DjVpz2D6.js";
|
|
11
|
-
import { a as
|
|
11
|
+
import { a as CONVENTION_ARGS, c as defaultConventions, d as withConventions, i as createUrlParam, l as hasConventionFlags, n as readPresetInput, o as CONVENTION_COMPLETIONS, r as AUTHZ_NOTE, s as conventionFlags, t as writeDesign, u as promptConventions } from "./design-edit-0U9iCTiS.js";
|
|
12
12
|
import { t as syncModules } from "./sync-DBvknfOK.js";
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
14
|
import { join, posix, resolve } from "node:path";
|
|
15
15
|
import { glob, readFile } from "node:fs/promises";
|
|
16
|
-
import { PRESETS, PRESET_NAMES, conventionConfig, designConfig,
|
|
16
|
+
import { PRESETS, PRESET_NAMES, conventionConfig, designConfig, encodePreset, glueCommand, integrationsForFramework, isPresetName, presetBlocksSource, presetGlue, resolvePreset } from "better-supabase/preset";
|
|
17
17
|
import { resolveConfig } from "better-supabase/config";
|
|
18
18
|
//#region src/cli/project/workspace.ts
|
|
19
19
|
const unquote = (value) => value.replace(/\s+#.*$/, "").trim().replace(/^(["'])(.*)\1$/, "$2");
|
|
@@ -120,8 +120,8 @@ const INIT_ARGS = {
|
|
|
120
120
|
},
|
|
121
121
|
preset: {
|
|
122
122
|
type: "string",
|
|
123
|
-
description: "A named preset, a code from /create or
|
|
124
|
-
valueHint: "name|code|url"
|
|
123
|
+
description: "A named preset, a code from /create, its URL or a downloaded design file: the config starts from it, and init writes its modules and lib/blocks.ts",
|
|
124
|
+
valueHint: "name|code|url|file"
|
|
125
125
|
},
|
|
126
126
|
lite: {
|
|
127
127
|
type: "boolean",
|
|
@@ -175,7 +175,7 @@ async function initTarget(cwd, pkg, prompts) {
|
|
|
175
175
|
return dir === void 0 ? CANCELLED : { dir };
|
|
176
176
|
}
|
|
177
177
|
/** The preset `--preset` names, or the one the person picks; `null` for none. */
|
|
178
|
-
async function chosenPreset(args, flags, prompts) {
|
|
178
|
+
async function chosenPreset(args, flags, prompts, root) {
|
|
179
179
|
let value = args.preset;
|
|
180
180
|
if (value === void 0 && prompts && !hasConventionFlags(flags) && args.integration === void 0) {
|
|
181
181
|
const picked = await prompts.select("Preset", [{
|
|
@@ -191,15 +191,9 @@ async function chosenPreset(args, flags, prompts) {
|
|
|
191
191
|
if (picked !== "none") value = picked;
|
|
192
192
|
}
|
|
193
193
|
if (value === void 0) return null;
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
preset = presetOf(value);
|
|
198
|
-
design = isPresetName(value) ? void 0 : await designOf(value);
|
|
199
|
-
} catch (error) {
|
|
200
|
-
throw new CliError("usage", error instanceof Error ? error.message : String(error));
|
|
201
|
-
}
|
|
202
|
-
preset = withConventions(preset, flags);
|
|
194
|
+
const input = await readPresetInput(value, root);
|
|
195
|
+
const design = input.design;
|
|
196
|
+
const preset = withConventions(input.preset, flags);
|
|
203
197
|
const resolved = resolvePreset(preset);
|
|
204
198
|
if (resolved.conflicts.length > 0) throw new CliError("usage", `The preset can't install: ${resolved.conflicts.map((conflict) => `${conflict.block ?? conflict.field ?? ""} (${conflict.reason})`).join("; ")}.`);
|
|
205
199
|
if (design !== void 0) try {
|
|
@@ -233,7 +227,7 @@ function withDesign(files, design) {
|
|
|
233
227
|
}
|
|
234
228
|
async function runInit(config, args, prompts, now = () => /* @__PURE__ */ new Date()) {
|
|
235
229
|
const flags = conventionFlags(args);
|
|
236
|
-
const chosen = await chosenPreset(args, flags, prompts);
|
|
230
|
+
const chosen = await chosenPreset(args, flags, prompts, config.root);
|
|
237
231
|
if (chosen !== null && "code" in chosen) return chosen;
|
|
238
232
|
let conventions = chosen?.resolved.preset;
|
|
239
233
|
conventions ??= prompts && !hasConventionFlags(flags) ? await promptConventions(prompts) : defaultConventions(flags);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
3
3
|
import { c as serializeGenerator, s as restrictSchemas } from "./typegen--TfvOPLh.js";
|
|
4
|
-
import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-
|
|
4
|
+
import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-BBKFojqM.js";
|
|
5
5
|
import { n as applyPlan, o as insideRoot, s as planResult, t as PLAN_ARGS } from "./files-DDvAwTko.js";
|
|
6
|
-
import { i as sourceArgs, n as SOURCE_ARGS } from "./source-args-
|
|
6
|
+
import { i as sourceArgs, n as SOURCE_ARGS } from "./source-args-Cwo7zwvq.js";
|
|
7
7
|
//#region src/cli/commands/introspect.ts
|
|
8
8
|
const ARGS = {
|
|
9
9
|
out: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { t as display } from "./io-BiPX-_J1.js";
|
|
3
3
|
import { m as supabaseDir } from "./supabase-toml-BC5sNVKU.js";
|
|
4
4
|
import { n as applyPlan, r as changeLines } from "./files-DDvAwTko.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as errorText } from "./errors-Caiz_0so.js";
|
|
2
|
-
import "./snapshot-
|
|
2
|
+
import "./snapshot-BBKFojqM.js";
|
|
3
3
|
import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-DKLuA1Tp.js";
|
|
4
4
|
//#region src/cli/doctor/reserved-roles.ts
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
2
|
-
import { a as envelope, i as run } from "./run-
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
|
+
import { a as envelope, i as run } from "./run-DRZ10srj.js";
|
|
3
|
+
import { t as VERSION } from "./version-B7akdvDv.js";
|
|
4
4
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
5
5
|
import { n as consentToken } from "./agent-CCrTYK3W.js";
|
|
6
6
|
import { A as string$1, E as record, M as unknown, O as safeParse, S as optional, a as array, b as object, d as is, o as boolean, t as PROCESS_ENV } from "./env-C8R7Nf0a.js";
|
|
@@ -2,7 +2,7 @@ import { n as CliError, r as errorText } from "./errors-Caiz_0so.js";
|
|
|
2
2
|
import { i as readStdin } from "./io-BiPX-_J1.js";
|
|
3
3
|
import { a as parseMetadataDocument, t as MetadataRejectedError } from "./typegen--TfvOPLh.js";
|
|
4
4
|
import { i as metaPaths } from "./emit-56LAG_Px.js";
|
|
5
|
-
import { b as render, i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-
|
|
5
|
+
import { b as render, i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-BhJKAanr.js";
|
|
6
6
|
import { basename, join, relative, resolve, sep } from "node:path";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
8
8
|
import { jsonSchema, standardSchema, valibot, zod } from "better-supabase/config";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
2
|
-
import { s as positionalIndex } from "./parse-
|
|
2
|
+
import { s as positionalIndex } from "./parse-QzDvMpXH.js";
|
|
3
3
|
//#region src/cli/core/moved.ts
|
|
4
4
|
/** Commands renamed in 0.9, longest prefix first. */
|
|
5
5
|
const MOVED_COMMANDS = [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __toESM } from "./rolldown-runtime-kJ_i4yPo.js";
|
|
2
|
-
import { t as GLOBAL_ARGS } from "./command-
|
|
2
|
+
import { t as GLOBAL_ARGS } from "./command-dfdVhU_2.js";
|
|
3
3
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
4
4
|
//#region src/cli/core/parse.ts
|
|
5
5
|
/** Global options that take a value, so a command name is never the token after them. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-dfdVhU_2.js";
|
|
2
2
|
import { n as CliError } from "./errors-Caiz_0so.js";
|
|
3
3
|
import { PRESET_FIELDS, decodePreset, encodePreset, isPresetCode, listNames, presetConfig, presetOf, resolvePreset } from "better-supabase/preset";
|
|
4
4
|
//#region src/cli/commands/preset.ts
|