better-supabase 0.23.0 → 0.28.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/{access-sql-bjWFUWlk.js → access-sql-CTDNuxRv.js} +177 -12
- package/dist/{ai-schedules-7uQNMXve.d.ts → ai-schedules-yGZH-vQb.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +2 -2
- package/dist/ai-sdk/batches/index.d.ts +1 -1
- package/dist/ai-sdk/index.d.ts +1 -1
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/{api-CHObZL7m.d.ts → api-B1OkIWdx.d.ts} +3 -3
- package/dist/{api-keys-D5k63K6y.d.ts → api-keys-ClhKBDcc.d.ts} +1 -1
- package/dist/{app-tables-CJO6pWwy.d.ts → app-tables-62GqZIhd.d.ts} +1 -1
- package/dist/{approvals-Dh9dUXrN.d.ts → approvals-C5fmPLsH.d.ts} +1 -1
- package/dist/astro/index.d.ts +5 -5
- package/dist/{authorization-Dtwpjeuz.d.ts → authorization-BCG1v0iC.d.ts} +73 -15
- package/dist/{authorization-hooks-D_pwXlBs.d.ts → authorization-hooks-DtzreCAq.d.ts} +1 -1
- package/dist/{automations-FCnWy387.js → automations-8L3NEuoq.js} +4 -1
- package/dist/{availability-vguUvEK2.d.ts → availability-BdeKCHpl.d.ts} +10 -0
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-DaoTunvE.d.ts → bind-C54jD0r3.d.ts} +4 -4
- package/dist/{block-env-DUyo2I5O.d.ts → block-env-CM-LFfj4.d.ts} +4 -4
- package/dist/blocks/access-requests/index.d.ts +2 -2
- package/dist/blocks/activities/index.d.ts +3 -3
- 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 +5 -5
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.d.ts +3 -3
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +5 -5
- package/dist/blocks/api-keys/index.d.ts +5 -5
- package/dist/blocks/approvals/index.d.ts +3 -3
- package/dist/blocks/assets/index.d.ts +2 -2
- package/dist/blocks/assignment/index.d.ts +3 -3
- package/dist/blocks/attachments/index.d.ts +3 -3
- package/dist/blocks/audit/index.d.ts +7 -7
- package/dist/blocks/automations/index.d.ts +5 -5
- package/dist/blocks/billable-time/index.d.ts +2 -2
- package/dist/blocks/billing/index.d.ts +5 -5
- package/dist/blocks/bookings/index.d.ts +6 -6
- package/dist/blocks/bulk/index.d.ts +2 -2
- package/dist/blocks/calendar/index.d.ts +46 -13
- package/dist/blocks/calendar/index.js +130 -30
- package/dist/blocks/catalog/index.d.ts +2 -2
- package/dist/blocks/channels/index.d.ts +3 -3
- package/dist/blocks/collections/index.d.ts +3 -3
- package/dist/blocks/comments/index.d.ts +5 -5
- package/dist/blocks/compliance/index.d.ts +2 -2
- package/dist/blocks/connectors/index.d.ts +3 -3
- package/dist/blocks/contacts/index.d.ts +3 -3
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/contracts/index.d.ts +2 -2
- package/dist/blocks/courses/index.d.ts +2 -2
- package/dist/blocks/created-by/index.d.ts +1 -1
- package/dist/blocks/custom-fields/index.d.ts +2 -2
- package/dist/blocks/custom-fields/index.js +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +4 -4
- package/dist/blocks/deals/index.d.ts +3 -3
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/documents/index.d.ts +2 -2
- package/dist/blocks/domains/index.d.ts +2 -2
- package/dist/blocks/donations/index.d.ts +2 -2
- package/dist/blocks/drive/index.d.ts +4 -4
- package/dist/blocks/employees/index.d.ts +21 -6
- package/dist/blocks/employees/index.js +37 -2
- package/dist/blocks/enrichment/index.d.ts +3 -3
- package/dist/blocks/enrollments/index.d.ts +2 -2
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +2 -2
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/flags/index.d.ts +2 -2
- package/dist/blocks/forecasts/index.d.ts +3 -3
- package/dist/blocks/forms/index.d.ts +3 -3
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/guests/index.d.ts +2 -2
- package/dist/blocks/hiring/index.d.ts +13 -6
- package/dist/blocks/hiring/index.js +15 -4
- package/dist/blocks/identities/index.d.ts +2 -2
- package/dist/blocks/imports/index.d.ts +2 -2
- package/dist/blocks/inbox/index.d.ts +6 -6
- package/dist/blocks/incidents/index.d.ts +2 -2
- package/dist/blocks/index.d.ts +4 -4
- package/dist/blocks/inventory/index.d.ts +2 -2
- package/dist/blocks/invoices/index.d.ts +3 -3
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +1 -1
- package/dist/blocks/leases/index.d.ts +2 -2
- package/dist/blocks/leave/index.d.ts +2 -2
- package/dist/blocks/ledger/index.d.ts +2 -2
- package/dist/blocks/mail-sync/index.d.ts +3 -3
- package/dist/blocks/memberships/index.d.ts +1 -1
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +7 -7
- package/dist/blocks/metrics/index.d.ts +2 -2
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +2 -2
- package/dist/blocks/notifications/index.d.ts +7 -7
- package/dist/blocks/numbering/index.d.ts +2 -2
- package/dist/blocks/oauth-server/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +3 -3
- package/dist/blocks/organizations/index.d.ts +4 -4
- package/dist/blocks/outbox/index.d.ts +2 -2
- package/dist/blocks/passes/index.d.ts +3 -3
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/pipelines/index.d.ts +3 -3
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/promotions/index.d.ts +2 -2
- package/dist/blocks/push/index.d.ts +3 -3
- package/dist/blocks/queue/index.d.ts +1 -1
- package/dist/blocks/quotes/index.d.ts +3 -3
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +5 -5
- package/dist/blocks/relations/index.d.ts +2 -2
- package/dist/blocks/reminders/index.d.ts +4 -4
- package/dist/blocks/reviews/index.d.ts +2 -2
- package/dist/blocks/saved-views/index.d.ts +4 -4
- package/dist/blocks/scores/index.d.ts +2 -2
- package/dist/blocks/search/index.d.ts +4 -4
- package/dist/blocks/security-events/index.d.ts +3 -3
- package/dist/blocks/segments/index.d.ts +3 -3
- package/dist/blocks/sequences/index.d.ts +2 -2
- package/dist/blocks/service-accounts/index.d.ts +2 -2
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +3 -3
- package/dist/blocks/share-links/index.d.ts +2 -2
- package/dist/blocks/shipments/index.d.ts +2 -2
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signing-keys/index.d.ts +2 -2
- package/dist/blocks/sla/index.d.ts +3 -3
- package/dist/blocks/sso/index.d.ts +3 -3
- package/dist/blocks/state-machine/index.d.ts +2 -2
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/tags/index.d.ts +3 -3
- package/dist/blocks/tasks/index.d.ts +6 -6
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +2 -2
- package/dist/blocks/templates/index.d.ts +4 -4
- package/dist/blocks/time-tracking/index.d.ts +10 -5
- package/dist/blocks/time-tracking/index.js +16 -9
- package/dist/blocks/timeline/index.d.ts +4 -4
- package/dist/blocks/trash/index.d.ts +2 -2
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +1 -1
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/vercel-marketplace/index.d.ts +2 -2
- package/dist/blocks/versions/index.d.ts +2 -2
- package/dist/blocks/waitlist/index.d.ts +2 -2
- package/dist/blocks/webhooks/index.d.ts +6 -6
- package/dist/blocks/workflow-editor/index.d.ts +7 -7
- package/dist/blocks/workflows/index.d.ts +5 -5
- package/dist/{bookings-BpCNphYp.d.ts → bookings-CVw5-Q0Z.d.ts} +1 -1
- package/dist/chat-sdk/index.d.ts +2 -2
- package/dist/cli/{add-DVHniZOO.js → add-BKcE_g9D.js} +2 -2
- package/dist/cli/{add-C7lKQNBL.js → add-DUyg9qna.js} +40 -15
- package/dist/cli/add-pDOlqWUa.js +1 -0
- package/dist/cli/{backfill-Lrn-Qp5X.js → backfill-r9RELEEh.js} +4 -4
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-BKNd886C.js → blocks-DTOFdrxL.js} +1 -1
- package/dist/cli/{blocks-2Yw9t-_U.js → blocks-k1OG8XDs.js} +2 -2
- package/dist/cli/{cache-ByhPVMo-.js → cache-Czfw7Iow.js} +1 -1
- package/dist/cli/{codemod-C0eXpzFu.js → codemod-ClmbiLuL.js} +3 -3
- package/dist/cli/{command-BWEEXmtz.js → command-CVzTJSLp.js} +31 -0
- package/dist/cli/{completion-8EDK21xj.js → completion-CNCqE-Gb.js} +1 -1
- package/dist/cli/{completion-BfnKI4QZ.js → completion-Dpk6vh0p.js} +2 -2
- package/dist/cli/{completion-Bt7LMypX.js → completion-DxEXxFpz.js} +2 -2
- package/dist/cli/{config-CeaQMrvS.js → config-D2YUlzrl.js} +1 -1
- package/dist/cli/{config-WKDixoGK.js → config-EjNj3HfT.js} +1 -1
- package/dist/cli/{config-BVfeG3A5.js → config-KvV-sLZL.js} +290 -10
- package/dist/cli/{content-mapper-qH-_YQ8H.js → content-mapper-ez_mT0d4.js} +2 -2
- package/dist/cli/{db-DwjyUbAh.js → db-uYN6O5Eg.js} +38 -14
- package/dist/cli/{doctor-BnxkqXGA.js → doctor-BD9oo4MG.js} +31 -28
- package/dist/cli/{env-DMgjB_4y.js → env-BK0xKMeU.js} +1 -2
- package/dist/cli/{env-C-Bl6Awn.js → env-Bat6ogep.js} +1 -1
- package/dist/cli/env-Cy2lWBRC.js +1 -0
- package/dist/cli/{env-BCgVZkcb.js → env-DEAtgGoj.js} +2 -2
- package/dist/cli/{exec--Q1ZEWUW.js → exec-Ca5s-ygi.js} +1 -1
- package/dist/cli/{gen-aERmP3Sw.js → gen-8Ya8n2sA.js} +16 -16
- package/dist/cli/in-stack-diff-Cp-tVPj2.js +186 -0
- package/dist/cli/index.d.ts +1 -2
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-DWUqVSVW.js → init-DgL3sDfQ.js} +118 -11
- package/dist/cli/{keys-CbaL0lnw.js → keys-CsanNk-2.js} +1 -1
- package/dist/cli/{live-KcdTBUij.js → live-CMMEct_F.js} +2 -2
- package/dist/cli/{mcp-Dsjjo-LT.js → mcp-DEHtzAkq.js} +4 -4
- package/dist/cli/{metadata-DWQSIZ59.js → metadata-BZh-cOzC.js} +3 -3
- package/dist/cli/migrate-sVs1QYTM.js +306 -0
- package/dist/cli/{migration-safety-Cy7xlU4G.js → migration-safety-ClnYNMdq.js} +2 -2
- package/dist/cli/migrations-DWh38tO9.js +117 -0
- package/dist/cli/{module-migration-C6NLY9iZ.js → module-migration-CXfRJIV4.js} +2 -2
- package/dist/cli/{moved-DVwgE8lV.js → moved-Cnb4fp49.js} +1 -1
- package/dist/cli/{parse-B079x40m.js → parse-BWM6IGhF.js} +1 -1
- package/dist/cli/powersync-DURhWDVc.js +1 -0
- package/dist/cli/{powersync-CE_hQdgc.js → powersync-Dnyr-Wy5.js} +4 -3
- package/dist/cli/{print-Cy_ram9N.js → print-DJrSr56b.js} +2 -2
- package/dist/cli/{migrations-CUjNXokR.js → providers-CpaISitn.js} +4 -116
- package/dist/cli/{remove-DmwjzqaW.js → remove-ChaieK3t.js} +6 -6
- package/dist/cli/{render-CF09FCra.js → render-DUNJ4Pss.js} +8 -5
- package/dist/cli/{run-BYpZ8FjF.js → run-ChCQPYOh.js} +41 -39
- package/dist/cli/{run-lh-chAJW.js → run-Cl9COGuy.js} +10 -10
- package/dist/cli/{run-DmOTMa44.js → run-CxFDjL1Q.js} +4 -4
- package/dist/cli/seed-BJ7c-ktX.js +1 -0
- package/dist/cli/{seed-BMynpMPy.js → seed-BzVLTdRl.js} +3 -3
- package/dist/cli/{shared-D05A6t1e.js → shared-5uqc1GBj.js} +1 -1
- package/dist/cli/{skills-FXAVPLzp.js → skills-0gz_qjVb.js} +1 -1
- package/dist/cli/{snapshot-BITNbA5V.js → snapshot-DdAP7LWO.js} +3 -3
- package/dist/cli/{source-GGJHuzpH.js → source-2irbWSck.js} +1 -1
- package/dist/cli/{source-args-CDmmFmFG.js → source-args-DAcQt-Mh.js} +1 -1
- package/dist/cli/{spec-BGcRdlhN.js → spec-B7n4Rthp.js} +3 -3
- package/dist/cli/{spec-BjxXWaNQ.js → spec-_MS0ym5r.js} +1 -1
- package/dist/cli/{sql-layout-BoD5ynN9.js → sql-layout-DYKkQw1k.js} +21 -7
- package/dist/cli/{stack-DgASZP0K.js → stack-CteM33gC.js} +3 -3
- package/dist/cli/{stack-status-B_Ipd_-z.js → stack-status-BkkYRlXG.js} +1 -1
- package/dist/cli/{stacks-BYlQ96WS.js → stacks-CiDBH1dB.js} +1 -1
- package/dist/cli/{sync-_QlsTmqu.js → sync-DnSOrQuA.js} +4 -3
- package/dist/cli/table-DeH8X0qz.js +89 -0
- package/dist/cli/{upgrade-Cwhb1M7O.js → upgrade-CWdrC-K3.js} +5 -4
- package/dist/cli/{upgrade-n9ar1kc4.js → upgrade-cMy5fKkg.js} +3 -3
- package/dist/cli/{version-RSpJIWDd.js → version-C5RAWmrD.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/native/index.d.ts +4 -4
- package/dist/{cloud-event-CzZTJkXv.d.ts → cloud-event-DcJwder2.d.ts} +1 -1
- package/dist/{composite-ChzHhSB0.d.ts → composite-CWJvZgni.d.ts} +6 -6
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +4 -4
- package/dist/{config-RwpFcPq8.js → config-CTeR7XHK.js} +6 -5
- package/dist/{config-vHLJ8SKf.js → config-CvJHIy5q.js} +4 -3
- package/dist/{connectors-Fud4amxp.d.ts → connectors-CHGiffYH.d.ts} +1 -1
- package/dist/{context-CMf4OKpN.d.ts → context-BFEX0b7H.d.ts} +109 -4
- package/dist/{controller-BGto_kYM.d.ts → controller-Cl6HmMBk.d.ts} +1 -1
- package/dist/{conversion-DBgMck5U.d.ts → conversion-DlfStnln.d.ts} +1 -1
- package/dist/create/index.d.ts +62 -3
- package/dist/create/index.js +67 -4
- package/dist/create/lite/index.d.ts +140 -3
- package/dist/create/lite/index.js +399 -47
- package/dist/credentials/index.d.ts +3 -3
- package/dist/{define-Lf6rI2QN.d.ts → define-BLP6XtoL.d.ts} +1 -1
- package/dist/{define-block-DCAiOrNX.d.ts → define-block-DibVN37N.d.ts} +4 -4
- package/dist/edge/index.d.ts +8 -8
- package/dist/elysia/index.d.ts +1 -1
- package/dist/{ended-gUsMZVNg.d.ts → ended-B8RyuUXF.d.ts} +1 -1
- package/dist/{entitlements-CIhVQ-0u.d.ts → entitlements-Y-n4RGAd.d.ts} +2 -2
- package/dist/eve/index.d.ts +2 -2
- package/dist/{event-calendar-DCufbihU.d.ts → event-calendar-DVLs2wUO.d.ts} +1 -1
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-vcqenSYU.d.ts → events-Cc9DDQWH.d.ts} +2 -0
- package/dist/{executor-DNK401lZ.d.ts → executor-C-Ox9eKq.d.ts} +1 -1
- package/dist/{executor-aFV7nEBs.d.ts → executor-DNPm13a9.d.ts} +2 -2
- package/dist/expo/index.d.ts +3 -3
- package/dist/{field-errors-BDhPaO0a.d.ts → field-errors-Btn3czyz.d.ts} +7 -7
- package/dist/{framework-DKA3fTHl.d.ts → framework-GlxXiotm.d.ts} +6 -6
- 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/{index-CFWlHuVY.d.ts → index-8wOL81rB.d.ts} +1 -1
- package/dist/{index-ClvuSZEz.d.ts → index-BfYDY6eh.d.ts} +3 -3
- package/dist/{index-ujNqgZ6B.d.ts → index-C0_cweyT.d.ts} +11 -11
- package/dist/{index--OhYKouV.d.ts → index-CAY7rIQs.d.ts} +3 -3
- package/dist/{index-CG9rA8H8.d.ts → index-C_qlBJ3k.d.ts} +2 -2
- package/dist/{index-iRkFvJ7J.d.ts → index-D1ckLbUM.d.ts} +1 -1
- package/dist/{index-lV43eM34.d.ts → index-DPMVWm_Z.d.ts} +4 -4
- package/dist/{index-4MStWaeF.d.ts → index-k-SyCzcQ.d.ts} +105 -120
- package/dist/index.d.ts +2 -2
- package/dist/{instances-BPJSESPx.js → instances-C7qUTjhJ.js} +85 -6
- package/dist/{kit-CVgQCIBO.d.ts → kit-Dxx3MT8m.d.ts} +3 -3
- package/dist/list/index.d.ts +1 -1
- package/dist/{list-query-XYfUZb0j.d.ts → list-query-XHoYDlRN.d.ts} +1 -1
- package/dist/mapper/bin.js +7 -7
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/sdk/index.d.ts +5 -5
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/next/client/index.d.ts +1 -1
- package/dist/next/index.d.ts +21 -21
- package/dist/node/index.d.ts +2 -2
- package/dist/{operations-qSBBV5vl.d.ts → operations-DE7SOBw-.d.ts} +1 -1
- package/dist/{options-D4ADKTKo.js → options-B5E2MGIz.js} +6 -1
- package/dist/options-C4LuqmdG.js +15 -0
- package/dist/{options-D2s7fT1s.js → options-COo7_3MX.js} +2 -1
- package/dist/{options-D32-YxnO.js → options-DhoLMknl.js} +3 -1
- package/dist/{options-BPp2zzsz.js → options-eTepQ1rZ.js} +2 -1
- package/dist/orpc/index.d.ts +7 -7
- package/dist/otel/index.d.ts +1 -1
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-HxjZTfF6.d.ts → outbox-DxZgoKwp.d.ts} +2 -2
- package/dist/{pool-CrtT4dg-.d.ts → pool-wjbAMqc1.d.ts} +1 -1
- package/dist/{ports-DbHiNSAa.d.ts → ports-DP0bthUk.d.ts} +1 -1
- package/dist/postgres/index.d.ts +1 -1
- package/dist/powersync/index.d.ts +3 -3
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-B1xXOJ0T.js → preset-DwuWNBip.js} +2 -2
- package/dist/{project-BM6QMtzV.js → project-Bo1vZqVs.js} +5 -5
- package/dist/{provider-CqwEOLCA.d.ts → provider-ClrIplXa.d.ts} +1 -1
- package/dist/{push-token-BwF1fyjA.d.ts → push-token-v3xCcVU7.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/realtime/index.d.ts +4 -4
- package/dist/realtime/index.js +1 -1
- package/dist/{record-form-BbZpwsEi.d.ts → record-form-D2-F4IwS.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{refresh-DT_ICaK-.d.ts → refresh-CCKB1Wa6.d.ts} +1 -1
- package/dist/{refusal-OrlI3g4H.d.ts → refusal-D_tklIEb.d.ts} +2 -2
- package/dist/{resolve-CXX6DHv3.d.ts → resolve-Bj1qD7Dy.d.ts} +1 -1
- package/dist/{resolved-names-WzRYhUez.js → resolved-names-iLBOUaib.js} +2 -2
- package/dist/{resource-execute-CUG6xUuh.d.ts → resource-execute-BSTIfp1D.d.ts} +1 -1
- package/dist/{resource-types-DjZ91WKA.d.ts → resource-types-D5WEvYtV.d.ts} +2 -2
- package/dist/{resources-6Ncdt9XT.d.ts → resources-CsZ7RhZC.d.ts} +1 -1
- package/dist/{respond-oZeJ342J.d.ts → respond-BzRG-0qc.d.ts} +1 -1
- package/dist/server/index.d.ts +20 -20
- package/dist/{server-types-BH6AjDBN.d.ts → server-types-BlDiY-ya.d.ts} +8 -8
- package/dist/{session-Y5SSYO2C.d.ts → session-BGP98Rgj.d.ts} +5 -5
- package/dist/{session-status-qQLm7jzh.d.ts → session-status-C4t7kbSn.d.ts} +2 -2
- package/dist/{sign-in-BAjR49fq.d.ts → sign-in-CAadgm33.d.ts} +2 -2
- package/dist/solid/index.d.ts +9 -9
- package/dist/solid-start/index.d.ts +5 -5
- package/dist/spec/index.d.ts +1 -1
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +5 -5
- package/dist/{sql-CNH8kjLS.js → sql-B7vBP9g0.js} +6248 -2092
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/ssr/index.d.ts +5 -5
- package/dist/storage/index.js +1 -1
- package/dist/{subject-readers-8GySC9Z8.d.ts → subject-readers-DJbzlm8a.d.ts} +1 -1
- package/dist/{subjects-NomQg6Eg.d.ts → subjects-BYCL-6hA.d.ts} +15 -1
- package/dist/{support-B4ZBVxt3.d.ts → support-D7CMbhRT.d.ts} +4 -4
- package/dist/{support-view-BYOgwXsJ.d.ts → support-view-CIDXF3_H.d.ts} +1 -1
- package/dist/svelte/index.d.ts +8 -8
- package/dist/sveltekit/index.d.ts +6 -6
- package/dist/{tags-Cjtcp5cN.d.ts → tags-Dg4Ywmqp.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +5 -5
- package/dist/{tenant-D4BA7XQ-.d.ts → tenant-CyLEXgot.d.ts} +2 -2
- package/dist/testing/index.d.ts +16 -16
- package/dist/testing/index.js +2 -2
- package/dist/{timeline-CEzj9v1z.d.ts → timeline-Cjl-1hiA.d.ts} +3 -3
- package/dist/{topic-utZqhw96.d.ts → topic-B_DGdAEs.d.ts} +3 -3
- package/dist/{topic-F0FKzJyQ.js → topic-DnsNG4Kj.js} +1 -1
- package/dist/{types-yj8VF4oY.d.ts → types-BdaBfYIw.d.ts} +2 -2
- package/dist/{types-DLnBJ3ST.d.ts → types-DF8JYEf5.d.ts} +2 -2
- package/dist/{types-EO2crSX_.d.ts → types-DR1MHh7N.d.ts} +1 -1
- package/dist/{vault-O-YlAyHb.d.ts → vault-BghaujrZ.d.ts} +1 -1
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/{verify-B0KLBb3j.d.ts → verify-CI8LgSpv.d.ts} +1 -1
- package/dist/{view-DyFdMCqg.d.ts → view-BvNA7EOC.d.ts} +1 -1
- package/dist/vue/index.d.ts +9 -9
- package/dist/{watch-topic-B1UCoQfz.d.ts → watch-topic-1zIAtiNM.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/world/index.d.ts +1 -1
- package/dist/workflow-sdk/world/index.js +1 -1
- package/dist/{workflow-sdk-B3Ss55Fy.d.ts → workflow-sdk-BNsZrcVg.d.ts} +1 -1
- package/dist/{workflow-sdk-CE8sEK57.js → workflow-sdk-CaEw822d.js} +25 -4
- package/dist/yjs/index.d.ts +1 -1
- package/dist/yjs/index.js +1 -1
- package/package.json +11 -1
- package/schemas/config-v1.json +95 -1
- package/dist/cli/add-vZRn-uH0.js +0 -1
- package/dist/cli/env-xhwXk5Ri.js +0 -1
- package/dist/cli/in-stack-diff-DQTW53Vf.js +0 -257
- package/dist/cli/powersync-BOhjVQCb.js +0 -1
- package/dist/cli/seed-CO3j_bly.js +0 -1
- package/dist/options-DztCKw_f.js +0 -8
|
@@ -1,22 +1,22 @@
|
|
|
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-CVzTJSLp.js";
|
|
2
2
|
import { i as plain } from "./style-Bm2X5JrN.js";
|
|
3
3
|
import { a as parseNames, i as failedResult, n as CliError } from "./errors-BTe6A15O.js";
|
|
4
|
-
import { u as catalogFingerprint } from "./cache-
|
|
5
|
-
import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-
|
|
6
|
-
import {
|
|
7
|
-
import { d as GEN_TASKS, p as isGenTask } from "./config-BVfeG3A5.js";
|
|
4
|
+
import { u as catalogFingerprint } from "./cache-Czfw7Iow.js";
|
|
5
|
+
import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
|
|
6
|
+
import { d as GEN_TASKS, p as isGenTask } from "./config-KvV-sLZL.js";
|
|
8
7
|
import { c as insideRoot, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
|
|
9
|
-
import { n as runGen } from "./run-
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { a as
|
|
15
|
-
import { a as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { t as
|
|
8
|
+
import { n as runGen } from "./run-Cl9COGuy.js";
|
|
9
|
+
import { n as dataMigration } from "./migrations-DWh38tO9.js";
|
|
10
|
+
import { t as syncModules } from "./sync-DnSOrQuA.js";
|
|
11
|
+
import { t as addModules } from "./add-BKcE_g9D.js";
|
|
12
|
+
import { n as listModules, t as printModule } from "./print-DJrSr56b.js";
|
|
13
|
+
import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-DAcQt-Mh.js";
|
|
14
|
+
import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-BZh-cOzC.js";
|
|
15
|
+
import { a as runEnv } from "./env-DEAtgGoj.js";
|
|
16
|
+
import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-B7n4Rthp.js";
|
|
17
|
+
import { n as runPowerSync } from "./powersync-Dnyr-Wy5.js";
|
|
18
|
+
import { t as runSeed } from "./seed-BzVLTdRl.js";
|
|
19
|
+
import { t as upgrade } from "./upgrade-CWdrC-K3.js";
|
|
20
20
|
import { existsSync } from "node:fs";
|
|
21
21
|
import { resolve } from "node:path";
|
|
22
22
|
//#region src/cli/commands/sql.ts
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
+
import { t as connect } from "./db-CQCLx7cx.js";
|
|
3
|
+
import { basename, join } from "node:path";
|
|
4
|
+
import { readFile, readdir } from "node:fs/promises";
|
|
5
|
+
import { gatePlan } from "better-supabase/create";
|
|
6
|
+
//#region src/cli/in-stack-diff.ts
|
|
7
|
+
/**
|
|
8
|
+
* Schemas the platform owns. The declarative files may add policies to their
|
|
9
|
+
* tables (`storage.objects`), so those policies are dropped and replayed, but
|
|
10
|
+
* the schemas themselves are kept.
|
|
11
|
+
*/
|
|
12
|
+
const PLATFORM_SCHEMAS = /* @__PURE__ */ new Set([
|
|
13
|
+
"_analytics",
|
|
14
|
+
"_realtime",
|
|
15
|
+
"auth",
|
|
16
|
+
"cron",
|
|
17
|
+
"extensions",
|
|
18
|
+
"graphql",
|
|
19
|
+
"graphql_public",
|
|
20
|
+
"information_schema",
|
|
21
|
+
"net",
|
|
22
|
+
"pgbouncer",
|
|
23
|
+
"pgmq",
|
|
24
|
+
"pgsodium",
|
|
25
|
+
"pgsodium_masks",
|
|
26
|
+
"pgtle",
|
|
27
|
+
"realtime",
|
|
28
|
+
"repack",
|
|
29
|
+
"storage",
|
|
30
|
+
"supabase_functions",
|
|
31
|
+
"supabase_migrations",
|
|
32
|
+
"tiger",
|
|
33
|
+
"tiger_data",
|
|
34
|
+
"topology",
|
|
35
|
+
"vault"
|
|
36
|
+
]);
|
|
37
|
+
/** Why the Supabase CLI could not start its shadow database. */
|
|
38
|
+
const SHADOW_FAILURE = /could not create shared memory segment|No space left on device|shmget|shadow database/i;
|
|
39
|
+
function isShadowFailure(output) {
|
|
40
|
+
return SHADOW_FAILURE.test(output);
|
|
41
|
+
}
|
|
42
|
+
/** The migration versions (`<digits>_name.sql`) the stack has not applied. */
|
|
43
|
+
function pendingMigrations(files, applied) {
|
|
44
|
+
return files.filter((file) => {
|
|
45
|
+
const version = /^(\d+)_/.exec(basename(file))?.[1];
|
|
46
|
+
return version !== void 0 && !applied.has(version);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
const MIGRATION_HEADER = `-- Generated by better-supabase db diff from the running stack with pg-delta.
|
|
50
|
+
-- The SQL compares two databases, so review it before you apply it: check
|
|
51
|
+
-- the order of the statements and drop the ones you didn't mean to change.
|
|
52
|
+
`;
|
|
53
|
+
/** UTC `YYYYMMDDHHMMSS`, the Supabase CLI's migration version. */
|
|
54
|
+
function migrationVersion(now) {
|
|
55
|
+
return now.toISOString().replaceAll(/[-:T]/g, "").slice(0, 14);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Pg-delta is an optional peer (with `@supabase/pg-topo`) that only `db diff`
|
|
59
|
+
* needs, so it loads on demand. Without it, `db diff` says how to install it.
|
|
60
|
+
*/
|
|
61
|
+
async function loadPgDelta(load = () => import("@supabase/pg-delta")) {
|
|
62
|
+
try {
|
|
63
|
+
return await load();
|
|
64
|
+
} catch {
|
|
65
|
+
throw new CliError("dependency_missing", "better-supabase needs \"@supabase/pg-delta\" and \"@supabase/pg-topo\" to plan the diff. Install them: pnpm add -D @supabase/pg-delta @supabase/pg-topo", { suggestion: "pnpm add -D @supabase/pg-delta @supabase/pg-topo" });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* `pg` is an optional peer that pg-delta shares; the pools it takes come from
|
|
70
|
+
* it.
|
|
71
|
+
*/
|
|
72
|
+
async function openPgPool(url) {
|
|
73
|
+
try {
|
|
74
|
+
const mod = await import("pg");
|
|
75
|
+
const { Pool } = mod.default ?? mod;
|
|
76
|
+
return new Pool({ connectionString: url });
|
|
77
|
+
} catch {
|
|
78
|
+
throw new CliError("dependency_missing", "better-supabase needs the \"pg\" package to diff the schema. Install it: pnpm add -D pg", { suggestion: "pnpm add -D pg" });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function appliedVersions(client) {
|
|
82
|
+
const rows = await client.query("select version from supabase_migrations.schema_migrations").then((result) => result.rows).catch(() => []);
|
|
83
|
+
return new Set(rows.map((row) => row.version));
|
|
84
|
+
}
|
|
85
|
+
function behindMessage(behind) {
|
|
86
|
+
return `The stack has not applied ${String(behind.length)} migration(s) (${behind.slice(0, 3).join(", ")}${behind.length > 3 ? ", ..." : ""}), so the diff would repeat them. Run supabase migration up, then diff again.`;
|
|
87
|
+
}
|
|
88
|
+
/** One SQL statement per action, each ended with a semicolon. */
|
|
89
|
+
function actionsSql(actions) {
|
|
90
|
+
return actions.map((action) => {
|
|
91
|
+
const sql = action.sql.trim();
|
|
92
|
+
return sql.endsWith(";") ? sql : `${sql};`;
|
|
93
|
+
}).join("\n\n");
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Diffs the declarative schema against the running stack with pg-delta's
|
|
97
|
+
* library plan, connected as the stack's `postgres` role: objects owned by
|
|
98
|
+
* `supabase_admin` are invisible to pg-delta, so a shadow that role created
|
|
99
|
+
* would look empty. The plan: it creates a shadow database on the stack's
|
|
100
|
+
* cluster, loads the files into it, and plans the changes from the stack to the
|
|
101
|
+
* shadow. Renames are applied only when a hint confirms them, and destructive
|
|
102
|
+
* actions are blocked unless `allowDataLoss` is set. The shadow is always
|
|
103
|
+
* dropped.
|
|
104
|
+
*/
|
|
105
|
+
async function inStackDiff(options) {
|
|
106
|
+
const open = options.open ?? connect;
|
|
107
|
+
const loadDelta = options.loadDelta ?? loadPgDelta;
|
|
108
|
+
const openPool = options.openPool ?? openPgPool;
|
|
109
|
+
const log = options.log ?? (() => {});
|
|
110
|
+
const main = await open(options.url);
|
|
111
|
+
try {
|
|
112
|
+
const behind = pendingMigrations(options.migrations, await appliedVersions(main.client));
|
|
113
|
+
if (behind.length > 0) throw new CliError("check_failed", behindMessage(behind), { suggestion: "supabase migration up" });
|
|
114
|
+
} finally {
|
|
115
|
+
await main.close();
|
|
116
|
+
}
|
|
117
|
+
const delta = await loadDelta();
|
|
118
|
+
const hints = options.hints ?? [];
|
|
119
|
+
const files = await Promise.all(options.files.map(async (file) => ({
|
|
120
|
+
name: file,
|
|
121
|
+
sql: await readFile(join(options.root, file), "utf-8")
|
|
122
|
+
})));
|
|
123
|
+
log("Creating a shadow database on the stack");
|
|
124
|
+
const shadow = await delta.provisionCoLocatedShadow(options.url).catch((cause) => {
|
|
125
|
+
throw new CliError("failed", cause instanceof Error ? cause.message : String(cause));
|
|
126
|
+
});
|
|
127
|
+
const target = await openPool(options.url);
|
|
128
|
+
const scratch = await openPool(shadow.url);
|
|
129
|
+
try {
|
|
130
|
+
const planFiles = (accept) => delta.planSchemaFiles(target, scratch, files, {
|
|
131
|
+
profile: delta.supabaseProfile,
|
|
132
|
+
renames: "prompt",
|
|
133
|
+
seedAssumedSchemas: true,
|
|
134
|
+
acceptRenames: accept
|
|
135
|
+
});
|
|
136
|
+
log(`Planning ${String(files.length)} schema file(s) with pg-delta`);
|
|
137
|
+
let result = await planFiles([]);
|
|
138
|
+
let gate = gatePlan(describePlan(delta, result.plan), {
|
|
139
|
+
hints,
|
|
140
|
+
allowDataLoss: options.allowDataLoss === true
|
|
141
|
+
});
|
|
142
|
+
if (gate.accepted.length > 0) {
|
|
143
|
+
result = await planFiles(result.plan.renameCandidates.filter((candidate) => gate.accepted.some((accepted) => accepted.from === delta.encodeId(candidate.from) && accepted.to === delta.encodeId(candidate.to))));
|
|
144
|
+
gate = gatePlan(describePlan(delta, result.plan), {
|
|
145
|
+
hints,
|
|
146
|
+
allowDataLoss: options.allowDataLoss === true
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const sql = gate.blocked ? "" : actionsSql(result.plan.actions);
|
|
150
|
+
const diagnostics = [
|
|
151
|
+
...result.loadDiagnostics,
|
|
152
|
+
...result.targetDiagnostics,
|
|
153
|
+
...result.driftDiagnostics
|
|
154
|
+
];
|
|
155
|
+
return {
|
|
156
|
+
sql,
|
|
157
|
+
gate,
|
|
158
|
+
issues: gate.issues,
|
|
159
|
+
diagnostics,
|
|
160
|
+
skipped: result.skipped
|
|
161
|
+
};
|
|
162
|
+
} finally {
|
|
163
|
+
await Promise.allSettled([target.end(), scratch.end()]);
|
|
164
|
+
await shadow.cleanup();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** The plan with stable ids written as strings, the shape `gatePlan` reads. */
|
|
168
|
+
function describePlan(delta, plan) {
|
|
169
|
+
return {
|
|
170
|
+
actions: plan.actions,
|
|
171
|
+
renameCandidates: plan.renameCandidates.map((candidate) => ({
|
|
172
|
+
kind: candidate.kind,
|
|
173
|
+
from: delta.encodeId(candidate.from),
|
|
174
|
+
to: delta.encodeId(candidate.to),
|
|
175
|
+
status: candidate.status,
|
|
176
|
+
...candidate.reason === void 0 ? {} : { reason: candidate.reason }
|
|
177
|
+
}))
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
/** The migration files under `supabase/migrations`, relative to the root. */
|
|
181
|
+
async function migrationFiles(root, supabaseDir) {
|
|
182
|
+
const dir = join(supabaseDir, "migrations");
|
|
183
|
+
return (await readdir(join(root, dir)).catch(() => [])).filter((name) => name.endsWith(".sql")).toSorted().map((name) => join(dir, name));
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
export { migrationFiles as a, isShadowFailure as i, PLATFORM_SCHEMAS as n, migrationVersion as o, inStackDiff as r, MIGRATION_HEADER as t };
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -119,7 +119,6 @@ interface CliEnv {
|
|
|
119
119
|
* The directory with `pg_dump` and `psql` for `db diff --in-stack`; found
|
|
120
120
|
* from the stack's postmaster otherwise.
|
|
121
121
|
*/
|
|
122
|
-
readonly BSB_PG_BIN?: string | undefined;
|
|
123
122
|
/** Every variable of the run, for the processes the CLI starts. */
|
|
124
123
|
readonly [PROCESS_ENV]?: Readonly<Record<string, string | undefined>>;
|
|
125
124
|
}
|
|
@@ -798,6 +797,6 @@ export declare function emitModule(model: Model, options: EmitOptions): string;
|
|
|
798
797
|
export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined): Promise<ResolvedConfig>;
|
|
799
798
|
//#endregion
|
|
800
799
|
//#region src/cli/version.d.ts
|
|
801
|
-
export declare const VERSION = "0.
|
|
800
|
+
export declare const VERSION = "0.28.0";
|
|
802
801
|
//#endregion
|
|
803
802
|
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-CVzTJSLp.js";
|
|
2
|
+
import { i as run, n as createCli, r as help, t as commandNames } from "./run-ChCQPYOh.js";
|
|
3
|
+
import { t as VERSION } from "./version-C5RAWmrD.js";
|
|
4
4
|
import { n as CliError, t as CLI_ERRORS_URL } from "./errors-BTe6A15O.js";
|
|
5
|
-
import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-
|
|
6
|
-
import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-
|
|
7
|
-
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-
|
|
8
|
-
import { s as loadConfig } from "./config-
|
|
9
|
-
import { n as runGen } from "./run-
|
|
5
|
+
import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
|
|
6
|
+
import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-DUNJ4Pss.js";
|
|
7
|
+
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-2irbWSck.js";
|
|
8
|
+
import { s as loadConfig } from "./config-KvV-sLZL.js";
|
|
9
|
+
import { n as runGen } from "./run-Cl9COGuy.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 and
|
|
@@ -1,20 +1,94 @@
|
|
|
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-CVzTJSLp.js";
|
|
2
2
|
import { i as plain } from "./style-Bm2X5JrN.js";
|
|
3
3
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
4
4
|
import { r as readIfExists } from "./io-DH1kcmmP.js";
|
|
5
|
-
import { l as TYPEGEN_VERSION } from "./cache-
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
5
|
+
import { l as TYPEGEN_VERSION } from "./cache-Czfw7Iow.js";
|
|
6
|
+
import { a as serializeSnapshot, t as loadSnapshot } from "./snapshot-DdAP7LWO.js";
|
|
7
|
+
import { a as toCatalog } from "./source-2irbWSck.js";
|
|
8
|
+
import { a as findConfig, s as loadConfig } from "./config-KvV-sLZL.js";
|
|
9
|
+
import { r as contentMapperFiles } from "./content-mapper-ez_mT0d4.js";
|
|
10
|
+
import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
|
|
11
|
+
import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-DUyg9qna.js";
|
|
12
|
+
import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-ClnYNMdq.js";
|
|
11
13
|
import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
|
|
12
|
-
import { s as enablePgDelta, t as syncModules } from "./sync-
|
|
14
|
+
import { s as enablePgDelta, t as syncModules } from "./sync-DnSOrQuA.js";
|
|
13
15
|
import { existsSync } from "node:fs";
|
|
14
16
|
import { join, posix, resolve } from "node:path";
|
|
15
|
-
import { glob, readFile } from "node:fs/promises";
|
|
17
|
+
import { glob, readFile, readdir } from "node:fs/promises";
|
|
16
18
|
import { groupConfig, resolveConfig } from "better-supabase/config";
|
|
17
19
|
import { PRESETS, PRESET_NAMES, conventionConfig, designConfig, glueCommand, integrationsForFramework, isPresetName, presetBlocksSource, presetGlue, presetSpec, resolvePreset } from "better-supabase/preset";
|
|
20
|
+
//#region src/cli/init-existing.ts
|
|
21
|
+
/** Where `init --from <url>` writes the schema it read. */
|
|
22
|
+
const SNAPSHOT_PATH = "supabase/snapshot.json";
|
|
23
|
+
const DATABASE_URL = /^postgres(?:ql)?:\/\//u;
|
|
24
|
+
/** Whether `--from` names a database rather than a preset, design or file. */
|
|
25
|
+
const isDatabaseUrl = (value) => DATABASE_URL.test(value);
|
|
26
|
+
async function sqlFiles(dir) {
|
|
27
|
+
if (!existsSync(dir)) return 0;
|
|
28
|
+
return (await readdir(dir, {
|
|
29
|
+
withFileTypes: true,
|
|
30
|
+
recursive: true
|
|
31
|
+
})).filter((entry) => entry.isFile() && entry.name.endsWith(".sql")).length;
|
|
32
|
+
}
|
|
33
|
+
/** The tables in the project's saved snapshot, or none without one. */
|
|
34
|
+
async function snapshotTables(config, env, root) {
|
|
35
|
+
const path = join(root, SNAPSHOT_PATH);
|
|
36
|
+
if (!existsSync(path)) return [];
|
|
37
|
+
try {
|
|
38
|
+
return toCatalog(await loadSnapshot(config, env, { snapshotPath: path })).tables;
|
|
39
|
+
} catch {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The migrations, schema files and snapshot tables of the Supabase folder in
|
|
45
|
+
* `root`, or `undefined` for a project without one.
|
|
46
|
+
*/
|
|
47
|
+
async function detectExisting(config, env, root) {
|
|
48
|
+
const supabase = join(root, "supabase");
|
|
49
|
+
if (!existsSync(supabase)) return;
|
|
50
|
+
const [migrations, schemaFiles, tables] = await Promise.all([
|
|
51
|
+
sqlFiles(join(supabase, "migrations")),
|
|
52
|
+
sqlFiles(join(supabase, "schemas")),
|
|
53
|
+
snapshotTables(config, env, root)
|
|
54
|
+
]);
|
|
55
|
+
return {
|
|
56
|
+
migrations,
|
|
57
|
+
schemaFiles,
|
|
58
|
+
tables: tables.map((table) => `${table.schema}.${table.name}`)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** The lines `init` prints for an existing project. */
|
|
62
|
+
function existingLines(found) {
|
|
63
|
+
return [`Found an existing Supabase project: ${[
|
|
64
|
+
`${String(found.migrations)} migration(s)`,
|
|
65
|
+
`${String(found.schemaFiles)} schema file(s)`,
|
|
66
|
+
`${String(found.tables.length)} table(s) in ${SNAPSHOT_PATH}`
|
|
67
|
+
].join(", ")}.`, "init changed nothing in the database and added no blocks; each step after it is optional."];
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Reads the database at `url` and plans a snapshot of its schema, so `gen`,
|
|
71
|
+
* `doctor` and block detection see tables made in the dashboard.
|
|
72
|
+
*/
|
|
73
|
+
async function planSnapshotFrom(config, env, root, url) {
|
|
74
|
+
const snapshot = await loadSnapshot(config, env, {
|
|
75
|
+
dbUrl: url,
|
|
76
|
+
live: true
|
|
77
|
+
});
|
|
78
|
+
return {
|
|
79
|
+
tables: snapshot.extras.tables.length,
|
|
80
|
+
plan: {
|
|
81
|
+
root,
|
|
82
|
+
regenerate: "better-supabase init --from",
|
|
83
|
+
files: [{
|
|
84
|
+
path: insideRoot(root, SNAPSHOT_PATH, "--from"),
|
|
85
|
+
contents: serializeSnapshot(snapshot),
|
|
86
|
+
note: `${String(snapshot.extras.tables.length)} tables`
|
|
87
|
+
}]
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
18
92
|
//#region src/cli/project/workspace.ts
|
|
19
93
|
const unquote = (value) => value.replace(/\s+#.*$/, "").trim().replace(/^(["'])(.*)\1$/, "$2");
|
|
20
94
|
/** The `packages` globs of `pnpm-workspace.yaml`, in block or flow style. */
|
|
@@ -121,6 +195,11 @@ const INIT_ARGS = {
|
|
|
121
195
|
description: "How the SQL modules reach the database: pg-delta (the default), migra or migrations",
|
|
122
196
|
valueHint: "pg-delta|migra|migrations"
|
|
123
197
|
},
|
|
198
|
+
from: {
|
|
199
|
+
type: "string",
|
|
200
|
+
description: "Where the project starts: a postgres:// URL (reads its schema into supabase/snapshot.json), or a preset, design code, URL or file like --preset",
|
|
201
|
+
valueHint: "url|name|code|file"
|
|
202
|
+
},
|
|
124
203
|
preset: {
|
|
125
204
|
type: "string",
|
|
126
205
|
description: "A named preset, a design code from /create, its URL or a downloaded design file: the config starts from it, and init writes its modules and lib/blocks.ts",
|
|
@@ -232,7 +311,14 @@ function withDesign(files, design) {
|
|
|
232
311
|
}
|
|
233
312
|
return out;
|
|
234
313
|
}
|
|
235
|
-
async function runInit(config,
|
|
314
|
+
async function runInit(config, given, prompts, now = () => /* @__PURE__ */ new Date(), env = {}) {
|
|
315
|
+
const databaseFrom = given.from !== void 0 && isDatabaseUrl(given.from) ? given.from : void 0;
|
|
316
|
+
if (given.from !== void 0 && given.preset !== void 0) throw new CliError("usage", "Pass --from or --preset, not both.");
|
|
317
|
+
const withPreset = {
|
|
318
|
+
...given,
|
|
319
|
+
preset: given.from
|
|
320
|
+
};
|
|
321
|
+
const args = given.from === void 0 || databaseFrom !== void 0 ? given : withPreset;
|
|
236
322
|
const flags = conventionFlags(args);
|
|
237
323
|
const chosen = await chosenPreset(args, flags, prompts, config.root);
|
|
238
324
|
if (chosen !== null && "code" in chosen) return chosen;
|
|
@@ -307,8 +393,10 @@ async function runInit(config, args, prompts, now = () => /* @__PURE__ */ new Da
|
|
|
307
393
|
force
|
|
308
394
|
});
|
|
309
395
|
if (applied.mode === "check" && applied.drift) return planResult(templatePlan(root, files, "better-supabase init", config.root), applied);
|
|
396
|
+
const existing = await detectExisting(config, env, config.root);
|
|
310
397
|
const lines = [
|
|
311
398
|
project.frameworks.length > 0 ? `Found ${project.frameworks.join(", ")}${where}.` : `No framework found${where}.`,
|
|
399
|
+
...existing === void 0 ? [] : ["", ...existingLines(existing)],
|
|
312
400
|
"",
|
|
313
401
|
...changeLines(applied),
|
|
314
402
|
...workflow === "pg-delta" ? await enablePgDelta(root, args["dry-run"] === true, config.root) : []
|
|
@@ -328,6 +416,16 @@ async function runInit(config, args, prompts, now = () => /* @__PURE__ */ new Da
|
|
|
328
416
|
});
|
|
329
417
|
lines.push(...changeLines(wrote));
|
|
330
418
|
}
|
|
419
|
+
let snapshotTables;
|
|
420
|
+
if (databaseFrom !== void 0) {
|
|
421
|
+
const read = await planSnapshotFrom(config, env, config.root, databaseFrom);
|
|
422
|
+
const wrote = await applyPlan(read.plan, {
|
|
423
|
+
...args,
|
|
424
|
+
force: true
|
|
425
|
+
});
|
|
426
|
+
snapshotTables = read.tables;
|
|
427
|
+
lines.push("", ...changeLines(wrote));
|
|
428
|
+
}
|
|
331
429
|
if (createUrlParam(args.preset, "authz") !== void 0) lines.push("", AUTHZ_NOTE);
|
|
332
430
|
if (chosen !== null) {
|
|
333
431
|
const presetConfig = resolveConfig(groupConfig({
|
|
@@ -388,6 +486,13 @@ async function runInit(config, args, prompts, now = () => /* @__PURE__ */ new Da
|
|
|
388
486
|
command: `better-supabase gen${cwdFlag}`,
|
|
389
487
|
when: "generates the typed client"
|
|
390
488
|
},
|
|
489
|
+
...existing === void 0 ? [] : [{
|
|
490
|
+
command: `better-supabase doctor${cwdFlag}`,
|
|
491
|
+
when: "reports which tables each rung covers"
|
|
492
|
+
}, {
|
|
493
|
+
command: `better-supabase table <table> enable <feature>${cwdFlag}`,
|
|
494
|
+
when: "turns on a feature for one of your tables"
|
|
495
|
+
}],
|
|
391
496
|
{
|
|
392
497
|
command: "better-supabase skills install",
|
|
393
498
|
when: "installs the agent skills"
|
|
@@ -407,6 +512,8 @@ async function runInit(config, args, prompts, now = () => /* @__PURE__ */ new Da
|
|
|
407
512
|
...inPackage ? { package: target.dir } : {},
|
|
408
513
|
integrations,
|
|
409
514
|
...chosen === null ? {} : { preset: chosen.value },
|
|
515
|
+
...existing === void 0 ? {} : { existing },
|
|
516
|
+
...snapshotTables === void 0 ? {} : { snapshotTables },
|
|
410
517
|
files: applied.changes,
|
|
411
518
|
hints
|
|
412
519
|
},
|
|
@@ -425,7 +532,7 @@ const initCommand = defineCliCommand({
|
|
|
425
532
|
...CONVENTION_COMPLETIONS,
|
|
426
533
|
preset: () => PRESET_NAMES
|
|
427
534
|
},
|
|
428
|
-
run: (args, { config, io }) => runInit(config, args, io.prompts)
|
|
535
|
+
run: (args, { config, io, env }) => runInit(config, args, io.prompts, void 0, env)
|
|
429
536
|
});
|
|
430
537
|
/** The `blocks` and `appTables` keys a design adds to the preset's config. */
|
|
431
538
|
function designKeys(resolved, design) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { p as commandMeta, r as defineCliCommand } from "./command-
|
|
1
|
+
import { p as commandMeta, r as defineCliCommand } from "./command-CVzTJSLp.js";
|
|
2
2
|
import { t as display } from "./io-DH1kcmmP.js";
|
|
3
3
|
import { m as supabaseDir } from "./supabase-toml-CncmQbO0.js";
|
|
4
4
|
import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as errorText } from "./errors-BTe6A15O.js";
|
|
2
|
-
import "./source-
|
|
3
|
-
import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-
|
|
2
|
+
import "./source-2irbWSck.js";
|
|
3
|
+
import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-5uqc1GBj.js";
|
|
4
4
|
//#region src/cli/doctor/reserved-roles.ts
|
|
5
5
|
/**
|
|
6
6
|
* Supautils' `reserved_roles` on Supabase. Nobody but a superuser may alter,
|
|
@@ -1,9 +1,9 @@
|
|
|
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-CVzTJSLp.js";
|
|
2
|
+
import { a as envelope, i as run } from "./run-ChCQPYOh.js";
|
|
3
|
+
import { t as VERSION } from "./version-C5RAWmrD.js";
|
|
4
4
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
5
5
|
import { n as consentToken } from "./agent-CbuPvI2x.js";
|
|
6
|
-
import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, o as boolean, t as PROCESS_ENV, x as object } from "./env-
|
|
6
|
+
import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, o as boolean, t as PROCESS_ENV, x as object } from "./env-BK0xKMeU.js";
|
|
7
7
|
import { createInterface } from "node:readline";
|
|
8
8
|
import { answerLine } from "better-supabase/mcp";
|
|
9
9
|
//#region src/cli/mcp/server.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
|
|
2
2
|
import { i as readStdin } from "./io-DH1kcmmP.js";
|
|
3
|
-
import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-
|
|
4
|
-
import { c as metaPaths, n as render } from "./render-
|
|
5
|
-
import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-
|
|
3
|
+
import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-DdAP7LWO.js";
|
|
4
|
+
import { c as metaPaths, n as render } from "./render-DUNJ4Pss.js";
|
|
5
|
+
import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-Cl9COGuy.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";
|