better-supabase 0.20.0 → 0.21.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 (488) hide show
  1. package/dist/{adapter-CfuBICuG.js → adapter-DZJZTY6g.js} +2 -2
  2. package/dist/{ai-cache-BuNbWEFI.js → ai-cache-BFRKxgZ4.js} +2 -2
  3. package/dist/{ai-files-DeMWQfzs.js → ai-files-m_2z3rH1.js} +3 -3
  4. package/dist/{ai-schedules-Bp-U0cZG.d.ts → ai-schedules-7uQNMXve.d.ts} +1 -1
  5. package/dist/ai-sdk/agents/index.d.ts +2 -2
  6. package/dist/ai-sdk/batches/index.js +3 -3
  7. package/dist/ai-sdk/cache/index.js +1 -1
  8. package/dist/ai-sdk/chat/index.js +1 -1
  9. package/dist/ai-sdk/files/index.js +2 -2
  10. package/dist/ai-sdk/index.js +3 -3
  11. package/dist/ai-sdk/mcp/index.js +2 -2
  12. package/dist/ai-sdk/workflow/index.js +2 -2
  13. package/dist/{api-BIw5g_4V.d.ts → api-Cj4W_pqT.d.ts} +1 -1
  14. package/dist/{app-tables-oYkgtcRM.d.ts → app-tables-C5HjXs2k.d.ts} +1 -1
  15. package/dist/astro/index.d.ts +3 -3
  16. package/dist/astro/index.js +2 -2
  17. package/dist/{attachments-BTIwCuwm.js → attachments-BXbLnNxm.js} +5 -5
  18. package/dist/{authorization-08F77H2w.d.ts → authorization-DhoA7dsD.d.ts} +22 -8
  19. package/dist/{automations-jIIaT9EJ.js → automations-BMuqwZZn.js} +5 -5
  20. package/dist/better-result/index.d.ts +2 -2
  21. package/dist/{bind-BwQGUqdQ.d.ts → bind-CFsctoFJ.d.ts} +4 -4
  22. package/dist/{block-authors-D9hyCizs.js → block-authors-Bw3zdzgl.js} +1 -1
  23. package/dist/{block-env-Dh0Fe-fK.d.ts → block-env-BrUNeuJ_.d.ts} +4 -4
  24. package/dist/{block-events-pBXPzwnW.js → block-events-IWAyafO3.js} +1 -1
  25. package/dist/{block-fields-DE_FgpOU.js → block-fields-BjXgX_5c.js} +4 -3
  26. package/dist/{block-helpers-DnCtsKtv.js → block-helpers-B0f0ZVb5.js} +169 -4
  27. package/dist/{block-hooks-DbIpkq7a.js → block-hooks-DKtz0HRh.js} +1 -1
  28. package/dist/{block-subjects-BRJO0IqO.js → block-subjects-DFSuFY1a.js} +1 -1
  29. package/dist/blocks/access-requests/index.d.ts +1 -1
  30. package/dist/blocks/access-requests/index.js +4 -5
  31. package/dist/blocks/activities/index.d.ts +1 -1
  32. package/dist/blocks/activities/index.js +4 -5
  33. package/dist/blocks/agents/index.d.ts +1 -1
  34. package/dist/blocks/agents/index.js +3 -4
  35. package/dist/blocks/ai-cache/index.d.ts +1 -1
  36. package/dist/blocks/ai-cache/index.js +2 -2
  37. package/dist/blocks/ai-chat/index.d.ts +4 -4
  38. package/dist/blocks/ai-chat/index.js +3 -4
  39. package/dist/blocks/ai-files/index.d.ts +1 -1
  40. package/dist/blocks/ai-files/index.js +2 -2
  41. package/dist/blocks/ai-keys/index.d.ts +1 -1
  42. package/dist/blocks/ai-keys/index.js +2 -3
  43. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  44. package/dist/blocks/ai-schedules/index.js +5 -6
  45. package/dist/blocks/announcements/index.d.ts +4 -4
  46. package/dist/blocks/announcements/index.js +3 -4
  47. package/dist/blocks/api-keys/index.d.ts +2 -2
  48. package/dist/blocks/api-keys/index.js +4 -5
  49. package/dist/blocks/approvals/index.d.ts +1 -1
  50. package/dist/blocks/approvals/index.js +4 -5
  51. package/dist/blocks/assets/index.d.ts +1 -1
  52. package/dist/blocks/assets/index.js +3 -4
  53. package/dist/blocks/assignment/index.d.ts +1 -1
  54. package/dist/blocks/assignment/index.js +4 -5
  55. package/dist/blocks/attachments/index.d.ts +2 -2
  56. package/dist/blocks/attachments/index.js +4 -5
  57. package/dist/blocks/audit/index.d.ts +5 -5
  58. package/dist/blocks/audit/index.js +7 -8
  59. package/dist/blocks/automations/index.d.ts +3 -3
  60. package/dist/blocks/automations/index.js +5 -5
  61. package/dist/blocks/billable-time/index.d.ts +1 -1
  62. package/dist/blocks/billable-time/index.js +6 -7
  63. package/dist/blocks/billing/index.d.ts +3 -3
  64. package/dist/blocks/billing/index.js +5 -6
  65. package/dist/blocks/bookings/index.d.ts +3 -3
  66. package/dist/blocks/bookings/index.js +6 -6
  67. package/dist/blocks/bulk/index.d.ts +4 -3
  68. package/dist/blocks/bulk/index.js +4 -4
  69. package/dist/blocks/calendar/index.d.ts +2 -2
  70. package/dist/blocks/calendar/index.js +6 -6
  71. package/dist/blocks/catalog/index.d.ts +1 -1
  72. package/dist/blocks/catalog/index.js +5 -6
  73. package/dist/blocks/channels/index.d.ts +1 -1
  74. package/dist/blocks/channels/index.js +3 -4
  75. package/dist/blocks/collections/index.d.ts +1 -1
  76. package/dist/blocks/collections/index.js +3 -4
  77. package/dist/blocks/comments/index.d.ts +5 -5
  78. package/dist/blocks/comments/index.js +8 -9
  79. package/dist/blocks/compliance/index.d.ts +1 -1
  80. package/dist/blocks/compliance/index.js +5 -6
  81. package/dist/blocks/connectors/index.d.ts +1 -1
  82. package/dist/blocks/connectors/index.js +3 -4
  83. package/dist/blocks/contacts/index.d.ts +1 -1
  84. package/dist/blocks/contacts/index.js +4 -5
  85. package/dist/blocks/content/index.d.ts +1 -1
  86. package/dist/blocks/content/index.js +3 -4
  87. package/dist/blocks/contracts/index.d.ts +1 -1
  88. package/dist/blocks/contracts/index.js +8 -9
  89. package/dist/blocks/courses/index.d.ts +1 -1
  90. package/dist/blocks/courses/index.js +5 -6
  91. package/dist/blocks/created-by/index.d.ts +1 -1
  92. package/dist/blocks/custom-fields/index.d.ts +1 -1
  93. package/dist/blocks/custom-fields/index.js +2 -2
  94. package/dist/blocks/data-lifecycle/index.d.ts +1 -1
  95. package/dist/blocks/data-lifecycle/index.js +2 -3
  96. package/dist/blocks/deals/index.d.ts +1 -1
  97. package/dist/blocks/deals/index.js +9 -10
  98. package/dist/blocks/dispatch/index.d.ts +1 -1
  99. package/dist/blocks/dispatch/index.js +7 -8
  100. package/dist/blocks/documents/index.d.ts +1 -1
  101. package/dist/blocks/documents/index.js +2 -3
  102. package/dist/blocks/domains/index.d.ts +1 -1
  103. package/dist/blocks/domains/index.js +3 -4
  104. package/dist/blocks/donations/index.d.ts +1 -1
  105. package/dist/blocks/donations/index.js +7 -8
  106. package/dist/blocks/drive/index.d.ts +5 -1
  107. package/dist/blocks/drive/index.js +6 -7
  108. package/dist/blocks/employees/index.d.ts +2 -2
  109. package/dist/blocks/employees/index.js +7 -8
  110. package/dist/blocks/enrichment/index.d.ts +1 -1
  111. package/dist/blocks/enrichment/index.js +2 -3
  112. package/dist/blocks/enrollments/index.d.ts +1 -1
  113. package/dist/blocks/enrollments/index.js +3 -4
  114. package/dist/blocks/entitlements/index.d.ts +3 -3
  115. package/dist/blocks/entitlements/index.js +2 -2
  116. package/dist/blocks/expenses/index.d.ts +1 -1
  117. package/dist/blocks/expenses/index.js +6 -7
  118. package/dist/blocks/field-history/index.d.ts +1 -1
  119. package/dist/blocks/field-history/index.js +2 -3
  120. package/dist/blocks/flags/index.d.ts +1 -1
  121. package/dist/blocks/flags/index.js +4 -5
  122. package/dist/blocks/forecasts/index.d.ts +1 -1
  123. package/dist/blocks/forecasts/index.js +5 -6
  124. package/dist/blocks/forms/index.d.ts +2 -2
  125. package/dist/blocks/forms/index.js +3 -4
  126. package/dist/blocks/goals/index.d.ts +1 -1
  127. package/dist/blocks/goals/index.js +4 -5
  128. package/dist/blocks/guests/index.d.ts +1 -1
  129. package/dist/blocks/guests/index.js +4 -5
  130. package/dist/blocks/hiring/index.d.ts +1 -1
  131. package/dist/blocks/hiring/index.js +4 -5
  132. package/dist/blocks/identities/index.d.ts +1 -1
  133. package/dist/blocks/identities/index.js +2 -3
  134. package/dist/blocks/imports/index.d.ts +1 -1
  135. package/dist/blocks/imports/index.js +2 -2
  136. package/dist/blocks/inbox/index.d.ts +5 -5
  137. package/dist/blocks/inbox/index.js +3 -4
  138. package/dist/blocks/incidents/index.d.ts +1 -1
  139. package/dist/blocks/incidents/index.js +5 -6
  140. package/dist/blocks/index.d.ts +2 -2
  141. package/dist/blocks/index.js +6 -6
  142. package/dist/blocks/inventory/index.d.ts +1 -1
  143. package/dist/blocks/inventory/index.js +3 -4
  144. package/dist/blocks/invoices/index.d.ts +1 -1
  145. package/dist/blocks/invoices/index.js +6 -7
  146. package/dist/blocks/knowledge/index.d.ts +1 -1
  147. package/dist/blocks/knowledge/index.js +2 -2
  148. package/dist/blocks/lead-scoring/index.d.ts +1 -1
  149. package/dist/blocks/lead-scoring/index.js +4 -5
  150. package/dist/blocks/leases/index.d.ts +1 -1
  151. package/dist/blocks/leases/index.js +7 -8
  152. package/dist/blocks/leave/index.d.ts +1 -1
  153. package/dist/blocks/leave/index.js +4 -5
  154. package/dist/blocks/ledger/index.d.ts +1 -1
  155. package/dist/blocks/ledger/index.js +3 -4
  156. package/dist/blocks/mail-sync/index.d.ts +1 -1
  157. package/dist/blocks/mail-sync/index.js +4 -5
  158. package/dist/blocks/memberships/index.d.ts +1 -1
  159. package/dist/blocks/memory/index.d.ts +1 -1
  160. package/dist/blocks/memory/index.js +3 -4
  161. package/dist/blocks/messaging/index.d.ts +5 -5
  162. package/dist/blocks/messaging/index.js +5 -6
  163. package/dist/blocks/metrics/index.d.ts +1 -1
  164. package/dist/blocks/metrics/index.js +4 -5
  165. package/dist/blocks/mfa/index.d.ts +2 -2
  166. package/dist/blocks/moderation/index.d.ts +1 -1
  167. package/dist/blocks/moderation/index.js +3 -4
  168. package/dist/blocks/notifications/index.d.ts +4 -4
  169. package/dist/blocks/notifications/index.js +7 -8
  170. package/dist/blocks/numbering/index.d.ts +1 -1
  171. package/dist/blocks/numbering/index.js +2 -2
  172. package/dist/blocks/oauth-server/index.d.ts +1 -1
  173. package/dist/blocks/oauth-server/index.js +3 -4
  174. package/dist/blocks/onboarding/index.d.ts +2 -2
  175. package/dist/blocks/onboarding/index.js +2 -3
  176. package/dist/blocks/orders/index.d.ts +9 -2
  177. package/dist/blocks/orders/index.js +7 -8
  178. package/dist/blocks/organizations/index.d.ts +3 -3
  179. package/dist/blocks/organizations/index.js +5 -6
  180. package/dist/blocks/outbox/index.d.ts +1 -1
  181. package/dist/blocks/outbox/index.js +3 -4
  182. package/dist/blocks/passes/index.d.ts +2 -2
  183. package/dist/blocks/passes/index.js +7 -8
  184. package/dist/blocks/permissions/index.d.ts +3 -3
  185. package/dist/blocks/permissions/index.js +2 -3
  186. package/dist/blocks/pipelines/index.d.ts +1 -1
  187. package/dist/blocks/pipelines/index.js +4 -5
  188. package/dist/blocks/posts/index.d.ts +1 -1
  189. package/dist/blocks/posts/index.js +4 -5
  190. package/dist/blocks/profiles/index.d.ts +1 -1
  191. package/dist/blocks/profiles/index.js +3 -4
  192. package/dist/blocks/promotions/index.d.ts +1 -1
  193. package/dist/blocks/promotions/index.js +4 -5
  194. package/dist/blocks/push/index.d.ts +2 -2
  195. package/dist/blocks/push/index.js +4 -5
  196. package/dist/blocks/queue/index.d.ts +1 -1
  197. package/dist/blocks/queue/index.js +7 -8
  198. package/dist/blocks/quotes/index.d.ts +1 -1
  199. package/dist/blocks/quotes/index.js +6 -7
  200. package/dist/blocks/rank/index.d.ts +1 -1
  201. package/dist/blocks/rank/index.js +2 -2
  202. package/dist/blocks/reactions/index.d.ts +4 -4
  203. package/dist/blocks/reactions/index.js +3 -4
  204. package/dist/blocks/relations/index.d.ts +3 -2
  205. package/dist/blocks/relations/index.js +8 -8
  206. package/dist/blocks/reminders/index.d.ts +10 -6
  207. package/dist/blocks/reminders/index.js +13 -12
  208. package/dist/blocks/reviews/index.d.ts +1 -1
  209. package/dist/blocks/reviews/index.js +3 -4
  210. package/dist/blocks/saved-views/index.d.ts +3 -3
  211. package/dist/blocks/saved-views/index.js +3 -3
  212. package/dist/blocks/scores/index.d.ts +1 -1
  213. package/dist/blocks/scores/index.js +4 -4
  214. package/dist/blocks/search/index.d.ts +3 -3
  215. package/dist/blocks/search/index.js +2 -3
  216. package/dist/blocks/security-events/index.d.ts +1 -1
  217. package/dist/blocks/security-events/index.js +2 -3
  218. package/dist/blocks/segments/index.d.ts +1 -1
  219. package/dist/blocks/segments/index.js +4 -5
  220. package/dist/blocks/sequences/index.d.ts +1 -1
  221. package/dist/blocks/sequences/index.js +3 -4
  222. package/dist/blocks/service-accounts/index.d.ts +1 -1
  223. package/dist/blocks/service-accounts/index.js +3 -4
  224. package/dist/blocks/sessions/index.d.ts +2 -2
  225. package/dist/blocks/sessions/index.js +1 -1
  226. package/dist/blocks/settings/index.d.ts +2 -2
  227. package/dist/blocks/settings/index.js +2 -3
  228. package/dist/blocks/share-links/index.d.ts +1 -1
  229. package/dist/blocks/share-links/index.js +6 -6
  230. package/dist/blocks/shipments/index.d.ts +1 -1
  231. package/dist/blocks/shipments/index.js +9 -10
  232. package/dist/blocks/signatures/index.d.ts +1 -1
  233. package/dist/blocks/signatures/index.js +3 -4
  234. package/dist/blocks/signing-keys/index.d.ts +1 -1
  235. package/dist/blocks/signing-keys/index.js +2 -2
  236. package/dist/blocks/sla/index.d.ts +1 -1
  237. package/dist/blocks/sla/index.js +7 -8
  238. package/dist/blocks/sso/index.d.ts +1 -1
  239. package/dist/blocks/sso/index.js +2 -3
  240. package/dist/blocks/state-machine/index.d.ts +1 -1
  241. package/dist/blocks/state-machine/index.js +3 -3
  242. package/dist/blocks/subjects/index.d.ts +2 -2
  243. package/dist/blocks/subjects/index.js +3 -4
  244. package/dist/blocks/tags/index.d.ts +2 -2
  245. package/dist/blocks/tags/index.js +5 -5
  246. package/dist/blocks/tasks/index.d.ts +2 -2
  247. package/dist/blocks/tasks/index.js +7 -8
  248. package/dist/blocks/teams/index.d.ts +1 -1
  249. package/dist/blocks/teams/index.js +3 -3
  250. package/dist/blocks/templates/index.d.ts +3 -3
  251. package/dist/blocks/templates/index.js +3 -4
  252. package/dist/blocks/time-tracking/index.d.ts +8 -1
  253. package/dist/blocks/time-tracking/index.js +9 -10
  254. package/dist/blocks/timeline/index.d.ts +3 -3
  255. package/dist/blocks/timeline/index.js +4 -5
  256. package/dist/blocks/trash/index.d.ts +1 -1
  257. package/dist/blocks/trash/index.js +3 -4
  258. package/dist/blocks/undo/index.d.ts +2 -2
  259. package/dist/blocks/undo/index.js +2 -2
  260. package/dist/blocks/updated-at/index.d.ts +1 -1
  261. package/dist/blocks/usage/index.d.ts +2 -2
  262. package/dist/blocks/usage/index.js +2 -3
  263. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  264. package/dist/blocks/vercel-marketplace/index.js +3 -4
  265. package/dist/blocks/versions/index.d.ts +1 -1
  266. package/dist/blocks/versions/index.js +6 -7
  267. package/dist/blocks/waitlist/index.d.ts +1 -1
  268. package/dist/blocks/waitlist/index.js +4 -5
  269. package/dist/blocks/webhooks/index.d.ts +3 -3
  270. package/dist/blocks/webhooks/index.js +11 -12
  271. package/dist/blocks/workflow-editor/index.d.ts +6 -6
  272. package/dist/blocks/workflow-editor/index.js +9 -10
  273. package/dist/blocks/workflows/index.d.ts +4 -4
  274. package/dist/blocks/workflows/index.js +4 -5
  275. package/dist/{bookings-Dox2rced.d.ts → bookings-BpCNphYp.d.ts} +1 -2
  276. package/dist/{build-D9lWi5bk.js → build-CM8PJqwW.js} +1 -1
  277. package/dist/{build-BFC8nFiL.js → build-DbIRFcHQ.js} +3 -65
  278. package/dist/chat-sdk/index.js +2 -3
  279. package/dist/cli/{add-CtLjnwds.js → add-BTDPjVGC.js} +9 -9
  280. package/dist/cli/{add-CH7dC6UR.js → add-C0w-mVTQ.js} +2 -2
  281. package/dist/cli/add-CspY9jKT.js +1 -0
  282. package/dist/cli/{backfill-DBJIMzcy.js → backfill-BDdBs6Ne.js} +1 -1
  283. package/dist/cli/bin.js +1 -1
  284. package/dist/cli/{blocks-i1w0EEvs.js → blocks-Bs-lA-U_.js} +1 -1
  285. package/dist/cli/{blocks-CS58-xnw.js → blocks-CQLME-HQ.js} +1 -1
  286. package/dist/cli/{cache-Cn3crN0v.js → cache-DDKao2Va.js} +1 -1
  287. package/dist/cli/{codemod-D6wifOAH.js → codemod-Bjl998Do.js} +1 -1
  288. package/dist/cli/{content-mapper-Q9We297z.js → content-mapper-DgSTl-DL.js} +2 -2
  289. package/dist/cli/{doctor-DmfdE5Ct.js → doctor-CMLWbt44.js} +57 -55
  290. package/dist/cli/{gen-D68A0uN8.js → gen-D3VX8WdV.js} +11 -11
  291. package/dist/cli/index.d.ts +1 -1
  292. package/dist/cli/index.js +6 -6
  293. package/dist/cli/{init-N7pkBbJn.js → init-D6D6eWze.js} +5 -5
  294. package/dist/cli/{live-0xAAlTK_.js → live-C_xgTOfD.js} +2 -2
  295. package/dist/cli/{mcp-CbN3ulRF.js → mcp-B0Irjbes.js} +2 -2
  296. package/dist/cli/{metadata-417ldpf4.js → metadata-cLXra-XB.js} +3 -3
  297. package/dist/cli/{migration-safety-BC_UI4jC.js → migration-safety-OUK-Afbb.js} +1 -1
  298. package/dist/cli/{migrations-DdBKwrvG.js → migrations-CHenMvl_.js} +1 -1
  299. package/dist/cli/{module-migration-DdxPdqMC.js → module-migration-6V7vXWUK.js} +2 -2
  300. package/dist/cli/{powersync-CJTEz-uY.js → powersync-D83yAFbl.js} +2 -2
  301. package/dist/cli/powersync-DwhCH0gs.js +1 -0
  302. package/dist/cli/{print-DyFm91R-.js → print-C0OmQyTu.js} +2 -2
  303. package/dist/cli/{remove-CPY0xsVm.js → remove-BWlOngNT.js} +5 -5
  304. package/dist/cli/{render-DE3O1OFq.js → render-9m70qveo.js} +22 -5
  305. package/dist/cli/{run-CcrNGX9C.js → run-He3M-ZRq.js} +21 -21
  306. package/dist/cli/{run-WtIEFGvP.js → run-gE4eAazR.js} +8 -8
  307. package/dist/cli/{shared-SlukBuKn.js → shared-Cx2WFVWq.js} +1 -1
  308. package/dist/cli/{snapshot-pyIsJjUV.js → snapshot-CZb3uVKE.js} +2 -2
  309. package/dist/cli/{source-Bclt9D0Y.js → source-CrYSCdPZ.js} +1 -1
  310. package/dist/cli/{spec-D7zsEVj_.js → spec-Cn5RhuQc.js} +2 -2
  311. package/dist/cli/{spec-BsdLx7tZ.js → spec-D4b9ePuQ.js} +1 -1
  312. package/dist/cli/{sql-layout-C6baAM5t.js → sql-layout-CLJ67h3L.js} +2 -2
  313. package/dist/cli/{sync-Cse8VXAU.js → sync-B8VGiaHk.js} +3 -3
  314. package/dist/cli/{upgrade-Cwc1RiAE.js → upgrade-BvBWK3Fo.js} +4 -4
  315. package/dist/cli/{upgrade-28ENjIJU.js → upgrade-DMiYx1C8.js} +2 -2
  316. package/dist/cli/{version-yWIaLG04.js → version-BVg2Z6yv.js} +1 -1
  317. package/dist/client/index.d.ts +5 -5
  318. package/dist/client/index.js +1 -1
  319. package/dist/client/native/index.d.ts +4 -4
  320. package/dist/client/native/index.js +1 -1
  321. package/dist/{codecs-BfmQSbM6.js → codecs-CSUFGrdP.js} +3 -3
  322. package/dist/commerce/index.js +3 -3
  323. package/dist/{composite-DbRuu6Jb.d.ts → composite-ChzHhSB0.d.ts} +3 -3
  324. package/dist/{composite-D24L5RIY.js → composite-Dw5ofSF_.js} +1 -1
  325. package/dist/config/index.d.ts +2 -2
  326. package/dist/config/index.js +2 -2
  327. package/dist/{config-D74JT0qL.js → config-BOt5T6Vs.js} +1 -1
  328. package/dist/{context-CjHXhCck.d.ts → context-sgrUjA3U.d.ts} +4 -4
  329. package/dist/{controller-BeqcjERs.d.ts → controller-B6vWdKSa.d.ts} +1 -1
  330. package/dist/{controller-BNZKd6bJ.js → controller-qG-B1eDn.js} +1 -1
  331. package/dist/{conversion-BqDvi8ty.d.ts → conversion-DBgMck5U.d.ts} +1 -1
  332. package/dist/create/index.d.ts +2 -2
  333. package/dist/create/index.js +2 -2
  334. package/dist/{create-blocks-0pWKQ6x4.js → create-blocks-CUS28FfS.js} +13 -9
  335. package/dist/credentials/index.js +2 -3
  336. package/dist/{cron-CgHTKwYG.js → cron-DdT4ti8a.js} +1 -1
  337. package/dist/{cron-route-UU9i5i9J.js → cron-route-FjKgRvTY.js} +1 -1
  338. package/dist/{deal-forecast-DikouYGj.js → deal-forecast-CKBnRodz.js} +2 -2
  339. package/dist/{define-Djgn3HQQ.js → define-D-dLADd5.js} +16 -19
  340. package/dist/{define-BqaUwrIC.d.ts → define-Lf6rI2QN.d.ts} +14 -8
  341. package/dist/{define-block-CRwHsxZO.d.ts → define-block-DCAiOrNX.d.ts} +12 -3
  342. package/dist/edge/index.d.ts +5 -5
  343. package/dist/edge/index.js +3 -3
  344. package/dist/{entitlements-mDz7GfA_.d.ts → entitlements-BPaPd3MD.d.ts} +1 -1
  345. package/dist/{entitlements-DBir2qwB.js → entitlements-tGL6-69B.js} +2 -2
  346. package/dist/{entity-schema-BDv6w-OQ.js → entity-schema-B1YmMtP8.js} +1 -1
  347. package/dist/events/index.js +2 -2
  348. package/dist/{executor-3qcMhg6R.js → executor-C2Ne-Scm.js} +3 -2
  349. package/dist/{executor-Bi056Cnj.d.ts → executor-DNK401lZ.d.ts} +1 -1
  350. package/dist/{executor-D3gB-9si.js → executor-DqIci3Jb.js} +3 -3
  351. package/dist/{executor-BQ7dYw4E.js → executor-WolvKszH.js} +3 -3
  352. package/dist/{executor-_O-CqCPl.d.ts → executor-aFV7nEBs.d.ts} +2 -2
  353. package/dist/expo/index.d.ts +2 -2
  354. package/dist/expo/index.js +2 -2
  355. package/dist/{field-errors-Cfvcg-C3.d.ts → field-errors-DBgDCITw.d.ts} +6 -6
  356. package/dist/{fields--5a88KJe.js → fields-BBm49w-E.js} +1 -1
  357. package/dist/{filter-evaluate-w1XOIUOL.js → filter-evaluate-lCToXzZI.js} +2 -2
  358. package/dist/{filter-query-DMoKo82_.js → filter-query-CQ6d5GnQ.js} +1 -1
  359. package/dist/{flags-ClOQY-p5.js → flags-DF_SCqp5.js} +1 -1
  360. package/dist/flags-sdk/index.js +2 -2
  361. package/dist/{framework-B-1Ka0GW.d.ts → framework-DKA3fTHl.d.ts} +3 -3
  362. package/dist/{framework-CNhTg0th.js → framework-DXM1vNcV.js} +1 -1
  363. package/dist/hono/index.d.ts +4 -4
  364. package/dist/hono/index.js +2 -2
  365. package/dist/{index-CjnDGAJr.d.ts → index-5JSxY1MG.d.ts} +1 -1
  366. package/dist/{index-CYzckGOz.d.ts → index-Bt7_mxn0.d.ts} +9 -5
  367. package/dist/{index-BzW1T3oI.d.ts → index-ByF22_C6.d.ts} +3 -3
  368. package/dist/{index-BdzfjFnd.d.ts → index-C4sjewrr.d.ts} +9 -9
  369. package/dist/{index-DfgP-9eC.d.ts → index-CdMZQCYR.d.ts} +3 -3
  370. package/dist/{index-EieRHooI.d.ts → index-ClvuSZEz.d.ts} +2 -2
  371. package/dist/index.d.ts +2 -2
  372. package/dist/index.js +8 -7
  373. package/dist/{json-schema-Ca6gYbEP.js → json-schema-DHJxiizN.js} +1 -1
  374. package/dist/{knowledge-CV6OSirC.js → knowledge-tCrrU99q.js} +2 -2
  375. package/dist/list/index.d.ts +1 -1
  376. package/dist/list/index.js +3 -3
  377. package/dist/{list-query-BKy2zBaT.js → list-query-BnpA2BDg.js} +1 -1
  378. package/dist/{list-query-6vTI1VN6.d.ts → list-query-XYfUZb0j.d.ts} +1 -1
  379. package/dist/mapper/bin.js +5 -5
  380. package/dist/mcp/index.d.ts +4 -4
  381. package/dist/mcp/index.js +2 -2
  382. package/dist/mcp/sdk/index.d.ts +2 -2
  383. package/dist/mcp/sdk/index.js +1 -1
  384. package/dist/{messages-D4XWuRTj.js → messages-ecPW_nOv.js} +1 -1
  385. package/dist/{model-messages-CKG0zwdF.js → model-messages-CkZSDDHP.js} +1 -1
  386. package/dist/{money-codec-uV5WbT60.js → money-codec-BJuS2zEW.js} +1 -1
  387. package/dist/next/index.d.ts +14 -14
  388. package/dist/next/index.js +4 -4
  389. package/dist/{operations-DbNAgo7E.d.ts → operations-DC3wU3Sy.d.ts} +1 -1
  390. package/dist/orpc/index.d.ts +4 -4
  391. package/dist/orpc/index.js +1 -1
  392. package/dist/otel/index.js +5 -5
  393. package/dist/{ports-DO3tgLTo.d.ts → ports-BbBJVyS0.d.ts} +1 -1
  394. package/dist/{ports-CaVRXjxq.js → ports-DvpNseap.js} +1 -1
  395. package/dist/postgres/index.js +5 -4
  396. package/dist/{postgrest-executor-BFW4oWte.js → postgrest-executor-B_Uezhrm.js} +7 -3
  397. package/dist/powersync/index.d.ts +3 -3
  398. package/dist/powersync/index.js +1 -1
  399. package/dist/preset/index.d.ts +3 -3
  400. package/dist/{push-token-IFGi8jvd.d.ts → push-token-CPJfPFa2.d.ts} +1 -1
  401. package/dist/query/index.d.ts +1 -1
  402. package/dist/query/index.js +1 -1
  403. package/dist/{rate-limit-BPuUWz4U.js → rate-limit-fZ_d8gSE.js} +4 -5
  404. package/dist/react/index.d.ts +5 -5
  405. package/dist/react/index.js +1 -1
  406. package/dist/react/native/index.d.ts +1 -1
  407. package/dist/react/server.d.ts +6 -6
  408. package/dist/react/server.js +1 -1
  409. package/dist/{react-D-p70_wL.js → react-_D_CeZMk.js} +3 -3
  410. package/dist/react-router/index.d.ts +3 -3
  411. package/dist/react-router/index.js +2 -2
  412. package/dist/{read-set-BnKnofIj.js → read-set-B1sDib5O.js} +1 -1
  413. package/dist/realtime/index.d.ts +3 -3
  414. package/dist/realtime/index.js +2 -2
  415. package/dist/{record-bindings-DkBJpC5A.js → record-bindings-Z51mGfhB.js} +1 -1
  416. package/dist/{record-form-yMVvkPiQ.d.ts → record-form-BbZpwsEi.d.ts} +1 -1
  417. package/dist/records/index.d.ts +7 -7
  418. package/dist/records/index.js +3 -3
  419. package/dist/{resource-execute-LR71zWej.d.ts → resource-execute-CUG6xUuh.d.ts} +1 -1
  420. package/dist/{resource-types-eXuFxVt7.d.ts → resource-types-DjZ91WKA.d.ts} +1 -1
  421. package/dist/{resources-Dpz3h8Fe.d.ts → resources-6Ncdt9XT.d.ts} +1 -1
  422. package/dist/{rows-EGAbu7MG.js → rows-BdqXmiB-.js} +2 -2
  423. package/dist/{rows-Bh9QemqN.js → rows-jijHLVE_.js} +1 -1
  424. package/dist/{rrule-79K2c3Nr.js → rrule-C9Ot6ax8.js} +1 -1
  425. package/dist/{sales-lines-CP4Z_LyE.js → sales-lines-DO7oRu1o.js} +3 -3
  426. package/dist/{sales-shared-BKXXA5qV.js → sales-shared-BuTA8JK7.js} +2 -2
  427. package/dist/{schemas-BSTNfGsQ.js → schemas-CLOTvdsC.js} +1 -1
  428. package/dist/{scores-CsgM-dw7.js → scores-bY2Is0kx.js} +2 -2
  429. package/dist/server/index.d.ts +7 -7
  430. package/dist/server/index.js +5 -5
  431. package/dist/{server-types-BTBzrzOH.d.ts → server-types-BH6AjDBN.d.ts} +1 -1
  432. package/dist/{session-BgYGk_FS.d.ts → session-Y5SSYO2C.d.ts} +1 -1
  433. package/dist/{shared-C47zAh2A.js → shared-BeHTi8Fu.js} +1 -1
  434. package/dist/{sign-in-BTaRWS-L.js → sign-in-1FJiXXyG.js} +5 -5
  435. package/dist/{signatures-CNcoq392.js → signatures-CX1b4WHa.js} +2 -2
  436. package/dist/{signers-BAEzvTJ0.d.ts → signers-BKgmVh6A.d.ts} +2 -2
  437. package/dist/{signing-keys-DqI-gB_C.js → signing-keys-CWtpMask.js} +3 -3
  438. package/dist/solid/index.d.ts +6 -6
  439. package/dist/solid-start/index.d.ts +3 -3
  440. package/dist/solid-start/index.js +2 -2
  441. package/dist/spec/index.d.ts +1 -1
  442. package/dist/spec/index.js +1 -1
  443. package/dist/{spec-DTWkHzYZ.js → spec-BMvCCNnd.js} +1 -1
  444. package/dist/sql/index.d.ts +4 -4
  445. package/dist/sql/index.js +1 -1
  446. package/dist/{sql-B0wb7XA5.js → sql-BjjgwJKg.js} +9668 -6251
  447. package/dist/{sql-BPbbPzRJ.js → sql-CYt7EhH0.js} +2 -2
  448. package/dist/sqlite/index.d.ts +1 -1
  449. package/dist/sqlite/index.js +1 -1
  450. package/dist/{sso-Co2TbnEy.js → sso-DdDpJQzw.js} +2 -2
  451. package/dist/ssr/index.d.ts +1 -1
  452. package/dist/storage/index.js +3 -3
  453. package/dist/streams/index.js +1 -2
  454. package/dist/{subject-readers-F1xvRY-d.js → subject-readers-CeeJJOQ4.js} +1 -1
  455. package/dist/svelte/index.d.ts +6 -6
  456. package/dist/sveltekit/index.d.ts +4 -4
  457. package/dist/sveltekit/index.js +2 -2
  458. package/dist/{table-schema-CD8cJz_M.js → table-schema-C80xItaV.js} +1 -1
  459. package/dist/{tags-CXeJu332.d.ts → tags-Cjtcp5cN.d.ts} +1 -1
  460. package/dist/tanstack-db/index.d.ts +1 -1
  461. package/dist/tanstack-start/index.d.ts +3 -3
  462. package/dist/tanstack-start/index.js +2 -2
  463. package/dist/{temporal-DLZlWbOi.js → temporal-Dbo0fLzc.js} +12 -2
  464. package/dist/{temporal-required-Dy0GGD8E.js → temporal-required-DcLhnDhQ.js} +1 -1
  465. package/dist/{tenant-DzymQ9sv.d.ts → tenant-BHvMFNXl.d.ts} +1 -1
  466. package/dist/testing/index.d.ts +9 -9
  467. package/dist/testing/index.js +8 -8
  468. package/dist/{timeline-BMVOKokJ.d.ts → timeline-CEzj9v1z.d.ts} +3 -3
  469. package/dist/{topic-0uK4db_2.d.ts → topic-gTVjLGTk.d.ts} +2 -2
  470. package/dist/{types-DsRfiQ0v.d.ts → types-yj8VF4oY.d.ts} +5 -0
  471. package/dist/{undo-B3FQvuAd.js → undo-BbftL9-4.js} +2 -2
  472. package/dist/vercel-connect/index.js +1 -1
  473. package/dist/{verify-ZLFUdlqE.js → verify-7EucfCnv.js} +3 -3
  474. package/dist/{verify-DexkIx4t.d.ts → verify-B0KLBb3j.d.ts} +1 -1
  475. package/dist/vue/index.d.ts +6 -6
  476. package/dist/{watch-topic-CG3kOX-D.d.ts → watch-topic-C6HhbnVz.d.ts} +1 -1
  477. package/dist/wire-ChYn1g21.js +91 -0
  478. package/dist/workflow-sdk/builder/index.d.ts +2 -2
  479. package/dist/workflow-sdk/builder/index.js +1 -1
  480. package/dist/workflow-sdk/world/index.js +1 -1
  481. package/dist/yjs/index.d.ts +1 -1
  482. package/dist/yjs/index.js +1 -1
  483. package/package.json +1 -1
  484. package/skills/better-supabase/references/ui-recipes.md +1 -1
  485. package/dist/block-transport-PNea4lfQ.js +0 -84
  486. package/dist/cli/add-DyCrVejx.js +0 -1
  487. package/dist/cli/powersync-CYQ4Ljcz.js +0 -1
  488. package/dist/{topic-DXbA-jwr.js → topic-J9I3yu6f.js} +1 -1
@@ -3,7 +3,7 @@ import { A as flattenConfig, n as expandFlatPreset, r as expandPreset } from "./
3
3
  import { t as DEFAULT_CLAIMS } from "./claims-Bp9My7XP.js";
4
4
  import { o as tenantNames } from "./entity-naming-Dtyq5sKE.js";
5
5
  import { A as resolveBlock, E as PRESET_CATALOG, d as appTablesOf, f as withAppTableSubjects, j as tenantNameOf } from "./app-tables-DyswUg6J.js";
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-Ca6gYbEP.js";
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
  /**
9
9
  * The error for a provider built for another API version, or `undefined` for
@@ -1,7 +1,7 @@
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-08F77H2w.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-CRwHsxZO.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-DhoA7dsD.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";
5
5
  import { a as ScalarKind, i as FieldSpec } from "./table-schema-BlF6k62Q.js";
6
6
  import { n as SubjectsConfig } from "./subjects-DvmQeF_F.js";
7
7
  import { i as FIELD_FORMAT_NAMES, s as FieldFormatName } from "./field-formats-CAFNkKSN.js";
@@ -490,8 +490,8 @@ interface PipelineContribution {
490
490
  readonly type: string;
491
491
  /** The qualified table its records live in. */
492
492
  readonly table: string;
493
- /** Its tenant column, unquoted; `tenant_id` when left out. */
494
- readonly tenant?: string;
493
+ /** Its tenant column, unquoted, as the block names it. */
494
+ readonly tenant: string;
495
495
  /** The binding; an app's own `on` entry is merged over it. */
496
496
  readonly entry: Readonly<Record<string, unknown>>;
497
497
  }
@@ -1,4 +1,4 @@
1
- import { a as ClientAuth } from "./bind-BwQGUqdQ.js";
1
+ import { a as ClientAuth } from "./bind-CFsctoFJ.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 { n as whileSignedIn, t as defineController } from "./controller-BEliOBOv.js";
2
- import { r as recordEventMatches } from "./record-bindings-DkBJpC5A.js";
2
+ import { r as recordEventMatches } from "./record-bindings-Z51mGfhB.js";
3
3
  import { f as findBinding, p as loadBindings } from "./record-type-DRbnlj5q.js";
4
4
  //#region src/records/controller.ts
5
5
  /**
@@ -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-CRwHsxZO.js";
2
+ import { Bt as Action, Ht as ActionContext, Vt as ActionCall } from "./define-block-DCAiOrNX.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,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Pn as PresetSpec, Wn as PresetName, ar as AppColumnAccess, ci as Preset, cr as AppColumnType, g as BlockSqlAccessProvider, ht as PresetInput, nr as APP_ON_DELETE_ACTIONS, sr as AppColumnFormat, ur as AppOnDeleteAction, yr as AppTableVersions } from "../context-CjHXhCck.js";
3
- import { a as DesignChange, p as DesignErrorCode, u as CreateDesign } from "../index-CjnDGAJr.js";
2
+ import { Pn as PresetSpec, Wn as PresetName, ar as AppColumnAccess, ci as Preset, cr as AppColumnType, g as BlockSqlAccessProvider, ht as PresetInput, nr as APP_ON_DELETE_ACTIONS, sr as AppColumnFormat, ur as AppOnDeleteAction, yr as AppTableVersions } from "../context-sgrUjA3U.js";
3
+ import { a as DesignChange, p as DesignErrorCode, u as CreateDesign } from "../index-5JSxY1MG.js";
4
4
  import { a as SupabaseLint, o as SupabaseOrganization, s as SupabaseProject } from "../management-wtecfrNf.js";
5
5
  import { t as PresetMigrationFile } from "../types-DGHfTW8_.js";
6
6
  //#region src/create/design-computed.d.ts
@@ -1,8 +1,8 @@
1
1
  import { a as presetOf, d as resolvePreset } from "../config-CD2OGfCG.js";
2
2
  import { C as APP_ON_DELETE_ACTIONS, E as PRESET_CATALOG, a as appIdentifierError, m as isAppDefault, o as appNameLengthError, p as appDefaultError, s as appReservedColumns } from "../app-tables-DyswUg6J.js";
3
- import { c as resolveConfig } from "../config-D74JT0qL.js";
3
+ import { c as resolveConfig } from "../config-BOt5T6Vs.js";
4
4
  import { _ as jsonPointer, a as DesignParseError, h as encodeDesign, n as diffDesigns, o as DesignTooLongError, p as designOf, u as designConfig, v as parseDesign } from "../preset-B3CukUhu.js";
5
- import { R as SQL_MODULES, _ as renderBlocks, i as moduleLayout } from "../sql-B0wb7XA5.js";
5
+ import { R as SQL_MODULES, _ as renderBlocks, i as moduleLayout } from "../sql-BjjgwJKg.js";
6
6
  //#region src/create/column-keys.ts
7
7
  /** The most options a select takes, and the longest option. */
8
8
  const MAX_OPTIONS = 100;
@@ -1,8 +1,10 @@
1
+ import { n as dbError } from "./errors-BVFgt8BZ.js";
1
2
  import { n as isRecord } from "./guards-6F2bCtQR.js";
2
- import { t as dbTransport } from "./block-transport-PNea4lfQ.js";
3
+ import { t as AsyncResult } from "./result-ntFBW2p2.js";
3
4
  import { i as entityNames, o as tenantNames, r as composeNames } from "./entity-naming-Dtyq5sKE.js";
4
5
  import { t as onBlockEvent } from "./block-event-listener-Bu6G0TFH.js";
5
- import { i as wrapTransport, r as withBlockHooks, t as defineTransportMiddleware } from "./block-hooks-DbIpkq7a.js";
6
+ import { V as dbTransport, o as blockCall } from "./block-helpers-B0f0ZVb5.js";
7
+ import { i as wrapTransport, r as withBlockHooks, t as defineTransportMiddleware } from "./block-hooks-DKtz0HRh.js";
6
8
  import { i as forwardBlockEvents } from "./cloud-event-XsM53POL.js";
7
9
  //#region src/core/block-names.ts
8
10
  const TENANT_COLUMNS = ["organization_id", "active_organization_id"];
@@ -52,10 +54,14 @@ function blockNames(naming) {
52
54
  const renamed = names.rename(fn);
53
55
  return functions[fn] ?? functions[renamed] ?? renamed;
54
56
  };
55
- const columns = new Map(TENANT_COLUMNS.map((column) => [tenant.rename(column), column]));
56
57
  const { tenantColumn } = naming;
57
- const restore = (key) => key === tenantColumn ? "tenant_id" : columns.get(key) ?? entities.reverse(key);
58
- const restores = names.renamed || tenantColumn !== void 0;
58
+ const columns = new Map([
59
+ ...TENANT_COLUMNS.map((column) => [tenant.rename(column), column]),
60
+ ...tenantColumn === void 0 ? [] : [[tenantColumn, "tenant_id"]],
61
+ ...Object.entries(naming.columns ?? {})
62
+ ]);
63
+ const restores = names.renamed || tenantColumn !== void 0 || Object.keys(naming.columns ?? {}).length > 0;
64
+ const restore = (key) => columns.get(key) ?? entities.reverse(key);
59
65
  return defineTransportMiddleware({
60
66
  name: "block-names",
61
67
  call: async (request, next) => {
@@ -120,10 +126,8 @@ function defineBlocks(config, blocks, ...appEvents) {
120
126
  ...options,
121
127
  config
122
128
  }, blocks),
123
- call: (db, fn, args) => {
124
- if (api === void 0) return Promise.reject(/* @__PURE__ */ new TypeError("better-supabase: no block has an API schema (`sql.api`) to call"));
125
- return dbTransport(db).call(api, fn, args);
126
- },
129
+ api,
130
+ call: (db, fn, args) => api === void 0 ? AsyncResult.err(dbError("unsupported", "No block has an API schema (`sql.api`) to call")) : blockCall(dbTransport(db), api)(fn, args, (value) => value),
127
131
  client: (db, key, options = {}) => blockBuilder(clientContext(db, {
128
132
  config,
129
133
  ...options
@@ -1,11 +1,10 @@
1
1
  import { n as dbError } from "../errors-BVFgt8BZ.js";
2
2
  import { a as ok, r as err, t as AsyncResult } from "../result-ntFBW2p2.js";
3
- import { i as sqlTransport, r as rpcTransport, t as dbTransport } from "../block-transport-PNea4lfQ.js";
4
- import { o as blockCall } from "../block-helpers-DnCtsKtv.js";
3
+ import { U as rpcTransport, V as dbTransport, W as sqlTransport, o as blockCall } from "../block-helpers-B0f0ZVb5.js";
5
4
  import { a as tenantCredentialRef, i as subjectFor, n as credentialRefInTenant, r as foreignCredentialRef } from "../provider-B6g7rBZX.js";
6
5
  import { n as event, t as defineEvents } from "../event-map-CtPFhcOp.js";
7
6
  import { n as hmacHex, r as timingSafeEqual } from "../hmac-B3CTTlfv.js";
8
- import { o as verifySharedSecret, s as verifyWebhook } from "../signatures-CNcoq392.js";
7
+ import { o as verifySharedSecret, s as verifyWebhook } from "../signatures-CX1b4WHa.js";
9
8
  import { n as revokeIfConfigured, t as credentialRouter } from "../compose-DKW0Tr3e.js";
10
9
  //#region src/credentials/vault.ts
11
10
  const MAX_CACHED = 256;
@@ -1,4 +1,4 @@
1
- import { t as temporal } from "./temporal-required-Dy0GGD8E.js";
1
+ import { t as temporal } from "./temporal-required-DcLhnDhQ.js";
2
2
  //#region src/blocks/queue/cron.ts
3
3
  const MACROS = {
4
4
  "@yearly": "0 0 1 1 *",
@@ -1,6 +1,6 @@
1
1
  import { n as dbError } from "./errors-BVFgt8BZ.js";
2
2
  import { a as methodNotAllowed, o as problemResponse } from "./problem-Bf0cJ7tk.js";
3
- import { o as verifySharedSecret } from "./signatures-CNcoq392.js";
3
+ import { o as verifySharedSecret } from "./signatures-CX1b4WHa.js";
4
4
  //#region src/core/cron-route.ts
5
5
  /**
6
6
  * A `GET` or `POST` handler for a cron caller such as Vercel Cron. It throws
@@ -1,5 +1,5 @@
1
- import { C as optionalText, D as recordOf, I as textOf, k as recordsOf } from "./block-helpers-DnCtsKtv.js";
2
- import { i as moneyOf, o as optionalMoneyOf } from "./money-codec-uV5WbT60.js";
1
+ import { A as recordsOf, L as textOf, O as recordOf, w as optionalText } from "./block-helpers-B0f0ZVb5.js";
2
+ import { i as moneyOf, o as optionalMoneyOf } from "./money-codec-BJuS2zEW.js";
3
3
  //#region src/blocks/deal-forecast.ts
4
4
  function sums(row, currency, fn) {
5
5
  const at = (key) => moneyOf(row[key], currency, `${fn} ${key}`);
@@ -1,24 +1,24 @@
1
1
  import { r as isPlainObject, t as cloneValue } from "./clone-CkG0-hlI.js";
2
2
  import { t as DbException } from "./db-exception-Lngc1W49.js";
3
- import { c as mapDbError, n as dbError } from "./errors-BVFgt8BZ.js";
3
+ import { n as dbError } from "./errors-BVFgt8BZ.js";
4
4
  import { n as isRecord, t as isList } from "./guards-6F2bCtQR.js";
5
- import { c as optionalTemporal, l as provideTemporal, s as nowInstant, u as providedTemporal } from "./temporal-DLZlWbOi.js";
6
- import { a as decodeValue, i as decodeScalar, n as invalidRequest, o as encodeValue, t as builderFor } from "./build-BFC8nFiL.js";
5
+ import { c as optionalTemporal, l as provideTemporal, s as nowInstant, u as providedTemporal } from "./temporal-Dbo0fLzc.js";
6
+ import { n as invalidRequest, t as builderFor } from "./build-DbIRFcHQ.js";
7
7
  import { t as lookupOf } from "./lookup-BaP5bI27.js";
8
8
  import { i as or, n as column, r as not, t as and } from "./types-R6syp1el.js";
9
+ import { a as encodeArguments, n as decodeScalar, o as encodeValue, r as decodeValue } from "./wire-ChYn1g21.js";
9
10
  import { t as isStorageApi } from "./storage-api-Dg78Wqsg.js";
10
11
  import { a as ok, c as withErrorMapper, r as err, s as toDbError, t as AsyncResult } from "./result-ntFBW2p2.js";
11
12
  import { t as invalidationTargets } from "./tables-Cb-3_VWc.js";
12
- import { n as rawError } from "./block-transport-PNea4lfQ.js";
13
13
  import { t as instanceProperty } from "./instance-property-hRh88y_s.js";
14
14
  import { t as vectorLiteral } from "./search-Cn_DGluL.js";
15
15
  import { t as consoleLogger } from "./logger-glM28NVN.js";
16
16
  import { n as errorEvent, t as EventHub } from "./events-D6IZ5CE8.js";
17
17
  import { i as orderPlugins } from "./plugin-AKwwe2gF.js";
18
18
  import { t as simplify } from "./simplify-DDO0j0LI.js";
19
- import { a as invalidTuning, i as deadline, n as postgrestExecutor, o as tuningOf, r as NO_TUNING } from "./postgrest-executor-BFW4oWte.js";
20
- import { n as isQuerySpec, r as specTables, t as createSpecs } from "./spec-DTWkHzYZ.js";
21
- import { n as checkParams, o as isReadSet, r as containsPlaceholder, t as bindParams } from "./read-set-BnKnofIj.js";
19
+ import { a as invalidTuning, i as deadline, n as postgrestExecutor, o as tuningOf, r as NO_TUNING } from "./postgrest-executor-B_Uezhrm.js";
20
+ import { n as isQuerySpec, r as specTables, t as createSpecs } from "./spec-BMvCCNnd.js";
21
+ import { n as checkParams, o as isReadSet, r as containsPlaceholder, t as bindParams } from "./read-set-B1sDib5O.js";
22
22
  import { a as toBase64Url, t as base64ToText } from "./base64-B9Wlsdj7.js";
23
23
  import { n as validate } from "./standard-BA3mLh6w.js";
24
24
  import { n as StatsRecorder, r as recordStats } from "./stats-BHl1-zj9.js";
@@ -181,23 +181,20 @@ function blocksPrototype(source, parent, tables, events, temporal) {
181
181
  enumerable: false
182
182
  });
183
183
  Object.defineProperty(prototype, "$api", {
184
- value(fn, args) {
185
- return source.call(this, fn, args);
184
+ value(fn, args = {}, options = {}) {
185
+ if (source.api === void 0) return AsyncResult.err(dbError("unsupported", "No block has an API schema (`sql.api`) for $api to call"));
186
+ return this.$rpc(fn, args, {
187
+ ...options,
188
+ schema: source.api
189
+ });
186
190
  },
187
191
  configurable: true,
188
192
  enumerable: false,
189
193
  writable: false
190
194
  });
191
195
  Object.defineProperty(prototype, "$apiResult", {
192
- value(fn, args) {
193
- return AsyncResult.from(async () => {
194
- try {
195
- return ok(await source.call(this, fn, args));
196
- } catch (cause) {
197
- const raw = rawError(cause);
198
- return err(raw === void 0 ? toDbError(cause) : mapDbError(raw));
199
- }
200
- });
196
+ value(fn, args = {}) {
197
+ return this.$api(fn, args);
201
198
  },
202
199
  configurable: true,
203
200
  enumerable: false,
@@ -2029,7 +2026,7 @@ function runSpec(db, spec, signal) {
2029
2026
  }
2030
2027
  function rpc(meta, executor, errorMappers, defaults, name, rest) {
2031
2028
  const [given, options] = rest;
2032
- const args = given === void 0 ? void 0 : Object.fromEntries(Object.entries(given).filter(([, value]) => value !== void 0));
2029
+ const args = given === void 0 ? void 0 : encodeArguments(given);
2033
2030
  return AsyncResult.from(async () => {
2034
2031
  if (!executor.rpc) return err(dbError("unsupported", `Executor "${executor.name}" does not support rpc()`));
2035
2032
  const tuning = {
@@ -884,8 +884,8 @@ interface DbBlockSource {
884
884
  readonly events: EventHub;
885
885
  readonly temporal?: typeof Temporal;
886
886
  }): unknown;
887
- /** Calls a function in the API schema that the blocks are wrapped in. */
888
- call(db: object, fn: string, args: Readonly<Record<string, unknown>>): Promise<unknown>;
887
+ /** The API schema the blocks are wrapped in (`sql.api`), which `$api` calls. */
888
+ readonly api?: string | undefined;
889
889
  /**
890
890
  * What one instance's client serves, for `defineApi`: its methods and the
891
891
  * input schemas of its entities. `undefined` when the client can't be built
@@ -949,12 +949,18 @@ type BlocksHelper<K, T extends PropertyKey = never> = unknown extends K ? unknow
949
949
  readonly $blocks: K;
950
950
  /**
951
951
  * Calls `fn` in the API schema the blocks are wrapped in, as the `Db`'s
952
- * caller. Resolves to the function's result and rejects with the raw
953
- * database error.
954
- */
955
- $api(fn: string, args: Readonly<Record<string, unknown>>): Promise<unknown>;
956
- $apiResult(fn: string, args: Readonly<Record<string, unknown>>): AsyncResult<unknown>;
952
+ * caller, through `$rpc`: the error is a `DbError` in the result, and a
953
+ * `returns` schema validates the value and types it.
954
+ */
955
+ $api<R>(fn: string, args: Readonly<Record<string, unknown>> | undefined, options: ApiOptions & {
956
+ readonly returns: StandardSchemaV1<unknown, R>;
957
+ }): AsyncResult<R>;
958
+ $api(fn: string, args?: Readonly<Record<string, unknown>>, options?: ApiOptions): AsyncResult<unknown>;
959
+ /** @deprecated `$api` returns the same `Result`; call it instead. */
960
+ $apiResult(fn: string, args?: Readonly<Record<string, unknown>>): AsyncResult<unknown>;
957
961
  };
962
+ /** Options for `db.$api`: `$rpc`'s, without `schema`. */
963
+ type ApiOptions = Omit<RpcOptions<unknown>, "schema" | "returns"> | Omit<RawRpcOptions, "schema">;
958
964
  /**
959
965
  * The `Db` a definition connects in the browser: what `bsb.db` holds and what
960
966
  * the generated data hooks read (`DbOf<typeof betterSupabase>`).
@@ -1254,4 +1260,4 @@ declare class BetterSupabase<M extends AnyModels = AnyModels, D = unknown, F ext
1254
1260
  */
1255
1261
  declare function defineSupabase<M extends AnyModels, D, F extends AnyFunctions, E = unknown>(schema: Schema<M, D, F, string, E>, options?: SupabaseOptions): BetterSupabase<M, D, F, E>;
1256
1262
  //#endregion
1257
- export { SearchScore as $, MemoryCache as $t, OffsetRangeArgs as A, IncludeArg as At, RowFilter as B, Payload as Bt, GetKey as C, AggregateRow as Ct, NoArgName as D, CountArgs as Dt, ManyWriteArgs as E, CountArg as Et, PlainName as F, MeasureKey as Ft, UpsertManyArgs as G, SortDirection as Gt, RpcOptions as H, RelationMeasureArg as Ht, RawRpcOptions as I, MutableWhere as It, DbStats as J, WhereInput as Jt, WriteArgs as K, SortSpec as Kt, Repository as L, NumericMeasureArg as Lt, OverloadReturns as M, JsonPathOps as Mt, OverloadedName as N, ListArgs as Nt, OffsetPage as O, FieldFilter as Ot, PageOf as P, MeasureArg as Pt, SearchArgs as Q, CacheTarget as Qt, RepositoryOf as R, OrderByArg as Rt, FindExt as S, AggregateResult as St, ManyResult as T, ColumnOrderByArg as Tt, UpdateArgs as U, RequestArgs as Ut, RpcArgs as V, ReadArgs as Vt, UpsertArgs as W, SelectArg as Wt, StatsRecorder as X, BucketsHelper as Xt, EMPTY_STATS as Y, BucketRegistry as Yt, recordStats as Z, CacheAdapter as Zt, CursorPageArgs as _, isQuerySpec as _t, explainPostgrest as a, ReadSetParamTypes as at, DeleteArgs as b, AggregateOrderBy as bt, RpcDefinition as c, ReadSetResult as ct, BlocksHelper as d, readSetTables as dt, cacheTargetOf as en, InferReadSetParams as et, DbBlockSource as f, InferResult as ft, CursorPage as g, TableSpecs as gt, ConflictTarget as h, Specs as ht, PostgrestExecutorOptions as i, ReadSetParamType as it, OverloadArgs as j, IncludeArgs as jt, OffsetPageArgs as k, GetArgs as kt, SupabaseOptions as l, defineReadSet as lt, DbOf as m, ReadMethod as mt, defineSupabase as n, rowKey as nn, ReadSetAuth as nt, postgrestExecutor as o, ReadSetParamValue as ot, DbExtras as p, QuerySpec as pt, WriteManyArgs as q, WhereArg as qt, PostgrestClientLike as r, rpcCacheTargets as rn, ReadSetOptions as rt, ConnectOptions as s, ReadSetParams as st, BetterSupabase as t, memoryCache as tn, ReadSet as tt, BlockInstanceSurface as u, isReadSet as ut, Db as v, specTables as vt, ManyOutcome as w, ColumnOrderBy as wt, DeleteExt as x, AggregateOrderByArg as xt, DbHelpers as y, AggregateArgs as yt, Returned as z, OrderByInput as zt };
1263
+ export { SearchArgs as $, CacheTarget as $t, OffsetPageArgs as A, GetArgs as At, Returned as B, OrderByInput as Bt, FindExt as C, AggregateResult as Ct, ManyWriteArgs as D, CountArg as Dt, ManyResult as E, ColumnOrderByArg as Et, PageOf as F, MeasureArg as Ft, UpsertArgs as G, SelectArg as Gt, RpcArgs as H, ReadArgs as Ht, PlainName as I, MeasureKey as It, WriteManyArgs as J, WhereArg as Jt, UpsertManyArgs as K, SortDirection as Kt, RawRpcOptions as L, MutableWhere as Lt, OverloadArgs as M, IncludeArgs as Mt, OverloadReturns as N, JsonPathOps as Nt, NoArgName as O, CountArgs as Ot, OverloadedName as P, ListArgs as Pt, recordStats as Q, CacheAdapter as Qt, Repository as R, NumericMeasureArg as Rt, DeleteExt as S, AggregateOrderByArg as St, ManyOutcome as T, ColumnOrderBy as Tt, RpcOptions as U, RelationMeasureArg as Ut, RowFilter as V, Payload as Vt, UpdateArgs as W, RequestArgs as Wt, EMPTY_STATS as X, BucketRegistry as Xt, DbStats as Y, WhereInput as Yt, StatsRecorder as Z, BucketsHelper as Zt, CursorPage as _, TableSpecs as _t, explainPostgrest as a, ReadSetParamType as at, DbHelpers as b, AggregateArgs as bt, RpcDefinition as c, ReadSetParams as ct, BlockInstanceSurface as d, isReadSet as dt, MemoryCache as en, SearchScore as et, BlocksHelper as f, readSetTables as ft, ConflictTarget as g, Specs as gt, DbOf as h, ReadMethod as ht, PostgrestExecutorOptions as i, rpcCacheTargets as in, ReadSetOptions as it, OffsetRangeArgs as j, IncludeArg as jt, OffsetPage as k, FieldFilter as kt, SupabaseOptions as l, ReadSetResult as lt, DbExtras as m, QuerySpec as mt, defineSupabase as n, memoryCache as nn, ReadSet as nt, postgrestExecutor as o, ReadSetParamTypes as ot, DbBlockSource as p, InferResult as pt, WriteArgs as q, SortSpec as qt, PostgrestClientLike as r, rowKey as rn, ReadSetAuth as rt, ConnectOptions as s, ReadSetParamValue as st, BetterSupabase as t, cacheTargetOf as tn, InferReadSetParams as tt, ApiOptions as u, defineReadSet as ut, CursorPageArgs as v, isQuerySpec as vt, GetKey as w, AggregateRow as wt, DeleteArgs as x, AggregateOrderBy as xt, Db as y, specTables as yt, RepositoryOf as z, OrderByArg as zt };
@@ -13,7 +13,7 @@ import { f as AiFiles, y as UploadClaimStorage } from "./types-Dr9wZgNy.js";
13
13
  import { g as JobHandler } from "./types-Czq9Xtpa.js";
14
14
  import { t as BlockOptionsSchema } from "./options-BTmaRzx2.js";
15
15
  import { t as Author } from "./block-authors-DzXLUiIq.js";
16
- import { u as BlockInstanceSurface } from "./define-BqaUwrIC.js";
16
+ import { d as BlockInstanceSurface } from "./define-Lf6rI2QN.js";
17
17
  import { A as TtlPreset, C as TransformOptions, j as StorageApi, l as ImageTransform } from "./bucket-vc-QRrva.js";
18
18
  import { i as FieldSpec, n as TableSchema, o as TableSchemaSpec } from "./table-schema-BlF6k62Q.js";
19
19
  import { i as EventSink } from "./cloud-event-CzZTJkXv.js";
@@ -68,6 +68,13 @@ interface BlockNaming {
68
68
  readonly functions?: Readonly<Record<string, string>>;
69
69
  /** The block's own entities the config renames, such as `work_item` to `task`. */
70
70
  readonly entities?: readonly EntityRename[];
71
+ /**
72
+ * The tenant columns `blocks.<name>.columns.<table>.tenant` renames: the
73
+ * column's name in the database to its default name, such as `org_id` to
74
+ * `tenant_id`, so the block's client reads rows by the default name.
75
+ */
76
+ readonly columns?: Readonly<Record<string, string>>;
77
+ /** `database.sql.tenantColumn`, read back as `tenant_id`. */
71
78
  readonly tenantColumn?: string;
72
79
  }
73
80
  /**
@@ -1349,6 +1356,8 @@ interface BlockSet<B extends BlockMap, M extends EventMap> {
1349
1356
  readonly $clients?: BlockSetClientMap<B>;
1350
1357
  /** The generated config the blocks are built with. */
1351
1358
  readonly config: GeneratedBlocks;
1359
+ /** The API schema the blocks are wrapped in (`sql.api`), if any has one. */
1360
+ readonly api: string | undefined;
1352
1361
  /** Every block's events and the app's, typed. */
1353
1362
  readonly events: Events<M>;
1354
1363
  /**
@@ -1376,9 +1385,9 @@ interface BlockSet<B extends BlockMap, M extends EventMap> {
1376
1385
  }): ClientOf<B[K]>;
1377
1386
  /**
1378
1387
  * Calls `fn` in the API schema the blocks are wrapped in (`sql.api`), as
1379
- * `db`'s caller. Rejects with the raw database error.
1388
+ * `db`'s caller. The error is a `DbError` in the result.
1380
1389
  */
1381
- call(db: BlockClientSource, fn: string, args: Readonly<Record<string, unknown>>): Promise<unknown>;
1390
+ call(db: BlockClientSource, fn: string, args: Readonly<Record<string, unknown>>): AsyncResult<unknown>;
1382
1391
  /**
1383
1392
  * One instance's methods and input schemas, for `defineApi`; `undefined` when
1384
1393
  * its client can't be built without a database.
@@ -2,17 +2,17 @@ import { f as Result } from "../result-DZeA5KS6.js";
2
2
  import { t as StandardSchemaV1 } from "../standard-DBV730sF.js";
3
3
  import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
4
4
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
5
- import { t as BetterSupabase } from "../define-BqaUwrIC.js";
6
- import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-BTBzrzOH.js";
5
+ import { t as BetterSupabase } from "../define-Lf6rI2QN.js";
6
+ import { a as ServerContext, c as ServerOptions, n as BetterServer } from "../server-types-BH6AjDBN.js";
7
7
  import { t as AuthSession } from "../view-DyFdMCqg.js";
8
8
  import { i as MiddlewareOptions, r as GuardOptions } from "../respond-oZeJ342J.js";
9
9
  import { c as ResourceLoaderContext, s as BlockRequireOptions } from "../kit-CVgQCIBO.js";
10
10
  import { n as FunctionContract, t as DescribedFunction } from "../function-contract-DxFNOmsm.js";
11
11
  import { t as Validated } from "../shared-CRRfQAKG.js";
12
12
  import { n as SUPABASE_CORS_HEADERS, r as corsConfig, t as CorsOptions } from "../cors-kLq6VM06.js";
13
- import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-eXuFxVt7.js";
14
- import { t as ResourceMap } from "../resources-Dpz3h8Fe.js";
15
- import { t as defineAction } from "../resource-execute-LR71zWej.js";
13
+ import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-DjZ91WKA.js";
14
+ import { t as ResourceMap } from "../resources-6Ncdt9XT.js";
15
+ import { t as defineAction } from "../resource-execute-CUG6xUuh.js";
16
16
  import { AnyEntry, Contributions } from "@supabase/middleware";
17
17
  //#region src/bridges/edge.d.ts
18
18
  /** The platform context Workers pass as the third `fetch` argument. */
@@ -2,15 +2,15 @@ import { n as dbError } from "../errors-BVFgt8BZ.js";
2
2
  import { a as ok, r as err } from "../result-ntFBW2p2.js";
3
3
  import { n as validate } from "../standard-BA3mLh6w.js";
4
4
  import { o as problemResponse } from "../problem-Bf0cJ7tk.js";
5
- import { a as unexpectedResponse, c as extendServer, o as withFlush, s as createServer } from "../adapter-CfuBICuG.js";
5
+ import { a as unexpectedResponse, c as extendServer, o as withFlush, s as createServer } from "../adapter-DZJZTY6g.js";
6
6
  import { n as defaultExpose, o as respond, s as settle } from "../respond-3RKp6VgU.js";
7
- import { t as withBetterSupabase } from "../composite-D24L5RIY.js";
7
+ import { t as withBetterSupabase } from "../composite-Dw5ofSF_.js";
8
8
  import { i as defineAction } from "../resource-R3KToNze.js";
9
9
  import { i as requireCaller } from "../kit-DhlB-vv_.js";
10
10
  import { t as withExtra } from "../extra-CGQ2_q3S.js";
11
11
  import { n as resourceRouter } from "../resources-DqIwoQsP.js";
12
12
  import { n as corsConfig, t as SUPABASE_CORS_HEADERS } from "../cors-h_v7TPxl.js";
13
- import { t as EVERY_CALLER } from "../framework-CNhTg0th.js";
13
+ import { t as EVERY_CALLER } from "../framework-DXM1vNcV.js";
14
14
  import { t as FUNCTION_DESCRIPTOR } from "../function-contract-pEmsaUIf.js";
15
15
  import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
16
16
  import { withCors } from "@supabase/middleware/cors";
@@ -1,4 +1,4 @@
1
- import { t as AuthSnapshot } from "./bind-BwQGUqdQ.js";
1
+ import { t as AuthSnapshot } from "./bind-CFsctoFJ.js";
2
2
  import { t as AuthSession } from "./view-DyFdMCqg.js";
3
3
  //#region src/auth/entitlements.d.ts
4
4
  /**
@@ -1,6 +1,6 @@
1
1
  import { t as AsyncResult } from "./result-ntFBW2p2.js";
2
- import { j as run, o as blockCall } from "./block-helpers-DnCtsKtv.js";
3
- import { r as withBlockHooks } from "./block-hooks-DbIpkq7a.js";
2
+ import { M as run, o as blockCall } from "./block-helpers-B0f0ZVb5.js";
3
+ import { r as withBlockHooks } from "./block-hooks-DKtz0HRh.js";
4
4
  //#region src/blocks/entitlements/entitlements.ts
5
5
  /** The Stripe event sent when a customer's active entitlements change. */
6
6
  const ENTITLEMENTS_UPDATED = "entitlements.active_entitlement_summary.updated";
@@ -1,4 +1,4 @@
1
- import { n as tableSchema } from "./table-schema-CD8cJz_M.js";
1
+ import { n as tableSchema } from "./table-schema-C80xItaV.js";
2
2
  //#region src/blocks/entity-schema.ts
3
3
  /** The keys of `EntitySchemas`. */
4
4
  const ENTITY_SCHEMA_KINDS = [
@@ -1,9 +1,9 @@
1
- import { s as nowInstant } from "../temporal-DLZlWbOi.js";
1
+ import { s as nowInstant } from "../temporal-Dbo0fLzc.js";
2
2
  import { t as onBlockEvent } from "../block-event-listener-Bu6G0TFH.js";
3
3
  import { i as forwardBlockEvents, n as blockCloudEvent, r as dataschemaOf } from "../cloud-event-XsM53POL.js";
4
4
  import { t as jsonReplacer } from "../json-DaByVJpw.js";
5
5
  import { n as event, r as mergeEvents, t as defineEvents } from "../event-map-CtPFhcOp.js";
6
- import { a as emitBlockEvent, i as blockEventAttributes, n as BLOCK_EVENT_RENAMES, t as BLOCK_ATTRIBUTES } from "../block-events-pBXPzwnW.js";
6
+ import { a as emitBlockEvent, i as blockEventAttributes, n as BLOCK_EVENT_RENAMES, t as BLOCK_ATTRIBUTES } from "../block-events-IWAyafO3.js";
7
7
  //#region src/events/index.ts
8
8
  const ROW_EVENT_TYPES = {
9
9
  insert: "dev.better-supabase.row.created",
@@ -1,7 +1,8 @@
1
1
  import { r as isPlainObject } from "./clone-CkG0-hlI.js";
2
2
  import { c as mapDbError, d as withMaxAffected, n as dbError } from "./errors-BVFgt8BZ.js";
3
+ import { i as encodeArgument } from "./wire-ChYn1g21.js";
3
4
  import { a as ok, r as err, s as toDbError } from "./result-ntFBW2p2.js";
4
- import { n as quoteIdent, t as compileSql } from "./sql-BPbbPzRJ.js";
5
+ import { n as quoteIdent, t as compileSql } from "./sql-CYt7EhH0.js";
5
6
  import { t as fromPgError } from "./pg-error-B5QLDcbG.js";
6
7
  //#region src/postgres/executor.ts
7
8
  /**
@@ -186,7 +187,7 @@ async function callFunction(client, name, args, context, cache) {
186
187
  }, context.errorMappers));
187
188
  const params = [];
188
189
  const named = Object.entries(args).filter(([key, value]) => value !== void 0 && !signature.outputOnly.has(key)).map(([key, value]) => {
189
- params.push(argValue(value, signature.json.has(key)));
190
+ params.push(argValue(encodeArgument(value), signature.json.has(key)));
190
191
  return `${quoteIdent(key)} => $${String(params.length)}`;
191
192
  });
192
193
  const call = `${quoteIdent(context.schema)}.${quoteIdent(name)}(${named.join(", ")})`;
@@ -1,4 +1,4 @@
1
- import { L as WorkflowGraph } from "./types-DsRfiQ0v.js";
1
+ import { L as WorkflowGraph } from "./types-yj8VF4oY.js";
2
2
  //#region src/blocks/workflow-editor/executor.d.ts
3
3
  /** The record a run belongs to. */
4
4
  interface GraphSubject {
@@ -1,6 +1,6 @@
1
- import { c as optionalTemporal } from "./temporal-DLZlWbOi.js";
2
- import { i as checkFilterQuery, t as FILTER_OPERATORS } from "./filter-query-DMoKo82_.js";
3
- import { t as evaluateFilterQuery } from "./filter-evaluate-w1XOIUOL.js";
1
+ import { c as optionalTemporal } from "./temporal-Dbo0fLzc.js";
2
+ import { i as checkFilterQuery, t as FILTER_OPERATORS } from "./filter-query-CQ6d5GnQ.js";
3
+ import { t as evaluateFilterQuery } from "./filter-evaluate-lCToXzZI.js";
4
4
  //#region src/blocks/workflow-editor/graph.ts
5
5
  /** Kept local: the static executor runs this file inside the workflow VM. */
6
6
  const isGraphRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
@@ -1,11 +1,11 @@
1
1
  import { t as DbException } from "./db-exception-Lngc1W49.js";
2
2
  import { c as mapDbError, n as dbError } from "./errors-BVFgt8BZ.js";
3
- import { n as invalidRequest } from "./build-BFC8nFiL.js";
3
+ import { n as invalidRequest } from "./build-DbIRFcHQ.js";
4
4
  import { t as lookupOf } from "./lookup-BaP5bI27.js";
5
5
  import { a as ok, r as err, s as toDbError } from "./result-ntFBW2p2.js";
6
6
  import { n as simplifyOrFalse } from "./simplify-DDO0j0LI.js";
7
- import { n as isQuerySpec } from "./spec-DTWkHzYZ.js";
8
- import { n as whereClause, t as integer } from "./shared-C47zAh2A.js";
7
+ import { n as isQuerySpec } from "./spec-BMvCCNnd.js";
8
+ import { n as whereClause, t as integer } from "./shared-BeHTi8Fu.js";
9
9
  //#region src/compile/sqlite.ts
10
10
  /**
11
11
  * The operation needs something the SQLite dialect can't express: full-text
@@ -1,7 +1,7 @@
1
1
  import { E as RawDbError, b as DbError, f as Result } from "./result-DZeA5KS6.js";
2
2
  import { Bt as Executor, O as AnyFunctions, dt as TableMeta, k as AnyModels, m as Operation, ut as TableKey } from "./types-DFdg_4yN.js";
3
- import { pt as QuerySpec, t as BetterSupabase } from "./define-BqaUwrIC.js";
4
- import { i as ListDefinition } from "./list-query-6vTI1VN6.js";
3
+ import { mt as QuerySpec, t as BetterSupabase } from "./define-Lf6rI2QN.js";
4
+ import { i as ListDefinition } from "./list-query-XYfUZb0j.js";
5
5
  import { t as Compiler } from "./compiler-D3UmE7ao.js";
6
6
  //#region src/compile/sqlite.d.ts
7
7
  /** A value SQLite binds: booleans become `0`/`1`, objects JSON text. */
@@ -1,6 +1,6 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
2
- import { t as BetterSupabase } from "../define-BqaUwrIC.js";
3
- import { a as ServerContext, c as ServerOptions, n as BetterServer, r as ContextOptions } from "../server-types-BTBzrzOH.js";
2
+ import { t as BetterSupabase } from "../define-Lf6rI2QN.js";
3
+ import { a as ServerContext, c as ServerOptions, n as BetterServer, r as ContextOptions } from "../server-types-BH6AjDBN.js";
4
4
  import { i as MiddlewareOptions, r as GuardOptions } from "../respond-oZeJ342J.js";
5
5
  import { t as Validated } from "../shared-CRRfQAKG.js";
6
6
  import { AnyEntry, Contributions } from "@supabase/middleware";
@@ -1,9 +1,9 @@
1
1
  import { t as DbException } from "../db-exception-Lngc1W49.js";
2
2
  import { c as toProblem } from "../problem-Bf0cJ7tk.js";
3
- import { a as unexpectedResponse, b as isPrefetch, c as extendServer, s as createServer, x as refreshFor } from "../adapter-CfuBICuG.js";
3
+ import { a as unexpectedResponse, b as isPrefetch, c as extendServer, s as createServer, x as refreshFor } from "../adapter-DZJZTY6g.js";
4
4
  import { h as serializeCookie } from "../resolve-B0mW2m7f.js";
5
5
  import { i as guard, n as defaultExpose, o as respond } from "../respond-3RKp6VgU.js";
6
- import { t as withBetterSupabase } from "../composite-D24L5RIY.js";
6
+ import { t as withBetterSupabase } from "../composite-Dw5ofSF_.js";
7
7
  import { r as handoffOf } from "../shared-Bf-I13Ht.js";
8
8
  import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
9
9
  import { StatusError, setResponseHeaders } from "expo-server";
@@ -1,14 +1,14 @@
1
1
  import { b as DbError, f as Result } from "./result-DZeA5KS6.js";
2
2
  import { o as EventHub } from "./events-vcqenSYU.js";
3
3
  import { o as BlockTenant } from "./block-helpers-CRpAHrp_.js";
4
- import { pt as QuerySpec } from "./define-BqaUwrIC.js";
4
+ import { mt as QuerySpec } from "./define-Lf6rI2QN.js";
5
5
  import { tt as TemplateValues } from "./bucket-vc-QRrva.js";
6
6
  import { n as DataEngine } from "./data-engine-BWoz9lED.js";
7
- import { Dn as GeneratedBlocks } from "./define-block-CRwHsxZO.js";
8
- import { _ as TopicMessage, c as RealtimeClient, d as SubscribeOptions, i as PresenceOptions, s as PresenceSubscription } from "./topic-0uK4db_2.js";
9
- import { t as ClientPorts } from "./ports-DO3tgLTo.js";
10
- import { a as ClientAuth } from "./bind-BwQGUqdQ.js";
11
- import { a as LiveSource, r as LiveCountSeed } from "./index-BzW1T3oI.js";
7
+ import { Dn as GeneratedBlocks } from "./define-block-DCAiOrNX.js";
8
+ import { _ as TopicMessage, c as RealtimeClient, d as SubscribeOptions, i as PresenceOptions, s as PresenceSubscription } from "./topic-gTVjLGTk.js";
9
+ import { t as ClientPorts } from "./ports-BbBJVyS0.js";
10
+ import { a as ClientAuth } from "./bind-CFsctoFJ.js";
11
+ import { a as LiveSource, r as LiveCountSeed } from "./index-ByF22_C6.js";
12
12
  import { SupabaseClient } from "@supabase/supabase-js";
13
13
  import { QueryClient } from "@tanstack/query-core";
14
14
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -1,4 +1,4 @@
1
- import { i as checkFilterQuery, p as toFilterFields, t as FILTER_OPERATORS } from "./filter-query-DMoKo82_.js";
1
+ import { i as checkFilterQuery, p as toFilterFields, t as FILTER_OPERATORS } from "./filter-query-CQ6d5GnQ.js";
2
2
  import { t as SUBJECT_TYPE_PATTERN } from "./subject-type-BRnK7Av3.js";
3
3
  //#region src/blocks/automations/fields.ts
4
4
  const DEFAULT_COLUMN_TYPE = {
@@ -1,6 +1,6 @@
1
1
  import { n as isRecord } from "./guards-6F2bCtQR.js";
2
- import { c as optionalTemporal, t as TEMPORAL_MISSING } from "./temporal-DLZlWbOi.js";
3
- import { a as dateBounds, r as NEGATIVE } from "./filter-query-DMoKo82_.js";
2
+ import { c as optionalTemporal, t as TEMPORAL_MISSING } from "./temporal-Dbo0fLzc.js";
3
+ import { a as dateBounds, r as NEGATIVE } from "./filter-query-CQ6d5GnQ.js";
4
4
  //#region src/list/filter-evaluate.ts
5
5
  function read(record, column) {
6
6
  let value = record;
@@ -1,5 +1,5 @@
1
1
  import { n as isRecord } from "./guards-6F2bCtQR.js";
2
- import { c as optionalTemporal, t as TEMPORAL_MISSING } from "./temporal-DLZlWbOi.js";
2
+ import { c as optionalTemporal, t as TEMPORAL_MISSING } from "./temporal-Dbo0fLzc.js";
3
3
  import { t as escapeLike } from "./escape-like-DHfx6jRr.js";
4
4
  //#region src/list/filter-query.ts
5
5
  const op = (value, arity = "one", inverse) => ({
@@ -1,6 +1,6 @@
1
1
  import { n as isRecord } from "./guards-6F2bCtQR.js";
2
2
  import { t as DEFAULT_CLAIMS } from "./claims-Bp9My7XP.js";
3
- import { C as optionalText, F as stringsOf, I as textOf, f as errorText, k as recordsOf, n as applyTemporal, o as blockCall } from "./block-helpers-DnCtsKtv.js";
3
+ import { A as recordsOf, I as stringsOf, L as textOf, f as errorText, n as applyTemporal, o as blockCall, w as optionalText } from "./block-helpers-B0f0ZVb5.js";
4
4
  //#region src/blocks/flags/flags.ts
5
5
  const BUCKETS = 1e4;
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { f as errorText } from "../block-helpers-DnCtsKtv.js";
2
- import { a as flagContext, n as createFlagsProvider, r as evaluateFlag } from "../flags-ClOQY-p5.js";
1
+ import { f as errorText } from "../block-helpers-B0f0ZVb5.js";
2
+ import { a as flagContext, n as createFlagsProvider, r as evaluateFlag } from "../flags-DF_SCqp5.js";
3
3
  //#region src/flags-sdk/flags-sdk.ts
4
4
  function originOf(origin, key) {
5
5
  return typeof origin === "function" ? origin(key) : origin?.replaceAll("{key}", encodeURIComponent(key));
@@ -1,8 +1,8 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "./types-DFdg_4yN.js";
2
- import { O as SessionSnapshot, c as ServerOptions } from "./server-types-BTBzrzOH.js";
2
+ import { O as SessionSnapshot, c as ServerOptions } from "./server-types-BH6AjDBN.js";
3
3
  import { t as AuthSession } from "./view-DyFdMCqg.js";
4
- import { n as SessionEntryConfig } from "./session-BgYGk_FS.js";
5
- import { n as BetterSupabaseContributions } from "./composite-DbRuu6Jb.js";
4
+ import { n as SessionEntryConfig } from "./session-Y5SSYO2C.js";
5
+ import { n as BetterSupabaseContributions } from "./composite-ChzHhSB0.js";
6
6
  import { c as ResourceLoaderContext } from "./kit-CVgQCIBO.js";
7
7
  import { t as RefusalRedirects } from "./refusal-OrlI3g4H.js";
8
8
  //#region src/server/framework.d.ts