@prisma/orm-toolchain 8.0.0-rc.24-dev.28 → 8.0.0-rc.24-dev.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/{aggregate-CRIdmKmq.mjs → aggregate-7sB4u_aJ.mjs} +11 -5
- package/dist/aggregate-7sB4u_aJ.mjs.map +1 -0
- package/dist/{aggregate-C6PGBKyb.d.mts → aggregate-DgWdbWNs.d.mts} +12 -6
- package/dist/{aggregate-C6PGBKyb.d.mts.map → aggregate-DgWdbWNs.d.mts.map} +1 -1
- package/dist/{caught-errors-I1l50iPc-D_-F2M3t.mjs → caught-errors-D_pbHqmS-B-4jRN6g.mjs} +52 -11
- package/dist/caught-errors-D_pbHqmS-B-4jRN6g.mjs.map +1 -0
- package/dist/cli-telemetry.mjs +1 -1
- package/dist/cli.d.mts +2 -2
- package/dist/cli.mjs +1094 -1012
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +16 -14
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +2 -2
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/cli__init-contribution.d.mts +101 -0
- package/dist/cli__init-contribution.d.mts.map +1 -0
- package/dist/cli__init-contribution.mjs +1 -0
- package/dist/cli__init-output.d.mts +3 -3
- package/dist/cli__init-output.mjs +1 -1
- package/dist/cli__migration-cli.mjs +3 -3
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/config-loader.d.mts +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{db-sign-Bv-FZMAD-uQhMNCC7.d.mts → db-sign-DLIR5swa-DQ0aN1nU.d.mts} +25 -21
- package/dist/db-sign-DLIR5swa-DQ0aN1nU.d.mts.map +1 -0
- package/dist/{domain-type-generation-BlYB8GiS-k0HNTf4f.mjs → domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs} +11 -12
- package/dist/domain-type-generation-BGcbGgHJ-Cdw5RNaZ.mjs.map +1 -0
- package/dist/{domain-type-generation-D5cG6TGd-DKLpO6ZA.d.mts → domain-type-generation-BP8J5hy8-CxSjSRCh.d.mts} +6 -5
- package/dist/domain-type-generation-BP8J5hy8-CxSjSRCh.d.mts.map +1 -0
- package/dist/emitter.d.mts +3 -3
- package/dist/emitter.mjs +3 -3
- package/dist/emitter__domain-type-generation.d.mts +2 -2
- package/dist/emitter__domain-type-generation.mjs +2 -2
- package/dist/{exports-RTLU0w9r.mjs → exports-BiXPktAF.mjs} +4 -4
- package/dist/{exports-RTLU0w9r.mjs.map → exports-BiXPktAF.mjs.map} +1 -1
- package/dist/{exports-CVgs3YWV-BF4rqnxF.mjs → exports-CCuYD8dO-yw1GizAT.mjs} +28 -18
- package/dist/exports-CCuYD8dO-yw1GizAT.mjs.map +1 -0
- package/dist/{exports-CSVHjfwG.mjs → exports-CZ6dPu-O.mjs} +35 -10
- package/dist/exports-CZ6dPu-O.mjs.map +1 -0
- package/dist/{index-BHYAWGxJ.d.mts → index-C09OeJjf.d.mts} +7 -12
- package/dist/index-C09OeJjf.d.mts.map +1 -0
- package/dist/{index-BhNbc269.d.mts → index-C3KtOcBP.d.mts} +3 -1
- package/dist/index-C3KtOcBP.d.mts.map +1 -0
- package/dist/migration-tools.d.mts +1 -1
- package/dist/migration-tools.mjs +3 -3
- package/dist/migration-tools__aggregate.d.mts +1 -1
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__ref-resolution.mjs +1 -1
- package/dist/migration-tools__refs.mjs +1 -1
- package/dist/{output-BcC8eB0h-C5bRd-aC.mjs → output-E6F4-EMc-CqlzGlv-.mjs} +50 -9
- package/dist/output-E6F4-EMc-CqlzGlv-.mjs.map +1 -0
- package/dist/{ref-DfuqRCA7-CPPoVHY9.mjs → ref-PQOM_LTC-lyfzb0MO.mjs} +535 -270
- package/dist/ref-PQOM_LTC-lyfzb0MO.mjs.map +1 -0
- package/dist/{ref-resolution-C9j2SSb6.mjs → ref-resolution-C0xsiRig.mjs} +2 -2
- package/dist/{ref-resolution-C9j2SSb6.mjs.map → ref-resolution-C0xsiRig.mjs.map} +1 -1
- package/dist/{refs-t_JbIjGo-CRpBRRkq.mjs → refs-t_JbIjGo-BVCqKpXd.mjs} +2 -2
- package/dist/{refs-t_JbIjGo-CRpBRRkq.mjs.map → refs-t_JbIjGo-BVCqKpXd.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +4 -5
- package/dist/vite-plugin-contract-emit.mjs.map +1 -1
- package/package.json +19 -22
- package/dist/aggregate-CRIdmKmq.mjs.map +0 -1
- package/dist/caught-errors-I1l50iPc-D_-F2M3t.mjs.map +0 -1
- package/dist/db-sign-Bv-FZMAD-uQhMNCC7.d.mts.map +0 -1
- package/dist/domain-type-generation-BlYB8GiS-k0HNTf4f.mjs.map +0 -1
- package/dist/domain-type-generation-D5cG6TGd-DKLpO6ZA.d.mts.map +0 -1
- package/dist/exports-CSVHjfwG.mjs.map +0 -1
- package/dist/exports-CVgs3YWV-BF4rqnxF.mjs.map +0 -1
- package/dist/import-roots-DlSoi7oS.d.mts +0 -119
- package/dist/import-roots-DlSoi7oS.d.mts.map +0 -1
- package/dist/import-roots-Dqs1_cn4.mjs +0 -224
- package/dist/import-roots-Dqs1_cn4.mjs.map +0 -1
- package/dist/index-BHYAWGxJ.d.mts.map +0 -1
- package/dist/index-BhNbc269.d.mts.map +0 -1
- package/dist/output-BcC8eB0h-C5bRd-aC.mjs.map +0 -1
- package/dist/publish-surface.d.mts +0 -3
- package/dist/publish-surface.mjs +0 -3
- package/dist/publish-surface__import-roots.d.mts +0 -2
- package/dist/publish-surface__import-roots.mjs +0 -2
- package/dist/publish-surface__shells.d.mts +0 -2
- package/dist/publish-surface__shells.mjs +0 -2
- package/dist/quick-reference-mongo.md +0 -116
- package/dist/quick-reference-postgres.md +0 -95
- package/dist/quick-reference-prisma7.md +0 -80
- package/dist/readme-mongo.md +0 -35
- package/dist/readme-postgres.md +0 -34
- package/dist/ref-DfuqRCA7-CPPoVHY9.mjs.map +0 -1
- package/dist/shells-BA7YJyPT.mjs +0 -777
- package/dist/shells-BA7YJyPT.mjs.map +0 -1
- package/dist/shells-D7NNxMLT.d.mts +0 -129
- package/dist/shells-D7NNxMLT.d.mts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"caught-errors-I1l50iPc-D_-F2M3t.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/caught-errors-I1l50iPc.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { CliStructuredError as CliStructuredError$1, errorConfigValidation, errorContractConfigMissing, errorContractValidationFailed, errorDatabaseConnectionRequired, errorDriverRequired, errorFileNotFound, errorMigrationPlanningFailed, errorTargetMigrationNotSupported, errorUnexpected } from \"@internal/errors/control\";\nimport { APP_SPACE_ID, hasMigrations } from \"@internal/framework-components/control\";\nimport { InternalError, isInternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { join, relative, resolve } from \"pathe\";\nimport { errorHashMismatch, errorMarkerMissing, errorRuntime, errorTargetMismatch } from \"@internal/errors/execution\";\nimport \"@internal/errors/migration\";\nimport { readFile } from \"node:fs/promises\";\nimport { APP_SPACE_ID as APP_SPACE_ID$1, spaceMigrationDirectory } from \"@internal/migration-tools/spaces\";\n//#region src/control-api/statements/statement-flag.ts\nconst SHELL_SAFE = /^[A-Za-z0-9_.:/@%+,-]+$/;\n/** The value as a shell passes it through unchanged, single-quoted when needed. */\nfunction shellQuoted(value) {\n\treturn SHELL_SAFE.test(value) ? value : `'${value.replaceAll(\"'\", `'\\\\''`)}'`;\n}\n/**\n* A statement written as a flag a shell passes through unchanged: the value is single-quoted when\n* it has a character a shell would read, and joined with `=` when it starts with `-`, which a\n* parser would otherwise read as a flag.\n*/\nfunction statementFlag(statement) {\n\tconst value = shellQuoted(statement.text);\n\treturn statement.text.startsWith(\"-\") ? `--${statement.verb}=${value}` : `--${statement.verb} ${value}`;\n}\n//#endregion\n//#region src/utils/next-actions.ts\n/**\n* The typed remediation the CLI attaches to its own errors and findings.\n* Constructors live here rather than in any library the CLI calls: naming a\n* runnable invocation is something only the CLI can do.\n*/\nfunction runCommandAction(label, command) {\n\treturn {\n\t\tkind: \"run-command\",\n\t\tlabel,\n\t\tcommand\n\t};\n}\n/** Advice the user carries out or decides on themselves, such as changing data in the database or choosing between plans; it has no command to run and edits no file. */\nfunction chooseAction(label) {\n\treturn {\n\t\tkind: \"user-choice\",\n\t\tlabel\n\t};\n}\n/** Advice that changes a file before anything runs again. */\nfunction editFileAction(label) {\n\treturn {\n\t\tkind: \"edit-file\",\n\t\tlabel\n\t};\n}\n//#endregion\n//#region src/utils/printed-command.ts\n/** The invocation of a command run with `ctx`, given `--db` when `db` is defined. */\nfunction cliInvocation(ctx, db) {\n\treturn {\n\t\tcwd: ctx.cwd,\n\t\tconfigPath: ctx.configPath,\n\t\tdbGiven: db !== void 0\n\t};\n}\n/** The flags of `db migrate` or `db update` that a re-run repeats, as the user gave them. */\nfunction rerunFlags(flags) {\n\treturn [\n\t\t...flags.to === void 0 ? [] : [\"--to\", shellQuoted(flags.to)],\n\t\t...flags.advanceRef === void 0 ? [] : [\"--advance-ref\", shellQuoted(flags.advanceRef)],\n\t\t...flags.permitPolicyChange === true ? [\"--permit-policy-change\"] : []\n\t];\n}\n/** The `db migrate` the user ran, with the flags they gave. */\nfunction dbMigrateRerun(invocation) {\n\treturn cliCommand(invocation, \"db migrate\", invocation.rerunArgs ?? []);\n}\n/** The `db update` the user ran, with the flags they gave and `statements`, by default the run's own. */\nfunction dbUpdateRerun(invocation, statements = invocation.statementArgs ?? []) {\n\treturn cliCommand(invocation, \"db update\", [...invocation.rerunArgs ?? [], ...statements]);\n}\n/** The commands that connect to a database: those whose flags include `dbFlag`, which a test checks. */\nconst COMMANDS_TAKING_DB = /* @__PURE__ */ new Set([\n\t\"contract infer\",\n\t\"db init\",\n\t\"db migrate\",\n\t\"db schema\",\n\t\"db sign\",\n\t\"db update\",\n\t\"db verify\",\n\t\"migration log\",\n\t\"migration status\"\n]);\nfunction configWords(configPath) {\n\treturn configPath === void 0 ? [] : [\"--config\", shellQuoted(configPath)];\n}\n/**\n* A CLI command as advice prints it: `{bin}`, the command and its arguments, the `--config` the CLI\n* was given, and, for a command that connects to a database, `--db <url>` when the CLI was given\n* `--db`, so it runs as printed from the directory the CLI ran in, against the same database. The\n* URL stays a placeholder because it can hold credentials.\n*/\nfunction cliCommand(invocation, command, args = []) {\n\treturn [\n\t\t\"{bin}\",\n\t\tcommand,\n\t\t...args,\n\t\t...configWords(invocation?.configPath),\n\t\t...invocation?.dbGiven === true && COMMANDS_TAKING_DB.has(command) ? [\"--db\", \"<url>\"] : []\n\t].join(\" \");\n}\n/**\n* The `migration plan` command advice prints: it starts from `from`, the contract the database is\n* at, whenever that is known, because `migration plan` cannot find its origin without it once\n* migrations exist and no `db` ref names one.\n*/\nfunction printedPlanCommand(invocation, from, flags) {\n\treturn cliCommand(invocation, \"migration plan\", [...from === void 0 ? [] : [\"--from\", from], ...flags]);\n}\n/**\n* The command that runs a `migration.ts`, named relative to the directory the CLI ran in, with the\n* `--config` the CLI was given, so it loads the same config.\n*/\nfunction selfEmitCommand(invocation, migrationTs) {\n\treturn [\n\t\t\"node\",\n\t\tshellQuoted(printedPath(invocation, migrationTs)),\n\t\t...configWords(invocation.configPath)\n\t].join(\" \");\n}\n/** The command that runs the `migration.ts` a `migration plan` writes, with its directory a placeholder. */\nfunction writtenMigrationRunCommand(invocation) {\n\treturn [\n\t\t\"node\",\n\t\t\"<migration directory>/migration.ts\",\n\t\t...configWords(invocation.configPath)\n\t].join(\" \");\n}\n/** A path as advice prints it: relative to the directory the CLI ran in. */\nfunction printedPath(invocation, path) {\n\treturn relative(invocation.cwd, path);\n}\n//#endregion\n//#region src/utils/cli-errors.ts\n/**\n* A CLI-raised error that carries the typed remediation as well as the prose.\n* Only the CLI knows which invocation fixes a failure, so only errors raised\n* here spell one; the foundation classes every library also raises keep\n* carrying `code`, `why` and `fix` alone.\n*\n* Both fields are required: the `fix` prose is what the commander shell still\n* renders, and the handler boundary drops it in favour of `nextActions` when it\n* settles the engine's envelope.\n*/\nvar ActionableCliError = class extends CliStructuredError$1 {\n\tnextActions;\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t\tthis.nextActions = options.nextActions;\n\t}\n};\n/**\n* A command that accepts a contract reference both as a positional and as a\n* flag was given both. Structured rather than a bare stderr line, so a script\n* sees the same envelope every other invocation failure produces.\n*/\nfunction errorContractArgConflict(options) {\n\tconst fix = \"Pass the contract reference once — either as the positional argument or as --contract.\";\n\treturn new ActionableCliError(\"CLI.CONTRACT_ARG_CONFLICT\", \"Cannot specify both a positional contract argument and --contract\", {\n\t\twhy: `The positional argument names \"${options.positional}\" and --contract names \"${options.flag}\"; there is no rule for which wins.`,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tpositional: options.positional,\n\t\t\tflag: options.flag\n\t\t}\n\t});\n}\n/**\n* A command was told both which ref to advance and not to advance any ref.\n* Same envelope as the positional/flag contract conflict, so a script sees\n* every invocation conflict in one shape.\n*/\nfunction errorAdvanceRefArgConflict(options) {\n\tconst fix = \"Pass either --advance-ref <name> or --no-advance-ref, not both.\";\n\treturn new ActionableCliError(\"CLI.ADVANCE_REF_ARG_CONFLICT\", \"Cannot specify both --advance-ref and --no-advance-ref\", {\n\t\twhy: `--advance-ref names \"${options.advanceRef}\" while --no-advance-ref asks for no ref to be written; there is no rule for which wins.`,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: { advanceRef: options.advanceRef }\n\t});\n}\nfunction quotedSpaces(spaces) {\n\treturn spaces.map((space) => `\"${space}\"`).join(\", \");\n}\nfunction notSignedSentence(spaces, because, becausePlural) {\n\tif (spaces.length === 0) return \"\";\n\treturn spaces.length === 1 ? ` Space ${quotedSpaces(spaces)} was not signed, because ${because}.` : ` Spaces ${quotedSpaces(spaces)} were not signed, because ${becausePlural}.`;\n}\n/**\n* `db sign` wrote the markers, then failed to write one or more refs or their snapshots. The database is signed; running the command again writes the refs. The error also names the spaces it did not sign: those whose schema failed verification, those whose marker changed while it ran, and those whose marker lacks invariants their head ref requires, and it carries each of those spaces' findings.\n*/\nfunction errorSignRefsNotWritten(options) {\n\tconst { signedSpaces, failedSpaces, conflictSpaces, refusedSpaces, unwrittenRefs, rerunCommand } = options;\n\tconst markers = signedSpaces.length === 1 ? `the marker of space ${quotedSpaces(signedSpaces)} holds its contract` : `the markers of spaces ${quotedSpaces(signedSpaces)} hold their contracts`;\n\tconst notSigned = notSignedSentence(failedSpaces, \"its schema does not satisfy its contract\", \"their schemas do not satisfy their contracts\") + notSignedSentence(conflictSpaces, \"its marker changed while db sign ran\", \"their markers changed while db sign ran\") + notSignedSentence(refusedSpaces.map(({ space }) => space), \"its marker does not record invariants its head ref requires\", \"their markers do not record invariants their head refs require\");\n\tconst refs = unwrittenRefs.map((ref) => `ref \"${ref.name}\" of space \"${ref.space}\" (${ref.reason})`).join(\"; \");\n\tconst count = unwrittenRefs.length;\n\treturn new ActionableCliError(\"MIGRATION.SIGN_REFS_NOT_WRITTEN\", `Database signed, but ${count} ${count === 1 ? \"ref was\" : \"refs were\"} not written`, {\n\t\twhy: `The database was signed: ${markers}.${notSigned} These refs were not written: ${refs}.`,\n\t\tfix: `Fix what stopped the write, then run \\`${rerunCommand}\\` again: the markers already hold the contracts, so it writes only the refs.`,\n\t\tnextActions: [runCommandAction(\"Sign again to write the refs that were not written\", rerunCommand), ...refusedSpaces.length === 0 ? [] : [runCommandAction(\"Run the migrations that provide the missing invariants, then sign again\", options.migrateCommand)]],\n\t\tmeta: {\n\t\t\tsignedSpaces,\n\t\t\tfailedSpaces,\n\t\t\tconflictSpaces,\n\t\t\trefusedSpaces,\n\t\t\tunwrittenRefs,\n\t\t\tadvancedRefs: options.advancedRefs\n\t\t},\n\t\tdiagnostics: options.diagnostics,\n\t\tcause: options.cause\n\t});\n}\nfunction errorRefSetHashNotInGraph(resolvedHash, reachableHashes) {\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none — migration graph is empty)\";\n\tconst fix = reachableHashes.length > 0 ? \"Set the ref to the `to` hash of an on-disk migration; `{bin} migration list` shows them.\" : \"Run `{bin} migration plan` first.\";\n\tconst nextActions = reachableHashes.length > 0 ? [runCommandAction(\"List the migrations and their destination hashes\", \"{bin} migration list\"), chooseAction(\"Set the ref to the `to` hash of one of them\")] : [runCommandAction(\"Plan the first migration\", \"{bin} migration plan\")];\n\treturn new ActionableCliError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Resolved contract hash is not in the migration graph: ${resolvedHash}`, {\n\t\twhy: reachableHashes.length > 0 ? `The migration graph reaches ${reachableList}; resolved ${resolvedHash} isn't a graph node.` : \"The migration graph is empty — no hashes reachable.\",\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tresolvedHash,\n\t\t\treachableHashes: [...reachableHashes]\n\t\t}\n\t});\n}\nfunction errorRefSetEmptySentinel(hash) {\n\treturn new ActionableCliError(\"MIGRATION.REF_SET_EMPTY_SENTINEL\", `Cannot set ref to the empty-database sentinel: ${hash}`, {\n\t\twhy: \"The empty-database sentinel is a planner internal; it is not a valid ref target.\",\n\t\tfix: \"Set the ref to a contract hash from the migration graph, or use another ref name.\",\n\t\tnextActions: [chooseAction(\"Set the ref to a contract hash from the migration graph\"), chooseAction(\"Or use another ref name\")],\n\t\tmeta: { hash }\n\t});\n}\n/**\n* `--legend` was combined with a machine-readable or silent output flag.\n* The legend is human-only decoration on stderr.\n*/\nfunction errorLegendHumanOnly(conflictingFlag) {\n\treturn new ActionableCliError(\"MIGRATION.LEGEND_HUMAN_ONLY\", \"`--legend` is only available for human-readable output\", {\n\t\twhy: `\\`--legend\\` prints a glyph key to stderr and cannot be combined with ${conflictingFlag}.`,\n\t\tfix: `Omit ${conflictingFlag} to print the legend alongside the tree, or omit --legend when using ${conflictingFlag}.`,\n\t\tnextActions: [chooseAction(`Omit ${conflictingFlag} to print the legend alongside the tree`), chooseAction(`Or omit --legend when using ${conflictingFlag}`)],\n\t\tmeta: { conflictingFlag }\n\t});\n}\n/**\n* `--space <id>` was given a value that doesn't satisfy the contract-space\n* naming rule (`[a-z][a-z0-9_-]{0,63}` per `isValidSpaceId`). Fires before\n* any fs work — the input is syntactically rejected the same way an on-disk\n* directory with that name would be skipped by the enumerator.\n*/\nfunction errorInvalidSpaceId(spaceId) {\n\treturn new ActionableCliError(\"MIGRATION.INVALID_SPACE_ID\", `Invalid contract space id: ${spaceId}`, {\n\t\twhy: \"Contract space ids must match [a-z][a-z0-9_-]{0,63} (lowercase, starts with a letter, max 64 characters — the rule applied to every on-disk space directory).\",\n\t\tfix: \"Pass a space id that matches the directory naming rule, or omit --space to list every space.\",\n\t\tnextActions: [chooseAction(\"Pass a space id matching [a-z][a-z0-9_-]{0,63}\"), runCommandAction(\"Or list every space\", \"{bin} migration list\")],\n\t\tmeta: { spaceId }\n\t});\n}\n/**\n* `migration list --space <id>` was given a contract-space id that has no\n* directory under `migrations/`. Distinct from \"the space exists but is\n* empty\" — that path renders the empty-state line and exits 0 per the\n* slice spec § Empty-state. This error fires only when `<projectMigrationsDir>/<spaceId>`\n* does not exist on disk.\n*\n* `availableSpaces` lists the contract-space directory names actually\n* present, sorted lex-asc, so the diagnostic can suggest a near match\n* without making the user reach for `ls`.\n*/\nfunction errorSpaceNotFound(spaceId, availableSpaces) {\n\tconst availableList = availableSpaces.length > 0 ? availableSpaces.join(\", \") : \"(none — no contract spaces on disk yet)\";\n\tconst fix = availableSpaces.length > 0 ? `Pick one of: ${availableList}. Run \\`{bin} migration list\\` (no --space) to see every space's migrations.` : \"Author a migration with `{bin} migration new` to create the first contract-space directory.\";\n\tconst nextActions = availableSpaces.length > 0 ? [chooseAction(`Pick one of: ${availableList}`), runCommandAction(\"See every space's migrations\", \"{bin} migration list\")] : [runCommandAction(\"Author the first migration, which creates the contract-space directory\", \"{bin} migration new\")];\n\treturn new ActionableCliError(\"MIGRATION.SPACE_NOT_FOUND\", `Unknown contract space: ${spaceId}`, {\n\t\twhy: `No directory named \"${spaceId}\" exists under the migrations root.`,\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tavailableSpaces: [...availableSpaces]\n\t\t}\n\t});\n}\n/**\n* A `migration show` target resolved to a directory or a graph node, but no\n* on-disk package was loaded for it.\n*/\nfunction errorMigrationPackageNotFound(why) {\n\treturn new ActionableCliError(\"MIGRATION.PACKAGE_NOT_FOUND\", \"Migration package not found\", {\n\t\twhy,\n\t\tfix: \"Pass a directory name, hash prefix, or path to an on-disk app-space migration package.\",\n\t\tnextActions: [chooseAction(\"Pass a directory name, hash prefix, or path to an on-disk app-space migration package\"), runCommandAction(\"List what is on disk\", \"{bin} migration list\")]\n\t});\n}\n/** The app space has no migration packages at all, so no target can resolve. */\nfunction errorNoMigrations(appMigrationsRelative) {\n\treturn new ActionableCliError(\"MIGRATION.NO_MIGRATIONS\", \"No migrations found\", {\n\t\twhy: `No migration packages found in ${appMigrationsRelative}`,\n\t\tfix: \"Run `{bin} migration plan` to create a migration first.\",\n\t\tnextActions: [runCommandAction(\"Create the first migration\", \"{bin} migration plan\")]\n\t});\n}\nfunction errorRefSetBundleNotFound(hash) {\n\treturn new ActionableCliError(\"MIGRATION.REF_SET_BUNDLE_NOT_FOUND\", `No migration bundle matches graph-node hash ${hash}`, {\n\t\twhy: `The hash is a graph node but no on-disk bundle has metadata.to = ${hash}.`,\n\t\tfix: \"Run `pnpm fixtures:check`, or re-emit the migration that produces this hash so its bundle is restored.\",\n\t\tnextActions: [runCommandAction(\"Restore the checked-in fixtures\", \"pnpm fixtures:check\"), chooseAction(\"Or re-emit the migration that produces this hash\")],\n\t\tmeta: { hash }\n\t});\n}\nfunction errorPlanForgotTheFlag(resolvedHash, reachableRefs, options) {\n\tconst reachableList = reachableRefs.length > 0 ? reachableRefs.map((r) => `${r.name} (${r.hash})`).join(\", \") : \"(none)\";\n\tconst refFix = reachableRefs.length > 0 ? `Run migration plan with ${reachableRefs.map((r) => `--from ${r.name}`).join(\" or \")}.` : \"Pass --from <contract> naming the `to` hash of an on-disk migration (`{bin} migration list` shows them), or point the db ref at one with `{bin} migration ref set db <contract>`.\";\n\tconst nextActions = reachableRefs.length > 0 ? reachableRefs.map((ref) => runCommandAction(`Plan from ${ref.name}`, `{bin} migration plan --from ${ref.name}`)) : [runCommandAction(\"Plan from an explicit origin\", \"{bin} migration plan --from <contract>\"), runCommandAction(\"Point the db ref at a graph node\", \"{bin} migration ref set db <contract>\")];\n\treturn new ActionableCliError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Resolved from-hash is not in the migration graph: ${resolvedHash}`, {\n\t\twhy: `The migration graph reaches ${reachableList}; resolved ${resolvedHash} isn't a graph node.`,\n\t\tfix: refFix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tresolvedHash,\n\t\t\treachableRefs: reachableRefs.map((r) => r.name)\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* `viaRef: true` (the default) mirrors migration-tools' `errorRefNotResolvable`:\n* a ref name with no pointer file, where the fallback hash isn't a graph\n* node either — there's nothing to materialize a contract from.\n* `viaRef: false` is a distinct, ref-independent case: an explicit `--from\n* <hash>` that doesn't name a ref, on an empty migration graph, so there is\n* no graph node and no ref to resolve a contract through.\n*/\nfunction errorSnapshotMissing(identifier, options) {\n\tconst viaRef = options?.viaRef !== false;\n\tconst fix = viaRef ? `Create the ref with \"{bin} migration ref set ${identifier} <hash>\" (or advance it via \"{bin} db update --advance-ref ${identifier}\"), or pass a hash that is a node in the migration graph.` : `No contract source exists for hash \"${identifier}\" on an empty migration graph. Use --from with a ref name (its contract resolves through the snapshot store), or run db update first.`;\n\tconst nextActions = viaRef ? [\n\t\trunCommandAction(`Create the ref \"${identifier}\"`, `{bin} migration ref set ${identifier} <hash>`),\n\t\trunCommandAction(\"Or advance it from the database\", `{bin} db update --advance-ref ${identifier}`),\n\t\tchooseAction(\"Or pass a hash that is a node in the migration graph\")\n\t] : [chooseAction(\"Pass --from a ref name, whose contract resolves through the snapshot store\"), runCommandAction(\"Or populate the graph first\", \"{bin} db update\")];\n\treturn new ActionableCliError(\"MIGRATION.SNAPSHOT_MISSING\", viaRef ? `Ref \"${identifier}\" is not resolvable` : `No contract source for from-hash \"${identifier}\"`, {\n\t\twhy: viaRef ? `Ref \"${identifier}\" has no pointer file, and the hash being resolved is not a node in the migration graph either.` : `Hash \"${identifier}\" is not a node in the migration graph (the graph is empty), and it does not name a ref either.`,\n\t\tfix,\n\t\tnextActions,\n\t\tmeta: {\n\t\t\tidentifier,\n\t\t\tviaRef\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\n/**\n* Default origin resolution for `migration plan` found nothing (no `--from`,\n* no `db` ref) while migrations already exist on disk. Planning would silently\n* produce an empty-origin migration that ignores the existing history — almost\n* always a mistake — so the command refuses and names the three exits.\n*/\nfunction errorPlanOriginUnknown(reachableRefs) {\n\tconst fromSuggestion = reachableRefs.length > 0 ? reachableRefs.map((r) => `--from ${r.name}`).join(\" or \") : \"--from <contract>\";\n\tconst refSetCommand = \"{bin} migration ref set db <contract>\";\n\treturn new ActionableCliError(\"MIGRATION.PLAN_ORIGIN_UNKNOWN\", \"Cannot determine the plan origin: migrations exist but no origin is named\", {\n\t\twhy: \"Migrations exist on disk, but there is no `db` ref and no --from was given, so the plan origin would silently fall back to an empty database and the resulting migration would recreate everything the existing migrations already create.\",\n\t\tfix: [\n\t\t\t`Set the \\`db\\` ref to the contract your database is at (\\`${refSetCommand}\\`), or, on a database whose migration history does not need to be kept, advance it via \\`{bin} db update\\`.`,\n\t\t\t`Or pass the origin explicitly: \\`{bin} migration plan ${fromSuggestion}\\`.`,\n\t\t\t\"Or pass --from @empty to deliberately plan from an empty database.\"\n\t\t].join(\"\\n\"),\n\t\tnextActions: [\n\t\t\trunCommandAction(\"Point the db ref at the origin contract\", refSetCommand),\n\t\t\t...reachableRefs.length > 0 ? reachableRefs.map((ref) => runCommandAction(`Plan from ${ref.name}`, `{bin} migration plan --from ${ref.name}`)) : [runCommandAction(\"Plan from an explicit origin\", `{bin} migration plan ${fromSuggestion}`)],\n\t\t\trunCommandAction(\"Plan from an empty database deliberately\", \"{bin} migration plan --from @empty\")\n\t\t],\n\t\tmeta: { reachableRefs: reachableRefs.map((r) => r.name) }\n\t});\n}\nfunction errorStatementInvalid(statement, why, fix) {\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_INVALID\", `Invalid statement \"--${statement.verb} ${statement.text}\"`, {\n\t\twhy,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tstatement: statement.text,\n\t\t\tverb: statement.verb\n\t\t}\n\t});\n}\n/**\n* A statement is well formed, but its names do not resolve in the\n* origin and destination contracts the way a rename requires.\n*/\nfunction errorStatementUnresolved(statement, why, fix) {\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_UNRESOLVED\", `Cannot resolve statement \"--${statement.verb} ${statement.text}\"`, {\n\t\twhy,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tstatement: statement.text,\n\t\t\tverb: statement.verb\n\t\t}\n\t});\n}\n/**\n* A rename or convert typed in answer to a data-loss question was planned, and the plan still loses\n* the subject's data: the statement does not account for the operation the question was about.\n*/\nfunction errorStatementDidNotResolveLoss(statement, subject) {\n\tconst fix = `Answer the question about \"${subject}\" with ${statementFlag({\n\t\tverb: \"delete\",\n\t\ttext: subject\n\t})} if its data may be lost, or give a ${statement.verb} statement that keeps that data.`;\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_DID_NOT_RESOLVE_LOSS\", `\"--${statement.verb} ${statement.text}\" does not keep the data of \"${subject}\"`, {\n\t\twhy: `The plan was made again with the statement, and it still loses the data of \"${subject}\".`,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tstatement: statement.text,\n\t\t\tverb: statement.verb,\n\t\t\tsubject\n\t\t}\n\t});\n}\n/** `--convert` and `--delete` name the same field, and each answers its type change differently. */\nfunction errorConvertAndDelete(field) {\n\tconst fix = `Give one of them: ${statementFlag({\n\t\tverb: \"convert\",\n\t\ttext: field\n\t})}, or ${statementFlag({\n\t\tverb: \"delete\",\n\t\ttext: field\n\t})}.`;\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_INVALID\", `\"--convert ${field}\" and \"--delete ${field}\" conflict`, {\n\t\twhy: `Both answer the type change of \"${field}\": --convert converts each value with code you write in migration.ts, and --delete lets the database cast each value, losing those it cannot keep.`,\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tstatement: field,\n\t\t\tverb: \"convert\"\n\t\t}\n\t});\n}\nconst MIGRATION_PLAN_VERBS = [\n\t\"rename\",\n\t\"delete\",\n\t\"convert\",\n\t\"backfill\"\n];\n/**\n* `refused`, `--convert` or `--backfill` statements that ask for code the user writes, were given\n* to `db update`, which applies its plan directly and so has no migration file whose slot the user\n* could fill. `statements` are every statement the user gave, in the order given: the `migration\n* plan` command the error suggests carries each one that command accepts, and starts from\n* `databaseStorageHash`, the contract the database is at, when it is known. Its commands repeat the\n* `--config` of `invocation`.\n*/\nfunction needsMigrationFileReason(refused) {\n\tconst converts = refused.some(({ verb }) => verb === \"convert\");\n\tconst backfills = refused.some(({ verb }) => verb === \"backfill\");\n\tif (converts && backfills) return \"--convert of a field and --backfill ask for a migration file with a slot for the code that converts the values or the value that fills the field\";\n\treturn converts ? \"--convert of a field asks for a migration file with a slot for the code that converts its values\" : \"--backfill asks for a migration file with a slot for the value that fills the field\";\n}\nfunction errorStatementNeedsMigrationFile(statements, refused, invocation, databaseStorageHash) {\n\tconst written = refused.map(({ verb, text }) => `\"--${verb} ${text}\"`);\n\tconst listed = written.length === 1 ? written[0] : `${written.slice(0, -1).join(\", \")} and ${written.at(-1)}`;\n\tconst plan = printedPlanCommand(invocation, databaseStorageHash, statements.filter(({ verb }) => MIGRATION_PLAN_VERBS.includes(verb)).map(statementFlag));\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_NEEDS_MIGRATION_FILE\", `db update cannot carry out ${listed}`, {\n\t\twhy: `${needsMigrationFileReason(refused)}, and db update has no migration file to fill: it applies its plan directly.`,\n\t\tfix: `Plan the change with ${plan}, fill in the migration.ts it writes, run that migration.ts with the \\`node\\` command \\`migration plan\\` prints, and apply it with ${cliCommand(invocation, \"db migrate\")}. Or leave out these statements: db update then asks before it loses any data.`,\n\t\tnextActions: [runCommandAction(\"Plan the change into a migration file to fill in\", plan), chooseAction(\"Or run db update without these statements\")],\n\t\tmeta: { statements: refused.map(({ verb, text }) => ({\n\t\t\tverb,\n\t\t\ttext\n\t\t})) }\n\t});\n}\nfunction unusedConsentSentence({ verb, text, alreadyAnsweredBy: answeredBy }) {\n\tif (answeredBy === void 0) return `--${verb} ${text} was given but nothing in this run asked about ${text}.`;\n\tif (answeredBy.kind === \"namespace\") return `--${verb} ${text} was given, but every question about namespace \"${answeredBy.namespace}\" was already answered by another flag.`;\n\treturn `--${verb} ${text} was given, but the question about ${answeredBy.subject} was already answered by --${answeredBy.flag.verb} ${answeredBy.flag.text}.`;\n}\nfunction errorConsentUnused(unused, asked) {\n\tconst actions = [...unused.some(({ alreadyAnsweredBy }) => alreadyAnsweredBy === void 0) ? [\"Remove the flag, or spell the subject the way the command names it.\"] : [], ...unused.some(({ alreadyAnsweredBy }) => alreadyAnsweredBy !== void 0) ? [\"Give one flag per question.\"] : []];\n\treturn new CliStructuredError$1(\"CLI.CONSENT_UNUSED\", unused.map(unusedConsentSentence).join(\" \"), {\n\t\t...ifDefined(\"why\", asked.length === 0 ? void 0 : `The run asked about ${asked.join(\", \")}.`),\n\t\tnextActions: actions.map((label) => ({\n\t\t\tkind: \"user-choice\",\n\t\t\tlabel\n\t\t})),\n\t\tmeta: {\n\t\t\tunused: unused.map(({ verb, text }) => ({\n\t\t\t\tverb,\n\t\t\t\tvalues: [text]\n\t\t\t})),\n\t\t\t...asked.length === 0 ? {} : { asked }\n\t\t}\n\t});\n}\n/**\n* `delete` or `allow` statements given to a programmatic call match no question the plan asks,\n* so they consent to nothing.\n*/\nfunction errorStatementAnswersNoQuestion(statements, subjects) {\n\tconst written = statements.map(({ verb, text }) => `\"--${verb} ${text}\"`);\n\tconst listed = written.length === 1 ? `Statement ${written[0]} answers` : `Statements ${written.slice(0, -1).join(\", \")} and ${written.at(-1)} answer`;\n\tconst fix = subjects.length === 0 ? \"Leave the statements out: the plan asks no question.\" : `Leave them out, or name a subject the plan asks about: ${subjects.join(\", \")}.`;\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_ANSWERS_NO_QUESTION\", `${listed} no question of the plan`, {\n\t\twhy: \"A delete or allow statement consents to an operation the plan asks about, and these name no subject the plan would lose data from or change access to.\",\n\t\tfix,\n\t\tnextActions: [chooseAction(fix)],\n\t\tmeta: {\n\t\t\tstatements: statements.map(({ verb, text }) => ({\n\t\t\t\tverb,\n\t\t\t\ttext\n\t\t\t})),\n\t\t\tsubjects\n\t\t}\n\t});\n}\n/**\n* Without statements, `db update` drops a renamed table or column and creates it again under the\n* new name, so any advice to run without them says so.\n*/\nconst WITHOUT_STATEMENTS_DROPS = \"A plan made without statements drops the storage of each renamed model or field with its data and creates it again under the new name, and asks for consent before it does.\";\n/** How to store the snapshot of the contract the database is at, so statements can resolve. */\nconst STORE_ORIGIN_SNAPSHOT_STEPS = [\n\t\"1. Put the contract source back to the version the database is at, and run `{bin} contract emit`.\",\n\t\"2. Run `{bin} db update --advance-ref <name> --dry-run`, with the same `--db` as this command if it has one, and check that it plans no operations. Then run it again without `--dry-run`: the database matches that contract, so this changes nothing in it, and it stores the contract snapshot. If the dry run plans operations, the database has drifted from that contract; settle that before you go on.\",\n\t\"3. Put the new contract source back, run `{bin} contract emit`, and run this command again with `--advance-ref <name>`.\"\n];\n/**\n* Statements were given, but there is no origin contract to resolve their old\n* names against.\n*/\nfunction errorStatementOriginUnknown(origin) {\n\tif (origin.hash === null) return new ActionableCliError(\"MIGRATION.STATEMENT_ORIGIN_UNKNOWN\", \"Cannot resolve statements: the database has no marker\", {\n\t\twhy: \"The database has no marker: Prisma has never initialised or updated it, so there is no earlier contract whose names a statement could rename.\",\n\t\tfix: `Leave out the statements. If the database already holds data under the old names, preview the plan with --dry-run first. ${WITHOUT_STATEMENTS_DROPS}`,\n\t\tnextActions: [chooseAction(`Leave out the statements, and preview the plan with --dry-run first. ${WITHOUT_STATEMENTS_DROPS}`)],\n\t\tmeta: {\n\t\t\thash: null,\n\t\t\tsnapshotDirectory: origin.snapshotDirectory\n\t\t}\n\t});\n\tconst meta = {\n\t\thash: origin.hash,\n\t\tsnapshotDirectory: origin.snapshotDirectory,\n\t\t...ifDefined(\"unreadable\", origin.unreadable)\n\t};\n\tif (origin.unreadable !== void 0) return new ActionableCliError(\"MIGRATION.STATEMENT_ORIGIN_UNKNOWN\", \"Cannot resolve statements: the origin contract snapshot cannot be read\", {\n\t\twhy: `The contract snapshot for hash \"${origin.hash}\" in ${origin.snapshotDirectory} could not be read: ${origin.unreadable}`,\n\t\tfix: [\"Restore migrations/snapshots/ from version control. If no good copy exists, store the snapshot again:\", ...STORE_ORIGIN_SNAPSHOT_STEPS].join(\"\\n\"),\n\t\tnextActions: [chooseAction(\"Restore migrations/snapshots/ from version control\"), chooseAction(\"Or store the snapshot again from the contract the database is at\")],\n\t\tmeta\n\t});\n\treturn new ActionableCliError(\"MIGRATION.STATEMENT_ORIGIN_UNKNOWN\", \"Cannot resolve statements: the origin contract is unknown\", {\n\t\twhy: `No contract snapshot for hash \"${origin.hash}\" was found in ${origin.snapshotDirectory}. Statements name things in the contract the database is at, so the command needs that contract. \\`db update\\` stores the snapshot of the contract it applies only when it advances a ref: the \\`db\\` ref by default, or with \\`--db <url>\\` only the ref named by \\`--advance-ref <name>\\`. Most likely the run that brought the database to this contract advanced no ref.`,\n\t\tfix: [\n\t\t\t\"Store the snapshot of the contract the database is at, then run the rename:\",\n\t\t\t...STORE_ORIGIN_SNAPSHOT_STEPS,\n\t\t\t\"Adding --advance-ref to this command alone does not help: it would store the new contract, not the one the database is at. `migration plan --from` does not apply to `db update`.\"\n\t\t].join(\"\\n\"),\n\t\tnextActions: [\n\t\t\tchooseAction(\"Put the contract source back to the version the database is at, and emit it\"),\n\t\t\trunCommandAction(\"Check that it plans no operations (with the same --db as this command, if any)\", \"{bin} db update --advance-ref <name> --dry-run\"),\n\t\t\trunCommandAction(\"Then store its snapshot, which changes nothing in the database\", \"{bin} db update --advance-ref <name>\"),\n\t\t\tchooseAction(\"Put the new contract source back, emit it, and run this command again with --advance-ref <name>\")\n\t\t],\n\t\tmeta\n\t});\n}\n/**\n* `migration plan` refuses a first migration whose planner produced no operations: the contract\n* describes nothing to create.\n*/\nfunction errorPlanProducedNoOperations(destination) {\n\treturn errorMigrationPlanningFailed({ conflicts: [{\n\t\tkind: \"nothingToCreate\",\n\t\tsummary: \"This contract describes nothing migration plan can create, so there is no first migration to plan.\",\n\t\twhy: destination.isEmitted ? \"If the database needs something the contract does not describe, run `prisma migration new`, add its operations to the new `migration.ts`, then run that `migration.ts` with `node` to write `ops.json`.\" : \"`prisma migration new` writes a migration only to the emitted contract. If the database needs something this contract does not describe, emit it, run `prisma migration new`, add its operations to the new `migration.ts`, then run that `migration.ts` with `node` to write `ops.json`.\"\n\t}] });\n}\nconst ROLLBACK_IS_DESTRUCTIVE = \"A rollback (reverse) plan is expected to contain destructive (DROP) operations — review them before applying\";\nconst RENAMES_AND_DATA_NEED_MORE = \"Plan a rename with --rename old:new; re-adding a required field without a safe default, or a type change that needs data, may need you to fill in the planned migration.ts\";\nfunction planThenApply(meta) {\n\tconst planCommand = meta.kind === \"neverPlanned\" ? \"{bin} migration plan --name <slug>\" : meta.fromHash === EMPTY_CONTRACT_HASH ? `{bin} migration plan --to ${meta.targetHash} --name <slug>` : `{bin} migration plan --from ${meta.fromHash} --to ${meta.targetHash} --name <slug>`;\n\tconst applyCommand = meta.kind === \"neverPlanned\" ? \"{bin} db migrate\" : `{bin} db migrate --to ${meta.targetHash}`;\n\treturn {\n\t\tfix: [\n\t\t\t\"Plan the missing edge, then apply it:\",\n\t\t\t` 1. ${planCommand}`,\n\t\t\t` 2. ${applyCommand}`,\n\t\t\t`${ROLLBACK_IS_DESTRUCTIVE}.`,\n\t\t\t`${RENAMES_AND_DATA_NEED_MORE}.`,\n\t\t\t\"Inspect the on-disk graph with `{bin} migration list`, or `{bin} migration show <bundle>` for any bundle in the path you expected.\"\n\t\t].join(\"\\n\"),\n\t\tnextActions: [\n\t\t\trunCommandAction(\"Plan the missing edge\", planCommand),\n\t\t\trunCommandAction(\"Apply it\", applyCommand),\n\t\t\tchooseAction(ROLLBACK_IS_DESTRUCTIVE),\n\t\t\tchooseAction(RENAMES_AND_DATA_NEED_MORE),\n\t\t\trunCommandAction(\"Inspect the on-disk graph\", \"{bin} migration list\"),\n\t\t\trunCommandAction(\"Inspect a bundle in the path you expected\", \"{bin} migration show <bundle>\")\n\t\t]\n\t};\n}\n/** `MIGRATION.UNFILLED_PLACEHOLDER` from `db migrate`: a migration to apply still has `placeholder(...)` calls, so its `ops.json` lacks their operations. */\nfunction errorMigrationHasUnfilledPlaceholders(directory, invocation) {\n\tconst migrationTs = join(directory, \"migration.ts\");\n\tconst edit = `Replace each placeholder(...) call in ${printedPath(invocation, migrationTs)} with the value or query it stands for.`;\n\tconst emit = selfEmitCommand(invocation, migrationTs);\n\tconst migrate = dbMigrateRerun(invocation);\n\treturn new ActionableCliError(\"MIGRATION.UNFILLED_PLACEHOLDER\", \"Migration has unfilled placeholders\", {\n\t\twhy: `The migration in ${printedPath(invocation, directory)} still has placeholder(...) calls in its migration.ts, so its ops.json does not hold their operations. Applying it would move the database to its contract without them.`,\n\t\tfix: `${edit} Then run ${emit} to write ops.json, and run ${migrate} again.`,\n\t\tnextActions: [\n\t\t\teditFileAction(edit),\n\t\t\trunCommandAction(\"Write ops.json\", emit),\n\t\t\trunCommandAction(\"Apply the migration\", migrate)\n\t\t],\n\t\tmeta: { directory }\n\t});\n}\n/** `MIGRATION.PATH_UNREACHABLE`, advising to plan the missing edge and apply it unless `advice` says otherwise. */\nfunction errorPathUnreachable(failure, advice = planThenApply(failure.meta)) {\n\treturn new ActionableCliError(\"MIGRATION.PATH_UNREACHABLE\", failure.summary, {\n\t\twhy: failure.why,\n\t\tfix: advice.fix,\n\t\tnextActions: advice.nextActions,\n\t\tmeta: failure.meta\n\t});\n}\n/**\n* Shared \"needs a live database\" precondition for read verbs that consult the\n* marker/ledger (`migration log`, `migration status`). A command needs both a\n* connection string and a control-plane driver; either missing yields the same\n* `CONFIG.DB_CONNECTION_REQUIRED` envelope with `meta.missingFlags` (canonical long-form flags\n* per CLI Style Guide §Errors) so callers can react programmatically. Returns\n* `null` when both are present.\n*/\nfunction requireLiveDatabase(args) {\n\tif (args.dbConnection && args.hasDriver) return null;\n\tconst missingFlags = args.dbConnection ? [] : [\"--db\"];\n\treturn errorDatabaseConnectionRequired({\n\t\twhy: args.why,\n\t\tmissingFlags,\n\t\t...ifDefined(\"commandName\", args.commandName),\n\t\t...ifDefined(\"retryCommand\", args.retryCommand)\n\t});\n}\n/**\n* Maps a `RefResolutionError` from the contract/migration reference\n* resolver into a CLI structured error envelope.\n*/\n/**\n* A migration ref (dirName or hash-prefix) resolves in more than one contract\n* space. The user must qualify with `--space <id>` to disambiguate.\n*/\nfunction errorAmbiguousMigrationRef(ref, spaceIds) {\n\tconst spaceList = spaceIds.join(\", \");\n\treturn new ActionableCliError(\"MIGRATION.AMBIGUOUS_MIGRATION_REF\", `Ambiguous migration reference: \"${ref}\" resolves in multiple spaces — qualify with --space <id>`, {\n\t\twhy: `\"${ref}\" matches migrations in spaces: ${spaceList}.`,\n\t\tfix: `Qualify with --space <id> to select one space. Available matching spaces: ${spaceList}.`,\n\t\tnextActions: [chooseAction(`Qualify with --space <id>, one of: ${spaceList}`)],\n\t\tmeta: {\n\t\t\tref,\n\t\t\tspaceIds: [...spaceIds]\n\t\t}\n\t});\n}\nfunction mapRefResolutionError(error) {\n\tswitch (error.kind) {\n\t\tcase \"not-found\": {\n\t\t\tconst fix = error.grammar === \"contract\" ? \"Provide a valid contract hash, ref name, or migration directory name.\" : \"Provide a valid migration directory name or migration hash.\";\n\t\t\treturn new ActionableCliError(\"MIGRATION.REF_NOT_FOUND\", `Not a known ${error.grammar} reference: \"${error.input}\"`, {\n\t\t\t\twhy: `No ${error.grammar} matching \"${error.input}\" exists in the migration graph or refs index.`,\n\t\t\t\tfix,\n\t\t\t\tnextActions: [chooseAction(fix)],\n\t\t\t\tmeta: {\n\t\t\t\t\tinput: error.input,\n\t\t\t\t\tgrammar: error.grammar\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tcase \"ambiguous\": return new ActionableCliError(\"MIGRATION.REF_AMBIGUOUS\", `Ambiguous ${error.grammar} reference: \"${error.input}\"`, {\n\t\t\twhy: `\"${error.input}\" matches multiple ${error.grammar}s: ${error.candidates.join(\", \")}`,\n\t\t\tfix: \"Provide a longer prefix or use the full hash to disambiguate.\",\n\t\t\tnextActions: [chooseAction(\"Provide a longer prefix or use the full hash to disambiguate\")],\n\t\t\tmeta: {\n\t\t\t\tinput: error.input,\n\t\t\t\tcandidates: error.candidates,\n\t\t\t\tgrammar: error.grammar\n\t\t\t}\n\t\t});\n\t\tcase \"wrong-grammar\": return new ActionableCliError(\"MIGRATION.REF_WRONG_GRAMMAR\", error.message, {\n\t\t\twhy: error.message,\n\t\t\tfix: error.fix,\n\t\t\tnextActions: [chooseAction(error.fix)],\n\t\t\tmeta: {\n\t\t\t\tinput: error.input,\n\t\t\t\texpectedGrammar: error.expectedGrammar\n\t\t\t}\n\t\t});\n\t\tcase \"invalid-format\": return new ActionableCliError(\"MIGRATION.REF_INVALID_FORMAT\", `Invalid reference format: \"${error.input}\"`, {\n\t\t\twhy: error.reason,\n\t\t\tfix: \"Provide a valid contract hash, ref name, or migration directory name.\",\n\t\t\tnextActions: [chooseAction(\"Provide a valid contract hash, ref name, or migration directory name\")],\n\t\t\tmeta: { input: error.input }\n\t\t});\n\t}\n}\n//#endregion\n//#region src/orm/migration/paths.ts\n/**\n* The directory of the config file that wrote the section, recorded when the\n* engine validated it. Every command runs behind that validation, so its\n* absence here is a bug.\n*/\nfunction baseDirFor(config) {\n\tif (config.baseDir === void 0) throw new InternalError(\"the orm config section reached a command without baseDir\");\n\treturn config.baseDir;\n}\n/**\n* Where a config keeps its migrations: `migrations.dir`, default `migrations`, resolved against the config's `baseDir`. `base` stands in for `baseDir` when a config built in memory carries none.\n*/\nfunction migrationsDirFor(config, base) {\n\treturn resolve(config.baseDir ?? base ?? baseDirFor(config), config.migrations?.dir ?? \"migrations\");\n}\n/** The app subspace under {@link migrationsDirFor}. */\nfunction appMigrationsDirFor(config) {\n\treturn spaceMigrationDirectory(migrationsDirFor(config), APP_SPACE_ID);\n}\n/**\n* Where refs live. The framework keeps them under the app subspace rather than\n* at the migrations root.\n*/\nfunction appRefsDirFor(config) {\n\treturn resolve(appMigrationsDirFor(config), \"refs\");\n}\n/** The emitted contract; the validated config carries `contract.output` absolute. */\nfunction contractPathFor(config) {\n\treturn config.contract?.output;\n}\n/**\n* The header's rendering of a path: relative to where the user invoked the\n* CLI, as the commander shell rendered it against the config file.\n*/\nfunction displayPath(path, cwd) {\n\treturn relative(cwd, path);\n}\n//#endregion\n//#region src/utils/url-credentials.ts\nconst MASK = \"****\";\nconst URL_SCHEME = /^[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\//;\nconst LEADING_URL_USERINFO = /^[a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/([^/?#\\s]+)@/;\nconst URL_USERINFO = /([a-zA-Z][a-zA-Z0-9+.-]*:\\/\\/)([^/?#\\s]+)@/g;\nconst PASSWORD_QUERY_PARAMETER = /([?&][^=&#\\s]*password[^=&#\\s]*=)([^&#\\s]*)/gi;\nfunction hasUrlScheme(text) {\n\treturn URL_SCHEME.test(text);\n}\n/**\n* Reads the userinfo of a URL without parsing its hosts, so it works for URLs `new URL` rejects,\n* such as a seed list of several `host:port` pairs. The userinfo ends at the last `@` before the\n* first `/`, `?` or `#`.\n*/\nfunction urlUserinfo(url) {\n\treturn splitUserinfo(url.match(LEADING_URL_USERINFO)?.[1] ?? \"\");\n}\n/**\n* Reads the values of the query parameters whose key contains `password`, the same ones\n* `redactUrlCredentials` masks, without parsing hosts.\n*/\nfunction passwordQueryValues(url) {\n\treturn [...url.matchAll(PASSWORD_QUERY_PARAMETER)].map((match) => match[2] ?? \"\");\n}\n/**\n* Masks the userinfo and any password query parameter of every URL in `text`, without parsing\n* hosts. The masked form matches what `new URL` gives when its username and password are set to\n* `****`.\n*/\nfunction redactUrlCredentials(text) {\n\treturn text.replace(URL_USERINFO, (_match, scheme, userinfo) => `${scheme}${maskUserinfo(splitUserinfo(userinfo))}@`).replace(PASSWORD_QUERY_PARAMETER, `$1${MASK}`);\n}\nfunction splitUserinfo(userinfo) {\n\tconst colon = userinfo.indexOf(\":\");\n\tif (colon === -1) return {\n\t\tusername: userinfo,\n\t\tpassword: \"\"\n\t};\n\treturn {\n\t\tusername: userinfo.slice(0, colon),\n\t\tpassword: userinfo.slice(colon + 1)\n\t};\n}\nfunction maskUserinfo({ username, password }) {\n\treturn `${username ? MASK : \"\"}${password ? `:${MASK}` : \"\"}`;\n}\n//#endregion\n//#region src/utils/command-helpers.ts\nconst PASSWORD_QUERY_KEY = /password/i;\n/**\n* Resolves the absolute path to contract.json from the config.\n*/\nfunction resolveContractPath(config) {\n\tif (config.contract?.output === void 0) throw errorRuntime(\"CONFIG.VALIDATION_FAILED\", \"config.contract.output is required to resolve the contract path\", {\n\t\twhy: \"CLI commands read the emitted contract from config.contract.output; the config has no value to read.\",\n\t\tfix: \"Ensure your prisma.config.ts goes through `defineConfig()`, which normalises a default output when the provider supplies an input path, or set `contract.output` explicitly.\"\n\t});\n\treturn resolve(config.contract.output);\n}\n/**\n* Resolves the migrations directory and config path from CLI options.\n* Shared by migrate, migration-plan, and migration-status.\n*\n* - `migrationsDir` is the project's top-level `migrations/` directory\n* (the root that the aggregate loader walks for every contract space).\n* - `appMigrationsDir` is the app subspace directory under it\n* (`<migrationsDir>/<APP_SPACE_ID>/`). Every per-app reader / writer\n* (`migration new`, `migration plan`, `migrate`,\n* `migration status`, `migration show`, `migration ref`) operates on\n* this directory. Extensions own their own `migrations/<spaceId>/`.\n* - `refsDir` is the app's refs directory (`<appMigrationsDir>/refs/`).\n* The framework does not maintain refs at the migrations root.\n*\n* `cwd` is the directory the command was invoked from; every relative path in\n* the result is computed against it.\n*/\nfunction resolveMigrationPaths(config, cwd) {\n\tconst configPath = \"prisma.config.ts\";\n\tconst migrationsDir = migrationsDirFor(config, cwd);\n\tconst migrationsRelative = relative(cwd, migrationsDir);\n\tconst appMigrationsDir = spaceMigrationDirectory(migrationsDir, APP_SPACE_ID$1);\n\treturn {\n\t\tconfigPath,\n\t\tmigrationsDir,\n\t\tmigrationsRelative,\n\t\tappMigrationsDir,\n\t\tappMigrationsRelative: relative(cwd, appMigrationsDir),\n\t\trefsDir: resolve(appMigrationsDir, \"refs\")\n\t};\n}\nfunction collectDeclaredInvariants(graph) {\n\tconst declared = /* @__PURE__ */ new Set();\n\tfor (const edges of graph.forwardChain.values()) for (const edge of edges) for (const inv of edge.invariants) declared.add(inv);\n\treturn declared;\n}\n/**\n* Maps a `MigrationEdge` to the structural-edge shape used in the\n* `MIGRATION.NO_INVARIANT_PATH` error envelope. Shared between\n* `migrate` and `migration status` so both commands surface\n* the same JSON wire shape when an invariant-aware route is unsatisfiable.\n*/\nfunction toStructuralEdge(edge) {\n\treturn {\n\t\tdirName: edge.dirName,\n\t\tmigrationHash: edge.migrationHash,\n\t\tfrom: edge.from,\n\t\tto: edge.to,\n\t\tinvariants: edge.invariants\n\t};\n}\nfunction targetSupportsMigrations(target) {\n\treturn hasMigrations(target);\n}\n/**\n* Hangs up without letting the hang-up decide the command's result. A rejection out of a\n* `finally` replaces the value the `try`/`catch` already returned, so an unguarded close turns a\n* mapped connection error into an unmapped one — and that is the case it hits most, because a\n* `connect()` that failed leaves nothing to close.\n*/\nasync function closeQuietly(client) {\n\ttry {\n\t\tawait client.close();\n\t} catch {}\n}\nfunction getTargetMigrations(target) {\n\treturn hasMigrations(target) ? target.migrations : void 0;\n}\n/**\n* Reads and parses contract.json, validating the framework-level envelope\n* fields (storageHash, schemaVersion, target, targetFamily).\n*\n* Family-specific validation (storage structure, codec mappings, etc.)\n* happens downstream in the control client via the family instance.\n*/\nasync function readContractEnvelope(config) {\n\tconst contractPath = resolveContractPath(config);\n\tconst content = await readFile(contractPath, \"utf-8\");\n\tconst json = JSON.parse(content);\n\tconst { schemaVersion, target, targetFamily, profileHash } = json;\n\tconst storageHash = json[\"storage\"]?.[\"storageHash\"];\n\tif (typeof storageHash !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing a valid storage.storageHash. Run \\`{bin} contract emit\\` to regenerate.`, { where: { path: contractPath } });\n\tif (typeof schemaVersion !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing schemaVersion.`, { where: { path: contractPath } });\n\tif (typeof target !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing target.`, { where: { path: contractPath } });\n\tif (typeof targetFamily !== \"string\") throw new CliStructuredError$1(\"CONTRACT.VALIDATION_FAILED\", `Contract at ${relative(process.cwd(), contractPath)} is missing targetFamily.`, { where: { path: contractPath } });\n\treturn {\n\t\t...json,\n\t\tstorageHash,\n\t\tschemaVersion,\n\t\ttarget,\n\t\ttargetFamily,\n\t\t...typeof profileHash === \"string\" ? { profileHash } : {}\n\t};\n}\n/**\n* Masks credentials in a database connection URL.\n* Handles standard URLs (username + password + query params), URLs `new URL` rejects (such as\n* multi-host URLs), and libpq-style key=value strings.\n*/\nfunction maskConnectionUrl(url) {\n\ttry {\n\t\tconst parsed = new URL(url);\n\t\tif (parsed.username) parsed.username = \"****\";\n\t\tif (parsed.password) parsed.password = \"****\";\n\t\tfor (const key of [...parsed.searchParams.keys()]) if (PASSWORD_QUERY_KEY.test(key)) parsed.searchParams.set(key, \"****\");\n\t\treturn parsed.toString();\n\t} catch {\n\t\treturn hasUrlScheme(url) ? redactUrlCredentials(url) : maskKeyValueCredentials(url);\n\t}\n}\n/**\n* Strips raw connection URL fragments from an error message to prevent credential leakage.\n* Call this before surfacing driver errors to the user.\n*/\nfunction sanitizeErrorMessage(message, connectionUrl) {\n\tif (!connectionUrl) return message;\n\tconst secrets = connectionUrlSecrets(connectionUrl);\n\tif (secrets === void 0) return maskKeyValueCredentials(message);\n\tlet sanitized = message.replaceAll(connectionUrl, maskConnectionUrl(connectionUrl));\n\tfor (const secret of secrets.filter(Boolean).sort(longestFirst)) sanitized = sanitized.replaceAll(secret, \"****\");\n\treturn sanitized;\n}\n/** A next action with the connection string removed from each of its strings. */\nfunction nextActionWithoutConnectionString(action, connectionUrl) {\n\tconst clean = (text) => sanitizeErrorMessage(text, connectionUrl);\n\treturn {\n\t\tkind: action.kind,\n\t\tlabel: clean(action.label),\n\t\t...ifDefined(\"command\", action.command === void 0 ? void 0 : clean(action.command)),\n\t\t...ifDefined(\"commands\", action.commands?.map(clean)),\n\t\t...ifDefined(\"url\", action.url === void 0 ? void 0 : clean(action.url)),\n\t\t...ifDefined(\"reason\", action.reason === void 0 ? void 0 : clean(action.reason))\n\t};\n}\n/** `meta` with the connection string removed from every string it holds, however deeply nested. */\nfunction metaWithoutConnectionString(meta, connectionUrl) {\n\tconst clean = (value) => {\n\t\tif (typeof value === \"string\") return sanitizeErrorMessage(value, connectionUrl);\n\t\tif (Array.isArray(value)) return value.map(clean);\n\t\tif (typeof value === \"object\" && value !== null) return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, clean(entry)]));\n\t\treturn value;\n\t};\n\treturn Object.fromEntries(Object.entries(meta).map(([key, value]) => [key, clean(value)]));\n}\nfunction connectionUrlSecrets(connectionUrl) {\n\ttry {\n\t\tconst { username, password, searchParams } = new URL(connectionUrl);\n\t\treturn [\n\t\t\tusername,\n\t\t\tpassword,\n\t\t\t...[...searchParams].filter(([key]) => PASSWORD_QUERY_KEY.test(key)).map(([, value]) => value)\n\t\t];\n\t} catch {\n\t\tif (!hasUrlScheme(connectionUrl)) return;\n\t\tconst { username, password } = urlUserinfo(connectionUrl);\n\t\treturn [\n\t\t\tusername,\n\t\t\tpassword,\n\t\t\t...passwordQueryValues(connectionUrl)\n\t\t];\n\t}\n}\nfunction longestFirst(a, b) {\n\treturn b.length - a.length;\n}\nfunction maskKeyValueCredentials(text) {\n\treturn text.replace(/password\\s*=\\s*\\S+/gi, \"password=****\").replace(/user\\s*=\\s*\\S+/gi, \"user=****\");\n}\n//#endregion\n//#region src/control-api/operations/caught-errors.ts\n/**\n* The error a command reports for one it caught. A CLI error is reported as it is, and so is any other error a library raised with a structured code, such as `CONTRACT.DEFAULT_INVALID` for a stale contract's default or `CONTRACT.TYPE_PARAMS_INVALID` for its type parameters: the code says what went wrong better than the command can. An `InternalError` is thrown again, so the command boundary, `defineOrmCommand`, lets the engine report it as a bug. Anything else is reported as `CLI.UNEXPECTED` with the `why` the command gives for the error's message, and a `code` it carries that is not a structured one, such as a driver's `ECONNREFUSED` or a SQLSTATE, in `meta.code`.\n*\n* A command that holds a database connection passes its connection string, which is then removed from every string the reported error carries, whichever of those it is.\n*/\nfunction errorFromCaught(error, why, options = {}) {\n\tconst reported = reportedError(error, why);\n\treturn options.connection === void 0 ? reported : withoutConnectionString(reported, options.connection);\n}\n/** A structured error a library raised, reported under its own code, message and fields. */\nfunction cliErrorFromStructured(error) {\n\tif (CliStructuredError$1.is(error)) return error;\n\treturn new CliStructuredError$1(error.code, error.message, {\n\t\t...ifDefined(\"severity\", error.severity),\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"nextActions\", error.nextActions),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl),\n\t\tcause: error\n\t});\n}\nfunction reportedError(error, why) {\n\tif (isInternalError(error)) throw error;\n\tif (CliStructuredError$1.is(error)) return error;\n\tif (isStructuredError(error)) return cliErrorFromStructured(error);\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconst driverCode = error instanceof Error ? Reflect.get(error, \"code\") : void 0;\n\treturn errorUnexpected(message, {\n\t\twhy: why(message),\n\t\t...ifDefined(\"meta\", typeof driverCode === \"string\" ? { code: driverCode } : void 0),\n\t\tcause: error\n\t});\n}\nfunction withoutConnectionString(error, connection) {\n\tconst clean = (text) => sanitizeErrorMessage(text, connection);\n\treturn new CliStructuredError$1(error.code, clean(error.message), {\n\t\tseverity: error.severity,\n\t\t...ifDefined(\"why\", error.why === void 0 ? void 0 : clean(error.why)),\n\t\t...ifDefined(\"fix\", error.fix === void 0 ? void 0 : clean(error.fix)),\n\t\t...ifDefined(\"nextActions\", error.nextActions?.map((action) => nextActionWithoutConnectionString(action, connection))),\n\t\t...ifDefined(\"diagnostics\", error.diagnostics?.map((diagnostic) => diagnosticWithoutConnectionString(diagnostic, connection))),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta === void 0 ? void 0 : metaWithoutConnectionString(error.meta, connection)),\n\t\t...ifDefined(\"docsUrl\", error.docsUrl),\n\t\tcause: error.cause\n\t});\n}\nfunction diagnosticWithoutConnectionString(diagnostic, connection) {\n\tconst clean = (text) => sanitizeErrorMessage(text, connection);\n\treturn {\n\t\t...diagnostic,\n\t\tsummary: clean(diagnostic.summary),\n\t\t...ifDefined(\"why\", diagnostic.why === void 0 ? void 0 : clean(diagnostic.why)),\n\t\tnextActions: diagnostic.nextActions.map((action) => nextActionWithoutConnectionString(action, connection)),\n\t\t...ifDefined(\"meta\", diagnostic.meta === void 0 ? void 0 : metaWithoutConnectionString(diagnostic.meta, connection))\n\t};\n}\n//#endregion\nexport { errorStatementDidNotResolveLoss as $, errorDatabaseConnectionRequired as A, errorNoMigrations as B, errorAmbiguousMigrationRef as C, errorContractConfigMissing as D, errorContractArgConflict as E, errorLegendHumanOnly as F, errorRefSetBundleNotFound as G, errorPlanForgotTheFlag as H, errorMarkerMissing as I, errorRuntime as J, errorRefSetEmptySentinel as K, errorMigrationHasUnfilledPlaceholders as L, errorFileNotFound as M, errorHashMismatch as N, errorContractValidationFailed as O, errorInvalidSpaceId as P, errorStatementAnswersNoQuestion as Q, errorMigrationPackageNotFound as R, errorAdvanceRefArgConflict as S, statementFlag as St, errorConsentUnused as T, errorPlanOriginUnknown as U, errorPathUnreachable as V, errorPlanProducedNoOperations as W, errorSnapshotMissing as X, errorSignRefsNotWritten as Y, errorSpaceNotFound as Z, displayPath as _, writtenMigrationRunCommand as _t, getTargetMigrations as a, errorTargetMismatch as at, CliStructuredError$1 as b, runCommandAction as bt, resolveContractPath as c, requireLiveDatabase as ct, toStructuralEdge as d, dbMigrateRerun as dt, errorStatementInvalid as et, redactUrlCredentials as f, dbUpdateRerun as ft, contractPathFor as g, selfEmitCommand as gt, baseDirFor as h, rerunFlags as ht, collectDeclaredInvariants as i, errorTargetMigrationNotSupported as it, errorDriverRequired as j, errorConvertAndDelete as k, resolveMigrationPaths as l, cliCommand as lt, appRefsDirFor as m, printedPlanCommand as mt, errorFromCaught as n, errorStatementOriginUnknown as nt, maskConnectionUrl as o, errorUnexpected as ot, appMigrationsDirFor as p, printedPath as pt, errorRefSetHashNotInGraph as q, closeQuietly as r, errorStatementUnresolved as rt, readContractEnvelope as s, mapRefResolutionError as st, cliErrorFromStructured as t, errorStatementNeedsMigrationFile as tt, targetSupportsMigrations as u, cliInvocation as ut, migrationsDirFor as v, chooseAction as vt, errorConfigValidation as w, STORE_ORIGIN_SNAPSHOT_STEPS as x, shellQuoted as xt, ActionableCliError as y, editFileAction as yt, errorMigrationPlanningFailed as z };\n\n//# sourceMappingURL=caught-errors-I1l50iPc.mjs.map"],"mappings":";;;;;;;;;;;;AAYA,MAAM,aAAa;;AAEnB,SAAS,YAAY,OAAO;CAC3B,OAAO,WAAW,KAAK,KAAK,IAAI,QAAQ,IAAI,MAAM,WAAW,KAAK,OAAO,EAAE;AAC5E;;;;;;AAMA,SAAS,cAAc,WAAW;CACjC,MAAM,QAAQ,YAAY,UAAU,IAAI;CACxC,OAAO,UAAU,KAAK,WAAW,GAAG,IAAI,KAAK,UAAU,KAAK,GAAG,UAAU,KAAK,UAAU,KAAK,GAAG;AACjG;;;;;;AAQA,SAAS,iBAAiB,OAAO,SAAS;CACzC,OAAO;EACN,MAAM;EACN;EACA;CACD;AACD;;AAEA,SAAS,aAAa,OAAO;CAC5B,OAAO;EACN,MAAM;EACN;CACD;AACD;;AAEA,SAAS,eAAe,OAAO;CAC9B,OAAO;EACN,MAAM;EACN;CACD;AACD;;AAIA,SAAS,cAAc,KAAK,IAAI;CAC/B,OAAO;EACN,KAAK,IAAI;EACT,YAAY,IAAI;EAChB,SAAS,OAAO,KAAK;CACtB;AACD;;AAEA,SAAS,WAAW,OAAO;CAC1B,OAAO;EACN,GAAG,MAAM,OAAO,KAAK,IAAI,CAAC,IAAI,CAAC,QAAQ,YAAY,MAAM,EAAE,CAAC;EAC5D,GAAG,MAAM,eAAe,KAAK,IAAI,CAAC,IAAI,CAAC,iBAAiB,YAAY,MAAM,UAAU,CAAC;EACrF,GAAG,MAAM,uBAAuB,OAAO,CAAC,wBAAwB,IAAI,CAAC;CACtE;AACD;;AAEA,SAAS,eAAe,YAAY;CACnC,OAAO,WAAW,YAAY,cAAc,WAAW,aAAa,CAAC,CAAC;AACvE;;AAEA,SAAS,cAAc,YAAY,aAAa,WAAW,iBAAiB,CAA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UAAU;WACV,QAAQ;;;UAGT;WACC;WACA;WACA,UAAU;WACV;WACA,SAAS;;;;;KAKf,qBAAqB,QAAQ,gBAAgB,iCAAiC,qBAAqB;UAC9F;;WAEC,iBAAiB;;KAEvB,sBAAsB,OAAO,sBAAsB;;;;iBAIvC,cAAc,0BAA0B,0BAA0B,SAAS,qBAAqB,WAAW,aAAa,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domain-type-generation-BlYB8GiS-k0HNTf4f.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-BlYB8GiS.mjs"],"sourcesContent":["import { isSafeTypeExpression } from \"./type-expression-safety.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { entityAt } from \"@internal/framework-components/ir\";\nimport { renderImports, tsStringLiteral } from \"@internal/ts-render\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/emitter-errors.ts\nfunction emitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/domain-type-generation.ts\nfunction serializeValue(value) {\n\tif (value === null) return \"null\";\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (Array.isArray(value)) return `readonly [${value.map((v) => serializeValue(v)).join(\", \")}]`;\n\tif (typeof value === \"object\") return `{ ${Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([k, v]) => `readonly ${serializeObjectKey(k)}: ${serializeValue(v)}`).join(\"; \")} }`;\n\treturn \"unknown\";\n}\nfunction serializeObjectKey(key) {\n\tif (/^[$A-Z_a-z][$\\w]*$/.test(key)) return key;\n\treturn serializeValue(key);\n}\nfunction serializeNamespaceId(value) {\n\treturn `${serializeValue(value)} & NamespaceId`;\n}\nfunction serializeCrossReference(ref) {\n\treturn `{ readonly namespace: ${serializeNamespaceId(String(ref.namespace))}; readonly model: ${serializeValue(ref.model)}${ref.space !== void 0 ? `; readonly space: ${serializeValue(ref.space)}` : \"\"} }`;\n}\nfunction generateRootsType(roots) {\n\tif (!roots || Object.keys(roots).length === 0) return \"Record<string, never>\";\n\treturn `{ ${Object.entries(roots).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${serializeCrossReference(value)}`).join(\"; \")} }`;\n}\nfunction valueObjectFieldTypeText(type) {\n\treturn `{ readonly kind: \"valueObject\"; readonly plane: \"storage\"; readonly namespaceId: ${serializeValue(type.namespaceId)}; readonly entityKind: \"valueObject\"; readonly entityName: ${serializeValue(type.entityName)} }`;\n}\nfunction contractFieldModifierSuffix(field) {\n\treturn (field.many ? `; readonly many: { readonly elementNullable: ${field.many.elementNullable} }` : \"\") + (field.dict === true ? \"; readonly dict: true\" : \"\");\n}\nfunction generateModelFieldEntry(fieldName, field) {\n\tconst mods = contractFieldModifierSuffix(field);\n\tconst { nullable, type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${mods} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${valueObjectFieldTypeText(type)}${mods} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${serializeValue(type)}${mods} }`;\n}\nfunction objectTypeOpenWhenEmpty(entries) {\n\treturn entries.length > 0 ? `{ ${entries.join(\"; \")} }` : \"{}\";\n}\nfunction generateModelFieldsType(fields) {\n\tconst fieldEntries = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) fieldEntries.push(generateModelFieldEntry(fieldName, field));\n\treturn objectTypeOpenWhenEmpty(fieldEntries);\n}\nfunction generateModelRelationsType(relations) {\n\tconst relationEntries = [];\n\tfor (const [relName, rel] of Object.entries(relations)) {\n\t\tif (typeof rel !== \"object\" || rel === null) continue;\n\t\tconst relObj = blindCast(rel);\n\t\tconst toRef = relObj[\"to\"];\n\t\tif (toRef !== null && typeof toRef === \"object\" && \"space\" in toRef && toRef.space !== void 0) {\n\t\t\trelationEntries.push(`readonly ${serializeObjectKey(relName)}: never`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parts = [];\n\t\tif (toRef) parts.push(`readonly to: ${serializeCrossReference(blindCast(toRef))}`);\n\t\tif (relObj[\"cardinality\"]) parts.push(`readonly cardinality: ${serializeValue(relObj[\"cardinality\"])}`);\n\t\tif (typeof relObj[\"nullable\"] === \"boolean\") parts.push(`readonly nullable: ${relObj[\"nullable\"]}`);\n\t\tconst on = blindCast(relObj[\"on\"]);\n\t\tif (on && (!on.localFields || !on.targetFields)) throw emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relName}\" has an \"on\" block but is missing localFields or targetFields`, { meta: { relation: relName } });\n\t\tif (on?.localFields && on.targetFields) {\n\t\t\tconst localFields = on.localFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tconst targetFields = on.targetFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tparts.push(`readonly on: { readonly localFields: readonly [${localFields}]; readonly targetFields: readonly [${targetFields}] }`);\n\t\t}\n\t\tif (relObj[\"cardinality\"] === \"N:M\") {\n\t\t\tconst { through } = blindCast(relObj);\n\t\t\tconst table = serializeValue(through.table);\n\t\t\tconst namespaceId = serializeValue(through.namespaceId);\n\t\t\tconst parentColumns = through.parentColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst childColumns = through.childColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst targetColumns = through.targetColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tparts.push(`readonly through: { readonly table: ${table}; readonly namespaceId: ${namespaceId}; readonly parentColumns: readonly [${parentColumns}]; readonly childColumns: readonly [${childColumns}]; readonly targetColumns: readonly [${targetColumns}] }`);\n\t\t}\n\t\tif (parts.length > 0) relationEntries.push(`readonly ${serializeObjectKey(relName)}: { ${parts.join(\"; \")} }`);\n\t}\n\tif (relationEntries.length === 0) return \"Record<string, never>\";\n\treturn `{ ${relationEntries.join(\"; \")} }`;\n}\nfunction generateModelsType(models, generateModelStorage) {\n\tif (!models || Object.keys(models).length === 0) return \"Record<string, never>\";\n\tconst modelTypes = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tconst fieldsType = generateModelFieldsType(model.fields);\n\t\tconst relationsType = generateModelRelationsType(model.relations);\n\t\tconst storageType = generateModelStorage(modelName, model);\n\t\tconst modelParts = [\n\t\t\t`readonly fields: ${fieldsType}`,\n\t\t\t`readonly relations: ${relationsType}`,\n\t\t\t`readonly storage: ${storageType}`\n\t\t];\n\t\tif (model.owner) modelParts.push(`readonly owner: ${serializeValue(model.owner)}`);\n\t\tif (model.discriminator) modelParts.push(`readonly discriminator: ${serializeValue(model.discriminator)}`);\n\t\tif (model.variants) {\n\t\t\tconst variantEntries = Object.entries(model.variants).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([value, ref]) => `readonly ${serializeObjectKey(value)}: ${serializeCrossReference(ref)}`);\n\t\t\tmodelParts.push(`readonly variants: { ${variantEntries.join(\"; \")} }`);\n\t\t}\n\t\tif (model.base) modelParts.push(`readonly base: ${serializeCrossReference(model.base)}`);\n\t\tmodelTypes.push(`readonly ${serializeObjectKey(modelName)}: { ${modelParts.join(\"; \")} }`);\n\t}\n\treturn `{ ${modelTypes.join(\"; \")} }`;\n}\nfunction deduplicateImports(imports) {\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const imp of imports) {\n\t\tconst key = `${imp.package}::${imp.named}`;\n\t\tif (!seenKeys.has(key)) {\n\t\t\tseenKeys.add(key);\n\t\t\tresult.push(imp);\n\t\t}\n\t}\n\treturn result;\n}\nfunction generateImportLines(imports, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst rendered = renderImports(imports.map((imp) => ({\n\t\tmoduleSpecifier: resolveImportSpecifier(imp.package),\n\t\tsymbol: imp.named,\n\t\talias: imp.alias,\n\t\ttypeOnly: true\n\t})));\n\treturn rendered === \"\" ? [] : rendered.split(\"\\n\");\n}\nfunction generateCodecTypeIntersection(imports, named) {\n\treturn imports.filter((imp) => imp.named === named).map((imp) => imp.alias).join(\" & \") || \"Record<string, never>\";\n}\nfunction serializeExecutionType(execution) {\n\tconst parts = [\"readonly executionHash: ExecutionHash\"];\n\tfor (const [key, value] of Object.entries(execution)) {\n\t\tif (key === \"executionHash\") continue;\n\t\tparts.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\nfunction generateHashTypeAliases(hashes) {\n\tconst executionHashType = hashes.executionHash ? `ExecutionHashBase<${serializeValue(hashes.executionHash)}>` : \"ExecutionHashBase<string>\";\n\treturn [\n\t\t`export type StorageHash = StorageHashBase<${serializeValue(hashes.storageHash)}>;`,\n\t\t`export type ExecutionHash = ${executionHashType};`,\n\t\t`export type ProfileHash = ProfileHashBase<${serializeValue(hashes.profileHash)}>;`\n\t].join(\"\\n\");\n}\n/**\n* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by\n* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not\n* a generic serializer. `side`: `output` = read type, `input` = create/update type.\n*\n* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when\n* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value\n* isn't literal-expressible, which every value of a codec that declares `keepsWrittenForm` is. A\n* caller that needs column and field types to agree shares this so both compute the union\n* identically.\n*/\nfunction renderValueSetType(values, codecId, side, codecLookup) {\n\tif (values.length === 0) return void 0;\n\tconst literals = [];\n\tfor (const value of values) {\n\t\tconst lit = renderValueLiteralType(value, codecId, side, codecLookup);\n\t\tif (lit === void 0) return void 0;\n\t\tliterals.push(lit);\n\t}\n\treturn literals.join(\" | \");\n}\n/** The TS literal type the codec renders for one stored value, or `undefined` when it renders none or what it renders is not a safe type expression. */\nfunction renderValueLiteralType(value, codecId, side, codecLookup) {\n\tconst lit = codecLookup?.renderValueLiteralFor?.(codecId, value, side);\n\treturn lit === void 0 || !isSafeTypeExpression(lit) ? void 0 : lit;\n}\n/** The local alias for the union of the stack's parameterized output type functions. */\nconst PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS = \"ParameterizedOutputTypeFunctions\";\n/** The declaration of {@link PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} for the type functions the stack's components declare. */\nfunction parameterizedOutputTypeFunctionsAlias(typeFunctions) {\n\tconst aliases = [...new Set(typeFunctions.map((typeFunction) => typeFunction.alias))];\n\treturn `type ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS} = ${aliases.length > 0 ? aliases.join(\" | \") : \"never\"};`;\n}\n/** `FieldOutputTypes` (`side` `'output'`) or `FieldInputTypes` (`'input'`): the shared generic applied to the emitted contract's domain, with `FieldTypeOverrides`, and to its storage namespaces. */\nfunction fieldTypesMapExpression(side) {\n\treturn `FieldTypesFromDomain<ContractBase['domain']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}, ContractBase['storage']['namespaces']>`;\n}\nfunction generateContractFieldDescriptor(fieldName, field) {\n\tconst modStr = contractFieldModifierSuffix(field);\n\tconst { type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${modStr} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${valueObjectFieldTypeText(type)}${modStr} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${serializeValue(type)}${modStr} }`;\n}\nfunction generateValueObjectsDescriptorType(valueObjects) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"Record<string, never>\";\n\tconst voEntries = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst fieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(vo.fields)) fieldEntries.push(generateContractFieldDescriptor(fieldName, field));\n\t\tconst fieldsType = fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tvoEntries.push(`readonly ${serializeObjectKey(voName)}: { readonly fields: ${fieldsType} }`);\n\t}\n\treturn `{ ${voEntries.join(\"; \")} }`;\n}\n/**\n* `<Name>Output` and `<Name>Input` for each value object, read from the shared generic's value object types at the storage namespace that holds it.\n*/\nfunction generateValueObjectTypeAliases(valueObjectNamespaces) {\n\tif (valueObjectNamespaces.length === 0) return \"\";\n\tconst generic = (side) => `ValueObjectTypesFromStorage<ContractBase['storage']['namespaces'], CodecTypes, ${PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS}, FieldTypeOverrides, ${serializeValue(side)}>`;\n\tconst aliases = [`type ValueObjectOutputTypes = ${generic(\"output\")};`, `type ValueObjectInputTypes = ${generic(\"input\")};`];\n\tfor (const [name, namespaceId] of valueObjectNamespaces) {\n\t\tconst path = `[${serializeValue(namespaceId)}][${serializeValue(name)}]`;\n\t\taliases.push(`export type ${name}Output = ValueObjectOutputTypes${path};`);\n\t\taliases.push(`export type ${name}Input = ValueObjectInputTypes${path};`);\n\t}\n\treturn aliases.join(\"\\n\");\n}\n/**\n* The type of a scalar field that its codec does not give, which the shared field type generic takes as an override: the literal union of the value set it holds, or the text its codec renders for its type parameters. `undefined` when the codec gives both sides, and for a value object or union field, which the generic types itself.\n*/\nfunction resolveFieldTypeOverride(field, codecLookup, resolvedValueSet) {\n\tconst { type } = field;\n\tif (type.kind !== \"scalar\") return void 0;\n\tif (resolvedValueSet) {\n\t\tconst override = renderValueSetOverride(resolvedValueSet.encodedValues, resolvedValueSet.codecId, codecLookup);\n\t\tif (override !== void 0) return override;\n\t}\n\tconst typeParams = type.typeParams && Object.keys(type.typeParams).length > 0 ? type.typeParams : void 0;\n\treturn renderCodecTypeOverride(type.codecId, typeParams, codecLookup);\n}\n/** The literal union of a value set on each side whose values all have literal types, or `undefined` when neither side has. */\nfunction renderValueSetOverride(values, codecId, codecLookup) {\n\tconst output = renderValueSetType(values, codecId, \"output\", codecLookup);\n\tconst input = renderValueSetType(values, codecId, \"input\", codecLookup);\n\tconst override = {\n\t\t...output !== void 0 ? { output } : {},\n\t\t...input !== void 0 ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\n/** The type text a codec renders for these type parameters, on the sides it renders one. */\nfunction renderCodecTypeOverride(codecId, typeParams, codecLookup) {\n\tif (codecLookup === void 0 || typeParams === void 0) return void 0;\n\tconst output = codecLookup.renderOutputTypeFor(codecId, typeParams);\n\tconst input = codecLookup.renderInputTypeFor?.(codecId, typeParams);\n\tconst override = {\n\t\t...output && isSafeTypeExpression(output) ? { output } : {},\n\t\t...input && isSafeTypeExpression(input) ? { input } : {}\n\t};\n\treturn Object.keys(override).length > 0 ? override : void 0;\n}\nfunction renderTypeOverride(override) {\n\treturn `{ ${[\"output\", \"input\"].flatMap((side) => {\n\t\tconst type = override[side];\n\t\treturn type === void 0 ? [] : [`readonly ${side}: ${type}`];\n\t}).join(\"; \")} }`;\n}\n/** A nested map of type overrides, one level per path segment, ordered by name at every level, leaving out every branch with no entry. */\nfunction renderTypeOverridesMap(entries) {\n\tconst root = /* @__PURE__ */ new Map();\n\tfor (const [path, type] of entries) {\n\t\tif (type === void 0) continue;\n\t\tlet node = root;\n\t\tfor (const segment of path.slice(0, -1)) {\n\t\t\tconst child = node.get(segment);\n\t\t\tconst next = child instanceof Map ? child : /* @__PURE__ */ new Map();\n\t\t\tnode.set(segment, next);\n\t\t\tnode = next;\n\t\t}\n\t\tconst leaf = path.at(-1);\n\t\tif (leaf !== void 0) node.set(leaf, type);\n\t}\n\treturn renderOverrideTree(root);\n}\nfunction renderOverrideTree(tree) {\n\treturn `{ ${[...tree].sort(([a], [b]) => a.localeCompare(b)).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${value instanceof Map ? renderOverrideTree(value) : renderTypeOverride(value)}`).join(\"; \")} }`;\n}\n/**\n* The values a model field's value set holds, with the field's codec. A reference to a domain enum is read from the contract's domain. Any other model field goes to the family's `resolveStorageValueSet`, which reads its storage.\n*/\nfunction resolveFieldValueSet(field, contract, resolveStorageValueSet) {\n\tif (field.valueSet?.plane === \"domain\") return resolveDomainValueSet(field, contract);\n\treturn resolveStorageValueSet();\n}\nfunction resolveDomainValueSet(field, contract) {\n\tconst ref = field.valueSet;\n\tif (ref === void 0 || field.type.kind !== \"scalar\" || ref.entityKind !== \"enum\") return;\n\tconst domainEnum = contract.domain.namespaces[ref.namespaceId]?.enum?.[ref.entityName];\n\tif (domainEnum === void 0) return void 0;\n\treturn {\n\t\tencodedValues: domainEnum.members.map((member) => member.value),\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** The values of the storage value set a value object field names, with the field's codec. */\nfunction resolveValueObjectFieldValueSet(field, storage) {\n\tif (field.valueSet === void 0 || field.type.kind !== \"scalar\") return void 0;\n\tconst valueSet = entityAt(storage, field.valueSet);\n\tif (valueSet === void 0) return void 0;\n\treturn {\n\t\tencodedValues: valueSet.values,\n\t\tcodecId: field.type.codecId\n\t};\n}\n/** `FieldTypeOverrides`: per namespace, `models` (domain namespace) or `valueObjects` (storage namespace), owner and field, the type of each field its codec does not give. */\nfunction generateFieldTypeOverridesMap(contract, codecLookup, resolveStorageValueSet) {\n\tconst modelFields = Object.entries(contract.domain.namespaces).flatMap(([nsId, ns]) => Object.entries(ns.models).flatMap(([modelName, model]) => Object.entries(model.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"models\",\n\t\tmodelName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveFieldValueSet(field, contract, () => resolveStorageValueSet?.(modelName, fieldName, model)))])));\n\tconst valueObjectFields = valueObjectsWithCoordinates(contract.storage).flatMap(({ coordinate: { namespaceId: nsId, entityName: valueObjectName }, valueObject }) => Object.entries(valueObject.fields).map(([fieldName, field]) => [[\n\t\tnsId,\n\t\t\"valueObjects\",\n\t\tvalueObjectName,\n\t\tfieldName\n\t], resolveFieldTypeOverride(field, codecLookup, resolveValueObjectFieldValueSet(field, contract.storage))]));\n\treturn renderTypeOverridesMap([...modelFields, ...valueObjectFields]);\n}\n//#endregion\nexport { resolveFieldTypeOverride as C, serializeObjectKey as D, serializeNamespaceId as E, serializeValue as O, renderValueSetType as S, serializeExecutionType as T, renderCodecTypeOverride as _, generateContractFieldDescriptor as a, renderValueLiteralType as b, generateImportLines as c, generateModelRelationsType as d, generateModelsType as f, parameterizedOutputTypeFunctionsAlias as g, generateValueObjectsDescriptorType as h, generateCodecTypeIntersection as i, emitterError as k, generateModelFieldEntry as l, generateValueObjectTypeAliases as m, deduplicateImports as n, generateFieldTypeOverridesMap as o, generateRootsType as p, fieldTypesMapExpression as r, generateHashTypeAliases as s, PARAMETERIZED_OUTPUT_TYPE_FUNCTIONS as t, generateModelFieldsType as u, renderTypeOverride as v, serializeCrossReference as w, renderValueSetOverride as x, renderTypeOverridesMap as y };\n\n//# sourceMappingURL=domain-type-generation-BlYB8GiS.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAA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AC,CAAC,CAAC;CAC3G,OAAO,uBAAuB,CAAC,GAAG,aAAa,GAAG,iBAAiB,CAAC;AACrE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"domain-type-generation-D5cG6TGd-DKLpO6ZA.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-D5cG6TGd.d.mts"],"mappings":";;;;;iBAIiB,eAAe;iBACf,mBAAmB;iBACnB,qBAAqB;iBACrB,wBAAwB,KAAK;iBAC7B,kBAAkB,OAAO,eAAe;iBACxC,wBAAwB,mBAAmB,OAAO;iBAClD,wBAAwB,QAAQ,eAAe;iBAC/C,2BAA2B,WAAW;iBACtC,mBAAmB,QAAQ,eAAe,oBAAoB,uBAAuB,mBAAmB,OAAO;iBAC/G,mBAAmB,SAAS,oBAAoB;iBAChD,oBAAoB,SAAS,mBAAmB,yBAAyB;iBACzE,8BAA8B,SAAS,cAAc,kBAAkB;iBACvE,uBAAuB,WAAW;iBAClC,wBAAwB;WAC9B;WACA;WACA;;;;;KAKN;WACM,wBAAwB;WACxB;;KAEN,2BAA2B,mBAAmB,mBAAmB,OAAO,sBAAsB;;;;;;;;;;;;iBAYlF,mBAAmB,iBAAiB,aAAa,iBAAiB,0BAA0B,aAAa;;iBAEzG,uBAAuB,OAAO,WAAW,iBAAiB,0BAA0B,aAAa;;cAEpG;;iBAEG,sCAAsC,eAAe,cAAc;;iBAEnE,wBAAwB;iBACxB,gCAAgC,mBAAmB,OAAO;iBAC1D,mCAAmC,cAAc,eAAe;;;;iBAIhE,+BAA+B,uBAAuB,wBAAwB,cAAc;;KAExG;WACM;WACA;;;;;iBAKM,yBAAyB,OAAO,KAAK,wBAAwB,aAAa,yBAAyB,kBAAkB,oCAAoC;;iBAEzJ,uBAAuB,iBAAiB,aAAa,iBAAiB,aAAa,0BAA0B;;iBAE7G,wBAAwB,iBAAiB,YAAY,qCAAqC,aAAa,0BAA0B;iBACjI,mBAAmB,UAAU;;iBAE7B,uBAAuB,SAAS,wBAAwB,yBAAyB,MAAM;;iBAEvF,8BAA8B,UAAU,oBAAoB,aAAa,yBAAyB,wBAAwB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exports-CSVHjfwG.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\nimport { dirname, join, matchesGlob, resolve } from \"pathe\";\nimport { glob, isDynamicPattern } from \"tinyglobby\";\nimport { realpathSync } from \"node:fs\";\nimport { access } from \"node:fs/promises\";\nimport { pathToFileURL } from \"node:url\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from \"@internal/errors/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\nimport { configSchema, defineConfigSection, reference, validateSectionWithSchema } from \"@prisma/cli-engine\";\n//#region src/expand-contract-inputs.ts\nconst UNC_PREFIX_RE = /^(?:\\\\\\\\|\\/\\/)/;\nfunction isUncLike(entry) {\n\treturn UNC_PREFIX_RE.test(entry);\n}\nfunction resolveLiteral(entry) {\n\treturn isUncLike(entry) ? entry : resolve(entry);\n}\n/**\n* Glob syntax (tinyglobby, pathe's `matchesGlob`) only understands `/` as a\n* separator and reads a backslash as an escape. Config validation resolves inputs\n* to native absolute paths, so on Windows an authored `./schema/*.prisma`\n* arrives as `C:\\app\\schema\\*.prisma`, where the backslash escapes the\n* wildcard. Convert native separators back to `/` on Windows only, so glob\n* escapes keep working on POSIX.\n*/\nfunction withForwardSlashSeparators(pattern) {\n\treturn process.platform === \"win32\" ? pattern.replaceAll(\"\\\\\", \"/\") : pattern;\n}\n/**\n* The form of `entry` the glob libraries understand, or nothing when `entry`\n* is a literal. A UNC entry on Windows stays a literal: tinyglobby would\n* crawl the share's path on the working directory's drive.\n*/\nfunction globPatternOf(entry) {\n\tif (process.platform === \"win32\" && isUncLike(entry)) return;\n\tconst candidate = withForwardSlashSeparators(entry);\n\treturn isDynamicPattern(candidate) ? candidate : void 0;\n}\n/** pathe's `matchesGlob` uppercases the drive letter of the path it tests, so the pattern's must match. */\nfunction withUppercaseDrive(globPattern) {\n\treturn globPattern.replace(/^[a-z]:/, (drive) => drive.toUpperCase());\n}\n/**\n* Expands a finalized contract source input list into its member file set:\n* absolute, deduped by canonical path, sorted. `patterns` must already be\n* absolute (the `orm` config schema resolves each entry against the config\n* file that wrote it but does not expand it).\n*\n* A wildcard-free entry (per tinyglobby's own magic-character check) passes\n* through verbatim — no globbing, no existence check, no directory\n* expansion — so a literal file, a nonexistent path (its read error\n* surfaces downstream), and a directory (`contract-prisma7`'s adoption\n* surface) all reach the result unchanged. Only entries containing glob\n* magic run through `tinyglobby`, directories-not-auto-expanded and\n* files-only; a glob matching nothing contributes nothing — no diagnostic\n* here.\n*/\nasync function expandContractInputs(patterns) {\n\tif (patterns === void 0 || patterns.length === 0) return [];\n\tconst literals = [];\n\tconst globPatterns = [];\n\tfor (const pattern of patterns) {\n\t\tconst globPattern = globPatternOf(pattern);\n\t\tif (globPattern === void 0) literals.push(pattern);\n\t\telse globPatterns.push(globPattern);\n\t}\n\tconst globMatches = globPatterns.length === 0 ? [] : await glob(globPatterns, {\n\t\tabsolute: true,\n\t\tonlyFiles: true,\n\t\texpandDirectories: false\n\t});\n\tconst canonical = new Set([...literals, ...globMatches].map(resolveLiteral));\n\treturn Array.from(canonical).sort();\n}\n/**\n* The first glob entry of `patterns` that `path` matches, whether or not a\n* file exists at `path`. Both must be absolute.\n*/\nfunction globContractInputMatching(patterns, path) {\n\treturn patterns.find((pattern) => {\n\t\tconst globPattern = globPatternOf(pattern);\n\t\treturn globPattern !== void 0 && matchesGlob(path, withUppercaseDrive(globPattern));\n\t});\n}\n//#endregion\n//#region src/orm-section.ts\n/** The single config section the `orm` command family owns. */\nconst ORM_CONFIG_SECTION_NAME = \"orm\";\nconst CONFIG_SECTIONS = [\n\t\"family\",\n\t\"target\",\n\t\"adapter\",\n\t\"driver\",\n\t\"extensions\",\n\t\"db\",\n\t\"contract\",\n\t\"migrations\",\n\t\"formatter\"\n];\nfunction isConfigSection(value) {\n\treturn CONFIG_SECTIONS.some((section) => section === value);\n}\n/**\n* The fields that identify a control descriptor. Only these are declared: a\n* descriptor is a runtime object the family builds, and its other members\n* (codec tables, the contract serializer, migration hooks) pass through. Each\n* descriptor is declared a reference, so the command receives the object the\n* config file built.\n*/\nconst descriptorFields = {\n\tid: \"string\",\n\tfamilyId: \"string\",\n\tversion: \"string\",\n\tcreate: \"Function\"\n};\nconst targetLikeFields = {\n\t...descriptorFields,\n\ttargetId: \"string\"\n};\n/**\n* The contract source provider: `load` closes over the authored contract,\n* `inputs` are paths the schema resolves against the config file, and\n* `format` names the language the inputs are written in. Other keys a\n* provider carries pass through.\n*/\nconst contractSource = {\n\tload: \"Function\",\n\t\"inputs?\": \"path[]\",\n\tformat: \"'psl' | 'typescript'\",\n\t\"parserOptions?\": {\n\t\t\"+\": \"reject\",\n\t\t\"grammar?\": \"'prisma-7' | 'prisma-8'\"\n\t}\n};\n/** Each subsection's own shape, without the rules that relate subsections to one another. */\nconst ormSubsectionsSchema = configSchema({\n\tfamily: reference(configSchema({\n\t\tkind: \"'family'\",\n\t\t...descriptorFields,\n\t\temission: \"object\"\n\t})),\n\ttarget: reference(configSchema({\n\t\tkind: \"'target'\",\n\t\t...targetLikeFields\n\t})),\n\tadapter: reference(configSchema({\n\t\tkind: \"'adapter'\",\n\t\t...targetLikeFields\n\t})),\n\t\"driver?\": reference(configSchema({\n\t\tkind: \"'driver'\",\n\t\t...targetLikeFields\n\t})),\n\t\"extensions?\": [reference(configSchema({\n\t\tkind: \"'extension'\",\n\t\t...targetLikeFields\n\t})), \"[]\"],\n\t\"db?\": { \"connection?\": reference(configSchema(\"unknown\")) },\n\t\"contract?\": {\n\t\tsource: contractSource,\n\t\toutput: [\n\t\t\t\"path\",\n\t\t\t\"=\",\n\t\t\t() => \"src/prisma/contract.json\"\n\t\t]\n\t},\n\tmigrations: [\n\t\t{ dir: [\n\t\t\t\"path\",\n\t\t\t\"=\",\n\t\t\t() => \"./migrations\"\n\t\t] },\n\t\t\"=\",\n\t\t() => ({})\n\t],\n\t\"formatter?\": {\n\t\t\"indent?\": \"number.integer >= 1 | 'tab'\",\n\t\t\"newline?\": \"'LF' | 'CRLF'\"\n\t}\n});\n/**\n* Every broken rule relating the descriptor subsections: each descriptor\n* shares the family's `familyId`, and each target-bound descriptor shares\n* the target's `targetId`. A rule is checked only when `checked` accepts\n* both subsections it relates, so a loader can check the subsections that\n* validated while others have diagnostics.\n*/\nfunction descriptorRelationshipProblems(config, checked) {\n\tconst family = checked(\"family\") ? config.family : void 0;\n\tconst target = checked(\"target\") ? config.target : void 0;\n\tconst bound = [\n\t\t[[\"target\"], target],\n\t\t[[\"adapter\"], checked(\"adapter\") ? config.adapter : void 0],\n\t\t[[\"driver\"], checked(\"driver\") ? config.driver : void 0],\n\t\t...(checked(\"extensions\") ? config.extensions ?? [] : []).map((extension, index) => [[\"extensions\", index], extension])\n\t];\n\tconst problems = [];\n\tfor (const [path, descriptor] of bound) {\n\t\tif (descriptor === void 0) continue;\n\t\tif (family !== void 0 && descriptor.familyId !== family.familyId) problems.push({\n\t\t\tpath: [...path, \"familyId\"],\n\t\t\texpected: `Config.family.familyId (${family.familyId})`,\n\t\t\tactual: descriptor.familyId\n\t\t});\n\t\tif (target !== void 0 && path[0] !== \"target\" && descriptor.targetId !== target.targetId) problems.push({\n\t\t\tpath: [...path, \"targetId\"],\n\t\t\texpected: `Config.target.targetId (${target.targetId})`,\n\t\t\tactual: descriptor.targetId\n\t\t});\n\t}\n\treturn problems;\n}\n/**\n* The shape of the `orm` section of `prisma.config.ts`, declared once. The\n* CLI engine derives validation, the diagnostics naming a bad field and the\n* file to fix, and the resolution of every `path` field against the config\n* file that wrote it (prisma-cli ADR 0005). Relative paths are resolved\n* before any command sees the value, and the value carries `baseDir`.\n*/\nconst ormConfigSchema = ormSubsectionsSchema.narrow((config, ctx) => {\n\tif (\"extensionPacks\" in config) return ctx.reject({\n\t\tpath: [\"extensionPacks\"],\n\t\tmessage: \"Config.extensionPacks is no longer supported; rename it to Config.extensions\"\n\t});\n\tconst problems = descriptorRelationshipProblems(config, () => true);\n\tfor (const problem of problems) ctx.error({\n\t\tpath: [...problem.path],\n\t\texpected: problem.expected,\n\t\tactual: problem.actual\n\t});\n\treturn problems.length === 0;\n});\n/**\n* The section token the ORM's commands declare in `needs.config`. The\n* engine validates the merged section with its provenance and hands the\n* handler the value: absolute paths, `migrations.dir` defaulted, `baseDir`\n* recorded.\n*/\nconst ormConfigSection = blindCast(defineConfigSection({\n\tname: \"orm\",\n\tschema: ormConfigSchema\n}));\n/**\n* Validates a raw `orm` section the way the engine does for a command,\n* for the loaders and tools that read the config outside a command run.\n*/\nfunction validateOrmSection(raw, provenance) {\n\treturn blindCast(validateSectionWithSchema(\"orm\", ormConfigSchema, raw, provenance));\n}\n/**\n* Validates the shape of every subsection except `failing`, which comes back\n* as authored. A loader uses it when some subsections have diagnostics, so a\n* caller that reads only the others still gets their paths resolved and\n* defaults applied. The rules relating subsections are not applied here; see\n* {@link descriptorRelationshipProblems}.\n*/\nfunction validateOrmSectionExcept(raw, provenance, failing) {\n\tconst healthy = CONFIG_SECTIONS.filter((section) => !failing.has(section));\n\treturn validateSectionWithSchema(\"orm\", ormSubsectionsSchema.pick(...healthy), raw, provenance);\n}\n//#endregion\n//#region src/load.ts\nconst CONFIG_FILENAME = \"prisma.config.ts\";\nasync function findNearestConfigPathForFile(filePath) {\n\tlet current = dirname(resolve(process.cwd(), filePath));\n\twhile (true) {\n\t\tconst candidate = join(current, CONFIG_FILENAME);\n\t\tif (await fileExists(candidate)) return candidate;\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) return;\n\t\tcurrent = parent;\n\t}\n}\nasync function fileExists(path) {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction collectArtifactCollisionDiagnostics(contract) {\n\tconst inputs = contract.source.inputs;\n\tconst output = contract.output;\n\tif (inputs === void 0 || output === void 0) return [];\n\tlet emittedArtifactPaths;\n\ttry {\n\t\temittedArtifactPaths = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [errorConfigValidation(\"contract.output\", {\n\t\t\t/* v8 ignore next -- getEmittedArtifactPaths only ever throws an Error */\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tsection: \"contract\"\n\t\t})];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\tif (inputs.some((input) => emittedPaths.has(input))) return [errorConfigValidation(\"contract.source.inputs[]\", {\n\t\twhy: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\",\n\t\tsection: \"contract\"\n\t})];\n\treturn [];\n}\nfunction validateLoadedSection(rawConfig, provenance) {\n\tconst validation = validateOrmSection(rawConfig, provenance);\n\tif (!validation.ok) {\n\t\tconst diagnostics = validation.diagnostics.map((diagnostic) => {\n\t\t\tconst field = typeof diagnostic.meta?.[\"field\"] === \"string\" ? diagnostic.meta[\"field\"] : \"\";\n\t\t\tconst section = field.split(\".\")[0] ?? \"\";\n\t\t\treturn errorConfigValidation(field, {\n\t\t\t\twhy: diagnostic.summary,\n\t\t\t\t...isConfigSection(section) ? { section } : {}\n\t\t\t});\n\t\t});\n\t\tconst failing = new Set(diagnostics.map((diagnostic) => String(diagnostic.meta?.[\"section\"] ?? \"\")));\n\t\tconst partial = validateOrmSectionExcept(rawConfig, provenance, failing);\n\t\tconst config = blindCast(partial.ok ? partial.value : rawConfig);\n\t\tif (!partial.ok) return {\n\t\t\tconfig,\n\t\t\tdiagnostics\n\t\t};\n\t\tconst related = descriptorRelationshipProblems(config, (section) => !failing.has(section)).map((problem) => errorConfigValidation(problem.path.join(\".\"), {\n\t\t\twhy: `${problem.path.join(\".\")} must be ${problem.expected} (was ${problem.actual})`,\n\t\t\tsection: String(problem.path[0])\n\t\t}));\n\t\tconst collisions = failing.has(\"contract\") || config.contract === void 0 ? [] : collectArtifactCollisionDiagnostics(config.contract);\n\t\treturn {\n\t\t\tconfig,\n\t\t\tdiagnostics: [\n\t\t\t\t...diagnostics,\n\t\t\t\t...related,\n\t\t\t\t...collisions\n\t\t\t]\n\t\t};\n\t}\n\tconst config = validation.value;\n\tif (config.contract === void 0) return {\n\t\tconfig,\n\t\tdiagnostics: []\n\t};\n\treturn {\n\t\tconfig,\n\t\tdiagnostics: collectArtifactCollisionDiagnostics(config.contract)\n\t};\n}\n/**\n* Validates a raw `orm` section and resolves its paths against `configDir`, the way a loaded config\n* file is. A caller that builds the section in memory gets the same diagnostics as one that wrote\n* it to `prisma.config.ts`.\n*/\nfunction buildLoadedConfig(rawConfig, configDir) {\n\tconst file = join(configDir, CONFIG_FILENAME);\n\treturn validateLoadedSection(rawConfig, {\n\t\tfiles: [file],\n\t\tkeys: Object.fromEntries(Object.keys(rawConfig).map((key) => [key, file]))\n\t});\n}\nfunction toConfigLoadFailure(error, configPath) {\n\tif (CliStructuredError.is(error)) return error;\n\tconst resolvedPath = configPath ? resolve(process.cwd(), configPath) : void 0;\n\tif (isStructuredError(error)) return new CliStructuredError(error.code, error.message, {\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\tcause: error\n\t});\n\tif (error instanceof Error) return errorConfigEvaluationFailed(resolvedPath, {\n\t\twhy: error.message,\n\t\tcause: error\n\t});\n\treturn errorConfigEvaluationFailed(resolvedPath, { why: String(error) });\n}\n/**\n* c12 is resolved to its real on-disk entry before importing: jiti (inside\n* c12) resolves its own transitive imports from the importing file's location,\n* and a symlinked install (pnpm) would otherwise anchor them somewhere the\n* packages are not. Importing at the real location keeps every transitive\n* resolution working.\n*/\nasync function importC12() {\n\treturn await import(pathToFileURL(realpathSync(createRequire(import.meta.url).resolve(\"c12\"))).href);\n}\n/**\n* Runs c12 against one config path. Every throw out of evaluation becomes a\n* `CONFIG.EVALUATION_FAILED` and a requested path c12 did not resolve to becomes\n* `CONFIG.FILE_NOT_FOUND`, so both loaders report the same failures for the\n* same file.\n*/\nasync function evaluateWithC12(configPath, cwd) {\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tlet result;\n\ttry {\n\t\tresult = await (await importC12()).loadConfig({\n\t\t\tname: \"prisma\",\n\t\t\t...ifDefined(\"configFile\", resolvedConfigPath),\n\t\t\tcwd: configCwd\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(toConfigLoadFailure(error, configPath));\n\t}\n\tif (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\treturn ok(result);\n}\nconst FILE_FORMAT_KEYS = /* @__PURE__ */ new Set([\"$prismaConfig\", \"extends\"]);\nfunction sectionsOf(exported) {\n\treturn Object.fromEntries(Object.entries(exported).filter(([key]) => !FILE_FORMAT_KEYS.has(key)));\n}\n/**\n* Evaluates `prisma.config.ts` and hands back each file on the chain with its\n* sections as written, plus c12's merge. Failures that prevent evaluation are\n* the Result failure. Nothing is validated or resolved here: the CLI engine\n* validates each section against its schema with the files' provenance, and\n* {@link loadConfig} does the same for the `orm` section outside a command run.\n*/\nasync function loadConfigFiles(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tconst evaluated = await evaluateWithC12(configPath, cwd);\n\tif (!evaluated.ok) return evaluated;\n\tconst result = evaluated.value;\n\tif (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst layers = result.layers ?? [];\n\tconst layerConfig = layers[0]?.config;\n\tconst engineMarker = isRecord(layerConfig) ? layerConfig[\"$prismaConfig\"] : void 0;\n\tif (engineMarker === void 0)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\tif (engineMarker !== 1)\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\t/* v8 ignore next -- @preserve */\n\tconst requested = result.configFile ?? join(configCwd, \"prisma.config.ts\");\n\tconst files = layers.flatMap((layer, index) => isRecord(layer.config) && Object.keys(layer.config).length > 0 ? [{\n\t\tpath: index === 0 ? requested : resolve(configCwd, layer.configFile ?? requested),\n\t\tsections: sectionsOf(layer.config)\n\t}] : []);\n\treturn ok({\n\t\tfiles: files.length === 0 ? [{\n\t\t\tpath: requested,\n\t\t\tsections: sectionsOf(result.config)\n\t\t}] : files,\n\t\tmerged: result.config\n\t});\n}\n/**\n* The raw default export of the module at `configPath`, evaluated exactly as\n* {@link loadConfig} evaluates it and returned without validation or the\n* version-marker check. The caller decides what the export means — a\n* default export without the `$prismaConfig` marker is what an earlier Prisma\n* CLI's config looks like.\n*/\nasync function evaluateConfigModule(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = resolve(cwd, configPath);\n\tif (!await fileExists(resolvedConfigPath)) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\tconst evaluated = await evaluateWithC12(resolvedConfigPath, cwd);\n\tif (!evaluated.ok) return evaluated;\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst [requestedLayer] = evaluated.value.layers ?? [];\n\treturn ok(requestedLayer?.config);\n}\n/** Which file wrote each top-level key of the `orm` section, nearest file first. */\nfunction ormProvenance(files, merged) {\n\tconst contributors = files.filter((file) => isRecord(file.sections[\"orm\"]));\n\tconst paths = contributors.map((file) => file.path);\n\treturn {\n\t\tfiles: paths,\n\t\tkeys: Object.fromEntries(Object.keys(merged).flatMap((key) => {\n\t\t\tconst file = contributors.find((contributor) => {\n\t\t\t\tconst orm = contributor.sections[\"orm\"];\n\t\t\t\treturn isRecord(orm) && Object.hasOwn(orm, key);\n\t\t\t})?.path ?? paths[0];\n\t\t\treturn file === void 0 ? [] : [[key, file]];\n\t\t}))\n\t};\n}\n/**\n* Loads the Prisma 8 config and validates its `orm` section.\n*\n* Failures that prevent evaluation entirely — missing file, module that does\n* not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the\n* `Result` failure. Structural problems inside an evaluated config do not\n* fail the load: they are returned as section-tagged diagnostics so commands\n* fail only on the sections they read (via {@link requireConfigSections}).\n*/\nasync function loadConfig(configPath, options) {\n\tconst loaded = await loadConfigFiles(configPath, options);\n\tif (!loaded.ok) return loaded;\n\tconst orm = loaded.value.merged[\"orm\"];\n\tif (orm !== void 0 && !isRecord(orm)) return ok({\n\t\tconfig: validateLoadedSection({}, {\n\t\t\tfiles: [],\n\t\t\tkeys: {}\n\t\t}).config,\n\t\tdiagnostics: [errorConfigValidation(\"orm\", { why: `The orm section of ${CONFIG_FILENAME} must be an object` })]\n\t});\n\tconst section = orm ?? {};\n\tconst provenance = ormProvenance(loaded.value.files, section);\n\tconst requested = loaded.value.files[0]?.path;\n\treturn ok(validateLoadedSection(section, provenance.files.length === 0 && requested !== void 0 ? {\n\t\tfiles: [requested],\n\t\tkeys: Object.fromEntries(Object.keys(section).map((key) => [key, requested]))\n\t} : provenance));\n}\n/**\n* Narrows a {@link LoadedConfig} to the sections a command reads. Fails with\n* the first diagnostic concerning a required section; diagnostics on other\n* sections are ignored so unrelated commands keep working.\n*/\nfunction requireConfigSections(loaded, sections) {\n\tconst blocking = loaded.diagnostics.find((diagnostic) => {\n\t\tconst section = diagnostic.meta?.[\"section\"];\n\t\treturn typeof section !== \"string\" || sections.some((required) => required === section);\n\t});\n\treturn blocking ? notOk(blocking) : ok(loaded.config);\n}\n/**\n* Convenience composition of {@link loadConfig} and\n* {@link requireConfigSections} for commands that read a fixed set of\n* sections and have no use for diagnostics outside them.\n*/\nasync function loadConfigForSections(configPath, sections) {\n\tconst loaded = await loadConfig(configPath);\n\tif (!loaded.ok) return loaded;\n\treturn requireConfigSections(loaded.value, sections);\n}\nasync function loadConfigForFile(filePath) {\n\tconst configPath = await findNearestConfigPathForFile(filePath);\n\tif (configPath === void 0) return notOk(errorConfigFileNotFound(join(dirname(resolve(process.cwd(), filePath)), CONFIG_FILENAME)));\n\treturn loadConfig(configPath);\n}\n//#endregion\nexport { CONFIG_FILENAME, ORM_CONFIG_SECTION_NAME, buildLoadedConfig, evaluateConfigModule, expandContractInputs, findNearestConfigPathForFile, globContractInputMatching, isConfigSection, loadConfig, loadConfigFiles, loadConfigForFile, loadConfigForSections, ormConfigSchema, ormConfigSection, requireConfigSections, validateOrmSection };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAM,gBAAgB;AACtB,SAAS,UAAU,OAAO;CACzB,OAAO,cAAc,KAAK,KAAK;AAChC;AACA,SAAS,eAAe,OAAO;CAC9B,OAAO,UAAU,KAAK,IAAI,QAAQ,QAAQ,KAAK;AAChD;;;;;;;;;AASA,SAAS,2BAA2B,SAAS;CAC5C,OAAO,QAAQ,aAAa,UAAU,QAAQ,WAAW,MAAM,GAAG,IAAI;AACvE;;;;;;AAMA,SAAS,cAAc,OAAO;CAC7B,IAAI,QAAQ,aAAa,WAAW,UAAU,KAAK,GAAG;CACtD,MAAM,YAAY,2BAA2B,KAAK;CAClD,OA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ializeObjectKey, O as serializeValue, T as serializeExecutionType, b as renderValueLiteralType, c as generateImportLines, f as generateModelsType, g as parameterizedOutputTypeFunctionsAlias, i as generateCodecTypeIntersection, k as emitterError, m as generateValueObjectTypeAliases, n as deduplicateImports, o as generateFieldTypeOverridesMap, p as generateRootsType, r as fieldTypesMapExpression, s as generateHashTypeAliases } from \"./domain-type-generation-BlYB8GiS.mjs\";\nimport { valueObjectsWithCoordinates } from \"@internal/contract/types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { UNBOUND_NAMESPACE_ID } from \"@internal/framework-components/ir\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { canonicalizeContractToObject } from \"@internal/contract/hashing\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { format } from \"prettier\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { UNBOUND_PSL_NAMESPACE_NAME } from \"@internal/framework-components/psl-ast\";\n//#region src/artifact-paths.ts\nconst JSON_EXTENSION = \".json\";\nfunction getEmittedArtifactPaths(outputJsonPath) {\n\tif (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError(\"CONFIG.VALIDATION_FAILED\", \"Contract output path must end with .json\", { meta: {\n\t\tfield: \"contract.output\",\n\t\toutputJsonPath\n\t} });\n\treturn {\n\t\tjsonPath: outputJsonPath,\n\t\tdtsPath: `${outputJsonPath.slice(0, -5)}.d.ts`\n\t};\n}\n//#endregion\n//#region src/model-types-emission.ts\nconst TYPESCRIPT_IDENTIFIER = /^[$A-Z_a-z][$\\w]*$/;\nfunction namespacedMemberName(namespaceId, modelName) {\n\treturn `${namespaceId === UNBOUND_NAMESPACE_ID ? UNBOUND_PSL_NAMESPACE_NAME : namespaceId}_${modelName}`;\n}\nfunction bareMemberName(_namespaceId, modelName) {\n\treturn modelName;\n}\nfunction claimMemberName(claims, memberName, source) {\n\tif (!TYPESCRIPT_IDENTIFIER.test(memberName)) throw emitterError(\"CONTRACT.MODEL_TYPE_NAME_INVALID\", `Emitted model type name \"${memberName}\" (from ${source}) is not a TypeScript identifier`, {\n\t\twhy: \"Every entry in the emitted Models namespace is declared as `export type <name>`, so the name must be a TypeScript identifier.\",\n\t\tfix: \"Rename the namespace or model so that <namespace>_<Model> contains only letters, digits, `$`, and `_`, and does not start with a digit.\",\n\t\tmeta: {\n\t\t\tmemberName,\n\t\t\tsource\n\t\t}\n\t});\n\tconst existing = claims.get(memberName);\n\tif (existing !== void 0) throw emitterError(\"CONTRACT.MODEL_TYPE_NAME_COLLISION\", `Emitted model type name \"${memberName}\" is produced by both ${existing} and ${source}`, {\n\t\twhy: \"Every entry in the emitted Models namespace needs a distinct name, formed as <namespace>_<Model>.\",\n\t\tfix: \"Rename one of the models or namespaces so the two names differ.\",\n\t\tmeta: {\n\t\t\tmemberName,\n\t\t\tsources: [existing, source]\n\t\t}\n\t});\n\tclaims.set(memberName, source);\n}\nfunction isPolymorphicBase(model) {\n\treturn model.discriminator !== void 0 && model.variants !== void 0;\n}\nfunction findModel(namespaces, ref) {\n\treturn namespaces.find((ns) => ns.namespaceId === ref.namespace)?.models.find((m) => m.modelName === ref.model);\n}\nfunction requireRelationTarget(namespaces, owner, relationName, ref) {\n\tconst target = findModel(namespaces, ref);\n\tif (target !== void 0) return target;\n\tconst ownerSource = `${owner.namespaceId}.${owner.modelName}`;\n\tthrow emitterError(\"CONTRACT.MODEL_RELATION_TARGET_MISSING\", `Relation \"${relationName}\" on ${ownerSource} targets ${ref.namespace}.${ref.model}, which is not in the contract`, {\n\t\twhy: \"A same-space relation must point at a model the contract declares; only cross-space relations may reference models outside it.\",\n\t\tfix: \"Declare the target model in the contract, or mark the relation as cross-space by giving its target a `space`.\",\n\t\tmeta: {\n\t\t\towner: ownerSource,\n\t\t\trelationName,\n\t\t\ttarget: {\n\t\t\t\tnamespaceId: ref.namespace,\n\t\t\t\tmodelName: ref.model\n\t\t\t}\n\t\t}\n\t});\n}\nfunction requireBase(namespaces, variant, base) {\n\tconst found = findModel(namespaces, base);\n\tif (found !== void 0) return found;\n\tconst variantSource = `${variant.namespaceId}.${variant.modelName}`;\n\tconst baseSource = `${base.namespace}.${base.model}`;\n\tthrow emitterError(\"CONTRACT.MODEL_BASE_MISSING\", `Model ${variantSource} names base ${baseSource}, which is not in the contract`, {\n\t\twhy: \"A variant's type is its base's fields plus its own, so the base must be a model the contract declares.\",\n\t\tfix: \"Declare the base model in the contract, or remove `base` from the variant.\",\n\t\tmeta: {\n\t\t\tvariant: variantSource,\n\t\t\tbase: baseSource\n\t\t}\n\t});\n}\nfunction requireVariant(namespaces, base, variantRef) {\n\tconst variant = findModel(namespaces, variantRef);\n\tif (variant !== void 0) return variant;\n\tconst baseSource = `${base.namespaceId}.${base.modelName}`;\n\tconst variantSource = `${variantRef.namespace}.${variantRef.model}`;\n\tthrow emitterError(\"CONTRACT.MODEL_VARIANT_MISSING\", `Polymorphic base ${baseSource} names variant ${variantSource}, which is not in the contract`, {\n\t\twhy: \"The Any<Base> union is the union of the variant model types, so every variant a base declares must be a model in the contract.\",\n\t\tfix: \"Declare the variant model, or remove it from the base's variants.\",\n\t\tmeta: {\n\t\t\tbase: baseSource,\n\t\t\tvariant: variantSource\n\t\t}\n\t});\n}\nfunction collectFieldLines(ref, discriminatorType) {\n\tconst lines = /* @__PURE__ */ new Map();\n\tfor (const fieldName of Object.keys(ref.model.fields)) {\n\t\tconst type = discriminatorType !== void 0 && fieldName === discriminatorType.field ? discriminatorType.type : `FieldOutputTypes[${serializeValue(ref.namespaceId)}][${serializeValue(ref.modelName)}][${serializeValue(fieldName)}]`;\n\t\tlines.set(fieldName, `${serializeObjectKey(fieldName)}: ${type};`);\n\t}\n\treturn lines;\n}\nfunction hasJoin(relation) {\n\treturn \"on\" in relation && relation.on !== void 0;\n}\nfunction relationLine(owner, relationName, relation, index) {\n\tif (relation.to.space !== void 0) return void 0;\n\tconst target = requireRelationTarget(index.namespaces, owner, relationName, relation.to);\n\tconst targetMember = index.memberNameOf(target.namespaceId, isPolymorphicBase(target.model) ? `Any${target.modelName}` : target.modelName);\n\tconst key = serializeObjectKey(relationName);\n\tif (!hasJoin(relation)) return {\n\t\tline: `${key}: ${relation.cardinality === \"1:N\" ? `${targetMember}[]` : targetMember};`,\n\t\thasJoin: false\n\t};\n\tif (relation.cardinality === \"1:N\" || relation.cardinality === \"N:M\") return {\n\t\tline: `${key}: ${targetMember}[];`,\n\t\thasJoin: true\n\t};\n\treturn {\n\t\tline: `${key}: ${relation.nullable ? `${targetMember} | null` : targetMember};`,\n\t\thasJoin: true\n\t};\n}\nfunction collectRelationLines(ref, index) {\n\tconst lines = /* @__PURE__ */ new Map();\n\tfor (const [relationName, relation] of Object.entries(ref.model.relations)) {\n\t\tconst rendered = relationLine(ref, relationName, relation, index);\n\t\tif (rendered !== void 0) lines.set(relationName, rendered);\n\t}\n\treturn lines;\n}\nfunction discriminatorUnion(base) {\n\tconst values = Object.keys(base.variants ?? {}).map((value) => serializeValue(value));\n\treturn values.length > 0 ? values.join(\" | \") : \"never\";\n}\nfunction memberLines(ref, index) {\n\tconst base = ref.model.base !== void 0 ? requireBase(index.namespaces, ref, ref.model.base) : void 0;\n\tif (base !== void 0 && isPolymorphicBase(base.model)) {\n\t\tconst discriminatorField = base.model.discriminator?.field ?? \"\";\n\t\tconst variantValue = Object.entries(base.model.variants ?? {}).find(([, variant]) => variant.namespace === ref.namespaceId && variant.model === ref.modelName)?.[0];\n\t\tconst discriminatorType = {\n\t\t\tfield: discriminatorField,\n\t\t\ttype: variantValue !== void 0 ? serializeValue(variantValue) : discriminatorUnion(base.model)\n\t\t};\n\t\treturn {\n\t\t\tfieldsByName: new Map([...collectFieldLines(base, discriminatorType), ...collectFieldLines(ref, void 0)]),\n\t\t\trelationsByName: new Map([...collectRelationLines(base, index), ...collectRelationLines(ref, index)])\n\t\t};\n\t}\n\treturn {\n\t\tfieldsByName: collectFieldLines(ref, isPolymorphicBase(ref.model) ? {\n\t\t\tfield: ref.model.discriminator?.field ?? \"\",\n\t\t\ttype: discriminatorUnion(ref.model)\n\t\t} : void 0),\n\t\trelationsByName: collectRelationLines(ref, index)\n\t};\n}\nfunction renderMember(memberName, lines, hasOwner) {\n\tconst entries = [...lines.relationsByName];\n\tconst joinlessLines = entries.filter(([, r]) => !r.hasJoin).map(([, r]) => r.line);\n\tconst joinedLines = entries.filter(([, r]) => r.hasJoin).map(([, r]) => r.line);\n\tconst relationNames = entries.filter(([, r]) => r.hasJoin).map(([name]) => name);\n\tconst phantom = relationNames.length > 0 ? relationNames.map((name) => serializeValue(name)).join(\" | \") : \"never\";\n\treturn ` export type ${memberName} = {\\n${[\n\t\t...lines.fieldsByName.values(),\n\t\t...joinlessLines,\n\t\t...joinedLines,\n\t\t...hasOwner ? [] : [`readonly [RelationKeys]?: ${phantom};`]\n\t].map((line) => ` ${line}`).join(\"\\n\")}\\n };`;\n}\nfunction namespaceModelsOf(contract) {\n\treturn Object.entries(contract.domain.namespaces).map(([namespaceId, ns]) => ({\n\t\tnamespaceId,\n\t\tmodels: Object.entries(ns.models).map(([modelName, model]) => ({\n\t\t\tnamespaceId,\n\t\t\tmodelName,\n\t\t\tmodel\n\t\t}))\n\t}));\n}\nfunction generateModelTypesBlock(contract, supportsNamespaces) {\n\tconst memberNameOf = supportsNamespaces ? namespacedMemberName : bareMemberName;\n\tconst namespaces = namespaceModelsOf(contract);\n\tconst index = {\n\t\tnamespaces,\n\t\tmemberNameOf\n\t};\n\tconst claims = /* @__PURE__ */ new Map();\n\tfor (const ns of namespaces) for (const ref of ns.models) claimMemberName(claims, memberNameOf(ns.namespaceId, ref.modelName), `${ns.namespaceId}.${ref.modelName}`);\n\tfor (const ns of namespaces) for (const ref of ns.models) {\n\t\tif (!isPolymorphicBase(ref.model)) continue;\n\t\tclaimMemberName(claims, memberNameOf(ns.namespaceId, `Any${ref.modelName}`), `${ns.namespaceId}.Any<${ref.modelName}>`);\n\t}\n\tconst members = [];\n\tconst constantEntries = [];\n\tfor (const ns of namespaces) {\n\t\tconst keys = [];\n\t\tfor (const ref of ns.models) {\n\t\t\tconst memberName = memberNameOf(ns.namespaceId, ref.modelName);\n\t\t\tmembers.push(renderMember(memberName, memberLines(ref, index), ref.model.owner !== void 0));\n\t\t\tkeys.push(`${serializeObjectKey(ref.modelName)}: Models.${memberName};`);\n\t\t}\n\t\tfor (const ref of ns.models) {\n\t\t\tif (!isPolymorphicBase(ref.model)) continue;\n\t\t\tconst unionName = memberNameOf(ns.namespaceId, `Any${ref.modelName}`);\n\t\t\tconst variantMembers = Object.values(ref.model.variants ?? {}).map((variantRef) => {\n\t\t\t\tconst variant = requireVariant(namespaces, ref, variantRef);\n\t\t\t\treturn memberNameOf(variant.namespaceId, variant.modelName);\n\t\t\t});\n\t\t\tmembers.push(` export type ${unionName} = ${variantMembers.length > 0 ? variantMembers.join(\" | \") : \"never\"};`);\n\t\t\tkeys.push(`${serializeObjectKey(`Any${ref.modelName}`)}: Models.${unionName};`);\n\t\t}\n\t\tif (!supportsNamespaces) {\n\t\t\tconstantEntries.push(...keys.map((key) => ` ${key}`));\n\t\t\tcontinue;\n\t\t}\n\t\tconst nsKey = serializeObjectKey(ns.namespaceId);\n\t\tconst nested = keys.map((key) => ` ${key}`).join(\"\\n\");\n\t\tconstantEntries.push(keys.length > 0 ? ` ${nsKey}: {\\n${nested}\\n };` : ` ${nsKey}: {};`);\n\t}\n\treturn `${members.length > 0 ? `export namespace Models {\\n${members.join(\"\\n\")}\\n}` : \"export namespace Models {}\"}\\n\\n${`export declare const models: {\\n${constantEntries.join(\"\\n\")}\\n};`}`;\n}\n//#endregion\n//#region src/generate-contract-dts.ts\nfunction generateEnumBlockType(enums) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst membersType = `readonly [${entry.members.map((m) => `{ readonly name: ${serializeValue(m.name)}; readonly value: ${serializeValue(m.value)} }`).join(\", \")}]`;\n\t\treturn `readonly ${serializeObjectKey(name)}: { readonly codecId: ${serializeValue(entry.codecId)}; readonly members: ${membersType} }`;\n\t}).join(\"; \")} }`;\n}\n/**\n* Types each enum member as the value a query returns for it: the literal its codec renders for the stored form, or the codec's output type when the codec renders none.\n*/\nfunction generateEnumMemberTypesBlock(enums, codecLookup) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst memberTupleItems = entry.members.map((m) => {\n\t\t\tconst valueType = renderValueLiteralType(m.value, entry.codecId, \"output\", codecLookup) ?? `CodecTypes[${serializeValue(entry.codecId)}][\"output\"]`;\n\t\t\treturn `{ readonly name: ${serializeValue(m.name)}; readonly value: ${valueType} }`;\n\t\t});\n\t\treturn `readonly ${serializeObjectKey(name)}: readonly [${memberTupleItems.join(\", \")}]`;\n\t}).join(\"; \")} }`;\n}\nfunction generateContractDts(contract, emitter, codecTypeImports, hashes, options, codecLookup, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst allImports = [...codecTypeImports];\n\tif (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);\n\tif (options?.parameterizedOutputTypeImports) allImports.push(...options.parameterizedOutputTypeImports);\n\tconst uniqueImports = deduplicateImports(allImports);\n\tconst familyImportLines = emitter.getFamilyImports(resolveImportSpecifier);\n\tconst hashAliases = generateHashTypeAliases(hashes);\n\tconst codecTypes = generateCodecTypeIntersection(codecTypeImports, \"CodecTypes\");\n\tconst familyTypeAliases = emitter.getFamilyTypeAliases(options);\n\tconst typeMapsExpr = emitter.getTypeMapsExpression();\n\tconst storageType = emitter.generateStorageType(contract, \"StorageHash\");\n\tconst namespaceEntries = Object.entries(contract.domain.namespaces);\n\tif (namespaceEntries.length === 0) throw emitterError(\"CONTRACT.NAMESPACE_INVALID\", \"domain has no namespaces\", { meta: { reason: \"no-domain-namespaces\" } });\n\tfor (const [nsId, ns] of namespaceEntries) if (ns === void 0) throw new InternalError(`domain namespace \"${nsId}\" is not present on the contract`);\n\tconst rootsType = generateRootsType(contract.roots);\n\tconst firstNamespaceOfValueObject = /* @__PURE__ */ new Map();\n\tfor (const { coordinate: { namespaceId, entityName: name } } of valueObjectsWithCoordinates(contract.storage)) if (!firstNamespaceOfValueObject.has(name)) firstNamespaceOfValueObject.set(name, namespaceId);\n\tconst valueObjectNamespaces = [...firstNamespaceOfValueObject];\n\tconst hasValueObjects = valueObjectNamespaces.length > 0;\n\tconst valueObjectTypeAliases = generateValueObjectTypeAliases(valueObjectNamespaces);\n\tconst domainNamespacesType = namespaceEntries.map(([nsId, ns]) => {\n\t\tconst nsModels = ns.models;\n\t\tconst nsModelsType = generateModelsType(nsModels, (name, model) => emitter.generateModelStorageType(name, model));\n\t\tconst nsEnums = blindCast(ns.enum);\n\t\tconst hasEnums = nsEnums !== void 0 && Object.keys(nsEnums).length > 0;\n\t\treturn [\n\t\t\tnsId,\n\t\t\tnsModelsType,\n\t\t\thasEnums ? generateEnumBlockType(nsEnums) : void 0,\n\t\t\thasEnums ? generateEnumMemberTypesBlock(nsEnums, codecLookup) : void 0\n\t\t];\n\t}).map(([nsId, nsModelsType, nsEnumBlock, nsEnumMemberTypesBlock]) => {\n\t\tconst enumLine = nsEnumBlock !== void 0 ? `\\n readonly enum: ${nsEnumBlock};` : \"\";\n\t\tconst enumMemberTypesLine = nsEnumMemberTypesBlock !== void 0 ? `\\n readonly enumMemberTypes?: ${nsEnumMemberTypesBlock};` : \"\";\n\t\treturn ` readonly ${serializeObjectKey(nsId)}: {\\n readonly models: ${nsModelsType};${enumLine}${enumMemberTypesLine}\\n }`;\n\t}).join(\";\\n\");\n\tconst executionClause = contract.execution !== void 0 ? `\\n readonly execution: ${serializeExecutionType(contract.execution)};` : \"\";\n\tconst fieldTypeOverrides = generateFieldTypeOverridesMap(contract, codecLookup, emitter.resolveStorageValueSet ? (modelName, fieldName, model) => emitter.resolveStorageValueSet?.(modelName, fieldName, model, contract) : void 0);\n\tconst extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);\n\tconst contractWrapper = emitter.getContractWrapper(\"ContractBase\", \"TypeMaps\");\n\tconst modelTypesBlock = generateModelTypesBlock(contract, options?.supportsNamespaces ?? true);\n\tconst body = `${hashAliases}\n\nexport type CodecTypes = ${codecTypes};\n${familyTypeAliases}\n${parameterizedOutputTypeFunctionsAlias(options?.parameterizedOutputTypeImports ?? [])}\n${valueObjectTypeAliases}\ntype FieldTypeOverrides = ${fieldTypeOverrides};\nexport type FieldOutputTypes = ${fieldTypesMapExpression(\"output\")};\nexport type FieldInputTypes = ${fieldTypesMapExpression(\"input\")};\n${extraTypeExports ? `${extraTypeExports}\\n` : \"\"}\n${modelTypesBlock}\n\nexport type TypeMaps = ${typeMapsExpr};\n\ntype ContractBase = Omit<\n ContractType<${storageType}>,\n 'roots' | 'domain'\n> & {\n readonly target: ${serializeValue(contract.target)};\n readonly targetFamily: ${serializeValue(contract.targetFamily)};\n readonly roots: ${rootsType};\n readonly domain: {\n readonly namespaces: {\n${domainNamespacesType};\n };\n };\n readonly capabilities: ${serializeValue(contract.capabilities)};\n readonly extensions: ${serializeValue(contract.extensions)};${executionClause}\n readonly meta: ${serializeValue(contract.meta)};\n readonly profileHash: ProfileHash;\n};\n\n${contractWrapper}\n`;\n\treturn `// ⚠️ GENERATED FILE - DO NOT EDIT\n// This file is automatically generated by 'prisma contract emit'.\n// To regenerate, run: prisma contract emit\n${generateImportLines(uniqueImports.filter((spec) => mentions(body, spec.alias)), resolveImportSpecifier).join(\"\\n\")}\n\n${familyImportLines.join(\"\\n\")}\nimport type {\n Contract as ContractType,\n ExecutionHashBase,\n FieldTypesFromDomain,\n NamespaceId,\n ProfileHashBase,\n StorageHashBase,${hasValueObjects ? \"\\n ValueObjectTypesFromStorage,\" : \"\"}\n} from '${resolveImportSpecifier(\"@internal/contract/types\")}';\n\n${body}`;\n}\n/** Whether `text` uses `identifier` as a whole identifier, not as part of a longer one. */\nfunction mentions(text, identifier) {\n\tconst escaped = identifier.replace(/[$]/g, \"\\\\$\");\n\treturn new RegExp(`(?<![\\\\w$])${escaped}(?![\\\\w$])`).test(text);\n}\n//#endregion\n//#region src/require-relation-nullability.ts\n/**\n* The emitter only ever consumes a freshly authored contract, so every same-space to-one relation\n* must already state whether it is nullable. Hydration of an on-disk contract derives a missing\n* flag instead; that path never reaches here.\n*/\nfunction requireToOneRelationNullability(contract) {\n\tfor (const [namespaceId, namespace] of Object.entries(contract.domain.namespaces)) for (const [modelName, model] of Object.entries(namespace.models)) for (const [relationName, relation] of Object.entries(model.relations ?? {})) {\n\t\tif (!(\"on\" in relation && (relation.cardinality === \"1:1\" || relation.cardinality === \"N:1\") && relation.to.space === void 0) || typeof relation.nullable === \"boolean\") continue;\n\t\tthrow emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relationName}\" on model \"${namespaceId}:${modelName}\" is a ${relation.cardinality} relation and must carry a boolean \"nullable\"`, {\n\t\t\twhy: \"contract.d.ts types a to-one relation as nullable or required from this flag, and the authoring surfaces always set it.\",\n\t\t\tfix: \"Author the contract through PSL or the contract builder, which derive the flag from the local fields the relation joins on.\",\n\t\t\tmeta: {\n\t\t\t\tmodelName,\n\t\t\t\trelationName,\n\t\t\t\treason: \"to-one-nullability-missing\"\n\t\t\t}\n\t\t});\n\t}\n}\n//#endregion\n//#region src/emit.ts\nconst SCHEMA_VERSION = \"1\";\nasync function emit(contract, stack, targetFamily, options) {\n\tif (options.outputJsonPath !== void 0) getEmittedArtifactPaths(options.outputJsonPath);\n\trequireToOneRelationNullability(contract);\n\tconst { codecTypeImports, queryOperationTypeImports, parameterizedOutputTypeImports, aggregateDescriptors, codecDescriptors } = stack;\n\tconst { storageHash } = contract.storage;\n\tconst executionHash = contract.execution?.executionHash;\n\tconst { profileHash } = contract;\n\tconst canonicalized = canonicalizeContractToObject(contract, {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: options.serializeContract,\n\t\t...ifDefined(\"shouldPreserveEmpty\", options.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", options.sortStorage)\n\t});\n\tconst contractJsonString = JSON.stringify({\n\t\t...canonicalized,\n\t\t_generated: {\n\t\t\twarning: \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\tmessage: \"This file is automatically generated by \\\"prisma contract emit\\\".\",\n\t\t\tregenerate: \"To regenerate, run: prisma contract emit\"\n\t\t}\n\t}, null, 2);\n\tconst generateOptions = {\n\t\t...ifDefined(\"queryOperationTypeImports\", queryOperationTypeImports),\n\t\t...ifDefined(\"parameterizedOutputTypeImports\", parameterizedOutputTypeImports),\n\t\t...ifDefined(\"aggregateDescriptors\", aggregateDescriptors),\n\t\t...ifDefined(\"codecDescriptors\", codecDescriptors),\n\t\t...ifDefined(\"supportsNamespaces\", options.supportsNamespaces)\n\t};\n\tconst contractTypeHashes = {\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n\treturn {\n\t\tcontractJson: contractJsonString,\n\t\tcontractDts: await format(generateContractDts(options.deserializeContract(canonicalized), targetFamily, codecTypeImports ?? [], contractTypeHashes, generateOptions, stack.codecLookup, options.resolveImportSpecifier ?? keepInternalSpecifiers), {\n\t\t\tparser: \"typescript\",\n\t\t\tsingleQuote: true,\n\t\t\tsemi: true,\n\t\t\tprintWidth: 100\n\t\t}),\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n}\n//#endregion\nexport { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };\n\n//# sourceMappingURL=exports-CVgs3YWV.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,iBAAiB;AACvB,SAAS,wBAAwB,gBAAgB;CAChD,IAAI,CAAC,eAAe,SAAS,cAAc,GAAG,MAAM,aAAa,4BAA4B,4CAA4C,EAAE,MAAM;EAChJ,OAAO;EACP;CACD,EAAE,CAAC;CACH,OAAO;EACN,UAAU;EACV,SAAS,GAAG,eAAe,MAAM,GAAG,EAAE,EAAE;CACzC;AACD;AAGA,MAAM,wBAAwB;AAC9B,SAAS,qBAAqB,aAAa,WAAW;CACrD,OAAO,GAAG,gBAAgB,uBAAuB,6BAA6B,YAAY,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AiB,aAAa;EAC3C;CACD;CACA,OAAO;EACN,cAAc;EACd,aAAa,MAAM,OAAO,oBAAoB,QAAQ,oBAAoB,aAAa,GAAG,cAAc,oBAAoB,CAAC,GAAG,oBAAoB,iBAAiB,MAAM,aAAa,QAAQ,0BAA0B,sBAAsB,GAAG;GAClP,QAAQ;GACR,aAAa;GACb,MAAM;GACN,YAAY;EACb,CAAC;EACD;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;AACD"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { r as ShellName, t as ShellDefinition } from "./shells-D7NNxMLT.mjs";
|
|
2
|
-
//#region ../../../0-shared/publish-surface/dist/import-roots.d.mts
|
|
3
|
-
//#region src/import-roots.d.ts
|
|
4
|
-
/** An import root that emitted code cannot express. */
|
|
5
|
-
declare class ImportRootError extends Error {}
|
|
6
|
-
type ImportRootMode = 'internal' | 'facade' | 'platform';
|
|
7
|
-
/**
|
|
8
|
-
* The published packages an application depends on directly, from emission's
|
|
9
|
-
* point of view.
|
|
10
|
-
*
|
|
11
|
-
* - `internal` — the repo's own workspace names. Emitted output is unchanged
|
|
12
|
-
* from before ADR 242; this is the default and stays so until every in-repo
|
|
13
|
-
* consumer imports published names.
|
|
14
|
-
* - `facade` — the application installed one `@prisma/orm-<database>` package.
|
|
15
|
-
* - `platform` — a decomposed install that wires the platform packages itself.
|
|
16
|
-
*/
|
|
17
|
-
type ImportRoot = {
|
|
18
|
-
readonly mode: 'internal';
|
|
19
|
-
} | {
|
|
20
|
-
readonly mode: 'facade';
|
|
21
|
-
readonly facade: ShellName;
|
|
22
|
-
} | {
|
|
23
|
-
readonly mode: 'platform';
|
|
24
|
-
};
|
|
25
|
-
declare const internalImportRoot: Extract<ImportRoot, {
|
|
26
|
-
mode: 'internal';
|
|
27
|
-
}>;
|
|
28
|
-
/**
|
|
29
|
-
* Rewrites one module specifier for an import root. Specifiers outside the
|
|
30
|
-
* internal scope — relative paths, `node:` builtins, third-party packages —
|
|
31
|
-
* come back unchanged.
|
|
32
|
-
*/
|
|
33
|
-
type ImportSpecifierResolver = (specifier: string) => string;
|
|
34
|
-
/**
|
|
35
|
-
* The import root an application's own dependency list expresses.
|
|
36
|
-
*
|
|
37
|
-
* Emission has to name packages the application can actually resolve, and the
|
|
38
|
-
* application already states which those are. Reading its manifest keeps the
|
|
39
|
-
* two from drifting and lets consumers move to published names one project at
|
|
40
|
-
* a time instead of behind a repository-wide switch.
|
|
41
|
-
*
|
|
42
|
-
* A project that names exactly one facade is on the facade root; one that
|
|
43
|
-
* names platform shells without a facade is a decomposed install; anything
|
|
44
|
-
* else — including a project with no `@prisma/orm-*` dependency at all — is on
|
|
45
|
-
* the internal root, which emits workspace names unchanged.
|
|
46
|
-
*
|
|
47
|
-
* @throws {ImportRootError} when the project depends on two facades, which no
|
|
48
|
-
* single generated file can be emitted for.
|
|
49
|
-
*/
|
|
50
|
-
declare function importRootForDependencies(dependencies: Iterable<string>): ImportRoot;
|
|
51
|
-
interface OwningShell {
|
|
52
|
-
readonly shell: ShellName;
|
|
53
|
-
readonly entry: string;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Takes the shell map as an argument rather than closing over `publicShells`
|
|
57
|
-
* so the duplicate-owner guard is reachable from a test: the real map is
|
|
58
|
-
* valid by construction, and a guard nothing can exercise is a guard nobody
|
|
59
|
-
* knows still works.
|
|
60
|
-
*/
|
|
61
|
-
declare function buildOwnerIndex(shells: ReadonlyMap<ShellName, ShellDefinition>): Map<string, OwningShell>;
|
|
62
|
-
/**
|
|
63
|
-
* The shells an application installs directly under this root. Emitted code
|
|
64
|
-
* may name only these: a package manager puts a package's own dependencies in
|
|
65
|
-
* its own `node_modules`, so importing a transitively installed package fails
|
|
66
|
-
* to resolve at run time even though the files are on disk.
|
|
67
|
-
*/
|
|
68
|
-
declare function directDependencyShells(root: ImportRoot): ReadonlySet<ShellName>;
|
|
69
|
-
/**
|
|
70
|
-
* The platform-install name for an internal specifier, with the shell that
|
|
71
|
-
* owns it. The shell build needs both: an import that stays inside the shell
|
|
72
|
-
* being built is bundled rather than externalized.
|
|
73
|
-
*/
|
|
74
|
-
declare function platformEntrypointOf(specifier: string): {
|
|
75
|
-
shell: ShellName;
|
|
76
|
-
id: string;
|
|
77
|
-
};
|
|
78
|
-
declare function resolveImportSpecifier(specifier: string, root: ImportRoot): string;
|
|
79
|
-
declare function createImportSpecifierResolver(root: ImportRoot): ImportSpecifierResolver;
|
|
80
|
-
/**
|
|
81
|
-
* The import roots a scaffolded application can be generated against.
|
|
82
|
-
*
|
|
83
|
-
* `platform` is absent deliberately, and this is a modelling statement rather
|
|
84
|
-
* than a limitation to be lifted: `prisma orm init` writes an application
|
|
85
|
-
* around a per-database facade, and that facade's `runtime` entrypoint is its
|
|
86
|
-
* own wiring code, not a re-export of anything. A decomposed install has no
|
|
87
|
-
* name for it because it has no such module — it wires the platform packages
|
|
88
|
-
* itself. Scaffolding a decomposed project is a different template, not a
|
|
89
|
-
* different import root.
|
|
90
|
-
*/
|
|
91
|
-
type ScaffoldImportRoot = Extract<ImportRoot, {
|
|
92
|
-
mode: 'internal' | 'facade';
|
|
93
|
-
}>;
|
|
94
|
-
/**
|
|
95
|
-
* Builds the resolver `prisma orm init` scaffolds with. Identical to
|
|
96
|
-
* {@link createImportSpecifierResolver} except that it will not accept a root
|
|
97
|
-
* a scaffold cannot express, so the impossible case is rejected where the
|
|
98
|
-
* resolver is made rather than when a template happens to hit a name.
|
|
99
|
-
*/
|
|
100
|
-
declare function createScaffoldSpecifierResolver(root: ScaffoldImportRoot): ImportSpecifierResolver;
|
|
101
|
-
/** The module specifiers a generated source file names. */
|
|
102
|
-
declare function importedSpecifiers(source: string): string[];
|
|
103
|
-
/**
|
|
104
|
-
* The specifiers in a generated file that the application would not have as a
|
|
105
|
-
* direct dependency under `root` — the thing no emitted file may contain.
|
|
106
|
-
*
|
|
107
|
-
* Under the `internal` root nothing is reported: those names are the
|
|
108
|
-
* repository's own, and every in-repo consumer resolves them through the
|
|
109
|
-
* workspace.
|
|
110
|
-
*
|
|
111
|
-
* Throws rather than returning `[]` when the source plainly has imports but
|
|
112
|
-
* the scan found none. An audit whose scanner has stopped matching would
|
|
113
|
-
* otherwise report every file as clean, which is the one failure mode that
|
|
114
|
-
* makes the audit worse than not having it.
|
|
115
|
-
*/
|
|
116
|
-
declare function transitiveImports(source: string, root: ImportRoot): string[];
|
|
117
|
-
//#endregion
|
|
118
|
-
export { ScaffoldImportRoot as a, createScaffoldSpecifierResolver as c, importedSpecifiers as d, internalImportRoot as f, transitiveImports as h, ImportSpecifierResolver as i, directDependencyShells as l, resolveImportSpecifier as m, ImportRootError as n, buildOwnerIndex as o, platformEntrypointOf as p, ImportRootMode as r, createImportSpecifierResolver as s, ImportRoot as t, importRootForDependencies as u };
|
|
119
|
-
//# sourceMappingURL=import-roots-DlSoi7oS.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import-roots-DlSoi7oS.d.mts","names":[],"sources":["../../../../0-shared/publish-surface/dist/import-roots.d.mts"],"mappings":";;;;cAGc,wBAAwB;KACjC;;;;;;;;;;;KAWA;WACM;;WAEA;WACA,QAAQ;;WAER;;cAEG,oBAAoB,QAAQ;EACxC;;;;;;;KAOG,2BAA2B;;;;;;;;;;;;;;;;;iBAiBf,0BAA0B,cAAc,mBAAmB;UAClE;WACC,OAAO;WACP;;;;;;;;iBAQM,gBAAgB,QAAQ,YAAY,WAAW,mBAAmB,YAAY;;;;;;;iBAO9E,uBAAuB,MAAM,aAAa,YAAY;;;;;;iBAMtD,qBAAqB;EACpC,OAAO;EACP;;iBAEe,uBAAuB,mBAAmB,MAAM;iBAChD,8BAA8B,MAAM,aAAa;;;;;;;;;;;;KAY7D,qBAAqB,QAAQ;EAChC;;;;;;;;iBAQe,gCAAgC,MAAM,qBAAqB;;iBAE3D,mBAAmB;;;;;;;;;;;;;;iBAcnB,kBAAkB,gBAAgB,MAAM"}
|