@supacloud/compiler 0.21.1 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/config.d.ts CHANGED
@@ -23,7 +23,7 @@ export interface SupaCloudConfig {
23
23
  commandCapabilities?: CommandExecutionCapabilities;
24
24
  treeShakeUnusedProviders?: boolean;
25
25
  }
26
- export declare const DEFAULT_SUPACLOUD_CONFIG: Required<Omit<SupaCloudConfig, "include" | "moduleBoundaryPreset" | "commandCapabilities" | "moduleBoundaries" | "typeSafety" | "delivery" | "allowRouteCommandBindings" | "disallowControllerDirectDb" | "detectOrphanModules" | "openApi">> & {
26
+ export declare const DEFAULT_SUPACLOUD_CONFIG: Required<Omit<SupaCloudConfig, "include" | "moduleBoundaryPreset" | "moduleBoundaries" | "typeSafety" | "delivery" | "allowRouteCommandBindings" | "disallowControllerDirectDb" | "detectOrphanModules" | "openApi">> & {
27
27
  include: string[];
28
28
  moduleBoundaryPreset: ModuleBoundaryPresetName;
29
29
  };
@@ -0,0 +1,48 @@
1
+ import type { GraphqlOptions } from "./types";
2
+ export interface DatabaseContractsOptions {
3
+ rootDir: string;
4
+ outDir: string;
5
+ /** Generated by the official Supabase/Postgres Meta exporter, not a handwritten table map. */
6
+ postgrestTypes: string;
7
+ /** Source module defining Drizzle tables; imported as types, never executed by this generator. */
8
+ drizzleSchema: string;
9
+ /** Explicit identity/role label for reviewing snapshot provenance. Not an authorization proof. */
10
+ role: string;
11
+ graphql: GraphqlOptions;
12
+ /** Ordered complete migration history. */
13
+ migrations: readonly string[];
14
+ }
15
+ export declare function parseDatabaseContractsOptions(value: unknown, directory: string): DatabaseContractsOptions;
16
+ /** One offline entrypoint; preserves each protocol's native type semantics and generated validators. */
17
+ export declare function generateDatabaseContracts(options: DatabaseContractsOptions, check?: boolean): Promise<{
18
+ upToDate: boolean;
19
+ mismatches: string[];
20
+ written: string[];
21
+ manifest: {
22
+ version: number;
23
+ role: string;
24
+ inputs: {
25
+ [k: string]: string;
26
+ };
27
+ migrationOrder: string[];
28
+ outputs: {
29
+ [k: string]: string;
30
+ };
31
+ };
32
+ }>;
33
+ export declare function runDatabaseContractsFile(path: string, check?: boolean): Promise<{
34
+ upToDate: boolean;
35
+ mismatches: string[];
36
+ written: string[];
37
+ manifest: {
38
+ version: number;
39
+ role: string;
40
+ inputs: {
41
+ [k: string]: string;
42
+ };
43
+ migrationOrder: string[];
44
+ outputs: {
45
+ [k: string]: string;
46
+ };
47
+ };
48
+ }>;
package/dist/index.d.ts CHANGED
@@ -29,6 +29,7 @@ export type { MigrateFileResult, MigrateProjectOptions, MigrateProjectResult, So
29
29
  export { validateGraph, COMPILER_DIAGNOSTIC_CODES } from "./validate";
30
30
  export { scanGeneratedArtifacts, scanProductionSource, TYPE_SAFETY_DIAGNOSTIC_CODES } from "./type-safety";
31
31
  export type { TypeSafetyScanOptions } from "./type-safety";
32
+ export { scanDrizzleSql, SQL_SAFETY_DIAGNOSTIC_CODES } from "./sql-safety";
32
33
  export { DEFAULT_SUPACLOUD_CONFIG, compileOptionsFromConfig, defineSupacloudConfig, loadSupacloudConfig, resolveSupacloudConfig, } from "./config";
33
34
  export type { SupaCloudConfig } from "./config";
34
35
  export { camelName } from "./util";
@@ -37,3 +38,4 @@ export type { ApplicationGraph, AspectRefNode, CachedModuleEntry, CheckProjectRe
37
38
  export { inspectRouteContracts, validateRouteContracts } from "./route-contracts";
38
39
  export { pullGraphqlSchema } from "./graphql-schema";
39
40
  export type { PullGraphqlSchemaOptions } from "./graphql-schema";
41
+ export { generateDatabaseContracts, parseDatabaseContractsOptions, runDatabaseContractsFile, type DatabaseContractsOptions } from "./database-contracts";