@prisma-next/core-control-plane 0.3.0-dev.2 → 0.3.0-dev.21
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 +29 -0
- package/dist/{chunk-U5RYT6PT.js → chunk-YT6YGR3N.js} +17 -6
- package/dist/chunk-YT6YGR3N.js.map +1 -0
- package/dist/config-types.d.ts +79 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/config-validation.d.ts +10 -0
- package/dist/config-validation.d.ts.map +1 -0
- package/dist/emission/canonicalization.d.ts +6 -0
- package/dist/emission/canonicalization.d.ts.map +1 -0
- package/dist/emission/emit.d.ts +5 -0
- package/dist/emission/emit.d.ts.map +1 -0
- package/dist/emission/hashing.d.ts +17 -0
- package/dist/emission/hashing.d.ts.map +1 -0
- package/dist/emission/types.d.ts +16 -0
- package/dist/emission/types.d.ts.map +1 -0
- package/dist/errors.d.ts +188 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/exports/config-types.d.ts +3 -70
- package/dist/exports/config-types.d.ts.map +1 -0
- package/dist/exports/config-types.js.map +1 -1
- package/dist/exports/config-validation.d.ts +2 -18
- package/dist/exports/config-validation.d.ts.map +1 -0
- package/dist/exports/config-validation.js +1 -1
- package/dist/exports/emission.d.ts +5 -42
- package/dist/exports/emission.d.ts.map +1 -0
- package/dist/exports/emission.js +2 -2
- package/dist/exports/emission.js.map +1 -1
- package/dist/exports/errors.d.ts +3 -184
- package/dist/exports/errors.d.ts.map +1 -0
- package/dist/exports/errors.js +3 -3
- package/dist/exports/schema-view.d.ts +2 -87
- package/dist/exports/schema-view.d.ts.map +1 -0
- package/dist/exports/stack.d.ts +2 -0
- package/dist/exports/stack.d.ts.map +1 -0
- package/dist/exports/stack.js +13 -0
- package/dist/exports/stack.js.map +1 -0
- package/dist/exports/types.d.ts +2 -589
- package/dist/exports/types.d.ts.map +1 -0
- package/dist/migrations.d.ts +190 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/schema-view.d.ts +86 -0
- package/dist/schema-view.d.ts.map +1 -0
- package/dist/stack.d.ts +25 -0
- package/dist/stack.d.ts.map +1 -0
- package/dist/types.d.ts +416 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +18 -14
- package/src/config-types.ts +174 -0
- package/src/config-validation.ts +270 -0
- package/src/emission/canonicalization.ts +253 -0
- package/src/emission/emit.ts +118 -0
- package/src/emission/hashing.ts +57 -0
- package/src/emission/types.ts +17 -0
- package/src/errors.ts +445 -0
- package/src/exports/config-types.ts +5 -0
- package/src/exports/config-validation.ts +1 -0
- package/src/exports/emission.ts +6 -0
- package/src/exports/errors.ts +22 -0
- package/src/exports/schema-view.ts +1 -0
- package/src/exports/stack.ts +1 -0
- package/src/exports/types.ts +38 -0
- package/src/migrations.ts +247 -0
- package/src/schema-view.ts +95 -0
- package/src/stack.ts +38 -0
- package/src/types.ts +530 -0
- package/dist/chunk-U5RYT6PT.js.map +0 -1
package/src/types.ts
ADDED
|
@@ -0,0 +1,530 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AdapterDescriptor,
|
|
3
|
+
AdapterInstance,
|
|
4
|
+
DriverDescriptor,
|
|
5
|
+
DriverInstance,
|
|
6
|
+
ExtensionDescriptor,
|
|
7
|
+
ExtensionInstance,
|
|
8
|
+
FamilyDescriptor,
|
|
9
|
+
FamilyInstance,
|
|
10
|
+
TargetBoundComponentDescriptor,
|
|
11
|
+
TargetDescriptor,
|
|
12
|
+
TargetInstance,
|
|
13
|
+
} from '@prisma-next/contract/framework-components';
|
|
14
|
+
import type { ContractIR } from '@prisma-next/contract/ir';
|
|
15
|
+
import type { ContractMarkerRecord, TargetFamilyHook } from '@prisma-next/contract/types';
|
|
16
|
+
import type { TargetMigrationsCapability } from './migrations';
|
|
17
|
+
import type { CoreSchemaView } from './schema-view';
|
|
18
|
+
|
|
19
|
+
// Re-export migration types for convenience
|
|
20
|
+
export type {
|
|
21
|
+
MigrationOperationClass,
|
|
22
|
+
MigrationOperationPolicy,
|
|
23
|
+
MigrationPlan,
|
|
24
|
+
MigrationPlanner,
|
|
25
|
+
MigrationPlannerConflict,
|
|
26
|
+
MigrationPlannerFailureResult,
|
|
27
|
+
MigrationPlannerResult,
|
|
28
|
+
MigrationPlannerSuccessResult,
|
|
29
|
+
MigrationPlanOperation,
|
|
30
|
+
MigrationRunner,
|
|
31
|
+
MigrationRunnerExecutionChecks,
|
|
32
|
+
MigrationRunnerFailure,
|
|
33
|
+
MigrationRunnerResult,
|
|
34
|
+
MigrationRunnerSuccessValue,
|
|
35
|
+
TargetMigrationsCapability,
|
|
36
|
+
} from './migrations';
|
|
37
|
+
|
|
38
|
+
// ============================================================================
|
|
39
|
+
// Control*Instance Base Interfaces (ADR 151)
|
|
40
|
+
// ============================================================================
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Control-plane family instance interface.
|
|
44
|
+
* Extends the base FamilyInstance with control-plane domain actions.
|
|
45
|
+
*
|
|
46
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
47
|
+
* @template TSchemaIR - The schema IR type returned by introspect() (family-specific)
|
|
48
|
+
*/
|
|
49
|
+
export interface ControlFamilyInstance<TFamilyId extends string, TSchemaIR = unknown>
|
|
50
|
+
extends FamilyInstance<TFamilyId> {
|
|
51
|
+
/**
|
|
52
|
+
* Validates a contract JSON and returns a validated ContractIR (without mappings).
|
|
53
|
+
* Mappings are runtime-only and should not be part of ContractIR.
|
|
54
|
+
*
|
|
55
|
+
* Note: The returned ContractIR may include additional fields from the emitted contract
|
|
56
|
+
* (like coreHash, profileHash) that are not part of the ContractIR type but are preserved
|
|
57
|
+
* for use by verify/sign operations.
|
|
58
|
+
*/
|
|
59
|
+
validateContractIR(contractJson: unknown): ContractIR;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Verifies the database marker against the contract.
|
|
63
|
+
* Compares target, coreHash, and profileHash.
|
|
64
|
+
*
|
|
65
|
+
* @param options.contractIR - The validated contract (from validateContractIR). Must have
|
|
66
|
+
* coreHash and target fields for verification. These fields are present in emitted
|
|
67
|
+
* contracts but not in the ContractIR type definition.
|
|
68
|
+
*/
|
|
69
|
+
verify(options: {
|
|
70
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
71
|
+
readonly contractIR: unknown;
|
|
72
|
+
readonly expectedTargetId: string;
|
|
73
|
+
readonly contractPath: string;
|
|
74
|
+
readonly configPath?: string;
|
|
75
|
+
}): Promise<VerifyDatabaseResult>;
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Verifies the database schema against the contract.
|
|
79
|
+
* Compares contract requirements against live database schema.
|
|
80
|
+
*/
|
|
81
|
+
schemaVerify(options: {
|
|
82
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
83
|
+
readonly contractIR: unknown;
|
|
84
|
+
readonly strict: boolean;
|
|
85
|
+
readonly contractPath: string;
|
|
86
|
+
readonly configPath?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Active framework components participating in this composition.
|
|
89
|
+
* All components must have matching familyId and targetId.
|
|
90
|
+
*/
|
|
91
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, string>>;
|
|
92
|
+
}): Promise<VerifyDatabaseSchemaResult>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Signs the database with the contract marker.
|
|
96
|
+
* Writes or updates the contract marker if schema verification passes.
|
|
97
|
+
* This operation is idempotent - if the marker already matches, no changes are made.
|
|
98
|
+
*/
|
|
99
|
+
sign(options: {
|
|
100
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
101
|
+
readonly contractIR: unknown;
|
|
102
|
+
readonly contractPath: string;
|
|
103
|
+
readonly configPath?: string;
|
|
104
|
+
}): Promise<SignDatabaseResult>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Reads the contract marker from the database.
|
|
108
|
+
* Returns null if no marker exists.
|
|
109
|
+
*/
|
|
110
|
+
readMarker(options: {
|
|
111
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
112
|
+
}): Promise<ContractMarkerRecord | null>;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Introspects the database schema and returns a family-specific schema IR.
|
|
116
|
+
*
|
|
117
|
+
* This is a read-only operation that returns a snapshot of the live database schema.
|
|
118
|
+
* The method is family-owned and delegates to target/adapter-specific introspectors
|
|
119
|
+
* to perform the actual schema introspection.
|
|
120
|
+
*
|
|
121
|
+
* @param options - Introspection options
|
|
122
|
+
* @param options.driver - Control plane driver for database connection
|
|
123
|
+
* @param options.contractIR - Optional contract for contract-guided introspection.
|
|
124
|
+
* When provided, families may use it for filtering, optimization, or validation
|
|
125
|
+
* during introspection. The contract does not change the meaning of "what exists"
|
|
126
|
+
* in the database - it only guides how introspection is performed.
|
|
127
|
+
* @returns Promise resolving to the family-specific Schema IR (e.g., `SqlSchemaIR` for SQL).
|
|
128
|
+
* The IR represents the complete schema snapshot at the time of introspection.
|
|
129
|
+
*/
|
|
130
|
+
introspect(options: {
|
|
131
|
+
readonly driver: ControlDriverInstance<TFamilyId, string>;
|
|
132
|
+
readonly contractIR?: unknown;
|
|
133
|
+
}): Promise<TSchemaIR>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Optionally projects a family-specific Schema IR into a core schema view.
|
|
137
|
+
* Families that provide this method enable rich tree output for CLI visualization.
|
|
138
|
+
* Families that do not provide it still support introspection via raw Schema IR.
|
|
139
|
+
*/
|
|
140
|
+
toSchemaView?(schema: TSchemaIR): CoreSchemaView;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Emits contract JSON and DTS as strings.
|
|
144
|
+
* Uses the instance's preassembled state (operation registry, type imports, extension IDs).
|
|
145
|
+
* Handles stripping mappings and validation internally.
|
|
146
|
+
*/
|
|
147
|
+
emitContract(options: { readonly contractIR: ContractIR | unknown }): Promise<EmitContractResult>;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Control-plane target instance interface.
|
|
152
|
+
* Extends the base TargetInstance with control-plane specific behavior.
|
|
153
|
+
*
|
|
154
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
155
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
156
|
+
*/
|
|
157
|
+
export interface ControlTargetInstance<TFamilyId extends string, TTargetId extends string>
|
|
158
|
+
extends TargetInstance<TFamilyId, TTargetId> {}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Control-plane adapter instance interface.
|
|
162
|
+
* Extends the base AdapterInstance with control-plane specific behavior.
|
|
163
|
+
* Families extend this with family-specific adapter interfaces.
|
|
164
|
+
*
|
|
165
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
166
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
167
|
+
*/
|
|
168
|
+
export interface ControlAdapterInstance<TFamilyId extends string, TTargetId extends string>
|
|
169
|
+
extends AdapterInstance<TFamilyId, TTargetId> {}
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Control-plane driver instance interface.
|
|
173
|
+
* Extends the base DriverInstance with control-plane specific behavior.
|
|
174
|
+
*
|
|
175
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
176
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
177
|
+
*/
|
|
178
|
+
export interface ControlDriverInstance<TFamilyId extends string, TTargetId extends string>
|
|
179
|
+
extends DriverInstance<TFamilyId, TTargetId> {
|
|
180
|
+
query<Row = Record<string, unknown>>(
|
|
181
|
+
sql: string,
|
|
182
|
+
params?: readonly unknown[],
|
|
183
|
+
): Promise<{ readonly rows: Row[] }>;
|
|
184
|
+
close(): Promise<void>;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Control-plane extension instance interface.
|
|
189
|
+
* Extends the base ExtensionInstance with control-plane specific behavior.
|
|
190
|
+
*
|
|
191
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
192
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
193
|
+
*/
|
|
194
|
+
export interface ControlExtensionInstance<TFamilyId extends string, TTargetId extends string>
|
|
195
|
+
extends ExtensionInstance<TFamilyId, TTargetId> {}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Operation context for propagating metadata through control-plane operation call chains.
|
|
199
|
+
* Inspired by OpenTelemetry's Context and Sentry's Scope patterns.
|
|
200
|
+
*
|
|
201
|
+
* This context carries informational metadata (like file paths) that can be used for
|
|
202
|
+
* error reporting, logging, and debugging, but is not required for structural correctness.
|
|
203
|
+
* It allows subsystems to propagate context without coupling to file I/O concerns.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```typescript
|
|
207
|
+
* const context: OperationContext = {
|
|
208
|
+
* contractPath: './contract.json',
|
|
209
|
+
* configPath: './prisma-next.config.ts',
|
|
210
|
+
* };
|
|
211
|
+
*
|
|
212
|
+
* await runner.execute({ plan, driver, destinationContract: contract, context });
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
export interface OperationContext {
|
|
216
|
+
/**
|
|
217
|
+
* Path to the contract file (if applicable).
|
|
218
|
+
* Used for error reporting and metadata, not for file I/O.
|
|
219
|
+
*/
|
|
220
|
+
readonly contractPath?: string;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Path to the configuration file (if applicable).
|
|
224
|
+
* Used for error reporting and metadata, not for file I/O.
|
|
225
|
+
*/
|
|
226
|
+
readonly configPath?: string;
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Additional metadata that can be propagated through the call chain.
|
|
230
|
+
* Extensible for future needs without breaking changes.
|
|
231
|
+
*/
|
|
232
|
+
readonly meta?: Readonly<Record<string, unknown>>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ============================================================================
|
|
236
|
+
// Control*Descriptor Interfaces (ADR 151)
|
|
237
|
+
// ============================================================================
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* A bundle of control-plane component descriptors for a specific family and target.
|
|
241
|
+
*
|
|
242
|
+
* This struct groups the target, adapter, driver (optional), and extension packs
|
|
243
|
+
* needed to create a family instance and run CLI commands. Use `createControlPlaneStack()`
|
|
244
|
+
* to construct with sensible defaults.
|
|
245
|
+
*
|
|
246
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
247
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
248
|
+
*/
|
|
249
|
+
export interface ControlPlaneStack<TFamilyId extends string, TTargetId extends string> {
|
|
250
|
+
readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
|
|
251
|
+
readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
|
|
252
|
+
readonly driver: ControlDriverDescriptor<TFamilyId, TTargetId> | undefined;
|
|
253
|
+
readonly extensionPacks: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Descriptor for a control-plane family (e.g., SQL).
|
|
258
|
+
* Provides the family hook and factory method.
|
|
259
|
+
*
|
|
260
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
261
|
+
* @template TFamilyInstance - The family instance type
|
|
262
|
+
*/
|
|
263
|
+
export interface ControlFamilyDescriptor<
|
|
264
|
+
TFamilyId extends string,
|
|
265
|
+
TFamilyInstance extends ControlFamilyInstance<TFamilyId> = ControlFamilyInstance<TFamilyId>,
|
|
266
|
+
> extends FamilyDescriptor<TFamilyId> {
|
|
267
|
+
readonly hook: TargetFamilyHook;
|
|
268
|
+
create<TTargetId extends string>(stack: ControlPlaneStack<TFamilyId, TTargetId>): TFamilyInstance;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Descriptor for a control-plane target component (e.g., Postgres target).
|
|
273
|
+
*
|
|
274
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
275
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
276
|
+
* @template TTargetInstance - The target instance type
|
|
277
|
+
* @template TFamilyInstance - The family instance type for migrations (optional)
|
|
278
|
+
*/
|
|
279
|
+
export interface ControlTargetDescriptor<
|
|
280
|
+
TFamilyId extends string,
|
|
281
|
+
TTargetId extends string,
|
|
282
|
+
TTargetInstance extends ControlTargetInstance<TFamilyId, TTargetId> = ControlTargetInstance<
|
|
283
|
+
TFamilyId,
|
|
284
|
+
TTargetId
|
|
285
|
+
>,
|
|
286
|
+
TFamilyInstance extends ControlFamilyInstance<TFamilyId> = ControlFamilyInstance<TFamilyId>,
|
|
287
|
+
> extends TargetDescriptor<TFamilyId, TTargetId> {
|
|
288
|
+
/**
|
|
289
|
+
* Optional migrations capability.
|
|
290
|
+
* Targets that support migrations expose this property.
|
|
291
|
+
* The capability is parameterized by family and target IDs to ensure type-level
|
|
292
|
+
* compatibility of framework components.
|
|
293
|
+
*/
|
|
294
|
+
readonly migrations?: TargetMigrationsCapability<TFamilyId, TTargetId, TFamilyInstance>;
|
|
295
|
+
create(): TTargetInstance;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Descriptor for a control-plane adapter component (e.g., Postgres adapter).
|
|
300
|
+
*
|
|
301
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
302
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
303
|
+
* @template TAdapterInstance - The adapter instance type
|
|
304
|
+
*/
|
|
305
|
+
export interface ControlAdapterDescriptor<
|
|
306
|
+
TFamilyId extends string,
|
|
307
|
+
TTargetId extends string,
|
|
308
|
+
TAdapterInstance extends ControlAdapterInstance<TFamilyId, TTargetId> = ControlAdapterInstance<
|
|
309
|
+
TFamilyId,
|
|
310
|
+
TTargetId
|
|
311
|
+
>,
|
|
312
|
+
> extends AdapterDescriptor<TFamilyId, TTargetId> {
|
|
313
|
+
create(): TAdapterInstance;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Descriptor for a control-plane driver component (e.g., Postgres driver).
|
|
318
|
+
*
|
|
319
|
+
* The connection input type is driver-specific. For example:
|
|
320
|
+
* - Postgres uses a connection string (URL)
|
|
321
|
+
* - Other drivers may accept structured objects (e.g., file paths, credentials)
|
|
322
|
+
*
|
|
323
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
324
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
325
|
+
* @template TDriverInstance - The driver instance type
|
|
326
|
+
* @template TConnection - The connection input type (defaults to `string` for URL-based drivers)
|
|
327
|
+
*/
|
|
328
|
+
export interface ControlDriverDescriptor<
|
|
329
|
+
TFamilyId extends string,
|
|
330
|
+
TTargetId extends string,
|
|
331
|
+
TDriverInstance extends ControlDriverInstance<TFamilyId, TTargetId> = ControlDriverInstance<
|
|
332
|
+
TFamilyId,
|
|
333
|
+
TTargetId
|
|
334
|
+
>,
|
|
335
|
+
TConnection = string,
|
|
336
|
+
> extends DriverDescriptor<TFamilyId, TTargetId> {
|
|
337
|
+
create(connection: TConnection): Promise<TDriverInstance>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Descriptor for a control-plane extension component (e.g., pgvector).
|
|
342
|
+
*
|
|
343
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
344
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
345
|
+
* @template TExtensionInstance - The extension instance type
|
|
346
|
+
*/
|
|
347
|
+
export interface ControlExtensionDescriptor<
|
|
348
|
+
TFamilyId extends string,
|
|
349
|
+
TTargetId extends string,
|
|
350
|
+
TExtensionInstance extends ControlExtensionInstance<
|
|
351
|
+
TFamilyId,
|
|
352
|
+
TTargetId
|
|
353
|
+
> = ControlExtensionInstance<TFamilyId, TTargetId>,
|
|
354
|
+
> extends ExtensionDescriptor<TFamilyId, TTargetId> {
|
|
355
|
+
create(): TExtensionInstance;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Result type for database marker verification operations.
|
|
360
|
+
*/
|
|
361
|
+
export interface VerifyDatabaseResult {
|
|
362
|
+
readonly ok: boolean;
|
|
363
|
+
readonly code?: string;
|
|
364
|
+
readonly summary: string;
|
|
365
|
+
readonly contract: {
|
|
366
|
+
readonly coreHash: string;
|
|
367
|
+
readonly profileHash?: string;
|
|
368
|
+
};
|
|
369
|
+
readonly marker?: {
|
|
370
|
+
readonly coreHash?: string;
|
|
371
|
+
readonly profileHash?: string;
|
|
372
|
+
};
|
|
373
|
+
readonly target: {
|
|
374
|
+
readonly expected: string;
|
|
375
|
+
readonly actual?: string;
|
|
376
|
+
};
|
|
377
|
+
readonly missingCodecs?: readonly string[];
|
|
378
|
+
readonly codecCoverageSkipped?: boolean;
|
|
379
|
+
readonly meta?: {
|
|
380
|
+
readonly configPath?: string;
|
|
381
|
+
readonly contractPath: string;
|
|
382
|
+
};
|
|
383
|
+
readonly timings: {
|
|
384
|
+
readonly total: number;
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Schema issue type for schema verification results.
|
|
390
|
+
*/
|
|
391
|
+
export interface SchemaIssue {
|
|
392
|
+
readonly kind:
|
|
393
|
+
| 'missing_table'
|
|
394
|
+
| 'missing_column'
|
|
395
|
+
| 'extra_table'
|
|
396
|
+
| 'extra_column'
|
|
397
|
+
| 'extra_primary_key'
|
|
398
|
+
| 'extra_foreign_key'
|
|
399
|
+
| 'extra_unique_constraint'
|
|
400
|
+
| 'extra_index'
|
|
401
|
+
| 'type_mismatch'
|
|
402
|
+
| 'nullability_mismatch'
|
|
403
|
+
| 'primary_key_mismatch'
|
|
404
|
+
| 'foreign_key_mismatch'
|
|
405
|
+
| 'unique_constraint_mismatch'
|
|
406
|
+
| 'index_mismatch'
|
|
407
|
+
| 'extension_missing';
|
|
408
|
+
readonly table: string;
|
|
409
|
+
readonly column?: string;
|
|
410
|
+
readonly indexOrConstraint?: string;
|
|
411
|
+
readonly expected?: string;
|
|
412
|
+
readonly actual?: string;
|
|
413
|
+
readonly message: string;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Contract-shaped verification tree node for schema verification results.
|
|
418
|
+
* Family-agnostic structure that follows the contract structure.
|
|
419
|
+
*/
|
|
420
|
+
export interface SchemaVerificationNode {
|
|
421
|
+
readonly status: 'pass' | 'warn' | 'fail';
|
|
422
|
+
readonly kind: string;
|
|
423
|
+
readonly name: string;
|
|
424
|
+
readonly contractPath: string;
|
|
425
|
+
readonly code: string;
|
|
426
|
+
readonly message: string;
|
|
427
|
+
readonly expected: unknown;
|
|
428
|
+
readonly actual: unknown;
|
|
429
|
+
readonly children: readonly SchemaVerificationNode[];
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Result type for database schema verification operations.
|
|
434
|
+
*/
|
|
435
|
+
export interface VerifyDatabaseSchemaResult {
|
|
436
|
+
readonly ok: boolean;
|
|
437
|
+
readonly code?: string;
|
|
438
|
+
readonly summary: string;
|
|
439
|
+
readonly contract: {
|
|
440
|
+
readonly coreHash: string;
|
|
441
|
+
readonly profileHash?: string;
|
|
442
|
+
};
|
|
443
|
+
readonly target: {
|
|
444
|
+
readonly expected: string;
|
|
445
|
+
readonly actual?: string;
|
|
446
|
+
};
|
|
447
|
+
readonly schema: {
|
|
448
|
+
readonly issues: readonly SchemaIssue[];
|
|
449
|
+
readonly root: SchemaVerificationNode;
|
|
450
|
+
readonly counts: {
|
|
451
|
+
readonly pass: number;
|
|
452
|
+
readonly warn: number;
|
|
453
|
+
readonly fail: number;
|
|
454
|
+
readonly totalNodes: number;
|
|
455
|
+
};
|
|
456
|
+
};
|
|
457
|
+
readonly meta?: {
|
|
458
|
+
readonly configPath?: string;
|
|
459
|
+
readonly contractPath?: string;
|
|
460
|
+
readonly strict: boolean;
|
|
461
|
+
};
|
|
462
|
+
readonly timings: {
|
|
463
|
+
readonly total: number;
|
|
464
|
+
};
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Result type for contract emission operations.
|
|
469
|
+
*/
|
|
470
|
+
export interface EmitContractResult {
|
|
471
|
+
readonly contractJson: string;
|
|
472
|
+
readonly contractDts: string;
|
|
473
|
+
readonly coreHash: string;
|
|
474
|
+
readonly profileHash: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Result envelope for schema introspection operations.
|
|
479
|
+
* Used by CLI for JSON output when introspecting database schemas.
|
|
480
|
+
*
|
|
481
|
+
* @template TSchemaIR - The family-specific Schema IR type (e.g., `SqlSchemaIR` for SQL)
|
|
482
|
+
*/
|
|
483
|
+
export interface IntrospectSchemaResult<TSchemaIR> {
|
|
484
|
+
readonly ok: true;
|
|
485
|
+
readonly summary: string;
|
|
486
|
+
readonly target: {
|
|
487
|
+
readonly familyId: string;
|
|
488
|
+
readonly id: string;
|
|
489
|
+
};
|
|
490
|
+
readonly schema: TSchemaIR;
|
|
491
|
+
readonly meta?: {
|
|
492
|
+
readonly configPath?: string;
|
|
493
|
+
readonly dbUrl?: string;
|
|
494
|
+
};
|
|
495
|
+
readonly timings: {
|
|
496
|
+
readonly total: number;
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Result type for database signing operations.
|
|
502
|
+
* Returned when writing or updating the contract marker in the database.
|
|
503
|
+
*/
|
|
504
|
+
export interface SignDatabaseResult {
|
|
505
|
+
readonly ok: boolean;
|
|
506
|
+
readonly summary: string;
|
|
507
|
+
readonly contract: {
|
|
508
|
+
readonly coreHash: string;
|
|
509
|
+
readonly profileHash?: string;
|
|
510
|
+
};
|
|
511
|
+
readonly target: {
|
|
512
|
+
readonly expected: string;
|
|
513
|
+
readonly actual?: string;
|
|
514
|
+
};
|
|
515
|
+
readonly marker: {
|
|
516
|
+
readonly created: boolean;
|
|
517
|
+
readonly updated: boolean;
|
|
518
|
+
readonly previous?: {
|
|
519
|
+
readonly coreHash?: string;
|
|
520
|
+
readonly profileHash?: string;
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
readonly meta?: {
|
|
524
|
+
readonly configPath?: string;
|
|
525
|
+
readonly contractPath: string;
|
|
526
|
+
};
|
|
527
|
+
readonly timings: {
|
|
528
|
+
readonly total: number;
|
|
529
|
+
};
|
|
530
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["/**\n * CLI error envelope for output formatting.\n * This is the serialized form of a CliStructuredError.\n */\nexport interface CliErrorEnvelope {\n readonly code: string;\n readonly domain: string;\n readonly severity: 'error' | 'warn' | 'info';\n readonly summary: string;\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n}\n\n/**\n * Minimal conflict data structure expected by CLI output.\n */\nexport interface CliErrorConflict {\n readonly kind: string;\n readonly summary: string;\n readonly why?: string;\n}\n\n/**\n * Structured CLI error that contains all information needed for error envelopes.\n * Call sites throw these errors with full context.\n */\nexport class CliStructuredError extends Error {\n readonly code: string;\n readonly domain: 'CLI' | 'RTM';\n readonly severity: 'error' | 'warn' | 'info';\n readonly why: string | undefined;\n readonly fix: string | undefined;\n readonly where:\n | {\n readonly path: string | undefined;\n readonly line: number | undefined;\n }\n | undefined;\n readonly meta: Record<string, unknown> | undefined;\n readonly docsUrl: string | undefined;\n\n constructor(\n code: string,\n summary: string,\n options?: {\n readonly domain?: 'CLI' | 'RTM';\n readonly severity?: 'error' | 'warn' | 'info';\n readonly why?: string;\n readonly fix?: string;\n readonly where?: { readonly path?: string; readonly line?: number };\n readonly meta?: Record<string, unknown>;\n readonly docsUrl?: string;\n },\n ) {\n super(summary);\n this.name = 'CliStructuredError';\n this.code = code;\n this.domain = options?.domain ?? 'CLI';\n this.severity = options?.severity ?? 'error';\n this.why = options?.why;\n this.fix = options?.fix;\n this.where = options?.where\n ? {\n path: options.where.path,\n line: options.where.line,\n }\n : undefined;\n this.meta = options?.meta;\n this.docsUrl = options?.docsUrl;\n }\n\n /**\n * Converts this error to a CLI error envelope for output formatting.\n */\n toEnvelope(): CliErrorEnvelope {\n const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RTM-';\n return {\n code: `${codePrefix}${this.code}`,\n domain: this.domain,\n severity: this.severity,\n summary: this.message,\n why: this.why,\n fix: this.fix,\n where: this.where,\n meta: this.meta,\n docsUrl: this.docsUrl,\n };\n }\n}\n\n// ============================================================================\n// Config Errors (PN-CLI-4001-4007)\n// ============================================================================\n\n/**\n * Config file not found or missing.\n */\nexport function errorConfigFileNotFound(\n configPath?: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n ...(options?.why ? { why: options.why } : { why: 'Config file not found' }),\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n ...(configPath ? { where: { path: configPath } } : {}),\n });\n}\n\n/**\n * Contract configuration missing from config.\n */\nexport function errorContractConfigMissing(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4002', 'Contract configuration missing', {\n domain: 'CLI',\n why: options?.why ?? 'The contract configuration is required for emit',\n fix: 'Add contract configuration to your prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',\n });\n}\n\n/**\n * Contract validation failed.\n */\nexport function errorContractValidationFailed(\n reason: string,\n options?: {\n readonly where?: { readonly path?: string; readonly line?: number };\n },\n): CliStructuredError {\n return new CliStructuredError('4003', 'Contract validation failed', {\n domain: 'CLI',\n why: reason,\n fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',\n docsUrl: 'https://prisma-next.dev/docs/contracts',\n ...(options?.where ? { where: options.where } : {}),\n });\n}\n\n/**\n * File not found.\n */\nexport function errorFileNotFound(\n filePath: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly docsUrl?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4004', 'File not found', {\n domain: 'CLI',\n why: options?.why ?? `File not found: ${filePath}`,\n fix: options?.fix ?? 'Check that the file path is correct',\n where: { path: filePath },\n ...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),\n });\n}\n\n/**\n * Database URL is required but not provided.\n */\nexport function errorDatabaseUrlRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4005', 'Database URL is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database URL is required for this command',\n fix: 'Provide `--db <url>` or set `db: { url: \"postgres://…\" }` in prisma-next.config.ts',\n });\n}\n\n/**\n * Query runner factory is required but not provided in config.\n */\nexport function errorQueryRunnerFactoryRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4006', 'Query runner factory is required', {\n domain: 'CLI',\n why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',\n fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * Family verify.readMarker is required but not provided.\n */\nexport function errorFamilyReadMarkerSqlRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4007', 'Family readMarker() is required', {\n domain: 'CLI',\n why: options?.why ?? 'Family verify.readMarker is required for db verify',\n fix: 'Ensure family.verify.readMarker() is exported by your family package',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',\n });\n}\n\n/**\n * JSON output format not supported.\n */\nexport function errorJsonFormatNotSupported(options: {\n readonly command: string;\n readonly format: string;\n readonly supportedFormats: readonly string[];\n}): CliStructuredError {\n return new CliStructuredError('4008', 'Unsupported JSON format', {\n domain: 'CLI',\n why: `The ${options.command} command does not support --json ${options.format}`,\n fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,\n meta: {\n command: options.command,\n format: options.format,\n supportedFormats: options.supportedFormats,\n },\n });\n}\n\n/**\n * Driver is required for DB-connected commands but not provided.\n */\nexport function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {\n return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {\n domain: 'CLI',\n why: options?.why ?? 'Config.driver is required for DB-connected commands',\n fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n/**\n * Contract requires extension packs that are not provided by config descriptors.\n */\nexport function errorContractMissingExtensionPacks(options: {\n readonly missingExtensionPacks: readonly string[];\n readonly providedComponentIds: readonly string[];\n}): CliStructuredError {\n const missing = [...options.missingExtensionPacks].sort();\n return new CliStructuredError('4011', 'Missing extension packs in config', {\n domain: 'CLI',\n why:\n missing.length === 1\n ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`\n : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,\n fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n meta: {\n missingExtensionPacks: missing,\n providedComponentIds: [...options.providedComponentIds].sort(),\n },\n });\n}\n\n/**\n * Migration planning failed due to conflicts.\n */\nexport function errorMigrationPlanningFailed(options: {\n readonly conflicts: readonly CliErrorConflict[];\n readonly why?: string;\n}): CliStructuredError {\n // Build \"why\" from conflict summaries - these contain the actual problem description\n const conflictSummaries = options.conflicts.map((c) => c.summary);\n const computedWhy = options.why ?? conflictSummaries.join('\\n');\n\n // Build \"fix\" from conflict \"why\" fields - these contain actionable advice\n const conflictFixes = options.conflicts\n .map((c) => c.why)\n .filter((why): why is string => typeof why === 'string');\n const computedFix =\n conflictFixes.length > 0\n ? conflictFixes.join('\\n')\n : 'Use `db schema-verify` to inspect conflicts, or ensure the database is empty';\n\n return new CliStructuredError('4020', 'Migration planning failed', {\n domain: 'CLI',\n why: computedWhy,\n fix: computedFix,\n meta: { conflicts: options.conflicts },\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Target does not support migrations (missing createPlanner/createRunner).\n */\nexport function errorTargetMigrationNotSupported(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4021', 'Target does not support migrations', {\n domain: 'CLI',\n why: options?.why ?? 'The configured target does not provide migration planner/runner',\n fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',\n docsUrl: 'https://prisma-next.dev/docs/cli/db-init',\n });\n}\n\n/**\n * Config validation error (missing required fields).\n */\nexport function errorConfigValidation(\n field: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4001', 'Config file not found', {\n domain: 'CLI',\n why: options?.why ?? `Config must have a \"${field}\" field`,\n fix: \"Run 'prisma-next init' to create a config file\",\n docsUrl: 'https://prisma-next.dev/docs/cli/config',\n });\n}\n\n// ============================================================================\n// Runtime Errors (PN-RTM-3000-3003)\n// ============================================================================\n\n/**\n * Contract marker not found in database.\n */\nexport function errorMarkerMissing(options?: {\n readonly why?: string;\n readonly dbUrl?: string;\n}): CliStructuredError {\n return new CliStructuredError('3001', 'Marker missing', {\n domain: 'RTM',\n why: options?.why ?? 'Contract marker not found in database',\n fix: 'Run `prisma-next db sign --db <url>` to create marker',\n });\n}\n\n/**\n * Contract hash does not match database marker.\n */\nexport function errorHashMismatch(options?: {\n readonly why?: string;\n readonly expected?: string;\n readonly actual?: string;\n}): CliStructuredError {\n return new CliStructuredError('3002', 'Hash mismatch', {\n domain: 'RTM',\n why: options?.why ?? 'Contract hash does not match database marker',\n fix: 'Migrate database or re-sign if intentional',\n ...(options?.expected || options?.actual\n ? {\n meta: {\n ...(options.expected ? { expected: options.expected } : {}),\n ...(options.actual ? { actual: options.actual } : {}),\n },\n }\n : {}),\n });\n}\n\n/**\n * Contract target does not match config target.\n */\nexport function errorTargetMismatch(\n expected: string,\n actual: string,\n options?: {\n readonly why?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('3003', 'Target mismatch', {\n domain: 'RTM',\n why:\n options?.why ??\n `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n fix: 'Align contract target and config target',\n meta: { expected, actual },\n });\n}\n\n/**\n * Generic runtime error.\n */\nexport function errorRuntime(\n summary: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n readonly meta?: Record<string, unknown>;\n },\n): CliStructuredError {\n return new CliStructuredError('3000', summary, {\n domain: 'RTM',\n ...(options?.why ? { why: options.why } : { why: 'Verification failed' }),\n ...(options?.fix ? { fix: options.fix } : { fix: 'Check contract and database state' }),\n ...(options?.meta ? { meta: options.meta } : {}),\n });\n}\n\n// ============================================================================\n// Generic Error\n// ============================================================================\n\n/**\n * Generic unexpected error.\n */\nexport function errorUnexpected(\n message: string,\n options?: {\n readonly why?: string;\n readonly fix?: string;\n },\n): CliStructuredError {\n return new CliStructuredError('4999', 'Unexpected error', {\n domain: 'CLI',\n why: options?.why ?? message,\n fix: options?.fix ?? 'Check the error message and try again',\n });\n}\n"],"mappings":";AAkCO,IAAM,qBAAN,cAAiC,MAAM;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAMA;AAAA,EACA;AAAA,EAET,YACE,MACA,SACA,SASA;AACA,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,SAAS,SAAS,UAAU;AACjC,SAAK,WAAW,SAAS,YAAY;AACrC,SAAK,MAAM,SAAS;AACpB,SAAK,MAAM,SAAS;AACpB,SAAK,QAAQ,SAAS,QAClB;AAAA,MACE,MAAM,QAAQ,MAAM;AAAA,MACpB,MAAM,QAAQ,MAAM;AAAA,IACtB,IACA;AACJ,SAAK,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