@prisma-next/core-control-plane 0.3.0-pr.94.3 → 0.3.0-pr.95.2
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/chunk-YT6YGR3N.js +240 -0
- 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 +21 -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 -0
- package/dist/exports/config-types.d.ts.map +1 -0
- package/dist/exports/config-types.js +53 -0
- package/dist/exports/config-types.js.map +1 -0
- package/dist/exports/config-validation.d.ts +2 -0
- package/dist/exports/config-validation.d.ts.map +1 -0
- package/dist/exports/config-validation.js +252 -0
- package/dist/exports/config-validation.js.map +1 -0
- package/dist/exports/emission.d.ts +5 -0
- package/dist/exports/emission.d.ts.map +1 -0
- package/dist/exports/emission.js +317 -0
- package/dist/exports/emission.js.map +1 -0
- package/dist/exports/errors.d.ts +3 -0
- package/dist/exports/errors.d.ts.map +1 -0
- package/dist/exports/errors.js +43 -0
- package/dist/exports/errors.js.map +1 -0
- package/dist/exports/schema-view.d.ts +2 -0
- package/dist/exports/schema-view.d.ts.map +1 -0
- package/dist/exports/schema-view.js +1 -0
- package/dist/exports/schema-view.js.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 -0
- package/dist/exports/types.d.ts.map +1 -0
- package/dist/exports/types.js +1 -0
- package/dist/exports/types.js.map +1 -0
- package/dist/migrations.d.ts +190 -0
- package/dist/migrations.d.ts.map +1 -0
- package/dist/{schema-view-BG_ebqoV.d.mts → schema-view.d.ts} +10 -13
- 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 +36 -20
- package/src/emission/emit.ts +8 -1
- package/src/emission/types.ts +6 -1
- package/dist/config-types-h9ifypQ0.d.mts +0 -79
- package/dist/config-types-h9ifypQ0.d.mts.map +0 -1
- package/dist/config-types.d.mts +0 -2
- package/dist/config-types.mjs +0 -65
- package/dist/config-types.mjs.map +0 -1
- package/dist/config-validation.d.mts +0 -15
- package/dist/config-validation.d.mts.map +0 -1
- package/dist/config-validation.mjs +0 -79
- package/dist/config-validation.mjs.map +0 -1
- package/dist/emission.d.mts +0 -47
- package/dist/emission.d.mts.map +0 -1
- package/dist/emission.mjs +0 -255
- package/dist/emission.mjs.map +0 -1
- package/dist/errors-Qlh0sdcb.mjs +0 -276
- package/dist/errors-Qlh0sdcb.mjs.map +0 -1
- package/dist/errors.d.mts +0 -191
- package/dist/errors.d.mts.map +0 -1
- package/dist/errors.mjs +0 -3
- package/dist/schema-view-BG_ebqoV.d.mts.map +0 -1
- package/dist/schema-view.d.mts +0 -2
- package/dist/schema-view.mjs +0 -1
- package/dist/stack.d.mts +0 -30
- package/dist/stack.d.mts.map +0 -1
- package/dist/stack.mjs +0 -30
- package/dist/stack.mjs.map +0 -1
- package/dist/types-CsaU_uQP.d.mts +0 -595
- package/dist/types-CsaU_uQP.d.mts.map +0 -1
- package/dist/types.d.mts +0 -2
- package/dist/types.mjs +0 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
// src/errors.ts
|
|
2
|
+
var CliStructuredError = class extends Error {
|
|
3
|
+
code;
|
|
4
|
+
domain;
|
|
5
|
+
severity;
|
|
6
|
+
why;
|
|
7
|
+
fix;
|
|
8
|
+
where;
|
|
9
|
+
meta;
|
|
10
|
+
docsUrl;
|
|
11
|
+
constructor(code, summary, options) {
|
|
12
|
+
super(summary);
|
|
13
|
+
this.name = "CliStructuredError";
|
|
14
|
+
this.code = code;
|
|
15
|
+
this.domain = options?.domain ?? "CLI";
|
|
16
|
+
this.severity = options?.severity ?? "error";
|
|
17
|
+
this.why = options?.why;
|
|
18
|
+
this.fix = options?.fix;
|
|
19
|
+
this.where = options?.where ? {
|
|
20
|
+
path: options.where.path,
|
|
21
|
+
line: options.where.line
|
|
22
|
+
} : void 0;
|
|
23
|
+
this.meta = options?.meta;
|
|
24
|
+
this.docsUrl = options?.docsUrl;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Converts this error to a CLI error envelope for output formatting.
|
|
28
|
+
*/
|
|
29
|
+
toEnvelope() {
|
|
30
|
+
const codePrefix = this.domain === "CLI" ? "PN-CLI-" : "PN-RTM-";
|
|
31
|
+
return {
|
|
32
|
+
code: `${codePrefix}${this.code}`,
|
|
33
|
+
domain: this.domain,
|
|
34
|
+
severity: this.severity,
|
|
35
|
+
summary: this.message,
|
|
36
|
+
why: this.why,
|
|
37
|
+
fix: this.fix,
|
|
38
|
+
where: this.where,
|
|
39
|
+
meta: this.meta,
|
|
40
|
+
docsUrl: this.docsUrl
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Type guard to check if an error is a CliStructuredError.
|
|
45
|
+
* Uses duck-typing to work across module boundaries where instanceof may fail.
|
|
46
|
+
*/
|
|
47
|
+
static is(error) {
|
|
48
|
+
if (!(error instanceof Error)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const candidate = error;
|
|
52
|
+
return candidate.name === "CliStructuredError" && typeof candidate.code === "string" && (candidate.domain === "CLI" || candidate.domain === "RTM") && typeof candidate.toEnvelope === "function";
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function errorConfigFileNotFound(configPath, options) {
|
|
56
|
+
return new CliStructuredError("4001", "Config file not found", {
|
|
57
|
+
domain: "CLI",
|
|
58
|
+
...options?.why ? { why: options.why } : { why: "Config file not found" },
|
|
59
|
+
fix: "Run 'prisma-next init' to create a config file",
|
|
60
|
+
docsUrl: "https://prisma-next.dev/docs/cli/config",
|
|
61
|
+
...configPath ? { where: { path: configPath } } : {}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function errorContractConfigMissing(options) {
|
|
65
|
+
return new CliStructuredError("4002", "Contract configuration missing", {
|
|
66
|
+
domain: "CLI",
|
|
67
|
+
why: options?.why ?? "The contract configuration is required for emit",
|
|
68
|
+
fix: "Add contract configuration to your prisma-next.config.ts",
|
|
69
|
+
docsUrl: "https://prisma-next.dev/docs/cli/contract-emit"
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function errorContractValidationFailed(reason, options) {
|
|
73
|
+
return new CliStructuredError("4003", "Contract validation failed", {
|
|
74
|
+
domain: "CLI",
|
|
75
|
+
why: reason,
|
|
76
|
+
fix: "Re-run `prisma-next contract emit`, or fix the contract file and try again",
|
|
77
|
+
docsUrl: "https://prisma-next.dev/docs/contracts",
|
|
78
|
+
...options?.where ? { where: options.where } : {}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function errorFileNotFound(filePath, options) {
|
|
82
|
+
return new CliStructuredError("4004", "File not found", {
|
|
83
|
+
domain: "CLI",
|
|
84
|
+
why: options?.why ?? `File not found: ${filePath}`,
|
|
85
|
+
fix: options?.fix ?? "Check that the file path is correct",
|
|
86
|
+
where: { path: filePath },
|
|
87
|
+
...options?.docsUrl ? { docsUrl: options.docsUrl } : {}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function errorDatabaseConnectionRequired(options) {
|
|
91
|
+
return new CliStructuredError("4005", "Database connection is required", {
|
|
92
|
+
domain: "CLI",
|
|
93
|
+
why: options?.why ?? "Database connection is required for this command",
|
|
94
|
+
fix: 'Provide `--db <url>` or set `db: { connection: "postgres://\u2026" }` in prisma-next.config.ts'
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function errorQueryRunnerFactoryRequired(options) {
|
|
98
|
+
return new CliStructuredError("4006", "Query runner factory is required", {
|
|
99
|
+
domain: "CLI",
|
|
100
|
+
why: options?.why ?? "Config.db.queryRunnerFactory is required for db verify",
|
|
101
|
+
fix: "Add db.queryRunnerFactory to prisma-next.config.ts",
|
|
102
|
+
docsUrl: "https://prisma-next.dev/docs/cli/db-verify"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function errorFamilyReadMarkerSqlRequired(options) {
|
|
106
|
+
return new CliStructuredError("4007", "Family readMarker() is required", {
|
|
107
|
+
domain: "CLI",
|
|
108
|
+
why: options?.why ?? "Family verify.readMarker is required for db verify",
|
|
109
|
+
fix: "Ensure family.verify.readMarker() is exported by your family package",
|
|
110
|
+
docsUrl: "https://prisma-next.dev/docs/cli/db-verify"
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
function errorJsonFormatNotSupported(options) {
|
|
114
|
+
return new CliStructuredError("4008", "Unsupported JSON format", {
|
|
115
|
+
domain: "CLI",
|
|
116
|
+
why: `The ${options.command} command does not support --json ${options.format}`,
|
|
117
|
+
fix: `Use --json ${options.supportedFormats.join(" or ")}, or omit --json for human output`,
|
|
118
|
+
meta: {
|
|
119
|
+
command: options.command,
|
|
120
|
+
format: options.format,
|
|
121
|
+
supportedFormats: options.supportedFormats
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function errorDriverRequired(options) {
|
|
126
|
+
return new CliStructuredError("4010", "Driver is required for DB-connected commands", {
|
|
127
|
+
domain: "CLI",
|
|
128
|
+
why: options?.why ?? "Config.driver is required for DB-connected commands",
|
|
129
|
+
fix: "Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)",
|
|
130
|
+
docsUrl: "https://prisma-next.dev/docs/cli/config"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
function errorContractMissingExtensionPacks(options) {
|
|
134
|
+
const missing = [...options.missingExtensionPacks].sort();
|
|
135
|
+
return new CliStructuredError("4011", "Missing extension packs in config", {
|
|
136
|
+
domain: "CLI",
|
|
137
|
+
why: missing.length === 1 ? `Contract requires extension pack '${missing[0]}', but CLI config does not provide a matching descriptor.` : `Contract requires extension packs ${missing.map((p) => `'${p}'`).join(", ")}, but CLI config does not provide matching descriptors.`,
|
|
138
|
+
fix: "Add the missing extension descriptors to `extensions` in prisma-next.config.ts",
|
|
139
|
+
docsUrl: "https://prisma-next.dev/docs/cli/config",
|
|
140
|
+
meta: {
|
|
141
|
+
missingExtensionPacks: missing,
|
|
142
|
+
providedComponentIds: [...options.providedComponentIds].sort()
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function errorMigrationPlanningFailed(options) {
|
|
147
|
+
const conflictSummaries = options.conflicts.map((c) => c.summary);
|
|
148
|
+
const computedWhy = options.why ?? conflictSummaries.join("\n");
|
|
149
|
+
const conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === "string");
|
|
150
|
+
const computedFix = conflictFixes.length > 0 ? conflictFixes.join("\n") : "Use `db schema-verify` to inspect conflicts, or ensure the database is empty";
|
|
151
|
+
return new CliStructuredError("4020", "Migration planning failed", {
|
|
152
|
+
domain: "CLI",
|
|
153
|
+
why: computedWhy,
|
|
154
|
+
fix: computedFix,
|
|
155
|
+
meta: { conflicts: options.conflicts },
|
|
156
|
+
docsUrl: "https://prisma-next.dev/docs/cli/db-init"
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
function errorTargetMigrationNotSupported(options) {
|
|
160
|
+
return new CliStructuredError("4021", "Target does not support migrations", {
|
|
161
|
+
domain: "CLI",
|
|
162
|
+
why: options?.why ?? "The configured target does not provide migration planner/runner",
|
|
163
|
+
fix: "Select a target that provides migrations (it must export `target.migrations` for db init)",
|
|
164
|
+
docsUrl: "https://prisma-next.dev/docs/cli/db-init"
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function errorConfigValidation(field, options) {
|
|
168
|
+
return new CliStructuredError("4001", "Config file not found", {
|
|
169
|
+
domain: "CLI",
|
|
170
|
+
why: options?.why ?? `Config must have a "${field}" field`,
|
|
171
|
+
fix: "Run 'prisma-next init' to create a config file",
|
|
172
|
+
docsUrl: "https://prisma-next.dev/docs/cli/config"
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function errorMarkerMissing(options) {
|
|
176
|
+
return new CliStructuredError("3001", "Marker missing", {
|
|
177
|
+
domain: "RTM",
|
|
178
|
+
why: options?.why ?? "Contract marker not found in database",
|
|
179
|
+
fix: "Run `prisma-next db sign --db <url>` to create marker"
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function errorHashMismatch(options) {
|
|
183
|
+
return new CliStructuredError("3002", "Hash mismatch", {
|
|
184
|
+
domain: "RTM",
|
|
185
|
+
why: options?.why ?? "Contract hash does not match database marker",
|
|
186
|
+
fix: "Migrate database or re-sign if intentional",
|
|
187
|
+
...options?.expected || options?.actual ? {
|
|
188
|
+
meta: {
|
|
189
|
+
...options.expected ? { expected: options.expected } : {},
|
|
190
|
+
...options.actual ? { actual: options.actual } : {}
|
|
191
|
+
}
|
|
192
|
+
} : {}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function errorTargetMismatch(expected, actual, options) {
|
|
196
|
+
return new CliStructuredError("3003", "Target mismatch", {
|
|
197
|
+
domain: "RTM",
|
|
198
|
+
why: options?.why ?? `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,
|
|
199
|
+
fix: "Align contract target and config target",
|
|
200
|
+
meta: { expected, actual }
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function errorRuntime(summary, options) {
|
|
204
|
+
return new CliStructuredError("3000", summary, {
|
|
205
|
+
domain: "RTM",
|
|
206
|
+
...options?.why ? { why: options.why } : { why: "Verification failed" },
|
|
207
|
+
...options?.fix ? { fix: options.fix } : { fix: "Check contract and database state" },
|
|
208
|
+
...options?.meta ? { meta: options.meta } : {}
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function errorUnexpected(message, options) {
|
|
212
|
+
return new CliStructuredError("4999", "Unexpected error", {
|
|
213
|
+
domain: "CLI",
|
|
214
|
+
why: options?.why ?? message,
|
|
215
|
+
fix: options?.fix ?? "Check the error message and try again"
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export {
|
|
220
|
+
CliStructuredError,
|
|
221
|
+
errorConfigFileNotFound,
|
|
222
|
+
errorContractConfigMissing,
|
|
223
|
+
errorContractValidationFailed,
|
|
224
|
+
errorFileNotFound,
|
|
225
|
+
errorDatabaseConnectionRequired,
|
|
226
|
+
errorQueryRunnerFactoryRequired,
|
|
227
|
+
errorFamilyReadMarkerSqlRequired,
|
|
228
|
+
errorJsonFormatNotSupported,
|
|
229
|
+
errorDriverRequired,
|
|
230
|
+
errorContractMissingExtensionPacks,
|
|
231
|
+
errorMigrationPlanningFailed,
|
|
232
|
+
errorTargetMigrationNotSupported,
|
|
233
|
+
errorConfigValidation,
|
|
234
|
+
errorMarkerMissing,
|
|
235
|
+
errorHashMismatch,
|
|
236
|
+
errorTargetMismatch,
|
|
237
|
+
errorRuntime,
|
|
238
|
+
errorUnexpected
|
|
239
|
+
};
|
|
240
|
+
//# sourceMappingURL=chunk-YT6YGR3N.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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 * Type guard to check if an error is a CliStructuredError.\n * Uses duck-typing to work across module boundaries where instanceof may fail.\n */\n static is(error: unknown): error is CliStructuredError {\n if (!(error instanceof Error)) {\n return false;\n }\n const candidate = error as CliStructuredError;\n return (\n candidate.name === 'CliStructuredError' &&\n typeof candidate.code === 'string' &&\n (candidate.domain === 'CLI' || candidate.domain === 'RTM') &&\n typeof candidate.toEnvelope === 'function'\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 connection is required but not provided.\n */\nexport function errorDatabaseConnectionRequired(options?: {\n readonly why?: string;\n}): CliStructuredError {\n return new CliStructuredError('4005', 'Database connection is required', {\n domain: 'CLI',\n why: options?.why ?? 'Database connection is required for this command',\n fix: 'Provide `--db <url>` or set `db: { connection: \"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,OAAO,SAAS;AACrB,SAAK,UAAU,SAAS;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA,EAKA,aAA+B;AAC7B,UAAM,aAAa,KAAK,WAAW,QAAQ,YAAY;AACvD,WAAO;AAAA,MACL,MAAM,GAAG,UAAU,GAAG,KAAK,IAAI;AAAA,MAC/B,QAAQ,KAAK;AAAA,MACb,UAAU,KAAK;AAAA,MACf,SAAS,KAAK;AAAA,MACd,KAAK,KAAK;AAAA,MACV,KAAK,KAAK;AAAA,MACV,OAAO,KAAK;AAAA,MACZ,MA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CAAC;AACH;","names":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { ControlAdapterDescriptor, ControlDriverDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlTargetDescriptor } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Type alias for CLI driver instances.
|
|
4
|
+
* Uses string for both family and target IDs for maximum flexibility.
|
|
5
|
+
*/
|
|
6
|
+
export type CliDriver = ControlDriverInstance<string, string>;
|
|
7
|
+
/**
|
|
8
|
+
* Contract configuration specifying source and artifact locations.
|
|
9
|
+
*/
|
|
10
|
+
export interface ContractConfig {
|
|
11
|
+
/**
|
|
12
|
+
* Contract source. Can be a value or a function that returns a value (sync or async).
|
|
13
|
+
* If a function, it will be called to resolve the contract.
|
|
14
|
+
*/
|
|
15
|
+
readonly source: unknown | (() => unknown | Promise<unknown>);
|
|
16
|
+
/**
|
|
17
|
+
* Path to contract.json artifact. Defaults to 'src/prisma/contract.json'.
|
|
18
|
+
* This is the canonical location where other CLI commands can find the contract JSON.
|
|
19
|
+
*/
|
|
20
|
+
readonly output?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Path to contract.d.ts artifact. Defaults to output with .d.ts extension.
|
|
23
|
+
* If output ends with .json, replaces .json with .d.ts.
|
|
24
|
+
* Otherwise, appends .d.ts to the directory containing output.
|
|
25
|
+
*/
|
|
26
|
+
readonly types?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Configuration for Prisma Next CLI.
|
|
30
|
+
* Uses Control*Descriptor types for type-safe wiring with compile-time compatibility checks.
|
|
31
|
+
*
|
|
32
|
+
* @template TFamilyId - The family ID (e.g., 'sql', 'document')
|
|
33
|
+
* @template TTargetId - The target ID (e.g., 'postgres', 'mysql')
|
|
34
|
+
* @template TConnection - The driver connection input type (defaults to `unknown` for config flexibility)
|
|
35
|
+
*/
|
|
36
|
+
export interface PrismaNextConfig<TFamilyId extends string = string, TTargetId extends string = string, TConnection = unknown> {
|
|
37
|
+
readonly family: ControlFamilyDescriptor<TFamilyId>;
|
|
38
|
+
readonly target: ControlTargetDescriptor<TFamilyId, TTargetId>;
|
|
39
|
+
readonly adapter: ControlAdapterDescriptor<TFamilyId, TTargetId>;
|
|
40
|
+
readonly extensionPacks?: readonly ControlExtensionDescriptor<TFamilyId, TTargetId>[];
|
|
41
|
+
/**
|
|
42
|
+
* Driver descriptor for DB-connected CLI commands.
|
|
43
|
+
* Required for DB-connected commands (e.g., db verify).
|
|
44
|
+
* Optional for commands that don't need database access (e.g., emit).
|
|
45
|
+
* The driver's connection type matches the TConnection config parameter.
|
|
46
|
+
*/
|
|
47
|
+
readonly driver?: ControlDriverDescriptor<TFamilyId, TTargetId, ControlDriverInstance<TFamilyId, TTargetId>, TConnection>;
|
|
48
|
+
/**
|
|
49
|
+
* Database connection configuration.
|
|
50
|
+
* The connection type is driver-specific (e.g., URL string for Postgres).
|
|
51
|
+
*/
|
|
52
|
+
readonly db?: {
|
|
53
|
+
/**
|
|
54
|
+
* Driver-specific connection input.
|
|
55
|
+
* For Postgres: a connection string (URL).
|
|
56
|
+
* For other drivers: may be a structured object.
|
|
57
|
+
*/
|
|
58
|
+
readonly connection?: TConnection;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Contract configuration. Specifies source and artifact locations.
|
|
62
|
+
* Required for emit command; optional for other commands that only read artifacts.
|
|
63
|
+
*/
|
|
64
|
+
readonly contract?: ContractConfig;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Helper function to define a Prisma Next config.
|
|
68
|
+
* Validates and normalizes the config using Arktype, then returns the normalized IR.
|
|
69
|
+
*
|
|
70
|
+
* Normalization:
|
|
71
|
+
* - contract.output defaults to 'src/prisma/contract.json' if missing
|
|
72
|
+
* - contract.types defaults to output with .d.ts extension if missing
|
|
73
|
+
*
|
|
74
|
+
* @param config - Raw config input from user
|
|
75
|
+
* @returns Normalized config IR with defaults applied
|
|
76
|
+
* @throws Error if config structure is invalid
|
|
77
|
+
*/
|
|
78
|
+
export declare function defineConfig<TFamilyId extends string = string, TTargetId extends string = string>(config: PrismaNextConfig<TFamilyId, TTargetId>): PrismaNextConfig<TFamilyId, TTargetId>;
|
|
79
|
+
//# sourceMappingURL=config-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,EACxB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9D;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAC/B,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,SAAS,SAAS,MAAM,GAAG,MAAM,EACjC,WAAW,GAAG,OAAO;IAErB,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,uBAAuB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,wBAAwB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACjE,QAAQ,CAAC,cAAc,CAAC,EAAE,SAAS,0BAA0B,CAAC,SAAS,EAAE,SAAS,CAAC,EAAE,CAAC;IACtF;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CACvC,SAAS,EACT,SAAS,EACT,qBAAqB,CAAC,SAAS,EAAE,SAAS,CAAC,EAC3C,WAAW,CACZ,CAAC;IACF;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE;QACZ;;;;WAIG;QACH,QAAQ,CAAC,UAAU,CAAC,EAAE,WAAW,CAAC;KACnC,CAAC;IACF;;;OAGG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;CACpC;AA0BD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,SAAS,SAAS,MAAM,GAAG,MAAM,EAAE,SAAS,SAAS,MAAM,GAAG,MAAM,EAC/F,MAAM,EAAE,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,GAC7C,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAgDxC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PrismaNextConfig } from './config-types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates that the config has the required structure.
|
|
4
|
+
* This is pure validation logic with no file I/O or CLI awareness.
|
|
5
|
+
*
|
|
6
|
+
* @param config - Config object to validate
|
|
7
|
+
* @throws CliStructuredError if config structure is invalid
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateConfig(config: unknown): asserts config is PrismaNextConfig;
|
|
10
|
+
//# sourceMappingURL=config-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-validation.d.ts","sourceRoot":"","sources":["../src/config-validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGvD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,IAAI,gBAAgB,CAmQlF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonicalization.d.ts","sourceRoot":"","sources":["../../src/emission/canonicalization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AA6N3D,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,UAAU,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3D,MAAM,CA6BR"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ContractIR } from '@prisma-next/contract/ir';
|
|
2
|
+
import type { TargetFamilyHook } from '@prisma-next/contract/types';
|
|
3
|
+
import type { EmitOptions, EmitResult } from './types';
|
|
4
|
+
export declare function emit(ir: ContractIR, options: EmitOptions, targetFamily: TargetFamilyHook): Promise<EmitResult>;
|
|
5
|
+
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../src/emission/emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,6BAA6B,CAAC;AAIvF,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAmCvD,wBAAsB,IAAI,CACxB,EAAE,EAAE,UAAU,EACd,OAAO,EAAE,WAAW,EACpB,YAAY,EAAE,gBAAgB,GAC7B,OAAO,CAAC,UAAU,CAAC,CAgFrB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type ContractInput = {
|
|
2
|
+
schemaVersion: string;
|
|
3
|
+
targetFamily: string;
|
|
4
|
+
target: string;
|
|
5
|
+
models: Record<string, unknown>;
|
|
6
|
+
relations: Record<string, unknown>;
|
|
7
|
+
storage: Record<string, unknown>;
|
|
8
|
+
extensionPacks: Record<string, unknown>;
|
|
9
|
+
sources: Record<string, unknown>;
|
|
10
|
+
capabilities: Record<string, Record<string, boolean>>;
|
|
11
|
+
meta: Record<string, unknown>;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
export declare function computeCoreHash(contract: ContractInput): string;
|
|
15
|
+
export declare function computeProfileHash(contract: ContractInput): string;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=hashing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hashing.d.ts","sourceRoot":"","sources":["../../src/emission/hashing.ts"],"names":[],"mappings":"AAIA,KAAK,aAAa,GAAG;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAQF,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAe/D;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAelE"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { TypeRenderEntry, TypesImportSpec } from '@prisma-next/contract/types';
|
|
2
|
+
import type { OperationRegistry } from '@prisma-next/operations';
|
|
3
|
+
export interface EmitOptions {
|
|
4
|
+
readonly outputDir: string;
|
|
5
|
+
readonly operationRegistry?: OperationRegistry;
|
|
6
|
+
readonly codecTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
7
|
+
readonly operationTypeImports?: ReadonlyArray<TypesImportSpec>;
|
|
8
|
+
readonly extensionIds?: ReadonlyArray<string>;
|
|
9
|
+
/**
|
|
10
|
+
* Normalized parameterized type renderers, keyed by codecId.
|
|
11
|
+
* These are extracted from descriptors and normalized during assembly.
|
|
12
|
+
*/
|
|
13
|
+
readonly parameterizedRenderers?: Map<string, TypeRenderEntry>;
|
|
14
|
+
}
|
|
15
|
+
export interface EmitResult {
|
|
16
|
+
readonly contractJson: string;
|
|
17
|
+
readonly contractDts: string;
|
|
18
|
+
readonly coreHash: string;
|
|
19
|
+
readonly profileHash: string;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/emission/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IAC/C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC3D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IAC/D,QAAQ,CAAC,YAAY,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C;;;OAGG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;CAChE;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
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
|
+
readonly path: string | undefined;
|
|
14
|
+
readonly line: number | undefined;
|
|
15
|
+
} | undefined;
|
|
16
|
+
readonly meta: Record<string, unknown> | undefined;
|
|
17
|
+
readonly docsUrl: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Minimal conflict data structure expected by CLI output.
|
|
21
|
+
*/
|
|
22
|
+
export interface CliErrorConflict {
|
|
23
|
+
readonly kind: string;
|
|
24
|
+
readonly summary: string;
|
|
25
|
+
readonly why?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Structured CLI error that contains all information needed for error envelopes.
|
|
29
|
+
* Call sites throw these errors with full context.
|
|
30
|
+
*/
|
|
31
|
+
export declare class CliStructuredError extends Error {
|
|
32
|
+
readonly code: string;
|
|
33
|
+
readonly domain: 'CLI' | 'RTM';
|
|
34
|
+
readonly severity: 'error' | 'warn' | 'info';
|
|
35
|
+
readonly why: string | undefined;
|
|
36
|
+
readonly fix: string | undefined;
|
|
37
|
+
readonly where: {
|
|
38
|
+
readonly path: string | undefined;
|
|
39
|
+
readonly line: number | undefined;
|
|
40
|
+
} | undefined;
|
|
41
|
+
readonly meta: Record<string, unknown> | undefined;
|
|
42
|
+
readonly docsUrl: string | undefined;
|
|
43
|
+
constructor(code: string, summary: string, options?: {
|
|
44
|
+
readonly domain?: 'CLI' | 'RTM';
|
|
45
|
+
readonly severity?: 'error' | 'warn' | 'info';
|
|
46
|
+
readonly why?: string;
|
|
47
|
+
readonly fix?: string;
|
|
48
|
+
readonly where?: {
|
|
49
|
+
readonly path?: string;
|
|
50
|
+
readonly line?: number;
|
|
51
|
+
};
|
|
52
|
+
readonly meta?: Record<string, unknown>;
|
|
53
|
+
readonly docsUrl?: string;
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Converts this error to a CLI error envelope for output formatting.
|
|
57
|
+
*/
|
|
58
|
+
toEnvelope(): CliErrorEnvelope;
|
|
59
|
+
/**
|
|
60
|
+
* Type guard to check if an error is a CliStructuredError.
|
|
61
|
+
* Uses duck-typing to work across module boundaries where instanceof may fail.
|
|
62
|
+
*/
|
|
63
|
+
static is(error: unknown): error is CliStructuredError;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Config file not found or missing.
|
|
67
|
+
*/
|
|
68
|
+
export declare function errorConfigFileNotFound(configPath?: string, options?: {
|
|
69
|
+
readonly why?: string;
|
|
70
|
+
}): CliStructuredError;
|
|
71
|
+
/**
|
|
72
|
+
* Contract configuration missing from config.
|
|
73
|
+
*/
|
|
74
|
+
export declare function errorContractConfigMissing(options?: {
|
|
75
|
+
readonly why?: string;
|
|
76
|
+
}): CliStructuredError;
|
|
77
|
+
/**
|
|
78
|
+
* Contract validation failed.
|
|
79
|
+
*/
|
|
80
|
+
export declare function errorContractValidationFailed(reason: string, options?: {
|
|
81
|
+
readonly where?: {
|
|
82
|
+
readonly path?: string;
|
|
83
|
+
readonly line?: number;
|
|
84
|
+
};
|
|
85
|
+
}): CliStructuredError;
|
|
86
|
+
/**
|
|
87
|
+
* File not found.
|
|
88
|
+
*/
|
|
89
|
+
export declare function errorFileNotFound(filePath: string, options?: {
|
|
90
|
+
readonly why?: string;
|
|
91
|
+
readonly fix?: string;
|
|
92
|
+
readonly docsUrl?: string;
|
|
93
|
+
}): CliStructuredError;
|
|
94
|
+
/**
|
|
95
|
+
* Database connection is required but not provided.
|
|
96
|
+
*/
|
|
97
|
+
export declare function errorDatabaseConnectionRequired(options?: {
|
|
98
|
+
readonly why?: string;
|
|
99
|
+
}): CliStructuredError;
|
|
100
|
+
/**
|
|
101
|
+
* Query runner factory is required but not provided in config.
|
|
102
|
+
*/
|
|
103
|
+
export declare function errorQueryRunnerFactoryRequired(options?: {
|
|
104
|
+
readonly why?: string;
|
|
105
|
+
}): CliStructuredError;
|
|
106
|
+
/**
|
|
107
|
+
* Family verify.readMarker is required but not provided.
|
|
108
|
+
*/
|
|
109
|
+
export declare function errorFamilyReadMarkerSqlRequired(options?: {
|
|
110
|
+
readonly why?: string;
|
|
111
|
+
}): CliStructuredError;
|
|
112
|
+
/**
|
|
113
|
+
* JSON output format not supported.
|
|
114
|
+
*/
|
|
115
|
+
export declare function errorJsonFormatNotSupported(options: {
|
|
116
|
+
readonly command: string;
|
|
117
|
+
readonly format: string;
|
|
118
|
+
readonly supportedFormats: readonly string[];
|
|
119
|
+
}): CliStructuredError;
|
|
120
|
+
/**
|
|
121
|
+
* Driver is required for DB-connected commands but not provided.
|
|
122
|
+
*/
|
|
123
|
+
export declare function errorDriverRequired(options?: {
|
|
124
|
+
readonly why?: string;
|
|
125
|
+
}): CliStructuredError;
|
|
126
|
+
/**
|
|
127
|
+
* Contract requires extension packs that are not provided by config descriptors.
|
|
128
|
+
*/
|
|
129
|
+
export declare function errorContractMissingExtensionPacks(options: {
|
|
130
|
+
readonly missingExtensionPacks: readonly string[];
|
|
131
|
+
readonly providedComponentIds: readonly string[];
|
|
132
|
+
}): CliStructuredError;
|
|
133
|
+
/**
|
|
134
|
+
* Migration planning failed due to conflicts.
|
|
135
|
+
*/
|
|
136
|
+
export declare function errorMigrationPlanningFailed(options: {
|
|
137
|
+
readonly conflicts: readonly CliErrorConflict[];
|
|
138
|
+
readonly why?: string;
|
|
139
|
+
}): CliStructuredError;
|
|
140
|
+
/**
|
|
141
|
+
* Target does not support migrations (missing createPlanner/createRunner).
|
|
142
|
+
*/
|
|
143
|
+
export declare function errorTargetMigrationNotSupported(options?: {
|
|
144
|
+
readonly why?: string;
|
|
145
|
+
}): CliStructuredError;
|
|
146
|
+
/**
|
|
147
|
+
* Config validation error (missing required fields).
|
|
148
|
+
*/
|
|
149
|
+
export declare function errorConfigValidation(field: string, options?: {
|
|
150
|
+
readonly why?: string;
|
|
151
|
+
}): CliStructuredError;
|
|
152
|
+
/**
|
|
153
|
+
* Contract marker not found in database.
|
|
154
|
+
*/
|
|
155
|
+
export declare function errorMarkerMissing(options?: {
|
|
156
|
+
readonly why?: string;
|
|
157
|
+
readonly dbUrl?: string;
|
|
158
|
+
}): CliStructuredError;
|
|
159
|
+
/**
|
|
160
|
+
* Contract hash does not match database marker.
|
|
161
|
+
*/
|
|
162
|
+
export declare function errorHashMismatch(options?: {
|
|
163
|
+
readonly why?: string;
|
|
164
|
+
readonly expected?: string;
|
|
165
|
+
readonly actual?: string;
|
|
166
|
+
}): CliStructuredError;
|
|
167
|
+
/**
|
|
168
|
+
* Contract target does not match config target.
|
|
169
|
+
*/
|
|
170
|
+
export declare function errorTargetMismatch(expected: string, actual: string, options?: {
|
|
171
|
+
readonly why?: string;
|
|
172
|
+
}): CliStructuredError;
|
|
173
|
+
/**
|
|
174
|
+
* Generic runtime error.
|
|
175
|
+
*/
|
|
176
|
+
export declare function errorRuntime(summary: string, options?: {
|
|
177
|
+
readonly why?: string;
|
|
178
|
+
readonly fix?: string;
|
|
179
|
+
readonly meta?: Record<string, unknown>;
|
|
180
|
+
}): CliStructuredError;
|
|
181
|
+
/**
|
|
182
|
+
* Generic unexpected error.
|
|
183
|
+
*/
|
|
184
|
+
export declare function errorUnexpected(message: string, options?: {
|
|
185
|
+
readonly why?: string;
|
|
186
|
+
readonly fix?: string;
|
|
187
|
+
}): CliStructuredError;
|
|
188
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,KAAK,EACV;QACE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;QAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KACnC,GACD,SAAS,CAAC;IACd,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,KAAK,GAAG,KAAK,CAAC;IAC/B,QAAQ,CAAC,QAAQ,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