better-supabase 0.54.0 → 0.55.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 (442) hide show
  1. package/dist/{agents-DcZk8HBB.d.ts → agents-CBXJce8J.d.ts} +2 -2
  2. package/dist/{ai-schedules-b-uWaxba.d.ts → ai-schedules-CtwkMJDZ.d.ts} +1 -1
  3. package/dist/ai-sdk/agents/index.d.ts +1 -1
  4. package/dist/ai-sdk/workflow/index.d.ts +1 -1
  5. package/dist/{app-tables-B2xNMyLA.d.ts → app-tables-BsDmauWB.d.ts} +1 -1
  6. package/dist/{audit-actions-Dni5Y4wV.d.ts → audit-actions-DC-AtyWB.d.ts} +6 -0
  7. package/dist/{authorization-Bk6cLL5f.d.ts → authorization-DK7YSiFV.d.ts} +1 -1
  8. package/dist/{automations-CjKWYzIu.js → automations-Cu1KdCvL.js} +3 -1
  9. package/dist/{bind-DWElQa6I.d.ts → bind-DiGmjHzz.d.ts} +4 -4
  10. package/dist/{block-env-CQQUMPYZ.d.ts → block-env-BTKZBCL4.d.ts} +4 -4
  11. package/dist/{block-subjects-9KU6Q6-3.js → block-subjects-BoJrJAgR.js} +3 -2
  12. package/dist/{block-tables-JC1dMLaA.d.ts → block-tables-B6Jt0mWg.d.ts} +1 -1
  13. package/dist/blocks/access-requests/index.d.ts +1 -1
  14. package/dist/blocks/accounting/index.d.ts +1 -1
  15. package/dist/blocks/acknowledgements/index.d.ts +1 -1
  16. package/dist/blocks/activities/index.d.ts +2 -2
  17. package/dist/blocks/advisories/index.d.ts +1 -1
  18. package/dist/blocks/agent-checkout/index.d.ts +1 -1
  19. package/dist/blocks/agents/index.d.ts +1 -1
  20. package/dist/blocks/ai-cache/index.d.ts +1 -1
  21. package/dist/blocks/ai-chat/index.d.ts +1 -1
  22. package/dist/blocks/ai-evals/index.d.ts +1 -1
  23. package/dist/blocks/ai-files/index.d.ts +1 -1
  24. package/dist/blocks/ai-guardrails/index.d.ts +1 -1
  25. package/dist/blocks/ai-keys/index.d.ts +1 -1
  26. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  27. package/dist/blocks/announcements/index.d.ts +4 -4
  28. package/dist/blocks/api-keys/index.d.ts +1 -1
  29. package/dist/blocks/appraisals/index.d.ts +1 -1
  30. package/dist/blocks/approvals/index.d.ts +1 -1
  31. package/dist/blocks/assets/index.d.ts +2 -2
  32. package/dist/blocks/assignment/index.d.ts +1 -1
  33. package/dist/blocks/attachments/index.d.ts +5 -5
  34. package/dist/blocks/audit/index.d.ts +2 -2
  35. package/dist/blocks/automations/index.d.ts +3 -3
  36. package/dist/blocks/banking/index.d.ts +1 -1
  37. package/dist/blocks/billable-time/index.d.ts +1 -1
  38. package/dist/blocks/billing/index.d.ts +2 -2
  39. package/dist/blocks/bookings/index.d.ts +2 -2
  40. package/dist/blocks/bulk/index.d.ts +1 -1
  41. package/dist/blocks/calendar/index.d.ts +3 -3
  42. package/dist/blocks/care/index.d.ts +27 -27
  43. package/dist/blocks/care-plans/index.d.ts +3 -3
  44. package/dist/blocks/cases/index.d.ts +3 -3
  45. package/dist/blocks/catalog/index.d.ts +2 -2
  46. package/dist/blocks/channels/index.d.ts +1 -1
  47. package/dist/blocks/clinical-decision-support/index.d.ts +1 -1
  48. package/dist/blocks/cms/index.d.ts +5 -5
  49. package/dist/blocks/collaboration/index.d.ts +6 -6
  50. package/dist/blocks/collections/index.d.ts +1 -1
  51. package/dist/blocks/comments/index.d.ts +2 -2
  52. package/dist/blocks/commerce/index.d.ts +5 -5
  53. package/dist/blocks/commerce/index.js +2 -2
  54. package/dist/blocks/commissions/index.d.ts +1 -1
  55. package/dist/blocks/compliance/index.d.ts +1 -1
  56. package/dist/blocks/connectors/index.d.ts +1 -1
  57. package/dist/blocks/consents/index.d.ts +2 -2
  58. package/dist/blocks/contacts/index.d.ts +2 -2
  59. package/dist/blocks/content/index.d.ts +2 -2
  60. package/dist/blocks/contracts/index.d.ts +1 -1
  61. package/dist/blocks/courses/index.d.ts +3 -3
  62. package/dist/blocks/created-by/index.d.ts +2 -2
  63. package/dist/blocks/crm/index.d.ts +16 -16
  64. package/dist/blocks/crm/index.js +2 -2
  65. package/dist/blocks/custom-fields/index.d.ts +1 -1
  66. package/dist/blocks/dam/index.d.ts +2 -2
  67. package/dist/blocks/data-lifecycle/index.d.ts +2 -2
  68. package/dist/blocks/deadlines/index.d.ts +1 -1
  69. package/dist/blocks/deals/index.d.ts +1 -1
  70. package/dist/blocks/dispatch/index.d.ts +2 -2
  71. package/dist/blocks/document-templates/index.d.ts +2 -2
  72. package/dist/blocks/documents/index.d.ts +1 -1
  73. package/dist/blocks/domains/index.d.ts +1 -1
  74. package/dist/blocks/donations/index.d.ts +1 -1
  75. package/dist/blocks/drive/index.d.ts +5 -5
  76. package/dist/blocks/e-prescribing/index.d.ts +1 -1
  77. package/dist/blocks/employees/index.d.ts +1 -1
  78. package/dist/blocks/enrichment/index.d.ts +1 -1
  79. package/dist/blocks/enrollments/index.d.ts +2 -2
  80. package/dist/blocks/entitlements/index.d.ts +3 -3
  81. package/dist/blocks/events/index.d.ts +3 -3
  82. package/dist/blocks/expenses/index.d.ts +1 -1
  83. package/dist/blocks/field-history/index.d.ts +1 -1
  84. package/dist/blocks/filespace/index.d.ts +8 -8
  85. package/dist/blocks/finance/index.d.ts +5 -5
  86. package/dist/blocks/finance/index.js +1 -1
  87. package/dist/blocks/flags/index.d.ts +1 -1
  88. package/dist/blocks/forecasts/index.d.ts +1 -1
  89. package/dist/blocks/forms/index.d.ts +3 -3
  90. package/dist/blocks/funding/index.d.ts +2 -2
  91. package/dist/blocks/goals/index.d.ts +1 -1
  92. package/dist/blocks/governance/index.d.ts +4 -4
  93. package/dist/blocks/guests/index.d.ts +1 -1
  94. package/dist/blocks/hiring/index.d.ts +1 -1
  95. package/dist/blocks/identities/index.d.ts +1 -1
  96. package/dist/blocks/imports/index.d.ts +2 -2
  97. package/dist/blocks/inbox/index.d.ts +6 -6
  98. package/dist/blocks/incidents/index.d.ts +1 -1
  99. package/dist/blocks/index.d.ts +4 -4
  100. package/dist/blocks/inspections/index.d.ts +2 -2
  101. package/dist/blocks/inventory/index.d.ts +1 -1
  102. package/dist/blocks/inventory/index.js +1 -1
  103. package/dist/blocks/invoices/index.d.ts +1 -1
  104. package/dist/blocks/invoices/index.js +1 -1
  105. package/dist/blocks/knowledge/index.d.ts +1 -1
  106. package/dist/blocks/lead-scoring/index.d.ts +2 -2
  107. package/dist/blocks/learning/index.d.ts +3 -3
  108. package/dist/blocks/leases/index.d.ts +1 -1
  109. package/dist/blocks/leave/index.d.ts +1 -1
  110. package/dist/blocks/ledger/index.d.ts +1 -1
  111. package/dist/blocks/legal-entities/index.d.ts +2 -2
  112. package/dist/blocks/lims/index.d.ts +2 -2
  113. package/dist/blocks/mail-sync/index.d.ts +3 -3
  114. package/dist/blocks/maintenance/index.d.ts +2 -2
  115. package/dist/blocks/manufacturing/index.d.ts +2 -2
  116. package/dist/blocks/medications/index.d.ts +1 -1
  117. package/dist/blocks/meetings/index.d.ts +3 -3
  118. package/dist/blocks/memberships/index.d.ts +2 -2
  119. package/dist/blocks/memory/index.d.ts +1 -1
  120. package/dist/blocks/messaging/index.d.ts +5 -5
  121. package/dist/blocks/metrics/index.d.ts +1 -1
  122. package/dist/blocks/mfa/index.d.ts +2 -2
  123. package/dist/blocks/moderation/index.d.ts +2 -2
  124. package/dist/blocks/notifications/index.d.ts +5 -5
  125. package/dist/blocks/numbering/index.d.ts +1 -1
  126. package/dist/blocks/oauth-server/index.d.ts +1 -1
  127. package/dist/blocks/observations/index.d.ts +2 -2
  128. package/dist/blocks/onboarding/index.d.ts +2 -2
  129. package/dist/blocks/option-sets/index.d.ts +2 -2
  130. package/dist/blocks/orders/index.d.ts +1 -1
  131. package/dist/blocks/orders/index.js +1 -1
  132. package/dist/blocks/organizations/index.d.ts +2 -2
  133. package/dist/blocks/outbox/index.d.ts +1 -1
  134. package/dist/blocks/passes/index.d.ts +2 -2
  135. package/dist/blocks/payroll-export/index.d.ts +2 -2
  136. package/dist/blocks/payroll-export/index.js +1 -1
  137. package/dist/blocks/people/index.d.ts +7 -7
  138. package/dist/blocks/people/index.js +1 -1
  139. package/dist/blocks/periods/index.d.ts +1 -1
  140. package/dist/blocks/permissions/index.d.ts +3 -3
  141. package/dist/blocks/pipelines/index.d.ts +1 -1
  142. package/dist/blocks/posts/index.d.ts +2 -2
  143. package/dist/blocks/procurement/index.d.ts +5 -5
  144. package/dist/blocks/procurement/index.js +2 -2
  145. package/dist/blocks/profiles/index.d.ts +1 -1
  146. package/dist/blocks/projects/index.d.ts +7 -7
  147. package/dist/blocks/projects/index.js +2 -2
  148. package/dist/blocks/promotions/index.d.ts +1 -1
  149. package/dist/blocks/prompts/index.d.ts +1 -1
  150. package/dist/blocks/push/index.d.ts +2 -2
  151. package/dist/blocks/qualifications/index.d.ts +2 -2
  152. package/dist/blocks/queue/index.d.ts +2 -2
  153. package/dist/blocks/quotes/index.d.ts +1 -1
  154. package/dist/blocks/quotes/index.js +2 -2
  155. package/dist/blocks/rank/index.d.ts +1 -1
  156. package/dist/blocks/reactions/index.d.ts +4 -4
  157. package/dist/blocks/recruiting/index.d.ts +4 -4
  158. package/dist/blocks/referrals/index.d.ts +1 -1
  159. package/dist/blocks/relations/index.d.ts +1 -1
  160. package/dist/blocks/reminders/index.d.ts +1 -1
  161. package/dist/blocks/reviews/index.d.ts +1 -1
  162. package/dist/blocks/rfqs/index.d.ts +2 -2
  163. package/dist/blocks/risks/index.d.ts +2 -2
  164. package/dist/blocks/saas/index.d.ts +12 -12
  165. package/dist/blocks/sales/index.d.ts +1 -1
  166. package/dist/blocks/sales/index.js +1 -1
  167. package/dist/blocks/saved-views/index.d.ts +2 -2
  168. package/dist/blocks/scheduling/index.d.ts +4 -4
  169. package/dist/blocks/scores/index.d.ts +2 -2
  170. package/dist/blocks/search/index.d.ts +3 -3
  171. package/dist/blocks/security-events/index.d.ts +1 -1
  172. package/dist/blocks/segments/index.d.ts +2 -2
  173. package/dist/blocks/sequences/index.d.ts +3 -3
  174. package/dist/blocks/service/index.d.ts +7 -7
  175. package/dist/blocks/service/index.js +1 -1
  176. package/dist/blocks/service-accounts/index.d.ts +1 -1
  177. package/dist/blocks/sessions/index.d.ts +2 -2
  178. package/dist/blocks/settings/index.d.ts +2 -2
  179. package/dist/blocks/share-links/index.d.ts +1 -1
  180. package/dist/blocks/shifts/index.d.ts +2 -2
  181. package/dist/blocks/shipments/index.d.ts +2 -2
  182. package/dist/blocks/signatures/index.d.ts +2 -2
  183. package/dist/blocks/signing-keys/index.d.ts +1 -1
  184. package/dist/blocks/sla/index.d.ts +1 -1
  185. package/dist/blocks/sso/index.d.ts +1 -1
  186. package/dist/blocks/state-machine/index.d.ts +1 -1
  187. package/dist/blocks/subjects/index.d.ts +2 -2
  188. package/dist/blocks/support/index.d.ts +5 -5
  189. package/dist/blocks/support/index.js +1 -1
  190. package/dist/blocks/tags/index.d.ts +2 -2
  191. package/dist/blocks/tasks/index.d.ts +2 -2
  192. package/dist/blocks/tasks/index.js +1 -1
  193. package/dist/blocks/tax/index.d.ts +2 -2
  194. package/dist/blocks/teams/index.d.ts +1 -1
  195. package/dist/blocks/templates/index.d.ts +11 -1
  196. package/dist/blocks/templates/index.js +6 -1
  197. package/dist/blocks/tills/index.d.ts +1 -1
  198. package/dist/blocks/time-tracking/index.d.ts +2 -2
  199. package/dist/blocks/timeline/index.d.ts +1 -1
  200. package/dist/blocks/trash/index.d.ts +1 -1
  201. package/dist/blocks/undo/index.d.ts +2 -2
  202. package/dist/blocks/updated-at/index.d.ts +2 -2
  203. package/dist/blocks/usage/index.d.ts +2 -2
  204. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  205. package/dist/blocks/versions/index.d.ts +1 -1
  206. package/dist/blocks/waitlist/index.d.ts +1 -1
  207. package/dist/blocks/warehouse/index.d.ts +1 -1
  208. package/dist/blocks/webhooks/index.d.ts +1 -1
  209. package/dist/blocks/workflow-editor/index.d.ts +4 -4
  210. package/dist/blocks/workflows/index.d.ts +4 -4
  211. package/dist/{blocks-LZklPzC5.d.ts → blocks-2HFgUcqG.d.ts} +52 -17
  212. package/dist/claims/index.d.ts +3 -3
  213. package/dist/cli/{add-DK38-F2F.js → add-BnYh-Kpy.js} +12 -12
  214. package/dist/cli/add-D0TUMxXn.js +1 -0
  215. package/dist/cli/{add-BQZbFEAP.js → add-LvxZ-JNB.js} +2 -2
  216. package/dist/cli/{app-table-files-C5Sx2Qao.js → app-table-files-7M0I9LaE.js} +3 -3
  217. package/dist/cli/{app-tables-ChZE8Z_L.js → app-tables-BfWPWiOJ.js} +2 -2
  218. package/dist/cli/{backfill-COnv2tOL.js → backfill-i0Tx24Sa.js} +3 -3
  219. package/dist/cli/bin.js +1 -1
  220. package/dist/cli/{blocks-Dea_Z5Ps.js → blocks-C_7ioBdJ.js} +1 -1
  221. package/dist/cli/{blocks-Csu6lLqC.js → blocks-X_eD_t_f.js} +1 -1
  222. package/dist/cli/{cache-C1nAFZNW.js → cache-D98rjB1C.js} +1 -1
  223. package/dist/cli/{codemod-DHULUpez.js → codemod-j1nCkgA5.js} +1 -1
  224. package/dist/cli/{config-FN5Cp861.js → config-DdkxiGjH.js} +7 -0
  225. package/dist/cli/{config-U32Vo0h6.js → config-DmjFp8jY.js} +1 -1
  226. package/dist/cli/{content-mapper-QVJJto5U.js → content-mapper-UsLt4y0J.js} +2 -2
  227. package/dist/cli/{db-T8u160uM.js → db-B54TQ_iX.js} +2 -2
  228. package/dist/cli/{doctor-Du2zwLUG.js → doctor-BYJM72wi.js} +17 -17
  229. package/dist/cli/{gen-CQ2ubqjB.js → gen-D47t5jj3.js} +14 -14
  230. package/dist/cli/index.d.ts +1 -1
  231. package/dist/cli/index.js +7 -7
  232. package/dist/cli/{init-CTt0aQn1.js → init-CAWeLXCs.js} +10 -10
  233. package/dist/cli/{live-DMNuAml9.js → live-DNd8MMNk.js} +2 -2
  234. package/dist/cli/{mcp-C63ulwyU.js → mcp-BUs7M6fq.js} +2 -2
  235. package/dist/cli/{metadata-CylES-9Y.js → metadata-UwEYCntC.js} +3 -3
  236. package/dist/cli/{migrate-BezKva56.js → migrate-D-GzXR4D.js} +1 -1
  237. package/dist/cli/{migration-safety-DQtpMu-g.js → migration-safety-Cg9jf2s-.js} +2 -2
  238. package/dist/cli/{migrations-DGJJ1rHt.js → migrations-Bhcf7MHM.js} +2 -2
  239. package/dist/cli/{module-migration-CxbEDfSF.js → module-migration-BJaOdOWy.js} +2 -2
  240. package/dist/cli/powersync-Bn-u0TGP.js +1 -0
  241. package/dist/cli/{powersync-FUYFuZSw.js → powersync-DQKdjG_K.js} +3 -3
  242. package/dist/cli/{print-DAwLAC-7.js → print-B1onZWRG.js} +2 -2
  243. package/dist/cli/{providers-hrxX3YKU.js → providers-M7s8btf1.js} +1 -1
  244. package/dist/cli/{prune-workflows-DLhKu_UJ.js → prune-workflows-BiRF1YBZ.js} +3 -3
  245. package/dist/cli/{remove-DSC6Fvwo.js → remove-BHyzqWNm.js} +6 -6
  246. package/dist/cli/{render-647qdnrX.js → render-DDCy_0V_.js} +4 -4
  247. package/dist/cli/{run-BcI6KXV3.js → run-Csm1-Uto.js} +35 -35
  248. package/dist/cli/{run--qaDaqfL.js → run-DDUBMkbN.js} +9 -9
  249. package/dist/cli/seed-BxjjQ3OO.js +1 -0
  250. package/dist/cli/{seed-BgpovbwF.js → seed-kCLEYSOH.js} +2 -2
  251. package/dist/cli/{shared-D_DZ9MfG.js → shared-Cv22MEAO.js} +1 -1
  252. package/dist/cli/{snapshot-B-1tPbV4.js → snapshot-9xnSt525.js} +3 -3
  253. package/dist/cli/{source-BgFNrRcl.js → source-B_miugrh.js} +1 -1
  254. package/dist/cli/{source-args-DC8snM7e.js → source-args-C3_mMci3.js} +1 -1
  255. package/dist/cli/{spec-C88dtkj4.js → spec-BeAgQ-of.js} +1 -1
  256. package/dist/cli/{spec-CV0FdW18.js → spec-dYLJbr9J.js} +2 -2
  257. package/dist/cli/{sql-layout-byUur5FC.js → sql-layout-3YU4941N.js} +2 -2
  258. package/dist/cli/{sync-BtM7o-sI.js → sync-Bfwk4Ldc.js} +4 -4
  259. package/dist/cli/{upgrade-CKDeHkyy.js → upgrade-BMrkzAcD.js} +5 -5
  260. package/dist/cli/{upgrade-B_HEJvRX.js → upgrade-DRvMFW2T.js} +2 -2
  261. package/dist/cli/{version-DWDoiP5_.js → version-BXjNETWS.js} +1 -1
  262. package/dist/client/index.d.ts +6 -6
  263. package/dist/client/native/index.d.ts +4 -4
  264. package/dist/config/index.d.ts +4 -4
  265. package/dist/config/index.js +4 -4
  266. package/dist/{config-LOwFAFpo.js → config-CsX2THwJ.js} +3 -3
  267. package/dist/{config-ekflaCnS.js → config-Dgl6AxKE.js} +1 -1
  268. package/dist/{context-iduX3Fsn.d.ts → context-DSJpfeVv.d.ts} +47 -4
  269. package/dist/contract/index.d.ts +3 -3
  270. package/dist/{contributions-DPjEWWpE.js → contributions-olp7tVYC.js} +11 -0
  271. package/dist/{controller-DFGNChQL.d.ts → controller-BVee4yX8.d.ts} +1 -1
  272. package/dist/{conversion-DTBB0Zgt.d.ts → conversion-BPkWkVoa.d.ts} +1 -1
  273. package/dist/create/index.d.ts +4 -4
  274. package/dist/create/index.js +3 -3
  275. package/dist/create/lite/index.d.ts +3 -3
  276. package/dist/create/lite/index.js +2 -2
  277. package/dist/{data-engine-BKO5EAzN.d.ts → data-engine-0uVsKWaB.d.ts} +7 -3
  278. package/dist/{define-block-By-LUpM_.d.ts → define-block-Cu67KCN1.d.ts} +1 -1
  279. package/dist/{drive-CuNG4qB8.d.ts → drive-D008IDpI.d.ts} +1 -1
  280. package/dist/{entitlements-Go8BHqhr.d.ts → entitlements-CRBZg5y2.d.ts} +1 -1
  281. package/dist/{extract-DQKHxiiq.d.ts → extract-BU5w3k5s.d.ts} +1 -1
  282. package/dist/{field-errors-B4SMTk2e.d.ts → field-errors-CjEgbjO9.d.ts} +6 -6
  283. package/dist/{index-NqLuAXG3.d.ts → index--7HXH_H_.d.ts} +2 -2
  284. package/dist/{index-BvwlIGwY.d.ts → index-AmPcMT_X.d.ts} +1 -1
  285. package/dist/{index-DfJFbsVp.d.ts → index-BDn4Mqq0.d.ts} +1 -1
  286. package/dist/{index-DeE-Xuv7.d.ts → index-BOZ6AsMs.d.ts} +1 -1
  287. package/dist/{index-BkBNirhK.d.ts → index-BR8ZkijS.d.ts} +2 -2
  288. package/dist/{index-DzjugbCf.d.ts → index-BTl5A8Aj.d.ts} +2 -2
  289. package/dist/{index-BmKtYKwN.d.ts → index-BVJsz3pS.d.ts} +2 -2
  290. package/dist/{index-CTHuTJtf.d.ts → index-BeU2DRAI.d.ts} +1 -1
  291. package/dist/{index-DkNMN5uU.d.ts → index-BleHtlJ6.d.ts} +1 -1
  292. package/dist/{index-ROumUag2.d.ts → index-BoCyVsCr.d.ts} +1 -1
  293. package/dist/{index-DgRK-iM3.d.ts → index-BvPirjfD.d.ts} +4 -4
  294. package/dist/{index-pRdO2XnG.d.ts → index-CDEzb5bl.d.ts} +1 -1
  295. package/dist/{index-D-bMFoGs.d.ts → index-CKdNndE3.d.ts} +2 -2
  296. package/dist/{index-B8axasMg.d.ts → index-CaW37FHZ.d.ts} +1 -1
  297. package/dist/{index-DJyt9j86.d.ts → index-ChaJiMkI.d.ts} +2 -2
  298. package/dist/{index-9zNFFq6E.d.ts → index-D-3fZP5z.d.ts} +1 -1
  299. package/dist/{index-szXZSILq.d.ts → index-D5nY5k-2.d.ts} +7 -7
  300. package/dist/{index-D7FXhn2i.d.ts → index-D7zwaGAP.d.ts} +1 -1
  301. package/dist/{index-DkJtM-9e.d.ts → index-DDDHYXtr.d.ts} +9 -9
  302. package/dist/{index-DFdqVxv6.d.ts → index-DJ1Uk4ff.d.ts} +4 -4
  303. package/dist/{index-BKWnyAWN.d.ts → index-DR4P3Lf9.d.ts} +2 -2
  304. package/dist/{index-BoKvWo8t.d.ts → index-DYzQ_PPW.d.ts} +1 -1
  305. package/dist/{index-abVPYQE3.d.ts → index-DZRsTCds.d.ts} +1 -1
  306. package/dist/{index-D9Sb8Ju5.d.ts → index-DhS8Qkgj.d.ts} +3 -3
  307. package/dist/{index-YZ-_hzdR.d.ts → index-DsA7MQwZ.d.ts} +1 -1
  308. package/dist/{index-bJVAgXxw.d.ts → index-DtMdKIJU.d.ts} +2 -2
  309. package/dist/{index-BXRyr3ey.d.ts → index-Dyq6B4gZ.d.ts} +2 -2
  310. package/dist/{index-D337YzjX.d.ts → index-E_Q5L9PV.d.ts} +1 -1
  311. package/dist/{index-DXoS8BnK.d.ts → index-JzAR_Y7n.d.ts} +3 -3
  312. package/dist/{index-D4ke5U0m.d.ts → index-_RnZChF8.d.ts} +1 -1
  313. package/dist/{index-DkNLdcX_.d.ts → index-_wr8wCe9.d.ts} +1 -1
  314. package/dist/{index-20EPlFXG.d.ts → index-dMGEJLxl.d.ts} +1 -1
  315. package/dist/{index-DQVQYEhP.d.ts → index-ilxdL8pz.d.ts} +1 -1
  316. package/dist/{index-DlXgoerO.d.ts → index-r3QZBY7z.d.ts} +1 -1
  317. package/dist/{index-Bsd8P1iQ.d.ts → index-slG4UpF_.d.ts} +2 -2
  318. package/dist/{index-C1kImKZg.d.ts → index-u8EXkOzJ.d.ts} +1 -1
  319. package/dist/{index-Dg35ugqv.d.ts → index-voglIa16.d.ts} +4 -4
  320. package/dist/{instances-DJxWRqXk.js → instances-BMjIO6Xu.js} +32 -7
  321. package/dist/{inventory-reads-BNDSYnuG.js → inventory-reads-DEw2Kbff.js} +2 -1
  322. package/dist/{manifest-8JvRt8LB.d.ts → manifest-6PhMgCFi.d.ts} +1 -1
  323. package/dist/{manifest-B6EkxzC0.d.ts → manifest-B17Sra5h.d.ts} +1 -1
  324. package/dist/{manifest-DCPKfwsh.d.ts → manifest-B4CEdcH_.d.ts} +1 -1
  325. package/dist/{manifest-BCyCm0Z3.d.ts → manifest-BB3GjGa3.d.ts} +1 -1
  326. package/dist/{manifest-H6lz9xQm.d.ts → manifest-BE7UwezO.d.ts} +1 -1
  327. package/dist/{manifest-DGgFeLwd.d.ts → manifest-BMNwdO5D.d.ts} +1 -1
  328. package/dist/{manifest-BrOXXz7k.d.ts → manifest-BSvxbZH5.d.ts} +1 -1
  329. package/dist/{manifest-DZLr6Cbr.js → manifest-BV1YxozT.js} +1 -1
  330. package/dist/{manifest-BJs6pHI0.d.ts → manifest-BVjhJ3Mj.d.ts} +1 -1
  331. package/dist/{manifest-Dh4AJeLl.d.ts → manifest-BXxSqnLS.d.ts} +1 -1
  332. package/dist/{manifest-CcDqfRee.d.ts → manifest-BYbt4y_O.d.ts} +1 -1
  333. package/dist/{manifest-KHudP5T5.d.ts → manifest-BZL2TAB1.d.ts} +1 -1
  334. package/dist/{manifest-BRFen7mE.js → manifest-Bb8S2tcs.js} +1 -1
  335. package/dist/{manifest-fviCqeHj.d.ts → manifest-BknZ4yQ-.d.ts} +1 -1
  336. package/dist/{manifest-B24Ymu8p.d.ts → manifest-Bp0oZ3-W.d.ts} +1 -1
  337. package/dist/{manifest-DxPMUjhY.js → manifest-BvcIe5z_.js} +1 -1
  338. package/dist/{manifest-DWQaegX6.d.ts → manifest-Bz0EjE76.d.ts} +1 -1
  339. package/dist/{manifest-BbC83cJB.d.ts → manifest-BzsuqiQx.d.ts} +1 -1
  340. package/dist/{manifest-Dc1eHEJV.d.ts → manifest-CBwrN4Nf.d.ts} +1 -1
  341. package/dist/{manifest-BqBVKNjy.d.ts → manifest-CELTce26.d.ts} +1 -1
  342. package/dist/{manifest-jSOZl7qT.d.ts → manifest-CGZQ9lU3.d.ts} +1 -1
  343. package/dist/{manifest-DpF5bliV.d.ts → manifest-CGcGylmw.d.ts} +1 -1
  344. package/dist/{manifest-RUmJ5H6p.d.ts → manifest-CMNPpmWS.d.ts} +2 -2
  345. package/dist/{manifest-vG5iHhA5.d.ts → manifest-CMnLDDS3.d.ts} +1 -1
  346. package/dist/{manifest-CszjCxVJ.d.ts → manifest-CSHNTEJZ.d.ts} +1 -1
  347. package/dist/{manifest-qs_U2rx3.d.ts → manifest-CWj5SFuw.d.ts} +1 -1
  348. package/dist/{manifest-Cko_ySTe.d.ts → manifest-C_dVunWg.d.ts} +1 -1
  349. package/dist/{manifest-uL5fzXsx.d.ts → manifest-CaA-2HPK.d.ts} +1 -1
  350. package/dist/{manifest-DPGJ2otk.d.ts → manifest-CbKgs5qA.d.ts} +1 -1
  351. package/dist/{manifest-BfIYKrNe.d.ts → manifest-CdD44xlg.d.ts} +1 -1
  352. package/dist/{manifest-BGD8cD6S.d.ts → manifest-CoFpa0dN.d.ts} +1 -1
  353. package/dist/{manifest-H65OlXiB.js → manifest-CqJkmxrA.js} +1 -1
  354. package/dist/{manifest-BHlKJbN2.d.ts → manifest-D0FjVeay.d.ts} +1 -1
  355. package/dist/{manifest-Bj5hfBA_.d.ts → manifest-D2Z_2z9-.d.ts} +1 -1
  356. package/dist/{manifest-o-S9bj6i.d.ts → manifest-D2d1wS7g.d.ts} +1 -1
  357. package/dist/{manifest-CL5QEu5B.d.ts → manifest-D7mliM-d.d.ts} +1 -1
  358. package/dist/{manifest-DBmuiJ91.d.ts → manifest-D9P9Yhe3.d.ts} +1 -1
  359. package/dist/{manifest-Bg5Znp_u.d.ts → manifest-DAXz8rxB.d.ts} +1 -1
  360. package/dist/{manifest-BgVQ8xd3.d.ts → manifest-DG0oDOmq.d.ts} +1 -1
  361. package/dist/{manifest-Csw2tVut.d.ts → manifest-DGLrMEdB.d.ts} +1 -1
  362. package/dist/{manifest-BxujRhsY.d.ts → manifest-DGiswyG5.d.ts} +1 -1
  363. package/dist/{manifest-Da1QZDY4.d.ts → manifest-DIZ6chpf.d.ts} +1 -1
  364. package/dist/{manifest-xRlf8RQk.d.ts → manifest-DMvx2rWH.d.ts} +1 -1
  365. package/dist/{manifest-BtlEwVU4.d.ts → manifest-DPqKZgWn.d.ts} +1 -1
  366. package/dist/{manifest-BmLU5HtO.d.ts → manifest-DUlZ8qck.d.ts} +1 -1
  367. package/dist/{manifest-DjAdsSs4.d.ts → manifest-DYPVnKW_.d.ts} +1 -1
  368. package/dist/{manifest-Oo7PegXK.d.ts → manifest-D_VmA0aC.d.ts} +1 -1
  369. package/dist/{manifest-CAPSAozN.d.ts → manifest-Dc8pNExY.d.ts} +1 -1
  370. package/dist/{manifest-dXPq0ubY.d.ts → manifest-Df1QDhiQ.d.ts} +1 -1
  371. package/dist/{manifest-BAgvJODg.d.ts → manifest-DhXoSaUC.d.ts} +1 -1
  372. package/dist/{manifest-DweZMH-F.d.ts → manifest-DhpmWh55.d.ts} +1 -1
  373. package/dist/{manifest-BxuSAdYu.d.ts → manifest-Dk_7prKx.d.ts} +1 -1
  374. package/dist/{manifest-DnGgZ9_F.d.ts → manifest-Dl_bw4IU.d.ts} +1 -1
  375. package/dist/{manifest-BeW5LlW1.d.ts → manifest-DsuoLp-Y.d.ts} +1 -1
  376. package/dist/{manifest-2ZgzNTbP.d.ts → manifest-DtEcJBdE.d.ts} +10 -1
  377. package/dist/{manifest-DdxfAXvG.d.ts → manifest-DwCorUVJ.d.ts} +1 -1
  378. package/dist/{manifest-CfQ0nD_7.d.ts → manifest-DxPLHyKY.d.ts} +1 -1
  379. package/dist/{manifest-BSkYvne3.d.ts → manifest-Eazz96as.d.ts} +1 -1
  380. package/dist/{manifest-CH7g3uI3.d.ts → manifest-Pl5us_yz.d.ts} +1 -1
  381. package/dist/{manifest-upfKO7JJ.d.ts → manifest-X4analSK.d.ts} +1 -1
  382. package/dist/{manifest-2jLTjnVh.d.ts → manifest-auanzyjB.d.ts} +1 -1
  383. package/dist/{manifest-CeoUoZDs.d.ts → manifest-gGFtQDJz.d.ts} +1 -1
  384. package/dist/{manifest-BCOBkYvY.d.ts → manifest-lzwWCAYV.d.ts} +2 -2
  385. package/dist/{manifest-BUktyXMR.js → manifest-ok1ge1bM.js} +1 -1
  386. package/dist/{manifest-Ct6mHhg4.d.ts → manifest-uIIb_YLI.d.ts} +1 -1
  387. package/dist/{manifest-DevURQJj.js → manifest-vBvsSefP.js} +5 -1
  388. package/dist/{manifest-CDcaLpwB.d.ts → manifest-xikzppm9.d.ts} +1 -1
  389. package/dist/{manifest-BHZEsuzC.d.ts → manifest-yKx0faak.d.ts} +1 -1
  390. package/dist/mapper/bin.js +6 -6
  391. package/dist/mcp/index.d.ts +1 -1
  392. package/dist/next/index.d.ts +7 -7
  393. package/dist/{operations-IzVAIMvs.d.ts → operations-DKfYeS5z.d.ts} +1 -1
  394. package/dist/{options-CGQC7Wue.js → options-C1N8cOQU.js} +2 -1
  395. package/dist/{options-BTuDJ2RC.js → options-Cu6IqZ_n.js} +3 -1
  396. package/dist/{options-wBw_6uhd.js → options-Oo46IzNk.js} +2 -1
  397. package/dist/{orders-reads-Yo9GGjdv.js → orders-reads-2ozdZx1l.js} +108 -13
  398. package/dist/otel/index.js +4 -4
  399. package/dist/{payroll-export-T754eWz8.js → payroll-export-ChZY6W3w.js} +1 -1
  400. package/dist/{permissions-DxXor_NY.d.ts → permissions-C5h1cU25.d.ts} +1 -1
  401. package/dist/{ports-C5BEHQi6.d.ts → ports-DvaVv_3b.d.ts} +1 -1
  402. package/dist/powersync/index.d.ts +3 -3
  403. package/dist/powersync/index.js +11 -3
  404. package/dist/preset/index.d.ts +4 -4
  405. package/dist/preset/index.js +3 -3
  406. package/dist/{preset-8Xh21Uyw.js → preset-Cl3Q5ASC.js} +8 -2
  407. package/dist/{preview-B-mtB1ka.d.ts → preview-Bwg7r1Lf.d.ts} +2 -2
  408. package/dist/{project-C6JAWCnH.js → project-At5wBJSS.js} +5 -5
  409. package/dist/{push-token-TWXWra8i.d.ts → push-token-C6ZGE1g0.d.ts} +1 -1
  410. package/dist/query/index.d.ts +1 -1
  411. package/dist/react/index.d.ts +6 -6
  412. package/dist/react/native/index.d.ts +1 -1
  413. package/dist/react/server.d.ts +5 -5
  414. package/dist/realtime/index.d.ts +3 -3
  415. package/dist/{record-form-B9-7RhYz.d.ts → record-form-DTncyqVH.d.ts} +1 -1
  416. package/dist/records/index.d.ts +7 -7
  417. package/dist/{sales-CLHrvNDm.js → sales-BhOckhix.js} +3 -3
  418. package/dist/server/index.d.ts +3 -3
  419. package/dist/solid/index.d.ts +5 -5
  420. package/dist/sql/index.d.ts +6 -6
  421. package/dist/sql/index.js +3 -3
  422. package/dist/{sql-Bam07JIf.js → sql-CdZdPqjA.js} +1010 -219
  423. package/dist/sqlite/index.d.ts +1 -1
  424. package/dist/ssr/index.d.ts +1 -1
  425. package/dist/svelte/index.d.ts +5 -5
  426. package/dist/tanstack-db/index.d.ts +1 -1
  427. package/dist/{tenant-BpJ2F2b_.d.ts → tenant-BTnwa5oZ.d.ts} +1 -1
  428. package/dist/testing/index.d.ts +6 -6
  429. package/dist/testing/index.js +1 -1
  430. package/dist/{timeline-LHtdAJnM.d.ts → timeline-B7kBQ1gh.d.ts} +2 -2
  431. package/dist/{topic-4KYLvvTB.d.ts → topic-hu0RP7CG.d.ts} +1 -1
  432. package/dist/{types-Dfa7b0KI.d.ts → types-DvglaQ_D.d.ts} +2 -2
  433. package/dist/vue/index.d.ts +5 -5
  434. package/dist/{watch-topic-C9DIO476.d.ts → watch-topic-C_rGHxIA.d.ts} +1 -1
  435. package/dist/webmcp/index.d.ts +1 -1
  436. package/dist/yjs/index.d.ts +1 -1
  437. package/package.json +1 -1
  438. package/schemas/config-v1.json +64 -1
  439. package/skills/better-supabase-api/references/powersync.md +1 -0
  440. package/dist/cli/add-3L9NVEA3.js +0 -1
  441. package/dist/cli/powersync-COHj6FT8.js +0 -1
  442. package/dist/cli/seed-CRD1tYPA.js +0 -1
@@ -1,8 +1,8 @@
1
1
  import { n as isRecord } from "./guards-CsRa6v57.js";
2
2
  import { a as sqlString, i as sqlIdent } from "./template-1e2akYYK.js";
3
- import { $ as updateExtraColumns, S as extraFieldsArg, T as insertExtraColumns, h as columnsObject, m as columnRef, r as NOTHING, tt as userGrant, w as fail } from "./shared-DwShIqeQ.js";
3
+ import { $ as updateExtraColumns, S as extraFieldsArg, T as insertExtraColumns, Y as splitTable, h as columnsObject, m as columnRef, r as NOTHING, tt as userGrant, w as fail } from "./shared-DwShIqeQ.js";
4
4
  import { n as blockOptions, r as option } from "./options-Z-bd_H1E.js";
5
- import { l as tenantColumnOf, t as uniqueContributions } from "./contributions-DPjEWWpE.js";
5
+ import { l as tenantColumnOf, o as registeredSubjects, t as uniqueContributions } from "./contributions-olp7tVYC.js";
6
6
  import { t as RANK_ALPHABET } from "./rank-keys-CEBzd9Xa.js";
7
7
  import { t as declareRead } from "./reads-CWVqw2JB.js";
8
8
  import { c as stockHistory } from "./inventory-stock-DadU4mb2.js";
@@ -11,7 +11,8 @@ const ordersSqlOptions = blockOptions({
11
11
  paymentWindowMinutes: option.number({ default: 30 }),
12
12
  extraColumns: option.extraColumns(),
13
13
  kitchen: option.boolean({ default: false }),
14
- discountMatrix: option.boolean({ default: false })
14
+ discountMatrix: option.boolean({ default: false }),
15
+ templates: option.boolean({ default: false })
15
16
  });
16
17
  // src/sql/rank-sql.ts
17
18
  /** The `~` pattern a rank key matches, the same as `isRankKey`. */
@@ -69,6 +70,81 @@ function rankSql(type) {
69
70
  pattern: RANK_KEY_PATTERN
70
71
  };
71
72
  }
73
+ // src/sql/template-rows-sql.ts
74
+ /**
75
+ * The template column of a subject, when the table holds template rows. A
76
+ * string is the column; an object also names the child tables a clone copies.
77
+ */
78
+ function templateRowsOf(config) {
79
+ const value = config.template;
80
+ if (value === void 0) return;
81
+ if (typeof value === "string") return {
82
+ column: value,
83
+ children: []
84
+ };
85
+ return {
86
+ column: value.column,
87
+ children: value.children ?? []
88
+ };
89
+ }
90
+ /** `alias.column is null`: the row is a live record, not a template. */
91
+ function isLiveRow(alias, column) {
92
+ return `${alias}.${sqlIdent(column)} is null`;
93
+ }
94
+ /**
95
+ * An early return for a template row, or "" when the subject has no template
96
+ * column. The block ends in a newline so the next statement keeps its indent.
97
+ */
98
+ function templateTriggerReturn(column, value) {
99
+ return column === void 0 ? "" : ` if new.${sqlIdent(column)} is not null then
100
+ return ${value};
101
+ end if;
102
+ `;
103
+ }
104
+ /** ` and alias.template is null` when the subject holds template rows. */
105
+ function excludeTemplates(config, alias) {
106
+ const column = templateRowsOf(config)?.column;
107
+ return column === void 0 ? "" : ` and ${isLiveRow(alias, column)}`;
108
+ }
109
+ /**
110
+ * The `template` column: a uuid that points at the templates table. Unique on
111
+ * the root table of a type, so one template owns one root row; bundle members
112
+ * share the id and are not unique.
113
+ */
114
+ function templateColumnSql(column, templates, unique) {
115
+ return `${sqlIdent(column)} uuid${unique ? " unique" : ""} references ${templates} (id) on delete cascade`;
116
+ }
117
+ /** The column that records which template a live row was made from. */
118
+ function sourceTemplateColumnSql(column, templates) {
119
+ return `${sqlIdent(column)} uuid references ${templates} (id) on delete set null`;
120
+ }
121
+ /**
122
+ * A before-update trigger that refuses a change of the template column, so a
123
+ * row never switches between a template and a live record.
124
+ */
125
+ function templateGuardSql(options) {
126
+ const column = sqlIdent(options.column);
127
+ return `create or replace function ${options.fn}()
128
+ returns trigger
129
+ language plpgsql
130
+ as $$
131
+ begin
132
+ if tg_op = 'UPDATE' and new.${column} is distinct from old.${column} then
133
+ ${fail(options.hint, "A row cannot change between a template and a live record", "23514")}
134
+ end if;
135
+ return new;
136
+ end;
137
+ $$;
138
+
139
+ drop trigger if exists ${options.trigger} on ${options.table};
140
+ create trigger ${options.trigger}
141
+ before update of ${column} on ${options.table}
142
+ for each row execute function ${options.fn}();`;
143
+ }
144
+ /** A partial index over the live rows, the ones lists read by default. */
145
+ function liveRowsIndex(name, table, columns, template) {
146
+ return `create index if not exists ${sqlIdent(name)} on ${table} (${columns}) where ${sqlIdent(template)} is null;`;
147
+ }
72
148
  // src/sql/modules/numbering-entities.ts
73
149
  const ENTITY = /^[a-z][a-z0-9_]*$/;
74
150
  const PREDICATE = /^[A-Za-z0-9_.'"=<>!(), \t-]+$/;
@@ -289,11 +365,12 @@ function assignNumberSql(ctx, entity, tenant, target, fallback, at = "now()", op
289
365
  const sequence = sequenceFormatOf(ctx, entity, tenant);
290
366
  const scope = options.scope ?? "''";
291
367
  const scoped = scope !== "''";
368
+ const gate = (body) => options.when === void 0 ? body : `if ${options.when} then\n ${body.replaceAll("\n", "\n ")}\nend if;`;
292
369
  if (sequence !== void 0) {
293
370
  const next = ctx.of("numbering").fn("next_number");
294
371
  const issued = sequence.assigns ? `
295
372
  perform set_config('better_supabase.issued_number', ${sqlString(entity)} || chr(31) || ${target.seq}::text || chr(31) || ${target.identifier}, true);` : "";
296
- return withFixedNumber(ctx, entity, tenant, {
373
+ return gate(withFixedNumber(ctx, entity, tenant, {
297
374
  seq: target.seq,
298
375
  text: target.identifier
299
376
  }, `${target.seq} := ${next}(${tenant}, ${sqlString(entity)}, ${at}, ${scope});
@@ -303,9 +380,9 @@ function assignNumberSql(ctx, entity, tenant, target, fallback, at = "now()", op
303
380
  registered: true,
304
381
  ...options.fixed === void 0 ? {} : { fixed: options.fixed },
305
382
  after: issued
306
- });
383
+ }));
307
384
  }
308
- return withFixedNumber(ctx, entity, tenant, {
385
+ return gate(withFixedNumber(ctx, entity, tenant, {
309
386
  seq: target.seq,
310
387
  text: target.identifier
311
388
  }, `perform pg_catalog.pg_advisory_xact_lock(pg_catalog.hashtextextended(${tenant}::text || ${sqlString(`:${entity}`)}${scoped ? ` || ':' || ${scope}` : ""}, 0));
@@ -314,7 +391,7 @@ function assignNumberSql(ctx, entity, tenant, target, fallback, at = "now()", op
314
391
  at,
315
392
  scope,
316
393
  ...options.fixed === void 0 ? {} : { fixed: options.fixed }
317
- });
394
+ }));
318
395
  }
319
396
  /**
320
397
  * Wraps `normal`, the SQL that takes the next number, so an importer's fixed
@@ -340,6 +417,17 @@ function withFixedNumber(ctx, entity, tenant, target, normal, options) {
340
417
  ${normal}
341
418
  end if;`;
342
419
  }
420
+ /**
421
+ * `assignOn`, and a template row never takes a number when the numbered table
422
+ * is a subject with a template column.
423
+ */
424
+ function assignWhen(ctx, item) {
425
+ if (item.table === void 0) return item.assignOn;
426
+ const [schema, table] = splitTable(item.table);
427
+ const subject = registeredSubjects(ctx.subjects, ctx.naming).find((entry) => entry.schema === schema && entry.table === table);
428
+ const column = subject === void 0 ? void 0 : templateRowsOf(subject.config)?.column;
429
+ return column === void 0 ? item.assignOn : `(${item.assignOn}) and new.${sqlIdent(column)} is null`;
430
+ }
343
431
  // src/sql/column-defaults.ts
344
432
  const QUOTED_IDENT = /^"(.*)"$/s;
345
433
  const bareName = (ident) => QUOTED_IDENT.exec(ident)?.[1]?.replaceAll("\"\"", "\"") ?? ident;
@@ -1347,11 +1435,18 @@ function sequenceFormat(ctx, entity, tenant) {
1347
1435
  * one more than the tenant's highest under a transaction lock, as plain
1348
1436
  * digits.
1349
1437
  */
1350
- function assignNumber(ctx, entity, tenant, target) {
1438
+ /** Template rows are on for orders (ADR 0244). */
1439
+ function orderTemplatesOn(ctx) {
1440
+ if (!ctx.flag("templates", false)) return false;
1441
+ if (!ctx.installed("templates")) throw new TypeError("blocks.orders.options.templates needs the templates block");
1442
+ return ctx.has("orders", "template");
1443
+ }
1444
+ function assignNumber(ctx, entity, tenant, target, when) {
1351
1445
  const format = sequenceFormat(ctx, entity, tenant);
1446
+ const gate = (body) => when === void 0 ? body : `if ${when} then\n ${body.replaceAll("\n", "\n ")}\nend if;`;
1352
1447
  if (format !== void 0) {
1353
1448
  const next = ctx.of("numbering").fn("next_number");
1354
- return withFixedNumber(ctx, entity, tenant, {
1449
+ return gate(withFixedNumber(ctx, entity, tenant, {
1355
1450
  seq: target.seq,
1356
1451
  text: target.number
1357
1452
  }, `${target.seq} := ${next}(${tenant}, ${sqlString(entity)}, now());
@@ -1359,11 +1454,11 @@ function assignNumber(ctx, entity, tenant, target) {
1359
1454
  at: "now()",
1360
1455
  scope: "''",
1361
1456
  registered: true
1362
- });
1457
+ }));
1363
1458
  }
1364
1459
  const o = columns(ctx, "orders");
1365
1460
  const column = entity === "order" ? o("sequence") : o("invoiceSequence");
1366
- return withFixedNumber(ctx, entity, tenant, {
1461
+ return gate(withFixedNumber(ctx, entity, tenant, {
1367
1462
  seq: target.seq,
1368
1463
  text: target.number
1369
1464
  }, `perform pg_catalog.pg_advisory_xact_lock(pg_catalog.hashtextextended(${tenant}::text || ':commerce:${entity}', 0));
@@ -1371,7 +1466,7 @@ function assignNumber(ctx, entity, tenant, target) {
1371
1466
  ${target.number} := ${target.seq}::text;`, {
1372
1467
  at: "now()",
1373
1468
  scope: "''"
1374
- });
1469
+ }));
1375
1470
  }
1376
1471
  /**
1377
1472
  * `${fn("order_transition")}(order, to)`: moves an order's status along the
@@ -1534,4 +1629,4 @@ $$;
1534
1629
  ${userGrant(`${fn}(${ctx.idType}, integer)`)}
1535
1630
  `;
1536
1631
  }
1537
- export { scopeSql as A, variantExtras as C, withColumnDefault as D, uniqueViolationOn as E, RANK_KEY_PATTERN as F, rankAfter as I, rankBackfill as L, withFixedNumber as M, sequenceEntry as N, assignNumberSql as O, sequences as P, ordersSqlOptions as R, storefrontOption as S, columnDefaults as T, guard$1 as _, asService as a, productFunctions as b, guard as c, paymentWindow as d, serviceOnlyGuard as f, categoryExtras as g, amountOf$1 as h, amountOf as i, sequenceFormatOf as j, hasLegalEntityColumn as k, orderFields as l, SLUG as m, ORDER_STATUS_BOARD_RESULT as n, assignNumber as o, transitionFunction as p, orderReads as r, columns as s, ORDER_READS as t, orderPayload as u, optionFunctions as v, catalogRank as w, productSettingTypes as x, productExtras as y };
1632
+ export { assignWhen as A, templateColumnSql as B, storefrontOption as C, uniqueViolationOn as D, columnDefaults as E, sequenceEntry as F, rankAfter as G, templateRowsOf as H, sequences as I, rankBackfill as K, excludeTemplates as L, scopeSql as M, sequenceFormatOf as N, withColumnDefault as O, withFixedNumber as P, liveRowsIndex as R, productSettingTypes as S, catalogRank as T, templateTriggerReturn as U, templateGuardSql as V, RANK_KEY_PATTERN as W, categoryExtras as _, asService as a, productExtras as b, guard as c, orderTemplatesOn as d, paymentWindow as f, amountOf$1 as g, SLUG as h, amountOf as i, hasLegalEntityColumn as j, assignNumberSql as k, orderFields as l, transitionFunction as m, ORDER_STATUS_BOARD_RESULT as n, assignNumber as o, serviceOnlyGuard as p, ordersSqlOptions as q, orderReads as r, columns as s, ORDER_READS as t, orderPayload as u, guard$1 as v, variantExtras as w, productFunctions as x, optionFunctions as y, sourceTemplateColumnSql as z };
@@ -39,9 +39,9 @@ function systemOf(executor) {
39
39
  * ```
40
40
  */
41
41
  function otel(options = {}) {
42
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.54.0");
42
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.55.0");
43
43
  let histogram;
44
- if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.54.0")).createHistogram("db.client.operation.duration", {
44
+ if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.55.0")).createHistogram("db.client.operation.duration", {
45
45
  unit: "s",
46
46
  description: "Duration of database client operations.",
47
47
  advice: { explicitBucketBoundaries: [
@@ -230,7 +230,7 @@ function otel(options = {}) {
230
230
  * `betterSupabase.events`. Returns a function that stops listening.
231
231
  */
232
232
  function traceAuth(betterSupabase, options = {}) {
233
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.54.0");
233
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.55.0");
234
234
  const offAuth = betterSupabase.events.on("auth", (event) => {
235
235
  const span = tracer.startSpan("auth.resolve", {
236
236
  kind: SpanKind.INTERNAL,
@@ -269,7 +269,7 @@ function traceAuth(betterSupabase, options = {}) {
269
269
  * `*.denied`) set an error status. Returns a function that stops listening.
270
270
  */
271
271
  function traceBlockEvents(betterSupabase, options = {}) {
272
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.54.0");
272
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.55.0");
273
273
  return betterSupabase.events.on("block", (event) => {
274
274
  const attributes = {
275
275
  ...options.attributes,
@@ -4,7 +4,7 @@ import { i as fillTemplate } from "./access-sql-DH2LbcQe.js";
4
4
  import { c as renderPolicy, i as policy } from "./policy-B9UWDXMF.js";
5
5
  import { C as extraFieldsJson, I as quotedTable, O as lockTable, S as extraFieldsArg, W as schemaPreamble, Y as splitTable, a as SCHEMA, m as columnRef, nt as withExtraFields, o as SERVICE_CALLER, q as sha256HexSql, rt as writeExtraColumns, tt as userGrant, u as addExtraColumns, w as fail } from "./shared-DwShIqeQ.js";
6
6
  import { n as blockOptions, r as option } from "./options-Z-bd_H1E.js";
7
- import { d as subjectPermissionKey, f as subjectPermissionOf, r as checkCall, t as uniqueContributions } from "./contributions-DPjEWWpE.js";
7
+ import { d as subjectPermissionKey, f as subjectPermissionOf, r as checkCall, t as uniqueContributions } from "./contributions-olp7tVYC.js";
8
8
  import { t as SUBJECT_TYPE_PATTERN } from "./subject-type-BarjdHZV.js";
9
9
  import { a as moduleOperations, n as OPERATIONS, r as accessModel } from "./permissions-model-Dh9-Zzfy.js";
10
10
  // src/sql/column-type.ts
@@ -1,4 +1,4 @@
1
- import { o as ClaimsRecord, s as ClaimsSource } from "./entitlements-Go8BHqhr.js";
1
+ import { o as ClaimsRecord, s as ClaimsSource } from "./entitlements-CRBZg5y2.js";
2
2
  interface PermissionsOfOptions {
3
3
  /**
4
4
  * The claim holding `{ [tenantId]: string[] }`, as
@@ -1,4 +1,4 @@
1
- import { n as TopicPort } from "./watch-topic-C9DIO476.js";
1
+ import { n as TopicPort } from "./watch-topic-C_rGHxIA.js";
2
2
  import { t as AsyncResult } from "./result-CMqlHv82.js";
3
3
  import { SupabaseClient } from "@supabase/supabase-js";
4
4
  /**
@@ -1,10 +1,10 @@
1
1
  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-CewY2EQK.js";
2
2
  import { Vt as Executor } from "../types-BlBju7Wa.js";
3
- 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-BKO5EAzN.js";
4
- import { t as AuthSnapshot } from "../bind-DWElQa6I.js";
3
+ 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-0uVsKWaB.js";
4
+ import { t as AuthSnapshot } from "../bind-DiGmjHzz.js";
5
5
  import { t as BlockTransport } from "../block-transport-CP4wAHU-.js";
6
6
  import { b as DbError, f as Result } from "../result-CMqlHv82.js";
7
- import { n as TopicPort } from "../watch-topic-C9DIO476.js";
7
+ import { n as TopicPort } from "../watch-topic-C_rGHxIA.js";
8
8
  import { o as EngagementSubject } from "../activities-DPq0U9Nb.js";
9
9
  import { a as MedicationAsNeededInput, r as MedicationAdministrationInput } from "../medications-0Uuwu3k2.js";
10
10
  import { d as ObservationInput, t as Observation } from "../observations-ilWeRQ20.js";
@@ -272,6 +272,14 @@ function sessionError(cause) {
272
272
  function unsupportedOp(entry, route) {
273
273
  return err(dbError("unsupported", `better-supabase: a ${route} upload route can't replay PowerSync op ${entry.op}`));
274
274
  }
275
+ /**
276
+ * A replay writes what the device recorded, including the columns the
277
+ * timestamps, actor and trash plugins fill: the local repository stamped them
278
+ * offline, so refusing them would refuse every queued insert. The plugins guard
279
+ * against mistakes in app code, not untrusted clients; a column the server must
280
+ * own needs its trigger (`bsb_updated_at`, `track_actor`).
281
+ */
282
+ const REPLAY = { override: true };
275
283
  function uploadRoute(repository, options = {}) {
276
284
  const put = options.put ?? "upsert";
277
285
  return async (entry) => {
@@ -283,11 +291,11 @@ function uploadRoute(repository, options = {}) {
283
291
  switch (entry.op) {
284
292
  case "PUT":
285
293
  if (put === "create" && "create" in repository) {
286
- const result = await repository.create(row);
294
+ const result = await repository.create(row, REPLAY);
287
295
  return !result.ok && result.error.kind === "conflict" ? ok(void 0) : result;
288
296
  }
289
- return "upsert" in repository ? repository.upsert(row) : unsupportedOp(entry, put);
290
- case "PATCH": return put === "upsert" && "update" in repository ? repository.update(id, entry.opData ?? {}) : unsupportedOp(entry, put);
297
+ return "upsert" in repository ? repository.upsert(row, REPLAY) : unsupportedOp(entry, put);
298
+ case "PATCH": return put === "upsert" && "update" in repository ? repository.update(id, entry.opData ?? {}, REPLAY) : unsupportedOp(entry, put);
291
299
  case "DELETE": return repository.delete(id);
292
300
  default: return err(dbError("unsupported", `better-supabase: unknown PowerSync op ${entry.op}`));
293
301
  }
@@ -1,5 +1,5 @@
1
- import { Ar as PresetAccess, Dr as PRESET_FRAMEWORKS, Er as DEFAULT_CONVENTIONS, Fr as PresetFramework, Hr as integrationsForFramework, Lr as PresetPlatforms, Mr as PresetField, Nr as PresetFieldKey, Or as PRESET_TENANT_NAMES, Pr as PresetFieldValue, Rr as PresetScope, Tr as CONVENTION_FIELDS, Ur as presetField, Vr as PresetValueInfo, Wr as presetValueLabel, jr as PresetConventions, kr as Preset, zr as PresetSubjectSettings } from "../define-block-By-LUpM_.js";
2
- import { $i as CORE_BLOCKS, $n as presetApplyCommand, An as CREATE_URL, Bn as MAX_DESIGN_CODE_LENGTH, Cn as PRESET_GROUPS, Cr as ResolvedPresetBlock, Dn as defaultPreset, Dr as resolvePreset, En as PresetName, Er as removeComposite, Fn as DesignFile, Gn as designFileSource, Hn as createUrl, In as DesignParseError, Jn as designSchema, Kn as designFormat, Ln as DesignParseIssue, Mn as DESIGN_FILE, Nn as DESIGN_FORMAT, On as isPresetName, Pn as DesignErrorCode, Qn as presetAndDesignOf, Qr as APP_COLUMN_FORMATS, Rn as DesignParseResult, Sn as PRESETS, Sr as ResolvedPreset, Tn as PresetGroup, Tr as presetBlockConflict, Un as decodeDesign, Vn as createQuery, Wn as designConfig, Xn as isDesignCode, Yn as encodeDesign, Zn as parseDesign, _r as presetSpec, aa as PresetCatalogBlock, ai as AppColumnFormat, ar as safeDesignFileSource, bn as DEFAULT_PRESET_NAME, br as PresetIntegration, cr as ExpandedConfig, dr as expandPreset, ea as INSTANCE_NAME, er as presetArgumentOf, fr as presetConfig, gr as presetOfSpec, hr as presetFromSpec, ia as PresetCatalog, ir as readDesignFile, jn as CreateDesign, kn as namedPreset, lr as PresetInput, mr as PresetSpec, na as BlockCatalog, nr as presetInstallCommand, oa as PresetCatalogManifest, or as safeParseDesign, pr as presetOf, qn as designOf, ra as BlockCatalogEntry, rr as presetKey, sa as PresetGlueItem, sr as ConfigConventions, ta as instancePrefix, tr as presetConfigSource, ur as conventionConfig, vr as CompositeRemoval, wn as PRESET_NAMES, wr as listNames, xn as NamedPreset, xr as ResolvedComposite, yr as PresetConflict, zn as DesignTooLongError } from "../context-iduX3Fsn.js";
3
- import { C as diffAppTables, D as PRESET_CATALOG, E as isAppDefault, O as BLOCK_CATALOG, S as DiffOptions, T as appDefaultError, _ as glueCommand, a as blockRequires, b as DesignChange, c as installedBlocks, d as instancesOf, f as presetInstances, g as PROVIDER_COMMENT, h as withoutInstance, i as blockEntities, l as instanceBlock, m as withInstance, n as BlockInstance, o as canAddInstance, p as withEntityName, r as PresetInstance, s as entityName, t as BlockEntity, u as instanceNameProblem, v as presetBlocksSource, w as diffDesigns, x as DesignChangeKind, y as presetGlue } from "../index-Bsd8P1iQ.js";
4
- import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-B2xNMyLA.js";
1
+ import { Ar as PresetAccess, Dr as PRESET_FRAMEWORKS, Er as DEFAULT_CONVENTIONS, Fr as PresetFramework, Hr as integrationsForFramework, Lr as PresetPlatforms, Mr as PresetField, Nr as PresetFieldKey, Or as PRESET_TENANT_NAMES, Pr as PresetFieldValue, Rr as PresetScope, Tr as CONVENTION_FIELDS, Ur as presetField, Vr as PresetValueInfo, Wr as presetValueLabel, jr as PresetConventions, kr as Preset, zr as PresetSubjectSettings } from "../define-block-Cu67KCN1.js";
2
+ import { $i as CORE_BLOCKS, $n as presetApplyCommand, An as CREATE_URL, Bn as MAX_DESIGN_CODE_LENGTH, Cn as PRESET_GROUPS, Cr as ResolvedPresetBlock, Dn as defaultPreset, Dr as resolvePreset, En as PresetName, Er as removeComposite, Fn as DesignFile, Gn as designFileSource, Hn as createUrl, In as DesignParseError, Jn as designSchema, Kn as designFormat, Ln as DesignParseIssue, Mn as DESIGN_FILE, Nn as DESIGN_FORMAT, On as isPresetName, Pn as DesignErrorCode, Qn as presetAndDesignOf, Qr as APP_COLUMN_FORMATS, Rn as DesignParseResult, Sn as PRESETS, Sr as ResolvedPreset, Tn as PresetGroup, Tr as presetBlockConflict, Un as decodeDesign, Vn as createQuery, Wn as designConfig, Xn as isDesignCode, Yn as encodeDesign, Zn as parseDesign, _r as presetSpec, aa as PresetCatalogBlock, ai as AppColumnFormat, ar as safeDesignFileSource, bn as DEFAULT_PRESET_NAME, br as PresetIntegration, cr as ExpandedConfig, dr as expandPreset, ea as INSTANCE_NAME, er as presetArgumentOf, fr as presetConfig, gr as presetOfSpec, hr as presetFromSpec, ia as PresetCatalog, ir as readDesignFile, jn as CreateDesign, kn as namedPreset, lr as PresetInput, mr as PresetSpec, na as BlockCatalog, nr as presetInstallCommand, oa as PresetCatalogManifest, or as safeParseDesign, pr as presetOf, qn as designOf, ra as BlockCatalogEntry, rr as presetKey, sa as PresetGlueItem, sr as ConfigConventions, ta as instancePrefix, tr as presetConfigSource, ur as conventionConfig, vr as CompositeRemoval, wn as PRESET_NAMES, wr as listNames, xn as NamedPreset, xr as ResolvedComposite, yr as PresetConflict, zn as DesignTooLongError } from "../context-DSJpfeVv.js";
3
+ import { C as diffAppTables, D as PRESET_CATALOG, E as isAppDefault, O as BLOCK_CATALOG, S as DiffOptions, T as appDefaultError, _ as glueCommand, a as blockRequires, b as DesignChange, c as installedBlocks, d as instancesOf, f as presetInstances, g as PROVIDER_COMMENT, h as withoutInstance, i as blockEntities, l as instanceBlock, m as withInstance, n as BlockInstance, o as canAddInstance, p as withEntityName, r as PresetInstance, s as entityName, t as BlockEntity, u as instanceNameProblem, v as presetBlocksSource, w as diffDesigns, x as DesignChangeKind, y as presetGlue } from "../index-slG4UpF_.js";
4
+ import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-BsDmauWB.js";
5
5
  export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, BLOCK_CATALOG, type BlockCatalog, type BlockCatalogEntry, type BlockEntity, type BlockInstance, CONVENTION_FIELDS, CREATE_URL, type CompositeRemoval, 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 PresetSubjectSettings, type PresetValueInfo, type ResolvedComposite, 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, removeComposite, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
@@ -1,4 +1,4 @@
1
- import { C as PRESET_TENANT_NAMES, E as presetValueLabel, S as PRESET_FRAMEWORKS, T as presetField, _ as defaultPreset, a as presetOf, b as CONVENTION_FIELDS, c as presetSpec, d as removeComposite, f as resolvePreset, g as PRESET_NAMES, h as PRESET_GROUPS, i as presetConfig, l as listNames, m as PRESETS, o as presetFromSpec, p as DEFAULT_PRESET_NAME, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as isPresetName, w as integrationsForFramework, x as DEFAULT_CONVENTIONS, y as namedPreset } from "../config-ekflaCnS.js";
2
- import { I as PRESET_CATALOG, O as APP_COLUMN_FORMATS, b as appDefaultError, 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, x as isAppDefault } from "../instances-DJxWRqXk.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, K as BLOCK_CATALOG, 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-8Xh21Uyw.js";
1
+ import { C as PRESET_TENANT_NAMES, E as presetValueLabel, S as PRESET_FRAMEWORKS, T as presetField, _ as defaultPreset, a as presetOf, b as CONVENTION_FIELDS, c as presetSpec, d as removeComposite, f as resolvePreset, g as PRESET_NAMES, h as PRESET_GROUPS, i as presetConfig, l as listNames, m as PRESETS, o as presetFromSpec, p as DEFAULT_PRESET_NAME, r as expandPreset, s as presetOfSpec, t as conventionConfig, u as presetBlockConflict, v as isPresetName, w as integrationsForFramework, x as DEFAULT_CONVENTIONS, y as namedPreset } from "../config-Dgl6AxKE.js";
2
+ import { I as PRESET_CATALOG, O as APP_COLUMN_FORMATS, b as appDefaultError, 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, x as isAppDefault } from "../instances-BMjIO6Xu.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, K as BLOCK_CATALOG, 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-Cl3Q5ASC.js";
4
4
  export { APP_COLUMN_FORMATS, APP_NAME_MAX, BLOCK_CATALOG, 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, removeComposite, resolvePreset, safeDesignFileSource, safeParseDesign, withEntityName, withInstance, withoutInstance };
@@ -1,5 +1,5 @@
1
- import { I as PRESET_CATALOG, _ as appTablesOf, n as INSTANCE_NAME, t as CORE_BLOCKS, z as asBlocksConfig } from "./instances-DJxWRqXk.js";
2
- import { N as groupEntries, _ as defaultPreset, a as presetOf, c as presetSpec, f as resolvePreset, i as presetConfig, s as presetOfSpec } from "./config-ekflaCnS.js";
1
+ import { I as PRESET_CATALOG, _ as appTablesOf, n as INSTANCE_NAME, t as CORE_BLOCKS, z as asBlocksConfig } from "./instances-BMjIO6Xu.js";
2
+ import { N as groupEntries, _ as defaultPreset, a as presetOf, c as presetSpec, f as resolvePreset, i as presetConfig, s as presetOfSpec } from "./config-Dgl6AxKE.js";
3
3
  import { t as isSqlType } from "./sql-type-XWMeZRAl.js";
4
4
  import { i as FIELD_FORMATS } from "./field-formats-sLYMh1ZK.js";
5
5
  // src/preset/block-catalog.generated.ts
@@ -1640,6 +1640,7 @@ const BLOCK_CATALOG = {
1640
1640
  "contacts",
1641
1641
  "approvals",
1642
1642
  "inspections",
1643
+ "templates",
1643
1644
  "imports"
1644
1645
  ],
1645
1646
  "modes": ["managed", "custom"],
@@ -1763,6 +1764,7 @@ const BLOCK_CATALOG = {
1763
1764
  "invoices",
1764
1765
  "quotes",
1765
1766
  "contacts",
1767
+ "templates",
1766
1768
  "imports"
1767
1769
  ],
1768
1770
  "modes": ["managed", "custom"],
@@ -2089,6 +2091,8 @@ const BLOCK_CATALOG = {
2089
2091
  "reminders",
2090
2092
  "accounting",
2091
2093
  "option-sets",
2094
+ "templates",
2095
+ "tags",
2092
2096
  "pipelines",
2093
2097
  "subjects"
2094
2098
  ],
@@ -2128,6 +2132,7 @@ const BLOCK_CATALOG = {
2128
2132
  "orders",
2129
2133
  "invoices",
2130
2134
  "inventory",
2135
+ "templates",
2131
2136
  "imports"
2132
2137
  ],
2133
2138
  "modes": ["managed", "custom"],
@@ -2174,6 +2179,7 @@ const BLOCK_CATALOG = {
2174
2179
  "orders",
2175
2180
  "shipments",
2176
2181
  "billable-time",
2182
+ "templates",
2177
2183
  "imports"
2178
2184
  ],
2179
2185
  "modes": ["managed", "custom"],
@@ -1,9 +1,9 @@
1
1
  import { t as BlockTransport } from "./block-transport-CP4wAHU-.js";
2
2
  import { i as EventSink } from "./cloud-event-Dj2V1lQw.js";
3
- import { Ln as AttachmentStorage } from "./define-block-By-LUpM_.js";
3
+ import { Ln as AttachmentStorage } from "./define-block-Cu67KCN1.js";
4
4
  import { _ as JobHandler } from "./types-CTb0Uroz.js";
5
5
  import { r as BlockTemporalOptions } from "./block-helpers-rTsuHt6v.js";
6
- import { y as DrivePreviews } from "./drive-CuNG4qB8.js";
6
+ import { y as DrivePreviews } from "./drive-D008IDpI.js";
7
7
  import { t as AsyncResult } from "./result-CMqlHv82.js";
8
8
  /** One rendered page: an image the drive stores under the file's previews. */
9
9
  interface PreviewPage {
@@ -1,8 +1,8 @@
1
- import { a as presetOf, f as resolvePreset } from "./config-ekflaCnS.js";
2
- import { D as designOf, M as parseDesign, j as jsonPointer, k as encodeDesign, v as DesignParseError, w as designConfig, y as DesignTooLongError } from "./preset-8Xh21Uyw.js";
3
- import { I as PRESET_CATALOG, b as appDefaultError, d as appIdentifierError, f as appNameLengthError, p as appReservedColumns, x as isAppDefault } from "./instances-DJxWRqXk.js";
4
- import { c as resolveConfig } from "./config-LOwFAFpo.js";
5
- import { R as moduleLayout, U as renderBlocks, dt as SQL_MODULES } from "./sql-Bam07JIf.js";
1
+ import { a as presetOf, f as resolvePreset } from "./config-Dgl6AxKE.js";
2
+ import { D as designOf, M as parseDesign, j as jsonPointer, k as encodeDesign, v as DesignParseError, w as designConfig, y as DesignTooLongError } from "./preset-Cl3Q5ASC.js";
3
+ import { I as PRESET_CATALOG, b as appDefaultError, d as appIdentifierError, f as appNameLengthError, p as appReservedColumns, x as isAppDefault } from "./instances-BMjIO6Xu.js";
4
+ import { c as resolveConfig } from "./config-CsX2THwJ.js";
5
+ import { H as renderBlocks, L as moduleLayout, ut as SQL_MODULES } from "./sql-CdZdPqjA.js";
6
6
  // src/create/column-keys.ts
7
7
  /** The most options a select takes, and the longest option. */
8
8
  const MAX_OPTIONS = 100;
@@ -1,4 +1,4 @@
1
- import { s as PushTokenPort } from "./ports-C5BEHQi6.js";
1
+ import { s as PushTokenPort } from "./ports-DvaVv_3b.js";
2
2
  /** The part of `expo-notifications` the push token port uses. */
3
3
  interface ExpoNotificationsLike {
4
4
  getPermissionsAsync(): Promise<{
@@ -1,4 +1,4 @@
1
1
  import { t as escapeLike } from "../escape-like-BtorH1tO.js";
2
2
  import { n as invalidateTables, t as BetterQueryMeta } from "../invalidate-DAB9CaPm.js";
3
- import { $ as blockQueries, G as BLOCK_READ_PREFIXES, J as BlockInvalidation, K as BlockClientQueries, Q as blockControllerEngine, X as BlockQueries, Y as BlockMethodQuery, Z as BlockVariablesOf, a as RecordBindingQueries, at as InfiniteExtras, c as RecordWriteMutations, ct as QueriesOptions, dt as QueryOptionsOf, et as invalidateOnBlockEvents, ft as TableQueries, ht as queryCache, i as optimistic, it as BetterQueries, l as invalidateOnRecordEvents, lt as QueryHelpers, mt as invalidateOnMutation, n as OptimisticSnapshot, nt as UserChangeSource, o as RecordQueries, ot as InfiniteOptionsOf, pt as createQueries, q as BlockClients, r as OptimisticTarget, rt as clearOnUserChange, s as RecordQueriesOptions, st as MutationOptionsOf, t as OptimisticHandlers, tt as queryEngine, u as recordQueries, ut as QueryKeyOf } from "../index-DzjugbCf.js";
3
+ import { $ as blockQueries, G as BLOCK_READ_PREFIXES, J as BlockInvalidation, K as BlockClientQueries, Q as blockControllerEngine, X as BlockQueries, Y as BlockMethodQuery, Z as BlockVariablesOf, a as RecordBindingQueries, at as InfiniteExtras, c as RecordWriteMutations, ct as QueriesOptions, dt as QueryOptionsOf, et as invalidateOnBlockEvents, ft as TableQueries, ht as queryCache, i as optimistic, it as BetterQueries, l as invalidateOnRecordEvents, lt as QueryHelpers, mt as invalidateOnMutation, n as OptimisticSnapshot, nt as UserChangeSource, o as RecordQueries, ot as InfiniteOptionsOf, pt as createQueries, q as BlockClients, r as OptimisticTarget, rt as clearOnUserChange, s as RecordQueriesOptions, st as MutationOptionsOf, t as OptimisticHandlers, tt as queryEngine, u as recordQueries, ut as QueryKeyOf } from "../index-BTl5A8Aj.js";
4
4
  export { BLOCK_READ_PREFIXES, type BetterQueries, type BetterQueryMeta, type BlockClientQueries, type BlockClients, type BlockInvalidation, type BlockMethodQuery, type BlockQueries, type BlockVariablesOf, type InfiniteExtras, type InfiniteOptionsOf, type MutationOptionsOf, type OptimisticHandlers, type OptimisticSnapshot, type OptimisticTarget, type QueriesOptions, type QueryHelpers, type QueryKeyOf, type QueryOptionsOf, type RecordBindingQueries, type RecordQueries, type RecordQueriesOptions, type RecordWriteMutations, type TableQueries, type UserChangeSource, blockControllerEngine, blockQueries, clearOnUserChange, createQueries, escapeLike, invalidateOnBlockEvents, invalidateOnMutation, invalidateOnRecordEvents, invalidateTables, optimistic, queryCache, queryEngine, recordQueries };
@@ -1,12 +1,12 @@
1
1
  import { t as escapeLike } from "../escape-like-BtorH1tO.js";
2
2
  import { c as Impersonator, n as AuthSession } from "../view-CVXHgadI.js";
3
- import { i as DataEntry, m as RejectedChange, n as DataEngine, o as DataSyncState } from "../data-engine-BKO5EAzN.js";
4
- import { r as MembershipClaim } from "../entitlements-Go8BHqhr.js";
5
- import { t as tenantOf } from "../tenant-BpJ2F2b_.js";
6
- import { r as LiveCountSeed } from "../index-D9Sb8Ju5.js";
7
- import { C as LiveCountHookOptions, O as ProfileOf, S as ClientLike, T as LiveQueryHookOptions, _ as ActionInputOf, b as BroadcastOptions, c as DataWrites, d as BlockMutationActions, f as BlockMutationState, g as BlockRefetchOn, h as BlockQueryState, k as UseActionOptions, l as BlockEngineOptions, m as BlockQueryOptions, o as DataSource, p as BlockQueryActions, s as DataState, t as fieldErrorsOf, u as BlockEventSource, v as ActionResultOf, x as ClaimsOf } from "../field-errors-B4SMTk2e.js";
3
+ import { i as DataEntry, m as RejectedChange, n as DataEngine, o as DataSyncState } from "../data-engine-0uVsKWaB.js";
4
+ import { r as MembershipClaim } from "../entitlements-CRBZg5y2.js";
5
+ import { t as tenantOf } from "../tenant-BTnwa5oZ.js";
6
+ import { r as LiveCountSeed } from "../index-DhS8Qkgj.js";
7
+ import { C as LiveCountHookOptions, O as ProfileOf, S as ClientLike, T as LiveQueryHookOptions, _ as ActionInputOf, b as BroadcastOptions, c as DataWrites, d as BlockMutationActions, f as BlockMutationState, g as BlockRefetchOn, h as BlockQueryState, k as UseActionOptions, l as BlockEngineOptions, m as BlockQueryOptions, o as DataSource, p as BlockQueryActions, s as DataState, t as fieldErrorsOf, u as BlockEventSource, v as ActionResultOf, x as ClaimsOf } from "../field-errors-CjEgbjO9.js";
8
8
  import { n as supportOf, t as SupportView } from "../support-view-Dn_YTGV4.js";
9
- import { $ as ActionForm, A as useBlockEnv, B as RecordListQueryStates, C as useConflicts, D as defineDataHooks, E as DataView, F as useBlockMutation, G as RecordActionsOf, H as RecordListUrl, I as useBlockQuery, J as RecordProviderKit, K as RecordContextValue, L as RecordFormState, M as useController, N as useLatest, O as defineListHook, P as useBlockEvent, Q as createRecordProvider, R as UseRecordFormOptions, S as Conflicts, T as DataHooks, U as RecordListUrlState, V as RecordListState, W as useRecordListState, X as RecordState, Y as RecordProviderProps, Z as RecordWriteHandlers, _ as useRealtimeRelay, a as Upload, at as BetterSupabaseProvider, b as PresenceTopic, c as UseImageOptions, ct as createHooks, d as useSignedUrl, dt as useLiveCount, et as ActionHandle, f as useUpload, ft as useLiveQuery, g as UseRealtimeRelayOptions, h as useDebouncedSearch, i as StorageImage, it as BetterHooks, j as useBlockTenant, k as defineOneHook, l as UseUploadOptions, lt as useAuth, m as DebouncedSearchOptions, n as SignedUrl, nt as useAction, o as UploadStatus, ot as BetterSupabaseProviderProps, p as DebouncedSearch, pt as useSupabase, q as RecordInitial, r as SignedUrlSource, rt as useActionForm, s as UploadTarget, st as LiveCount, t as ImageSource, tt as UseActionFormOptions, u as useImage, ut as useBroadcast, v as Presence, w as useSyncStatus, x as usePresence, y as PresenceHookOptions, z as useRecordForm } from "../index-DkJtM-9e.js";
9
+ import { $ as ActionForm, A as useBlockEnv, B as RecordListQueryStates, C as useConflicts, D as defineDataHooks, E as DataView, F as useBlockMutation, G as RecordActionsOf, H as RecordListUrl, I as useBlockQuery, J as RecordProviderKit, K as RecordContextValue, L as RecordFormState, M as useController, N as useLatest, O as defineListHook, P as useBlockEvent, Q as createRecordProvider, R as UseRecordFormOptions, S as Conflicts, T as DataHooks, U as RecordListUrlState, V as RecordListState, W as useRecordListState, X as RecordState, Y as RecordProviderProps, Z as RecordWriteHandlers, _ as useRealtimeRelay, a as Upload, at as BetterSupabaseProvider, b as PresenceTopic, c as UseImageOptions, ct as createHooks, d as useSignedUrl, dt as useLiveCount, et as ActionHandle, f as useUpload, ft as useLiveQuery, g as UseRealtimeRelayOptions, h as useDebouncedSearch, i as StorageImage, it as BetterHooks, j as useBlockTenant, k as defineOneHook, l as UseUploadOptions, lt as useAuth, m as DebouncedSearchOptions, n as SignedUrl, nt as useAction, o as UploadStatus, ot as BetterSupabaseProviderProps, p as DebouncedSearch, pt as useSupabase, q as RecordInitial, r as SignedUrlSource, rt as useActionForm, s as UploadTarget, st as LiveCount, t as ImageSource, tt as UseActionFormOptions, u as useImage, ut as useBroadcast, v as Presence, w as useSyncStatus, x as usePresence, y as PresenceHookOptions, z as useRecordForm } from "../index-DDDHYXtr.js";
10
10
  import { SessionProvider, SessionProviderProps, useSession, useSupportSession } from "./session.js";
11
11
  import { a as useSignIn, i as SignOut, n as PendingState, o as useSignOut, r as SignIn, t as AuthHookOptions } from "../sign-in-C9pZE1kM.js";
12
12
  export { type ActionForm, type ActionHandle, type ActionInputOf, type ActionResultOf, type AuthHookOptions, type AuthSession, type BetterHooks, BetterSupabaseProvider, type BetterSupabaseProviderProps, type BlockEngineOptions, type BlockEventSource, type BlockMutationActions, type BlockMutationState, type BlockQueryActions, type BlockQueryOptions, type BlockQueryState, type BlockRefetchOn, type BroadcastOptions, type ClaimsOf, type ClientLike, type Conflicts, type DataEngine, type DataEntry, type DataHooks, type DataSource, type DataState, type DataSyncState, type DataView, type DataWrites, type DebouncedSearch, type DebouncedSearchOptions, type ImageSource, type Impersonator, type LiveCount, type LiveCountHookOptions, type LiveCountSeed, type LiveQueryHookOptions, type MembershipClaim, type PendingState, type Presence, type PresenceHookOptions, type PresenceTopic, type ProfileOf, type RecordActionsOf, type RecordContextValue, type RecordFormState, type RecordInitial, type RecordListQueryStates, type RecordListState, type RecordListUrl, type RecordListUrlState, type RecordProviderKit, type RecordProviderProps, type RecordState, type RecordWriteHandlers, type RejectedChange, SessionProvider, type SessionProviderProps, type SignIn, type SignOut, type SignedUrl, type SignedUrlSource, type StorageImage, type SupportView, type Upload, type UploadStatus, type UploadTarget, type UseActionFormOptions, type UseActionOptions, type UseImageOptions, type UseRealtimeRelayOptions, type UseRecordFormOptions, type UseUploadOptions, createHooks, createRecordProvider, defineDataHooks, defineListHook, defineOneHook, escapeLike, fieldErrorsOf, supportOf, tenantOf, useAction, useActionForm, useAuth, useBlockEnv, useBlockEvent, useBlockMutation, useBlockQuery, useBlockTenant, useBroadcast, useConflicts, useController, useDebouncedSearch, useImage, useLatest, useLiveCount, useLiveQuery, usePresence, useRealtimeRelay, useRecordForm, useRecordListState, useSession, useSignIn, useSignOut, useSignedUrl, useSupabase, useSupportSession, useSyncStatus, useUpload };
@@ -1,4 +1,4 @@
1
- import { t as AuthSnapshot } from "../../bind-DWElQa6I.js";
1
+ import { t as AuthSnapshot } from "../../bind-DiGmjHzz.js";
2
2
  import { a as OAuthSignInOptions, i as OAuthClient, n as AuthLinkClient, o as WebBrowserLike, r as AuthLinkResult, t as AuthFailure } from "../../auth-link-DRjtI1Ky.js";
3
3
  import { a as AppStateLike, r as PowerSyncReconnect, t as NativeAuthzRefreshClient } from "../../authz-refresh-DIqPTJZe.js";
4
4
  import { i as authzUserTopic, r as AuthzVersionSource, t as AUTHZ_EVENT } from "../../authz-topic-C7n3kIm_.js";
@@ -1,14 +1,14 @@
1
1
  import { n as supportOf, t as SupportView } from "../support-view-Dn_YTGV4.js";
2
2
  import { c as Impersonator, n as AuthSession } from "../view-CVXHgadI.js";
3
- import { $ as ActionForm, A as useBlockEnv$1, B as RecordListQueryStates, C as useConflicts$1, D as defineDataHooks$1, F as useBlockMutation$1, G as RecordActionsOf, H as RecordListUrl, I as useBlockQuery$1, J as RecordProviderKit, K as RecordContextValue, L as RecordFormState, M as useController$1, N as useLatest$1, O as defineListHook$1, P as useBlockEvent$1, Q as createRecordProvider$1, R as UseRecordFormOptions, U as RecordListUrlState, V as RecordListState, W as useRecordListState$1, X as RecordState, Y as RecordProviderProps, Z as RecordWriteHandlers, _ as useRealtimeRelay$1, a as Upload, at as BetterSupabaseProvider, b as PresenceTopic, c as UseImageOptions, d as useSignedUrl$1, et as ActionHandle, f as useUpload$1, ft as useLiveQuery, g as UseRealtimeRelayOptions, h as useDebouncedSearch$1, i as StorageImage, it as BetterHooks, j as useBlockTenant$1, k as defineOneHook$1, l as UseUploadOptions, lt as useAuth, m as DebouncedSearchOptions, n as SignedUrl, o as UploadStatus, ot as BetterSupabaseProviderProps, p as DebouncedSearch, pt as useSupabase, q as RecordInitial, r as SignedUrlSource, s as UploadTarget, st as LiveCount, t as ImageSource, tt as UseActionFormOptions, u as useImage$1, ut as useBroadcast, v as Presence, w as useSyncStatus$1, x as usePresence$1, y as PresenceHookOptions, z as useRecordForm$1 } from "../index-DkJtM-9e.js";
3
+ import { $ as ActionForm, A as useBlockEnv$1, B as RecordListQueryStates, C as useConflicts$1, D as defineDataHooks$1, F as useBlockMutation$1, G as RecordActionsOf, H as RecordListUrl, I as useBlockQuery$1, J as RecordProviderKit, K as RecordContextValue, L as RecordFormState, M as useController$1, N as useLatest$1, O as defineListHook$1, P as useBlockEvent$1, Q as createRecordProvider$1, R as UseRecordFormOptions, U as RecordListUrlState, V as RecordListState, W as useRecordListState$1, X as RecordState, Y as RecordProviderProps, Z as RecordWriteHandlers, _ as useRealtimeRelay$1, a as Upload, at as BetterSupabaseProvider, b as PresenceTopic, c as UseImageOptions, d as useSignedUrl$1, et as ActionHandle, f as useUpload$1, ft as useLiveQuery, g as UseRealtimeRelayOptions, h as useDebouncedSearch$1, i as StorageImage, it as BetterHooks, j as useBlockTenant$1, k as defineOneHook$1, l as UseUploadOptions, lt as useAuth, m as DebouncedSearchOptions, n as SignedUrl, o as UploadStatus, ot as BetterSupabaseProviderProps, p as DebouncedSearch, pt as useSupabase, q as RecordInitial, r as SignedUrlSource, s as UploadTarget, st as LiveCount, t as ImageSource, tt as UseActionFormOptions, u as useImage$1, ut as useBroadcast, v as Presence, w as useSyncStatus$1, x as usePresence$1, y as PresenceHookOptions, z as useRecordForm$1 } from "../index-DDDHYXtr.js";
4
4
  import { st as QuerySpec } from "../db-blocks-CzhzWfvR.js";
5
- import { r as LiveCountSeed } from "../index-D9Sb8Ju5.js";
6
- import { C as LiveCountHookOptions, O as ProfileOf, S as ClientLike, T as LiveQueryHookOptions, _ as ActionInputOf, b as BroadcastOptions, k as UseActionOptions, t as fieldErrorsOf, v as ActionResultOf, x as ClaimsOf } from "../field-errors-B4SMTk2e.js";
5
+ import { r as LiveCountSeed } from "../index-DhS8Qkgj.js";
6
+ import { C as LiveCountHookOptions, O as ProfileOf, S as ClientLike, T as LiveQueryHookOptions, _ as ActionInputOf, b as BroadcastOptions, k as UseActionOptions, t as fieldErrorsOf, v as ActionResultOf, x as ClaimsOf } from "../field-errors-CjEgbjO9.js";
7
7
  import { a as useSignIn$1, i as SignOut, n as PendingState, o as useSignOut$1, r as SignIn, t as AuthHookOptions } from "../sign-in-C9pZE1kM.js";
8
8
  import { SessionProvider, SessionProviderProps } from "./session.js";
9
9
  import { t as escapeLike } from "../escape-like-BtorH1tO.js";
10
- import { t as tenantOf } from "../tenant-BpJ2F2b_.js";
11
- import { r as MembershipClaim } from "../entitlements-Go8BHqhr.js";
10
+ import { t as tenantOf } from "../tenant-BTnwa5oZ.js";
11
+ import { r as MembershipClaim } from "../entitlements-CRBZg5y2.js";
12
12
  /** The `react-server` build of `useSession`: await `bsb.claims()` instead. */
13
13
  export declare const useSession: <C = unknown, P = unknown>() => AuthSession<C, P>;
14
14
  /**
@@ -1,8 +1,8 @@
1
1
  import { D as AccessTopicPolicy, E as AccessPolicySql } from "../types-BlBju7Wa.js";
2
2
  import { et as TemplateParams, tt as TemplateValues } from "../bucket-DJu58KBb.js";
3
3
  import { t as RealtimeStatus } from "../realtime-status-D3oUx3o4.js";
4
- import { A as TriggerTopic, C as TopicSubscription, D as TriggerLookup, E as TopicTriggerValue, F as FanOutResult, I as TopicFanOutOptions, M as defineTopic, N as rowChange, O as TriggerOptions, P as rowKeys, S as TopicSubscribeOptions, T as TopicTriggerOptions, _ as TopicMessage, a as PresenceOutput, b as TopicPermission, c as RealtimeClient, d as SubscribeOptions, f as Subscription, g as TopicHandlers, h as TopicEvent, i as PresenceOptions, j as TriggerValue, k as TriggerPayloadMode, l as RowChange, m as Topic, n as PresenceInput, o as PresenceSchema, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas, u as RowKeys, v as TopicOptions, w as TopicTriggerLookup, x as TopicSqlOptions, y as TopicPayload } from "../topic-4KYLvvTB.js";
5
- import { a as watchTopic, i as topicPort, n as TopicPort, r as TopicWatch, t as TopicHandle } from "../watch-topic-C9DIO476.js";
6
- import { S as relayTopicPort, _ as subjectPresenceValues, a as LiveSource, b as RelayEventSourceConstructor, c as liveCount, d as realtimeChanges, f as SUBJECT_PRESENCE_TEMPLATE, g as subjectPresenceTopic, h as subjectPresence, i as LiveQueryOptions, l as liveQuery, m as SubjectPresenceValues, n as LiveCountOptions, o as LiveSubscription, p as SubjectPresenceTopic, r as LiveCountSeed, s as RealtimeChangesOptions, t as CountRunner, u as liveTopic, v as RelayClientOptions, x as relayRealtimeClient, y as RelayEventSource } from "../index-D9Sb8Ju5.js";
4
+ import { A as TriggerTopic, C as TopicSubscription, D as TriggerLookup, E as TopicTriggerValue, F as FanOutResult, I as TopicFanOutOptions, M as defineTopic, N as rowChange, O as TriggerOptions, P as rowKeys, S as TopicSubscribeOptions, T as TopicTriggerOptions, _ as TopicMessage, a as PresenceOutput, b as TopicPermission, c as RealtimeClient, d as SubscribeOptions, f as Subscription, g as TopicHandlers, h as TopicEvent, i as PresenceOptions, j as TriggerValue, k as TriggerPayloadMode, l as RowChange, m as Topic, n as PresenceInput, o as PresenceSchema, p as SubscriptionStatus, r as PresenceMember, s as PresenceSubscription, t as EventSchemas, u as RowKeys, v as TopicOptions, w as TopicTriggerLookup, x as TopicSqlOptions, y as TopicPayload } from "../topic-hu0RP7CG.js";
5
+ import { a as watchTopic, i as topicPort, n as TopicPort, r as TopicWatch, t as TopicHandle } from "../watch-topic-C_rGHxIA.js";
6
+ import { S as relayTopicPort, _ as subjectPresenceValues, a as LiveSource, b as RelayEventSourceConstructor, c as liveCount, d as realtimeChanges, f as SUBJECT_PRESENCE_TEMPLATE, g as subjectPresenceTopic, h as subjectPresence, i as LiveQueryOptions, l as liveQuery, m as SubjectPresenceValues, n as LiveCountOptions, o as LiveSubscription, p as SubjectPresenceTopic, r as LiveCountSeed, s as RealtimeChangesOptions, t as CountRunner, u as liveTopic, v as RelayClientOptions, x as relayRealtimeClient, y as RelayEventSource } from "../index-DhS8Qkgj.js";
7
7
  import { n as subjectReaders, t as SubjectReadersOptions } from "../subject-readers-fKAdJQGu.js";
8
8
  export { type AccessPolicySql, type AccessTopicPolicy, type CountRunner, type EventSchemas, type FanOutResult, type LiveCountOptions, type LiveCountSeed, type LiveQueryOptions, type LiveSource, type LiveSubscription, type PresenceInput, type PresenceMember, type PresenceOptions, type PresenceOutput, type PresenceSchema, type PresenceSubscription, type RealtimeChangesOptions, type RealtimeClient, type RealtimeStatus, type RelayClientOptions, type RelayEventSource, type RelayEventSourceConstructor, type RowChange, type RowKeys, SUBJECT_PRESENCE_TEMPLATE, type SubjectPresenceTopic, type SubjectPresenceValues, type SubjectReadersOptions, type SubscribeOptions, type Subscription, type SubscriptionStatus, type TemplateParams, type TemplateValues, type Topic, type TopicEvent, type TopicFanOutOptions, type TopicHandle, type TopicHandlers, type TopicMessage, type TopicOptions, type TopicPayload, type TopicPermission, type TopicPort, type TopicSqlOptions, type TopicSubscribeOptions, type TopicSubscription, type TopicTriggerLookup, type TopicTriggerOptions, type TopicTriggerValue, type TopicWatch, type TriggerLookup, type TriggerOptions, type TriggerPayloadMode, type TriggerTopic, type TriggerValue, defineTopic, liveCount, liveQuery, liveTopic, realtimeChanges, relayRealtimeClient, relayTopicPort, rowChange, rowKeys, subjectPresence, subjectPresenceTopic, subjectPresenceValues, subjectReaders, topicPort, watchTopic };
@@ -1,4 +1,4 @@
1
- import { G as EntitySchema, yn as FormFieldType } from "./define-block-By-LUpM_.js";
1
+ import { G as EntitySchema, yn as FormFieldType } from "./define-block-Cu67KCN1.js";
2
2
  /** The input a field renders: a forms block field type, or a date and time. */
3
3
  type RecordFormInput = FormFieldType | "datetime";
4
4
  /** One field of an entity form, in render order. */
@@ -1,13 +1,13 @@
1
- import { n as Controller, t as AuthPort } from "../controller-DFGNChQL.js";
1
+ import { n as Controller, t as AuthPort } from "../controller-BVee4yX8.js";
2
2
  import { _ as MyWorkKind, a as RecordSummaryOptions, c as Subjects, i as RecordSummary, n as MyWorkItem, r as MyWorkOptions } from "../subjects-C0_z3QUL.js";
3
3
  import { b as DbError, f as Result, t as AsyncResult } from "../result-CMqlHv82.js";
4
- import { p as SubscriptionStatus } from "../topic-4KYLvvTB.js";
5
- import { n as TopicPort } from "../watch-topic-C9DIO476.js";
4
+ import { p as SubscriptionStatus } from "../topic-hu0RP7CG.js";
5
+ import { n as TopicPort } from "../watch-topic-C_rGHxIA.js";
6
6
  import { et as RecordRef } from "../types-BlBju7Wa.js";
7
- import { A as BindingBlocks, B as PermissionFlags, C as defineRecordType, D as recordPermissionKeys, E as recordCan, F as LoadBindingsOptions, H as can, I as LoadedBindings, L as bindingCan, M as BindingName, N as BindingOf, O as recordSubject, P as BindingSource, R as countBinding, S as RecordWriteInput, T as plainData, U as permissionFlags, V as PermissionSet, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, j as BindingCheck, k as recordWriteInput, m as PlainBindings, p as PlainBinding, v as RecordTypePermissions, w as findBindingWrite, x as RecordTypeWriteOutput, y as RecordTypeSpec, z as loadBindings } from "../index-DzjugbCf.js";
8
- import { a as timelineBindings, c as RecordListCells, d as RecordListQuery, f as RecordListRow, h as defineRecordList, i as loadTimeline, l as RecordListColumn, m as RecordListSpec, n as Timeline, o as RecordList, p as RecordListSource, r as TimelineEntry, s as RecordListCell, t as LoadTimelineOptions, u as RecordListPage } from "../timeline-LHtdAJnM.js";
9
- import { a as RecordFormOptions, c as recordForm, i as RecordFormInput, n as RecordFormCustomField, o as RecordFormResult, r as RecordFormField, s as RecordFormValues, t as RecordForm } from "../record-form-B9-7RhYz.js";
10
- import { A as RecordBindingPermissions, B as recordBindingWrite, D as RecordBindingData, E as RecordBinding, F as RecordBindingWriteOutput, H as recordRowInput, I as RecordBindingWrites, L as RecordRowInput, M as RecordBindingWrite, N as RecordBindingWriteInput, O as RecordBindingDefinition, P as RecordBindingWriteName, R as TimelineItem, T as AnyRecordBindingWrite, V as recordEventMatches, j as RecordBindingResult, k as RecordBindingOptions, w as AnyRecordBinding, z as defineRecordBinding } from "../define-block-By-LUpM_.js";
7
+ import { A as BindingBlocks, B as PermissionFlags, C as defineRecordType, D as recordPermissionKeys, E as recordCan, F as LoadBindingsOptions, H as can, I as LoadedBindings, L as bindingCan, M as BindingName, N as BindingOf, O as recordSubject, P as BindingSource, R as countBinding, S as RecordWriteInput, T as plainData, U as permissionFlags, V as PermissionSet, _ as RecordTypeBlocks, b as RecordTypeWriteInput, d as BindingWritesOf, f as Plain, g as RecordType, h as RecordCan, j as BindingCheck, k as recordWriteInput, m as PlainBindings, p as PlainBinding, v as RecordTypePermissions, w as findBindingWrite, x as RecordTypeWriteOutput, y as RecordTypeSpec, z as loadBindings } from "../index-BTl5A8Aj.js";
8
+ import { a as timelineBindings, c as RecordListCells, d as RecordListQuery, f as RecordListRow, h as defineRecordList, i as loadTimeline, l as RecordListColumn, m as RecordListSpec, n as Timeline, o as RecordList, p as RecordListSource, r as TimelineEntry, s as RecordListCell, t as LoadTimelineOptions, u as RecordListPage } from "../timeline-B7kBQ1gh.js";
9
+ import { a as RecordFormOptions, c as recordForm, i as RecordFormInput, n as RecordFormCustomField, o as RecordFormResult, r as RecordFormField, s as RecordFormValues, t as RecordForm } from "../record-form-DTncyqVH.js";
10
+ import { A as RecordBindingPermissions, B as recordBindingWrite, D as RecordBindingData, E as RecordBinding, F as RecordBindingWriteOutput, H as recordRowInput, I as RecordBindingWrites, L as RecordRowInput, M as RecordBindingWrite, N as RecordBindingWriteInput, O as RecordBindingDefinition, P as RecordBindingWriteName, R as TimelineItem, T as AnyRecordBindingWrite, V as recordEventMatches, j as RecordBindingResult, k as RecordBindingOptions, w as AnyRecordBinding, z as defineRecordBinding } from "../define-block-Cu67KCN1.js";
11
11
  interface RecordControllerOptions<B extends BindingBlocks, N extends BindingName<B>> extends LoadBindingsOptions<B, N> {
12
12
  readonly source: BindingSource<B>;
13
13
  readonly auth: AuthPort;
@@ -2,10 +2,10 @@ import { r as withBlockHooks } from "./block-hooks-Bd5bRM9B.js";
2
2
  import { t as AsyncResult } from "./result-DrBaeIVt.js";
3
3
  import { t as contactsBlock } from "./manifest-D46SY8Og.js";
4
4
  import { t as dealsBlock } from "./manifest-jLh9Rwsh.js";
5
- import { t as invoicesBlock } from "./manifest-BRFen7mE.js";
6
- import { t as ordersBlock } from "./manifest-DxPMUjhY.js";
5
+ import { t as invoicesBlock } from "./manifest-Bb8S2tcs.js";
6
+ import { t as ordersBlock } from "./manifest-BvcIe5z_.js";
7
7
  import { t as pipelinesBlock } from "./manifest-F35IzwVM.js";
8
- import { t as quotesBlock } from "./manifest-H65OlXiB.js";
8
+ import { t as quotesBlock } from "./manifest-CqJkmxrA.js";
9
9
  import { n as defineBlock } from "./define-block-D3uNVp2k.js";
10
10
  // src/blocks/sales/sales.ts
11
11
  /**
@@ -8,16 +8,16 @@ import { C as SupportSession, D as supportClaims, E as sqlSupportStore, S as Sup
8
8
  import { Dt as Events, pt as SupportEventData } from "../events-DN9PAcjq.js";
9
9
  import { _ as SupportAuthorize, a as AutomationHooks, b as TicketSubject, c as ChatActionHook, d as IdentityRef, f as IdentityTarget, g as SubscriberPolicy, h as SubscriberEvent, i as AuthorizationHooks, l as DelegationPermissions, m as Subscriber, n as Approver, o as AutomationRef, p as PrincipalByIdentity, r as ApproverOf, s as ChatAction, t as ApprovalRequestRef, u as DelegationRef, v as SupportAuthorizeInput, x as defineAuthorizationHooks, y as SupportDecision } from "../authorization-hooks-DM_ijJsD.js";
10
10
  import { a as PERMISSIONS_TRUNCATED_CLAIM, i as PERMISSIONS_CLAIM, n as FEATURES_CLAIM, o as PERMISSION_CAP_CLAIM, r as MEMBERSHIPS_CLAIM, t as AUTHZ_VERSION_CLAIM } from "../index-IKfbX_39.js";
11
- import { i as decodeEntitlementClaim, o as ClaimsRecord, s as ClaimsSource } from "../entitlements-Go8BHqhr.js";
11
+ import { i as decodeEntitlementClaim, o as ClaimsRecord, s as ClaimsSource } from "../entitlements-CRBZg5y2.js";
12
12
  import { a as isUserSession, c as Impersonator, i as isApiKeySession, l as impersonatorOf, n as AuthSession, o as toSession, r as UserSession, s as ImpersonationOptions, t as ApiKeySession } from "../view-CVXHgadI.js";
13
- import { n as isTruncated, r as permissionsOf, t as PermissionsOfOptions } from "../permissions-DxXor_NY.js";
13
+ import { n as isTruncated, r as permissionsOf, t as PermissionsOfOptions } from "../permissions-C5h1cU25.js";
14
14
  import { K as permissionCapOf } from "../types-CTb0Uroz.js";
15
15
  import { n as subjectReaders, t as SubjectReadersOptions } from "../subject-readers-fKAdJQGu.js";
16
16
  import { n as SqlClient } from "../executor-CnU5r1HS.js";
17
17
  import { j as StorageApi } from "../bucket-DJu58KBb.js";
18
18
  import { a as claimsFingerprint, i as SessionWatchStatus, n as SessionStatusRouteOptions, o as sessionStatusRoute, r as SessionStatusServer, t as SessionStatusBody } from "../session-status-ChvyVQgl.js";
19
19
  import { a as ProblemFormat, c as fromProblem, d as toProblem, i as ProblemDetails, l as isProblem, n as PROBLEM_CONTENT_TYPE, o as ProblemOptions, r as PROBLEM_TYPE_BASE, s as ProblemResponseOptions, u as problemResponse } from "../problem-BkuOcWRv.js";
20
- import { c as RealtimeClient } from "../topic-4KYLvvTB.js";
20
+ import { c as RealtimeClient } from "../topic-hu0RP7CG.js";
21
21
  import { n as supportOf, t as SupportView } from "../support-view-Dn_YTGV4.js";
22
22
  import { a as GuardEntryConfig, i as withBetterSupabase, n as BetterSupabaseContributions, o as withGuard, r as BetterSupabaseEntry, t as BetterSupabaseConfig } from "../composite-Ddap_a-U.js";
23
23
  import { a as serverCore, i as ServerCore, n as SessionEntryConfig, r as withSession, t as AuthOutageHook } from "../session-CfOsLGD_.js";