better-supabase 0.16.0 → 0.17.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 (269) hide show
  1. package/dist/{ai-schedules-BmkARmQ9.d.ts → ai-schedules-Dk9H3kAp.d.ts} +1 -1
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{api-hHwieEfz.d.ts → api-CpL3hm87.d.ts} +1 -1
  4. package/dist/{app-tables-D29Rahtg.js → app-tables-Q0TYfeih.js} +1 -0
  5. package/dist/{app-tables-yMQ4ubyY.d.ts → app-tables-dS02piE7.d.ts} +1 -1
  6. package/dist/astro/index.d.ts +3 -3
  7. package/dist/{authorization-HZdJCaVm.d.ts → authorization-CNsvnwle.d.ts} +19 -3
  8. package/dist/better-result/index.d.ts +2 -2
  9. package/dist/{bind-JGCPGUJh.d.ts → bind-C801IaK-.d.ts} +4 -4
  10. package/dist/{block-env-y65GF_px.d.ts → block-env-BeG4DiiO.d.ts} +4 -4
  11. package/dist/blocks/access-requests/index.d.ts +1 -1
  12. package/dist/blocks/activities/index.d.ts +1 -1
  13. package/dist/blocks/agents/index.d.ts +1 -1
  14. package/dist/blocks/ai-cache/index.d.ts +1 -1
  15. package/dist/blocks/ai-chat/index.d.ts +4 -4
  16. package/dist/blocks/ai-files/index.d.ts +1 -1
  17. package/dist/blocks/ai-keys/index.d.ts +1 -1
  18. package/dist/blocks/ai-schedules/index.d.ts +2 -2
  19. package/dist/blocks/announcements/index.d.ts +4 -4
  20. package/dist/blocks/api-keys/index.d.ts +2 -2
  21. package/dist/blocks/approvals/index.d.ts +1 -1
  22. package/dist/blocks/assets/index.d.ts +1 -1
  23. package/dist/blocks/assignment/index.d.ts +1 -1
  24. package/dist/blocks/attachments/index.d.ts +2 -2
  25. package/dist/blocks/audit/index.d.ts +5 -5
  26. package/dist/blocks/automations/index.d.ts +3 -3
  27. package/dist/blocks/billable-time/index.d.ts +1 -1
  28. package/dist/blocks/billing/index.d.ts +3 -3
  29. package/dist/blocks/bookings/index.d.ts +2 -2
  30. package/dist/blocks/bulk/index.d.ts +1 -1
  31. package/dist/blocks/calendar/index.d.ts +2 -2
  32. package/dist/blocks/catalog/index.d.ts +1 -1
  33. package/dist/blocks/channels/index.d.ts +1 -1
  34. package/dist/blocks/collections/index.d.ts +1 -1
  35. package/dist/blocks/comments/index.d.ts +5 -5
  36. package/dist/blocks/compliance/index.d.ts +1 -1
  37. package/dist/blocks/connectors/index.d.ts +1 -1
  38. package/dist/blocks/contacts/index.d.ts +1 -1
  39. package/dist/blocks/content/index.d.ts +1 -1
  40. package/dist/blocks/contracts/index.d.ts +1 -1
  41. package/dist/blocks/courses/index.d.ts +1 -1
  42. package/dist/blocks/created-by/index.d.ts +4 -3
  43. package/dist/blocks/created-by/index.js +2 -2
  44. package/dist/blocks/custom-fields/index.d.ts +1 -1
  45. package/dist/blocks/data-lifecycle/index.d.ts +1 -1
  46. package/dist/blocks/deals/index.d.ts +1 -1
  47. package/dist/blocks/dispatch/index.d.ts +1 -1
  48. package/dist/blocks/documents/index.d.ts +1 -1
  49. package/dist/blocks/domains/index.d.ts +1 -1
  50. package/dist/blocks/donations/index.d.ts +1 -1
  51. package/dist/blocks/drive/index.d.ts +1 -1
  52. package/dist/blocks/employees/index.d.ts +2 -2
  53. package/dist/blocks/enrichment/index.d.ts +1 -1
  54. package/dist/blocks/enrollments/index.d.ts +1 -1
  55. package/dist/blocks/entitlements/index.d.ts +3 -3
  56. package/dist/blocks/expenses/index.d.ts +1 -1
  57. package/dist/blocks/field-history/index.d.ts +1 -1
  58. package/dist/blocks/flags/index.d.ts +1 -1
  59. package/dist/blocks/forecasts/index.d.ts +1 -1
  60. package/dist/blocks/forms/index.d.ts +2 -2
  61. package/dist/blocks/goals/index.d.ts +1 -1
  62. package/dist/blocks/guests/index.d.ts +1 -1
  63. package/dist/blocks/hiring/index.d.ts +1 -1
  64. package/dist/blocks/identities/index.d.ts +1 -1
  65. package/dist/blocks/imports/index.d.ts +1 -1
  66. package/dist/blocks/inbox/index.d.ts +5 -5
  67. package/dist/blocks/incidents/index.d.ts +1 -1
  68. package/dist/blocks/index.d.ts +2 -2
  69. package/dist/blocks/inventory/index.d.ts +1 -1
  70. package/dist/blocks/invoices/index.d.ts +1 -1
  71. package/dist/blocks/knowledge/index.d.ts +1 -1
  72. package/dist/blocks/lead-scoring/index.d.ts +1 -1
  73. package/dist/blocks/leases/index.d.ts +1 -1
  74. package/dist/blocks/leave/index.d.ts +1 -1
  75. package/dist/blocks/ledger/index.d.ts +1 -1
  76. package/dist/blocks/mail-sync/index.d.ts +1 -1
  77. package/dist/blocks/memberships/index.d.ts +1 -1
  78. package/dist/blocks/memory/index.d.ts +1 -1
  79. package/dist/blocks/messaging/index.d.ts +5 -5
  80. package/dist/blocks/metrics/index.d.ts +1 -1
  81. package/dist/blocks/mfa/index.d.ts +2 -2
  82. package/dist/blocks/moderation/index.d.ts +1 -1
  83. package/dist/blocks/notifications/index.d.ts +4 -4
  84. package/dist/blocks/numbering/index.d.ts +1 -1
  85. package/dist/blocks/oauth-server/index.d.ts +1 -1
  86. package/dist/blocks/onboarding/index.d.ts +2 -2
  87. package/dist/blocks/orders/index.d.ts +2 -2
  88. package/dist/blocks/organizations/index.d.ts +2 -2
  89. package/dist/blocks/outbox/index.d.ts +1 -1
  90. package/dist/blocks/passes/index.d.ts +1 -1
  91. package/dist/blocks/permissions/index.d.ts +3 -3
  92. package/dist/blocks/pipelines/index.d.ts +1 -1
  93. package/dist/blocks/posts/index.d.ts +1 -1
  94. package/dist/blocks/profiles/index.d.ts +1 -1
  95. package/dist/blocks/promotions/index.d.ts +1 -1
  96. package/dist/blocks/push/index.d.ts +2 -2
  97. package/dist/blocks/queue/index.d.ts +1 -1
  98. package/dist/blocks/quotes/index.d.ts +1 -1
  99. package/dist/blocks/rank/index.d.ts +1 -1
  100. package/dist/blocks/reactions/index.d.ts +4 -4
  101. package/dist/blocks/relations/index.d.ts +1 -1
  102. package/dist/blocks/reminders/index.d.ts +1 -1
  103. package/dist/blocks/reviews/index.d.ts +1 -1
  104. package/dist/blocks/saved-views/index.d.ts +3 -3
  105. package/dist/blocks/scores/index.d.ts +1 -1
  106. package/dist/blocks/search/index.d.ts +3 -3
  107. package/dist/blocks/security-events/index.d.ts +1 -1
  108. package/dist/blocks/segments/index.d.ts +1 -1
  109. package/dist/blocks/sequences/index.d.ts +1 -1
  110. package/dist/blocks/service-accounts/index.d.ts +1 -1
  111. package/dist/blocks/sessions/index.d.ts +2 -2
  112. package/dist/blocks/settings/index.d.ts +2 -2
  113. package/dist/blocks/share-links/index.d.ts +1 -1
  114. package/dist/blocks/shipments/index.d.ts +1 -1
  115. package/dist/blocks/signatures/index.d.ts +1 -1
  116. package/dist/blocks/signing-keys/index.d.ts +1 -1
  117. package/dist/blocks/sla/index.d.ts +1 -1
  118. package/dist/blocks/sso/index.d.ts +1 -1
  119. package/dist/blocks/state-machine/index.d.ts +1 -1
  120. package/dist/blocks/subjects/index.d.ts +2 -2
  121. package/dist/blocks/tags/index.d.ts +2 -2
  122. package/dist/blocks/tasks/index.d.ts +2 -2
  123. package/dist/blocks/teams/index.d.ts +1 -1
  124. package/dist/blocks/templates/index.d.ts +1 -1
  125. package/dist/blocks/time-tracking/index.d.ts +1 -1
  126. package/dist/blocks/timeline/index.d.ts +3 -3
  127. package/dist/blocks/trash/index.d.ts +1 -1
  128. package/dist/blocks/undo/index.d.ts +2 -2
  129. package/dist/blocks/updated-at/index.d.ts +7 -4
  130. package/dist/blocks/updated-at/index.js +2 -2
  131. package/dist/blocks/usage/index.d.ts +2 -2
  132. package/dist/blocks/vercel-marketplace/index.d.ts +1 -1
  133. package/dist/blocks/versions/index.d.ts +1 -1
  134. package/dist/blocks/waitlist/index.d.ts +1 -1
  135. package/dist/blocks/webhooks/index.d.ts +2 -2
  136. package/dist/blocks/workflow-editor/index.d.ts +4 -4
  137. package/dist/blocks/workflows/index.d.ts +4 -4
  138. package/dist/cli/{add-I8OW-qJH.js → add-BinNYhFD.js} +2 -2
  139. package/dist/cli/{add-D7TkPdco.js → add-DMcrsWjC.js} +13 -11
  140. package/dist/cli/add-z-3pXI6C.js +1 -0
  141. package/dist/cli/{backfill-DIz5DnlQ.js → backfill-DxBB62Zr.js} +3 -3
  142. package/dist/cli/bin.js +1 -1
  143. package/dist/cli/{blocks-xk-SE8gS.js → blocks-DSgTifw0.js} +1 -1
  144. package/dist/cli/{blocks-Bp5RPoft.js → blocks-rxOS-Mzz.js} +1 -1
  145. package/dist/cli/{cache-AznIssjI.js → cache-oU0yHKf0.js} +1 -1
  146. package/dist/cli/{codemod-Aewxza6i.js → codemod-Dsrv_3gQ.js} +1 -1
  147. package/dist/cli/{config-9t5ec_N7.js → config-2rwFHbwj.js} +3 -1
  148. package/dist/cli/{config-CBqkQjjN.js → config-C6XylzKz.js} +1 -1
  149. package/dist/cli/{content-mapper-DCrz6OIv.js → content-mapper-DLbXilBz.js} +2 -2
  150. package/dist/cli/{db-DrBI_HNv.js → db-Bwrr3GHM.js} +2 -2
  151. package/dist/cli/{doctor-DkOSLPEQ.js → doctor-CKt5Yyl4.js} +184 -142
  152. package/dist/cli/{gen-CFkYUnWq.js → gen-CeG6lbka.js} +13 -13
  153. package/dist/cli/index.d.ts +1 -1
  154. package/dist/cli/index.js +7 -7
  155. package/dist/cli/{init-CHj9ad4S.js → init-DrQlf9RL.js} +6 -6
  156. package/dist/cli/{live-DGdLR41j.js → live-BvWGM4c3.js} +2 -2
  157. package/dist/cli/{mcp-BZno503V.js → mcp-BrOnGB15.js} +2 -2
  158. package/dist/cli/{metadata-BfgHMe4q.js → metadata-BNSdPuKp.js} +3 -3
  159. package/dist/cli/{migration-safety-BnnXPAro.js → migration-safety-NtB3dsRU.js} +2 -2
  160. package/dist/cli/{module-migration-O_IxewFs.js → module-migration-mKhX88V_.js} +1 -1
  161. package/dist/cli/{print-DosQIFSy.js → print-Dh8iuPK3.js} +1 -1
  162. package/dist/cli/{remove-DK2G_KHm.js → remove-DfFXVBRr.js} +5 -5
  163. package/dist/cli/{render-5y5a1QZr.js → render-ChIwdIOJ.js} +10 -4
  164. package/dist/cli/{run-Bs4OKdDI.js → run-CLSHSVYo.js} +7 -7
  165. package/dist/cli/{run-MRET30vh.js → run-D48ZEU58.js} +24 -24
  166. package/dist/cli/{seed-Cz8PcXeT.js → seed-CG-pA-5N.js} +2 -2
  167. package/dist/cli/seed-CUxW5Dks.js +1 -0
  168. package/dist/cli/{shared-BLqbvY2x.js → shared-D0XBFSlz.js} +1 -1
  169. package/dist/cli/{snapshot-uTUlEzY2.js → snapshot-C6vh_n3t.js} +3 -3
  170. package/dist/cli/{source-D2gJHKwC.js → source-BZbEK5if.js} +1 -1
  171. package/dist/cli/{source-args-IpJRJO5t.js → source-args-MTLYpifA.js} +1 -1
  172. package/dist/cli/{spec-Cm2einTO.js → spec-B4LhpI6t.js} +2 -2
  173. package/dist/cli/{spec-DUjOtciN.js → spec-C-dhdKwa.js} +1 -1
  174. package/dist/cli/{sql-layout-lUWenjJw.js → sql-layout-26LSoifK.js} +2 -2
  175. package/dist/cli/{sync-CZMRB3aU.js → sync-CHGMZCJ5.js} +2 -2
  176. package/dist/cli/{upgrade-BFEIMC7U.js → upgrade-C0dVsqNX.js} +3 -3
  177. package/dist/cli/{upgrade-fVsJniXm.js → upgrade-GB9rqUGT.js} +2 -2
  178. package/dist/cli/{version-B2Dr6VmJ.js → version-T507a49w.js} +1 -1
  179. package/dist/client/index.d.ts +5 -5
  180. package/dist/client/native/index.d.ts +4 -4
  181. package/dist/{composite-CfYyU3vs.d.ts → composite-B7f1MMgr.d.ts} +3 -3
  182. package/dist/config/index.d.ts +3 -3
  183. package/dist/config/index.js +4 -4
  184. package/dist/{config-DWGgUQCh.js → config-BVNNJwGC.js} +7 -6
  185. package/dist/{config-CcehOvbz.js → config-CIBc79_8.js} +1 -1
  186. package/dist/{context-8kb8m5uO.d.ts → context-CKCgjEDF.d.ts} +9 -2
  187. package/dist/{controller-BW-5Opig.d.ts → controller-CJUXhshv.d.ts} +1 -1
  188. package/dist/{conversion-3iv2r7YC.d.ts → conversion-DgHdDlTK.d.ts} +1 -1
  189. package/dist/create/index.d.ts +2 -2
  190. package/dist/create/index.js +5 -5
  191. package/dist/{define-C5AcEkEJ.d.ts → define-Cgru0_kF.d.ts} +1 -1
  192. package/dist/{define-block-C1RHXz7L.d.ts → define-block-Xxw8Hroe.d.ts} +1 -1
  193. package/dist/edge/index.d.ts +5 -5
  194. package/dist/{entitlements-sO977DO-.d.ts → entitlements-B0jmjNLD.d.ts} +1 -1
  195. package/dist/{executor-BcNWcD-4.d.ts → executor-BWFfz0ik.d.ts} +2 -2
  196. package/dist/expo/index.d.ts +2 -2
  197. package/dist/{extension-B-lajjex.js → extension-DTaHjwdc.js} +3 -2
  198. package/dist/{extension-B0EjCYhO.js → extension-mGylYROs.js} +2 -10
  199. package/dist/{field-errors-Dt86dCKk.d.ts → field-errors-DqlebtTE.d.ts} +6 -6
  200. package/dist/{framework-BGdZVyPL.d.ts → framework-CF6zFU7a.d.ts} +3 -3
  201. package/dist/hono/index.d.ts +4 -4
  202. package/dist/{index-CcAmFNVi.d.ts → index-B8YjrfVl.d.ts} +2 -2
  203. package/dist/{index-CENWq3zb.d.ts → index-BCeTYhFk.d.ts} +1 -1
  204. package/dist/{index-Craf712U.d.ts → index-ClMN0f98.d.ts} +9 -9
  205. package/dist/{index-DZKCc2WM.d.ts → index-DUxXdQN_.d.ts} +3 -3
  206. package/dist/{index-Cc4mIQS8.d.ts → index-Dbb7BQdi.d.ts} +9 -4
  207. package/dist/{index-CTu-3fJB.d.ts → index-lB-8iPmY.d.ts} +3 -3
  208. package/dist/index.d.ts +1 -1
  209. package/dist/{instances-BHjCZoF8.js → instances-QOzIz9-q.js} +1 -1
  210. package/dist/list/index.d.ts +1 -1
  211. package/dist/{list-query-DYhgRTd5.d.ts → list-query-DxjuIHEL.d.ts} +1 -1
  212. package/dist/mapper/bin.js +6 -6
  213. package/dist/mcp/index.d.ts +4 -4
  214. package/dist/mcp/sdk/index.d.ts +2 -2
  215. package/dist/next/index.d.ts +14 -14
  216. package/dist/{operations-CSc_IsHO.d.ts → operations-Dc07aV_H.d.ts} +1 -1
  217. package/dist/{options-DChZoVfs.d.ts → options-B_NrjVDt.d.ts} +1 -0
  218. package/dist/{options-B2swWnJW.js → options-CCUaRLgd.js} +2 -1
  219. package/dist/{options-CM6-18FQ.d.ts → options-CDSCkYxu.d.ts} +1 -0
  220. package/dist/{options-C-dQHH5-.js → options-tSsUF0-7.js} +2 -1
  221. package/dist/orpc/index.d.ts +4 -4
  222. package/dist/otel/index.js +4 -4
  223. package/dist/{ports-mObLgH1z.d.ts → ports-DnpAuTvB.d.ts} +1 -1
  224. package/dist/powersync/index.d.ts +2 -2
  225. package/dist/preset/index.d.ts +3 -3
  226. package/dist/preset/index.js +3 -3
  227. package/dist/{preset-CsHnIBJF.js → preset-BIANzB5p.js} +2 -2
  228. package/dist/{push-token-BSSvsWXZ.d.ts → push-token-C_mFkYfq.d.ts} +1 -1
  229. package/dist/query/index.d.ts +1 -1
  230. package/dist/react/index.d.ts +5 -5
  231. package/dist/react/native/index.d.ts +1 -1
  232. package/dist/react/server.d.ts +6 -6
  233. package/dist/react-router/index.d.ts +3 -3
  234. package/dist/realtime/index.d.ts +3 -3
  235. package/dist/{record-form-D9ILuVtA.d.ts → record-form-xWvVcb86.d.ts} +1 -1
  236. package/dist/records/index.d.ts +7 -7
  237. package/dist/{resource-execute-Cpnob1Vj.d.ts → resource-execute-DqWfEc56.d.ts} +1 -1
  238. package/dist/{resource-types-pMeLs68X.d.ts → resource-types-BIoz_ElD.d.ts} +1 -1
  239. package/dist/{resources-7iq2-5_A.d.ts → resources-Bt2PDKE7.d.ts} +1 -1
  240. package/dist/server/index.d.ts +7 -7
  241. package/dist/{server-types-CK8mUIUT.d.ts → server-types-gR4Q1aM0.d.ts} +1 -1
  242. package/dist/{session-DWmFv3vB.d.ts → session-C1OuXbtN.d.ts} +1 -1
  243. package/dist/solid/index.d.ts +6 -6
  244. package/dist/solid-start/index.d.ts +3 -3
  245. package/dist/spec/index.d.ts +1 -1
  246. package/dist/sql/index.d.ts +5 -5
  247. package/dist/sql/index.js +3 -3
  248. package/dist/{sql-Dl3Alk43.js → sql-ClTmzHs8.js} +72 -31
  249. package/dist/sqlite/index.d.ts +1 -1
  250. package/dist/ssr/index.d.ts +1 -1
  251. package/dist/svelte/index.d.ts +6 -6
  252. package/dist/sveltekit/index.d.ts +4 -4
  253. package/dist/{tags-qvVk79pp.d.ts → tags-sM-CH9Mn.d.ts} +1 -1
  254. package/dist/tanstack-db/index.d.ts +1 -1
  255. package/dist/tanstack-start/index.d.ts +3 -3
  256. package/dist/{tenant-DOKIJI62.d.ts → tenant-DVvjw9H-.d.ts} +1 -1
  257. package/dist/testing/index.d.ts +7 -7
  258. package/dist/testing/index.js +3 -3
  259. package/dist/{timeline-CvTuXYvn.d.ts → timeline-BBfKuMVL.d.ts} +3 -3
  260. package/dist/{topic-CZXHhZye.d.ts → topic-BtLz-qTI.d.ts} +2 -2
  261. package/dist/{verify-CjvNLY7N.d.ts → verify-DEqY__0N.d.ts} +1 -1
  262. package/dist/vue/index.d.ts +6 -6
  263. package/dist/{watch-topic-BAxoPKZx.d.ts → watch-topic-tnfOTa3-.d.ts} +1 -1
  264. package/dist/yjs/index.d.ts +1 -1
  265. package/package.json +1 -1
  266. package/schemas/config-v1.json +22 -0
  267. package/schemas/doctor-report-v1.json +1 -0
  268. package/dist/cli/add-Bfb_ISrO.js +0 -1
  269. package/dist/cli/seed-D6XijwbR.js +0 -1
@@ -3,10 +3,10 @@ import { d as temporalText } from "./temporal-DLZlWbOi.js";
3
3
  import { r as NEGATIVE, t as FILTER_OPERATORS } from "./filter-query-DMoKo82_.js";
4
4
  import { a as ok } from "./result-ntFBW2p2.js";
5
5
  import { a as hasPlaceholder, l as splitPlaceholders, s as placeholderOf } from "./read-set-BnKnofIj.js";
6
- import { a as resolveNames, n as instancePrefix, o as resolveJsonSchema, r as isRenamedInstance, s as CONFIG_DEFAULTS } from "./instances-BHjCZoF8.js";
6
+ import { a as resolveNames, n as instancePrefix, o as resolveJsonSchema, r as isRenamedInstance, s as CONFIG_DEFAULTS } from "./instances-QOzIz9-q.js";
7
7
  import { t as DEFAULT_CLAIMS } from "./claims-Bp9My7XP.js";
8
8
  import { o as tenantNames, r as composeNames } from "./entity-naming-Dtyq5sKE.js";
9
- import { A as resolveBlock, D as BLOCK_SCOPES, _ as encryptedColumns, c as appTableEventKinds, g as columnsWithAccess, h as hasComputed, j as tenantNameOf, r as APP_RANK_COLUMN, t as APP_DELETED_AT_COLUMN, u as appTableVersions, v as hasColumnAccess, y as hiddenColumns } from "./app-tables-D29Rahtg.js";
9
+ import { A as resolveBlock, D as BLOCK_SCOPES, _ as encryptedColumns, c as appTableEventKinds, g as columnsWithAccess, h as hasComputed, j as tenantNameOf, r as APP_RANK_COLUMN, t as APP_DELETED_AT_COLUMN, u as appTableVersions, v as hasColumnAccess, y as hiddenColumns } from "./app-tables-Q0TYfeih.js";
10
10
  import { a as RATING_BOUNDS, n as CUSTOM_FIELD_TYPES, r as FIELD_FORMATS, t as CUSTOM_FIELD_FORM_TYPES } from "./field-formats-C6QKA3UR.js";
11
11
  import { a as sqlString, i as sqlIdent } from "./template-Drgg3v2J.js";
12
12
  import { i as fillTemplate, l as templatePlaceholders } from "./access-sql-B-MkVARa.js";
@@ -41,7 +41,7 @@ import { t as contactsSqlOptions } from "./options-BlncUmIc.js";
41
41
  import { t as contentSqlOptions } from "./options-1GgseJq5.js";
42
42
  import { t as contractsSqlOptions } from "./options-E7KcmHQv.js";
43
43
  import { t as coursesSqlOptions } from "./options-63AKQNv0.js";
44
- import { t as createdBySqlOptions } from "./options-B2swWnJW.js";
44
+ import { t as createdBySqlOptions } from "./options-CCUaRLgd.js";
45
45
  import { t as customFieldsSqlOptions } from "./options-BjtrC7o6.js";
46
46
  import { t as dataLifecycleSqlOptions } from "./options-C239TLRF.js";
47
47
  import { t as dealsSqlOptions } from "./options-DTDxFT6J.js";
@@ -114,7 +114,7 @@ import { t as teamsSqlOptions } from "./options-C6rEL6U5.js";
114
114
  import { t as templatesSqlOptions } from "./options-Fz6xqu-b.js";
115
115
  import { t as timeTrackingSqlOptions } from "./options-BbnPv6p7.js";
116
116
  import { t as trashSqlOptions } from "./options-DWbA9buW.js";
117
- import { t as updatedAtSqlOptions } from "./options-C-dQHH5-.js";
117
+ import { t as updatedAtSqlOptions } from "./options-tSsUF0-7.js";
118
118
  import { t as usageSqlOptions } from "./options-B9q8CROT.js";
119
119
  import { t as vercelMarketplaceSqlOptions } from "./options-RKYdmIdV.js";
120
120
  import { t as versionsSqlOptions } from "./options-BQIYfx9F.js";
@@ -41629,7 +41629,8 @@ const ACTOR = {
41629
41629
  options: [
41630
41630
  "createdBy",
41631
41631
  "updatedBy",
41632
- "impersonatedBy"
41632
+ "impersonatedBy",
41633
+ "stamp"
41633
41634
  ]
41634
41635
  },
41635
41636
  build: () => `${SCHEMA$5}
@@ -54742,6 +54743,11 @@ function providerEntitlementMembers(provider) {
54742
54743
  * column and key come from the module's own (possibly renamed) names.
54743
54744
  */
54744
54745
  function customerSource(ctx, layout) {
54746
+ const source = resolvedCustomerSource(ctx, layout);
54747
+ if (source === void 0) throw new TypeError("The entitlements module needs auth.entitlements.customer: the table.column with each tenant's Stripe customer id. With the managed billing or organizations module it defaults to that module's customer column.");
54748
+ return source;
54749
+ }
54750
+ function resolvedCustomerSource(ctx, layout) {
54745
54751
  const configured = layout.entitlements;
54746
54752
  if (configured?.table !== void 0 && configured.column !== void 0) return {
54747
54753
  table: configured.table,
@@ -54769,7 +54775,14 @@ function customerSource(ctx, layout) {
54769
54775
  deferred: true
54770
54776
  };
54771
54777
  }
54772
- throw new TypeError("The entitlements module needs auth.entitlements.customer: the table.column with each tenant's Stripe customer id. With the managed billing or organizations module it defaults to that module's customer column.");
54778
+ }
54779
+ function readsOrganizationCustomer(ctx, layout) {
54780
+ if (!ctx.installed("entitlements") || (layout.entitlements?.source ?? "stripe-sync") !== "stripe-sync") return false;
54781
+ const source = resolvedCustomerSource(ctx.of("entitlements"), layout);
54782
+ if (source === void 0) return false;
54783
+ const organizations = ctx.tableName("organizations");
54784
+ const [schema, table] = splitTable$1(source.table);
54785
+ return source.column === "stripe_customer_id" && schema === organizations.schema && table === organizations.name;
54773
54786
  }
54774
54787
  function entitlementsSource(source, layout) {
54775
54788
  const provider = layout.entitlementsProvider;
@@ -69465,7 +69478,9 @@ function platformTableSql(ctx) {
69465
69478
  if (!p || !ctx.manages) return "";
69466
69479
  const c = (logical) => p.col(logical);
69467
69480
  const add = (logical, type) => p.has(logical) ? `alter table ${p.table} add column if not exists ${c(logical)} ${type};\n` : "";
69468
- const where = openFilter(p, p.table).replaceAll(`${p.table}.`, "");
69481
+ const where = `${openFilter(p, p.table)}${p.only(p.table)}`.replaceAll(`${p.table}.`, "");
69482
+ const openEmailIndex = sharesTable(ctx) ? `drop index if exists ${sqlIdent(ctx.tableName("invitations").schema)}.platform_invitations_open_email_idx;
69483
+ create unique index if not exists invitations_platform_open_email_idx` : "create unique index if not exists platform_invitations_open_email_idx";
69469
69484
  return `
69470
69485
  -- Invitations to a platform role (the catalog model's platform assignments).
69471
69486
  create table if not exists ${p.table} (
@@ -69477,7 +69492,7 @@ create table if not exists ${p.table} (
69477
69492
  ${c("acceptedAt")} timestamptz
69478
69493
  );
69479
69494
  ${add("invitedBy", "uuid references auth.users (id) on delete set null")}${add("createdAt", "timestamptz not null default now()")}${add("acceptedBy", "uuid references auth.users (id) on delete set null")}${add("declinedAt", "timestamptz")}${add("revokedAt", "timestamptz")}
69480
- create unique index if not exists platform_invitations_open_email_idx
69495
+ ${openEmailIndex}
69481
69496
  on ${p.table} (lower(${c("email")})) where ${where};
69482
69497
  ${p.has("updatedAt") ? `${updatedAt(p.table, c("updatedAt"))}\n` : ""}${p.has("invitedBy") ? `create index if not exists platform_invitations_invited_by_idx on ${p.table} (${c("invitedBy")});\n` : ""}${p.has("acceptedBy") ? `create index if not exists platform_invitations_accepted_by_idx on ${p.table} (${c("acceptedBy")});\n` : ""}
69483
69498
  alter table ${p.table} enable row level security;
@@ -87076,7 +87091,7 @@ function idColumn(ctx, column) {
87076
87091
  default: return ctx.idType;
87077
87092
  }
87078
87093
  }
87079
- function table$2(ctx, n) {
87094
+ function table$2(ctx, n, layout) {
87080
87095
  if (!ctx.manages) return `
87081
87096
  -- Adopted: ${n.organization} belongs to the app (blocks.organizations.tables.organizations).
87082
87097
  `;
@@ -87090,7 +87105,7 @@ create table if not exists ${n.organization} (
87090
87105
  ${idColumn(ctx, n.id)},
87091
87106
  ${c("name")} text not null check (length(btrim(${c("name")})) > 0)${optional("slug", `${slugType} not null`)}${optional("createdBy", "uuid references auth.users (id) on delete set null")}${optional("createdAt", "timestamptz not null default now()")}${optional("disabledAt", "timestamptz")}${optional("deletedAt", "timestamptz")}
87092
87107
  );${addExtraColumns(n.organization, organizationExtraColumns(ctx))}
87093
- ${slugIndex}${ctx.has("organizations", "createdBy") ? `create index if not exists ${ctx.naming.rename("organizations_created_by_idx")} on ${n.organization} (${c("createdBy")});\n` : ""}${ctx.has("organizations", "updatedAt") ? `${updatedAt(n.organization, c("updatedAt"))}\n` : ""}${ctx.installed("entitlements") ? `-- The Stripe customer the entitlements module reads (config.entitlements.customer).
87108
+ ${slugIndex}${ctx.has("organizations", "createdBy") ? `create index if not exists ${ctx.naming.rename("organizations_created_by_idx")} on ${n.organization} (${c("createdBy")});\n` : ""}${ctx.has("organizations", "updatedAt") ? `${updatedAt(n.organization, c("updatedAt"))}\n` : ""}${readsOrganizationCustomer(ctx, layout) ? `-- The Stripe customer the entitlements module reads (config.entitlements.customer).
87094
87109
  alter table ${n.organization} add column if not exists ${ORGANIZATION_CUSTOMER_COLUMN} text unique;
87095
87110
  ` : ""}alter table ${n.organization} enable row level security;
87096
87111
  ${revokeTable(n.organization)}
@@ -87684,12 +87699,12 @@ const functionsOf$1 = (ctx, id) => [
87684
87699
  ...ctx.installed("invitations") ? [["list_organization_invitations", id]] : [],
87685
87700
  ...membershipDisabledAt(ctx) === void 0 ? [] : [["suspend_member", `${id}, uuid`], ["resume_member", `${id}, uuid`]]
87686
87701
  ];
87687
- function organizationsSql(ctx) {
87702
+ function organizationsSql(ctx, layout) {
87688
87703
  const n = namesOf$2(ctx);
87689
87704
  const grants = functionsOf$1(ctx, ctx.idType).map(([name, args]) => `revoke execute on function ${ctx.fn(name)}(${args}) from public, anon;
87690
87705
  grant execute on function ${ctx.fn(name)}(${args}) to authenticated, service_role;`).join("\n");
87691
87706
  return `${schemaPreamble(ctx)}
87692
- ${table$2(ctx, n)}${tenantKeys(ctx, n)}${slugCheck(ctx, n)}${create(ctx, n)}${organizationDeletion(ctx, n, {
87707
+ ${table$2(ctx, n, layout)}${tenantKeys(ctx, n)}${slugCheck(ctx, n)}${create(ctx, n)}${organizationDeletion(ctx, n, {
87693
87708
  platformOverride: platformOverride(ctx, "deletePlatform"),
87694
87709
  event
87695
87710
  })}${guards(ctx, n)}${members(ctx, n)}${memberSuspension(ctx, n, {
@@ -114647,7 +114662,11 @@ const UPDATED_AT = {
114647
114662
  target: "schema",
114648
114663
  names: {
114649
114664
  tables: {},
114650
- options: ["createdAt", "updatedAt"]
114665
+ options: [
114666
+ "createdAt",
114667
+ "updatedAt",
114668
+ "stamp"
114669
+ ]
114651
114670
  },
114652
114671
  build: () => `${SCHEMA$5}
114653
114672
 
@@ -126088,16 +126107,7 @@ function parsePolicy(statement) {
126088
126107
  }
126089
126108
  const BLOCK_PREFIX = "bsb_";
126090
126109
  const POLICY_EDIT = new RegExp(String.raw`^\s*(?:alter\s+policy|comment\s+on\s+policy)\s+(${NAME$9})\s+on\s+(${NAME$9}(?:\s*\.\s*${NAME$9})?)`, "i");
126091
- /**
126092
- * `sql` without the block's permissive `bsb_` policies that the app's own
126093
- * policies on the same table already cover for every command they grant (the
126094
- * comparison BS347 makes), so Postgres doesn't OR two policies that admit the
126095
- * same rows. A block policy that is wider stays, and BS347 reports it. The
126096
- * `drop policy if exists` before it stays too, so an earlier install's copy
126097
- * goes.
126098
- */
126099
- function withoutCoveredPolicies(sql, ownPolicies = {}) {
126100
- if (Object.keys(ownPolicies).length === 0) return sql;
126110
+ function withoutBlockPolicies(sql, skip, restrictive = false) {
126101
126111
  const masked = maskComments(sql);
126102
126112
  const skipped = /* @__PURE__ */ new Set();
126103
126113
  const statements = statementSpans(sql).map(([from, to]) => ({
@@ -126106,20 +126116,51 @@ function withoutCoveredPolicies(sql, ownPolicies = {}) {
126106
126116
  }));
126107
126117
  const kept = statements.map(({ text, masked: statement }) => {
126108
126118
  const parsed = parsePolicy(statement);
126109
- if (parsed === void 0 || !parsed.policy.name.startsWith(BLOCK_PREFIX) || !parsed.policy.permissive) return text;
126110
- const apps = (ownPolicies[parsed.table] ?? []).filter((policy) => !policy.name.startsWith(BLOCK_PREFIX));
126111
- const covering = COMMANDS.filter((command) => coversCommand(parsed.policy, command)).map((command) => coveringPolicy(parsed.policy, apps, command));
126112
- if (covering.length === 0 || covering.includes(void 0)) return text;
126119
+ if (parsed === void 0 || !parsed.policy.name.startsWith(BLOCK_PREFIX) || !(parsed.policy.permissive || restrictive)) return text;
126120
+ const comment = skip(parsed);
126121
+ if (comment === void 0) return text;
126113
126122
  skipped.add(`${parsed.table}\u0000${parsed.policy.name}`);
126114
- const names = [...new Set(covering.map((policy) => policy.name))].join(" and ");
126115
126123
  const start = statement.search(/\S/);
126116
- return `${text.slice(0, start === -1 ? 0 : start).trimEnd()}\n-- ${parsed.table}: the app's policy ${names} already allows what ${parsed.policy.name} would, so the block adds none.`;
126124
+ return `${text.slice(0, start === -1 ? 0 : start).trimEnd()}\n-- ${parsed.table}: ${comment}`;
126117
126125
  });
126118
126126
  return statements.map(({ masked: statement }, index) => {
126119
126127
  const edit = POLICY_EDIT.exec(statement);
126120
126128
  return edit !== null && skipped.has(`${qualified$8(edit[2])}\u0000${unquote$4(edit[1])}`) ? "" : kept[index];
126121
126129
  }).join("");
126122
126130
  }
126131
+ /**
126132
+ * `sql` without the block's permissive `bsb_` policies that the app's own
126133
+ * policies on the same table already cover for every command they grant (the
126134
+ * comparison BS347 makes), so Postgres doesn't OR two policies that admit the
126135
+ * same rows. A block policy that is wider stays, and BS347 reports it. The
126136
+ * `drop policy if exists` before it stays too, so an earlier install's copy
126137
+ * goes.
126138
+ */
126139
+ function withoutCoveredPolicies(sql, ownPolicies = {}) {
126140
+ if (Object.keys(ownPolicies).length === 0) return sql;
126141
+ return withoutBlockPolicies(sql, ({ table, policy }) => {
126142
+ const apps = (ownPolicies[table] ?? []).filter((own) => !own.name.startsWith(BLOCK_PREFIX));
126143
+ const covering = COMMANDS.filter((command) => coversCommand(policy, command)).map((command) => coveringPolicy(policy, apps, command));
126144
+ if (covering.length === 0 || covering.includes(void 0)) return;
126145
+ return `the app's policy ${[...new Set(covering.map((own) => own.name))].join(" and ")} already allows what ${policy.name} would, so the block adds none.`;
126146
+ });
126147
+ }
126148
+ const APP_POLICIES_NOTE = `the app's policies govern this table (ownTablePolicies "app"), so the block adds no`;
126149
+ const APP_POLICIES = new RegExp(String.raw`^-- (\S+): ${APP_POLICIES_NOTE.replaceAll(/[()]/g, String.raw`\$&`)} (\S+) for ([a-z, ]+)\.$`, "gm");
126150
+ function appTablePolicyNotes(sql) {
126151
+ return [...sql.matchAll(APP_POLICIES)].map(([, table = "", policy = "", commands = ""]) => ({
126152
+ table,
126153
+ policy,
126154
+ commands: COMMANDS.filter((command) => commands.split(", ").includes(command))
126155
+ }));
126156
+ }
126157
+ function withoutAppTablePolicies(sql, tables) {
126158
+ if (tables.size === 0) return sql;
126159
+ return withoutBlockPolicies(sql, ({ table, policy }) => {
126160
+ if (!tables.has(table)) return;
126161
+ return policy.permissive ? `${APP_POLICIES_NOTE} ${policy.name} for ${COMMANDS.filter((command) => coversCommand(policy, command)).join(", ")}.` : `${APP_POLICIES_NOTE} restrictive ${policy.name}.`;
126162
+ }, true);
126163
+ }
126123
126164
  const DROP_POLICY = new RegExp(String.raw`^\s*drop\s+policy\s+(?:if\s+exists\s+)?(${NAME$9})\s+on\s+(${NAME$9}(?:\s*\.\s*${NAME$9})?)`, "i");
126124
126165
  /**
126125
126166
  * The policies `sources` leave on each `schema.table` in `schemas`, in order: a
@@ -126302,7 +126343,7 @@ function moduleBody(name, layout = {}) {
126302
126343
  */
126303
126344
  function overApp(sql, ctx, layout) {
126304
126345
  const appTables = appTableSet(ctx);
126305
- return withoutUnmappedColumns(withoutUnmappedTables(blockNamesOnAppTables(withoutAppTableEdits(overAppTables(overAppViews(sql, appTableSet(ctx, ctx.appViews)), appTables, layout.ownColumns), appTables), appTables, layout.ownUpdatedAtTriggers), ctx.instance), ctx.instance);
126346
+ return withoutAppTablePolicies(withoutUnmappedColumns(withoutUnmappedTables(blockNamesOnAppTables(withoutAppTableEdits(overAppTables(overAppViews(sql, appTableSet(ctx, ctx.appViews)), appTables, layout.ownColumns), appTables), appTables, layout.ownUpdatedAtTriggers), ctx.instance), ctx.instance), ctx.config.ownTablePolicies === "app" ? appTables : /* @__PURE__ */ new Set());
126306
126347
  }
126307
126348
  /** The app's tables a module runs over, as `schema.table`. */
126308
126349
  function appTableSet(ctx, tables = ctx.appOwned) {
@@ -127382,4 +127423,4 @@ async function compileReadSets(sets) {
127382
127423
  return Promise.all(names.map((name) => compileReadSet(byName.get(name))));
127383
127424
  }
127384
127425
  //#endregion
127385
- export { contractSignature as $, moduleFileVersion as A, resolveExposeColumns as B, APP_TABLES_MARKER as C, blockSqlVersion as D, scopePolicyName as E, moduleSchemaExtensions as F, sameTenantTrigger as G, dataExportPlan as H, SQL_MODULES as I, currentBlockName as J, migrationOptionUses as K, resolveBlocks as L, moduleEventTriggers as M, moduleHidingColumns as N, blockFileState as O, modulePermissionKeys as P, MODULE_ID_TYPES as Q, TENANT_SCOPE_POLICY as R, moduleFilePaths as S, appTablesFiles as T, subjectColumns$1 as U, SECRET_COLUMNS as V, sameTenantColumn as W, renamedBlock as X, formerBlockName as Y, AUDIT_CATEGORIES as Z, moduleDeprecations as _, tenantsQuery as a, declaredUpdatedAtTriggers as at, widenedCommands as b, adoptedColumnProblems as c, policyGrants as ct, instanceFunctions as d, isBlockSqlIdType as et, entityRenamePlan as f, renderBlocks as g, moduleTopics as h, moduleLayout as i, declaredTables as it, sameBlockFile as j, isModuleDataFile as k, adoptedTables as l, rlsTables as lt, moduleBody as m, compileReadSets as n, BLOCK_OPTION_SCHEMAS as nt, expiredFlagsQuery as o, declaredViews as ot, customContracts as p, BLOCK_RENAMES as q, sharedRolesProblems as r, declaredTableColumns as rt, sameTenantLayout as s, extensionSchema as st, compileReadSet as t, moduleIdType as tt, adoptedViews as u, auditRegistrations as ut, upgradePlan as v, APP_TABLES_MODULE as w, moduleDataDir as x, declaredPolicies as y, excludedColumns as z };
127426
+ export { MODULE_ID_TYPES as $, isModuleDataFile as A, excludedColumns as B, moduleFilePaths as C, scopePolicyName as D, appTablesFiles as E, modulePermissionKeys as F, sameTenantColumn as G, SECRET_COLUMNS as H, moduleSchemaExtensions as I, BLOCK_RENAMES as J, sameTenantTrigger as K, SQL_MODULES as L, sameBlockFile as M, moduleEventTriggers as N, blockSqlVersion as O, moduleHidingColumns as P, AUDIT_CATEGORIES as Q, resolveBlocks as R, moduleDataDir as S, APP_TABLES_MODULE as T, dataExportPlan as U, resolveExposeColumns as V, subjectColumns$1 as W, formerBlockName as X, currentBlockName as Y, renamedBlock as Z, moduleDeprecations as _, tenantsQuery as a, declaredTables as at, declaredPolicies as b, adoptedColumnProblems as c, extensionSchema as ct, instanceFunctions as d, auditRegistrations as dt, contractSignature as et, entityRenamePlan as f, renderBlocks as g, moduleTopics as h, moduleLayout as i, declaredTableColumns as it, moduleFileVersion as j, blockFileState as k, adoptedTables as l, policyGrants as lt, moduleBody as m, compileReadSets as n, moduleIdType as nt, expiredFlagsQuery as o, declaredUpdatedAtTriggers as ot, customContracts as p, migrationOptionUses as q, sharedRolesProblems as r, BLOCK_OPTION_SCHEMAS as rt, sameTenantLayout as s, declaredViews as st, compileReadSet as t, isBlockSqlIdType as tt, adoptedViews as u, rlsTables as ut, upgradePlan as v, APP_TABLES_MARKER as w, widenedCommands as x, appTablePolicyNotes as y, TENANT_SCOPE_POLICY as z };
@@ -1,6 +1,6 @@
1
1
  import { Bt as Executor } from "../types-DFdg_4yN.js";
2
2
  import { c as LocalTablesOption, n as DataEngine, s as LiveEngineOptions } from "../data-engine-BWoz9lED.js";
3
- import { i as fromSqliteError, n as SqliteDatabaseLike, o as CheckSqliteOptions, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike } from "../executor-BcNWcD-4.js";
3
+ import { i as fromSqliteError, n as SqliteDatabaseLike, o as CheckSqliteOptions, r as SqliteExecutorOptions, s as checkSqlite, t as SqliteContextLike } from "../executor-BWFfz0ik.js";
4
4
  //#region src/sqlite/engine.d.ts
5
5
  /** A SQLite database that may report which tables changed. */
6
6
  interface ChangingSqliteDatabase extends SqliteDatabaseLike {
@@ -1,6 +1,6 @@
1
1
  import { C as readSession, D as writeSession, E as sessionEncoding, S as pruneSessionChunks, T as sessionCookieName, _ as StoredSession, a as ResolveAuthOptions, b as clearSessionAtScopes, d as CookieOptions, f as CookieRecord, g as SessionEncoding, h as DEFAULT_SESSION_ENCODING, l as resolveAuth, m as CookieWrite, n as AuthResolver, p as CookieScope, r as AuthState, t as AuthResolution, u as AUTH_CACHE_HEADERS, v as WriteSessionOptions, w as serializeCookie, x as parseCookies, y as applyCookieWrites } from "../resolve-CXX6DHv3.js";
2
2
  import { n as toSession, t as AuthSession } from "../view-DyFdMCqg.js";
3
- import { r as MembershipClaim } from "../entitlements-sO977DO-.js";
3
+ import { r as MembershipClaim } from "../entitlements-B0jmjNLD.js";
4
4
  import { n as RefreshOutcome, r as refreshSession, t as RefreshOptions } from "../refresh-DT_ICaK-.js";
5
5
  import { a as sessionStatus, i as clearSessionCookies, n as SessionStatus, o as authContext, r as SessionStatusOptions, t as ClearSessionCookiesOptions } from "../ended-gUsMZVNg.js";
6
6
  export { AUTH_CACHE_HEADERS, type AuthResolution, type AuthResolver, type AuthSession, type AuthState, type ClearSessionCookiesOptions, type CookieOptions, type CookieRecord, type CookieScope, type CookieWrite, DEFAULT_SESSION_ENCODING, type MembershipClaim, type RefreshOptions, type RefreshOutcome, type ResolveAuthOptions, type SessionEncoding, type SessionStatus, type SessionStatusOptions, type StoredSession, type WriteSessionOptions, applyCookieWrites, authContext, clearSessionAtScopes, clearSessionCookies, parseCookies, pruneSessionChunks, readSession, refreshSession, resolveAuth, serializeCookie, sessionCookieName, sessionEncoding, sessionStatus, toSession, writeSession };
@@ -1,13 +1,13 @@
1
1
  import { b as DbError } from "../result-DZeA5KS6.js";
2
2
  import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-vcqenSYU.js";
3
- import { pt as QuerySpec } from "../define-C5AcEkEJ.js";
3
+ import { pt as QuerySpec } from "../define-Cgru0_kF.js";
4
4
  import { tt as TemplateValues } from "../bucket-vc-QRrva.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-CZXHhZye.js";
6
- import { t as AuthSnapshot } from "../bind-JGCPGUJh.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-BtLz-qTI.js";
6
+ import { t as AuthSnapshot } from "../bind-C801IaK-.js";
7
7
  import { t as AuthSession } from "../view-DyFdMCqg.js";
8
- import { n as Controller } from "../controller-BW-5Opig.js";
9
- import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-Dt86dCKk.js";
10
- import { n as BlockOptions } from "../block-env-y65GF_px.js";
8
+ import { n as Controller } from "../controller-CJUXhshv.js";
9
+ import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DqlebtTE.js";
10
+ import { n as BlockOptions } from "../block-env-BeG4DiiO.js";
11
11
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
12
12
  import { SupabaseClient } from "@supabase/supabase-js";
13
13
  import { QueryClient } from "@tanstack/query-core";
@@ -1,12 +1,12 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
2
2
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
3
- import { t as BetterSupabase } from "../define-C5AcEkEJ.js";
4
- import { n as BetterServer } from "../server-types-CK8mUIUT.js";
3
+ import { t as BetterSupabase } from "../define-Cgru0_kF.js";
4
+ import { n as BetterServer } from "../server-types-gR4Q1aM0.js";
5
5
  import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-DOwKpSkA.js";
6
6
  import { t as RefusalRedirects } from "../refusal-CSntB_x8.js";
7
- import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-BGdZVyPL.js";
7
+ import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-CF6zFU7a.js";
8
8
  import { t as Validated } from "../shared-CRRfQAKG.js";
9
- import { i as tagFor } from "../tags-qvVk79pp.js";
9
+ import { i as tagFor } from "../tags-sM-CH9Mn.js";
10
10
  import { AnyEntry, Contributions } from "@supabase/middleware";
11
11
  import { StandardSchemaV1 } from "@standard-schema/spec";
12
12
  //#region src/bridges/sveltekit.d.ts
@@ -1,4 +1,4 @@
1
- import { Qt as CacheTarget, Zt as CacheAdapter } from "./define-C5AcEkEJ.js";
1
+ import { Qt as CacheTarget, Zt as CacheAdapter } from "./define-Cgru0_kF.js";
2
2
  //#region src/core/tags.d.ts
3
3
  interface TagOptions {
4
4
  /** The tenant the read is scoped to; `"*"` is every tenant's reads. */
@@ -1,5 +1,5 @@
1
1
  import { O as AnyFunctions, k as AnyModels, ut as TableKey } from "../types-DFdg_4yN.js";
2
- import { t as BetterSupabase, v as Db } from "../define-C5AcEkEJ.js";
2
+ import { t as BetterSupabase, v as Db } from "../define-Cgru0_kF.js";
3
3
  import { n as DataEngine } from "../data-engine-BWoz9lED.js";
4
4
  import { t as BetterQueryMeta } from "../invalidate-DMp4eqfF.js";
5
5
  import { QueryClient, SkipToken } from "@tanstack/query-core";
@@ -1,10 +1,10 @@
1
1
  import { O as AnyFunctions, k as AnyModels } from "../types-DFdg_4yN.js";
2
2
  import { l as PermissionRef, t as AnyAuthorizer } from "../authorizer-B6X09otb.js";
3
- import { t as BetterSupabase } from "../define-C5AcEkEJ.js";
4
- import { n as BetterServer } from "../server-types-CK8mUIUT.js";
3
+ import { t as BetterSupabase } from "../define-Cgru0_kF.js";
4
+ import { n as BetterServer } from "../server-types-gR4Q1aM0.js";
5
5
  import { a as AuthorizedContext, c as ResourceLoaderContext, i as AuthorizeOptions, l as Unwrapped, n as ActionParsed, o as BlockActionOptions, r as ActionResult, s as BlockRequireOptions } from "../kit-DOwKpSkA.js";
6
6
  import { t as RefusalRedirects } from "../refusal-CSntB_x8.js";
7
- import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-BGdZVyPL.js";
7
+ import { n as FrameworkOptions, r as LocalsResource, t as FrameworkLocals } from "../framework-CF6zFU7a.js";
8
8
  import { t as Validated } from "../shared-CRRfQAKG.js";
9
9
  import { AnyEntry, Contributions } from "@supabase/middleware";
10
10
  import { StandardSchemaV1 } from "@standard-schema/spec";
@@ -1,4 +1,4 @@
1
- import { t as AuthSnapshot } from "./bind-JGCPGUJh.js";
1
+ import { t as AuthSnapshot } from "./bind-C801IaK-.js";
2
2
  import { t as AuthSession } from "./view-DyFdMCqg.js";
3
3
  //#region src/auth/tenant.d.ts
4
4
  /**
@@ -9,14 +9,14 @@ import { a as BlockTransportMiddleware } from "../block-hooks-DZN2w69m.js";
9
9
  import { a as SessionActor, o as SessionDelegation } from "../actor-CoveJgya.js";
10
10
  import { P as QueueProvider } from "../types-Czq9Xtpa.js";
11
11
  import { n as Embedder } from "../knowledge-F1IhRI4Q.js";
12
- import { a as AuthorizationProvider } from "../authorization-HZdJCaVm.js";
12
+ import { a as AuthorizationProvider } from "../authorization-CNsvnwle.js";
13
13
  import { o as StreamStore } from "../store-CpheI-lN.js";
14
14
  import { o as Authorizer } from "../authorizer-B6X09otb.js";
15
- import { J as DbStats, Zt as CacheAdapter, t as BetterSupabase, v as Db } from "../define-C5AcEkEJ.js";
15
+ import { J as DbStats, Zt as CacheAdapter, t as BetterSupabase, v as Db } from "../define-Cgru0_kF.js";
16
16
  import { Q as StoragePath } from "../bucket-vc-QRrva.js";
17
- import { a as ServerContext, c as ServerOptions } from "../server-types-CK8mUIUT.js";
17
+ import { a as ServerContext, c as ServerOptions } from "../server-types-gR4Q1aM0.js";
18
18
  import { n as Impersonator } from "../impersonation-YTa9dZUv.js";
19
- import { tn as AnyRecordBinding } from "../define-block-C1RHXz7L.js";
19
+ import { tn as AnyRecordBinding } from "../define-block-Xxw8Hroe.js";
20
20
  import { n as Money } from "../money-BNRdJQzA.js";
21
21
  import { i as EventSink, t as CloudEvent } from "../cloud-event-CzZTJkXv.js";
22
22
  import { i as AuthorizationHooks } from "../authorization-hooks-D_pwXlBs.js";
@@ -24,9 +24,9 @@ import { s as SqlClaims, t as BetterPostgres } from "../pool-CrtT4dg-.js";
24
24
  import { C as SupportSessionStore } from "../support-B4ZBVxt3.js";
25
25
  import { r as GuardOptions } from "../respond-Dn1_YhC1.js";
26
26
  import { l as Transcriber, s as NoteTaker, u as TranscriberInput } from "../recordings-BBSJt_YV.js";
27
- import { n as Controller } from "../controller-BW-5Opig.js";
28
- import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-BmkARmQ9.js";
29
- import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-8kb8m5uO.js";
27
+ import { n as Controller } from "../controller-CJUXhshv.js";
28
+ import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-Dk9H3kAp.js";
29
+ import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-CKCgjEDF.js";
30
30
  import { r as WebhookInput } from "../signatures-Dkx9OE8j.js";
31
31
  import { n as Payment, o as PaymentProvider } from "../payments-BYcN34Fp.js";
32
32
  import { t as NotificationChannel } from "../channel-BjvGO39m.js";
@@ -6,7 +6,7 @@ import { t as temporal } from "../temporal-required-Dy0GGD8E.js";
6
6
  import { a as ok } from "../result-ntFBW2p2.js";
7
7
  import { t as BetterSupabase } from "../define-DlUeKHce.js";
8
8
  import { a as toBase64Url, r as fromBase64, t as base64ToText } from "../base64-B9Wlsdj7.js";
9
- import { c as resolveConfig } from "../config-DWGgUQCh.js";
9
+ import { c as resolveConfig } from "../config-BVNNJwGC.js";
10
10
  import { a as isScopeName, c as templateFunctions, l as templatePlaceholders, n as TEMPLATE_PLACEHOLDERS, s as scopeProblems, u as templateProblems } from "../access-sql-B-MkVARa.js";
11
11
  import { r as TRACKING_STATUSES, t as LABEL_FORMATS } from "../statuses-zRcc2TeZ.js";
12
12
  import { i as seedLite, n as loadLite, r as migrateLite, t as LITE_INSTALL } from "../runtime-CoKxZibd.js";
@@ -27,8 +27,8 @@ import { c as isMoney, d as money, l as isRate } from "../money-BZl985O-.js";
27
27
  import { t as SHIPPING_LINE } from "../tax-BkCNWWMc.js";
28
28
  import { t as trashExtension } from "../extension-DzCc0IOd.js";
29
29
  import { t as membershipsExtension } from "../extension-DeAd_MqI.js";
30
- import { t as createdByExtension } from "../extension-B-lajjex.js";
31
- import { t as updatedAtExtension } from "../extension-B0EjCYhO.js";
30
+ import { t as createdByExtension } from "../extension-DTaHjwdc.js";
31
+ import { t as updatedAtExtension } from "../extension-mGylYROs.js";
32
32
  import { t as buildApiModel } from "../build-QitPVzzO.js";
33
33
  import { createClient } from "@supabase/supabase-js";
34
34
  import { existsSync } from "node:fs";
@@ -1,9 +1,9 @@
1
1
  import { D as ValidationIssue, t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { $ as RecordRef } from "./types-DFdg_4yN.js";
3
3
  import { o as FilterField } from "./filter-query-BXLs72G9.js";
4
- import { cn as RecordBindingResult, hn as TimelineItem, in as RecordBindingData } from "./define-block-C1RHXz7L.js";
5
- import { A as BindingBlocks, F as LoadBindingsOptions, M as BindingName, N as BindingOf, P as BindingSource, V as PermissionSet, _ as RecordTypeBlocks, g as RecordType, h as RecordCan } from "./index-CcAmFNVi.js";
6
- import { c as ListParseOptions, m as ListSearchParams } from "./list-query-DYhgRTd5.js";
4
+ import { cn as RecordBindingResult, hn as TimelineItem, in as RecordBindingData } from "./define-block-Xxw8Hroe.js";
5
+ import { A as BindingBlocks, F as LoadBindingsOptions, M as BindingName, N as BindingOf, P as BindingSource, V as PermissionSet, _ as RecordTypeBlocks, g as RecordType, h as RecordCan } from "./index-B8YjrfVl.js";
6
+ import { c as ListParseOptions, m as ListSearchParams } from "./list-query-DxjuIHEL.js";
7
7
  //#region src/records/list.d.ts
8
8
  /**
9
9
  * How a binding fills a list column: `count` is how many rows it has (the
@@ -1,7 +1,7 @@
1
1
  import { D as ValidationIssue, b as DbError, t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { D as AccessTopicPolicy, O as AnyFunctions, it as Row, k as AnyModels, ut as TableKey } from "./types-DFdg_4yN.js";
3
- import { t as AuthorizationFunctions } from "./authorization-HZdJCaVm.js";
4
- import { t as BetterSupabase } from "./define-C5AcEkEJ.js";
3
+ import { t as AuthorizationFunctions } from "./authorization-CNsvnwle.js";
4
+ import { t as BetterSupabase } from "./define-Cgru0_kF.js";
5
5
  import { et as TemplateParams, tt as TemplateValues } from "./bucket-vc-QRrva.js";
6
6
  import { g as SubscriberPolicy, h as SubscriberEvent, i as AuthorizationHooks, m as Subscriber } from "./authorization-hooks-D_pwXlBs.js";
7
7
  import { t as RealtimeStatus } from "./realtime-status-BhNkb-Ow.js";
@@ -1,7 +1,7 @@
1
1
  /// <reference lib="esnext.temporal" />
2
2
  import { f as Result } from "./result-DZeA5KS6.js";
3
3
  import { O as AnyFunctions, it as Row, k as AnyModels, ut as TableKey } from "./types-DFdg_4yN.js";
4
- import { t as BetterSupabase } from "./define-C5AcEkEJ.js";
4
+ import { t as BetterSupabase } from "./define-Cgru0_kF.js";
5
5
  import { n as VerifyOptions, r as WebhookInput, t as VerifiedWebhook } from "./signatures-Dkx9OE8j.js";
6
6
  //#region src/blocks/webhooks/verify.d.ts
7
7
  /** The `Stripe-Signature` header for `body`, for tests and local replays. */
@@ -1,13 +1,13 @@
1
1
  import { b as DbError } from "../result-DZeA5KS6.js";
2
2
  import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-vcqenSYU.js";
3
- import { pt as QuerySpec } from "../define-C5AcEkEJ.js";
3
+ import { pt as QuerySpec } from "../define-Cgru0_kF.js";
4
4
  import { tt as TemplateValues } from "../bucket-vc-QRrva.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-CZXHhZye.js";
6
- import { t as AuthSnapshot } from "../bind-JGCPGUJh.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-BtLz-qTI.js";
6
+ import { t as AuthSnapshot } from "../bind-C801IaK-.js";
7
7
  import { t as AuthSession } from "../view-DyFdMCqg.js";
8
- import { n as Controller } from "../controller-BW-5Opig.js";
9
- import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-Dt86dCKk.js";
10
- import { n as BlockOptions } from "../block-env-y65GF_px.js";
8
+ import { n as Controller } from "../controller-CJUXhshv.js";
9
+ import { C as LiveCountSource, D as ProfileOf, E as PresenceTopic, O as UseActionOptions, S as LiveCountHookOptions, T as PresenceHookOptions, _ as ActionResultOf, a as DataRows, b as ClaimsOf, c as DataWrites, d as BlockMutationState, f as BlockQueryActions, g as ActionInputOf, h as BlockRefetchOn, i as DataRow, l as BlockEventSource, m as BlockQueryState, n as DataId, o as DataSource, p as BlockQueryOptions, r as DataListArgs, s as DataState, t as fieldErrorsOf, u as BlockMutationActions, v as ActionState, w as LiveQueryHookOptions, x as ClientLike, y as BroadcastOptions } from "../field-errors-DqlebtTE.js";
10
+ import { n as BlockOptions } from "../block-env-BeG4DiiO.js";
11
11
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-CiVa2G-J.js";
12
12
  import { t as SupportView } from "../support-view-BYOgwXsJ.js";
13
13
  import { SupabaseClient } from "@supabase/supabase-js";
@@ -1,4 +1,4 @@
1
- import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-CZXHhZye.js";
1
+ import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-BtLz-qTI.js";
2
2
  //#region src/realtime/watch-topic.d.ts
3
3
  interface TopicWatch {
4
4
  readonly onMessage: (event: string, payload: unknown) => void;
@@ -1,5 +1,5 @@
1
1
  import { t as AsyncResult } from "../result-DZeA5KS6.js";
2
- import { c as RealtimeClient, r as PresenceMember } from "../topic-CZXHhZye.js";
2
+ import { c as RealtimeClient, r as PresenceMember } from "../topic-BtLz-qTI.js";
3
3
  import { a as DocumentSuggestion, d as OpenedDocument, l as Documents, r as DocumentRef, t as DecidedSuggestion } from "../documents-Cup1rpjF.js";
4
4
  //#region src/yjs/yjs.d.ts
5
5
  type PresenceState = Readonly<Record<string, unknown>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue, framework integrations and the better-supabase CLI.",
5
5
  "keywords": [
6
6
  "cli",
@@ -217,6 +217,12 @@
217
217
  "type": "string",
218
218
  "description": "Who a block's rows belong to, unless the block sets its own scope: tenant (the default), user (the signed-in user, no tenants) or none (one shared space every signed-in user uses).",
219
219
  "default": "tenant"
220
+ },
221
+ "ownTablePolicies": {
222
+ "enum": ["block", "app"],
223
+ "type": "string",
224
+ "description": "Whose policies govern the app's tables a block runs over, unless the block sets its own ownTablePolicies: block (the default) lets a block add its bsb_ policies where none of the app's covers them, and app keeps every bsb_ policy, permissive or restrictive, off them.",
225
+ "default": "block"
220
226
  }
221
227
  },
222
228
  "additionalProperties": false
@@ -3050,6 +3056,11 @@
3050
3056
  "type": "string",
3051
3057
  "description": "Who the block's rows belong to: tenant, user or none. Defaults to database.sql.owner, then tenant."
3052
3058
  },
3059
+ "ownTablePolicies": {
3060
+ "enum": ["block", "app"],
3061
+ "type": "string",
3062
+ "description": "Whose policies govern the app's tables this block runs over: block lets it add its bsb_ policies where none of the app's covers them, app keeps every bsb_ policy, permissive or restrictive, off them. Applies to every app table of the block. Defaults to database.sql.ownTablePolicies, then block."
3063
+ },
3053
3064
  "functions": {
3054
3065
  "type": "object",
3055
3066
  "additionalProperties": {
@@ -3231,6 +3242,11 @@
3231
3242
  "type": "string",
3232
3243
  "description": "Who the block's rows belong to: tenant, user or none. Defaults to database.sql.owner, then tenant."
3233
3244
  },
3245
+ "ownTablePolicies": {
3246
+ "enum": ["block", "app"],
3247
+ "type": "string",
3248
+ "description": "Whose policies govern the app's tables this block runs over: block lets it add its bsb_ policies where none of the app's covers them, app keeps every bsb_ policy, permissive or restrictive, off them. Applies to every app table of the block. Defaults to database.sql.ownTablePolicies, then block."
3249
+ },
3234
3250
  "functions": {
3235
3251
  "type": "object",
3236
3252
  "properties": {
@@ -4257,6 +4273,9 @@
4257
4273
  "impersonatedBy": {
4258
4274
  "type": "string",
4259
4275
  "default": "impersonated_by"
4276
+ },
4277
+ "stamp": {
4278
+ "default": "client"
4260
4279
  }
4261
4280
  }
4262
4281
  }
@@ -6152,6 +6171,9 @@
6152
6171
  "updatedAt": {
6153
6172
  "type": "string",
6154
6173
  "default": "updated_at"
6174
+ },
6175
+ "stamp": {
6176
+ "default": "client"
6155
6177
  }
6156
6178
  }
6157
6179
  }
@@ -136,6 +136,7 @@
136
136
  "BS347",
137
137
  "BS348",
138
138
  "BS349",
139
+ "BS350",
139
140
  "BS401",
140
141
  "BS402",
141
142
  "BS403",
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-D7TkPdco.js";
@@ -1 +0,0 @@
1
- export { n as seedCommand } from "./seed-Cz8PcXeT.js";