better-supabase 0.58.3 → 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.
Files changed (522) hide show
  1. package/dist/{account-parts-DxSyD4yi.d.ts → account-parts-D-cLYi0Y.d.ts} +1 -1
  2. package/dist/{adapter-base-BbnpIsy4.js → adapter-base-BHtxRoRg.js} +1 -1
  3. package/dist/{agents-CbsEgoLN.d.ts → agents-FJk0CNex.d.ts} +2 -2
  4. package/dist/{ai-schedules-D47O_Vlo.d.ts → ai-schedules-wlL3DKqu.d.ts} +1 -1
  5. package/dist/ai-sdk/agents/index.d.ts +1 -1
  6. package/dist/ai-sdk/workflow/index.d.ts +1 -1
  7. package/dist/{api-wRlj_7so.d.ts → api-CSx2F4zg.d.ts} +1 -1
  8. package/dist/{api-DsFkhsYI.js → api-Clu-XitC.js} +1 -1
  9. package/dist/{app-tables-IXL0Hzut.d.ts → app-tables-C_bRG0ek.d.ts} +1 -1
  10. package/dist/{approvals-Clg-7ghA.js → approvals-D7Xhpd52.js} +8 -6
  11. package/dist/{approvals-Bbxeiywy.d.ts → approvals-Dn_DM4Oi.d.ts} +6 -0
  12. package/dist/astro/index.d.ts +3 -3
  13. package/dist/astro/index.js +3 -3
  14. package/dist/{authorization-Dq47C4vf.d.ts → authorization-Cn_oEGoA.d.ts} +1 -1
  15. package/dist/better-result/index.d.ts +2 -2
  16. package/dist/{bind-BRkDWXXk.d.ts → bind-Dopmkg_T.d.ts} +4 -4
  17. package/dist/{block-env-I8juWoVO.d.ts → block-env-4tgXDIAX.d.ts} +4 -4
  18. package/dist/{block-tables-DmDyNlJf.d.ts → block-tables-KnVB7FH0.d.ts} +1 -1
  19. package/dist/blocks/access-requests/index.d.ts +1 -1
  20. package/dist/blocks/accounting/index.d.ts +1 -1
  21. package/dist/blocks/acknowledgements/index.d.ts +1 -1
  22. package/dist/blocks/activities/index.d.ts +2 -2
  23. package/dist/blocks/advisories/index.d.ts +1 -1
  24. package/dist/blocks/agent-checkout/index.d.ts +1 -1
  25. package/dist/blocks/agents/index.d.ts +1 -1
  26. package/dist/blocks/ai-cache/index.d.ts +1 -1
  27. package/dist/blocks/ai-chat/index.d.ts +1 -1
  28. package/dist/blocks/ai-evals/index.d.ts +1 -1
  29. package/dist/blocks/ai-files/index.d.ts +1 -1
  30. package/dist/blocks/ai-guardrails/index.d.ts +1 -1
  31. package/dist/blocks/ai-keys/index.d.ts +1 -1
  32. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  33. package/dist/blocks/announcements/index.d.ts +4 -4
  34. package/dist/blocks/api-keys/index.d.ts +1 -1
  35. package/dist/blocks/appraisals/index.d.ts +1 -1
  36. package/dist/blocks/approvals/index.d.ts +2 -2
  37. package/dist/blocks/approvals/index.js +2 -2
  38. package/dist/blocks/assets/index.d.ts +2 -2
  39. package/dist/blocks/assignment/index.d.ts +1 -1
  40. package/dist/blocks/attachments/index.d.ts +5 -5
  41. package/dist/blocks/audit/index.d.ts +2 -2
  42. package/dist/blocks/automations/index.d.ts +4 -4
  43. package/dist/blocks/banking/index.d.ts +1 -1
  44. package/dist/blocks/billable-time/index.d.ts +1 -1
  45. package/dist/blocks/billing/index.d.ts +3 -3
  46. package/dist/blocks/bookings/index.d.ts +2 -2
  47. package/dist/blocks/bulk-actions/index.d.ts +2 -2
  48. package/dist/blocks/calendar/index.d.ts +3 -3
  49. package/dist/blocks/care/index.d.ts +27 -27
  50. package/dist/blocks/care/index.js +1 -1
  51. package/dist/blocks/care-plans/index.d.ts +3 -3
  52. package/dist/blocks/cases/index.d.ts +3 -3
  53. package/dist/blocks/catalog/index.d.ts +2 -2
  54. package/dist/blocks/channels/index.d.ts +1 -1
  55. package/dist/blocks/clinical-decision-support/index.d.ts +1 -1
  56. package/dist/blocks/cms/index.d.ts +5 -5
  57. package/dist/blocks/cms/index.js +1 -1
  58. package/dist/blocks/collaboration/index.d.ts +6 -6
  59. package/dist/blocks/collections/index.d.ts +1 -1
  60. package/dist/blocks/comments/index.d.ts +2 -2
  61. package/dist/blocks/commerce/index.d.ts +5 -5
  62. package/dist/blocks/commissions/index.d.ts +1 -1
  63. package/dist/blocks/compliance/index.d.ts +1 -1
  64. package/dist/blocks/connectors/index.d.ts +1 -1
  65. package/dist/blocks/consents/index.d.ts +2 -2
  66. package/dist/blocks/contacts/index.d.ts +2 -2
  67. package/dist/blocks/content/index.d.ts +2 -2
  68. package/dist/blocks/contracts/index.d.ts +1 -1
  69. package/dist/blocks/courses/index.d.ts +2 -2
  70. package/dist/blocks/created-by/index.d.ts +2 -2
  71. package/dist/blocks/crm/index.d.ts +17 -17
  72. package/dist/blocks/crm/index.js +2 -2
  73. package/dist/blocks/custom-fields/index.d.ts +1 -1
  74. package/dist/blocks/dam/index.d.ts +2 -2
  75. package/dist/blocks/data-lifecycle/index.d.ts +2 -2
  76. package/dist/blocks/deadlines/index.d.ts +1 -1
  77. package/dist/blocks/deals/index.d.ts +1 -1
  78. package/dist/blocks/dispatch/index.d.ts +2 -2
  79. package/dist/blocks/document-templates/index.d.ts +2 -2
  80. package/dist/blocks/documents/index.d.ts +1 -1
  81. package/dist/blocks/domains/index.d.ts +1 -1
  82. package/dist/blocks/donations/index.d.ts +1 -1
  83. package/dist/blocks/drive/index.d.ts +5 -5
  84. package/dist/blocks/e-prescribing/index.d.ts +1 -1
  85. package/dist/blocks/employees/index.d.ts +1 -1
  86. package/dist/blocks/enrichment/index.d.ts +1 -1
  87. package/dist/blocks/enrollments/index.d.ts +2 -2
  88. package/dist/blocks/entitlements/index.d.ts +3 -3
  89. package/dist/blocks/events/index.d.ts +3 -3
  90. package/dist/blocks/expenses/index.d.ts +1 -1
  91. package/dist/blocks/field-history/index.d.ts +1 -1
  92. package/dist/blocks/filespace/index.d.ts +8 -8
  93. package/dist/blocks/finance/index.d.ts +5 -5
  94. package/dist/blocks/finance/index.js +1 -1
  95. package/dist/blocks/flags/index.d.ts +1 -1
  96. package/dist/blocks/forecasts/index.d.ts +1 -1
  97. package/dist/blocks/forms/index.d.ts +3 -3
  98. package/dist/blocks/funding/index.d.ts +2 -2
  99. package/dist/blocks/goals/index.d.ts +1 -1
  100. package/dist/blocks/governance/index.d.ts +4 -4
  101. package/dist/blocks/guests/index.d.ts +1 -1
  102. package/dist/blocks/hiring/index.d.ts +1 -1
  103. package/dist/blocks/identities/index.d.ts +1 -1
  104. package/dist/blocks/imports/index.d.ts +2 -2
  105. package/dist/blocks/inbox/index.d.ts +6 -6
  106. package/dist/blocks/incidents/index.d.ts +1 -1
  107. package/dist/blocks/index.d.ts +5 -5
  108. package/dist/blocks/index.js +2 -2
  109. package/dist/blocks/inspections/index.d.ts +2 -2
  110. package/dist/blocks/inventory/index.d.ts +1 -1
  111. package/dist/blocks/invoices/index.d.ts +2 -2
  112. package/dist/blocks/invoices/index.js +1 -1
  113. package/dist/blocks/knowledge/index.d.ts +1 -1
  114. package/dist/blocks/lead-scoring/index.d.ts +2 -2
  115. package/dist/blocks/learning/index.d.ts +3 -3
  116. package/dist/blocks/leases/index.d.ts +1 -1
  117. package/dist/blocks/leave/index.d.ts +1 -1
  118. package/dist/blocks/ledger/index.d.ts +1 -1
  119. package/dist/blocks/legal-entities/index.d.ts +2 -2
  120. package/dist/blocks/lims/index.d.ts +2 -2
  121. package/dist/blocks/mail-sync/index.d.ts +3 -3
  122. package/dist/blocks/maintenance/index.d.ts +2 -2
  123. package/dist/blocks/manufacturing/index.d.ts +2 -2
  124. package/dist/blocks/medications/index.d.ts +1 -1
  125. package/dist/blocks/meetings/index.d.ts +3 -3
  126. package/dist/blocks/memberships/index.d.ts +2 -2
  127. package/dist/blocks/memory/index.d.ts +1 -1
  128. package/dist/blocks/messaging/index.d.ts +5 -5
  129. package/dist/blocks/metrics/index.d.ts +1 -1
  130. package/dist/blocks/mfa/index.d.ts +2 -2
  131. package/dist/blocks/moderation/index.d.ts +2 -2
  132. package/dist/blocks/notifications/index.d.ts +5 -5
  133. package/dist/blocks/numbering/index.d.ts +1 -1
  134. package/dist/blocks/oauth-server/index.d.ts +1 -1
  135. package/dist/blocks/observations/index.d.ts +2 -2
  136. package/dist/blocks/onboarding/index.d.ts +2 -2
  137. package/dist/blocks/option-sets/index.d.ts +2 -2
  138. package/dist/blocks/orders/index.d.ts +1 -1
  139. package/dist/blocks/organizations/index.d.ts +2 -2
  140. package/dist/blocks/outbox/index.d.ts +1 -1
  141. package/dist/blocks/passes/index.d.ts +2 -2
  142. package/dist/blocks/payroll-export/index.d.ts +2 -2
  143. package/dist/blocks/people/index.d.ts +7 -7
  144. package/dist/blocks/periods/index.d.ts +1 -1
  145. package/dist/blocks/permissions/index.d.ts +3 -3
  146. package/dist/blocks/pipelines/index.d.ts +2 -2
  147. package/dist/blocks/posts/index.d.ts +2 -2
  148. package/dist/blocks/procurement/index.d.ts +5 -5
  149. package/dist/blocks/procurement/index.js +1 -1
  150. package/dist/blocks/profiles/index.d.ts +1 -1
  151. package/dist/blocks/projects/index.d.ts +7 -7
  152. package/dist/blocks/projects/index.js +2 -2
  153. package/dist/blocks/promotions/index.d.ts +1 -1
  154. package/dist/blocks/prompts/index.d.ts +1 -1
  155. package/dist/blocks/push/index.d.ts +2 -2
  156. package/dist/blocks/qualifications/index.d.ts +2 -2
  157. package/dist/blocks/queue/index.d.ts +2 -2
  158. package/dist/blocks/quotes/index.d.ts +1 -1
  159. package/dist/blocks/rank/index.d.ts +1 -1
  160. package/dist/blocks/reactions/index.d.ts +4 -4
  161. package/dist/blocks/recruiting/index.d.ts +4 -4
  162. package/dist/blocks/referrals/index.d.ts +1 -1
  163. package/dist/blocks/relations/index.d.ts +1 -1
  164. package/dist/blocks/reminders/index.d.ts +1 -1
  165. package/dist/blocks/reviews/index.d.ts +1 -1
  166. package/dist/blocks/rfqs/index.d.ts +2 -2
  167. package/dist/blocks/risks/index.d.ts +2 -2
  168. package/dist/blocks/saas/index.d.ts +12 -12
  169. package/dist/blocks/sales/index.d.ts +1 -1
  170. package/dist/blocks/sales/index.js +1 -1
  171. package/dist/blocks/saved-views/index.d.ts +3 -3
  172. package/dist/blocks/scheduling/index.d.ts +4 -4
  173. package/dist/blocks/scores/index.d.ts +2 -2
  174. package/dist/blocks/search/index.d.ts +3 -3
  175. package/dist/blocks/security-events/index.d.ts +1 -1
  176. package/dist/blocks/segments/index.d.ts +2 -2
  177. package/dist/blocks/sequences/index.d.ts +3 -3
  178. package/dist/blocks/service/index.d.ts +7 -7
  179. package/dist/blocks/service-accounts/index.d.ts +1 -1
  180. package/dist/blocks/sessions/index.d.ts +2 -2
  181. package/dist/blocks/settings/index.d.ts +2 -2
  182. package/dist/blocks/share-links/index.d.ts +1 -1
  183. package/dist/blocks/shifts/index.d.ts +2 -2
  184. package/dist/blocks/shipments/index.d.ts +1 -1
  185. package/dist/blocks/signatures/index.d.ts +2 -2
  186. package/dist/blocks/signing-keys/index.d.ts +1 -1
  187. package/dist/blocks/sla/index.d.ts +1 -1
  188. package/dist/blocks/sso/index.d.ts +1 -1
  189. package/dist/blocks/state-machine/index.d.ts +1 -1
  190. package/dist/blocks/subjects/index.d.ts +2 -2
  191. package/dist/blocks/support/index.d.ts +5 -5
  192. package/dist/blocks/tags/index.d.ts +2 -2
  193. package/dist/blocks/tasks/index.d.ts +2 -2
  194. package/dist/blocks/tax/index.d.ts +2 -2
  195. package/dist/blocks/teams/index.d.ts +1 -1
  196. package/dist/blocks/templates/index.d.ts +1 -1
  197. package/dist/blocks/tills/index.d.ts +1 -1
  198. package/dist/blocks/time-entries/index.d.ts +2 -2
  199. package/dist/blocks/timeline/index.d.ts +1 -1
  200. package/dist/blocks/trash/index.d.ts +1 -1
  201. package/dist/blocks/undo/index.d.ts +2 -2
  202. package/dist/blocks/updated-at/index.d.ts +2 -2
  203. package/dist/blocks/usage/index.d.ts +2 -2
  204. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  205. package/dist/blocks/versions/index.d.ts +1 -1
  206. package/dist/blocks/waitlist/index.d.ts +1 -1
  207. package/dist/blocks/warehouse/index.d.ts +1 -1
  208. package/dist/blocks/warranty/index.d.ts +1 -1
  209. package/dist/blocks/webhooks/index.d.ts +2 -2
  210. package/dist/blocks/workflow-editor/index.d.ts +4 -4
  211. package/dist/blocks/workflows/index.d.ts +4 -4
  212. package/dist/{blocks-RVd7m590.d.ts → blocks-sDhFO8-h.d.ts} +4 -4
  213. package/dist/{build-Cb9yLxtS.js → build-QM0GdQ2B.js} +1 -1
  214. package/dist/{cache-tags-BxpxsCtq.d.ts → cache-tags-FrJaMalu.d.ts} +1 -1
  215. package/dist/claims/index.d.ts +4 -4
  216. package/dist/{claims-source-CXAtLZ9_.d.ts → claims-source-CeefCyGV.d.ts} +1 -1
  217. package/dist/cli/add-BBZULhs3.js +1 -0
  218. package/dist/cli/{add-dbBQf6Vy.js → add-OllEkXon.js} +11 -11
  219. package/dist/cli/{add-BQZyQh4f.js → add-djLR310z.js} +2 -2
  220. package/dist/cli/{app-table-files-CITEmvRS.js → app-table-files-DnoDAkVJ.js} +4 -4
  221. package/dist/cli/{app-tables-BBqu3dow.js → app-tables-C4shCkBv.js} +2 -2
  222. package/dist/cli/{backfill-bBk3QjfK.js → backfill-_spwSvnn.js} +3 -3
  223. package/dist/cli/bin.js +1 -1
  224. package/dist/cli/{blocks-D-DV2aCE.js → blocks-Cvs0nhC2.js} +1 -1
  225. package/dist/cli/{blocks-CsQNweG8.js → blocks-DFkzCFQi.js} +1 -1
  226. package/dist/cli/{cache-sR8AQqSV.js → cache-B0JnXfiY.js} +1 -1
  227. package/dist/cli/{codemod-BkPcyPnF.js → codemod-D2Lnca97.js} +6 -6
  228. package/dist/cli/{codemod-naming-BLoVSmVF.js → codemod-naming-CHIeOTt5.js} +1 -1
  229. package/dist/cli/{column-renames-brM-D_th.js → column-renames-4OHEvCAj.js} +2 -2
  230. package/dist/cli/{config-NxPVkM-K.js → config-DD_MnPRL.js} +1 -0
  231. package/dist/cli/{config-BGh7rJwA.js → config-DkjilxeE.js} +1 -1
  232. package/dist/cli/{content-mapper-DMi2HOKi.js → content-mapper-DAYxPQ18.js} +1 -1
  233. package/dist/cli/{db-od92zIrO.js → db-CEUnv3hK.js} +2 -2
  234. package/dist/cli/{dev-ClH-7fB0.js → dev-Xw7pt3KG.js} +5 -5
  235. package/dist/cli/{doctor-C_BEuEGg.js → doctor-diSKQp-6.js} +724 -32
  236. package/dist/cli/{emit-CTzFdffA.js → emit-CICey-Za.js} +2 -2
  237. package/dist/cli/{gen-RKf7q3L5.js → gen-BVuNFeLB.js} +5 -5
  238. package/dist/cli/{gen-tasks-DmDvgVBV.js → gen-tasks-C2vwKKTc.js} +11 -11
  239. package/dist/cli/index.d.ts +1 -1
  240. package/dist/cli/index.js +8 -8
  241. package/dist/cli/{init-B_CCByIh.js → init-9BSoBkny.js} +9 -9
  242. package/dist/cli/{live-DjjMID3V.js → live-Ce8vdcCn.js} +2 -2
  243. package/dist/cli/{mcp-BYwrZHp1.js → mcp-UW-gEnP_.js} +2 -2
  244. package/dist/cli/{memo-backend-BIHqP1uE.js → memo-backend-BMdfsihK.js} +1 -1
  245. package/dist/cli/{metadata-DCtLUYqR.js → metadata-DqrbS0sS.js} +4 -4
  246. package/dist/cli/{migrate-Bq6CUPbE.js → migrate-Cn8L_0co.js} +1 -1
  247. package/dist/cli/{migration-safety-BvJ-JK5n.js → migration-safety-C1Ysrthi.js} +2 -2
  248. package/dist/cli/{module-migration-Dv6VV1om.js → module-migration-DXI95fqs.js} +1 -1
  249. package/dist/cli/{partition-C4g7WAwh.js → partition-CJCrIueu.js} +3 -3
  250. package/dist/cli/{powersync-1HMiZhFF.js → powersync-CB-7AksZ.js} +4 -4
  251. package/dist/cli/powersync-JTdU1Xpy.js +1 -0
  252. package/dist/cli/{print-D9biMrfv.js → print-AVVgXsLG.js} +2 -2
  253. package/dist/cli/{providers-C5fw9XC_.js → providers-B3FLmlud.js} +1 -1
  254. package/dist/cli/{prune-workflows-DxpPCevB.js → prune-workflows-CrLDmFf1.js} +3 -3
  255. package/dist/cli/{remove-CyhSdPkK.js → remove-00SZWfyi.js} +6 -6
  256. package/dist/cli/{render-DOz25g5T.js → render-3J7sk_CL.js} +5 -5
  257. package/dist/cli/{render-cache-CInSNFhV.js → render-cache-P4gQeivH.js} +1 -1
  258. package/dist/cli/round-trips-BHfeIu6I.js +238 -0
  259. package/dist/cli/{run-DVdkD1MI.js → run-CByEIEng.js} +35 -35
  260. package/dist/cli/{run-0bMsZ1VV.js → run-D_z9ULO7.js} +7 -7
  261. package/dist/cli/seed-CucH5loT.js +1 -0
  262. package/dist/cli/{seed-DVKgi-7l.js → seed-CvDA1ItH.js} +2 -2
  263. package/dist/cli/{shared-D2i8_u-U.js → shared-d021xfdn.js} +1 -1
  264. package/dist/cli/{source-BGVOuWXq.js → source-DdqeWoO4.js} +1 -1
  265. package/dist/cli/{source-args-B3Rowfv5.js → source-args-yU6N6JLm.js} +1 -1
  266. package/dist/cli/{spec-COotILIk.js → spec-ClfqDbVv.js} +2 -2
  267. package/dist/cli/{spec-C_JKo_dP.js → spec-Diudl7hC.js} +1 -1
  268. package/dist/cli/{sql-layout-D8dIzdy9.js → sql-layout-Bl3iOXMS.js} +4 -4
  269. package/dist/cli/{squash-xCseaSP1.js → squash-C07y7CsQ.js} +1 -1
  270. package/dist/cli/{sync-Ceqa-3R6.js → sync-Cw0ke-3h.js} +4 -4
  271. package/dist/cli/{upgrade-CUNKALDw.js → upgrade-niwEovfl.js} +5 -5
  272. package/dist/cli/{upgrade-DiMHauEU.js → upgrade-oc6s5Xoe.js} +5 -5
  273. package/dist/cli/{verify-BFLaU6w3.js → verify-CrFHs8Lr.js} +2 -2
  274. package/dist/cli/{version-C7imaHag.js → version-Bd3kCDzL.js} +1 -1
  275. package/dist/client/index.d.ts +5 -5
  276. package/dist/client/index.js +1 -1
  277. package/dist/client/native/index.d.ts +5 -5
  278. package/dist/client/native/index.js +2 -2
  279. package/dist/{codec-Cjquuv8M.js → codec-BI1mq95W.js} +1 -1
  280. package/dist/{composite-CL4zDLjs.d.ts → composite-BVEOyec_.d.ts} +3 -3
  281. package/dist/{composite-DYAp3Znr.js → composite-Tsm5QFS2.js} +1 -1
  282. package/dist/{composite-reads-BJeDe1yV.js → composite-reads-BJJBI4tL.js} +1 -1
  283. package/dist/{composite-reads-B9psRGqQ.d.ts → composite-reads-DvN7EgDO.d.ts} +1 -1
  284. package/dist/config/index.d.ts +4 -4
  285. package/dist/config/index.js +2 -2
  286. package/dist/{config-DzPViWQU.js → config-cisS43w5.js} +2 -1
  287. package/dist/{context-DMBXEzQa.d.ts → context-C_Rx1QaW.d.ts} +4 -3
  288. package/dist/contract/index.d.ts +4 -4
  289. package/dist/{controller-CaZv50cD.d.ts → controller-D9N4NKbM.d.ts} +1 -1
  290. package/dist/{conversion-D2key0v9.d.ts → conversion-CruLbcu8.d.ts} +1 -1
  291. package/dist/create/index.d.ts +4 -4
  292. package/dist/create/index.js +1 -1
  293. package/dist/create/lite/index.d.ts +3 -3
  294. package/dist/create/lite/index.js +3 -3
  295. package/dist/{db-blocks-Db3LVXco.d.ts → db-blocks-DB8Ct8Eu.d.ts} +11 -2
  296. package/dist/{define-block-kWv1wYf7.d.ts → define-block-Cd7dm2o6.d.ts} +7 -2
  297. package/dist/{define-runtime-Dv8OYnKW.js → define-runtime-Ca5NN0gu.js} +2 -2
  298. package/dist/{define-runtime-full-Bh5c_01f.js → define-runtime-full-DeuaXsV7.js} +45 -38
  299. package/dist/{delete-account-BHXzIUIq.d.ts → delete-account-DwGFiIYv.d.ts} +1 -1
  300. package/dist/{drive-Bm-up0KU.d.ts → drive-C6thwExa.d.ts} +2 -2
  301. package/dist/e-invoicing/index.d.ts +1 -1
  302. package/dist/edge/index.d.ts +5 -5
  303. package/dist/edge/index.js +4 -4
  304. package/dist/{entitlements-UGUF2RJv.d.ts → entitlements-CR5HRd3S.d.ts} +2 -2
  305. package/dist/eve/index.d.ts +1 -1
  306. package/dist/eve/index.js +1 -1
  307. package/dist/{executor-B0nTn-4Q.js → executor-Bot0tkvU.js} +2 -2
  308. package/dist/{executor-Dp4A_McY.d.ts → executor-CTuilcgE.d.ts} +2 -2
  309. package/dist/expo/index.d.ts +2 -2
  310. package/dist/expo/index.js +3 -3
  311. package/dist/{extract-Bs_b4ZIX.d.ts → extract-B2My7IhT.d.ts} +1 -1
  312. package/dist/{extras-C258FsPj.d.ts → extras-CKwPSpGL.d.ts} +1 -1
  313. package/dist/{field-errors-BKCtkPxS.d.ts → field-errors-CihTLojJ.d.ts} +6 -6
  314. package/dist/{former-permission-keys-hL23tm66.js → former-permission-keys-D8FbWktT.js} +4 -3
  315. package/dist/{framework-C9UiMaOq.js → framework-BYZ8c9_g.js} +1 -1
  316. package/dist/{framework-BUzOnlJN.d.ts → framework-giXStk8k.d.ts} +3 -3
  317. package/dist/generators/factories/index.d.ts +1 -1
  318. package/dist/generators/factories/index.js +1 -1
  319. package/dist/generators/index.d.ts +2 -2
  320. package/dist/generators/json-schema/index.d.ts +2 -2
  321. package/dist/generators/json-schema/index.js +1 -1
  322. package/dist/generators/nuqs/index.d.ts +1 -1
  323. package/dist/generators/nuqs/index.js +1 -1
  324. package/dist/generators/standard-schema/index.d.ts +1 -1
  325. package/dist/generators/standard-schema/index.js +1 -1
  326. package/dist/generators/valibot/index.d.ts +1 -1
  327. package/dist/generators/valibot/index.js +1 -1
  328. package/dist/generators/zod/index.d.ts +1 -1
  329. package/dist/generators/zod/index.js +1 -1
  330. package/dist/hono/index.d.ts +4 -4
  331. package/dist/hono/index.js +3 -3
  332. package/dist/{index-CDCyOPT7.d.ts → index-28PPT5w7.d.ts} +2 -2
  333. package/dist/{index-nsEUHz98.d.ts → index-69aFw9Id.d.ts} +2 -2
  334. package/dist/{index-BtuseUSW.d.ts → index-74TASXlD.d.ts} +1 -1
  335. package/dist/{index-DOBq5QFe.d.ts → index-B0dSXth6.d.ts} +1 -1
  336. package/dist/{index-Mq2z-GgJ.d.ts → index-BOuJSOaf.d.ts} +1 -1
  337. package/dist/{index-DLVuARYk.d.ts → index-BnY5lZtT.d.ts} +9 -9
  338. package/dist/{index-rFIDpwjh.d.ts → index-BqUY2MB-.d.ts} +1 -1
  339. package/dist/{index-BG-WQ0JH.d.ts → index-BrnGYShi.d.ts} +2 -2
  340. package/dist/{index-BMh8ACKR.d.ts → index-Bs6OCtxW.d.ts} +1 -1
  341. package/dist/{index-CIVA5x1i.d.ts → index-BszN5nLs.d.ts} +2 -2
  342. package/dist/{index-CjeQqQzW.d.ts → index-Bv2kSYet.d.ts} +4 -4
  343. package/dist/{index-R_k3Nh4y.d.ts → index-BvRseRob.d.ts} +3 -3
  344. package/dist/{index-DIK12ZTb.d.ts → index-BvZ3uvj9.d.ts} +2 -2
  345. package/dist/{index-ClysJ8O-.d.ts → index-C1na2fiY.d.ts} +3 -3
  346. package/dist/{index-DgiSwhKf.d.ts → index-C59gKJBx.d.ts} +1 -1
  347. package/dist/{index-DcdC0Qll.d.ts → index-CGAcXNod.d.ts} +1 -1
  348. package/dist/{index-DWxio8F_.d.ts → index-CMyUugyW.d.ts} +8 -8
  349. package/dist/{index-BYx-ObF-.d.ts → index-CdoTvK2W.d.ts} +1 -1
  350. package/dist/{index-CkCuMFVG.d.ts → index-CiCmlbtu.d.ts} +1 -1
  351. package/dist/{index-B67YUNow.d.ts → index-CiLb3DTI.d.ts} +3 -3
  352. package/dist/{index-CzNRwKGG.d.ts → index-Cnc4wyTo.d.ts} +2 -2
  353. package/dist/{index-CDrLyU72.d.ts → index-Cpj79WyM.d.ts} +1 -1
  354. package/dist/{index-B6i7w-iS.d.ts → index-D50ulqMJ.d.ts} +1 -1
  355. package/dist/{index-48l12mNt.d.ts → index-D6px-XTD.d.ts} +2 -2
  356. package/dist/{index-DRKAMZV3.d.ts → index-DMHxmit5.d.ts} +4 -4
  357. package/dist/{index-BBf3nn7Y.d.ts → index-DflyfGR8.d.ts} +2 -2
  358. package/dist/{index-DebFs8qq.d.ts → index-DibtbiIW.d.ts} +1 -1
  359. package/dist/{index-B64DT6Io.d.ts → index-DpXMVE12.d.ts} +1 -1
  360. package/dist/{index-GamVr8VZ.d.ts → index-DsLMqyB5.d.ts} +1 -1
  361. package/dist/{index-C_DCvnW0.d.ts → index-DzUnwtxa.d.ts} +1 -1
  362. package/dist/{index-BZdSOt51.d.ts → index-Hzbfht3Z.d.ts} +1 -1
  363. package/dist/{index-bkm44ycq.d.ts → index-Sl13L6VB.d.ts} +4 -4
  364. package/dist/{index-DskEpSgl.d.ts → index-UQOB8v1I.d.ts} +1 -1
  365. package/dist/{index-CDxfstYD.d.ts → index-_No9Jb9O.d.ts} +1 -1
  366. package/dist/{index-icogJj2C.d.ts → index-cgHbN_EA.d.ts} +4 -4
  367. package/dist/{index-D2aht6Cz.d.ts → index-pry9PXpK.d.ts} +2 -2
  368. package/dist/{index-BJ1Mv0TK.d.ts → index-wc3-R_cK.d.ts} +1 -1
  369. package/dist/index.d.ts +2 -2
  370. package/dist/index.js +2 -2
  371. package/dist/{invoices-CWp9jcI2.d.ts → invoices-BXwG7Jwp.d.ts} +5 -0
  372. package/dist/{json-schema-CgwH39-G.js → json-schema-BveJfXoz.js} +1 -1
  373. package/dist/list/export/index.d.ts +1 -1
  374. package/dist/list/index.d.ts +1 -1
  375. package/dist/list/order/index.d.ts +2 -2
  376. package/dist/{list-query-qCpvTDGH.d.ts → list-query-CBjzZmjx.d.ts} +1 -1
  377. package/dist/{manifest-CD_ZA69x.d.ts → manifest-2JeNUq8t.d.ts} +1 -1
  378. package/dist/{manifest-9TRpR9P-.d.ts → manifest-3e0zfaQt.d.ts} +1 -1
  379. package/dist/{manifest-BXatXuLx.d.ts → manifest-3or1oZTo.d.ts} +1 -1
  380. package/dist/{manifest-mCn7RdZs.d.ts → manifest-AS4QwWdu.d.ts} +1 -1
  381. package/dist/{manifest-D02pP9Nl.d.ts → manifest-B1lYVfIp.d.ts} +1 -1
  382. package/dist/{manifest-dSiPcx5l.d.ts → manifest-B7xyFqWo.d.ts} +1 -1
  383. package/dist/{manifest-DF6GzdBC.d.ts → manifest-B9m_UaiY.d.ts} +1 -1
  384. package/dist/{manifest-BmGsyaxx.d.ts → manifest-B9qFGJ_A.d.ts} +1 -1
  385. package/dist/{manifest-CTEURHfF.d.ts → manifest-BSjzLeb-.d.ts} +1 -1
  386. package/dist/{manifest-BG2_hkzB.d.ts → manifest-BVn2Xglt.d.ts} +1 -1
  387. package/dist/{manifest-C1TwYhyr.d.ts → manifest-BWKFNoxP.d.ts} +1 -1
  388. package/dist/{manifest-DGrcTY4n.d.ts → manifest-BXWhDMFt.d.ts} +1 -1
  389. package/dist/{manifest-Cfrflbtt.d.ts → manifest-Bi44m1V3.d.ts} +1 -1
  390. package/dist/{manifest-Bsrn5gfq.d.ts → manifest-Bluupj7R.d.ts} +1 -1
  391. package/dist/{manifest-D32p1K-g.d.ts → manifest-Bo0SCigB.d.ts} +1 -1
  392. package/dist/{manifest-C3FjJnQT.d.ts → manifest-ByRLUGaJ.d.ts} +3 -3
  393. package/dist/{manifest-Cx_UVMlT.d.ts → manifest-C1--UMCz.d.ts} +1 -1
  394. package/dist/{manifest-BizfO8zf.d.ts → manifest-C20SXAzp.d.ts} +1 -1
  395. package/dist/{manifest-BKY6WHm6.d.ts → manifest-C40ISJVj.d.ts} +1 -1
  396. package/dist/{manifest-DBptC4dz.d.ts → manifest-C7KPtGTu.d.ts} +2 -2
  397. package/dist/{manifest-ChKRtAF6.d.ts → manifest-C82tY_RD.d.ts} +1 -1
  398. package/dist/{manifest-LAVlQXiw.d.ts → manifest-C94eugvl.d.ts} +1 -1
  399. package/dist/{manifest-tjlvcP1t.d.ts → manifest-CBdMkxZD.d.ts} +1 -1
  400. package/dist/{manifest-CxUI9ZXn.d.ts → manifest-CCPioFQl.d.ts} +1 -1
  401. package/dist/{manifest-BdV9GNAF.d.ts → manifest-CD5D0OWo.d.ts} +1 -1
  402. package/dist/{manifest-B91B3Yvk.d.ts → manifest-CGnN_2Yx.d.ts} +1 -1
  403. package/dist/{manifest-CpMVJWDU.d.ts → manifest-CH1MFzXN.d.ts} +1 -1
  404. package/dist/{manifest-BkJdR1D-.d.ts → manifest-CJRob2Ms.d.ts} +1 -1
  405. package/dist/{manifest-BdBaGzfE.d.ts → manifest-CgljOcHt.d.ts} +1 -1
  406. package/dist/{manifest-BSrdiUHP.d.ts → manifest-Ci7NEusH.d.ts} +1 -1
  407. package/dist/{manifest-gS-wx2yB.d.ts → manifest-CiXl1kUg.d.ts} +1 -1
  408. package/dist/{manifest-BNIvrs6_.d.ts → manifest-CjzIpyBP.d.ts} +2 -2
  409. package/dist/{manifest-B-wg2F2L.d.ts → manifest-ClDcyCPP.d.ts} +3 -3
  410. package/dist/{manifest-CIa0-uCj.d.ts → manifest-Co0CBReD.d.ts} +1 -1
  411. package/dist/{manifest-CPlmHPRY.d.ts → manifest-CpmJIEt7.d.ts} +1 -1
  412. package/dist/{manifest-DAv6iO-q.d.ts → manifest-Cqv6c1KN.d.ts} +1 -1
  413. package/dist/{manifest-BOxu_JMd.d.ts → manifest-CtUKrkx1.d.ts} +1 -1
  414. package/dist/{manifest-C7bh84U0.d.ts → manifest-D1FPczc-.d.ts} +1 -1
  415. package/dist/{manifest-VjVVI7bV.d.ts → manifest-D43yma-v.d.ts} +1 -1
  416. package/dist/{manifest-B7IYj4OA.d.ts → manifest-DAF4J0gk.d.ts} +1 -1
  417. package/dist/{manifest-BSSoVDlI.d.ts → manifest-DGoI006V.d.ts} +1 -1
  418. package/dist/{manifest-Ce_JDK4r.d.ts → manifest-DHN6WiIJ.d.ts} +1 -1
  419. package/dist/{manifest-C7CtYgWC.d.ts → manifest-DIl_cNua.d.ts} +1 -1
  420. package/dist/{manifest-BWE_47qq.d.ts → manifest-DJhjOnvk.d.ts} +1 -1
  421. package/dist/{manifest-Cn85_kP6.d.ts → manifest-DMhuQgOx.d.ts} +1 -1
  422. package/dist/{manifest-1P6OEAwH.d.ts → manifest-DQkz9UVy.d.ts} +1 -1
  423. package/dist/{manifest-Cz8poTZ2.d.ts → manifest-DUZUtWBi.d.ts} +1 -1
  424. package/dist/{manifest-BVwoT7GU.d.ts → manifest-DY2KtVcD.d.ts} +1 -1
  425. package/dist/{manifest-Dc_FWIrg.d.ts → manifest-DaB1w2xo.d.ts} +1 -1
  426. package/dist/{manifest-DZc_37YJ.d.ts → manifest-DpXgCZEd.d.ts} +1 -1
  427. package/dist/{manifest-BcqqAgm9.d.ts → manifest-Dqf2Uw17.d.ts} +1 -1
  428. package/dist/{manifest-D5aZyD1b.js → manifest-OxHBbWrs.js} +1 -1
  429. package/dist/{manifest-khfEDzX4.d.ts → manifest-Utivc7Qa.d.ts} +1 -1
  430. package/dist/{manifest-t9v09kRa.d.ts → manifest-WJ-UHuEx.d.ts} +1 -1
  431. package/dist/{manifest-BNCX3M2Y.d.ts → manifest-WpIMAJCT.d.ts} +1 -1
  432. package/dist/{manifest-Cle7S3sn.d.ts → manifest-at0NS8cT.d.ts} +1 -1
  433. package/dist/{manifest-D4iEPtlb.d.ts → manifest-d7vR6coE.d.ts} +2 -2
  434. package/dist/{manifest-BN2J8Zo7.d.ts → manifest-gl856Z9G.d.ts} +1 -1
  435. package/dist/{manifest-DcnVXlH7.d.ts → manifest-iGmnzfGD.d.ts} +1 -1
  436. package/dist/{manifest-BWFemJ6Q.d.ts → manifest-j4_V-qhA.d.ts} +1 -1
  437. package/dist/{manifest-blSYzmEZ.d.ts → manifest-mAxLRfeu.d.ts} +1 -1
  438. package/dist/{manifest-zEA2Tw_l.d.ts → manifest-mBKFNynL.d.ts} +1 -1
  439. package/dist/{manifest-SoNChfLL.d.ts → manifest-wPIH-Oo7.d.ts} +1 -1
  440. package/dist/{manifest-Djy3wcSo.js → manifest-waO9DHVc.js} +1 -0
  441. package/dist/mapper/bin.js +6 -6
  442. package/dist/mcp/index.d.ts +2 -2
  443. package/dist/mcp/index.js +1 -1
  444. package/dist/mcp/sdk/index.d.ts +2 -2
  445. package/dist/mcp/sdk/index.js +1 -1
  446. package/dist/{mcp-CoJbu0Hk.js → mcp-mSD-ic9W.js} +3 -3
  447. package/dist/next/index.d.ts +12 -12
  448. package/dist/next/index.js +10 -5
  449. package/dist/next/proxy/index.d.ts +3 -3
  450. package/dist/{operations-nnC3pvwn.d.ts → operations-dIOdHqYz.d.ts} +1 -1
  451. package/dist/orpc/index.d.ts +4 -4
  452. package/dist/orpc/index.js +2 -2
  453. package/dist/otel/index.js +5 -5
  454. package/dist/{permissions-Ccvec0MR.d.ts → permissions-DG0t2lrA.d.ts} +1 -1
  455. package/dist/{ports-CfVACwW_.d.ts → ports-CfiOCL2r.d.ts} +1 -1
  456. package/dist/{ports-DfDzwMCR.js → ports-DR88RF0N.js} +2 -2
  457. package/dist/powersync/index.d.ts +3 -3
  458. package/dist/powersync/index.js +1 -1
  459. package/dist/preset/index.d.ts +4 -4
  460. package/dist/{preview-CR1nZ6-E.d.ts → preview-3nes4WG4.d.ts} +2 -2
  461. package/dist/{project-CxoixIpG.js → project-CXcoauzs.js} +2 -2
  462. package/dist/{push-token-Rv1CxW_N.d.ts → push-token-CRBieazN.d.ts} +1 -1
  463. package/dist/query/index.d.ts +1 -1
  464. package/dist/react/index.d.ts +5 -5
  465. package/dist/react/native/index.d.ts +1 -1
  466. package/dist/react/server.d.ts +6 -6
  467. package/dist/react-router/index.d.ts +3 -3
  468. package/dist/react-router/index.js +3 -3
  469. package/dist/{read-set-BptYceHc.js → read-set-DfScfSsf.js} +3 -2
  470. package/dist/realtime/index.d.ts +3 -3
  471. package/dist/{record-form-mpamIVq3.d.ts → record-form-BggNAKZA.d.ts} +1 -1
  472. package/dist/records/index.d.ts +7 -7
  473. package/dist/{resource-execute-Bb-zKYUc.d.ts → resource-execute-BIqAzA57.d.ts} +1 -1
  474. package/dist/{resource-types-C8kdoZ-J.d.ts → resource-types-DcEe07vC.d.ts} +1 -1
  475. package/dist/{resources-B9dfA1jH.d.ts → resources-Bb_JRadM.d.ts} +1 -1
  476. package/dist/{sales-D_yZoFUU.js → sales-CIe7dE4J.js} +1 -1
  477. package/dist/server/account/index.d.ts +2 -2
  478. package/dist/server/accounts/index.d.ts +1 -1
  479. package/dist/server/index.d.ts +12 -12
  480. package/dist/server/index.js +4 -4
  481. package/dist/{server-CqRpnOo0.js → server-DA5SRGHQ.js} +2 -2
  482. package/dist/{server-types-C8zErBy9.d.ts → server-types-Cp2en4rP.d.ts} +2 -2
  483. package/dist/{session-DRn_URq0.d.ts → session-Bro3jmnu.d.ts} +1 -1
  484. package/dist/{sign-in-CMEBFv36.d.ts → sign-in-Cj7Y0mSU.d.ts} +11 -11
  485. package/dist/solid/index.d.ts +6 -6
  486. package/dist/solid-start/index.d.ts +3 -3
  487. package/dist/solid-start/index.js +3 -3
  488. package/dist/spec/index.d.ts +1 -1
  489. package/dist/spec/index.js +2 -2
  490. package/dist/sql/index.d.ts +5 -5
  491. package/dist/sql/index.js +1 -1
  492. package/dist/{sql-ZLYXNvXw.js → sql-BwfPwN8v.js} +304 -95
  493. package/dist/sqlite/index.d.ts +1 -1
  494. package/dist/sqlite/index.js +1 -1
  495. package/dist/ssr/index.d.ts +1 -1
  496. package/dist/svelte/index.d.ts +6 -6
  497. package/dist/sveltekit/index.d.ts +4 -4
  498. package/dist/sveltekit/index.js +3 -3
  499. package/dist/{tags-Bh4zXrnl.d.ts → tags-C7NyJTdU.d.ts} +1 -1
  500. package/dist/tanstack-db/index.d.ts +1 -1
  501. package/dist/tanstack-start/index.d.ts +3 -3
  502. package/dist/tanstack-start/index.js +3 -3
  503. package/dist/{tenant-DpJTJr1c.d.ts → tenant-BFABaxQ5.d.ts} +1 -1
  504. package/dist/testing/index.d.ts +9 -9
  505. package/dist/testing/index.js +4 -4
  506. package/dist/{timeline-CGjiciIY.d.ts → timeline-0a7kclhg.d.ts} +3 -3
  507. package/dist/{topic-R7kIJ_xI.d.ts → topic-BH4L7H8n.d.ts} +2 -2
  508. package/dist/{types-BidEA6pZ.d.ts → types-BMLgTFzf.d.ts} +2 -2
  509. package/dist/{verify-BfcOHiUP.d.ts → verify-tK2F49Gn.d.ts} +1 -1
  510. package/dist/{version-DRVVrk-u.js → version-BHgdHcZN.js} +1 -1
  511. package/dist/vue/index.d.ts +6 -6
  512. package/dist/{watch-topic-D18gT7-K.d.ts → watch-topic-BYfSlldk.d.ts} +1 -1
  513. package/dist/webmcp/index.d.ts +1 -1
  514. package/dist/webmcp/index.js +1 -1
  515. package/dist/yjs/index.d.ts +1 -1
  516. package/package.json +1 -1
  517. package/schemas/config-v1.json +3 -0
  518. package/schemas/doctor-report-v1.json +2 -0
  519. package/dist/cli/add-DHvo6zQZ.js +0 -1
  520. package/dist/cli/powersync-DLUNuNl4.js +0 -1
  521. package/dist/cli/round-trips-D2KD5Hpq.js +0 -56
  522. package/dist/cli/seed-Dlm5jjPn.js +0 -1
@@ -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-BGVOuWXq.js";
6
- import { F as restrictSchemas, R as tsTypeOf, b as bootstrapTables } from "./sql-layout-D8dIzdy9.js";
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,11 +1,11 @@
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-DCtLUYqR.js";
4
- import { m as GEN_TASKS } from "./config-NxPVkM-K.js";
5
- import { i as selectTasks, n as runTasks, r as parseTasks } from "./gen-tasks-DmDvgVBV.js";
3
+ import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-DqrbS0sS.js";
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-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-D8dIzdy9.js";
8
- import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-B3Rowfv5.js";
7
+ import { F as restrictSchemas, I as serializeGenerator, d as loadSnapshot, h as serializeSnapshot } from "./sql-layout-Bl3iOXMS.js";
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. */
11
11
  const SAVE_SNAPSHOT_ARGS = {
@@ -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-0bMsZ1VV.js";
3
- import { l as catalogFingerprint } from "./cache-sR8AQqSV.js";
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
- import { g as isGenTask, m as GEN_TASKS } from "./config-NxPVkM-K.js";
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-1HMiZhFF.js";
8
- import { t as runSeed } from "./seed-DVKgi-7l.js";
9
- import { r as specOptionsFromConfig, t as runSpec } from "./spec-COotILIk.js";
10
- import { t as addModules } from "./add-BQZyQh4f.js";
11
- import { n as listModules, t as printModule } from "./print-D9biMrfv.js";
12
- import { o as dataMigration, t as syncModules } from "./sync-Ceqa-3R6.js";
13
- import { t as upgrade } from "./upgrade-CUNKALDw.js";
14
- import { d as loadSnapshot } from "./sql-layout-D8dIzdy9.js";
7
+ import { n as runPowerSync } from "./powersync-CB-7AksZ.js";
8
+ import { t as runSeed } from "./seed-CvDA1ItH.js";
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
@@ -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.58.3";
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-DVdkD1MI.js";
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-DOz25g5T.js";
5
- import { n as runGen } from "./run-0bMsZ1VV.js";
6
- import { d as loadSnapshot, h as serializeSnapshot, m as parseSnapshot, y as introspect } from "./sql-layout-D8dIzdy9.js";
7
- import { a as emitModule, d as buildModel, t as GENERATED_HEADER } from "./emit-CTzFdffA.js";
8
- import { a as toCatalog, n as managementSource, r as pgSource } from "./source-BGVOuWXq.js";
9
- import { s as loadConfig } from "./config-NxPVkM-K.js";
10
- import { t as VERSION } from "./version-C7imaHag.js";
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
+ import { s as loadConfig } from "./config-DD_MnPRL.js";
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
@@ -1,17 +1,17 @@
1
- import { a as findConfig, s as loadConfig } from "./config-NxPVkM-K.js";
2
- import { r as contentMapperFiles } from "./content-mapper-DMi2HOKi.js";
3
- import { C as withConventions, S as promptConventions, _ as CONVENTION_ARGS, a as writeDesign, b as defaultConventions, c as createUrlParam, d as integrationFiles, f as overwrite, g as templatePlan, h as templateContextFor, i as blocksWiringPath, l as CANCELLED, m as parseIntegrations, o as readPresetInput, p as packagesFor, r as blockConfigImport, s as AUTHZ_NOTE, u as chooseIntegrations, v as CONVENTION_COMPLETIONS, x as hasConventionFlags, y as conventionFlags } from "./add-dbBQf6Vy.js";
1
+ import { a as findConfig, s as loadConfig } from "./config-DD_MnPRL.js";
2
+ import { r as contentMapperFiles } from "./content-mapper-DAYxPQ18.js";
3
+ import { C as withConventions, S as promptConventions, _ as CONVENTION_ARGS, a as writeDesign, b as defaultConventions, c as createUrlParam, d as integrationFiles, f as overwrite, g as templatePlan, h as templateContextFor, i as blocksWiringPath, l as CANCELLED, m as parseIntegrations, o as readPresetInput, p as packagesFor, r as blockConfigImport, s as AUTHZ_NOTE, u as chooseIntegrations, v as CONVENTION_COMPLETIONS, x as hasConventionFlags, y as conventionFlags } from "./add-OllEkXon.js";
4
4
  import { a as list, m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
5
5
  import { n as CliError } from "./errors-B7i-VGxk.js";
6
6
  import { c as insideRoot, i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-NnXnawki.js";
7
7
  import { r as readIfExists } from "./io-CngfGyMA.js";
8
- import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-BvJ-JK5n.js";
9
- import { c as enablePgDelta, t as syncModules } from "./sync-Ceqa-3R6.js";
10
- import { A as suggestedPackage, d as loadSnapshot, h as serializeSnapshot, k as detectWorkspace } from "./sql-layout-D8dIzdy9.js";
11
- import { a as toCatalog } from "./source-BGVOuWXq.js";
12
- import { c as TYPEGEN_VERSION } from "./cache-sR8AQqSV.js";
8
+ import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-C1Ysrthi.js";
9
+ import { c as enablePgDelta, t as syncModules } from "./sync-Cw0ke-3h.js";
10
+ import { A as suggestedPackage, d as loadSnapshot, h as serializeSnapshot, k as detectWorkspace } from "./sql-layout-Bl3iOXMS.js";
11
+ import { a as toCatalog } from "./source-DdqeWoO4.js";
12
+ import { c as TYPEGEN_VERSION } from "./cache-B0JnXfiY.js";
13
13
  import { n as installCommand, t as detectProject } from "./detect-CHR-SAmE.js";
14
- import { t as appTablePlan } from "./app-table-files-CITEmvRS.js";
14
+ import { t as appTablePlan } from "./app-table-files-DnoDAkVJ.js";
15
15
  import { i as plain } from "./style-B5-nByxb.js";
16
16
  import { existsSync } from "node:fs";
17
17
  import { join, posix, resolve } from "node:path";
@@ -1,6 +1,6 @@
1
1
  import { r as errorText } from "./errors-B7i-VGxk.js";
2
- import "./source-BGVOuWXq.js";
3
- import { c as qualified, l as tableObject, r as exposed, t as catalogOf } from "./shared-D2i8_u-U.js";
2
+ import "./source-DdqeWoO4.js";
3
+ import { c as qualified, l as tableObject, r as exposed, t as catalogOf } from "./shared-d021xfdn.js";
4
4
  // src/cli/doctor/reserved-roles.ts
5
5
  /**
6
6
  * Supautils' `reserved_roles` on Supabase. Nobody but a superuser may alter,
@@ -1,9 +1,9 @@
1
1
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
- import { a as errorDocument, i as run } from "./run-DVdkD1MI.js";
2
+ import { a as errorDocument, i as run } from "./run-CByEIEng.js";
3
3
  import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, t as PROCESS_ENV, x as object } from "./env-CQ831uY0.js";
4
4
  import { n as consentDigest } from "./agent-BlYLJPzM.js";
5
5
  import { n as CliError } from "./errors-B7i-VGxk.js";
6
- import { t as VERSION } from "./version-C7imaHag.js";
6
+ import { t as VERSION } from "./version-Bd3kCDzL.js";
7
7
  import { createInterface } from "node:readline";
8
8
  import { answerLine } from "better-supabase/mcp";
9
9
  // src/cli/mcp/server.ts
@@ -1,5 +1,5 @@
1
1
  import { t as generatorHash } from "./generator-hash-BkdtEywR.js";
2
- import { t as VERSION } from "./version-C7imaHag.js";
2
+ import { t as VERSION } from "./version-Bd3kCDzL.js";
3
3
  import { n as cacheEnabled, r as cacheRoot } from "./store-DP-nmqBt.js";
4
4
  import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
5
5
  import { dirname, resolve } from "node:path";
@@ -1,9 +1,9 @@
1
1
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
2
2
  import { i as readStdin } from "./io-CngfGyMA.js";
3
- import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-0bMsZ1VV.js";
4
- import { P as parseMetadataDocument, j as MetadataRejectedError } from "./sql-layout-D8dIzdy9.js";
5
- import { c as metaPaths } from "./emit-CTzFdffA.js";
6
- import { n as render } from "./render-DOz25g5T.js";
3
+ import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-D_z9ULO7.js";
4
+ import { P as parseMetadataDocument, j as MetadataRejectedError } from "./sql-layout-Bl3iOXMS.js";
5
+ import { c as metaPaths } from "./emit-CICey-Za.js";
6
+ import { n as render } from "./render-3J7sk_CL.js";
7
7
  import { basename, join, relative, resolve, sep } from "node:path";
8
8
  import { readFile } from "node:fs/promises";
9
9
  import { jsonSchema } from "better-supabase/generators/json-schema";
@@ -1,6 +1,6 @@
1
1
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
2
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-NnXnawki.js";
3
- import { t as appTablePlan } from "./app-table-files-CITEmvRS.js";
3
+ import { t as appTablePlan } from "./app-table-files-DnoDAkVJ.js";
4
4
  import { i as plain } from "./style-B5-nByxb.js";
5
5
  // src/cli/commands/migrate.ts
6
6
  const MIGRATE_ARGS = {};
@@ -1,5 +1,5 @@
1
- import { h as INTEGRATIONS } from "./config-NxPVkM-K.js";
2
- import { l as schemaModulePath } from "./emit-CTzFdffA.js";
1
+ import { h as INTEGRATIONS } from "./config-DD_MnPRL.js";
2
+ import { l as schemaModulePath } from "./emit-CICey-Za.js";
3
3
  import { dirname, join, posix } from "node:path";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { splitStatements } from "better-supabase/sql";
@@ -1,5 +1,5 @@
1
1
  import { i as changeLines, r as applyPlan } from "./files-NnXnawki.js";
2
- import { i as migrationsDir, l as sqlPlan } from "./sql-layout-D8dIzdy9.js";
2
+ import { i as migrationsDir, l as sqlPlan } from "./sql-layout-Bl3iOXMS.js";
3
3
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-B6-eEV5p.js";
4
4
  import { n as migrationFile, t as hasMigrationSuffix } from "./migration-names-7zAdXfcd.js";
5
5
  import { resolve } from "node:path";
@@ -1,10 +1,10 @@
1
- import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-NxPVkM-K.js";
1
+ import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-DD_MnPRL.js";
2
2
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-BlYLJPzM.js";
3
3
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
4
4
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
5
5
  import { t as connect } from "./db-B_xr3ZvK.js";
6
- import { n as ident } from "./live-DjjMID3V.js";
7
- import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-B3Rowfv5.js";
6
+ import { n as ident } from "./live-Ce8vdcCn.js";
7
+ import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-yU6N6JLm.js";
8
8
  // src/cli/commands/partition.ts
9
9
  const DEFAULT_BATCH = 5e4;
10
10
  const PROCEDURE = "convert_audit_log_to_partitioned";
@@ -1,11 +1,11 @@
1
1
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
2
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-NnXnawki.js";
3
3
  import { t as projectionsOf } from "./projection-DlVB5YL-.js";
4
- import { c as snapshotColumnTypes, i as migrationsDir, n as appSchemaTexts, s as schemasDirOf } from "./sql-layout-D8dIzdy9.js";
4
+ import { c as snapshotColumnTypes, i as migrationsDir, n as appSchemaTexts, s as schemasDirOf } from "./sql-layout-Bl3iOXMS.js";
5
5
  import { n as migrationFile, t as hasMigrationSuffix } from "./migration-names-7zAdXfcd.js";
6
- import { r as layoutFor } from "./providers-C5fw9XC_.js";
7
- import { n as renderBlocksCached } from "./render-cache-CInSNFhV.js";
8
- import { d as subjectFromTag } from "./config-NxPVkM-K.js";
6
+ import { r as layoutFor } from "./providers-B3FLmlud.js";
7
+ import { n as renderBlocksCached } from "./render-cache-P4gQeivH.js";
8
+ import { d as subjectFromTag } from "./config-DD_MnPRL.js";
9
9
  import { existsSync } from "node:fs";
10
10
  import { join, resolve } from "node:path";
11
11
  import { readFile, readdir } from "node:fs/promises";
@@ -0,0 +1 @@
1
+ export { t as powersyncStreamsCommand } from "./powersync-CB-7AksZ.js";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-B7i-VGxk.js";
2
- import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-Dv6VV1om.js";
3
- import { n as layout } from "./providers-C5fw9XC_.js";
2
+ import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-DXI95fqs.js";
3
+ import { n as layout } from "./providers-B3FLmlud.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { resolve } from "node:path";
6
6
  import { SQL_MODULES, contractSignature, customContracts, moduleBody, moduleFilePaths } from "better-supabase/sql";
@@ -1,7 +1,7 @@
1
1
  import { a as entitlementsMode, o as moduleKeyProblems, t as accessProviderMode } from "./authorization-CNWhpdKb.js";
2
2
  import { n as CliError } from "./errors-B7i-VGxk.js";
3
3
  import { t as compiledReadSets } from "./read-sets-77o7SxpK.js";
4
- import { a as moduleLayoutFor, s as schemasDirOf } from "./sql-layout-D8dIzdy9.js";
4
+ import { a as moduleLayoutFor, s as schemasDirOf } from "./sql-layout-Bl3iOXMS.js";
5
5
  import { moduleLayout, modulePermissionKeys, resolveBlocks } from "better-supabase/sql";
6
6
  import { FormerPermissionKeyError } from "better-supabase/config";
7
7
  // src/cli/sql/providers.ts
@@ -1,10 +1,10 @@
1
- import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-NxPVkM-K.js";
1
+ import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-DD_MnPRL.js";
2
2
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-BlYLJPzM.js";
3
3
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
4
4
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
5
5
  import { t as connect } from "./db-B_xr3ZvK.js";
6
- import { n as ident } from "./live-DjjMID3V.js";
7
- import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-B3Rowfv5.js";
6
+ import { n as ident } from "./live-Ce8vdcCn.js";
7
+ import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-yU6N6JLm.js";
8
8
  // src/cli/commands/prune-workflows.ts
9
9
  const TERMINAL = [
10
10
  "completed",
@@ -2,15 +2,15 @@ import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
2
  import { n as CliError } from "./errors-B7i-VGxk.js";
3
3
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-NnXnawki.js";
4
4
  import { r as readIfExists, t as display } from "./io-CngfGyMA.js";
5
- import { h as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-dbBQf6Vy.js";
5
+ import { h as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-OllEkXon.js";
6
6
  import { t as detectProject } from "./detect-CHR-SAmE.js";
7
- import { l as sqlPlan } from "./sql-layout-D8dIzdy9.js";
8
- import { _ as tidyInline, c as cutRange, i as addBlocksToJson, l as mask, n as isComposite, o as closingIndex, r as addBlocksToConfig, s as configObject, u as properties, v as wiringBlocks } from "./add-BQZyQh4f.js";
7
+ import { l as sqlPlan } from "./sql-layout-Bl3iOXMS.js";
8
+ import { _ as tidyInline, c as cutRange, i as addBlocksToJson, l as mask, n as isComposite, o as closingIndex, r as addBlocksToConfig, s as configObject, u as properties, v as wiringBlocks } from "./add-djLR310z.js";
9
9
  import { t as SQL_ARGS } from "./args-CS_64_tg.js";
10
- import { r as layoutFor } from "./providers-C5fw9XC_.js";
11
- import { n as guardedRemoval } from "./sync-Ceqa-3R6.js";
10
+ import { r as layoutFor } from "./providers-B3FLmlud.js";
11
+ import { n as guardedRemoval } from "./sync-Cw0ke-3h.js";
12
12
  import { i as plain } from "./style-B5-nByxb.js";
13
- import { t as blockNames } from "./blocks-D-DV2aCE.js";
13
+ import { t as blockNames } from "./blocks-Cvs0nhC2.js";
14
14
  import { existsSync } from "node:fs";
15
15
  import { resolve } from "node:path";
16
16
  import { readFile } from "node:fs/promises";
@@ -1,14 +1,14 @@
1
1
  import { n as importPath } from "./io-CngfGyMA.js";
2
2
  import { n as cacheEnabled, t as CACHE_DIR } from "./store-DP-nmqBt.js";
3
3
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
4
- import { o as typesModuleKey, r as cachedTypesModule, s as writeAtomic, t as cachedDatabaseTypes } from "./cache-sR8AQqSV.js";
5
- import { t as VERSION } from "./version-C7imaHag.js";
6
- import { M as generateDatabaseTypes, N as oxfmtInstalled, n as appSchemaTexts, t as appColumnsFor, x as apiTypeSchemas } from "./sql-layout-D8dIzdy9.js";
4
+ import { o as typesModuleKey, r as cachedTypesModule, s as writeAtomic, t as cachedDatabaseTypes } from "./cache-B0JnXfiY.js";
5
+ import { t as VERSION } from "./version-Bd3kCDzL.js";
6
+ import { M as generateDatabaseTypes, N as oxfmtInstalled, n as appSchemaTexts, t as appColumnsFor, x as apiTypeSchemas } from "./sql-layout-Bl3iOXMS.js";
7
7
  import { t as isRecord$1 } from "./guards-DxwRG0Uv.js";
8
- import { _ as prop, a as emitModule, b as singular, c as metaPaths, d as buildModel$1, f as generatorModel, g as pascal$2, h as identifier, i as emitMeta, l as schemaModulePath, n as emitFunctions, o as emitRuntime, r as emitFunctionsTypes, s as emitSchemaModule, t as GENERATED_HEADER, u as valueLists, v as q, x as applyCasing, y as runtimeSubpath } from "./emit-CTzFdffA.js";
8
+ import { _ as prop, a as emitModule, b as singular, c as metaPaths, d as buildModel$1, f as generatorModel, g as pascal$2, h as identifier, i as emitMeta, l as schemaModulePath, n as emitFunctions, o as emitRuntime, r as emitFunctionsTypes, s as emitSchemaModule, t as GENERATED_HEADER, u as valueLists, v as q, x as applyCasing, y as runtimeSubpath } from "./emit-CICey-Za.js";
9
9
  import { t as byCodePoint } from "./compare-yl4sSwVn.js";
10
10
  import { t as projectionsOf } from "./projection-DlVB5YL-.js";
11
- import { u as withTableTags } from "./config-NxPVkM-K.js";
11
+ import { u as withTableTags } from "./config-DD_MnPRL.js";
12
12
  import { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
13
13
  import { readFile } from "node:fs/promises";
14
14
  import { createHash } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
2
- import { t as VERSION } from "./version-C7imaHag.js";
2
+ import { t as VERSION } from "./version-Bd3kCDzL.js";
3
3
  import { t as generatorHash } from "./generator-hash-BkdtEywR.js";
4
4
  import { dirname, resolve } from "node:path";
5
5
  import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
@@ -0,0 +1,238 @@
1
+ import { t as codeRanges } from "./code-ranges-uTOKmIXC.js";
2
+ // src/cli/doctor/source-scan.ts
3
+ /**
4
+ * Source scanning shared by the code checks: brackets and statements in code
5
+ * with strings and comments blanked, and line-independent finding targets.
6
+ */
7
+ const OPEN = /* @__PURE__ */ new Set([
8
+ "(",
9
+ "[",
10
+ "{"
11
+ ]);
12
+ const CLOSE = /* @__PURE__ */ new Set([
13
+ ")",
14
+ "]",
15
+ "}"
16
+ ]);
17
+ /** `text` with strings, template literals and comments blanked, offsets kept. */
18
+ function codeOnly(text) {
19
+ let out = "";
20
+ let last = 0;
21
+ const blank = (part) => part.replaceAll(/[^\n]/g, " ");
22
+ for (const [start, end] of codeRanges(text)) {
23
+ out += blank(text.slice(last, start)) + text.slice(start, end);
24
+ last = end;
25
+ }
26
+ return out + blank(text.slice(last));
27
+ }
28
+ /** The index of the bracket that closes the one at `open`. */
29
+ function closeOf(code, open) {
30
+ let depth = 0;
31
+ for (let index = open; index < code.length; index += 1) {
32
+ const char = code.charAt(index);
33
+ if (OPEN.has(char)) depth += 1;
34
+ else if (CLOSE.has(char)) {
35
+ depth -= 1;
36
+ if (depth === 0) return index;
37
+ }
38
+ }
39
+ return code.length;
40
+ }
41
+ /** The end of the statement or expression that starts at `from`. */
42
+ function statementEnd(code, from) {
43
+ let depth = 0;
44
+ for (let index = from; index < code.length; index += 1) {
45
+ const char = code.charAt(index);
46
+ if (OPEN.has(char)) depth += 1;
47
+ else if (CLOSE.has(char)) {
48
+ if (depth === 0) return index;
49
+ depth -= 1;
50
+ } else if ((char === ";" || char === ",") && depth === 0) return index;
51
+ }
52
+ return code.length;
53
+ }
54
+ const WRAPPED_CALL = /(?<![\w$.])([\w$]+)\s*=\s*(?:await\s+)?[\w$.]+\s*(?:<[^>()]*>)?\s*\(/g;
55
+ const FUNCTION_HEAD = /(?<![\w$.])(?:function\s*\*?\s*([\w$]+)\s*(?:<[^>()]*>)?\s*\(|([\w$]+)\s*(?:[:=]\s*(?:[\w$.]+\s*(?:<[^>()]*>)?\s*\(\s*)*(?:async\s+)?(?:function\b[^(]*\(|(?:<[^>()]*>)?\s*\(|[\w$]+\s*=>)|(?:<[^>()]*>)?\s*\())/g;
56
+ const NOT_A_FUNCTION = /* @__PURE__ */ new Set([
57
+ "if",
58
+ "for",
59
+ "while",
60
+ "switch",
61
+ "catch",
62
+ "return",
63
+ "await",
64
+ "typeof",
65
+ "new",
66
+ "super",
67
+ "function"
68
+ ]);
69
+ /**
70
+ * Where the return type annotation that may start at `from` ends: at the body
71
+ * `{` or the `=>`. `Promise<{ a: string }>` and `{ a: string }` are types.
72
+ */
73
+ function returnTypeEnd(code, from) {
74
+ let index = from;
75
+ while (/\s/.test(code.charAt(index))) index += 1;
76
+ if (code.charAt(index) !== ":") return index;
77
+ let angle = 0;
78
+ let expectType = true;
79
+ for (index += 1; index < code.length; index += 1) {
80
+ const char = code.charAt(index);
81
+ if (/\s/.test(char)) continue;
82
+ if (char === "=" && code.charAt(index + 1) === ">") {
83
+ if (angle === 0 && !expectType) return index;
84
+ index += 1;
85
+ expectType = true;
86
+ } else if (char === "<") {
87
+ angle += 1;
88
+ expectType = true;
89
+ } else if (char === ">") {
90
+ angle -= 1;
91
+ expectType = false;
92
+ } else if (char === "(" || char === "[") {
93
+ index = closeOf(code, index);
94
+ expectType = false;
95
+ } else if (char === "{") {
96
+ if (angle === 0 && !expectType) return index;
97
+ index = closeOf(code, index);
98
+ expectType = false;
99
+ } else if (char === ";" || char === "=" || char === ")" || char === "}") return -1;
100
+ else expectType = "|&,:".includes(char);
101
+ }
102
+ return -1;
103
+ }
104
+ /**
105
+ * Functions, methods and arrow functions bound to a name, with their bodies:
106
+ * `function load(`, `const load = async (`, `load: (`, `load() {`, `const load
107
+ * = cache(async (`.
108
+ */
109
+ function functionsIn(code) {
110
+ const functions = [];
111
+ for (const match of code.matchAll(FUNCTION_HEAD)) {
112
+ const name = match[1] ?? match[2];
113
+ if (NOT_A_FUNCTION.has(name)) continue;
114
+ const head = match[0];
115
+ const last = match.index + head.length - 1;
116
+ const arrowParam = !head.endsWith("(");
117
+ const declared = match[1] !== void 0 || /function\b/.test(head);
118
+ const method = !declared && !/[:=]/.test(head);
119
+ const afterParams = arrowParam ? last + 1 : closeOf(code, last) + 1;
120
+ const typeEnd = arrowParam ? afterParams : returnTypeEnd(code, afterParams);
121
+ if (typeEnd === -1) continue;
122
+ let start;
123
+ if (arrowParam) start = typeEnd;
124
+ else if (declared || method) {
125
+ if (code.charAt(typeEnd) !== "{") continue;
126
+ start = typeEnd;
127
+ } else {
128
+ if (!code.startsWith("=>", typeEnd)) continue;
129
+ start = typeEnd + 2;
130
+ }
131
+ const open = /^\s*\{/.test(code.slice(start, start + 200)) ? code.indexOf("{", start) : -1;
132
+ const end = open === -1 ? statementEnd(code, start) : closeOf(code, open);
133
+ functions.push({
134
+ name,
135
+ start,
136
+ end
137
+ });
138
+ }
139
+ for (const match of code.matchAll(WRAPPED_CALL)) {
140
+ const open = match.index + match[0].length - 1;
141
+ functions.push({
142
+ name: match[1],
143
+ start: open,
144
+ end: closeOf(code, open),
145
+ wrapped: true
146
+ });
147
+ }
148
+ return functions;
149
+ }
150
+ /** The innermost named function around `at`, or `<module>`. */
151
+ function functionAt(functions, at) {
152
+ const inside = functions.filter((candidate) => candidate.start <= at && at < candidate.end);
153
+ const named = inside.filter((candidate) => candidate.wrapped !== true);
154
+ const size = (item) => item.end - item.start;
155
+ return (named.length > 0 ? named.reduce((a, b) => size(b) < size(a) ? b : a) : inside.reduce((a, b) => a === void 0 || size(b) > size(a) ? b : a, void 0))?.name ?? "<module>";
156
+ }
157
+ /**
158
+ * Line-independent targets: `path#function:callee`, with `#2`, `#3` for the
159
+ * second and later call of the same callee in one function. An edit elsewhere
160
+ * in the file keeps them.
161
+ */
162
+ function targetKeys(path, functions, calls) {
163
+ const seen = /* @__PURE__ */ new Map();
164
+ const keys = /* @__PURE__ */ new Map();
165
+ for (const call of calls.toSorted((a, b) => a.start - b.start)) {
166
+ const key = `${path}#${functionAt(functions, call.start)}:${call.callee}`;
167
+ const count = (seen.get(key) ?? 0) + 1;
168
+ seen.set(key, count);
169
+ keys.set(call.start, count === 1 ? key : `${key}#${String(count)}`);
170
+ }
171
+ return keys;
172
+ }
173
+ // src/cli/doctor/round-trips.ts
174
+ const PROMISE_ALL = /\bPromise\.all\s*\(\s*\[/g;
175
+ /**
176
+ * Parts of the array literal that starts after `open`, split at top-level
177
+ * commas.
178
+ */
179
+ function arrayEntries(text, open) {
180
+ const entries = [];
181
+ let depth = 0;
182
+ let start = open;
183
+ for (let index = open; index < text.length; index += 1) {
184
+ const char = text.charAt(index);
185
+ if (char === "(" || char === "[" || char === "{") depth += 1;
186
+ else if (char === ")" || char === "}") depth -= 1;
187
+ else if (char === "]") {
188
+ if (depth === 0) {
189
+ entries.push(text.slice(start, index));
190
+ return entries;
191
+ }
192
+ depth -= 1;
193
+ } else if (char === "," && depth === 0) {
194
+ entries.push(text.slice(start, index));
195
+ start = index + 1;
196
+ }
197
+ }
198
+ }
199
+ /** An entry that awaits the database: a repository, a block client or a call. */
200
+ const DATABASE_READ = /\b(?:db|ctx\.db|bsb\.db\(\)|blocks\.\w+)\b[\s\S]*?\(|\$rpc\s*\(/;
201
+ function parallelReads(context) {
202
+ const findings = [];
203
+ for (const file of context.sources) {
204
+ const waves = [];
205
+ for (const match of file.text.matchAll(PROMISE_ALL)) {
206
+ const open = match.index + match[0].length;
207
+ const reads = arrayEntries(file.text, open)?.filter((entry) => DATABASE_READ.test(entry));
208
+ if (reads === void 0 || reads.length < context.config.doctor.parallelReads) continue;
209
+ waves.push({
210
+ start: match.index,
211
+ callee: "Promise.all",
212
+ reads: reads.length
213
+ });
214
+ }
215
+ if (waves.length === 0) continue;
216
+ const keys = targetKeys(file.path, functionsIn(codeOnly(file.text)), waves);
217
+ for (const wave of waves) {
218
+ const line = file.text.slice(0, wave.start).split("\n").length;
219
+ findings.push({
220
+ message: `${file.path} awaits ${wave.reads} database reads in one Promise.all. They run in parallel, but each is its own request. Load them in one call with a read set: defineReadSet(db, "name", { ... }) and db.$many(readSet, params) (or bsb.bootstrap for a page's first load).`,
221
+ target: keys.get(wave.start),
222
+ location: {
223
+ file: file.path,
224
+ line
225
+ }
226
+ });
227
+ }
228
+ }
229
+ return findings;
230
+ }
231
+ const ROUND_TRIP_RULES = [{
232
+ code: "BS609",
233
+ severity: "info",
234
+ title: "Three or more database reads in one Promise.all",
235
+ description: "A page that loads its data with several parallel reads makes one request each. A read set compiles the same reads into one stable database function, so the page waits on one round trip and RLS applies as for any read.",
236
+ check: parallelReads
237
+ }];
238
+ export { OPEN as a, functionsIn as c, CLOSE as i, statementEnd as l, ROUND_TRIP_RULES as n, closeOf as o, arrayEntries as r, codeOnly as s, PROMISE_ALL as t, targetKeys as u };