better-supabase 0.20.0 → 0.22.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 (513) hide show
  1. package/dist/{adapter-CfuBICuG.js → adapter-D4aNBxhm.js} +4 -4
  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-3C0AWFeP.js +696 -0
  14. package/dist/{api-BIw5g_4V.d.ts → api-CHObZL7m.d.ts} +2 -2
  15. package/dist/{app-tables-oYkgtcRM.d.ts → app-tables-BGzdnQm5.d.ts} +1 -1
  16. package/dist/astro/index.d.ts +3 -3
  17. package/dist/astro/index.js +5 -5
  18. package/dist/{attachments-BTIwCuwm.js → attachments-BXbLnNxm.js} +5 -5
  19. package/dist/{authorization-08F77H2w.d.ts → authorization-DhoA7dsD.d.ts} +22 -8
  20. package/dist/{automations-jIIaT9EJ.js → automations-BMuqwZZn.js} +5 -5
  21. package/dist/better-result/index.d.ts +2 -2
  22. package/dist/{bind-BwQGUqdQ.d.ts → bind-CFsctoFJ.d.ts} +4 -4
  23. package/dist/{block-authors-D9hyCizs.js → block-authors-Bw3zdzgl.js} +1 -1
  24. package/dist/{block-env-Dh0Fe-fK.d.ts → block-env-BrUNeuJ_.d.ts} +4 -4
  25. package/dist/{block-events-pBXPzwnW.js → block-events-IWAyafO3.js} +1 -1
  26. package/dist/{block-fields-DE_FgpOU.js → block-fields-BjXgX_5c.js} +4 -3
  27. package/dist/{block-helpers-DnCtsKtv.js → block-helpers-B0f0ZVb5.js} +169 -4
  28. package/dist/{block-hooks-DbIpkq7a.js → block-hooks-DKtz0HRh.js} +1 -1
  29. package/dist/{block-subjects-BRJO0IqO.js → block-subjects-DFSuFY1a.js} +1 -1
  30. package/dist/blocks/access-requests/index.d.ts +1 -1
  31. package/dist/blocks/access-requests/index.js +4 -5
  32. package/dist/blocks/activities/index.d.ts +1 -1
  33. package/dist/blocks/activities/index.js +4 -5
  34. package/dist/blocks/agents/index.d.ts +1 -1
  35. package/dist/blocks/agents/index.js +3 -4
  36. package/dist/blocks/ai-cache/index.d.ts +1 -1
  37. package/dist/blocks/ai-cache/index.js +2 -2
  38. package/dist/blocks/ai-chat/index.d.ts +4 -4
  39. package/dist/blocks/ai-chat/index.js +4 -5
  40. package/dist/blocks/ai-files/index.d.ts +1 -1
  41. package/dist/blocks/ai-files/index.js +2 -2
  42. package/dist/blocks/ai-keys/index.d.ts +1 -1
  43. package/dist/blocks/ai-keys/index.js +3 -4
  44. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  45. package/dist/blocks/ai-schedules/index.js +5 -6
  46. package/dist/blocks/announcements/index.d.ts +4 -4
  47. package/dist/blocks/announcements/index.js +4 -5
  48. package/dist/blocks/api-keys/index.d.ts +2 -2
  49. package/dist/blocks/api-keys/index.js +5 -6
  50. package/dist/blocks/approvals/index.d.ts +1 -1
  51. package/dist/blocks/approvals/index.js +4 -5
  52. package/dist/blocks/assets/index.d.ts +1 -1
  53. package/dist/blocks/assets/index.js +3 -4
  54. package/dist/blocks/assignment/index.d.ts +1 -1
  55. package/dist/blocks/assignment/index.js +4 -5
  56. package/dist/blocks/attachments/index.d.ts +2 -2
  57. package/dist/blocks/attachments/index.js +5 -6
  58. package/dist/blocks/audit/index.d.ts +5 -5
  59. package/dist/blocks/audit/index.js +8 -9
  60. package/dist/blocks/automations/index.d.ts +3 -3
  61. package/dist/blocks/automations/index.js +6 -6
  62. package/dist/blocks/billable-time/index.d.ts +1 -1
  63. package/dist/blocks/billable-time/index.js +6 -7
  64. package/dist/blocks/billing/index.d.ts +3 -3
  65. package/dist/blocks/billing/index.js +6 -7
  66. package/dist/blocks/bookings/index.d.ts +3 -3
  67. package/dist/blocks/bookings/index.js +7 -7
  68. package/dist/blocks/bulk/index.d.ts +4 -3
  69. package/dist/blocks/bulk/index.js +4 -4
  70. package/dist/blocks/calendar/index.d.ts +2 -2
  71. package/dist/blocks/calendar/index.js +7 -7
  72. package/dist/blocks/catalog/index.d.ts +1 -1
  73. package/dist/blocks/catalog/index.js +5 -6
  74. package/dist/blocks/channels/index.d.ts +1 -1
  75. package/dist/blocks/channels/index.js +3 -4
  76. package/dist/blocks/collections/index.d.ts +1 -1
  77. package/dist/blocks/collections/index.js +3 -4
  78. package/dist/blocks/comments/index.d.ts +5 -5
  79. package/dist/blocks/comments/index.js +8 -9
  80. package/dist/blocks/compliance/index.d.ts +1 -1
  81. package/dist/blocks/compliance/index.js +5 -6
  82. package/dist/blocks/connectors/index.d.ts +1 -1
  83. package/dist/blocks/connectors/index.js +3 -4
  84. package/dist/blocks/contacts/index.d.ts +1 -1
  85. package/dist/blocks/contacts/index.js +4 -5
  86. package/dist/blocks/content/index.d.ts +1 -1
  87. package/dist/blocks/content/index.js +3 -4
  88. package/dist/blocks/contracts/index.d.ts +1 -1
  89. package/dist/blocks/contracts/index.js +8 -9
  90. package/dist/blocks/courses/index.d.ts +1 -1
  91. package/dist/blocks/courses/index.js +5 -6
  92. package/dist/blocks/created-by/index.d.ts +1 -1
  93. package/dist/blocks/custom-fields/index.d.ts +1 -1
  94. package/dist/blocks/custom-fields/index.js +2 -2
  95. package/dist/blocks/data-lifecycle/index.d.ts +1 -1
  96. package/dist/blocks/data-lifecycle/index.js +3 -4
  97. package/dist/blocks/deals/index.d.ts +1 -1
  98. package/dist/blocks/deals/index.js +9 -10
  99. package/dist/blocks/dispatch/index.d.ts +1 -1
  100. package/dist/blocks/dispatch/index.js +7 -8
  101. package/dist/blocks/documents/index.d.ts +1 -1
  102. package/dist/blocks/documents/index.js +2 -3
  103. package/dist/blocks/domains/index.d.ts +1 -1
  104. package/dist/blocks/domains/index.js +3 -4
  105. package/dist/blocks/donations/index.d.ts +1 -1
  106. package/dist/blocks/donations/index.js +7 -8
  107. package/dist/blocks/drive/index.d.ts +5 -1
  108. package/dist/blocks/drive/index.js +6 -7
  109. package/dist/blocks/employees/index.d.ts +2 -2
  110. package/dist/blocks/employees/index.js +7 -8
  111. package/dist/blocks/enrichment/index.d.ts +1 -1
  112. package/dist/blocks/enrichment/index.js +2 -3
  113. package/dist/blocks/enrollments/index.d.ts +1 -1
  114. package/dist/blocks/enrollments/index.js +3 -4
  115. package/dist/blocks/entitlements/index.d.ts +3 -3
  116. package/dist/blocks/entitlements/index.js +2 -2
  117. package/dist/blocks/expenses/index.d.ts +1 -1
  118. package/dist/blocks/expenses/index.js +6 -7
  119. package/dist/blocks/field-history/index.d.ts +1 -1
  120. package/dist/blocks/field-history/index.js +2 -3
  121. package/dist/blocks/flags/index.d.ts +1 -1
  122. package/dist/blocks/flags/index.js +4 -5
  123. package/dist/blocks/forecasts/index.d.ts +1 -1
  124. package/dist/blocks/forecasts/index.js +5 -6
  125. package/dist/blocks/forms/index.d.ts +2 -2
  126. package/dist/blocks/forms/index.js +4 -5
  127. package/dist/blocks/goals/index.d.ts +1 -1
  128. package/dist/blocks/goals/index.js +4 -5
  129. package/dist/blocks/guests/index.d.ts +1 -1
  130. package/dist/blocks/guests/index.js +4 -5
  131. package/dist/blocks/hiring/index.d.ts +1 -1
  132. package/dist/blocks/hiring/index.js +4 -5
  133. package/dist/blocks/identities/index.d.ts +1 -1
  134. package/dist/blocks/identities/index.js +2 -3
  135. package/dist/blocks/imports/index.d.ts +1 -1
  136. package/dist/blocks/imports/index.js +3 -3
  137. package/dist/blocks/inbox/index.d.ts +5 -5
  138. package/dist/blocks/inbox/index.js +4 -5
  139. package/dist/blocks/incidents/index.d.ts +1 -1
  140. package/dist/blocks/incidents/index.js +5 -6
  141. package/dist/blocks/index.d.ts +2 -2
  142. package/dist/blocks/index.js +7 -7
  143. package/dist/blocks/inventory/index.d.ts +1 -1
  144. package/dist/blocks/inventory/index.js +3 -4
  145. package/dist/blocks/invoices/index.d.ts +1 -1
  146. package/dist/blocks/invoices/index.js +6 -7
  147. package/dist/blocks/knowledge/index.d.ts +1 -1
  148. package/dist/blocks/knowledge/index.js +2 -2
  149. package/dist/blocks/lead-scoring/index.d.ts +1 -1
  150. package/dist/blocks/lead-scoring/index.js +4 -5
  151. package/dist/blocks/leases/index.d.ts +1 -1
  152. package/dist/blocks/leases/index.js +7 -8
  153. package/dist/blocks/leave/index.d.ts +1 -1
  154. package/dist/blocks/leave/index.js +4 -5
  155. package/dist/blocks/ledger/index.d.ts +1 -1
  156. package/dist/blocks/ledger/index.js +3 -4
  157. package/dist/blocks/mail-sync/index.d.ts +1 -1
  158. package/dist/blocks/mail-sync/index.js +5 -6
  159. package/dist/blocks/memberships/index.d.ts +1 -1
  160. package/dist/blocks/memory/index.d.ts +1 -1
  161. package/dist/blocks/memory/index.js +3 -4
  162. package/dist/blocks/messaging/index.d.ts +5 -5
  163. package/dist/blocks/messaging/index.js +6 -7
  164. package/dist/blocks/metrics/index.d.ts +1 -1
  165. package/dist/blocks/metrics/index.js +4 -5
  166. package/dist/blocks/mfa/index.d.ts +2 -2
  167. package/dist/blocks/moderation/index.d.ts +1 -1
  168. package/dist/blocks/moderation/index.js +3 -4
  169. package/dist/blocks/notifications/index.d.ts +4 -4
  170. package/dist/blocks/notifications/index.js +8 -9
  171. package/dist/blocks/numbering/index.d.ts +1 -1
  172. package/dist/blocks/numbering/index.js +2 -2
  173. package/dist/blocks/oauth-server/index.d.ts +1 -1
  174. package/dist/blocks/oauth-server/index.js +3 -4
  175. package/dist/blocks/onboarding/index.d.ts +2 -2
  176. package/dist/blocks/onboarding/index.js +2 -3
  177. package/dist/blocks/orders/index.d.ts +9 -2
  178. package/dist/blocks/orders/index.js +7 -8
  179. package/dist/blocks/organizations/index.d.ts +3 -3
  180. package/dist/blocks/organizations/index.js +5 -6
  181. package/dist/blocks/outbox/index.d.ts +1 -1
  182. package/dist/blocks/outbox/index.js +3 -4
  183. package/dist/blocks/passes/index.d.ts +2 -2
  184. package/dist/blocks/passes/index.js +7 -8
  185. package/dist/blocks/permissions/index.d.ts +3 -3
  186. package/dist/blocks/permissions/index.js +2 -3
  187. package/dist/blocks/pipelines/index.d.ts +1 -1
  188. package/dist/blocks/pipelines/index.js +4 -5
  189. package/dist/blocks/posts/index.d.ts +1 -1
  190. package/dist/blocks/posts/index.js +4 -5
  191. package/dist/blocks/profiles/index.d.ts +1 -1
  192. package/dist/blocks/profiles/index.js +3 -4
  193. package/dist/blocks/promotions/index.d.ts +1 -1
  194. package/dist/blocks/promotions/index.js +4 -5
  195. package/dist/blocks/push/index.d.ts +2 -2
  196. package/dist/blocks/push/index.js +5 -6
  197. package/dist/blocks/queue/index.d.ts +1 -1
  198. package/dist/blocks/queue/index.js +7 -8
  199. package/dist/blocks/quotes/index.d.ts +1 -1
  200. package/dist/blocks/quotes/index.js +6 -7
  201. package/dist/blocks/rank/index.d.ts +1 -1
  202. package/dist/blocks/rank/index.js +2 -2
  203. package/dist/blocks/reactions/index.d.ts +4 -4
  204. package/dist/blocks/reactions/index.js +4 -5
  205. package/dist/blocks/relations/index.d.ts +3 -2
  206. package/dist/blocks/relations/index.js +8 -8
  207. package/dist/blocks/reminders/index.d.ts +10 -6
  208. package/dist/blocks/reminders/index.js +13 -12
  209. package/dist/blocks/reviews/index.d.ts +1 -1
  210. package/dist/blocks/reviews/index.js +3 -4
  211. package/dist/blocks/saved-views/index.d.ts +3 -3
  212. package/dist/blocks/saved-views/index.js +4 -4
  213. package/dist/blocks/scores/index.d.ts +1 -1
  214. package/dist/blocks/scores/index.js +4 -4
  215. package/dist/blocks/search/index.d.ts +3 -3
  216. package/dist/blocks/search/index.js +3 -4
  217. package/dist/blocks/security-events/index.d.ts +1 -1
  218. package/dist/blocks/security-events/index.js +2 -3
  219. package/dist/blocks/segments/index.d.ts +1 -1
  220. package/dist/blocks/segments/index.js +4 -5
  221. package/dist/blocks/sequences/index.d.ts +1 -1
  222. package/dist/blocks/sequences/index.js +3 -4
  223. package/dist/blocks/service-accounts/index.d.ts +1 -1
  224. package/dist/blocks/service-accounts/index.js +3 -4
  225. package/dist/blocks/sessions/index.d.ts +2 -2
  226. package/dist/blocks/sessions/index.js +1 -1
  227. package/dist/blocks/settings/index.d.ts +2 -2
  228. package/dist/blocks/settings/index.js +3 -4
  229. package/dist/blocks/share-links/index.d.ts +1 -1
  230. package/dist/blocks/share-links/index.js +6 -6
  231. package/dist/blocks/shipments/index.d.ts +1 -1
  232. package/dist/blocks/shipments/index.js +9 -10
  233. package/dist/blocks/signatures/index.d.ts +1 -1
  234. package/dist/blocks/signatures/index.js +3 -4
  235. package/dist/blocks/signing-keys/index.d.ts +1 -1
  236. package/dist/blocks/signing-keys/index.js +2 -2
  237. package/dist/blocks/sla/index.d.ts +1 -1
  238. package/dist/blocks/sla/index.js +7 -8
  239. package/dist/blocks/sso/index.d.ts +1 -1
  240. package/dist/blocks/sso/index.js +2 -3
  241. package/dist/blocks/state-machine/index.d.ts +1 -1
  242. package/dist/blocks/state-machine/index.js +3 -3
  243. package/dist/blocks/subjects/index.d.ts +2 -2
  244. package/dist/blocks/subjects/index.js +3 -4
  245. package/dist/blocks/tags/index.d.ts +2 -2
  246. package/dist/blocks/tags/index.js +6 -6
  247. package/dist/blocks/tasks/index.d.ts +2 -2
  248. package/dist/blocks/tasks/index.js +7 -8
  249. package/dist/blocks/teams/index.d.ts +1 -1
  250. package/dist/blocks/teams/index.js +3 -3
  251. package/dist/blocks/templates/index.d.ts +3 -3
  252. package/dist/blocks/templates/index.js +3 -4
  253. package/dist/blocks/time-tracking/index.d.ts +8 -1
  254. package/dist/blocks/time-tracking/index.js +9 -10
  255. package/dist/blocks/timeline/index.d.ts +3 -3
  256. package/dist/blocks/timeline/index.js +4 -5
  257. package/dist/blocks/trash/index.d.ts +1 -1
  258. package/dist/blocks/trash/index.js +3 -4
  259. package/dist/blocks/undo/index.d.ts +2 -2
  260. package/dist/blocks/undo/index.js +2 -2
  261. package/dist/blocks/updated-at/index.d.ts +1 -1
  262. package/dist/blocks/usage/index.d.ts +2 -2
  263. package/dist/blocks/usage/index.js +2 -3
  264. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  265. package/dist/blocks/vercel-marketplace/index.js +3 -4
  266. package/dist/blocks/versions/index.d.ts +1 -1
  267. package/dist/blocks/versions/index.js +6 -7
  268. package/dist/blocks/waitlist/index.d.ts +1 -1
  269. package/dist/blocks/waitlist/index.js +4 -5
  270. package/dist/blocks/webhooks/index.d.ts +3 -3
  271. package/dist/blocks/webhooks/index.js +13 -14
  272. package/dist/blocks/workflow-editor/index.d.ts +6 -6
  273. package/dist/blocks/workflow-editor/index.js +10 -11
  274. package/dist/blocks/workflows/index.d.ts +4 -4
  275. package/dist/blocks/workflows/index.js +5 -6
  276. package/dist/{bookings-Dox2rced.d.ts → bookings-BpCNphYp.d.ts} +1 -2
  277. package/dist/{build-D9lWi5bk.js → build-CH2N3Yf0.js} +4 -4
  278. package/dist/{build-BFC8nFiL.js → build-DbIRFcHQ.js} +3 -65
  279. package/dist/chat-sdk/index.js +2 -3
  280. package/dist/cli/{add-CH7dC6UR.js → add-B6CQOt3A.js} +2 -2
  281. package/dist/cli/{add-CtLjnwds.js → add-BXFzr0Wf.js} +9 -9
  282. package/dist/cli/add-w_HumDPX.js +1 -0
  283. package/dist/cli/{backfill-DBJIMzcy.js → backfill-Dflp6JZk.js} +1 -1
  284. package/dist/cli/bin.js +1 -1
  285. package/dist/cli/{blocks-i1w0EEvs.js → blocks-CBH3N7Fy.js} +1 -1
  286. package/dist/cli/{blocks-CS58-xnw.js → blocks-FtOIcUbu.js} +1 -1
  287. package/dist/cli/{cache-Cn3crN0v.js → cache-61VwYKEv.js} +1 -1
  288. package/dist/cli/{codemod-D6wifOAH.js → codemod-CqPRa25J.js} +1 -1
  289. package/dist/cli/{content-mapper-Q9We297z.js → content-mapper-DGQQY5IA.js} +2 -2
  290. package/dist/cli/{doctor-DmfdE5Ct.js → doctor-BxxSO193.js} +62 -58
  291. package/dist/cli/{gen-D68A0uN8.js → gen-D2cqqqTH.js} +11 -11
  292. package/dist/cli/index.d.ts +1 -1
  293. package/dist/cli/index.js +6 -6
  294. package/dist/cli/{init-N7pkBbJn.js → init-BnG1IE1y.js} +5 -5
  295. package/dist/cli/{live-0xAAlTK_.js → live-D26OWOAb.js} +2 -2
  296. package/dist/cli/{mcp-CbN3ulRF.js → mcp-1l3C_GdB.js} +2 -2
  297. package/dist/cli/{metadata-417ldpf4.js → metadata-DDfPBHwI.js} +3 -3
  298. package/dist/cli/{migration-safety-BC_UI4jC.js → migration-safety-CQbrfZIx.js} +1 -1
  299. package/dist/cli/{migrations-DdBKwrvG.js → migrations-Ch5Uuvyj.js} +1 -1
  300. package/dist/cli/{module-migration-DdxPdqMC.js → module-migration-Dul1uTYX.js} +2 -2
  301. package/dist/cli/{powersync-CJTEz-uY.js → powersync-CfT-tRx1.js} +2 -2
  302. package/dist/cli/powersync-Vmhw5c1N.js +1 -0
  303. package/dist/cli/{print-DyFm91R-.js → print-CbPT4PTL.js} +2 -2
  304. package/dist/cli/{remove-CPY0xsVm.js → remove-kDH1yxKZ.js} +5 -5
  305. package/dist/cli/{render-DE3O1OFq.js → render-0Vd7BaNA.js} +22 -5
  306. package/dist/cli/{run-WtIEFGvP.js → run-Dafms0D2.js} +8 -8
  307. package/dist/cli/{run-CcrNGX9C.js → run-DxTd55Ug.js} +21 -21
  308. package/dist/cli/{shared-SlukBuKn.js → shared-BQAMXvwd.js} +1 -1
  309. package/dist/cli/{snapshot-pyIsJjUV.js → snapshot-B8K6gYjA.js} +2 -2
  310. package/dist/cli/{source-Bclt9D0Y.js → source-CXDyCWz5.js} +1 -1
  311. package/dist/cli/{spec-D7zsEVj_.js → spec-BGsnTkIl.js} +2 -2
  312. package/dist/cli/{spec-BsdLx7tZ.js → spec-CaN7nOqI.js} +1 -1
  313. package/dist/cli/{sql-layout-C6baAM5t.js → sql-layout-BGAlcp1U.js} +2 -2
  314. package/dist/cli/{sync-Cse8VXAU.js → sync-CT_5VG0E.js} +3 -3
  315. package/dist/cli/{upgrade-28ENjIJU.js → upgrade-DA7aO88E.js} +2 -2
  316. package/dist/cli/{upgrade-Cwc1RiAE.js → upgrade-frUtPDDb.js} +4 -4
  317. package/dist/cli/{version-yWIaLG04.js → version-CUdPyV6J.js} +1 -1
  318. package/dist/client/index.d.ts +5 -5
  319. package/dist/client/index.js +1 -1
  320. package/dist/client/native/index.d.ts +4 -4
  321. package/dist/client/native/index.js +1 -1
  322. package/dist/{codecs-BfmQSbM6.js → codecs-CSUFGrdP.js} +3 -3
  323. package/dist/commerce/index.js +3 -3
  324. package/dist/{composite-D24L5RIY.js → composite-CBRbvn5j.js} +2 -2
  325. package/dist/{composite-DbRuu6Jb.d.ts → composite-ChzHhSB0.d.ts} +3 -3
  326. package/dist/config/index.d.ts +2 -2
  327. package/dist/config/index.js +5 -5
  328. package/dist/{config-CD2OGfCG.js → config-C9AOcQ9S.js} +1 -1
  329. package/dist/{config-D74JT0qL.js → config-CH-D2B-4.js} +4 -4
  330. package/dist/{context-CjHXhCck.d.ts → context-DEisra3V.d.ts} +19 -7
  331. package/dist/{controller-BeqcjERs.d.ts → controller-B6vWdKSa.d.ts} +1 -1
  332. package/dist/{controller-BNZKd6bJ.js → controller-qG-B1eDn.js} +1 -1
  333. package/dist/{conversion-BqDvi8ty.d.ts → conversion-DBgMck5U.d.ts} +1 -1
  334. package/dist/create/index.d.ts +72 -451
  335. package/dist/create/index.js +15 -1687
  336. package/dist/create/lite/index.d.ts +250 -13
  337. package/dist/create/lite/index.js +1007 -24
  338. package/dist/{create-blocks-0pWKQ6x4.js → create-blocks-BfrDUSM6.js} +14 -10
  339. package/dist/credentials/index.js +3 -4
  340. package/dist/{cron-CgHTKwYG.js → cron-DdT4ti8a.js} +1 -1
  341. package/dist/{cron-route-UU9i5i9J.js → cron-route-FjKgRvTY.js} +1 -1
  342. package/dist/{deal-forecast-DikouYGj.js → deal-forecast-CKBnRodz.js} +2 -2
  343. package/dist/{define-Djgn3HQQ.js → define-D-dLADd5.js} +16 -19
  344. package/dist/{define-BqaUwrIC.d.ts → define-Lf6rI2QN.d.ts} +14 -8
  345. package/dist/{define-block-CRwHsxZO.d.ts → define-block-DCAiOrNX.d.ts} +12 -3
  346. package/dist/edge/index.d.ts +5 -5
  347. package/dist/edge/index.js +7 -7
  348. package/dist/elysia/index.js +1 -1
  349. package/dist/{entitlements-mDz7GfA_.d.ts → entitlements-BPaPd3MD.d.ts} +1 -1
  350. package/dist/{entitlements-DBir2qwB.js → entitlements-tGL6-69B.js} +2 -2
  351. package/dist/{entity-schema-BDv6w-OQ.js → entity-schema-B1YmMtP8.js} +1 -1
  352. package/dist/events/index.js +3 -3
  353. package/dist/{executor-3qcMhg6R.js → executor-C2Ne-Scm.js} +3 -2
  354. package/dist/{executor-Bi056Cnj.d.ts → executor-DNK401lZ.d.ts} +1 -1
  355. package/dist/{executor-D3gB-9si.js → executor-DqIci3Jb.js} +3 -3
  356. package/dist/{executor-BQ7dYw4E.js → executor-WolvKszH.js} +3 -3
  357. package/dist/{executor-_O-CqCPl.d.ts → executor-aFV7nEBs.d.ts} +2 -2
  358. package/dist/expo/index.d.ts +2 -2
  359. package/dist/expo/index.js +3 -3
  360. package/dist/{field-errors-Cfvcg-C3.d.ts → field-errors-DBgDCITw.d.ts} +6 -6
  361. package/dist/{fields--5a88KJe.js → fields-BBm49w-E.js} +1 -1
  362. package/dist/{filter-evaluate-w1XOIUOL.js → filter-evaluate-lCToXzZI.js} +2 -2
  363. package/dist/{filter-query-DMoKo82_.js → filter-query-CQ6d5GnQ.js} +1 -1
  364. package/dist/{flags-ClOQY-p5.js → flags-DF_SCqp5.js} +1 -1
  365. package/dist/flags-sdk/index.js +2 -2
  366. package/dist/{framework-B-1Ka0GW.d.ts → framework-DKA3fTHl.d.ts} +3 -3
  367. package/dist/{framework-CNhTg0th.js → framework-DYEUraqt.js} +1 -1
  368. package/dist/h3/index.js +1 -1
  369. package/dist/h3/v1/index.js +1 -1
  370. package/dist/hono/index.d.ts +4 -4
  371. package/dist/hono/index.js +6 -6
  372. package/dist/{index-CjnDGAJr.d.ts → index-3p_oWttZ.d.ts} +77 -2
  373. package/dist/{index-BzW1T3oI.d.ts → index-ByF22_C6.d.ts} +3 -3
  374. package/dist/{index-BdzfjFnd.d.ts → index-C4sjewrr.d.ts} +9 -9
  375. package/dist/{index-CYzckGOz.d.ts → index-CM2aGNRo.d.ts} +9 -5
  376. package/dist/{index-DfgP-9eC.d.ts → index-CdMZQCYR.d.ts} +3 -3
  377. package/dist/{index-EieRHooI.d.ts → index-ClvuSZEz.d.ts} +2 -2
  378. package/dist/index.d.ts +2 -2
  379. package/dist/index.js +8 -7
  380. package/dist/{app-tables-DyswUg6J.js → instances-CK0jR3Pc.js} +147 -3
  381. package/dist/{json-schema-Ca6gYbEP.js → json-schema-DHJxiizN.js} +1 -1
  382. package/dist/{kit-DhlB-vv_.js → kit-Bcd9wYCV.js} +1 -1
  383. package/dist/{knowledge-CV6OSirC.js → knowledge-tCrrU99q.js} +2 -2
  384. package/dist/list/index.d.ts +1 -1
  385. package/dist/list/index.js +3 -3
  386. package/dist/{list-query-BKy2zBaT.js → list-query-BnpA2BDg.js} +1 -1
  387. package/dist/{list-query-6vTI1VN6.d.ts → list-query-XYfUZb0j.d.ts} +1 -1
  388. package/dist/mapper/bin.js +5 -5
  389. package/dist/mcp/index.d.ts +4 -4
  390. package/dist/mcp/index.js +7 -7
  391. package/dist/mcp/sdk/index.d.ts +2 -2
  392. package/dist/mcp/sdk/index.js +2 -2
  393. package/dist/{messages-D4XWuRTj.js → messages-ecPW_nOv.js} +1 -1
  394. package/dist/{model-messages-CKG0zwdF.js → model-messages-CkZSDDHP.js} +1 -1
  395. package/dist/{money-codec-uV5WbT60.js → money-codec-BJuS2zEW.js} +1 -1
  396. package/dist/nestjs/index.js +1 -1
  397. package/dist/next/index.d.ts +14 -14
  398. package/dist/next/index.js +8 -8
  399. package/dist/node/index.js +1 -1
  400. package/dist/{operations-DbNAgo7E.d.ts → operations-DC3wU3Sy.d.ts} +1 -1
  401. package/dist/orpc/index.d.ts +4 -4
  402. package/dist/orpc/index.js +5 -5
  403. package/dist/otel/index.js +5 -5
  404. package/dist/{ports-DO3tgLTo.d.ts → ports-BbBJVyS0.d.ts} +1 -1
  405. package/dist/{ports-CaVRXjxq.js → ports-DvpNseap.js} +1 -1
  406. package/dist/postgres/index.js +5 -4
  407. package/dist/{postgrest-executor-BFW4oWte.js → postgrest-executor-B_Uezhrm.js} +7 -3
  408. package/dist/powersync/index.d.ts +3 -3
  409. package/dist/powersync/index.js +1 -1
  410. package/dist/preset/index.d.ts +4 -4
  411. package/dist/preset/index.js +4 -4
  412. package/dist/{preset-B3CukUhu.js → preset-CS490mYJ.js} +179 -7
  413. package/dist/project-NmP1NdLi.js +1760 -0
  414. package/dist/{push-token-IFGi8jvd.d.ts → push-token-CPJfPFa2.d.ts} +1 -1
  415. package/dist/query/index.d.ts +1 -1
  416. package/dist/query/index.js +1 -1
  417. package/dist/{rate-limit-BPuUWz4U.js → rate-limit-fZ_d8gSE.js} +4 -5
  418. package/dist/react/index.d.ts +5 -5
  419. package/dist/react/index.js +2 -2
  420. package/dist/react/native/index.d.ts +1 -1
  421. package/dist/react/server.d.ts +6 -6
  422. package/dist/react/server.js +2 -2
  423. package/dist/{react-D-p70_wL.js → react-CcrQQl0_.js} +4 -4
  424. package/dist/react-router/index.d.ts +3 -3
  425. package/dist/react-router/index.js +5 -5
  426. package/dist/{read-set-BnKnofIj.js → read-set-B1sDib5O.js} +1 -1
  427. package/dist/realtime/index.d.ts +3 -3
  428. package/dist/realtime/index.js +2 -2
  429. package/dist/{record-bindings-DkBJpC5A.js → record-bindings-Z51mGfhB.js} +1 -1
  430. package/dist/{record-form-yMVvkPiQ.d.ts → record-form-BbZpwsEi.d.ts} +1 -1
  431. package/dist/records/index.d.ts +7 -7
  432. package/dist/records/index.js +3 -3
  433. package/dist/{refusal-D48CMqpQ.js → refusal-DDlInPff.js} +2 -2
  434. package/dist/{instances-DDt7NdVl.js → resolved-names-DdlJzoMK.js} +2 -146
  435. package/dist/{resource-R3KToNze.js → resource-BUJcZKiW.js} +2 -2
  436. package/dist/{resource-execute-LR71zWej.d.ts → resource-execute-CUG6xUuh.d.ts} +1 -1
  437. package/dist/{resource-types-eXuFxVt7.d.ts → resource-types-DjZ91WKA.d.ts} +1 -1
  438. package/dist/{resources-Dpz3h8Fe.d.ts → resources-6Ncdt9XT.d.ts} +1 -1
  439. package/dist/{resources-DqIwoQsP.js → resources-jb3R6rEa.js} +1 -1
  440. package/dist/{rows-EGAbu7MG.js → rows-BdqXmiB-.js} +2 -2
  441. package/dist/{rows-Bh9QemqN.js → rows-jijHLVE_.js} +1 -1
  442. package/dist/{rrule-79K2c3Nr.js → rrule-C9Ot6ax8.js} +1 -1
  443. package/dist/{sales-lines-CP4Z_LyE.js → sales-lines-DO7oRu1o.js} +3 -3
  444. package/dist/{sales-shared-BKXXA5qV.js → sales-shared-BuTA8JK7.js} +2 -2
  445. package/dist/{schemas-BSTNfGsQ.js → schemas-CLOTvdsC.js} +1 -1
  446. package/dist/{scores-CsgM-dw7.js → scores-bY2Is0kx.js} +2 -2
  447. package/dist/server/index.d.ts +7 -7
  448. package/dist/server/index.js +9 -9
  449. package/dist/{server-types-BTBzrzOH.d.ts → server-types-BH6AjDBN.d.ts} +1 -1
  450. package/dist/{session-BgYGk_FS.d.ts → session-Y5SSYO2C.d.ts} +1 -1
  451. package/dist/{shared-C47zAh2A.js → shared-BeHTi8Fu.js} +1 -1
  452. package/dist/{sign-in-BTaRWS-L.js → sign-in-NO7LWlw4.js} +5 -5
  453. package/dist/{signatures-CNcoq392.js → signatures-CX1b4WHa.js} +2 -2
  454. package/dist/{signers-BAEzvTJ0.d.ts → signers-BKgmVh6A.d.ts} +2 -2
  455. package/dist/{signing-keys-DqI-gB_C.js → signing-keys-CWtpMask.js} +3 -3
  456. package/dist/solid/index.d.ts +6 -6
  457. package/dist/solid/index.js +1 -1
  458. package/dist/solid-start/index.d.ts +3 -3
  459. package/dist/solid-start/index.js +5 -5
  460. package/dist/spec/index.d.ts +2 -2
  461. package/dist/spec/index.js +2 -693
  462. package/dist/{spec-DTWkHzYZ.js → spec-BMvCCNnd.js} +1 -1
  463. package/dist/sql/index.d.ts +4 -4
  464. package/dist/sql/index.js +2 -2
  465. package/dist/{sql-B0wb7XA5.js → sql-BMXEHTvr.js} +9685 -6254
  466. package/dist/{sql-BPbbPzRJ.js → sql-CYt7EhH0.js} +2 -2
  467. package/dist/sqlite/index.d.ts +1 -1
  468. package/dist/sqlite/index.js +1 -1
  469. package/dist/{sso-Co2TbnEy.js → sso-DdDpJQzw.js} +2 -2
  470. package/dist/ssr/index.d.ts +1 -1
  471. package/dist/storage/index.js +3 -3
  472. package/dist/streams/index.js +1 -2
  473. package/dist/{subject-readers-F1xvRY-d.js → subject-readers-CeeJJOQ4.js} +1 -1
  474. package/dist/svelte/index.d.ts +6 -6
  475. package/dist/svelte/index.js +1 -1
  476. package/dist/sveltekit/index.d.ts +4 -4
  477. package/dist/sveltekit/index.js +5 -5
  478. package/dist/{table-schema-CD8cJz_M.js → table-schema-C80xItaV.js} +1 -1
  479. package/dist/{tags-CXeJu332.d.ts → tags-Cjtcp5cN.d.ts} +1 -1
  480. package/dist/tanstack-db/index.d.ts +1 -1
  481. package/dist/tanstack-start/index.d.ts +3 -3
  482. package/dist/tanstack-start/index.js +5 -5
  483. package/dist/{temporal-DLZlWbOi.js → temporal-Dbo0fLzc.js} +12 -2
  484. package/dist/{temporal-required-Dy0GGD8E.js → temporal-required-DcLhnDhQ.js} +1 -1
  485. package/dist/{tenant-DzymQ9sv.d.ts → tenant-BHvMFNXl.d.ts} +1 -1
  486. package/dist/testing/index.d.ts +10 -10
  487. package/dist/testing/index.js +10 -10
  488. package/dist/{timeline-BMVOKokJ.d.ts → timeline-CEzj9v1z.d.ts} +3 -3
  489. package/dist/{topic-0uK4db_2.d.ts → topic-gTVjLGTk.d.ts} +2 -2
  490. package/dist/types-BC1HLEVx.d.ts +461 -0
  491. package/dist/{types-DsRfiQ0v.d.ts → types-yj8VF4oY.d.ts} +5 -0
  492. package/dist/{undo-B3FQvuAd.js → undo-BbftL9-4.js} +2 -2
  493. package/dist/vercel-connect/index.js +1 -1
  494. package/dist/{verify-ZLFUdlqE.js → verify-7EucfCnv.js} +3 -3
  495. package/dist/{verify-DexkIx4t.d.ts → verify-B0KLBb3j.d.ts} +1 -1
  496. package/dist/vue/index.d.ts +6 -6
  497. package/dist/vue/index.js +1 -1
  498. package/dist/{watch-topic-CG3kOX-D.d.ts → watch-topic-C6HhbnVz.d.ts} +1 -1
  499. package/dist/wire-ChYn1g21.js +91 -0
  500. package/dist/workflow-sdk/builder/index.d.ts +2 -2
  501. package/dist/workflow-sdk/builder/index.js +1 -1
  502. package/dist/workflow-sdk/world/index.js +1 -1
  503. package/dist/yjs/index.d.ts +1 -1
  504. package/dist/yjs/index.js +1 -1
  505. package/package.json +1 -1
  506. package/skills/better-supabase/references/ui-recipes.md +1 -1
  507. package/dist/block-transport-PNea4lfQ.js +0 -84
  508. package/dist/cli/add-DyCrVejx.js +0 -1
  509. package/dist/cli/powersync-CYQ4Ljcz.js +0 -1
  510. package/dist/types-DGHfTW8_.d.ts +0 -9
  511. package/dist/{data-hooks-tgF1Ct0F.js → data-hooks-CdcZfVS1.js} +1 -1
  512. package/dist/{respond-3RKp6VgU.js → respond-CZMWbUs3.js} +1 -1
  513. package/dist/{topic-DXbA-jwr.js → topic-DClSoqY7.js} +2 -2
@@ -1,8 +1,8 @@
1
1
  import { n as dbError } from "../../errors-BVFgt8BZ.js";
2
2
  import { o as problemResponse } from "../../problem-Bf0cJ7tk.js";
3
3
  import { i as delegationOf } from "../../actor-go7p9-CJ.js";
4
- import { c as extendServer, i as resolveToken, n as flushEvents, s as createServer } from "../../adapter-CfuBICuG.js";
5
- import { i as guard } from "../../respond-3RKp6VgU.js";
4
+ import { c as extendServer, i as resolveToken, n as flushEvents, s as createServer } from "../../adapter-D4aNBxhm.js";
5
+ import { i as guard } from "../../respond-CZMWbUs3.js";
6
6
  import { t as withExtra } from "../../extra-CGQ2_q3S.js";
7
7
  import { a as withCors, i as metadataPreflight, n as endpointPreflight, r as isMetadataRequest, t as discovery } from "../../http-DzbloBR-.js";
8
8
  import { n as loadSupabaseMcp, r as loadSupabaseMcpPlatform, t as isRecord } from "../../supabase-mcp-Dz9DgrKP.js";
@@ -1,6 +1,6 @@
1
1
  import { n as dbError } from "./errors-BVFgt8BZ.js";
2
2
  import { n as isRecord } from "./guards-6F2bCtQR.js";
3
- import { s as nowInstant } from "./temporal-DLZlWbOi.js";
3
+ import { s as nowInstant } from "./temporal-Dbo0fLzc.js";
4
4
  import { o as problemResponse } from "./problem-Bf0cJ7tk.js";
5
5
  //#region src/ai-sdk/gateway.ts
6
6
  const count = (value) => typeof value === "number" && Number.isFinite(value) ? value : 0;
@@ -1,5 +1,5 @@
1
1
  import { n as isRecord } from "./guards-6F2bCtQR.js";
2
- import { a as meta } from "./messages-D4XWuRTj.js";
2
+ import { a as meta } from "./messages-ecPW_nOv.js";
3
3
  //#region src/ai-sdk/model-messages.ts
4
4
  const FETCHABLE_URL = /^(?:https?|data):/u;
5
5
  function fileUrl(data) {
@@ -1,5 +1,5 @@
1
1
  import { n as dbError } from "./errors-BVFgt8BZ.js";
2
- import { a as bigintOf, x as optionalBigintOf } from "./block-helpers-DnCtsKtv.js";
2
+ import { S as optionalBigintOf, a as bigintOf } from "./block-helpers-B0f0ZVb5.js";
3
3
  import { d as money, s as isCurrency } from "./money-BZl985O-.js";
4
4
  //#region src/blocks/money-codec.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-D48CMqpQ.js";
1
+ import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-DDlInPff.js";
2
2
  import { t as beforeRoute } from "../before-route-B23K2zYU.js";
3
3
  import { t as applyWebHeaders } from "../node-headers-C71zNQHe.js";
4
4
  import { n as toWebRequest, t as sendWebResponse } from "../http-BjjojWg3.js";
@@ -2,27 +2,27 @@ import { b as DbError, f as Result } from "../result-DZeA5KS6.js";
2
2
  import { $ as RecordRef, O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
3
3
  import { r as AuthState } from "../resolve-CXX6DHv3.js";
4
4
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
5
- import { J as DbStats, Zt as CacheAdapter, pt as QuerySpec, t as BetterSupabase, tt as ReadSet } from "../define-BqaUwrIC.js";
6
- import { A as isSessionSnapshot, M as sessionCacheKey, O as SessionSnapshot, a as ServerContext, c as ServerOptions, j as issuedAtOf, k as authzVersionOf, l as SharedServer, n as BetterServer, r as ContextOptions } from "../server-types-BTBzrzOH.js";
5
+ import { Qt as CacheAdapter, Y as DbStats, mt as QuerySpec, nt as ReadSet, t as BetterSupabase } from "../define-Lf6rI2QN.js";
6
+ import { A as isSessionSnapshot, M as sessionCacheKey, O as SessionSnapshot, a as ServerContext, c as ServerOptions, j as issuedAtOf, k as authzVersionOf, l as SharedServer, n as BetterServer, r as ContextOptions } from "../server-types-BH6AjDBN.js";
7
7
  import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
8
8
  import { n as AmrEntry, t as Aal } from "../mfa-oIOYTpvc.js";
9
- import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-CRwHsxZO.js";
10
- import { M as BindingName, N as BindingOf, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "../index-EieRHooI.js";
11
- import { t as tenantOf } from "../tenant-DzymQ9sv.js";
9
+ import { S as BlockClientSource, on as RecordBindingOptions } from "../define-block-DCAiOrNX.js";
10
+ import { M as BindingName, N as BindingOf, S as RecordWriteInput, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, m as PlainBindings, x as RecordTypeWriteOutput } from "../index-ClvuSZEz.js";
11
+ import { t as tenantOf } from "../tenant-BHvMFNXl.js";
12
12
  import { n as toSession, t as AuthSession } from "../view-DyFdMCqg.js";
13
13
  import { a as SupportPolicy, c as supportSessions, i as SupportOptions, o as SupportSessions, s as SupportStartRequest, t as ActiveSupport } from "../support-B4ZBVxt3.js";
14
- import { t as AuthOutageHook } from "../session-BgYGk_FS.js";
14
+ import { t as AuthOutageHook } from "../session-Y5SSYO2C.js";
15
15
  import { n as AuthKind, r as GuardOptions } from "../respond-oZeJ342J.js";
16
16
  import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, r as ActionResult, t as ActionInput } from "../kit-CVgQCIBO.js";
17
- import { c as ListParseOptions, m as ListSearchParams } from "../list-query-6vTI1VN6.js";
18
- import { r as LiveCountSeed, t as CountRunner } from "../index-BzW1T3oI.js";
19
- import { r as MembershipClaim } from "../entitlements-mDz7GfA_.js";
20
- import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-eXuFxVt7.js";
21
- import { t as ResourceMap } from "../resources-Dpz3h8Fe.js";
22
- import { t as defineAction } from "../resource-execute-LR71zWej.js";
17
+ import { c as ListParseOptions, m as ListSearchParams } from "../list-query-XYfUZb0j.js";
18
+ import { r as LiveCountSeed, t as CountRunner } from "../index-ByF22_C6.js";
19
+ import { r as MembershipClaim } from "../entitlements-BPaPd3MD.js";
20
+ import { i as ResourceContext, l as ResourceRouteOptions, o as ResourceHooks, r as ResourceAction, t as ActionArgs } from "../resource-types-DjZ91WKA.js";
21
+ import { t as ResourceMap } from "../resources-6Ncdt9XT.js";
22
+ import { t as defineAction } from "../resource-execute-CUG6xUuh.js";
23
23
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
24
- import { i as tagFor, t as TagOptions } from "../tags-CXeJu332.js";
25
- import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-BMVOKokJ.js";
24
+ import { i as tagFor, t as TagOptions } from "../tags-Cjtcp5cN.js";
25
+ import { c as RecordListCells, n as Timeline, o as RecordList, u as RecordListPage } from "../timeline-CEzj9v1z.js";
26
26
  import { r as safeRedirectPath } from "../sign-in-BAjR49fq.js";
27
27
  import { n as supportOf, t as SupportView } from "../support-view-BYOgwXsJ.js";
28
28
  import { NextRequest } from "next/server.js";
@@ -3,27 +3,27 @@ import { n as dbError } from "../errors-BVFgt8BZ.js";
3
3
  import { t as isList } from "../guards-6F2bCtQR.js";
4
4
  import { t as isStorageApi } from "../storage-api-Dg78Wqsg.js";
5
5
  import { r as err } from "../result-ntFBW2p2.js";
6
- import { o as isReadSet } from "../read-set-BnKnofIj.js";
6
+ import { o as isReadSet } from "../read-set-B1sDib5O.js";
7
7
  import { n as validate } from "../standard-BA3mLh6w.js";
8
8
  import { n as StatsRecorder, t as EMPTY_STATS } from "../stats-BHl1-zj9.js";
9
9
  import { o as problemResponse } from "../problem-Bf0cJ7tk.js";
10
10
  import { i as claimsOf } from "../claims-Bp9My7XP.js";
11
11
  import { t as supportOf } from "../support-view-g4YLBeqX.js";
12
- import { n as createBlockClient } from "../create-blocks-0pWKQ6x4.js";
12
+ import { n as createBlockClient } from "../create-blocks-BfrDUSM6.js";
13
13
  import { a as recordCan, c as recordWriteInput, i as plainData, l as runBindingWrite, o as recordPermissionKeys, p as loadBindings, r as findBindingWrite, s as recordSubject, t as bindingWrites } from "../record-type-DRbnlj5q.js";
14
14
  import { n as methodOf } from "../block-method-C9hWdHom.js";
15
15
  import { t as tenantOf } from "../tenant-BgIiMQpo.js";
16
16
  import { t as loadTimeline } from "../timeline--VU3A1e4.js";
17
- import { T as serverCore, b as isPrefetch, c as extendServer, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as outageResponse } from "../adapter-CfuBICuG.js";
17
+ import { T as serverCore, b as isPrefetch, c as extendServer, n as flushEvents, p as supportCookieMaxAge, r as handle, s as createServer, t as bearerRequest, v as outageResponse } from "../adapter-D4aNBxhm.js";
18
18
  import { g as sessionCookieName, t as clientIp, v as writeSession } from "../resolve-B0mW2m7f.js";
19
19
  import { a as isSessionSnapshot, f as checkAal, i as authzVersionOf, n as toSession, o as issuedAtOf, s as sessionCacheKey } from "../view-C8Ve14ja.js";
20
- import { i as guard, n as defaultExpose, s as settle } from "../respond-3RKp6VgU.js";
21
- import { i as supportSessions, n as passwordGrant, r as safeRedirectPath, t as needsMfa } from "../sign-in-BTaRWS-L.js";
22
- import { i as defineAction } from "../resource-R3KToNze.js";
20
+ import { i as guard, n as defaultExpose, s as settle } from "../respond-CZMWbUs3.js";
21
+ import { i as supportSessions, n as passwordGrant, r as safeRedirectPath, t as needsMfa } from "../sign-in-NO7LWlw4.js";
22
+ import { i as defineAction } from "../resource-BUJcZKiW.js";
23
23
  import { r as tagFor, t as cacheTagsOf } from "../tags-CIZTqtlY.js";
24
- import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-DhlB-vv_.js";
24
+ import { i as requireCaller, n as formDataObject, t as authorizeCaller } from "../kit-Bcd9wYCV.js";
25
25
  import { t as withExtra } from "../extra-CGQ2_q3S.js";
26
- import { n as resourceRouter } from "../resources-DqIwoQsP.js";
26
+ import { n as resourceRouter } from "../resources-jb3R6rEa.js";
27
27
  import { cache } from "react";
28
28
  import { cacheLife, cacheTag, io, revalidateTag, updateTag } from "next/cache.js";
29
29
  import { cookies, headers } from "next/headers.js";
@@ -1,5 +1,5 @@
1
1
  import { a as toResponse, t as around } from "../shared-Bf-I13Ht.js";
2
- import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-D48CMqpQ.js";
2
+ import { a as routeRefusal, n as guardedLocals, t as errorResponse } from "../refusal-DDlInPff.js";
3
3
  import { t as beforeRoute } from "../before-route-B23K2zYU.js";
4
4
  import { i as toWebHeaders, t as applyWebHeaders } from "../node-headers-C71zNQHe.js";
5
5
  import { n as toWebRequest, t as sendWebResponse } from "../http-BjjojWg3.js";
@@ -1,4 +1,4 @@
1
- import { r as AuthorizationOperation } from "./authorization-08F77H2w.js";
1
+ import { r as AuthorizationOperation } from "./authorization-DhoA7dsD.js";
2
2
  //#region src/core/operations.d.ts
3
3
  /** Operations by name, as `authorization.operations` or a module's own defaults. */
4
4
  type OperationTable = Readonly<Record<string, AuthorizationOperation>>;
@@ -2,14 +2,14 @@ import { b as DbError, f as Result } from "../result-DZeA5KS6.js";
2
2
  import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
3
3
  import { r as AuthState } from "../resolve-CXX6DHv3.js";
4
4
  import { i as ProblemDetails } from "../problem-DNwN8iGz.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 { i as MiddlewareOptions, r as GuardOptions } from "../respond-oZeJ342J.js";
8
8
  import { c as ResourceLoaderContext, i as AuthorizeOptions } from "../kit-CVgQCIBO.js";
9
9
  import { t as Validated } from "../shared-CRRfQAKG.js";
10
- import { a as ResourceHandler } from "../resource-types-eXuFxVt7.js";
10
+ import { a as ResourceHandler } from "../resource-types-DjZ91WKA.js";
11
11
  import { i as RouteRateLimitRule, n as RateLimitVerdict, r as RateLimiter, t as RateLimitRouteOptions } from "../rate-limit-Bztf32cl.js";
12
- import { t as Api } from "../api-BIw5g_4V.js";
12
+ import { t as Api } from "../api-CHObZL7m.js";
13
13
  import { AnyEntry, Contributions } from "@supabase/middleware";
14
14
  import { AnySchema, BuilderWithMiddlewares, DecoratedMiddleware, DecoratedProcedure, MetaPlugin, ORPCError, Schema } from "@orpc/server";
15
15
  //#region src/orpc/router.d.ts
@@ -4,15 +4,15 @@ import { r as err } from "../result-ntFBW2p2.js";
4
4
  import { t as instanceProperty } from "../instance-property-hRh88y_s.js";
5
5
  import { c as toProblem } from "../problem-Bf0cJ7tk.js";
6
6
  import { i as claimsOf } from "../claims-Bp9My7XP.js";
7
+ import { t as TABLE_VERBS } from "../resource-DvgXqZB_.js";
7
8
  import { t as callWithInput } from "../block-method-C9hWdHom.js";
8
9
  import { t as tenantOf } from "../tenant-BgIiMQpo.js";
9
- import { c as extendServer, n as flushEvents, s as createServer, x as refreshFor } from "../adapter-CfuBICuG.js";
10
+ import { c as extendServer, n as flushEvents, s as createServer, x as refreshFor } from "../adapter-D4aNBxhm.js";
10
11
  import { r as checkPermission } from "../authorizer-BGhXaDmo.js";
11
12
  import { n as toSession } from "../view-C8Ve14ja.js";
12
- import { i as guard, n as defaultExpose, s as settle, t as assertCookieRefresh } from "../respond-3RKp6VgU.js";
13
- import { t as TABLE_VERBS } from "../resource-DvgXqZB_.js";
14
- import { r as contextOf, t as defineResource } from "../resource-R3KToNze.js";
15
- import { t as authorizeCaller } from "../kit-DhlB-vv_.js";
13
+ import { i as guard, n as defaultExpose, s as settle, t as assertCookieRefresh } from "../respond-CZMWbUs3.js";
14
+ import { r as contextOf, t as defineResource } from "../resource-BUJcZKiW.js";
15
+ import { t as authorizeCaller } from "../kit-Bcd9wYCV.js";
16
16
  import { t as rateLimitGate } from "../rate-limit-BWKGlhTM.js";
17
17
  import { bufferRequest, pipeline, seedContext } from "@supabase/middleware";
18
18
  import { COMMON_ERROR_STATUS_MAP, ORPCError, os } from "@orpc/server";
@@ -1,6 +1,6 @@
1
1
  import { r as definePlugin } from "../plugin-AKwwe2gF.js";
2
2
  import { t as SPEC_PINS } from "../spec-pins-D3zDek-u.js";
3
- import { i as blockEventAttributes } from "../block-events-pBXPzwnW.js";
3
+ import { i as blockEventAttributes } from "../block-events-IWAyafO3.js";
4
4
  import { SpanKind, SpanStatusCode, context, metrics, propagation, trace } from "@opentelemetry/api";
5
5
  //#endregion
6
6
  //#region src/otel/index.ts
@@ -40,9 +40,9 @@ function systemOf(executor) {
40
40
  * ```
41
41
  */
42
42
  function otel(options = {}) {
43
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.20.0");
43
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.22.0");
44
44
  let histogram;
45
- if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.20.0")).createHistogram("db.client.operation.duration", {
45
+ if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.22.0")).createHistogram("db.client.operation.duration", {
46
46
  unit: "s",
47
47
  description: "Duration of database client operations.",
48
48
  advice: { explicitBucketBoundaries: [
@@ -219,7 +219,7 @@ function otel(options = {}) {
219
219
  * `betterSupabase.events`. Returns a function that stops listening.
220
220
  */
221
221
  function traceAuth(betterSupabase, options = {}) {
222
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.20.0");
222
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.22.0");
223
223
  const offAuth = betterSupabase.events.on("auth", (event) => {
224
224
  const span = tracer.startSpan("auth.resolve", {
225
225
  kind: SpanKind.INTERNAL,
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
257
257
  * an error status. Returns a function that stops listening.
258
258
  */
259
259
  function traceBlockEvents(betterSupabase, options = {}) {
260
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.20.0");
260
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.22.0");
261
261
  return betterSupabase.events.on("block", (event) => {
262
262
  const attributes = {
263
263
  ...options.attributes,
@@ -1,5 +1,5 @@
1
1
  import { t as AsyncResult } from "./result-DZeA5KS6.js";
2
- import { n as TopicPort } from "./watch-topic-CG3kOX-D.js";
2
+ import { n as TopicPort } from "./watch-topic-C6HhbnVz.js";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  //#region src/client/ports.d.ts
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { a as ok, r as err, t as AsyncResult } from "./result-ntFBW2p2.js";
2
- import { n as postgrestExecutor } from "./postgrest-executor-BFW4oWte.js";
2
+ import { n as postgrestExecutor } from "./postgrest-executor-B_Uezhrm.js";
3
3
  import { n as decodeJwtPayload } from "./base64-B9Wlsdj7.js";
4
4
  import { i as userContext } from "./impersonation-DM3oWNoD.js";
5
5
  import { n as hasAuthModule, r as claimedTenant } from "./auth-module-BbmX-N4L.js";
@@ -1,6 +1,7 @@
1
- import { n as quoteIdent, t as compileSql } from "../sql-BPbbPzRJ.js";
1
+ import { i as encodeArgument } from "../wire-ChYn1g21.js";
2
+ import { n as quoteIdent, t as compileSql } from "../sql-CYt7EhH0.js";
2
3
  import { t as fromPgError } from "../pg-error-B5QLDcbG.js";
3
- import { t as postgresExecutor } from "../executor-3qcMhg6R.js";
4
+ import { t as postgresExecutor } from "../executor-C2Ne-Scm.js";
4
5
  import { t as watchPoolErrors } from "../pool-errors-JUBcGrre.js";
5
6
  import { Pool } from "pg";
6
7
  //#region src/postgres/pool.ts
@@ -96,7 +97,7 @@ function createPostgres(options = {}) {
96
97
  try {
97
98
  await begin(client, session, settingsOf(session));
98
99
  const scoped = {
99
- queryRaw: async (text, params) => (await client.query(text, params)).rows,
100
+ queryRaw: async (text, params) => (await client.query(text, params?.map(encodeArgument))).rows,
100
101
  transaction: (inner) => inner(scoped)
101
102
  };
102
103
  const result = await fn(scoped);
@@ -112,7 +113,7 @@ function createPostgres(options = {}) {
112
113
  const clientFor = (session) => {
113
114
  const bare = !session.readOnly && settingsOf(session).length === 0;
114
115
  return {
115
- queryRaw: (text, params) => bare ? single(text, params) : transaction(session, (client) => client.queryRaw(text, params)),
116
+ queryRaw: (text, params) => bare ? single(text, params?.map(encodeArgument)) : transaction(session, (client) => client.queryRaw(text, params)),
116
117
  transaction: (fn) => transaction(session, fn)
117
118
  };
118
119
  };
@@ -1,7 +1,8 @@
1
1
  import { c as mapDbError, d as withMaxAffected, n as dbError } from "./errors-BVFgt8BZ.js";
2
- import { d as temporalText } from "./temporal-DLZlWbOi.js";
3
- import { n as invalidRequest, r as dateText } from "./build-BFC8nFiL.js";
2
+ import { d as temporalText } from "./temporal-Dbo0fLzc.js";
3
+ import { n as invalidRequest } from "./build-DbIRFcHQ.js";
4
4
  import { t as lookupOf } from "./lookup-BaP5bI27.js";
5
+ import { a as encodeArguments, t as dateText } from "./wire-ChYn1g21.js";
5
6
  import { a as ok, r as err, s as toDbError } from "./result-ntFBW2p2.js";
6
7
  import { n as simplifyOrFalse } from "./simplify-DDO0j0LI.js";
7
8
  //#region src/compile/postgrest.ts
@@ -1032,7 +1033,8 @@ function postgrestExecutor(client, options = {}) {
1032
1033
  const scoped = scope(client, context.schema);
1033
1034
  if (!scoped.rpc) return err(toDbError(/* @__PURE__ */ new Error("The client does not support rpc()")));
1034
1035
  if (context.signal?.aborted) return err(aborted());
1035
- const called = context.get ? scoped.rpc(name, queryArgs(args), { get: true }) : scoped.rpc(name, args);
1036
+ const encoded = encodeArguments(args);
1037
+ const called = context.get ? scoped.rpc(name, queryArgs(encoded), { get: true }) : scoped.rpc(name, encoded);
1036
1038
  const built = context.select ? called.select(context.select.map(({ column, cast }) => cast ? `${column}::${cast}` : column).join(",")) : called;
1037
1039
  const limit = deadline(context.signal, timeout);
1038
1040
  try {
@@ -1052,6 +1054,8 @@ function postgrestExecutor(client, options = {}) {
1052
1054
  /**
1053
1055
  * GET arguments travel in the query string, where supabase-js would print an
1054
1056
  * object as `[object Object]`; json and jsonb parameters take it as JSON.
1057
+ * `args` are already in wire form, so Temporal values arrive as plain text and
1058
+ * are not quoted a second time.
1055
1059
  */
1056
1060
  function queryArgs(args) {
1057
1061
  return Object.fromEntries(Object.entries(args).map(([key, value]) => [key, typeof value === "object" && value !== null && !Array.isArray(value) ? JSON.stringify(value) : value]));
@@ -2,9 +2,9 @@ import { f as Result } from "../result-DZeA5KS6.js";
2
2
  import { Bt as Executor } from "../types-DFdg_4yN.js";
3
3
  import { t as BlockTransport } from "../block-transport-DWZSJrwN.js";
4
4
  import { C as UploadRouteOptions, E as uploadRoute, S as UploadRoute, T as uploadOutcome, _ as UploadConnectorOptions, b as UploadOutcome, c as LocalTablesOption, d as CreateUploadRepository, f as CrudEntryLike, g as UploadConnector, h as RejectedStore, m as RejectedChange, n as DataEngine, p as CrudQueueLike, s as LiveEngineOptions, v as UploadErrorContext, w as createUploadConnector, x as UploadRepository, y as UploadFunction } from "../data-engine-BWoz9lED.js";
5
- import { n as TopicPort } from "../watch-topic-CG3kOX-D.js";
6
- import { t as AuthSnapshot } from "../bind-BwQGUqdQ.js";
7
- import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-_O-CqCPl.js";
5
+ import { n as TopicPort } from "../watch-topic-C6HhbnVz.js";
6
+ import { t as AuthSnapshot } from "../bind-CFsctoFJ.js";
7
+ import { C as quoteSqliteIdent, S as likeToGlob, _ as SqliteQuery, a as postgrestTimestamp, b as SqliteValue, c as sqliteCompiler, d as SqliteDecode, f as SqliteInsertPlan, g as SqlitePlan, h as SqliteNested, i as fromSqliteError, l as SqliteColumn, m as SqliteKeys, n as SqliteDatabaseLike, o as CheckSqliteOptions, p as SqliteKeyedPlan, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike, u as SqliteCompilerOptions, v as SqliteReturning, w as sqliteValue, x as compileSqlite, y as SqliteSelectPlan } from "../executor-aFV7nEBs.js";
8
8
  //#region src/powersync/sync.d.ts
9
9
  /** The part of PowerSync's `SyncStatus` the engine reads. */
10
10
  interface SyncStatusLike {
@@ -1,7 +1,7 @@
1
1
  import { n as dbError } from "../errors-BVFgt8BZ.js";
2
2
  import { a as ok, r as err } from "../result-ntFBW2p2.js";
3
3
  import { i as localEngine } from "../data-engine-D1BkmBoR.js";
4
- import { a as sqliteCompiler, c as quoteSqliteIdent, i as checkSqlite, l as sqliteValue, n as postgrestTimestamp, o as compileSqlite, r as sqliteExecutor, s as likeToGlob, t as fromSqliteError } from "../executor-BQ7dYw4E.js";
4
+ import { a as sqliteCompiler, c as quoteSqliteIdent, i as checkSqlite, l as sqliteValue, n as postgrestTimestamp, o as compileSqlite, r as sqliteExecutor, s as likeToGlob, t as fromSqliteError } from "../executor-WolvKszH.js";
5
5
  //#region src/powersync/executor.ts
6
6
  /**
7
7
  * Runs repository operations on PowerSync's local SQLite database, so the same
@@ -1,4 +1,4 @@
1
- import { Bn as PRESETS, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetValueInfo, _t as expandPreset, ai as DEFAULT_CONVENTIONS, bi as presetValueLabel, bt as PresetConflict, ci as Preset, di as PresetField, ei as PresetCatalog, er as APP_COLUMN_FORMATS, fi as PresetFieldKey, gi as PresetScope, gt as conventionConfig, hi as PresetPlatforms, ht as PresetInput, ii as CONVENTION_FIELDS, li as PresetAccess, mi as PresetFramework, mt as ExpandedConfig, ni as PresetCatalogManifest, oi as PRESET_FRAMEWORKS, pi as PresetFieldValue, pt as ConfigConventions, qn as namedPreset, ri as PresetGlueItem, si as PRESET_TENANT_NAMES, sr as AppColumnFormat, ti as PresetCatalogBlock, ui as PresetConventions, vi as integrationsForFramework, vt as presetConfig, wt as listNames, xt as PresetIntegration, yi as presetField, yt as presetOf, zn as NamedPreset } from "../context-CjHXhCck.js";
2
- import { A as presetAndDesignOf, C as designFileSource, D as encodeDesign, E as designSchema, F as safeDesignFileSource, I as safeParseDesign, L as appDefaultError, M as presetConfigSource, N as presetInstallCommand, O as isDesignCode, P as readDesignFile, R as isAppDefault, S as designConfig, T as designOf, _ as DesignParseResult, a as DesignChange, b as createUrl, c as diffAppTables, d as DESIGN_FILE, f as DESIGN_FORMAT, g as DesignParseIssue, h as DesignParseError, i as presetGlue, j as presetApplyCommand, k as parseDesign, l as diffDesigns, m as DesignFile, n as glueCommand, o as DesignChangeKind, p as DesignErrorCode, r as presetBlocksSource, s as DiffOptions, t as PROVIDER_COMMENT, u as CreateDesign, v as DesignTooLongError, w as designFormat, x as decodeDesign, y as MAX_DESIGN_CODE_LENGTH, z as PRESET_CATALOG } from "../index-CjnDGAJr.js";
3
- import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-oYkgtcRM.js";
4
- export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, CONVENTION_FIELDS, type ConfigConventions, type CreateDesign, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, type DesignChange, type DesignChangeKind, type DesignErrorCode, type DesignFile, DesignParseError, type DesignParseIssue, type DesignParseResult, DesignTooLongError, type DiffOptions, type ExpandedConfig, MAX_DESIGN_CODE_LENGTH, type NamedPreset, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, type Preset, type PresetAccess, type PresetCatalog, type PresetCatalogBlock, type PresetCatalogManifest, type PresetConflict, type PresetConventions, type PresetField, type PresetFieldKey, type PresetFieldValue, type PresetFramework, type PresetGlueItem, type PresetGroup, type PresetInput, type PresetIntegration, type PresetName, type PresetPlatforms, type PresetScope, type PresetSpec, type PresetValueInfo, type ResolvedPreset, type ResolvedPresetBlock, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
1
+ import { Bn as PRESETS, Ci as presetValueLabel, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, Si as presetField, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetFramework, _t as expandPreset, ai as PresetCatalogManifest, bi as PresetValueInfo, bt as PresetConflict, ci as DEFAULT_CONVENTIONS, di as Preset, ei as CORE_BLOCKS, er as APP_COLUMN_FORMATS, fi as PresetAccess, gi as PresetFieldValue, gt as conventionConfig, hi as PresetFieldKey, ht as PresetInput, ii as PresetCatalogBlock, li as PRESET_FRAMEWORKS, mi as PresetField, mt as ExpandedConfig, ni as instancePrefix, oi as PresetGlueItem, pi as PresetConventions, pt as ConfigConventions, qn as namedPreset, ri as PresetCatalog, si as CONVENTION_FIELDS, sr as AppColumnFormat, ti as INSTANCE_NAME, ui as PRESET_TENANT_NAMES, vi as PresetPlatforms, vt as presetConfig, wt as listNames, xi as integrationsForFramework, xt as PresetIntegration, yi as PresetScope, yt as presetOf, zn as NamedPreset } from "../context-DEisra3V.js";
2
+ import { $ as readDesignFile, A as DesignFile, B as designFileSource, C as diffAppTables, D as DESIGN_FILE, E as CreateDesign, F as MAX_DESIGN_CODE_LENGTH, G as isDesignCode, H as designOf, I as createQuery, J as presetApplyCommand, K as parseDesign, L as createUrl, M as DesignParseIssue, N as DesignParseResult, O as DESIGN_FORMAT, P as DesignTooLongError, Q as presetKey, R as decodeDesign, S as DiffOptions, T as CREATE_URL, U as designSchema, V as designFormat, W as encodeDesign, X as presetConfigSource, Y as presetArgumentOf, Z as presetInstallCommand, _ as glueCommand, a as blockRequires, b as DesignChange, c as installedBlocks, d as instancesOf, et as safeDesignFileSource, f as presetInstances, g as PROVIDER_COMMENT, h as withoutInstance, i as blockEntities, it as PRESET_CATALOG, j as DesignParseError, k as DesignErrorCode, l as instanceBlock, m as withInstance, n as BlockInstance, nt as appDefaultError, o as canAddInstance, p as withEntityName, q as presetAndDesignOf, r as PresetInstance, rt as isAppDefault, s as entityName, t as BlockEntity, tt as safeParseDesign, u as instanceNameProblem, v as presetBlocksSource, w as diffDesigns, x as DesignChangeKind, y as presetGlue, z as designConfig } from "../index-3p_oWttZ.js";
3
+ import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-BGzdnQm5.js";
4
+ export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, type BlockEntity, type BlockInstance, CONVENTION_FIELDS, CREATE_URL, type ConfigConventions, type CreateDesign, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, type DesignChange, type DesignChangeKind, type DesignErrorCode, type DesignFile, DesignParseError, type DesignParseIssue, type DesignParseResult, DesignTooLongError, type DiffOptions, type ExpandedConfig, INSTANCE_NAME, MAX_DESIGN_CODE_LENGTH, type NamedPreset, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, type Preset, type PresetAccess, type PresetCatalog, type PresetCatalogBlock, type PresetCatalogManifest, type PresetConflict, type PresetConventions, type PresetField, type PresetFieldKey, type PresetFieldValue, type PresetFramework, type PresetGlueItem, type PresetGroup, type PresetInput, type PresetInstance, type PresetIntegration, type PresetName, type PresetPlatforms, type PresetScope, type PresetSpec, type PresetValueInfo, type ResolvedPreset, type ResolvedPresetBlock, CORE_BLOCKS as SINGLE_INSTANCE_BLOCKS, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, blockEntities, blockRequires, canAddInstance, conventionConfig, createQuery, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, entityName, expandPreset, glueCommand, installedBlocks, instanceBlock, instanceNameProblem, instancePrefix, instancesOf, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetArgumentOf, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetInstances, presetKey, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
@@ -1,4 +1,4 @@
1
- import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-CD2OGfCG.js";
2
- import { E as PRESET_CATALOG, a as appIdentifierError, m as isAppDefault, n as APP_NAME_MAX, o as appNameLengthError, p as appDefaultError, s as appReservedColumns, x as APP_COLUMN_FORMATS } from "../app-tables-DyswUg6J.js";
3
- import { C as readDesignFile, D as glueCommand, E as PROVIDER_COMMENT, O as presetBlocksSource, S as presetInstallCommand, T as safeParseDesign, a as DesignParseError, b as presetApplyCommand, c as createUrl, d as designFileSource, f as designFormat, g as isDesignCode, h as encodeDesign, i as DESIGN_FORMAT, k as presetGlue, l as decodeDesign, m as designSchema, n as diffDesigns, o as DesignTooLongError, p as designOf, r as DESIGN_FILE, s as MAX_DESIGN_CODE_LENGTH, t as diffAppTables, u as designConfig, v as parseDesign, w as safeDesignFileSource, x as presetConfigSource, y as presetAndDesignOf } from "../preset-B3CukUhu.js";
4
- export { APP_COLUMN_FORMATS, APP_NAME_MAX, CONVENTION_FIELDS, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, DesignParseError, DesignTooLongError, MAX_DESIGN_CODE_LENGTH, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
1
+ import { C as integrationsForFramework, S as PRESET_TENANT_NAMES, T as presetValueLabel, _ as isPresetName, a as presetOf, b as DEFAULT_CONVENTIONS, c as presetSpec, d as resolvePreset, f as DEFAULT_PRESET_NAME, g as defaultPreset, h as PRESET_NAMES, i as presetConfig, l as listNames, m as PRESET_GROUPS, o as presetFromSpec, p as PRESETS, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as namedPreset, w as presetField, x as PRESET_FRAMEWORKS, y as CONVENTION_FIELDS } from "../config-C9AOcQ9S.js";
2
+ import { D as APP_COLUMN_FORMATS, M as PRESET_CATALOG, b as isAppDefault, c as APP_NAME_MAX, d as appIdentifierError, f as appNameLengthError, i as instancePrefix, n as INSTANCE_NAME, p as appReservedColumns, t as CORE_BLOCKS, y as appDefaultError } from "../instances-CK0jR3Pc.js";
3
+ import { A as isDesignCode, B as safeDesignFileSource, C as decodeDesign, D as designOf, E as designFormat, F as presetArgumentOf, G as presetGlue, H as PROVIDER_COMMENT, I as presetConfigSource, L as presetInstallCommand, M as parseDesign, N as presetAndDesignOf, O as designSchema, P as presetApplyCommand, R as presetKey, S as createUrl, T as designFileSource, U as glueCommand, V as safeParseDesign, W as presetBlocksSource, _ as DESIGN_FORMAT, a as installedBlocks, b as MAX_DESIGN_CODE_LENGTH, c as instancesOf, d as withInstance, f as withoutInstance, g as DESIGN_FILE, h as CREATE_URL, i as entityName, k as encodeDesign, l as presetInstances, m as diffDesigns, n as blockRequires, o as instanceBlock, p as diffAppTables, r as canAddInstance, s as instanceNameProblem, t as blockEntities, u as withEntityName, v as DesignParseError, w as designConfig, x as createQuery, y as DesignTooLongError, z as readDesignFile } from "../preset-CS490mYJ.js";
4
+ export { APP_COLUMN_FORMATS, APP_NAME_MAX, CONVENTION_FIELDS, CREATE_URL, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, DesignParseError, DesignTooLongError, INSTANCE_NAME, MAX_DESIGN_CODE_LENGTH, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, CORE_BLOCKS as SINGLE_INSTANCE_BLOCKS, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, blockEntities, blockRequires, canAddInstance, conventionConfig, createQuery, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, entityName, expandPreset, glueCommand, installedBlocks, instanceBlock, instanceNameProblem, instancePrefix, instancesOf, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetArgumentOf, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetInstances, presetKey, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
@@ -1,5 +1,5 @@
1
- import { M as groupEntries, a as presetOf, c as presetSpec, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-CD2OGfCG.js";
2
- import { E as PRESET_CATALOG, d as appTablesOf, k as asBlocksConfig } from "./app-tables-DyswUg6J.js";
1
+ import { M as groupEntries, a as presetOf, c as presetSpec, d as resolvePreset, g as defaultPreset, i as presetConfig, s as presetOfSpec } from "./config-C9AOcQ9S.js";
2
+ import { F as asBlocksConfig, M as PRESET_CATALOG, _ as appTablesOf, n as INSTANCE_NAME, t as CORE_BLOCKS } from "./instances-CK0jR3Pc.js";
3
3
  import { r as FIELD_FORMATS } from "./field-formats-C6QKA3UR.js";
4
4
  import { t as isSqlType } from "./sql-type-iUSZpaUu.js";
5
5
  //#region src/preset/render.ts
@@ -120,6 +120,7 @@ function glueCommand(items) {
120
120
  }
121
121
  //#endregion
122
122
  //#region src/preset/design.ts
123
+ /** Where Create links point. */
123
124
  const CREATE_URL = "https://app.bettersupabase.com/create";
124
125
  /**
125
126
  * The first character of a design code: how it is encoded. `0` is deflate-raw
@@ -516,14 +517,31 @@ function designConfig(resolved, design) {
516
517
  * design file (`designFileSource`) instead.
517
518
  */
518
519
  async function createUrl(resolved, design = {}) {
519
- const preset = presetSpec(resolved.preset);
520
+ return `${CREATE_URL}?${await createQuery(resolved.preset, design)}`;
521
+ }
522
+ /**
523
+ * The query `/create` and its routes read a selection from: `preset=<name>` for
524
+ * a named preset without a design, otherwise `design=<code>` with the preset
525
+ * inside the design. Throws a `DesignTooLongError` when the design is too long
526
+ * for a link.
527
+ */
528
+ async function createQuery(preset, design = {}) {
529
+ const spec = presetSpec(preset);
520
530
  const rest = withoutPreset(design);
521
- if (typeof preset === "string" && Object.keys(rest).length === 0) return `${CREATE_URL}?preset=${preset}`;
522
- return `${CREATE_URL}?design=${await encodeDesign({
531
+ if (typeof spec === "string" && Object.keys(rest).length === 0) return `preset=${spec}`;
532
+ return `design=${await encodeDesign({
523
533
  ...rest,
524
- preset
534
+ preset: spec
525
535
  })}`;
526
536
  }
537
+ /** The value `--preset` takes for a `createQuery`: the name, or the quoted URL. */
538
+ function presetArgumentOf(query) {
539
+ return query.startsWith("preset=") ? query.slice(7) : `"${CREATE_URL}?${query}"`;
540
+ }
541
+ /** A string that is equal for equal presets, for comparing selections. */
542
+ function presetKey(preset) {
543
+ return JSON.stringify(presetSpec(preset));
544
+ }
527
545
  /**
528
546
  * `better-supabase.config.ts` for a preset and an optional design: every block
529
547
  * with its reason, the conventions that differ from the defaults and the app
@@ -872,4 +890,158 @@ function diffDesigns(before, after) {
872
890
  return diffAppTables(before.appTables ?? {}, after.appTables ?? {});
873
891
  }
874
892
  //#endregion
875
- export { readDesignFile as C, glueCommand as D, PROVIDER_COMMENT as E, presetBlocksSource as O, presetInstallCommand as S, safeParseDesign as T, jsonPointer as _, DesignParseError as a, presetApplyCommand as b, createUrl as c, designFileSource as d, designFormat as f, isDesignCode as g, encodeDesign as h, DESIGN_FORMAT as i, presetGlue as k, decodeDesign as l, designSchema as m, diffDesigns as n, DesignTooLongError as o, designOf as p, DESIGN_FILE as r, MAX_DESIGN_CODE_LENGTH as s, diffAppTables as t, designConfig as u, parseDesign as v, safeDesignFileSource as w, presetConfigSource as x, presetAndDesignOf as y };
893
+ //#region src/preset/instances.ts
894
+ /** Whether a preset can install `block` a second time, under another name. */
895
+ function canAddInstance(block) {
896
+ return !CORE_BLOCKS.has(block);
897
+ }
898
+ /**
899
+ * What `block` requires, at every access level: the dependencies `uses` must
900
+ * name.
901
+ */
902
+ function blockRequires(block, catalog = PRESET_CATALOG) {
903
+ const entry = catalog.blocks.find((each) => each.name === block);
904
+ return [.../* @__PURE__ */ new Set([...entry?.requires ?? [], ...Object.values(entry?.requiresByAccess ?? {}).flat()])];
905
+ }
906
+ /** The blocks a preset installs, by name. */
907
+ function installedBlocks(preset) {
908
+ return new Set(resolvePreset(preset).blocks.map((block) => block.name));
909
+ }
910
+ const ENTITIES = new Map(PRESET_CATALOG.blocks.map((block) => [block.name, Object.entries(block.entities?.specs ?? {}).flatMap(([key, spec]) => spec.table === void 0 || spec.global === true ? [] : [{
911
+ key,
912
+ table: spec.table,
913
+ singular: spec.singular,
914
+ required: spec.primary === true || spec.subject !== void 0
915
+ }])]));
916
+ /**
917
+ * The entities `block` lets an instance rename; the tenant is renamed by
918
+ * `tenantName`.
919
+ */
920
+ function blockEntities(block) {
921
+ return ENTITIES.get(block) ?? [];
922
+ }
923
+ /** The block `instance` installs. */
924
+ function instanceBlock(preset, instance) {
925
+ return preset.instances?.[instance]?.block ?? instance;
926
+ }
927
+ /**
928
+ * Every instance the preset installs: each installed block under its own name,
929
+ * then each `instances` entry that installs a block under another name.
930
+ */
931
+ function presetInstances(preset) {
932
+ return [...resolvePreset(preset).blocks.map(({ name }) => ({
933
+ name,
934
+ block: name
935
+ })), ...Object.entries(preset.instances ?? {}).flatMap(([name, instance]) => {
936
+ const block = instance.block ?? name;
937
+ return block === name ? [] : [{
938
+ name,
939
+ block
940
+ }];
941
+ })];
942
+ }
943
+ /** The instances of `block`, its own one first when the preset selects it. */
944
+ function instancesOf(preset, block) {
945
+ return presetInstances(preset).filter((each) => each.block === block);
946
+ }
947
+ /** The name `instance` gives `entity`, or undefined when it keeps the default. */
948
+ function entityName(preset, instance, entity) {
949
+ return preset.instances?.[instance]?.names?.[entity];
950
+ }
951
+ function withInstances(preset, instances) {
952
+ if (Object.keys(instances).length > 0) return {
953
+ ...preset,
954
+ instances
955
+ };
956
+ const { instances: _instances, ...rest } = preset;
957
+ return rest;
958
+ }
959
+ /** An instance without its empty `names`, `uses` or `on`. */
960
+ function compact(instance) {
961
+ const { names, uses, on, ...rest } = instance;
962
+ return {
963
+ ...rest,
964
+ ...names === void 0 || Object.keys(names).length === 0 ? {} : { names },
965
+ ...uses === void 0 || Object.keys(uses).length === 0 ? {} : { uses },
966
+ ...on === void 0 || (Array.isArray(on) ? on.length === 0 : Object.keys(on).length === 0) ? {} : { on }
967
+ };
968
+ }
969
+ /**
970
+ * The preset with `instance` naming `entity` `name`; undefined, or the entity's
971
+ * default, goes back to the default. An entry left empty is dropped.
972
+ */
973
+ function withEntityName(preset, instance, entity, name) {
974
+ const fallback = blockEntities(instanceBlock(preset, instance)).find((each) => each.key === entity)?.singular;
975
+ const current = preset.instances?.[instance] ?? {};
976
+ const { [entity]: _previous, ...names } = current.names ?? {};
977
+ const next = compact({
978
+ ...current,
979
+ names: name === void 0 || name === fallback ? names : {
980
+ ...names,
981
+ [entity]: name
982
+ }
983
+ });
984
+ const { [instance]: _instance, ...others } = preset.instances ?? {};
985
+ return withInstances(preset, Object.keys(next).length === 0 ? others : {
986
+ ...others,
987
+ [instance]: next
988
+ });
989
+ }
990
+ /** Why `name` can't name a new instance, or undefined when it can. */
991
+ function instanceNameProblem(preset, name) {
992
+ if (!INSTANCE_NAME.test(name)) return "Start with a lowercase letter, then use letters, digits and hyphens.";
993
+ if (PRESET_CATALOG.blocks.some((block) => block.name === name)) return `"${name}" is a block name. Choose another name.`;
994
+ if (presetInstances(preset).some((each) => each.name === name)) return `"${name}" is already an instance. Choose another name.`;
995
+ }
996
+ /**
997
+ * The preset with `name` set to `instance`: a new instance, or new settings for
998
+ * one already there. `instance.block` defaults to `name`.
999
+ */
1000
+ function withInstance(preset, name, instance) {
1001
+ const block = instance.block ?? name;
1002
+ const existing = instancesOf(preset, block).filter((each) => each.name !== name);
1003
+ const next = withInstances(preset, {
1004
+ ...preset.instances,
1005
+ [name]: compact(instance)
1006
+ });
1007
+ const [first] = existing;
1008
+ return existing.length === 1 && first !== void 0 ? pinDependents(next, block, first.name, name) : next;
1009
+ }
1010
+ /**
1011
+ * Keeps the instances that required `block` on `target`, its only instance
1012
+ * until `added` joined it, so a second instance changes nothing they read.
1013
+ */
1014
+ function pinDependents(preset, block, target, added) {
1015
+ const instances = { ...preset.instances };
1016
+ for (const each of presetInstances(preset)) {
1017
+ const entry = instances[each.name] ?? {};
1018
+ if (each.name !== added && blockRequires(each.block).includes(block) && entry.uses?.[block] === void 0) instances[each.name] = {
1019
+ ...entry,
1020
+ uses: {
1021
+ ...entry.uses,
1022
+ [block]: target
1023
+ }
1024
+ };
1025
+ }
1026
+ return withInstances(preset, instances);
1027
+ }
1028
+ /**
1029
+ * The preset without the instance `name`: its entry, the `uses` entries of
1030
+ * other instances that pointed at it, and the ones a dependency left with one
1031
+ * instance no longer needs. A block's own instance is removed by deselecting
1032
+ * the block instead.
1033
+ */
1034
+ function withoutInstance(preset, name) {
1035
+ const { [name]: _removed, ...rest } = preset.instances ?? {};
1036
+ const remaining = presetInstances(withInstances(preset, rest));
1037
+ const single = (dependency) => remaining.filter((each) => each.block === dependency).length === 1;
1038
+ return withInstances(preset, Object.fromEntries(Object.entries(rest).flatMap(([key, instance]) => {
1039
+ const kept = compact({
1040
+ ...instance,
1041
+ uses: Object.fromEntries(Object.entries(instance.uses ?? {}).filter(([dependency, target]) => target !== name && !(target === dependency && single(dependency))))
1042
+ });
1043
+ return Object.keys(kept).length === 0 ? [] : [[key, kept]];
1044
+ })));
1045
+ }
1046
+ //#endregion
1047
+ export { isDesignCode as A, safeDesignFileSource as B, decodeDesign as C, designOf as D, designFormat as E, presetArgumentOf as F, presetGlue as G, PROVIDER_COMMENT as H, presetConfigSource as I, presetInstallCommand as L, parseDesign as M, presetAndDesignOf as N, designSchema as O, presetApplyCommand as P, presetKey as R, createUrl as S, designFileSource as T, glueCommand as U, safeParseDesign as V, presetBlocksSource as W, DESIGN_FORMAT as _, installedBlocks as a, MAX_DESIGN_CODE_LENGTH as b, instancesOf as c, withInstance as d, withoutInstance as f, DESIGN_FILE as g, CREATE_URL as h, entityName as i, jsonPointer as j, encodeDesign as k, presetInstances as l, diffDesigns as m, blockRequires as n, instanceBlock as o, diffAppTables as p, canAddInstance as r, instanceNameProblem as s, blockEntities as t, withEntityName as u, DesignParseError as v, designConfig as w, createQuery as x, DesignTooLongError as y, readDesignFile as z };