better-supabase 0.29.0 → 0.31.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 (208) hide show
  1. package/dist/{adapter-D4aNBxhm.js → adapter-BTbj5N9C.js} +2 -52
  2. package/dist/ai-sdk/agents/index.d.ts +2 -2
  3. package/dist/{app-tables-DekyKNQ8.d.ts → app-tables-B2mKMNRQ.d.ts} +1 -1
  4. package/dist/astro/index.js +2 -2
  5. package/dist/{authorization-C7nuWMuB.d.ts → authorization-DfEkyFt_.d.ts} +24 -3
  6. package/dist/{bind-DmUGUsBd.d.ts → bind-DAx0bMSi.d.ts} +2 -2
  7. package/dist/{block-env-DWtZsqhH.d.ts → block-env-Dz7Caxk0.d.ts} +3 -3
  8. package/dist/blocks/ai-chat/index.d.ts +3 -3
  9. package/dist/blocks/announcements/index.d.ts +3 -3
  10. package/dist/blocks/api-keys/index.d.ts +1 -1
  11. package/dist/blocks/attachments/index.d.ts +1 -1
  12. package/dist/blocks/audit/index.d.ts +2 -2
  13. package/dist/blocks/automations/index.d.ts +1 -1
  14. package/dist/blocks/billing/index.d.ts +1 -1
  15. package/dist/blocks/bookings/index.d.ts +1 -1
  16. package/dist/blocks/calendar/index.d.ts +7 -3
  17. package/dist/blocks/calendar/index.js +5 -1
  18. package/dist/blocks/comments/index.d.ts +4 -4
  19. package/dist/blocks/employees/index.js +1 -4
  20. package/dist/blocks/entitlements/index.d.ts +2 -2
  21. package/dist/blocks/forms/index.d.ts +1 -1
  22. package/dist/blocks/inbox/index.d.ts +4 -4
  23. package/dist/blocks/index.d.ts +1 -1
  24. package/dist/blocks/messaging/index.d.ts +4 -4
  25. package/dist/blocks/mfa/index.d.ts +1 -1
  26. package/dist/blocks/notifications/index.d.ts +3 -3
  27. package/dist/blocks/notifications/index.js +5 -43
  28. package/dist/blocks/onboarding/index.d.ts +1 -1
  29. package/dist/blocks/organizations/index.d.ts +34 -21
  30. package/dist/blocks/organizations/index.js +5 -1
  31. package/dist/blocks/permissions/index.d.ts +32 -3
  32. package/dist/blocks/permissions/index.js +23 -2
  33. package/dist/blocks/push/index.d.ts +10 -2
  34. package/dist/blocks/push/index.js +23 -7
  35. package/dist/blocks/reactions/index.d.ts +3 -3
  36. package/dist/blocks/saved-views/index.d.ts +1 -1
  37. package/dist/blocks/search/index.d.ts +2 -2
  38. package/dist/blocks/sessions/index.d.ts +1 -1
  39. package/dist/blocks/settings/index.d.ts +1 -1
  40. package/dist/blocks/subjects/index.d.ts +1 -1
  41. package/dist/blocks/tags/index.d.ts +1 -1
  42. package/dist/blocks/tasks/index.js +1 -1
  43. package/dist/blocks/teams/index.d.ts +7 -1
  44. package/dist/blocks/teams/index.js +8 -7
  45. package/dist/blocks/undo/index.d.ts +1 -1
  46. package/dist/blocks/usage/index.d.ts +1 -1
  47. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  48. package/dist/blocks/workflows/index.d.ts +3 -3
  49. package/dist/cli/{add-BKkV99g9.js → add-B9wP0YGU.js} +2 -2
  50. package/dist/cli/{add-CrQ3jS7t.js → add-DjZXKd7X.js} +10 -10
  51. package/dist/cli/add-ZcEOEK23.js +1 -0
  52. package/dist/cli/{app-table-files-PnPOpuB4.js → app-table-files-mtvjHa48.js} +2 -2
  53. package/dist/cli/{backfill-DDDLhinm.js → backfill-Coshdvh_.js} +2 -2
  54. package/dist/cli/bin.js +1 -1
  55. package/dist/cli/{blocks-tRfYx_mh.js → blocks-BWCuA0nq.js} +2 -2
  56. package/dist/cli/{blocks-BCVcjvbm.js → blocks-hiSazThw.js} +1 -1
  57. package/dist/cli/{cache-DQZ09YOg.js → cache-x2wWAy0h.js} +1 -1
  58. package/dist/cli/{codemod-HKuwQmi_.js → codemod-BnjV7BpC.js} +210 -11
  59. package/dist/cli/{command-DIPmo0wh.js → command-CCAwhiOh.js} +6 -0
  60. package/dist/cli/{completion-DxPxMtyP.js → completion-BJaB84Pe.js} +2 -2
  61. package/dist/cli/{completion-DyLMSjOD.js → completion-BkUhs1ms.js} +1 -1
  62. package/dist/cli/{completion-FUgqm2-N.js → completion-DmUVsUVQ.js} +2 -2
  63. package/dist/cli/{config-BfapErxs.js → config-zId1jkLx.js} +1 -1
  64. package/dist/cli/{content-mapper-B0ehR7K-.js → content-mapper-DvOSOdTE.js} +2 -2
  65. package/dist/cli/{db-CWvH1_46.js → db-DXKyVEDF.js} +1 -1
  66. package/dist/cli/{doctor-CXJOhwLB.js → doctor-Ywy8oJEU.js} +76 -18
  67. package/dist/cli/env-CNjT_uOV.js +1 -0
  68. package/dist/cli/{env-BM242BCV.js → env-XMiKvhtV.js} +2 -2
  69. package/dist/cli/{gen-B7rw4j19.js → gen-B-FbQmG1.js} +14 -14
  70. package/dist/cli/index.d.ts +1 -1
  71. package/dist/cli/index.js +7 -7
  72. package/dist/cli/{init-C1bXXB_P.js → init-fb9e1BKX.js} +9 -9
  73. package/dist/cli/{keys-V-HcO-21.js → keys-ORiPz1sM.js} +1 -1
  74. package/dist/cli/{live-PpAh9pAc.js → live-DIt7TP-N.js} +2 -2
  75. package/dist/cli/{mcp-BRNAchdH.js → mcp-CVWwraga.js} +3 -3
  76. package/dist/cli/{metadata-dAAKb_kR.js → metadata-CannIjel.js} +3 -3
  77. package/dist/cli/{migrate-BWYXFnaW.js → migrate-Ht2TzIQF.js} +2 -2
  78. package/dist/cli/{migration-safety-DGQswWZy.js → migration-safety-nNyB05I-.js} +1 -1
  79. package/dist/cli/{migrations-Cqk-lJwu.js → migrations-bAd7dpk1.js} +2 -2
  80. package/dist/cli/{module-migration-8-hMiZtW.js → module-migration-CkNux8dr.js} +2 -2
  81. package/dist/cli/{moved-DNOtp9LA.js → moved-C3WyRHkA.js} +1 -1
  82. package/dist/cli/{parse-BPf3kGnc.js → parse-DjHbTaFI.js} +1 -1
  83. package/dist/cli/{powersync-BWQ-8T3G.js → powersync-B2v0tDwp.js} +100 -7
  84. package/dist/cli/powersync-D3mAQ6QE.js +1 -0
  85. package/dist/cli/{print-DSTnq5xz.js → print-CxQ0rBKT.js} +2 -2
  86. package/dist/cli/{providers-Cjf5iOp5.js → providers-DtI90lSw.js} +1 -1
  87. package/dist/cli/{remove-CwG8cPv1.js → remove-DYtE4IZ4.js} +6 -6
  88. package/dist/cli/{render-B18iAdsT.js → render-QGWfEoiB.js} +3 -3
  89. package/dist/cli/{run-CvPl8iQd.js → run-B5aMwErM.js} +3 -3
  90. package/dist/cli/{run-C2Yg5MWt.js → run-BNoJKf5I.js} +40 -39
  91. package/dist/cli/{run-Wx_2Acgv.js → run-DiYX1XEa.js} +8 -8
  92. package/dist/cli/{seed-CDnL4Tnc.js → seed-C-Hu2n_E.js} +1 -1
  93. package/dist/cli/seed-Cm-c0BDd.js +1 -0
  94. package/dist/cli/{shared-BHbtUOvh.js → shared-D_CFi5di.js} +1 -1
  95. package/dist/cli/{skills-DM3oeIxY.js → skills-D98y0bSB.js} +1 -1
  96. package/dist/cli/{snapshot-CXgsUPGj.js → snapshot-BlQ4DDcJ.js} +9 -4
  97. package/dist/cli/{source-B6aMAoEK.js → source-CelMBQMj.js} +1 -1
  98. package/dist/cli/{spec-EO0TP84d.js → spec-BxcoGE0h.js} +1 -1
  99. package/dist/cli/{spec-BcYic005.js → spec-iBx1LcYO.js} +3 -3
  100. package/dist/cli/{sql-layout-CkxDNVEH.js → sql-layout-Dp4Rottt.js} +2 -2
  101. package/dist/cli/{stack-ClESAZYf.js → stack-B2slzrYH.js} +1 -1
  102. package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
  103. package/dist/cli/{sync-pq6gmlhG.js → sync-BnORI43S.js} +4 -4
  104. package/dist/cli/{table-dyKddjwo.js → table-D6HUECKI.js} +1 -1
  105. package/dist/cli/{upgrade-Dp9p7A69.js → upgrade-CR6-WmIc.js} +5 -5
  106. package/dist/cli/{upgrade-BoHb4h9P.js → upgrade-fz92aCnh.js} +3 -3
  107. package/dist/cli/{version-CQHFm-ak.js → version-Dz8ZlOuh.js} +1 -1
  108. package/dist/client/index.d.ts +5 -5
  109. package/dist/client/native/index.d.ts +4 -4
  110. package/dist/{composite-CBRbvn5j.js → composite-B4qB6k31.js} +2 -2
  111. package/dist/config/index.d.ts +2 -2
  112. package/dist/config/index.js +4 -4
  113. package/dist/{config-r7njjNgh.js → config-B7g-HDis.js} +3 -3
  114. package/dist/{config-bqKaPjst.js → config-R0m0fBiD.js} +1 -1
  115. package/dist/{context-B4TsE2gY.d.ts → context-DWWoP1wK.d.ts} +13 -1
  116. package/dist/{controller-CtwAsnVV.d.ts → controller-Br9dGKGe.d.ts} +1 -1
  117. package/dist/{controller-qG-B1eDn.js → controller-W97g2WGG.js} +1 -1
  118. package/dist/create/index.d.ts +3 -3
  119. package/dist/create/index.js +3 -3
  120. package/dist/create/lite/index.d.ts +3 -3
  121. package/dist/create/lite/index.js +3 -3
  122. package/dist/delivery-events-DbL8IHIY.js +53 -0
  123. package/dist/edge/index.js +3 -3
  124. package/dist/{entitlements-Bw3eYGKJ.d.ts → entitlements-CBjm2lvD.d.ts} +1 -1
  125. package/dist/eve/index.js +1 -1
  126. package/dist/expo/index.js +3 -2
  127. package/dist/{field-errors-DkzFduux.d.ts → field-errors-CEjsMAgd.d.ts} +4 -4
  128. package/dist/{framework-DYEUraqt.js → framework-CqiZk89W.js} +1 -1
  129. package/dist/hono/index.js +2 -2
  130. package/dist/{index-CB66nl14.d.ts → index-Clyd2Goi.d.ts} +1 -1
  131. package/dist/{index-Cw5gGSP8.d.ts → index-D98bQs8a.d.ts} +7 -7
  132. package/dist/{index-BNgpz_BV.d.ts → index-DIdPoQtO.d.ts} +2 -2
  133. package/dist/{index-BxckmAFc.d.ts → index-I8YLxKq8.d.ts} +2 -2
  134. package/dist/{index-CBQT_nXf.d.ts → index-eRBuKtMt.d.ts} +2 -2
  135. package/dist/{index-BM6NmKSc.d.ts → index-uIU65iEn.d.ts} +6 -6
  136. package/dist/{instances-C7qUTjhJ.js → instances-DY_ORk5g.js} +2 -0
  137. package/dist/mapper/bin.js +5 -5
  138. package/dist/mcp/index.d.ts +1 -1
  139. package/dist/mcp/index.js +1 -1
  140. package/dist/mcp/sdk/index.js +1 -1
  141. package/dist/next/index.d.ts +155 -13
  142. package/dist/next/index.js +245 -52
  143. package/dist/{operations-CqmQrTKw.d.ts → operations-hm1Isvvs.d.ts} +1 -1
  144. package/dist/{options-C4LuqmdG.js → options-CF6EVF_G.js} +3 -1
  145. package/dist/{options-COo7_3MX.js → options-DSCW40_5.js} +3 -1
  146. package/dist/orpc/index.js +2 -1
  147. package/dist/otel/index.js +4 -4
  148. package/dist/{ports-6LBgr1Aa.d.ts → ports-DOrPTJzl.d.ts} +1 -1
  149. package/dist/powersync/index.d.ts +204 -4
  150. package/dist/powersync/index.js +361 -4
  151. package/dist/preset/index.d.ts +3 -3
  152. package/dist/preset/index.js +3 -3
  153. package/dist/{preset-DCdEnJj9.js → preset-CXhpPmPV.js} +2 -2
  154. package/dist/{project-C4NA_van.js → project-DJ9Uo0sT.js} +5 -5
  155. package/dist/{push-token-BXsrJ7W9.d.ts → push-token-B4vcIU4s.d.ts} +1 -1
  156. package/dist/query/index.d.ts +1 -1
  157. package/dist/query/index.js +1 -1
  158. package/dist/react/index.d.ts +5 -5
  159. package/dist/react/index.js +1 -1
  160. package/dist/react/native/index.d.ts +1 -1
  161. package/dist/react/server.d.ts +5 -5
  162. package/dist/react/server.js +1 -1
  163. package/dist/{react-CcrQQl0_.js → react-mdVjpewL.js} +2 -2
  164. package/dist/react-router/index.js +2 -2
  165. package/dist/realtime/index.d.ts +3 -3
  166. package/dist/{record-type-DRbnlj5q.js → record-type-BEUyEsFx.js} +2 -2
  167. package/dist/records/index.d.ts +5 -5
  168. package/dist/records/index.js +3 -3
  169. package/dist/{replicas-Dyoh3CEg.js → refresh-DLBgnxjL.js} +51 -1
  170. package/dist/{resolved-names-iLBOUaib.js → resolved-names-kMRjmSIy.js} +1 -1
  171. package/dist/{runtime-CoKxZibd.js → runtime-LRJM7UqY.js} +19 -20
  172. package/dist/server/index.d.ts +3 -3
  173. package/dist/server/index.js +4 -4
  174. package/dist/sign-in-BzihC_8k.d.ts +50 -0
  175. package/dist/{sign-in-NO7LWlw4.js → sign-in-CuZ1Ag7O.js} +136 -26
  176. package/dist/solid/index.d.ts +5 -5
  177. package/dist/solid-start/index.js +2 -2
  178. package/dist/spec/index.js +1 -1
  179. package/dist/sql/index.d.ts +4 -4
  180. package/dist/sql/index.js +3 -3
  181. package/dist/{sql-CoBySj2F.js → sql-DHp0L7zK.js} +680 -333
  182. package/dist/ssr/index.d.ts +1 -1
  183. package/dist/svelte/index.d.ts +5 -5
  184. package/dist/sveltekit/index.js +2 -2
  185. package/dist/tanstack-start/index.js +2 -2
  186. package/dist/{tenant-Ded341Qz.d.ts → tenant-FfgNhd5x.d.ts} +1 -1
  187. package/dist/testing/index.d.ts +13 -4
  188. package/dist/testing/index.js +17 -15
  189. package/dist/{timeline-DvXtXq5q.d.ts → timeline-DqEoD8bb.d.ts} +1 -1
  190. package/dist/{timeline--VU3A1e4.js → timeline-Dz3hO2I6.js} +1 -1
  191. package/dist/{topic-XDdKzlrn.d.ts → topic-BaUElNw2.d.ts} +1 -1
  192. package/dist/{types-BFwB-E1j.d.ts → types-CMN0h_Ix.d.ts} +2 -2
  193. package/dist/vue/index.d.ts +5 -5
  194. package/dist/{watch-topic-DpN_GEoS.d.ts → watch-topic-BabDTZ-L.d.ts} +1 -1
  195. package/dist/workflow-sdk/world/index.js +2 -2
  196. package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-DJJkP0dT.js} +47 -8
  197. package/dist/yjs/index.d.ts +1 -1
  198. package/package.json +1 -1
  199. package/schemas/config-v1.json +10 -1
  200. package/schemas/doctor-report-v1.json +2 -0
  201. package/skills/better-supabase/references/ui-recipes.md +524 -295
  202. package/skills/better-supabase-api/references/powersync.md +16 -0
  203. package/skills/better-supabase-auth/SKILL.md +11 -1
  204. package/dist/cli/add-CwhrRJz5.js +0 -1
  205. package/dist/cli/env-uqfUbUzk.js +0 -1
  206. package/dist/cli/powersync-CbYxLsjv.js +0 -1
  207. package/dist/cli/seed-BOun22-k.js +0 -1
  208. package/dist/sign-in-CfwJAJJL.d.ts +0 -24
@@ -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-CtX6T0c0.js";
2
2
  import { n as toSession, t as AuthSession } from "../view-C8_xvD-j.js";
3
- import { r as MembershipClaim } from "../entitlements-Bw3eYGKJ.js";
3
+ import { r as MembershipClaim } from "../entitlements-CBjm2lvD.js";
4
4
  import { n as RefreshOutcome, r as refreshSession, t as RefreshOptions } from "../refresh-D02Pbf5B.js";
5
5
  import { a as sessionStatus, i as clearSessionCookies, n as SessionStatus, o as authContext, r as SessionStatusOptions, t as ClearSessionCookiesOptions } from "../ended-EZzN9QTM.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 };
@@ -2,12 +2,12 @@ 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-B2qbZps6.js";
3
3
  import { mt as QuerySpec } from "../define-D8_9X5fZ.js";
4
4
  import { tt as TemplateValues } from "../bucket-SvRQwYS4.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-XDdKzlrn.js";
6
- import { t as AuthSnapshot } from "../bind-DmUGUsBd.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-BaUElNw2.js";
6
+ import { t as AuthSnapshot } from "../bind-DAx0bMSi.js";
7
7
  import { t as AuthSession } from "../view-C8_xvD-j.js";
8
- import { n as Controller } from "../controller-CtwAsnVV.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-DkzFduux.js";
10
- import { n as BlockOptions } from "../block-env-DWtZsqhH.js";
8
+ import { n as Controller } from "../controller-Br9dGKGe.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-CEjsMAgd.js";
10
+ import { n as BlockOptions } from "../block-env-Dz7Caxk0.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 { t as DbException } from "../db-exception-Lngc1W49.js";
2
2
  import { r as dbErrorOf } from "../errors-BVFgt8BZ.js";
3
3
  import { c as toProblem } from "../problem-Bf0cJ7tk.js";
4
- import { c as extendServer, o as withFlush, s as createServer } from "../adapter-D4aNBxhm.js";
4
+ import { c as extendServer, o as withFlush, s as createServer } from "../adapter-BTbj5N9C.js";
5
5
  import { n as defaultExpose } from "../respond-CZMWbUs3.js";
6
6
  import { r as tagFor } from "../tags-CIZTqtlY.js";
7
7
  import { i as requireCaller, o as runAction } from "../kit-Bcd9wYCV.js";
8
8
  import { n as bufferInPlace, t as around } from "../shared-Bf-I13Ht.js";
9
- import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-DYEUraqt.js";
9
+ import { a as platformWaitUntil, i as localsOf, n as actionInput, r as frameworkEntry } from "../framework-CqiZk89W.js";
10
10
  import { i as refusalTarget } from "../refusal-DDlInPff.js";
11
11
  //#region src/bridges/sveltekit.ts
12
12
  /**
@@ -1,8 +1,8 @@
1
- import { c as extendServer, o as withFlush, s as createServer } from "../adapter-D4aNBxhm.js";
1
+ import { c as extendServer, o as withFlush, s as createServer } from "../adapter-BTbj5N9C.js";
2
2
  import { n as defaultExpose } from "../respond-CZMWbUs3.js";
3
3
  import { i as requireCaller, o as runAction } from "../kit-Bcd9wYCV.js";
4
4
  import { n as bufferInPlace, t as around } from "../shared-Bf-I13Ht.js";
5
- import { i as localsOf, r as frameworkEntry } from "../framework-DYEUraqt.js";
5
+ import { i as localsOf, r as frameworkEntry } from "../framework-CqiZk89W.js";
6
6
  import { r as refusalResponse } from "../refusal-DDlInPff.js";
7
7
  //#region src/bridges/tanstack-start.ts
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { t as AuthSnapshot } from "./bind-DmUGUsBd.js";
1
+ import { t as AuthSnapshot } from "./bind-DAx0bMSi.js";
2
2
  import { t as AuthSession } from "./view-C8_xvD-j.js";
3
3
  //#region src/auth/tenant.d.ts
4
4
  /**
@@ -9,7 +9,7 @@ import { a as BlockTransportMiddleware } from "../block-hooks-B8itxzEE.js";
9
9
  import { a as SessionActor, o as SessionDelegation } from "../actor-CoveJgya.js";
10
10
  import { P as QueueProvider } from "../types-CK2X2wCB.js";
11
11
  import { n as Embedder } from "../knowledge-CsLPACGJ.js";
12
- import { a as AuthorizationProvider } from "../authorization-C7nuWMuB.js";
12
+ import { a as AuthorizationProvider } from "../authorization-DfEkyFt_.js";
13
13
  import { o as StreamStore } from "../store-CpheI-lN.js";
14
14
  import { o as Authorizer } from "../authorizer-B6X09otb.js";
15
15
  import { Qt as CacheAdapter, Y as DbStats, t as BetterSupabase, y as Db } from "../define-D8_9X5fZ.js";
@@ -24,9 +24,9 @@ import { s as SqlClaims, t as BetterPostgres } from "../pool-DDR1ndk7.js";
24
24
  import { C as SupportSessionStore } from "../support-BxyPOFk4.js";
25
25
  import { r as GuardOptions } from "../respond-Dzu_-EPH.js";
26
26
  import { l as Transcriber, s as NoteTaker, u as TranscriberInput } from "../recordings-DeZYx-Kv.js";
27
- import { n as Controller } from "../controller-CtwAsnVV.js";
27
+ import { n as Controller } from "../controller-Br9dGKGe.js";
28
28
  import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-CZEfo-_M.js";
29
- import { Qt as GeneratorModel, Vt as Generator, Yt as GeneratorInput, cn as ResolvedConfig } from "../context-B4TsE2gY.js";
29
+ import { Qt as GeneratorModel, Vt as Generator, Yt as GeneratorInput, cn as ResolvedConfig } from "../context-DWWoP1wK.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-JcMd5lNP.js";
@@ -350,6 +350,10 @@ interface InstantLocator {
350
350
  timeout?: number;
351
351
  }): Promise<void>;
352
352
  count(): Promise<number>;
353
+ /** Playwright's `Locator.filter`; absent when a custom locator lacks it. */
354
+ filter?(options: {
355
+ visible?: boolean;
356
+ }): InstantLocator;
353
357
  }
354
358
  interface InstantExpectation {
355
359
  /** The navigation to hold, such as a click on a `<Link>`. */
@@ -485,12 +489,17 @@ interface ScopedSeed<M extends AnyModels, S> {
485
489
  * It creates a new tenant id, inserts the fixtures that `build` returns through
486
490
  * the service role (RLS and plugins don't apply), and hands back the inserted
487
491
  * rows. Call `cleanup()` in `afterEach` (or `await using`) to delete them. A
488
- * user from `asUser` then reads them over PostgREST like any other.
492
+ * user from `asUser` then reads them over PostgREST like any other. The access
493
+ * contract trusts a tenant claim only for a member, so seed the user's
494
+ * membership too (under the catalog model, `role` is the role's id).
489
495
  *
490
496
  * ```ts
491
497
  * const scope = await scopedSeed(
492
498
  * betterSupabase,
493
499
  * ({ tenant, id }) => ({
500
+ * memberships: {
501
+ * alice: { organizationId: tenant, userId: aliceId, role: "member" },
502
+ * },
494
503
  * customers: {
495
504
  * first: { organizationId: tenant, name: `first-${id()}` },
496
505
  * },
@@ -6,17 +6,18 @@ import { t as temporal } from "../temporal-required-DcLhnDhQ.js";
6
6
  import { a as ok } from "../result-ntFBW2p2.js";
7
7
  import { t as BetterSupabase } from "../define-D-dLADd5.js";
8
8
  import { a as toBase64Url, r as fromBase64, t as base64ToText } from "../base64-B9Wlsdj7.js";
9
- import { c as resolveConfig } from "../config-r7njjNgh.js";
9
+ import { c as resolveConfig } from "../config-B7g-HDis.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-CTDNuxRv.js";
11
11
  import { r as TRACKING_STATUSES, t as LABEL_FORMATS } from "../statuses-zRcc2TeZ.js";
12
- import { i as seedLite, n as loadLite, r as migrateLite, t as LITE_INSTALL } from "../runtime-CoKxZibd.js";
12
+ import { t as importOptionalPeer } from "../optional-peer-C1NbBRJm.js";
13
+ import { i as seedLite, n as loadLite, r as migrateLite, t as LITE_INSTALL } from "../runtime-LRJM7UqY.js";
13
14
  import { t as buildApiModel } from "../build-CH2N3Yf0.js";
14
15
  import { t as onBlockEvent } from "../block-event-listener-Bu6G0TFH.js";
15
16
  import { toCloudEvents } from "../events/index.js";
16
17
  import { ENV_VARIABLES } from "../env/index.js";
17
18
  import { t as defineController } from "../controller-BEliOBOv.js";
18
19
  import { H as rawError } from "../block-helpers-B0f0ZVb5.js";
19
- import "../replicas-Dyoh3CEg.js";
20
+ import { t as isPrefetch } from "../refresh-DLBgnxjL.js";
20
21
  import { i as defineAuthorizer, r as checkPermission, s as requestOf } from "../authorizer-BGhXaDmo.js";
21
22
  import { a as tenantCredentialRef } from "../provider-B6g7rBZX.js";
22
23
  import { t as postgresExecutor } from "../executor-C2Ne-Scm.js";
@@ -379,9 +380,10 @@ async function liteStack(options = {}) {
379
380
  }
380
381
  //#endregion
381
382
  //#region src/testing/budget.ts
382
- function isPrefetch(response) {
383
- const headers = response.request().headers();
384
- return headers["next-router-prefetch"] !== void 0 || headers["purpose"] === "prefetch" || (headers["sec-purpose"]?.includes("prefetch") ?? false);
383
+ function isPrefetchResponse(response) {
384
+ const request = response.request();
385
+ const headers = new Headers(request.headers());
386
+ return isPrefetch(new Request("http://budget.local/", { headers }));
385
387
  }
386
388
  function sleep$1(ms) {
387
389
  return new Promise((done) => {
@@ -414,7 +416,7 @@ async function expectPageBudget(page, expectation) {
414
416
  const headers = response.headers();
415
417
  const id = headers["x-bsb-request-id"];
416
418
  const stats = headers["x-bsb-stats"];
417
- if (!id || !stats || !expectation.prefetches && isPrefetch(response)) return;
419
+ if (!id || !stats || !expectation.prefetches && isPrefetchResponse(response)) return;
418
420
  lastSeen = Date.now();
419
421
  seen.push({
420
422
  response,
@@ -489,12 +491,7 @@ async function expectPageBudget(page, expectation) {
489
491
  * `undefined` so the caller can say how to add it.
490
492
  */
491
493
  async function loadInstant() {
492
- const specifier = "@next/playwright";
493
- try {
494
- return (await import(specifier)).instant;
495
- } catch {
496
- return;
497
- }
494
+ return (await importOptionalPeer("@next/playwright"))?.instant;
498
495
  }
499
496
  async function assertUnderLock(expectation) {
500
497
  const timeout = expectation.timeoutMs ?? 5e3;
@@ -507,7 +504,7 @@ async function assertUnderLock(expectation) {
507
504
  throw new Error(`expectInstant: ${String(locator)} was not visible under the instant() lock. It is not in the prefetched UI.`, { cause: error });
508
505
  }
509
506
  for (const locator of expectation.absent ?? []) {
510
- const count = await locator.count();
507
+ const count = await (locator.filter?.({ visible: true }) ?? locator).count();
511
508
  if (count > 0) throw new Error(`expectInstant: ${String(locator)} matched ${count} elements under the instant() lock. It should stream in after the navigation.`);
512
509
  }
513
510
  }
@@ -677,12 +674,17 @@ function env$1(names) {
677
674
  * It creates a new tenant id, inserts the fixtures that `build` returns through
678
675
  * the service role (RLS and plugins don't apply), and hands back the inserted
679
676
  * rows. Call `cleanup()` in `afterEach` (or `await using`) to delete them. A
680
- * user from `asUser` then reads them over PostgREST like any other.
677
+ * user from `asUser` then reads them over PostgREST like any other. The access
678
+ * contract trusts a tenant claim only for a member, so seed the user's
679
+ * membership too (under the catalog model, `role` is the role's id).
681
680
  *
682
681
  * ```ts
683
682
  * const scope = await scopedSeed(
684
683
  * betterSupabase,
685
684
  * ({ tenant, id }) => ({
685
+ * memberships: {
686
+ * alice: { organizationId: tenant, userId: aliceId, role: "member" },
687
+ * },
686
688
  * customers: {
687
689
  * first: { organizationId: tenant, name: `first-${id()}` },
688
690
  * },
@@ -2,7 +2,7 @@ import { D as ValidationIssue, t as AsyncResult } from "./result-DZeA5KS6.js";
2
2
  import { $ as RecordRef } from "./types-CPl9uJ0G.js";
3
3
  import { o as FilterField } from "./filter-query-DBt7OKuH.js";
4
4
  import { cn as RecordBindingResult, hn as TimelineItem, in as RecordBindingData } from "./define-block-DWVZSZv1.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-BM6NmKSc.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-uIU65iEn.js";
6
6
  import { c as ListParseOptions, m as ListSearchParams } from "./list-query-BcU8NnNL.js";
7
7
  //#region src/records/list.d.ts
8
8
  /**
@@ -1,4 +1,4 @@
1
- import { f as findBinding, p as loadBindings } from "./record-type-DRbnlj5q.js";
1
+ import { f as findBinding, p as loadBindings } from "./record-type-BEUyEsFx.js";
2
2
  //#region src/records/timeline.ts
3
3
  /** The binding names of `blocks` whose bindings map rows to timeline entries. */
4
4
  function timelineBindings(blocks) {
@@ -1,6 +1,6 @@
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-CPl9uJ0G.js";
3
- import { t as AuthorizationFunctions } from "./authorization-C7nuWMuB.js";
3
+ import { t as AuthorizationFunctions } from "./authorization-DfEkyFt_.js";
4
4
  import { t as BetterSupabase } from "./define-D8_9X5fZ.js";
5
5
  import { et as TemplateParams, tt as TemplateValues } from "./bucket-SvRQwYS4.js";
6
6
  import { g as SubscriberPolicy, h as SubscriberEvent, i as AuthorizationHooks, m as Subscriber } from "./authorization-hooks-BWhkMZfH.js";
@@ -1,5 +1,5 @@
1
- import { _r as AppColumnFormat, br as AppOnDeleteAction, hr as AppColumnAccess, kr as AppTableVersions, vr as AppColumnType, xi as Preset } from "./context-B4TsE2gY.js";
2
- import { k as DesignErrorCode } from "./index-CB66nl14.js";
1
+ import { _r as AppColumnFormat, br as AppOnDeleteAction, hr as AppColumnAccess, kr as AppTableVersions, vr as AppColumnType, xi as Preset } from "./context-DWWoP1wK.js";
2
+ import { k as DesignErrorCode } from "./index-Clyd2Goi.js";
3
3
  //#region src/create/issue.d.ts
4
4
  /** Where in the project pipeline an issue came from. */
5
5
  type IssueSource = "design" | "rules" | "sql" | "verifier" | "plan";
@@ -2,12 +2,12 @@ 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-B2qbZps6.js";
3
3
  import { mt as QuerySpec } from "../define-D8_9X5fZ.js";
4
4
  import { tt as TemplateValues } from "../bucket-SvRQwYS4.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-XDdKzlrn.js";
6
- import { t as AuthSnapshot } from "../bind-DmUGUsBd.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-BaUElNw2.js";
6
+ import { t as AuthSnapshot } from "../bind-DAx0bMSi.js";
7
7
  import { t as AuthSession } from "../view-C8_xvD-j.js";
8
- import { n as Controller } from "../controller-CtwAsnVV.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-DkzFduux.js";
10
- import { n as BlockOptions } from "../block-env-DWtZsqhH.js";
8
+ import { n as Controller } from "../controller-Br9dGKGe.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-CEjsMAgd.js";
10
+ import { n as BlockOptions } from "../block-env-Dz7Caxk0.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-nqUWKHEs.js";
13
13
  import { SupabaseClient } from "@supabase/supabase-js";
@@ -1,4 +1,4 @@
1
- import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-XDdKzlrn.js";
1
+ import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-BaUElNw2.js";
2
2
  //#region src/realtime/watch-topic.d.ts
3
3
  interface TopicWatch {
4
4
  readonly onMessage: (event: string, payload: unknown) => void;
@@ -1,10 +1,10 @@
1
1
  import { n as dbError } from "../../errors-BVFgt8BZ.js";
2
2
  import { o as problemResponse } from "../../problem-Bf0cJ7tk.js";
3
3
  import { i as sqlIdent } from "../../template-Drgg3v2J.js";
4
- import { i as WORLD_POSTGRES_VERSION, r as WORKFLOW_VAULT_SECRETS } from "../../workflow-sdk-CaEw822d.js";
4
+ import { i as WORLD_POSTGRES_VERSION, r as WORKFLOW_VAULT_SECRETS } from "../../workflow-sdk-DJJkP0dT.js";
5
+ import { n as memoized } from "../../optional-peer-C1NbBRJm.js";
5
6
  import { n as hmacHex, r as timingSafeEqual } from "../../hmac-B3CTTlfv.js";
6
7
  import { t as watchPoolErrors } from "../../pool-errors-JUBcGrre.js";
7
- import { n as memoized } from "../../optional-peer-C1NbBRJm.js";
8
8
  import { Pool } from "pg";
9
9
  import { reenqueueActiveRuns } from "@workflow/world";
10
10
  import { createWorld as createWorld$1 } from "@workflow/world-postgres";
@@ -32,17 +32,45 @@ const writeExtraColumns = (table, extras, source, where, into) => extras.length
32
32
  from jsonb_populate_record(null::${table}, (select coalesce(jsonb_object_agg(e.key, e.value), '{}') from jsonb_each(${source}) e where e.key in (${extras.map((extra) => sqlString(extra.name)).join(", ")}))) r
33
33
  where ${where}${into === void 0 ? "" : `\n returning x.* into ${into}`};`;
34
34
  /**
35
- * The extra columns an insert sets itself: those whose type is `not null`
36
- * without a `default`, which the update `writeExtraColumns` runs after the
37
- * insert would set too late. `columns` and `values` are `, a, b` lists for the
38
- * insert, reading `source` (a `jsonb` object keyed by column name); both are
39
- * empty when no extra column needs it, so the insert is unchanged.
35
+ * The `default` expression of an `extraColumns` type, such as `'en'` in `text
36
+ * not null default 'en'`, or undefined without one.
37
+ */
38
+ function extraColumnDefault(type) {
39
+ let quoted = false;
40
+ let depth = 0;
41
+ let start;
42
+ for (let index = 0; index < type.length; index += 1) {
43
+ const char = type.charAt(index);
44
+ if (char === "'") quoted = !quoted;
45
+ if (quoted) continue;
46
+ depth += char === "(" ? 1 : char === ")" ? -1 : 0;
47
+ if (depth !== 0 || !/\s/u.test(type.charAt(index - 1) || " ")) continue;
48
+ const rest = type.slice(index);
49
+ if (start === void 0) {
50
+ const match = /^default\s+/iu.exec(rest);
51
+ start = match === null ? void 0 : index + match[0].length;
52
+ } else if (CONSTRAINT_WORD.test(rest)) return type.slice(start, index).trim();
53
+ }
54
+ return start === void 0 ? void 0 : type.slice(start).trim();
55
+ }
56
+ const CONSTRAINT_WORD = /^(?:not\s+null|null|check|references|unique|primary\s+key|constraint|generated|collate)\b/iu;
57
+ /**
58
+ * The extra columns an insert sets itself: every one, read from `source` (a
59
+ * `jsonb` object keyed by column name), and the column's `default` when
60
+ * `source` leaves its key out. Writing them in the insert keeps a check across
61
+ * columns, or a `not null` column without a default, from failing before the
62
+ * update `writeExtraColumns` runs. `columns` and `values` are `, a, b` lists
63
+ * for the insert; both are empty without extra columns.
40
64
  */
41
65
  const insertExtraColumns = (table, extras, source) => {
42
- const required = extras.filter((extra) => /\bnot\s+null\b/iu.test(extra.type) && !/\bdefault\b/iu.test(extra.type));
66
+ const value = (extra) => {
67
+ const read = `(jsonb_populate_record(null::${table}, jsonb_build_object(${sqlString(extra.name)}, ${source} -> ${sqlString(extra.name)}))).${extra.ident}`;
68
+ const fallback = extraColumnDefault(extra.type);
69
+ return fallback === void 0 ? read : `case when ${source} ? ${sqlString(extra.name)} then ${read} else ${fallback} end`;
70
+ };
43
71
  return {
44
- columns: required.map((extra) => `, ${extra.ident}`).join(""),
45
- values: required.map((extra) => `, (jsonb_populate_record(null::${table}, coalesce(${source}, '{}'::jsonb))).${extra.ident}`).join("")
72
+ columns: extras.map((extra) => `, ${extra.ident}`).join(""),
73
+ values: extras.map((extra) => `, ${value(extra)}`).join("")
46
74
  };
47
75
  };
48
76
  /**
@@ -1053,6 +1081,11 @@ const OPTIONAL_MODULE_PERMISSIONS = {
1053
1081
  create: "tenant",
1054
1082
  delete: "tenant"
1055
1083
  },
1084
+ calendar: {
1085
+ create: "tenant",
1086
+ update: "tenant",
1087
+ delete: "tenant"
1088
+ },
1056
1089
  employees: {
1057
1090
  create: "tenant",
1058
1091
  contractsRead: "tenant",
@@ -1172,6 +1205,8 @@ const OPERATIONS = {
1172
1205
  "numbering.assign": "number_sequences.assign",
1173
1206
  "teams.manage": "teams.manage",
1174
1207
  "teams.read": "teams.read",
1208
+ "permissions.listRoles": "members.read",
1209
+ "permissions.setOverride": "roles.manage",
1175
1210
  "tags.manage": "tags.manage",
1176
1211
  "tags.read": "tags.read",
1177
1212
  "tags.apply": "tags.apply",
@@ -1540,6 +1575,10 @@ const MODULE_PERMISSION_SCOPES = {
1540
1575
  manage: "tenant",
1541
1576
  read: "tenant"
1542
1577
  },
1578
+ permissions: {
1579
+ listRoles: "tenant",
1580
+ setOverride: "tenant"
1581
+ },
1543
1582
  tags: {
1544
1583
  manage: "tenant",
1545
1584
  read: "tenant",
@@ -1,5 +1,5 @@
1
1
  import { t as AsyncResult } from "../result-DZeA5KS6.js";
2
- import { c as RealtimeClient, r as PresenceMember } from "../topic-XDdKzlrn.js";
2
+ import { c as RealtimeClient, r as PresenceMember } from "../topic-BaUElNw2.js";
3
3
  import { a as DocumentSuggestion, d as OpenedDocument, l as Documents, r as DocumentRef, t as DecidedSuggestion } from "../documents-BbwYyynk.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.29.0",
3
+ "version": "0.31.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",
@@ -3995,7 +3995,9 @@
3995
3995
  "calendarDetails": {
3996
3996
  "type": "boolean",
3997
3997
  "default": false
3998
- }
3998
+ },
3999
+ "ruleDialect": {},
4000
+ "readOnly": {}
3999
4001
  }
4000
4002
  }
4001
4003
  }
@@ -6325,6 +6327,13 @@
6325
6327
  "authorCanDelete": {
6326
6328
  "type": "boolean",
6327
6329
  "default": true
6330
+ },
6331
+ "notify": {
6332
+ "type": "boolean",
6333
+ "default": true
6334
+ },
6335
+ "actionPath": {
6336
+ "type": "string"
6328
6337
  }
6329
6338
  }
6330
6339
  }
@@ -87,6 +87,7 @@
87
87
  "BS236",
88
88
  "BS237",
89
89
  "BS238",
90
+ "BS239",
90
91
  "BS301",
91
92
  "BS302",
92
93
  "BS303",
@@ -160,6 +161,7 @@
160
161
  "BS503",
161
162
  "BS504",
162
163
  "BS505",
164
+ "BS506",
163
165
  "BS601",
164
166
  "BS602",
165
167
  "BS700",