@prisma-next/core-control-plane 0.3.0-dev.4 → 0.3.0-dev.6
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-types.d.ts +68 -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 +183 -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-validation.d.ts +2 -18
- package/dist/exports/config-validation.d.ts.map +1 -0
- package/dist/exports/emission.d.ts +5 -42
- package/dist/exports/emission.d.ts.map +1 -0
- package/dist/exports/errors.d.ts +3 -184
- package/dist/exports/errors.d.ts.map +1 -0
- package/dist/exports/schema-view.d.ts +2 -87
- package/dist/exports/schema-view.d.ts.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/types.d.ts +400 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +7 -6
- package/src/config-types.ts +157 -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 +426 -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/types.ts +37 -0
- package/src/migrations.ts +247 -0
- package/src/schema-view.ts +95 -0
- package/src/types.ts +512 -0
package/src/errors.ts
ADDED
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI error envelope for output formatting.
|
|
3
|
+
* This is the serialized form of a CliStructuredError.
|
|
4
|
+
*/
|
|
5
|
+
export interface CliErrorEnvelope {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly domain: string;
|
|
8
|
+
readonly severity: 'error' | 'warn' | 'info';
|
|
9
|
+
readonly summary: string;
|
|
10
|
+
readonly why: string | undefined;
|
|
11
|
+
readonly fix: string | undefined;
|
|
12
|
+
readonly where:
|
|
13
|
+
| {
|
|
14
|
+
readonly path: string | undefined;
|
|
15
|
+
readonly line: number | undefined;
|
|
16
|
+
}
|
|
17
|
+
| undefined;
|
|
18
|
+
readonly meta: Record<string, unknown> | undefined;
|
|
19
|
+
readonly docsUrl: string | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Minimal conflict data structure expected by CLI output.
|
|
24
|
+
*/
|
|
25
|
+
export interface CliErrorConflict {
|
|
26
|
+
readonly kind: string;
|
|
27
|
+
readonly summary: string;
|
|
28
|
+
readonly why?: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Structured CLI error that contains all information needed for error envelopes.
|
|
33
|
+
* Call sites throw these errors with full context.
|
|
34
|
+
*/
|
|
35
|
+
export class CliStructuredError extends Error {
|
|
36
|
+
readonly code: string;
|
|
37
|
+
readonly domain: 'CLI' | 'RTM';
|
|
38
|
+
readonly severity: 'error' | 'warn' | 'info';
|
|
39
|
+
readonly why: string | undefined;
|
|
40
|
+
readonly fix: string | undefined;
|
|
41
|
+
readonly where:
|
|
42
|
+
| {
|
|
43
|
+
readonly path: string | undefined;
|
|
44
|
+
readonly line: number | undefined;
|
|
45
|
+
}
|
|
46
|
+
| undefined;
|
|
47
|
+
readonly meta: Record<string, unknown> | undefined;
|
|
48
|
+
readonly docsUrl: string | undefined;
|
|
49
|
+
|
|
50
|
+
constructor(
|
|
51
|
+
code: string,
|
|
52
|
+
summary: string,
|
|
53
|
+
options?: {
|
|
54
|
+
readonly domain?: 'CLI' | 'RTM';
|
|
55
|
+
readonly severity?: 'error' | 'warn' | 'info';
|
|
56
|
+
readonly why?: string;
|
|
57
|
+
readonly fix?: string;
|
|
58
|
+
readonly where?: { readonly path?: string; readonly line?: number };
|
|
59
|
+
readonly meta?: Record<string, unknown>;
|
|
60
|
+
readonly docsUrl?: string;
|
|
61
|
+
},
|
|
62
|
+
) {
|
|
63
|
+
super(summary);
|
|
64
|
+
this.name = 'CliStructuredError';
|
|
65
|
+
this.code = code;
|
|
66
|
+
this.domain = options?.domain ?? 'CLI';
|
|
67
|
+
this.severity = options?.severity ?? 'error';
|
|
68
|
+
this.why = options?.why;
|
|
69
|
+
this.fix = options?.fix;
|
|
70
|
+
this.where = options?.where
|
|
71
|
+
? {
|
|
72
|
+
path: options.where.path,
|
|
73
|
+
line: options.where.line,
|
|
74
|
+
}
|
|
75
|
+
: undefined;
|
|
76
|
+
this.meta = options?.meta;
|
|
77
|
+
this.docsUrl = options?.docsUrl;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Converts this error to a CLI error envelope for output formatting.
|
|
82
|
+
*/
|
|
83
|
+
toEnvelope(): CliErrorEnvelope {
|
|
84
|
+
const codePrefix = this.domain === 'CLI' ? 'PN-CLI-' : 'PN-RTM-';
|
|
85
|
+
return {
|
|
86
|
+
code: `${codePrefix}${this.code}`,
|
|
87
|
+
domain: this.domain,
|
|
88
|
+
severity: this.severity,
|
|
89
|
+
summary: this.message,
|
|
90
|
+
why: this.why,
|
|
91
|
+
fix: this.fix,
|
|
92
|
+
where: this.where,
|
|
93
|
+
meta: this.meta,
|
|
94
|
+
docsUrl: this.docsUrl,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Config Errors (PN-CLI-4001-4007)
|
|
101
|
+
// ============================================================================
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Config file not found or missing.
|
|
105
|
+
*/
|
|
106
|
+
export function errorConfigFileNotFound(
|
|
107
|
+
configPath?: string,
|
|
108
|
+
options?: {
|
|
109
|
+
readonly why?: string;
|
|
110
|
+
},
|
|
111
|
+
): CliStructuredError {
|
|
112
|
+
return new CliStructuredError('4001', 'Config file not found', {
|
|
113
|
+
domain: 'CLI',
|
|
114
|
+
...(options?.why ? { why: options.why } : { why: 'Config file not found' }),
|
|
115
|
+
fix: "Run 'prisma-next init' to create a config file",
|
|
116
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/config',
|
|
117
|
+
...(configPath ? { where: { path: configPath } } : {}),
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Contract configuration missing from config.
|
|
123
|
+
*/
|
|
124
|
+
export function errorContractConfigMissing(options?: {
|
|
125
|
+
readonly why?: string;
|
|
126
|
+
}): CliStructuredError {
|
|
127
|
+
return new CliStructuredError('4002', 'Contract configuration missing', {
|
|
128
|
+
domain: 'CLI',
|
|
129
|
+
why: options?.why ?? 'The contract configuration is required for emit',
|
|
130
|
+
fix: 'Add contract configuration to your prisma-next.config.ts',
|
|
131
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/contract-emit',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Contract validation failed.
|
|
137
|
+
*/
|
|
138
|
+
export function errorContractValidationFailed(
|
|
139
|
+
reason: string,
|
|
140
|
+
options?: {
|
|
141
|
+
readonly where?: { readonly path?: string; readonly line?: number };
|
|
142
|
+
},
|
|
143
|
+
): CliStructuredError {
|
|
144
|
+
return new CliStructuredError('4003', 'Contract validation failed', {
|
|
145
|
+
domain: 'CLI',
|
|
146
|
+
why: reason,
|
|
147
|
+
fix: 'Re-run `prisma-next contract emit`, or fix the contract file and try again',
|
|
148
|
+
docsUrl: 'https://prisma-next.dev/docs/contracts',
|
|
149
|
+
...(options?.where ? { where: options.where } : {}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* File not found.
|
|
155
|
+
*/
|
|
156
|
+
export function errorFileNotFound(
|
|
157
|
+
filePath: string,
|
|
158
|
+
options?: {
|
|
159
|
+
readonly why?: string;
|
|
160
|
+
readonly fix?: string;
|
|
161
|
+
readonly docsUrl?: string;
|
|
162
|
+
},
|
|
163
|
+
): CliStructuredError {
|
|
164
|
+
return new CliStructuredError('4004', 'File not found', {
|
|
165
|
+
domain: 'CLI',
|
|
166
|
+
why: options?.why ?? `File not found: ${filePath}`,
|
|
167
|
+
fix: options?.fix ?? 'Check that the file path is correct',
|
|
168
|
+
where: { path: filePath },
|
|
169
|
+
...(options?.docsUrl ? { docsUrl: options.docsUrl } : {}),
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Database URL is required but not provided.
|
|
175
|
+
*/
|
|
176
|
+
export function errorDatabaseUrlRequired(options?: { readonly why?: string }): CliStructuredError {
|
|
177
|
+
return new CliStructuredError('4005', 'Database URL is required', {
|
|
178
|
+
domain: 'CLI',
|
|
179
|
+
why: options?.why ?? 'Database URL is required for this command',
|
|
180
|
+
fix: 'Provide `--db <url>` or set `db: { url: "postgres://…" }` in prisma-next.config.ts',
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Query runner factory is required but not provided in config.
|
|
186
|
+
*/
|
|
187
|
+
export function errorQueryRunnerFactoryRequired(options?: {
|
|
188
|
+
readonly why?: string;
|
|
189
|
+
}): CliStructuredError {
|
|
190
|
+
return new CliStructuredError('4006', 'Query runner factory is required', {
|
|
191
|
+
domain: 'CLI',
|
|
192
|
+
why: options?.why ?? 'Config.db.queryRunnerFactory is required for db verify',
|
|
193
|
+
fix: 'Add db.queryRunnerFactory to prisma-next.config.ts',
|
|
194
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Family verify.readMarker is required but not provided.
|
|
200
|
+
*/
|
|
201
|
+
export function errorFamilyReadMarkerSqlRequired(options?: {
|
|
202
|
+
readonly why?: string;
|
|
203
|
+
}): CliStructuredError {
|
|
204
|
+
return new CliStructuredError('4007', 'Family readMarker() is required', {
|
|
205
|
+
domain: 'CLI',
|
|
206
|
+
why: options?.why ?? 'Family verify.readMarker is required for db verify',
|
|
207
|
+
fix: 'Ensure family.verify.readMarker() is exported by your family package',
|
|
208
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/db-verify',
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* JSON output format not supported.
|
|
214
|
+
*/
|
|
215
|
+
export function errorJsonFormatNotSupported(options: {
|
|
216
|
+
readonly command: string;
|
|
217
|
+
readonly format: string;
|
|
218
|
+
readonly supportedFormats: readonly string[];
|
|
219
|
+
}): CliStructuredError {
|
|
220
|
+
return new CliStructuredError('4008', 'Unsupported JSON format', {
|
|
221
|
+
domain: 'CLI',
|
|
222
|
+
why: `The ${options.command} command does not support --json ${options.format}`,
|
|
223
|
+
fix: `Use --json ${options.supportedFormats.join(' or ')}, or omit --json for human output`,
|
|
224
|
+
meta: {
|
|
225
|
+
command: options.command,
|
|
226
|
+
format: options.format,
|
|
227
|
+
supportedFormats: options.supportedFormats,
|
|
228
|
+
},
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Driver is required for DB-connected commands but not provided.
|
|
234
|
+
*/
|
|
235
|
+
export function errorDriverRequired(options?: { readonly why?: string }): CliStructuredError {
|
|
236
|
+
return new CliStructuredError('4010', 'Driver is required for DB-connected commands', {
|
|
237
|
+
domain: 'CLI',
|
|
238
|
+
why: options?.why ?? 'Config.driver is required for DB-connected commands',
|
|
239
|
+
fix: 'Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)',
|
|
240
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/config',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Contract requires extension packs that are not provided by config descriptors.
|
|
246
|
+
*/
|
|
247
|
+
export function errorContractMissingExtensionPacks(options: {
|
|
248
|
+
readonly missingExtensionPacks: readonly string[];
|
|
249
|
+
readonly providedComponentIds: readonly string[];
|
|
250
|
+
}): CliStructuredError {
|
|
251
|
+
const missing = [...options.missingExtensionPacks].sort();
|
|
252
|
+
return new CliStructuredError('4011', 'Missing extension packs in config', {
|
|
253
|
+
domain: 'CLI',
|
|
254
|
+
why:
|
|
255
|
+
missing.length === 1
|
|
256
|
+
? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.`
|
|
257
|
+
: `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(', ')}, but CLI config does not provide matching descriptors.`,
|
|
258
|
+
fix: 'Add the missing extension descriptors to `extensions` in prisma-next.config.ts',
|
|
259
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/config',
|
|
260
|
+
meta: {
|
|
261
|
+
missingExtensionPacks: missing,
|
|
262
|
+
providedComponentIds: [...options.providedComponentIds].sort(),
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Migration planning failed due to conflicts.
|
|
269
|
+
*/
|
|
270
|
+
export function errorMigrationPlanningFailed(options: {
|
|
271
|
+
readonly conflicts: readonly CliErrorConflict[];
|
|
272
|
+
readonly why?: string;
|
|
273
|
+
}): CliStructuredError {
|
|
274
|
+
// Build "why" from conflict summaries - these contain the actual problem description
|
|
275
|
+
const conflictSummaries = options.conflicts.map((c) => c.summary);
|
|
276
|
+
const computedWhy = options.why ?? conflictSummaries.join('\n');
|
|
277
|
+
|
|
278
|
+
// Build "fix" from conflict "why" fields - these contain actionable advice
|
|
279
|
+
const conflictFixes = options.conflicts
|
|
280
|
+
.map((c) => c.why)
|
|
281
|
+
.filter((why): why is string => typeof why === 'string');
|
|
282
|
+
const computedFix =
|
|
283
|
+
conflictFixes.length > 0
|
|
284
|
+
? conflictFixes.join('\n')
|
|
285
|
+
: 'Use `db schema-verify` to inspect conflicts, or ensure the database is empty';
|
|
286
|
+
|
|
287
|
+
return new CliStructuredError('4020', 'Migration planning failed', {
|
|
288
|
+
domain: 'CLI',
|
|
289
|
+
why: computedWhy,
|
|
290
|
+
fix: computedFix,
|
|
291
|
+
meta: { conflicts: options.conflicts },
|
|
292
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/db-init',
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Target does not support migrations (missing createPlanner/createRunner).
|
|
298
|
+
*/
|
|
299
|
+
export function errorTargetMigrationNotSupported(options?: {
|
|
300
|
+
readonly why?: string;
|
|
301
|
+
}): CliStructuredError {
|
|
302
|
+
return new CliStructuredError('4021', 'Target does not support migrations', {
|
|
303
|
+
domain: 'CLI',
|
|
304
|
+
why: options?.why ?? 'The configured target does not provide migration planner/runner',
|
|
305
|
+
fix: 'Select a target that provides migrations (it must export `target.migrations` for db init)',
|
|
306
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/db-init',
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Config validation error (missing required fields).
|
|
312
|
+
*/
|
|
313
|
+
export function errorConfigValidation(
|
|
314
|
+
field: string,
|
|
315
|
+
options?: {
|
|
316
|
+
readonly why?: string;
|
|
317
|
+
},
|
|
318
|
+
): CliStructuredError {
|
|
319
|
+
return new CliStructuredError('4001', 'Config file not found', {
|
|
320
|
+
domain: 'CLI',
|
|
321
|
+
why: options?.why ?? `Config must have a "${field}" field`,
|
|
322
|
+
fix: "Run 'prisma-next init' to create a config file",
|
|
323
|
+
docsUrl: 'https://prisma-next.dev/docs/cli/config',
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// ============================================================================
|
|
328
|
+
// Runtime Errors (PN-RTM-3000-3003)
|
|
329
|
+
// ============================================================================
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Contract marker not found in database.
|
|
333
|
+
*/
|
|
334
|
+
export function errorMarkerMissing(options?: {
|
|
335
|
+
readonly why?: string;
|
|
336
|
+
readonly dbUrl?: string;
|
|
337
|
+
}): CliStructuredError {
|
|
338
|
+
return new CliStructuredError('3001', 'Marker missing', {
|
|
339
|
+
domain: 'RTM',
|
|
340
|
+
why: options?.why ?? 'Contract marker not found in database',
|
|
341
|
+
fix: 'Run `prisma-next db sign --db <url>` to create marker',
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* Contract hash does not match database marker.
|
|
347
|
+
*/
|
|
348
|
+
export function errorHashMismatch(options?: {
|
|
349
|
+
readonly why?: string;
|
|
350
|
+
readonly expected?: string;
|
|
351
|
+
readonly actual?: string;
|
|
352
|
+
}): CliStructuredError {
|
|
353
|
+
return new CliStructuredError('3002', 'Hash mismatch', {
|
|
354
|
+
domain: 'RTM',
|
|
355
|
+
why: options?.why ?? 'Contract hash does not match database marker',
|
|
356
|
+
fix: 'Migrate database or re-sign if intentional',
|
|
357
|
+
...(options?.expected || options?.actual
|
|
358
|
+
? {
|
|
359
|
+
meta: {
|
|
360
|
+
...(options.expected ? { expected: options.expected } : {}),
|
|
361
|
+
...(options.actual ? { actual: options.actual } : {}),
|
|
362
|
+
},
|
|
363
|
+
}
|
|
364
|
+
: {}),
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Contract target does not match config target.
|
|
370
|
+
*/
|
|
371
|
+
export function errorTargetMismatch(
|
|
372
|
+
expected: string,
|
|
373
|
+
actual: string,
|
|
374
|
+
options?: {
|
|
375
|
+
readonly why?: string;
|
|
376
|
+
},
|
|
377
|
+
): CliStructuredError {
|
|
378
|
+
return new CliStructuredError('3003', 'Target mismatch', {
|
|
379
|
+
domain: 'RTM',
|
|
380
|
+
why:
|
|
381
|
+
options?.why ??
|
|
382
|
+
`Contract target does not match config target (expected: ${expected}, actual: ${actual})`,
|
|
383
|
+
fix: 'Align contract target and config target',
|
|
384
|
+
meta: { expected, actual },
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Generic runtime error.
|
|
390
|
+
*/
|
|
391
|
+
export function errorRuntime(
|
|
392
|
+
summary: string,
|
|
393
|
+
options?: {
|
|
394
|
+
readonly why?: string;
|
|
395
|
+
readonly fix?: string;
|
|
396
|
+
readonly meta?: Record<string, unknown>;
|
|
397
|
+
},
|
|
398
|
+
): CliStructuredError {
|
|
399
|
+
return new CliStructuredError('3000', summary, {
|
|
400
|
+
domain: 'RTM',
|
|
401
|
+
...(options?.why ? { why: options.why } : { why: 'Verification failed' }),
|
|
402
|
+
...(options?.fix ? { fix: options.fix } : { fix: 'Check contract and database state' }),
|
|
403
|
+
...(options?.meta ? { meta: options.meta } : {}),
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// ============================================================================
|
|
408
|
+
// Generic Error
|
|
409
|
+
// ============================================================================
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Generic unexpected error.
|
|
413
|
+
*/
|
|
414
|
+
export function errorUnexpected(
|
|
415
|
+
message: string,
|
|
416
|
+
options?: {
|
|
417
|
+
readonly why?: string;
|
|
418
|
+
readonly fix?: string;
|
|
419
|
+
},
|
|
420
|
+
): CliStructuredError {
|
|
421
|
+
return new CliStructuredError('4999', 'Unexpected error', {
|
|
422
|
+
domain: 'CLI',
|
|
423
|
+
why: options?.why ?? message,
|
|
424
|
+
fix: options?.fix ?? 'Check the error message and try again',
|
|
425
|
+
});
|
|
426
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { validateConfig } from '../config-validation';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// Export emission functions and types
|
|
2
|
+
|
|
3
|
+
export { canonicalizeContract } from '../emission/canonicalization';
|
|
4
|
+
export { emit } from '../emission/emit';
|
|
5
|
+
export { computeCoreHash, computeProfileHash } from '../emission/hashing';
|
|
6
|
+
export type { EmitOptions, EmitResult } from '../emission/types';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type { CliErrorConflict, CliErrorEnvelope } from '../errors';
|
|
2
|
+
export {
|
|
3
|
+
CliStructuredError,
|
|
4
|
+
errorConfigFileNotFound,
|
|
5
|
+
errorConfigValidation,
|
|
6
|
+
errorContractConfigMissing,
|
|
7
|
+
errorContractMissingExtensionPacks,
|
|
8
|
+
errorContractValidationFailed,
|
|
9
|
+
errorDatabaseUrlRequired,
|
|
10
|
+
errorDriverRequired,
|
|
11
|
+
errorFamilyReadMarkerSqlRequired,
|
|
12
|
+
errorFileNotFound,
|
|
13
|
+
errorHashMismatch,
|
|
14
|
+
errorJsonFormatNotSupported,
|
|
15
|
+
errorMarkerMissing,
|
|
16
|
+
errorMigrationPlanningFailed,
|
|
17
|
+
errorQueryRunnerFactoryRequired,
|
|
18
|
+
errorRuntime,
|
|
19
|
+
errorTargetMigrationNotSupported,
|
|
20
|
+
errorTargetMismatch,
|
|
21
|
+
errorUnexpected,
|
|
22
|
+
} from '../errors';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { CoreSchemaView, SchemaNodeKind, SchemaTreeNode } from '../schema-view';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
// Control* types (ADR 151)
|
|
3
|
+
ControlAdapterDescriptor,
|
|
4
|
+
ControlAdapterInstance,
|
|
5
|
+
ControlDriverDescriptor,
|
|
6
|
+
ControlDriverInstance,
|
|
7
|
+
ControlExtensionDescriptor,
|
|
8
|
+
ControlExtensionInstance,
|
|
9
|
+
ControlFamilyDescriptor,
|
|
10
|
+
ControlFamilyInstance,
|
|
11
|
+
ControlTargetDescriptor,
|
|
12
|
+
ControlTargetInstance,
|
|
13
|
+
EmitContractResult,
|
|
14
|
+
IntrospectSchemaResult,
|
|
15
|
+
// Migration types (canonical, family-agnostic)
|
|
16
|
+
MigrationOperationClass,
|
|
17
|
+
MigrationOperationPolicy,
|
|
18
|
+
MigrationPlan,
|
|
19
|
+
MigrationPlanner,
|
|
20
|
+
MigrationPlannerConflict,
|
|
21
|
+
MigrationPlannerFailureResult,
|
|
22
|
+
MigrationPlannerResult,
|
|
23
|
+
MigrationPlannerSuccessResult,
|
|
24
|
+
MigrationPlanOperation,
|
|
25
|
+
MigrationRunner,
|
|
26
|
+
MigrationRunnerExecutionChecks,
|
|
27
|
+
MigrationRunnerFailure,
|
|
28
|
+
MigrationRunnerResult,
|
|
29
|
+
MigrationRunnerSuccessValue,
|
|
30
|
+
OperationContext,
|
|
31
|
+
SchemaIssue,
|
|
32
|
+
SchemaVerificationNode,
|
|
33
|
+
SignDatabaseResult,
|
|
34
|
+
TargetMigrationsCapability,
|
|
35
|
+
VerifyDatabaseResult,
|
|
36
|
+
VerifyDatabaseSchemaResult,
|
|
37
|
+
} from '../types';
|