better-supabase 0.59.0 → 0.60.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/{account-parts-DxSyD4yi.d.ts → account-parts-D-cLYi0Y.d.ts} +1 -1
- package/dist/{adapter-base-BAjra5Eb.js → adapter-base-BHtxRoRg.js} +1 -1
- package/dist/{agents-CbsEgoLN.d.ts → agents-FJk0CNex.d.ts} +2 -2
- package/dist/{ai-schedules-BxBsTpji.d.ts → ai-schedules-wlL3DKqu.d.ts} +1 -1
- package/dist/ai-sdk/agents/index.d.ts +1 -1
- package/dist/ai-sdk/workflow/index.d.ts +1 -1
- package/dist/{api-wRlj_7so.d.ts → api-CSx2F4zg.d.ts} +1 -1
- package/dist/{api-DAJJ7N_0.js → api-Clu-XitC.js} +1 -1
- package/dist/{app-tables-DBmFqdFN.d.ts → app-tables-C_bRG0ek.d.ts} +1 -1
- package/dist/{approvals-Clg-7ghA.js → approvals-D7Xhpd52.js} +8 -6
- package/dist/{approvals-Bbxeiywy.d.ts → approvals-Dn_DM4Oi.d.ts} +6 -0
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.js +3 -3
- package/dist/{authorization-Dq47C4vf.d.ts → authorization-Cn_oEGoA.d.ts} +1 -1
- package/dist/better-result/index.d.ts +2 -2
- package/dist/{bind-Bx0H1vAc.d.ts → bind-Dopmkg_T.d.ts} +4 -4
- package/dist/{block-env-DUn5reXc.d.ts → block-env-4tgXDIAX.d.ts} +4 -4
- package/dist/{block-tables-BaLXCQha.d.ts → block-tables-KnVB7FH0.d.ts} +1 -1
- package/dist/blocks/access-requests/index.d.ts +1 -1
- package/dist/blocks/accounting/index.d.ts +1 -1
- package/dist/blocks/acknowledgements/index.d.ts +1 -1
- package/dist/blocks/activities/index.d.ts +2 -2
- package/dist/blocks/advisories/index.d.ts +1 -1
- package/dist/blocks/agent-checkout/index.d.ts +1 -1
- package/dist/blocks/agents/index.d.ts +1 -1
- package/dist/blocks/ai-cache/index.d.ts +1 -1
- package/dist/blocks/ai-chat/index.d.ts +1 -1
- package/dist/blocks/ai-evals/index.d.ts +1 -1
- package/dist/blocks/ai-files/index.d.ts +1 -1
- package/dist/blocks/ai-guardrails/index.d.ts +1 -1
- package/dist/blocks/ai-keys/index.d.ts +1 -1
- package/dist/blocks/ai-schedules/index.d.ts +2 -2
- package/dist/blocks/announcements/index.d.ts +4 -4
- package/dist/blocks/api-keys/index.d.ts +1 -1
- package/dist/blocks/appraisals/index.d.ts +1 -1
- package/dist/blocks/approvals/index.d.ts +2 -2
- package/dist/blocks/approvals/index.js +2 -2
- package/dist/blocks/assets/index.d.ts +2 -2
- package/dist/blocks/assignment/index.d.ts +1 -1
- package/dist/blocks/attachments/index.d.ts +5 -5
- package/dist/blocks/audit/index.d.ts +2 -2
- package/dist/blocks/automations/index.d.ts +4 -4
- package/dist/blocks/banking/index.d.ts +1 -1
- package/dist/blocks/billable-time/index.d.ts +1 -1
- package/dist/blocks/billing/index.d.ts +3 -3
- package/dist/blocks/bookings/index.d.ts +2 -2
- package/dist/blocks/bulk-actions/index.d.ts +2 -2
- package/dist/blocks/calendar/index.d.ts +3 -3
- package/dist/blocks/care/index.d.ts +27 -27
- package/dist/blocks/care/index.js +1 -1
- package/dist/blocks/care-plans/index.d.ts +3 -3
- package/dist/blocks/cases/index.d.ts +3 -3
- package/dist/blocks/catalog/index.d.ts +2 -2
- package/dist/blocks/channels/index.d.ts +1 -1
- package/dist/blocks/clinical-decision-support/index.d.ts +1 -1
- package/dist/blocks/cms/index.d.ts +5 -5
- package/dist/blocks/cms/index.js +1 -1
- package/dist/blocks/collaboration/index.d.ts +6 -6
- package/dist/blocks/collections/index.d.ts +1 -1
- package/dist/blocks/comments/index.d.ts +2 -2
- package/dist/blocks/commerce/index.d.ts +5 -5
- package/dist/blocks/commissions/index.d.ts +1 -1
- package/dist/blocks/compliance/index.d.ts +1 -1
- package/dist/blocks/connectors/index.d.ts +1 -1
- package/dist/blocks/consents/index.d.ts +2 -2
- package/dist/blocks/contacts/index.d.ts +2 -2
- package/dist/blocks/content/index.d.ts +2 -2
- package/dist/blocks/contracts/index.d.ts +1 -1
- package/dist/blocks/courses/index.d.ts +2 -2
- package/dist/blocks/created-by/index.d.ts +2 -2
- package/dist/blocks/crm/index.d.ts +17 -17
- package/dist/blocks/crm/index.js +2 -2
- package/dist/blocks/custom-fields/index.d.ts +1 -1
- package/dist/blocks/dam/index.d.ts +2 -2
- package/dist/blocks/data-lifecycle/index.d.ts +2 -2
- package/dist/blocks/deadlines/index.d.ts +1 -1
- package/dist/blocks/deals/index.d.ts +1 -1
- package/dist/blocks/dispatch/index.d.ts +2 -2
- package/dist/blocks/document-templates/index.d.ts +2 -2
- package/dist/blocks/documents/index.d.ts +1 -1
- package/dist/blocks/domains/index.d.ts +1 -1
- package/dist/blocks/donations/index.d.ts +1 -1
- package/dist/blocks/drive/index.d.ts +5 -5
- package/dist/blocks/e-prescribing/index.d.ts +1 -1
- package/dist/blocks/employees/index.d.ts +1 -1
- package/dist/blocks/enrichment/index.d.ts +1 -1
- package/dist/blocks/enrollments/index.d.ts +2 -2
- package/dist/blocks/entitlements/index.d.ts +3 -3
- package/dist/blocks/events/index.d.ts +3 -3
- package/dist/blocks/expenses/index.d.ts +1 -1
- package/dist/blocks/field-history/index.d.ts +1 -1
- package/dist/blocks/filespace/index.d.ts +8 -8
- package/dist/blocks/finance/index.d.ts +5 -5
- package/dist/blocks/finance/index.js +1 -1
- package/dist/blocks/flags/index.d.ts +1 -1
- package/dist/blocks/forecasts/index.d.ts +1 -1
- package/dist/blocks/forms/index.d.ts +3 -3
- package/dist/blocks/funding/index.d.ts +2 -2
- package/dist/blocks/goals/index.d.ts +1 -1
- package/dist/blocks/governance/index.d.ts +4 -4
- package/dist/blocks/guests/index.d.ts +1 -1
- package/dist/blocks/hiring/index.d.ts +1 -1
- package/dist/blocks/identities/index.d.ts +1 -1
- 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 +1 -1
- package/dist/blocks/index.d.ts +5 -5
- package/dist/blocks/index.js +2 -2
- package/dist/blocks/inspections/index.d.ts +2 -2
- package/dist/blocks/inventory/index.d.ts +1 -1
- package/dist/blocks/invoices/index.d.ts +2 -2
- package/dist/blocks/invoices/index.js +1 -1
- package/dist/blocks/knowledge/index.d.ts +1 -1
- package/dist/blocks/lead-scoring/index.d.ts +2 -2
- package/dist/blocks/learning/index.d.ts +3 -3
- package/dist/blocks/leases/index.d.ts +1 -1
- package/dist/blocks/leave/index.d.ts +1 -1
- package/dist/blocks/ledger/index.d.ts +1 -1
- package/dist/blocks/legal-entities/index.d.ts +2 -2
- package/dist/blocks/lims/index.d.ts +2 -2
- package/dist/blocks/mail-sync/index.d.ts +3 -3
- package/dist/blocks/maintenance/index.d.ts +2 -2
- package/dist/blocks/manufacturing/index.d.ts +2 -2
- package/dist/blocks/medications/index.d.ts +1 -1
- package/dist/blocks/meetings/index.d.ts +3 -3
- package/dist/blocks/memberships/index.d.ts +2 -2
- package/dist/blocks/memory/index.d.ts +1 -1
- package/dist/blocks/messaging/index.d.ts +5 -5
- package/dist/blocks/metrics/index.d.ts +1 -1
- 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 +5 -5
- package/dist/blocks/numbering/index.d.ts +1 -1
- package/dist/blocks/oauth-server/index.d.ts +1 -1
- package/dist/blocks/observations/index.d.ts +2 -2
- package/dist/blocks/onboarding/index.d.ts +2 -2
- package/dist/blocks/option-sets/index.d.ts +2 -2
- package/dist/blocks/orders/index.d.ts +1 -1
- package/dist/blocks/organizations/index.d.ts +2 -2
- package/dist/blocks/outbox/index.d.ts +1 -1
- package/dist/blocks/passes/index.d.ts +2 -2
- package/dist/blocks/payroll-export/index.d.ts +2 -2
- package/dist/blocks/people/index.d.ts +7 -7
- package/dist/blocks/periods/index.d.ts +1 -1
- package/dist/blocks/permissions/index.d.ts +3 -3
- package/dist/blocks/pipelines/index.d.ts +2 -2
- package/dist/blocks/posts/index.d.ts +2 -2
- package/dist/blocks/procurement/index.d.ts +5 -5
- package/dist/blocks/procurement/index.js +1 -1
- package/dist/blocks/profiles/index.d.ts +1 -1
- package/dist/blocks/projects/index.d.ts +7 -7
- package/dist/blocks/projects/index.js +2 -2
- package/dist/blocks/promotions/index.d.ts +1 -1
- package/dist/blocks/prompts/index.d.ts +1 -1
- package/dist/blocks/push/index.d.ts +2 -2
- package/dist/blocks/qualifications/index.d.ts +2 -2
- package/dist/blocks/queue/index.d.ts +2 -2
- package/dist/blocks/quotes/index.d.ts +1 -1
- package/dist/blocks/rank/index.d.ts +1 -1
- package/dist/blocks/reactions/index.d.ts +4 -4
- package/dist/blocks/recruiting/index.d.ts +4 -4
- package/dist/blocks/referrals/index.d.ts +1 -1
- package/dist/blocks/relations/index.d.ts +1 -1
- package/dist/blocks/reminders/index.d.ts +1 -1
- package/dist/blocks/reviews/index.d.ts +1 -1
- package/dist/blocks/rfqs/index.d.ts +2 -2
- package/dist/blocks/risks/index.d.ts +2 -2
- package/dist/blocks/saas/index.d.ts +12 -12
- package/dist/blocks/sales/index.d.ts +1 -1
- package/dist/blocks/sales/index.js +1 -1
- package/dist/blocks/saved-views/index.d.ts +3 -3
- package/dist/blocks/scheduling/index.d.ts +4 -4
- package/dist/blocks/scores/index.d.ts +2 -2
- package/dist/blocks/search/index.d.ts +3 -3
- package/dist/blocks/security-events/index.d.ts +1 -1
- package/dist/blocks/segments/index.d.ts +2 -2
- package/dist/blocks/sequences/index.d.ts +3 -3
- package/dist/blocks/service/index.d.ts +7 -7
- package/dist/blocks/service-accounts/index.d.ts +1 -1
- package/dist/blocks/sessions/index.d.ts +2 -2
- package/dist/blocks/settings/index.d.ts +2 -2
- package/dist/blocks/share-links/index.d.ts +1 -1
- package/dist/blocks/shifts/index.d.ts +2 -2
- package/dist/blocks/shipments/index.d.ts +1 -1
- package/dist/blocks/signatures/index.d.ts +2 -2
- package/dist/blocks/signing-keys/index.d.ts +1 -1
- package/dist/blocks/sla/index.d.ts +1 -1
- package/dist/blocks/sso/index.d.ts +1 -1
- package/dist/blocks/state-machine/index.d.ts +1 -1
- package/dist/blocks/subjects/index.d.ts +2 -2
- package/dist/blocks/support/index.d.ts +5 -5
- package/dist/blocks/tags/index.d.ts +2 -2
- package/dist/blocks/tasks/index.d.ts +2 -2
- package/dist/blocks/tax/index.d.ts +2 -2
- package/dist/blocks/teams/index.d.ts +1 -1
- package/dist/blocks/templates/index.d.ts +1 -1
- package/dist/blocks/tills/index.d.ts +1 -1
- package/dist/blocks/time-entries/index.d.ts +2 -2
- package/dist/blocks/timeline/index.d.ts +1 -1
- package/dist/blocks/trash/index.d.ts +1 -1
- package/dist/blocks/undo/index.d.ts +2 -2
- package/dist/blocks/updated-at/index.d.ts +2 -2
- package/dist/blocks/usage/index.d.ts +2 -2
- package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
- package/dist/blocks/versions/index.d.ts +1 -1
- package/dist/blocks/waitlist/index.d.ts +1 -1
- package/dist/blocks/warehouse/index.d.ts +1 -1
- package/dist/blocks/warranty/index.d.ts +1 -1
- package/dist/blocks/webhooks/index.d.ts +2 -2
- package/dist/blocks/workflow-editor/index.d.ts +4 -4
- package/dist/blocks/workflows/index.d.ts +4 -4
- package/dist/{blocks-RVd7m590.d.ts → blocks-sDhFO8-h.d.ts} +4 -4
- package/dist/{build-Rz89mkdS.js → build-QM0GdQ2B.js} +1 -1
- package/dist/{cache-tags-BxpxsCtq.d.ts → cache-tags-FrJaMalu.d.ts} +1 -1
- package/dist/claims/index.d.ts +4 -4
- package/dist/{claims-source-BEVTXHQx.d.ts → claims-source-CeefCyGV.d.ts} +1 -1
- package/dist/cli/add-BBZULhs3.js +1 -0
- package/dist/cli/{add-CnCt2QoB.js → add-OllEkXon.js} +9 -9
- package/dist/cli/{add-BJNTq7Ti.js → add-djLR310z.js} +2 -2
- package/dist/cli/{app-table-files-CfB0_NuX.js → app-table-files-DnoDAkVJ.js} +3 -3
- package/dist/cli/{app-tables-oieRU_sP.js → app-tables-C4shCkBv.js} +2 -2
- package/dist/cli/{backfill-Cr5jgVi1.js → backfill-_spwSvnn.js} +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/cli/{blocks-B-ANsRnH.js → blocks-Cvs0nhC2.js} +1 -1
- package/dist/cli/{blocks-DLMVaOFG.js → blocks-DFkzCFQi.js} +1 -1
- package/dist/cli/{cache-Ba26VW2N.js → cache-B0JnXfiY.js} +1 -1
- package/dist/cli/{codemod-x1I7Mjr3.js → codemod-D2Lnca97.js} +5 -5
- package/dist/cli/{codemod-naming-CZhndoO7.js → codemod-naming-CHIeOTt5.js} +1 -1
- package/dist/cli/{column-renames-BEEDF6P6.js → column-renames-4OHEvCAj.js} +2 -2
- package/dist/cli/{content-mapper-z7CrnE1s.js → content-mapper-DAYxPQ18.js} +1 -1
- package/dist/cli/{dev-D9nn9Gzt.js → dev-Xw7pt3KG.js} +3 -3
- package/dist/cli/{doctor-DCorhlir.js → doctor-diSKQp-6.js} +238 -105
- package/dist/cli/{emit-qQdWBc9e.js → emit-CICey-Za.js} +2 -2
- package/dist/cli/{gen-Bf1ujcTm.js → gen-BVuNFeLB.js} +3 -3
- package/dist/cli/{gen-tasks-q9JJSJ6r.js → gen-tasks-C2vwKKTc.js} +9 -9
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/cli/{init-DLLfL1uL.js → init-9BSoBkny.js} +8 -8
- package/dist/cli/{live-D4giSEyd.js → live-Ce8vdcCn.js} +2 -2
- package/dist/cli/{mcp-DwjeMbmV.js → mcp-UW-gEnP_.js} +2 -2
- package/dist/cli/{memo-backend-DPGMyJvH.js → memo-backend-BMdfsihK.js} +1 -1
- package/dist/cli/{metadata-Cft3CW1M.js → metadata-DqrbS0sS.js} +4 -4
- package/dist/cli/{migrate-Ci_UUuPv.js → migrate-Cn8L_0co.js} +1 -1
- package/dist/cli/{migration-safety-D3raBuJx.js → migration-safety-C1Ysrthi.js} +1 -1
- package/dist/cli/{module-migration-DZtxNO8A.js → module-migration-DXI95fqs.js} +1 -1
- package/dist/cli/{partition-DWJ6icQ5.js → partition-CJCrIueu.js} +1 -1
- package/dist/cli/{powersync-BAyDVR-N.js → powersync-CB-7AksZ.js} +3 -3
- package/dist/cli/powersync-JTdU1Xpy.js +1 -0
- package/dist/cli/{print-BSy5c62C.js → print-AVVgXsLG.js} +2 -2
- package/dist/cli/{providers-BbFKOale.js → providers-B3FLmlud.js} +1 -1
- package/dist/cli/{prune-workflows-VY7C9vhb.js → prune-workflows-CrLDmFf1.js} +1 -1
- package/dist/cli/{remove-CcBoTjEO.js → remove-00SZWfyi.js} +6 -6
- package/dist/cli/{render-CIrcdge6.js → render-3J7sk_CL.js} +4 -4
- package/dist/cli/{render-cache-bbL2UdJ6.js → render-cache-P4gQeivH.js} +1 -1
- package/dist/cli/round-trips-BHfeIu6I.js +238 -0
- package/dist/cli/{run-qCtE--0z.js → run-CByEIEng.js} +30 -30
- package/dist/cli/{run-D_p_WkPh.js → run-D_z9ULO7.js} +7 -7
- package/dist/cli/{shared-CkqZm0Bz.js → shared-d021xfdn.js} +1 -1
- package/dist/cli/{source-io7b1UpH.js → source-DdqeWoO4.js} +1 -1
- package/dist/cli/{spec-djAAvGKU.js → spec-ClfqDbVv.js} +2 -2
- package/dist/cli/{spec-QGOfTJvS.js → spec-Diudl7hC.js} +1 -1
- package/dist/cli/{sql-layout-1ASqdR4g.js → sql-layout-Bl3iOXMS.js} +3 -3
- package/dist/cli/{squash-DEmB47YZ.js → squash-C07y7CsQ.js} +1 -1
- package/dist/cli/{sync-CUcxtnwa.js → sync-Cw0ke-3h.js} +4 -4
- package/dist/cli/{upgrade-DV9mKpAp.js → upgrade-niwEovfl.js} +5 -5
- package/dist/cli/{upgrade-FWW6hKCv.js → upgrade-oc6s5Xoe.js} +5 -5
- package/dist/cli/{version-CSdXYnhG.js → version-Bd3kCDzL.js} +1 -1
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.js +1 -1
- package/dist/client/native/index.d.ts +5 -5
- package/dist/client/native/index.js +2 -2
- package/dist/{codec-Cjquuv8M.js → codec-BI1mq95W.js} +1 -1
- package/dist/{composite-CL4zDLjs.d.ts → composite-BVEOyec_.d.ts} +3 -3
- package/dist/{composite-WUO6K2Hu.js → composite-Tsm5QFS2.js} +1 -1
- package/dist/{composite-reads-BJeDe1yV.js → composite-reads-BJJBI4tL.js} +1 -1
- package/dist/{composite-reads-B9psRGqQ.d.ts → composite-reads-DvN7EgDO.d.ts} +1 -1
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +2 -2
- package/dist/{config-C3yry9U5.js → config-cisS43w5.js} +1 -1
- package/dist/{context-DMTfze4z.d.ts → context-C_Rx1QaW.d.ts} +3 -3
- package/dist/contract/index.d.ts +4 -4
- package/dist/{controller-l9h4TtKg.d.ts → controller-D9N4NKbM.d.ts} +1 -1
- package/dist/{conversion-D70FELty.d.ts → conversion-CruLbcu8.d.ts} +1 -1
- package/dist/create/index.d.ts +4 -4
- package/dist/create/index.js +1 -1
- package/dist/create/lite/index.d.ts +3 -3
- package/dist/create/lite/index.js +3 -3
- package/dist/{db-blocks-Db3LVXco.d.ts → db-blocks-DB8Ct8Eu.d.ts} +11 -2
- package/dist/{define-block-D-Z8xB6y.d.ts → define-block-Cd7dm2o6.d.ts} +2 -2
- package/dist/{define-runtime-Dv8OYnKW.js → define-runtime-Ca5NN0gu.js} +2 -2
- package/dist/{define-runtime-full-C4eTtJAx.js → define-runtime-full-DeuaXsV7.js} +3 -3
- package/dist/{delete-account-BHXzIUIq.d.ts → delete-account-DwGFiIYv.d.ts} +1 -1
- package/dist/{drive-DrD94tWF.d.ts → drive-C6thwExa.d.ts} +2 -2
- package/dist/e-invoicing/index.d.ts +1 -1
- package/dist/edge/index.d.ts +5 -5
- package/dist/edge/index.js +4 -4
- package/dist/{entitlements-B6q7TIMP.d.ts → entitlements-CR5HRd3S.d.ts} +2 -2
- package/dist/eve/index.d.ts +1 -1
- package/dist/eve/index.js +1 -1
- package/dist/{executor-BmcRcw83.js → executor-Bot0tkvU.js} +2 -2
- package/dist/{executor-Dp4A_McY.d.ts → executor-CTuilcgE.d.ts} +2 -2
- package/dist/expo/index.d.ts +2 -2
- package/dist/expo/index.js +3 -3
- package/dist/{extract-D4QPFB_M.d.ts → extract-B2My7IhT.d.ts} +1 -1
- package/dist/{extras-C0cnpjDP.d.ts → extras-CKwPSpGL.d.ts} +1 -1
- package/dist/{field-errors-Br3wwgbu.d.ts → field-errors-CihTLojJ.d.ts} +6 -6
- package/dist/{former-permission-keys-BwJW5uc6.js → former-permission-keys-D8FbWktT.js} +2 -2
- package/dist/{framework-CbjS8M33.js → framework-BYZ8c9_g.js} +1 -1
- package/dist/{framework-BUzOnlJN.d.ts → framework-giXStk8k.d.ts} +3 -3
- package/dist/generators/factories/index.d.ts +1 -1
- package/dist/generators/factories/index.js +1 -1
- package/dist/generators/index.d.ts +2 -2
- package/dist/generators/json-schema/index.d.ts +2 -2
- package/dist/generators/json-schema/index.js +1 -1
- package/dist/generators/nuqs/index.d.ts +1 -1
- package/dist/generators/nuqs/index.js +1 -1
- package/dist/generators/standard-schema/index.d.ts +1 -1
- package/dist/generators/standard-schema/index.js +1 -1
- package/dist/generators/valibot/index.d.ts +1 -1
- package/dist/generators/valibot/index.js +1 -1
- package/dist/generators/zod/index.d.ts +1 -1
- package/dist/generators/zod/index.js +1 -1
- package/dist/hono/index.d.ts +4 -4
- package/dist/hono/index.js +3 -3
- package/dist/{index-DKuOnwh6.d.ts → index-28PPT5w7.d.ts} +2 -2
- package/dist/{index-ouiV6zqH.d.ts → index-69aFw9Id.d.ts} +2 -2
- package/dist/{index-o2y0w9lX.d.ts → index-74TASXlD.d.ts} +1 -1
- package/dist/{index-Dg4lbDzI.d.ts → index-B0dSXth6.d.ts} +1 -1
- package/dist/{index-DK0Hj3pi.d.ts → index-BOuJSOaf.d.ts} +1 -1
- package/dist/{index-C9p3wiWn.d.ts → index-BnY5lZtT.d.ts} +9 -9
- package/dist/{index-jCKNxp8C.d.ts → index-BqUY2MB-.d.ts} +1 -1
- package/dist/{index-BZHDwHGW.d.ts → index-BrnGYShi.d.ts} +2 -2
- package/dist/{index-BquYRGtV.d.ts → index-Bs6OCtxW.d.ts} +1 -1
- package/dist/{index-B6h9m3ml.d.ts → index-BszN5nLs.d.ts} +2 -2
- package/dist/{index-Cg0lDbXs.d.ts → index-Bv2kSYet.d.ts} +4 -4
- package/dist/{index-CHOeFZUB.d.ts → index-BvRseRob.d.ts} +3 -3
- package/dist/{index-DtVZnjKf.d.ts → index-BvZ3uvj9.d.ts} +2 -2
- package/dist/{index-ClysJ8O-.d.ts → index-C1na2fiY.d.ts} +3 -3
- package/dist/{index-D3d7m03L.d.ts → index-C59gKJBx.d.ts} +1 -1
- package/dist/{index-X-ihJBuJ.d.ts → index-CGAcXNod.d.ts} +1 -1
- package/dist/{index-BbpacfC0.d.ts → index-CMyUugyW.d.ts} +8 -8
- package/dist/{index-DkALeCTq.d.ts → index-CdoTvK2W.d.ts} +1 -1
- package/dist/{index-DG187JM_.d.ts → index-CiCmlbtu.d.ts} +1 -1
- package/dist/{index-qzFFTwel.d.ts → index-CiLb3DTI.d.ts} +3 -3
- package/dist/{index-WuUhLgMp.d.ts → index-Cnc4wyTo.d.ts} +2 -2
- package/dist/{index-DLlAc0wg.d.ts → index-Cpj79WyM.d.ts} +1 -1
- package/dist/{index-NNox0BqF.d.ts → index-D50ulqMJ.d.ts} +1 -1
- package/dist/{index-C7Tcervm.d.ts → index-D6px-XTD.d.ts} +2 -2
- package/dist/{index-BfoKErj3.d.ts → index-DMHxmit5.d.ts} +4 -4
- package/dist/{index-Dyns9a8l.d.ts → index-DflyfGR8.d.ts} +2 -2
- package/dist/{index-BFvj-fNS.d.ts → index-DibtbiIW.d.ts} +1 -1
- package/dist/{index-CnTxcNyl.d.ts → index-DpXMVE12.d.ts} +1 -1
- package/dist/{index-DMyMrXPW.d.ts → index-DsLMqyB5.d.ts} +1 -1
- package/dist/{index-DGszLnec.d.ts → index-DzUnwtxa.d.ts} +1 -1
- package/dist/{index-B4uPo3Sr.d.ts → index-Hzbfht3Z.d.ts} +1 -1
- package/dist/{index-bkm44ycq.d.ts → index-Sl13L6VB.d.ts} +4 -4
- package/dist/{index-DU_gZYuh.d.ts → index-UQOB8v1I.d.ts} +1 -1
- package/dist/{index-DYX_uL5t.d.ts → index-_No9Jb9O.d.ts} +1 -1
- package/dist/{index-BWxcC8ll.d.ts → index-cgHbN_EA.d.ts} +4 -4
- package/dist/{index-DHjZvZWC.d.ts → index-pry9PXpK.d.ts} +2 -2
- package/dist/{index-D_xJSanv.d.ts → index-wc3-R_cK.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{invoices-CWp9jcI2.d.ts → invoices-BXwG7Jwp.d.ts} +5 -0
- package/dist/{json-schema-B8f7HdoX.js → json-schema-BveJfXoz.js} +1 -1
- package/dist/list/export/index.d.ts +1 -1
- package/dist/list/index.d.ts +1 -1
- package/dist/list/order/index.d.ts +2 -2
- package/dist/{list-query-qCpvTDGH.d.ts → list-query-CBjzZmjx.d.ts} +1 -1
- package/dist/{manifest-Clzy2rSU.d.ts → manifest-2JeNUq8t.d.ts} +1 -1
- package/dist/{manifest-B_2lEGUS.d.ts → manifest-3e0zfaQt.d.ts} +1 -1
- package/dist/{manifest-CKDaQT_5.d.ts → manifest-3or1oZTo.d.ts} +1 -1
- package/dist/{manifest-qvMWfrZ-.d.ts → manifest-AS4QwWdu.d.ts} +1 -1
- package/dist/{manifest-BvzmDxod.d.ts → manifest-B1lYVfIp.d.ts} +1 -1
- package/dist/{manifest-DVZmJvrE.d.ts → manifest-B7xyFqWo.d.ts} +1 -1
- package/dist/{manifest-Dpad_5Lw.d.ts → manifest-B9m_UaiY.d.ts} +1 -1
- package/dist/{manifest-CKCaFg8y.d.ts → manifest-B9qFGJ_A.d.ts} +1 -1
- package/dist/{manifest-DLSzZMXM.d.ts → manifest-BSjzLeb-.d.ts} +1 -1
- package/dist/{manifest-BS8p47JO.d.ts → manifest-BVn2Xglt.d.ts} +1 -1
- package/dist/{manifest-BoUGzBpS.d.ts → manifest-BWKFNoxP.d.ts} +1 -1
- package/dist/{manifest-D0eItVsP.d.ts → manifest-BXWhDMFt.d.ts} +1 -1
- package/dist/{manifest-DlLxdk7P.d.ts → manifest-Bi44m1V3.d.ts} +1 -1
- package/dist/{manifest-DHTVfgX9.d.ts → manifest-Bluupj7R.d.ts} +1 -1
- package/dist/{manifest-V0QSCEfx.d.ts → manifest-Bo0SCigB.d.ts} +1 -1
- package/dist/{manifest-DCkeNzPW.d.ts → manifest-ByRLUGaJ.d.ts} +3 -3
- package/dist/{manifest-C0v6IEWk.d.ts → manifest-C1--UMCz.d.ts} +1 -1
- package/dist/{manifest-CyaHDD_i.d.ts → manifest-C20SXAzp.d.ts} +1 -1
- package/dist/{manifest-CxgOFWlh.d.ts → manifest-C40ISJVj.d.ts} +1 -1
- package/dist/{manifest-C-pVDUC6.d.ts → manifest-C7KPtGTu.d.ts} +2 -2
- package/dist/{manifest-BAn3lTr4.d.ts → manifest-C82tY_RD.d.ts} +1 -1
- package/dist/{manifest-DBfQe19Z.d.ts → manifest-C94eugvl.d.ts} +1 -1
- package/dist/{manifest-BESrR9Xp.d.ts → manifest-CBdMkxZD.d.ts} +1 -1
- package/dist/{manifest-B7lSTuVC.d.ts → manifest-CCPioFQl.d.ts} +1 -1
- package/dist/{manifest-CCKfdYiH.d.ts → manifest-CD5D0OWo.d.ts} +1 -1
- package/dist/{manifest-Co41j70r.d.ts → manifest-CGnN_2Yx.d.ts} +1 -1
- package/dist/{manifest-ByV81mLa.d.ts → manifest-CH1MFzXN.d.ts} +1 -1
- package/dist/{manifest-BEw6nEKW.d.ts → manifest-CJRob2Ms.d.ts} +1 -1
- package/dist/{manifest-D80LSWzZ.d.ts → manifest-CgljOcHt.d.ts} +1 -1
- package/dist/{manifest-CNLJLsHB.d.ts → manifest-Ci7NEusH.d.ts} +1 -1
- package/dist/{manifest-DHulRwzL.d.ts → manifest-CiXl1kUg.d.ts} +1 -1
- package/dist/{manifest-VCJSqffq.d.ts → manifest-CjzIpyBP.d.ts} +2 -2
- package/dist/{manifest-eUUJnoB5.d.ts → manifest-ClDcyCPP.d.ts} +3 -3
- package/dist/{manifest-DKnWcgse.d.ts → manifest-Co0CBReD.d.ts} +1 -1
- package/dist/{manifest-QmYmc98q.d.ts → manifest-CpmJIEt7.d.ts} +1 -1
- package/dist/{manifest-C5LxShda.d.ts → manifest-Cqv6c1KN.d.ts} +1 -1
- package/dist/{manifest-CZoRtSvn.d.ts → manifest-CtUKrkx1.d.ts} +1 -1
- package/dist/{manifest-BGmmK9bZ.d.ts → manifest-D1FPczc-.d.ts} +1 -1
- package/dist/{manifest-RitquXSE.d.ts → manifest-D43yma-v.d.ts} +1 -1
- package/dist/{manifest-BMcuCUre.d.ts → manifest-DAF4J0gk.d.ts} +1 -1
- package/dist/{manifest-BgmY9fuz.d.ts → manifest-DGoI006V.d.ts} +1 -1
- package/dist/{manifest-ByNpLQWh.d.ts → manifest-DHN6WiIJ.d.ts} +1 -1
- package/dist/{manifest-BYv5BqtY.d.ts → manifest-DIl_cNua.d.ts} +1 -1
- package/dist/{manifest-CjzlsilW.d.ts → manifest-DJhjOnvk.d.ts} +1 -1
- package/dist/{manifest-CvncELVO.d.ts → manifest-DMhuQgOx.d.ts} +1 -1
- package/dist/{manifest-Fapf4NdA.d.ts → manifest-DQkz9UVy.d.ts} +1 -1
- package/dist/{manifest-BA-urVob.d.ts → manifest-DUZUtWBi.d.ts} +1 -1
- package/dist/{manifest-Dp92U_iP.d.ts → manifest-DY2KtVcD.d.ts} +1 -1
- package/dist/{manifest-CXYg8gzt.d.ts → manifest-DaB1w2xo.d.ts} +1 -1
- package/dist/{manifest-C8PUzse6.d.ts → manifest-DpXgCZEd.d.ts} +1 -1
- package/dist/{manifest-ra7MSo-3.d.ts → manifest-Dqf2Uw17.d.ts} +1 -1
- package/dist/{manifest-D5aZyD1b.js → manifest-OxHBbWrs.js} +1 -1
- package/dist/{manifest-r6DHrB4Q.d.ts → manifest-Utivc7Qa.d.ts} +1 -1
- package/dist/{manifest-CWwdLMT0.d.ts → manifest-WJ-UHuEx.d.ts} +1 -1
- package/dist/{manifest-CIVhJzKF.d.ts → manifest-WpIMAJCT.d.ts} +1 -1
- package/dist/{manifest-Ch08RUKa.d.ts → manifest-at0NS8cT.d.ts} +1 -1
- package/dist/{manifest-Dvm2mwFy.d.ts → manifest-d7vR6coE.d.ts} +2 -2
- package/dist/{manifest-TvLJWs_L.d.ts → manifest-gl856Z9G.d.ts} +1 -1
- package/dist/{manifest--_00y416.d.ts → manifest-iGmnzfGD.d.ts} +1 -1
- package/dist/{manifest-D_wBteR5.d.ts → manifest-j4_V-qhA.d.ts} +1 -1
- package/dist/{manifest-CLukD6aB.d.ts → manifest-mAxLRfeu.d.ts} +1 -1
- package/dist/{manifest-DofXV9lE.d.ts → manifest-mBKFNynL.d.ts} +1 -1
- package/dist/{manifest-wbs2VkcB.d.ts → manifest-wPIH-Oo7.d.ts} +1 -1
- package/dist/{manifest-Djy3wcSo.js → manifest-waO9DHVc.js} +1 -0
- package/dist/mapper/bin.js +5 -5
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/sdk/index.d.ts +2 -2
- package/dist/mcp/sdk/index.js +1 -1
- package/dist/{mcp-aMq1fkoe.js → mcp-mSD-ic9W.js} +3 -3
- package/dist/next/index.d.ts +12 -12
- package/dist/next/index.js +10 -5
- package/dist/next/proxy/index.d.ts +3 -3
- package/dist/{operations-nnC3pvwn.d.ts → operations-dIOdHqYz.d.ts} +1 -1
- package/dist/orpc/index.d.ts +4 -4
- package/dist/orpc/index.js +2 -2
- package/dist/otel/index.js +5 -5
- package/dist/{permissions-ZLtxCurD.d.ts → permissions-DG0t2lrA.d.ts} +1 -1
- package/dist/{ports-CfVACwW_.d.ts → ports-CfiOCL2r.d.ts} +1 -1
- package/dist/{ports-DfDzwMCR.js → ports-DR88RF0N.js} +2 -2
- package/dist/powersync/index.d.ts +3 -3
- package/dist/powersync/index.js +1 -1
- package/dist/preset/index.d.ts +4 -4
- package/dist/{preview-BoJkQw2E.d.ts → preview-3nes4WG4.d.ts} +2 -2
- package/dist/{project-DI09JnXz.js → project-CXcoauzs.js} +2 -2
- package/dist/{push-token-Rv1CxW_N.d.ts → push-token-CRBieazN.d.ts} +1 -1
- package/dist/query/index.d.ts +1 -1
- package/dist/react/index.d.ts +5 -5
- package/dist/react/native/index.d.ts +1 -1
- package/dist/react/server.d.ts +6 -6
- package/dist/react-router/index.d.ts +3 -3
- package/dist/react-router/index.js +3 -3
- package/dist/{read-set-BptYceHc.js → read-set-DfScfSsf.js} +3 -2
- package/dist/realtime/index.d.ts +3 -3
- package/dist/{record-form-BHUYs5ju.d.ts → record-form-BggNAKZA.d.ts} +1 -1
- package/dist/records/index.d.ts +7 -7
- package/dist/{resource-execute-Bb-zKYUc.d.ts → resource-execute-BIqAzA57.d.ts} +1 -1
- package/dist/{resource-types-C8kdoZ-J.d.ts → resource-types-DcEe07vC.d.ts} +1 -1
- package/dist/{resources-B9dfA1jH.d.ts → resources-Bb_JRadM.d.ts} +1 -1
- package/dist/{sales-D_yZoFUU.js → sales-CIe7dE4J.js} +1 -1
- package/dist/server/account/index.d.ts +2 -2
- package/dist/server/accounts/index.d.ts +1 -1
- package/dist/server/index.d.ts +12 -12
- package/dist/server/index.js +4 -4
- package/dist/{server-Bgugpk3A.js → server-DA5SRGHQ.js} +2 -2
- package/dist/{server-types-C8zErBy9.d.ts → server-types-Cp2en4rP.d.ts} +2 -2
- package/dist/{session-DRn_URq0.d.ts → session-Bro3jmnu.d.ts} +1 -1
- package/dist/{sign-in-Dp-X2YXo.d.ts → sign-in-Cj7Y0mSU.d.ts} +11 -11
- package/dist/solid/index.d.ts +6 -6
- package/dist/solid-start/index.d.ts +3 -3
- package/dist/solid-start/index.js +3 -3
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +2 -2
- package/dist/sql/index.d.ts +5 -5
- package/dist/sql/index.js +1 -1
- package/dist/{sql-BqOBYRvI.js → sql-BwfPwN8v.js} +304 -95
- package/dist/sqlite/index.d.ts +1 -1
- package/dist/sqlite/index.js +1 -1
- package/dist/ssr/index.d.ts +1 -1
- package/dist/svelte/index.d.ts +6 -6
- package/dist/sveltekit/index.d.ts +4 -4
- package/dist/sveltekit/index.js +3 -3
- package/dist/{tags-Bh4zXrnl.d.ts → tags-C7NyJTdU.d.ts} +1 -1
- package/dist/tanstack-db/index.d.ts +1 -1
- package/dist/tanstack-start/index.d.ts +3 -3
- package/dist/tanstack-start/index.js +3 -3
- package/dist/{tenant-BQaG8Hma.d.ts → tenant-BFABaxQ5.d.ts} +1 -1
- package/dist/testing/index.d.ts +9 -9
- package/dist/testing/index.js +4 -4
- package/dist/{timeline-D7T-qrKN.d.ts → timeline-0a7kclhg.d.ts} +3 -3
- package/dist/{topic-R7kIJ_xI.d.ts → topic-BH4L7H8n.d.ts} +2 -2
- package/dist/{types-BE6BvLv2.d.ts → types-BMLgTFzf.d.ts} +2 -2
- package/dist/{verify-BfcOHiUP.d.ts → verify-tK2F49Gn.d.ts} +1 -1
- package/dist/{version-CkYT3KbT.js → version-BHgdHcZN.js} +1 -1
- package/dist/vue/index.d.ts +6 -6
- package/dist/{watch-topic-D18gT7-K.d.ts → watch-topic-BYfSlldk.d.ts} +1 -1
- package/dist/webmcp/index.d.ts +1 -1
- package/dist/webmcp/index.js +1 -1
- package/dist/yjs/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/cli/add-C04PIE9H.js +0 -1
- package/dist/cli/powersync-DnKUA1tu.js +0 -1
- package/dist/cli/round-trips-n_Dk1iUI.js +0 -54
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as subjectFromTag, l as stdinDatabaseUrl, n as databaseUrl, u as withTableTags } from "./config-DD_MnPRL.js";
|
|
2
|
-
import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-
|
|
2
|
+
import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-DAYxPQ18.js";
|
|
3
3
|
import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-BlYLJPzM.js";
|
|
4
4
|
import { a as list, m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
|
|
5
5
|
import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
|
|
@@ -7,36 +7,35 @@ import { c as insideRoot, i as changeLines, r as applyPlan } from "./files-NnXna
|
|
|
7
7
|
import { a as sameText, t as display } from "./io-CngfGyMA.js";
|
|
8
8
|
import { t as connect } from "./db-B_xr3ZvK.js";
|
|
9
9
|
import { t as byCodePoint } from "./compare-yl4sSwVn.js";
|
|
10
|
-
import { C as dataFiles, D as sourceFiles, E as seedFiles, H as installedVersion, O as sqlFiles, S as ENV_FILES, T as readText, U as peerVersions, W as satisfies, _ as liteDriverOf, a as moduleLayoutFor, d as loadSnapshot, f as managementTarget, g as snapshotFile, i as migrationsDir, j as MetadataRejectedError, p as openSource, r as blockDeclaredTables, u as writtenByBlocks, v as isSqliteLiteDriver, w as functionFiles } from "./sql-layout-
|
|
11
|
-
import { i as request } from "./source-
|
|
10
|
+
import { C as dataFiles, D as sourceFiles, E as seedFiles, H as installedVersion, O as sqlFiles, S as ENV_FILES, T as readText, U as peerVersions, W as satisfies, _ as liteDriverOf, a as moduleLayoutFor, d as loadSnapshot, f as managementTarget, g as snapshotFile, i as migrationsDir, j as MetadataRejectedError, p as openSource, r as blockDeclaredTables, u as writtenByBlocks, v as isSqliteLiteDriver, w as functionFiles } from "./sql-layout-Bl3iOXMS.js";
|
|
11
|
+
import { i as request } from "./source-DdqeWoO4.js";
|
|
12
12
|
import { a as findRepoRoot, c as httpHooks, d as readSupabaseToml, h as tomlGet, i as diffEngine, l as migrationCommand, n as declarativeSchemasDir, p as sqlWorkflow, u as pgFunctionHooks } from "./supabase-toml-B6-eEV5p.js";
|
|
13
13
|
import { r as supabaseCli } from "./exec-DBgtTCHK.js";
|
|
14
14
|
import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
|
|
15
|
-
import { _ as BLOCK_PREFIX, a as METADATA_GAPS_TEXT, b as splinterTables, c as entitlementsModule, d as appliesTo, f as escape$7, g as withoutStrings, h as policyHelpers, l as COMMANDS$2, m as functionObject, p as functionBody, s as AUTHORIZATION_RULES, u as RLS_RULES, v as blockTargets, y as advisorRule } from "./run-
|
|
16
|
-
import { r as renderFiles } from "./render-
|
|
17
|
-
import { l as schemaModulePath, m as configFor, p as notNullTag } from "./emit-
|
|
15
|
+
import { _ as BLOCK_PREFIX, a as METADATA_GAPS_TEXT, b as splinterTables, c as entitlementsModule, d as appliesTo, f as escape$7, g as withoutStrings, h as policyHelpers, l as COMMANDS$2, m as functionObject, p as functionBody, s as AUTHORIZATION_RULES, u as RLS_RULES, v as blockTargets, y as advisorRule } from "./run-D_z9ULO7.js";
|
|
16
|
+
import { r as renderFiles } from "./render-3J7sk_CL.js";
|
|
17
|
+
import { l as schemaModulePath, m as configFor, p as notNullTag } from "./emit-CICey-Za.js";
|
|
18
18
|
import { t as orphanedBlockFiles } from "./orphans-ByB0gKOp.js";
|
|
19
|
-
import { a as renameArguments, s as tenantEntries, t as NAMING_RENAMES } from "./codemod-naming-
|
|
19
|
+
import { a as renameArguments, s as tenantEntries, t as NAMING_RENAMES } from "./codemod-naming-CHIeOTt5.js";
|
|
20
20
|
import { t as isRecord$1 } from "./guards-DxwRG0Uv.js";
|
|
21
|
-
import { i as appViewsOf, n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-
|
|
22
|
-
import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-
|
|
23
|
-
import { n as renderBlocksCached } from "./render-cache-
|
|
24
|
-
import { a as lineOf, c as qualified, i as exposedSchemas, l as tableObject, n as deniesAll, o as permissionCatalogKeys, r as exposed, s as policyObject, t as catalogOf, u as workflowOf } from "./shared-
|
|
25
|
-
import { n as staleRenameKeys, t as shadowedBlockColumns } from "./column-renames-
|
|
26
|
-
import { a as reservedRoles, i as statementsView, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-
|
|
21
|
+
import { i as appViewsOf, n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-C4shCkBv.js";
|
|
22
|
+
import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-DXI95fqs.js";
|
|
23
|
+
import { n as renderBlocksCached } from "./render-cache-P4gQeivH.js";
|
|
24
|
+
import { a as lineOf, c as qualified, i as exposedSchemas, l as tableObject, n as deniesAll, o as permissionCatalogKeys, r as exposed, s as policyObject, t as catalogOf, u as workflowOf } from "./shared-d021xfdn.js";
|
|
25
|
+
import { n as staleRenameKeys, t as shadowedBlockColumns } from "./column-renames-4OHEvCAj.js";
|
|
26
|
+
import { a as reservedRoles, i as statementsView, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-Ce8vdcCn.js";
|
|
27
27
|
import { t as projectionsOf } from "./projection-DlVB5YL-.js";
|
|
28
28
|
import { s as providerLabel } from "./authorization-CNWhpdKb.js";
|
|
29
|
-
import { t as VERSION$1 } from "./version-
|
|
29
|
+
import { t as VERSION$1 } from "./version-Bd3kCDzL.js";
|
|
30
30
|
import { t as PROCESS_ENV } from "./env-CQ831uY0.js";
|
|
31
31
|
import { a as stackEnvValues, i as redactValue, o as staleVariables, t as PREFIX_NAMES } from "./stack-env-CtkfVXsR.js";
|
|
32
32
|
import { n as readStackStatus } from "./stack-status-rNPCacin.js";
|
|
33
|
-
import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-
|
|
34
|
-
import {
|
|
33
|
+
import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-C1Ysrthi.js";
|
|
34
|
+
import { a as OPEN, c as functionsIn, i as CLOSE, l as statementEnd, n as ROUND_TRIP_RULES, o as closeOf, s as codeOnly, u as targetKeys } from "./round-trips-BHfeIu6I.js";
|
|
35
35
|
import { n as PLATFORM_SCHEMAS } from "./in-stack-diff-3e1LT1bn.js";
|
|
36
|
-
import { n as ROUND_TRIP_RULES } from "./round-trips-n_Dk1iUI.js";
|
|
37
36
|
import { a as readSharedMemory, n as listStacks, t as branchName } from "./stacks-Eu6d45F8.js";
|
|
38
37
|
import { i as plain$2 } from "./style-B5-nByxb.js";
|
|
39
|
-
import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-
|
|
38
|
+
import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-DqrbS0sS.js";
|
|
40
39
|
import { t as compiledReadSets } from "./read-sets-77o7SxpK.js";
|
|
41
40
|
import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-yU6N6JLm.js";
|
|
42
41
|
import { existsSync } from "node:fs";
|
|
@@ -1213,7 +1212,7 @@ const AUTH_USER_RULES = [{
|
|
|
1213
1212
|
})))
|
|
1214
1213
|
}];
|
|
1215
1214
|
// src/cli/doctor/projections.ts
|
|
1216
|
-
const HELPER_CALL = new RegExp(String.raw`\b(${[
|
|
1215
|
+
const HELPER_CALL$1 = new RegExp(String.raw`\b(${[
|
|
1217
1216
|
"createNativeClient",
|
|
1218
1217
|
"powersyncEngine",
|
|
1219
1218
|
"attachmentQueueRoute",
|
|
@@ -1274,7 +1273,7 @@ const PROJECTION_RULES = [{
|
|
|
1274
1273
|
check(context) {
|
|
1275
1274
|
const projections = projectedBlockTables(context);
|
|
1276
1275
|
if (projections.length === 0) return [];
|
|
1277
|
-
return context.sources.flatMap((file) => [...file.text.matchAll(HELPER_CALL)].flatMap((call) => {
|
|
1276
|
+
return context.sources.flatMap((file) => [...file.text.matchAll(HELPER_CALL$1)].flatMap((call) => {
|
|
1278
1277
|
const args = argumentsOf(file.text, call.index + call[0].length - 1);
|
|
1279
1278
|
return projections.flatMap(({ base, view }) => {
|
|
1280
1279
|
const name = base.slice(base.indexOf(".") + 1);
|
|
@@ -3845,64 +3844,36 @@ const SERVICE_WRITE = /(?<![\w$])([\w$]+)\s*\.\s*([a-z][\w$]*)\s*\(/g;
|
|
|
3845
3844
|
const SERVICE_NAME = /(?:services?|repositor(?:y|ies)|repos?|queries|readers?)$/i;
|
|
3846
3845
|
const SERVICE_FACTORY = /(?:const|let)\s+(\{[^}]*\}|[\w$]+)\s*=\s*(?:await\s+)?create[\w$]*(?:Services?|Repositor(?:y|ies)|Repos?)\s*\(/g;
|
|
3847
3846
|
/** A block method or a local function whose name says it writes. */
|
|
3848
|
-
const WRITE_NAME = /^(?:create|insert|update|upsert|delete|remove|set|add|save|send|enqueue|record|mark|approve|reject|cancel|archive|restore|move|assign|unassign|post|submit|publish|attach|detach|link|unlink|invite|revoke|grant|start|stop|complete|close|open|lock|unlock|apply|import|sync|refresh|recompute|merge|reorder|rename|toggle|track|emit|notify|write|put|patch|claim|release|issue|void|pay|charge|refund|transfer|book|confirm|accept|decline|resolve|reopen|pin|unpin|join|leave|subscribe|unsubscribe|upload|clear|reset|seed|ensure|process|run|execute|handle|dispatch|schedule|retry|replace|increment|decrement|bump|touch|finalize|commit|enable|disable|activate|deactivate|generate|log|accrue)(?:[A-Z_\d]|$)/;
|
|
3847
|
+
const WRITE_NAME = /^(?:create|insert|update|upsert|delete|remove|set|add|save|send|enqueue|record|mark|approve|reject|cancel|archive|restore|move|assign|unassign|post|submit|publish|attach|detach|link|unlink|invite|revoke|grant|start|stop|complete|close|open|lock|unlock|apply|import|sync|refresh|recompute|merge|reorder|rename|toggle|track|emit|notify|write|put|patch|claim|release|issue|void|pay|charge|refund|transfer|book|confirm|accept|decline|resolve|reopen|pin|unpin|join|leave|subscribe|unsubscribe|upload|clear|reset|seed|ensure|process|run|execute|handle|dispatch|schedule|retry|replace|increment|decrement|bump|touch|finalize|commit|enable|disable|activate|deactivate|generate|log|accrue|decide|escalate|expire|deliver|broadcast|transition|advance|convert|clone|duplicate|copy|share|sign|invalidate|revalidate)(?:[A-Z_\d]|$)/;
|
|
3849
3848
|
const REPOSITORY_WRITE = new RegExp(String.raw`${DB}\s*\.\s*[A-Za-z_][\w$]*\s*\.\s*(?:create|update|upsert|delete)\s*\(|\.\s*from\s*\([\w$.\s]*\)\s*\.\s*(?:insert|update|upsert|delete)\s*\(`);
|
|
3849
|
+
/**
|
|
3850
|
+
* A call whose name says it has a side effect, such as `notifyAgendaUpdated(`
|
|
3851
|
+
* or `events.publish(`: a loop that makes one per item is not a read pattern.
|
|
3852
|
+
*/
|
|
3853
|
+
const SIDE_EFFECT_CALL = /(?<![\w$])(?:notify|publish|send|emit|enqueue|dispatch|broadcast|deliver|revalidate)(?:[A-Z_][\w$]*)?\s*\(/g;
|
|
3854
|
+
/** A parameter or field typed as a service: `customers: CustomersService`. */
|
|
3855
|
+
const SERVICE_TYPED = /(?<![\w$.])([\w$]+)\s*\??\s*:\s*(?:Readonly<\s*)?[\w$.]*(?:Services?|Repositor(?:y|ies)|Repos?|Queries)\b(?!\s*[<[.])/g;
|
|
3856
|
+
/**
|
|
3857
|
+
* A helper that runs a callback per item: `mapInChunks(ids, 20, async (id) =>
|
|
3858
|
+
* ...)`, `pMap(ids, (id) => ...)`.
|
|
3859
|
+
*/
|
|
3860
|
+
const HELPER_CALL = /(?<![\w$.])(?<!new\s+)([A-Za-z_$][\w$]*)\s*(?:<[^>()]*>)?\s*\(/g;
|
|
3861
|
+
const HELPER_NAME = /map|each|chunk|batch|concurren|parallel|limit/i;
|
|
3862
|
+
/** Filters an `in` list can't batch: text search and JSON containment. */
|
|
3863
|
+
const SEARCH_FILTER = /(?<![\w$])(contains|containedBy|ilike|iLike|like|startsWith|endsWith|search|q|query|textSearch|match|fts)\s*([:(])/g;
|
|
3850
3864
|
const LOCAL_FUNCTION = /(?:function\s*\*?\s*([\w$]+)\s*(?:<[^>]*>)?\s*\(|(?:const|let)\s+([\w$]+)\s*(?::[^=]+)?=\s*(?:async\s+)?(?:function\b[^(]*\(|\(|[\w$]+\s*=>))/g;
|
|
3865
|
+
const WAVE = /\bPromise\.all\s*\(\s*\[/g;
|
|
3851
3866
|
const LOOP = /(?<![\w$.])for\s*(?:await\s*)?\(/g;
|
|
3852
3867
|
const CALLBACK = /\.\s*(?:map|flatMap|forEach)\s*\(/g;
|
|
3853
3868
|
const DECLARATION = /(?<![\w$.])(?:const|let|var)\s+([\w$]+|\{[^=;]*?\}|\[[^=;]*?\])\s*(?::[^=;]+)?=(?!=|>)/g;
|
|
3854
3869
|
/**
|
|
3855
|
-
*
|
|
3856
|
-
* of chunks)`, `for (const attempt of attempts)`.
|
|
3870
|
+
* Loop variables that are already batches, or retries of one read: `for (const
|
|
3871
|
+
* chunk of chunks)`, `for (const attempt of attempts)`. `chunk.map((id) =>
|
|
3872
|
+
* ...)` still runs once per item.
|
|
3857
3873
|
*/
|
|
3858
3874
|
const BATCHES = /chunk|batch|attempt|retr/i;
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
"[",
|
|
3862
|
-
"{"
|
|
3863
|
-
]);
|
|
3864
|
-
const CLOSE = /* @__PURE__ */ new Set([
|
|
3865
|
-
")",
|
|
3866
|
-
"]",
|
|
3867
|
-
"}"
|
|
3868
|
-
]);
|
|
3869
|
-
/** `text` with strings, template literals and comments blanked, offsets kept. */
|
|
3870
|
-
function codeOnly(text) {
|
|
3871
|
-
let out = "";
|
|
3872
|
-
let last = 0;
|
|
3873
|
-
const blank = (part) => part.replaceAll(/[^\n]/g, " ");
|
|
3874
|
-
for (const [start, end] of codeRanges(text)) {
|
|
3875
|
-
out += blank(text.slice(last, start)) + text.slice(start, end);
|
|
3876
|
-
last = end;
|
|
3877
|
-
}
|
|
3878
|
-
return out + blank(text.slice(last));
|
|
3879
|
-
}
|
|
3880
|
-
/** The index of the bracket that closes the one at `open`. */
|
|
3881
|
-
function closeOf(code, open) {
|
|
3882
|
-
let depth = 0;
|
|
3883
|
-
for (let index = open; index < code.length; index += 1) {
|
|
3884
|
-
const char = code.charAt(index);
|
|
3885
|
-
if (OPEN.has(char)) depth += 1;
|
|
3886
|
-
else if (CLOSE.has(char)) {
|
|
3887
|
-
depth -= 1;
|
|
3888
|
-
if (depth === 0) return index;
|
|
3889
|
-
}
|
|
3890
|
-
}
|
|
3891
|
-
return code.length;
|
|
3892
|
-
}
|
|
3893
|
-
/** The end of the statement or expression that starts at `from`. */
|
|
3894
|
-
function statementEnd(code, from) {
|
|
3895
|
-
let depth = 0;
|
|
3896
|
-
for (let index = from; index < code.length; index += 1) {
|
|
3897
|
-
const char = code.charAt(index);
|
|
3898
|
-
if (OPEN.has(char)) depth += 1;
|
|
3899
|
-
else if (CLOSE.has(char)) {
|
|
3900
|
-
if (depth === 0) return index;
|
|
3901
|
-
depth -= 1;
|
|
3902
|
-
} else if ((char === ";" || char === ",") && depth === 0) return index;
|
|
3903
|
-
}
|
|
3904
|
-
return code.length;
|
|
3905
|
-
}
|
|
3875
|
+
/** Iterables of batches or retries, whatever the loop variable is called. */
|
|
3876
|
+
const BATCH_ITEMS = /(?:chunks|batches)\b|chunked|attempt|retr/i;
|
|
3906
3877
|
/** The names a binding pattern declares: `x`, `{ a, b: c }`, `[d, ...e]`. */
|
|
3907
3878
|
function boundNames(pattern) {
|
|
3908
3879
|
const trimmed = pattern.trim();
|
|
@@ -3950,7 +3921,8 @@ const tableKey$1 = (name) => name.toLowerCase().replaceAll("_", "");
|
|
|
3950
3921
|
const rpcName = (text, open) => /^\s*["'`]([\w.]+)/.exec(text.slice(open + 1))?.[1]?.split(".").at(-1);
|
|
3951
3922
|
/**
|
|
3952
3923
|
* Offsets of calls that write: repository and supabase-js writes, RPCs, block
|
|
3953
|
-
* methods and service methods named for a write.
|
|
3924
|
+
* methods and service methods named for a write (`services.agenda.assignTask`
|
|
3925
|
+
* too), and calls named for a side effect such as `notify...` or `publish...`.
|
|
3954
3926
|
*/
|
|
3955
3927
|
function writesIn(text, code, services) {
|
|
3956
3928
|
const writes = [...code.matchAll(new RegExp(REPOSITORY_WRITE, "g"))].map((match) => match.index);
|
|
@@ -3959,7 +3931,11 @@ function writesIn(text, code, services) {
|
|
|
3959
3931
|
if (name !== void 0 && WRITE_NAME.test(camel$1(name))) writes.push(match.index);
|
|
3960
3932
|
}
|
|
3961
3933
|
for (const match of code.matchAll(BLOCK_CALL)) if (WRITE_NAME.test(match[1])) writes.push(match.index);
|
|
3962
|
-
for (const match of code.matchAll(SERVICE_WRITE))
|
|
3934
|
+
for (const match of code.matchAll(SERVICE_WRITE)) {
|
|
3935
|
+
const owner = /([\w$]+)\s*\.\s*$/.exec(code.slice(Math.max(0, match.index - 200), match.index))?.[1];
|
|
3936
|
+
if ((isService(match[1], services) || owner !== void 0 && isService(owner, services)) && WRITE_NAME.test(match[2])) writes.push(match.index);
|
|
3937
|
+
}
|
|
3938
|
+
for (const match of code.matchAll(SIDE_EFFECT_CALL)) writes.push(match.index);
|
|
3963
3939
|
return writes;
|
|
3964
3940
|
}
|
|
3965
3941
|
/** Reads by the database client itself, before following local functions. */
|
|
@@ -3980,6 +3956,7 @@ function directReads(text, code) {
|
|
|
3980
3956
|
open,
|
|
3981
3957
|
close,
|
|
3982
3958
|
call,
|
|
3959
|
+
callee: call,
|
|
3983
3960
|
kind,
|
|
3984
3961
|
...table === void 0 ? {} : { table },
|
|
3985
3962
|
...method === void 0 ? {} : { method }
|
|
@@ -4047,6 +4024,7 @@ function callsOf(code, name) {
|
|
|
4047
4024
|
function serviceNames(code) {
|
|
4048
4025
|
const services = /* @__PURE__ */ new Set();
|
|
4049
4026
|
for (const match of code.matchAll(SERVICE_FACTORY)) for (const name of boundNames(match[1])) services.add(name);
|
|
4027
|
+
for (const match of code.matchAll(SERVICE_TYPED)) services.add(match[1]);
|
|
4050
4028
|
return services;
|
|
4051
4029
|
}
|
|
4052
4030
|
const isService = (receiver, services) => services.has(receiver) || SERVICE_NAME.test(receiver);
|
|
@@ -4061,6 +4039,7 @@ function readsIn(text, code, services) {
|
|
|
4061
4039
|
open,
|
|
4062
4040
|
close: closeOf(code, open),
|
|
4063
4041
|
call: `${name} (which calls ${read.call})`,
|
|
4042
|
+
callee: name,
|
|
4064
4043
|
kind: "other"
|
|
4065
4044
|
});
|
|
4066
4045
|
}
|
|
@@ -4073,6 +4052,7 @@ function readsIn(text, code, services) {
|
|
|
4073
4052
|
open,
|
|
4074
4053
|
close: closeOf(code, open),
|
|
4075
4054
|
call: `${receiver}.${match[2]}`,
|
|
4055
|
+
callee: `${receiver}.${match[2]}`,
|
|
4076
4056
|
kind: "other"
|
|
4077
4057
|
});
|
|
4078
4058
|
}
|
|
@@ -4115,28 +4095,54 @@ function scopesIn(code) {
|
|
|
4115
4095
|
for (const match of code.matchAll(CALLBACK)) {
|
|
4116
4096
|
const open = match.index + match[0].length - 1;
|
|
4117
4097
|
const close = closeOf(code, open);
|
|
4118
|
-
const callback =
|
|
4119
|
-
if (
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
if (callback[1] === void 0) {
|
|
4123
|
-
const params = open + callback[0].length;
|
|
4124
|
-
const paramsEnd = closeOf(code, params);
|
|
4125
|
-
names = parameterNames(code.slice(params + 1, paramsEnd));
|
|
4126
|
-
start = paramsEnd + 1;
|
|
4127
|
-
} else {
|
|
4128
|
-
names = [callback[1]];
|
|
4129
|
-
start = open + 1 + callback[0].length;
|
|
4130
|
-
}
|
|
4131
|
-
scopes.push({
|
|
4132
|
-
start,
|
|
4133
|
-
end: close,
|
|
4134
|
-
items: compact(receiverBefore(code, match.index)),
|
|
4135
|
-
names
|
|
4098
|
+
const callback = callbackAt(code, open + 1, close);
|
|
4099
|
+
if (callback) scopes.push({
|
|
4100
|
+
...callback,
|
|
4101
|
+
items: compact(receiverBefore(code, match.index))
|
|
4136
4102
|
});
|
|
4137
4103
|
}
|
|
4104
|
+
for (const match of code.matchAll(HELPER_CALL)) {
|
|
4105
|
+
const name = match[1];
|
|
4106
|
+
if (!HELPER_NAME.test(name) || /^(?:Map|WeakMap|function)$/.test(name) || /(?:function\s*\*?\s*|async\s+)$/.test(code.slice(Math.max(0, match.index - 40), match.index))) continue;
|
|
4107
|
+
const open = match.index + match[0].length - 1;
|
|
4108
|
+
const close = closeOf(code, open);
|
|
4109
|
+
const args = splitTop(code.slice(open + 1, close));
|
|
4110
|
+
let from = open + 1 + args[0].length + 1;
|
|
4111
|
+
for (const arg of args.slice(1)) {
|
|
4112
|
+
const callback = callbackAt(code, from, from + arg.length);
|
|
4113
|
+
if (callback) {
|
|
4114
|
+
scopes.push({
|
|
4115
|
+
...callback,
|
|
4116
|
+
items: compact(args[0])
|
|
4117
|
+
});
|
|
4118
|
+
break;
|
|
4119
|
+
}
|
|
4120
|
+
from += arg.length + 1;
|
|
4121
|
+
}
|
|
4122
|
+
}
|
|
4138
4123
|
return scopes.toSorted((a, b) => a.end - a.start - (b.end - b.start));
|
|
4139
4124
|
}
|
|
4125
|
+
/**
|
|
4126
|
+
* The parameters and body of a function written at `from` (`async (a, b) =>
|
|
4127
|
+
* ...`, `x => ...`, `function (x) {...}`), ending at `end`.
|
|
4128
|
+
*/
|
|
4129
|
+
function callbackAt(code, from, end) {
|
|
4130
|
+
const callback = /^\s*(?:async\s+)?(?:function\s*[\w$]*\s*\(|\(|([\w$]+)\s*=>)/.exec(code.slice(from, end));
|
|
4131
|
+
if (!callback) return;
|
|
4132
|
+
if (callback[1] !== void 0) return {
|
|
4133
|
+
start: from + callback[0].length,
|
|
4134
|
+
end,
|
|
4135
|
+
names: [callback[1]]
|
|
4136
|
+
};
|
|
4137
|
+
const params = from + callback[0].length - 1;
|
|
4138
|
+
const paramsEnd = closeOf(code, params);
|
|
4139
|
+
if (!callback[0].includes("function") && !/^\s*(?::[^=;{]+)?=>/.test(code.slice(paramsEnd + 1, end))) return;
|
|
4140
|
+
return {
|
|
4141
|
+
start: paramsEnd + 1,
|
|
4142
|
+
end,
|
|
4143
|
+
names: parameterNames(code.slice(params + 1, paramsEnd))
|
|
4144
|
+
};
|
|
4145
|
+
}
|
|
4140
4146
|
/** Names in `scope` that hold the loop variable, or something derived from it. */
|
|
4141
4147
|
function scopeNames(code, scope) {
|
|
4142
4148
|
const names = [...scope.names];
|
|
@@ -4251,7 +4257,7 @@ function lines$1(text) {
|
|
|
4251
4257
|
* filters on the column it references, `notes` when `inner` holds the key and
|
|
4252
4258
|
* `args` filters on it.
|
|
4253
4259
|
*/
|
|
4254
|
-
function relationTo(snapshot, outer, inner, args) {
|
|
4260
|
+
function relationTo(snapshot, outer, inner, args, via) {
|
|
4255
4261
|
const table = inner.table;
|
|
4256
4262
|
if (table === void 0 || tableKey$1(outer) === tableKey$1(table)) return;
|
|
4257
4263
|
const camelCase = /[A-Z]/.test(outer + table);
|
|
@@ -4277,11 +4283,64 @@ function relationTo(snapshot, outer, inner, args) {
|
|
|
4277
4283
|
many: true
|
|
4278
4284
|
});
|
|
4279
4285
|
}
|
|
4280
|
-
return candidates[0];
|
|
4286
|
+
if (candidates.length > 0 || via === void 0) return candidates[0];
|
|
4287
|
+
return throughRelation(snapshot, outer, table, args, via, name);
|
|
4288
|
+
}
|
|
4289
|
+
/**
|
|
4290
|
+
* Two tables that both reference a third, such as `quote_tasks` and
|
|
4291
|
+
* `invoice_tasks` through `tasks`, when the inner read filters its key column
|
|
4292
|
+
* by the outer rows (`taskId: { in: taskIds }`): `include: { task: { include: {
|
|
4293
|
+
* invoiceTasks: true } } }` on the outer read.
|
|
4294
|
+
*/
|
|
4295
|
+
function throughRelation(snapshot, outer, inner, args, via, name) {
|
|
4296
|
+
const relationships = snapshot.generator.relationships;
|
|
4297
|
+
const shared = new Set(relationships.flatMap((relation) => relation.columns.slice(1)));
|
|
4298
|
+
for (const hop of relationships) {
|
|
4299
|
+
const [hopColumn] = hop.columns;
|
|
4300
|
+
const middle = tableKey$1(hop.referenced_relation);
|
|
4301
|
+
if (hopColumn === void 0 || shared.has(hopColumn) || hop.referenced_schema !== hop.schema || tableKey$1(hop.relation) !== tableKey$1(outer) || middle === tableKey$1(inner) || middle === tableKey$1(outer)) continue;
|
|
4302
|
+
for (const back of relationships) {
|
|
4303
|
+
const [column] = back.columns;
|
|
4304
|
+
if (column !== void 0 && back.schema === hop.schema && back.referenced_schema === hop.schema && tableKey$1(back.relation) === tableKey$1(inner) && tableKey$1(back.referenced_relation) === middle && back.referenced_columns[0] === hop.referenced_columns[0] && filterMentions(args, column, via)) return {
|
|
4305
|
+
name: name(back.relation),
|
|
4306
|
+
many: true,
|
|
4307
|
+
through: name(hopColumn.replace(/_id$/, ""))
|
|
4308
|
+
};
|
|
4309
|
+
}
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
/** Whether the filter on `column` (`taskId: { in: taskIds }`) uses `name`. */
|
|
4313
|
+
function filterMentions(args, column, name) {
|
|
4314
|
+
const key = new RegExp(String.raw`(?<![\w$])(?:${column}|${camel$1(column)})\s*:`, "g");
|
|
4315
|
+
for (const match of args.matchAll(key)) {
|
|
4316
|
+
const from = match.index + match[0].length;
|
|
4317
|
+
if (mentions(args.slice(from, statementEnd(args, from)), name)) return true;
|
|
4318
|
+
}
|
|
4319
|
+
return false;
|
|
4281
4320
|
}
|
|
4282
4321
|
/** `include: { quote: true }`, or `_count` for a count of related rows. */
|
|
4283
4322
|
function includeOf(relation, read) {
|
|
4284
|
-
|
|
4323
|
+
const inner = relation.many && read.method === "count" ? `include: { _count: { ${relation.name}: true } }` : `include: { ${relation.name}: true }`;
|
|
4324
|
+
return relation.through === void 0 ? inner : `include: { ${relation.through}: { ${inner} } }`;
|
|
4325
|
+
}
|
|
4326
|
+
/**
|
|
4327
|
+
* How the read matches the loop variable when an `in` list can't: a text search
|
|
4328
|
+
* (`contains: term`, `q: term`, `.ilike(...)`) or JSON containment (`contains:
|
|
4329
|
+
* { nodes: [{ id }] }`).
|
|
4330
|
+
*/
|
|
4331
|
+
function searchMatch(args, names) {
|
|
4332
|
+
for (const match of args.matchAll(SEARCH_FILTER)) {
|
|
4333
|
+
const from = match.index + match[0].length;
|
|
4334
|
+
const value = match[2] === "(" ? args.slice(from, closeOf(args, from - 1)) : args.slice(from, statementEnd(args, from));
|
|
4335
|
+
const name = names.find((candidate) => mentions(value, candidate));
|
|
4336
|
+
if (name !== void 0) return {
|
|
4337
|
+
kind: match[1].startsWith("contain") && /^\s*[[{]/.test(value) ? "json" : "search",
|
|
4338
|
+
name
|
|
4339
|
+
};
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
function searchHint(match) {
|
|
4343
|
+
return match.kind === "json" ? `The read matches \`${match.name}\` inside a JSON column with \`contains\`, which an \`in\` filter can't do. Fold the values into one read with an \`OR\` of the \`contains\` conditions, or call an RPC that takes them as an array and matches with \`@> any (...)\`. When neither fits, accept the finding in the baseline.` : `\`${match.name}\` is a search term, and an \`in\` filter only matches whole values. Fold the terms into one read with an \`OR\` of the conditions (\`where: { OR: terms.map((term) => ({ name: { contains: term } })) }\`), or call an RPC that takes the terms as \`text[]\` and matches with \`ilike any (...)\`. When each term needs its own limit or ranking, no batched form applies: accept the finding in the baseline.`;
|
|
4285
4344
|
}
|
|
4286
4345
|
function batchHint(read) {
|
|
4287
4346
|
switch (read.kind) {
|
|
@@ -4299,7 +4358,7 @@ const batchedOver = (args, name) => new RegExp(String.raw`\bin\s*:\s*(?:\[\s*\.\
|
|
|
4299
4358
|
* not a read pattern to fold into one request.
|
|
4300
4359
|
*/
|
|
4301
4360
|
function skipScope(scope, writes) {
|
|
4302
|
-
return BATCHES.test(scope.items) || scope.items.startsWith("[") && !scope.items.includes("...") || writes.some((at) => at >= scope.start && at < scope.end);
|
|
4361
|
+
return scope.names.some((name) => BATCHES.test(name)) || BATCH_ITEMS.test(scope.items) || scope.items.startsWith("[") && !scope.items.includes("...") || writes.some((at) => at >= scope.start && at < scope.end);
|
|
4303
4362
|
}
|
|
4304
4363
|
/** Both checks share one pass over each file. */
|
|
4305
4364
|
function analyze(file, snapshot) {
|
|
@@ -4321,6 +4380,11 @@ function analyze(file, snapshot) {
|
|
|
4321
4380
|
const lineAt = lines$1(file.text);
|
|
4322
4381
|
const origins = originsIn(file.text, code, reads);
|
|
4323
4382
|
const reported = /* @__PURE__ */ new Set();
|
|
4383
|
+
let keys;
|
|
4384
|
+
const targetOf = (read) => {
|
|
4385
|
+
keys ??= targetKeys(file.path, functionsIn(code), reads);
|
|
4386
|
+
return keys.get(read.start);
|
|
4387
|
+
};
|
|
4324
4388
|
for (const scope of scopesIn(code)) {
|
|
4325
4389
|
if (skipScope(scope, writes)) continue;
|
|
4326
4390
|
const names = scopeNames(code, scope);
|
|
@@ -4332,10 +4396,11 @@ function analyze(file, snapshot) {
|
|
|
4332
4396
|
const root = /^[\w$]+/.exec(scope.items)?.[0];
|
|
4333
4397
|
const outer = origins.findLast((origin) => origin.name === root && scope.start >= origin.from && scope.start < origin.to);
|
|
4334
4398
|
const relation = outer ? relationTo(snapshot, outer.table, read, rawArgs(read)) : void 0;
|
|
4335
|
-
const
|
|
4399
|
+
const search = searchMatch(args, names);
|
|
4400
|
+
const hint = outer && relation ? `${outer.table} and ${read.table} are related: add \`${includeOf(relation, read)}\` to ${outer.call} at line ${String(outer.line)} and drop this read.` : search ? searchHint(search) : batchHint(read);
|
|
4336
4401
|
perItem.push({
|
|
4337
4402
|
message: `${file.path}:${String(line)} calls ${read.call} once per item of \`${scope.items}\`, so n items make n requests (N+1). ${hint}`,
|
|
4338
|
-
target:
|
|
4403
|
+
target: targetOf(read),
|
|
4339
4404
|
location: {
|
|
4340
4405
|
file: file.path,
|
|
4341
4406
|
line
|
|
@@ -4343,20 +4408,28 @@ function analyze(file, snapshot) {
|
|
|
4343
4408
|
});
|
|
4344
4409
|
}
|
|
4345
4410
|
}
|
|
4411
|
+
const waves = [...code.matchAll(WAVE)].map((match) => {
|
|
4412
|
+
const open = match.index + match[0].length - 1;
|
|
4413
|
+
return [open, closeOf(code, open)];
|
|
4414
|
+
});
|
|
4346
4415
|
for (const read of reads) {
|
|
4347
4416
|
if (read.table === void 0 || reported.has(read.start)) continue;
|
|
4348
4417
|
const args = code.slice(read.open + 1, read.close);
|
|
4349
4418
|
const origin = origins.findLast((candidate) => read.start >= candidate.from && read.start < candidate.to && mentions(args, candidate.name));
|
|
4350
|
-
const relation = origin ? relationTo(snapshot, origin.table, read, rawArgs(read)) : void 0;
|
|
4419
|
+
const relation = origin ? relationTo(snapshot, origin.table, read, rawArgs(read), origin.name) : void 0;
|
|
4351
4420
|
if (!origin || !relation) continue;
|
|
4352
4421
|
const line = lineAt(read.start);
|
|
4422
|
+
const include = `\`${includeOf(relation, read)}\``;
|
|
4423
|
+
const wave = waves.find(([open, close]) => read.start > open && read.start < close);
|
|
4424
|
+
const sameWave = wave !== void 0 && reads.some((other) => other !== read && other.start > wave[0] && other.start < wave[1] && (other.start > read.close || other.close < read.start) && mentions(code.slice(other.open + 1, other.close), origin.name));
|
|
4353
4425
|
waterfalls.push({
|
|
4354
|
-
message: `${file.path}:${String(line)} waits for ${origin.call} at line ${String(origin.line)}, then reads ${read.call} filtered by its rows (\`${origin.name}\`). The tables are related: add
|
|
4355
|
-
target:
|
|
4426
|
+
message: sameWave ? `${file.path}:${String(line)} reads ${read.call} filtered by the rows of ${origin.call} at line ${String(origin.line)} (\`${origin.name}\`), in one Promise.all with other reads that wait for the same rows. An include saves a request, not a wait: add ${include} to the first read to drop this one.` : `${file.path}:${String(line)} waits for ${origin.call} at line ${String(origin.line)}, then reads ${read.call} filtered by its rows (\`${origin.name}\`). The tables are related: add ${include} to the first read so one request returns both.`,
|
|
4427
|
+
target: targetOf(read),
|
|
4356
4428
|
location: {
|
|
4357
4429
|
file: file.path,
|
|
4358
4430
|
line
|
|
4359
|
-
}
|
|
4431
|
+
},
|
|
4432
|
+
...sameWave ? { severity: "info" } : {}
|
|
4360
4433
|
});
|
|
4361
4434
|
}
|
|
4362
4435
|
const byLine = (a, b) => (a.location?.line ?? 0) - (b.location?.line ?? 0);
|
|
@@ -4374,6 +4447,38 @@ function analyzeAll(context) {
|
|
|
4374
4447
|
}
|
|
4375
4448
|
return result;
|
|
4376
4449
|
}
|
|
4450
|
+
/**
|
|
4451
|
+
* Checks that read only source files. Without a database or a snapshot they
|
|
4452
|
+
* still run; BS634 and BS635 then lack the foreign keys that name includes.
|
|
4453
|
+
*/
|
|
4454
|
+
const SOURCE_ONLY_CODES = /* @__PURE__ */ new Set([
|
|
4455
|
+
"BS609",
|
|
4456
|
+
"BS634",
|
|
4457
|
+
"BS635"
|
|
4458
|
+
]);
|
|
4459
|
+
/** The snapshot of a run that could not read one: no tables, no foreign keys. */
|
|
4460
|
+
const NO_SNAPSHOT = {
|
|
4461
|
+
version: 2,
|
|
4462
|
+
schemas: [],
|
|
4463
|
+
generator: {
|
|
4464
|
+
version: 1,
|
|
4465
|
+
schemas: [],
|
|
4466
|
+
tables: [],
|
|
4467
|
+
foreignTables: [],
|
|
4468
|
+
views: [],
|
|
4469
|
+
materializedViews: [],
|
|
4470
|
+
columns: [],
|
|
4471
|
+
primaryKeys: [],
|
|
4472
|
+
relationships: [],
|
|
4473
|
+
functions: [],
|
|
4474
|
+
types: []
|
|
4475
|
+
},
|
|
4476
|
+
extras: {
|
|
4477
|
+
tables: [],
|
|
4478
|
+
buckets: [],
|
|
4479
|
+
realtime: []
|
|
4480
|
+
}
|
|
4481
|
+
};
|
|
4377
4482
|
const N_PLUS_ONE_RULES = [{
|
|
4378
4483
|
code: "BS634",
|
|
4379
4484
|
severity: "warning",
|
|
@@ -7613,6 +7718,18 @@ async function runRules(context, rules = RULES) {
|
|
|
7613
7718
|
// src/cli/doctor/baseline.ts
|
|
7614
7719
|
const targetOf = (finding) => finding.target ?? finding.title;
|
|
7615
7720
|
const keyOf = (code, target) => `${code}\u0000${target}`;
|
|
7721
|
+
/**
|
|
7722
|
+
* The `file:line` target BS634 and BS635 wrote before their targets named the
|
|
7723
|
+
* function and the callee; an entry with it still matches the finding.
|
|
7724
|
+
*/
|
|
7725
|
+
const legacyKeyOf = (finding) => finding.location === void 0 ? void 0 : keyOf(finding.code, `${finding.location.file}:${String(finding.location.line)}`);
|
|
7726
|
+
/** The listed key that accepts `finding`: its target, or its old line target. */
|
|
7727
|
+
function listedKey(finding, listed) {
|
|
7728
|
+
const key = keyOf(finding.code, targetOf(finding));
|
|
7729
|
+
if (listed.has(key)) return key;
|
|
7730
|
+
const legacy = legacyKeyOf(finding);
|
|
7731
|
+
return legacy !== void 0 && listed.has(legacy) ? legacy : void 0;
|
|
7732
|
+
}
|
|
7616
7733
|
const text$1 = (value) => typeof value === "string";
|
|
7617
7734
|
/**
|
|
7618
7735
|
* Parses a baseline file, `[{ code, target, reason }]`. Throws a `TypeError`
|
|
@@ -7657,9 +7774,9 @@ function applyBaseline(findings, entries, ran, context, path) {
|
|
|
7657
7774
|
const matched = /* @__PURE__ */ new Set();
|
|
7658
7775
|
const kept = [];
|
|
7659
7776
|
for (const finding of findings) {
|
|
7660
|
-
const key =
|
|
7661
|
-
if (
|
|
7662
|
-
else
|
|
7777
|
+
const key = listedKey(finding, listed);
|
|
7778
|
+
if (key === void 0) kept.push(finding);
|
|
7779
|
+
else matched.add(key);
|
|
7663
7780
|
}
|
|
7664
7781
|
const stale = entries.filter((entry) => !matched.has(keyOf(entry.code, entry.target)) && judged(entry.code, ran, context));
|
|
7665
7782
|
return {
|
|
@@ -7685,14 +7802,16 @@ function updatedBaseline(findings, entries, ran, context) {
|
|
|
7685
7802
|
const byCode = /* @__PURE__ */ new Map();
|
|
7686
7803
|
for (const entry of entries) if (entry.reason !== "" && !byCode.has(entry.code)) byCode.set(entry.code, entry.reason);
|
|
7687
7804
|
const next = /* @__PURE__ */ new Map();
|
|
7805
|
+
const known = new Set(reasons.keys());
|
|
7688
7806
|
for (const finding of findings) {
|
|
7689
7807
|
if (finding.severity === "info") continue;
|
|
7690
7808
|
const target = targetOf(finding);
|
|
7691
7809
|
const key = keyOf(finding.code, target);
|
|
7810
|
+
const listed = listedKey(finding, known);
|
|
7692
7811
|
next.set(key, {
|
|
7693
7812
|
code: finding.code,
|
|
7694
7813
|
target,
|
|
7695
|
-
reason: reasons.get(
|
|
7814
|
+
reason: (listed === void 0 ? void 0 : reasons.get(listed)) ?? byCode.get(finding.code) ?? ""
|
|
7696
7815
|
});
|
|
7697
7816
|
}
|
|
7698
7817
|
for (const entry of entries) {
|
|
@@ -8157,9 +8276,15 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
8157
8276
|
...options.advisors === void 0 ? {} : { advisors: options.advisors },
|
|
8158
8277
|
...options.database === void 0 ? {} : { database: options.database }
|
|
8159
8278
|
};
|
|
8279
|
+
const sourceOnly = rules.length > 0 && rules.every((rule) => SOURCE_ONLY_CODES.has(rule.code));
|
|
8280
|
+
let noSnapshot;
|
|
8160
8281
|
const vercel = VERCEL_FILES.some((path) => existsSync(resolve(config.root, path)));
|
|
8161
8282
|
const [snapshot, envFiles, [configToml, sql], gitignore, sources, readSets, peers, contentMapper, stackEnv, localStacks, nextConfig, install] = await Promise.all([
|
|
8162
|
-
options.snapshot ?? loadSnapshot(config, env, source, pg, opened.open)
|
|
8283
|
+
options.snapshot ?? loadSnapshot(config, env, source, pg, opened.open).catch((cause) => {
|
|
8284
|
+
if (!sourceOnly) throw cause;
|
|
8285
|
+
noSnapshot = errorText(cause);
|
|
8286
|
+
return NO_SNAPSHOT;
|
|
8287
|
+
}),
|
|
8163
8288
|
Promise.all(ENV_FILES.map((path) => readText(config.root, path))).then((files) => files.filter((file) => file !== void 0)),
|
|
8164
8289
|
readSupabaseToml(config.root).then(async (toml) => [toml, await sqlFiles(config.root, toml, sqlWorkflow(config, toml))]),
|
|
8165
8290
|
readText(config.root, ".gitignore"),
|
|
@@ -8221,6 +8346,14 @@ async function runDoctor(config, args, env, options = {}) {
|
|
|
8221
8346
|
let ran;
|
|
8222
8347
|
try {
|
|
8223
8348
|
ran = await runRules(context, rules);
|
|
8349
|
+
const schemaRule = rules.find((rule) => rule.code === "BS635") ?? rules.find((rule) => rule.code === "BS634");
|
|
8350
|
+
if (noSnapshot !== void 0 && schemaRule !== void 0) ran.push({
|
|
8351
|
+
code: schemaRule.code,
|
|
8352
|
+
severity: "info",
|
|
8353
|
+
title: schemaRule.title,
|
|
8354
|
+
help: `${DOCS_URL}#${schemaRule.code.toLowerCase()}`,
|
|
8355
|
+
message: `Ran without the schema (${noSnapshot}), so the findings name no include and BS635 finds no waterfall. Pass --snapshot, or set $DATABASE_URL, to use the foreign keys.`
|
|
8356
|
+
});
|
|
8224
8357
|
if (args.yes === true) {
|
|
8225
8358
|
const count = ran.filter((finding) => finding.fix !== void 0).length;
|
|
8226
8359
|
({left: ran} = await applyFixes(ran, context.database, async () => {
|
|
@@ -2,8 +2,8 @@ import { t as byCodePoint } from "./compare-yl4sSwVn.js";
|
|
|
2
2
|
import { r as claimMarkerOverrides } from "./authorization-CNWhpdKb.js";
|
|
3
3
|
import { n as CliError } from "./errors-B7i-VGxk.js";
|
|
4
4
|
import { t as isRecord } from "./guards-DxwRG0Uv.js";
|
|
5
|
-
import { a as toCatalog } from "./source-
|
|
6
|
-
import { F as restrictSchemas, R as tsTypeOf, b as bootstrapTables } from "./sql-layout-
|
|
5
|
+
import { a as toCatalog } from "./source-DdqeWoO4.js";
|
|
6
|
+
import { F as restrictSchemas, R as tsTypeOf, b as bootstrapTables } from "./sql-layout-Bl3iOXMS.js";
|
|
7
7
|
import { resolveBlock, resolveProviderSql } from "better-supabase/sql";
|
|
8
8
|
import { DEFAULT_CLAIMS, tenantClaimPaths } from "better-supabase/config";
|
|
9
9
|
import { toCamel } from "better-supabase";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { a as list, m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
|
|
2
2
|
import { n as CliError } from "./errors-B7i-VGxk.js";
|
|
3
|
-
import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-
|
|
3
|
+
import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-DqrbS0sS.js";
|
|
4
4
|
import { m as GEN_TASKS } from "./config-DD_MnPRL.js";
|
|
5
|
-
import { i as selectTasks, n as runTasks, r as parseTasks } from "./gen-tasks-
|
|
5
|
+
import { i as selectTasks, n as runTasks, r as parseTasks } from "./gen-tasks-C2vwKKTc.js";
|
|
6
6
|
import { c as insideRoot, r as applyPlan, u as planResult } from "./files-NnXnawki.js";
|
|
7
|
-
import { F as restrictSchemas, I as serializeGenerator, d as loadSnapshot, h as serializeSnapshot } from "./sql-layout-
|
|
7
|
+
import { F as restrictSchemas, I as serializeGenerator, d as loadSnapshot, h as serializeSnapshot } from "./sql-layout-Bl3iOXMS.js";
|
|
8
8
|
import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-yU6N6JLm.js";
|
|
9
9
|
// src/cli/commands/save-snapshot.ts
|
|
10
10
|
/** The flags `gen --save-snapshot` reads. */
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { c as parseNames, i as failedResult, n as CliError } from "./errors-B7i-VGxk.js";
|
|
2
|
-
import { n as runGen } from "./run-
|
|
3
|
-
import { l as catalogFingerprint } from "./cache-
|
|
2
|
+
import { n as runGen } from "./run-D_z9ULO7.js";
|
|
3
|
+
import { l as catalogFingerprint } from "./cache-B0JnXfiY.js";
|
|
4
4
|
import { i as plain } from "./style-B5-nByxb.js";
|
|
5
5
|
import { g as isGenTask, m as GEN_TASKS } from "./config-DD_MnPRL.js";
|
|
6
6
|
import { i as runEnv } from "./env-DtJNOdyD.js";
|
|
7
|
-
import { n as runPowerSync } from "./powersync-
|
|
7
|
+
import { n as runPowerSync } from "./powersync-CB-7AksZ.js";
|
|
8
8
|
import { t as runSeed } from "./seed-CvDA1ItH.js";
|
|
9
|
-
import { r as specOptionsFromConfig, t as runSpec } from "./spec-
|
|
10
|
-
import { t as addModules } from "./add-
|
|
11
|
-
import { n as listModules, t as printModule } from "./print-
|
|
12
|
-
import { o as dataMigration, t as syncModules } from "./sync-
|
|
13
|
-
import { t as upgrade } from "./upgrade-
|
|
14
|
-
import { d as loadSnapshot } from "./sql-layout-
|
|
9
|
+
import { r as specOptionsFromConfig, t as runSpec } from "./spec-ClfqDbVv.js";
|
|
10
|
+
import { t as addModules } from "./add-djLR310z.js";
|
|
11
|
+
import { n as listModules, t as printModule } from "./print-AVVgXsLG.js";
|
|
12
|
+
import { o as dataMigration, t as syncModules } from "./sync-Cw0ke-3h.js";
|
|
13
|
+
import { t as upgrade } from "./upgrade-niwEovfl.js";
|
|
14
|
+
import { d as loadSnapshot } from "./sql-layout-Bl3iOXMS.js";
|
|
15
15
|
import { existsSync } from "node:fs";
|
|
16
16
|
import { resolve } from "node:path";
|
|
17
17
|
// src/cli/commands/sql.ts
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -864,5 +864,5 @@ export declare function emitModule(model: Model, options: EmitOptions): string;
|
|
|
864
864
|
export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined, options?: {
|
|
865
865
|
readonly legacyTables?: boolean;
|
|
866
866
|
}): Promise<ResolvedConfig>;
|
|
867
|
-
export declare const VERSION = "0.
|
|
867
|
+
export declare const VERSION = "0.60.0";
|
|
868
868
|
export type { Catalog, CatalogCheck, CatalogColumn, CatalogColumnGrant, CatalogEnum, CatalogForeignKey, CatalogFunction, CatalogFunctionArg, CatalogGrant, CatalogIndex, CatalogPolicy, CatalogTable, CatalogTrigger, CatalogUnique, Choice, Cli, CliCommand, CliCommandDef, CliContext, CliEnv, CliErrorCode, CliErrorOptions, CliIo, CliLog, CliProblem, CliProblemExtensions, CliValues, 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,13 +1,13 @@
|
|
|
1
|
-
import { i as run, n as createCli, r as help, t as commandNames } from "./run-
|
|
1
|
+
import { i as run, n as createCli, r as help, t as commandNames } from "./run-CByEIEng.js";
|
|
2
2
|
import { a as list, r as defineCliCommand } from "./command-fqvJ0TdG.js";
|
|
3
3
|
import { n as CliError, t as CLI_ERRORS_URL } from "./errors-B7i-VGxk.js";
|
|
4
|
-
import { a as emitBlockConfig, c as emitClientBlocks, o as emitBlockConfigModule, r as renderFiles, s as emitBlockReads } from "./render-
|
|
5
|
-
import { n as runGen } from "./run-
|
|
6
|
-
import { d as loadSnapshot, h as serializeSnapshot, m as parseSnapshot, y as introspect } from "./sql-layout-
|
|
7
|
-
import { a as emitModule, d as buildModel, t as GENERATED_HEADER } from "./emit-
|
|
8
|
-
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-
|
|
4
|
+
import { a as emitBlockConfig, c as emitClientBlocks, o as emitBlockConfigModule, r as renderFiles, s as emitBlockReads } from "./render-3J7sk_CL.js";
|
|
5
|
+
import { n as runGen } from "./run-D_z9ULO7.js";
|
|
6
|
+
import { d as loadSnapshot, h as serializeSnapshot, m as parseSnapshot, y as introspect } from "./sql-layout-Bl3iOXMS.js";
|
|
7
|
+
import { a as emitModule, d as buildModel, t as GENERATED_HEADER } from "./emit-CICey-Za.js";
|
|
8
|
+
import { a as toCatalog, n as managementSource, r as pgSource } from "./source-DdqeWoO4.js";
|
|
9
9
|
import { s as loadConfig } from "./config-DD_MnPRL.js";
|
|
10
|
-
import { t as VERSION } from "./version-
|
|
10
|
+
import { t as VERSION } from "./version-Bd3kCDzL.js";
|
|
11
11
|
// src/cli/introspect/from-catalog.ts
|
|
12
12
|
/**
|
|
13
13
|
* Builds a snapshot from catalog records: the inverse of `toCatalog`. Tests and
|