@prisma/orm-framework 8.0.0-rc.1-dev.4 → 8.0.0-rc.1-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{control-B87KWI_K-C_R8WfEr.d.mts → control-CwRPkRJ7-Dk0c6D_5.d.mts} +6 -2
- package/dist/control-CwRPkRJ7-Dk0c6D_5.d.mts.map +1 -0
- package/dist/{control-Ftiau058-CCeJcAVQ.mjs → control-NxsoLvV7-CEAZQk3h.mjs} +9 -6
- package/dist/control-NxsoLvV7-CEAZQk3h.mjs.map +1 -0
- package/dist/errors.d.mts +3 -3
- package/dist/errors.mjs +3 -3
- package/dist/errors__control.d.mts +1 -1
- package/dist/errors__control.mjs +1 -1
- package/dist/errors__execution.d.mts +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-BbOD4GyR.mjs → execution-D1Tn68OX.mjs} +23 -15
- package/dist/execution-D1Tn68OX.mjs.map +1 -0
- package/dist/{execution-4sAWQx8X.d.mts → execution-k_kzuxxs.d.mts} +8 -4
- package/dist/execution-k_kzuxxs.d.mts.map +1 -0
- package/dist/{migration-DKbDzBwy.d.mts → migration-C02YXQMR.d.mts} +2 -2
- package/dist/{migration-DKbDzBwy.d.mts.map → migration-C02YXQMR.d.mts.map} +1 -1
- package/dist/{migration-4VOHVEzx.mjs → migration-Ds6n8w-H.mjs} +2 -2
- package/dist/{migration-4VOHVEzx.mjs.map → migration-Ds6n8w-H.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/control-B87KWI_K-C_R8WfEr.d.mts.map +0 -1
- package/dist/control-Ftiau058-CCeJcAVQ.mjs.map +0 -1
- package/dist/execution-4sAWQx8X.d.mts.map +0 -1
- package/dist/execution-BbOD4GyR.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as StructuredError } from "./structured-error-BVmv2aPB.mjs";
|
|
2
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
2
|
+
//#region ../../../1-framework/1-core/errors/dist/control-CwRPkRJ7.d.mts
|
|
3
3
|
//#region src/control.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* CLI error envelope for output formatting.
|
|
@@ -59,6 +59,7 @@ declare class CliStructuredError extends Error implements StructuredError {
|
|
|
59
59
|
};
|
|
60
60
|
readonly meta?: Record<string, unknown>;
|
|
61
61
|
readonly docsUrl?: string;
|
|
62
|
+
readonly cause?: unknown;
|
|
62
63
|
});
|
|
63
64
|
/**
|
|
64
65
|
* Converts this error to a CLI error envelope for output formatting.
|
|
@@ -90,6 +91,7 @@ declare function errorContractValidationFailed(reason: string, options?: {
|
|
|
90
91
|
readonly path?: string;
|
|
91
92
|
readonly line?: number;
|
|
92
93
|
};
|
|
94
|
+
readonly cause?: unknown;
|
|
93
95
|
}): CliStructuredError;
|
|
94
96
|
/**
|
|
95
97
|
* File not found.
|
|
@@ -98,6 +100,7 @@ declare function errorFileNotFound(filePath: string, options?: {
|
|
|
98
100
|
readonly why?: string;
|
|
99
101
|
readonly fix?: string;
|
|
100
102
|
readonly docsUrl?: string;
|
|
103
|
+
readonly cause?: unknown;
|
|
101
104
|
}): CliStructuredError;
|
|
102
105
|
/**
|
|
103
106
|
* Database connection is required but not provided.
|
|
@@ -207,7 +210,8 @@ declare function errorEnumCodecNotInPackStack(options: {
|
|
|
207
210
|
declare function errorUnexpected(message: string, options?: {
|
|
208
211
|
readonly why?: string;
|
|
209
212
|
readonly fix?: string;
|
|
213
|
+
readonly cause?: unknown;
|
|
210
214
|
}): CliStructuredError;
|
|
211
215
|
//#endregion
|
|
212
216
|
export { errorUnexpected as S, errorMigrationCliUnknownFlag as _, errorConfigValidation as a, errorQueryRunnerFactoryRequired as b, errorContractValidationFailed as c, errorEnumCodecNotInPackStack as d, errorFamilyReadMarkerSqlRequired as f, errorMigrationCliInvalidConfigArg as g, errorJsonFormatNotSupported as h, errorConfigFileNotFound as i, errorDatabaseConnectionRequired as l, errorInvalidOutputFormat as m, CliErrorEnvelope as n, errorContractConfigMissing as o, errorFileNotFound as p, CliStructuredError as r, errorContractMissingExtensions as s, CliErrorConflict as t, errorDriverRequired as u, errorMigrationPlanningFailed as v, errorTargetMigrationNotSupported as x, errorOutputFormatMutex as y };
|
|
213
|
-
//# sourceMappingURL=control-
|
|
217
|
+
//# sourceMappingURL=control-CwRPkRJ7-Dk0c6D_5.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-CwRPkRJ7-Dk0c6D_5.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-CwRPkRJ7.d.mts"],"mappings":";;;;;;;UAMU;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;UAKD;WACC;WACA;WACA;;;;;;;;;;;;;cAaG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA;eACE;eACA;;aAEF,OAAO;aACP;aACA;;;;;EAKX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;iBAKrB,wBAAwB,qBAAqB;WACnD;IACP;;;;iBAIa,2BAA2B;WACjC;IACP;;;;iBAIa,8BAA8B,gBAAgB;WACpD;aACE;aACA;;WAEF;IACP;;;;iBAIa,kBAAkB,kBAAkB;WAC1C;WACA;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;WACA;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;iBAIa,4BAA4B;WAClC;WACA;WACA;IACP;;;;iBAIa,oBAAoB;WAC1B;IACP;;;;iBAIa,+BAA+B;WACrC;WACA;IACP;;;;iBAIa,6BAA6B;WACnC,oBAAoB;WACpB;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;;;;;iBAQa,kCAAkC;WACxC;IACP;;;;;;;;;;iBAUa,6BAA6B;WACnC;WACA;IACP;;;;iBAIa,yBAAyB,gBAAgB;;;;;iBAKzC,0BAA0B;;;;iBAI1B,sBAAsB,eAAe;WAC3C;IACP;;;;;;;iBAOa,6BAA6B;WACnC;IACP;;;;iBAIa,gBAAgB,iBAAiB;WACvC;WACA;WACA;IACP"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as ifDefined } from "./defined-BQWA85QH-BRSBMULx.mjs";
|
|
2
2
|
import { r as docsUrlFor } from "./structured-error-H6WU9Kjt.mjs";
|
|
3
|
-
//#region ../../../1-framework/1-core/errors/dist/control-
|
|
3
|
+
//#region ../../../1-framework/1-core/errors/dist/control-NxsoLvV7.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.
|
|
@@ -16,7 +16,7 @@ var CliStructuredError = class extends Error {
|
|
|
16
16
|
code;
|
|
17
17
|
severity;
|
|
18
18
|
constructor(code, summary, options) {
|
|
19
|
-
super(summary);
|
|
19
|
+
super(summary, options?.cause !== void 0 ? { cause: options.cause } : void 0);
|
|
20
20
|
this.name = "CliStructuredError";
|
|
21
21
|
this.code = code;
|
|
22
22
|
this.severity = options?.severity ?? "error";
|
|
@@ -88,7 +88,8 @@ function errorContractValidationFailed(reason, options) {
|
|
|
88
88
|
why: reason,
|
|
89
89
|
fix: "Re-run `prisma-next contract emit`, or fix the contract file and try again",
|
|
90
90
|
docsUrl: docsUrlFor("CONTRACT.VALIDATION_FAILED"),
|
|
91
|
-
...options?.where ? { where: options.where } : {}
|
|
91
|
+
...options?.where ? { where: options.where } : {},
|
|
92
|
+
...ifDefined("cause", options?.cause)
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
/**
|
|
@@ -99,7 +100,8 @@ function errorFileNotFound(filePath, options) {
|
|
|
99
100
|
why: options?.why ?? `File not found: ${filePath}`,
|
|
100
101
|
fix: options?.fix ?? "Check that the file path is correct",
|
|
101
102
|
where: { path: filePath },
|
|
102
|
-
...options?.docsUrl ? { docsUrl: options.docsUrl } : {}
|
|
103
|
+
...options?.docsUrl ? { docsUrl: options.docsUrl } : {},
|
|
104
|
+
...ifDefined("cause", options?.cause)
|
|
103
105
|
});
|
|
104
106
|
}
|
|
105
107
|
/**
|
|
@@ -275,10 +277,11 @@ function errorEnumCodecNotInPackStack(options) {
|
|
|
275
277
|
function errorUnexpected(message, options) {
|
|
276
278
|
return new CliStructuredError("CLI.UNEXPECTED", "Unexpected error", {
|
|
277
279
|
why: options?.why ?? message,
|
|
278
|
-
fix: options?.fix ?? "Check the error message and try again"
|
|
280
|
+
fix: options?.fix ?? "Check the error message and try again",
|
|
281
|
+
...ifDefined("cause", options?.cause)
|
|
279
282
|
});
|
|
280
283
|
}
|
|
281
284
|
//#endregion
|
|
282
285
|
export { errorOutputFormatMutex as _, errorContractMissingExtensions as a, errorUnexpected as b, errorDriverRequired as c, errorFileNotFound as d, errorInvalidOutputFormat as f, errorMigrationPlanningFailed as g, errorMigrationCliUnknownFlag as h, errorContractConfigMissing as i, errorEnumCodecNotInPackStack as l, errorMigrationCliInvalidConfigArg as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorJsonFormatNotSupported as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFamilyReadMarkerSqlRequired as u, errorQueryRunnerFactoryRequired as v, errorTargetMigrationNotSupported as y };
|
|
283
286
|
|
|
284
|
-
//# sourceMappingURL=control-
|
|
287
|
+
//# sourceMappingURL=control-NxsoLvV7-CEAZQk3h.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"control-NxsoLvV7-CEAZQk3h.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-NxsoLvV7.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(\"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\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\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\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\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\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});\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 { errorOutputFormatMutex as _, errorContractMissingExtensions as a, errorUnexpected as b, errorDriverRequired as c, errorFileNotFound as d, errorInvalidOutputFormat as f, errorMigrationPlanningFailed as g, errorMigrationCliUnknownFlag as h, errorContractConfigMissing as i, errorEnumCodecNotInPackStack as l, errorMigrationCliInvalidConfigArg as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorJsonFormatNotSupported as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFamilyReadMarkerSqlRequired as u, errorQueryRunnerFactoryRequired as v, errorTargetMigrationNotSupported as y };\n\n//# sourceMappingURL=control-NxsoLvV7.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,SAAS,KAAK;GAC3B,GAAG,UAAU,QAAQ,SAAS,IAAI;GAClC,GAAG,UAAU,WAAW,SAAS,OAAO;EACzC,CAAC;CACF;;;;CAIA,aAAa;EACZ,OAAO;GACN,IAAI;GACJ,MAAM,KAAK;GACX,UAAU,KAAK;GACf,SAAS,KAAK;GACd,GAAG,UAAU,OAAO,KAAK,GAAG;GAC5B,GAAG,UAAU,OAAO,KAAK,GAAG;GAC5B,GAAG,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A8B;EAC/E,KAAK,kBAAkB,QAAQ,KAAK;EACpC,KAAK,gBAAgB,UAAU;EAC/B,MAAM;GACL,MAAM,QAAQ;GACd,YAAY,QAAQ;EACrB;CACD,CAAC;AACF;;;;AAIA,SAAS,yBAAyB,OAAO;CACxC,OAAO,IAAI,mBAAmB,6BAA6B,2BAA2B,MAAM,mCAAmC,EAAE,MAAM;EACtI;EACA,SAAS,CAAC,UAAU,MAAM;CAC3B,EAAE,CAAC;AACJ;;;;;AAKA,SAAS,yBAAyB;CACjC,OAAO,IAAI,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;CAC/C,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
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigValidation, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorFileNotFound, r as CliStructuredError, s as errorContractMissingExtensions, t as CliErrorConflict, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
2
|
-
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } 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 errorConfigValidation, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorFileNotFound, r as CliStructuredError, s as errorContractMissingExtensions, t as CliErrorConflict, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-CwRPkRJ7-Dk0c6D_5.mjs";
|
|
2
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-k_kzuxxs.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-C02YXQMR.mjs";
|
|
4
4
|
export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigFileNotFound, errorConfigValidation, 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 { _ as errorOutputFormatMutex, a as errorContractMissingExtensions, b as errorUnexpected, c as errorDriverRequired, d as errorFileNotFound, f as errorInvalidOutputFormat, g as errorMigrationPlanningFailed, h as errorMigrationCliUnknownFlag, i as errorContractConfigMissing, l as errorEnumCodecNotInPackStack, m as errorMigrationCliInvalidConfigArg, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorJsonFormatNotSupported, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFamilyReadMarkerSqlRequired, v as errorQueryRunnerFactoryRequired, y as errorTargetMigrationNotSupported } from "./control-
|
|
2
|
-
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } 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 { _ as errorOutputFormatMutex, a as errorContractMissingExtensions, b as errorUnexpected, c as errorDriverRequired, d as errorFileNotFound, f as errorInvalidOutputFormat, g as errorMigrationPlanningFailed, h as errorMigrationCliUnknownFlag, i as errorContractConfigMissing, l as errorEnumCodecNotInPackStack, m as errorMigrationCliInvalidConfigArg, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorJsonFormatNotSupported, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFamilyReadMarkerSqlRequired, v as errorQueryRunnerFactoryRequired, y as errorTargetMigrationNotSupported } from "./control-NxsoLvV7-CEAZQk3h.mjs";
|
|
2
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-D1Tn68OX.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-Ds6n8w-H.mjs";
|
|
4
4
|
export { CliStructuredError, ERROR_CODE_DESTRUCTIVE_CHANGES, errorConfigFileNotFound, errorConfigValidation, 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 };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigValidation, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorFileNotFound, r as CliStructuredError, s as errorContractMissingExtensions, t as CliErrorConflict, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-
|
|
1
|
+
import { S as errorUnexpected, _ as errorMigrationCliUnknownFlag, a as errorConfigValidation, b as errorQueryRunnerFactoryRequired, c as errorContractValidationFailed, d as errorEnumCodecNotInPackStack, f as errorFamilyReadMarkerSqlRequired, g as errorMigrationCliInvalidConfigArg, h as errorJsonFormatNotSupported, i as errorConfigFileNotFound, l as errorDatabaseConnectionRequired, m as errorInvalidOutputFormat, n as CliErrorEnvelope, o as errorContractConfigMissing, p as errorFileNotFound, r as CliStructuredError, s as errorContractMissingExtensions, t as CliErrorConflict, u as errorDriverRequired, v as errorMigrationPlanningFailed, x as errorTargetMigrationNotSupported, y as errorOutputFormatMutex } from "./control-CwRPkRJ7-Dk0c6D_5.mjs";
|
|
2
2
|
export { type CliErrorConflict, type CliErrorEnvelope, CliStructuredError, errorConfigFileNotFound, errorConfigValidation, errorContractConfigMissing, errorContractMissingExtensions, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorEnumCodecNotInPackStack, errorFamilyReadMarkerSqlRequired, errorFileNotFound, errorInvalidOutputFormat, errorJsonFormatNotSupported, errorMigrationCliInvalidConfigArg, errorMigrationCliUnknownFlag, errorMigrationPlanningFailed, errorOutputFormatMutex, errorQueryRunnerFactoryRequired, errorTargetMigrationNotSupported, errorUnexpected };
|
package/dist/errors__control.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as errorOutputFormatMutex, a as errorContractMissingExtensions, b as errorUnexpected, c as errorDriverRequired, d as errorFileNotFound, f as errorInvalidOutputFormat, g as errorMigrationPlanningFailed, h as errorMigrationCliUnknownFlag, i as errorContractConfigMissing, l as errorEnumCodecNotInPackStack, m as errorMigrationCliInvalidConfigArg, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorJsonFormatNotSupported, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFamilyReadMarkerSqlRequired, v as errorQueryRunnerFactoryRequired, y as errorTargetMigrationNotSupported } from "./control-
|
|
1
|
+
import { _ as errorOutputFormatMutex, a as errorContractMissingExtensions, b as errorUnexpected, c as errorDriverRequired, d as errorFileNotFound, f as errorInvalidOutputFormat, g as errorMigrationPlanningFailed, h as errorMigrationCliUnknownFlag, i as errorContractConfigMissing, l as errorEnumCodecNotInPackStack, m as errorMigrationCliInvalidConfigArg, n as errorConfigFileNotFound, o as errorContractValidationFailed, p as errorJsonFormatNotSupported, r as errorConfigValidation, s as errorDatabaseConnectionRequired, t as CliStructuredError, u as errorFamilyReadMarkerSqlRequired, v as errorQueryRunnerFactoryRequired, y as errorTargetMigrationNotSupported } from "./control-NxsoLvV7-CEAZQk3h.mjs";
|
|
2
2
|
export { CliStructuredError, errorConfigFileNotFound, errorConfigValidation, 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 errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-
|
|
1
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-k_kzuxxs.mjs";
|
|
2
2
|
export { ERROR_CODE_DESTRUCTIVE_CHANGES, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerRowSafely, rethrowMarkerReadError, withMarkerReadErrorHandling };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-
|
|
1
|
+
import { a as errorMarkerReadFailed, c as errorRunnerFailed, d as errorTargetMismatch, f as parseMarkerRowSafely, i as errorMarkerMissing, l as errorRuntime, m as withMarkerReadErrorHandling, n as errorDestructiveChanges, o as errorMarkerRequired, p as rethrowMarkerReadError, r as errorHashMismatch, s as errorMarkerRowCorrupt, t as ERROR_CODE_DESTRUCTIVE_CHANGES, u as errorSchemaVerificationFailed } from "./execution-D1Tn68OX.mjs";
|
|
2
2
|
export { ERROR_CODE_DESTRUCTIVE_CHANGES, 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-C02YXQMR.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-Ds6n8w-H.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-NxsoLvV7-CEAZQk3h.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/errors/dist/execution.mjs
|
|
4
4
|
/**
|
|
5
5
|
* Contract marker not found in database.
|
|
@@ -43,7 +43,8 @@ function errorMarkerRowCorrupt(options) {
|
|
|
43
43
|
return new CliStructuredError("CONTRACT.MARKER_ROW_CORRUPT", "Marker row is corrupt or incompatible", {
|
|
44
44
|
why: options.why,
|
|
45
45
|
fix: `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.`,
|
|
46
|
-
meta: { space: options.space }
|
|
46
|
+
meta: { space: options.space },
|
|
47
|
+
...ifDefined("cause", options.cause)
|
|
47
48
|
});
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
@@ -53,7 +54,8 @@ function errorMarkerReadFailed(options) {
|
|
|
53
54
|
return new CliStructuredError("CONTRACT.MARKER_READ_FAILED", "Database error while reading contract marker", {
|
|
54
55
|
why: options.why,
|
|
55
56
|
fix: `Could not read marker at ${options.markerLocation} for space "${options.space}". Verify read permissions, connectivity, and locks, then retry.`,
|
|
56
|
-
meta: { space: options.space }
|
|
57
|
+
meta: { space: options.space },
|
|
58
|
+
...ifDefined("cause", options.cause)
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
function isMarkerRowParseError(err) {
|
|
@@ -67,7 +69,8 @@ function errorLegacyMarkerShape(options) {
|
|
|
67
69
|
return 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.`, {
|
|
68
70
|
why: options.why,
|
|
69
71
|
fix: "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.",
|
|
70
|
-
meta: { runnerErrorCode: "MIGRATION.LEGACY_MARKER_SHAPE" }
|
|
72
|
+
meta: { runnerErrorCode: "MIGRATION.LEGACY_MARKER_SHAPE" },
|
|
73
|
+
...ifDefined("cause", options.cause)
|
|
71
74
|
});
|
|
72
75
|
}
|
|
73
76
|
function rethrowMarkerReadError(err, context) {
|
|
@@ -75,17 +78,20 @@ function rethrowMarkerReadError(err, context) {
|
|
|
75
78
|
if (isMarkerRowParseError(err)) throw errorMarkerRowCorrupt({
|
|
76
79
|
why: err.message,
|
|
77
80
|
space: context.space,
|
|
78
|
-
markerLocation: context.markerLocation
|
|
81
|
+
markerLocation: context.markerLocation,
|
|
82
|
+
cause: err
|
|
79
83
|
});
|
|
80
84
|
const message = err instanceof Error ? err.message : String(err);
|
|
81
85
|
if (isLegacyMarkerShapeReadError(message)) throw errorLegacyMarkerShape({
|
|
82
86
|
why: message,
|
|
83
|
-
markerLocation: context.markerLocation
|
|
87
|
+
markerLocation: context.markerLocation,
|
|
88
|
+
cause: err
|
|
84
89
|
});
|
|
85
90
|
throw errorMarkerReadFailed({
|
|
86
91
|
why: message,
|
|
87
92
|
space: context.space,
|
|
88
|
-
markerLocation: context.markerLocation
|
|
93
|
+
markerLocation: context.markerLocation,
|
|
94
|
+
cause: err
|
|
89
95
|
});
|
|
90
96
|
}
|
|
91
97
|
async function withMarkerReadErrorHandling(operation, context) {
|
|
@@ -133,7 +139,8 @@ function errorRunnerFailed(summary, options) {
|
|
|
133
139
|
return new CliStructuredError("MIGRATION.RUNNER_FAILED", summary, {
|
|
134
140
|
why: options?.why ?? "Migration runner failed",
|
|
135
141
|
fix: options?.fix ?? "Inspect the reported conflict and reconcile schema drift",
|
|
136
|
-
...options?.meta ? { meta: options.meta } : {}
|
|
142
|
+
...options?.meta ? { meta: options.meta } : {},
|
|
143
|
+
...ifDefined("cause", options?.cause)
|
|
137
144
|
});
|
|
138
145
|
}
|
|
139
146
|
/** Error code for destructive changes that require explicit confirmation. */
|
|
@@ -149,16 +156,17 @@ function errorDestructiveChanges(summary, options) {
|
|
|
149
156
|
});
|
|
150
157
|
}
|
|
151
158
|
/**
|
|
152
|
-
* Generic runtime error.
|
|
159
|
+
* Generic runtime error carrying a caller-provided dotted code.
|
|
153
160
|
*/
|
|
154
|
-
function errorRuntime(summary, options) {
|
|
155
|
-
return new CliStructuredError(
|
|
156
|
-
...
|
|
157
|
-
...
|
|
158
|
-
...
|
|
161
|
+
function errorRuntime(code, summary, options) {
|
|
162
|
+
return new CliStructuredError(code, summary, {
|
|
163
|
+
...ifDefined("why", options?.why),
|
|
164
|
+
...ifDefined("fix", options?.fix),
|
|
165
|
+
...ifDefined("meta", options?.meta),
|
|
166
|
+
...ifDefined("cause", options?.cause)
|
|
159
167
|
});
|
|
160
168
|
}
|
|
161
169
|
//#endregion
|
|
162
170
|
export { errorMarkerReadFailed as a, errorRunnerFailed as c, errorTargetMismatch as d, parseMarkerRowSafely as f, errorMarkerMissing as i, errorRuntime as l, withMarkerReadErrorHandling as m, errorDestructiveChanges as n, errorMarkerRequired as o, rethrowMarkerReadError as p, errorHashMismatch as r, errorMarkerRowCorrupt as s, ERROR_CODE_DESTRUCTIVE_CHANGES as t, errorSchemaVerificationFailed as u };
|
|
163
171
|
|
|
164
|
-
//# sourceMappingURL=execution-
|
|
172
|
+
//# sourceMappingURL=execution-D1Tn68OX.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-D1Tn68OX.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-NxsoLvV7.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});\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\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\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});\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\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...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}\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_DESTRUCTIVE_CHANGES, 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,O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AAQ,MAAM;EACtC;CACD,CAAC;AACF;;;;AAIA,SAAS,kBAAkB,SAAS,SAAS;CAC5C,OAAO,IAAI,mBAAmB,2BAA2B,SAAS;EACjE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,SAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;EAC7C,GAAG,UAAU,SAAS,SAAS,KAAK;CACrC,CAAC;AACF;;AAEA,MAAM,iCAAiC;;;;AAIvC,SAAS,wBAAwB,SAAS,SAAS;CAClD,OAAO,IAAI,mBAAmB,gCAAgC,SAAS;EACtE,KAAK,SAAS,OAAO;EACrB,KAAK,SAAS,OAAO;EACrB,GAAG,SAAS,OAAO,EAAE,MAAM,QAAQ,KAAK,IAAI,CAAC;CAC9C,CAAC;AACF;;;;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,5 +1,5 @@
|
|
|
1
1
|
import { $ as SchemaDiffIssue, St as VerifyDatabaseSchemaResult } from "./control-DavL9i47.mjs";
|
|
2
|
-
import { r as CliStructuredError } from "./control-
|
|
2
|
+
import { r as CliStructuredError } from "./control-CwRPkRJ7-Dk0c6D_5.mjs";
|
|
3
3
|
//#region ../../../1-framework/1-core/errors/dist/execution.d.mts
|
|
4
4
|
//#region src/execution.d.ts
|
|
5
5
|
/**
|
|
@@ -29,6 +29,7 @@ declare function errorMarkerRowCorrupt(options: {
|
|
|
29
29
|
readonly why: string;
|
|
30
30
|
readonly space: string;
|
|
31
31
|
readonly markerLocation: string;
|
|
32
|
+
readonly cause?: unknown;
|
|
32
33
|
}): CliStructuredError;
|
|
33
34
|
/**
|
|
34
35
|
* Driver-level failure while reading the contract marker table.
|
|
@@ -37,6 +38,7 @@ declare function errorMarkerReadFailed(options: {
|
|
|
37
38
|
readonly why: string;
|
|
38
39
|
readonly space: string;
|
|
39
40
|
readonly markerLocation: string;
|
|
41
|
+
readonly cause?: unknown;
|
|
40
42
|
}): CliStructuredError;
|
|
41
43
|
declare function rethrowMarkerReadError(err: unknown, context: {
|
|
42
44
|
readonly space: string;
|
|
@@ -74,6 +76,7 @@ declare function errorRunnerFailed(summary: string, options?: {
|
|
|
74
76
|
readonly why?: string;
|
|
75
77
|
readonly fix?: string;
|
|
76
78
|
readonly meta?: Record<string, unknown>;
|
|
79
|
+
readonly cause?: unknown;
|
|
77
80
|
}): CliStructuredError;
|
|
78
81
|
/** Error code for destructive changes that require explicit confirmation. */
|
|
79
82
|
declare const ERROR_CODE_DESTRUCTIVE_CHANGES = "MIGRATION.DESTRUCTIVE_CHANGES";
|
|
@@ -86,13 +89,14 @@ declare function errorDestructiveChanges(summary: string, options?: {
|
|
|
86
89
|
readonly meta?: Record<string, unknown>;
|
|
87
90
|
}): CliStructuredError;
|
|
88
91
|
/**
|
|
89
|
-
* Generic runtime error.
|
|
92
|
+
* Generic runtime error carrying a caller-provided dotted code.
|
|
90
93
|
*/
|
|
91
|
-
declare function errorRuntime(summary: string, options?: {
|
|
94
|
+
declare function errorRuntime(code: `${string}.${string}`, summary: string, options?: {
|
|
92
95
|
readonly why?: string;
|
|
93
96
|
readonly fix?: string;
|
|
94
97
|
readonly meta?: Record<string, unknown>;
|
|
98
|
+
readonly cause?: unknown;
|
|
95
99
|
}): CliStructuredError;
|
|
96
100
|
//#endregion
|
|
97
101
|
export { errorMarkerReadFailed as a, errorRunnerFailed as c, errorTargetMismatch as d, parseMarkerRowSafely as f, errorMarkerMissing as i, errorRuntime as l, withMarkerReadErrorHandling as m, errorDestructiveChanges as n, errorMarkerRequired as o, rethrowMarkerReadError as p, errorHashMismatch as r, errorMarkerRowCorrupt as s, ERROR_CODE_DESTRUCTIVE_CHANGES as t, errorSchemaVerificationFailed as u };
|
|
98
|
-
//# sourceMappingURL=execution-
|
|
102
|
+
//# sourceMappingURL=execution-k_kzuxxs.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execution-k_kzuxxs.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.d.mts"],"mappings":";;;;;;;iBAMiB,mBAAmB;WACzB;IACP;;;;iBAIa,kBAAkB;WACxB;WACA;WACA;IACP;;;;iBAIa,oBAAoB,kBAAkB,gBAAgB;WAC5D;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;WACA;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;WACA;IACP;iBACa,uBAAuB,cAAc;WAC3C;WACA;;iBAEM,4BAA4B,GAAG,iBAAiB,QAAQ,IAAI;WAClE;WACA;IACP,QAAQ;iBACK,qBAAqB,GAAG,cAAc,QAAQ,mBAAmB,GAAG;WAC1E;WACA;IACP;;;;;iBAKa,oBAAoB;WAC1B;WACA;IACP;;;;;iBAKa,8BAA8B;WACpC;WACA,oBAAoB;WACpB,kBAAkB;IACzB;;;;iBAIa,kBAAkB,iBAAiB;WACzC;WACA;WACA,OAAO;WACP;IACP;;cAEU;;;;iBAIG,wBAAwB,iBAAiB;WAC/C;WACA;WACA,OAAO;IACd;;;;iBAIa,aAAa,6BAA6B,iBAAiB;WACjE;WACA;WACA,OAAO;WACP;IACP"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as CliStructuredError } from "./control-
|
|
1
|
+
import { r as CliStructuredError } from "./control-CwRPkRJ7-Dk0c6D_5.mjs";
|
|
2
2
|
//#region ../../../1-framework/1-core/errors/dist/migration.d.mts
|
|
3
3
|
//#region src/migration.d.ts
|
|
4
4
|
/**
|
|
@@ -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-C02YXQMR.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-C02YXQMR.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-NxsoLvV7-CEAZQk3h.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.
|
|
@@ -115,4 +115,4 @@ function errorMigrationPlanNotArray(dir, actualValueDescription) {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
export { errorMigrationTargetMismatch as a, errorMigrationPlanNotArray as i, errorMigrationFileMissing as n, errorUnfilledPlaceholder as o, errorMigrationInvalidDefaultExport as r, placeholder as s, errorDataTransformContractMismatch as t };
|
|
117
117
|
|
|
118
|
-
//# sourceMappingURL=migration-
|
|
118
|
+
//# sourceMappingURL=migration-Ds6n8w-H.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migration-
|
|
1
|
+
{"version":3,"file":"migration-Ds6n8w-H.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/migration.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-NxsoLvV7.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\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-next.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-next.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, errorMigrationTargetMismatch, errorUnfilledPlaceholder, placeholder };\n\n//# sourceMappingURL=migration.mjs.map"],"mappings":";;;;;;;;;AASA,SAAS,yBAAyB,MAAM;CACvC,OAAO,IAAI,mBAAmB,kCAAkC,kCAAkC;EACjG,KAAK,qEAAqE;EAC1E,KAAK;EACL,MAAM,EAAE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BAA2B,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.1-dev.
|
|
3
|
+
"version": "8.0.0-rc.1-dev.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
"uniku": "^0.4.3"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@internal/config": "8.0.0-rc.1-dev.
|
|
19
|
-
"@internal/contract": "8.0.0-rc.1-dev.
|
|
20
|
-
"@internal/contract-authoring": "8.0.0-rc.1-dev.
|
|
21
|
-
"@internal/errors": "8.0.0-rc.1-dev.
|
|
22
|
-
"@internal/framework-components": "8.0.0-rc.1-dev.
|
|
23
|
-
"@internal/ids": "8.0.0-rc.1-dev.
|
|
24
|
-
"@internal/operations": "8.0.0-rc.1-dev.
|
|
25
|
-
"@internal/psl-parser": "8.0.0-rc.1-dev.
|
|
26
|
-
"@internal/psl-printer": "8.0.0-rc.1-dev.
|
|
27
|
-
"@internal/ts-render": "8.0.0-rc.1-dev.
|
|
28
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
29
|
-
"@internal/publish-surface": "8.0.0-rc.1-dev.
|
|
30
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
31
|
-
"@internal/utils": "8.0.0-rc.1-dev.
|
|
18
|
+
"@internal/config": "8.0.0-rc.1-dev.6",
|
|
19
|
+
"@internal/contract": "8.0.0-rc.1-dev.6",
|
|
20
|
+
"@internal/contract-authoring": "8.0.0-rc.1-dev.6",
|
|
21
|
+
"@internal/errors": "8.0.0-rc.1-dev.6",
|
|
22
|
+
"@internal/framework-components": "8.0.0-rc.1-dev.6",
|
|
23
|
+
"@internal/ids": "8.0.0-rc.1-dev.6",
|
|
24
|
+
"@internal/operations": "8.0.0-rc.1-dev.6",
|
|
25
|
+
"@internal/psl-parser": "8.0.0-rc.1-dev.6",
|
|
26
|
+
"@internal/psl-printer": "8.0.0-rc.1-dev.6",
|
|
27
|
+
"@internal/ts-render": "8.0.0-rc.1-dev.6",
|
|
28
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.6",
|
|
29
|
+
"@internal/publish-surface": "8.0.0-rc.1-dev.6",
|
|
30
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.6",
|
|
31
|
+
"@internal/utils": "8.0.0-rc.1-dev.6",
|
|
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-B87KWI_K-C_R8WfEr.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-B87KWI_K.d.mts"],"mappings":";;;;;;;UAMU;WACC;WACA;WACA;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;;;;;UAKD;WACC;WACA;WACA;;;;;;;;;;;;;cAaG,2BAA2B,iBAAiB;WAC/C;WACA;WACA;WACA;WACA;aACE;aACA;;WAEF,OAAO;WACP;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA;aACA;eACE;eACA;;aAEF,OAAO;aACP;;;;;EAKX,cAAc;;;;;SAKP,GAAG,iBAAiB,SAAS;;;;;iBAKrB,wBAAwB,qBAAqB;WACnD;IACP;;;;iBAIa,2BAA2B;WACjC;IACP;;;;iBAIa,8BAA8B,gBAAgB;WACpD;aACE;aACA;;IAET;;;;iBAIa,kBAAkB,kBAAkB;WAC1C;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;WACA;WACA;WACA;IACP;;;;iBAIa,gCAAgC;WACtC;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;iBAIa,4BAA4B;WAClC;WACA;WACA;IACP;;;;iBAIa,oBAAoB;WAC1B;IACP;;;;iBAIa,+BAA+B;WACrC;WACA;IACP;;;;iBAIa,6BAA6B;WACnC,oBAAoB;WACpB;IACP;;;;iBAIa,iCAAiC;WACvC;IACP;;;;;;;;iBAQa,kCAAkC;WACxC;IACP;;;;;;;;;;iBAUa,6BAA6B;WACnC;WACA;IACP;;;;iBAIa,yBAAyB,gBAAgB;;;;;iBAKzC,0BAA0B;;;;iBAI1B,sBAAsB,eAAe;WAC3C;IACP;;;;;;;iBAOa,6BAA6B;WACnC;IACP;;;;iBAIa,gBAAgB,iBAAiB;WACvC;WACA;IACP"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"control-Ftiau058-CCeJcAVQ.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/control-Ftiau058.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);\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(\"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\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\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\tdocsUrl: docsUrlFor(\"CONFIG.FILE_NOT_FOUND\"),\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\tdocsUrl: docsUrlFor(\"CONTRACT.VALIDATION_FAILED\"),\n\t\t...options?.where ? { where: options.where } : {}\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});\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});\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});\n}\n//#endregion\nexport { errorOutputFormatMutex as _, errorContractMissingExtensions as a, errorUnexpected as b, errorDriverRequired as c, errorFileNotFound as d, errorInvalidOutputFormat as f, errorMigrationPlanningFailed as g, errorMigrationCliUnknownFlag as h, errorContractConfigMissing as i, errorEnumCodecNotInPackStack as l, errorMigrationCliInvalidConfigArg as m, errorConfigFileNotFound as n, errorContractValidationFailed as o, errorJsonFormatNotSupported as p, errorConfigValidation as r, errorDatabaseConnectionRequired as s, CliStructuredError as t, errorFamilyReadMarkerSqlRequired as u, errorQueryRunnerFactoryRequired as v, errorTargetMigrationNotSupported as y };\n\n//# sourceMappingURL=control-Ftiau058.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,IAAI,qBAAqB,cAAc,MAAM;CAC5C;CACA;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,OAAO;EACb,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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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-4sAWQx8X.d.mts","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.d.mts"],"mappings":";;;;;;;iBAMiB,mBAAmB;WACzB;IACP;;;;iBAIa,kBAAkB;WACxB;WACA;WACA;IACP;;;;iBAIa,oBAAoB,kBAAkB,gBAAgB;WAC5D;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;IACP;;;;iBAIa,sBAAsB;WAC5B;WACA;WACA;IACP;iBACa,uBAAuB,cAAc;WAC3C;WACA;;iBAEM,4BAA4B,GAAG,iBAAiB,QAAQ,IAAI;WAClE;WACA;IACP,QAAQ;iBACK,qBAAqB,GAAG,cAAc,QAAQ,mBAAmB,GAAG;WAC1E;WACA;IACP;;;;;iBAKa,oBAAoB;WAC1B;WACA;IACP;;;;;iBAKa,8BAA8B;WACpC;WACA,oBAAoB;WACpB,kBAAkB;IACzB;;;;iBAIa,kBAAkB,iBAAiB;WACzC;WACA;WACA,OAAO;IACd;;cAEU;;;;iBAIG,wBAAwB,iBAAiB;WAC/C;WACA;WACA,OAAO;IACd;;;;iBAIa,aAAa,iBAAiB;WACpC;WACA;WACA,OAAO;IACd"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"execution-BbOD4GyR.mjs","names":[],"sources":["../../../../1-framework/1-core/errors/dist/execution.mjs"],"sourcesContent":["import { t as CliStructuredError } from \"./control-Ftiau058.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});\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\tmeta: { space: options.space }\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});\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\tmeta: { runnerErrorCode: \"MIGRATION.LEGACY_MARKER_SHAPE\" }\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});\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});\n\tthrow errorMarkerReadFailed({\n\t\twhy: message,\n\t\tspace: context.space,\n\t\tmarkerLocation: context.markerLocation\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});\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\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...options?.meta ? { meta: options.meta } : {}\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}\n/**\n* Generic runtime error.\n*/\nfunction errorRuntime(summary, options) {\n\treturn new CliStructuredError(\"CONTRACT.VERIFY_FAILED\", summary, {\n\t\t...options?.why ? { why: options.why } : { why: \"Verification failed\" },\n\t\t...options?.fix ? { fix: options.fix } : { fix: \"Check contract and database state\" },\n\t\t...options?.meta ? { meta: options.meta } : {}\n\t});\n}\n//#endregion\nexport { ERROR_CODE_DESTRUCTIVE_CHANGES, errorDestructiveChanges, errorHashMismatch, errorMarkerMissing, errorMarkerReadFailed, errorMarkerRequired, errorMarkerRowCorrupt, errorRunnerFailed, errorRuntime, errorSchemaVerificationFailed, errorTargetMismatch, parseMarkerR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