clivly 0.23.1 → 0.24.0-next.1

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 (117) hide show
  1. package/README.md +42 -2
  2. package/{adapter-B4v4dwgD.d.mts → adapter--YV7du3i.d.cts} +1 -1
  3. package/{adapter-BK3gsby5.d.cts → adapter-DD3K3dCW.d.mts} +1 -1
  4. package/app-id-5cB6yioz.mjs +53 -0
  5. package/app-id-DcQ4u1c8.cjs +70 -0
  6. package/{auth-adapter-BIa-ZyVV.d.mts → auth-adapter-C17dzlzF.d.cts} +1 -1
  7. package/{auth-adapter-DwtMJb7D.d.cts → auth-adapter-CizFv7oU.d.mts} +1 -1
  8. package/auth-better-auth.d.cts +1 -1
  9. package/auth-better-auth.d.mts +1 -1
  10. package/auth-clerk.d.cts +1 -1
  11. package/auth-clerk.d.mts +1 -1
  12. package/auth-supabase.cjs +121 -0
  13. package/auth-supabase.d.cts +23 -0
  14. package/auth-supabase.d.mts +23 -0
  15. package/auth-supabase.mjs +119 -0
  16. package/auth-workos.d.cts +1 -1
  17. package/auth-workos.d.mts +1 -1
  18. package/core-adapter.d.cts +1 -1
  19. package/core-adapter.d.mts +1 -1
  20. package/core-auth-adapter.d.cts +1 -1
  21. package/core-auth-adapter.d.mts +1 -1
  22. package/core-mapping-score.d.cts +1 -0
  23. package/core-sync-engine.cjs +1 -1
  24. package/core-sync-engine.mjs +1 -1
  25. package/core-types.cjs +5 -1
  26. package/core-types.d.cts +2 -2
  27. package/core-types.d.mts +2 -2
  28. package/core-types.mjs +1 -1
  29. package/core-view-compiler.cjs +1 -1
  30. package/core-view-compiler.mjs +1 -1
  31. package/core.cjs +9 -5
  32. package/core.d.cts +6 -6
  33. package/core.d.mts +6 -6
  34. package/core.mjs +6 -6
  35. package/drizzle.cjs +121 -14
  36. package/drizzle.d.cts +8 -2
  37. package/drizzle.d.mts +8 -2
  38. package/drizzle.mjs +126 -19
  39. package/executor-CJEWurjZ.mjs +23 -0
  40. package/executor-CU-jRgpC.cjs +40 -0
  41. package/from-sql-BD7gR4bC.mjs +282 -0
  42. package/from-sql-CFgXkCe2.cjs +347 -0
  43. package/from-sql-CpGP7K3J.d.mts +70 -0
  44. package/from-sql-S8dSvU-e.d.cts +70 -0
  45. package/index-BoemTWH4.d.mts +134 -0
  46. package/index-CIupXz_w.d.cts +134 -0
  47. package/{index-Bh7o2J7K.d.mts → index-DOoX2GgI.d.mts} +3 -3
  48. package/{index-DRRTE5IJ.d.cts → index-uFDiQEjj.d.cts} +231 -5
  49. package/index.cjs +1079 -36
  50. package/index.d.cts +36 -0
  51. package/index.d.mts +35 -0
  52. package/index.mjs +1077 -34
  53. package/{internal-CdfVkh4O.d.mts → internal-D_2q2BOB.d.mts} +1 -1
  54. package/internal-adapter.d.cts +1 -1
  55. package/internal-adapter.d.mts +1 -1
  56. package/internal-auth-adapter.d.cts +1 -1
  57. package/internal-auth-adapter.d.mts +1 -1
  58. package/internal-sync-engine.cjs +1 -1
  59. package/internal-sync-engine.mjs +1 -1
  60. package/internal-types.cjs +5 -1
  61. package/internal-types.d.cts +2 -2
  62. package/internal-types.d.mts +2 -2
  63. package/internal-types.mjs +1 -1
  64. package/internal-view-compiler.cjs +1 -1
  65. package/internal-view-compiler.mjs +1 -1
  66. package/internal.cjs +9 -5
  67. package/internal.d.cts +5 -6
  68. package/internal.d.mts +6 -6
  69. package/internal.mjs +6 -6
  70. package/introspector-5w2x89RD.mjs +55 -0
  71. package/introspector-DT_Ma59k.cjs +60 -0
  72. package/kysely.cjs +56 -0
  73. package/kysely.d.cts +45 -0
  74. package/kysely.d.mts +45 -0
  75. package/kysely.mjs +54 -0
  76. package/{namespace-probe-JuHriruA.d.mts → namespace-probe-CUR2zG2l.d.mts} +41 -4
  77. package/package.json +45 -1
  78. package/projection-guard-C70l5U24.cjs +170 -0
  79. package/projection-guard-DOt_nbGn.mjs +147 -0
  80. package/{projection-sql-DQQdjw9I.mjs → projection-sql-2joBkLz2.mjs} +13 -3
  81. package/{projection-sql-BkrHR2ea.cjs → projection-sql-DS5sVTY-.cjs} +18 -2
  82. package/sdk-Bzkr24NW.cjs +207 -0
  83. package/sdk-D2WwGBzk.mjs +178 -0
  84. package/sdk.cjs +8 -6
  85. package/sdk.d.cts +7 -1
  86. package/sdk.d.mts +7 -1
  87. package/sdk.mjs +3 -2
  88. package/sql.cjs +20 -0
  89. package/sql.d.cts +3 -0
  90. package/sql.d.mts +3 -0
  91. package/sql.mjs +7 -0
  92. package/{sdk-BOarpe5I.cjs → src-CZIdwwI2.cjs} +203 -583
  93. package/{sdk-BkMDOfCk.mjs → src-tFhC1Ru2.mjs} +175 -531
  94. package/supabase-contact-3ke1KKUs.mjs +595 -0
  95. package/supabase-contact-BXQ0nnLq.cjs +624 -0
  96. package/supabase.cjs +165 -0
  97. package/supabase.d.cts +20 -0
  98. package/supabase.d.mts +20 -0
  99. package/supabase.mjs +164 -0
  100. package/sync-CdA9dgZz.cjs +519 -0
  101. package/sync-Q0O-2kFI.mjs +382 -0
  102. package/{sync-engine-yFLEyId3.mjs → sync-engine-D0mJUeqP.mjs} +1 -1
  103. package/{sync-engine-DNSoZeo0.cjs → sync-engine-hU041kXO.cjs} +1 -1
  104. package/{namespace-probe-CcL6Wj8E.d.cts → types-CzL7lUH9.d.cts} +84 -47
  105. package/types-KMH5D5Lg.mjs +32 -0
  106. package/{types-BBfwsDxe.d.cts → types-f-Vcv-pl.d.cts} +18 -2
  107. package/{types-BBfwsDxe.d.mts → types-f-Vcv-pl.d.mts} +18 -2
  108. package/types-kR1kUlmz.cjs +67 -0
  109. package/{view-compiler-CSHSqZl7.mjs → view-compiler-BhKiezRH.mjs} +1 -1
  110. package/{view-compiler-NqiortOA.cjs → view-compiler-DgZadq1F.cjs} +1 -1
  111. package/vite.d.cts +1 -1
  112. package/vite.d.mts +1 -1
  113. package/drizzle-meta-BPnRLpsB.cjs +0 -8
  114. package/drizzle-meta-D00lFvAk.mjs +0 -3
  115. package/internal-D7qVRIFb.d.cts +0 -228
  116. package/types-8KSw2AWg.mjs +0 -8
  117. package/types-B8m39L1s.cjs +0 -19
package/index.d.cts CHANGED
@@ -1,3 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { m as DiscoveredSchemaTable } from "./entity-config-CXpGowQa.cjs";
3
+ import { i as SqlExecutor } from "./from-sql-S8dSvU-e.cjs";
4
+ import "./index-CIupXz_w.cjs";
1
5
  type Framework = "nextjs" | "tanstack-start" | "sveltekit" | "remix" | "nuxt" | "unknown";
2
6
  type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3
7
  type AppLayout = "app" | "src/app";
@@ -42,6 +46,35 @@ interface DiscoveredSchema {
42
46
  importPath: string;
43
47
  tables: DiscoveredTable[];
44
48
  }
49
+ interface LiveSchemaConnection {
50
+ close(): Promise<void>;
51
+ executor: SqlExecutor;
52
+ }
53
+ interface SupabaseCliResult {
54
+ code: number;
55
+ stdout: string;
56
+ }
57
+ type LiveSchemaFailure = "cli_failed" | "connect_failed" | "driver_missing";
58
+ type RunSupabaseCli = (args: string[]) => Promise<SupabaseCliResult>;
59
+ interface ReadLiveSchemaOptions {
60
+ /** Opens the database. Defaults to the host app's own `postgres` or `pg`. */
61
+ connect?: (url: string) => Promise<LiveSchemaConnection>;
62
+ /** Which variable the string came from, for the failure message only. */
63
+ connectionLabel?: string;
64
+ connectionString?: string;
65
+ /** Why a source failed, so the caller can word its next step. */
66
+ onFailure?: (reason: LiveSchemaFailure) => void;
67
+ out?: (line: string) => void;
68
+ runSupabaseCli?: RunSupabaseCli;
69
+ /**
70
+ * Whether the Supabase CLI may run. Only a linked project does: an absent
71
+ * or unlinked one would make `npx --yes supabase` download tens of MB to
72
+ * fail. Unset keeps the older rule (run whenever `runSupabaseCli` is given).
73
+ */
74
+ supabaseProject?: SupabaseProjectState;
75
+ }
76
+ /** Is this a Supabase app, and has `supabase link` been run in it? */
77
+ type SupabaseProjectState = "absent" | "linked" | "unlinked";
45
78
  interface ProbeHit {
46
79
  /** Config-relative specifier to import it from, e.g. "./lib/db". */
47
80
  importPath: string;
@@ -84,13 +117,16 @@ export interface RunInitOptions {
84
117
  loadWorkspaceGraph?: (cwd: string) => WorkspaceGraph | null;
85
118
  login?: (cwd: string) => Promise<number>;
86
119
  noLogin?: boolean;
120
+ noOrm?: boolean;
87
121
  openBrowser?: boolean;
88
122
  out?: (line: string) => void;
89
123
  probeAuthInstance?: (cwd: string) => Promise<ProbeHit | null>;
124
+ processEnv?: Record<string, string | undefined>;
90
125
  readDeps?: (cwd: string) => Record<string, string>;
91
126
  readEnv?: (cwd: string) => string;
92
127
  readFile?: (path: string) => string | null;
93
128
  readInstalledVersion?: (cwd: string, name: string) => string | null;
129
+ readLiveSchema?: (opts: Pick<ReadLiveSchemaOptions, "connectionLabel" | "connectionString" | "onFailure" | "out" | "supabaseProject">) => Promise<DiscoveredSchemaTable[] | null>;
94
130
  readOwnVersion?: () => string | undefined;
95
131
  resolveAppLayout?: (cwd: string, fileExists: (path: string) => boolean) => AppLayout;
96
132
  resolveSchemaPath?: (cwd: string) => string | null;
package/index.d.mts CHANGED
@@ -1,3 +1,6 @@
1
+ import { m as DiscoveredSchemaTable } from "./entity-config-CXpGowQa.mjs";
2
+ import { i as SqlExecutor } from "./from-sql-CpGP7K3J.mjs";
3
+ import "./index-BoemTWH4.mjs";
1
4
  type Framework = "nextjs" | "tanstack-start" | "sveltekit" | "remix" | "nuxt" | "unknown";
2
5
  type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
3
6
  type AppLayout = "app" | "src/app";
@@ -42,6 +45,35 @@ interface DiscoveredSchema {
42
45
  importPath: string;
43
46
  tables: DiscoveredTable[];
44
47
  }
48
+ interface LiveSchemaConnection {
49
+ close(): Promise<void>;
50
+ executor: SqlExecutor;
51
+ }
52
+ interface SupabaseCliResult {
53
+ code: number;
54
+ stdout: string;
55
+ }
56
+ type LiveSchemaFailure = "cli_failed" | "connect_failed" | "driver_missing";
57
+ type RunSupabaseCli = (args: string[]) => Promise<SupabaseCliResult>;
58
+ interface ReadLiveSchemaOptions {
59
+ /** Opens the database. Defaults to the host app's own `postgres` or `pg`. */
60
+ connect?: (url: string) => Promise<LiveSchemaConnection>;
61
+ /** Which variable the string came from, for the failure message only. */
62
+ connectionLabel?: string;
63
+ connectionString?: string;
64
+ /** Why a source failed, so the caller can word its next step. */
65
+ onFailure?: (reason: LiveSchemaFailure) => void;
66
+ out?: (line: string) => void;
67
+ runSupabaseCli?: RunSupabaseCli;
68
+ /**
69
+ * Whether the Supabase CLI may run. Only a linked project does: an absent
70
+ * or unlinked one would make `npx --yes supabase` download tens of MB to
71
+ * fail. Unset keeps the older rule (run whenever `runSupabaseCli` is given).
72
+ */
73
+ supabaseProject?: SupabaseProjectState;
74
+ }
75
+ /** Is this a Supabase app, and has `supabase link` been run in it? */
76
+ type SupabaseProjectState = "absent" | "linked" | "unlinked";
45
77
  interface ProbeHit {
46
78
  /** Config-relative specifier to import it from, e.g. "./lib/db". */
47
79
  importPath: string;
@@ -84,13 +116,16 @@ export interface RunInitOptions {
84
116
  loadWorkspaceGraph?: (cwd: string) => WorkspaceGraph | null;
85
117
  login?: (cwd: string) => Promise<number>;
86
118
  noLogin?: boolean;
119
+ noOrm?: boolean;
87
120
  openBrowser?: boolean;
88
121
  out?: (line: string) => void;
89
122
  probeAuthInstance?: (cwd: string) => Promise<ProbeHit | null>;
123
+ processEnv?: Record<string, string | undefined>;
90
124
  readDeps?: (cwd: string) => Record<string, string>;
91
125
  readEnv?: (cwd: string) => string;
92
126
  readFile?: (path: string) => string | null;
93
127
  readInstalledVersion?: (cwd: string, name: string) => string | null;
128
+ readLiveSchema?: (opts: Pick<ReadLiveSchemaOptions, "connectionLabel" | "connectionString" | "onFailure" | "out" | "supabaseProject">) => Promise<DiscoveredSchemaTable[] | null>;
94
129
  readOwnVersion?: () => string | undefined;
95
130
  resolveAppLayout?: (cwd: string, fileExists: (path: string) => boolean) => AppLayout;
96
131
  resolveSchemaPath?: (cwd: string) => string | null;