better-supabase 0.23.0 → 0.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/dist/{access-sql-bjWFUWlk.js → access-sql-CTDNuxRv.js} +177 -12
  2. package/dist/{ai-schedules-7uQNMXve.d.ts → ai-schedules-yGZH-vQb.d.ts} +1 -1
  3. package/dist/ai-sdk/agents/index.d.ts +2 -2
  4. package/dist/ai-sdk/batches/index.d.ts +1 -1
  5. package/dist/ai-sdk/index.d.ts +1 -1
  6. package/dist/ai-sdk/mcp/index.d.ts +3 -3
  7. package/dist/{api-CHObZL7m.d.ts → api-B1OkIWdx.d.ts} +3 -3
  8. package/dist/{api-keys-D5k63K6y.d.ts → api-keys-ClhKBDcc.d.ts} +1 -1
  9. package/dist/{app-tables-CJO6pWwy.d.ts → app-tables-62GqZIhd.d.ts} +1 -1
  10. package/dist/{approvals-Dh9dUXrN.d.ts → approvals-C5fmPLsH.d.ts} +1 -1
  11. package/dist/astro/index.d.ts +5 -5
  12. package/dist/{authorization-Dtwpjeuz.d.ts → authorization-BCG1v0iC.d.ts} +73 -15
  13. package/dist/{authorization-hooks-D_pwXlBs.d.ts → authorization-hooks-DtzreCAq.d.ts} +1 -1
  14. package/dist/{automations-FCnWy387.js → automations-8L3NEuoq.js} +4 -1
  15. package/dist/{availability-vguUvEK2.d.ts → availability-BdeKCHpl.d.ts} +10 -0
  16. package/dist/better-result/index.d.ts +2 -2
  17. package/dist/{bind-DaoTunvE.d.ts → bind-C54jD0r3.d.ts} +4 -4
  18. package/dist/{block-env-DUyo2I5O.d.ts → block-env-CM-LFfj4.d.ts} +4 -4
  19. package/dist/blocks/access-requests/index.d.ts +2 -2
  20. package/dist/blocks/activities/index.d.ts +3 -3
  21. package/dist/blocks/agents/index.d.ts +2 -2
  22. package/dist/blocks/ai-cache/index.d.ts +1 -1
  23. package/dist/blocks/ai-chat/index.d.ts +5 -5
  24. package/dist/blocks/ai-files/index.d.ts +1 -1
  25. package/dist/blocks/ai-keys/index.d.ts +3 -3
  26. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  27. package/dist/blocks/announcements/index.d.ts +5 -5
  28. package/dist/blocks/api-keys/index.d.ts +5 -5
  29. package/dist/blocks/approvals/index.d.ts +3 -3
  30. package/dist/blocks/assets/index.d.ts +2 -2
  31. package/dist/blocks/assignment/index.d.ts +3 -3
  32. package/dist/blocks/attachments/index.d.ts +3 -3
  33. package/dist/blocks/audit/index.d.ts +7 -7
  34. package/dist/blocks/automations/index.d.ts +5 -5
  35. package/dist/blocks/billable-time/index.d.ts +2 -2
  36. package/dist/blocks/billing/index.d.ts +5 -5
  37. package/dist/blocks/bookings/index.d.ts +6 -6
  38. package/dist/blocks/bulk/index.d.ts +2 -2
  39. package/dist/blocks/calendar/index.d.ts +46 -13
  40. package/dist/blocks/calendar/index.js +130 -30
  41. package/dist/blocks/catalog/index.d.ts +2 -2
  42. package/dist/blocks/channels/index.d.ts +3 -3
  43. package/dist/blocks/collections/index.d.ts +3 -3
  44. package/dist/blocks/comments/index.d.ts +5 -5
  45. package/dist/blocks/compliance/index.d.ts +2 -2
  46. package/dist/blocks/connectors/index.d.ts +3 -3
  47. package/dist/blocks/contacts/index.d.ts +3 -3
  48. package/dist/blocks/content/index.d.ts +2 -2
  49. package/dist/blocks/contracts/index.d.ts +2 -2
  50. package/dist/blocks/courses/index.d.ts +2 -2
  51. package/dist/blocks/created-by/index.d.ts +1 -1
  52. package/dist/blocks/custom-fields/index.d.ts +2 -2
  53. package/dist/blocks/custom-fields/index.js +1 -1
  54. package/dist/blocks/data-lifecycle/index.d.ts +4 -4
  55. package/dist/blocks/deals/index.d.ts +3 -3
  56. package/dist/blocks/dispatch/index.d.ts +2 -2
  57. package/dist/blocks/documents/index.d.ts +2 -2
  58. package/dist/blocks/domains/index.d.ts +2 -2
  59. package/dist/blocks/donations/index.d.ts +2 -2
  60. package/dist/blocks/drive/index.d.ts +4 -4
  61. package/dist/blocks/employees/index.d.ts +21 -6
  62. package/dist/blocks/employees/index.js +37 -2
  63. package/dist/blocks/enrichment/index.d.ts +3 -3
  64. package/dist/blocks/enrollments/index.d.ts +2 -2
  65. package/dist/blocks/entitlements/index.d.ts +3 -3
  66. package/dist/blocks/expenses/index.d.ts +2 -2
  67. package/dist/blocks/field-history/index.d.ts +1 -1
  68. package/dist/blocks/flags/index.d.ts +2 -2
  69. package/dist/blocks/forecasts/index.d.ts +3 -3
  70. package/dist/blocks/forms/index.d.ts +3 -3
  71. package/dist/blocks/goals/index.d.ts +1 -1
  72. package/dist/blocks/guests/index.d.ts +2 -2
  73. package/dist/blocks/hiring/index.d.ts +13 -6
  74. package/dist/blocks/hiring/index.js +15 -4
  75. package/dist/blocks/identities/index.d.ts +2 -2
  76. package/dist/blocks/imports/index.d.ts +2 -2
  77. package/dist/blocks/inbox/index.d.ts +6 -6
  78. package/dist/blocks/incidents/index.d.ts +2 -2
  79. package/dist/blocks/index.d.ts +4 -4
  80. package/dist/blocks/inventory/index.d.ts +2 -2
  81. package/dist/blocks/invoices/index.d.ts +3 -3
  82. package/dist/blocks/knowledge/index.d.ts +1 -1
  83. package/dist/blocks/lead-scoring/index.d.ts +1 -1
  84. package/dist/blocks/leases/index.d.ts +2 -2
  85. package/dist/blocks/leave/index.d.ts +2 -2
  86. package/dist/blocks/ledger/index.d.ts +2 -2
  87. package/dist/blocks/mail-sync/index.d.ts +3 -3
  88. package/dist/blocks/memberships/index.d.ts +1 -1
  89. package/dist/blocks/memory/index.d.ts +1 -1
  90. package/dist/blocks/messaging/index.d.ts +7 -7
  91. package/dist/blocks/metrics/index.d.ts +2 -2
  92. package/dist/blocks/mfa/index.d.ts +2 -2
  93. package/dist/blocks/moderation/index.d.ts +2 -2
  94. package/dist/blocks/notifications/index.d.ts +7 -7
  95. package/dist/blocks/numbering/index.d.ts +2 -2
  96. package/dist/blocks/oauth-server/index.d.ts +2 -2
  97. package/dist/blocks/onboarding/index.d.ts +2 -2
  98. package/dist/blocks/orders/index.d.ts +3 -3
  99. package/dist/blocks/organizations/index.d.ts +4 -4
  100. package/dist/blocks/outbox/index.d.ts +2 -2
  101. package/dist/blocks/passes/index.d.ts +3 -3
  102. package/dist/blocks/permissions/index.d.ts +3 -3
  103. package/dist/blocks/pipelines/index.d.ts +3 -3
  104. package/dist/blocks/posts/index.d.ts +2 -2
  105. package/dist/blocks/profiles/index.d.ts +1 -1
  106. package/dist/blocks/promotions/index.d.ts +2 -2
  107. package/dist/blocks/push/index.d.ts +3 -3
  108. package/dist/blocks/queue/index.d.ts +1 -1
  109. package/dist/blocks/quotes/index.d.ts +3 -3
  110. package/dist/blocks/rank/index.d.ts +1 -1
  111. package/dist/blocks/reactions/index.d.ts +5 -5
  112. package/dist/blocks/relations/index.d.ts +2 -2
  113. package/dist/blocks/reminders/index.d.ts +4 -4
  114. package/dist/blocks/reviews/index.d.ts +2 -2
  115. package/dist/blocks/saved-views/index.d.ts +4 -4
  116. package/dist/blocks/scores/index.d.ts +2 -2
  117. package/dist/blocks/search/index.d.ts +4 -4
  118. package/dist/blocks/security-events/index.d.ts +3 -3
  119. package/dist/blocks/segments/index.d.ts +3 -3
  120. package/dist/blocks/sequences/index.d.ts +2 -2
  121. package/dist/blocks/service-accounts/index.d.ts +2 -2
  122. package/dist/blocks/sessions/index.d.ts +2 -2
  123. package/dist/blocks/settings/index.d.ts +3 -3
  124. package/dist/blocks/share-links/index.d.ts +2 -2
  125. package/dist/blocks/shipments/index.d.ts +2 -2
  126. package/dist/blocks/signatures/index.d.ts +2 -2
  127. package/dist/blocks/signing-keys/index.d.ts +2 -2
  128. package/dist/blocks/sla/index.d.ts +3 -3
  129. package/dist/blocks/sso/index.d.ts +3 -3
  130. package/dist/blocks/state-machine/index.d.ts +2 -2
  131. package/dist/blocks/subjects/index.d.ts +2 -2
  132. package/dist/blocks/tags/index.d.ts +3 -3
  133. package/dist/blocks/tasks/index.d.ts +6 -6
  134. package/dist/blocks/tasks/index.js +1 -1
  135. package/dist/blocks/teams/index.d.ts +2 -2
  136. package/dist/blocks/templates/index.d.ts +4 -4
  137. package/dist/blocks/time-tracking/index.d.ts +10 -5
  138. package/dist/blocks/time-tracking/index.js +16 -9
  139. package/dist/blocks/timeline/index.d.ts +4 -4
  140. package/dist/blocks/trash/index.d.ts +2 -2
  141. package/dist/blocks/undo/index.d.ts +2 -2
  142. package/dist/blocks/updated-at/index.d.ts +1 -1
  143. package/dist/blocks/usage/index.d.ts +2 -2
  144. package/dist/blocks/vercel-marketplace/index.d.ts +2 -2
  145. package/dist/blocks/versions/index.d.ts +2 -2
  146. package/dist/blocks/waitlist/index.d.ts +2 -2
  147. package/dist/blocks/webhooks/index.d.ts +6 -6
  148. package/dist/blocks/workflow-editor/index.d.ts +7 -7
  149. package/dist/blocks/workflows/index.d.ts +5 -5
  150. package/dist/{bookings-BpCNphYp.d.ts → bookings-CVw5-Q0Z.d.ts} +1 -1
  151. package/dist/chat-sdk/index.d.ts +2 -2
  152. package/dist/cli/{add-DVHniZOO.js → add-BKcE_g9D.js} +2 -2
  153. package/dist/cli/{add-C7lKQNBL.js → add-DUyg9qna.js} +40 -15
  154. package/dist/cli/add-pDOlqWUa.js +1 -0
  155. package/dist/cli/{backfill-Lrn-Qp5X.js → backfill-r9RELEEh.js} +4 -4
  156. package/dist/cli/bin.js +1 -1
  157. package/dist/cli/{blocks-BKNd886C.js → blocks-DTOFdrxL.js} +1 -1
  158. package/dist/cli/{blocks-2Yw9t-_U.js → blocks-k1OG8XDs.js} +2 -2
  159. package/dist/cli/{cache-ByhPVMo-.js → cache-Czfw7Iow.js} +1 -1
  160. package/dist/cli/{codemod-C0eXpzFu.js → codemod-ClmbiLuL.js} +3 -3
  161. package/dist/cli/{command-BWEEXmtz.js → command-CVzTJSLp.js} +31 -0
  162. package/dist/cli/{completion-8EDK21xj.js → completion-CNCqE-Gb.js} +1 -1
  163. package/dist/cli/{completion-BfnKI4QZ.js → completion-Dpk6vh0p.js} +2 -2
  164. package/dist/cli/{completion-Bt7LMypX.js → completion-DxEXxFpz.js} +2 -2
  165. package/dist/cli/{config-CeaQMrvS.js → config-D2YUlzrl.js} +1 -1
  166. package/dist/cli/{config-WKDixoGK.js → config-EjNj3HfT.js} +1 -1
  167. package/dist/cli/{config-BVfeG3A5.js → config-KvV-sLZL.js} +290 -10
  168. package/dist/cli/{content-mapper-qH-_YQ8H.js → content-mapper-ez_mT0d4.js} +2 -2
  169. package/dist/cli/{db-DwjyUbAh.js → db-uYN6O5Eg.js} +38 -14
  170. package/dist/cli/{doctor-BnxkqXGA.js → doctor-BD9oo4MG.js} +31 -28
  171. package/dist/cli/{env-DMgjB_4y.js → env-BK0xKMeU.js} +1 -2
  172. package/dist/cli/{env-C-Bl6Awn.js → env-Bat6ogep.js} +1 -1
  173. package/dist/cli/env-Cy2lWBRC.js +1 -0
  174. package/dist/cli/{env-BCgVZkcb.js → env-DEAtgGoj.js} +2 -2
  175. package/dist/cli/{exec--Q1ZEWUW.js → exec-Ca5s-ygi.js} +1 -1
  176. package/dist/cli/{gen-aERmP3Sw.js → gen-8Ya8n2sA.js} +16 -16
  177. package/dist/cli/in-stack-diff-Cp-tVPj2.js +186 -0
  178. package/dist/cli/index.d.ts +1 -2
  179. package/dist/cli/index.js +8 -8
  180. package/dist/cli/{init-DWUqVSVW.js → init-DgL3sDfQ.js} +118 -11
  181. package/dist/cli/{keys-CbaL0lnw.js → keys-CsanNk-2.js} +1 -1
  182. package/dist/cli/{live-KcdTBUij.js → live-CMMEct_F.js} +2 -2
  183. package/dist/cli/{mcp-Dsjjo-LT.js → mcp-DEHtzAkq.js} +4 -4
  184. package/dist/cli/{metadata-DWQSIZ59.js → metadata-BZh-cOzC.js} +3 -3
  185. package/dist/cli/migrate-sVs1QYTM.js +306 -0
  186. package/dist/cli/{migration-safety-Cy7xlU4G.js → migration-safety-ClnYNMdq.js} +2 -2
  187. package/dist/cli/migrations-DWh38tO9.js +117 -0
  188. package/dist/cli/{module-migration-C6NLY9iZ.js → module-migration-CXfRJIV4.js} +2 -2
  189. package/dist/cli/{moved-DVwgE8lV.js → moved-Cnb4fp49.js} +1 -1
  190. package/dist/cli/{parse-B079x40m.js → parse-BWM6IGhF.js} +1 -1
  191. package/dist/cli/powersync-DURhWDVc.js +1 -0
  192. package/dist/cli/{powersync-CE_hQdgc.js → powersync-Dnyr-Wy5.js} +4 -3
  193. package/dist/cli/{print-Cy_ram9N.js → print-DJrSr56b.js} +2 -2
  194. package/dist/cli/{migrations-CUjNXokR.js → providers-CpaISitn.js} +4 -116
  195. package/dist/cli/{remove-DmwjzqaW.js → remove-ChaieK3t.js} +6 -6
  196. package/dist/cli/{render-CF09FCra.js → render-DUNJ4Pss.js} +8 -5
  197. package/dist/cli/{run-BYpZ8FjF.js → run-ChCQPYOh.js} +41 -39
  198. package/dist/cli/{run-lh-chAJW.js → run-Cl9COGuy.js} +10 -10
  199. package/dist/cli/{run-DmOTMa44.js → run-CxFDjL1Q.js} +4 -4
  200. package/dist/cli/seed-BJ7c-ktX.js +1 -0
  201. package/dist/cli/{seed-BMynpMPy.js → seed-BzVLTdRl.js} +3 -3
  202. package/dist/cli/{shared-D05A6t1e.js → shared-5uqc1GBj.js} +1 -1
  203. package/dist/cli/{skills-FXAVPLzp.js → skills-0gz_qjVb.js} +1 -1
  204. package/dist/cli/{snapshot-BITNbA5V.js → snapshot-DdAP7LWO.js} +3 -3
  205. package/dist/cli/{source-GGJHuzpH.js → source-2irbWSck.js} +1 -1
  206. package/dist/cli/{source-args-CDmmFmFG.js → source-args-DAcQt-Mh.js} +1 -1
  207. package/dist/cli/{spec-BGcRdlhN.js → spec-B7n4Rthp.js} +3 -3
  208. package/dist/cli/{spec-BjxXWaNQ.js → spec-_MS0ym5r.js} +1 -1
  209. package/dist/cli/{sql-layout-BoD5ynN9.js → sql-layout-DYKkQw1k.js} +21 -7
  210. package/dist/cli/{stack-DgASZP0K.js → stack-CteM33gC.js} +3 -3
  211. package/dist/cli/{stack-status-B_Ipd_-z.js → stack-status-BkkYRlXG.js} +1 -1
  212. package/dist/cli/{stacks-BYlQ96WS.js → stacks-CiDBH1dB.js} +1 -1
  213. package/dist/cli/{sync-_QlsTmqu.js → sync-DnSOrQuA.js} +4 -3
  214. package/dist/cli/table-DeH8X0qz.js +89 -0
  215. package/dist/cli/{upgrade-Cwhb1M7O.js → upgrade-CWdrC-K3.js} +5 -4
  216. package/dist/cli/{upgrade-n9ar1kc4.js → upgrade-cMy5fKkg.js} +3 -3
  217. package/dist/cli/{version-RSpJIWDd.js → version-C5RAWmrD.js} +1 -1
  218. package/dist/client/index.d.ts +5 -5
  219. package/dist/client/native/index.d.ts +4 -4
  220. package/dist/{cloud-event-CzZTJkXv.d.ts → cloud-event-DcJwder2.d.ts} +1 -1
  221. package/dist/{composite-ChzHhSB0.d.ts → composite-CWJvZgni.d.ts} +6 -6
  222. package/dist/config/index.d.ts +3 -3
  223. package/dist/config/index.js +4 -4
  224. package/dist/{config-RwpFcPq8.js → config-CTeR7XHK.js} +6 -5
  225. package/dist/{config-vHLJ8SKf.js → config-CvJHIy5q.js} +4 -3
  226. package/dist/{connectors-Fud4amxp.d.ts → connectors-CHGiffYH.d.ts} +1 -1
  227. package/dist/{context-CMf4OKpN.d.ts → context-BFEX0b7H.d.ts} +109 -4
  228. package/dist/{controller-BGto_kYM.d.ts → controller-Cl6HmMBk.d.ts} +1 -1
  229. package/dist/{conversion-DBgMck5U.d.ts → conversion-DlfStnln.d.ts} +1 -1
  230. package/dist/create/index.d.ts +62 -3
  231. package/dist/create/index.js +67 -4
  232. package/dist/create/lite/index.d.ts +140 -3
  233. package/dist/create/lite/index.js +399 -47
  234. package/dist/credentials/index.d.ts +3 -3
  235. package/dist/{define-Lf6rI2QN.d.ts → define-BLP6XtoL.d.ts} +1 -1
  236. package/dist/{define-block-DCAiOrNX.d.ts → define-block-DibVN37N.d.ts} +4 -4
  237. package/dist/edge/index.d.ts +8 -8
  238. package/dist/elysia/index.d.ts +1 -1
  239. package/dist/{ended-gUsMZVNg.d.ts → ended-B8RyuUXF.d.ts} +1 -1
  240. package/dist/{entitlements-CIhVQ-0u.d.ts → entitlements-Y-n4RGAd.d.ts} +2 -2
  241. package/dist/eve/index.d.ts +2 -2
  242. package/dist/{event-calendar-DCufbihU.d.ts → event-calendar-DVLs2wUO.d.ts} +1 -1
  243. package/dist/events/index.d.ts +3 -3
  244. package/dist/{events-vcqenSYU.d.ts → events-Cc9DDQWH.d.ts} +2 -0
  245. package/dist/{executor-DNK401lZ.d.ts → executor-C-Ox9eKq.d.ts} +1 -1
  246. package/dist/{executor-aFV7nEBs.d.ts → executor-DNPm13a9.d.ts} +2 -2
  247. package/dist/expo/index.d.ts +3 -3
  248. package/dist/{field-errors-BDhPaO0a.d.ts → field-errors-Btn3czyz.d.ts} +7 -7
  249. package/dist/{framework-DKA3fTHl.d.ts → framework-GlxXiotm.d.ts} +6 -6
  250. package/dist/h3/index.d.ts +1 -1
  251. package/dist/h3/v1/index.d.ts +1 -1
  252. package/dist/hono/index.d.ts +8 -8
  253. package/dist/{index-CFWlHuVY.d.ts → index-8wOL81rB.d.ts} +1 -1
  254. package/dist/{index-ClvuSZEz.d.ts → index-BfYDY6eh.d.ts} +3 -3
  255. package/dist/{index-ujNqgZ6B.d.ts → index-C0_cweyT.d.ts} +11 -11
  256. package/dist/{index--OhYKouV.d.ts → index-CAY7rIQs.d.ts} +3 -3
  257. package/dist/{index-CG9rA8H8.d.ts → index-C_qlBJ3k.d.ts} +2 -2
  258. package/dist/{index-iRkFvJ7J.d.ts → index-D1ckLbUM.d.ts} +1 -1
  259. package/dist/{index-lV43eM34.d.ts → index-DPMVWm_Z.d.ts} +4 -4
  260. package/dist/{index-4MStWaeF.d.ts → index-k-SyCzcQ.d.ts} +105 -120
  261. package/dist/index.d.ts +2 -2
  262. package/dist/{instances-BPJSESPx.js → instances-C7qUTjhJ.js} +85 -6
  263. package/dist/{kit-CVgQCIBO.d.ts → kit-Dxx3MT8m.d.ts} +3 -3
  264. package/dist/list/index.d.ts +1 -1
  265. package/dist/{list-query-XYfUZb0j.d.ts → list-query-XHoYDlRN.d.ts} +1 -1
  266. package/dist/mapper/bin.js +7 -7
  267. package/dist/mcp/index.d.ts +5 -5
  268. package/dist/mcp/sdk/index.d.ts +5 -5
  269. package/dist/nestjs/index.d.ts +2 -2
  270. package/dist/next/client/index.d.ts +1 -1
  271. package/dist/next/index.d.ts +21 -21
  272. package/dist/node/index.d.ts +2 -2
  273. package/dist/{operations-qSBBV5vl.d.ts → operations-DE7SOBw-.d.ts} +1 -1
  274. package/dist/{options-D4ADKTKo.js → options-B5E2MGIz.js} +6 -1
  275. package/dist/options-C4LuqmdG.js +15 -0
  276. package/dist/{options-D2s7fT1s.js → options-COo7_3MX.js} +2 -1
  277. package/dist/{options-D32-YxnO.js → options-DhoLMknl.js} +3 -1
  278. package/dist/{options-BPp2zzsz.js → options-eTepQ1rZ.js} +2 -1
  279. package/dist/orpc/index.d.ts +7 -7
  280. package/dist/otel/index.d.ts +1 -1
  281. package/dist/otel/index.js +4 -4
  282. package/dist/{outbox-HxjZTfF6.d.ts → outbox-DxZgoKwp.d.ts} +2 -2
  283. package/dist/{pool-CrtT4dg-.d.ts → pool-wjbAMqc1.d.ts} +1 -1
  284. package/dist/{ports-DbHiNSAa.d.ts → ports-DP0bthUk.d.ts} +1 -1
  285. package/dist/postgres/index.d.ts +1 -1
  286. package/dist/powersync/index.d.ts +3 -3
  287. package/dist/preset/index.d.ts +3 -3
  288. package/dist/preset/index.js +3 -3
  289. package/dist/{preset-B1xXOJ0T.js → preset-DwuWNBip.js} +2 -2
  290. package/dist/{project-BM6QMtzV.js → project-Bo1vZqVs.js} +5 -5
  291. package/dist/{provider-CqwEOLCA.d.ts → provider-ClrIplXa.d.ts} +1 -1
  292. package/dist/{push-token-BwF1fyjA.d.ts → push-token-v3xCcVU7.d.ts} +1 -1
  293. package/dist/query/index.d.ts +1 -1
  294. package/dist/react/index.d.ts +7 -7
  295. package/dist/react/native/index.d.ts +1 -1
  296. package/dist/react/server.d.ts +8 -8
  297. package/dist/react/session.d.ts +2 -2
  298. package/dist/react-router/index.d.ts +5 -5
  299. package/dist/realtime/index.d.ts +4 -4
  300. package/dist/realtime/index.js +1 -1
  301. package/dist/{record-form-BbZpwsEi.d.ts → record-form-D2-F4IwS.d.ts} +1 -1
  302. package/dist/records/index.d.ts +7 -7
  303. package/dist/{refresh-DT_ICaK-.d.ts → refresh-CCKB1Wa6.d.ts} +1 -1
  304. package/dist/{refusal-OrlI3g4H.d.ts → refusal-D_tklIEb.d.ts} +2 -2
  305. package/dist/{resolve-CXX6DHv3.d.ts → resolve-Bj1qD7Dy.d.ts} +1 -1
  306. package/dist/{resolved-names-WzRYhUez.js → resolved-names-iLBOUaib.js} +2 -2
  307. package/dist/{resource-execute-CUG6xUuh.d.ts → resource-execute-BSTIfp1D.d.ts} +1 -1
  308. package/dist/{resource-types-DjZ91WKA.d.ts → resource-types-D5WEvYtV.d.ts} +2 -2
  309. package/dist/{resources-6Ncdt9XT.d.ts → resources-CsZ7RhZC.d.ts} +1 -1
  310. package/dist/{respond-oZeJ342J.d.ts → respond-BzRG-0qc.d.ts} +1 -1
  311. package/dist/server/index.d.ts +20 -20
  312. package/dist/{server-types-BH6AjDBN.d.ts → server-types-BlDiY-ya.d.ts} +8 -8
  313. package/dist/{session-Y5SSYO2C.d.ts → session-BGP98Rgj.d.ts} +5 -5
  314. package/dist/{session-status-qQLm7jzh.d.ts → session-status-C4t7kbSn.d.ts} +2 -2
  315. package/dist/{sign-in-BAjR49fq.d.ts → sign-in-CAadgm33.d.ts} +2 -2
  316. package/dist/solid/index.d.ts +9 -9
  317. package/dist/solid-start/index.d.ts +5 -5
  318. package/dist/spec/index.d.ts +1 -1
  319. package/dist/sql/index.d.ts +5 -5
  320. package/dist/sql/index.js +5 -5
  321. package/dist/{sql-CNH8kjLS.js → sql-B7vBP9g0.js} +6248 -2092
  322. package/dist/sqlite/index.d.ts +1 -1
  323. package/dist/ssr/index.d.ts +5 -5
  324. package/dist/storage/index.js +1 -1
  325. package/dist/{subject-readers-8GySC9Z8.d.ts → subject-readers-DJbzlm8a.d.ts} +1 -1
  326. package/dist/{subjects-NomQg6Eg.d.ts → subjects-BYCL-6hA.d.ts} +15 -1
  327. package/dist/{support-B4ZBVxt3.d.ts → support-D7CMbhRT.d.ts} +4 -4
  328. package/dist/{support-view-BYOgwXsJ.d.ts → support-view-CIDXF3_H.d.ts} +1 -1
  329. package/dist/svelte/index.d.ts +8 -8
  330. package/dist/sveltekit/index.d.ts +6 -6
  331. package/dist/{tags-Cjtcp5cN.d.ts → tags-Dg4Ywmqp.d.ts} +1 -1
  332. package/dist/tanstack-db/index.d.ts +1 -1
  333. package/dist/tanstack-start/index.d.ts +5 -5
  334. package/dist/{tenant-D4BA7XQ-.d.ts → tenant-CyLEXgot.d.ts} +2 -2
  335. package/dist/testing/index.d.ts +16 -16
  336. package/dist/testing/index.js +2 -2
  337. package/dist/{timeline-CEzj9v1z.d.ts → timeline-Cjl-1hiA.d.ts} +3 -3
  338. package/dist/{topic-utZqhw96.d.ts → topic-B_DGdAEs.d.ts} +3 -3
  339. package/dist/{topic-F0FKzJyQ.js → topic-DnsNG4Kj.js} +1 -1
  340. package/dist/{types-yj8VF4oY.d.ts → types-BdaBfYIw.d.ts} +2 -2
  341. package/dist/{types-DLnBJ3ST.d.ts → types-DF8JYEf5.d.ts} +2 -2
  342. package/dist/{types-EO2crSX_.d.ts → types-DR1MHh7N.d.ts} +1 -1
  343. package/dist/{vault-O-YlAyHb.d.ts → vault-BghaujrZ.d.ts} +1 -1
  344. package/dist/vercel-connect/index.d.ts +1 -1
  345. package/dist/{verify-B0KLBb3j.d.ts → verify-CI8LgSpv.d.ts} +1 -1
  346. package/dist/{view-DyFdMCqg.d.ts → view-BvNA7EOC.d.ts} +1 -1
  347. package/dist/vue/index.d.ts +9 -9
  348. package/dist/{watch-topic-B1UCoQfz.d.ts → watch-topic-1zIAtiNM.d.ts} +1 -1
  349. package/dist/workflow-sdk/builder/index.d.ts +3 -3
  350. package/dist/workflow-sdk/index.d.ts +1 -1
  351. package/dist/workflow-sdk/world/index.d.ts +1 -1
  352. package/dist/workflow-sdk/world/index.js +1 -1
  353. package/dist/{workflow-sdk-B3Ss55Fy.d.ts → workflow-sdk-BNsZrcVg.d.ts} +1 -1
  354. package/dist/{workflow-sdk-CE8sEK57.js → workflow-sdk-CaEw822d.js} +25 -4
  355. package/dist/yjs/index.d.ts +1 -1
  356. package/dist/yjs/index.js +1 -1
  357. package/package.json +11 -1
  358. package/schemas/config-v1.json +95 -1
  359. package/dist/cli/add-vZRn-uH0.js +0 -1
  360. package/dist/cli/env-xhwXk5Ri.js +0 -1
  361. package/dist/cli/in-stack-diff-DQTW53Vf.js +0 -257
  362. package/dist/cli/powersync-BOhjVQCb.js +0 -1
  363. package/dist/cli/seed-CO3j_bly.js +0 -1
  364. package/dist/options-DztCKw_f.js +0 -8
@@ -1,10 +1,10 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "./types-DFdg_4yN.js";
2
- import { r as AuthState } from "./resolve-CXX6DHv3.js";
3
- import { t as BetterSupabase, y as Db } from "./define-Lf6rI2QN.js";
4
- import { a as ServerContext, b as ReplicaState, c as ServerOptions, n as BetterServer } from "./server-types-BH6AjDBN.js";
5
- import { t as ActiveSupport } from "./support-B4ZBVxt3.js";
6
- import { n as SessionEntryConfig } from "./session-Y5SSYO2C.js";
7
- import { r as GuardOptions } from "./respond-oZeJ342J.js";
2
+ import { r as AuthState } from "./resolve-Bj1qD7Dy.js";
3
+ import { t as BetterSupabase, y as Db } from "./define-BLP6XtoL.js";
4
+ import { a as ServerContext, b as ReplicaState, c as ServerOptions, n as BetterServer } from "./server-types-BlDiY-ya.js";
5
+ import { t as ActiveSupport } from "./support-D7CMbhRT.js";
6
+ import { n as SessionEntryConfig } from "./session-BGP98Rgj.js";
7
+ import { r as GuardOptions } from "./respond-BzRG-0qc.js";
8
8
  import { SupabaseClient } from "@supabase/supabase-js";
9
9
  import { Entry, SingleKeyEntry } from "@supabase/middleware";
10
10
  import { AuthMode, JWTClaims, UserClaims } from "@supabase/server";
@@ -1,6 +1,6 @@
1
1
  import { M as Casing } from "../types-DFdg_4yN.js";
2
- import { A as tenantNameOf, C as EntityConfig, D as OwnTablePolicies, S as EntitiesConfig, a as AuthorizationProvider, b as DEFAULT_ACTIVE_TENANT, c as AuthorizationScope, d as AccessBlockConfig, f as ActiveTenantSource, g as BlockMode, i as AuthorizationPermission, l as AuthorizationTokenHook, m as BlockConfig, n as AuthorizationMembership, o as AuthorizationRequirement, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, u as providerApiProblem, v as BlockScope, x as DisabledRow, y as BlocksConfig } from "../authorization-Dtwpjeuz.js";
3
- import { $ as blockEntrySource, $n as APP_COLUMN_ACCESS, $r as RpcTypeReference, $t as ResolvedExtensions, A as ValibotGeneratorOptions, Ai as MigrationSafetyConfig, An as ExposePrivilege, Ar as CatalogIndex, At as GeneratedFile, B as jsonSchema, Br as ForeignKeyAction, Bt as GeneratorInputSchema, Cn as TopicTriggerPayloadValueConfig, Cr as CatalogColumn, D as ZodFlavor, Di as GenTask, Dn as VectorSearchConfig, Dr as CatalogFunction, Dt as resolveJsonSchema, Ei as GenConfig, En as VectorDistance, Er as CatalogForeignKey, F as nuqs, Fi as GEN_TASKS, Fr as ExtrasDomain, Ft as GeneratorEntitySchemas, G as tenantClaimPaths, Gr as PostgresColumn, Gt as JsonSchemaSource, H as ClaimPaths, Hr as SnapshotBucket, Ht as GeneratorModel, I as FactoriesGeneratorOptions, Ii as INTEGRATION_INFO, Ir as ExtrasFunction, It as GeneratorField, J as blockEntityRenames, Jn as CONFIG_DEFAULTS, Jr as RpcFunction, Jt as SourceConfig, K as BlockEntity, Kr as PostgresFunction, Kt as JsonTypeConfig, L as factories, Li as INTEGRATION_NAMES, Lr as ExtrasHook, Lt as GeneratorFunction, M as StandardSchemaGeneratorOptions, Mi as PowerSyncGenConfig, Mn as Privilege, Mr as CatalogTable, Mt as GeneratorBlock, N as standardSchema, Ni as SkillsAgent, Nn as ResolvedExpose, Nr as CatalogTrigger, Nt as GeneratorBlockEntity, O as ZodGeneratorOptions, Oi as IntegrationName, On as ColumnPrivilege, Or as CatalogFunctionArg, Ot as ClaimsConfig, P as NuqsGeneratorOptions, Pi as SkillsConfig, Pr as CatalogUnique, Pt as GeneratorColumn, Q as RENAMED_CONFIG_KEYS, Qr as RpcReturnColumn, Qt as ResolvedConfig, R as JsonSchemaGeneratorOptions, Ri as IntegrationInfo, Rr as ExtrasHookFunction, Rt as GeneratorFunctionArg, Sn as TopicTriggerLookupConfig, Sr as CatalogCheck, Ti as EnvFileConfig, Tn as TopicTriggerValueConfig, Tr as CatalogEnum, U as DEFAULT_CLAIMS, Ur as SnapshotExtras, Ut as GeneratorNoun, V as JsonSchemaTarget, Vr as Snapshot, Vt as GeneratorJsonSchema, W as claimPaths, Wr as GeneratorMetadata, Wt as GeneratorTable, X as CONFIG_GROUPS, Xr as RpcFunctionOverload, Xt as DataHooksFramework, Y as blockSubjectTypes, Yr as RpcFunctionArg, Yt as TableConfig, Z as RENAMED_BLOCK_KEYS, Zr as RpcFunctionReturns, Zt as FlatConfig, _n as ResolvedSqlConfig, _r as AppTableEvents, an as BlockInput, ar as AppColumnAccess, at as defineConfig, bn as SqlWorkflow, br as AppTablesConfig, cn as EnvironmentConfig, cr as AppColumnType, ct as BlockTableReference, dn as SqlInput, dr as AppReference, dt as RoleNames, en as ApiConfig, er as APP_COLUMN_FORMATS, et as flattenConfig, fn as ToolingConfig, fr as AppReferenceTarget, ft as TypedReference, gn as RealtimeConfig, gr as AppTableEventKind, hn as BucketConfig, hr as AppTableConfig, in as BetterSupabaseConfig, ir as APP_TABLE_EVENT_KINDS, it as CONFIG_SCHEMA_URL, j as valibot, ji as OpenApiConfig, jn as ExposeRole, jr as CatalogPolicy, jt as Generator, k as zod, ki as KeysConfig, kn as ExposeConfig, kr as CatalogGrant, kt as CodecsConfig, ln as GenGroupConfig, lr as AppLookupConfig, lt as BucketName, mn as EntitlementsConfig, mr as AppRollupConfig, mt as ExpandedConfig, nn as AppTablesInput, nr as APP_ON_DELETE_ACTIONS, nt as groupEntries, on as BlocksInput, or as AppColumnConfig, ot as resolveConfig, pn as EntitlementPlansSource, pr as AppRollupAggregate, q as blockEntities, qr as PostgresFunctionArg, qt as RelationsConfig, rn as AuthConfig, rr as APP_ROLLUP_AGGREGATES, rt as hasFlatTables, sn as DatabaseConfig, sr as AppColumnFormat, st as AppTableNames, tn as AppTableInput, tr as APP_COLUMN_TYPES, tt as groupConfig, un as OrganizationConfig, ur as AppOnDeleteAction, ut as ConfigReferences, vn as SeedConfig, vr as AppTableSubject, wi as DoctorConfig, wn as TopicTriggerTopicConfig, wr as CatalogColumnGrant, xn as TopicTriggerConfig, xr as Catalog, yn as SqlConfig, yr as AppTableVersions, z as buildJsonSchema, zi as SKILLS_AGENTS, zr as ExtrasTable, zt as GeneratorInput } from "../context-CMf4OKpN.js";
4
- import { i as SubjectsConfig, n as SubjectPermission, r as SubjectSearch, t as SubjectConfig } from "../subjects-NomQg6Eg.js";
2
+ import { A as tenantNameOf, C as EntityConfig, D as OwnTablePolicies, S as EntitiesConfig, a as AuthorizationProvider, b as DEFAULT_ACTIVE_TENANT, c as AuthorizationScope, d as AccessBlockConfig, f as ActiveTenantSource, g as BlockMode, i as AuthorizationPermission, l as AuthorizationTokenHook, m as BlockConfig, n as AuthorizationMembership, o as AuthorizationRequirement, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, u as providerApiProblem, v as BlockScope, x as DisabledRow, y as BlocksConfig } from "../authorization-BCG1v0iC.js";
3
+ import { $ as JsonSchemaTarget, $r as Snapshot, $t as GeneratorJsonSchema, An as SeedConfig, Ar as AppTableSubject, B as ZodGeneratorOptions, Bi as IntegrationName, Bn as ColumnPrivilege, Br as CatalogFunctionArg, Bt as ClaimsConfig, Cn as SqlInput, Cr as AppReference, Ct as RoleNames, Dn as BucketConfig, Dr as AppTableConfig, En as EntitlementsConfig, Er as AppRollupConfig, Et as ExpandedConfig, Fn as TopicTriggerPayloadValueConfig, Fr as CatalogColumn, G as standardSchema, Gi as SkillsAgent, Gn as ResolvedExpose, Gr as CatalogTrigger, Gt as GeneratorBlockEntity, H as ValibotGeneratorOptions, Hi as MigrationSafetyConfig, Hn as ExposePrivilege, Hr as CatalogIndex, Ht as GeneratedFile, Ii as DoctorConfig, In as TopicTriggerTopicConfig, Ir as CatalogColumnGrant, J as FactoriesGeneratorOptions, Ji as INTEGRATION_INFO, Jr as ExtrasFunction, Jt as GeneratorField, K as NuqsGeneratorOptions, Ki as SkillsConfig, Kr as CatalogUnique, Kt as GeneratorColumn, Li as EnvFileConfig, Ln as TopicTriggerValueConfig, Lr as CatalogEnum, Mn as SqlWorkflow, Mr as AppTablesConfig, Nn as TopicTriggerConfig, Nr as Catalog, On as RealtimeConfig, Or as AppTableEventKind, Pn as TopicTriggerLookupConfig, Pr as CatalogCheck, Q as jsonSchema, Qr as ForeignKeyAction, Qt as GeneratorInputSchema, Ri as GenConfig, Rn as VectorDistance, Rr as CatalogForeignKey, Sn as OrganizationConfig, Sr as AppOnDeleteAction, St as ConfigReferences, Tn as EntitlementPlansSource, Tr as AppRollupAggregate, U as valibot, Ui as OpenApiConfig, Un as ExposeRole, Ur as CatalogPolicy, Ut as Generator, V as zod, Vi as KeysConfig, Vn as ExposeConfig, Vr as CatalogGrant, Vt as CodecsConfig, W as StandardSchemaGeneratorOptions, Wi as PowerSyncGenConfig, Wn as Privilege, Wr as CatalogTable, Wt as GeneratorBlock, X as JsonSchemaGeneratorOptions, Xi as IntegrationInfo, Xr as ExtrasHookFunction, Xt as GeneratorFunctionArg, Y as factories, Yi as INTEGRATION_NAMES, Yr as ExtrasHook, Yt as GeneratorFunction, Z as buildJsonSchema, Zi as SKILLS_AGENTS, Zr as ExtrasTable, Zt as GeneratorInput, _n as BlockInput, _r as AppColumnAccess, _t as defineConfig, ai as PostgresFunctionArg, an as RelationsConfig, at as blockEntities, bn as EnvironmentConfig, br as AppColumnType, bt as BlockTableReference, ci as RpcFunctionOverload, cn as DataHooksFramework, ct as CONFIG_GROUPS, di as RpcTypeReference, dn as ResolvedExtensions, dr as APP_COLUMN_ACCESS, dt as blockEntrySource, ei as SnapshotBucket, en as GeneratorModel, et as ClaimPaths, fn as ApiConfig, fr as APP_COLUMN_FORMATS, ft as flattenConfig, gn as BetterSupabaseConfig, gr as APP_TABLE_EVENT_KINDS, gt as CONFIG_SCHEMA_URL, hn as AuthConfig, hr as APP_ROLLUP_AGGREGATES, ht as hasFlatTables, ii as PostgresFunction, in as JsonTypeConfig, it as BlockEntity, jn as SqlConfig, jr as AppTableVersions, kn as ResolvedSqlConfig, kr as AppTableEvents, li as RpcFunctionReturns, ln as FlatConfig, lt as RENAMED_BLOCK_KEYS, mn as AppTablesInput, mr as APP_ON_DELETE_ACTIONS, mt as groupEntries, ni as GeneratorMetadata, nn as GeneratorTable, nt as claimPaths, oi as RpcFunction, on as SourceConfig, or as CONFIG_DEFAULTS, ot as blockEntityRenames, pn as AppTableInput, pr as APP_COLUMN_TYPES, pt as groupConfig, q as nuqs, qi as GEN_TASKS, qr as ExtrasDomain, qt as GeneratorEntitySchemas, ri as PostgresColumn, rn as JsonSchemaSource, rt as tenantClaimPaths, si as RpcFunctionArg, sn as TableConfig, st as blockSubjectTypes, ti as SnapshotExtras, tn as GeneratorNoun, tt as DEFAULT_CLAIMS, ui as RpcReturnColumn, un as ResolvedConfig, ut as RENAMED_CONFIG_KEYS, vn as BlocksInput, vr as AppColumnConfig, vt as resolveConfig, wn as ToolingConfig, wr as AppReferenceTarget, wt as TypedReference, xn as GenGroupConfig, xr as AppLookupConfig, xt as BucketName, yn as DatabaseConfig, yr as AppColumnFormat, yt as AppTableNames, z as ZodFlavor, zi as GenTask, zn as VectorSearchConfig, zr as CatalogFunction, zt as resolveJsonSchema } from "../context-BFEX0b7H.js";
4
+ import { i as SubjectsConfig, n as SubjectPermission, r as SubjectSearch, t as SubjectConfig } from "../subjects-BYCL-6hA.js";
5
5
  import { a as FieldFormat, o as FieldFormatInput, r as FIELD_FORMATS } from "../field-formats-CAFNkKSN.js";
6
6
  export { APP_COLUMN_ACCESS, APP_COLUMN_FORMATS, APP_COLUMN_TYPES, APP_ON_DELETE_ACTIONS, APP_ROLLUP_AGGREGATES, APP_TABLE_EVENT_KINDS, type AccessBlockConfig, type ActiveTenantSource, type AnyBlocksConfig, type ApiConfig, type AppColumnAccess, type AppColumnConfig, type AppColumnFormat, type AppColumnType, type AppLookupConfig, type AppOnDeleteAction, type AppReference, type AppReferenceTarget, type AppRollupAggregate, type AppRollupConfig, type AppTableConfig, type AppTableEventKind, type AppTableEvents, type AppTableInput, type AppTableNames, type AppTableSubject, type AppTableVersions, type AppTablesConfig, type AppTablesInput, type AuthConfig, type AuthorizationFunctions, type AuthorizationMembership, type AuthorizationOperation, type AuthorizationPermission, type AuthorizationProvider, type AuthorizationRequirement, type AuthorizationRoleSource, type AuthorizationScope, type AuthorizationTokenHook, type BetterSupabaseConfig, type BlockConfig, type BlockEntity, type BlockInput, type BlockMode, type BlockScope, type BlockTableReference, type BlocksConfig, type BlocksInput, type BucketConfig, type BucketName, CONFIG_DEFAULTS, CONFIG_GROUPS, CONFIG_SCHEMA_URL, type Casing, type Catalog, type CatalogCheck, type CatalogColumn, type CatalogColumnGrant, type CatalogEnum, type CatalogForeignKey, type CatalogFunction, type CatalogFunctionArg, type CatalogGrant, type CatalogIndex, type CatalogPolicy, type CatalogTable, type CatalogTrigger, type CatalogUnique, type ClaimPaths, type ClaimsConfig, type CodecsConfig, type ColumnPrivilege, type ConfigReferences, DEFAULT_ACTIVE_TENANT, DEFAULT_CLAIMS, type DataHooksFramework, type DatabaseConfig, type DisabledRow, type DoctorConfig, type EntitiesConfig, type EntitlementPlansSource, type EntitlementsConfig, type EntityConfig, type EnvFileConfig, type EnvironmentConfig, type ExpandedConfig, type ExposeConfig, type ExposePrivilege, type ExposeRole, type ExtrasDomain, type ExtrasFunction, type ExtrasHook, type ExtrasHookFunction, type ExtrasTable, FIELD_FORMATS, type FactoriesGeneratorOptions, type FieldFormat, type FieldFormatInput, type FlatConfig, type ForeignKeyAction, GEN_TASKS, type GenConfig, type GenGroupConfig, type GenTask, type GeneratedFile, type Generator, type GeneratorBlock, type GeneratorBlockEntity, type GeneratorColumn, type GeneratorEntitySchemas, type GeneratorField, type GeneratorFunction, type GeneratorFunctionArg, type GeneratorInput, type GeneratorInputSchema, type GeneratorJsonSchema, type GeneratorMetadata, type GeneratorModel, type GeneratorNoun, type GeneratorTable, INTEGRATION_INFO, INTEGRATION_NAMES, type IntegrationInfo, type IntegrationName, type JsonSchemaGeneratorOptions, type JsonSchemaSource, type JsonSchemaTarget, type JsonTypeConfig, type KeysConfig, type MigrationSafetyConfig, type NuqsGeneratorOptions, type OpenApiConfig, type OrganizationConfig, type OwnTablePolicies, type PostgresColumn, type PostgresFunction, type PostgresFunctionArg, type PowerSyncGenConfig, type Privilege, RENAMED_BLOCK_KEYS, RENAMED_CONFIG_KEYS, type RealtimeConfig, type RelationsConfig, type ResolvedConfig, type ResolvedExpose, type ResolvedExtensions, type ResolvedSqlConfig, type RoleNames, type RpcFunction, type RpcFunctionArg, type RpcFunctionOverload, type RpcFunctionReturns, type RpcReturnColumn, type RpcTypeReference, SKILLS_AGENTS, type SeedConfig, type SkillsAgent, type SkillsConfig, type Snapshot, type SnapshotBucket, type SnapshotExtras, type SourceConfig, type SqlConfig, type SqlInput, type SqlWorkflow, type StandardSchemaGeneratorOptions, type SubjectConfig, type SubjectPermission, type SubjectSearch, type SubjectsConfig, type TableConfig, type ToolingConfig, type TopicTriggerConfig, type TopicTriggerLookupConfig, type TopicTriggerPayloadValueConfig, type TopicTriggerTopicConfig, type TopicTriggerValueConfig, type TypedReference, type ValibotGeneratorOptions, type VectorDistance, type VectorSearchConfig, type ZodFlavor, type ZodGeneratorOptions, blockEntities, blockEntityRenames, blockEntrySource, blockSubjectTypes, buildJsonSchema, claimPaths, defineConfig, factories, flattenConfig, groupConfig, groupEntries, hasFlatTables, jsonSchema, nuqs, providerApiProblem, resolveConfig, resolveJsonSchema, standardSchema, tenantClaimPaths, tenantNameOf, valibot, zod };
@@ -1,8 +1,8 @@
1
- import { n as resolveJsonSchema, r as CONFIG_DEFAULTS } from "../resolved-names-WzRYhUez.js";
2
- import { A as flattenConfig, D as RENAMED_BLOCK_KEYS, E as CONFIG_GROUPS, F as INTEGRATION_INFO, I as INTEGRATION_NAMES, L as SKILLS_AGENTS, M as groupEntries, N as hasFlatTables, O as RENAMED_CONFIG_KEYS, P as GEN_TASKS, j as groupConfig, k as blockEntrySource } from "../config-vHLJ8SKf.js";
1
+ import { n as resolveJsonSchema, r as CONFIG_DEFAULTS } from "../resolved-names-iLBOUaib.js";
2
+ import { A as flattenConfig, D as RENAMED_BLOCK_KEYS, E as CONFIG_GROUPS, F as INTEGRATION_INFO, I as INTEGRATION_NAMES, L as SKILLS_AGENTS, M as groupEntries, N as hasFlatTables, O as RENAMED_CONFIG_KEYS, P as GEN_TASKS, j as groupConfig, k as blockEntrySource } from "../config-CvJHIy5q.js";
3
3
  import { a as tenantClaimPaths, r as claimPaths, t as DEFAULT_CLAIMS } from "../claims-Bp9My7XP.js";
4
- import { A as APP_ROLLUP_AGGREGATES, D as APP_COLUMN_FORMATS, E as APP_COLUMN_ACCESS, L as tenantNameOf, O as APP_COLUMN_TYPES, P as DEFAULT_ACTIVE_TENANT, j as APP_TABLE_EVENT_KINDS, k as APP_ON_DELETE_ACTIONS } from "../instances-BPJSESPx.js";
4
+ import { A as APP_ROLLUP_AGGREGATES, D as APP_COLUMN_FORMATS, E as APP_COLUMN_ACCESS, L as tenantNameOf, O as APP_COLUMN_TYPES, P as DEFAULT_ACTIVE_TENANT, j as APP_TABLE_EVENT_KINDS, k as APP_ON_DELETE_ACTIONS } from "../instances-C7qUTjhJ.js";
5
5
  import { r as FIELD_FORMATS } from "../field-formats-C6QKA3UR.js";
6
- import { a as factories, c as resolveConfig, d as blockSubjectTypes, f as providerApiProblem, i as nuqs, l as blockEntities, n as valibot, o as CONFIG_SCHEMA_URL, r as standardSchema, s as defineConfig, t as zod, u as blockEntityRenames } from "../config-RwpFcPq8.js";
6
+ import { a as factories, c as resolveConfig, d as blockSubjectTypes, f as providerApiProblem, i as nuqs, l as blockEntities, n as valibot, o as CONFIG_SCHEMA_URL, r as standardSchema, s as defineConfig, t as zod, u as blockEntityRenames } from "../config-CTeR7XHK.js";
7
7
  import { n as jsonSchema, t as buildJsonSchema } from "../json-schema-DHJxiizN.js";
8
8
  export { APP_COLUMN_ACCESS, APP_COLUMN_FORMATS, APP_COLUMN_TYPES, APP_ON_DELETE_ACTIONS, APP_ROLLUP_AGGREGATES, APP_TABLE_EVENT_KINDS, CONFIG_DEFAULTS, CONFIG_GROUPS, CONFIG_SCHEMA_URL, DEFAULT_ACTIVE_TENANT, DEFAULT_CLAIMS, FIELD_FORMATS, GEN_TASKS, INTEGRATION_INFO, INTEGRATION_NAMES, RENAMED_BLOCK_KEYS, RENAMED_CONFIG_KEYS, SKILLS_AGENTS, blockEntities, blockEntityRenames, blockEntrySource, blockSubjectTypes, buildJsonSchema, claimPaths, defineConfig, factories, flattenConfig, groupConfig, groupEntries, hasFlatTables, jsonSchema, nuqs, providerApiProblem, resolveConfig, resolveJsonSchema, standardSchema, tenantClaimPaths, tenantNameOf, valibot, zod };
@@ -1,8 +1,8 @@
1
- import { r as CONFIG_DEFAULTS, t as resolveNames } from "./resolved-names-WzRYhUez.js";
2
- import { A as flattenConfig, n as expandFlatPreset, r as expandPreset } from "./config-vHLJ8SKf.js";
1
+ import { r as CONFIG_DEFAULTS, t as resolveNames } from "./resolved-names-iLBOUaib.js";
2
+ import { A as flattenConfig, n as expandFlatPreset, r as expandPreset } from "./config-CvJHIy5q.js";
3
3
  import { t as DEFAULT_CLAIMS } from "./claims-Bp9My7XP.js";
4
4
  import { o as tenantNames } from "./entity-naming-Dtyq5sKE.js";
5
- import { I as resolveBlock, L as tenantNameOf, M as PRESET_CATALOG, _ as appTablesOf, o as resolveInstances, r as blocksByName, v as withAppTableSubjects } from "./instances-BPJSESPx.js";
5
+ import { I as resolveBlock, L as tenantNameOf, M as PRESET_CATALOG, _ as appTablesOf, o as resolveInstances, r as blocksByName, v as withAppTableSubjects } from "./instances-C7qUTjhJ.js";
6
6
  import { C as variantsFor, S as variantTitle, _ as schemaName, a as extraSchemas, b as tableEntries, c as resultType, d as fieldSpec, f as fieldsFor, g as rowType, h as propertyKey, i as extraKinds, l as HEADER, m as parseImport, o as fieldMetaLines, p as optionalLine, s as objectType, u as fieldDocs, v as siblingPath, x as temporalGuardImport, y as tableDocs } from "./json-schema-DHJxiizN.js";
7
7
  //#region src/config/authorization.ts
8
8
  /**
@@ -86,13 +86,14 @@ function subjectsOf(module, blocks) {
86
86
  if (subject === void 0 || entity.table === void 0 || table === void 0 || mapped === null) return [];
87
87
  const logical = entity.table;
88
88
  const column = (name) => config.columns[logical]?.[name] ?? resolved.naming.rename(table.columns[name] ?? name);
89
+ const titled = (key) => config.columns[logical]?.[key] === null && subject.fallbackTitle !== void 0 ? column(subject.fallbackTitle) : column(key);
89
90
  const name = mapped ?? resolved.naming.rename(table.name);
90
91
  const url = entity.url ?? subject.url;
91
92
  const entry = {
92
93
  table: name.includes(".") ? name : `${config.schema}.${name}`,
93
94
  idType: "uuid",
94
95
  tenant: column("tenant"),
95
- title: column(subject.title),
96
+ title: titled(subject.title),
96
97
  permissions: {
97
98
  read: key(subject.permissions.read),
98
99
  write: key(subject.permissions.write),
@@ -104,7 +105,7 @@ function subjectsOf(module, blocks) {
104
105
  group: column(subject.rank.group)
105
106
  } },
106
107
  ...subject.search === void 0 ? {} : { search: {
107
- title: column(subject.search.title),
108
+ title: titled(subject.search.title),
108
109
  body: subject.search.body.filter((name) => config.columns[logical]?.[name] !== null).map(column)
109
110
  } },
110
111
  ...url === void 0 ? {} : { url: url.replaceAll(PLACEHOLDER, (_, placeholder) => `{${column(placeholder)}}`) },
@@ -1,5 +1,5 @@
1
1
  import { t as DEFAULT_TENANT } from "./entity-naming-Dtyq5sKE.js";
2
- import { F as asBlocksConfig, M as PRESET_CATALOG } from "./instances-BPJSESPx.js";
2
+ import { F as asBlocksConfig, M as PRESET_CATALOG } from "./instances-C7qUTjhJ.js";
3
3
  //#region src/config/names.ts
4
4
  /** The steps `better-supabase gen` runs, in the order it runs them. */
5
5
  const GEN_TASKS = [
@@ -1615,12 +1615,13 @@ function conventionConfig(conventions) {
1615
1615
  const tenant = tenantEntry(conventions);
1616
1616
  const blocks = {
1617
1617
  ...Object.keys(access).length === 0 ? {} : { permissions: access },
1618
- ...Object.keys(tenant).length === 0 ? {} : { memberships: tenant }
1618
+ ...Object.keys(tenant).length === 0 ? {} : { memberships: tenant },
1619
+ "rls-guard": {}
1619
1620
  };
1620
1621
  return {
1621
1622
  casing: conventions.casing,
1622
1623
  ...sql === void 0 ? {} : { sql },
1623
- ...Object.keys(blocks).length === 0 ? {} : { blocks }
1624
+ blocks
1624
1625
  };
1625
1626
  }
1626
1627
  /**
@@ -3,7 +3,7 @@ import { T as ErrorMapper, t as AsyncResult } from "./result-DZeA5KS6.js";
3
3
  import { t as StandardSchemaV1 } from "./standard-DBV730sF.js";
4
4
  import { n as ExtraFields, r as FieldsOf } from "./block-fields-BE7pInWZ.js";
5
5
  import { n as Logger } from "./logger-DWVYUmwi.js";
6
- import { i as CredentialRef, r as CredentialProvider } from "./provider-CqwEOLCA.js";
6
+ import { i as CredentialRef, r as CredentialProvider } from "./provider-ClrIplXa.js";
7
7
  import { r as BlockTemporalOptions } from "./block-helpers-CRpAHrp_.js";
8
8
  import { t as BlockTransport } from "./block-transport-DWZSJrwN.js";
9
9
  import { n as BlockHooks } from "./block-hooks-DZN2w69m.js";
@@ -1,9 +1,9 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { M as Casing, P as ClaimsMeta, T as AccessBucketPolicy, _t as BucketLifecycle, j as BucketPolicyName, ot as SchemaMeta } from "./types-DFdg_4yN.js";
3
- import { D as OwnTablePolicies, E as NamedInstance, I as TablesOf, L as BlockNameRegistry, O as ResolvedBlock, T as InstanceOn, _ as BlockName, a as AuthorizationProvider, d as AccessBlockConfig, g as BlockMode, h as BlockConfigOf, m as BlockConfig, n as AuthorizationMembership, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, v as BlockScope, w as InstanceKeys, x as DisabledRow, y as BlocksConfig } from "./authorization-Dtwpjeuz.js";
4
- import { Mn as EntityNames, Nn as EntityNoun, Pn as EntityRename, R as PortName, Ut as ActionDescriptor, Xt as BlockSchedule, Zt as DefaultAutomation, _ as BlockProvider, g as BlockEnvKey, i as BlockCategory, y as BlockWorker } from "./define-block-DCAiOrNX.js";
3
+ import { D as OwnTablePolicies, E as NamedInstance, I as TablesOf, L as BlockNameRegistry, O as ResolvedBlock, T as InstanceOn, _ as BlockName, a as AuthorizationProvider, d as AccessBlockConfig, g as BlockMode, h as BlockConfigOf, m as BlockConfig, n as AuthorizationMembership, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, v as BlockScope, w as InstanceKeys, x as DisabledRow, y as BlocksConfig } from "./authorization-BCG1v0iC.js";
4
+ import { Mn as EntityNames, Nn as EntityNoun, Pn as EntityRename, R as PortName, Ut as ActionDescriptor, Xt as BlockSchedule, Zt as DefaultAutomation, _ as BlockProvider, g as BlockEnvKey, i as BlockCategory, y as BlockWorker } from "./define-block-DibVN37N.js";
5
5
  import { a as ScalarKind, i as FieldSpec } from "./table-schema-BlF6k62Q.js";
6
- import { i as SubjectsConfig } from "./subjects-NomQg6Eg.js";
6
+ import { i as SubjectsConfig } from "./subjects-BYCL-6hA.js";
7
7
  import { i as FIELD_FORMAT_NAMES, s as FieldFormatName } from "./field-formats-CAFNkKSN.js";
8
8
  import { t as GuestAction } from "./guest-actions-1T1DeS5Y.js";
9
9
  //#region src/config/names.d.ts
@@ -2673,6 +2673,7 @@ declare function conventionConfig(conventions: ConfigConventions): Pick<FlatConf
2673
2673
  readonly blocks?: {
2674
2674
  readonly permissions?: AccessBlockConfig;
2675
2675
  readonly memberships?: BlockConfig;
2676
+ readonly "rls-guard": BlockConfig;
2676
2677
  };
2677
2678
  };
2678
2679
  /**
@@ -3210,6 +3211,97 @@ interface VectorSearchTable {
3210
3211
  readonly order?: string;
3211
3212
  }
3212
3213
  //#endregion
3214
+ //#region src/sql/schema-scan.d.ts
3215
+ /** Privileges one role gets on a table, from the policies that name it. */
3216
+ interface PolicyGrant {
3217
+ /** `schema.table`, unquoted; an unqualified name is in `public`. */
3218
+ readonly table: string;
3219
+ readonly role: "anon" | "authenticated";
3220
+ readonly privileges: readonly ("select" | "insert" | "update" | "delete")[];
3221
+ }
3222
+ /**
3223
+ * The tables `files` create (`create table`), as `schema.table`, in the order
3224
+ * they first appear. Only tables in `schemas` are kept.
3225
+ */
3226
+ declare function declaredTables(files: readonly {
3227
+ readonly text: string;
3228
+ }[], schemas: readonly string[]): string[];
3229
+ /** A view the app's files create. */
3230
+ interface DeclaredView {
3231
+ /** Its columns, or `undefined` when they can't be read (`select *`). */
3232
+ readonly columns: readonly string[] | undefined;
3233
+ /** Whether `insert`, `update` and `delete` reach the table under it. */
3234
+ readonly updatable: boolean;
3235
+ }
3236
+ /**
3237
+ * The views and materialized views `files` create, as `schema.view`, with their
3238
+ * columns and whether they are auto-updatable. A later `drop view` removes one.
3239
+ * Only views in `schemas` are kept.
3240
+ */
3241
+ declare function declaredViews(files: readonly {
3242
+ readonly text: string;
3243
+ }[], schemas: readonly string[]): ReadonlyMap<string, DeclaredView>;
3244
+ /**
3245
+ * The tables in `schemas` that `files` leave with row level security on: `alter
3246
+ * table ... enable row level security`, until a later `disable` or `drop
3247
+ * table`.
3248
+ */
3249
+ declare function rlsTables(files: readonly {
3250
+ readonly text: string;
3251
+ }[], schemas: readonly string[]): string[];
3252
+ /**
3253
+ * Columns each `create table` in `files` declares, as `schema.table` to
3254
+ * unquoted names. `like` and table constraints are skipped. Only tables in
3255
+ * `schemas` are kept.
3256
+ */
3257
+ declare function declaredTableColumns(files: readonly {
3258
+ readonly text: string;
3259
+ }[], schemas: readonly string[]): ReadonlyMap<string, ReadonlySet<string>>;
3260
+ /**
3261
+ * The declared type of each column of each `create table` in `files`, as
3262
+ * `schema.table` to unquoted column name to type. A type is lower-cased with
3263
+ * its spacing normalised, and a quoted part keeps its case without quotes. Only
3264
+ * tables in `schemas` are kept.
3265
+ */
3266
+ declare function declaredColumnTypes(files: readonly {
3267
+ readonly text: string;
3268
+ }[], schemas: readonly string[]): ReadonlyMap<string, ReadonlyMap<string, string>>;
3269
+ /**
3270
+ * The privileges the permissive policies in `files` imply, per table and role:
3271
+ * `for all` gives the four commands, `to public` (or no `to`) counts for
3272
+ * `authenticated` only, so `anon` needs a policy that names it. Restrictive
3273
+ * policies grant nothing. Only tables in `schemas` are kept.
3274
+ */
3275
+ declare function policyGrants(files: readonly {
3276
+ readonly text: string;
3277
+ }[], schemas: readonly string[]): PolicyGrant[];
3278
+ declare function extensionSchema(sources: readonly {
3279
+ readonly text: string;
3280
+ }[], extension: string): string | undefined;
3281
+ /**
3282
+ * The update trigger that keeps `updated_at` current on each table in `schemas`
3283
+ * the files create one on, by `schema.table`: its function is named like one
3284
+ * (`set_updated_at`, `moddatetime`, `touch_*`) or the files define it with
3285
+ * `new.updated_at :=`. Block triggers (`bsb_*`) don't count.
3286
+ */
3287
+ declare function declaredUpdatedAtTriggers(files: readonly {
3288
+ readonly text: string;
3289
+ }[], schemas: readonly string[]): Readonly<Record<string, string>>;
3290
+ /** A full btree index, by its name when it has one, and its leading columns. */
3291
+ interface OwnIndex {
3292
+ readonly name?: string;
3293
+ readonly columns: readonly string[];
3294
+ }
3295
+ /**
3296
+ * The leading columns of every full btree index the files give each table in
3297
+ * `schemas`: `create index` statements, and the primary keys and unique
3298
+ * constraints in `create table`. Partial indexes and other methods are left
3299
+ * out, since they don't answer every lookup.
3300
+ */
3301
+ declare function declaredIndexes(files: readonly {
3302
+ readonly text: string;
3303
+ }[], schemas: readonly string[]): ReadonlyMap<string, readonly OwnIndex[]>;
3304
+ //#endregion
3213
3305
  //#region src/sql/shared.d.ts
3214
3306
  /**
3215
3307
  * The name `addNotNullCheck` gives the check on `column` of `table`, both
@@ -3363,6 +3455,11 @@ interface BlockSql {
3363
3455
  readonly scope: "tenant" | "platform";
3364
3456
  readonly setting: string;
3365
3457
  }[];
3458
+ /**
3459
+ * Actions of the module's `OPERATIONS` this config never checks, so their
3460
+ * keys aren't reported to the authorization provider.
3461
+ */
3462
+ readonly unusedPermissions?: (ctx: BlockSqlContext) => readonly string[];
3366
3463
  /**
3367
3464
  * Functions granted to `anon` or `authenticated` only so the module's
3368
3465
  * policies and triggers can call them as the client. `api` writes no entry
@@ -3514,6 +3611,11 @@ interface BlockSqlLayout {
3514
3611
  readonly ownTables?: Readonly<Record<string, string>>;
3515
3612
  /** The columns of the tables in `ownTables`, where they are known. */
3516
3613
  readonly ownColumns?: Readonly<Record<string, readonly string[]>>;
3614
+ /**
3615
+ * The leading columns of each full btree index on a table in `ownTables`, by
3616
+ * `schema.table`. A block adds no plain index that one of them covers.
3617
+ */
3618
+ readonly ownIndexes?: Readonly<Record<string, readonly OwnIndex[]>>;
3517
3619
  /**
3518
3620
  * The entries of `ownTables` that are views or materialized views, by
3519
3621
  * `schema.view`, and whether Postgres can write through each one. A block
@@ -3851,6 +3953,7 @@ interface BlockSqlTableLifecycle {
3851
3953
  */
3852
3954
  interface BlockSqlEntitySubject {
3853
3955
  readonly title: string;
3956
+ readonly fallbackTitle?: string;
3854
3957
  readonly deletedAt?: string;
3855
3958
  readonly permissions: {
3856
3959
  readonly read: string;
@@ -4030,6 +4133,8 @@ interface BlockSqlContext extends BlockSqlValueMethods {
4030
4133
  readonly modules: AnyBlocksConfig;
4031
4134
  /** The app-wide subject registry (`config.records`). */
4032
4135
  readonly subjects: SubjectsConfig;
4136
+ /** The provider's `rowsWith` template under the `provider` model. */
4137
+ readonly providerRowsWith: string | undefined;
4033
4138
  /**
4034
4139
  * The names of `config.appTables`, created in `public` after every block
4035
4140
  * file, so a block can't put a trigger on one (ADR 0043).
@@ -4241,4 +4346,4 @@ interface ExtraColumn {
4241
4346
  /** The contract's argument list with `{id}` resolved, as Postgres prints it. */
4242
4347
  declare function contractSignature(fn: BlockSqlContractFunction, idType: string): string;
4243
4348
  //#endregion
4244
- export { blockEntrySource as $, APP_COLUMN_ACCESS as $n, RpcTypeReference as $r, ResolvedExtensions as $t, ValibotGeneratorOptions as A, MigrationSafetyConfig as Ai, ExposePrivilege as An, CatalogIndex as Ar, GeneratedFile as At, jsonSchema as B, PRESETS as Bn, ForeignKeyAction as Br, GeneratorInputSchema as Bt, OwnView as C, presetValueLabel as Ci, TopicTriggerPayloadValueConfig as Cn, CatalogColumn as Cr, ResolvedPresetBlock as Ct, ZodFlavor as D, GenTask as Di, VectorSearchConfig as Dn, CatalogFunction as Dr, resolveJsonSchema as Dt, TableGrant as E, GenConfig as Ei, VectorDistance as En, CatalogForeignKey as Er, resolvePreset as Et, nuqs as F, GEN_TASKS as Fi, presetFromSpec as Fn, ExtrasDomain as Fr, GeneratorEntitySchemas as Ft, tenantClaimPaths as G, defaultPreset as Gn, PostgresColumn as Gr, JsonSchemaSource as Gt, ClaimPaths as H, PRESET_NAMES as Hn, SnapshotBucket as Hr, GeneratorModel as Ht, FactoriesGeneratorOptions as I, INTEGRATION_INFO as Ii, presetOfSpec as In, ExtrasFunction as Ir, GeneratorField as It, blockEntityRenames as J, CONFIG_DEFAULTS as Jn, RpcFunction as Jr, SourceConfig as Jt, BlockEntity as K, isPresetName as Kn, PostgresFunction as Kr, JsonTypeConfig as Kt, factories as L, INTEGRATION_NAMES as Li, presetSpec as Ln, ExtrasHook as Lr, GeneratorFunction as Lt, StandardSchemaGeneratorOptions as M, PowerSyncGenConfig as Mi, Privilege as Mn, CatalogTable as Mr, GeneratorBlock as Mt, standardSchema as N, SkillsAgent as Ni, ResolvedExpose as Nn, CatalogTrigger as Nr, GeneratorBlockEntity as Nt, ZodGeneratorOptions as O, IntegrationName as Oi, ColumnPrivilege as On, CatalogFunctionArg as Or, ClaimsConfig as Ot, NuqsGeneratorOptions as P, SkillsConfig as Pi, PresetSpec as Pn, CatalogUnique as Pr, GeneratorColumn as Pt, RENAMED_CONFIG_KEYS as Q, auditRegistrations as Qn, RpcReturnColumn as Qr, ResolvedConfig as Qt, JsonSchemaGeneratorOptions as R, IntegrationInfo as Ri, DEFAULT_PRESET_NAME as Rn, ExtrasHookFunction as Rr, GeneratorFunctionArg as Rt, BlockSqlUpgrade as S, presetField as Si, TopicTriggerLookupConfig as Sn, CatalogCheck as Sr, ResolvedPreset as St, notNullCheckName as T, EnvFileConfig as Ti, TopicTriggerValueConfig as Tn, CatalogEnum as Tr, presetBlockConflict as Tt, DEFAULT_CLAIMS as U, PresetGroup as Un, SnapshotExtras as Ur, GeneratorNoun as Ut, JsonSchemaTarget as V, PRESET_GROUPS as Vn, Snapshot as Vr, GeneratorJsonSchema as Vt, claimPaths as W, PresetName as Wn, GeneratorMetadata as Wr, GeneratorTable as Wt, CONFIG_GROUPS as X, sameTenantLayout as Xn, RpcFunctionOverload as Xr, DataHooksFramework as Xt, blockSubjectTypes as Y, DeclaredForeignKey as Yn, RpcFunctionArg as Yr, TableConfig as Yt, RENAMED_BLOCK_KEYS as Z, AuditedTable as Zn, RpcFunctionReturns as Zr, FlatConfig as Zt, BlockSqlDeprecation as _, PresetFramework as _i, ResolvedSqlConfig as _n, AppTableEvents as _r, expandPreset as _t, BlockSqlContext as a, PresetCatalogManifest as ai, BlockInput as an, AppColumnAccess as ar, defineConfig as at, BlockSqlLayout as b, PresetValueInfo as bi, SqlWorkflow as bn, AppTablesConfig as br, PresetConflict as bt, BlockSqlIdType as c, DEFAULT_CONVENTIONS as ci, EnvironmentConfig as cn, AppColumnType as cr, BlockTableReference as ct, MODULE_ID_TYPES as d, Preset as di, SqlInput as dn, AppReference as dr, RoleNames as dt, CORE_BLOCKS as ei, ApiConfig as en, APP_COLUMN_FORMATS as er, flattenConfig as et, contractSignature as f, PresetAccess as fi, ToolingConfig as fn, AppReferenceTarget as fr, TypedReference as ft, BlockSqlAccessProvider as g, PresetFieldValue as gi, RealtimeConfig as gn, AppTableEventKind as gr, conventionConfig as gt, BlockSql as h, PresetFieldKey as hi, BucketConfig as hn, AppTableConfig as hr, PresetInput as ht, BlockSqlAudit as i, PresetCatalogBlock as ii, BetterSupabaseConfig as in, APP_TABLE_EVENT_KINDS as ir, CONFIG_SCHEMA_URL as it, valibot as j, OpenApiConfig as ji, ExposeRole as jn, CatalogPolicy as jr, Generator as jt, zod as k, KeysConfig as ki, ExposeConfig as kn, CatalogGrant as kr, CodecsConfig as kt, BlockSqlNames as l, PRESET_FRAMEWORKS as li, GenGroupConfig as ln, AppLookupConfig as lr, BucketName as lt, moduleIdType as m, PresetField as mi, EntitlementsConfig as mn, AppRollupConfig as mr, ExpandedConfig as mt, AuditCategory as n, instancePrefix as ni, AppTablesInput as nn, APP_ON_DELETE_ACTIONS as nr, groupEntries as nt, BlockSqlContractFunction as o, PresetGlueItem as oi, BlocksInput as on, AppColumnConfig as or, resolveConfig as ot, isBlockSqlIdType as p, PresetConventions as pi, EntitlementPlansSource as pn, AppRollupAggregate as pr, ConfigConventions as pt, blockEntities as q, namedPreset as qn, PostgresFunctionArg as qr, RelationsConfig as qt, BlockSqlAction as r, PresetCatalog as ri, AuthConfig as rn, APP_ROLLUP_AGGREGATES as rr, hasFlatTables as rt, BlockSqlEmit as s, CONVENTION_FIELDS as si, DatabaseConfig as sn, AppColumnFormat as sr, AppTableNames as st, AUDIT_CATEGORIES as t, INSTANCE_NAME as ti, AppTableInput as tn, APP_COLUMN_TYPES as tr, groupConfig as tt, BlockSqlTableSpec as u, PRESET_TENANT_NAMES as ui, OrganizationConfig as un, AppOnDeleteAction as ur, ConfigReferences as ut, BlockSqlEntitlementsProvider as v, PresetPlatforms as vi, SeedConfig as vn, AppTableSubject as vr, presetConfig as vt, blockSqlVersion as w, DoctorConfig as wi, TopicTriggerTopicConfig as wn, CatalogColumnGrant as wr, listNames as wt, BlockSqlTestFile as x, integrationsForFramework as xi, TopicTriggerConfig as xn, Catalog as xr, PresetIntegration as xt, BlockSqlFile as y, PresetScope as yi, SqlConfig as yn, AppTableVersions as yr, presetOf as yt, buildJsonSchema as z, SKILLS_AGENTS as zi, NamedPreset as zn, ExtrasTable as zr, GeneratorInput as zt };
4349
+ export { JsonSchemaTarget as $, PRESET_GROUPS as $n, Snapshot as $r, GeneratorJsonSchema as $t, declaredIndexes as A, PresetPlatforms as Ai, SeedConfig as An, AppTableSubject as Ar, presetConfig as At, ZodGeneratorOptions as B, IntegrationName as Bi, ColumnPrivilege as Bn, CatalogFunctionArg as Br, ClaimsConfig as Bt, OwnView as C, Preset as Ci, SqlInput as Cn, AppReference as Cr, RoleNames as Ct, OwnIndex as D, PresetFieldKey as Di, BucketConfig as Dn, AppTableConfig as Dr, PresetInput as Dt, DeclaredView as E, PresetField as Ei, EntitlementsConfig as En, AppRollupConfig as Er, ExpandedConfig as Et, extensionSchema as F, presetValueLabel as Fi, TopicTriggerPayloadValueConfig as Fn, CatalogColumn as Fr, ResolvedPresetBlock as Ft, standardSchema as G, SkillsAgent as Gi, ResolvedExpose as Gn, CatalogTrigger as Gr, GeneratorBlockEntity as Gt, ValibotGeneratorOptions as H, MigrationSafetyConfig as Hi, ExposePrivilege as Hn, CatalogIndex as Hr, GeneratedFile as Ht, policyGrants as I, DoctorConfig as Ii, TopicTriggerTopicConfig as In, CatalogColumnGrant as Ir, listNames as It, FactoriesGeneratorOptions as J, INTEGRATION_INFO as Ji, presetOfSpec as Jn, ExtrasFunction as Jr, GeneratorField as Jt, NuqsGeneratorOptions as K, SkillsConfig as Ki, PresetSpec as Kn, CatalogUnique as Kr, GeneratorColumn as Kt, rlsTables as L, EnvFileConfig as Li, TopicTriggerValueConfig as Ln, CatalogEnum as Lr, presetBlockConflict as Lt, declaredTables as M, PresetValueInfo as Mi, SqlWorkflow as Mn, AppTablesConfig as Mr, PresetConflict as Mt, declaredUpdatedAtTriggers as N, integrationsForFramework as Ni, TopicTriggerConfig as Nn, Catalog as Nr, PresetIntegration as Nt, PolicyGrant as O, PresetFieldValue as Oi, RealtimeConfig as On, AppTableEventKind as Or, conventionConfig as Ot, declaredViews as P, presetField as Pi, TopicTriggerLookupConfig as Pn, CatalogCheck as Pr, ResolvedPreset as Pt, jsonSchema as Q, PRESETS as Qn, ForeignKeyAction as Qr, GeneratorInputSchema as Qt, TableGrant as R, GenConfig as Ri, VectorDistance as Rn, CatalogForeignKey as Rr, resolvePreset as Rt, BlockSqlUpgrade as S, PRESET_TENANT_NAMES as Si, OrganizationConfig as Sn, AppOnDeleteAction as Sr, ConfigReferences as St, notNullCheckName as T, PresetConventions as Ti, EntitlementPlansSource as Tn, AppRollupAggregate as Tr, ConfigConventions as Tt, valibot as U, OpenApiConfig as Ui, ExposeRole as Un, CatalogPolicy as Ur, Generator as Ut, zod as V, KeysConfig as Vi, ExposeConfig as Vn, CatalogGrant as Vr, CodecsConfig as Vt, StandardSchemaGeneratorOptions as W, PowerSyncGenConfig as Wi, Privilege as Wn, CatalogTable as Wr, GeneratorBlock as Wt, JsonSchemaGeneratorOptions as X, IntegrationInfo as Xi, DEFAULT_PRESET_NAME as Xn, ExtrasHookFunction as Xr, GeneratorFunctionArg as Xt, factories as Y, INTEGRATION_NAMES as Yi, presetSpec as Yn, ExtrasHook as Yr, GeneratorFunction as Yt, buildJsonSchema as Z, SKILLS_AGENTS as Zi, NamedPreset as Zn, ExtrasTable as Zr, GeneratorInput as Zt, BlockSqlDeprecation as _, PresetCatalogManifest as _i, BlockInput as _n, AppColumnAccess as _r, defineConfig as _t, BlockSqlContext as a, PostgresFunctionArg as ai, RelationsConfig as an, namedPreset as ar, blockEntities as at, BlockSqlLayout as b, DEFAULT_CONVENTIONS as bi, EnvironmentConfig as bn, AppColumnType as br, BlockTableReference as bt, BlockSqlIdType as c, RpcFunctionOverload as ci, DataHooksFramework as cn, sameTenantLayout as cr, CONFIG_GROUPS as ct, MODULE_ID_TYPES as d, RpcTypeReference as di, ResolvedExtensions as dn, APP_COLUMN_ACCESS as dr, blockEntrySource as dt, SnapshotBucket as ei, GeneratorModel as en, PRESET_NAMES as er, ClaimPaths as et, contractSignature as f, CORE_BLOCKS as fi, ApiConfig as fn, APP_COLUMN_FORMATS as fr, flattenConfig as ft, BlockSqlAccessProvider as g, PresetCatalogBlock as gi, BetterSupabaseConfig as gn, APP_TABLE_EVENT_KINDS as gr, CONFIG_SCHEMA_URL as gt, BlockSql as h, PresetCatalog as hi, AuthConfig as hn, APP_ROLLUP_AGGREGATES as hr, hasFlatTables as ht, BlockSqlAudit as i, PostgresFunction as ii, JsonTypeConfig as in, isPresetName as ir, BlockEntity as it, declaredTableColumns as j, PresetScope as ji, SqlConfig as jn, AppTableVersions as jr, presetOf as jt, declaredColumnTypes as k, PresetFramework as ki, ResolvedSqlConfig as kn, AppTableEvents as kr, expandPreset as kt, BlockSqlNames as l, RpcFunctionReturns as li, FlatConfig as ln, AuditedTable as lr, RENAMED_BLOCK_KEYS as lt, moduleIdType as m, instancePrefix as mi, AppTablesInput as mn, APP_ON_DELETE_ACTIONS as mr, groupEntries as mt, AuditCategory as n, GeneratorMetadata as ni, GeneratorTable as nn, PresetName as nr, claimPaths as nt, BlockSqlContractFunction as o, RpcFunction as oi, SourceConfig as on, CONFIG_DEFAULTS as or, blockEntityRenames as ot, isBlockSqlIdType as p, INSTANCE_NAME as pi, AppTableInput as pn, APP_COLUMN_TYPES as pr, groupConfig as pt, nuqs as q, GEN_TASKS as qi, presetFromSpec as qn, ExtrasDomain as qr, GeneratorEntitySchemas as qt, BlockSqlAction as r, PostgresColumn as ri, JsonSchemaSource as rn, defaultPreset as rr, tenantClaimPaths as rt, BlockSqlEmit as s, RpcFunctionArg as si, TableConfig as sn, DeclaredForeignKey as sr, blockSubjectTypes as st, AUDIT_CATEGORIES as t, SnapshotExtras as ti, GeneratorNoun as tn, PresetGroup as tr, DEFAULT_CLAIMS as tt, BlockSqlTableSpec as u, RpcReturnColumn as ui, ResolvedConfig as un, auditRegistrations as ur, RENAMED_CONFIG_KEYS as ut, BlockSqlEntitlementsProvider as v, PresetGlueItem as vi, BlocksInput as vn, AppColumnConfig as vr, resolveConfig as vt, blockSqlVersion as w, PresetAccess as wi, ToolingConfig as wn, AppReferenceTarget as wr, TypedReference as wt, BlockSqlTestFile as x, PRESET_FRAMEWORKS as xi, GenGroupConfig as xn, AppLookupConfig as xr, BucketName as xt, BlockSqlFile as y, CONVENTION_FIELDS as yi, DatabaseConfig as yn, AppColumnFormat as yr, AppTableNames as yt, ZodFlavor as z, GenTask as zi, VectorSearchConfig as zn, CatalogFunction as zr, resolveJsonSchema as zt };
@@ -1,4 +1,4 @@
1
- import { a as ClientAuth } from "./bind-DaoTunvE.js";
1
+ import { a as ClientAuth } from "./bind-C54jD0r3.js";
2
2
  //#region src/blocks/controller.d.ts
3
3
  /**
4
4
  * A block's client state, framework-agnostic. `subscribe` and `getSnapshot`
@@ -1,5 +1,5 @@
1
1
  import { f as Result } from "./result-DZeA5KS6.js";
2
- import { Bt as Action, Ht as ActionContext, Vt as ActionCall } from "./define-block-DCAiOrNX.js";
2
+ import { Bt as Action, Ht as ActionContext, Vt as ActionCall } from "./define-block-DibVN37N.js";
3
3
  import { StandardSchemaV1 } from "@standard-schema/spec";
4
4
  //#region src/blocks/automations/conversion.d.ts
5
5
  /** A record a conversion reads from or creates: its subject type and id. */
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Pn as PresetSpec, Wn as PresetName, ar as AppColumnAccess, cr as AppColumnType, di as Preset, g as BlockSqlAccessProvider, ht as PresetInput, nr as APP_ON_DELETE_ACTIONS, ur as AppOnDeleteAction } from "../context-CMf4OKpN.js";
3
- import { E as CreateDesign, b as DesignChange } from "../index-CFWlHuVY.js";
4
- import { $ as SchemaTable, A as renameColumn, B as AppEvents, C as editTable, Ct as tableWithComputed, D as isEmptyDesign, Dt as IssueSeverity, E as isAppTable, Et as IssueCode, F as singular, G as subjectTypeError, H as eventsColumnsEdited, I as tidy, J as SchemaData, K as SchemaColumn, L as updateTable, M as setColumn, N as setExtraColumn, O as moveTables, Ot as IssueSource, P as setTableId, Q as SchemaSource, R as userConnection, S as duplicateTable, St as rollupSources, T as identifierError, Tt as Issue, U as subjectColumns, V as AppSubject, W as subjectColumnsEdited, X as SchemaOptions, Y as SchemaForeignKey, Z as SchemaSoftRef, _ as connect, _t as isRollupAggregate, a as AppScope, at as tenantColumnOf, b as deleteExtraColumn, bt as readableColumns, c as ConnectResult, ct as ComputedRow, d as EMPTY_DESIGN, dt as RollupAggregate, et as SchemaTarget, f as NamedDesign, ft as computedColumnRenamed, g as columnError, gt as fittedRollup, h as appTableId, ht as filterColumns, i as AppReference, it as tableStatements, j as renameTable, k as referenceFrom, l as Connection, lt as DraftRollup, m as addTable, mt as computedTableRenamed, n as APP_MODULE, nt as parseSchema, o as AppTable, ot as AppLookup, p as TablePatch, pt as computedRows, q as SchemaComputed, r as AppColumn, rt as schemaRelations, s as AppTableId, st as AppRollup, t as PresetMigrationFile, tt as keyColumnsOf, u as Design, ut as ROLLUP_AGGREGATES, v as defaultError, vt as lookupSources, w as freeTableName, wt as tableWithoutComputed, x as deleteTable, xt as rollupColumns, y as deleteColumn, yt as prunedComputed, z as withDesign } from "../types-DLnBJ3ST.js";
2
+ import { Ci as Preset, Dt as PresetInput, Kn as PresetSpec, Sr as AppOnDeleteAction, _r as AppColumnAccess, br as AppColumnType, g as BlockSqlAccessProvider, mr as APP_ON_DELETE_ACTIONS, nr as PresetName } from "../context-BFEX0b7H.js";
3
+ import { E as CreateDesign, b as DesignChange } from "../index-8wOL81rB.js";
4
+ import { $ as SchemaTable, A as renameColumn, B as AppEvents, C as editTable, Ct as tableWithComputed, D as isEmptyDesign, Dt as IssueSeverity, E as isAppTable, Et as IssueCode, F as singular, G as subjectTypeError, H as eventsColumnsEdited, I as tidy, J as SchemaData, K as SchemaColumn, L as updateTable, M as setColumn, N as setExtraColumn, O as moveTables, Ot as IssueSource, P as setTableId, Q as SchemaSource, R as userConnection, S as duplicateTable, St as rollupSources, T as identifierError, Tt as Issue, U as subjectColumns, V as AppSubject, W as subjectColumnsEdited, X as SchemaOptions, Y as SchemaForeignKey, Z as SchemaSoftRef, _ as connect, _t as isRollupAggregate, a as AppScope, at as tenantColumnOf, b as deleteExtraColumn, bt as readableColumns, c as ConnectResult, ct as ComputedRow, d as EMPTY_DESIGN, dt as RollupAggregate, et as SchemaTarget, f as NamedDesign, ft as computedColumnRenamed, g as columnError, gt as fittedRollup, h as appTableId, ht as filterColumns, i as AppReference, it as tableStatements, j as renameTable, k as referenceFrom, l as Connection, lt as DraftRollup, m as addTable, mt as computedTableRenamed, n as APP_MODULE, nt as parseSchema, o as AppTable, ot as AppLookup, p as TablePatch, pt as computedRows, q as SchemaComputed, r as AppColumn, rt as schemaRelations, s as AppTableId, st as AppRollup, t as PresetMigrationFile, tt as keyColumnsOf, u as Design, ut as ROLLUP_AGGREGATES, v as defaultError, vt as lookupSources, w as freeTableName, wt as tableWithoutComputed, x as deleteTable, xt as rollupColumns, y as deleteColumn, yt as prunedComputed, z as withDesign } from "../types-DF8JYEf5.js";
5
5
  import { a as SupabaseLint, o as SupabaseOrganization, s as SupabaseProject } from "../management-wtecfrNf.js";
6
6
  //#region src/create/check.d.ts
7
7
  /** What `checkDesign` returns. */
@@ -369,4 +369,63 @@ export type MigrationPlan = {
369
369
  */
370
370
  export declare function migrationBetween(preset: PresetInput, base: CreateDesign, next: CreateDesign): MigrationPlan;
371
371
  //#endregion
372
+ //#region src/create/plan-gate.d.ts
373
+ /** The part of a pg-delta `Action` the gate reads. */
374
+ export interface PlanActionLike {
375
+ readonly sql: string;
376
+ readonly verb: "create" | "alter" | "drop";
377
+ readonly dataLoss: "none" | "destructive";
378
+ }
379
+ /** The part of a pg-delta `RenameCandidate` the gate reads. */
380
+ export interface RenameCandidateLike {
381
+ readonly kind: string;
382
+ readonly from: string;
383
+ readonly to: string;
384
+ readonly status: "unambiguous" | "ambiguous" | "nearMiss";
385
+ readonly reason?: string;
386
+ }
387
+ /**
388
+ * The part of a pg-delta `Plan` the gate reads; the real plan fits it
389
+ * structurally.
390
+ */
391
+ export interface PlanLike {
392
+ readonly actions: readonly PlanActionLike[];
393
+ readonly renameCandidates: readonly RenameCandidateLike[];
394
+ }
395
+ /** A rename the user recorded with `-- bsb: rename old -> new`. */
396
+ export interface RenameHint {
397
+ readonly from: string;
398
+ readonly to: string;
399
+ }
400
+ export interface GateOptions {
401
+ /** Let destructive actions through (`--allow-data-loss`). */
402
+ readonly allowDataLoss?: boolean;
403
+ /** Renames recorded in the edit log; see `parseRenameHints`. */
404
+ readonly hints?: readonly RenameHint[];
405
+ }
406
+ export interface PlanGate {
407
+ /** Candidates a hint confirmed: apply these as renames. */
408
+ readonly accepted: readonly RenameCandidateLike[];
409
+ /** Unambiguous candidates nobody confirmed: ask the user. */
410
+ readonly questions: readonly RenameCandidateLike[];
411
+ /**
412
+ * Ambiguous candidates and near misses: never guessed, they plan as drop and
413
+ * create.
414
+ */
415
+ readonly unresolved: readonly RenameCandidateLike[];
416
+ readonly destructive: readonly PlanActionLike[];
417
+ /** `true` when a destructive action is present and `allowDataLoss` is off. */
418
+ readonly blocked: boolean;
419
+ readonly issues: readonly Issue[];
420
+ }
421
+ /** The `-- bsb: rename old -> new` lines of a migration or edit log. */
422
+ export declare function parseRenameHints(text: string): RenameHint[];
423
+ /**
424
+ * Applies the rules of ADR 0106 to a plan: only a recorded rename or a
425
+ * confirmed prompt becomes a rename, an ambiguous candidate never does, and a
426
+ * destructive action is blocked unless data loss is allowed. Returns the
427
+ * decisions and the findings as `Issue`s with `source: "plan"`.
428
+ */
429
+ export declare function gatePlan(plan: PlanLike, options?: GateOptions): PlanGate;
430
+ //#endregion
372
431
  export { APP_MODULE, AppColumn, type AppColumnAccess, type AppColumnType, AppEvents, AppLookup, AppReference, AppRollup, AppScope, AppSubject, AppTable, AppTableId, ComputedRow, ConnectResult, Connection, Design, DraftRollup, EMPTY_DESIGN, type Issue, type IssueCode, type IssueSeverity, type IssueSource, NamedDesign, APP_ON_DELETE_ACTIONS as ON_DELETE_ACTIONS, type AppOnDeleteAction as OnDeleteAction, type PresetMigrationFile, ROLLUP_AGGREGATES, RollupAggregate, SchemaColumn, SchemaComputed, SchemaData, SchemaForeignKey, SchemaOptions, SchemaSoftRef, SchemaSource, SchemaTable, SchemaTarget, TablePatch, addTable, appTableId, columnError, computedColumnRenamed, computedRows, computedTableRenamed, connect, defaultError, deleteColumn, deleteExtraColumn, deleteTable, duplicateTable, editTable, eventsColumnsEdited, filterColumns, fittedRollup, freeTableName, identifierError, isAppTable, isEmptyDesign, isRollupAggregate, keyColumnsOf, lookupSources, moveTables, parseSchema, prunedComputed, readableColumns, referenceFrom, renameColumn, renameTable, rollupColumns, rollupSources, schemaRelations, setColumn, setExtraColumn, setTableId, singular, subjectColumns, subjectColumnsEdited, subjectTypeError, tableStatements, tableWithComputed, tableWithoutComputed, tenantColumnOf, tidy, updateTable, userConnection, withDesign };
@@ -1,6 +1,6 @@
1
- import { k as APP_ON_DELETE_ACTIONS } from "../instances-BPJSESPx.js";
2
- import { m as diffDesigns } from "../preset-B1xXOJ0T.js";
3
- import { $ as tableWithComputed, A as referenceFrom, B as withDesign, C as duplicateTable, D as isAppTable, E as identifierError, F as setTableId, G as filterColumns, H as computedColumnRenamed, I as singular, J as lookupSources, K as fittedRollup, L as tidy, M as renameTable, N as setColumn, O as isEmptyDesign, P as setExtraColumn, Q as rollupSources, R as updateTable, S as deleteTable, T as freeTableName, U as computedRows, V as ROLLUP_AGGREGATES, W as computedTableRenamed, X as readableColumns, Y as prunedComputed, Z as rollupColumns, _ as columnError, a as parseSchema, at as boundError, b as deleteColumn, c as tenantColumnOf, ct as fitted, d as previewFiles, dt as takesBounds, et as tableWithoutComputed, f as designIssues, ft as withBounds, g as appTableId, h as addTable, i as keyColumnsOf, it as subjectTypeError, j as renameColumn, k as moveTables, l as schemaData, lt as lockedWithoutDefault, m as EMPTY_DESIGN, n as loadProject, nt as subjectColumns, o as schemaRelations, ot as columnLabel, p as APP_MODULE, q as isRollupAggregate, r as checkDesign, rt as subjectColumnsEdited, s as tableStatements, st as encryptable, t as checkProject, tt as eventsColumnsEdited, u as previewAccessProvider, ut as optionError, v as connect, w as editTable, x as deleteExtraColumn, y as defaultError, z as userConnection } from "../project-BM6QMtzV.js";
1
+ import { k as APP_ON_DELETE_ACTIONS } from "../instances-C7qUTjhJ.js";
2
+ import { m as diffDesigns } from "../preset-DwuWNBip.js";
3
+ import { $ as tableWithComputed, A as referenceFrom, B as withDesign, C as duplicateTable, D as isAppTable, E as identifierError, F as setTableId, G as filterColumns, H as computedColumnRenamed, I as singular, J as lookupSources, K as fittedRollup, L as tidy, M as renameTable, N as setColumn, O as isEmptyDesign, P as setExtraColumn, Q as rollupSources, R as updateTable, S as deleteTable, T as freeTableName, U as computedRows, V as ROLLUP_AGGREGATES, W as computedTableRenamed, X as readableColumns, Y as prunedComputed, Z as rollupColumns, _ as columnError, a as parseSchema, at as boundError, b as deleteColumn, c as tenantColumnOf, ct as fitted, d as previewFiles, dt as takesBounds, et as tableWithoutComputed, f as designIssues, ft as withBounds, g as appTableId, h as addTable, i as keyColumnsOf, it as subjectTypeError, j as renameColumn, k as moveTables, l as schemaData, lt as lockedWithoutDefault, m as EMPTY_DESIGN, n as loadProject, nt as subjectColumns, o as schemaRelations, ot as columnLabel, p as APP_MODULE, q as isRollupAggregate, r as checkDesign, rt as subjectColumnsEdited, s as tableStatements, st as encryptable, t as checkProject, tt as eventsColumnsEdited, u as previewAccessProvider, ut as optionError, v as connect, w as editTable, x as deleteExtraColumn, y as defaultError, z as userConnection } from "../project-Bo1vZqVs.js";
4
4
  //#region src/create/column-kinds.ts
5
5
  /** The groups of the column type picker, in the order it shows them. */
6
6
  const KIND_GROUPS = [
@@ -602,4 +602,67 @@ function migrationBetween(preset, base, next) {
602
602
  };
603
603
  }
604
604
  //#endregion
605
- export { APP_MODULE, COLUMN_KINDS, EMPTY_DESIGN, HISTORY_LIMIT, KIND_GROUPS, MIGRATION_NAME, APP_ON_DELETE_ACTIONS as ON_DELETE_ACTIONS, ROLLUP_AGGREGATES, SAMPLE_ROW_COUNT, addTable, appTableId, boundError, checkDesign, checkProject, columnError, columnLabel, computedColumnRenamed, computedRows, computedTableRenamed, connect, dashboardUrl, defaultError, deleteColumn, deleteExtraColumn, deleteTable, deployBlocker, deployQuery, designIssues, duplicateTable, editTable, encryptable, eventsColumnsEdited, filterColumns, fitted, fittedRollup, freeTableName, generatePassword, hiddenColumns, identifierError, initialHistory, isAppTable, isEmptyDesign, isRollupAggregate, keyColumnsOf, kindById, kindOf, loadProject, lockedWithoutDefault, lookupSources, migrationBetween, moveTables, newDeployId, optionError, parseSchema, previewAccessProvider, previewFiles, prunedComputed, readableColumns, referenceFrom, renameColumn, renameTable, rollupColumns, rollupSources, sampleRows, schemaData, schemaRelations, setColumn, setColumnKind, setExtraColumn, setTableId, singular, subjectColumns, subjectColumnsEdited, subjectTypeError, suggestedProjectName, tableStatements, tableWithComputed, tableWithoutComputed, takesBounds, tenantColumnOf, tidy, undoHistory, updateTable, userConnection, withBounds, withDesign, withKind };
605
+ //#region src/create/plan-gate.ts
606
+ const HINT = /^--\s*bsb:\s*rename\s+(\S+)\s*->\s*(\S+)\s*$/gmu;
607
+ /** The `-- bsb: rename old -> new` lines of a migration or edit log. */
608
+ function parseRenameHints(text) {
609
+ return [...text.matchAll(HINT)].flatMap((match) => {
610
+ const [, from, to] = match;
611
+ return from === void 0 || to === void 0 ? [] : [{
612
+ from,
613
+ to
614
+ }];
615
+ });
616
+ }
617
+ function bare(name) {
618
+ return name.replaceAll("\"", "").toLowerCase();
619
+ }
620
+ /** `id` names `name`, written as `table` or `schema.table`. */
621
+ function names(id, name) {
622
+ const wanted = bare(name);
623
+ const have = bare(id);
624
+ return have === wanted || have.endsWith(`.${wanted}`) || have.endsWith(`:${wanted}`);
625
+ }
626
+ function confirmed(candidate, hints) {
627
+ return hints.some((hint) => names(candidate.from, hint.from) && names(candidate.to, hint.to));
628
+ }
629
+ function planIssue(code, severity, table, message) {
630
+ return {
631
+ code,
632
+ severity,
633
+ source: "plan",
634
+ path: "",
635
+ table,
636
+ message
637
+ };
638
+ }
639
+ /**
640
+ * Applies the rules of ADR 0106 to a plan: only a recorded rename or a
641
+ * confirmed prompt becomes a rename, an ambiguous candidate never does, and a
642
+ * destructive action is blocked unless data loss is allowed. Returns the
643
+ * decisions and the findings as `Issue`s with `source: "plan"`.
644
+ */
645
+ function gatePlan(plan, options = {}) {
646
+ const hints = options.hints ?? [];
647
+ const accepted = [];
648
+ const questions = [];
649
+ const unresolved = [];
650
+ for (const candidate of plan.renameCandidates) if (candidate.status !== "unambiguous") unresolved.push(candidate);
651
+ else if (confirmed(candidate, hints)) accepted.push(candidate);
652
+ else questions.push(candidate);
653
+ const destructive = plan.actions.filter((action) => action.dataLoss === "destructive");
654
+ return {
655
+ accepted,
656
+ questions,
657
+ unresolved,
658
+ destructive,
659
+ blocked: destructive.length > 0 && options.allowDataLoss !== true,
660
+ issues: [
661
+ ...questions.map((candidate) => planIssue("plan_rename_question", "warning", candidate.to, `Is ${candidate.from} renamed to ${candidate.to}? Record \`-- bsb: rename\` or it plans as drop and create.`)),
662
+ ...unresolved.map((candidate) => planIssue("plan_rename_unresolved", "info", candidate.to, `${candidate.from} to ${candidate.to} is ${candidate.status}${candidate.reason === void 0 ? "" : `: ${candidate.reason}`}; it plans as drop and create.`)),
663
+ ...destructive.map((action) => planIssue("plan_data_loss", options.allowDataLoss === true ? "warning" : "error", "", `Destroys data: ${action.sql.split("\n")[0] ?? ""}`))
664
+ ]
665
+ };
666
+ }
667
+ //#endregion
668
+ export { APP_MODULE, COLUMN_KINDS, EMPTY_DESIGN, HISTORY_LIMIT, KIND_GROUPS, MIGRATION_NAME, APP_ON_DELETE_ACTIONS as ON_DELETE_ACTIONS, ROLLUP_AGGREGATES, SAMPLE_ROW_COUNT, addTable, appTableId, boundError, checkDesign, checkProject, columnError, columnLabel, computedColumnRenamed, computedRows, computedTableRenamed, connect, dashboardUrl, defaultError, deleteColumn, deleteExtraColumn, deleteTable, deployBlocker, deployQuery, designIssues, duplicateTable, editTable, encryptable, eventsColumnsEdited, filterColumns, fitted, fittedRollup, freeTableName, gatePlan, generatePassword, hiddenColumns, identifierError, initialHistory, isAppTable, isEmptyDesign, isRollupAggregate, keyColumnsOf, kindById, kindOf, loadProject, lockedWithoutDefault, lookupSources, migrationBetween, moveTables, newDeployId, optionError, parseRenameHints, parseSchema, previewAccessProvider, previewFiles, prunedComputed, readableColumns, referenceFrom, renameColumn, renameTable, rollupColumns, rollupSources, sampleRows, schemaData, schemaRelations, setColumn, setColumnKind, setExtraColumn, setTableId, singular, subjectColumns, subjectColumnsEdited, subjectTypeError, suggestedProjectName, tableStatements, tableWithComputed, tableWithoutComputed, takesBounds, tenantColumnOf, tidy, undoHistory, updateTable, userConnection, withBounds, withDesign, withKind };