better-supabase 0.37.0 → 0.38.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 (155) hide show
  1. package/dist/ai-sdk/agents/index.d.ts +2 -2
  2. package/dist/{app-tables-BlhdqqHf.d.ts → app-tables-D2c0i05-.d.ts} +1 -1
  3. package/dist/{authorization-C7yjZttV.d.ts → authorization-D8CaAdqU.d.ts} +7 -5
  4. package/dist/{bind-BspFMDdW.d.ts → bind-5vOwNouG.d.ts} +1 -1
  5. package/dist/{block-env-CLco8YUl.d.ts → block-env-hco8BLjC.d.ts} +3 -3
  6. package/dist/block-subjects-CINiJW1R.js +253 -0
  7. package/dist/{block-tables-DfomofFv.d.ts → block-tables-BsgdB6VG.d.ts} +1 -1
  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 +1 -1
  17. package/dist/blocks/catalog/index.d.ts +4 -0
  18. package/dist/blocks/catalog/index.js +10 -0
  19. package/dist/blocks/comments/index.d.ts +4 -4
  20. package/dist/blocks/entitlements/index.d.ts +2 -2
  21. package/dist/blocks/expenses/index.d.ts +2 -0
  22. package/dist/blocks/expenses/index.js +10 -3
  23. package/dist/blocks/forms/index.d.ts +1 -1
  24. package/dist/blocks/inbox/index.d.ts +4 -4
  25. package/dist/blocks/index.d.ts +1 -1
  26. package/dist/blocks/invoices/index.d.ts +15 -1
  27. package/dist/blocks/invoices/index.js +13 -0
  28. package/dist/blocks/leave/index.js +1 -1
  29. package/dist/blocks/messaging/index.d.ts +4 -4
  30. package/dist/blocks/mfa/index.d.ts +1 -1
  31. package/dist/blocks/notifications/index.d.ts +3 -3
  32. package/dist/blocks/onboarding/index.d.ts +1 -1
  33. package/dist/blocks/organizations/index.d.ts +2 -2
  34. package/dist/blocks/permissions/index.d.ts +1 -1
  35. package/dist/blocks/push/index.d.ts +1 -1
  36. package/dist/blocks/reactions/index.d.ts +3 -3
  37. package/dist/blocks/saved-views/index.d.ts +1 -1
  38. package/dist/blocks/search/index.d.ts +2 -2
  39. package/dist/blocks/sessions/index.d.ts +1 -1
  40. package/dist/blocks/settings/index.d.ts +1 -1
  41. package/dist/blocks/subjects/index.d.ts +1 -1
  42. package/dist/blocks/tags/index.d.ts +1 -1
  43. package/dist/blocks/undo/index.d.ts +1 -1
  44. package/dist/blocks/usage/index.d.ts +1 -1
  45. package/dist/blocks/workflow-editor/index.d.ts +3 -3
  46. package/dist/blocks/workflows/index.d.ts +3 -3
  47. package/dist/claims/index.d.ts +3 -3
  48. package/dist/cli/{add-DqfJVb1F.js → add-7nCSDmpt.js} +10 -10
  49. package/dist/cli/{add-Buuy7BSU.js → add-B4tQpnXP.js} +2 -2
  50. package/dist/cli/add-CdDneXMN.js +1 -0
  51. package/dist/cli/{app-table-files-Ku-4tPUu.js → app-table-files-CtO-zxpO.js} +2 -2
  52. package/dist/cli/{app-tables-Dg0sh4dH.js → app-tables-B7UzcJ_g.js} +2 -2
  53. package/dist/cli/{backfill-Dspz6kVJ.js → backfill-B2nFDXaS.js} +1 -1
  54. package/dist/cli/bin.js +1 -1
  55. package/dist/cli/{blocks-CqVBlc4L.js → blocks-BX_6HUQT.js} +1 -1
  56. package/dist/cli/{blocks-B8LAph-w.js → blocks-DU4iDrYS.js} +1 -1
  57. package/dist/cli/{cache-BbuuCIRU.js → cache-bS5bAoF-.js} +1 -1
  58. package/dist/cli/{codemod-DIAy8uXt.js → codemod-B1sSIE2p.js} +1 -1
  59. package/dist/cli/{content-mapper-NXfJ5VkP.js → content-mapper-CW6V6VRq.js} +2 -2
  60. package/dist/cli/{doctor-CUOyLE0c.js → doctor-Dw2pAf1b.js} +15 -15
  61. package/dist/cli/{gen-s9canfdC.js → gen-BtoSx3go.js} +11 -11
  62. package/dist/cli/index.d.ts +1 -1
  63. package/dist/cli/index.js +6 -6
  64. package/dist/cli/{init-Zs0Ca5on.js → init-DZXbrKuJ.js} +8 -8
  65. package/dist/cli/{live-BaLsNove.js → live-CDFfJcdR.js} +2 -2
  66. package/dist/cli/{mcp-ST7bVpJD.js → mcp-BukxvITV.js} +2 -2
  67. package/dist/cli/{metadata-aOvlCOOg.js → metadata-iZizGVuY.js} +3 -3
  68. package/dist/cli/{migrate-ClBx3Ggx.js → migrate-DPnnGLzw.js} +1 -1
  69. package/dist/cli/{migration-safety-mjm1pghO.js → migration-safety-COcnZbMO.js} +1 -1
  70. package/dist/cli/{migrations-tzItvwxT.js → migrations-BBt9fmiV.js} +2 -2
  71. package/dist/cli/{module-migration-D0Rjdvdx.js → module-migration-tCmPLhQp.js} +2 -2
  72. package/dist/cli/{powersync-DryX_DMG.js → powersync-BRmUJ-uR.js} +3 -3
  73. package/dist/cli/powersync-CYLPcJ9G.js +1 -0
  74. package/dist/cli/{print-fOUnKwA9.js → print-DdwQNG_e.js} +2 -2
  75. package/dist/cli/{providers-BR1d_5jA.js → providers-CaNg6Ayz.js} +1 -1
  76. package/dist/cli/{prune-workflows-CCjzNrxl.js → prune-workflows-BQQrI3tU.js} +1 -1
  77. package/dist/cli/{remove-B_0OIusa.js → remove-BEj9YEON.js} +5 -5
  78. package/dist/cli/{render-BCJKDX3c.js → render-UBqU9r44.js} +3 -3
  79. package/dist/cli/{run-4VUQTR-R.js → run-3E_IuJzS.js} +9 -9
  80. package/dist/cli/{run-BctvQX_g.js → run-BXlX9YdD.js} +27 -27
  81. package/dist/cli/{shared-oY7PGamd.js → shared-agrqD28l.js} +1 -1
  82. package/dist/cli/{snapshot-CWtER9-4.js → snapshot-DOXmozSq.js} +2 -2
  83. package/dist/cli/{source-D4uav_v9.js → source-BfJprU-6.js} +1 -1
  84. package/dist/cli/{spec-BPsyEzqH.js → spec-CgtIHFsl.js} +1 -1
  85. package/dist/cli/{spec-DTnBeaCD.js → spec-DRpSQGOW.js} +2 -2
  86. package/dist/cli/{sql-layout-DbhEQqq0.js → sql-layout-Cs3FMWcY.js} +2 -2
  87. package/dist/cli/{sync-CazH5FX4.js → sync-C_YGIDjk.js} +4 -4
  88. package/dist/cli/{upgrade-Cyx6ESpc.js → upgrade-ByQeJRGU.js} +5 -5
  89. package/dist/cli/{upgrade-Dyb4-f0Q.js → upgrade-OG9vaBeX.js} +2 -2
  90. package/dist/cli/{version-D1ZKUFng.js → version-CF6Yzah0.js} +1 -1
  91. package/dist/client/index.d.ts +5 -5
  92. package/dist/client/native/index.d.ts +4 -4
  93. package/dist/config/index.d.ts +2 -2
  94. package/dist/config/index.js +4 -4
  95. package/dist/{config-Dx3bEPlX.js → config-1-UmQczM.js} +1 -1
  96. package/dist/{config-uSliwPS6.js → config-AEB5iNEO.js} +4 -123
  97. package/dist/{context-D6OZQdcT.d.ts → context-CH5FYnVk.d.ts} +1 -1
  98. package/dist/contract/index.d.ts +3 -3
  99. package/dist/{controller-DhcSXkAC.d.ts → controller-CJ6rLnpS.d.ts} +1 -1
  100. package/dist/create/index.d.ts +3 -3
  101. package/dist/create/index.js +3 -3
  102. package/dist/create/lite/index.d.ts +3 -3
  103. package/dist/create/lite/index.js +2 -2
  104. package/dist/{entitlements-Bi4y8w8e.d.ts → entitlements-6gODwBSz.d.ts} +1 -1
  105. package/dist/{field-errors-CJ_i6HFg.d.ts → field-errors-CdSjV9Zo.d.ts} +4 -4
  106. package/dist/{index-C71uHfVj.d.ts → index-B5awu2SP.d.ts} +2 -2
  107. package/dist/{index-Cbwvf4yE.d.ts → index-BgRl484n.d.ts} +1 -1
  108. package/dist/{index-Bm1ftdBA.d.ts → index-CgKieWlO.d.ts} +2 -2
  109. package/dist/{index-ChvuVimY.d.ts → index-CrOeAgSh.d.ts} +2 -2
  110. package/dist/{index-Bc5t2QRU.d.ts → index-DnEJVKQ2.d.ts} +6 -6
  111. package/dist/{index-DrDCN45q.d.ts → index-DzLLMmUB.d.ts} +1 -1
  112. package/dist/{index-CRwpDGxd.d.ts → index-vkd2LTt2.d.ts} +1 -1
  113. package/dist/{instances-DKULdpWB.js → instances-Bycf_aus.js} +13 -1
  114. package/dist/mapper/bin.js +5 -5
  115. package/dist/mcp/index.d.ts +1 -1
  116. package/dist/next/index.d.ts +4 -4
  117. package/dist/{operations-BDjgCmT9.d.ts → operations-knMnfzgm.d.ts} +1 -1
  118. package/dist/{options-RYbyaVhv.js → options-CS1DA8q9.js} +1 -0
  119. package/dist/{options-ScQ6Hnxo.js → options-zsLpIqBA.js} +2 -1
  120. package/dist/otel/index.js +4 -4
  121. package/dist/{permissions-BGx22GP3.d.ts → permissions-Ed8WvLgQ.d.ts} +1 -1
  122. package/dist/{ports-D63bA3p4.d.ts → ports-Bnwy2mlR.d.ts} +1 -1
  123. package/dist/powersync/index.d.ts +2 -2
  124. package/dist/preset/index.d.ts +3 -3
  125. package/dist/preset/index.js +3 -3
  126. package/dist/{preset-oc_liUHz.js → preset-DkeXFh7e.js} +2 -2
  127. package/dist/{project-Cs0kz5OP.js → project-By0R8ioI.js} +5 -5
  128. package/dist/{push-token-BsyX0KlT.d.ts → push-token-CJbEvwjI.d.ts} +1 -1
  129. package/dist/react/index.d.ts +5 -5
  130. package/dist/react/native/index.d.ts +1 -1
  131. package/dist/react/server.d.ts +5 -5
  132. package/dist/realtime/index.d.ts +3 -3
  133. package/dist/records/index.d.ts +3 -3
  134. package/dist/server/index.d.ts +3 -3
  135. package/dist/solid/index.d.ts +5 -5
  136. package/dist/sql/index.d.ts +5 -5
  137. package/dist/sql/index.js +3 -3
  138. package/dist/{sql-CWYbu_6y.js → sql-B2cMvGnZ.js} +359 -47
  139. package/dist/ssr/index.d.ts +1 -1
  140. package/dist/svelte/index.d.ts +5 -5
  141. package/dist/{tenant-DqnE50Ju.d.ts → tenant-eZNRWTRJ.d.ts} +1 -1
  142. package/dist/testing/index.d.ts +3 -3
  143. package/dist/testing/index.js +1 -1
  144. package/dist/{topic-Dp7VGPd-.d.ts → topic-D7F2FBNp.d.ts} +1 -1
  145. package/dist/{types-DLXTmZtm.d.ts → types-bqvFoBhf.d.ts} +2 -2
  146. package/dist/vue/index.d.ts +5 -5
  147. package/dist/{watch-topic-CtJAkWT4.d.ts → watch-topic-BIEaSN0Y.d.ts} +1 -1
  148. package/dist/workflow-sdk/world/index.js +1 -1
  149. package/dist/{workflow-sdk-pB1jCLIL.js → workflow-sdk-6psRpDIo.js} +1 -69
  150. package/dist/yjs/index.d.ts +1 -1
  151. package/package.json +1 -1
  152. package/schemas/config-v1.json +10 -0
  153. package/dist/cli/add-8zKWiO0X.js +0 -1
  154. package/dist/cli/powersync-vvu2-72V.js +0 -1
  155. package/dist/resolved-names-sd6RuTju.js +0 -130
@@ -1,5 +1,5 @@
1
1
  import { A as serializeCookie, C as CookieScope, D as applyCookieWrites, E as StoredSession, O as parseCookies, S as CookieRecord, T as SessionEncoding, a as ResolveAuthOptions, j as sessionCookieName, k as readSession, n as AuthResolver, r as AuthState, t as AuthResolution, u as resolveAuth, w as CookieWrite, x as CookieOptions } from "../resolve-XlMQRUeG.js";
2
- import { r as MembershipClaim } from "../entitlements-Bi4y8w8e.js";
2
+ import { r as MembershipClaim } from "../entitlements-6gODwBSz.js";
3
3
  import { n as AuthSession, o as toSession } from "../view-eHgOOyRS.js";
4
4
  import { a as sessionStatus, i as clearSessionCookies, n as SessionStatus, o as authContext, r as SessionStatusOptions, t as ClearSessionCookiesOptions } from "../ended-BwpmNC5k.js";
5
5
  export { type AuthResolution, type AuthResolver, type AuthSession, type AuthState, type ClearSessionCookiesOptions, type CookieOptions, type CookieRecord, type CookieScope, type CookieWrite, type MembershipClaim, type ResolveAuthOptions, type SessionEncoding, type SessionStatus, type SessionStatusOptions, type StoredSession, applyCookieWrites, authContext, clearSessionCookies, parseCookies, readSession, resolveAuth, serializeCookie, sessionCookieName, sessionStatus, toSession };
@@ -2,12 +2,12 @@ import { b as DbError } from "../result-DTOQRyGY.js";
2
2
  import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-DddDlibJ.js";
3
3
  import { mt as QuerySpec } from "../define-C_He1bQO.js";
4
4
  import { tt as TemplateValues } from "../bucket-CrsJNHzi.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-Dp7VGPd-.js";
6
- import { t as AuthSnapshot } from "../bind-BspFMDdW.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-D7F2FBNp.js";
6
+ import { t as AuthSnapshot } from "../bind-5vOwNouG.js";
7
7
  import { n as AuthSession } from "../view-eHgOOyRS.js";
8
- import { n as Controller } from "../controller-DhcSXkAC.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-CJ_i6HFg.js";
10
- import { n as BlockOptions } from "../block-env-CLco8YUl.js";
8
+ import { n as Controller } from "../controller-CJ6rLnpS.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-CdSjV9Zo.js";
10
+ import { n as BlockOptions } from "../block-env-hco8BLjC.js";
11
11
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-QSaPsL2P.js";
12
12
  import { SupabaseClient } from "@supabase/supabase-js";
13
13
  import { QueryClient } from "@tanstack/query-core";
@@ -1,4 +1,4 @@
1
- import { s as ClaimsSource } from "./entitlements-Bi4y8w8e.js";
1
+ import { s as ClaimsSource } from "./entitlements-6gODwBSz.js";
2
2
  /**
3
3
  * The active tenant of a user session: the `claim` claim (`tenant_id` by
4
4
  * default, as `config.claims.tenant`) at the top level of the token, then in
@@ -9,7 +9,7 @@ import { a as BlockTransportMiddleware } from "../block-hooks-CtMsgLQr.js";
9
9
  import { a as SessionActor, o as SessionDelegation } from "../actor-DseNR02I.js";
10
10
  import { L as QueueProvider } from "../types-BdhE7I8Z.js";
11
11
  import { n as Embedder } from "../knowledge-DWXAxvkN.js";
12
- import { a as AuthorizationProvider } from "../authorization-C7yjZttV.js";
12
+ import { a as AuthorizationProvider } from "../authorization-D8CaAdqU.js";
13
13
  import { o as StreamStore } from "../store-c7QxUHX-.js";
14
14
  import { Qt as CacheAdapter, Y as DbStats, t as BetterSupabase, y as Db } from "../define-C_He1bQO.js";
15
15
  import { Q as StoragePath } from "../bucket-CrsJNHzi.js";
@@ -23,9 +23,9 @@ import { l as ServerOptions, o as ServerContext } from "../server-types-DpI82uNq
23
23
  import { C as SupportSessionStore } from "../support-Dj5V2WTs.js";
24
24
  import { r as GuardOptions } from "../respond-D7kUatjc.js";
25
25
  import { l as Transcriber, s as NoteTaker, u as TranscriberInput } from "../recordings-Bw5LoocX.js";
26
- import { n as Controller } from "../controller-DhcSXkAC.js";
26
+ import { n as Controller } from "../controller-CJ6rLnpS.js";
27
27
  import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-ChJkI2jo.js";
28
- import { Qt as GeneratorModel, Vt as Generator, Yt as GeneratorInput, cn as ResolvedConfig } from "../context-D6OZQdcT.js";
28
+ import { Qt as GeneratorModel, Vt as Generator, Yt as GeneratorInput, cn as ResolvedConfig } from "../context-CH5FYnVk.js";
29
29
  import { r as WebhookInput } from "../signatures-jPr9JXyw.js";
30
30
  import { n as Payment, o as PaymentProvider } from "../payments-BBGSGRQ7.js";
31
31
  import { y as FlagValue } from "../flags-Cuew4tGx.js";
@@ -7,7 +7,7 @@ import { a as ok } from "../result-8xza7w5W.js";
7
7
  import { t as BetterSupabase } from "../define-Duh2mMYk.js";
8
8
  import { i as fromBase64, o as toBase64Url, t as base64ToText } from "../base64-CEBz6-Jj.js";
9
9
  import "../claim-names-BKig1LOk.js";
10
- import { c as resolveConfig } from "../config-uSliwPS6.js";
10
+ import { c as resolveConfig } from "../config-AEB5iNEO.js";
11
11
  import { a as isScopeName, c as templateFunctions, l as templatePlaceholders, n as TEMPLATE_PLACEHOLDERS, s as scopeProblems, u as templateProblems } from "../access-sql-Dao1C0fz.js";
12
12
  import { a as TRACKING_STATUSES, t as LABEL_FORMATS } from "../statuses-Qqpzda35.js";
13
13
  import { t as importOptionalPeer } from "../optional-peer-5SOYr3lL.js";
@@ -1,6 +1,6 @@
1
1
  import { D as ValidationIssue, b as DbError, t as AsyncResult } from "./result-DTOQRyGY.js";
2
2
  import { D as AccessTopicPolicy, O as AnyFunctions, at as Row, dt as TableKey, k as AnyModels } from "./types-BzIYSSWK.js";
3
- import { t as AuthorizationFunctions } from "./authorization-C7yjZttV.js";
3
+ import { t as AuthorizationFunctions } from "./authorization-D8CaAdqU.js";
4
4
  import { t as BetterSupabase } from "./define-C_He1bQO.js";
5
5
  import { et as TemplateParams, tt as TemplateValues } from "./bucket-CrsJNHzi.js";
6
6
  import { g as SubscriberPolicy, h as SubscriberEvent, i as AuthorizationHooks, m as Subscriber } from "./authorization-hooks-CR8TVvqo.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-D6OZQdcT.js";
2
- import { k as DesignErrorCode } from "./index-CRwpDGxd.js";
1
+ import { _r as AppColumnFormat, br as AppOnDeleteAction, hr as AppColumnAccess, kr as AppTableVersions, vr as AppColumnType, xi as Preset } from "./context-CH5FYnVk.js";
2
+ import { k as DesignErrorCode } from "./index-vkd2LTt2.js";
3
3
  /** Where in the project pipeline an issue came from. */
4
4
  type IssueSource = "design" | "rules" | "sql" | "verifier" | "plan";
5
5
  type IssueSeverity = "error" | "warning" | "info";
@@ -2,12 +2,12 @@ import { b as DbError } from "../result-DTOQRyGY.js";
2
2
  import { Ct as Events, D as BlockEventPattern, T as BlockEvent, bt as EventMap, k as BlockEventsMatching } from "../events-DddDlibJ.js";
3
3
  import { mt as QuerySpec } from "../define-C_He1bQO.js";
4
4
  import { tt as TemplateValues } from "../bucket-CrsJNHzi.js";
5
- import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-Dp7VGPd-.js";
6
- import { t as AuthSnapshot } from "../bind-BspFMDdW.js";
5
+ import { g as TopicHandlers, m as Topic, p as SubscriptionStatus, r as PresenceMember, t as EventSchemas } from "../topic-D7F2FBNp.js";
6
+ import { t as AuthSnapshot } from "../bind-5vOwNouG.js";
7
7
  import { n as AuthSession } from "../view-eHgOOyRS.js";
8
- import { n as Controller } from "../controller-DhcSXkAC.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-CJ_i6HFg.js";
10
- import { n as BlockOptions } from "../block-env-CLco8YUl.js";
8
+ import { n as Controller } from "../controller-CJ6rLnpS.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-CdSjV9Zo.js";
10
+ import { n as BlockOptions } from "../block-env-hco8BLjC.js";
11
11
  import { n as BlockDataOf, r as BlockMethodName, t as BlockArgsOf } from "../block-method-QSaPsL2P.js";
12
12
  import { t as SupportView } from "../support-view-DKZkZeM5.js";
13
13
  import { SupabaseClient } from "@supabase/supabase-js";
@@ -1,4 +1,4 @@
1
- import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-Dp7VGPd-.js";
1
+ import { c as RealtimeClient, p as SubscriptionStatus } from "./topic-D7F2FBNp.js";
2
2
  interface TopicWatch {
3
3
  readonly onMessage: (event: string, payload: unknown) => void;
4
4
  readonly onRejoin: () => void;
@@ -2,7 +2,7 @@ import { n as dbError } from "../../errors-B7tCfCvX.js";
2
2
  import { c as optionalTemporal, t as TEMPORAL_MISSING } from "../../temporal-DKTdGK9i.js";
3
3
  import { o as problemResponse } from "../../problem-C0SVHhd3.js";
4
4
  import { i as sqlIdent } from "../../template-CNq9xcfx.js";
5
- import { i as WORLD_POSTGRES_VERSION, r as WORKFLOW_VAULT_SECRETS } from "../../workflow-sdk-pB1jCLIL.js";
5
+ import { i as WORLD_POSTGRES_VERSION, r as WORKFLOW_VAULT_SECRETS } from "../../workflow-sdk-6psRpDIo.js";
6
6
  import { n as memoized } from "../../optional-peer-5SOYr3lL.js";
7
7
  import { n as hmacHex, r as timingSafeEqual } from "../../hmac-DNcfpmI9.js";
8
8
  import { t as watchPoolErrors } from "../../pool-errors-JrZie6u3.js";
@@ -1061,74 +1061,6 @@ const DEFAULT_ROLES = {
1061
1061
  ],
1062
1062
  viewer: ["organization.read"]
1063
1063
  };
1064
- /** Actions a module checks only when `blocks.<module>.permissions` names a key. */
1065
- const OPTIONAL_MODULE_PERMISSIONS = {
1066
- organizations: {
1067
- create: "platform",
1068
- updatePlatform: "platform",
1069
- deletePlatform: "platform",
1070
- updateRolePlatform: "platform",
1071
- removeMemberPlatform: "platform"
1072
- },
1073
- audit: { reveal: "tenant" },
1074
- "data-lifecycle": { deletePlatform: "platform" },
1075
- tags: {
1076
- create: "tenant",
1077
- update: "tenant",
1078
- delete: "tenant"
1079
- },
1080
- tasks: {
1081
- create: "tenant",
1082
- delete: "tenant"
1083
- },
1084
- calendar: {
1085
- create: "tenant",
1086
- update: "tenant",
1087
- delete: "tenant"
1088
- },
1089
- employees: {
1090
- create: "tenant",
1091
- contractsRead: "tenant",
1092
- contractsWrite: "tenant",
1093
- privateDetailsWrite: "tenant"
1094
- },
1095
- hiring: {
1096
- create: "tenant",
1097
- jobsCreate: "tenant",
1098
- jobsUpdate: "tenant",
1099
- score: "tenant"
1100
- },
1101
- teams: {
1102
- create: "tenant",
1103
- update: "tenant",
1104
- delete: "tenant",
1105
- members: "tenant"
1106
- },
1107
- catalog: {
1108
- create: "tenant",
1109
- update: "tenant",
1110
- delete: "tenant"
1111
- },
1112
- invoices: {
1113
- create: "tenant",
1114
- update: "tenant",
1115
- issue: "tenant",
1116
- payment: "tenant",
1117
- credit: "tenant",
1118
- charge: "tenant",
1119
- void: "tenant",
1120
- writeOff: "tenant",
1121
- reverse: "tenant"
1122
- },
1123
- leave: { readConfidential: "tenant" },
1124
- expenses: {
1125
- create: "tenant",
1126
- update: "tenant",
1127
- delete: "tenant",
1128
- reimburse: "tenant",
1129
- categories: "tenant"
1130
- }
1131
- };
1132
1064
  /**
1133
1065
  * The permission key each operation checks by default, keyed
1134
1066
  * `<module>.<action>`. `blocks.<name>.permissions` renames a key per module,
@@ -2771,4 +2703,4 @@ const WORKFLOW_SDK_WORLD = {
2771
2703
  build,
2772
2704
  data
2773
2705
  };
2774
- export { ownRowPolicies as $, addForeignKey as A, ensureCheck as B, PARTITION_VARIABLES as C, activeMembership as D, accessDefinesDisabledHelpers as E, defaultPartition as F, jsonSchemaChecks as G, extraFieldsJson as H, defaultPartitionName as I, memberAddedRecord as J, jwtClaim as K, disabledHelpers as L, batchFunction as M, columnRef as N, addCheck as O, columnsObject as P, organizationMissing as Q, disabledHelpersNeedLaterTables as R, NOTHING as S, SERVICE_CALLER as T, fail as U, extraFieldsArg as V, insertExtraColumns as W, membershipSuspended as X, membershipDisabledAt as Y, notNullCheckName as Z, roleScopeIs as _, userGrant as _t, DEFAULT_ROLES as a, renameSql as at, EQUIVALENT_TRIGGERS as b, OPTIONAL_MODULE_PERMISSIONS as c, schemaPreamble as ct, isOperationModule as d, sha256Hex as dt, pageSize as et, moduleOperations as f, shortHash as ft, roleNames as g, updatedAt as gt, providerPlatformRoles as h, updateExtraColumns as ht, WORLD_POSTGRES_VERSION as i, registerPartitions as it, addNotNullCheck as j, addExtraColumns as k, accessModel as l, serviceGrant as lt, modulePermissionKey as m, triggerGrant as mt, WORKFLOW_SDK_WORLD as n, raise as nt, MODULE_PERMISSION_SCOPES as o, replaceColumnCheck as ot, modulePermission as p, splitTable as pt, lockTable as q, WORKFLOW_VAULT_SECRETS as r, recordTrigger as rt, OPERATIONS as s, revokeTable as st, WORKFLOW_DELIVERY_QUEUE as t, quotedTable as tt, hasPlatformRoles as u, serviceOnly as ut, rolesOf as v, withExtraFields as vt, SCHEMA as w, MONTHLY_PARTITIONS as x, tenantScope as y, writeExtraColumns as yt, dropExpiredPartitions as z };
2706
+ export { pageSize as $, addNotNullCheck as A, extraFieldsArg as B, SCHEMA as C, addCheck as D, activeMembership as E, defaultPartitionName as F, jwtClaim as G, fail as H, disabledHelpers as I, membershipDisabledAt as J, lockTable as K, disabledHelpersNeedLaterTables as L, columnRef as M, columnsObject as N, addExtraColumns as O, defaultPartition as P, ownRowPolicies as Q, dropExpiredPartitions as R, PARTITION_VARIABLES as S, accessDefinesDisabledHelpers as T, insertExtraColumns as U, extraFieldsJson as V, jsonSchemaChecks as W, notNullCheckName as X, membershipSuspended as Y, organizationMissing as Z, rolesOf as _, withExtraFields as _t, DEFAULT_ROLES as a, replaceColumnCheck as at, MONTHLY_PARTITIONS as b, accessModel as c, serviceGrant as ct, moduleOperations as d, shortHash as dt, quotedTable as et, modulePermission as f, splitTable as ft, roleScopeIs as g, userGrant as gt, roleNames as h, updatedAt as ht, WORLD_POSTGRES_VERSION as i, renameSql as it, batchFunction as j, addForeignKey as k, hasPlatformRoles as l, serviceOnly as lt, providerPlatformRoles as m, updateExtraColumns as mt, WORKFLOW_SDK_WORLD as n, recordTrigger as nt, MODULE_PERMISSION_SCOPES as o, revokeTable as ot, modulePermissionKey as p, triggerGrant as pt, memberAddedRecord as q, WORKFLOW_VAULT_SECRETS as r, registerPartitions as rt, OPERATIONS as s, schemaPreamble as st, WORKFLOW_DELIVERY_QUEUE as t, raise as tt, isOperationModule as u, sha256Hex as ut, tenantScope as v, writeExtraColumns as vt, SERVICE_CALLER as w, NOTHING as x, EQUIVALENT_TRIGGERS as y, ensureCheck as z };
@@ -1,5 +1,5 @@
1
1
  import { t as AsyncResult } from "../result-DTOQRyGY.js";
2
- import { c as RealtimeClient, r as PresenceMember } from "../topic-Dp7VGPd-.js";
2
+ import { c as RealtimeClient, r as PresenceMember } from "../topic-D7F2FBNp.js";
3
3
  import { a as DocumentSuggestion, d as OpenedDocument, l as Documents, r as DocumentRef, t as DecidedSuggestion } from "../documents-Btk0MhC0.js";
4
4
  type PresenceState = Readonly<Record<string, unknown>>;
5
5
  /** The part of a `Y.Doc` the provider uses. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.37.0",
3
+ "version": "0.38.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",
@@ -4775,6 +4775,12 @@
4775
4775
  "type": "string"
4776
4776
  }
4777
4777
  },
4778
+ "categoryExtraColumns": {
4779
+ "type": "object",
4780
+ "additionalProperties": {
4781
+ "type": "string"
4782
+ }
4783
+ },
4778
4784
  "approvals": {
4779
4785
  "type": "boolean",
4780
4786
  "default": true
@@ -5306,6 +5312,10 @@
5306
5312
  "owner": {
5307
5313
  "type": "string",
5308
5314
  "default": "user"
5315
+ },
5316
+ "reapprove": {
5317
+ "type": "boolean",
5318
+ "default": false
5309
5319
  }
5310
5320
  }
5311
5321
  }
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-DqfJVb1F.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-DryX_DMG.js";
@@ -1,130 +0,0 @@
1
- import { a as entityNoun, i as entityNames, n as checkEntityName, s as tenantRename, t as DEFAULT_TENANT } from "./entity-naming-BES3pkQI.js";
2
- import { L as tenantNameOf } from "./instances-DKULdpWB.js";
3
- // src/config/defaults.ts
4
- /**
5
- * Every default `resolveConfig` fills in. Other modules (the SQL module
6
- * registry, the CLI) read their fallbacks from here instead of repeating the
7
- * literals.
8
- */
9
- const CONFIG_DEFAULTS = {
10
- output: "src/lib/supabase/generated.ts",
11
- schemas: ["public"],
12
- casing: "snake",
13
- postgrestVersion: "13",
14
- codecs: {
15
- timestamptz: "string",
16
- int8: "number",
17
- numeric: "number"
18
- },
19
- sql: {
20
- dir: "supabase/schemas",
21
- prefix: "900_better_supabase",
22
- testsDir: "supabase/tests"
23
- },
24
- seed: {
25
- entry: "supabase/seed.ts",
26
- output: "supabase/seeds/000_better_supabase.sql",
27
- perTenant: "supabase/seed.tenant.ts"
28
- },
29
- openapi: {
30
- entry: "src/lib/openapi.ts",
31
- output: "openapi.json"
32
- },
33
- specs: { failOn: "error" },
34
- doctor: {
35
- format: "text",
36
- sources: ["src/**/*.{ts,tsx}"],
37
- policyHelperLimit: 5
38
- },
39
- gen: { watchInterval: 2e3 },
40
- env: { output: ".env.local" }
41
- };
42
- // src/config/json.ts
43
- /**
44
- * The JSON Schema document for a `json[...].schema` entry. A Standard Schema
45
- * converts for `target` (2020-12 by default); a JSON Schema object is returned
46
- * as it is.
47
- */
48
- function resolveJsonSchema(source, target = "draft-2020-12") {
49
- const standard = source["~standard"];
50
- if (standard === void 0) return source;
51
- const jsonSchema = standard.jsonSchema;
52
- if (typeof jsonSchema?.input !== "function") throw new TypeError("json[...].schema: this Standard Schema library does not implement Standard JSON Schema; pass a JSON Schema object instead");
53
- return jsonSchema.input({ target });
54
- }
55
- // src/sql/resolved-names.ts
56
- const PLACEHOLDER = /\{([^{}]*)\}/g;
57
- function primaryOf(where, entities) {
58
- const primary = Object.entries(entities).find(([, spec]) => spec.primary);
59
- if (primary === void 0) throw new TypeError(`${where}: the block has no primary entity, so name one: ${Object.keys(entities).join(", ") || "none"}`);
60
- return primary[0];
61
- }
62
- /** `blocks.<name>.entities` as entity key to its config, shorthand expanded. */
63
- function configured(where, entities, config) {
64
- if (config === void 0) return /* @__PURE__ */ new Map();
65
- if (typeof config === "string") return /* @__PURE__ */ new Map([[primaryOf(where, entities), { name: config }]]);
66
- const found = /* @__PURE__ */ new Map();
67
- for (const [key, value] of Object.entries(config)) {
68
- if (value === void 0) continue;
69
- if (!(key in entities)) throw new TypeError(`${where}: unknown entity "${key}". Entities: ${Object.keys(entities).join(", ") || "none"}`);
70
- found.set(key, typeof value === "string" ? { name: value } : value);
71
- }
72
- return found;
73
- }
74
- function checkUrl(where, url, columns) {
75
- for (const [, column] of url.matchAll(PLACEHOLDER)) if (columns === void 0 || column === void 0 || !(column in columns)) throw new TypeError(`${where}: "{${column ?? ""}}" is not a column of the entity's table. Columns: ${Object.keys(columns ?? {}).join(", ") || "none"}`);
76
- return url;
77
- }
78
- /** The noun forms a rename matches, for the containment check. */
79
- const nounForms = (noun) => [noun.singular, noun.plural];
80
- function checkNoun(where, noun, others) {
81
- for (const other of others) {
82
- const taken = nounForms(other).find((form) => new RegExp(`(^|_)${form}(_|$)`).test(noun.singular));
83
- if (taken !== void 0) throw new TypeError(`${where}: "${noun.singular}" contains "${taken}", another name the blocks rename. Choose another name.`);
84
- }
85
- }
86
- function resolveEntity(where, key, spec, names, config) {
87
- const from = entityNoun(spec.singular, spec.plural);
88
- const to = config?.name === void 0 && config?.plural === void 0 ? from : entityNoun(config.name === void 0 ? spec.singular : checkEntityName(`${where}.${key}`, config.name), config.plural === void 0 ? void 0 : checkEntityName(`${where}.${key}.plural`, config.plural));
89
- const columns = spec.table === void 0 ? void 0 : names.tables[spec.table]?.columns;
90
- return {
91
- key,
92
- from,
93
- to,
94
- primary: spec.primary === true,
95
- global: spec.global === true,
96
- ...spec.table === void 0 ? {} : { table: spec.table },
97
- ...config?.url === void 0 ? {} : { url: checkUrl(`${where}.${key}.url`, config.url, columns) },
98
- ...spec.subject === void 0 || config?.subject === false ? {} : { subject: spec.subject }
99
- };
100
- }
101
- /**
102
- * The final names of `module` under `blocks`: its entities renamed through
103
- * `blocks.<module>.entities`, and the tenant through
104
- * `blocks.memberships.names.organization`. Throws on an unknown entity, a name
105
- * that isn't a lowercase identifier, a `url` placeholder that isn't a column,
106
- * or a name that contains another noun the blocks rename.
107
- */
108
- function resolveNames(module, names, blocks = {}) {
109
- const where = `blocks.${module}.names`;
110
- const specs = names.entities ?? {};
111
- const config = configured(where, specs, blocks[module]?.entities);
112
- const tenantName = tenantNameOf(blocks);
113
- const tenant = tenantName === void 0 ? DEFAULT_TENANT : tenantRename(tenantName).to;
114
- const entities = Object.fromEntries(Object.entries(specs).map(([key, spec]) => [key, resolveEntity(where, key, spec, names, config.get(key))]));
115
- const own = Object.values(entities).filter((entity) => !entity.global);
116
- const defaults = [DEFAULT_TENANT, ...own.map((entity) => entity.from)];
117
- for (const entity of own) if (entity.to.singular !== entity.from.singular) checkNoun(`${where}.${entity.key}`, entity.to, defaults.filter((noun) => noun !== entity.from));
118
- const renames = own.map((entity) => ({
119
- from: entity.from,
120
- to: entity.to
121
- }));
122
- return {
123
- module,
124
- entities,
125
- tenant,
126
- naming: entityNames([...tenantName === void 0 ? [] : [tenantRename(tenantName)], ...renames]),
127
- entityNaming: entityNames(renames)
128
- };
129
- }
130
- export { resolveJsonSchema as n, CONFIG_DEFAULTS as r, resolveNames as t };