better-supabase 0.25.0 → 0.29.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/{agents-CMIB3802.d.ts → agents-CM_cCtcr.d.ts} +4 -4
- package/dist/{ai-cache-2LGgaT7F.d.ts → ai-cache-BTGqckta.d.ts} +4 -4
- package/dist/{ai-chat-BCaKsvLW.d.ts → ai-chat-B7_vQvxU.d.ts} +4 -4
- package/dist/{ai-schedules-yGZH-vQb.d.ts → ai-schedules-CZEfo-_M.d.ts} +5 -5
- package/dist/ai-sdk/agents/index.d.ts +6 -6
- package/dist/ai-sdk/batches/index.d.ts +3 -3
- package/dist/ai-sdk/cache/index.d.ts +1 -1
- package/dist/ai-sdk/chat/index.d.ts +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/index.d.ts +5 -5
- package/dist/ai-sdk/mcp/index.d.ts +3 -3
- package/dist/ai-sdk/memory/index.d.ts +3 -3
- package/dist/ai-sdk/workflow/index.d.ts +3 -3
- package/dist/{api-B1OkIWdx.d.ts → api-59rv5hL6.d.ts} +5 -5
- package/dist/{api-keys-ClhKBDcc.d.ts → api-keys-JE-aykZE.d.ts} +4 -4
- package/dist/{app-tables-xij_MI5H.d.ts → app-tables-DekyKNQ8.d.ts} +1 -1
- package/dist/{approvals-C5fmPLsH.d.ts → approvals-BfEafAzt.d.ts} +5 -5
- package/dist/{assistant-ndGdOBax.d.ts → assistant-B49qATbj.d.ts} +2 -2
- package/dist/astro/index.d.ts +7 -7
- package/dist/{authorization-BJV2i8xB.d.ts → authorization-C7nuWMuB.d.ts} +27 -6
- package/dist/{authorization-hooks-DtzreCAq.d.ts → authorization-hooks-BWhkMZfH.d.ts} +2 -2
- package/dist/better-result/index.d.ts +3 -3
- package/dist/{bind-vKDmdu_4.d.ts → bind-DmUGUsBd.d.ts} +7 -7
- package/dist/{block-env-wVLz0KMV.d.ts → block-env-DWtZsqhH.d.ts} +4 -4
- package/dist/{block-helpers-CRpAHrp_.d.ts → block-helpers-D5emQ2O6.d.ts} +1 -1
- package/dist/{block-hooks-DZN2w69m.d.ts → block-hooks-B8itxzEE.d.ts} +2 -2
- package/dist/{block-subjects-CphkQPxp.d.ts → block-subjects-C1_9DkSA.d.ts} +1 -1
- package/dist/{block-transport-DWZSJrwN.d.ts → block-transport-9EUA3q_I.d.ts} +2 -2
- package/dist/blocks/access-requests/index.d.ts +5 -5
- package/dist/blocks/activities/index.d.ts +10 -10
- package/dist/blocks/activities/index.js +1 -1
- package/dist/blocks/agents/index.d.ts +4 -4
- package/dist/blocks/ai-cache/index.d.ts +3 -3
- package/dist/blocks/ai-chat/index.d.ts +7 -7
- package/dist/blocks/ai-files/index.d.ts +3 -3
- package/dist/blocks/ai-keys/index.d.ts +4 -4
- package/dist/blocks/ai-schedules/index.d.ts +3 -3
- package/dist/blocks/announcements/index.d.ts +8 -8
- package/dist/blocks/api-keys/index.d.ts +6 -6
- package/dist/blocks/approvals/index.d.ts +4 -4
- package/dist/blocks/assets/index.d.ts +6 -6
- package/dist/blocks/assignment/index.d.ts +7 -7
- package/dist/blocks/attachments/index.d.ts +4 -4
- package/dist/blocks/audit/index.d.ts +13 -13
- package/dist/blocks/automations/index.d.ts +12 -12
- package/dist/blocks/billable-time/index.d.ts +6 -6
- package/dist/blocks/billing/index.d.ts +9 -9
- package/dist/blocks/bookings/index.d.ts +4 -4
- package/dist/blocks/bulk/index.d.ts +4 -4
- package/dist/blocks/calendar/index.d.ts +5 -5
- package/dist/blocks/catalog/index.d.ts +6 -6
- package/dist/blocks/channels/index.d.ts +7 -7
- package/dist/blocks/collections/index.d.ts +12 -12
- package/dist/blocks/collections/index.js +1 -1
- package/dist/blocks/comments/index.d.ts +10 -10
- package/dist/blocks/compliance/index.d.ts +5 -5
- package/dist/blocks/connectors/index.d.ts +4 -4
- package/dist/blocks/contacts/index.d.ts +7 -7
- package/dist/blocks/contacts/index.js +1 -1
- package/dist/blocks/content/index.d.ts +5 -5
- package/dist/blocks/contracts/index.d.ts +6 -6
- package/dist/blocks/courses/index.d.ts +5 -5
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/custom-fields/index.d.ts +6 -6
- package/dist/blocks/custom-fields/index.js +1 -1
- package/dist/blocks/data-lifecycle/index.d.ts +8 -8
- package/dist/blocks/deals/index.d.ts +6 -6
- package/dist/blocks/dispatch/index.d.ts +7 -7
- package/dist/blocks/documents/index.d.ts +4 -4
- package/dist/blocks/domains/index.d.ts +6 -6
- package/dist/blocks/donations/index.d.ts +6 -6
- package/dist/blocks/drive/index.d.ts +7 -7
- package/dist/blocks/employees/index.d.ts +8 -8
- package/dist/blocks/employees/index.js +1 -1
- package/dist/blocks/enrichment/index.d.ts +6 -6
- package/dist/blocks/enrollments/index.d.ts +6 -6
- package/dist/blocks/entitlements/index.d.ts +6 -6
- package/dist/blocks/expenses/index.d.ts +5 -5
- package/dist/blocks/field-history/index.d.ts +4 -4
- package/dist/blocks/flags/index.d.ts +5 -5
- package/dist/blocks/forecasts/index.d.ts +6 -6
- package/dist/blocks/forms/index.d.ts +6 -6
- package/dist/blocks/goals/index.d.ts +4 -4
- package/dist/blocks/guests/index.d.ts +6 -6
- package/dist/blocks/hiring/index.d.ts +7 -7
- package/dist/blocks/identities/index.d.ts +5 -5
- package/dist/blocks/imports/index.d.ts +5 -5
- package/dist/blocks/inbox/index.d.ts +10 -10
- package/dist/blocks/incidents/index.d.ts +5 -5
- package/dist/blocks/index.d.ts +9 -9
- package/dist/blocks/inventory/index.d.ts +7 -7
- package/dist/blocks/invoices/index.d.ts +8 -8
- package/dist/blocks/knowledge/index.d.ts +3 -3
- package/dist/blocks/lead-scoring/index.d.ts +7 -7
- package/dist/blocks/leases/index.d.ts +6 -6
- package/dist/blocks/leave/index.d.ts +5 -5
- package/dist/blocks/ledger/index.d.ts +6 -6
- package/dist/blocks/mail-sync/index.d.ts +5 -5
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +4 -4
- package/dist/blocks/messaging/index.d.ts +11 -11
- package/dist/blocks/metrics/index.d.ts +6 -6
- package/dist/blocks/mfa/index.d.ts +2 -2
- package/dist/blocks/moderation/index.d.ts +6 -6
- package/dist/blocks/notifications/index.d.ts +12 -12
- package/dist/blocks/notifications/index.js +1 -1
- package/dist/blocks/numbering/index.d.ts +4 -4
- package/dist/blocks/oauth-server/index.d.ts +5 -5
- package/dist/blocks/onboarding/index.d.ts +5 -5
- package/dist/blocks/orders/index.d.ts +7 -7
- package/dist/blocks/organizations/index.d.ts +8 -8
- package/dist/blocks/outbox/index.d.ts +4 -4
- package/dist/blocks/passes/index.d.ts +8 -8
- package/dist/blocks/permissions/index.d.ts +6 -6
- package/dist/blocks/pipelines/index.d.ts +6 -6
- package/dist/blocks/posts/index.d.ts +5 -5
- package/dist/blocks/profiles/index.d.ts +4 -4
- package/dist/blocks/promotions/index.d.ts +5 -5
- package/dist/blocks/push/index.d.ts +6 -6
- package/dist/blocks/queue/index.d.ts +6 -6
- package/dist/blocks/quotes/index.d.ts +8 -8
- package/dist/blocks/rank/index.d.ts +5 -5
- package/dist/blocks/reactions/index.d.ts +9 -9
- package/dist/blocks/relations/index.d.ts +7 -7
- package/dist/blocks/reminders/index.d.ts +9 -9
- package/dist/blocks/reminders/index.js +1 -1
- package/dist/blocks/reviews/index.d.ts +5 -5
- package/dist/blocks/saved-views/index.d.ts +6 -6
- package/dist/blocks/scores/index.d.ts +5 -5
- package/dist/blocks/search/index.d.ts +8 -8
- package/dist/blocks/security-events/index.d.ts +7 -7
- package/dist/blocks/segments/index.d.ts +8 -8
- package/dist/blocks/sequences/index.d.ts +6 -6
- package/dist/blocks/service-accounts/index.d.ts +5 -5
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +6 -6
- package/dist/blocks/share-links/index.d.ts +5 -5
- package/dist/blocks/shipments/index.d.ts +6 -6
- package/dist/blocks/signatures/index.d.ts +5 -5
- package/dist/blocks/signing-keys/index.d.ts +4 -4
- package/dist/blocks/sla/index.d.ts +7 -7
- package/dist/blocks/sso/index.d.ts +6 -6
- package/dist/blocks/state-machine/index.d.ts +5 -5
- package/dist/blocks/subjects/index.d.ts +6 -6
- package/dist/blocks/tags/index.d.ts +6 -6
- package/dist/blocks/tasks/index.d.ts +10 -10
- package/dist/blocks/tasks/index.js +1 -1
- package/dist/blocks/teams/index.d.ts +4 -4
- package/dist/blocks/templates/index.d.ts +7 -7
- package/dist/blocks/time-tracking/index.d.ts +7 -7
- package/dist/blocks/timeline/index.d.ts +8 -8
- package/dist/blocks/trash/index.d.ts +6 -6
- package/dist/blocks/undo/index.d.ts +4 -4
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +4 -4
- package/dist/blocks/vercel-marketplace/index.d.ts +5 -5
- package/dist/blocks/versions/index.d.ts +6 -6
- package/dist/blocks/waitlist/index.d.ts +5 -5
- package/dist/blocks/webhooks/index.d.ts +14 -14
- package/dist/blocks/webhooks/index.js +1 -1
- package/dist/blocks/workflow-editor/index.d.ts +9 -9
- package/dist/blocks/workflows/index.d.ts +7 -7
- package/dist/{bookings-CVw5-Q0Z.d.ts → bookings-xsmM2TA_.d.ts} +3 -3
- package/dist/{bucket-vc-QRrva.d.ts → bucket-SvRQwYS4.d.ts} +1 -1
- package/dist/chat-sdk/index.d.ts +6 -6
- package/dist/cli/{add-C2pNvVpu.js → add-BKkV99g9.js} +2 -2
- package/dist/cli/{add-BTVrOGJF.js → add-CrQ3jS7t.js} +55 -88
- package/dist/cli/add-CwhrRJz5.js +1 -0
- package/dist/cli/app-table-files-PnPOpuB4.js +346 -0
- package/dist/cli/{backfill-BicVPugb.js → backfill-DDDLhinm.js} +4 -4
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-sScN-ik-.js → blocks-BCVcjvbm.js} +1 -1
- package/dist/cli/{blocks-BmYOH4T-.js → blocks-tRfYx_mh.js} +2 -2
- package/dist/cli/{cache-1TfBy2K4.js → cache-DQZ09YOg.js} +1 -1
- package/dist/cli/{codemod-ylE6wGLo.js → codemod-HKuwQmi_.js} +5 -5
- package/dist/cli/{command-BWEEXmtz.js → command-DIPmo0wh.js} +37 -1
- package/dist/cli/{completion-Bt7LMypX.js → completion-DxPxMtyP.js} +2 -2
- package/dist/cli/{completion-8EDK21xj.js → completion-DyLMSjOD.js} +1 -1
- package/dist/cli/{completion-BfnKI4QZ.js → completion-FUgqm2-N.js} +2 -2
- package/dist/cli/{config-WKDixoGK.js → config-BfapErxs.js} +1 -1
- package/dist/cli/{config-BVfeG3A5.js → config-Cskysxp-.js} +327 -16
- package/dist/cli/{config-CeaQMrvS.js → config-Df5cXWNN.js} +1 -1
- package/dist/cli/{config-group-C8tjut39.js → config-group-CP-B9uRt.js} +2 -3
- package/dist/cli/{content-mapper-hUW2nb92.js → content-mapper-B0ehR7K-.js} +2 -2
- package/dist/cli/{db-DwjyUbAh.js → db-CWvH1_46.js} +38 -14
- package/dist/cli/{doctor-D3WKFBSv.js → doctor-CXJOhwLB.js} +36 -33
- package/dist/cli/{env-DMgjB_4y.js → env-BK0xKMeU.js} +1 -2
- package/dist/cli/{env-BCgVZkcb.js → env-BM242BCV.js} +2 -2
- package/dist/cli/{env-C-Bl6Awn.js → env-Bat6ogep.js} +1 -1
- package/dist/cli/env-uqfUbUzk.js +1 -0
- package/dist/cli/{exec--Q1ZEWUW.js → exec-Ca5s-ygi.js} +1 -1
- package/dist/cli/{gen-CqsUdsB2.js → gen-B7rw4j19.js} +16 -16
- package/dist/cli/in-stack-diff-Cp-tVPj2.js +186 -0
- package/dist/cli/index.d.ts +9 -3
- package/dist/cli/index.js +8 -8
- package/dist/cli/{init-DryZ5Mp1.js → init-C1bXXB_P.js} +131 -12
- package/dist/cli/{keys-CbaL0lnw.js → keys-V-HcO-21.js} +1 -1
- package/dist/cli/{live-Di45imoV.js → live-PpAh9pAc.js} +2 -2
- package/dist/cli/{mcp-BklC-3eK.js → mcp-BRNAchdH.js} +6 -14
- package/dist/cli/{metadata-7PsBF5Xw.js → metadata-dAAKb_kR.js} +3 -3
- package/dist/cli/migrate-BWYXFnaW.js +46 -0
- package/dist/cli/{migration-safety-Doy9qYO8.js → migration-safety-DGQswWZy.js} +2 -2
- package/dist/cli/migrations-Cqk-lJwu.js +117 -0
- package/dist/cli/{module-migration-ZIn1NCMi.js → module-migration-8-hMiZtW.js} +2 -2
- package/dist/cli/{moved-DVwgE8lV.js → moved-DNOtp9LA.js} +1 -1
- package/dist/cli/{parse-B079x40m.js → parse-BPf3kGnc.js} +1 -1
- package/dist/cli/{powersync-BRGXOCJ0.js → powersync-BWQ-8T3G.js} +4 -3
- package/dist/cli/powersync-CbYxLsjv.js +1 -0
- package/dist/cli/{print-Dfqd4DB-.js → print-DSTnq5xz.js} +2 -2
- package/dist/cli/{migrations-JtsPYv8g.js → providers-Cjf5iOp5.js} +4 -116
- package/dist/cli/{remove-CQzSCYTu.js → remove-CwG8cPv1.js} +7 -7
- package/dist/cli/{render-DWRz-uPQ.js → render-B18iAdsT.js} +9 -6
- package/dist/cli/{run-DPLedqTF.js → run-C2Yg5MWt.js} +42 -40
- package/dist/cli/{run-DmOTMa44.js → run-CvPl8iQd.js} +4 -4
- package/dist/cli/{run-j54rk2w-.js → run-Wx_2Acgv.js} +11 -11
- package/dist/cli/seed-BOun22-k.js +1 -0
- package/dist/cli/{seed-BMynpMPy.js → seed-CDnL4Tnc.js} +3 -3
- package/dist/cli/{shared-CslNcs-R.js → shared-BHbtUOvh.js} +1 -1
- package/dist/cli/{skills-FXAVPLzp.js → skills-DM3oeIxY.js} +1 -1
- package/dist/cli/{snapshot-DdN5GlhH.js → snapshot-CXgsUPGj.js} +3 -3
- package/dist/cli/{source-COARbqch.js → source-B6aMAoEK.js} +1 -1
- package/dist/cli/{source-args-CDmmFmFG.js → source-args-v8ljFDfc.js} +1 -1
- package/dist/cli/{spec-CgLNZc_C.js → spec-BcYic005.js} +3 -3
- package/dist/cli/{spec-DIhBQlBF.js → spec-EO0TP84d.js} +1 -1
- package/dist/cli/{sql-layout-8jrP5gIa.js → sql-layout-CkxDNVEH.js} +21 -7
- package/dist/cli/{stack-DgASZP0K.js → stack-ClESAZYf.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-SqyVHRSJ.js → sync-pq6gmlhG.js} +4 -3
- package/dist/cli/table-dyKddjwo.js +89 -0
- package/dist/cli/{upgrade-D0aLhluU.js → upgrade-BoHb4h9P.js} +3 -3
- package/dist/cli/{upgrade-CY-vj_qh.js → upgrade-Dp9p7A69.js} +5 -4
- package/dist/cli/{version-Bhca9D6q.js → version-CQHFm-ak.js} +1 -1
- package/dist/client/index.d.ts +6 -6
- package/dist/client/native/index.d.ts +5 -5
- package/dist/{cloud-event-DcJwder2.d.ts → cloud-event-0pQ9vFNS.d.ts} +1 -1
- package/dist/{compiler-D3UmE7ao.d.ts → compiler-BEeVWXPS.d.ts} +2 -2
- package/dist/{composite-CWJvZgni.d.ts → composite-BJ9s-IJJ.d.ts} +7 -7
- package/dist/config/index.d.ts +5 -5
- package/dist/config/index.js +5 -5
- package/dist/{config-C19McoGo.js → config-bqKaPjst.js} +7 -28
- package/dist/{config-CP-WaboC.js → config-r7njjNgh.js} +3 -3
- package/dist/{connectors-CHGiffYH.d.ts → connectors-uC5baoFV.d.ts} +4 -4
- package/dist/{context-BJoHD20l.d.ts → context-B4TsE2gY.d.ts} +138 -52
- package/dist/{controller-CwGXms17.d.ts → controller-CtwAsnVV.d.ts} +1 -1
- package/dist/{conversion-DlfStnln.d.ts → conversion-g8HzH9My.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 +141 -4
- package/dist/create/lite/index.js +399 -47
- package/dist/credentials/index.d.ts +4 -4
- package/dist/{data-engine-BWoz9lED.d.ts → data-engine-rvbR2C4F.d.ts} +1 -1
- package/dist/{define-BLP6XtoL.d.ts → define-D8_9X5fZ.d.ts} +5 -5
- package/dist/{define-block-DibVN37N.d.ts → define-block-DWVZSZv1.d.ts} +12 -12
- package/dist/{documents-Cup1rpjF.d.ts → documents-BbwYyynk.d.ts} +3 -3
- package/dist/edge/index.d.ts +9 -9
- package/dist/elysia/index.d.ts +1 -1
- package/dist/{embeddings-D_RsS6ow.d.ts → embeddings-I3s5sTDt.d.ts} +1 -1
- package/dist/{ended-B8RyuUXF.d.ts → ended-EZzN9QTM.d.ts} +2 -2
- package/dist/{entitlements-CsZcfllV.d.ts → entitlements-Bw3eYGKJ.d.ts} +2 -2
- package/dist/eve/index.d.ts +5 -5
- package/dist/{eve-B7jxYPCw.d.ts → eve-BfhVFV33.d.ts} +2 -2
- package/dist/events/index.d.ts +3 -3
- package/dist/{events-Cc9DDQWH.d.ts → events-B2qbZps6.d.ts} +1 -1
- package/dist/{executor-DNPm13a9.d.ts → executor-BfirBzOr.d.ts} +4 -4
- package/dist/{executor-C-Ox9eKq.d.ts → executor-BlS0kCrN.d.ts} +1 -1
- package/dist/{executor-hGjrop3A.d.ts → executor-DXQIx4sW.d.ts} +1 -1
- package/dist/expo/index.d.ts +4 -4
- package/dist/{field-errors-6BVg31Yp.d.ts → field-errors-DkzFduux.d.ts} +10 -10
- package/dist/{fields-C3q2ypnO.d.ts → fields-snbaZ14h.d.ts} +1 -1
- package/dist/{filter-evaluate-CPxeae5X.d.ts → filter-evaluate-BRpNiNPG.d.ts} +1 -1
- package/dist/{filter-query-BXLs72G9.d.ts → filter-query-DBt7OKuH.d.ts} +1 -1
- package/dist/{flags-C01PLMJ-.d.ts → flags-DDKTThrO.d.ts} +2 -2
- package/dist/flags-sdk/index.d.ts +1 -1
- package/dist/{framework-GlxXiotm.d.ts → framework-DVYTtQXA.d.ts} +7 -7
- package/dist/{gateway-DzI687yd.d.ts → gateway-Ve7cByEr.d.ts} +3 -3
- package/dist/h3/index.d.ts +1 -1
- package/dist/h3/v1/index.d.ts +1 -1
- package/dist/hono/index.d.ts +9 -9
- package/dist/{inbox-NDKwSk_H.d.ts → inbox-c8B86Trp.d.ts} +5 -5
- package/dist/{index-C_qlBJ3k.d.ts → index-B4wttiLh.d.ts} +4 -4
- package/dist/{index-BfYDY6eh.d.ts → index-BM6NmKSc.d.ts} +5 -5
- package/dist/{index-CbUCGMqj.d.ts → index-BNgpz_BV.d.ts} +5 -5
- package/dist/{index-C0QuN9_P.d.ts → index-BxckmAFc.d.ts} +106 -121
- package/dist/{index-Cagz4Z2k.d.ts → index-CB66nl14.d.ts} +4 -3
- package/dist/{index-DOHx3JuB.d.ts → index-CBQT_nXf.d.ts} +5 -5
- package/dist/{index-D01wHGSN.d.ts → index-Cw5gGSP8.d.ts} +14 -14
- package/dist/{index-CQhPHHDF.d.ts → index-Cxsnd-OL.d.ts} +1 -1
- package/dist/{index-D1ckLbUM.d.ts → index-pZn6S_iq.d.ts} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/{instances-qz2MCMyK.js → instances-C7qUTjhJ.js} +1 -1
- package/dist/{kit-Dxx3MT8m.d.ts → kit-B8yWCRN7.d.ts} +3 -3
- package/dist/{knowledge-F1IhRI4Q.d.ts → knowledge-CsLPACGJ.d.ts} +5 -5
- package/dist/lint/index.d.ts +1 -1
- package/dist/list/index.d.ts +3 -3
- package/dist/{list-query-XHoYDlRN.d.ts → list-query-BcU8NnNL.d.ts} +3 -3
- package/dist/mapper/bin.js +7 -7
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/sdk/index.d.ts +6 -6
- package/dist/{messaging-C_Pr9tGx.d.ts → messaging-DQP09JsY.d.ts} +4 -4
- package/dist/nestjs/index.d.ts +2 -2
- package/dist/next/client/index.d.ts +1 -1
- package/dist/next/index.d.ts +22 -22
- package/dist/node/index.d.ts +2 -2
- package/dist/{operations-CPhOcuzl.d.ts → operations-CqmQrTKw.d.ts} +1 -1
- package/dist/{options-BOGo1qCA.js → options-B5E2MGIz.js} +3 -1
- package/dist/{options-D2s7fT1s.js → options-COo7_3MX.js} +2 -1
- package/dist/{options-D32-YxnO.js → options-DhoLMknl.js} +3 -1
- package/dist/orpc/index.d.ts +8 -8
- package/dist/otel/index.d.ts +2 -2
- package/dist/otel/index.js +4 -4
- package/dist/{outbox-DxZgoKwp.d.ts → outbox-BZ712Z3X.d.ts} +4 -4
- package/dist/{pool-wjbAMqc1.d.ts → pool-DDR1ndk7.d.ts} +3 -3
- package/dist/{ports-Bw7uxPd_.d.ts → ports-6LBgr1Aa.d.ts} +1 -1
- package/dist/postgres/index.d.ts +4 -4
- package/dist/{postgrest-z-T0l23T.d.ts → postgrest-AJc8hnJU.d.ts} +1 -1
- package/dist/powersync/index.d.ts +6 -6
- package/dist/preset/index.d.ts +3 -3
- package/dist/preset/index.js +3 -3
- package/dist/{preset-BbSWLoXM.js → preset-DCdEnJj9.js} +9 -14
- package/dist/{project-TN03XDsA.js → project-C4NA_van.js} +5 -5
- package/dist/{provider-ClrIplXa.d.ts → provider-CWjzAIX9.d.ts} +1 -1
- package/dist/{push-token-vykw2JXT.d.ts → push-token-BXsrJ7W9.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +8 -8
- 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 +6 -6
- package/dist/realtime/index.d.ts +6 -6
- package/dist/realtime/index.js +2 -2
- package/dist/{record-form-D2-F4IwS.d.ts → record-form-CubgBrtI.d.ts} +1 -1
- package/dist/{recordings-BBSJt_YV.d.ts → recordings-DeZYx-Kv.d.ts} +1 -1
- package/dist/records/index.d.ts +9 -9
- package/dist/{refresh-CCKB1Wa6.d.ts → refresh-D02Pbf5B.d.ts} +1 -1
- package/dist/{refusal-D_tklIEb.d.ts → refusal-B0VmlAxF.d.ts} +2 -2
- package/dist/{resolve-Bj1qD7Dy.d.ts → resolve-CtX6T0c0.d.ts} +1 -1
- package/dist/{resolved-names-Dsf28_Dr.js → resolved-names-iLBOUaib.js} +2 -2
- package/dist/{resource-D8pzB5Qf.d.ts → resource-WxN0IsvB.d.ts} +1 -1
- package/dist/{resource-execute-BSTIfp1D.d.ts → resource-execute-BzqR8DdD.d.ts} +2 -2
- package/dist/{resource-types-D5WEvYtV.d.ts → resource-types-BVbHgTPg.d.ts} +4 -4
- package/dist/{resources-CsZ7RhZC.d.ts → resources-BSbRa0Ab.d.ts} +2 -2
- package/dist/{respond-BzRG-0qc.d.ts → respond-Dzu_-EPH.d.ts} +1 -1
- package/dist/{sales-lines-KxxStRzU.d.ts → sales-lines-BsmrNHe9.d.ts} +1 -1
- package/dist/{scores-B2BiNuVJ.d.ts → scores-Y8TvyJi1.d.ts} +5 -5
- package/dist/server/index.d.ts +24 -24
- package/dist/server/index.js +1 -1
- package/dist/{server-types-BlDiY-ya.d.ts → server-types-BkTIxW_H.d.ts} +11 -11
- package/dist/{session-BGP98Rgj.d.ts → session-BOzx2qHC.d.ts} +6 -6
- package/dist/{session-status-C4t7kbSn.d.ts → session-status-BP8eYVnA.d.ts} +2 -2
- package/dist/{sign-in-CAadgm33.d.ts → sign-in-CfwJAJJL.d.ts} +2 -2
- package/dist/{signers-BKgmVh6A.d.ts → signers-ZmxO1I05.d.ts} +4 -4
- package/dist/{signing-keys-BNDUxpQL.d.ts → signing-keys-udgP7Aod.d.ts} +2 -2
- package/dist/solid/index.d.ts +10 -10
- package/dist/solid-start/index.d.ts +6 -6
- package/dist/spec/index.d.ts +2 -2
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +5 -5
- package/dist/{sql-Dg3W1ENk.js → sql-CoBySj2F.js} +3617 -1285
- package/dist/sqlite/index.d.ts +3 -3
- package/dist/{sso-B0Txid2-.d.ts → sso-CkU_4mtK.d.ts} +3 -3
- package/dist/ssr/index.d.ts +5 -5
- package/dist/storage/index.d.ts +3 -3
- package/dist/storage/index.js +1 -1
- package/dist/streams/index.d.ts +1 -1
- package/dist/{subject-readers-DJbzlm8a.d.ts → subject-readers-CB5Te02u.d.ts} +5 -5
- package/dist/{subject-readers-CeeJJOQ4.js → subject-readers-VHcrWhmq.js} +2 -2
- package/dist/{subjects-NomQg6Eg.d.ts → subjects-BYCL-6hA.d.ts} +15 -1
- package/dist/{subjects-BpIEN1MS.d.ts → subjects-CiBNKy2y.d.ts} +4 -4
- package/dist/{support-D7CMbhRT.d.ts → support-BxyPOFk4.d.ts} +4 -4
- package/dist/{support-view-CIDXF3_H.d.ts → support-view-nqUWKHEs.d.ts} +1 -1
- package/dist/svelte/index.d.ts +9 -9
- package/dist/sveltekit/index.d.ts +7 -7
- package/dist/{tags-Dg4Ywmqp.d.ts → tags-Cm48BsOa.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +3 -3
- package/dist/tanstack-start/index.d.ts +6 -6
- package/dist/{tenant-BRmKZ7aq.d.ts → tenant-Ded341Qz.d.ts} +2 -2
- package/dist/testing/index.d.ts +25 -25
- package/dist/testing/index.js +2 -2
- package/dist/{timeline-Cjl-1hiA.d.ts → timeline-DvXtXq5q.d.ts} +5 -5
- package/dist/{topic-F0FKzJyQ.js → topic-DnsNG4Kj.js} +1 -1
- package/dist/{topic-CpsKVBot.d.ts → topic-XDdKzlrn.d.ts} +5 -5
- package/dist/{types-Dp3UCr1e.d.ts → types-B-D6fYx2.d.ts} +1 -1
- package/dist/{types-CjRwmCRP.d.ts → types-BFwB-E1j.d.ts} +2 -2
- package/dist/{types-Czq9Xtpa.d.ts → types-CK2X2wCB.d.ts} +5 -5
- package/dist/{types-DFdg_4yN.d.ts → types-CPl9uJ0G.d.ts} +2 -2
- package/dist/{types-DR1MHh7N.d.ts → types-CwQgFo8c.d.ts} +4 -4
- package/dist/{types-Dr9wZgNy.d.ts → types-DMihLukJ.d.ts} +3 -3
- package/dist/{types-A4yyKEsg.d.ts → types-iCyZ3lMx.d.ts} +4 -4
- package/dist/{types-BdaBfYIw.d.ts → types-nspa5I-a.d.ts} +7 -7
- package/dist/{undo-B1jwnVyN.d.ts → undo-0HkWXASn.d.ts} +2 -2
- package/dist/{usage-Dp45V42p.d.ts → usage-BkWAPkg2.d.ts} +4 -4
- package/dist/{vault-BghaujrZ.d.ts → vault-BkdPmL7f.d.ts} +2 -2
- package/dist/vercel-connect/index.d.ts +1 -1
- package/dist/{verify-CI8LgSpv.d.ts → verify-41mZmspj.d.ts} +2 -2
- package/dist/{view-BvNA7EOC.d.ts → view-C8_xvD-j.d.ts} +1 -1
- package/dist/vue/index.d.ts +10 -10
- package/dist/{watch-topic-BaMZX139.d.ts → watch-topic-DpN_GEoS.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-CE8sEK57.js → workflow-sdk-CaEw822d.js} +25 -4
- package/dist/{workflow-sdk-BNsZrcVg.d.ts → workflow-sdk-rg3IbCZC.d.ts} +3 -3
- package/dist/{workflows-B0ZPAQu0.d.ts → workflows-xL6t0TXx.d.ts} +7 -4
- package/dist/yjs/index.d.ts +2 -2
- package/dist/yjs/index.js +1 -1
- package/package.json +11 -2
- package/schemas/config-v1.json +45 -351
- package/skills/better-supabase/references/ui-recipes.md +5 -5
- package/dist/cli/add-Bf1fyCWm.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-Dq-txa0_.js +0 -1
- package/dist/cli/seed-CO3j_bly.js +0 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
-
import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
|
|
3
2
|
import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
|
|
4
|
-
import { i as
|
|
5
|
-
import { a as sqlPlan, i as schemasDirOf, n as migrationsDir, r as moduleLayoutFor } from "./sql-layout-8jrP5gIa.js";
|
|
3
|
+
import { i as schemasDirOf, r as moduleLayoutFor } from "./sql-layout-CkxDNVEH.js";
|
|
6
4
|
import { resolve } from "node:path";
|
|
7
|
-
import {
|
|
8
|
-
import { MODULE_ID_TYPES, compileReadSets, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, renderBlocks, resolveBlocks, scopeProblems, templateFunctions } from "better-supabase/sql";
|
|
5
|
+
import { MODULE_ID_TYPES, compileReadSets, moduleIdType, moduleLayout, modulePermissionKeys, resolveBlocks, scopeProblems, templateFunctions } from "better-supabase/sql";
|
|
9
6
|
import { isReadSet } from "better-supabase";
|
|
10
7
|
//#region src/cli/authorization.ts
|
|
11
8
|
/** How findings name the provider. */
|
|
@@ -265,7 +262,7 @@ function accessProviderFor(config, names) {
|
|
|
265
262
|
case "off": return;
|
|
266
263
|
case "provider": {
|
|
267
264
|
if (!renders || !config.authorization) return mode.access;
|
|
268
|
-
const problems = moduleKeyProblems(config.authorization, modulePermissionKeys(config.blocks, names));
|
|
265
|
+
const problems = moduleKeyProblems(config.authorization, modulePermissionKeys(config.blocks, names, config.subjects));
|
|
269
266
|
if (problems.length > 0) throw new TypeError(problems.map((problem) => problem.message).join("\n"));
|
|
270
267
|
return mode.access;
|
|
271
268
|
}
|
|
@@ -301,113 +298,4 @@ async function layoutFor(config, args, names) {
|
|
|
301
298
|
});
|
|
302
299
|
}
|
|
303
300
|
//#endregion
|
|
304
|
-
|
|
305
|
-
/** `YYYYMMDDHHMMSS` in UTC, the Supabase CLI's migration prefix. */
|
|
306
|
-
const migrationStamp = (now) => now.toISOString().replaceAll(/[-:T]/g, "").slice(0, 14);
|
|
307
|
-
/**
|
|
308
|
-
* A stamp for `now`, or one second after the newest migration when that one has
|
|
309
|
-
* the same stamp or a later one: the Supabase CLI keys migrations by stamp, and
|
|
310
|
-
* the data has to run after the schema.
|
|
311
|
-
*/
|
|
312
|
-
function stampAfter(migrations, now) {
|
|
313
|
-
const newest = migrations.map((name) => /^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(?!\d)/.exec(name)).filter((match) => match !== null).map((match) => Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]), Number(match[4]), Number(match[5]), Number(match[6]))).reduce((max, time) => Math.max(max, time), Number.NEGATIVE_INFINITY);
|
|
314
|
-
const at = Math.floor(now.getTime() / 1e3) * 1e3;
|
|
315
|
-
return migrationStamp(new Date(Math.max(at, newest + 1e3)));
|
|
316
|
-
}
|
|
317
|
-
const EXTENSIONS_SUFFIX = "_better_supabase_extensions.sql";
|
|
318
|
-
const MIGRATION_EXTENSION = /^\s*create\s+extension\s+(?:if\s+not\s+exists\s+)?"?([a-z_][a-z0-9_]*)"?/gim;
|
|
319
|
-
async function unmigratedExtensions(config, files) {
|
|
320
|
-
const dir = migrationsDir(config);
|
|
321
|
-
const existing = await readdir(resolve(config.root, dir)).catch(() => []);
|
|
322
|
-
const created = /* @__PURE__ */ new Set();
|
|
323
|
-
for (const name of existing) {
|
|
324
|
-
if (!name.endsWith(".sql") || name.endsWith(DATA_SUFFIX)) continue;
|
|
325
|
-
const text = await readFile(resolve(config.root, dir, name), "utf-8");
|
|
326
|
-
for (const match of text.matchAll(MIGRATION_EXTENSION)) created.add(match[1].toLowerCase());
|
|
327
|
-
}
|
|
328
|
-
return {
|
|
329
|
-
dir,
|
|
330
|
-
existing,
|
|
331
|
-
missing: moduleSchemaExtensions(files).filter((extension) => !created.has(extension.name))
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
async function writeExtensionsMigration(config, files, dryRun, now) {
|
|
335
|
-
const { dir, existing, missing } = await unmigratedExtensions(config, files);
|
|
336
|
-
if (missing.length === 0) return [];
|
|
337
|
-
const path = `${dir}/${stampAfter(existing, /* @__PURE__ */ new Date(now().getTime() - 1e3))}${EXTENSIONS_SUFFIX}`;
|
|
338
|
-
const applied = await applyPlan(sqlPlan(config, {
|
|
339
|
-
regenerate: "better-supabase upgrade",
|
|
340
|
-
files: [{
|
|
341
|
-
path,
|
|
342
|
-
contents: `-- better-supabase sql: the extensions of ${missing.map((extension) => extension.name).join(", ")}, created before the schema migration that needs them.\n\n${missing.map((extension) => extension.statement).join("\n")}\n`
|
|
343
|
-
}]
|
|
344
|
-
}), { "dry-run": dryRun });
|
|
345
|
-
return [...changeLines(applied), ...dryRun ? [] : ["It creates the extensions the module schemas need, so create the schema migration after it."]];
|
|
346
|
-
}
|
|
347
|
-
const DATA_NEXT = "The better-supabase-data files hold rows and settings a schema diff skips: after the schema migration, run `better-supabase add --adopt`.";
|
|
348
|
-
const DATA_SUFFIX = "_better_supabase_module_data.sql";
|
|
349
|
-
/**
|
|
350
|
-
* A migration without its comment lines, so a reworded comment needs no new
|
|
351
|
-
* one.
|
|
352
|
-
*/
|
|
353
|
-
const statements = (sql) => sql.split("\n").filter((line) => !line.trimStart().startsWith("--")).join("\n").replaceAll(/\n{2,}/g, "\n").trim();
|
|
354
|
-
/**
|
|
355
|
-
* Writes the data files of `blocks` into one migration, meant to run after the
|
|
356
|
-
* schema migration that creates their tables. Every statement is idempotent, so
|
|
357
|
-
* the migration carries all of them, not only the changes.
|
|
358
|
-
*/
|
|
359
|
-
async function dataMigration(config, args, now) {
|
|
360
|
-
if (config.blockNames.length === 0) return {
|
|
361
|
-
code: 0,
|
|
362
|
-
output: "blocks is empty; nothing to write.",
|
|
363
|
-
data: { wrote: false }
|
|
364
|
-
};
|
|
365
|
-
if (sqlWorkflow(config, await readSupabaseToml(config.root)) === "migrations") return {
|
|
366
|
-
code: 0,
|
|
367
|
-
output: "database.sql.workflow is 'migrations', so `better-supabase upgrade` already writes the rows into the module migration; nothing to write.",
|
|
368
|
-
data: { wrote: false }
|
|
369
|
-
};
|
|
370
|
-
const rendered = renderBlocks(config.blockNames, await layoutFor(config, args, config.blockNames));
|
|
371
|
-
const { missing } = await unmigratedExtensions(config, rendered);
|
|
372
|
-
if (missing.length > 0) return {
|
|
373
|
-
code: 1,
|
|
374
|
-
error: [`No migration before the data migration creates ${missing.map((extension) => extension.name).join(", ")}, and the schema migration needs ${missing.length === 1 ? "it" : "them"} while it applies.`, "Run `better-supabase upgrade` to write the extensions migration, then create the schema migration again after it."].join("\n")
|
|
375
|
-
};
|
|
376
|
-
const files = rendered.filter((file) => file.kind === "data");
|
|
377
|
-
const contents = `-- better-supabase add --adopt: the rows and settings of ${files.map((file) => file.module).join(", ")}, which a schema diff skips.\n\nset lock_timeout = '5s';\n\n${files.map((file) => file.contents.trim()).join("\n\n")}\n`;
|
|
378
|
-
const dir = migrationsDir(config);
|
|
379
|
-
const existing = await readdir(resolve(config.root, dir)).catch(() => []);
|
|
380
|
-
const latest = existing.toSorted().findLast((name) => name.endsWith(DATA_SUFFIX));
|
|
381
|
-
if (latest !== void 0 && statements(await readFile(resolve(config.root, dir, latest), "utf-8")) === statements(contents)) return {
|
|
382
|
-
code: 0,
|
|
383
|
-
output: `${dir}/${latest} already has these rows; nothing to write.`,
|
|
384
|
-
data: {
|
|
385
|
-
file: `${dir}/${latest}`,
|
|
386
|
-
wrote: false
|
|
387
|
-
}
|
|
388
|
-
};
|
|
389
|
-
if (args.check === true) return {
|
|
390
|
-
code: 1,
|
|
391
|
-
error: `${latest === void 0 ? "No data migration holds" : `${dir}/${latest} doesn't hold`} the current rows and settings of the blocks. Run \`better-supabase add --adopt\` after the schema migration.`,
|
|
392
|
-
data: { wrote: false }
|
|
393
|
-
};
|
|
394
|
-
const path = `${dir}/${stampAfter(existing, now())}${DATA_SUFFIX}`;
|
|
395
|
-
const applied = await applyPlan(sqlPlan(config, {
|
|
396
|
-
regenerate: "better-supabase add --adopt",
|
|
397
|
-
files: [{
|
|
398
|
-
path,
|
|
399
|
-
contents
|
|
400
|
-
}]
|
|
401
|
-
}), { "dry-run": args["dry-run"] });
|
|
402
|
-
return {
|
|
403
|
-
code: 0,
|
|
404
|
-
output: changeLines(applied).join("\n"),
|
|
405
|
-
data: {
|
|
406
|
-
file: path,
|
|
407
|
-
wrote: applied.mode === "write",
|
|
408
|
-
files: applied.changes
|
|
409
|
-
}
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
//#endregion
|
|
413
|
-
export { unsafeKey as _, writeExtensionsMigration as a, layoutFor as c, accessProviderMode as d, accessRequirements as f, providerLabel as g, moduleKeyProblems as h, stampAfter as i, providerOwnsMemberships as l, entitlementsMode as m, dataMigration as n, MEMBERSHIP_CLAIM_MODULES as o, entitlementRequirements as p, migrationStamp as r, layout as s, DATA_NEXT as t, compiledReadSets as u };
|
|
301
|
+
export { compiledReadSets as a, entitlementRequirements as c, providerLabel as d, unsafeKey as f, providerOwnsMemberships as i, entitlementsMode as l, layout as n, accessProviderMode as o, layoutFor as r, accessRequirements as s, MEMBERSHIP_CLAIM_MODULES as t, moduleKeyProblems as u };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.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, t as display } from "./io-DH1kcmmP.js";
|
|
5
|
-
import {
|
|
5
|
+
import { r as layoutFor } from "./providers-Cjf5iOp5.js";
|
|
6
6
|
import { i as changeLines, n as PLAN_ARGS, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-CX71yBm8.js";
|
|
7
|
-
import { a as sqlPlan } from "./sql-layout-
|
|
8
|
-
import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-
|
|
7
|
+
import { a as sqlPlan } from "./sql-layout-CkxDNVEH.js";
|
|
8
|
+
import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-CrQ3jS7t.js";
|
|
9
9
|
import { t as detectProject } from "./detect-D9JaAX20.js";
|
|
10
10
|
import { _ as wiringBlocks, a as configObject, c as mask, i as closingIndex, l as properties } from "./config-edit-CrWfk8s3.js";
|
|
11
|
-
import { n as guardedRemoval } from "./sync-
|
|
11
|
+
import { n as guardedRemoval } from "./sync-pq6gmlhG.js";
|
|
12
12
|
import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
|
|
13
|
-
import { t as blockNames } from "./blocks-
|
|
14
|
-
import { i as tidyInline, t as cutRange } from "./config-group-
|
|
13
|
+
import { t as blockNames } from "./blocks-tRfYx_mh.js";
|
|
14
|
+
import { i as tidyInline, t as cutRange } from "./config-group-CP-B9uRt.js";
|
|
15
15
|
import { existsSync } from "node:fs";
|
|
16
16
|
import { resolve } from "node:path";
|
|
17
17
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
|
|
2
2
|
import { n as importPath } from "./io-DH1kcmmP.js";
|
|
3
|
-
import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-
|
|
3
|
+
import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-DQZ09YOg.js";
|
|
4
4
|
import { t as byCodePoint } from "./compare-BmIWVEui.js";
|
|
5
|
-
import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-
|
|
5
|
+
import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-CXgsUPGj.js";
|
|
6
6
|
import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
|
|
7
|
-
import { a as toCatalog } from "./source-
|
|
7
|
+
import { a as toCatalog } from "./source-B6aMAoEK.js";
|
|
8
|
+
import { m as withTableTags } from "./config-Cskysxp-.js";
|
|
8
9
|
import { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
|
|
9
10
|
import { entityNames } from "better-supabase/blocks";
|
|
10
11
|
import { DEFAULT_CLAIMS, blockEntities, blockEntityRenames, blockSubjectTypes, tenantClaimPaths, tenantNameOf } from "better-supabase/config";
|
|
@@ -248,7 +249,7 @@ function literalPart(text) {
|
|
|
248
249
|
/** Permission keys by owner (block, subject or app table), then action. */
|
|
249
250
|
function permissionGroups(config) {
|
|
250
251
|
const groups = {};
|
|
251
|
-
for (const entry of modulePermissionKeys(config.blocks, config.blockNames)) groups[entry.module] = {
|
|
252
|
+
for (const entry of modulePermissionKeys(config.blocks, config.blockNames, config.subjects)) groups[entry.module] = {
|
|
252
253
|
...groups[entry.module],
|
|
253
254
|
[entry.action]: entry.key
|
|
254
255
|
};
|
|
@@ -1476,7 +1477,7 @@ function emitModule(model, options) {
|
|
|
1476
1477
|
if (extended) lines.push("/** The installed blocks' repository extensions; `defineSupabase` installs them. */", `type Extensions = readonly [${calls.map(({ fn }) => `ReturnType<typeof ${fn}>`).join(", ")}];`, `const extensions: Extensions = [${calls.map(({ call }) => call).join(", ")}];`, "");
|
|
1477
1478
|
const subjectType = subjects.length > 0 ? "SubjectType" : "string";
|
|
1478
1479
|
const schemaLine = extended ? `export const schema: Schema<Models, Database, Functions, ${subjectType}, ExtensionsOf<Extensions>> = defineSchema(meta, extensions);` : `export const schema: Schema<Models, Database, Functions${subjects.length > 0 ? ", SubjectType" : ""}> = defineSchema(meta);`;
|
|
1479
|
-
if (subjects.length > 0) lines.push("/** The app's subject types, from `config.
|
|
1480
|
+
if (subjects.length > 0) lines.push("/** The app's subject types, from `config.subjects`. */", `export const subjectTypes = [${subjects.map(q).join(", ")}] as const;`, "export type SubjectType = (typeof subjectTypes)[number];", "/** One subject: its type and its id as text. */", "export type RecordRef<T extends SubjectType = SubjectType> = { readonly type: T; readonly id: string };", "");
|
|
1480
1481
|
lines.push(schemaLine, "");
|
|
1481
1482
|
return lines.join("\n");
|
|
1482
1483
|
}
|
|
@@ -1569,6 +1570,7 @@ function blockConfigEntries(config) {
|
|
|
1569
1570
|
const layout = {
|
|
1570
1571
|
modules: config.blocks,
|
|
1571
1572
|
instances: config.instances,
|
|
1573
|
+
subjects: config.subjects,
|
|
1572
1574
|
...config.sql.scope === void 0 ? {} : { scope: config.sql.scope }
|
|
1573
1575
|
};
|
|
1574
1576
|
const entry = generatedEntry({
|
|
@@ -2112,7 +2114,8 @@ async function renderFiles(config, snapshot, options = {}) {
|
|
|
2112
2114
|
async function renderTypesModule(config, snapshot, configText) {
|
|
2113
2115
|
return cachedTypesModule(config.root, config.output, typesModuleKey(config, configText, snapshot), async () => (await render(config, snapshot, { typesModule: true })).typesModule ?? "");
|
|
2114
2116
|
}
|
|
2115
|
-
async function render(
|
|
2117
|
+
async function render(declared, snapshot, options = {}) {
|
|
2118
|
+
const config = withTableTags(declared, snapshot.generator.tables);
|
|
2116
2119
|
const model = buildModel(snapshot, config);
|
|
2117
2120
|
const runtime = options.runtimeImport ? { runtimeImport: options.runtimeImport } : {};
|
|
2118
2121
|
const output = resolve(config.root, config.output);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { c as
|
|
1
|
+
import { c as runsWithInvalidConfig, d as DOCS_ORIGIN, f as GROUPS, g as runCommand, h as parseArgs$2, i as joinRepeated, l as COMMANDS, o as listArgs, p as RESERVED_NAMES, s as readsLegacyTables, t as GLOBAL_ARGS } from "./command-DIPmo0wh.js";
|
|
2
2
|
import { n as highlight, r as painter } from "./style-Bm2X5JrN.js";
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
3
|
+
import { t as VERSION } from "./version-CQHFm-ak.js";
|
|
4
4
|
import { n as CliError, o as toCliError } from "./errors-BTe6A15O.js";
|
|
5
5
|
import { a as missingInputNext, o as resolveAgent, t as checkConsent } from "./agent-CbuPvI2x.js";
|
|
6
|
-
import { a as globalFlags, c as resolveCommand, i as commandTree, n as closestName, o as isVariadic, r as commandArgs, t as checkArgs } from "./parse-
|
|
7
|
-
import { n as movedCommand, r as movedFlag } from "./moved-
|
|
6
|
+
import { a as globalFlags, c as resolveCommand, i as commandTree, n as closestName, o as isVariadic, r as commandArgs, t as checkArgs } from "./parse-BPf3kGnc.js";
|
|
7
|
+
import { n as movedCommand, r as movedFlag } from "./moved-DNOtp9LA.js";
|
|
8
8
|
import { n as HTTP_CHANNEL, t as EXEC_CHANNEL } from "./trace-VbdO6bcN.js";
|
|
9
9
|
import { stripVTControlCharacters } from "node:util";
|
|
10
10
|
import { subscribe, unsubscribe } from "node:diagnostics_channel";
|
|
@@ -16,38 +16,40 @@ import { resolve } from "node:path";
|
|
|
16
16
|
* loads on demand, so `--version` and `--help` import no command.
|
|
17
17
|
*/
|
|
18
18
|
const LOADERS = [
|
|
19
|
-
["init", () => import("./init-
|
|
20
|
-
["add", () => import("./add-
|
|
21
|
-
["remove", () => import("./remove-
|
|
22
|
-
["upgrade", () => import("./upgrade-
|
|
23
|
-
["
|
|
24
|
-
["
|
|
25
|
-
["
|
|
26
|
-
["
|
|
27
|
-
["db
|
|
28
|
-
["db
|
|
29
|
-
["
|
|
30
|
-
["
|
|
31
|
-
["dev
|
|
32
|
-
["dev
|
|
33
|
-
["dev
|
|
34
|
-
["
|
|
35
|
-
["
|
|
36
|
-
["blocks
|
|
37
|
-
["
|
|
38
|
-
["
|
|
39
|
-
["
|
|
40
|
-
["
|
|
41
|
-
["
|
|
42
|
-
["
|
|
43
|
-
["
|
|
44
|
-
["
|
|
45
|
-
["codemod 0.
|
|
46
|
-
["codemod 0.
|
|
47
|
-
["codemod 0.
|
|
48
|
-
["codemod 0.
|
|
49
|
-
["
|
|
50
|
-
["
|
|
19
|
+
["init", () => import("./init-C1bXXB_P.js").then((m) => m.initCommand)],
|
|
20
|
+
["add", () => import("./add-CwhrRJz5.js").then((m) => m.addCommand)],
|
|
21
|
+
["remove", () => import("./remove-CwG8cPv1.js").then((m) => m.removeCommand)],
|
|
22
|
+
["upgrade", () => import("./upgrade-BoHb4h9P.js").then((m) => m.upgradeCommand)],
|
|
23
|
+
["table", () => import("./table-dyKddjwo.js").then((m) => m.tableCommand)],
|
|
24
|
+
["migrate schema-first", () => import("./migrate-BWYXFnaW.js").then((m) => m.migrateSchemaFirstCommand)],
|
|
25
|
+
["gen", () => import("./gen-B7rw4j19.js").then((m) => m.genCommand)],
|
|
26
|
+
["doctor", () => import("./doctor-CXJOhwLB.js").then((m) => m.doctorCommand)],
|
|
27
|
+
["db query", () => import("./db-CWvH1_46.js").then((m) => m.dbQueryCommand)],
|
|
28
|
+
["db diff", () => import("./db-CWvH1_46.js").then((m) => m.dbDiffCommand)],
|
|
29
|
+
["db seed", () => import("./seed-BOun22-k.js").then((m) => m.seedCommand)],
|
|
30
|
+
["db backfill", () => import("./backfill-DDDLhinm.js").then((m) => m.dbBackfillCommand)],
|
|
31
|
+
["dev env", () => import("./env-uqfUbUzk.js").then((m) => m.envCommand)],
|
|
32
|
+
["dev run", () => import("./run-CvPl8iQd.js").then((m) => m.runCommand)],
|
|
33
|
+
["dev keys", () => import("./keys-V-HcO-21.js").then((m) => m.keysCommand)],
|
|
34
|
+
["dev stack ls", () => import("./stack-ClESAZYf.js").then((m) => m.stackLsCommand)],
|
|
35
|
+
["dev stack prune", () => import("./stack-ClESAZYf.js").then((m) => m.stackPruneCommand)],
|
|
36
|
+
["blocks list", () => import("./blocks-BCVcjvbm.js").then((m) => m.blocksListCommand)],
|
|
37
|
+
["blocks view", () => import("./blocks-BCVcjvbm.js").then((m) => m.blocksViewCommand)],
|
|
38
|
+
["blocks search", () => import("./blocks-BCVcjvbm.js").then((m) => m.blocksSearchCommand)],
|
|
39
|
+
["powersync streams", () => import("./powersync-CbYxLsjv.js").then((m) => m.powersyncStreamsCommand)],
|
|
40
|
+
["spec emit", () => import("./spec-EO0TP84d.js").then((m) => m.specEmitCommand)],
|
|
41
|
+
["spec validate", () => import("./spec-EO0TP84d.js").then((m) => m.specValidateCommand)],
|
|
42
|
+
["mcp", () => import("./mcp-BRNAchdH.js").then((m) => m.mcpCommand)],
|
|
43
|
+
["skills list", () => import("./skills-DM3oeIxY.js").then((m) => m.skillsListCommand)],
|
|
44
|
+
["skills install", () => import("./skills-DM3oeIxY.js").then((m) => m.skillsInstallCommand)],
|
|
45
|
+
["codemod 0.4", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.4"))],
|
|
46
|
+
["codemod 0.5", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.5"))],
|
|
47
|
+
["codemod 0.6", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.6"))],
|
|
48
|
+
["codemod 0.9", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.9"))],
|
|
49
|
+
["codemod 0.11", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.11"))],
|
|
50
|
+
["codemod 0.15", () => import("./codemod-HKuwQmi_.js").then((m) => m.codemodCommand("0.15"))],
|
|
51
|
+
["completion", () => import("./completion-FUgqm2-N.js").then((m) => m.completionCommand)],
|
|
52
|
+
["config", () => import("./config-BfapErxs.js").then((m) => m.configCommand)]
|
|
51
53
|
];
|
|
52
54
|
/** The built-in commands, for `createCli`. */
|
|
53
55
|
function builtinCommands() {
|
|
@@ -466,7 +468,7 @@ function cliFromTree(init, extra = {}) {
|
|
|
466
468
|
};
|
|
467
469
|
if (argv[0] === "__complete") {
|
|
468
470
|
const words = argv[1] === "--" ? argv.slice(2) : argv.slice(1);
|
|
469
|
-
const lines = await import("./completion-
|
|
471
|
+
const lines = await import("./completion-DyLMSjOD.js").then(async ({ complete, completionLines }) => completionLines(await complete(tree, words))).catch(() => "");
|
|
470
472
|
if (lines !== "") out(lines);
|
|
471
473
|
return {
|
|
472
474
|
code: 0,
|
|
@@ -595,8 +597,8 @@ function cliFromTree(init, extra = {}) {
|
|
|
595
597
|
try {
|
|
596
598
|
const [loaded, { defaultConfig, discoverConfig, loadConfig }, { configEnvironment, isCi, parseEnv }] = await Promise.all([
|
|
597
599
|
node.load(),
|
|
598
|
-
import("./config-
|
|
599
|
-
import("./env-
|
|
600
|
+
import("./config-Df5cXWNN.js"),
|
|
601
|
+
import("./env-Bat6ogep.js")
|
|
600
602
|
]);
|
|
601
603
|
command = loaded;
|
|
602
604
|
rawArgs = joinRepeated(rest, listArgs(command));
|
|
@@ -606,7 +608,7 @@ function cliFromTree(init, extra = {}) {
|
|
|
606
608
|
const env = parseEnv(options.env ?? {});
|
|
607
609
|
const environment = configEnvironment(globals.env, env);
|
|
608
610
|
const configFile = discoverConfig(cwd, globals.config);
|
|
609
|
-
const loadWith = (path) => loadConfig(cwd, globals.config, environment, path).catch((cause) => {
|
|
611
|
+
const loadWith = (path) => loadConfig(cwd, globals.config, environment, path, { legacyTables: readsLegacyTables(command) }).catch((cause) => {
|
|
610
612
|
throw cause instanceof CliError ? cause : new CliError("config_invalid", toCliError(cause).message, { cause });
|
|
611
613
|
});
|
|
612
614
|
const reloadConfig = () => loadWith();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
|
|
2
2
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
3
|
-
import { t as PROCESS_ENV } from "./env-
|
|
4
|
-
import { n as spawnInherited } from "./exec
|
|
3
|
+
import { t as PROCESS_ENV } from "./env-BK0xKMeU.js";
|
|
4
|
+
import { n as spawnInherited } from "./exec-Ca5s-ygi.js";
|
|
5
5
|
import { i as staleVariables } from "./stack-env-6hS-WEmh.js";
|
|
6
|
-
import { i as readStackEnv } from "./env-
|
|
6
|
+
import { i as readStackEnv } from "./env-BM242BCV.js";
|
|
7
7
|
//#region src/cli/commands/run.ts
|
|
8
8
|
const ARGS = {
|
|
9
9
|
prefix: {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as errorText } from "./errors-BTe6A15O.js";
|
|
2
2
|
import { a as sameText, t as display } from "./io-DH1kcmmP.js";
|
|
3
|
-
import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-
|
|
3
|
+
import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-DQZ09YOg.js";
|
|
4
4
|
import { t as byCodePoint } from "./compare-BmIWVEui.js";
|
|
5
|
-
import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-
|
|
6
|
-
import { n as render } from "./render-
|
|
7
|
-
import {
|
|
8
|
-
import { s as schemaStampPath } from "./content-mapper-
|
|
5
|
+
import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-CXgsUPGj.js";
|
|
6
|
+
import { n as render } from "./render-B18iAdsT.js";
|
|
7
|
+
import { a as compiledReadSets, c as entitlementRequirements, d as providerLabel, f as unsafeKey, l as entitlementsMode, o as accessProviderMode, s as accessRequirements, u as moduleKeyProblems } from "./providers-Cjf5iOp5.js";
|
|
8
|
+
import { s as schemaStampPath } from "./content-mapper-B0ehR7K-.js";
|
|
9
9
|
import { a as changedFiles, d as fileDiff, i as changeLines, r as applyPlan, s as hasConflicts } from "./files-CX71yBm8.js";
|
|
10
|
-
import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-
|
|
11
|
-
import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-
|
|
12
|
-
import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-
|
|
10
|
+
import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-CkxDNVEH.js";
|
|
11
|
+
import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-BHbtUOvh.js";
|
|
12
|
+
import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-8-hMiZtW.js";
|
|
13
13
|
import { existsSync } from "node:fs";
|
|
14
14
|
import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
|
|
15
15
|
import { readFile } from "node:fs/promises";
|
|
@@ -142,7 +142,7 @@ function appViewsOf(context) {
|
|
|
142
142
|
const BLOCK_PREFIX = "bsb_";
|
|
143
143
|
/** The app tables (`schema.table`) that blocks run over. */
|
|
144
144
|
function blockTargets(context) {
|
|
145
|
-
return new Set(adoptedTables(context.config.blocks, appTablesOf(context)).map((table) => `${table.schema}.${table.table}`));
|
|
145
|
+
return new Set(adoptedTables(context.config.blocks, appTablesOf(context), { subjects: context.config.subjects }).map((table) => `${table.schema}.${table.table}`));
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Whether permissive policies that overlap on `table` are one app policy and
|
|
@@ -553,7 +553,7 @@ const RLS_RULES = [
|
|
|
553
553
|
code: "BS213",
|
|
554
554
|
severity: "warning",
|
|
555
555
|
title: "API roles can write the columns that grant access",
|
|
556
|
-
description: "RLS helpers decide access from columns such as `memberships.user_id`, `memberships.role` or `contacts.customer_id`, and an authorization provider lists them as `decidingColumns`. When `anon` or `authenticated` may insert or update one of them, and a policy lets them write the row, a user can grant themselves access. A table-level grant counts even after a column-level revoke. A single-column primary key, a tenant column every write policy pins to a tenant the caller acts in (`current_tenant_id()`, `can('tenant', column, ...)`, `tenant_ids_with(...)` or the membership helper `member_organization_ids()`, alone or next to a guest's grant from `portal_subjects()`), a subject's `deletedAt` column in `config.
|
|
556
|
+
description: "RLS helpers decide access from columns such as `memberships.user_id`, `memberships.role` or `contacts.customer_id`, and an authorization provider lists them as `decidingColumns`. When `anon` or `authenticated` may insert or update one of them, and a policy lets them write the row, a user can grant themselves access. A table-level grant counts even after a column-level revoke. A single-column primary key, a tenant column every write policy pins to a tenant the caller acts in (`current_tenant_id()`, `can('tenant', column, ...)`, `tenant_ids_with(...)` or the membership helper `member_organization_ids()`, alone or next to a guest's grant from `portal_subjects()`), a subject's `deletedAt` column in `config.subjects` and a block's soft-delete column (they only hide rows) don't count unless the provider lists them.",
|
|
557
557
|
check: (context) => {
|
|
558
558
|
const tables = new Map(catalogOf(context).tables.map((table) => [qualified(table), table]));
|
|
559
559
|
return [...grantColumns(context)].flatMap(([name, byColumn]) => {
|
|
@@ -999,7 +999,7 @@ const AUTHORIZATION_RULES = [
|
|
|
999
999
|
target: requirement.function
|
|
1000
1000
|
});
|
|
1001
1001
|
}
|
|
1002
|
-
findings.push(...moduleKeyProblems(provider, modulePermissionKeys(context.config.blocks, context.config.blockNames)));
|
|
1002
|
+
findings.push(...moduleKeyProblems(provider, modulePermissionKeys(context.config.blocks, context.config.blockNames, context.config.subjects)));
|
|
1003
1003
|
if ((context.config.blocks.permissions?.functions?.canAssign ?? provider.functions.canAssign) === void 0) findings.push({
|
|
1004
1004
|
severity: "warning",
|
|
1005
1005
|
message: `Neither blocks.permissions.functions.canAssign nor ${providerLabel(provider)} sets canAssign, so under the provider model only the service role assigns roles: the memberships guard refuses every membership a member adds or changes. Use a provider that sets authorization.functions.canAssign, or set blocks.permissions.functions.canAssign.`,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { n as seedCommand } from "./seed-CDnL4Tnc.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
|
|
2
2
|
import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
|
|
3
3
|
import { t as display } from "./io-DH1kcmmP.js";
|
|
4
|
-
import { l as stdinDatabaseUrl, n as databaseUrl, o as importExport } from "./config-
|
|
4
|
+
import { l as stdinDatabaseUrl, n as databaseUrl, o as importExport } from "./config-Cskysxp-.js";
|
|
5
5
|
import { m as supabaseDir } from "./supabase-toml-CncmQbO0.js";
|
|
6
6
|
import { t as connect } from "./db-CQCLx7cx.js";
|
|
7
7
|
import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, s as hasConflicts, u as planResult } from "./files-CX71yBm8.js";
|
|
8
|
-
import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-
|
|
8
|
+
import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-v8ljFDfc.js";
|
|
9
9
|
import { existsSync } from "node:fs";
|
|
10
10
|
import { resolve } from "node:path";
|
|
11
11
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as toCatalog } from "./source-
|
|
1
|
+
import { a as toCatalog } from "./source-B6aMAoEK.js";
|
|
2
2
|
import { h as tomlGet, p as sqlWorkflow, r as detectWorkflow } from "./supabase-toml-CncmQbO0.js";
|
|
3
3
|
//#region src/cli/doctor/shared.ts
|
|
4
4
|
const catalogs = /* @__PURE__ */ new WeakMap();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as list,
|
|
1
|
+
import { a as list, m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
|
|
2
2
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
3
3
|
import { t as byCodePoint } from "./compare-BmIWVEui.js";
|
|
4
4
|
import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
|
|
2
|
-
import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-
|
|
2
|
+
import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-DQZ09YOg.js";
|
|
3
3
|
import { t as byCodePoint } from "./compare-BmIWVEui.js";
|
|
4
|
-
import { n as managementSource, r as pgSource } from "./source-
|
|
5
|
-
import { n as databaseUrl, u as accessToken } from "./config-
|
|
4
|
+
import { n as managementSource, r as pgSource } from "./source-B6aMAoEK.js";
|
|
5
|
+
import { n as databaseUrl, u as accessToken } from "./config-Cskysxp-.js";
|
|
6
6
|
import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, u as pgFunctionHooks } from "./supabase-toml-CncmQbO0.js";
|
|
7
7
|
import { t as connect } from "./db-CQCLx7cx.js";
|
|
8
8
|
import { existsSync } from "node:fs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as VERSION } from "./version-
|
|
1
|
+
import { t as VERSION } from "./version-CQHFm-ak.js";
|
|
2
2
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
3
3
|
import { r as redactUrl } from "./redact-KGAk2Ul9.js";
|
|
4
4
|
import { n as HTTP_CHANNEL } from "./trace-VbdO6bcN.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
-
import { l as stdinDatabaseUrl } from "./config-
|
|
2
|
+
import { l as stdinDatabaseUrl } from "./config-Cskysxp-.js";
|
|
3
3
|
//#region src/cli/commands/source-args.ts
|
|
4
4
|
/**
|
|
5
5
|
* The connection string from stdin, for commands that connect but read no
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { n as __require, t as __commonJSMin } from "./rolldown-runtime-kJ_i4yPo.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as VERSION } from "./version-
|
|
2
|
+
import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
|
|
3
|
+
import { t as VERSION } from "./version-CQHFm-ak.js";
|
|
4
4
|
import { i as failedResult, n as CliError, r as errorText } from "./errors-BTe6A15O.js";
|
|
5
5
|
import { t as display } from "./io-DH1kcmmP.js";
|
|
6
|
-
import { c as writeAtomic, t as CACHE_DIR } from "./cache-
|
|
6
|
+
import { c as writeAtomic, t as CACHE_DIR } from "./cache-DQZ09YOg.js";
|
|
7
7
|
import { t as isRecord } from "./guards-CUlDNYZs.js";
|
|
8
8
|
import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
|
|
9
9
|
import { a as changedFiles, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as specEmitCommand, i as specValidateCommand } from "./spec-
|
|
1
|
+
export { n as specEmitCommand, i as specValidateCommand } from "./spec-BcYic005.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-
|
|
2
|
-
import { a as toCatalog } from "./source-
|
|
1
|
+
import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-CXgsUPGj.js";
|
|
2
|
+
import { a as toCatalog } from "./source-B6aMAoEK.js";
|
|
3
3
|
import { d as readSupabaseToml, f as schemaPaths, n as declarativeSchemasDir, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
|
|
4
4
|
import { existsSync } from "node:fs";
|
|
5
5
|
import { dirname, join, relative, resolve, sep } from "node:path";
|
|
6
6
|
import { readFile, readdir } from "node:fs/promises";
|
|
7
|
-
import { adoptedColumnProblems, auditRegistrations, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, extensionSchema, moduleLayout, policyGrants, resolveBlocks, resolveExposeColumns, rlsTables, sameTenantLayout } from "better-supabase/sql";
|
|
7
|
+
import { adoptedColumnProblems, auditRegistrations, declaredIndexes, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, extensionSchema, moduleLayout, policyGrants, resolveBlocks, resolveExposeColumns, rlsTables, sameTenantLayout } from "better-supabase/sql";
|
|
8
8
|
//#region src/cli/sql-layout.ts
|
|
9
9
|
/** The folder the module data files sit next to, for the project's workflow. */
|
|
10
10
|
async function schemasDirOf(config) {
|
|
@@ -44,7 +44,7 @@ async function auditedTables(config) {
|
|
|
44
44
|
async function moduleLayoutFor(config, input) {
|
|
45
45
|
const resolved = new Set(resolveBlocks(input.names, input.entitlementsProvider ? { entitlementsProvider: input.entitlementsProvider } : {}).map((module) => module.name));
|
|
46
46
|
const own = await ownLayout(config);
|
|
47
|
-
const adopted = adoptedColumnProblems(config.blocks, await declarativeTexts(config), config.schemas, own.ownTables);
|
|
47
|
+
const adopted = adoptedColumnProblems(config.blocks, await declarativeTexts(config), config.schemas, own.ownTables, config.subjects);
|
|
48
48
|
if (adopted.length > 0) throw new TypeError(adopted.join("\n"));
|
|
49
49
|
const fromPolicies = resolved.has("grants") && config.blocks["grants"]?.options?.["fromPolicies"] === true;
|
|
50
50
|
const sessionPolicies = resolved.has("sessions") && config.blocks["sessions"]?.options?.["policies"] === true;
|
|
@@ -96,9 +96,15 @@ async function ownLayout(config) {
|
|
|
96
96
|
ownPolicies: {
|
|
97
97
|
...database.policies,
|
|
98
98
|
...declaredPolicies(own, config.schemas)
|
|
99
|
-
}
|
|
99
|
+
},
|
|
100
|
+
ownIndexes: mergeIndexes(database.indexes, declaredIndexes(own, config.schemas))
|
|
100
101
|
};
|
|
101
102
|
}
|
|
103
|
+
function mergeIndexes(database, declared) {
|
|
104
|
+
const merged = { ...database };
|
|
105
|
+
for (const [table, indexes] of declared) merged[table] = [...merged[table] ?? [], ...indexes];
|
|
106
|
+
return merged;
|
|
107
|
+
}
|
|
102
108
|
/** A trigger function named like one that keeps `updated_at` current. */
|
|
103
109
|
const UPDATED_AT_FUNCTION = /updated_at|moddatetime|touch/i;
|
|
104
110
|
const BLOCK_MARKER = /^-- @(?:bsb-block|bsb-tables|bs-module|bs-app-tables)\b/m;
|
|
@@ -125,7 +131,8 @@ async function databaseTables(config) {
|
|
|
125
131
|
views: {},
|
|
126
132
|
columns: {},
|
|
127
133
|
updatedAtTriggers: {},
|
|
128
|
-
policies: {}
|
|
134
|
+
policies: {},
|
|
135
|
+
indexes: {}
|
|
129
136
|
};
|
|
130
137
|
const path = config.source.snapshot;
|
|
131
138
|
if (path === void 0 || !existsSync(resolve(config.root, path))) return none;
|
|
@@ -137,11 +144,13 @@ async function databaseTables(config) {
|
|
|
137
144
|
throw cause;
|
|
138
145
|
}
|
|
139
146
|
const created = blockDeclaredTables(await schemaTexts(config), config.schemas);
|
|
147
|
+
const blockIndexes = new Set([...declaredIndexes((await schemaTexts(config)).filter(writtenByBlocks), config.schemas).values()].flatMap((list) => list.map((index) => index.name)));
|
|
140
148
|
const tables = {};
|
|
141
149
|
const views = {};
|
|
142
150
|
const columns = {};
|
|
143
151
|
const updatedAtTriggers = {};
|
|
144
152
|
const policies = {};
|
|
153
|
+
const indexes = {};
|
|
145
154
|
for (const table of toCatalog(snapshot).tables) {
|
|
146
155
|
const name = `${table.schema}.${table.name}`;
|
|
147
156
|
if (config.schemas.includes(table.schema) && !created.has(name)) {
|
|
@@ -151,6 +160,10 @@ async function databaseTables(config) {
|
|
|
151
160
|
const kept = table.triggers.find((trigger) => !trigger.name.startsWith("bsb_") && trigger.events.includes("update") && UPDATED_AT_FUNCTION.test(trigger.function));
|
|
152
161
|
if (kept !== void 0) updatedAtTriggers[name] = kept.name;
|
|
153
162
|
policies[name] = table.policies.filter((policy) => !policy.name.startsWith("bsb_"));
|
|
163
|
+
indexes[name] = table.indexes.filter((index) => !index.partial && [void 0, "btree"].includes(index.method) && !blockIndexes.has(index.name)).map((index) => ({
|
|
164
|
+
name: index.name,
|
|
165
|
+
columns: index.columns
|
|
166
|
+
}));
|
|
154
167
|
}
|
|
155
168
|
}
|
|
156
169
|
return {
|
|
@@ -158,7 +171,8 @@ async function databaseTables(config) {
|
|
|
158
171
|
views,
|
|
159
172
|
columns,
|
|
160
173
|
updatedAtTriggers,
|
|
161
|
-
policies
|
|
174
|
+
policies,
|
|
175
|
+
indexes
|
|
162
176
|
};
|
|
163
177
|
}
|
|
164
178
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as supabaseCli } from "./exec
|
|
3
|
-
import { a as readSharedMemory, i as reportStacks, n as listStacks, r as prunePlan, t as branchName } from "./stacks-
|
|
1
|
+
import { m as commandMeta, r as defineCliCommand } from "./command-DIPmo0wh.js";
|
|
2
|
+
import { r as supabaseCli } from "./exec-Ca5s-ygi.js";
|
|
3
|
+
import { a as readSharedMemory, i as reportStacks, n as listStacks, r as prunePlan, t as branchName } from "./stacks-CiDBH1dB.js";
|
|
4
4
|
//#region src/cli/commands/stack.ts
|
|
5
5
|
const DEFAULT_DEPS = {
|
|
6
6
|
memory: (root, env) => readSharedMemory(root, env),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
-
import { r as supabaseCli } from "./exec
|
|
2
|
+
import { r as supabaseCli } from "./exec-Ca5s-ygi.js";
|
|
3
3
|
//#region src/cli/stack-status.ts
|
|
4
4
|
/** Parses the JSON object `supabase status` prints after any progress lines. */
|
|
5
5
|
function parseStackStatus(stdout) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as CliError } from "./errors-BTe6A15O.js";
|
|
2
|
-
import { r as supabaseCli, t as runProcess } from "./exec
|
|
2
|
+
import { r as supabaseCli, t as runProcess } from "./exec-Ca5s-ygi.js";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
//#region src/cli/shm.ts
|
|
5
5
|
const DIGITS = /^\d+$/;
|