@prisma-next/config 0.0.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.
- package/README.md +42 -0
- package/dist/config-types-RUOChRJ2.d.mts +103 -0
- package/dist/config-types-RUOChRJ2.d.mts.map +1 -0
- package/dist/config-types.d.mts +2 -0
- package/dist/config-types.mjs +62 -0
- package/dist/config-types.mjs.map +1 -0
- package/dist/config-validation.d.mts +22 -0
- package/dist/config-validation.d.mts.map +1 -0
- package/dist/config-validation.mjs +95 -0
- package/dist/config-validation.mjs.map +1 -0
- package/dist/types-BRFw7URn.d.mts +197 -0
- package/dist/types-BRFw7URn.d.mts.map +1 -0
- package/dist/types.d.mts +2 -0
- package/dist/types.mjs +1 -0
- package/package.json +47 -0
- package/src/config-types.ts +164 -0
- package/src/config-validation.ts +239 -0
- package/src/contract-source-types.ts +28 -0
- package/src/errors.ts +11 -0
- package/src/exports/config-types.ts +9 -0
- package/src/exports/config-validation.ts +2 -0
- package/src/exports/types.ts +13 -0
- package/src/types.ts +316 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# @prisma-next/config
|
|
2
|
+
|
|
3
|
+
Config authoring types and validation for `prisma-next.config.ts`.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This package owns the shared config contract used by tooling and authoring packages:
|
|
8
|
+
|
|
9
|
+
- `PrismaNextConfig` and `ContractConfig` types
|
|
10
|
+
- contract source provider + diagnostics protocol
|
|
11
|
+
- `defineConfig()` normalization/defaulting
|
|
12
|
+
- `validateConfig()` structural/runtime-shape validation
|
|
13
|
+
|
|
14
|
+
## Responsibilities
|
|
15
|
+
|
|
16
|
+
- Type-safe config composition for `family`, `target`, `adapter`, optional `driver`, and optional `extensionPacks` (`extensions` is rejected at runtime)
|
|
17
|
+
- Contract source provider protocol (`contract.source`) and diagnostics shape
|
|
18
|
+
- Pure config validation and normalization with no file system access
|
|
19
|
+
|
|
20
|
+
## Non-responsibilities
|
|
21
|
+
|
|
22
|
+
- Config file discovery/loading (`c12`, file I/O) - handled by `@prisma-next/cli`
|
|
23
|
+
- CLI error envelope formatting and rendering - handled by CLI/core-control-plane error utilities
|
|
24
|
+
- Control-plane migration operations and runtime actions
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import { defineConfig } from '@prisma-next/config/config-types';
|
|
30
|
+
import { validateConfig } from '@prisma-next/config/config-validation';
|
|
31
|
+
|
|
32
|
+
const config = defineConfig({
|
|
33
|
+
family: sqlFamilyDescriptor,
|
|
34
|
+
target: postgresTargetDescriptor,
|
|
35
|
+
adapter: postgresAdapterDescriptor,
|
|
36
|
+
contract: {
|
|
37
|
+
source: async () => /* Result<ContractIR, ContractSourceDiagnostics> */ null as never,
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
validateConfig(config);
|
|
42
|
+
```
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { a as ControlExtensionDescriptor, i as ControlDriverInstance, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-BRFw7URn.mjs";
|
|
2
|
+
import { ContractIR } from "@prisma-next/contract/ir";
|
|
3
|
+
import { Result } from "@prisma-next/utils/result";
|
|
4
|
+
|
|
5
|
+
//#region src/contract-source-types.d.ts
|
|
6
|
+
interface ContractSourceDiagnosticPosition {
|
|
7
|
+
readonly offset: number;
|
|
8
|
+
readonly line: number;
|
|
9
|
+
readonly column: number;
|
|
10
|
+
}
|
|
11
|
+
interface ContractSourceDiagnosticSpan {
|
|
12
|
+
readonly start: ContractSourceDiagnosticPosition;
|
|
13
|
+
readonly end: ContractSourceDiagnosticPosition;
|
|
14
|
+
}
|
|
15
|
+
interface ContractSourceDiagnostic {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
readonly message: string;
|
|
18
|
+
readonly sourceId?: string;
|
|
19
|
+
readonly span?: ContractSourceDiagnosticSpan;
|
|
20
|
+
}
|
|
21
|
+
interface ContractSourceDiagnostics {
|
|
22
|
+
readonly summary: string;
|
|
23
|
+
readonly diagnostics: readonly ContractSourceDiagnostic[];
|
|
24
|
+
readonly meta?: Record<string, unknown>;
|
|
25
|
+
}
|
|
26
|
+
type ContractSourceProvider = () => Promise<Result<ContractIR, ContractSourceDiagnostics>>;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/config-types.d.ts
|
|
29
|
+
/**
|
|
30
|
+
* Contract configuration specifying source and artifact locations.
|
|
31
|
+
*/
|
|
32
|
+
interface ContractConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Contract source provider. The provider is always async and must return
|
|
35
|
+
* a Result containing either ContractIR or structured diagnostics.
|
|
36
|
+
*/
|
|
37
|
+
readonly source: ContractSourceProvider;
|
|
38
|
+
/**
|
|
39
|
+
* Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.
|
|
40
|
+
* The .d.ts types file will be colocated (e.g., contract.json -> contract.d.ts).
|
|
41
|
+
*/
|
|
42
|
+
readonly output?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Configuration for Prisma Next CLI.
|
|
46
|
+
* Uses Control*Descriptor types for type-safe wiring with compile-time compatibility checks.
|
|
47
|
+
*
|
|
48
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
49
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
50
|
+
* @template TConnection - The driver connection input type (defaults to `unknown` for config flexibility)
|
|
51
|
+
*/
|
|
52
|
+
interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends string = string, TConnection = unknown> {
|
|
53
|
+
readonly family: ControlFamilyDescriptor<TFamilyId>;
|
|
54
|
+
readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
|
|
55
|
+
readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
|
|
56
|
+
readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];
|
|
57
|
+
/**
|
|
58
|
+
* Driver descriptor for DB-connected CLI commands.
|
|
59
|
+
* Required for DB-connected commands (e.g., db verify).
|
|
60
|
+
* Optional for commands that don't need database access (e.g., emit).
|
|
61
|
+
* The driver's connection type matches the TConnection config parameter.
|
|
62
|
+
*/
|
|
63
|
+
readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId, ControlDriverInstance<TFamilyId, TTargetId>, TConnection>;
|
|
64
|
+
/**
|
|
65
|
+
* Database connection configuration.
|
|
66
|
+
* The connection type is driver-specific (e.g., URL string for Postgres).
|
|
67
|
+
*/
|
|
68
|
+
readonly db?: {
|
|
69
|
+
/**
|
|
70
|
+
* Driver-specific connection input.
|
|
71
|
+
* For Postgres: a connection string (URL).
|
|
72
|
+
* For other drivers: may be a structured object.
|
|
73
|
+
*/
|
|
74
|
+
readonly connection?: TConnection;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Contract configuration. Specifies source and artifact locations.
|
|
78
|
+
* Required for emit command; optional for other commands that only read artifacts.
|
|
79
|
+
*/
|
|
80
|
+
readonly contract?: ContractConfig;
|
|
81
|
+
/**
|
|
82
|
+
* Migration configuration. Controls where on-disk migration packages are stored.
|
|
83
|
+
*/
|
|
84
|
+
readonly migrations?: {
|
|
85
|
+
/** Directory for migration packages, relative to config file. Defaults to 'migrations'. */
|
|
86
|
+
readonly dir?: string;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Helper function to define a Prisma Next config.
|
|
91
|
+
* Validates and normalizes the config using Arktype, then returns the normalized IR.
|
|
92
|
+
*
|
|
93
|
+
* Normalization:
|
|
94
|
+
* - contract.output defaults to 'src/prisma/contract.json' if missing
|
|
95
|
+
*
|
|
96
|
+
* @param config - Raw config input from user
|
|
97
|
+
* @returns Normalized config IR with defaults applied
|
|
98
|
+
* @throws Error if config structure is invalid
|
|
99
|
+
*/
|
|
100
|
+
declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
|
|
101
|
+
//#endregion
|
|
102
|
+
export { ContractSourceDiagnosticPosition as a, ContractSourceProvider as c, ContractSourceDiagnostic as i, PrismaNextConfig as n, ContractSourceDiagnosticSpan as o, defineConfig as r, ContractSourceDiagnostics as s, ContractConfig as t };
|
|
103
|
+
//# sourceMappingURL=config-types-RUOChRJ2.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types-RUOChRJ2.d.mts","names":[],"sources":["../src/contract-source-types.ts","../src/config-types.ts"],"sourcesContent":[],"mappings":";;;;;UAGiB,gCAAA;;;EAAA,SAAA,MAAA,EAAA,MAAA;AAMjB;AAKiB,UALA,4BAAA,CASC;EAGD,SAAA,KAAA,EAXC,gCAae;EAIrB,SAAA,GAAA,EAhBI,gCAgBkB;;AAAoC,UAbrD,wBAAA,CAaqD;EAAnB,SAAA,IAAA,EAAA,MAAA;EAAR,SAAA,OAAA,EAAA,MAAA;EAAO,SAAA,QAAA,CAAA,EAAA,MAAA;kBAThC;;UAGD,yBAAA;ECDA,SAAA,OAAA,EAAc,MAAA;EAqBd,SAAA,WAAgB,EAAA,SDlBA,wBCkBA,EAAA;EAKU,SAAA,IAAA,CAAA,EDtBzB,MCsByB,CAAA,MAAA,EAAA,OAAA,CAAA;;AACA,KDpB/B,sBAAA,GCoB+B,GAAA,GDpBA,OCoBA,CDpBQ,MCoBR,CDpBe,UCoBf,EDpB2B,yBCoB3B,CAAA,CAAA;;;ADjC3C;AAOA;AAMA;AAA0D,UCPzC,cAAA,CDOyC;EAAY;;;;mBCFnD;;;AALnB;AAqBA;EAK2C,SAAA,MAAA,CAAA,EAAA,MAAA;;;;;;;;;;AAGN,UARpB,gBAQoB,CAAA,kBAAA,MAAA,GAAA,MAAA,EAAA,kBAAA,MAAA,GAAA,MAAA,EAAA,cAAA,OAAA,CAAA,CAAA;EAQjC,SAAA,MAAA,EAXe,uBAWf,CAXuC,SAWvC,CAAA;EACA,SAAA,MAAA,EAXe,uBAWf,CAXuC,SAWvC,EAXkD,SAWlD,CAAA;EACsB,SAAA,OAAA,EAXN,wBAWM,CAXmB,SAWnB,EAX8B,SAW9B,CAAA;EAAW,SAAA,cAAA,CAAA,EAAA,SAVA,0BAUA,CAV2B,SAU3B,EAVsC,SAUtC,CAAA,EAAA;EAAjC;;;;;;EAqEY,SAAA,MAAY,CAAA,EAxER,uBAwEQ,CAvExB,SAuEwB,EAtExB,SAsEwB,EArExB,qBAqEwB,CArEF,SAqEE,EArES,SAqET,CAAA,EApExB,WAoEwB,CAAA;EACD;;;;EACI,SAAA,EAAA,CAAA,EAAA;IAA5B;;;;;0BA1DuB;;;;;;sBAMJ;;;;;;;;;;;;;;;;;;;;iBAkDN,2FACN,iBAAiB,WAAW,aACnC,iBAAiB,WAAW"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ContractSourceDiagnosticPosition, c as ContractSourceProvider, i as ContractSourceDiagnostic, n as PrismaNextConfig, o as ContractSourceDiagnosticSpan, r as defineConfig, s as ContractSourceDiagnostics, t as ContractConfig } from "./config-types-RUOChRJ2.mjs";
|
|
2
|
+
export { type ContractConfig, type ContractSourceDiagnostic, type ContractSourceDiagnosticPosition, type ContractSourceDiagnosticSpan, type ContractSourceDiagnostics, type ContractSourceProvider, type PrismaNextConfig, defineConfig };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { type } from "arktype";
|
|
2
|
+
|
|
3
|
+
//#region src/config-types.ts
|
|
4
|
+
/**
|
|
5
|
+
* Arktype schema for ContractConfig validation.
|
|
6
|
+
* Validates presence/shape only.
|
|
7
|
+
* contract.source is validated as a provider function at runtime in defineConfig().
|
|
8
|
+
*/
|
|
9
|
+
const ContractConfigSchema = type({
|
|
10
|
+
source: "unknown",
|
|
11
|
+
"output?": "string"
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Arktype schema for PrismaNextConfig validation.
|
|
15
|
+
* Note: This validates structure only. Descriptor objects (family, target, adapter) are validated separately.
|
|
16
|
+
*/
|
|
17
|
+
const MigrationsConfigSchema = type({ "dir?": "string" });
|
|
18
|
+
const PrismaNextConfigSchema = type({
|
|
19
|
+
family: "unknown",
|
|
20
|
+
target: "unknown",
|
|
21
|
+
adapter: "unknown",
|
|
22
|
+
"extensionPacks?": "unknown[]",
|
|
23
|
+
"driver?": "unknown",
|
|
24
|
+
"db?": "unknown",
|
|
25
|
+
"contract?": ContractConfigSchema,
|
|
26
|
+
"migrations?": MigrationsConfigSchema
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Helper function to define a Prisma Next config.
|
|
30
|
+
* Validates and normalizes the config using Arktype, then returns the normalized IR.
|
|
31
|
+
*
|
|
32
|
+
* Normalization:
|
|
33
|
+
* - contract.output defaults to 'src/prisma/contract.json' if missing
|
|
34
|
+
*
|
|
35
|
+
* @param config - Raw config input from user
|
|
36
|
+
* @returns Normalized config IR with defaults applied
|
|
37
|
+
* @throws Error if config structure is invalid
|
|
38
|
+
*/
|
|
39
|
+
function defineConfig(config) {
|
|
40
|
+
const validated = PrismaNextConfigSchema(config);
|
|
41
|
+
if (validated instanceof type.errors) {
|
|
42
|
+
const messages = validated.map((p) => p.message).join("; ");
|
|
43
|
+
throw new Error(`Config validation failed: ${messages}`);
|
|
44
|
+
}
|
|
45
|
+
if (config.contract) {
|
|
46
|
+
if (typeof config.contract.source !== "function") throw new Error("Config.contract.source must be a provider function");
|
|
47
|
+
const output = config.contract.output ?? "src/prisma/contract.json";
|
|
48
|
+
const normalizedContract = {
|
|
49
|
+
source: config.contract.source,
|
|
50
|
+
output
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
...config,
|
|
54
|
+
contract: normalizedContract
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return config;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
//#endregion
|
|
61
|
+
export { defineConfig };
|
|
62
|
+
//# sourceMappingURL=config-types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types.mjs","names":["normalizedContract: ContractConfig"],"sources":["../src/config-types.ts"],"sourcesContent":["import { type } from 'arktype';\nimport type { ContractSourceProvider } from './contract-source-types';\nimport type {\n ControlAdapterDescriptor,\n ControlDriverDescriptor,\n ControlDriverInstance,\n ControlExtensionDescriptor,\n ControlFamilyDescriptor,\n ControlTargetDescriptor,\n} from './types';\n\n/**\n * Type alias for CLI driver instances.\n * Uses string for both family and target IDs for maximum flexibility.\n */\nexport type CliDriver = ControlDriverInstance<string, string>;\n\n/**\n * Contract configuration specifying source and artifact locations.\n */\nexport interface ContractConfig {\n /**\n * Contract source provider. The provider is always async and must return\n * a Result containing either ContractIR or structured diagnostics.\n */\n readonly source: ContractSourceProvider;\n /**\n * Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.\n * The .d.ts types file will be colocated (e.g., contract.json -> contract.d.ts).\n */\n readonly output?: string;\n}\n\n/**\n * Configuration for Prisma Next CLI.\n * Uses Control*Descriptor types for type-safe wiring with compile-time compatibility checks.\n *\n * @template TFamilyId - The family ID (e.g., 'sql', 'document')\n * @template TTargetId - The target ID (e.g., 'postgres', 'mysql')\n * @template TConnection - The driver connection input type (defaults to `unknown` for config flexibility)\n */\nexport interface PrismaNextConfig<\n TFamilyId extends string = string,\n TTargetId extends string = string,\n TConnection = unknown,\n> {\n readonly family: ControlFamilyDescriptor<TFamilyId>;\n readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;\n readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;\n readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];\n /**\n * Driver descriptor for DB-connected CLI commands.\n * Required for DB-connected commands (e.g., db verify).\n * Optional for commands that don't need database access (e.g., emit).\n * The driver's connection type matches the TConnection config parameter.\n */\n readonly driver?: ControlDriverDescriptor<\n TFamilyId,\n TTargetId,\n ControlDriverInstance<TFamilyId, TTargetId>,\n TConnection\n >;\n /**\n * Database connection configuration.\n * The connection type is driver-specific (e.g., URL string for Postgres).\n */\n readonly db?: {\n /**\n * Driver-specific connection input.\n * For Postgres: a connection string (URL).\n * For other drivers: may be a structured object.\n */\n readonly connection?: TConnection;\n };\n /**\n * Contract configuration. Specifies source and artifact locations.\n * Required for emit command; optional for other commands that only read artifacts.\n */\n readonly contract?: ContractConfig;\n /**\n * Migration configuration. Controls where on-disk migration packages are stored.\n */\n readonly migrations?: {\n /** Directory for migration packages, relative to config file. Defaults to 'migrations'. */\n readonly dir?: string;\n };\n}\n\n/**\n * Arktype schema for ContractConfig validation.\n * Validates presence/shape only.\n * contract.source is validated as a provider function at runtime in defineConfig().\n */\nconst ContractConfigSchema = type({\n source: 'unknown', // Runtime check enforces provider function shape\n 'output?': 'string',\n});\n\n/**\n * Arktype schema for PrismaNextConfig validation.\n * Note: This validates structure only. Descriptor objects (family, target, adapter) are validated separately.\n */\nconst MigrationsConfigSchema = type({\n 'dir?': 'string',\n});\n\nconst PrismaNextConfigSchema = type({\n family: 'unknown', // ControlFamilyDescriptor - validated separately\n target: 'unknown', // ControlTargetDescriptor - validated separately\n adapter: 'unknown', // ControlAdapterDescriptor - validated separately\n 'extensionPacks?': 'unknown[]',\n 'driver?': 'unknown', // ControlDriverDescriptor - validated separately (optional)\n 'db?': 'unknown',\n 'contract?': ContractConfigSchema,\n 'migrations?': MigrationsConfigSchema,\n});\n\n/**\n * Helper function to define a Prisma Next config.\n * Validates and normalizes the config using Arktype, then returns the normalized IR.\n *\n * Normalization:\n * - contract.output defaults to 'src/prisma/contract.json' if missing\n *\n * @param config - Raw config input from user\n * @returns Normalized config IR with defaults applied\n * @throws Error if config structure is invalid\n */\nexport function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(\n config: PrismaNextConfig<TFamilyId, TTargetId>,\n): PrismaNextConfig<TFamilyId, TTargetId> {\n // Validate structure using Arktype\n const validated = PrismaNextConfigSchema(config);\n if (validated instanceof type.errors) {\n const messages = validated.map((p: { message: string }) => p.message).join('; ');\n throw new Error(`Config validation failed: ${messages}`);\n }\n\n // Normalize contract config if present\n if (config.contract) {\n // Validate contract.source provider function shape at runtime.\n const source = config.contract.source;\n if (typeof source !== 'function') {\n throw new Error('Config.contract.source must be a provider function');\n }\n\n // Apply defaults\n const output = config.contract.output ?? 'src/prisma/contract.json';\n\n const normalizedContract: ContractConfig = {\n source: config.contract.source,\n output,\n };\n\n // Return normalized config\n return {\n ...config,\n contract: normalizedContract,\n };\n }\n\n // Return config as-is if no contract (preserve literal types)\n return config;\n}\n"],"mappings":";;;;;;;;AA6FA,MAAM,uBAAuB,KAAK;CAChC,QAAQ;CACR,WAAW;CACZ,CAAC;;;;;AAMF,MAAM,yBAAyB,KAAK,EAClC,QAAQ,UACT,CAAC;AAEF,MAAM,yBAAyB,KAAK;CAClC,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,mBAAmB;CACnB,WAAW;CACX,OAAO;CACP,aAAa;CACb,eAAe;CAChB,CAAC;;;;;;;;;;;;AAaF,SAAgB,aACd,QACwC;CAExC,MAAM,YAAY,uBAAuB,OAAO;AAChD,KAAI,qBAAqB,KAAK,QAAQ;EACpC,MAAM,WAAW,UAAU,KAAK,MAA2B,EAAE,QAAQ,CAAC,KAAK,KAAK;AAChF,QAAM,IAAI,MAAM,6BAA6B,WAAW;;AAI1D,KAAI,OAAO,UAAU;AAGnB,MAAI,OADW,OAAO,SAAS,WACT,WACpB,OAAM,IAAI,MAAM,qDAAqD;EAIvE,MAAM,SAAS,OAAO,SAAS,UAAU;EAEzC,MAAMA,qBAAqC;GACzC,QAAQ,OAAO,SAAS;GACxB;GACD;AAGD,SAAO;GACL,GAAG;GACH,UAAU;GACX;;AAIH,QAAO"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { n as PrismaNextConfig } from "./config-types-RUOChRJ2.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/config-validation.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validates that the config has the required structure.
|
|
7
|
+
* This is pure validation logic with no file I/O or CLI awareness.
|
|
8
|
+
*
|
|
9
|
+
* @param config - Config object to validate
|
|
10
|
+
* @throws ConfigValidationError if config structure is invalid
|
|
11
|
+
*/
|
|
12
|
+
declare function validateConfig(config: unknown): asserts config is PrismaNextConfig;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/errors.d.ts
|
|
15
|
+
declare class ConfigValidationError extends Error {
|
|
16
|
+
readonly field: string;
|
|
17
|
+
readonly why: string;
|
|
18
|
+
constructor(field: string, why?: string);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ConfigValidationError, validateConfig };
|
|
22
|
+
//# sourceMappingURL=config-validation.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validation.d.mts","names":[],"sources":["../src/config-validation.ts","../src/errors.ts"],"sourcesContent":[],"mappings":";;;;;;AAcA;;;;ACdA;iBDcgB,cAAA,qCAAmD;;;cCdtD,qBAAA,SAA8B,KAAA;;;EDc3B,WAAA,CAAA,KAAc,EAAA,MAAA,EAAA,GAAqC,CAAA,EAAA,MAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
//#region src/errors.ts
|
|
2
|
+
var ConfigValidationError = class extends Error {
|
|
3
|
+
field;
|
|
4
|
+
why;
|
|
5
|
+
constructor(field, why) {
|
|
6
|
+
super(why ?? `Config must have a "${field}" field`);
|
|
7
|
+
this.name = "ConfigValidationError";
|
|
8
|
+
this.field = field;
|
|
9
|
+
this.why = why ?? `Config must have a "${field}" field`;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/config-validation.ts
|
|
15
|
+
function throwValidation(field, why) {
|
|
16
|
+
throw new ConfigValidationError(field, why);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Validates that the config has the required structure.
|
|
20
|
+
* This is pure validation logic with no file I/O or CLI awareness.
|
|
21
|
+
*
|
|
22
|
+
* @param config - Config object to validate
|
|
23
|
+
* @throws ConfigValidationError if config structure is invalid
|
|
24
|
+
*/
|
|
25
|
+
function validateConfig(config) {
|
|
26
|
+
if (!config || typeof config !== "object") throwValidation("object", "Config must be an object");
|
|
27
|
+
const configObj = config;
|
|
28
|
+
if (!configObj["family"]) throwValidation("family");
|
|
29
|
+
if (!configObj["target"]) throwValidation("target");
|
|
30
|
+
if (!configObj["adapter"]) throwValidation("adapter");
|
|
31
|
+
const family = configObj["family"];
|
|
32
|
+
if (family["kind"] !== "family") throwValidation("family.kind", "Config.family must have kind: \"family\"");
|
|
33
|
+
if (typeof family["id"] !== "string") throwValidation("family.id", "Config.family must have id: string");
|
|
34
|
+
if (typeof family["familyId"] !== "string") throwValidation("family.familyId", "Config.family must have familyId: string");
|
|
35
|
+
if (typeof family["version"] !== "string") throwValidation("family.version", "Config.family must have version: string");
|
|
36
|
+
if (!family["hook"] || typeof family["hook"] !== "object") throwValidation("family.hook", "Config.family must have hook: TargetFamilyHook");
|
|
37
|
+
if (typeof family["create"] !== "function") throwValidation("family.create", "Config.family must have create: function");
|
|
38
|
+
const familyId = family["familyId"];
|
|
39
|
+
const target = configObj["target"];
|
|
40
|
+
if (target["kind"] !== "target") throwValidation("target.kind", "Config.target must have kind: \"target\"");
|
|
41
|
+
if (typeof target["id"] !== "string") throwValidation("target.id", "Config.target must have id: string");
|
|
42
|
+
if (typeof target["familyId"] !== "string") throwValidation("target.familyId", "Config.target must have familyId: string");
|
|
43
|
+
if (typeof target["version"] !== "string") throwValidation("target.version", "Config.target must have version: string");
|
|
44
|
+
if (target["familyId"] !== familyId) throwValidation("target.familyId", `Config.target.familyId must match Config.family.familyId (expected: ${familyId}, got: ${target["familyId"]})`);
|
|
45
|
+
if (typeof target["targetId"] !== "string") throwValidation("target.targetId", "Config.target must have targetId: string");
|
|
46
|
+
if (typeof target["create"] !== "function") throwValidation("target.create", "Config.target must have create: function");
|
|
47
|
+
const expectedTargetId = target["targetId"];
|
|
48
|
+
const adapter = configObj["adapter"];
|
|
49
|
+
if (adapter["kind"] !== "adapter") throwValidation("adapter.kind", "Config.adapter must have kind: \"adapter\"");
|
|
50
|
+
if (typeof adapter["id"] !== "string") throwValidation("adapter.id", "Config.adapter must have id: string");
|
|
51
|
+
if (typeof adapter["familyId"] !== "string") throwValidation("adapter.familyId", "Config.adapter must have familyId: string");
|
|
52
|
+
if (typeof adapter["version"] !== "string") throwValidation("adapter.version", "Config.adapter must have version: string");
|
|
53
|
+
if (adapter["familyId"] !== familyId) throwValidation("adapter.familyId", `Config.adapter.familyId must match Config.family.familyId (expected: ${familyId}, got: ${adapter["familyId"]})`);
|
|
54
|
+
if (typeof adapter["targetId"] !== "string") throwValidation("adapter.targetId", "Config.adapter must have targetId: string");
|
|
55
|
+
if (adapter["targetId"] !== expectedTargetId) throwValidation("adapter.targetId", `Config.adapter.targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${adapter["targetId"]})`);
|
|
56
|
+
if (typeof adapter["create"] !== "function") throwValidation("adapter.create", "Config.adapter must have create: function");
|
|
57
|
+
if (configObj["extensions"] !== void 0) throwValidation("extensions", "Config.extensions is not supported; use Config.extensionPacks");
|
|
58
|
+
if (configObj["extensionPacks"] !== void 0) {
|
|
59
|
+
if (!Array.isArray(configObj["extensionPacks"])) throwValidation("extensionPacks", "Config.extensionPacks must be an array");
|
|
60
|
+
for (const ext of configObj["extensionPacks"]) {
|
|
61
|
+
if (!ext || typeof ext !== "object") throwValidation("extensionPacks[]", "Config.extensionPacks must contain ControlExtensionDescriptor objects");
|
|
62
|
+
const extObj = ext;
|
|
63
|
+
if (extObj["kind"] !== "extension") throwValidation("extensionPacks[].kind", "Config.extensionPacks items must have kind: \"extension\"");
|
|
64
|
+
if (typeof extObj["id"] !== "string") throwValidation("extensionPacks[].id", "Config.extensionPacks items must have id: string");
|
|
65
|
+
if (typeof extObj["familyId"] !== "string") throwValidation("extensionPacks[].familyId", "Config.extensionPacks items must have familyId: string");
|
|
66
|
+
if (typeof extObj["version"] !== "string") throwValidation("extensionPacks[].version", "Config.extensionPacks items must have version: string");
|
|
67
|
+
if (extObj["familyId"] !== familyId) throwValidation("extensionPacks[].familyId", `Config.extensionPacks[].familyId must match Config.family.familyId (expected: ${familyId}, got: ${extObj["familyId"]})`);
|
|
68
|
+
if (typeof extObj["targetId"] !== "string") throwValidation("extensionPacks[].targetId", "Config.extensionPacks items must have targetId: string");
|
|
69
|
+
if (extObj["targetId"] !== expectedTargetId) throwValidation("extensionPacks[].targetId", `Config.extensionPacks[].targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${extObj["targetId"]})`);
|
|
70
|
+
if (typeof extObj["create"] !== "function") throwValidation("extensionPacks[].create", "Config.extensionPacks items must have create: function");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (configObj["driver"] !== void 0) {
|
|
74
|
+
const driver = configObj["driver"];
|
|
75
|
+
if (driver["kind"] !== "driver") throwValidation("driver.kind", "Config.driver must have kind: \"driver\"");
|
|
76
|
+
if (typeof driver["id"] !== "string") throwValidation("driver.id", "Config.driver must have id: string");
|
|
77
|
+
if (typeof driver["version"] !== "string") throwValidation("driver.version", "Config.driver must have version: string");
|
|
78
|
+
if (typeof driver["familyId"] !== "string") throwValidation("driver.familyId", "Config.driver must have familyId: string");
|
|
79
|
+
if (driver["familyId"] !== familyId) throwValidation("driver.familyId", `Config.driver.familyId must match Config.family.familyId (expected: ${familyId}, got: ${driver["familyId"]})`);
|
|
80
|
+
if (typeof driver["targetId"] !== "string") throwValidation("driver.targetId", "Config.driver must have targetId: string");
|
|
81
|
+
if (driver["targetId"] !== expectedTargetId) throwValidation("driver.targetId", `Config.driver.targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${driver["targetId"]})`);
|
|
82
|
+
if (typeof driver["create"] !== "function") throwValidation("driver.create", "Config.driver must have create: function");
|
|
83
|
+
}
|
|
84
|
+
if (configObj["contract"] !== void 0) {
|
|
85
|
+
const contract = configObj["contract"];
|
|
86
|
+
if (!contract || typeof contract !== "object") throwValidation("contract", "Config.contract must be an object");
|
|
87
|
+
if (!Object.hasOwn(contract, "source")) throwValidation("contract.source", "Config.contract.source is required when contract is provided");
|
|
88
|
+
if (typeof contract["source"] !== "function") throwValidation("contract.source", "Config.contract.source must be a provider function");
|
|
89
|
+
if (contract["output"] !== void 0 && typeof contract["output"] !== "string") throwValidation("contract.output", "Config.contract.output must be a string when provided");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
//#endregion
|
|
94
|
+
export { ConfigValidationError, validateConfig };
|
|
95
|
+
//# sourceMappingURL=config-validation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validation.mjs","names":[],"sources":["../src/errors.ts","../src/config-validation.ts"],"sourcesContent":["export class ConfigValidationError extends Error {\n readonly field: string;\n readonly why: string;\n\n constructor(field: string, why?: string) {\n super(why ?? `Config must have a \"${field}\" field`);\n this.name = 'ConfigValidationError';\n this.field = field;\n this.why = why ?? `Config must have a \"${field}\" field`;\n }\n}\n","import type { PrismaNextConfig } from './config-types';\nimport { ConfigValidationError } from './errors';\n\nfunction throwValidation(field: string, why?: string): never {\n throw new ConfigValidationError(field, why);\n}\n\n/**\n * Validates that the config has the required structure.\n * This is pure validation logic with no file I/O or CLI awareness.\n *\n * @param config - Config object to validate\n * @throws ConfigValidationError if config structure is invalid\n */\nexport function validateConfig(config: unknown): asserts config is PrismaNextConfig {\n if (!config || typeof config !== 'object') {\n throwValidation('object', 'Config must be an object');\n }\n\n const configObj = config as Record<string, unknown>;\n\n if (!configObj['family']) {\n throwValidation('family');\n }\n\n if (!configObj['target']) {\n throwValidation('target');\n }\n\n if (!configObj['adapter']) {\n throwValidation('adapter');\n }\n\n // Validate family descriptor\n const family = configObj['family'] as Record<string, unknown>;\n if (family['kind'] !== 'family') {\n throwValidation('family.kind', 'Config.family must have kind: \"family\"');\n }\n if (typeof family['id'] !== 'string') {\n throwValidation('family.id', 'Config.family must have id: string');\n }\n if (typeof family['familyId'] !== 'string') {\n throwValidation('family.familyId', 'Config.family must have familyId: string');\n }\n if (typeof family['version'] !== 'string') {\n throwValidation('family.version', 'Config.family must have version: string');\n }\n if (!family['hook'] || typeof family['hook'] !== 'object') {\n throwValidation('family.hook', 'Config.family must have hook: TargetFamilyHook');\n }\n if (typeof family['create'] !== 'function') {\n throwValidation('family.create', 'Config.family must have create: function');\n }\n\n const familyId = family['familyId'] as string;\n\n // Validate target descriptor\n const target = configObj['target'] as Record<string, unknown>;\n if (target['kind'] !== 'target') {\n throwValidation('target.kind', 'Config.target must have kind: \"target\"');\n }\n if (typeof target['id'] !== 'string') {\n throwValidation('target.id', 'Config.target must have id: string');\n }\n if (typeof target['familyId'] !== 'string') {\n throwValidation('target.familyId', 'Config.target must have familyId: string');\n }\n if (typeof target['version'] !== 'string') {\n throwValidation('target.version', 'Config.target must have version: string');\n }\n if (target['familyId'] !== familyId) {\n throwValidation(\n 'target.familyId',\n `Config.target.familyId must match Config.family.familyId (expected: ${familyId}, got: ${target['familyId']})`,\n );\n }\n if (typeof target['targetId'] !== 'string') {\n throwValidation('target.targetId', 'Config.target must have targetId: string');\n }\n if (typeof target['create'] !== 'function') {\n throwValidation('target.create', 'Config.target must have create: function');\n }\n const expectedTargetId = target['targetId'] as string;\n\n // Validate adapter descriptor\n const adapter = configObj['adapter'] as Record<string, unknown>;\n if (adapter['kind'] !== 'adapter') {\n throwValidation('adapter.kind', 'Config.adapter must have kind: \"adapter\"');\n }\n if (typeof adapter['id'] !== 'string') {\n throwValidation('adapter.id', 'Config.adapter must have id: string');\n }\n if (typeof adapter['familyId'] !== 'string') {\n throwValidation('adapter.familyId', 'Config.adapter must have familyId: string');\n }\n if (typeof adapter['version'] !== 'string') {\n throwValidation('adapter.version', 'Config.adapter must have version: string');\n }\n if (adapter['familyId'] !== familyId) {\n throwValidation(\n 'adapter.familyId',\n `Config.adapter.familyId must match Config.family.familyId (expected: ${familyId}, got: ${adapter['familyId']})`,\n );\n }\n if (typeof adapter['targetId'] !== 'string') {\n throwValidation('adapter.targetId', 'Config.adapter must have targetId: string');\n }\n if (adapter['targetId'] !== expectedTargetId) {\n throwValidation(\n 'adapter.targetId',\n `Config.adapter.targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${adapter['targetId']})`,\n );\n }\n if (typeof adapter['create'] !== 'function') {\n throwValidation('adapter.create', 'Config.adapter must have create: function');\n }\n\n if (configObj['extensions'] !== undefined) {\n throwValidation('extensions', 'Config.extensions is not supported; use Config.extensionPacks');\n }\n\n // Validate extensionPacks array if present\n if (configObj['extensionPacks'] !== undefined) {\n if (!Array.isArray(configObj['extensionPacks'])) {\n throwValidation('extensionPacks', 'Config.extensionPacks must be an array');\n }\n for (const ext of configObj['extensionPacks']) {\n if (!ext || typeof ext !== 'object') {\n throwValidation(\n 'extensionPacks[]',\n 'Config.extensionPacks must contain ControlExtensionDescriptor objects',\n );\n }\n const extObj = ext as Record<string, unknown>;\n if (extObj['kind'] !== 'extension') {\n throwValidation(\n 'extensionPacks[].kind',\n 'Config.extensionPacks items must have kind: \"extension\"',\n );\n }\n if (typeof extObj['id'] !== 'string') {\n throwValidation('extensionPacks[].id', 'Config.extensionPacks items must have id: string');\n }\n if (typeof extObj['familyId'] !== 'string') {\n throwValidation(\n 'extensionPacks[].familyId',\n 'Config.extensionPacks items must have familyId: string',\n );\n }\n if (typeof extObj['version'] !== 'string') {\n throwValidation(\n 'extensionPacks[].version',\n 'Config.extensionPacks items must have version: string',\n );\n }\n if (extObj['familyId'] !== familyId) {\n throwValidation(\n 'extensionPacks[].familyId',\n `Config.extensionPacks[].familyId must match Config.family.familyId (expected: ${familyId}, got: ${extObj['familyId']})`,\n );\n }\n if (typeof extObj['targetId'] !== 'string') {\n throwValidation(\n 'extensionPacks[].targetId',\n 'Config.extensionPacks items must have targetId: string',\n );\n }\n if (extObj['targetId'] !== expectedTargetId) {\n throwValidation(\n 'extensionPacks[].targetId',\n `Config.extensionPacks[].targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${extObj['targetId']})`,\n );\n }\n if (typeof extObj['create'] !== 'function') {\n throwValidation(\n 'extensionPacks[].create',\n 'Config.extensionPacks items must have create: function',\n );\n }\n }\n }\n\n // Validate driver descriptor if present\n if (configObj['driver'] !== undefined) {\n const driver = configObj['driver'] as Record<string, unknown>;\n if (driver['kind'] !== 'driver') {\n throwValidation('driver.kind', 'Config.driver must have kind: \"driver\"');\n }\n if (typeof driver['id'] !== 'string') {\n throwValidation('driver.id', 'Config.driver must have id: string');\n }\n if (typeof driver['version'] !== 'string') {\n throwValidation('driver.version', 'Config.driver must have version: string');\n }\n if (typeof driver['familyId'] !== 'string') {\n throwValidation('driver.familyId', 'Config.driver must have familyId: string');\n }\n if (driver['familyId'] !== familyId) {\n throwValidation(\n 'driver.familyId',\n `Config.driver.familyId must match Config.family.familyId (expected: ${familyId}, got: ${driver['familyId']})`,\n );\n }\n if (typeof driver['targetId'] !== 'string') {\n throwValidation('driver.targetId', 'Config.driver must have targetId: string');\n }\n if (driver['targetId'] !== expectedTargetId) {\n throwValidation(\n 'driver.targetId',\n `Config.driver.targetId must match Config.target.targetId (expected: ${expectedTargetId}, got: ${driver['targetId']})`,\n );\n }\n if (typeof driver['create'] !== 'function') {\n throwValidation('driver.create', 'Config.driver must have create: function');\n }\n }\n\n // Validate contract config if present (structure validation - defineConfig() handles normalization)\n if (configObj['contract'] !== undefined) {\n const contract = configObj['contract'] as Record<string, unknown>;\n if (!contract || typeof contract !== 'object') {\n throwValidation('contract', 'Config.contract must be an object');\n }\n if (!Object.hasOwn(contract, 'source')) {\n throwValidation(\n 'contract.source',\n 'Config.contract.source is required when contract is provided',\n );\n }\n\n if (typeof contract['source'] !== 'function') {\n throwValidation('contract.source', 'Config.contract.source must be a provider function');\n }\n\n if (contract['output'] !== undefined && typeof contract['output'] !== 'string') {\n throwValidation('contract.output', 'Config.contract.output must be a string when provided');\n }\n }\n}\n"],"mappings":";AAAA,IAAa,wBAAb,cAA2C,MAAM;CAC/C,AAAS;CACT,AAAS;CAET,YAAY,OAAe,KAAc;AACvC,QAAM,OAAO,uBAAuB,MAAM,SAAS;AACnD,OAAK,OAAO;AACZ,OAAK,QAAQ;AACb,OAAK,MAAM,OAAO,uBAAuB,MAAM;;;;;;ACLnD,SAAS,gBAAgB,OAAe,KAAqB;AAC3D,OAAM,IAAI,sBAAsB,OAAO,IAAI;;;;;;;;;AAU7C,SAAgB,eAAe,QAAqD;AAClF,KAAI,CAAC,UAAU,OAAO,WAAW,SAC/B,iBAAgB,UAAU,2BAA2B;CAGvD,MAAM,YAAY;AAElB,KAAI,CAAC,UAAU,UACb,iBAAgB,SAAS;AAG3B,KAAI,CAAC,UAAU,UACb,iBAAgB,SAAS;AAG3B,KAAI,CAAC,UAAU,WACb,iBAAgB,UAAU;CAI5B,MAAM,SAAS,UAAU;AACzB,KAAI,OAAO,YAAY,SACrB,iBAAgB,eAAe,2CAAyC;AAE1E,KAAI,OAAO,OAAO,UAAU,SAC1B,iBAAgB,aAAa,qCAAqC;AAEpE,KAAI,OAAO,OAAO,gBAAgB,SAChC,iBAAgB,mBAAmB,2CAA2C;AAEhF,KAAI,OAAO,OAAO,eAAe,SAC/B,iBAAgB,kBAAkB,0CAA0C;AAE9E,KAAI,CAAC,OAAO,WAAW,OAAO,OAAO,YAAY,SAC/C,iBAAgB,eAAe,iDAAiD;AAElF,KAAI,OAAO,OAAO,cAAc,WAC9B,iBAAgB,iBAAiB,2CAA2C;CAG9E,MAAM,WAAW,OAAO;CAGxB,MAAM,SAAS,UAAU;AACzB,KAAI,OAAO,YAAY,SACrB,iBAAgB,eAAe,2CAAyC;AAE1E,KAAI,OAAO,OAAO,UAAU,SAC1B,iBAAgB,aAAa,qCAAqC;AAEpE,KAAI,OAAO,OAAO,gBAAgB,SAChC,iBAAgB,mBAAmB,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iBACE,mBACA,+DACD;AAGH,MAAI,OAAO,SAAS,cAAc,WAChC,iBAAgB,mBAAmB,qDAAqD;AAG1F,MAAI,SAAS,cAAc,UAAa,OAAO,SAAS,cAAc,SACpE,iBAAgB,mBAAmB,wDAAwD"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { ContractIR } from "@prisma-next/contract/ir";
|
|
2
|
+
import { AdapterDescriptor, AdapterInstance, DriverDescriptor, DriverInstance, ExtensionDescriptor, ExtensionInstance, FamilyDescriptor, FamilyInstance, TargetBoundComponentDescriptor, TargetDescriptor, TargetInstance } from "@prisma-next/contract/framework-components";
|
|
3
|
+
import { ContractMarkerRecord, TargetFamilyHook } from "@prisma-next/contract/types";
|
|
4
|
+
|
|
5
|
+
//#region src/types.d.ts
|
|
6
|
+
type SchemaNodeKind = 'root' | 'namespace' | 'collection' | 'entity' | 'field' | 'index' | 'extension';
|
|
7
|
+
interface SchemaTreeNode {
|
|
8
|
+
readonly kind: SchemaNodeKind;
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly label: string;
|
|
11
|
+
readonly meta?: Record<string, unknown>;
|
|
12
|
+
readonly children?: readonly SchemaTreeNode[];
|
|
13
|
+
}
|
|
14
|
+
interface CoreSchemaView {
|
|
15
|
+
readonly root: SchemaTreeNode;
|
|
16
|
+
}
|
|
17
|
+
interface ControlFamilyInstance<TFamilyId extends string, TSchemaIR = unknown> extends FamilyInstance<TFamilyId> {
|
|
18
|
+
validateContractIR(contractJson: unknown): ContractIR;
|
|
19
|
+
verify(options: {
|
|
20
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
21
|
+
readonly contractIR: unknown;
|
|
22
|
+
readonly expectedTargetId: string;
|
|
23
|
+
readonly contractPath: string;
|
|
24
|
+
readonly configPath?: string;
|
|
25
|
+
}): Promise<VerifyDatabaseResult>;
|
|
26
|
+
schemaVerify(options: {
|
|
27
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
28
|
+
readonly contractIR: unknown;
|
|
29
|
+
readonly strict: boolean;
|
|
30
|
+
readonly contractPath: string;
|
|
31
|
+
readonly configPath?: string;
|
|
32
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, string>>;
|
|
33
|
+
}): Promise<VerifyDatabaseSchemaResult>;
|
|
34
|
+
sign(options: {
|
|
35
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
36
|
+
readonly contractIR: unknown;
|
|
37
|
+
readonly contractPath: string;
|
|
38
|
+
readonly configPath?: string;
|
|
39
|
+
}): Promise<SignDatabaseResult>;
|
|
40
|
+
readMarker(options: {
|
|
41
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
42
|
+
}): Promise<ContractMarkerRecord | null>;
|
|
43
|
+
introspect(options: {
|
|
44
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
45
|
+
readonly contractIR?: unknown;
|
|
46
|
+
}): Promise<TSchemaIR>;
|
|
47
|
+
toSchemaView?(schema: TSchemaIR): CoreSchemaView;
|
|
48
|
+
emitContract(options: {
|
|
49
|
+
readonly contractIR: unknown;
|
|
50
|
+
}): Promise<EmitContractResult>;
|
|
51
|
+
}
|
|
52
|
+
interface ControlTargetInstance<TFamilyId extends string, TTargetId extends string> extends TargetInstance<TFamilyId, TTargetId> {}
|
|
53
|
+
interface ControlAdapterInstance<TFamilyId extends string, TTargetId extends string> extends AdapterInstance<TFamilyId, TTargetId> {}
|
|
54
|
+
interface ControlDriverInstance<TFamilyId extends string, TTargetId extends string> extends DriverInstance<TFamilyId, TTargetId> {
|
|
55
|
+
query<Row = Record<string, unknown>>(sql: string, params?: readonly unknown[]): Promise<{
|
|
56
|
+
readonly rows: Row[];
|
|
57
|
+
}>;
|
|
58
|
+
close(): Promise<void>;
|
|
59
|
+
}
|
|
60
|
+
interface ControlExtensionInstance<TFamilyId extends string, TTargetId extends string> extends ExtensionInstance<TFamilyId, TTargetId> {}
|
|
61
|
+
interface ControlPlaneStack<TFamilyId extends string, TTargetId extends string> {
|
|
62
|
+
readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
|
|
63
|
+
readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
|
|
64
|
+
readonly driver: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;
|
|
65
|
+
readonly extensionPacks: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];
|
|
66
|
+
}
|
|
67
|
+
interface ControlFamilyDescriptor<TFamilyId extends string, TFamilyInstance extends ControlFamilyInstance<TFamilyId> = ControlFamilyInstance<TFamilyId>> extends FamilyDescriptor<TFamilyId> {
|
|
68
|
+
readonly hook: TargetFamilyHook;
|
|
69
|
+
create<TTargetId extends string>(stack: ControlPlaneStack<TFamilyId, TTargetId>): TFamilyInstance;
|
|
70
|
+
}
|
|
71
|
+
interface ControlTargetDescriptor<TFamilyId extends string, TTargetId extends string, TTargetInstance extends ControlTargetInstance<TFamilyId, TTargetId> = ControlTargetInstance<TFamilyId, TTargetId>> extends TargetDescriptor<TFamilyId, TTargetId> {
|
|
72
|
+
create(): TTargetInstance;
|
|
73
|
+
}
|
|
74
|
+
interface ControlAdapterDescriptor<TFamilyId extends string, TTargetId extends string, TAdapterInstance extends ControlAdapterInstance<TFamilyId, TTargetId> = ControlAdapterInstance<TFamilyId, TTargetId>> extends AdapterDescriptor<TFamilyId, TTargetId> {
|
|
75
|
+
create(): TAdapterInstance;
|
|
76
|
+
}
|
|
77
|
+
interface ControlDriverDescriptor<TFamilyId extends string, TTargetId extends string, TDriverInstance extends ControlDriverInstance<TFamilyId, TTargetId> = ControlDriverInstance<TFamilyId, TTargetId>, TConnection = string> extends DriverDescriptor<TFamilyId, TTargetId> {
|
|
78
|
+
create(connection: TConnection): Promise<TDriverInstance>;
|
|
79
|
+
}
|
|
80
|
+
interface ControlExtensionDescriptor<TFamilyId extends string, TTargetId extends string, TExtensionInstance extends ControlExtensionInstance<TFamilyId, TTargetId> = ControlExtensionInstance<TFamilyId, TTargetId>> extends ExtensionDescriptor<TFamilyId, TTargetId> {
|
|
81
|
+
create(): TExtensionInstance;
|
|
82
|
+
}
|
|
83
|
+
interface VerifyDatabaseResult {
|
|
84
|
+
readonly ok: boolean;
|
|
85
|
+
readonly code?: string;
|
|
86
|
+
readonly summary: string;
|
|
87
|
+
readonly contract: {
|
|
88
|
+
readonly storageHash: string;
|
|
89
|
+
readonly profileHash?: string;
|
|
90
|
+
};
|
|
91
|
+
readonly marker?: {
|
|
92
|
+
readonly storageHash?: string;
|
|
93
|
+
readonly profileHash?: string;
|
|
94
|
+
};
|
|
95
|
+
readonly target: {
|
|
96
|
+
readonly expected: string;
|
|
97
|
+
readonly actual?: string;
|
|
98
|
+
};
|
|
99
|
+
readonly missingCodecs?: readonly string[];
|
|
100
|
+
readonly codecCoverageSkipped?: boolean;
|
|
101
|
+
readonly meta?: {
|
|
102
|
+
readonly configPath?: string;
|
|
103
|
+
readonly contractPath: string;
|
|
104
|
+
};
|
|
105
|
+
readonly timings: {
|
|
106
|
+
readonly total: number;
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
interface SchemaIssue {
|
|
110
|
+
readonly kind: 'missing_table' | 'missing_column' | 'extra_table' | 'extra_column' | 'extra_primary_key' | 'extra_foreign_key' | 'extra_unique_constraint' | 'extra_index' | 'type_mismatch' | 'type_missing' | 'type_values_mismatch' | 'nullability_mismatch' | 'primary_key_mismatch' | 'foreign_key_mismatch' | 'unique_constraint_mismatch' | 'index_mismatch' | 'extension_missing' | 'default_missing' | 'default_mismatch';
|
|
111
|
+
readonly table: string;
|
|
112
|
+
readonly column?: string;
|
|
113
|
+
readonly indexOrConstraint?: string;
|
|
114
|
+
readonly typeName?: string;
|
|
115
|
+
readonly expected?: string;
|
|
116
|
+
readonly actual?: string;
|
|
117
|
+
readonly message: string;
|
|
118
|
+
}
|
|
119
|
+
interface SchemaVerificationNode {
|
|
120
|
+
readonly status: 'pass' | 'warn' | 'fail';
|
|
121
|
+
readonly kind: string;
|
|
122
|
+
readonly name: string;
|
|
123
|
+
readonly contractPath: string;
|
|
124
|
+
readonly code: string;
|
|
125
|
+
readonly message: string;
|
|
126
|
+
readonly expected: unknown;
|
|
127
|
+
readonly actual: unknown;
|
|
128
|
+
readonly children: readonly SchemaVerificationNode[];
|
|
129
|
+
}
|
|
130
|
+
interface VerifyDatabaseSchemaResult {
|
|
131
|
+
readonly ok: boolean;
|
|
132
|
+
readonly code?: string;
|
|
133
|
+
readonly summary: string;
|
|
134
|
+
readonly contract: {
|
|
135
|
+
readonly storageHash: string;
|
|
136
|
+
readonly profileHash?: string;
|
|
137
|
+
};
|
|
138
|
+
readonly target: {
|
|
139
|
+
readonly expected: string;
|
|
140
|
+
readonly actual?: string;
|
|
141
|
+
};
|
|
142
|
+
readonly schema: {
|
|
143
|
+
readonly issues: readonly SchemaIssue[];
|
|
144
|
+
readonly root: SchemaVerificationNode;
|
|
145
|
+
readonly counts: {
|
|
146
|
+
readonly pass: number;
|
|
147
|
+
readonly warn: number;
|
|
148
|
+
readonly fail: number;
|
|
149
|
+
readonly totalNodes: number;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
readonly meta?: {
|
|
153
|
+
readonly configPath?: string;
|
|
154
|
+
readonly contractPath?: string;
|
|
155
|
+
readonly strict: boolean;
|
|
156
|
+
};
|
|
157
|
+
readonly timings: {
|
|
158
|
+
readonly total: number;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
interface EmitContractResult {
|
|
162
|
+
readonly contractJson: string;
|
|
163
|
+
readonly contractDts: string;
|
|
164
|
+
readonly storageHash: string;
|
|
165
|
+
readonly executionHash?: string;
|
|
166
|
+
readonly profileHash: string;
|
|
167
|
+
}
|
|
168
|
+
interface SignDatabaseResult {
|
|
169
|
+
readonly ok: boolean;
|
|
170
|
+
readonly summary: string;
|
|
171
|
+
readonly contract: {
|
|
172
|
+
readonly storageHash: string;
|
|
173
|
+
readonly profileHash?: string;
|
|
174
|
+
};
|
|
175
|
+
readonly target: {
|
|
176
|
+
readonly expected: string;
|
|
177
|
+
readonly actual?: string;
|
|
178
|
+
};
|
|
179
|
+
readonly marker: {
|
|
180
|
+
readonly created: boolean;
|
|
181
|
+
readonly updated: boolean;
|
|
182
|
+
readonly previous?: {
|
|
183
|
+
readonly storageHash?: string;
|
|
184
|
+
readonly profileHash?: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
readonly meta?: {
|
|
188
|
+
readonly configPath?: string;
|
|
189
|
+
readonly contractPath: string;
|
|
190
|
+
};
|
|
191
|
+
readonly timings: {
|
|
192
|
+
readonly total: number;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
//#endregion
|
|
196
|
+
export { ControlExtensionDescriptor as a, ControlFamilyInstance as c, ControlTargetInstance as d, ControlDriverInstance as i, ControlPlaneStack as l, ControlAdapterInstance as n, ControlExtensionInstance as o, ControlDriverDescriptor as r, ControlFamilyDescriptor as s, ControlAdapterDescriptor as t, ControlTargetDescriptor as u };
|
|
197
|
+
//# sourceMappingURL=types-BRFw7URn.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-BRFw7URn.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";;;;;KAgBY,cAAA;UASK,cAAA;EATL,SAAA,IAAA,EAUK,cAVS;EAST,SAAA,EAAA,EAAA,MAAc;EACd,SAAA,KAAA,EAAA,MAAA;EAGC,SAAA,IAAA,CAAA,EAAA,MAAA,CAAA,MAAA,EAAA,OAAA,CAAA;EACa,SAAA,QAAA,CAAA,EAAA,SAAA,cAAA,EAAA;;AAGd,UAAA,cAAA,CAAc;EAId,SAAA,IAAA,EAHA,cAGqB;;AAEO,UAF5B,qBAE4B,CAAA,kBAAA,MAAA,EAAA,YAAA,OAAA,CAAA,SADnC,cACmC,CADpB,SACoB,CAAA,CAAA;EAGF,kBAAA,CAAA,YAAA,EAAA,OAAA,CAAA,EAHE,UAGF;EAAtB,MAAA,C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yInstance, d as ControlTargetInstance, i as ControlDriverInstance, l as ControlPlaneStack, n as ControlAdapterInstance, o as ControlExtensionInstance, r as ControlDriverDescriptor, s as ControlFamilyDescriptor, t as ControlAdapterDescriptor, u as ControlTargetDescriptor } from "./types-BRFw7URn.mjs";
|
|
2
|
+
export { type ControlAdapterDescriptor, type ControlAdapterInstance, type ControlDriverDescriptor, type ControlDriverInstance, type ControlExtensionDescriptor, type ControlExtensionInstance, type ControlFamilyDescriptor, type ControlFamilyInstance, type ControlPlaneStack, type ControlTargetDescriptor, type ControlTargetInstance };
|
package/dist/types.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|