better-supabase 0.29.0 → 0.30.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 (143) hide show
  1. package/dist/ai-sdk/agents/index.d.ts +2 -2
  2. package/dist/{app-tables-DekyKNQ8.d.ts → app-tables-yyVncXEt.d.ts} +1 -1
  3. package/dist/{authorization-C7nuWMuB.d.ts → authorization-CDU9tYA_.d.ts} +14 -0
  4. package/dist/{bind-DmUGUsBd.d.ts → bind-p7asfI6H.d.ts} +1 -1
  5. package/dist/{block-env-DWtZsqhH.d.ts → block-env-B8wG3xeh.d.ts} +3 -3
  6. package/dist/blocks/ai-chat/index.d.ts +3 -3
  7. package/dist/blocks/announcements/index.d.ts +3 -3
  8. package/dist/blocks/api-keys/index.d.ts +1 -1
  9. package/dist/blocks/attachments/index.d.ts +1 -1
  10. package/dist/blocks/audit/index.d.ts +2 -2
  11. package/dist/blocks/automations/index.d.ts +1 -1
  12. package/dist/blocks/billing/index.d.ts +1 -1
  13. package/dist/blocks/bookings/index.d.ts +1 -1
  14. package/dist/blocks/calendar/index.d.ts +1 -1
  15. package/dist/blocks/calendar/index.js +1 -1
  16. package/dist/blocks/comments/index.d.ts +4 -4
  17. package/dist/blocks/entitlements/index.d.ts +2 -2
  18. package/dist/blocks/forms/index.d.ts +1 -1
  19. package/dist/blocks/inbox/index.d.ts +4 -4
  20. package/dist/blocks/index.d.ts +1 -1
  21. package/dist/blocks/messaging/index.d.ts +4 -4
  22. package/dist/blocks/mfa/index.d.ts +1 -1
  23. package/dist/blocks/notifications/index.d.ts +3 -3
  24. package/dist/blocks/onboarding/index.d.ts +1 -1
  25. package/dist/blocks/organizations/index.d.ts +2 -2
  26. package/dist/blocks/permissions/index.d.ts +1 -1
  27. package/dist/blocks/push/index.d.ts +1 -1
  28. package/dist/blocks/reactions/index.d.ts +3 -3
  29. package/dist/blocks/saved-views/index.d.ts +1 -1
  30. package/dist/blocks/search/index.d.ts +2 -2
  31. package/dist/blocks/sessions/index.d.ts +1 -1
  32. package/dist/blocks/settings/index.d.ts +1 -1
  33. package/dist/blocks/subjects/index.d.ts +1 -1
  34. package/dist/blocks/tags/index.d.ts +1 -1
  35. package/dist/blocks/undo/index.d.ts +1 -1
  36. package/dist/blocks/usage/index.d.ts +1 -1
  37. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  38. package/dist/blocks/workflows/index.d.ts +3 -3
  39. package/dist/cli/add-BdhGOwkB.js +1 -0
  40. package/dist/cli/{add-CrQ3jS7t.js → add-D4w-Axib.js} +9 -9
  41. package/dist/cli/{add-BKkV99g9.js → add-Dggyehsy.js} +2 -2
  42. package/dist/cli/{app-table-files-PnPOpuB4.js → app-table-files-CiGuwLkO.js} +2 -2
  43. package/dist/cli/{backfill-DDDLhinm.js → backfill-DjVjXW_P.js} +1 -1
  44. package/dist/cli/bin.js +1 -1
  45. package/dist/cli/{blocks-BCVcjvbm.js → blocks-Bbmb6W_F.js} +1 -1
  46. package/dist/cli/{blocks-tRfYx_mh.js → blocks-jRL9K1R8.js} +1 -1
  47. package/dist/cli/{cache-DQZ09YOg.js → cache-BuoIFlUJ.js} +1 -1
  48. package/dist/cli/{codemod-HKuwQmi_.js → codemod-DRavXBCb.js} +1 -1
  49. package/dist/cli/{content-mapper-B0ehR7K-.js → content-mapper-BCtyfKXl.js} +2 -2
  50. package/dist/cli/{doctor-CXJOhwLB.js → doctor-Di2ZekfN.js} +49 -16
  51. package/dist/cli/{env-BM242BCV.js → env-B2CbnbzD.js} +1 -1
  52. package/dist/cli/env-CynGCICL.js +1 -0
  53. package/dist/cli/{gen-B7rw4j19.js → gen-STKC9vkK.js} +12 -12
  54. package/dist/cli/index.d.ts +1 -1
  55. package/dist/cli/index.js +6 -6
  56. package/dist/cli/{init-C1bXXB_P.js → init-DW6_nIwj.js} +8 -8
  57. package/dist/cli/{live-PpAh9pAc.js → live-0G4Plw3K.js} +2 -2
  58. package/dist/cli/{mcp-BRNAchdH.js → mcp-flKS8iU5.js} +2 -2
  59. package/dist/cli/{metadata-dAAKb_kR.js → metadata-VARUbXEe.js} +3 -3
  60. package/dist/cli/{migrate-BWYXFnaW.js → migrate-Bkq07XcT.js} +1 -1
  61. package/dist/cli/{migration-safety-DGQswWZy.js → migration-safety-BfVeza5j.js} +1 -1
  62. package/dist/cli/{migrations-Cqk-lJwu.js → migrations-BCq7Zs2E.js} +2 -2
  63. package/dist/cli/{module-migration-8-hMiZtW.js → module-migration-lbeUrsYv.js} +2 -2
  64. package/dist/cli/{powersync-BWQ-8T3G.js → powersync-B15CfH5Y.js} +3 -3
  65. package/dist/cli/powersync-DnBsDchT.js +1 -0
  66. package/dist/cli/{print-DSTnq5xz.js → print-DjxpBRnv.js} +2 -2
  67. package/dist/cli/{providers-Cjf5iOp5.js → providers-dyxcHQY3.js} +1 -1
  68. package/dist/cli/{remove-CwG8cPv1.js → remove-BLq5gbal.js} +5 -5
  69. package/dist/cli/{render-B18iAdsT.js → render-CizUf3RW.js} +3 -3
  70. package/dist/cli/{run-CvPl8iQd.js → run-ChEjR7yw.js} +2 -2
  71. package/dist/cli/{run-Wx_2Acgv.js → run-ChOY6s4o.js} +8 -8
  72. package/dist/cli/{run-C2Yg5MWt.js → run-MwM__teL.js} +24 -24
  73. package/dist/cli/{shared-BHbtUOvh.js → shared-DV5wIv-7.js} +1 -1
  74. package/dist/cli/{snapshot-CXgsUPGj.js → snapshot-B5LXkVMC.js} +2 -2
  75. package/dist/cli/{source-B6aMAoEK.js → source-BoLNG_2A.js} +1 -1
  76. package/dist/cli/{spec-EO0TP84d.js → spec-D6QeE2Zx.js} +1 -1
  77. package/dist/cli/{spec-BcYic005.js → spec-Dz-PGCaM.js} +2 -2
  78. package/dist/cli/{sql-layout-CkxDNVEH.js → sql-layout-zo02f3Dm.js} +2 -2
  79. package/dist/cli/{stack-env-6hS-WEmh.js → stack-env-3ziggrU3.js} +1 -1
  80. package/dist/cli/{sync-pq6gmlhG.js → sync-m-oZ_SyI.js} +4 -4
  81. package/dist/cli/{upgrade-Dp9p7A69.js → upgrade-C9sgVZ5z.js} +5 -5
  82. package/dist/cli/{upgrade-BoHb4h9P.js → upgrade-WwEJaX3i.js} +2 -2
  83. package/dist/cli/{version-CQHFm-ak.js → version-D2BQuqta.js} +1 -1
  84. package/dist/client/index.d.ts +5 -5
  85. package/dist/client/native/index.d.ts +4 -4
  86. package/dist/config/index.d.ts +2 -2
  87. package/dist/{context-B4TsE2gY.d.ts → context-nbYYjv7U.d.ts} +13 -1
  88. package/dist/{controller-CtwAsnVV.d.ts → controller-TRocodqG.d.ts} +1 -1
  89. package/dist/create/index.d.ts +3 -3
  90. package/dist/create/index.js +1 -1
  91. package/dist/create/lite/index.d.ts +3 -3
  92. package/dist/create/lite/index.js +1 -1
  93. package/dist/{entitlements-Bw3eYGKJ.d.ts → entitlements-B1i1-wfe.d.ts} +1 -1
  94. package/dist/{field-errors-DkzFduux.d.ts → field-errors-tJvehEFc.d.ts} +4 -4
  95. package/dist/{index-CBQT_nXf.d.ts → index-8US7qlvW.d.ts} +2 -2
  96. package/dist/{index-BNgpz_BV.d.ts → index-BKrxynq9.d.ts} +2 -2
  97. package/dist/{index-CB66nl14.d.ts → index-BkzXwuIN.d.ts} +1 -1
  98. package/dist/{index-BxckmAFc.d.ts → index-CWAQRWY8.d.ts} +2 -2
  99. package/dist/{index-Cw5gGSP8.d.ts → index-zsgNmE8m.d.ts} +6 -6
  100. package/dist/mapper/bin.js +5 -5
  101. package/dist/mcp/index.d.ts +1 -1
  102. package/dist/next/index.d.ts +86 -11
  103. package/dist/next/index.js +189 -49
  104. package/dist/{operations-CqmQrTKw.d.ts → operations-CB9atU2e.d.ts} +1 -1
  105. package/dist/{options-C4LuqmdG.js → options-BKBy5wM_.js} +2 -1
  106. package/dist/otel/index.js +4 -4
  107. package/dist/{ports-6LBgr1Aa.d.ts → ports-hpbyMySO.d.ts} +1 -1
  108. package/dist/powersync/index.d.ts +2 -2
  109. package/dist/preset/index.d.ts +3 -3
  110. package/dist/{project-C4NA_van.js → project-B32wb5J6.js} +1 -1
  111. package/dist/{push-token-BXsrJ7W9.d.ts → push-token-DQ1ycFPU.d.ts} +1 -1
  112. package/dist/react/index.d.ts +5 -5
  113. package/dist/react/native/index.d.ts +1 -1
  114. package/dist/react/server.d.ts +5 -5
  115. package/dist/realtime/index.d.ts +3 -3
  116. package/dist/records/index.d.ts +3 -3
  117. package/dist/server/index.d.ts +3 -3
  118. package/dist/server/index.js +1 -1
  119. package/dist/sign-in-BzihC_8k.d.ts +50 -0
  120. package/dist/{sign-in-NO7LWlw4.js → sign-in-Cyj3ZlFX.js} +120 -25
  121. package/dist/solid/index.d.ts +5 -5
  122. package/dist/sql/index.d.ts +4 -4
  123. package/dist/sql/index.js +2 -2
  124. package/dist/{sql-CoBySj2F.js → sql-CyeDg3Yh.js} +279 -171
  125. package/dist/ssr/index.d.ts +1 -1
  126. package/dist/svelte/index.d.ts +5 -5
  127. package/dist/{tenant-Ded341Qz.d.ts → tenant-C9YE_kqK.d.ts} +1 -1
  128. package/dist/testing/index.d.ts +3 -3
  129. package/dist/{topic-XDdKzlrn.d.ts → topic-breZqx_4.d.ts} +1 -1
  130. package/dist/{types-BFwB-E1j.d.ts → types-C3I7S51U.d.ts} +2 -2
  131. package/dist/vue/index.d.ts +5 -5
  132. package/dist/{watch-topic-DpN_GEoS.d.ts → watch-topic-ItO3dz8m.d.ts} +1 -1
  133. package/dist/workflow-sdk/world/index.js +1 -1
  134. package/dist/{workflow-sdk-CaEw822d.js → workflow-sdk-BWPsdzVK.js} +36 -8
  135. package/dist/yjs/index.d.ts +1 -1
  136. package/package.json +1 -1
  137. package/schemas/config-v1.json +2 -1
  138. package/schemas/doctor-report-v1.json +1 -0
  139. package/skills/better-supabase-auth/SKILL.md +8 -1
  140. package/dist/cli/add-CwhrRJz5.js +0 -1
  141. package/dist/cli/env-uqfUbUzk.js +0 -1
  142. package/dist/cli/powersync-CbYxLsjv.js +0 -1
  143. 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-B1i1-wfe.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-breZqx_4.js";
6
+ import { t as AuthSnapshot } from "../bind-p7asfI6H.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-TRocodqG.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-tJvehEFc.js";
10
+ import { n as BlockOptions } from "../block-env-B8wG3xeh.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,4 +1,4 @@
1
- import { t as AuthSnapshot } from "./bind-DmUGUsBd.js";
1
+ import { t as AuthSnapshot } from "./bind-p7asfI6H.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-CDU9tYA_.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-TRocodqG.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-nbYYjv7U.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";
@@ -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-CDU9tYA_.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-nbYYjv7U.js";
2
+ import { k as DesignErrorCode } from "./index-BkzXwuIN.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-breZqx_4.js";
6
+ import { t as AuthSnapshot } from "../bind-p7asfI6H.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-TRocodqG.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-tJvehEFc.js";
10
+ import { n as BlockOptions } from "../block-env-B8wG3xeh.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-breZqx_4.js";
2
2
  //#region src/realtime/watch-topic.d.ts
3
3
  interface TopicWatch {
4
4
  readonly onMessage: (event: string, payload: unknown) => void;
@@ -1,7 +1,7 @@
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-BWPsdzVK.js";
5
5
  import { n as hmacHex, r as timingSafeEqual } from "../../hmac-B3CTTlfv.js";
6
6
  import { t as watchPoolErrors } from "../../pool-errors-JUBcGrre.js";
7
7
  import { n as memoized } from "../../optional-peer-C1NbBRJm.js";
@@ -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}, coalesce(${source}, '{}'::jsonb))).${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
  /**
@@ -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-breZqx_4.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.30.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,8 @@
3995
3995
  "calendarDetails": {
3996
3996
  "type": "boolean",
3997
3997
  "default": false
3998
- }
3998
+ },
3999
+ "ruleDialect": {}
3999
4000
  }
4000
4001
  }
4001
4002
  }
@@ -160,6 +160,7 @@
160
160
  "BS503",
161
161
  "BS504",
162
162
  "BS505",
163
+ "BS506",
163
164
  "BS601",
164
165
  "BS602",
165
166
  "BS700",
@@ -169,7 +169,13 @@ membership lasts until the next refresh. When that window matters:
169
169
  - `bsb.invalidateSession(userId)` reaches the server caches and the caller's
170
170
  router only; another user's browser keeps its private entries until they
171
171
  go stale.
172
- - After signing in or out: `useSessionChange(sessionChanged)` from
172
+ - Sign in and out from a Server Action with `bsb.signIn`, `verifyOtp`,
173
+ `authorizeUrl` and `exchangeCode`, `verifyMfa` or `signOut`, then
174
+ `redirect(result.data.redirectTo)`. The result is plain data
175
+ (`redirectTo`, `mfa`); reads later in the action (`bsb.context()`,
176
+ `bsb.getRequestSession()`) see the new session, so build the landing
177
+ context from them.
178
+ - After signing in or out in the browser client: `useSessionChange(sessionChanged)` from
173
179
  `better-supabase/next/client`. After switching the active organization:
174
180
  `useSessionChange(sessionChanged, router, { refreshToken: supabase })`, so
175
181
  the new token reaches the server before it renders.
@@ -206,6 +212,7 @@ before touching the hook, claims, tenant or entitlements.
206
212
 
207
213
  https://bettersupabase.com/docs/auth.md,
208
214
  https://bettersupabase.com/docs/frameworks/next.md (bearer callers),
215
+ https://bettersupabase.com/docs/frameworks/next-auth.md (sign-in and sign-out),
209
216
  https://bettersupabase.com/docs/auth/account-deletion.md,
210
217
  https://bettersupabase.com/docs/frameworks/next-cache-components.md and
211
218
  https://bettersupabase.com/docs/extending/authorization-providers.md.
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-CrQ3jS7t.js";
@@ -1 +0,0 @@
1
- export { n as envCommand } from "./env-BM242BCV.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-BWQ-8T3G.js";
@@ -1,24 +0,0 @@
1
- import { f as Result } from "./result-DZeA5KS6.js";
2
- import { _ as StoredSession } from "./resolve-CtX6T0c0.js";
3
- import { t as RefreshOptions } from "./refresh-D02Pbf5B.js";
4
- //#region src/auth/sign-in.d.ts
5
- /**
6
- * `next` when it is a same-origin path (`/dashboard?tab=1`), else `fallback`.
7
- * Use it on any `?next=` or `redirectTo` value a request carries, so the value
8
- * can't send the user to another origin.
9
- */
10
- declare function safeRedirectPath(next: string | null | undefined, fallback: string): string;
11
- type PasswordGrantOptions = Omit<RefreshOptions, "now"> & {
12
- readonly now?: () => number;
13
- };
14
- /**
15
- * Signs in with an email and a password against the Auth server's password
16
- * grant, without a supabase-js client. Returns the session to write as
17
- * cookies.
18
- */
19
- declare function passwordGrant(credentials: {
20
- readonly email: string;
21
- readonly password: string;
22
- }, options: PasswordGrantOptions): Promise<Result<StoredSession>>;
23
- //#endregion
24
- export { passwordGrant as n, safeRedirectPath as r, PasswordGrantOptions as t };