@prisma/orm-framework 8.0.0-rc.1-dev.45 → 8.0.0-rc.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/{control-C9JfxzPo-CxCL2sxo.mjs → control-BD96JZi8-NUhO5Kkw.mjs} +10 -10
- package/dist/control-BD96JZi8-NUhO5Kkw.mjs.map +1 -0
- package/dist/errors.d.mts +1 -1
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.mjs +1 -1
- package/dist/errors__migration.d.mts +1 -1
- package/dist/errors__migration.mjs +1 -1
- package/dist/{execution-C_Bu-Fia.mjs → execution-Crk6IfTs.mjs} +2 -2
- package/dist/{execution-C_Bu-Fia.mjs.map → execution-Crk6IfTs.mjs.map} +1 -1
- package/dist/{migration-DOIs8GBr.d.mts → migration-BvrgDZXw.d.mts} +2 -2
- package/dist/{migration-DOIs8GBr.d.mts.map → migration-BvrgDZXw.d.mts.map} +1 -1
- package/dist/{migration-5zFMadnp.mjs → migration-C57VKLUY.mjs} +4 -4
- package/dist/{migration-5zFMadnp.mjs.map → migration-C57VKLUY.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/control-C9JfxzPo-CxCL2sxo.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
2
|
import { r as docsUrlFor } from "./structured-error-CgiSMpdU.mjs";
|
|
3
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
3
|
+
//#region ../../../1-framework/1-core/errors/dist/control-BD96JZi8.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Structured CLI error that contains all information needed for error envelopes.
|
|
6
6
|
* Call sites throw these errors with full context.
|
|
@@ -86,7 +86,7 @@ function errorConfigFileNotFound(configPath, options) {
|
|
|
86
86
|
function errorConfigEvaluationFailed(configPath, options) {
|
|
87
87
|
return new CliStructuredError("CONFIG.EVALUATION_FAILED", "Config file could not be evaluated", {
|
|
88
88
|
why: options.why,
|
|
89
|
-
fix: "Fix the error in your prisma
|
|
89
|
+
fix: "Fix the error in your prisma.config.ts so the module evaluates, then rerun the command",
|
|
90
90
|
docsUrl: docsUrlFor("CONFIG.EVALUATION_FAILED"),
|
|
91
91
|
...configPath ? { where: { path: configPath } } : {},
|
|
92
92
|
...options.cause !== void 0 ? { cause: options.cause } : {}
|
|
@@ -100,7 +100,7 @@ function errorConfigEvaluationFailed(configPath, options) {
|
|
|
100
100
|
function errorConfigVersionMarkerMissing(configPath) {
|
|
101
101
|
return new CliStructuredError("CONFIG.VERSION_MARKER_MISSING", "Config is not a defineConfig result", {
|
|
102
102
|
why: "The config module evaluated, but its default export was not created by a current defineConfig",
|
|
103
|
-
fix: "Create the config with defineConfig
|
|
103
|
+
fix: "Create the config with defineConfig from '@prisma/cli-engine', nest your settings under its `orm` section, and export its return value directly",
|
|
104
104
|
docsUrl: docsUrlFor("CONFIG.VERSION_MARKER_MISSING"),
|
|
105
105
|
...configPath ? { where: { path: configPath } } : {}
|
|
106
106
|
});
|
|
@@ -111,7 +111,7 @@ function errorConfigVersionMarkerMissing(configPath) {
|
|
|
111
111
|
function errorContractConfigMissing(options) {
|
|
112
112
|
return new CliStructuredError("CONFIG.CONTRACT_MISSING", "Contract configuration missing", {
|
|
113
113
|
why: options?.why ?? "The contract configuration is required for emit",
|
|
114
|
-
fix: "Add contract configuration to your prisma
|
|
114
|
+
fix: "Add contract configuration to your prisma.config.ts",
|
|
115
115
|
docsUrl: docsUrlFor("CONFIG.CONTRACT_MISSING")
|
|
116
116
|
});
|
|
117
117
|
}
|
|
@@ -155,7 +155,7 @@ function errorDatabaseConnectionRequired(options) {
|
|
|
155
155
|
const runHint = options?.retryCommand ? `Run \`${options.retryCommand}\`` : options?.commandName ? `Run \`prisma-next ${options.commandName} --db <url>\`` : "Provide `--db <url>`";
|
|
156
156
|
return new CliStructuredError("CONFIG.DB_CONNECTION_REQUIRED", "Database connection is required", {
|
|
157
157
|
why: options?.why ?? "Database connection is required for this command",
|
|
158
|
-
fix: `${runHint}, or set \`db: { connection: "postgres://…" }\` in prisma
|
|
158
|
+
fix: `${runHint}, or set \`db: { connection: "postgres://…" }\` in prisma.config.ts`,
|
|
159
159
|
...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -165,7 +165,7 @@ function errorDatabaseConnectionRequired(options) {
|
|
|
165
165
|
function errorQueryRunnerFactoryRequired(options) {
|
|
166
166
|
return new CliStructuredError("CONFIG.QUERY_RUNNER_FACTORY_REQUIRED", "Query runner factory is required", {
|
|
167
167
|
why: options?.why ?? "Config.db.queryRunnerFactory is required for db verify",
|
|
168
|
-
fix: "Add db.queryRunnerFactory to prisma
|
|
168
|
+
fix: "Add db.queryRunnerFactory to prisma.config.ts",
|
|
169
169
|
docsUrl: docsUrlFor("CONFIG.QUERY_RUNNER_FACTORY_REQUIRED")
|
|
170
170
|
});
|
|
171
171
|
}
|
|
@@ -199,7 +199,7 @@ function errorJsonFormatNotSupported(options) {
|
|
|
199
199
|
function errorDriverRequired(options) {
|
|
200
200
|
return new CliStructuredError("CONFIG.DRIVER_REQUIRED", "Driver is required for DB-connected commands", {
|
|
201
201
|
why: options?.why ?? "Config.driver is required for DB-connected commands",
|
|
202
|
-
fix: "Add a control-plane driver to prisma
|
|
202
|
+
fix: "Add a control-plane driver to prisma.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)",
|
|
203
203
|
docsUrl: docsUrlFor("CONFIG.DRIVER_REQUIRED")
|
|
204
204
|
});
|
|
205
205
|
}
|
|
@@ -210,7 +210,7 @@ function errorContractMissingExtensions(options) {
|
|
|
210
210
|
const missing = [...options.missingExtensions].sort();
|
|
211
211
|
return new CliStructuredError("CONFIG.MISSING_EXTENSION_PACKS", "Missing extension packs in config", {
|
|
212
212
|
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.`,
|
|
213
|
-
fix: "Add the missing extension descriptors to `extensions` in prisma
|
|
213
|
+
fix: "Add the missing extension descriptors to `extensions` in prisma.config.ts",
|
|
214
214
|
docsUrl: docsUrlFor("CONFIG.MISSING_EXTENSION_PACKS"),
|
|
215
215
|
meta: {
|
|
216
216
|
missingExtensions: missing,
|
|
@@ -298,7 +298,7 @@ function errorOutputFormatMutex() {
|
|
|
298
298
|
function errorConfigValidation(field, options) {
|
|
299
299
|
return new CliStructuredError("CONFIG.VALIDATION_FAILED", "Config validation error", {
|
|
300
300
|
why: options?.why ?? `Config must have a "${field}" field`,
|
|
301
|
-
fix: "Check your prisma
|
|
301
|
+
fix: "Check your prisma.config.ts and ensure all required fields are provided",
|
|
302
302
|
docsUrl: docsUrlFor("CONFIG.VALIDATION_FAILED"),
|
|
303
303
|
meta: {
|
|
304
304
|
field,
|
|
@@ -332,4 +332,4 @@ function errorUnexpected(message, options) {
|
|
|
332
332
|
//#endregion
|
|
333
333
|
export { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };
|
|
334
334
|
|
|
335
|
-
//# sourceMappingURL=control-
|
|
335
|
+
//# sourceMappingURL=control-BD96JZi8-NUhO5Kkw.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-BD96JZi8-NUhO5Kkw.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-BD96JZi8.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\n//#region src/control.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `@internal/utils/structured-error`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See\n* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md)\n* for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*\n\t* This is the boundary that emits the envelope, so it is where a missing\n\t* `nextActions` becomes `[]`.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\tnextActions: this.nextActions ?? [],\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = error;\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n/**\n* Config file not found or missing.\n*/\nfunction errorConfigFileNotFound(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.FILE_NOT_FOUND\", \"Config file not found\", {\n\t\t...options?.why ? { why: options.why } : { why: \"Config file not found\" },\n\t\tfix: \"Run 'prisma-next init' to create a config file\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Create a config file\",\n\t\t\tcommand: \"{bin} init\"\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Config module failed to evaluate (syntax error, module threw during import).\n*/\nfunction errorConfigEvaluationFailed(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", \"Config file could not be evaluated\", {\n\t\twhy: options.why,\n\t\tfix: \"Fix the error in your prisma.config.ts so the module evaluates, then rerun the command\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.EVALUATION_FAILED\"),\n\t\t...configPath ? { where: { path: configPath } } : {},\n\t\t...options.cause !== void 0 ? { cause: options.cause } : {}\n\t});\n}\n/**\n* Config module evaluated, but its export does not carry the defineConfig\n* version marker (plain object export, or a config produced by a different\n* defineConfig such as classic Prisma's).\n*/\nfunction errorConfigVersionMarkerMissing(configPath) {\n\treturn new CliStructuredError(\"CONFIG.VERSION_MARKER_MISSING\", \"Config is not a defineConfig result\", {\n\t\twhy: \"The config module evaluated, but its default export was not created by a current defineConfig\",\n\t\tfix: \"Create the config with defineConfig from '@prisma/cli-engine', nest your settings under its `orm` section, and export its return value directly\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VERSION_MARKER_MISSING\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Contract configuration missing from config.\n*/\nfunction errorContractConfigMissing(options) {\n\treturn new CliStructuredError(\"CONFIG.CONTRACT_MISSING\", \"Contract configuration missing\", {\n\t\twhy: options?.why ?? \"The contract configuration is required for emit\",\n\t\tfix: \"Add contract configuration to your prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.CONTRACT_MISSING\")\n\t});\n}\n/**\n* Contract validation failed.\n*/\nfunction errorContractValidationFailed(reason, options) {\n\treturn new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", \"Contract validation failed\", {\n\t\twhy: reason,\n\t\tfix: \"Re-run `prisma-next contract emit`, or fix the contract file and try again\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Re-emit the contract\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Fix the contract file, then re-run the command\",\n\t\t\treason\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* File not found.\n*/\nfunction errorFileNotFound(filePath, options) {\n\treturn new CliStructuredError(\"CLI.FILE_NOT_FOUND\", \"File not found\", {\n\t\twhy: options?.why ?? `File not found: ${filePath}`,\n\t\tfix: options?.fix ?? \"Check that the file path is correct\",\n\t\twhere: { path: filePath },\n\t\t...options?.docsUrl ? { docsUrl: options.docsUrl } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Database connection is required but not provided.\n*/\nfunction errorDatabaseConnectionRequired(options) {\n\tconst runHint = options?.retryCommand ? `Run \\`${options.retryCommand}\\`` : options?.commandName ? `Run \\`prisma-next ${options.commandName} --db <url>\\`` : \"Provide `--db <url>`\";\n\treturn new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"Database connection is required\", {\n\t\twhy: options?.why ?? \"Database connection is required for this command\",\n\t\tfix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma.config.ts`,\n\t\t...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}\n\t});\n}\n/**\n* Query runner factory is required but not provided in config.\n*/\nfunction errorQueryRunnerFactoryRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\", \"Query runner factory is required\", {\n\t\twhy: options?.why ?? \"Config.db.queryRunnerFactory is required for db verify\",\n\t\tfix: \"Add db.queryRunnerFactory to prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\")\n\t});\n}\n/**\n* Family verify.readMarker is required but not provided.\n*/\nfunction errorFamilyReadMarkerSqlRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\", \"Family readMarker() is required\", {\n\t\twhy: options?.why ?? \"Family verify.readMarker is required for db verify\",\n\t\tfix: \"Ensure family.verify.readMarker() is exported by your family package\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\")\n\t});\n}\n/**\n* JSON output format not supported.\n*/\nfunction errorJsonFormatNotSupported(options) {\n\treturn new CliStructuredError(\"CLI.JSON_FORMAT_UNSUPPORTED\", \"Unsupported JSON format\", {\n\t\twhy: `The ${options.command} command does not support --json ${options.format}`,\n\t\tfix: `Use --json ${options.supportedFormats.join(\" or \")}, or omit --json for human output`,\n\t\tmeta: {\n\t\t\tcommand: options.command,\n\t\t\tformat: options.format,\n\t\t\tsupportedFormats: options.supportedFormats\n\t\t}\n\t});\n}\n/**\n* Driver is required for DB-connected commands but not provided.\n*/\nfunction errorDriverRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is required for DB-connected commands\", {\n\t\twhy: options?.why ?? \"Config.driver is required for DB-connected commands\",\n\t\tfix: \"Add a control-plane driver to prisma.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.DRIVER_REQUIRED\")\n\t});\n}\n/**\n* Contract requires extension packs that are not provided by config descriptors.\n*/\nfunction errorContractMissingExtensions(options) {\n\tconst missing = [...options.missingExtensions].sort();\n\treturn new CliStructuredError(\"CONFIG.MISSING_EXTENSION_PACKS\", \"Missing extension packs in config\", {\n\t\twhy: 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.`,\n\t\tfix: \"Add the missing extension descriptors to `extensions` in prisma.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.MISSING_EXTENSION_PACKS\"),\n\t\tmeta: {\n\t\t\tmissingExtensions: missing,\n\t\t\tprovidedComponentIds: [...options.providedComponentIds].sort()\n\t\t}\n\t});\n}\n/**\n* Migration planning failed due to conflicts.\n*/\nfunction errorMigrationPlanningFailed(options) {\n\tconst conflictSummaries = options.conflicts.map((c) => c.summary);\n\tconst computedWhy = options.why ?? conflictSummaries.join(\"\\n\");\n\tconst conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === \"string\");\n\treturn new CliStructuredError(\"MIGRATION.PLANNING_FAILED\", \"Migration planning failed\", {\n\t\twhy: computedWhy,\n\t\tfix: conflictFixes.length > 0 ? conflictFixes.join(\"\\n\") : \"Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty\",\n\t\tmeta: { conflicts: options.conflicts },\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.PLANNING_FAILED\")\n\t});\n}\n/**\n* Target does not support migrations (missing createPlanner/createRunner).\n*/\nfunction errorTargetMigrationNotSupported(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", \"Target does not support migrations\", {\n\t\twhy: options?.why ?? \"The configured target does not provide migration planner/runner\",\n\t\tfix: \"Select a target that provides migrations (it must export `target.migrations` for db init)\",\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.TARGET_UNSUPPORTED\")\n\t});\n}\n/**\n* The migration-file CLI received `--config` without a path argument (either\n* a bare trailing `--config`, or `--config` followed by another flag like\n* `--config --dry-run`). Surfacing this as a structured error fails fast\n* rather than silently consuming the next flag as the config path or\n* falling back to default discovery against the wrong project.\n*/\nfunction errorMigrationCliInvalidConfigArg(options) {\n\treturn new CliStructuredError(\"CLI.CONFIG_ARG_MISSING_PATH\", \"--config flag requires a path argument\", {\n\t\twhy: options?.nextToken !== void 0 ? `\\`--config\\` was followed by another flag (\\`${options.nextToken}\\`) instead of a path argument.` : \"`--config` was passed without a following path argument.\",\n\t\tfix: \"Pass a config path: `--config <path>` or `--config=<path>`.\",\n\t\tmeta: options?.nextToken !== void 0 ? { nextToken: options.nextToken } : {}\n\t});\n}\n/**\n* The migration-file CLI received a flag it does not recognise. Surfaced as a\n* structured error so consumers can render their own \"did you mean\"\n* suggestions from `meta.knownFlags` rather than parsing the message.\n*\n* Designed to wrap clipanion's `UnknownSyntaxError` at the parser boundary:\n* pass the offending token as `flag` and the option declarations as\n* `knownFlags`.\n*/\nfunction errorMigrationCliUnknownFlag(options) {\n\tconst knownList = options.knownFlags.join(\", \");\n\treturn new CliStructuredError(\"CLI.UNKNOWN_FLAG\", \"Unknown migration CLI flag\", {\n\t\twhy: `Unknown flag \\`${options.flag}\\`.`,\n\t\tfix: `Known flags: ${knownList}. Run with \\`--help\\` to see the full list.`,\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tknownFlags: options.knownFlags\n\t\t}\n\t});\n}\n/**\n* The main CLI received an unsupported `--format` value.\n*/\nfunction errorInvalidOutputFormat(value) {\n\treturn new CliStructuredError(\"CLI.INVALID_OUTPUT_FORMAT\", `Invalid --format value \"${value}\". Allowed values: pretty, json.`, { meta: {\n\t\tvalue,\n\t\tallowed: [\"pretty\", \"json\"]\n\t} });\n}\n/**\n* The main CLI received mutually exclusive output format flags\n* (`--format pretty` together with `--json`).\n*/\nfunction errorOutputFormatMutex() {\n\treturn new CliStructuredError(\"CLI.OUTPUT_FORMAT_CONFLICT\", \"Cannot use --format pretty together with --json. Use --format json or --json alone for JSON output.\");\n}\n/**\n* Config validation error (missing required fields).\n*/\nfunction errorConfigValidation(field, options) {\n\treturn new CliStructuredError(\"CONFIG.VALIDATION_FAILED\", \"Config validation error\", {\n\t\twhy: options?.why ?? `Config must have a \"${field}\" field`,\n\t\tfix: \"Check your prisma.config.ts and ensure all required fields are provided\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VALIDATION_FAILED\"),\n\t\tmeta: {\n\t\t\tfield,\n\t\t\t...options?.section !== void 0 ? { section: options.section } : {}\n\t\t}\n\t});\n}\n/**\n* An enum declares a codecId that no component in the contract's pack stack provides,\n* so its member values cannot be encoded. Thrown by both authoring paths (TS `defineContract`\n* and PSL interpretation) when the codec lookup built from the contract's packs has no\n* descriptor for the codecId.\n*/\nfunction errorEnumCodecNotInPackStack(options) {\n\treturn new CliStructuredError(\"CONTRACT.ENUM_CODEC_NOT_IN_PACK_STACK\", `Enum codec \"${options.codecId}\" is not part of the contract's pack stack`, {\n\t\twhy: `An enum uses codec \"${options.codecId}\", but no family, target, or extension pack in the contract provides it.`,\n\t\tfix: \"Use a codec provided by the contract's target/extension packs, or add the pack that supplies this codec.\",\n\t\tmeta: { codecId: options.codecId }\n\t});\n}\n/**\n* Generic unexpected error.\n*/\nfunction errorUnexpected(message, options) {\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", \"Unexpected error\", {\n\t\twhy: options?.why ?? message,\n\t\tfix: options?.fix ?? \"Check the error message and try again\",\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };\n\n//# sourceMappingURL=control-BD96JZi8.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,EAAE,OAAO,QAAQ,MAAM,IAAI,KAAK,CAAC;EAC5E,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,WAAW,SAAS,YAAY;EACrC,MAAM,MAAM,SAAS,QAAQ,SAAS,MAAM,KAAK,IAAI,SAAS;EAC9D,MAAM,QAAQ,SAAS,QAAQ;GAC9B,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;GACvC,GAAG,UAAU,QAAQ,QAAQ,MAAM,IAAI;EACxC,IAAI,KAAK;EACT,OAAO,OAAO,MAAM;GACnB,GAAG,UAAU,OAAO,SAAS,GAAG;GAChC,GAAG,UAAU,OAAO,GAAG;GACvB,GAAG,UAAU,eAAe,SAAS,WAAW;GAChD,GAAG,UAAU,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS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I,mBAAmB,8BAA8B,qGAAqG;AAClK;;;;AAIA,SAAS,sBAAsB,OAAO,SAAS;CAC9C,OAAO,IAAI,mBAAmB,4BAA4B,2BAA2B;EACpF,KAAK,SAAS,OAAO,uBAAuB,MAAM;EAClD,KAAK;EACL,SAAS,WAAW,0BAA0B;EAC9C,MAAM;GACL;GACA,GAAG,SAAS,YAAY,KAAK,IAAI,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EAClE;CACD,CAAC;AACF;;;;;;;AAOA,SAAS,6BAA6B,SAAS;CAC9C,OAAO,IAAI,mBAAmB,yCAAyC,eAAe,QAAQ,QAAQ,6CAA6C;EAClJ,KAAK,uBAAuB,QAAQ,QAAQ;EAC5C,KAAK;EACL,MAAM,EAAE,SAAS,QAAQ,QAAQ;CAClC,CAAC;AACF;;;;AAIA,SAAS,gBAAgB,SAAS,SAAS;CAC1C,OAAO,IAAI,mBAAmB,kBAAkB,oBAAoB;EACnE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
package/dist/errors.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { C as errorTargetMigrationNotSupported, S as errorQueryRunnerFactoryRequired, _ as errorJsonFormatNotSupported, a as errorConfigFileNotFound, b as errorMigrationPlanningFailed, c as errorContractConfigMissing, d as errorDatabaseConnectionRequired, f as errorDriverRequired, g as errorInvalidOutputFormat, h as errorFileNotFound, i as errorConfigEvaluationFailed, l as errorContractMissingExtensions, m as errorFamilyReadMarkerSqlRequired, n as CliErrorEnvelope, o as errorConfigValidation, p as errorEnumCodecNotInPackStack, r as CliStructuredError, s as errorConfigVersionMarkerMissing, t as CliErrorConflict, u as errorContractValidationFailed, v as errorMigrationCliInvalidConfigArg, w as errorUnexpected, x as errorOutputFormatMutex, y as errorMigrationCliUnknownFlag } from "./control-ql9N9u4f-r3Vv41kZ.mjs";
|
|
2
2
|
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-Cyl2dXxX.mjs";
|
|
3
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
3
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-BvrgDZXw.mjs";
|
|
4
4
|
export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorConsentPlanMismatch, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDataTransformContractMismatch, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationPlanningFailed, errorMigrationTargetMismatch, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected, errorUnfilledPlaceholder, parseMarkerRowSafely, placeholder, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
package/dist/errors.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
2
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
3
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
1
|
+
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-BD96JZi8-NUhO5Kkw.mjs";
|
|
2
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-Crk6IfTs.mjs";
|
|
3
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-C57VKLUY.mjs";
|
|
4
4
|
export { CliStructuredError, ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorConsentPlanMismatch, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDataTransformContractMismatch, errorDatabaseConnectionRequired, errorDestructiveChanges, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorHashMismatch, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationPlanningFailed, errorMigrationTargetMismatch, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMigrationNotSupported, errorTargetMismatch, errorUnexpected, errorUnfilledPlaceholder, parseMarkerRowSafely, placeholder, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
package/dist/errors__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
1
|
+
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigVersionMarkerMissing, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigValidation, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as errorConfigEvaluationFailed, o as errorContractConfigMissing, p as errorFileNotFound, r as errorConfigFileNotFound, s as errorContractMissingExtensions, t as CliStructuredError, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-BD96JZi8-NUhO5Kkw.mjs";
|
|
2
2
|
export { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationPlanningFailed, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorTargetMigrationNotSupported, errorUnexpected };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-
|
|
1
|
+
import { a as errorHashMismatch, c as errorMarkerRequired, d as errorRuntime, f as errorSchemaVerificationFailed, g as withMarkerReadErrorHandling, h as rethrowMarkerReadError, i as errorDestructiveChanges, l as errorMarkerRowCorrupt, m as parseMarkerRowSafely, n as ERROR_CODE_DESTRUCTIVE_CHANGES, o as errorMarkerMissing, p as errorTargetMismatch, r as errorConsentPlanMismatch, s as errorMarkerReadFailed, t as ERROR_CODE_CONSENT_PLAN_MISMATCH, u as errorRunnerFailed } from "./execution-Crk6IfTs.mjs";
|
|
2
2
|
export { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
1
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-BvrgDZXw.mjs";
|
|
2
2
|
export { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-
|
|
1
|
+
import { a as errorMigrationTargetMismatch, i as errorMigrationPlanNotArray, n as errorMigrationFileMissing, o as errorUnfilledPlaceholder, r as errorMigrationInvalidDefaultExport, s as placeholder, t as errorDataTransformContractMismatch } from "./migration-C57VKLUY.mjs";
|
|
2
2
|
export { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
|
-
import { t as CliStructuredError } from "./control-
|
|
2
|
+
import { t as CliStructuredError } from "./control-BD96JZi8-NUhO5Kkw.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/errors/dist/execution.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Contract marker not found in database.
|
|
@@ -215,4 +215,4 @@ function errorRuntime(code, summary, options) {
|
|
|
215
215
|
//#endregion
|
|
216
216
|
export { errorHashMismatch as a, errorMarkerRequired as c, errorRuntime as d, errorSchemaVerificationFailed as f, withMarkerReadErrorHandling as g, rethrowMarkerReadError as h, errorDestructiveChanges as i, errorMarkerRowCorrupt as l, parseMarkerRowSafely as m, ERROR_CODE_DESTRUCTIVE_CHANGES as n, errorMarkerMissing as o, errorTargetMismatch as p, errorConsentPlanMismatch as r, errorMarkerReadFailed as s, ERROR_CODE_CONSENT_PLAN_MISMATCH as t, errorRunnerFailed as u };
|
|
217
217
|
|
|
218
|
-
//# sourceMappingURL=execution-
|
|
218
|
+
//# sourceMappingURL=execution-Crk6IfTs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution-C_Bu-Fia.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-C9JfxzPo.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/execution.ts\n/**\n* Contract marker not found in database.\n*/\nfunction errorMarkerMissing(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISSING\", \"Database not signed\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: \"Run `prisma-next db sign --db <url>` to sign the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db sign --db <url>\"\n\t\t}]\n\t});\n}\n/**\n* Contract hash does not match database marker.\n*/\nfunction errorHashMismatch(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISMATCH\", \"Hash mismatch\", {\n\t\twhy: options?.why ?? \"Contract hash does not match database marker\",\n\t\tfix: \"Migrate database or re-sign if intentional\",\n\t\t...options?.expected !== void 0 || options?.actual !== void 0 ? { meta: {\n\t\t\t...ifDefined(\"expected\", options?.expected),\n\t\t\t...ifDefined(\"actual\", options?.actual)\n\t\t} } : {}\n\t});\n}\n/**\n* Contract target does not match config target.\n*/\nfunction errorTargetMismatch(expected, actual, options) {\n\treturn new CliStructuredError(\"CONTRACT.TARGET_MISMATCH\", \"Target mismatch\", {\n\t\twhy: options?.why ?? `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n\t\tfix: \"Align contract target and config target\",\n\t\tmeta: {\n\t\t\texpected,\n\t\t\tactual\n\t\t}\n\t});\n}\n/**\n* Marker row exists but column values fail schema validation.\n*/\nfunction errorMarkerRowCorrupt(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", \"Marker row is corrupt or incompatible\", {\n\t\twhy: options.why,\n\t\tfix: `The ${options.markerLocation} row for space \"${options.space}\" contains invalid data. Delete the row, then run \\`prisma-next db sign --db <url>\\` to write a fresh marker.`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Write a fresh marker\",\n\t\t\tcommand: \"{bin} db sign --db <url>\",\n\t\t\treason: `Delete the invalid ${options.markerLocation} row for space \"${options.space}\" first — this command then writes a valid one.`\n\t\t}],\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/**\n* Driver-level failure while reading the contract marker table.\n*/\nfunction errorMarkerReadFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_READ_FAILED\", \"Database error while reading contract marker\", {\n\t\twhy: options.why,\n\t\tfix: `Could not read marker at ${options.markerLocation} for space \"${options.space}\". Verify read permissions, connectivity, and locks, then retry.`,\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction isMarkerRowParseError(err) {\n\treturn err instanceof Error && (err.message.startsWith(\"Invalid contract marker row:\") || err.message.startsWith(\"Invalid marker doc on\"));\n}\nfunction isLegacyMarkerShapeReadError(message) {\n\tconst normalized = message.toLowerCase();\n\treturn normalized.includes(\"column \\\"space\\\" does not exist\") || normalized.includes(\"no such column: space\");\n}\nfunction errorLegacyMarkerShape(options) {\n\treturn errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \\`space\\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${options.markerLocation}\\` and re-run \\`prisma-next db init\\` to reinitialise from a clean baseline.`, {\n\t\twhy: options.why,\n\t\tfix: \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-next db init` to recreate it with the current per-space schema.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reinitialise the marker table from a clean baseline\",\n\t\t\tcommand: \"{bin} db init\",\n\t\t\treason: `Drop \\`${options.markerLocation}\\` first — it has the legacy shape (no \\`space\\` column) and this command recreates it with the current per-space schema.`\n\t\t}],\n\t\tmeta: { runnerErrorCode: \"MIGRATION.LEGACY_MARKER_SHAPE\" },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction rethrowMarkerReadError(err, context) {\n\tif (CliStructuredError.is(err)) throw err;\n\tif (isMarkerRowParseError(err)) throw errorMarkerRowCorrupt({\n\t\twhy: err.message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (isLegacyMarkerShapeReadError(message)) throw errorLegacyMarkerShape({\n\t\twhy: message,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tthrow errorMarkerReadFailed({\n\t\twhy: message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n}\nasync function withMarkerReadErrorHandling(operation, context) {\n\ttry {\n\t\treturn await operation();\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\nfunction parseMarkerRowSafely(row, parse, context) {\n\ttry {\n\t\treturn parse(row);\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\n/**\n* Database marker is required but not found.\n* Used by commands that require a pre-existing marker as a precondition.\n*/\nfunction errorMarkerRequired(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_REQUIRED\", \"Database must be signed first\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: options?.fix ?? \"Run `prisma-next db init` first to sign the database\",\n\t\tnextActions: options?.nextActions ?? [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db init\"\n\t\t}]\n\t});\n}\n/**\n* Schema verification found mismatches between the database and the contract.\n* The full verification result is preserved in `meta.verificationResult`.\n*/\nfunction errorSchemaVerificationFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.SCHEMA_VERIFICATION_FAILED\", options.summary, {\n\t\twhy: \"Database schema does not satisfy the contract\",\n\t\tfix: \"Run `prisma-next db update` to reconcile, or adjust your contract to match the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reconcile the database\",\n\t\t\tcommand: \"{bin} db update\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Adjust your contract to match the database\"\n\t\t}],\n\t\tmeta: {\n\t\t\tverificationResult: options.verificationResult,\n\t\t\t...ifDefined(\"issues\", options.issues)\n\t\t}\n\t});\n}\n/**\n* Migration runner failed during execution.\n*/\nfunction errorRunnerFailed(summary, options) {\n\treturn new CliStructuredError(\"MIGRATION.RUNNER_FAILED\", summary, {\n\t\twhy: options?.why ?? \"Migration runner failed\",\n\t\tfix: options?.fix ?? \"Inspect the reported conflict and reconcile schema drift\",\n\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t...options?.meta ? { meta: options.meta } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/** Error code for destructive changes that require explicit confirmation. */\nconst ERROR_CODE_DESTRUCTIVE_CHANGES = \"MIGRATION.DESTRUCTIVE_CHANGES\";\n/**\n* Destructive operations require explicit confirmation via -y/--yes.\n*/\nfunction errorDestructiveChanges(summary, options) {\n\treturn new CliStructuredError(ERROR_CODE_DESTRUCTIVE_CHANGES, summary, {\n\t\twhy: options?.why ?? \"Planned operations include destructive changes that require confirmation\",\n\t\tfix: options?.fix ?? \"Re-run with `-y` to apply, or use `--dry-run` to preview first\",\n\t\t...options?.meta ? { meta: options.meta } : {}\n\t});\n}\nconst ERROR_CODE_CONSENT_PLAN_MISMATCH = \"MIGRATION.CONSENT_PLAN_MISMATCH\";\n/**\n* An apply carrying consent was refused because the plan recomputed for it is\n* not the plan that was consented to.\n*/\nfunction errorConsentPlanMismatch(options) {\n\treturn new CliStructuredError(ERROR_CODE_CONSENT_PLAN_MISMATCH, \"The plan changed between consent and apply\", {\n\t\twhy: options.why ?? \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\tfix: \"Re-run the command and review the freshly planned operations before consenting again\",\n\t\tmeta: {\n\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\tplanHash: options.planHash\n\t\t}\n\t});\n}\n/**\n* Generic runtime error carrying a caller-provided dotted code.\n*/\nfunction errorRuntime(code, summary, options) {\n\treturn new CliStructuredError(code, summary, {\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };\n\n//# sourceMappingURL=execution.mjs.map"],"mappings":";;;;;;AAMA,SAAS,mBAAmB,SAAS;CACpC,OAAO,IA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;;;;AAIA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,IAAI,mBAAmB,MAAM,SAAS;EAC5C,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,OAAO,SAAS,GAAG;EAChC,GAAG,UAAU,QAAQ,SAAS,IAAI;EAClC,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF"}
|
|
1
|
+
{"version":3,"file":"execution-Crk6IfTs.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-BD96JZi8.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\n//#region src/execution.ts\n/**\n* Contract marker not found in database.\n*/\nfunction errorMarkerMissing(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISSING\", \"Database not signed\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: \"Run `prisma-next db sign --db <url>` to sign the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db sign --db <url>\"\n\t\t}]\n\t});\n}\n/**\n* Contract hash does not match database marker.\n*/\nfunction errorHashMismatch(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_MISMATCH\", \"Hash mismatch\", {\n\t\twhy: options?.why ?? \"Contract hash does not match database marker\",\n\t\tfix: \"Migrate database or re-sign if intentional\",\n\t\t...options?.expected !== void 0 || options?.actual !== void 0 ? { meta: {\n\t\t\t...ifDefined(\"expected\", options?.expected),\n\t\t\t...ifDefined(\"actual\", options?.actual)\n\t\t} } : {}\n\t});\n}\n/**\n* Contract target does not match config target.\n*/\nfunction errorTargetMismatch(expected, actual, options) {\n\treturn new CliStructuredError(\"CONTRACT.TARGET_MISMATCH\", \"Target mismatch\", {\n\t\twhy: options?.why ?? `Contract target does not match config target (expected: ${expected}, actual: ${actual})`,\n\t\tfix: \"Align contract target and config target\",\n\t\tmeta: {\n\t\t\texpected,\n\t\t\tactual\n\t\t}\n\t});\n}\n/**\n* Marker row exists but column values fail schema validation.\n*/\nfunction errorMarkerRowCorrupt(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_ROW_CORRUPT\", \"Marker row is corrupt or incompatible\", {\n\t\twhy: options.why,\n\t\tfix: `The ${options.markerLocation} row for space \"${options.space}\" contains invalid data. Delete the row, then run \\`prisma-next db sign --db <url>\\` to write a fresh marker.`,\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Write a fresh marker\",\n\t\t\tcommand: \"{bin} db sign --db <url>\",\n\t\t\treason: `Delete the invalid ${options.markerLocation} row for space \"${options.space}\" first — this command then writes a valid one.`\n\t\t}],\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\n/**\n* Driver-level failure while reading the contract marker table.\n*/\nfunction errorMarkerReadFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_READ_FAILED\", \"Database error while reading contract marker\", {\n\t\twhy: options.why,\n\t\tfix: `Could not read marker at ${options.markerLocation} for space \"${options.space}\". Verify read permissions, connectivity, and locks, then retry.`,\n\t\tmeta: { space: options.space },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction isMarkerRowParseError(err) {\n\treturn err instanceof Error && (err.message.startsWith(\"Invalid contract marker row:\") || err.message.startsWith(\"Invalid marker doc on\"));\n}\nfunction isLegacyMarkerShapeReadError(message) {\n\tconst normalized = message.toLowerCase();\n\treturn normalized.includes(\"column \\\"space\\\" does not exist\") || normalized.includes(\"no such column: space\");\n}\nfunction errorLegacyMarkerShape(options) {\n\treturn errorRunnerFailed(`Legacy marker-table shape detected on ${options.markerLocation} (no \\`space\\` column). Prisma Next is in pre-1.0; the previous transitional auto-migration to the per-space-row schema has been removed. Drop \\`${options.markerLocation}\\` and re-run \\`prisma-next db init\\` to reinitialise from a clean baseline.`, {\n\t\twhy: options.why,\n\t\tfix: \"Legacy marker-table shape detected. Drop `prisma_contract.marker` (Postgres) or `_prisma_marker` (SQLite) and re-run `prisma-next db init` to recreate it with the current per-space schema.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reinitialise the marker table from a clean baseline\",\n\t\t\tcommand: \"{bin} db init\",\n\t\t\treason: `Drop \\`${options.markerLocation}\\` first — it has the legacy shape (no \\`space\\` column) and this command recreates it with the current per-space schema.`\n\t\t}],\n\t\tmeta: { runnerErrorCode: \"MIGRATION.LEGACY_MARKER_SHAPE\" },\n\t\t...ifDefined(\"cause\", options.cause)\n\t});\n}\nfunction rethrowMarkerReadError(err, context) {\n\tif (CliStructuredError.is(err)) throw err;\n\tif (isMarkerRowParseError(err)) throw errorMarkerRowCorrupt({\n\t\twhy: err.message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tconst message = err instanceof Error ? err.message : String(err);\n\tif (isLegacyMarkerShapeReadError(message)) throw errorLegacyMarkerShape({\n\t\twhy: message,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n\tthrow errorMarkerReadFailed({\n\t\twhy: message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation,\n\t\tcause: err\n\t});\n}\nasync function withMarkerReadErrorHandling(operation, context) {\n\ttry {\n\t\treturn await operation();\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\nfunction parseMarkerRowSafely(row, parse, context) {\n\ttry {\n\t\treturn parse(row);\n\t} catch (err) {\n\t\trethrowMarkerReadError(err, context);\n\t}\n}\n/**\n* Database marker is required but not found.\n* Used by commands that require a pre-existing marker as a precondition.\n*/\nfunction errorMarkerRequired(options) {\n\treturn new CliStructuredError(\"CONTRACT.MARKER_REQUIRED\", \"Database must be signed first\", {\n\t\twhy: options?.why ?? \"No database signature (marker) found\",\n\t\tfix: options?.fix ?? \"Run `prisma-next db init` first to sign the database\",\n\t\tnextActions: options?.nextActions ?? [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Sign the database\",\n\t\t\tcommand: \"{bin} db init\"\n\t\t}]\n\t});\n}\n/**\n* Schema verification found mismatches between the database and the contract.\n* The full verification result is preserved in `meta.verificationResult`.\n*/\nfunction errorSchemaVerificationFailed(options) {\n\treturn new CliStructuredError(\"CONTRACT.SCHEMA_VERIFICATION_FAILED\", options.summary, {\n\t\twhy: \"Database schema does not satisfy the contract\",\n\t\tfix: \"Run `prisma-next db update` to reconcile, or adjust your contract to match the database\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Reconcile the database\",\n\t\t\tcommand: \"{bin} db update\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Adjust your contract to match the database\"\n\t\t}],\n\t\tmeta: {\n\t\t\tverificationResult: options.verificationResult,\n\t\t\t...ifDefined(\"issues\", options.issues)\n\t\t}\n\t});\n}\n/**\n* Migration runner failed during execution.\n*/\nfunction errorRunnerFailed(summary, options) {\n\treturn new CliStructuredError(\"MIGRATION.RUNNER_FAILED\", summary, {\n\t\twhy: options?.why ?? \"Migration runner failed\",\n\t\tfix: options?.fix ?? \"Inspect the reported conflict and reconcile schema drift\",\n\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t...options?.meta ? { meta: options.meta } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/** Error code for destructive changes that require explicit confirmation. */\nconst ERROR_CODE_DESTRUCTIVE_CHANGES = \"MIGRATION.DESTRUCTIVE_CHANGES\";\n/**\n* Destructive operations require explicit confirmation via -y/--yes.\n*/\nfunction errorDestructiveChanges(summary, options) {\n\treturn new CliStructuredError(ERROR_CODE_DESTRUCTIVE_CHANGES, summary, {\n\t\twhy: options?.why ?? \"Planned operations include destructive changes that require confirmation\",\n\t\tfix: options?.fix ?? \"Re-run with `-y` to apply, or use `--dry-run` to preview first\",\n\t\t...options?.meta ? { meta: options.meta } : {}\n\t});\n}\nconst ERROR_CODE_CONSENT_PLAN_MISMATCH = \"MIGRATION.CONSENT_PLAN_MISMATCH\";\n/**\n* An apply carrying consent was refused because the plan recomputed for it is\n* not the plan that was consented to.\n*/\nfunction errorConsentPlanMismatch(options) {\n\treturn new CliStructuredError(ERROR_CODE_CONSENT_PLAN_MISMATCH, \"The plan changed between consent and apply\", {\n\t\twhy: options.why ?? \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\tfix: \"Re-run the command and review the freshly planned operations before consenting again\",\n\t\tmeta: {\n\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\tplanHash: options.planHash\n\t\t}\n\t});\n}\n/**\n* Generic runtime error carrying a caller-provided dotted code.\n*/\nfunction errorRuntime(code, summary, options) {\n\treturn new CliStructuredError(code, summary, {\n\t\t...ifDefined(\"why\", options?.why),\n\t\t...ifDefined(\"fix\", options?.fix),\n\t\t...ifDefined(\"meta\", options?.meta),\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { ERROR_CODE_CONSENT_PLAN_MISMATCH, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConsentPlanMismatch, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };\n\n//# sourceMappingURL=execution.mjs.map"],"mappings":";;;;;;AAMA,SAAS,mBAAmB,SAAS;CACpC,OAAO,IAAI,mBAAmB,2BAA2B,uBAAuB;EAC/E,KAAK,SAAS,OAAO;EACrB,KAAK;EACL,aAAa,CAAC;GACb,MAAM;GACN,OAAO;GACP,SAAS;EACV,CAAC;CACF,CAAC;AACF;;;;AAIA,SAAS,kBAAkB,SAAS;CACnC,OAAO,IAAI,mBAAmB,4BAA4B,iBAAiB;EAC1E,KAAK,SAAS,OAAO;EAC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"}
|
|
@@ -54,7 +54,7 @@ declare function errorMigrationFileMissing(dir: string): CliStructuredError;
|
|
|
54
54
|
declare function errorMigrationInvalidDefaultExport(dir: string, actualExportDescription?: string): CliStructuredError;
|
|
55
55
|
/**
|
|
56
56
|
* The migration class declares one `targetId` but the loaded
|
|
57
|
-
* `prisma
|
|
57
|
+
* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`
|
|
58
58
|
* when a migration script is invoked against a config whose target
|
|
59
59
|
* descriptor disagrees with the migration's own `targetId`. Distinct from generic
|
|
60
60
|
* config-validation errors because the mismatch is between two valid
|
|
@@ -71,4 +71,4 @@ declare function errorMigrationTargetMismatch(options: {
|
|
|
71
71
|
declare function errorMigrationPlanNotArray(dir: string, actualValueDescription?: string): CliStructuredError;
|
|
72
72
|
//#endregion
|
|
73
73
|
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
74
|
-
//# sourceMappingURL=migration-
|
|
74
|
+
//# sourceMappingURL=migration-BvrgDZXw.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-BvrgDZXw.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.d.mts"],"mappings":";;;;;;;;;;iBASiB,yBAAyB,eAAe;;;;;;;;;;iBAUxC,YAAY;;;;;;;;;;;;;iBAaZ,mCAAmC;WACzC;WACA;WACA;IACP;;;;;;iBAMa,0BAA0B,cAAc;;;;;;;;;;iBAUxC,mCAAmC,aAAa,mCAAmC;;;;;;;;;iBASnF,6BAA6B;WACnC;WACA;IACP;;;;;iBAKa,2BAA2B,aAAa,kCAAkC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as CliStructuredError } from "./control-
|
|
1
|
+
import { t as CliStructuredError } from "./control-BD96JZi8-NUhO5Kkw.mjs";
|
|
2
2
|
//#region ../../../1-framework/1-core/errors/dist/migration.mjs
|
|
3
3
|
/**
|
|
4
4
|
* A scaffolded migration contains a placeholder slot that was never filled in.
|
|
@@ -91,7 +91,7 @@ function errorMigrationInvalidDefaultExport(dir, actualExportDescription) {
|
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* The migration class declares one `targetId` but the loaded
|
|
94
|
-
* `prisma
|
|
94
|
+
* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`
|
|
95
95
|
* when a migration script is invoked against a config whose target
|
|
96
96
|
* descriptor disagrees with the migration's own `targetId`. Distinct from generic
|
|
97
97
|
* config-validation errors because the mismatch is between two valid
|
|
@@ -99,7 +99,7 @@ function errorMigrationInvalidDefaultExport(dir, actualExportDescription) {
|
|
|
99
99
|
*/
|
|
100
100
|
function errorMigrationTargetMismatch(options) {
|
|
101
101
|
return new CliStructuredError("MIGRATION.TARGET_MISMATCH", "Migration target does not match config target", {
|
|
102
|
-
why: `This migration is for target "${options.migrationTargetId}" but the loaded prisma
|
|
102
|
+
why: `This migration is for target "${options.migrationTargetId}" but the loaded prisma.config.ts declares target "${options.configTargetId}". The migration script can only be run against a config that targets the same database.`,
|
|
103
103
|
fix: "Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.",
|
|
104
104
|
meta: {
|
|
105
105
|
migrationTargetId: options.migrationTargetId,
|
|
@@ -124,4 +124,4 @@ function errorMigrationPlanNotArray(dir, actualValueDescription) {
|
|
|
124
124
|
//#endregion
|
|
125
125
|
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
126
126
|
|
|
127
|
-
//# sourceMappingURL=migration-
|
|
127
|
+
//# sourceMappingURL=migration-C57VKLUY.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-C57VKLUY.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-BD96JZi8.mjs\";\n//#region src/migration.ts\n/**\n* A scaffolded migration contains a placeholder slot that was never filled in.\n*\n* Thrown at emit time (when `check.source()` or `run()` is invoked) via the\n* `placeholder(...)` utility. The `slot` identifies the exact location the\n* author still needs to edit, e.g. `\"backfill-product-status:check.source\"`.\n*/\nfunction errorUnfilledPlaceholder(slot) {\n\treturn new CliStructuredError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Unfilled migration placeholder\", {\n\t\twhy: `The migration contains a placeholder that has not been filled in: ${slot}`,\n\t\tfix: \"Open migration.ts and replace the `placeholder(...)` call with your actual query.\",\n\t\tmeta: { slot }\n\t});\n}\n/**\n* Scaffolded `migration.ts` files call this wherever the scaffolder couldn't\n* emit a real query and the author is expected to fill one in. Always throws\n* a structured migration error (`MIGRATION.UNFILLED_PLACEHOLDER`).\n*\n* The return type `never` makes it assignable to any expected return type, so\n* a scaffolded `() => placeholder('...')` satisfies signatures like\n* `() => MongoQueryPlan` without polluting them with a sentinel union arm.\n*/\nfunction placeholder(slot) {\n\tthrow errorUnfilledPlaceholder(slot);\n}\n/**\n* A `dataTransform(endContract, …)` factory was handed a `SqlQueryPlan` whose\n* `meta.storageHash` does not match the `endContract.storage.storageHash` it\n* was configured with. This almost always means the user's query-builder\n* (`sql({ context: createExecutionContext({ contract: endContract, … }) })`)\n* was instantiated from a different contract reference than the one passed\n* to `dataTransform(endContract, …)`.\n*\n* Distinct from `errorHashMismatch` (`CONTRACT.MARKER_MISMATCH`) which\n* rejects a plan at runtime execution; this is an authoring-time rejection\n* so it lives in the `MIGRATION` namespace.\n*/\nfunction errorDataTransformContractMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.DATA_TRANSFORM_CONTRACT_MISMATCH\", \"dataTransform query plan built against wrong contract\", {\n\t\twhy: `Data transform \"${options.dataTransformName}\" produced a query plan whose storage hash (${options.actual}) does not match the migration's contract (${options.expected}). The query builder was configured with a different contract than the one passed to dataTransform(endContract, ...).`,\n\t\tfix: \"Ensure the `endContract` imported at module scope (used for both `dataTransform(endContract, …)` and `sql({ context: createExecutionContext({ contract: endContract, … }) })`) is the same reference.\",\n\t\tmeta: {\n\t\t\tdataTransformName: options.dataTransformName,\n\t\t\texpected: options.expected,\n\t\t\tactual: options.actual\n\t\t}\n\t});\n}\n/**\n* `migration.ts` was expected at the given package directory but could not be\n* located. Thrown when consumers attempt to read a migration package that is\n* missing its source file.\n*/\nfunction errorMigrationFileMissing(dir) {\n\treturn new CliStructuredError(\"MIGRATION.FILE_MISSING\", \"migration.ts not found\", {\n\t\twhy: `No migration.ts file was found at \"${dir}\"`,\n\t\tfix: \"Scaffold one with `prisma-next migration new` or `prisma-next migration plan`.\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold an empty migration\",\n\t\t\tcommand: \"{bin} migration new\"\n\t\t}, {\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Scaffold a migration from a contract diff\",\n\t\t\tcommand: \"{bin} migration plan\"\n\t\t}],\n\t\tmeta: { dir }\n\t});\n}\n/**\n* The `migration.ts` at the given package directory does not default-export a\n* valid migration shape. Two shapes are accepted: a `Migration` subclass, or a\n* factory function returning a `MigrationPlan`-shaped object (with at least\n* an `operations` array, plus `targetId` and `destination`). Thrown when the\n* default export is missing, is not a constructor/function, does not extend\n* `Migration`, or (for factory functions) returns a value that is not\n* `MigrationPlan`-shaped.\n*/\nfunction errorMigrationInvalidDefaultExport(dir, actualExportDescription) {\n\treturn new CliStructuredError(\"MIGRATION.INVALID_DEFAULT_EXPORT\", \"migration.ts default export is not a valid migration\", {\n\t\twhy: actualExportDescription !== void 0 ? `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object; got ${actualExportDescription}` : `migration.ts at \"${dir}\" must default-export a Migration subclass or a factory function returning a MigrationPlan-shaped object.`,\n\t\tfix: \"Use `export default class extends Migration { ... }` or `export default () => ({ targetId, destination, operations })`.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualExportDescription !== void 0 ? { actualExport: actualExportDescription } : {}\n\t\t}\n\t});\n}\n/**\n* The migration class declares one `targetId` but the loaded\n* `prisma.config.ts` declares another. Thrown by `MigrationCLI.run`\n* when a migration script is invoked against a config whose target\n* descriptor disagrees with the migration's own `targetId`. Distinct from generic\n* config-validation errors because the mismatch is between two valid\n* artifacts (the script and the config), not a malformed input.\n*/\nfunction errorMigrationTargetMismatch(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_MISMATCH\", \"Migration target does not match config target\", {\n\t\twhy: `This migration is for target \"${options.migrationTargetId}\" but the loaded prisma.config.ts declares target \"${options.configTargetId}\". The migration script can only be run against a config that targets the same database.`,\n\t\tfix: \"Switch to a config whose `target` matches the migration's target, or pass `--config <path>` to point at the right config file.\",\n\t\tmeta: {\n\t\t\tmigrationTargetId: options.migrationTargetId,\n\t\t\tconfigTargetId: options.configTargetId\n\t\t}\n\t});\n}\n/**\n* A `Migration.operations` getter returned a value that is not an array. Used\n* by emit capabilities after instantiating the authored migration.\n*/\nfunction errorMigrationPlanNotArray(dir, actualValueDescription) {\n\treturn new CliStructuredError(\"MIGRATION.PLAN_NOT_ARRAY\", \"Migration.operations must be an array of operations\", {\n\t\twhy: actualValueDescription !== void 0 ? `Migration.operations for migration.ts at \"${dir}\" was ${actualValueDescription}; an array of operations is required.` : `Migration.operations for migration.ts at \"${dir}\" is not an array of operations.`,\n\t\tfix: \"Ensure your `operations` getter returns an array of operations; see the data-migrations authoring guide.\",\n\t\tmeta: {\n\t\t\tdir,\n\t\t\t...actualValueDescription !== void 0 ? { actualValue: actualValueDescription } : {}\n\t\t}\n\t});\n}\n//#endregion\nexport { errorDataTransformContractMismatch, errorMigrationFileMissing, errorMigrationInvalidDefaultExport, errorMigrationPlanNotArray, errorMigration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Ae;EAC5I,KAAK;EACL,MAAM;GACL,mBAAmB,QAAQ;GAC3B,gBAAgB,QAAQ;EACzB;CACD,CAAC;AACF;;;;;AAKA,SAAS,2BAA2B,KAAK,wBAAwB;CAChE,OAAO,IAAI,mBAAmB,4BAA4B,uDAAuD;EAChH,KAAK,2BAA2B,KAAK,IAAI,6CAA6C,IAAI,QAAQ,uBAAuB,yCAAyC,6CAA6C,IAAI;EACnN,KAAK;EACL,MAAM;GACL;GACA,GAAG,2BAA2B,KAAK,IAAI,EAAE,aAAa,uBAAuB,IAAI,CAAC;EACnF;CACD,CAAC;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/orm-framework",
|
|
3
|
-
"version": "8.0.0-rc.
|
|
3
|
+
"version": "8.0.0-rc.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"uniku": "^0.5.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@internal/config": "8.0.0-rc.
|
|
19
|
-
"@internal/contract": "8.0.0-rc.
|
|
20
|
-
"@internal/contract-authoring": "8.0.0-rc.
|
|
21
|
-
"@internal/errors": "8.0.0-rc.
|
|
22
|
-
"@internal/framework-components": "8.0.0-rc.
|
|
23
|
-
"@internal/ids": "8.0.0-rc.
|
|
24
|
-
"@internal/operations": "8.0.0-rc.
|
|
25
|
-
"@internal/psl-parser": "8.0.0-rc.
|
|
26
|
-
"@internal/psl-printer": "8.0.0-rc.
|
|
27
|
-
"@internal/ts-render": "8.0.0-rc.
|
|
28
|
-
"@repo/tsconfig": "8.0.0-rc.
|
|
29
|
-
"@internal/publish-surface": "8.0.0-rc.
|
|
30
|
-
"@repo/tsdown": "8.0.0-rc.
|
|
31
|
-
"@internal/utils": "8.0.0-rc.
|
|
18
|
+
"@internal/config": "8.0.0-rc.2",
|
|
19
|
+
"@internal/contract": "8.0.0-rc.2",
|
|
20
|
+
"@internal/contract-authoring": "8.0.0-rc.2",
|
|
21
|
+
"@internal/errors": "8.0.0-rc.2",
|
|
22
|
+
"@internal/framework-components": "8.0.0-rc.2",
|
|
23
|
+
"@internal/ids": "8.0.0-rc.2",
|
|
24
|
+
"@internal/operations": "8.0.0-rc.2",
|
|
25
|
+
"@internal/psl-parser": "8.0.0-rc.2",
|
|
26
|
+
"@internal/psl-printer": "8.0.0-rc.2",
|
|
27
|
+
"@internal/ts-render": "8.0.0-rc.2",
|
|
28
|
+
"@repo/tsconfig": "8.0.0-rc.2",
|
|
29
|
+
"@internal/publish-surface": "8.0.0-rc.2",
|
|
30
|
+
"@repo/tsdown": "8.0.0-rc.2",
|
|
31
|
+
"@internal/utils": "8.0.0-rc.2",
|
|
32
32
|
"tsdown": "0.22.14",
|
|
33
33
|
"typescript": "5.9.3",
|
|
34
34
|
"vitest": "4.1.10"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-C9JfxzPo-CxCL2sxo.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-C9JfxzPo.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { docsUrlFor } from \"@internal/utils/structured-error\";\n//#region src/control.ts\n/**\n* Structured CLI error that contains all information needed for error envelopes.\n* Call sites throw these errors with full context.\n*\n* A `CliStructuredError` is a `StructuredError` (see\n* `@internal/utils/structured-error`): `code` is a dotted\n* `NAMESPACE.SUBCODE` string, and the namespace prefix is the error's\n* category — there is no separate `domain` field. See\n* [ADR 239](../../../../../docs/architecture%20docs/adrs/ADR%20239%20-%20Errors%20are%20structural%20envelopes%20with%20dotted%20namespace%20codes.md)\n* for the namespace taxonomy.\n*/\nvar CliStructuredError = class extends Error {\n\tcode;\n\tseverity;\n\tconstructor(code, summary, options) {\n\t\tsuper(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);\n\t\tthis.name = \"CliStructuredError\";\n\t\tthis.code = code;\n\t\tthis.severity = options?.severity ?? \"error\";\n\t\tconst fix = options?.fix === options?.why ? void 0 : options?.fix;\n\t\tconst where = options?.where ? {\n\t\t\t...ifDefined(\"path\", options.where.path),\n\t\t\t...ifDefined(\"line\", options.where.line)\n\t\t} : void 0;\n\t\tObject.assign(this, {\n\t\t\t...ifDefined(\"why\", options?.why),\n\t\t\t...ifDefined(\"fix\", fix),\n\t\t\t...ifDefined(\"nextActions\", options?.nextActions),\n\t\t\t...ifDefined(\"where\", where),\n\t\t\t...ifDefined(\"meta\", options?.meta),\n\t\t\t...ifDefined(\"docsUrl\", options?.docsUrl)\n\t\t});\n\t}\n\t/**\n\t* Converts this error to a CLI error envelope for output formatting.\n\t*\n\t* This is the boundary that emits the envelope, so it is where a missing\n\t* `nextActions` becomes `[]`.\n\t*/\n\ttoEnvelope() {\n\t\treturn {\n\t\t\tok: false,\n\t\t\tcode: this.code,\n\t\t\tseverity: this.severity,\n\t\t\tsummary: this.message,\n\t\t\t...ifDefined(\"why\", this.why),\n\t\t\t...ifDefined(\"fix\", this.fix),\n\t\t\tnextActions: this.nextActions ?? [],\n\t\t\t...ifDefined(\"where\", this.where),\n\t\t\t...ifDefined(\"meta\", this.meta),\n\t\t\t...ifDefined(\"docsUrl\", this.docsUrl)\n\t\t};\n\t}\n\t/**\n\t* Type guard to check if an error is a CliStructuredError.\n\t* Uses duck-typing to work across module boundaries where instanceof may fail.\n\t*/\n\tstatic is(error) {\n\t\tif (!(error instanceof Error)) return false;\n\t\tconst candidate = error;\n\t\treturn candidate.name === \"CliStructuredError\" && typeof candidate.code === \"string\" && typeof candidate.toEnvelope === \"function\";\n\t}\n};\n/**\n* Config file not found or missing.\n*/\nfunction errorConfigFileNotFound(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.FILE_NOT_FOUND\", \"Config file not found\", {\n\t\t...options?.why ? { why: options.why } : { why: \"Config file not found\" },\n\t\tfix: \"Run 'prisma-next init' to create a config file\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Create a config file\",\n\t\t\tcommand: \"{bin} init\"\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Config module failed to evaluate (syntax error, module threw during import).\n*/\nfunction errorConfigEvaluationFailed(configPath, options) {\n\treturn new CliStructuredError(\"CONFIG.EVALUATION_FAILED\", \"Config file could not be evaluated\", {\n\t\twhy: options.why,\n\t\tfix: \"Fix the error in your prisma-next.config.ts so the module evaluates, then rerun the command\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.EVALUATION_FAILED\"),\n\t\t...configPath ? { where: { path: configPath } } : {},\n\t\t...options.cause !== void 0 ? { cause: options.cause } : {}\n\t});\n}\n/**\n* Config module evaluated, but its export does not carry the defineConfig\n* version marker (plain object export, or a config produced by a different\n* defineConfig such as classic Prisma's).\n*/\nfunction errorConfigVersionMarkerMissing(configPath) {\n\treturn new CliStructuredError(\"CONFIG.VERSION_MARKER_MISSING\", \"Config is not a defineConfig result\", {\n\t\twhy: \"The config module evaluated, but its default export was not created by a current defineConfig\",\n\t\tfix: \"Create the config with defineConfig (imported from your target's '/config' entrypoint) and export its return value directly\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VERSION_MARKER_MISSING\"),\n\t\t...configPath ? { where: { path: configPath } } : {}\n\t});\n}\n/**\n* Contract configuration missing from config.\n*/\nfunction errorContractConfigMissing(options) {\n\treturn new CliStructuredError(\"CONFIG.CONTRACT_MISSING\", \"Contract configuration missing\", {\n\t\twhy: options?.why ?? \"The contract configuration is required for emit\",\n\t\tfix: \"Add contract configuration to your prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.CONTRACT_MISSING\")\n\t});\n}\n/**\n* Contract validation failed.\n*/\nfunction errorContractValidationFailed(reason, options) {\n\treturn new CliStructuredError(\"CONTRACT.VALIDATION_FAILED\", \"Contract validation failed\", {\n\t\twhy: reason,\n\t\tfix: \"Re-run `prisma-next contract emit`, or fix the contract file and try again\",\n\t\tnextActions: [{\n\t\t\tkind: \"run-command\",\n\t\t\tlabel: \"Re-emit the contract\",\n\t\t\tcommand: \"{bin} contract emit\"\n\t\t}, {\n\t\t\tkind: \"edit-file\",\n\t\t\tlabel: \"Fix the contract file, then re-run the command\",\n\t\t\treason\n\t\t}],\n\t\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* File not found.\n*/\nfunction errorFileNotFound(filePath, options) {\n\treturn new CliStructuredError(\"CLI.FILE_NOT_FOUND\", \"File not found\", {\n\t\twhy: options?.why ?? `File not found: ${filePath}`,\n\t\tfix: options?.fix ?? \"Check that the file path is correct\",\n\t\twhere: { path: filePath },\n\t\t...options?.docsUrl ? { docsUrl: options.docsUrl } : {},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Database connection is required but not provided.\n*/\nfunction errorDatabaseConnectionRequired(options) {\n\tconst runHint = options?.retryCommand ? `Run \\`${options.retryCommand}\\`` : options?.commandName ? `Run \\`prisma-next ${options.commandName} --db <url>\\`` : \"Provide `--db <url>`\";\n\treturn new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"Database connection is required\", {\n\t\twhy: options?.why ?? \"Database connection is required for this command\",\n\t\tfix: `${runHint}, or set \\`db: { connection: \"postgres://…\" }\\` in prisma-next.config.ts`,\n\t\t...options?.missingFlags !== void 0 ? { meta: { missingFlags: [...options.missingFlags] } } : {}\n\t});\n}\n/**\n* Query runner factory is required but not provided in config.\n*/\nfunction errorQueryRunnerFactoryRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\", \"Query runner factory is required\", {\n\t\twhy: options?.why ?? \"Config.db.queryRunnerFactory is required for db verify\",\n\t\tfix: \"Add db.queryRunnerFactory to prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.QUERY_RUNNER_FACTORY_REQUIRED\")\n\t});\n}\n/**\n* Family verify.readMarker is required but not provided.\n*/\nfunction errorFamilyReadMarkerSqlRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\", \"Family readMarker() is required\", {\n\t\twhy: options?.why ?? \"Family verify.readMarker is required for db verify\",\n\t\tfix: \"Ensure family.verify.readMarker() is exported by your family package\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.FAMILY_READ_MARKER_REQUIRED\")\n\t});\n}\n/**\n* JSON output format not supported.\n*/\nfunction errorJsonFormatNotSupported(options) {\n\treturn new CliStructuredError(\"CLI.JSON_FORMAT_UNSUPPORTED\", \"Unsupported JSON format\", {\n\t\twhy: `The ${options.command} command does not support --json ${options.format}`,\n\t\tfix: `Use --json ${options.supportedFormats.join(\" or \")}, or omit --json for human output`,\n\t\tmeta: {\n\t\t\tcommand: options.command,\n\t\t\tformat: options.format,\n\t\t\tsupportedFormats: options.supportedFormats\n\t\t}\n\t});\n}\n/**\n* Driver is required for DB-connected commands but not provided.\n*/\nfunction errorDriverRequired(options) {\n\treturn new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is required for DB-connected commands\", {\n\t\twhy: options?.why ?? \"Config.driver is required for DB-connected commands\",\n\t\tfix: \"Add a control-plane driver to prisma-next.config.ts (e.g. import a driver descriptor and set `driver: postgresDriver`)\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.DRIVER_REQUIRED\")\n\t});\n}\n/**\n* Contract requires extension packs that are not provided by config descriptors.\n*/\nfunction errorContractMissingExtensions(options) {\n\tconst missing = [...options.missingExtensions].sort();\n\treturn new CliStructuredError(\"CONFIG.MISSING_EXTENSION_PACKS\", \"Missing extension packs in config\", {\n\t\twhy: 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.`,\n\t\tfix: \"Add the missing extension descriptors to `extensions` in prisma-next.config.ts\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.MISSING_EXTENSION_PACKS\"),\n\t\tmeta: {\n\t\t\tmissingExtensions: missing,\n\t\t\tprovidedComponentIds: [...options.providedComponentIds].sort()\n\t\t}\n\t});\n}\n/**\n* Migration planning failed due to conflicts.\n*/\nfunction errorMigrationPlanningFailed(options) {\n\tconst conflictSummaries = options.conflicts.map((c) => c.summary);\n\tconst computedWhy = options.why ?? conflictSummaries.join(\"\\n\");\n\tconst conflictFixes = options.conflicts.map((c) => c.why).filter((why) => typeof why === \"string\");\n\treturn new CliStructuredError(\"MIGRATION.PLANNING_FAILED\", \"Migration planning failed\", {\n\t\twhy: computedWhy,\n\t\tfix: conflictFixes.length > 0 ? conflictFixes.join(\"\\n\") : \"Use `db verify --schema-only` to inspect conflicts, or ensure the database is empty\",\n\t\tmeta: { conflicts: options.conflicts },\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.PLANNING_FAILED\")\n\t});\n}\n/**\n* Target does not support migrations (missing createPlanner/createRunner).\n*/\nfunction errorTargetMigrationNotSupported(options) {\n\treturn new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", \"Target does not support migrations\", {\n\t\twhy: options?.why ?? \"The configured target does not provide migration planner/runner\",\n\t\tfix: \"Select a target that provides migrations (it must export `target.migrations` for db init)\",\n\t\tdocsUrl: docsUrlFor(\"MIGRATION.TARGET_UNSUPPORTED\")\n\t});\n}\n/**\n* The migration-file CLI received `--config` without a path argument (either\n* a bare trailing `--config`, or `--config` followed by another flag like\n* `--config --dry-run`). Surfacing this as a structured error fails fast\n* rather than silently consuming the next flag as the config path or\n* falling back to default discovery against the wrong project.\n*/\nfunction errorMigrationCliInvalidConfigArg(options) {\n\treturn new CliStructuredError(\"CLI.CONFIG_ARG_MISSING_PATH\", \"--config flag requires a path argument\", {\n\t\twhy: options?.nextToken !== void 0 ? `\\`--config\\` was followed by another flag (\\`${options.nextToken}\\`) instead of a path argument.` : \"`--config` was passed without a following path argument.\",\n\t\tfix: \"Pass a config path: `--config <path>` or `--config=<path>`.\",\n\t\tmeta: options?.nextToken !== void 0 ? { nextToken: options.nextToken } : {}\n\t});\n}\n/**\n* The migration-file CLI received a flag it does not recognise. Surfaced as a\n* structured error so consumers can render their own \"did you mean\"\n* suggestions from `meta.knownFlags` rather than parsing the message.\n*\n* Designed to wrap clipanion's `UnknownSyntaxError` at the parser boundary:\n* pass the offending token as `flag` and the option declarations as\n* `knownFlags`.\n*/\nfunction errorMigrationCliUnknownFlag(options) {\n\tconst knownList = options.knownFlags.join(\", \");\n\treturn new CliStructuredError(\"CLI.UNKNOWN_FLAG\", \"Unknown migration CLI flag\", {\n\t\twhy: `Unknown flag \\`${options.flag}\\`.`,\n\t\tfix: `Known flags: ${knownList}. Run with \\`--help\\` to see the full list.`,\n\t\tmeta: {\n\t\t\tflag: options.flag,\n\t\t\tknownFlags: options.knownFlags\n\t\t}\n\t});\n}\n/**\n* The main CLI received an unsupported `--format` value.\n*/\nfunction errorInvalidOutputFormat(value) {\n\treturn new CliStructuredError(\"CLI.INVALID_OUTPUT_FORMAT\", `Invalid --format value \"${value}\". Allowed values: pretty, json.`, { meta: {\n\t\tvalue,\n\t\tallowed: [\"pretty\", \"json\"]\n\t} });\n}\n/**\n* The main CLI received mutually exclusive output format flags\n* (`--format pretty` together with `--json`).\n*/\nfunction errorOutputFormatMutex() {\n\treturn new CliStructuredError(\"CLI.OUTPUT_FORMAT_CONFLICT\", \"Cannot use --format pretty together with --json. Use --format json or --json alone for JSON output.\");\n}\n/**\n* Config validation error (missing required fields).\n*/\nfunction errorConfigValidation(field, options) {\n\treturn new CliStructuredError(\"CONFIG.VALIDATION_FAILED\", \"Config validation error\", {\n\t\twhy: options?.why ?? `Config must have a \"${field}\" field`,\n\t\tfix: \"Check your prisma-next.config.ts and ensure all required fields are provided\",\n\t\tdocsUrl: docsUrlFor(\"CONFIG.VALIDATION_FAILED\"),\n\t\tmeta: {\n\t\t\tfield,\n\t\t\t...options?.section !== void 0 ? { section: options.section } : {}\n\t\t}\n\t});\n}\n/**\n* An enum declares a codecId that no component in the contract's pack stack provides,\n* so its member values cannot be encoded. Thrown by both authoring paths (TS `defineContract`\n* and PSL interpretation) when the codec lookup built from the contract's packs has no\n* descriptor for the codecId.\n*/\nfunction errorEnumCodecNotInPackStack(options) {\n\treturn new CliStructuredError(\"CONTRACT.ENUM_CODEC_NOT_IN_PACK_STACK\", `Enum codec \"${options.codecId}\" is not part of the contract's pack stack`, {\n\t\twhy: `An enum uses codec \"${options.codecId}\", but no family, target, or extension pack in the contract provides it.`,\n\t\tfix: \"Use a codec provided by the contract's target/extension packs, or add the pack that supplies this codec.\",\n\t\tmeta: { codecId: options.codecId }\n\t});\n}\n/**\n* Generic unexpected error.\n*/\nfunction errorUnexpected(message, options) {\n\treturn new CliStructuredError(\"CLI.UNEXPECTED\", \"Unexpected error\", {\n\t\twhy: options?.why ?? message,\n\t\tfix: options?.fix ?? \"Check the error message and try again\",\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n//#endregion\nexport { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigVersionMarkerMissing as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigValidation as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, errorConfigEvaluationFailed as n, errorContractConfigMissing as o, errorFileNotFound as p, errorConfigFileNotFound as r, errorContractMissingExtensions as s, CliStructuredError as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };\n\n//# sourceMappingURL=control-C9JfxzPo.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,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