better-supabase 0.18.1 → 0.18.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 (56) hide show
  1. package/dist/{app-tables-XwCviyhP.d.ts → app-tables-atP-tZKZ.d.ts} +1 -1
  2. package/dist/blocks/audit/index.d.ts +1 -1
  3. package/dist/cli/{add-C5kLXuqn.js → add-CbUFLPVA.js} +9 -9
  4. package/dist/cli/{add-CTtj1dfh.js → add-ee805E_R.js} +2 -2
  5. package/dist/cli/add-k8gdux-e.js +1 -0
  6. package/dist/cli/{backfill-C-b6eH98.js → backfill-CCNXzDjt.js} +1 -1
  7. package/dist/cli/bin.js +1 -1
  8. package/dist/cli/{blocks-CT8-TBdW.js → blocks-CKp4EfLe.js} +1 -1
  9. package/dist/cli/{blocks-zpu__C1Y.js → blocks-DNgcfS8X.js} +1 -1
  10. package/dist/cli/{cache-BxohmNou.js → cache-CDNVq1vO.js} +1 -1
  11. package/dist/cli/{codemod-BVo3sdx7.js → codemod-B621vQYQ.js} +1 -1
  12. package/dist/cli/{content-mapper-D54wumPS.js → content-mapper-Chm3txER.js} +2 -2
  13. package/dist/cli/{doctor-DBxc5aud.js → doctor-EWtWH8I9.js} +15 -15
  14. package/dist/cli/{gen--IBq-J4M.js → gen-D-g9TAmr.js} +11 -11
  15. package/dist/cli/index.d.ts +1 -1
  16. package/dist/cli/index.js +6 -6
  17. package/dist/cli/{init-Dxvlzka4.js → init-D0SxtKH5.js} +5 -5
  18. package/dist/cli/{live-C-0OdLKE.js → live-PaO1MC10.js} +2 -2
  19. package/dist/cli/{mcp-3q5RDvYJ.js → mcp-CHpzdlOg.js} +2 -2
  20. package/dist/cli/{metadata-Dvc6U3bk.js → metadata-KKCdxMLb.js} +3 -3
  21. package/dist/cli/{migration-safety-DYgarZxP.js → migration-safety-Cgr44KLM.js} +1 -1
  22. package/dist/cli/{migrations-Cwh5VvUC.js → migrations-VmJloDtq.js} +1 -1
  23. package/dist/cli/{module-migration-CXtSwDLu.js → module-migration-D4lirR47.js} +2 -2
  24. package/dist/cli/powersync-Bo16K2S6.js +1 -0
  25. package/dist/cli/{powersync-BCDuGn5p.js → powersync-Cc9Ad_Mn.js} +2 -2
  26. package/dist/cli/{print-Dpfa_--H.js → print-CXmXGe3Y.js} +2 -2
  27. package/dist/cli/{remove-DpAwgO8A.js → remove-CJi3fvpP.js} +5 -5
  28. package/dist/cli/{render-D9c5ynjR.js → render-CVTKsacY.js} +3 -3
  29. package/dist/cli/{run-Q5V5Kle1.js → run-DvK2vagi.js} +21 -21
  30. package/dist/cli/{run-CuzSU8Sk.js → run-x9l841K2.js} +8 -8
  31. package/dist/cli/{shared-BNScv93m.js → shared-FhGSrA9E.js} +1 -1
  32. package/dist/cli/{snapshot-k4R6vT20.js → snapshot-B12QpZNf.js} +2 -2
  33. package/dist/cli/{source-MMQKgaIx.js → source-DP8KOgax.js} +1 -1
  34. package/dist/cli/{spec-CqANRfuu.js → spec-CIQBAQgr.js} +1 -1
  35. package/dist/cli/{spec-CCpPVw_T.js → spec-D-NPgLTj.js} +2 -2
  36. package/dist/cli/{sql-layout-AByPAQXl.js → sql-layout-DTczUfCt.js} +2 -2
  37. package/dist/cli/{sync-DYQVml8j.js → sync-DHJ6UBod.js} +3 -3
  38. package/dist/cli/{upgrade-DHcIHeRM.js → upgrade-B69K7-JE.js} +4 -4
  39. package/dist/cli/{upgrade-f-3Nl6lO.js → upgrade-C7SEKT4b.js} +2 -2
  40. package/dist/cli/{version-DzroJkIT.js → version-DmaGTP3L.js} +1 -1
  41. package/dist/config/index.d.ts +1 -1
  42. package/dist/{context-D24k1Cpc.d.ts → context-Cj-9gE6l.d.ts} +4 -2
  43. package/dist/create/index.d.ts +2 -2
  44. package/dist/create/index.js +1 -1
  45. package/dist/{index-BAcQz5DS.d.ts → index-DVYEoVMK.d.ts} +1 -1
  46. package/dist/{index-4WT_uRRL.d.ts → index-DZylLz7h.d.ts} +1 -1
  47. package/dist/mapper/bin.js +5 -5
  48. package/dist/otel/index.js +4 -4
  49. package/dist/preset/index.d.ts +3 -3
  50. package/dist/sql/index.d.ts +3 -3
  51. package/dist/sql/index.js +1 -1
  52. package/dist/{sql-fHTjZGqR.js → sql-D2Sc6BTr.js} +39 -10
  53. package/dist/testing/index.d.ts +1 -1
  54. package/package.json +1 -1
  55. package/dist/cli/add-CFKvvXlK.js +0 -1
  56. package/dist/cli/powersync-BAE2dlPJ.js +0 -1
@@ -1,4 +1,4 @@
1
- import { hr as AppTableConfig } from "./context-D24k1Cpc.js";
1
+ import { hr as AppTableConfig } from "./context-Cj-9gE6l.js";
2
2
  //#region src/config/app-tables.d.ts
3
3
  /**
4
4
  * The columns every app table gets, which `columns` may not name: `id`,
@@ -13,7 +13,7 @@ import { i as EventSink, t as CloudEvent } from "../../cloud-event-CzZTJkXv.js";
13
13
  import { i as ListDefinition } from "../../list-query-DxjuIHEL.js";
14
14
  import { n as Controller, t as AuthPort } from "../../controller-BR7CZ1R9.js";
15
15
  import { a as UndoToken } from "../../undo-B1jwnVyN.js";
16
- import { n as AuditCategory } from "../../context-D24k1Cpc.js";
16
+ import { n as AuditCategory } from "../../context-Cj-9gE6l.js";
17
17
  //#region src/blocks/audit/audit.d.ts
18
18
  interface PurgeAuditLogOptions extends BlockTemporalOptions {
19
19
  /**
@@ -1,21 +1,21 @@
1
1
  import { a as list, p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { a as parseNames, n as CliError } from "./errors-BTe6A15O.js";
5
5
  import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
6
- import { t as loadSnapshot } from "./snapshot-k4R6vT20.js";
6
+ import { t as loadSnapshot } from "./snapshot-B12QpZNf.js";
7
7
  import { t as isRecord } from "./guards-CUlDNYZs.js";
8
- import { a as toCatalog } from "./source-MMQKgaIx.js";
9
- import { n as dataMigration } from "./migrations-Cwh5VvUC.js";
8
+ import { a as toCatalog } from "./source-DP8KOgax.js";
9
+ import { n as dataMigration } from "./migrations-VmJloDtq.js";
10
10
  import { a as findConfig, f as INTEGRATIONS, s as loadConfig } from "./config-BJSqMi04.js";
11
11
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
12
- import { a as wiringFiles, d as libEntry, f as needsLib, i as wiringChecklist, l as importFrom, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, s as TEMPLATES, u as isIntegration } from "./migration-safety-DYgarZxP.js";
12
+ import { a as wiringFiles, d as libEntry, f as needsLib, i as wiringChecklist, l as importFrom, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, s as TEMPLATES, u as isIntegration } from "./migration-safety-Cgr44KLM.js";
13
13
  import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
14
14
  import { d as setBlockInJson, f as setPathInConfig, h as setPresetInJson, m as setPresetInConfig, n as addBlocksToJson, p as setPathInJson, r as addBlocksToWiring, t as addBlocksToConfig, u as setBlockInConfig } from "./config-edit-CrWfk8s3.js";
15
- import { t as syncModules } from "./sync-DYQVml8j.js";
16
- import { t as addModules } from "./add-CTtj1dfh.js";
17
- import { n as ident } from "./live-C-0OdLKE.js";
18
- import { t as blockNames } from "./blocks-CT8-TBdW.js";
15
+ import { t as syncModules } from "./sync-DHJ6UBod.js";
16
+ import { t as addModules } from "./add-ee805E_R.js";
17
+ import { n as ident } from "./live-PaO1MC10.js";
18
+ import { t as blockNames } from "./blocks-CKp4EfLe.js";
19
19
  import { i as sourceArgs, n as SOURCE_ARGS } from "./source-args-DlckPVje.js";
20
20
  import { existsSync } from "node:fs";
21
21
  import { dirname, join, posix, resolve } from "node:path";
@@ -1,8 +1,8 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { c as layoutFor, g as providerLabel, l as providerOwnsMemberships, o as MEMBERSHIP_CLAIM_MODULES } from "./migrations-Cwh5VvUC.js";
2
+ import { c as layoutFor, g as providerLabel, l as providerOwnsMemberships, o as MEMBERSHIP_CLAIM_MODULES } from "./migrations-VmJloDtq.js";
3
3
  import { r as applyPlan } from "./files-CX71yBm8.js";
4
4
  import { n as addBlocksToJson, s as keyText, t as addBlocksToConfig } from "./config-edit-CrWfk8s3.js";
5
- import { a as write, i as unlistedModuleFiles, r as nextStep } from "./sync-DYQVml8j.js";
5
+ import { a as write, i as unlistedModuleFiles, r as nextStep } from "./sync-DHJ6UBod.js";
6
6
  import { basename, dirname } from "node:path";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import { SQL_MODULES, resolveBlocks } from "better-supabase/sql";
@@ -0,0 +1 @@
1
+ export { t as addCommand } from "./add-CbUFLPVA.js";
@@ -3,7 +3,7 @@ import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
3
3
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
4
4
  import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-BJSqMi04.js";
5
5
  import { t as connect } from "./db-CQCLx7cx.js";
6
- import { n as ident } from "./live-C-0OdLKE.js";
6
+ import { n as ident } from "./live-PaO1MC10.js";
7
7
  import { r as STACK_ARG, t as DB_URL_STDIN_ARG } from "./source-args-DlckPVje.js";
8
8
  //#region src/cli/commands/backfill.ts
9
9
  const DEFAULT_BATCH = 1e3;
package/dist/cli/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as run } from "./run-Q5V5Kle1.js";
2
+ import { i as run } from "./run-DvK2vagi.js";
3
3
  import { t as colorEnabled } from "./style-Bm2X5JrN.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { basename } from "node:path";
@@ -1,7 +1,7 @@
1
1
  import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
4
- import { n as listModules, t as printModule } from "./print-Dpfa_--H.js";
4
+ import { n as listModules, t as printModule } from "./print-CXmXGe3Y.js";
5
5
  import { t as decodePresetInput } from "./preset-BwmIfFnh.js";
6
6
  import { BLOCK_CATEGORIES } from "better-supabase/blocks";
7
7
  import { PRESET_CATALOG, PRESET_NAMES, glueCommand } from "better-supabase/preset";
@@ -1 +1 @@
1
- export { n as blocksListCommand, r as blocksSearchCommand, i as blocksViewCommand } from "./blocks-CT8-TBdW.js";
1
+ export { n as blocksListCommand, r as blocksSearchCommand, i as blocksViewCommand } from "./blocks-CKp4EfLe.js";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-DzroJkIT.js";
1
+ import { t as VERSION } from "./version-DmaGTP3L.js";
2
2
  import { dirname, resolve } from "node:path";
3
3
  import { createHash } from "node:crypto";
4
4
  import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises";
@@ -4,7 +4,7 @@ import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { t as migrateCliCall } from "./moved-DVwgE8lV.js";
5
5
  import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
6
6
  import { a as changedFiles, i as changeLines, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
7
- import { i as schemasDirOf, n as migrationsDir, o as writtenByBlocks } from "./sql-layout-AByPAQXl.js";
7
+ import { i as schemasDirOf, n as migrationsDir, o as writtenByBlocks } from "./sql-layout-DTczUfCt.js";
8
8
  import { a as configObject, c as mask, f as setPathInConfig, g as skipSpace, h as setPresetInJson, i as closingIndex, l as properties, m as setPresetInConfig, o as indentAt, p as setPathInJson, t as addBlocksToConfig, v as codeRanges } from "./config-edit-CrWfk8s3.js";
9
9
  import { i as legacyPrefixNames, n as LEGACY_PREFIXES, t as LEGACY_CLAIMS } from "./legacy-prefix-R7UChFFl.js";
10
10
  import { a as REVIEW_0_15, c as renameSubpaths, r as PLUGIN_IMPORT_RENAMES, s as SUBPATH_RENAMES_0_15, t as BLOCK_EXPORT_RENAMES } from "./codemod-block-renames-BuSaTE_G.js";
@@ -1,6 +1,6 @@
1
1
  import { r as readIfExists } from "./io-DH1kcmmP.js";
2
- import { t as CACHE_DIR } from "./cache-BxohmNou.js";
3
- import { x as installedVersion } from "./snapshot-k4R6vT20.js";
2
+ import { t as CACHE_DIR } from "./cache-CDNVq1vO.js";
3
+ import { x as installedVersion } from "./snapshot-B12QpZNf.js";
4
4
  import { t as i } from "./jsonc-D5Fu67jw.js";
5
5
  import { resolve } from "node:path";
6
6
  import { createHash } from "node:crypto";
@@ -1,36 +1,36 @@
1
1
  import { a as list, p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
5
5
  import { i as isLocalDatabaseUrl, r as databaseHost } from "./agent-CbuPvI2x.js";
6
6
  import { a as sameText, t as display } from "./io-DH1kcmmP.js";
7
- import { t as CACHE_DIR } from "./cache-BxohmNou.js";
7
+ import { t as CACHE_DIR } from "./cache-CDNVq1vO.js";
8
8
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
9
- import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError } from "./snapshot-k4R6vT20.js";
10
- import { d as configFor, r as renderFiles, u as notNullTag } from "./render-D9c5ynjR.js";
9
+ import { C as satisfies, S as peerVersions, c as isSqliteLiteDriver, n as managementTarget, o as snapshotFile, r as openSource, s as liteDriverOf, t as loadSnapshot, u as MetadataRejectedError } from "./snapshot-B12QpZNf.js";
10
+ import { d as configFor, r as renderFiles, u as notNullTag } from "./render-CVTKsacY.js";
11
11
  import { t as isRecord } from "./guards-CUlDNYZs.js";
12
- import { i as request } from "./source-MMQKgaIx.js";
13
- import { g as providerLabel, u as compiledReadSets } from "./migrations-Cwh5VvUC.js";
12
+ import { i as request } from "./source-DP8KOgax.js";
13
+ import { g as providerLabel, u as compiledReadSets } from "./migrations-VmJloDtq.js";
14
14
  import { l as stdinDatabaseUrl, n as databaseUrl } from "./config-BJSqMi04.js";
15
15
  import { a as findRepoRoot, c as httpHooks, d as readSupabaseToml, f as schemaPaths, h as tomlGet, i as diffEngine, l as migrationCommand, n as declarativeSchemasDir, p as sqlWorkflow, u as pgFunctionHooks } from "./supabase-toml-CncmQbO0.js";
16
16
  import { t as PROCESS_ENV } from "./env-DMgjB_4y.js";
17
17
  import { n as readStackStatus } from "./stack-status-B_Ipd_-z.js";
18
18
  import { t as connect } from "./db-CQCLx7cx.js";
19
- import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-D54wumPS.js";
19
+ import { a as hasContentMapper, c as supportsContentMappers, i as contentMapperSetup$1, n as TSCONFIG_SNIPPET, o as needsRunExternalCode, t as RUN_EXTERNAL_CODE } from "./content-mapper-Chm3txER.js";
20
20
  import { c as insideRoot, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
21
- import { C as splinterTables, S as advisorRule, _ as withoutStrings, a as METADATA_GAPS_TEXT, b as appTablesOf, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$2, s as AUTHORIZATION_RULES, u as COMMANDS$2, v as BLOCK_PREFIX, x as appViewsOf, y as blockTargets } from "./run-CuzSU8Sk.js";
22
- import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-AByPAQXl.js";
23
- import { a as permissionCatalogKeys, i as lineOf, l as tableObject, n as exposed, o as policyObject, r as exposedSchemas, s as qualified, t as catalogOf, u as workflowOf } from "./shared-BNScv93m.js";
24
- import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-CXtSwDLu.js";
25
- import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-DYgarZxP.js";
21
+ import { C as splinterTables, S as advisorRule, _ as withoutStrings, a as METADATA_GAPS_TEXT, b as appTablesOf, c as accessModule, d as RLS_RULES, f as appliesTo, g as policyHelpers, h as functionObject, l as entitlementsModule, m as functionBody, p as escape$2, s as AUTHORIZATION_RULES, u as COMMANDS$2, v as BLOCK_PREFIX, x as appViewsOf, y as blockTargets } from "./run-x9l841K2.js";
22
+ import { n as migrationsDir, r as moduleLayoutFor, t as blockDeclaredTables } from "./sql-layout-DTczUfCt.js";
23
+ import { a as permissionCatalogKeys, i as lineOf, l as tableObject, n as exposed, o as policyObject, r as exposedSchemas, s as qualified, t as catalogOf, u as workflowOf } from "./shared-FhGSrA9E.js";
24
+ import { i as migrationHolds, o as migrationModules, r as latestMigration, t as MODULES_SUFFIX } from "./module-migration-D4lirR47.js";
25
+ import { o as wiringFor, r as configInstances, t as MIGRATION_SAFETY_RULES } from "./migration-safety-Cgr44KLM.js";
26
26
  import { t as orphanedBlockFiles } from "./orphans-BAboqyVM.js";
27
- import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-C-0OdLKE.js";
27
+ import { i as reservedRoles, n as ident$1, r as literal$1, t as LIVE_RULES } from "./live-PaO1MC10.js";
28
28
  import { a as sourceFlags, n as SOURCE_ARGS } from "./source-args-DlckPVje.js";
29
29
  import { i as PLUGIN_SUBPATH_RENAMES, n as BLOCK_SUBPATH_RENAMES, o as SPEC_SUBPATH_RENAMES, t as BLOCK_EXPORT_RENAMES } from "./codemod-block-renames-BuSaTE_G.js";
30
30
  import { n as PLATFORM_SCHEMAS } from "./in-stack-diff-DQTW53Vf.js";
31
31
  import { i as staleVariables, r as stackEnvValues, t as PREFIX_NAMES } from "./stack-env-6hS-WEmh.js";
32
32
  import { a as readSharedMemory, n as listStacks, t as branchName } from "./stacks-BYlQ96WS.js";
33
- import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-Dvc6U3bk.js";
33
+ import { i as refuseWithMetadata, r as readMetadataSnapshot } from "./metadata-KKCdxMLb.js";
34
34
  import { existsSync } from "node:fs";
35
35
  import { dirname, resolve } from "node:path";
36
36
  import { createHash } from "node:crypto";
@@ -383,7 +383,7 @@ const ADOPTION_RULES = [
383
383
  code: "BS342",
384
384
  severity: "error",
385
385
  title: "Enum column of the app's that a module writes as text",
386
- description: "A module writes a text parameter or computed text value into a column of the app's table that the snapshot declares as an enum; string literals are fine. Postgres has no implicit cast from text to an enum, so the module's functions fail when they run. Columns the module casts to their declared type, such as the tags `kind` and the numbering `entity`, may be enums.",
386
+ description: "A module writes a text parameter or computed text value into a column of the app's table that the snapshot declares as an enum; string literals are fine. Postgres has no implicit cast from text to an enum, so the module's functions fail when they run. Columns the module casts to their declared type, such as the tags `kind`, the numbering `entity` and the profiles `locale`, may be enums.",
387
387
  check: (context) => {
388
388
  const { tables } = catalogOf(context);
389
389
  const ownTables = Object.fromEntries(tables.map((table) => [qualified(table), "database"]));
@@ -1,22 +1,22 @@
1
1
  import { a as list, p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { a as parseNames, i as failedResult, n as CliError } from "./errors-BTe6A15O.js";
4
- import { u as catalogFingerprint } from "./cache-BxohmNou.js";
5
- import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-k4R6vT20.js";
6
- import { n as dataMigration } from "./migrations-Cwh5VvUC.js";
4
+ import { u as catalogFingerprint } from "./cache-CDNVq1vO.js";
5
+ import { a as serializeSnapshot, g as serializeGenerator, h as restrictSchemas, o as snapshotFile, r as openSource, t as loadSnapshot } from "./snapshot-B12QpZNf.js";
6
+ import { n as dataMigration } from "./migrations-VmJloDtq.js";
7
7
  import { d as GEN_TASKS, p as isGenTask } from "./config-BJSqMi04.js";
8
8
  import { c as insideRoot, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
9
- import { n as runGen } from "./run-CuzSU8Sk.js";
10
- import { t as syncModules } from "./sync-DYQVml8j.js";
11
- import { t as addModules } from "./add-CTtj1dfh.js";
12
- import { n as listModules, t as printModule } from "./print-Dpfa_--H.js";
9
+ import { n as runGen } from "./run-x9l841K2.js";
10
+ import { t as syncModules } from "./sync-DHJ6UBod.js";
11
+ import { t as addModules } from "./add-ee805E_R.js";
12
+ import { n as listModules, t as printModule } from "./print-CXmXGe3Y.js";
13
13
  import { a as sourceFlags, i as sourceArgs, n as SOURCE_ARGS } from "./source-args-DlckPVje.js";
14
- import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-Dvc6U3bk.js";
14
+ import { a as runMetadataGen, n as checkMetadataFlags, t as EMITS } from "./metadata-KKCdxMLb.js";
15
15
  import { a as runEnv } from "./env-BCgVZkcb.js";
16
- import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-CCpPVw_T.js";
17
- import { n as runPowerSync } from "./powersync-BCDuGn5p.js";
16
+ import { c as watchLoop, o as parseInterval, r as specOptionsFromConfig, s as stampFiles, t as runSpec } from "./spec-D-NPgLTj.js";
17
+ import { n as runPowerSync } from "./powersync-Cc9Ad_Mn.js";
18
18
  import { t as runSeed } from "./seed-D9mt8bnW.js";
19
- import { t as upgrade } from "./upgrade-DHcIHeRM.js";
19
+ import { t as upgrade } from "./upgrade-B69K7-JE.js";
20
20
  import { existsSync } from "node:fs";
21
21
  import { resolve } from "node:path";
22
22
  //#region src/cli/commands/sql.ts
@@ -798,6 +798,6 @@ export declare function emitModule(model: Model, options: EmitOptions): string;
798
798
  export declare function loadConfig(cwd: string, explicit?: string, environment?: string, path?: string | undefined): Promise<ResolvedConfig>;
799
799
  //#endregion
800
800
  //#region src/cli/version.d.ts
801
- export declare const VERSION = "0.18.1";
801
+ export declare const VERSION = "0.18.2";
802
802
  //#endregion
803
803
  export type { Catalog, CatalogCheck, CatalogColumn, CatalogColumnGrant, CatalogEnum, CatalogForeignKey, CatalogFunction, CatalogFunctionArg, CatalogGrant, CatalogIndex, CatalogPolicy, CatalogTable, CatalogTrigger, CatalogUnique, Choice, Cli, CliArgs, CliCommand, CliCommandDef, CliContext, CliEnv, CliErrorCode, CliErrorOptions, CliIo, CliLog, CliProblem, CliProblemExtensions, CommandResult, CreateCliOptions, ExitCode, ExtrasFunction, ExtrasHook, ExtrasHookFunction, ExtrasTable, ForeignKeyAction, Format, GeneratorMetadata, IntrospectionSource, ManagementSourceOptions, NextStep, Paint, Prompter, Queryable, RunOptions, RunResult, Snapshot, SnapshotBucket, SnapshotExtras };
package/dist/cli/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { a as list, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
- import { i as run, n as createCli, r as help, t as commandNames } from "./run-Q5V5Kle1.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
2
+ import { i as run, n as createCli, r as help, t as commandNames } from "./run-DvK2vagi.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { n as CliError, t as CLI_ERRORS_URL } from "./errors-BTe6A15O.js";
5
- import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-k4R6vT20.js";
6
- import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-D9c5ynjR.js";
7
- import { a as toCatalog, n as managementSource, r as pgSource } from "./source-MMQKgaIx.js";
5
+ import { a as serializeSnapshot, i as parseSnapshot, l as introspect, t as loadSnapshot } from "./snapshot-B12QpZNf.js";
6
+ import { a as emitBlockConfig, l as buildModel, o as GENERATED_HEADER, r as renderFiles, s as emitModule } from "./render-CVTKsacY.js";
7
+ import { a as toCatalog, n as managementSource, r as pgSource } from "./source-DP8KOgax.js";
8
8
  import { s as loadConfig } from "./config-BJSqMi04.js";
9
- import { n as runGen } from "./run-CuzSU8Sk.js";
9
+ import { n as runGen } from "./run-x9l841K2.js";
10
10
  //#region src/cli/introspect/from-catalog.ts
11
11
  /**
12
12
  * Builds a snapshot from catalog records: the inverse of `toCatalog`. Tests and
@@ -2,14 +2,14 @@ import { a as list, p as commandMeta, r as defineCliCommand } from "./command-BW
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists } from "./io-DH1kcmmP.js";
5
- import { l as TYPEGEN_VERSION } from "./cache-BxohmNou.js";
5
+ import { l as TYPEGEN_VERSION } from "./cache-CDNVq1vO.js";
6
6
  import { a as findConfig, s as loadConfig } from "./config-BJSqMi04.js";
7
- import { r as contentMapperFiles } from "./content-mapper-D54wumPS.js";
7
+ import { r as contentMapperFiles } from "./content-mapper-Chm3txER.js";
8
8
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
9
- import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-C5kLXuqn.js";
10
- import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-DYgarZxP.js";
9
+ import { C as promptConventions, S as hasConventionFlags, _ as templatePlan, b as conventionFlags, c as AUTHZ_NOTE, d as chooseIntegrations, f as integrationFiles, g as templateContextFor, h as parseIntegrations, i as blocksWiringPath, l as createUrlParam, m as packagesFor, o as writeDesign, p as overwrite, r as blockConfigImport, s as readPresetInput, u as CANCELLED, v as CONVENTION_ARGS, w as withConventions, x as defaultConventions, y as CONVENTION_COMPLETIONS } from "./add-CbUFLPVA.js";
10
+ import { a as wiringFiles, c as baseFiles, f as needsLib, i as wiringChecklist, m as suggestedIntegrations, n as latestMigrationVersion, o as wiringFor, p as resolveIntegrations, r as configInstances, s as TEMPLATES } from "./migration-safety-Cgr44KLM.js";
11
11
  import { n as installCommand, t as detectProject } from "./detect-D9JaAX20.js";
12
- import { s as enablePgDelta, t as syncModules } from "./sync-DYQVml8j.js";
12
+ import { s as enablePgDelta, t as syncModules } from "./sync-DHJ6UBod.js";
13
13
  import { existsSync } from "node:fs";
14
14
  import { join, posix, resolve } from "node:path";
15
15
  import { glob, readFile } from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { r as errorText } from "./errors-BTe6A15O.js";
2
- import "./source-MMQKgaIx.js";
3
- import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-BNScv93m.js";
2
+ import "./source-DP8KOgax.js";
3
+ import { l as tableObject, n as exposed, s as qualified, t as catalogOf } from "./shared-FhGSrA9E.js";
4
4
  //#region src/cli/doctor/reserved-roles.ts
5
5
  /**
6
6
  * Supautils' `reserved_roles` on Supabase. Nobody but a superuser may alter,
@@ -1,6 +1,6 @@
1
1
  import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
- import { a as envelope, i as run } from "./run-Q5V5Kle1.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
2
+ import { a as envelope, i as run } from "./run-DvK2vagi.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { n as CliError } from "./errors-BTe6A15O.js";
5
5
  import { n as consentToken } from "./agent-CbuPvI2x.js";
6
6
  import { C as optional, D as record, N as unknown, a as array, d as is, j as string$1, k as safeParse, o as boolean, t as PROCESS_ENV, x as object } from "./env-DMgjB_4y.js";
@@ -1,8 +1,8 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { i as readStdin } from "./io-DH1kcmmP.js";
3
- import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-k4R6vT20.js";
4
- import { c as metaPaths, n as render } from "./render-D9c5ynjR.js";
5
- import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-CuzSU8Sk.js";
3
+ import { m as parseMetadataDocument, u as MetadataRejectedError } from "./snapshot-B12QpZNf.js";
4
+ import { c as metaPaths, n as render } from "./render-CVTKsacY.js";
5
+ import { i as generationNotices, n as runGen, o as fromMetadata, r as UNFORMATTED, t as refuseRowConditionedBuckets } from "./run-x9l841K2.js";
6
6
  import { basename, join, relative, resolve, sep } from "node:path";
7
7
  import { readFile } from "node:fs/promises";
8
8
  import { jsonSchema, standardSchema, valibot, zod } from "better-supabase/config";
@@ -1,5 +1,5 @@
1
1
  import { f as INTEGRATIONS } from "./config-BJSqMi04.js";
2
- import { c as splitStatements } from "./shared-BNScv93m.js";
2
+ import { c as splitStatements } from "./shared-FhGSrA9E.js";
3
3
  import { dirname, join, posix } from "node:path";
4
4
  import { readdir } from "node:fs/promises";
5
5
  import { INTEGRATION_INFO, groupEntries } from "better-supabase/config";
@@ -2,7 +2,7 @@ import { n as CliError } from "./errors-BTe6A15O.js";
2
2
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
4
4
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
5
- import { a as sqlPlan, i as schemasDirOf, n as migrationsDir, r as moduleLayoutFor } from "./sql-layout-AByPAQXl.js";
5
+ import { a as sqlPlan, i as schemasDirOf, n as migrationsDir, r as moduleLayoutFor } from "./sql-layout-DTczUfCt.js";
6
6
  import { resolve } from "node:path";
7
7
  import { readFile, readdir } from "node:fs/promises";
8
8
  import { MODULE_ID_TYPES, compileReadSets, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, renderBlocks, resolveBlocks, scopeProblems, templateFunctions } from "better-supabase/sql";
@@ -1,7 +1,7 @@
1
- import { i as stampAfter } from "./migrations-Cwh5VvUC.js";
1
+ import { i as stampAfter } from "./migrations-VmJloDtq.js";
2
2
  import { d as readSupabaseToml, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  import { i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
4
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-AByPAQXl.js";
4
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-DTczUfCt.js";
5
5
  import { resolve } from "node:path";
6
6
  import { readFile, readdir } from "node:fs/promises";
7
7
  import { moduleSchemaExtensions } from "better-supabase/sql";
@@ -0,0 +1 @@
1
+ export { t as powersyncStreamsCommand } from "./powersync-Cc9Ad_Mn.js";
@@ -1,7 +1,7 @@
1
1
  import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
- import { c as layoutFor, i as stampAfter } from "./migrations-Cwh5VvUC.js";
2
+ import { c as layoutFor, i as stampAfter } from "./migrations-VmJloDtq.js";
3
3
  import { n as PLAN_ARGS, r as applyPlan, u as planResult } from "./files-CX71yBm8.js";
4
- import { n as migrationsDir } from "./sql-layout-AByPAQXl.js";
4
+ import { n as migrationsDir } from "./sql-layout-DTczUfCt.js";
5
5
  import { existsSync } from "node:fs";
6
6
  import { join, resolve } from "node:path";
7
7
  import { readFile, readdir } from "node:fs/promises";
@@ -1,6 +1,6 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
- import { s as layout } from "./migrations-Cwh5VvUC.js";
3
- import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-CXtSwDLu.js";
2
+ import { s as layout } from "./migrations-VmJloDtq.js";
3
+ import { o as migrationModules, r as latestMigration, u as writesMigrations } from "./module-migration-D4lirR47.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { resolve } from "node:path";
6
6
  import { SQL_MODULES, contractSignature, customContracts, moduleBody, moduleFilePaths } from "better-supabase/sql";
@@ -2,15 +2,15 @@ import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
3
  import { n as CliError } from "./errors-BTe6A15O.js";
4
4
  import { r as readIfExists, t as display } from "./io-DH1kcmmP.js";
5
- import { c as layoutFor } from "./migrations-Cwh5VvUC.js";
5
+ import { c as layoutFor } from "./migrations-VmJloDtq.js";
6
6
  import { i as changeLines, n as PLAN_ARGS, r as applyPlan, t as HAND_EDITED, u as planResult } from "./files-CX71yBm8.js";
7
- import { a as sqlPlan } from "./sql-layout-AByPAQXl.js";
8
- import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-C5kLXuqn.js";
7
+ import { a as sqlPlan } from "./sql-layout-DTczUfCt.js";
8
+ import { g as templateContextFor, i as blocksWiringPath, n as blockClients } from "./add-CbUFLPVA.js";
9
9
  import { t as detectProject } from "./detect-D9JaAX20.js";
10
10
  import { _ as wiringBlocks, a as configObject, c as mask, i as closingIndex, l as properties } from "./config-edit-CrWfk8s3.js";
11
- import { n as guardedRemoval } from "./sync-DYQVml8j.js";
11
+ import { n as guardedRemoval } from "./sync-DHJ6UBod.js";
12
12
  import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
13
- import { t as blockNames } from "./blocks-CT8-TBdW.js";
13
+ import { t as blockNames } from "./blocks-CKp4EfLe.js";
14
14
  import { i as tidyInline, t as cutRange } from "./config-group-C8tjut39.js";
15
15
  import { existsSync } from "node:fs";
16
16
  import { resolve } from "node:path";
@@ -1,10 +1,10 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { n as importPath } from "./io-DH1kcmmP.js";
3
- import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-BxohmNou.js";
3
+ import { i as cachedTypesModule, n as cachedDatabaseTypes, s as typesModuleKey } from "./cache-CDNVq1vO.js";
4
4
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
5
- import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-k4R6vT20.js";
5
+ import { f as generateDatabaseTypes, h as restrictSchemas, p as oxfmtInstalled, v as tsTypeOf } from "./snapshot-B12QpZNf.js";
6
6
  import { t as isRecord$1 } from "./guards-CUlDNYZs.js";
7
- import { a as toCatalog } from "./source-MMQKgaIx.js";
7
+ import { a as toCatalog } from "./source-DP8KOgax.js";
8
8
  import { basename, dirname, isAbsolute, join, posix, relative, resolve } from "node:path";
9
9
  import { entityNames } from "better-supabase/blocks";
10
10
  import { DEFAULT_CLAIMS, blockEntities, blockEntityRenames, blockSubjectTypes, tenantClaimPaths, tenantNameOf } from "better-supabase/config";
@@ -1,6 +1,6 @@
1
1
  import { c as COMMANDS, d as GROUPS, f as RESERVED_NAMES, h as runCommand, i as joinRepeated, m as parseArgs$2, o as listArgs, s as runsWithInvalidConfig, t as GLOBAL_ARGS, u as DOCS_ORIGIN } from "./command-BWEEXmtz.js";
2
2
  import { n as highlight, r as painter } from "./style-Bm2X5JrN.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { n as CliError, o as toCliError } from "./errors-BTe6A15O.js";
5
5
  import { a as missingInputNext, o as resolveAgent, t as checkConsent } from "./agent-CbuPvI2x.js";
6
6
  import { a as globalFlags, c as resolveCommand, i as commandTree, n as closestName, o as isVariadic, r as commandArgs, t as checkArgs } from "./parse-B079x40m.js";
@@ -16,36 +16,36 @@ import { resolve } from "node:path";
16
16
  * loads on demand, so `--version` and `--help` import no command.
17
17
  */
18
18
  const LOADERS = [
19
- ["init", () => import("./init-Dxvlzka4.js").then((m) => m.initCommand)],
20
- ["add", () => import("./add-CFKvvXlK.js").then((m) => m.addCommand)],
21
- ["remove", () => import("./remove-DpAwgO8A.js").then((m) => m.removeCommand)],
22
- ["upgrade", () => import("./upgrade-f-3Nl6lO.js").then((m) => m.upgradeCommand)],
23
- ["gen", () => import("./gen--IBq-J4M.js").then((m) => m.genCommand)],
24
- ["doctor", () => import("./doctor-DBxc5aud.js").then((m) => m.doctorCommand)],
19
+ ["init", () => import("./init-D0SxtKH5.js").then((m) => m.initCommand)],
20
+ ["add", () => import("./add-k8gdux-e.js").then((m) => m.addCommand)],
21
+ ["remove", () => import("./remove-CJi3fvpP.js").then((m) => m.removeCommand)],
22
+ ["upgrade", () => import("./upgrade-C7SEKT4b.js").then((m) => m.upgradeCommand)],
23
+ ["gen", () => import("./gen-D-g9TAmr.js").then((m) => m.genCommand)],
24
+ ["doctor", () => import("./doctor-EWtWH8I9.js").then((m) => m.doctorCommand)],
25
25
  ["db query", () => import("./db-DYU5hUcd.js").then((m) => m.dbQueryCommand)],
26
26
  ["db diff", () => import("./db-DYU5hUcd.js").then((m) => m.dbDiffCommand)],
27
27
  ["db seed", () => import("./seed-EPO6AvLG.js").then((m) => m.seedCommand)],
28
- ["db backfill", () => import("./backfill-C-b6eH98.js").then((m) => m.dbBackfillCommand)],
28
+ ["db backfill", () => import("./backfill-CCNXzDjt.js").then((m) => m.dbBackfillCommand)],
29
29
  ["dev env", () => import("./env-xhwXk5Ri.js").then((m) => m.envCommand)],
30
30
  ["dev run", () => import("./run-DmOTMa44.js").then((m) => m.runCommand)],
31
31
  ["dev keys", () => import("./keys-CbaL0lnw.js").then((m) => m.keysCommand)],
32
32
  ["dev stack ls", () => import("./stack-DgASZP0K.js").then((m) => m.stackLsCommand)],
33
33
  ["dev stack prune", () => import("./stack-DgASZP0K.js").then((m) => m.stackPruneCommand)],
34
- ["blocks list", () => import("./blocks-zpu__C1Y.js").then((m) => m.blocksListCommand)],
35
- ["blocks view", () => import("./blocks-zpu__C1Y.js").then((m) => m.blocksViewCommand)],
36
- ["blocks search", () => import("./blocks-zpu__C1Y.js").then((m) => m.blocksSearchCommand)],
37
- ["powersync streams", () => import("./powersync-BAE2dlPJ.js").then((m) => m.powersyncStreamsCommand)],
38
- ["spec emit", () => import("./spec-CqANRfuu.js").then((m) => m.specEmitCommand)],
39
- ["spec validate", () => import("./spec-CqANRfuu.js").then((m) => m.specValidateCommand)],
40
- ["mcp", () => import("./mcp-3q5RDvYJ.js").then((m) => m.mcpCommand)],
34
+ ["blocks list", () => import("./blocks-DNgcfS8X.js").then((m) => m.blocksListCommand)],
35
+ ["blocks view", () => import("./blocks-DNgcfS8X.js").then((m) => m.blocksViewCommand)],
36
+ ["blocks search", () => import("./blocks-DNgcfS8X.js").then((m) => m.blocksSearchCommand)],
37
+ ["powersync streams", () => import("./powersync-Bo16K2S6.js").then((m) => m.powersyncStreamsCommand)],
38
+ ["spec emit", () => import("./spec-CIQBAQgr.js").then((m) => m.specEmitCommand)],
39
+ ["spec validate", () => import("./spec-CIQBAQgr.js").then((m) => m.specValidateCommand)],
40
+ ["mcp", () => import("./mcp-CHpzdlOg.js").then((m) => m.mcpCommand)],
41
41
  ["skills list", () => import("./skills-FXAVPLzp.js").then((m) => m.skillsListCommand)],
42
42
  ["skills install", () => import("./skills-FXAVPLzp.js").then((m) => m.skillsInstallCommand)],
43
- ["codemod 0.4", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.4"))],
44
- ["codemod 0.5", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.5"))],
45
- ["codemod 0.6", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.6"))],
46
- ["codemod 0.9", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.9"))],
47
- ["codemod 0.11", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.11"))],
48
- ["codemod 0.15", () => import("./codemod-BVo3sdx7.js").then((m) => m.codemodCommand("0.15"))],
43
+ ["codemod 0.4", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.4"))],
44
+ ["codemod 0.5", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.5"))],
45
+ ["codemod 0.6", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.6"))],
46
+ ["codemod 0.9", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.9"))],
47
+ ["codemod 0.11", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.11"))],
48
+ ["codemod 0.15", () => import("./codemod-B621vQYQ.js").then((m) => m.codemodCommand("0.15"))],
49
49
  ["completion", () => import("./completion-BfnKI4QZ.js").then((m) => m.completionCommand)],
50
50
  ["config", () => import("./config-WKDixoGK.js").then((m) => m.configCommand)]
51
51
  ];
@@ -1,15 +1,15 @@
1
1
  import { r as errorText } from "./errors-BTe6A15O.js";
2
2
  import { a as sameText, t as display } from "./io-DH1kcmmP.js";
3
- import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-BxohmNou.js";
3
+ import { c as writeAtomic, o as storeTypesModule, s as typesModuleKey, t as CACHE_DIR } from "./cache-CDNVq1vO.js";
4
4
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
5
- import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-k4R6vT20.js";
6
- import { n as render } from "./render-D9c5ynjR.js";
7
- import { _ as unsafeKey, d as accessProviderMode, f as accessRequirements, g as providerLabel, h as moduleKeyProblems, m as entitlementsMode, p as entitlementRequirements, u as compiledReadSets } from "./migrations-Cwh5VvUC.js";
8
- import { s as schemaStampPath } from "./content-mapper-D54wumPS.js";
5
+ import { _ as stabilizeMetadata, b as typegenVersionNotice, p as oxfmtInstalled, t as loadSnapshot, y as typegenVersion } from "./snapshot-B12QpZNf.js";
6
+ import { n as render } from "./render-CVTKsacY.js";
7
+ import { _ as unsafeKey, d as accessProviderMode, f as accessRequirements, g as providerLabel, h as moduleKeyProblems, m as entitlementsMode, p as entitlementRequirements, u as compiledReadSets } from "./migrations-VmJloDtq.js";
8
+ import { s as schemaStampPath } from "./content-mapper-Chm3txER.js";
9
9
  import { a as changedFiles, d as fileDiff, i as changeLines, r as applyPlan, s as hasConflicts } from "./files-CX71yBm8.js";
10
- import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-AByPAQXl.js";
11
- import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-BNScv93m.js";
12
- import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-CXtSwDLu.js";
10
+ import { n as migrationsDir, o as writtenByBlocks } from "./sql-layout-DTczUfCt.js";
11
+ import { l as tableObject, n as exposed, o as policyObject, s as qualified, t as catalogOf } from "./shared-FhGSrA9E.js";
12
+ import { c as sameModuleMigration, l as writeLatestMigration, n as READ_SETS_SUFFIX, r as latestMigration, u as writesMigrations } from "./module-migration-D4lirR47.js";
13
13
  import { existsSync } from "node:fs";
14
14
  import { dirname, isAbsolute, relative, resolve, sep } from "node:path";
15
15
  import { readFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { a as toCatalog } from "./source-MMQKgaIx.js";
1
+ import { a as toCatalog } from "./source-DP8KOgax.js";
2
2
  import { h as tomlGet, p as sqlWorkflow, r as detectWorkflow } from "./supabase-toml-CncmQbO0.js";
3
3
  //#region src/cli/doctor/shared.ts
4
4
  const catalogs = /* @__PURE__ */ new WeakMap();
@@ -1,7 +1,7 @@
1
1
  import { n as CliError, r as errorText } from "./errors-BTe6A15O.js";
2
- import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-BxohmNou.js";
2
+ import { d as readExtras, l as TYPEGEN_VERSION, r as cachedIntrospect } from "./cache-CDNVq1vO.js";
3
3
  import { t as byCodePoint } from "./compare-BmIWVEui.js";
4
- import { n as managementSource, r as pgSource } from "./source-MMQKgaIx.js";
4
+ import { n as managementSource, r as pgSource } from "./source-DP8KOgax.js";
5
5
  import { n as databaseUrl, u as accessToken } from "./config-BJSqMi04.js";
6
6
  import { d as readSupabaseToml, f as schemaPaths, h as tomlGet, u as pgFunctionHooks } from "./supabase-toml-CncmQbO0.js";
7
7
  import { t as connect } from "./db-CQCLx7cx.js";
@@ -1,4 +1,4 @@
1
- import { t as VERSION } from "./version-DzroJkIT.js";
1
+ import { t as VERSION } from "./version-DmaGTP3L.js";
2
2
  import { n as CliError } from "./errors-BTe6A15O.js";
3
3
  import { r as redactUrl } from "./redact-KGAk2Ul9.js";
4
4
  import { n as HTTP_CHANNEL } from "./trace-VbdO6bcN.js";
@@ -1 +1 @@
1
- export { n as specEmitCommand, i as specValidateCommand } from "./spec-CCpPVw_T.js";
1
+ export { n as specEmitCommand, i as specValidateCommand } from "./spec-D-NPgLTj.js";
@@ -1,9 +1,9 @@
1
1
  import { n as __require, t as __commonJSMin } from "./rolldown-runtime-kJ_i4yPo.js";
2
2
  import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
3
- import { t as VERSION } from "./version-DzroJkIT.js";
3
+ import { t as VERSION } from "./version-DmaGTP3L.js";
4
4
  import { i as failedResult, n as CliError, r as errorText } from "./errors-BTe6A15O.js";
5
5
  import { t as display } from "./io-DH1kcmmP.js";
6
- import { c as writeAtomic, t as CACHE_DIR } from "./cache-BxohmNou.js";
6
+ import { c as writeAtomic, t as CACHE_DIR } from "./cache-CDNVq1vO.js";
7
7
  import { t as isRecord } from "./guards-CUlDNYZs.js";
8
8
  import { t as importFresh } from "./fresh-import-DzgsGHkX.js";
9
9
  import { a as changedFiles, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
@@ -1,5 +1,5 @@
1
- import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-k4R6vT20.js";
2
- import { a as toCatalog } from "./source-MMQKgaIx.js";
1
+ import { d as TypegenMissingError, i as parseSnapshot } from "./snapshot-B12QpZNf.js";
2
+ import { a as toCatalog } from "./source-DP8KOgax.js";
3
3
  import { d as readSupabaseToml, f as schemaPaths, n as declarativeSchemasDir, p as sqlWorkflow } from "./supabase-toml-CncmQbO0.js";
4
4
  import { existsSync } from "node:fs";
5
5
  import { dirname, join, relative, resolve, sep } from "node:path";
@@ -1,10 +1,10 @@
1
1
  import { n as CliError } from "./errors-BTe6A15O.js";
2
2
  import { t as display } from "./io-DH1kcmmP.js";
3
- import { a as writeExtensionsMigration, c as layoutFor, t as DATA_NEXT } from "./migrations-Cwh5VvUC.js";
3
+ import { a as writeExtensionsMigration, c as layoutFor, t as DATA_NEXT } from "./migrations-VmJloDtq.js";
4
4
  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-CncmQbO0.js";
5
5
  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-CX71yBm8.js";
6
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-AByPAQXl.js";
7
- import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-CXtSwDLu.js";
6
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-DTczUfCt.js";
7
+ import { c as sameModuleMigration, l as writeLatestMigration, r as latestMigration, s as renderModuleMigration, t as MODULES_SUFFIX, u as writesMigrations } from "./module-migration-D4lirR47.js";
8
8
  import { t as loadTopics } from "./topics-BpdnYmWb.js";
9
9
  import { t as orphanedBlockFiles } from "./orphans-BAboqyVM.js";
10
10
  import { dirname, join, resolve } from "node:path";
@@ -1,9 +1,9 @@
1
1
  import { t as display } from "./io-DH1kcmmP.js";
2
- import { c as layoutFor, r as migrationStamp } from "./migrations-Cwh5VvUC.js";
2
+ import { c as layoutFor, r as migrationStamp } from "./migrations-VmJloDtq.js";
3
3
  import { d as fileDiff, i as changeLines, r as applyPlan } from "./files-CX71yBm8.js";
4
- import { a as sqlPlan, n as migrationsDir } from "./sql-layout-AByPAQXl.js";
5
- 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-CXtSwDLu.js";
6
- import { a as write, o as topicPolicyFile, r as nextStep } from "./sync-DYQVml8j.js";
4
+ import { a as sqlPlan, n as migrationsDir } from "./sql-layout-DTczUfCt.js";
5
+ 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-D4lirR47.js";
6
+ import { a as write, o as topicPolicyFile, r as nextStep } from "./sync-DHJ6UBod.js";
7
7
  import { a as legacyPrefixSql, i as legacyPrefixNames, r as legacyBlocksTableSql } from "./legacy-prefix-R7UChFFl.js";
8
8
  import { resolve } from "node:path";
9
9
  import { readFile } from "node:fs/promises";
@@ -1,8 +1,8 @@
1
1
  import { p as commandMeta, r as defineCliCommand } from "./command-BWEEXmtz.js";
2
2
  import { i as plain } from "./style-Bm2X5JrN.js";
3
- import { t as syncModules } from "./sync-DYQVml8j.js";
3
+ import { t as syncModules } from "./sync-DHJ6UBod.js";
4
4
  import { t as SQL_ARGS } from "./args-UEwg0l-N.js";
5
- import { t as upgrade } from "./upgrade-DHcIHeRM.js";
5
+ import { t as upgrade } from "./upgrade-B69K7-JE.js";
6
6
  //#region src/cli/commands/upgrade.ts
7
7
  const UPGRADE_ARGS = {
8
8
  check: {
@@ -1,4 +1,4 @@
1
1
  //#region src/cli/version.ts
2
- const VERSION = "0.18.1";
2
+ const VERSION = "0.18.2";
3
3
  //#endregion
4
4
  export { VERSION as t };
@@ -1,6 +1,6 @@
1
1
  import { M as Casing } from "../types-DFdg_4yN.js";
2
2
  import { A as tenantNameOf, C as EntityConfig, D as OwnTablePolicies, S as EntitiesConfig, a as AuthorizationProvider, b as DEFAULT_ACTIVE_TENANT, c as AuthorizationScope, d as AccessBlockConfig, f as ActiveTenantSource, g as BlockMode, i as AuthorizationPermission, l as AuthorizationTokenHook, m as BlockConfig, n as AuthorizationMembership, o as AuthorizationRequirement, p as AnyBlocksConfig, r as AuthorizationOperation, s as AuthorizationRoleSource, t as AuthorizationFunctions, u as providerApiProblem, v as BlockScope, x as DisabledRow, y as BlocksConfig } from "../authorization-IiE__z2m.js";
3
- import { $ as blockEntrySource, $n as APP_COLUMN_ACCESS, $r as RpcTypeReference, $t as ResolvedExtensions, A as ValibotGeneratorOptions, Ai as SkillsAgent, An as ExposePrivilege, Ar as CatalogIndex, At as GeneratedFile, B as jsonSchema, Br as ForeignKeyAction, Bt as GeneratorInputSchema, Ci as GenConfig, Cn as TopicTriggerPayloadValueConfig, Cr as CatalogColumn, D as ZodFlavor, Di as MigrationSafetyConfig, Dn as VectorSearchConfig, Dr as CatalogFunction, Dt as resolveJsonSchema, Ei as KeysConfig, En as VectorDistance, Er as CatalogForeignKey, F as nuqs, Fi as IntegrationInfo, Fr as ExtrasDomain, Ft as GeneratorEntitySchemas, G as tenantClaimPaths, Gr as PostgresColumn, Gt as JsonSchemaSource, H as ClaimPaths, Hr as SnapshotBucket, Ht as GeneratorModel, I as FactoriesGeneratorOptions, Ii as SKILLS_AGENTS, Ir as ExtrasFunction, It as GeneratorField, J as blockEntityRenames, Jn as CONFIG_DEFAULTS, Jr as RpcFunction, Jt as SourceConfig, K as BlockEntity, Kr as PostgresFunction, Kt as JsonTypeConfig, L as factories, Lr as ExtrasHook, Lt as GeneratorFunction, M as StandardSchemaGeneratorOptions, Mi as GEN_TASKS, Mn as Privilege, Mr as CatalogTable, Mt as GeneratorBlock, N as standardSchema, Ni as INTEGRATION_INFO, Nn as ResolvedExpose, Nr as CatalogTrigger, Nt as GeneratorBlockEntity, O as ZodGeneratorOptions, Oi as OpenApiConfig, On as ColumnPrivilege, Or as CatalogFunctionArg, Ot as ClaimsConfig, P as NuqsGeneratorOptions, Pi as INTEGRATION_NAMES, Pr as CatalogUnique, Pt as GeneratorColumn, Q as RENAMED_CONFIG_KEYS, Qr as RpcReturnColumn, Qt as ResolvedConfig, R as JsonSchemaGeneratorOptions, Rr as ExtrasHookFunction, Rt as GeneratorFunctionArg, Si as EnvFileConfig, Sn as TopicTriggerLookupConfig, Sr as CatalogCheck, Ti as IntegrationName, Tn as TopicTriggerValueConfig, Tr as CatalogEnum, U as DEFAULT_CLAIMS, Ur as SnapshotExtras, Ut as GeneratorNoun, V as JsonSchemaTarget, Vr as Snapshot, Vt as GeneratorJsonSchema, W as claimPaths, Wr as GeneratorMetadata, Wt as GeneratorTable, X as CONFIG_GROUPS, Xr as RpcFunctionOverload, Xt as DataHooksFramework, Y as blockSubjectTypes, Yr as RpcFunctionArg, Yt as TableConfig, Z as RENAMED_BLOCK_KEYS, Zr as RpcFunctionReturns, Zt as FlatConfig, _n as ResolvedSqlConfig, _r as AppTableEvents, an as BlockInput, ar as AppColumnAccess, at as defineConfig, bn as SqlWorkflow, br as AppTablesConfig, cn as EnvironmentConfig, cr as AppColumnType, ct as BlockTableReference, dn as SqlInput, dr as AppReference, dt as RoleNames, en as ApiConfig, er as APP_COLUMN_FORMATS, et as flattenConfig, fn as ToolingConfig, fr as AppReferenceTarget, ft as TypedReference, gn as RealtimeConfig, gr as AppTableEventKind, hn as BucketConfig, hr as AppTableConfig, in as BetterSupabaseConfig, ir as APP_TABLE_EVENT_KINDS, it as CONFIG_SCHEMA_URL, j as valibot, ji as SkillsConfig, jn as ExposeRole, jr as CatalogPolicy, jt as Generator, k as zod, ki as PowerSyncGenConfig, kn as ExposeConfig, kr as CatalogGrant, kt as CodecsConfig, ln as GenGroupConfig, lr as AppLookupConfig, lt as BucketName, mn as EntitlementsConfig, mr as AppRollupConfig, mt as ExpandedConfig, nn as AppTablesInput, nr as APP_ON_DELETE_ACTIONS, nt as groupEntries, on as BlocksInput, or as AppColumnConfig, ot as resolveConfig, pn as EntitlementPlansSource, pr as AppRollupAggregate, q as blockEntities, qr as PostgresFunctionArg, qt as RelationsConfig, rn as AuthConfig, rr as APP_ROLLUP_AGGREGATES, rt as hasFlatTables, sn as DatabaseConfig, sr as AppColumnFormat, st as AppTableNames, tn as AppTableInput, tr as APP_COLUMN_TYPES, tt as groupConfig, un as OrganizationConfig, ur as AppOnDeleteAction, ut as ConfigReferences, vn as SeedConfig, vr as AppTableSubject, wi as GenTask, wn as TopicTriggerTopicConfig, wr as CatalogColumnGrant, xi as DoctorConfig, xn as TopicTriggerConfig, xr as Catalog, yn as SqlConfig, yr as AppTableVersions, z as buildJsonSchema, zr as ExtrasTable, zt as GeneratorInput } from "../context-D24k1Cpc.js";
3
+ import { $ as blockEntrySource, $n as APP_COLUMN_ACCESS, $r as RpcTypeReference, $t as ResolvedExtensions, A as ValibotGeneratorOptions, Ai as SkillsAgent, An as ExposePrivilege, Ar as CatalogIndex, At as GeneratedFile, B as jsonSchema, Br as ForeignKeyAction, Bt as GeneratorInputSchema, Ci as GenConfig, Cn as TopicTriggerPayloadValueConfig, Cr as CatalogColumn, D as ZodFlavor, Di as MigrationSafetyConfig, Dn as VectorSearchConfig, Dr as CatalogFunction, Dt as resolveJsonSchema, Ei as KeysConfig, En as VectorDistance, Er as CatalogForeignKey, F as nuqs, Fi as IntegrationInfo, Fr as ExtrasDomain, Ft as GeneratorEntitySchemas, G as tenantClaimPaths, Gr as PostgresColumn, Gt as JsonSchemaSource, H as ClaimPaths, Hr as SnapshotBucket, Ht as GeneratorModel, I as FactoriesGeneratorOptions, Ii as SKILLS_AGENTS, Ir as ExtrasFunction, It as GeneratorField, J as blockEntityRenames, Jn as CONFIG_DEFAULTS, Jr as RpcFunction, Jt as SourceConfig, K as BlockEntity, Kr as PostgresFunction, Kt as JsonTypeConfig, L as factories, Lr as ExtrasHook, Lt as GeneratorFunction, M as StandardSchemaGeneratorOptions, Mi as GEN_TASKS, Mn as Privilege, Mr as CatalogTable, Mt as GeneratorBlock, N as standardSchema, Ni as INTEGRATION_INFO, Nn as ResolvedExpose, Nr as CatalogTrigger, Nt as GeneratorBlockEntity, O as ZodGeneratorOptions, Oi as OpenApiConfig, On as ColumnPrivilege, Or as CatalogFunctionArg, Ot as ClaimsConfig, P as NuqsGeneratorOptions, Pi as INTEGRATION_NAMES, Pr as CatalogUnique, Pt as GeneratorColumn, Q as RENAMED_CONFIG_KEYS, Qr as RpcReturnColumn, Qt as ResolvedConfig, R as JsonSchemaGeneratorOptions, Rr as ExtrasHookFunction, Rt as GeneratorFunctionArg, Si as EnvFileConfig, Sn as TopicTriggerLookupConfig, Sr as CatalogCheck, Ti as IntegrationName, Tn as TopicTriggerValueConfig, Tr as CatalogEnum, U as DEFAULT_CLAIMS, Ur as SnapshotExtras, Ut as GeneratorNoun, V as JsonSchemaTarget, Vr as Snapshot, Vt as GeneratorJsonSchema, W as claimPaths, Wr as GeneratorMetadata, Wt as GeneratorTable, X as CONFIG_GROUPS, Xr as RpcFunctionOverload, Xt as DataHooksFramework, Y as blockSubjectTypes, Yr as RpcFunctionArg, Yt as TableConfig, Z as RENAMED_BLOCK_KEYS, Zr as RpcFunctionReturns, Zt as FlatConfig, _n as ResolvedSqlConfig, _r as AppTableEvents, an as BlockInput, ar as AppColumnAccess, at as defineConfig, bn as SqlWorkflow, br as AppTablesConfig, cn as EnvironmentConfig, cr as AppColumnType, ct as BlockTableReference, dn as SqlInput, dr as AppReference, dt as RoleNames, en as ApiConfig, er as APP_COLUMN_FORMATS, et as flattenConfig, fn as ToolingConfig, fr as AppReferenceTarget, ft as TypedReference, gn as RealtimeConfig, gr as AppTableEventKind, hn as BucketConfig, hr as AppTableConfig, in as BetterSupabaseConfig, ir as APP_TABLE_EVENT_KINDS, it as CONFIG_SCHEMA_URL, j as valibot, ji as SkillsConfig, jn as ExposeRole, jr as CatalogPolicy, jt as Generator, k as zod, ki as PowerSyncGenConfig, kn as ExposeConfig, kr as CatalogGrant, kt as CodecsConfig, ln as GenGroupConfig, lr as AppLookupConfig, lt as BucketName, mn as EntitlementsConfig, mr as AppRollupConfig, mt as ExpandedConfig, nn as AppTablesInput, nr as APP_ON_DELETE_ACTIONS, nt as groupEntries, on as BlocksInput, or as AppColumnConfig, ot as resolveConfig, pn as EntitlementPlansSource, pr as AppRollupAggregate, q as blockEntities, qr as PostgresFunctionArg, qt as RelationsConfig, rn as AuthConfig, rr as APP_ROLLUP_AGGREGATES, rt as hasFlatTables, sn as DatabaseConfig, sr as AppColumnFormat, st as AppTableNames, tn as AppTableInput, tr as APP_COLUMN_TYPES, tt as groupConfig, un as OrganizationConfig, ur as AppOnDeleteAction, ut as ConfigReferences, vn as SeedConfig, vr as AppTableSubject, wi as GenTask, wn as TopicTriggerTopicConfig, wr as CatalogColumnGrant, xi as DoctorConfig, xn as TopicTriggerConfig, xr as Catalog, yn as SqlConfig, yr as AppTableVersions, z as buildJsonSchema, zr as ExtrasTable, zt as GeneratorInput } from "../context-Cj-9gE6l.js";
4
4
  import { n as SubjectsConfig, t as SubjectConfig } from "../subjects-DvmQeF_F.js";
5
5
  import { a as FieldFormat, o as FieldFormatInput, r as FIELD_FORMATS } from "../field-formats-CAFNkKSN.js";
6
6
  export { APP_COLUMN_ACCESS, APP_COLUMN_FORMATS, APP_COLUMN_TYPES, APP_ON_DELETE_ACTIONS, APP_ROLLUP_AGGREGATES, APP_TABLE_EVENT_KINDS, type AccessBlockConfig, type ActiveTenantSource, type AnyBlocksConfig, type ApiConfig, type AppColumnAccess, type AppColumnConfig, type AppColumnFormat, type AppColumnType, type AppLookupConfig, type AppOnDeleteAction, type AppReference, type AppReferenceTarget, type AppRollupAggregate, type AppRollupConfig, type AppTableConfig, type AppTableEventKind, type AppTableEvents, type AppTableInput, type AppTableNames, type AppTableSubject, type AppTableVersions, type AppTablesConfig, type AppTablesInput, type AuthConfig, type AuthorizationFunctions, type AuthorizationMembership, type AuthorizationOperation, type AuthorizationPermission, type AuthorizationProvider, type AuthorizationRequirement, type AuthorizationRoleSource, type AuthorizationScope, type AuthorizationTokenHook, type BetterSupabaseConfig, type BlockConfig, type BlockEntity, type BlockInput, type BlockMode, type BlockScope, type BlockTableReference, type BlocksConfig, type BlocksInput, type BucketConfig, type BucketName, CONFIG_DEFAULTS, CONFIG_GROUPS, CONFIG_SCHEMA_URL, type Casing, type Catalog, type CatalogCheck, type CatalogColumn, type CatalogColumnGrant, type CatalogEnum, type CatalogForeignKey, type CatalogFunction, type CatalogFunctionArg, type CatalogGrant, type CatalogIndex, type CatalogPolicy, type CatalogTable, type CatalogTrigger, type CatalogUnique, type ClaimPaths, type ClaimsConfig, type CodecsConfig, type ColumnPrivilege, type ConfigReferences, DEFAULT_ACTIVE_TENANT, DEFAULT_CLAIMS, type DataHooksFramework, type DatabaseConfig, type DisabledRow, type DoctorConfig, type EntitiesConfig, type EntitlementPlansSource, type EntitlementsConfig, type EntityConfig, type EnvFileConfig, type EnvironmentConfig, type ExpandedConfig, type ExposeConfig, type ExposePrivilege, type ExposeRole, type ExtrasDomain, type ExtrasFunction, type ExtrasHook, type ExtrasHookFunction, type ExtrasTable, FIELD_FORMATS, type FactoriesGeneratorOptions, type FieldFormat, type FieldFormatInput, type FlatConfig, type ForeignKeyAction, GEN_TASKS, type GenConfig, type GenGroupConfig, type GenTask, type GeneratedFile, type Generator, type GeneratorBlock, type GeneratorBlockEntity, type GeneratorColumn, type GeneratorEntitySchemas, type GeneratorField, type GeneratorFunction, type GeneratorFunctionArg, type GeneratorInput, type GeneratorInputSchema, type GeneratorJsonSchema, type GeneratorMetadata, type GeneratorModel, type GeneratorNoun, type GeneratorTable, INTEGRATION_INFO, INTEGRATION_NAMES, type IntegrationInfo, type IntegrationName, type JsonSchemaGeneratorOptions, type JsonSchemaSource, type JsonSchemaTarget, type JsonTypeConfig, type KeysConfig, type MigrationSafetyConfig, type NuqsGeneratorOptions, type OpenApiConfig, type OrganizationConfig, type OwnTablePolicies, type PostgresColumn, type PostgresFunction, type PostgresFunctionArg, type PowerSyncGenConfig, type Privilege, RENAMED_BLOCK_KEYS, RENAMED_CONFIG_KEYS, type RealtimeConfig, type RelationsConfig, type ResolvedConfig, type ResolvedExpose, type ResolvedExtensions, type ResolvedSqlConfig, type RoleNames, type RpcFunction, type RpcFunctionArg, type RpcFunctionOverload, type RpcFunctionReturns, type RpcReturnColumn, type RpcTypeReference, SKILLS_AGENTS, type SeedConfig, type SkillsAgent, type SkillsConfig, type Snapshot, type SnapshotBucket, type SnapshotExtras, type SourceConfig, type SqlConfig, type SqlInput, type SqlWorkflow, type StandardSchemaGeneratorOptions, type SubjectConfig, type SubjectsConfig, type TableConfig, type ToolingConfig, type TopicTriggerConfig, type TopicTriggerLookupConfig, type TopicTriggerPayloadValueConfig, type TopicTriggerTopicConfig, type TopicTriggerValueConfig, type TypedReference, type ValibotGeneratorOptions, type VectorDistance, type VectorSearchConfig, type ZodFlavor, type ZodGeneratorOptions, blockEntities, blockEntityRenames, blockEntrySource, blockSubjectTypes, buildJsonSchema, claimPaths, defineConfig, factories, flattenConfig, groupConfig, groupEntries, hasFlatTables, jsonSchema, nuqs, providerApiProblem, resolveConfig, resolveJsonSchema, standardSchema, tenantClaimPaths, tenantNameOf, valibot, zod };
@@ -4022,9 +4022,11 @@ interface BlockSqlContext {
4022
4022
  * lists in `typed`. On a table the app has, the column may be an enum or
4023
4023
  * another type with a text input, so the value goes through
4024
4024
  * `better_supabase.as_column_type`; on the module's own table it stays as it
4025
- * is.
4025
+ * is. With `invalid: "null"`, a value the type rejects, such as a label the
4026
+ * enum lacks, becomes null through `better_supabase.try_column_type` instead
4027
+ * of raising.
4026
4028
  */
4027
- cast(table: string, column: string, value: string): string;
4029
+ cast(table: string, column: string, value: string, invalid?: "raise" | "null"): string;
4028
4030
  /** Whether an optional logical table exists (it can be mapped to `null`). */
4029
4031
  hasTable(table: string): boolean;
4030
4032
  /** Whether the module renders its managed SQL (not adopt or custom mode). */
@@ -1,6 +1,6 @@
1
1
  /// <reference lib="esnext.temporal" />
2
- import { Pn as PresetSpec, Wn as PresetName, ar as AppColumnAccess, ci as Preset, cr as AppColumnType, g as BlockSqlAccessProvider, ht as PresetInput, nr as APP_ON_DELETE_ACTIONS, sr as AppColumnFormat, ur as AppOnDeleteAction, yr as AppTableVersions } from "../context-D24k1Cpc.js";
3
- import { a as DesignChange, p as DesignErrorCode, u as CreateDesign } from "../index-BAcQz5DS.js";
2
+ import { Pn as PresetSpec, Wn as PresetName, ar as AppColumnAccess, ci as Preset, cr as AppColumnType, g as BlockSqlAccessProvider, ht as PresetInput, nr as APP_ON_DELETE_ACTIONS, sr as AppColumnFormat, ur as AppOnDeleteAction, yr as AppTableVersions } from "../context-Cj-9gE6l.js";
3
+ import { a as DesignChange, p as DesignErrorCode, u as CreateDesign } from "../index-DVYEoVMK.js";
4
4
  import { a as SupabaseLint, o as SupabaseOrganization, s as SupabaseProject } from "../management-wtecfrNf.js";
5
5
  import { t as PresetMigrationFile } from "../types-DGHfTW8_.js";
6
6
  //#region src/create/design-computed.d.ts
@@ -2,7 +2,7 @@ import { a as presetOf, d as resolvePreset } from "../config-CD2OGfCG.js";
2
2
  import { C as APP_ON_DELETE_ACTIONS, E as PRESET_CATALOG, a as appIdentifierError, m as isAppDefault, o as appNameLengthError, p as appDefaultError, s as appReservedColumns } from "../app-tables-DyswUg6J.js";
3
3
  import { c as resolveConfig } from "../config-mbVyJwSc.js";
4
4
  import { _ as jsonPointer, a as DesignParseError, h as encodeDesign, n as diffDesigns, o as DesignTooLongError, p as designOf, u as designConfig, v as parseDesign } from "../preset-B3CukUhu.js";
5
- import { R as SQL_MODULES, _ as renderBlocks, i as moduleLayout } from "../sql-fHTjZGqR.js";
5
+ import { R as SQL_MODULES, _ as renderBlocks, i as moduleLayout } from "../sql-D2Sc6BTr.js";
6
6
  //#region src/create/column-keys.ts
7
7
  /** The most options a select takes, and the longest option. */
8
8
  const MAX_OPTIONS = 100;
@@ -1,4 +1,4 @@
1
- import { Pn as PresetSpec, St as ResolvedPreset, Wn as PresetName, br as AppTablesConfig, ci as Preset, cr as AppColumnType, ei as PresetCatalog, hr as AppTableConfig, or as AppColumnConfig, ri as PresetGlueItem, vt as presetConfig } from "./context-D24k1Cpc.js";
1
+ import { Pn as PresetSpec, St as ResolvedPreset, Wn as PresetName, br as AppTablesConfig, ci as Preset, cr as AppColumnType, ei as PresetCatalog, hr as AppTableConfig, or as AppColumnConfig, ri as PresetGlueItem, vt as presetConfig } from "./context-Cj-9gE6l.js";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/preset/catalog.generated.d.ts
4
4
  declare const PRESET_CATALOG: PresetCatalog;
@@ -1,7 +1,7 @@
1
1
  import { E as AccessPolicySql } from "./types-DFdg_4yN.js";
2
2
  import { p as AnyBlocksConfig, t as AuthorizationFunctions } from "./authorization-IiE__z2m.js";
3
3
  import { tt as ReadSet } from "./define-Cgru0_kF.js";
4
- import { E as TableGrant, Qt as ResolvedConfig, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, g as BlockSqlAccessProvider, h as BlockSql, hr as AppTableConfig, jr as CatalogPolicy, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-D24k1Cpc.js";
4
+ import { E as TableGrant, Qt as ResolvedConfig, _ as BlockSqlDeprecation, b as BlockSqlLayout, c as BlockSqlIdType, g as BlockSqlAccessProvider, h as BlockSql, hr as AppTableConfig, jr as CatalogPolicy, o as BlockSqlContractFunction, v as BlockSqlEntitlementsProvider, y as BlockSqlFile } from "./context-Cj-9gE6l.js";
5
5
  import { t as SubjectConfig } from "./subjects-DvmQeF_F.js";
6
6
  //#region src/sql/render.d.ts
7
7
  /** A module's SQL for `layout`, without header; `undefined` in custom mode. */
@@ -1,10 +1,10 @@
1
- import { t as VERSION } from "../cli/version-DzroJkIT.js";
2
- import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-BxohmNou.js";
3
- import { t as loadSnapshot } from "../cli/snapshot-k4R6vT20.js";
4
- import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-D9c5ynjR.js";
1
+ import { t as VERSION } from "../cli/version-DmaGTP3L.js";
2
+ import { a as lastTypesModule, c as writeAtomic, s as typesModuleKey } from "../cli/cache-CDNVq1vO.js";
3
+ import { t as loadSnapshot } from "../cli/snapshot-B12QpZNf.js";
4
+ import { i as renderTypesModule, t as mapperFilePath } from "../cli/render-CVTKsacY.js";
5
5
  import { i as discoverConfig, s as loadConfig } from "../cli/config-BJSqMi04.js";
6
6
  import { i as parseEnv, n as configEnvironment } from "../cli/env-DMgjB_4y.js";
7
- import { s as schemaStampPath } from "../cli/content-mapper-D54wumPS.js";
7
+ import { s as schemaStampPath } from "../cli/content-mapper-Chm3txER.js";
8
8
  import { existsSync, realpathSync } from "node:fs";
9
9
  import { basename, dirname, join, resolve } from "node:path";
10
10
  import { createHash } from "node:crypto";
@@ -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.18.1");
43
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.2");
44
44
  let histogram;
45
- if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.18.1")).createHistogram("db.client.operation.duration", {
45
+ if (options.metrics !== false) histogram = (options.meter ?? metrics.getMeter("better-supabase", "0.18.2")).createHistogram("db.client.operation.duration", {
46
46
  unit: "s",
47
47
  description: "Duration of database client operations.",
48
48
  advice: { explicitBucketBoundaries: [
@@ -219,7 +219,7 @@ function otel(options = {}) {
219
219
  * `betterSupabase.events`. Returns a function that stops listening.
220
220
  */
221
221
  function traceAuth(betterSupabase, options = {}) {
222
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.1");
222
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.2");
223
223
  const offAuth = betterSupabase.events.on("auth", (event) => {
224
224
  const span = tracer.startSpan("auth.resolve", {
225
225
  kind: SpanKind.INTERNAL,
@@ -257,7 +257,7 @@ function traceAuth(betterSupabase, options = {}) {
257
257
  * an error status. Returns a function that stops listening.
258
258
  */
259
259
  function traceBlockEvents(betterSupabase, options = {}) {
260
- const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.1");
260
+ const tracer = options.tracer ?? trace.getTracer("better-supabase", "0.18.2");
261
261
  return betterSupabase.events.on("block", (event) => {
262
262
  const attributes = {
263
263
  ...options.attributes,
@@ -1,4 +1,4 @@
1
- import { Bn as PRESETS, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetValueInfo, _t as expandPreset, ai as DEFAULT_CONVENTIONS, bi as presetValueLabel, bt as PresetConflict, ci as Preset, di as PresetField, ei as PresetCatalog, er as APP_COLUMN_FORMATS, fi as PresetFieldKey, gi as PresetScope, gt as conventionConfig, hi as PresetPlatforms, ht as PresetInput, ii as CONVENTION_FIELDS, li as PresetAccess, mi as PresetFramework, mt as ExpandedConfig, ni as PresetCatalogManifest, oi as PRESET_FRAMEWORKS, pi as PresetFieldValue, pt as ConfigConventions, qn as namedPreset, ri as PresetGlueItem, si as PRESET_TENANT_NAMES, sr as AppColumnFormat, ti as PresetCatalogBlock, ui as PresetConventions, vi as integrationsForFramework, vt as presetConfig, wt as listNames, xt as PresetIntegration, yi as presetField, yt as presetOf, zn as NamedPreset } from "../context-D24k1Cpc.js";
2
- import { A as presetAndDesignOf, C as designFileSource, D as encodeDesign, E as designSchema, F as safeDesignFileSource, I as safeParseDesign, L as appDefaultError, M as presetConfigSource, N as presetInstallCommand, O as isDesignCode, P as readDesignFile, R as isAppDefault, S as designConfig, T as designOf, _ as DesignParseResult, a as DesignChange, b as createUrl, c as diffAppTables, d as DESIGN_FILE, f as DESIGN_FORMAT, g as DesignParseIssue, h as DesignParseError, i as presetGlue, j as presetApplyCommand, k as parseDesign, l as diffDesigns, m as DesignFile, n as glueCommand, o as DesignChangeKind, p as DesignErrorCode, r as presetBlocksSource, s as DiffOptions, t as PROVIDER_COMMENT, u as CreateDesign, v as DesignTooLongError, w as designFormat, x as decodeDesign, y as MAX_DESIGN_CODE_LENGTH, z as PRESET_CATALOG } from "../index-BAcQz5DS.js";
3
- import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-XwCviyhP.js";
1
+ import { Bn as PRESETS, Ct as ResolvedPresetBlock, Et as resolvePreset, Fn as presetFromSpec, Gn as defaultPreset, Hn as PRESET_NAMES, In as presetOfSpec, Kn as isPresetName, Ln as presetSpec, Pn as PresetSpec, Rn as DEFAULT_PRESET_NAME, St as ResolvedPreset, Tt as presetBlockConflict, Un as PresetGroup, Vn as PRESET_GROUPS, Wn as PresetName, _i as PresetValueInfo, _t as expandPreset, ai as DEFAULT_CONVENTIONS, bi as presetValueLabel, bt as PresetConflict, ci as Preset, di as PresetField, ei as PresetCatalog, er as APP_COLUMN_FORMATS, fi as PresetFieldKey, gi as PresetScope, gt as conventionConfig, hi as PresetPlatforms, ht as PresetInput, ii as CONVENTION_FIELDS, li as PresetAccess, mi as PresetFramework, mt as ExpandedConfig, ni as PresetCatalogManifest, oi as PRESET_FRAMEWORKS, pi as PresetFieldValue, pt as ConfigConventions, qn as namedPreset, ri as PresetGlueItem, si as PRESET_TENANT_NAMES, sr as AppColumnFormat, ti as PresetCatalogBlock, ui as PresetConventions, vi as integrationsForFramework, vt as presetConfig, wt as listNames, xt as PresetIntegration, yi as presetField, yt as presetOf, zn as NamedPreset } from "../context-Cj-9gE6l.js";
2
+ import { A as presetAndDesignOf, C as designFileSource, D as encodeDesign, E as designSchema, F as safeDesignFileSource, I as safeParseDesign, L as appDefaultError, M as presetConfigSource, N as presetInstallCommand, O as isDesignCode, P as readDesignFile, R as isAppDefault, S as designConfig, T as designOf, _ as DesignParseResult, a as DesignChange, b as createUrl, c as diffAppTables, d as DESIGN_FILE, f as DESIGN_FORMAT, g as DesignParseIssue, h as DesignParseError, i as presetGlue, j as presetApplyCommand, k as parseDesign, l as diffDesigns, m as DesignFile, n as glueCommand, o as DesignChangeKind, p as DesignErrorCode, r as presetBlocksSource, s as DiffOptions, t as PROVIDER_COMMENT, u as CreateDesign, v as DesignTooLongError, w as designFormat, x as decodeDesign, y as MAX_DESIGN_CODE_LENGTH, z as PRESET_CATALOG } from "../index-DVYEoVMK.js";
3
+ import { i as appReservedColumns, n as appIdentifierError, r as appNameLengthError, t as APP_NAME_MAX } from "../app-tables-atP-tZKZ.js";
4
4
  export { APP_COLUMN_FORMATS, APP_NAME_MAX, type AppColumnFormat, CONVENTION_FIELDS, type ConfigConventions, type CreateDesign, DEFAULT_CONVENTIONS, DEFAULT_PRESET_NAME, DESIGN_FILE, DESIGN_FORMAT, type DesignChange, type DesignChangeKind, type DesignErrorCode, type DesignFile, DesignParseError, type DesignParseIssue, type DesignParseResult, DesignTooLongError, type DiffOptions, type ExpandedConfig, MAX_DESIGN_CODE_LENGTH, type NamedPreset, PRESETS, PRESET_CATALOG, PRESET_FRAMEWORKS, PRESET_GROUPS, PRESET_NAMES, PRESET_TENANT_NAMES, PROVIDER_COMMENT, type Preset, type PresetAccess, type PresetCatalog, type PresetCatalogBlock, type PresetCatalogManifest, type PresetConflict, type PresetConventions, type PresetField, type PresetFieldKey, type PresetFieldValue, type PresetFramework, type PresetGlueItem, type PresetGroup, type PresetInput, type PresetIntegration, type PresetName, type PresetPlatforms, type PresetScope, type PresetSpec, type PresetValueInfo, type ResolvedPreset, type ResolvedPresetBlock, appDefaultError, appIdentifierError, appNameLengthError, appReservedColumns, conventionConfig, createUrl, decodeDesign, defaultPreset, designConfig, designFileSource, designFormat, designOf, designSchema, diffAppTables, diffDesigns, encodeDesign, expandPreset, glueCommand, integrationsForFramework, isAppDefault, isDesignCode, isPresetName, listNames, namedPreset, parseDesign, presetAndDesignOf, presetApplyCommand, presetBlockConflict, presetBlocksSource, presetConfig, presetConfigSource, presetField, presetFromSpec, presetGlue, presetInstallCommand, presetOf, presetOfSpec, presetSpec, presetValueLabel, readDesignFile, resolvePreset, safeDesignFileSource, safeParseDesign };
@@ -1,5 +1,5 @@
1
1
  import { M as BlockOptionsRegistry, j as BLOCK_OPTION_SCHEMAS, k as resolveBlock } from "../authorization-IiE__z2m.js";
2
- import { C as OwnView, Qn as auditRegistrations, S as BlockSqlUpgrade, T as notNullCheckName, Xn as sameTenantLayout, Yn as DeclaredForeignKey, Zn as AuditedTable, _ as BlockSqlDeprecation, a as BlockSqlContext, b as BlockSqlLayout, c as BlockSqlIdType, d as MODULE_ID_TYPES, f as contractSignature, g as BlockSqlAccessProvider, h as BlockSql, i as BlockSqlAudit, l as BlockSqlNames, m as moduleIdType, n as AuditCategory, o as BlockSqlContractFunction, p as isBlockSqlIdType, r as BlockSqlAction, s as BlockSqlEmit, t as AUDIT_CATEGORIES, u as BlockSqlTableSpec, v as BlockSqlEntitlementsProvider, w as blockSqlVersion, x as BlockSqlTestFile, y as BlockSqlFile } from "../context-D24k1Cpc.js";
3
- import { a as appTableEventTypes } from "../app-tables-XwCviyhP.js";
4
- import { $ as BlockSqlPermissionKey, A as tenantsQuery, B as AdoptedView, C as declaredUpdatedAtTriggers, Ct as moduleBody, D as rlsTables, E as policyGrants, F as SECRET_COLUMNS, G as APP_TABLES_MARKER, H as adoptedTables, I as dataExportPlan, J as DEFAULT_ROLES, K as APP_TABLES_MODULE, L as excludedColumns, M as sameTenantColumn, N as sameTenantTrigger, O as subjectColumns, P as DataExportPlan, Q as BlockSqlExtension, R as resolveExposeColumns, S as declaredTables, St as customContracts, T as extensionSchema, Tt as renderBlocks, U as adoptedViews, V as adoptedColumnProblems, W as moduleWritesText, X as SQL_MODULES, Y as instanceFunctions, Z as resolveBlocks, _ as templateFunctions, _t as BlockSqlUpgradePlan, a as scopePolicyName, at as isModuleDataFile, b as declaredColumnTypes, bt as upgradePlan, c as compileReadSet, ct as moduleDataDir, d as MigrationOptionUse, dt as EntityRenameStep, et as moduleEventTriggers, f as migrationOptionUses, ft as entityRenamePlan, g as scopeProblems, gt as renamedBlock, h as resolveProviderSql, ht as formerBlockName, i as TENANT_SCOPE_POLICY, it as blockFileState, j as expiredFlagsQuery, k as TenantQuery, l as compileReadSets, lt as moduleFilePaths, m as SCOPE_ID_TYPES, mt as currentBlockName, n as declaredPolicies, nt as modulePermissionKeys, o as hasColumnAccess, ot as moduleFileVersion, p as moduleLayout, pt as BLOCK_RENAMES, q as appTablesFiles, r as widenedCommands, rt as moduleSchemaExtensions, s as CompiledReadSet, st as sameBlockFile, t as appTablePolicyNotes, tt as moduleHidingColumns, u as sharedRolesProblems, ut as EntityRenamePlan, v as DeclaredView, vt as InstalledBlock, w as declaredViews, wt as moduleTopics, x as declaredTableColumns, xt as BlockSqlTopic, y as PolicyGrant, yt as moduleDeprecations, z as AdoptedTable } from "../index-4WT_uRRL.js";
2
+ import { C as OwnView, Qn as auditRegistrations, S as BlockSqlUpgrade, T as notNullCheckName, Xn as sameTenantLayout, Yn as DeclaredForeignKey, Zn as AuditedTable, _ as BlockSqlDeprecation, a as BlockSqlContext, b as BlockSqlLayout, c as BlockSqlIdType, d as MODULE_ID_TYPES, f as contractSignature, g as BlockSqlAccessProvider, h as BlockSql, i as BlockSqlAudit, l as BlockSqlNames, m as moduleIdType, n as AuditCategory, o as BlockSqlContractFunction, p as isBlockSqlIdType, r as BlockSqlAction, s as BlockSqlEmit, t as AUDIT_CATEGORIES, u as BlockSqlTableSpec, v as BlockSqlEntitlementsProvider, w as blockSqlVersion, x as BlockSqlTestFile, y as BlockSqlFile } from "../context-Cj-9gE6l.js";
3
+ import { a as appTableEventTypes } from "../app-tables-atP-tZKZ.js";
4
+ import { $ as BlockSqlPermissionKey, A as tenantsQuery, B as AdoptedView, C as declaredUpdatedAtTriggers, Ct as moduleBody, D as rlsTables, E as policyGrants, F as SECRET_COLUMNS, G as APP_TABLES_MARKER, H as adoptedTables, I as dataExportPlan, J as DEFAULT_ROLES, K as APP_TABLES_MODULE, L as excludedColumns, M as sameTenantColumn, N as sameTenantTrigger, O as subjectColumns, P as DataExportPlan, Q as BlockSqlExtension, R as resolveExposeColumns, S as declaredTables, St as customContracts, T as extensionSchema, Tt as renderBlocks, U as adoptedViews, V as adoptedColumnProblems, W as moduleWritesText, X as SQL_MODULES, Y as instanceFunctions, Z as resolveBlocks, _ as templateFunctions, _t as BlockSqlUpgradePlan, a as scopePolicyName, at as isModuleDataFile, b as declaredColumnTypes, bt as upgradePlan, c as compileReadSet, ct as moduleDataDir, d as MigrationOptionUse, dt as EntityRenameStep, et as moduleEventTriggers, f as migrationOptionUses, ft as entityRenamePlan, g as scopeProblems, gt as renamedBlock, h as resolveProviderSql, ht as formerBlockName, i as TENANT_SCOPE_POLICY, it as blockFileState, j as expiredFlagsQuery, k as TenantQuery, l as compileReadSets, lt as moduleFilePaths, m as SCOPE_ID_TYPES, mt as currentBlockName, n as declaredPolicies, nt as modulePermissionKeys, o as hasColumnAccess, ot as moduleFileVersion, p as moduleLayout, pt as BLOCK_RENAMES, q as appTablesFiles, r as widenedCommands, rt as moduleSchemaExtensions, s as CompiledReadSet, st as sameBlockFile, t as appTablePolicyNotes, tt as moduleHidingColumns, u as sharedRolesProblems, ut as EntityRenamePlan, v as DeclaredView, vt as InstalledBlock, w as declaredViews, wt as moduleTopics, x as declaredTableColumns, xt as BlockSqlTopic, y as PolicyGrant, yt as moduleDeprecations, z as AdoptedTable } from "../index-DZylLz7h.js";
5
5
  export { APP_TABLES_MARKER, APP_TABLES_MODULE, AUDIT_CATEGORIES, type AdoptedTable, type AdoptedView, type AuditCategory, type AuditedTable, BLOCK_OPTION_SCHEMAS, BLOCK_RENAMES, type BlockOptionsRegistry, type BlockSql, type BlockSqlAccessProvider, type BlockSqlAction, type BlockSqlAudit, type BlockSqlContext, type BlockSqlContractFunction, type BlockSqlDeprecation, type BlockSqlEmit, type BlockSqlEntitlementsProvider, type BlockSqlExtension, type BlockSqlFile, type BlockSqlIdType, type BlockSqlLayout, type BlockSqlNames, type BlockSqlPermissionKey, type BlockSqlTableSpec, type BlockSqlTestFile, type BlockSqlTopic, type BlockSqlUpgrade, type BlockSqlUpgradePlan, type CompiledReadSet, DEFAULT_ROLES, type DataExportPlan, type DeclaredForeignKey, type DeclaredView, type EntityRenamePlan, type EntityRenameStep, type InstalledBlock, MODULE_ID_TYPES, type MigrationOptionUse, type OwnView, type PolicyGrant, SCOPE_ID_TYPES, SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_POLICY, type TenantQuery, adoptedColumnProblems, adoptedTables, adoptedViews, appTableEventTypes, appTablePolicyNotes, appTablesFiles, auditRegistrations, blockFileState, blockSqlVersion, compileReadSet, compileReadSets, contractSignature, currentBlockName, customContracts, dataExportPlan, declaredColumnTypes, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, entityRenamePlan, excludedColumns, expiredFlagsQuery, extensionSchema, formerBlockName, hasColumnAccess, instanceFunctions, isBlockSqlIdType, isModuleDataFile, migrationOptionUses, moduleBody, moduleDataDir, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleHidingColumns, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleWritesText, notNullCheckName, policyGrants, renamedBlock, renderBlocks, resolveBlock, resolveBlocks, resolveExposeColumns, resolveProviderSql, rlsTables, sameBlockFile, sameTenantColumn, sameTenantLayout, sameTenantTrigger, scopePolicyName, scopeProblems, sharedRolesProblems, subjectColumns, templateFunctions, tenantsQuery, upgradePlan, widenedCommands };
package/dist/sql/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { A as resolveBlock, l as appTableEventTypes, v as hasColumnAccess } from "../app-tables-DyswUg6J.js";
2
2
  import { c as templateFunctions, o as resolveProviderSql, s as scopeProblems, t as SCOPE_ID_TYPES } from "../access-sql-CNIgUqWf.js";
3
3
  import { Y as notNullCheckName, a as DEFAULT_ROLES } from "../workflow-sdk-DELaQEp3.js";
4
- import { $ as AUDIT_CATEGORIES, A as blockFileState, B as TENANT_SCOPE_POLICY, C as moduleDataDir, D as appTablesFiles, E as APP_TABLES_MODULE, F as moduleHidingColumns, G as subjectColumns, H as resolveExposeColumns, I as modulePermissionKeys, J as migrationOptionUses, K as sameTenantColumn, L as moduleSchemaExtensions, M as moduleFileVersion, N as sameBlockFile, O as scopePolicyName, P as moduleEventTriggers, Q as renamedBlock, R as SQL_MODULES, S as widenedCommands, T as APP_TABLES_MARKER, U as SECRET_COLUMNS, V as excludedColumns, W as dataExportPlan, X as currentBlockName, Y as BLOCK_RENAMES, Z as formerBlockName, _ as renderBlocks, a as tenantsQuery, at as declaredColumnTypes, b as appTablePolicyNotes, c as adoptedColumnProblems, ct as declaredUpdatedAtTriggers, d as moduleWritesText, dt as policyGrants, et as MODULE_ID_TYPES, f as instanceFunctions, ft as rlsTables, g as moduleTopics, h as moduleBody, i as moduleLayout, it as BLOCK_OPTION_SCHEMAS, j as isModuleDataFile, k as blockSqlVersion, l as adoptedTables, lt as declaredViews, m as customContracts, n as compileReadSets, nt as isBlockSqlIdType, o as expiredFlagsQuery, ot as declaredTableColumns, p as entityRenamePlan, pt as auditRegistrations, q as sameTenantTrigger, r as sharedRolesProblems, rt as moduleIdType, s as sameTenantLayout, st as declaredTables, t as compileReadSet, tt as contractSignature, u as adoptedViews, ut as extensionSchema, v as moduleDeprecations, w as moduleFilePaths, x as declaredPolicies, y as upgradePlan, z as resolveBlocks } from "../sql-fHTjZGqR.js";
4
+ import { $ as AUDIT_CATEGORIES, A as blockFileState, B as TENANT_SCOPE_POLICY, C as moduleDataDir, D as appTablesFiles, E as APP_TABLES_MODULE, F as moduleHidingColumns, G as subjectColumns, H as resolveExposeColumns, I as modulePermissionKeys, J as migrationOptionUses, K as sameTenantColumn, L as moduleSchemaExtensions, M as moduleFileVersion, N as sameBlockFile, O as scopePolicyName, P as moduleEventTriggers, Q as renamedBlock, R as SQL_MODULES, S as widenedCommands, T as APP_TABLES_MARKER, U as SECRET_COLUMNS, V as excludedColumns, W as dataExportPlan, X as currentBlockName, Y as BLOCK_RENAMES, Z as formerBlockName, _ as renderBlocks, a as tenantsQuery, at as declaredColumnTypes, b as appTablePolicyNotes, c as adoptedColumnProblems, ct as declaredUpdatedAtTriggers, d as moduleWritesText, dt as policyGrants, et as MODULE_ID_TYPES, f as instanceFunctions, ft as rlsTables, g as moduleTopics, h as moduleBody, i as moduleLayout, it as BLOCK_OPTION_SCHEMAS, j as isModuleDataFile, k as blockSqlVersion, l as adoptedTables, lt as declaredViews, m as customContracts, n as compileReadSets, nt as isBlockSqlIdType, o as expiredFlagsQuery, ot as declaredTableColumns, p as entityRenamePlan, pt as auditRegistrations, q as sameTenantTrigger, r as sharedRolesProblems, rt as moduleIdType, s as sameTenantLayout, st as declaredTables, t as compileReadSet, tt as contractSignature, u as adoptedViews, ut as extensionSchema, v as moduleDeprecations, w as moduleFilePaths, x as declaredPolicies, y as upgradePlan, z as resolveBlocks } from "../sql-D2Sc6BTr.js";
5
5
  export { APP_TABLES_MARKER, APP_TABLES_MODULE, AUDIT_CATEGORIES, BLOCK_OPTION_SCHEMAS, BLOCK_RENAMES, DEFAULT_ROLES, MODULE_ID_TYPES, SCOPE_ID_TYPES, SECRET_COLUMNS, SQL_MODULES, TENANT_SCOPE_POLICY, adoptedColumnProblems, adoptedTables, adoptedViews, appTableEventTypes, appTablePolicyNotes, appTablesFiles, auditRegistrations, blockFileState, blockSqlVersion, compileReadSet, compileReadSets, contractSignature, currentBlockName, customContracts, dataExportPlan, declaredColumnTypes, declaredPolicies, declaredTableColumns, declaredTables, declaredUpdatedAtTriggers, declaredViews, entityRenamePlan, excludedColumns, expiredFlagsQuery, extensionSchema, formerBlockName, hasColumnAccess, instanceFunctions, isBlockSqlIdType, isModuleDataFile, migrationOptionUses, moduleBody, moduleDataDir, moduleDeprecations, moduleEventTriggers, moduleFilePaths, moduleFileVersion, moduleHidingColumns, moduleIdType, moduleLayout, modulePermissionKeys, moduleSchemaExtensions, moduleTopics, moduleWritesText, notNullCheckName, policyGrants, renamedBlock, renderBlocks, resolveBlock, resolveBlocks, resolveExposeColumns, resolveProviderSql, rlsTables, sameBlockFile, sameTenantColumn, sameTenantLayout, sameTenantTrigger, scopePolicyName, scopeProblems, sharedRolesProblems, subjectColumns, templateFunctions, tenantsQuery, upgradePlan, widenedCommands };
@@ -505,19 +505,44 @@ $$;
505
505
  revoke execute on function better_supabase.as_column_type(text, anyelement) from public;
506
506
  grant execute on function better_supabase.as_column_type(text, anyelement) to anon, authenticated, service_role;`;
507
507
  }
508
+ function tryColumnTypeFunction() {
509
+ return `${SCHEMA$5}
510
+ create or replace function better_supabase.try_column_type(value text, target anyelement)
511
+ returns anyelement
512
+ language plpgsql
513
+ stable
514
+ security invoker
515
+ set search_path = ''
516
+ as $$
517
+ declare
518
+ result alias for $0;
519
+ begin
520
+ result := value;
521
+ return result;
522
+ exception when data_exception or check_violation then
523
+ return null;
524
+ end;
525
+ $$;
526
+ revoke execute on function better_supabase.try_column_type(text, anyelement) from public;
527
+ grant execute on function better_supabase.try_column_type(text, anyelement) to anon, authenticated, service_role;`;
528
+ }
508
529
  /** `value` (text) cast to the type of `column` on the quoted `table`. */
509
530
  function asColumnType(table, column, value) {
510
531
  return `better_supabase.as_column_type(${value}, (null::${table}).${sqlIdent(column)})`;
511
532
  }
533
+ function tryColumnType(table, column, value) {
534
+ return `better_supabase.try_column_type(${value}, (null::${table}).${sqlIdent(column)})`;
535
+ }
536
+ const FUNCTIONS$1 = [["as_column_type", columnTypeFunction], ["try_column_type", tryColumnTypeFunction]];
512
537
  /**
513
- * `sql` with `better_supabase.as_column_type` defined ahead of it when it calls
514
- * the function and does not define it. PL/pgSQL returns `value` through the
515
- * type's input function, so a text value becomes an enum label or any other
516
- * type `target` has.
538
+ * `sql` with `better_supabase.as_column_type` and `try_column_type` defined
539
+ * ahead of it when it calls them and does not define them. PL/pgSQL returns
540
+ * `value` through the type's input function, so a text value becomes an enum
541
+ * label or any other type `target` has.
517
542
  */
518
543
  function withColumnTypeFunction(sql) {
519
- if (!sql.includes("better_supabase.as_column_type(") || sql.includes("function better_supabase.as_column_type(")) return sql;
520
- return `${columnTypeFunction()}\n${sql}`;
544
+ const missing = FUNCTIONS$1.filter(([name]) => sql.includes(`better_supabase.${name}(`) && !sql.includes(`function better_supabase.${name}(`));
545
+ return missing.length === 0 ? sql : `${missing.map(([, define]) => define()).join("\n")}\n${sql}`;
521
546
  }
522
547
  //#endregion
523
548
  //#region src/sql/audit-registrations.ts
@@ -1312,11 +1337,11 @@ function tableOwnership(input, column, requiredColumn) {
1312
1337
  name: `${UNMAPPED_TABLE}${logical}`
1313
1338
  } : input.tableName(logical),
1314
1339
  col: (table, logical) => sqlIdent(column(table, logical) === null && appOwned.includes(table) ? `${UNMAPPED_COLUMN}${table}.${logical}` : requiredColumn(table, logical)),
1315
- cast: (table, logical, value) => {
1340
+ cast: (table, logical, value, invalid = "raise") => {
1316
1341
  if (input.tables[table]?.typed?.includes(logical) !== true) throw new TypeError(`Module "${input.module}" casts ${table}.${logical}, which its names.tables.${table}.typed doesn't list`);
1317
1342
  if (!appOwned.includes(table)) return value;
1318
1343
  const parts = input.tableName(table);
1319
- return asColumnType(`${sqlIdent(parts.schema)}.${sqlIdent(parts.name)}`, requiredColumn(table, logical), value);
1344
+ return (invalid === "null" ? tryColumnType : asColumnType)(`${sqlIdent(parts.schema)}.${sqlIdent(parts.name)}`, requiredColumn(table, logical), value);
1320
1345
  }
1321
1346
  };
1322
1347
  }
@@ -81029,7 +81054,8 @@ const NAMES$45 = {
81029
81054
  "createdAt",
81030
81055
  "updatedAt"
81031
81056
  ],
81032
- yieldsToExtra: ["locale"]
81057
+ yieldsToExtra: ["locale"],
81058
+ typed: ["locale"]
81033
81059
  } },
81034
81060
  hooks: [
81035
81061
  "after_profile_sync",
@@ -81130,6 +81156,8 @@ function syncValues(ctx) {
81130
81156
  if (has("lastName")) values.set(col("lastName"), `coalesce(${values.get(col("lastName")) ?? "null"}, nullif(btrim(substr(${full}, length(split_part(${full}, ' ', 1)) + 1)), ''))`);
81131
81157
  }
81132
81158
  }
81159
+ const fromLocale = hasLocale(ctx) ? values.get(col("locale")) : void 0;
81160
+ if (fromLocale !== void 0) values.set(col("locale"), ctx.cast("profiles", "locale", fromLocale, "null"));
81133
81161
  if (has("email")) values.set(col("email"), "lower(u.email)");
81134
81162
  if (has("username") && ctx.flag("username", true)) values.set(col("username"), `${ctx.fn("allocate_username")}(coalesce(${usernameSource(ctx, values)}, split_part(u.email, '@', 1)), user_id)`);
81135
81163
  return values;
@@ -81615,7 +81643,8 @@ function selfUpdates(ctx) {
81615
81643
  return [...columns.map((logical) => {
81616
81644
  const quoted = ctx.col("profiles", logical);
81617
81645
  const key = sqlString(profilePhysical(ctx, logical));
81618
- return `${quoted} = case when update_my_profile.attrs ? ${key} then update_my_profile.attrs ${logical === "onboarding" ? "->" : "->>"} ${key} else p.${quoted} end`;
81646
+ const value = `update_my_profile.attrs ${logical === "onboarding" ? "->" : "->>"} ${key}`;
81647
+ return `${quoted} = case when update_my_profile.attrs ? ${key} then ${logical === "locale" ? ctx.cast("profiles", logical, value) : value} else p.${quoted} end`;
81619
81648
  }), ...extras].join(",\n ");
81620
81649
  }
81621
81650
  /**
@@ -26,7 +26,7 @@ import { r as GuardOptions } from "../respond-oZeJ342J.js";
26
26
  import { l as Transcriber, s as NoteTaker, u as TranscriberInput } from "../recordings-BBSJt_YV.js";
27
27
  import { n as Controller } from "../controller-BR7CZ1R9.js";
28
28
  import { c as AiTaskRunner, o as AiTaskRun, r as AiTask } from "../ai-schedules-DzLh6BYI.js";
29
- import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-D24k1Cpc.js";
29
+ import { Ht as GeneratorModel, Qt as ResolvedConfig, jt as Generator, zt as GeneratorInput } from "../context-Cj-9gE6l.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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.18.1",
3
+ "version": "0.18.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-C5kLXuqn.js";
@@ -1 +0,0 @@
1
- export { t as powersyncStreamsCommand } from "./powersync-BCDuGn5p.js";