better-supabase 0.58.1 → 0.58.2

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 (75) hide show
  1. package/dist/{api-D-YoZpRe.js → api-D8E2jvT5.js} +1 -1
  2. package/dist/{build-1ikup3O6.js → build-6vLM3d_J.js} +1 -1
  3. package/dist/cli/{add-B63B07UG.js → add-B77M4v-f.js} +9 -9
  4. package/dist/cli/{add-CBNxtc8h.js → add-Ctv6m6Up.js} +2 -2
  5. package/dist/cli/add-CuKMP5du.js +1 -0
  6. package/dist/cli/{app-table-files-BQU5_xhz.js → app-table-files-Cj0LsH5w.js} +3 -3
  7. package/dist/cli/{app-tables-DUCrWiGS.js → app-tables-Cwgr3GTi.js} +2 -2
  8. package/dist/cli/{backfill-ff_y-n3l.js → backfill-BN81Sthj.js} +1 -1
  9. package/dist/cli/bin.js +1 -1
  10. package/dist/cli/{blocks-DcMd8kRY.js → blocks-BgKD3-I9.js} +1 -1
  11. package/dist/cli/{blocks-BuwjO--N.js → blocks-i6YzVQLK.js} +1 -1
  12. package/dist/cli/{cache-Di8fhrqf.js → cache-BV7WlzUF.js} +1 -1
  13. package/dist/cli/{codemod-Bu77IP-l.js → codemod-Dn8JZhKC.js} +4 -4
  14. package/dist/cli/{codemod-naming-CB4FfxcO.js → codemod-naming-8eUxJ86U.js} +1 -1
  15. package/dist/cli/{column-renames-B8tfoufA.js → column-renames-rRIoozHD.js} +2 -2
  16. package/dist/cli/{content-mapper-Dby_JOgB.js → content-mapper-DBMKbB16.js} +1 -1
  17. package/dist/cli/{dev-CJnbxe_s.js → dev-Bd5y9TWU.js} +3 -3
  18. package/dist/cli/{doctor-C_GPFp8I.js → doctor-3L2SV9yp.js} +16 -16
  19. package/dist/cli/{emit-Diublx-B.js → emit-DS6N1chg.js} +2 -2
  20. package/dist/cli/{gen-BgTMpJhV.js → gen-CITLb2eh.js} +3 -3
  21. package/dist/cli/{gen-tasks-Dn9gxauI.js → gen-tasks-gpTX1KW5.js} +9 -9
  22. package/dist/cli/index.d.ts +1 -1
  23. package/dist/cli/index.js +7 -7
  24. package/dist/cli/{init-1gNLko5F.js → init-CI-WwnYW.js} +8 -8
  25. package/dist/cli/{live-D07gGcoV.js → live-TK2YbWEB.js} +2 -2
  26. package/dist/cli/{mcp-BwMLfpxa.js → mcp-C08VfeGU.js} +2 -2
  27. package/dist/cli/{memo-backend-yki17W-K.js → memo-backend-Bjl2s-LJ.js} +1 -1
  28. package/dist/cli/{metadata-CxF9te2t.js → metadata-VfgaGwPp.js} +4 -4
  29. package/dist/cli/{migrate-D4gNS4gj.js → migrate-BHQ0pQ8v.js} +1 -1
  30. package/dist/cli/{migration-safety-DsQonP4-.js → migration-safety-CIDbpK_i.js} +1 -1
  31. package/dist/cli/{module-migration-Cl-I5j0j.js → module-migration-N79wX1lQ.js} +1 -1
  32. package/dist/cli/{partition-C5G03PgD.js → partition-BWiWQ7Wv.js} +1 -1
  33. package/dist/cli/{powersync-WhAasez3.js → powersync-B-K1msIl.js} +3 -3
  34. package/dist/cli/powersync-C5u6SbHy.js +1 -0
  35. package/dist/cli/{print-B6dsmPgY.js → print-BMDcJD64.js} +2 -2
  36. package/dist/cli/{providers-B4QIwuqF.js → providers-CjF7HAPk.js} +1 -1
  37. package/dist/cli/{prune-workflows-BRLMJAN3.js → prune-workflows-CJ4jrmPf.js} +1 -1
  38. package/dist/cli/{remove-H86BDqeG.js → remove-JJ4j1UPX.js} +6 -6
  39. package/dist/cli/{render-cache-BoFKfBx6.js → render-cache-D-L0uCUa.js} +1 -1
  40. package/dist/cli/{render-DinflArt.js → render-t8Y_8QIm.js} +4 -4
  41. package/dist/cli/{run-sk-YY1p3.js → run-BIL3hTIL.js} +30 -30
  42. package/dist/cli/{run-3BMqhsTa.js → run-C89xFeXI.js} +7 -7
  43. package/dist/cli/{shared-B9fxx6uL.js → shared-DJ0--OEH.js} +1 -1
  44. package/dist/cli/{source-Dwn8SwJg.js → source-3EDa7rPw.js} +1 -1
  45. package/dist/cli/{spec--0tYexnO.js → spec-D2Xwy1gO.js} +1 -1
  46. package/dist/cli/{spec-BFlvbXVb.js → spec-DP9TaDgC.js} +2 -2
  47. package/dist/cli/{sql-layout-CpbXj-r9.js → sql-layout-COn2WEKP.js} +2 -2
  48. package/dist/cli/{squash-DLXeXmpI.js → squash-bcwO1H_W.js} +1 -1
  49. package/dist/cli/{sync-DHUrIa97.js → sync-DqvkQ5MB.js} +4 -4
  50. package/dist/cli/{upgrade-DKfXHex4.js → upgrade-DmMKImiC.js} +5 -5
  51. package/dist/cli/{upgrade-N7lDosgT.js → upgrade-ecIafbIb.js} +5 -5
  52. package/dist/cli/{version-Bm4K-iOw.js → version-DvQcNR10.js} +1 -1
  53. package/dist/create/index.js +1 -1
  54. package/dist/create/lite/index.js +2 -2
  55. package/dist/generators/factories/index.js +1 -1
  56. package/dist/generators/json-schema/index.js +1 -1
  57. package/dist/generators/nuqs/index.js +1 -1
  58. package/dist/generators/standard-schema/index.js +1 -1
  59. package/dist/generators/valibot/index.js +1 -1
  60. package/dist/generators/zod/index.js +1 -1
  61. package/dist/{json-schema-Ba8xSQxR.js → json-schema-DxVQGZbL.js} +1 -1
  62. package/dist/mapper/bin.js +5 -5
  63. package/dist/mcp/index.js +1 -1
  64. package/dist/{mcp-CaC-3JB3.js → mcp-Cl8x5Ffg.js} +1 -1
  65. package/dist/otel/index.js +5 -5
  66. package/dist/{project-Bgz2gbh5.js → project-Ch2b_g1M.js} +1 -1
  67. package/dist/spec/index.js +2 -2
  68. package/dist/sql/index.js +1 -1
  69. package/dist/{sql-BbaGokNJ.js → sql-Cukwmnm3.js} +40 -17
  70. package/dist/testing/index.js +1 -1
  71. package/dist/{version-Ce4Rk4uV.js → version-BAL_8E6V.js} +1 -1
  72. package/dist/webmcp/index.js +1 -1
  73. package/package.json +1 -1
  74. package/dist/cli/add-CeZUs_jU.js +0 -1
  75. package/dist/cli/powersync-TDly6ptq.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import { c as runsWithInvalidConfig, d as DOCS_ORIGIN, f as GROUPS, g as runCommand, h as parseArgs$2, i as joinRepeated, l as COMMANDS, o as listArgs, p as RESERVED_NAMES, s as readsLegacyTables, t as GLOBAL_ARGS } from "./command-fqvJ0TdG.js";
2
2
  import { s as setCacheEnabled } from "./store-DP-nmqBt.js";
3
3
  import { n as highlight, r as painter } from "./style-B5-nByxb.js";
4
- import { t as VERSION } from "./version-Bm4K-iOw.js";
4
+ import { t as VERSION } from "./version-DvQcNR10.js";
5
5
  import { a as missingInputNext, o as resolveAgent, t as checkConsent } from "./agent-BlYLJPzM.js";
6
6
  import { a as isActionRequired, l as toCliError, n as CliError, o as isReport, s as isRetryable } from "./errors-B7i-VGxk.js";
7
7
  import { r as splitCommandLine } from "./shell-omi9-T2X.js";
@@ -21,48 +21,48 @@ const LOADERS = [
21
21
  ["login", () => import("./account-BzhVD6jJ.js").then((m) => m.loginCommand)],
22
22
  ["logout", () => import("./account-BzhVD6jJ.js").then((m) => m.logoutCommand)],
23
23
  ["whoami", () => import("./account-BzhVD6jJ.js").then((m) => m.whoamiCommand)],
24
- ["init", () => import("./init-1gNLko5F.js").then((m) => m.initCommand)],
25
- ["add", () => import("./add-CeZUs_jU.js").then((m) => m.addCommand)],
26
- ["remove", () => import("./remove-H86BDqeG.js").then((m) => m.removeCommand)],
27
- ["upgrade", () => import("./upgrade-N7lDosgT.js").then((m) => m.upgradeCommand)],
24
+ ["init", () => import("./init-CI-WwnYW.js").then((m) => m.initCommand)],
25
+ ["add", () => import("./add-CuKMP5du.js").then((m) => m.addCommand)],
26
+ ["remove", () => import("./remove-JJ4j1UPX.js").then((m) => m.removeCommand)],
27
+ ["upgrade", () => import("./upgrade-ecIafbIb.js").then((m) => m.upgradeCommand)],
28
28
  ["table", () => import("./table-CcO-m_7t.js").then((m) => m.tableCommand)],
29
- ["migrate schema-first", () => import("./migrate-D4gNS4gj.js").then((m) => m.migrateSchemaFirstCommand)],
30
- ["gen", () => import("./gen-BgTMpJhV.js").then((m) => m.genCommand)],
31
- ["doctor", () => import("./doctor-C_GPFp8I.js").then((m) => m.doctorCommand)],
29
+ ["migrate schema-first", () => import("./migrate-BHQ0pQ8v.js").then((m) => m.migrateSchemaFirstCommand)],
30
+ ["gen", () => import("./gen-CITLb2eh.js").then((m) => m.genCommand)],
31
+ ["doctor", () => import("./doctor-3L2SV9yp.js").then((m) => m.doctorCommand)],
32
32
  ["codes", () => import("./codes-DNq30BZg.js").then((m) => m.codesCommand)],
33
33
  ["db query", () => import("./db-od92zIrO.js").then((m) => m.dbQueryCommand)],
34
34
  ["db diff", () => import("./db-od92zIrO.js").then((m) => m.dbDiffCommand)],
35
35
  ["db seed", () => import("./seed-Dlm5jjPn.js").then((m) => m.seedCommand)],
36
- ["db backfill", () => import("./backfill-ff_y-n3l.js").then((m) => m.dbBackfillCommand)],
36
+ ["db backfill", () => import("./backfill-BN81Sthj.js").then((m) => m.dbBackfillCommand)],
37
37
  ["db verify", () => import("./verify-BFLaU6w3.js").then((m) => m.dbVerifyCommand)],
38
- ["db partition", () => import("./partition-C5G03PgD.js").then((m) => m.dbPartitionCommand)],
39
- ["db squash", () => import("./squash-DLXeXmpI.js").then((m) => m.dbSquashCommand)],
40
- ["workflows prune", () => import("./prune-workflows-BRLMJAN3.js").then((m) => m.workflowsPruneCommand)],
41
- ["dev", () => import("./dev-CJnbxe_s.js").then((m) => m.devCommand)],
38
+ ["db partition", () => import("./partition-BWiWQ7Wv.js").then((m) => m.dbPartitionCommand)],
39
+ ["db squash", () => import("./squash-bcwO1H_W.js").then((m) => m.dbSquashCommand)],
40
+ ["workflows prune", () => import("./prune-workflows-CJ4jrmPf.js").then((m) => m.workflowsPruneCommand)],
41
+ ["dev", () => import("./dev-Bd5y9TWU.js").then((m) => m.devCommand)],
42
42
  ["dev env", () => import("./env-bItpF97w.js").then((m) => m.envCommand)],
43
43
  ["dev run", () => import("./run-DbR0NaN_.js").then((m) => m.runCommand)],
44
44
  ["dev keys", () => import("./keys-f9iMQepr.js").then((m) => m.keysCommand)],
45
45
  ["dev stack ls", () => import("./stack-BUrc8jsg.js").then((m) => m.stackLsCommand)],
46
46
  ["dev stack prune", () => import("./stack-BUrc8jsg.js").then((m) => m.stackPruneCommand)],
47
47
  ["automations list", () => import("./automations-C1yZj3mn.js").then((m) => m.automationsListCommand)],
48
- ["blocks list", () => import("./blocks-BuwjO--N.js").then((m) => m.blocksListCommand)],
49
- ["blocks view", () => import("./blocks-BuwjO--N.js").then((m) => m.blocksViewCommand)],
50
- ["blocks search", () => import("./blocks-BuwjO--N.js").then((m) => m.blocksSearchCommand)],
51
- ["powersync streams", () => import("./powersync-TDly6ptq.js").then((m) => m.powersyncStreamsCommand)],
52
- ["spec emit", () => import("./spec--0tYexnO.js").then((m) => m.specEmitCommand)],
53
- ["spec validate", () => import("./spec--0tYexnO.js").then((m) => m.specValidateCommand)],
54
- ["mcp", () => import("./mcp-BwMLfpxa.js").then((m) => m.mcpCommand)],
48
+ ["blocks list", () => import("./blocks-i6YzVQLK.js").then((m) => m.blocksListCommand)],
49
+ ["blocks view", () => import("./blocks-i6YzVQLK.js").then((m) => m.blocksViewCommand)],
50
+ ["blocks search", () => import("./blocks-i6YzVQLK.js").then((m) => m.blocksSearchCommand)],
51
+ ["powersync streams", () => import("./powersync-C5u6SbHy.js").then((m) => m.powersyncStreamsCommand)],
52
+ ["spec emit", () => import("./spec-D2Xwy1gO.js").then((m) => m.specEmitCommand)],
53
+ ["spec validate", () => import("./spec-D2Xwy1gO.js").then((m) => m.specValidateCommand)],
54
+ ["mcp", () => import("./mcp-C08VfeGU.js").then((m) => m.mcpCommand)],
55
55
  ["skills list", () => import("./skills-C4vNmuxw.js").then((m) => m.skillsListCommand)],
56
56
  ["skills install", () => import("./skills-C4vNmuxw.js").then((m) => m.skillsInstallCommand)],
57
- ["codemod naming", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("naming"))],
58
- ["codemod extra-columns", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("extra-columns"))],
59
- ["codemod owned-columns", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("owned-columns"))],
60
- ["codemod config", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("config"))],
61
- ["codemod table-modules", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("table-modules"))],
62
- ["codemod account-calls", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("account-calls"))],
63
- ["codemod server-imports", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("server-imports"))],
64
- ["codemod generators", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("generators"))],
65
- ["codemod read-many", () => import("./codemod-Bu77IP-l.js").then((m) => m.codemodCommand("read-many"))],
57
+ ["codemod naming", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("naming"))],
58
+ ["codemod extra-columns", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("extra-columns"))],
59
+ ["codemod owned-columns", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("owned-columns"))],
60
+ ["codemod config", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("config"))],
61
+ ["codemod table-modules", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("table-modules"))],
62
+ ["codemod account-calls", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("account-calls"))],
63
+ ["codemod server-imports", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("server-imports"))],
64
+ ["codemod generators", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("generators"))],
65
+ ["codemod read-many", () => import("./codemod-Dn8JZhKC.js").then((m) => m.codemodCommand("read-many"))],
66
66
  ["completion", () => import("./completion-Ct0kXYpV.js").then((m) => m.completionCommand)],
67
67
  ["cache purge", () => import("./cache-DwdJCb29.js").then((m) => m.cachePurgeCommand)],
68
68
  ["config", () => import("./config-J8LaJ0Nl.js").then((m) => m.configCommand)]
@@ -746,7 +746,7 @@ function cliFromTree(init, extra = {}) {
746
746
  digest: globals["effects-digest"]
747
747
  });
748
748
  };
749
- await import("./memo-backend-yki17W-K.js").then(({ installMemo }) => installMemo(config.root));
749
+ await import("./memo-backend-Bjl2s-LJ.js").then(({ installMemo }) => installMemo(config.root));
750
750
  context = {
751
751
  cwd,
752
752
  config,
@@ -1,17 +1,17 @@
1
1
  import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
2
2
  import { a as entitlementsMode, c as unsafeKey, i as entitlementRequirements, n as accessRequirements, o as moduleKeyProblems, s as providerLabel } from "./authorization-CNWhpdKb.js";
3
- import { B as typegenVersionNotice, H as installedVersion, L as stabilizeMetadata, N as oxfmtInstalled, V as declaredPeers, W as satisfies, d as loadSnapshot, i as migrationsDir, z as typegenVersion } from "./sql-layout-CpbXj-r9.js";
4
- import { s as schemaStampPath } from "./content-mapper-Dby_JOgB.js";
3
+ import { B as typegenVersionNotice, H as installedVersion, L as stabilizeMetadata, N as oxfmtInstalled, V as declaredPeers, W as satisfies, d as loadSnapshot, i as migrationsDir, z as typegenVersion } from "./sql-layout-COn2WEKP.js";
4
+ import { s as schemaStampPath } from "./content-mapper-DBMKbB16.js";
5
5
  import { a as changedFiles, d as fileDiff, i as changeLines, r as applyPlan, s as hasConflicts } from "./files-NnXnawki.js";
6
6
  import { a as sameText, t as display } from "./io-CngfGyMA.js";
7
- import { n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-DUCrWiGS.js";
7
+ import { n as adoptionContext, r as appTablesOf, t as accessModule } from "./app-tables-Cwgr3GTi.js";
8
8
  import { r as errorText } from "./errors-B7i-VGxk.js";
9
- import { c as qualified, l as tableObject, r as exposed, s as policyObject, t as catalogOf } from "./shared-B9fxx6uL.js";
10
- import { a as storeTypesModule, o as typesModuleKey, s as writeAtomic } from "./cache-Di8fhrqf.js";
9
+ import { c as qualified, l as tableObject, r as exposed, s as policyObject, t as catalogOf } from "./shared-DJ0--OEH.js";
10
+ import { a as storeTypesModule, o as typesModuleKey, s as writeAtomic } from "./cache-BV7WlzUF.js";
11
11
  import { t as compiledReadSets } from "./read-sets-77o7SxpK.js";
12
- import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-Cl-I5j0j.js";
12
+ import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-N79wX1lQ.js";
13
13
  import { t as byCodePoint } from "./compare-yl4sSwVn.js";
14
- import { n as render } from "./render-DinflArt.js";
14
+ import { n as render } from "./render-t8Y_8QIm.js";
15
15
  import { existsSync } from "node:fs";
16
16
  import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
17
17
  import { readFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { a as toCatalog } from "./source-Dwn8SwJg.js";
1
+ import { a as toCatalog } from "./source-3EDa7rPw.js";
2
2
  import { h as tomlGet, p as sqlWorkflow, r as detectWorkflow } from "./supabase-toml-B6-eEV5p.js";
3
3
  // src/cli/doctor/shared.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-Bm4K-iOw.js";
1
+ import { t as VERSION } from "./version-DvQcNR10.js";
2
2
  import { n as CliError } from "./errors-B7i-VGxk.js";
3
3
  import { r as redactUrl } from "./redact--zOGdWzo.js";
4
4
  import { n as HTTP_CHANNEL } from "./trace-D3TNqWBg.js";
@@ -1 +1 @@
1
- export { n as specEmitCommand, i as specValidateCommand } from "./spec-BFlvbXVb.js";
1
+ export { n as specEmitCommand, i as specValidateCommand } from "./spec-DP9TaDgC.js";
@@ -4,8 +4,8 @@ import { t as CACHE_DIR } from "./store-DP-nmqBt.js";
4
4
  import { i as failedResult, n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
5
5
  import { a as changedFiles, i as changeLines, r as applyPlan } from "./files-NnXnawki.js";
6
6
  import { t as display } from "./io-CngfGyMA.js";
7
- import { s as writeAtomic } from "./cache-Di8fhrqf.js";
8
- import { t as VERSION } from "./version-Bm4K-iOw.js";
7
+ import { s as writeAtomic } from "./cache-BV7WlzUF.js";
8
+ import { t as VERSION } from "./version-DvQcNR10.js";
9
9
  import { t as importFresh } from "./fresh-import-CdO2oQaQ.js";
10
10
  import { t as isRecord } from "./guards-DxwRG0Uv.js";
11
11
  import { t as loadTopics } from "./topics-CqhOV1S0.js";
@@ -4,8 +4,8 @@ import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, n as declarative
4
4
  import { n as databaseUrl, p as accessToken } from "./config-NxPVkM-K.js";
5
5
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
6
6
  import { t as connect } from "./db-B_xr3ZvK.js";
7
- import { c as TYPEGEN_VERSION, n as cachedIntrospect, u as readExtras } from "./cache-Di8fhrqf.js";
8
- import { a as toCatalog, n as managementSource, r as pgSource } from "./source-Dwn8SwJg.js";
7
+ import { c as TYPEGEN_VERSION, n as cachedIntrospect, u as readExtras } from "./cache-BV7WlzUF.js";
8
+ import { a as toCatalog, n as managementSource, r as pgSource } from "./source-3EDa7rPw.js";
9
9
  import { existsSync } from "node:fs";
10
10
  import { dirname, join, posix, relative, resolve, sep } from "node:path";
11
11
  import { glob, readFile, readdir } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
2
  import { n as CliError, r as errorText } from "./errors-B7i-VGxk.js";
3
3
  import { r as supabaseCli } from "./exec-DBgtTCHK.js";
4
- import { i as migrationsDir } from "./sql-layout-CpbXj-r9.js";
4
+ import { i as migrationsDir } from "./sql-layout-COn2WEKP.js";
5
5
  import { r as migrationStamp } from "./migration-names-7zAdXfcd.js";
6
6
  import { resolve } from "node:path";
7
7
  import { readFile, readdir, rm, writeFile } from "node:fs/promises";
@@ -1,12 +1,12 @@
1
1
  import { d as fileDiff, i as changeLines, l as keepHandEdit, o as handEditedError, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-NnXnawki.js";
2
2
  import { t as display } from "./io-CngfGyMA.js";
3
- import { i as migrationsDir, l as sqlPlan } from "./sql-layout-CpbXj-r9.js";
3
+ import { i as migrationsDir, l as sqlPlan } from "./sql-layout-COn2WEKP.js";
4
4
  import { n as CliError } from "./errors-B7i-VGxk.js";
5
5
  import { t as loadTopics } from "./topics-CqhOV1S0.js";
6
- import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-Cl-I5j0j.js";
6
+ import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-N79wX1lQ.js";
7
7
  import { t as orphanedBlockFiles } from "./orphans-ByB0gKOp.js";
8
- import { r as layoutFor } from "./providers-B4QIwuqF.js";
9
- import { n as renderBlocksCached, t as cacheOf } from "./render-cache-BoFKfBx6.js";
8
+ import { r as layoutFor } from "./providers-CjF7HAPk.js";
9
+ import { n as renderBlocksCached, t as cacheOf } from "./render-cache-D-L0uCUa.js";
10
10
  import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, o as findSupabaseRoot, p as sqlWorkflow, t as PGDELTA_TABLE } from "./supabase-toml-B6-eEV5p.js";
11
11
  import { n as migrationFile, t as hasMigrationSuffix } from "./migration-names-7zAdXfcd.js";
12
12
  import { dirname, join, resolve } from "node:path";
@@ -1,12 +1,12 @@
1
1
  import { d as fileDiff, i as changeLines, r as applyPlan } from "./files-NnXnawki.js";
2
2
  import { t as display } from "./io-CngfGyMA.js";
3
- import { i as migrationsDir, l as sqlPlan } from "./sql-layout-CpbXj-r9.js";
3
+ import { i as migrationsDir, l as sqlPlan } from "./sql-layout-COn2WEKP.js";
4
4
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-B6-eEV5p.js";
5
- import { a as write, r as nextStep, s as topicPolicyFile } from "./sync-DHUrIa97.js";
5
+ import { a as write, r as nextStep, s as topicPolicyFile } from "./sync-DqvkQ5MB.js";
6
6
  import { n as migrationFile } from "./migration-names-7zAdXfcd.js";
7
- import { a as migrationInstances, c as sameModuleMigration, o as migrationModules, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-Cl-I5j0j.js";
8
- import { r as layoutFor } from "./providers-B4QIwuqF.js";
9
- import { n as renderBlocksCached, t as cacheOf } from "./render-cache-BoFKfBx6.js";
7
+ import { a as migrationInstances, c as sameModuleMigration, o as migrationModules, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-N79wX1lQ.js";
8
+ import { r as layoutFor } from "./providers-CjF7HAPk.js";
9
+ import { n as renderBlocksCached, t as cacheOf } from "./render-cache-D-L0uCUa.js";
10
10
  import { resolve } from "node:path";
11
11
  import { readFile, readdir } from "node:fs/promises";
12
12
  import { PRELUDE_FUNCTIONS, PRELUDE_MODULE, SQL_MODULES, buildModel, conflicts, duplicatePolicies, entityRenamePlan, moduleFileVersion, moduleTopics, sameBlockFile, upgradePlan } from "better-supabase/sql";
@@ -1,10 +1,10 @@
1
1
  import { m as commandMeta, r as defineCliCommand } from "./command-fqvJ0TdG.js";
2
- import { t as shadowedBlockColumns } from "./column-renames-B8tfoufA.js";
3
- import { n as appSchemaTexts } from "./sql-layout-CpbXj-r9.js";
2
+ import { t as shadowedBlockColumns } from "./column-renames-rRIoozHD.js";
3
+ import { n as appSchemaTexts } from "./sql-layout-COn2WEKP.js";
4
4
  import { t as SQL_ARGS } from "./args-CS_64_tg.js";
5
- import { o as dataMigration, t as syncModules } from "./sync-DHUrIa97.js";
6
- import { r as renderStats } from "./render-cache-BoFKfBx6.js";
7
- import { t as upgrade } from "./upgrade-DKfXHex4.js";
5
+ import { o as dataMigration, t as syncModules } from "./sync-DqvkQ5MB.js";
6
+ import { r as renderStats } from "./render-cache-D-L0uCUa.js";
7
+ import { t as upgrade } from "./upgrade-DmMKImiC.js";
8
8
  import { i as plain } from "./style-B5-nByxb.js";
9
9
  // src/cli/commands/upgrade.ts
10
10
  const UPGRADE_ARGS = {
@@ -1,3 +1,3 @@
1
1
  // src/cli/version.ts
2
- const VERSION = "0.58.1";
2
+ const VERSION = "0.58.2";
3
3
  export { VERSION as t };
@@ -1,5 +1,5 @@
1
1
  import { A as APP_ON_DELETE_ACTIONS } from "../instances-07Lopbd1.js";
2
- import { $ as eventsColumnsEdited, A as renameColumn, B as computedColumnRenamed, C as editTable, D as isEmptyDesign, E as isAppTable, F as tidy, G as isRollupAggregate, H as computedTableRenamed, I as updateTable, J as readableColumns, K as lookupSources, L as userConnection, M as setColumn, N as setTableId, O as moveTables, P as singular, Q as tableWithoutComputed, R as withDesign, S as duplicateTable, T as identifierError, U as filterColumns, V as computedRows, W as fittedRollup, X as rollupSources, Y as rollupColumns, Z as tableWithComputed, _ as columnError, a as parseSchema, at as encryptable, b as deleteColumn, c as tenantColumnOf, ct as optionError, d as previewFiles, et as subjectColumns, f as designIssues, g as appTableId, h as addTable, i as keyColumnsOf, it as columnLabel, j as renameTable, k as referenceFrom, l as schemaData, lt as takesBounds, m as EMPTY_DESIGN, n as loadProject, nt as subjectTypeError, o as schemaRelations, ot as fitted, p as APP_MODULE, q as prunedComputed, r as checkDesign, rt as boundError, s as tableStatements, st as lockedWithoutDefault, t as checkProject, tt as subjectColumnsEdited, u as previewAccessProvider, ut as withBounds, v as connect, w as freeTableName, x as deleteTable, y as defaultError, z as ROLLUP_AGGREGATES } from "../project-Bgz2gbh5.js";
2
+ import { $ as eventsColumnsEdited, A as renameColumn, B as computedColumnRenamed, C as editTable, D as isEmptyDesign, E as isAppTable, F as tidy, G as isRollupAggregate, H as computedTableRenamed, I as updateTable, J as readableColumns, K as lookupSources, L as userConnection, M as setColumn, N as setTableId, O as moveTables, P as singular, Q as tableWithoutComputed, R as withDesign, S as duplicateTable, T as identifierError, U as filterColumns, V as computedRows, W as fittedRollup, X as rollupSources, Y as rollupColumns, Z as tableWithComputed, _ as columnError, a as parseSchema, at as encryptable, b as deleteColumn, c as tenantColumnOf, ct as optionError, d as previewFiles, et as subjectColumns, f as designIssues, g as appTableId, h as addTable, i as keyColumnsOf, it as columnLabel, j as renameTable, k as referenceFrom, l as schemaData, lt as takesBounds, m as EMPTY_DESIGN, n as loadProject, nt as subjectTypeError, o as schemaRelations, ot as fitted, p as APP_MODULE, q as prunedComputed, r as checkDesign, rt as boundError, s as tableStatements, st as lockedWithoutDefault, t as checkProject, tt as subjectColumnsEdited, u as previewAccessProvider, ut as withBounds, v as connect, w as freeTableName, x as deleteTable, y as defaultError, z as ROLLUP_AGGREGATES } from "../project-Ch2b_g1M.js";
3
3
  import { m as diffDesigns } from "../preset-HzYIrxUS.js";
4
4
  // src/create/column-kinds.ts
5
5
  /** The groups of the column type picker, in the order it shows them. */
@@ -1,7 +1,7 @@
1
1
  import { n as loadLite, t as LITE_INSTALL } from "../../runtime-sBnEajcK.js";
2
2
  import { b as appDefaultError } from "../../instances-07Lopbd1.js";
3
- import { t as defineApi } from "../../api-D-YoZpRe.js";
4
- import { n as loadProject } from "../../project-Bgz2gbh5.js";
3
+ import { t as defineApi } from "../../api-D8E2jvT5.js";
4
+ import { n as loadProject } from "../../project-Ch2b_g1M.js";
5
5
  import { c as resolvePersonas } from "../../config-DzPViWQU.js";
6
6
  import { i as fillTemplate } from "../../access-sql-Dvl7BRy0.js";
7
7
  // src/create/lite/apply.ts
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "../../version-Ce4Rk4uV.js";
1
+ import { t as VERSION } from "../../version-BAL_8E6V.js";
2
2
  import { f as siblingPath, t as HEADER } from "../../shared-BXRDj6UR.js";
3
3
  import { r as relativeImport } from "../../kit-D6kdfQFj.js";
4
4
  // src/generators/factories.ts
@@ -1 +1 @@
1
- export { t as jsonSchema, n as toJsonSchema } from "../../json-schema-Ba8xSQxR.js";
1
+ export { t as jsonSchema, n as toJsonSchema } from "../../json-schema-DxVQGZbL.js";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "../../version-Ce4Rk4uV.js";
1
+ import { t as VERSION } from "../../version-BAL_8E6V.js";
2
2
  import { f as siblingPath, t as HEADER } from "../../shared-BXRDj6UR.js";
3
3
  // src/generators/nuqs.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "../../version-Ce4Rk4uV.js";
1
+ import { t as VERSION } from "../../version-BAL_8E6V.js";
2
2
  import { _ as variantTitle, c as parseImport, d as schemaName, f as siblingPath, i as fieldsFor, l as propertyKey, m as tableEntries, n as fieldDocs, p as tableDocs, r as fieldSpec, t as HEADER, v as variantsFor } from "../../shared-BXRDj6UR.js";
3
3
  import { a as objectType, i as fieldMetaLines, n as extraSchemas } from "../../extras-CW8CKLeE.js";
4
4
  import { r as relativeImport } from "../../kit-D6kdfQFj.js";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "../../version-Ce4Rk4uV.js";
1
+ import { t as VERSION } from "../../version-BAL_8E6V.js";
2
2
  import { _ as variantTitle, a as optionalLine, c as parseImport, d as schemaName, f as siblingPath, h as temporalGuardImport, i as fieldsFor, l as propertyKey, m as tableEntries, n as fieldDocs, p as tableDocs, t as HEADER, u as rowType, v as variantsFor } from "../../shared-BXRDj6UR.js";
3
3
  import { a as objectType, i as fieldMetaLines, n as extraSchemas, o as resultType, t as extraKinds } from "../../extras-CW8CKLeE.js";
4
4
  import { r as relativeImport } from "../../kit-D6kdfQFj.js";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "../../version-Ce4Rk4uV.js";
1
+ import { t as VERSION } from "../../version-BAL_8E6V.js";
2
2
  import { _ as variantTitle, a as optionalLine, c as parseImport, d as schemaName, f as siblingPath, h as temporalGuardImport, i as fieldsFor, l as propertyKey, m as tableEntries, n as fieldDocs, p as tableDocs, t as HEADER, u as rowType, v as variantsFor } from "../../shared-BXRDj6UR.js";
3
3
  import { a as objectType, i as fieldMetaLines, n as extraSchemas, o as resultType, t as extraKinds } from "../../extras-CW8CKLeE.js";
4
4
  import { r as relativeImport } from "../../kit-D6kdfQFj.js";
@@ -1,5 +1,5 @@
1
1
  import { i as tableJsonSchema, r as fieldJsonSchema, t as forTarget } from "./table-schema-CnUdpnfT.js";
2
- import { t as VERSION } from "./version-Ce4Rk4uV.js";
2
+ import { t as VERSION } from "./version-BAL_8E6V.js";
3
3
  import { t as isList } from "./guards-CsRa6v57.js";
4
4
  import { n as extraSchemas, r as fieldMeta } from "./extras-CW8CKLeE.js";
5
5
  import { _ as variantTitle, f as siblingPath, i as fieldsFor, m as tableEntries, n as fieldDocs, p as tableDocs, r as fieldSpec, v as variantsFor } from "./shared-BXRDj6UR.js";
@@ -1,10 +1,10 @@
1
- import { d as loadSnapshot } from "../cli/sql-layout-CpbXj-r9.js";
1
+ import { d as loadSnapshot } from "../cli/sql-layout-COn2WEKP.js";
2
2
  import { i as discoverConfig, s as loadConfig } from "../cli/config-NxPVkM-K.js";
3
- import { s as schemaStampPath } from "../cli/content-mapper-Dby_JOgB.js";
3
+ import { s as schemaStampPath } from "../cli/content-mapper-DBMKbB16.js";
4
4
  import { i as parseEnv, n as configEnvironment } from "../cli/env-CQ831uY0.js";
5
- import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-DinflArt.js";
6
- import { i as lastTypesModule, o as typesModuleKey, s as writeAtomic } from "../cli/cache-Di8fhrqf.js";
7
- import { t as VERSION } from "../cli/version-Bm4K-iOw.js";
5
+ import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-t8Y_8QIm.js";
6
+ import { i as lastTypesModule, o as typesModuleKey, s as writeAtomic } from "../cli/cache-BV7WlzUF.js";
7
+ import { t as VERSION } from "../cli/version-DvQcNR10.js";
8
8
  import { existsSync, realpathSync } from "node:fs";
9
9
  import { basename, dirname, join, resolve } from "node:path";
10
10
  import { readFile } from "node:fs/promises";
package/dist/mcp/index.js CHANGED
@@ -1 +1 @@
1
- export { r as MCP_PROTOCOL_VERSION, i as answerLine, a as answerMessage, t as createMcp, n as defineTool } from "../mcp-CaC-3JB3.js";
1
+ export { r as MCP_PROTOCOL_VERSION, i as answerLine, a as answerMessage, t as createMcp, n as defineTool } from "../mcp-Cl8x5Ffg.js";
@@ -3,7 +3,7 @@ import { n as jsonResponse, t as jsonReplacer } from "./json-O5vFw243.js";
3
3
  import { a as methodNotAllowed, c as toProblem, o as problemResponse } from "./problem-BwplIuhI.js";
4
4
  import { n as validate } from "./standard-DM4THQrL.js";
5
5
  import { t as boundedTtlCache } from "./ttl-cache-C5S0L2wx.js";
6
- import { n as toJsonSchema, r as toDraft07 } from "./json-schema-Ba8xSQxR.js";
6
+ import { n as toJsonSchema, r as toDraft07 } from "./json-schema-DxVQGZbL.js";
7
7
  import { t as adapterBase } from "./adapter-base-8PuJ3OoB.js";
8
8
  import { p as flushEvents } from "./sessions-Dedk1ubX.js";
9
9
  import { t as withExtra } from "./extra-Dz9n5y1s.js";
@@ -1,7 +1,7 @@
1
1
  import { r as blockEventAttributes } from "../block-events-uKWyOpAy.js";
2
2
  import { r as definePlugin } from "../plugin-Ca2qBiFZ.js";
3
3
  import { t as SPEC_PINS } from "../spec-pins-Dlz8OVqi.js";
4
- import "../version-Ce4Rk4uV.js";
4
+ import "../version-BAL_8E6V.js";
5
5
  import { SpanKind, SpanStatusCode, context, metrics, propagation, trace } from "@opentelemetry/api";
6
6
  // src/otel/index.ts
7
7
  const INSTRUMENTATION_NAME = "better-supabase";
@@ -40,9 +40,9 @@ function systemOf(executor) {
40
40
  * ```
41
41
  */
42
42
  function otel(options = {}) {
43
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.1");
43
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.2");
44
44
  let histogram;
45
- if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.58.1")).createHistogram("db.client.operation.duration", {
45
+ if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.58.2")).createHistogram("db.client.operation.duration", {
46
46
  unit: "s",
47
47
  description: "Duration of database client operations.",
48
48
  advice: { explicitBucketBoundaries: [
@@ -231,7 +231,7 @@ function otel(options = {}) {
231
231
  * `betterSupabase.events`. Returns a function that stops listening.
232
232
  */
233
233
  function traceAuth(betterSupabase, options = {}) {
234
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.1");
234
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.2");
235
235
  const offAuth = betterSupabase.events.on("auth", (event) => {
236
236
  const span = tracer.startSpan("auth.resolve", {
237
237
  kind: SpanKind.INTERNAL,
@@ -270,7 +270,7 @@ function traceAuth(betterSupabase, options = {}) {
270
270
  * `*.denied`) set an error status. Returns a function that stops listening.
271
271
  */
272
272
  function traceBlockEvents(betterSupabase, options = {}) {
273
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.1");
273
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.58.2");
274
274
  return betterSupabase.events.on("block", (event) => {
275
275
  const attributes = {
276
276
  ...options.attributes,
@@ -2,7 +2,7 @@ import { a as presetOf, f as resolvePreset } from "./config-a_CzEbpi.js";
2
2
  import { D as designOf, M as parseDesign, j as jsonPointer, k as encodeDesign, v as DesignParseError, w as designConfig, y as DesignTooLongError } from "./preset-HzYIrxUS.js";
3
3
  import { I as PRESET_CATALOG, b as appDefaultError, d as appIdentifierError, f as appNameLengthError, p as appReservedColumns, x as isAppDefault } from "./instances-07Lopbd1.js";
4
4
  import { i as resolveConfig } from "./config-DzPViWQU.js";
5
- import { Ft as SQL_MODULES, ot as renderBlocks, q as moduleLayout } from "./sql-BbaGokNJ.js";
5
+ import { Ft as SQL_MODULES, ot as renderBlocks, q as moduleLayout } from "./sql-Cukwmnm3.js";
6
6
  // src/create/column-keys.ts
7
7
  /** The most options a select takes, and the longest option. */
8
8
  const MAX_OPTIONS = 100;
@@ -1,5 +1,5 @@
1
- import { a as toOpenApi30Schema, n as openapiFormat, o as defineDocumentFormat, r as OPENAPI_33_PREVIEW_VERSION, t as defineApi } from "../api-D-YoZpRe.js";
2
- import { a as topicsFrom, c as PROBLEM_SCHEMA, d as mergeJson, f as pointerToken, i as safeKey, l as convertStandard, r as CLOUD_EVENT_TRAIT, s as DEFAULT_ERRORS, t as defineApiModel, u as pascal } from "../build-1ikup3O6.js";
1
+ import { a as toOpenApi30Schema, n as openapiFormat, o as defineDocumentFormat, r as OPENAPI_33_PREVIEW_VERSION, t as defineApi } from "../api-D8E2jvT5.js";
2
+ import { a as topicsFrom, c as PROBLEM_SCHEMA, d as mergeJson, f as pointerToken, i as safeKey, l as convertStandard, r as CLOUD_EVENT_TRAIT, s as DEFAULT_ERRORS, t as defineApiModel, u as pascal } from "../build-6vLM3d_J.js";
3
3
  import { t as FUNCTION_DESCRIPTOR } from "../function-contract-Bf6llTkE.js";
4
4
  import { r as isPlainObject } from "../clone-H_gCsL29.js";
5
5
  import { a as methodNotAllowed } from "../problem-BwplIuhI.js";
package/dist/sql/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { B as resolveBlock, T as hasColumnAccess, h as appTableEventTypes } from "../instances-07Lopbd1.js";
2
- import { $ as ownerOf, $t as redundantNulls, A as declaredCheckValues, At as sameBlockFile, B as clearMemo, Bt as excludedColumns, C as rulePolicy, Ct as appTablesFiles, D as duplicateObjects, Dt as blockFileState, E as sharedRolesProblems, Et as blockSqlVersion, F as sameTenantLayout, Ft as SQL_MODULES, G as blockTables, Gt as keysetPredicate, H as memoized, Ht as SECRET_COLUMNS, I as adoptedColumnProblems, It as moduleSource, J as entityRenamePlan, Jt as listOrder, K as seedDefaultsFunctions, Kt as listBody, L as adoptedTables, Lt as resolveBlocks, M as tenantsQuery, Mt as moduleHidingColumns, N as expiredFlagsQuery, Nt as modulePermissionKeys, O as writtenValues, Ot as isModuleDataFile, P as ownedColumns, Pt as moduleSchemaExtensions, Q as duplicatePolicies, Qt as moduleContext, R as adoptedViews, Rt as TENANT_SCOPE_NAMES, S as renderRulePolicy, St as APP_TABLES_MODULE, T as compileReadSets, Tt as renderAutoEmbedding, U as setMemoBackend, Ut as dataExportPlan, V as memoStats, Vt as resolveExposeColumns, W as instanceFunctions, Wt as LIST_TOTAL_CAP, X as buildModel, Xt as sameTenantTrigger, Y as appColumnsOf, Yt as sameTenantColumn, Z as conflicts, Zt as migrationOptionUses, _ as disallowedPolicyCalls, _n as extensionSchema, _t as setModuleRenderStore, a as setTableFeature, an as checkedValueMaps, at as moduleTopics, b as readRulePolicies, bn as auditRegistrations, bt as moduleFilePaths, c as RENDERED_FEATURES, cn as AUDIT_CATEGORIES, ct as upgradePlan, d as setTagBlock, dn as declaredColumnTypes, dt as appTablePolicyNotes, en as MODULE_ID_TYPES, et as parseDeclared, f as commentOnTableSql, fn as declaredIndexes, ft as declaredPolicies, g as POLICY_FUNCTIONS, gn as declaredViews, gt as moduleRenderStats, h as setBsbTag, hn as declaredUpdatedAtTriggers, ht as PRELUDE_MODULE, i as setFeatureStatement, in as appValues, it as moduleBody, j as blockReadRoles, jt as moduleEventTriggers, k as checkValues, kt as moduleFileVersion, l as isRenderedFeature, ln as BLOCK_OPTION_SCHEMAS, lt as bsbPolicyName, m as parseBsbComment, mn as declaredTables, mt as PRELUDE_FUNCTIONS, n as createsTable, nn as moduleIdType, nt as splitStatements, o as tableFeatures, on as legacyOptionTables, ot as renderBlocks, p as formatBsbComment, pn as declaredTableColumns, pt as widenedCommands, q as moduleLayout, qt as listDeclare, r as isTableFeature, rn as contractSignature, rt as customContracts, s as tableTagComments, sn as legacyOptionTarget, st as moduleDeprecations, t as TABLE_FEATURES, tn as isBlockSqlIdType, tt as setParseStore, u as renderTagBlock, un as addedColumnTypes, ut as UNSCOPED_MODULE, v as isRule, vn as policyGrants, vt as renderKey, w as compileReadSet, wt as scopePolicyName, x as renderRule, xt as APP_TABLES_MARKER, y as policyFunctionsSql, yn as rlsTables, yt as moduleDataDir, z as moduleWritesText, zt as TENANT_SCOPE_POLICY } from "../sql-BbaGokNJ.js";
2
+ import { $ as ownerOf, $t as redundantNulls, A as declaredCheckValues, At as sameBlockFile, B as clearMemo, Bt as excludedColumns, C as rulePolicy, Ct as appTablesFiles, D as duplicateObjects, Dt as blockFileState, E as sharedRolesProblems, Et as blockSqlVersion, F as sameTenantLayout, Ft as SQL_MODULES, G as blockTables, Gt as keysetPredicate, H as memoized, Ht as SECRET_COLUMNS, I as adoptedColumnProblems, It as moduleSource, J as entityRenamePlan, Jt as listOrder, K as seedDefaultsFunctions, Kt as listBody, L as adoptedTables, Lt as resolveBlocks, M as tenantsQuery, Mt as moduleHidingColumns, N as expiredFlagsQuery, Nt as modulePermissionKeys, O as writtenValues, Ot as isModuleDataFile, P as ownedColumns, Pt as moduleSchemaExtensions, Q as duplicatePolicies, Qt as moduleContext, R as adoptedViews, Rt as TENANT_SCOPE_NAMES, S as renderRulePolicy, St as APP_TABLES_MODULE, T as compileReadSets, Tt as renderAutoEmbedding, U as setMemoBackend, Ut as dataExportPlan, V as memoStats, Vt as resolveExposeColumns, W as instanceFunctions, Wt as LIST_TOTAL_CAP, X as buildModel, Xt as sameTenantTrigger, Y as appColumnsOf, Yt as sameTenantColumn, Z as conflicts, Zt as migrationOptionUses, _ as disallowedPolicyCalls, _n as extensionSchema, _t as setModuleRenderStore, a as setTableFeature, an as checkedValueMaps, at as moduleTopics, b as readRulePolicies, bn as auditRegistrations, bt as moduleFilePaths, c as RENDERED_FEATURES, cn as AUDIT_CATEGORIES, ct as upgradePlan, d as setTagBlock, dn as declaredColumnTypes, dt as appTablePolicyNotes, en as MODULE_ID_TYPES, et as parseDeclared, f as commentOnTableSql, fn as declaredIndexes, ft as declaredPolicies, g as POLICY_FUNCTIONS, gn as declaredViews, gt as moduleRenderStats, h as setBsbTag, hn as declaredUpdatedAtTriggers, ht as PRELUDE_MODULE, i as setFeatureStatement, in as appValues, it as moduleBody, j as blockReadRoles, jt as moduleEventTriggers, k as checkValues, kt as moduleFileVersion, l as isRenderedFeature, ln as BLOCK_OPTION_SCHEMAS, lt as bsbPolicyName, m as parseBsbComment, mn as declaredTables, mt as PRELUDE_FUNCTIONS, n as createsTable, nn as moduleIdType, nt as splitStatements, o as tableFeatures, on as legacyOptionTables, ot as renderBlocks, p as formatBsbComment, pn as declaredTableColumns, pt as widenedCommands, q as moduleLayout, qt as listDeclare, r as isTableFeature, rn as contractSignature, rt as customContracts, s as tableTagComments, sn as legacyOptionTarget, st as moduleDeprecations, t as TABLE_FEATURES, tn as isBlockSqlIdType, tt as setParseStore, u as renderTagBlock, un as addedColumnTypes, ut as UNSCOPED_MODULE, v as isRule, vn as policyGrants, vt as renderKey, w as compileReadSet, wt as scopePolicyName, x as renderRule, xt as APP_TABLES_MARKER, y as policyFunctionsSql, yn as rlsTables, yt as moduleDataDir, z as moduleWritesText, zt as TENANT_SCOPE_POLICY } from "../sql-Cukwmnm3.js";
3
3
  import { a as LEGACY_OPTION } from "../options-Bfd-k6yw.js";
4
4
  import { A as notNullCheckName } from "../shared-D-qwk29i.js";
5
5
  import { s as subjectColumns } from "../contributions-Bh-HcHoJ.js";
@@ -23952,7 +23952,15 @@ ${indent}end if;`;
23952
23952
  const escalatedSet = `coalesce((q.bsb_step ->> 'escalated')::boolean, false)`;
23953
23953
  const decidedHere = (row) => `exists (select 1 from ${decisions} x where x.${d("request")} = ${row}.${c("id")} and x.${d("step")} = ${stepOf(row)} and x.${d("approver")} = ${row}.bsb_me)`;
23954
23954
  const delegatedHere = delegation ? `\n or exists (select 1 from ${decisions} x where x.${d("request")} = q.${c("id")} and x.${d("step")} = ${stepOf("q")} and x.${d("decision")} = 'delegated' and x.${d("delegateTo")} = q.bsb_me)` : "";
23955
- const providerFallback = provider === void 0 ? "" : `\n or ${fn("approval_eligible")}(q.${c("id")})`;
23955
+ const stepApprovers = escalates ? `case when ${escalatedSet} then ${approversIn("escalateTo")} else ${approversIn("approvers")} end` : approversIn("approvers");
23956
+ const providerSet = approverCheck(ctx, layout, {
23957
+ kind: { sql: `q.${c("subjectType")} || '.' || q.${c("action")}` },
23958
+ subject: `q.${c("subjectId")}::text`,
23959
+ tenant: `q.${c("tenant")}`,
23960
+ requester: `q.${c("requestedBy")}`,
23961
+ approvers: `(coalesce(${stepApprovers}, '{}'::jsonb) || jsonb_build_object('required', coalesce(q.bsb_step -> 'required', '1'::jsonb)))`
23962
+ });
23963
+ const providerFallback = providerSet === void 0 ? "" : `\n or (q.bsb_me is distinct from q.${c("requestedBy")} and coalesce((${providerSet.sql}), false))`;
23956
23964
  const linkedSet = linked.flatMap((each) => each.approvable === void 0 ? [] : [`when q.${c("subjectType")} = ${sqlString(each.subject)} then (${each.approvable({
23957
23965
  id: `q.${c("id")}`,
23958
23966
  subjectId: `q.${c("subjectId")}`,
@@ -72406,14 +72414,26 @@ set search_path = ''
72406
72414
  as $$
72407
72415
  begin
72408
72416
  return (
72417
+ with e as materialized (
72418
+ select x.row, x.n from jsonb_array_elements(${m.fn("messaging_messages_json")}(comments_json.ids)) with ordinality x(row, n)
72419
+ ),
72420
+ c as materialized (
72421
+ select c.${cv("id")} as id, c.${cv("subjectType")} as subject_type, c.${cv("subjectId")} as subject_id
72422
+ from ${m.table("conversations")} c
72423
+ where c.${cv("id")} = any (array(select distinct (e.row ->> ${key(ms("conversation"))})::uuid from e))
72424
+ ),
72425
+ t as materialized (
72426
+ select t.${k("message")} as message, t.${k("task")} as task from ${tasks} t
72427
+ where t.${k("message")} = any (comments_json.ids)
72428
+ )
72409
72429
  select coalesce(jsonb_agg(e.row || jsonb_build_object(
72410
- 'subject_type', c.${cv("subjectType")},
72411
- 'subject_id', c.${cv("subjectId")},
72412
- 'task_id', t.${k("task")}
72430
+ 'subject_type', c.subject_type,
72431
+ 'subject_id', c.subject_id,
72432
+ 'task_id', t.task
72413
72433
  ) order by e.n), '[]'::jsonb)
72414
- from jsonb_array_elements(${m.fn("messaging_messages_json")}(comments_json.ids)) with ordinality e(row, n)
72415
- join ${m.table("conversations")} c on c.${cv("id")} = (e.row ->> ${key(ms("conversation"))})::uuid
72416
- left join ${tasks} t on t.${k("message")} = (e.row ->> ${key(ms("id"))})::uuid
72434
+ from e
72435
+ join c on c.id = (e.row ->> ${key(ms("conversation"))})::uuid
72436
+ left join t on t.message = (e.row ->> ${key(ms("id"))})::uuid
72417
72437
  );
72418
72438
  end;
72419
72439
  $$;
@@ -160906,7 +160926,7 @@ function messagesJson(q) {
160906
160926
  table: t("messages"),
160907
160927
  id: ms("id"),
160908
160928
  user: ms("author"),
160909
- visible: `exists (select 1 from ${t("conversations")} c where c.${q.cols("conversations")("id")} = y.${ms("conversation")} and ${conversationReadable(q, "c")})`,
160929
+ visible: `y.${ms("conversation")} = any (array(select c.${q.cols("conversations")("id")} from ${t("conversations")} c where c.${q.cols("conversations")("id")} = any (array(select distinct v.${ms("conversation")} from ${t("messages")} v where v.${ms("id")} = any ($1))) and ${conversationReadable(q, "c")}))`,
160910
160930
  what: "The name and avatar of each message's author, keyed by message id,\n-- for the messages of ids the caller may read."
160911
160931
  });
160912
160932
  const files = ctx.installed("attachments") ? (() => {
@@ -219442,6 +219462,7 @@ function build$7(ctx, layout) {
219442
219462
  const planKeys = typeof layout.entitlements?.source === "object" ? ` or q.${qc("plan")} = any (better_supabase.tenant_plans(tenant))` : "";
219443
219463
  const entitled = ctx.entitlements("tenant");
219444
219464
  const planMatches = entitled ? `q.${qc("plan")} = '*' or q.${qc("plan")} = any (${entitled})${planKeys}` : `q.${qc("plan")} = '*'`;
219465
+ const planMatchesOnce = entitled ? `q.${qc("plan")} = '*' or q.${qc("plan")} = any ((select ${ctx.entitlements("usage_overview.tenant") ?? entitled})::text[])${planKeys === "" ? "" : ` or q.${qc("plan")} = any ((select better_supabase.tenant_plans(usage_overview.tenant))::text[])`}` : `q.${qc("plan")} = '*'`;
219445
219466
  return `${schemaPreamble(ctx)}
219446
219467
  -- Usage per tenant, meter and UTC day. Quotas sum the days of their period.
219447
219468
  create table if not exists ${counters} (
@@ -219832,8 +219853,9 @@ begin
219832
219853
  end;
219833
219854
  $$;
219834
219855
 
219835
- -- One row per meter: the quota resolved once, the window once per distinct
219836
- -- period, and the counters summed in one grouped join. The catalog is read once.
219856
+ -- One row per meter: the tenant's plans and entitlements read once, the quota
219857
+ -- resolved once, the window once per distinct period, and the counters summed
219858
+ -- in one grouped join. The catalog is read once.
219837
219859
  create or replace function ${fn("usage_overview")}(tenant ${id})
219838
219860
  returns jsonb
219839
219861
  language plpgsql
@@ -219846,12 +219868,15 @@ begin
219846
219868
  ${fail("USAGE_FORBIDDEN", "Not allowed to read usage in this tenant")}
219847
219869
  end if;
219848
219870
  return (
219849
- with meters as (
219871
+ with scoped as materialized (
219872
+ select q.* from ${quotas} q
219873
+ where q.${qc("tenant")} = usage_overview.tenant
219874
+ or (q.${qc("tenant")} is null and (${planMatchesOnce}))
219875
+ ),
219876
+ meters as (
219850
219877
  select jsonb_object_keys(${fn("usage_meters")}()) as meter
219851
219878
  union
219852
- select q.${qc("meter")} from ${quotas} q
219853
- where q.${qc("tenant")} = usage_overview.tenant
219854
- or (q.${qc("tenant")} is null and (${planMatches.replaceAll("(tenant)", "(usage_overview.tenant)")}))
219879
+ select q.${qc("meter")} from scoped q
219855
219880
  union
219856
219881
  select distinct c.${cc("meter")} from ${counters} c
219857
219882
  where c.${cc("tenant")} = usage_overview.tenant
@@ -219861,10 +219886,8 @@ begin
219861
219886
  q.${qc("meter")} as meter,
219862
219887
  q.${qc("limit")} as quota_limit,
219863
219888
  ${quotaPeriod("q")} as period
219864
- from ${quotas} q
219889
+ from scoped q
219865
219890
  join meters m on m.meter = q.${qc("meter")}
219866
- where q.${qc("tenant")} = usage_overview.tenant
219867
- or (q.${qc("tenant")} is null and (${planMatches.replaceAll("(tenant)", "(usage_overview.tenant)")}))
219868
219891
  order by q.${qc("meter")}, (q.${qc("tenant")} is not null) desc, q.${qc("limit")} desc nulls first
219869
219892
  ),
219870
219893
  chosen as (
@@ -34,7 +34,7 @@ import { t as AUTHZ_VERSION_CLAIM } from "../claim-names-B3KyK7Js.js";
34
34
  import { c as snapshotOf } from "../snapshot-C1KUHKTc.js";
35
35
  import { c as requestOf, i as defineAuthorizer, r as checkPermission } from "../authorizer-DtUCjKBn.js";
36
36
  import { t as mailHeaders } from "../delivery-SmPHu2_H.js";
37
- import { t as defineApiModel } from "../build-1ikup3O6.js";
37
+ import { t as defineApiModel } from "../build-6vLM3d_J.js";
38
38
  import { i as resolveConfig, r as generatorProblem } from "../config-DzPViWQU.js";
39
39
  import { i as embedVectors } from "../knowledge-LNI5C6QT.js";
40
40
  import { n as toFhirPrescription } from "../prescriptions-CzY13vFr.js";
@@ -1,3 +1,3 @@
1
1
  // src/core/version.ts
2
- const VERSION = "0.58.1";
2
+ const VERSION = "0.58.2";
3
3
  export { VERSION as t };
@@ -1,4 +1,4 @@
1
- import { n as defineTool } from "../mcp-CaC-3JB3.js";
1
+ import { n as defineTool } from "../mcp-Cl8x5Ffg.js";
2
2
  // src/webmcp/webmcp.ts
3
3
  /** The WebMCP tool name rule: 1 to 128 ASCII letters, digits, `_`, `-` or `.`. */
4
4
  const TOOL_NAME = /^[A-Za-z0-9_.-]{1,128}$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.58.1",
3
+ "version": "0.58.2",
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",
@@ -1 +0,0 @@
1
- export { t as addCommand } from "./add-B63B07UG.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-WhAasez3.js";