@prisma-next/cli 0.12.0-dev.9 → 0.13.0-dev.1
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 +2 -2
- package/dist/cli.mjs +180 -163
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-KgJorIvG.mjs → client-CJzuo5wX.mjs} +222 -107
- package/dist/client-CJzuo5wX.mjs.map +1 -0
- package/dist/{command-helpers-Bbw1GbwL.mjs → command-helpers-DGMvGBeX.mjs} +318 -25
- package/dist/command-helpers-DGMvGBeX.mjs.map +1 -0
- package/dist/commands/contract-emit.d.mts.map +1 -1
- package/dist/commands/contract-emit.mjs +1 -1
- package/dist/commands/contract-infer.d.mts.map +1 -1
- package/dist/commands/contract-infer.mjs +1 -1
- package/dist/commands/db-init.d.mts.map +1 -1
- package/dist/commands/db-init.mjs +4 -5
- package/dist/commands/db-init.mjs.map +1 -1
- package/dist/commands/db-schema.d.mts.map +1 -1
- package/dist/commands/db-schema.mjs +3 -3
- package/dist/commands/db-schema.mjs.map +1 -1
- package/dist/commands/db-sign.d.mts.map +1 -1
- package/dist/commands/db-sign.mjs +6 -6
- package/dist/commands/db-sign.mjs.map +1 -1
- package/dist/commands/db-update.d.mts.map +1 -1
- package/dist/commands/db-update.mjs +10 -7
- package/dist/commands/db-update.mjs.map +1 -1
- package/dist/commands/db-verify.d.mts.map +1 -1
- package/dist/commands/db-verify.mjs +1 -1
- package/dist/commands/migrate.d.mts +37 -3
- package/dist/commands/migrate.d.mts.map +1 -1
- package/dist/commands/migrate.mjs +298 -12
- package/dist/commands/migrate.mjs.map +1 -1
- package/dist/commands/migration-check.d.mts +55 -13
- package/dist/commands/migration-check.d.mts.map +1 -1
- package/dist/commands/migration-check.mjs +3 -2
- package/dist/commands/migration-graph.d.mts +16 -25
- package/dist/commands/migration-graph.d.mts.map +1 -1
- package/dist/commands/migration-graph.mjs +185 -2
- package/dist/commands/migration-graph.mjs.map +1 -0
- package/dist/commands/migration-list.d.mts +26 -27
- package/dist/commands/migration-list.d.mts.map +1 -1
- package/dist/commands/migration-list.mjs +2 -190
- package/dist/commands/migration-log.d.mts +9 -19
- package/dist/commands/migration-log.d.mts.map +1 -1
- package/dist/commands/migration-log.mjs +1 -137
- package/dist/commands/migration-new.d.mts.map +1 -1
- package/dist/commands/migration-new.mjs +6 -5
- package/dist/commands/migration-new.mjs.map +1 -1
- package/dist/commands/migration-plan.d.mts +1 -1
- package/dist/commands/migration-plan.d.mts.map +1 -1
- package/dist/commands/migration-plan.mjs +1 -1
- package/dist/commands/migration-show.d.mts +17 -21
- package/dist/commands/migration-show.d.mts.map +1 -1
- package/dist/commands/migration-show.mjs +24 -36
- package/dist/commands/migration-show.mjs.map +1 -1
- package/dist/commands/migration-status.d.mts +42 -144
- package/dist/commands/migration-status.d.mts.map +1 -1
- package/dist/commands/migration-status.mjs +3 -759
- package/dist/commands/ref.d.mts +1 -1
- package/dist/commands/ref.d.mts.map +1 -1
- package/dist/commands/ref.mjs +4 -4
- package/dist/commands/ref.mjs.map +1 -1
- package/dist/commands/telemetry/index.d.mts +7 -0
- package/dist/commands/telemetry/index.d.mts.map +1 -0
- package/dist/commands/telemetry/index.mjs +2 -0
- package/dist/{config-loader-B6sJjXTv.mjs → config-loader-p9JMrekQ.mjs} +1 -1
- package/dist/{config-loader-B6sJjXTv.mjs.map → config-loader-p9JMrekQ.mjs.map} +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{contract-at-errors-BxP-TOMl.mjs → contract-at-errors-CFXsstzm.mjs} +2 -2
- package/dist/{contract-at-errors-BxP-TOMl.mjs.map → contract-at-errors-CFXsstzm.mjs.map} +1 -1
- package/dist/{contract-emit-DxcGl4Uq.mjs → contract-emit-B_qriF8B.mjs} +5 -5
- package/dist/{contract-emit-DxcGl4Uq.mjs.map → contract-emit-B_qriF8B.mjs.map} +1 -1
- package/dist/{contract-emit-D-4jrNve.mjs → contract-emit-C8HmtboH.mjs} +12 -7
- package/dist/contract-emit-C8HmtboH.mjs.map +1 -0
- package/dist/{contract-enrichment-a0V5Y_mL.mjs → contract-enrichment-gn9sWbPw.mjs} +1 -1
- package/dist/{contract-enrichment-a0V5Y_mL.mjs.map → contract-enrichment-gn9sWbPw.mjs.map} +1 -1
- package/dist/{contract-infer-D8uEbJuu.mjs → contract-infer-BYT_ra_U.mjs} +5 -5
- package/dist/contract-infer-BYT_ra_U.mjs.map +1 -0
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs → contract-space-aggregate-loader-ClI1KN6d.mjs} +5 -5
- package/dist/{contract-space-aggregate-loader-DvZwdkrr.mjs.map → contract-space-aggregate-loader-ClI1KN6d.mjs.map} +1 -1
- package/dist/{db-verify-v_vUKXTU.mjs → db-verify-C24FKhb7.mjs} +6 -6
- package/dist/{db-verify-v_vUKXTU.mjs.map → db-verify-C24FKhb7.mjs.map} +1 -1
- package/dist/exports/control-api.d.mts +5 -3
- package/dist/exports/control-api.d.mts.map +1 -1
- package/dist/exports/control-api.mjs +3 -3
- package/dist/exports/index.mjs +1 -1
- package/dist/exports/index.mjs.map +1 -1
- package/dist/exports/init-output.d.mts +1 -3
- package/dist/exports/init-output.d.mts.map +1 -1
- package/dist/exports/init-output.mjs +1 -1
- package/dist/{extension-pack-inputs-IDvjRCi3.mjs → extension-pack-inputs-1ySHqxKG.mjs} +1 -1
- package/dist/{extension-pack-inputs-IDvjRCi3.mjs.map → extension-pack-inputs-1ySHqxKG.mjs.map} +1 -1
- package/dist/{framework-components-fYXjz_in.mjs → framework-components-YVQHhPH7.mjs} +2 -2
- package/dist/{framework-components-fYXjz_in.mjs.map → framework-components-YVQHhPH7.mjs.map} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts → global-flags-BpoOYtNZ.d.mts} +1 -1
- package/dist/{global-flags-DEHjV8_s.d.mts.map → global-flags-BpoOYtNZ.d.mts.map} +1 -1
- package/dist/{init-Cv9UzWL5.mjs → init-0HwB-Vh8.mjs} +5 -58
- package/dist/init-0HwB-Vh8.mjs.map +1 -0
- package/dist/{inspect-live-schema-C6ohV_oQ.mjs → inspect-live-schema-DF6IwcDl.mjs} +7 -5
- package/dist/inspect-live-schema-DF6IwcDl.mjs.map +1 -0
- package/dist/migration-check-soB5uZEQ.mjs +573 -0
- package/dist/migration-check-soB5uZEQ.mjs.map +1 -0
- package/dist/migration-cli.mjs +1 -1
- package/dist/migration-cli.mjs.map +1 -1
- package/dist/{migration-command-scaffold-CjvwO6at.mjs → migration-command-scaffold-DA-Lhx6o.mjs} +5 -5
- package/dist/{migration-command-scaffold-CjvwO6at.mjs.map → migration-command-scaffold-DA-Lhx6o.mjs.map} +1 -1
- package/dist/migration-graph-command-render-CEez7YUK.mjs +1960 -0
- package/dist/migration-graph-command-render-CEez7YUK.mjs.map +1 -0
- package/dist/migration-list-DlJJ_38Z.mjs +230 -0
- package/dist/migration-list-DlJJ_38Z.mjs.map +1 -0
- package/dist/migration-log-CG0qQAFm.mjs +222 -0
- package/dist/migration-log-CG0qQAFm.mjs.map +1 -0
- package/dist/migration-path-target-Ce6OZImp.mjs +38 -0
- package/dist/migration-path-target-Ce6OZImp.mjs.map +1 -0
- package/dist/{migration-plan-9DJ7q7_z.mjs → migration-plan-z5Ing-TD.mjs} +9 -8
- package/dist/migration-plan-z5Ing-TD.mjs.map +1 -0
- package/dist/migration-status-CgWSoI_g.mjs +446 -0
- package/dist/migration-status-CgWSoI_g.mjs.map +1 -0
- package/dist/{output-B60Gw5fu.mjs → output-mEQ74_nd.mjs} +1 -1
- package/dist/{output-B60Gw5fu.mjs.map → output-mEQ74_nd.mjs.map} +1 -1
- package/dist/{progress-adapter-C644QK8l.mjs → progress-adapter-CjAeTxY_.mjs} +1 -1
- package/dist/{progress-adapter-C644QK8l.mjs.map → progress-adapter-CjAeTxY_.mjs.map} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs → ref-advancement-BkXlikCA.mjs} +1 -1
- package/dist/{ref-advancement-DUZqsue6.mjs.map → ref-advancement-BkXlikCA.mjs.map} +1 -1
- package/dist/schemas-CeGMYFYX.d.mts +191 -0
- package/dist/schemas-CeGMYFYX.d.mts.map +1 -0
- package/dist/schemas-KhXMzNA_.mjs +112 -0
- package/dist/schemas-KhXMzNA_.mjs.map +1 -0
- package/dist/telemetry-BIM4beEO.mjs +122 -0
- package/dist/telemetry-BIM4beEO.mjs.map +1 -0
- package/dist/{terminal-ui-5Y6mrg93.d.mts → terminal-ui-DGRNFWna.d.mts} +1 -1
- package/dist/terminal-ui-DGRNFWna.d.mts.map +1 -0
- package/dist/{types-Dt_SfqFm.d.mts → types-C_tYiJYx.d.mts} +53 -31
- package/dist/types-C_tYiJYx.d.mts.map +1 -0
- package/dist/{verify-DCA9Sldu.mjs → verify-DcOYZ1tH.mjs} +2 -2
- package/dist/{verify-DCA9Sldu.mjs.map → verify-DcOYZ1tH.mjs.map} +1 -1
- package/package.json +26 -22
- package/src/cli.ts +5 -0
- package/src/commands/contract-infer.ts +2 -2
- package/src/commands/db-update.ts +7 -1
- package/src/commands/init/index.ts +6 -35
- package/src/commands/init/init.ts +1 -14
- package/src/commands/init/inputs.ts +0 -75
- package/src/commands/inspect-live-schema.ts +10 -0
- package/src/commands/json/schemas.ts +195 -0
- package/src/commands/migrate.ts +527 -8
- package/src/commands/migration-check.ts +469 -134
- package/src/commands/migration-graph.ts +151 -119
- package/src/commands/migration-list.ts +72 -39
- package/src/commands/migration-log.ts +52 -102
- package/src/commands/migration-new.ts +2 -1
- package/src/commands/migration-plan.ts +2 -1
- package/src/commands/migration-show.ts +31 -66
- package/src/commands/migration-status-overlay.ts +61 -0
- package/src/commands/migration-status.ts +458 -1066
- package/src/commands/telemetry/index.ts +107 -0
- package/src/commands/telemetry/status.ts +67 -0
- package/src/control-api/client.ts +70 -9
- package/src/control-api/operations/contract-emit.ts +22 -2
- package/src/control-api/operations/db-init.ts +6 -3
- package/src/control-api/operations/{db-apply.ts → db-run.ts} +55 -14
- package/src/control-api/operations/db-update.ts +7 -4
- package/src/control-api/operations/db-verify.ts +15 -5
- package/src/control-api/operations/{migration-apply.ts → migrate.ts} +181 -80
- package/src/control-api/operations/{apply.ts → run-migration.ts} +33 -27
- package/src/control-api/types.ts +56 -29
- package/src/utils/cli-errors.ts +70 -2
- package/src/utils/formatters/errors.ts +11 -0
- package/src/utils/formatters/migration-graph-command-render.ts +239 -0
- package/src/utils/formatters/migration-graph-grid-layout.ts +1134 -0
- package/src/utils/formatters/migration-graph-labels.ts +408 -0
- package/src/utils/formatters/migration-graph-model.ts +103 -0
- package/src/utils/formatters/migration-graph-occlusion-render.ts +258 -0
- package/src/utils/formatters/migration-graph-rows.ts +128 -15
- package/src/utils/formatters/migration-graph-space-render.ts +188 -0
- package/src/utils/formatters/migration-list-data-column.ts +4 -91
- package/src/utils/formatters/migration-list-graph-topology.ts +72 -94
- package/src/utils/formatters/migration-list-render.ts +135 -71
- package/src/utils/formatters/migration-list-styler.ts +46 -5
- package/src/utils/formatters/migration-list-types.ts +5 -21
- package/src/utils/formatters/migration-log-table.ts +205 -0
- package/src/utils/formatters/migrations.ts +33 -11
- package/src/utils/global-flags.ts +35 -0
- package/src/utils/integrity-violation-to-check-failure.ts +28 -19
- package/src/utils/legend.ts +38 -0
- package/src/utils/migration-path-target.ts +60 -0
- package/src/utils/telemetry.ts +68 -32
- package/dist/client-KgJorIvG.mjs.map +0 -1
- package/dist/command-helpers-Bbw1GbwL.mjs.map +0 -1
- package/dist/commands/migration-list.mjs.map +0 -1
- package/dist/commands/migration-log.mjs.map +0 -1
- package/dist/commands/migration-status.mjs.map +0 -1
- package/dist/contract-emit-D-4jrNve.mjs.map +0 -1
- package/dist/contract-infer-D8uEbJuu.mjs.map +0 -1
- package/dist/graph-render-rFAqZujX.mjs +0 -1081
- package/dist/graph-render-rFAqZujX.mjs.map +0 -1
- package/dist/init-Cv9UzWL5.mjs.map +0 -1
- package/dist/inspect-live-schema-C6ohV_oQ.mjs.map +0 -1
- package/dist/migration-check-BiBJoYYW.mjs +0 -341
- package/dist/migration-check-BiBJoYYW.mjs.map +0 -1
- package/dist/migration-graph-C9WC-7eO.mjs +0 -1478
- package/dist/migration-graph-C9WC-7eO.mjs.map +0 -1
- package/dist/migration-list-styler-BRwF4-gy.mjs +0 -399
- package/dist/migration-list-styler-BRwF4-gy.mjs.map +0 -1
- package/dist/migration-plan-9DJ7q7_z.mjs.map +0 -1
- package/dist/migration-types-D2FW63pr.d.mts +0 -15
- package/dist/migration-types-D2FW63pr.d.mts.map +0 -1
- package/dist/migrations-Cv2jxNNK.mjs +0 -228
- package/dist/migrations-Cv2jxNNK.mjs.map +0 -1
- package/dist/terminal-ui-5Y6mrg93.d.mts.map +0 -1
- package/dist/types-Dt_SfqFm.d.mts.map +0 -1
- package/src/utils/formatters/graph-migration-mapper.ts +0 -235
- package/src/utils/formatters/graph-render.ts +0 -1323
- package/src/utils/formatters/graph-types.ts +0 -120
- package/src/utils/formatters/migration-graph-lane-colors.ts +0 -31
- package/src/utils/formatters/migration-graph-layout.ts +0 -1141
- package/src/utils/formatters/migration-graph-tree-render.ts +0 -768
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-BIM4beEO.mjs","names":[],"sources":["../src/commands/telemetry/status.ts","../src/commands/telemetry/index.ts"],"sourcesContent":["import { readUserConfig, resolveGating, userConfigPath } from '@prisma-next/cli-telemetry';\n\n/**\n * Why telemetry resolves the way it does, in the order the CLI's\n * `resolveTelemetryGate` evaluates: CI hard-disables first, then the env\n * opt-outs, then the stored `enableTelemetry`, then the opt-out default.\n */\nexport type TelemetryStatusReason =\n | 'ci'\n | 'env-opt-out'\n | 'stored-opt-out'\n | 'stored-opt-in'\n | 'default-on';\n\nexport interface TelemetryStatus {\n readonly enabled: boolean;\n readonly reason: TelemetryStatusReason;\n readonly configPath: string;\n readonly installationIdStored: boolean;\n}\n\n/**\n * Resolves the same gate the runtime uses (CI check + `resolveGating`) and\n * projects it into a user-facing status. Pure read: never mints, never\n * writes. The `installationId` value itself is never surfaced — only its\n * presence — so `status` discloses nothing identifying.\n */\nexport function resolveTelemetryStatus(inputs: {\n readonly env: Readonly<Record<string, string | undefined>>;\n readonly inCI: boolean;\n}): TelemetryStatus {\n const config = readUserConfig();\n const configPath = userConfigPath();\n const installationIdStored =\n typeof config.installationId === 'string' && config.installationId.length > 0;\n\n if (inputs.inCI) {\n return { enabled: false, reason: 'ci', configPath, installationIdStored };\n }\n\n const gating = resolveGating({ env: inputs.env, config });\n if (!gating.enabled) {\n const reason: TelemetryStatusReason =\n gating.reason === 'env-override' ? 'env-opt-out' : 'stored-opt-out';\n return { enabled: false, reason, configPath, installationIdStored };\n }\n\n const reason: TelemetryStatusReason =\n config.enableTelemetry === true ? 'stored-opt-in' : 'default-on';\n return { enabled: true, reason, configPath, installationIdStored };\n}\n\nconst REASON_EXPLANATION: Record<TelemetryStatusReason, string> = {\n ci: 'CI environment detected — telemetry is hard-disabled.',\n 'env-opt-out': 'an environment opt-out is set (DO_NOT_TRACK / PRISMA_NEXT_DISABLE_TELEMETRY).',\n 'stored-opt-out': '\"enableTelemetry\": false is stored in your config.',\n 'stored-opt-in': '\"enableTelemetry\": true is stored in your config.',\n 'default-on': 'no explicit choice is stored, so the opt-out default applies.',\n};\n\nexport function formatTelemetryStatusLines(status: TelemetryStatus): string[] {\n return [\n `Telemetry is ${status.enabled ? 'enabled' : 'disabled'}: ${REASON_EXPLANATION[status.reason]}`,\n `Config file: ${status.configPath}`,\n `Installation ID: ${status.installationIdStored ? 'stored' : 'not stored'}`,\n ];\n}\n","import { userConfigPath, writeUserConfig } from '@prisma-next/cli-telemetry';\nimport { Command } from 'commander';\nimport {\n addGlobalOptions,\n setCommandDescriptions,\n setCommandExamples,\n} from '../../utils/command-helpers';\nimport { formatCommandHelp } from '../../utils/formatters/help';\nimport {\n type CommonCommandOptions,\n parseGlobalFlags,\n parseGlobalFlagsOrExit,\n} from '../../utils/global-flags';\nimport { isCI } from '../../utils/is-ci';\nimport { createTerminalUI } from '../../utils/terminal-ui';\nimport { formatTelemetryStatusLines, resolveTelemetryStatus } from './status';\n\nfunction createTelemetryStatusCommand(): Command {\n const command = new Command('status');\n setCommandDescriptions(\n command,\n 'Show whether anonymous CLI telemetry is enabled and why',\n 'Reports whether telemetry is currently enabled or disabled and the reason\\n' +\n '(default-on, stored opt-out, environment opt-out, or CI), the path to your\\n' +\n 'user-level config file, and whether an installation ID has been stored.\\n' +\n 'Read-only: never sends an event, never mints an ID, never writes anything.',\n );\n return addGlobalOptions(command).action((options: CommonCommandOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n const ui = createTerminalUI(flags);\n const status = resolveTelemetryStatus({ env: process.env, inCI: isCI() });\n if (flags.json) {\n ui.output(JSON.stringify(status));\n } else {\n for (const line of formatTelemetryStatusLines(status)) {\n ui.output(line);\n }\n }\n process.exit(0);\n });\n}\n\nfunction createTelemetryEnableCommand(): Command {\n const command = new Command('enable');\n setCommandDescriptions(\n command,\n 'Enable anonymous CLI telemetry',\n 'Stores \"enableTelemetry\": true in your user-level config and mints an\\n' +\n 'installation ID if one is not already stored.',\n );\n return addGlobalOptions(command).action((options: CommonCommandOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n writeUserConfig({ enableTelemetry: true });\n const ui = createTerminalUI(flags);\n if (flags.json) {\n ui.output(JSON.stringify({ enableTelemetry: true, configPath: userConfigPath() }));\n } else {\n ui.output(`Telemetry enabled. Preference stored in ${userConfigPath()}.`);\n }\n process.exit(0);\n });\n}\n\nfunction createTelemetryDisableCommand(): Command {\n const command = new Command('disable');\n setCommandDescriptions(\n command,\n 'Disable anonymous CLI telemetry',\n 'Stores \"enableTelemetry\": false in your user-level config. No installation\\n' +\n 'ID is minted and no event is sent.',\n );\n return addGlobalOptions(command).action((options: CommonCommandOptions) => {\n const flags = parseGlobalFlagsOrExit(options);\n writeUserConfig({ enableTelemetry: false });\n const ui = createTerminalUI(flags);\n if (flags.json) {\n ui.output(JSON.stringify({ enableTelemetry: false, configPath: userConfigPath() }));\n } else {\n ui.output(`Telemetry disabled. Preference stored in ${userConfigPath()}.`);\n }\n process.exit(0);\n });\n}\n\nexport function createTelemetryCommand(): Command {\n const command = new Command('telemetry');\n setCommandDescriptions(\n command,\n 'Inspect and change anonymous CLI telemetry',\n 'Show telemetry status, or enable / disable anonymous CLI usage data.\\n' +\n 'Telemetry is on by default (opt-out); see https://prisma-next.dev/docs/cli/telemetry\\n' +\n 'for what is collected and why.',\n );\n setCommandExamples(command, [\n 'prisma-next telemetry status',\n 'prisma-next telemetry disable',\n 'prisma-next telemetry enable',\n ]);\n command.configureHelp({\n formatHelp: (cmd) => formatCommandHelp({ command: cmd, flags: parseGlobalFlags({}) }),\n subcommandDescription: () => '',\n });\n command.addCommand(createTelemetryStatusCommand());\n command.addCommand(createTelemetryEnableCommand());\n command.addCommand(createTelemetryDisableCommand());\n return command;\n}\n"],"mappings":";;;;;;;;;;AA2BA,SAAgB,uBAAuB,QAGnB;CAClB,MAAM,SAAS,eAAe;CAC9B,MAAM,aAAa,eAAe;CAClC,MAAM,uBACJ,OAAO,OAAO,mBAAmB,YAAY,OAAO,eAAe,SAAS;CAE9E,IAAI,OAAO,MACT,OAAO;EAAE,SAAS;EAAO,QAAQ;EAAM;EAAY;CAAqB;CAG1E,MAAM,SAAS,cAAc;EAAE,KAAK,OAAO;EAAK;CAAO,CAAC;CACxD,IAAI,CAAC,OAAO,SAGV,OAAO;EAAE,SAAS;EAAO,QADvB,OAAO,WAAW,iBAAiB,gBAAgB;EACpB;EAAY;CAAqB;CAKpE,OAAO;EAAE,SAAS;EAAM,QADtB,OAAO,oBAAoB,OAAO,kBAAkB;EACtB;EAAY;CAAqB;AACnE;AAEA,MAAM,qBAA4D;CAChE,IAAI;CACJ,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,cAAc;AAChB;AAEA,SAAgB,2BAA2B,QAAmC;CAC5E,OAAO;EACL,gBAAgB,OAAO,UAAU,YAAY,WAAW,IAAI,mBAAmB,OAAO;EACtF,gBAAgB,OAAO;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EAWR;;;EAAJ,GAAA,CAAI,OAAA;EAgBC;;;EARL,OAAA,CAAQ,OAAA;EAuBH;;;EAfL,IAAA,CAAK,OAAA;EA+BA;;;EAvBL,KAAA,CAAM,OAAA;EAuCN;;;EAhCA,IAAA,CAAK,OAAA;EA0CmB;;;EAlCxB,IAAA,CAAK,OAAA;EAoI2B;;;EA5HhC,IAAA,CAAK,OAAA,UAAiB,KAAA;EAyJf;;;EAjJP,KAAA,CAAM,KAAA;EA4JF;;;EApJJ,KAAA,CAAM,OAAA;EA0JF;;;;;EAhJJ,OAAA,CAAQ,OAAA,YAAgB,KAAA,CAAM,aAAA;EAsJX;;;;EApDb,OAAA,CAAQ,OAAA,WAAkB,OAAA;;;;;EAchC,MAAA,CAAO,OAAA;;;;;;;EAeP,MAAA,CAAO,IAAA;EAQP,KAAA,CAAM,IAAA;EAGN,GAAA,CAAI,IAAA;EAGJ,IAAA,CAAK,IAAA;EAGL,GAAA,CAAI,IAAA;EAGJ,IAAA,CAAK,IAAA;EAGL,MAAA,CAAO,IAAA;AAAA"}
|
|
@@ -3,8 +3,10 @@ import { Result } from "@prisma-next/utils/result";
|
|
|
3
3
|
import { ContractSourceDiagnostics, ContractSourceProvider } from "@prisma-next/config/config-types";
|
|
4
4
|
import { ControlAdapterDescriptor, ControlDriverDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlFamilyInstance, ControlTargetDescriptor, CoreSchemaView, MigrationPlanOperation, MigrationPlannerConflict, OperationPreview, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma-next/framework-components/control";
|
|
5
5
|
import { TargetBoundComponentDescriptor } from "@prisma-next/framework-components/components";
|
|
6
|
+
import { ContractSpaceMember } from "@prisma-next/migration-tools/aggregate";
|
|
6
7
|
import { MigrationToolsError } from "@prisma-next/migration-tools/errors";
|
|
7
|
-
import { Contract, ContractMarkerRecord } from "@prisma-next/contract/types";
|
|
8
|
+
import { Contract, ContractMarkerRecord, LedgerEntryRecord } from "@prisma-next/contract/types";
|
|
9
|
+
import { AuthoringPslBlockDescriptorNamespace } from "@prisma-next/framework-components/authoring";
|
|
8
10
|
import { PslDocumentAst } from "@prisma-next/framework-components/psl-ast";
|
|
9
11
|
|
|
10
12
|
//#region src/control-api/operations/db-verify.d.ts
|
|
@@ -95,7 +97,7 @@ interface ControlClientOptions {
|
|
|
95
97
|
/**
|
|
96
98
|
* Action names for control-api operations that can emit progress events.
|
|
97
99
|
*/
|
|
98
|
-
type ControlActionName = 'dbInit' | 'dbUpdate' | 'dbVerify' | '
|
|
100
|
+
type ControlActionName = 'dbInit' | 'dbUpdate' | 'dbVerify' | 'migrate' | 'verify' | 'schemaVerify' | 'sign' | 'introspect' | 'emit';
|
|
99
101
|
/**
|
|
100
102
|
* Progress event emitted during control-api operation execution.
|
|
101
103
|
*
|
|
@@ -391,6 +393,7 @@ interface DbInitSuccess {
|
|
|
391
393
|
*/
|
|
392
394
|
readonly perSpace?: ReadonlyArray<PerSpaceExecutionEntry>;
|
|
393
395
|
readonly summary: string;
|
|
396
|
+
readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
|
|
394
397
|
}
|
|
395
398
|
/**
|
|
396
399
|
* Failure codes for dbInit operation.
|
|
@@ -404,6 +407,7 @@ interface DbInitFailure {
|
|
|
404
407
|
readonly summary: string;
|
|
405
408
|
readonly why: string | undefined;
|
|
406
409
|
readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
|
|
410
|
+
readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
|
|
407
411
|
readonly meta: Record<string, unknown> | undefined;
|
|
408
412
|
readonly marker?: {
|
|
409
413
|
readonly storageHash?: string;
|
|
@@ -457,6 +461,7 @@ interface DbUpdateSuccess {
|
|
|
457
461
|
*/
|
|
458
462
|
readonly perSpace?: ReadonlyArray<PerSpaceExecutionEntry>;
|
|
459
463
|
readonly summary: string;
|
|
464
|
+
readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
|
|
460
465
|
}
|
|
461
466
|
/**
|
|
462
467
|
* Failure codes for dbUpdate operation.
|
|
@@ -470,6 +475,7 @@ interface DbUpdateFailure {
|
|
|
470
475
|
readonly summary: string;
|
|
471
476
|
readonly why: string | undefined;
|
|
472
477
|
readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
|
|
478
|
+
readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
|
|
473
479
|
readonly meta: Record<string, unknown> | undefined;
|
|
474
480
|
}
|
|
475
481
|
/**
|
|
@@ -513,17 +519,17 @@ interface EmitFailure {
|
|
|
513
519
|
*/
|
|
514
520
|
type EmitResult = Result<EmitSuccess, EmitFailure>;
|
|
515
521
|
/**
|
|
516
|
-
* Options for the aggregate-walking `
|
|
522
|
+
* Options for the aggregate-walking `migrate` operation.
|
|
517
523
|
*
|
|
518
524
|
* The control-api operation is responsible for: loading the
|
|
519
525
|
* contract-space aggregate, reading per-space marker rows from the
|
|
520
526
|
* live database, plotting per-space paths via `graphWalkStrategy`
|
|
521
527
|
* (replay-only — no synth, no introspection), and dispatching
|
|
522
|
-
* through the shared `
|
|
528
|
+
* through the shared `runMigration` primitive. The CLI command
|
|
523
529
|
* just resolves the descriptor surface (config, refs, contract
|
|
524
530
|
* envelope, app-space migration packages) and hands the inputs in.
|
|
525
531
|
*/
|
|
526
|
-
interface
|
|
532
|
+
interface MigrateOptions {
|
|
527
533
|
/** Already-validated app contract (the canonical "where we are heading" hash). */
|
|
528
534
|
readonly contract: unknown;
|
|
529
535
|
/** Migrations root directory (`migrations/` under the project). */
|
|
@@ -548,7 +554,7 @@ interface MigrationApplyOptions {
|
|
|
548
554
|
*/
|
|
549
555
|
readonly refName?: string;
|
|
550
556
|
/**
|
|
551
|
-
* Database connection. If provided,
|
|
557
|
+
* Database connection. If provided, migrate will connect before executing.
|
|
552
558
|
* If omitted, the client must already be connected.
|
|
553
559
|
*/
|
|
554
560
|
readonly connection?: unknown;
|
|
@@ -568,7 +574,7 @@ interface MigrationApplyOptions {
|
|
|
568
574
|
* Per-space aggregate detail (markers, ops grouped by space) lives
|
|
569
575
|
* on `perSpace[]`; this list is the per-edge view.
|
|
570
576
|
*/
|
|
571
|
-
interface
|
|
577
|
+
interface MigrateRanEntry {
|
|
572
578
|
readonly spaceId: string;
|
|
573
579
|
readonly dirName: string;
|
|
574
580
|
readonly migrationHash: string;
|
|
@@ -577,13 +583,13 @@ interface MigrationApplyAppliedEntry {
|
|
|
577
583
|
readonly operationsExecuted: number;
|
|
578
584
|
}
|
|
579
585
|
/**
|
|
580
|
-
* Successful
|
|
581
|
-
* (`markerHash` is the **app member's** post-
|
|
586
|
+
* Successful migrate result. Carries both the top-level fields
|
|
587
|
+
* (`markerHash` is the **app member's** post-migrate marker) and the
|
|
582
588
|
* per-space breakdown (`perSpace` — markers / operations in canonical
|
|
583
589
|
* schedule order).
|
|
584
590
|
*/
|
|
585
591
|
/**
|
|
586
|
-
* Path-decision summary for the **app member** post-
|
|
592
|
+
* Path-decision summary for the **app member** post-migrate. Surfaced
|
|
587
593
|
* at the top level (and consumed by the cli-journeys suite, which
|
|
588
594
|
* inspects `requiredInvariants`/`satisfiedInvariants`/
|
|
589
595
|
* `selectedPath` to validate invariant routing).
|
|
@@ -591,7 +597,7 @@ interface MigrationApplyAppliedEntry {
|
|
|
591
597
|
* Per-space path decisions for extension members are not surfaced —
|
|
592
598
|
* extensions own their own ref/invariant control.
|
|
593
599
|
*/
|
|
594
|
-
interface
|
|
600
|
+
interface MigratePathDecision {
|
|
595
601
|
readonly fromHash: string;
|
|
596
602
|
readonly toHash: string;
|
|
597
603
|
readonly alternativeCount: number;
|
|
@@ -607,10 +613,10 @@ interface MigrationApplyPathDecision {
|
|
|
607
613
|
readonly invariants: readonly string[];
|
|
608
614
|
}[];
|
|
609
615
|
}
|
|
610
|
-
interface
|
|
616
|
+
interface MigrateSuccess {
|
|
611
617
|
readonly migrationsApplied: number;
|
|
612
618
|
readonly markerHash: string;
|
|
613
|
-
readonly applied: readonly
|
|
619
|
+
readonly applied: readonly MigrateRanEntry[];
|
|
614
620
|
readonly summary: string;
|
|
615
621
|
/**
|
|
616
622
|
* Per-space breakdown in canonical schedule order (extensions
|
|
@@ -621,28 +627,28 @@ interface MigrationApplySuccess {
|
|
|
621
627
|
/**
|
|
622
628
|
* Path-decision data for the app member. Present whenever the
|
|
623
629
|
* graph-walk strategy ran for the app (i.e. always for the
|
|
624
|
-
* aggregate-walking
|
|
630
|
+
* aggregate-walking migrate path). Absent only for the no-op
|
|
625
631
|
* "Already up to date" early return when the app has no plan.
|
|
626
632
|
*/
|
|
627
|
-
readonly pathDecision?:
|
|
633
|
+
readonly pathDecision?: MigratePathDecision;
|
|
628
634
|
}
|
|
629
635
|
/**
|
|
630
|
-
* Failure codes for
|
|
636
|
+
* Failure codes for migrate operation.
|
|
631
637
|
*/
|
|
632
|
-
type
|
|
638
|
+
type MigrateFailureCode = 'RUNNER_FAILED' | 'MIGRATION_PATH_NOT_FOUND';
|
|
633
639
|
/**
|
|
634
|
-
* Failure details for
|
|
640
|
+
* Failure details for migrate operation.
|
|
635
641
|
*/
|
|
636
|
-
interface
|
|
637
|
-
readonly code:
|
|
642
|
+
interface MigrateFailure {
|
|
643
|
+
readonly code: MigrateFailureCode;
|
|
638
644
|
readonly summary: string;
|
|
639
645
|
readonly why: string | undefined;
|
|
640
646
|
readonly meta: Record<string, unknown> | undefined;
|
|
641
647
|
}
|
|
642
648
|
/**
|
|
643
|
-
* Result type for
|
|
649
|
+
* Result type for migrate operation.
|
|
644
650
|
*/
|
|
645
|
-
type
|
|
651
|
+
type MigrateResult = Result<MigrateSuccess, MigrateFailure>;
|
|
646
652
|
/**
|
|
647
653
|
* Options for the standalone executeContractEmit function.
|
|
648
654
|
*
|
|
@@ -805,17 +811,25 @@ interface ControlClient {
|
|
|
805
811
|
*/
|
|
806
812
|
readAllMarkers(): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
|
|
807
813
|
/**
|
|
808
|
-
*
|
|
814
|
+
* Reads the per-migration ledger journal for `space` in apply order.
|
|
815
|
+
* Returns an empty array when the ledger store does not yet exist or
|
|
816
|
+
* has no rows for that space.
|
|
817
|
+
*/
|
|
818
|
+
readLedger(space?: string): Promise<readonly LedgerEntryRecord[]>;
|
|
819
|
+
/**
|
|
820
|
+
* Advances the database along the migration graph to the target contract.
|
|
809
821
|
* Each migration runs in its own transaction with full execution checks.
|
|
810
|
-
* Resume-safe: re-running after failure picks up from the last
|
|
822
|
+
* Resume-safe: re-running after failure picks up from the last run migration.
|
|
811
823
|
*
|
|
812
|
-
* @param options.
|
|
813
|
-
* @param options.
|
|
814
|
-
* @param options.
|
|
815
|
-
* @
|
|
824
|
+
* @param options.contract - The target contract to migrate to
|
|
825
|
+
* @param options.migrationsDir - Root migrations directory (`migrations/` under the project)
|
|
826
|
+
* @param options.refHash - Optional app-space ref override hash
|
|
827
|
+
* @param options.refInvariants - Required invariants on the user-supplied ref
|
|
828
|
+
* @param options.refName - Resolved name of the user-supplied app-space ref
|
|
829
|
+
* @returns Result pattern: Ok with migration details, NotOk with failure details
|
|
816
830
|
* @throws If not connected, target doesn't support migrations, or infrastructure failure
|
|
817
831
|
*/
|
|
818
|
-
|
|
832
|
+
migrate(options: MigrateOptions): Promise<MigrateResult>;
|
|
819
833
|
/**
|
|
820
834
|
* Introspects the database schema.
|
|
821
835
|
*
|
|
@@ -839,6 +853,14 @@ interface ControlClient {
|
|
|
839
853
|
* @returns PslDocumentAst if the family supports the capability, undefined otherwise
|
|
840
854
|
*/
|
|
841
855
|
inferPslContract(schemaIR: unknown): PslDocumentAst | undefined;
|
|
856
|
+
/**
|
|
857
|
+
* Returns the assembled PSL block descriptors from the control stack — the full
|
|
858
|
+
* set of extension-contributed top-level block descriptors. The CLI's
|
|
859
|
+
* `contract infer` command threads these through to `printPsl` so
|
|
860
|
+
* extension-contributed blocks in the inferred AST round-trip back to PSL
|
|
861
|
+
* source. Forces `init()` so the stack is built before access.
|
|
862
|
+
*/
|
|
863
|
+
getPslBlockDescriptors(): AuthoringPslBlockDescriptorNamespace;
|
|
842
864
|
/**
|
|
843
865
|
* Renders a textual preview of a migration plan's operations for the CLI's
|
|
844
866
|
* "DDL preview" output. Delegates to the family instance's
|
|
@@ -858,5 +880,5 @@ interface ControlClient {
|
|
|
858
880
|
emit(options: EmitOptions): Promise<EmitResult>;
|
|
859
881
|
}
|
|
860
882
|
//#endregion
|
|
861
|
-
export { ExecuteDbVerifyOptions as A, IntrospectOptions as C, SchemaVerifyOptions as D, PerSpaceExecutionEntry as E, executeDbVerify as M, CliStructuredError$1 as N, SignOptions as O, EmitSuccess as S, OnControlProgress as T, EmitContractConfig as _, ControlClientOptions as a, EmitOptions as b, DbInitFailureCode as c, DbInitSuccess as d, DbUpdateFailure as f, DbUpdateSuccess as g, DbUpdateResult as h, ControlClient as i, ExecuteDbVerifyResult as j, VerifyOptions as k, DbInitOptions as l, DbUpdateOptions as m, ContractEmitResult as n, ControlProgressEvent as o, DbUpdateFailureCode as p, ControlActionName as r, DbInitFailure as s, ContractEmitOptions as t, DbInitResult as u, EmitFailure as v,
|
|
862
|
-
//# sourceMappingURL=types-
|
|
883
|
+
export { ExecuteDbVerifyOptions as A, IntrospectOptions as C, SchemaVerifyOptions as D, PerSpaceExecutionEntry as E, executeDbVerify as M, CliStructuredError$1 as N, SignOptions as O, EmitSuccess as S, OnControlProgress as T, EmitContractConfig as _, ControlClientOptions as a, EmitOptions as b, DbInitFailureCode as c, DbInitSuccess as d, DbUpdateFailure as f, DbUpdateSuccess as g, DbUpdateResult as h, ControlClient as i, ExecuteDbVerifyResult as j, VerifyOptions as k, DbInitOptions as l, DbUpdateOptions as m, ContractEmitResult as n, ControlProgressEvent as o, DbUpdateFailureCode as p, ControlActionName as r, DbInitFailure as s, ContractEmitOptions as t, DbInitResult as u, EmitFailure as v, MigratePathDecision as w, EmitResult as x, EmitFailureCode as y };
|
|
884
|
+
//# sourceMappingURL=types-C_tYiJYx.d.mts.map
|
|
@@ -0,0 +1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,eAAA,GAAkB,OAAA,CAAQ,qBAAA;;;;;;;EAQ5C,UAAA,IAAc,OAAA,CAAQ,oBAAA;;;;;;EAOtB,cAAA,IAAkB,OAAA,CAAQ,WAAA,SAAoB,oBAAA;;;;;;EAO9C,UAAA,CAAW,KAAA,YAAiB,OAAA,UAAiB,iBAAA;;;;;;;;;;;;;;EAe7C,OAAA,CAAQ,OAAA,EAAS,cAAA,GAAiB,OAAA,CAAQ,aAAA;;;;;;;EAQ1C,UAAA,CAAW,OAAA,GAAU,iBAAA,GAAoB,OAAA;;;;;;;;EASzC,YAAA,CAAa,QAAA,YAAoB,cAAA;;;;;;;;EASjC,gBAAA,CAAiB,QAAA,YAAoB,cAAA;;;;;;;;EASrC,sBAAA,IAA0B,oCAAA;;;;;;;;;EAU1B,kBAAA,CAAmB,UAAA,WAAqB,sBAAA,KAA2B,gBAAA;;;;;;;;EASnE,IAAA,CAAK,OAAA,EAAS,WAAA,GAAc,OAAA,CAAQ,UAAA;AAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { M as createColorFormatter, N as formatDim, P as isVerbose } from "./command-helpers-DGMvGBeX.mjs";
|
|
2
2
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
3
3
|
import { bold, cyan, dim, green, magenta, red, yellow } from "colorette";
|
|
4
4
|
//#region src/utils/formatters/verify.ts
|
|
@@ -381,4 +381,4 @@ function formatSignJson(result) {
|
|
|
381
381
|
//#endregion
|
|
382
382
|
export { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };
|
|
383
383
|
|
|
384
|
-
//# sourceMappingURL=verify-
|
|
384
|
+
//# sourceMappingURL=verify-DcOYZ1tH.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-DCA9Sldu.mjs","names":[],"sources":["../src/utils/formatters/verify.ts"],"sourcesContent":["import type {\n CoreSchemaView,\n IntrospectSchemaResult,\n SchemaTreeNode,\n SchemaVerificationNode,\n SignDatabaseResult,\n VerifyDatabaseResult,\n VerifyDatabaseSchemaResult,\n} from '@prisma-next/framework-components/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { bold, cyan, dim, green, magenta, red, yellow } from 'colorette';\nimport type { GlobalFlags } from '../global-flags';\nimport { createColorFormatter, formatDim, isVerbose } from './helpers';\n\n// ============================================================================\n// Verify Output Formatters\n// ============================================================================\n\nexport interface DbVerifyCommandSuccessResult {\n readonly ok: true;\n readonly mode: 'full' | 'marker-only';\n readonly summary: string;\n readonly contract: VerifyDatabaseResult['contract'];\n readonly marker?: VerifyDatabaseResult['marker'];\n readonly target: VerifyDatabaseResult['target'];\n readonly missingCodecs?: VerifyDatabaseResult['missingCodecs'];\n readonly codecCoverageSkipped?: VerifyDatabaseResult['codecCoverageSkipped'];\n readonly schema?: {\n readonly summary: string;\n readonly counts: VerifyDatabaseSchemaResult['schema']['counts'];\n readonly strict: boolean;\n };\n readonly warning?: string;\n readonly meta?:\n | (NonNullable<VerifyDatabaseResult['meta']> & {\n readonly schemaVerification: 'performed' | 'skipped';\n })\n | {\n readonly schemaVerification: 'performed' | 'skipped';\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\n/**\n * Formats human-readable output for database verify.\n */\nexport function formatVerifyOutput(\n result: DbVerifyCommandSuccessResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatYellow = createColorFormatter(useColor, yellow);\n const formatDimText = (text: string) => formatDim(useColor, text);\n const verificationMode =\n result.mode === 'full'\n ? `marker + schema${result.schema?.strict ? ' (strict)' : ' (tolerant)'}`\n : 'marker only (--marker-only)';\n\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n lines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n lines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.mode === 'full' && result.schema && isVerbose(flags, 1)) {\n lines.push(\n `${formatDimText(` schema: pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n if (result.warning) {\n lines.push('');\n lines.push(`${formatYellow('⚠')} ${result.warning}`);\n }\n\n if (isVerbose(flags, 1)) {\n if (result.codecCoverageSkipped) {\n lines.push(\n `${formatDimText(' Codec coverage check skipped (helper returned no supported types)')}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database verify.\n */\nexport function formatVerifyJson(result: DbVerifyCommandSuccessResult): string {\n const output = {\n ok: result.ok,\n summary: result.summary,\n mode: result.mode,\n contract: result.contract,\n ...ifDefined('marker', result.marker),\n target: result.target,\n ...ifDefined('missingCodecs', result.missingCodecs),\n ...ifDefined('codecCoverageSkipped', result.codecCoverageSkipped),\n ...ifDefined('schema', result.schema),\n ...ifDefined('warning', result.warning),\n ...ifDefined('meta', result.meta),\n timings: result.timings,\n };\n\n return JSON.stringify(output, null, 2);\n}\n\n/**\n * Formats JSON output for database introspection.\n */\nexport function formatIntrospectJson(result: IntrospectSchemaResult<unknown>): string {\n return JSON.stringify(result, null, 2);\n}\n\n/**\n * Renders a schema tree structure from CoreSchemaView.\n * Matches the style of renderSchemaVerificationTree for consistency.\n */\nfunction renderSchemaTree(\n node: SchemaTreeNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format node label with color based on kind (matching schema-verify style)\n let formattedLabel: string = node.label;\n\n if (useColor) {\n switch (node.kind) {\n case 'root':\n formattedLabel = bold(node.label);\n break;\n case 'entity': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.label.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n // Fallback: color entire label with cyan\n formattedLabel = cyan(node.label);\n }\n break;\n }\n case 'collection': {\n // \"columns\" grouping node - dim the label\n formattedLabel = dim(node.label);\n break;\n }\n case 'field': {\n // Parse column name format: \"columnName: typeDisplay (nullability)\"\n // Color code: column name (cyan), type (default), nullability (dim)\n const columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"typeDisplay (nullability)\"\n const typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2]) {\n const typeDisplay = typeMatch[1];\n const nullability = typeMatch[2];\n formattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.label;\n }\n break;\n }\n case 'index': {\n // Parse index/unique constraint/primary key formats\n // \"primary key: columnName\" -> dim \"primary key\", cyan columnName\n const pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n // \"unique name\" -> dim \"unique\", cyan \"name\"\n const uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n if (uniqueMatch?.[1]) {\n const name = uniqueMatch[1];\n formattedLabel = `${dim('unique')} ${cyan(name)}`;\n } else {\n // \"index name\" or \"unique index name\" -> dim label prefix, cyan name\n const indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n if (indexMatch?.[2]) {\n const indexPrefix = indexMatch[1] ? `${dim('unique')} ` : '';\n const name = indexMatch[2];\n formattedLabel = `${indexPrefix}${dim('index')} ${cyan(name)}`;\n } else {\n formattedLabel = dim(node.label);\n }\n }\n }\n break;\n }\n case 'dependency': {\n // Parse extension message formats similar to schema-verify\n // \"extensionName extension is enabled\" -> cyan extensionName, dim rest\n const extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire label with magenta\n formattedLabel = magenta(node.label);\n }\n break;\n }\n default:\n formattedLabel = node.label;\n break;\n }\n }\n\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(formattedLabel);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${formattedLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database introspection.\n */\nexport function formatIntrospectOutput(\n result: IntrospectSchemaResult<unknown>,\n schemaView: CoreSchemaView | undefined,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (schemaView) {\n // Render tree structure - root node is special (no tree characters)\n const treeLines = renderSchemaTree(schemaView.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n } else {\n // Fallback: print summary when toSchemaView is not available\n lines.push(`✔ ${result.summary}`);\n if (isVerbose(flags, 1)) {\n lines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n if (result.meta?.dbUrl) {\n lines.push(` Database: ${result.meta.dbUrl}`);\n }\n }\n }\n\n // Add timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Renders a schema verification tree structure from SchemaVerificationNode.\n * Similar to renderSchemaTree but for verification nodes with status-based colors and glyphs.\n */\nfunction renderSchemaVerificationTree(\n node: SchemaVerificationNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format status glyph and color based on status\n let statusGlyph = '';\n let statusColor: (text: string) => string = (text) => text;\n if (useColor) {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n statusColor = green;\n break;\n case 'warn':\n statusGlyph = '⚠';\n statusColor = (text) => (useColor ? yellow(text) : text);\n break;\n case 'fail':\n statusGlyph = '✖';\n statusColor = red;\n break;\n }\n } else {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n break;\n case 'warn':\n statusGlyph = '⚠';\n break;\n case 'fail':\n statusGlyph = '✖';\n break;\n }\n }\n\n // Format node label with color based on kind\n // For column nodes, we need to parse the name to color code different parts\n let labelColor: (text: string) => string = (text) => text;\n let formattedLabel: string = node.name;\n\n if (useColor) {\n switch (node.kind) {\n case 'contract':\n case 'schema':\n labelColor = bold;\n formattedLabel = labelColor(node.name);\n break;\n case 'table': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.name.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'columns':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'column': {\n // Parse column name format: \"columnName: contractType -> nativeType (nullability)\"\n // Color code: column name (cyan), contract type (default), native type (dim), nullability (dim)\n const columnMatch = node.name.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"contractType -> nativeType (nullability)\"\n // Match contract type (can contain /, @, etc.), arrow, native type, then nullability in parentheses\n const typeMatch = rest.match(/^([^\\s→]+)\\s*→\\s*([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2] && typeMatch[3]) {\n const contractType = typeMatch[1];\n const nativeType = typeMatch[2];\n const nullability = typeMatch[3];\n formattedLabel = `${cyan(columnName)}: ${contractType} → ${dim(nativeType)} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match (e.g., no native type or no nullability)\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.name;\n }\n break;\n }\n case 'type':\n case 'nullability':\n labelColor = (text) => text; // Default color\n formattedLabel = labelColor(node.name);\n break;\n case 'primaryKey': {\n // Parse \"primary key: columnName\" format - color \"primary key\" dim, columnName cyan\n const pkMatch = node.name.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'foreignKey':\n case 'unique':\n case 'index':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'dependency': {\n // Parse specific extension message formats\n // \"database is postgres\" -> dim \"database is\", cyan \"postgres\"\n const dbMatch = node.name.match(/^database is\\s+(.+)$/);\n if (dbMatch?.[1]) {\n const dbName = dbMatch[1];\n formattedLabel = `${dim('database is')} ${cyan(dbName)}`;\n } else {\n // \"vector extension is enabled\" -> dim everything except extension name\n // Match pattern: \"extensionName extension is enabled\"\n const extMatch = node.name.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire name with magenta\n labelColor = magenta;\n formattedLabel = labelColor(node.name);\n }\n }\n break;\n }\n default:\n formattedLabel = node.name;\n break;\n }\n } else {\n formattedLabel = node.name;\n }\n\n const statusGlyphColored = statusColor(statusGlyph);\n\n // Build the label with optional message for failure/warn nodes\n let nodeLabel = formattedLabel;\n if (\n (node.status === 'fail' || node.status === 'warn') &&\n node.message &&\n node.message.length > 0\n ) {\n // Always show message for failure/warn nodes - it provides crucial context\n // For parent nodes, the message summarizes child failures\n // For leaf nodes, the message explains the specific issue\n const messageText = formatDimText(`(${node.message})`);\n nodeLabel = `${formattedLabel} ${messageText}`;\n }\n\n // Root node renders without tree characters or | prefix\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(`${statusGlyphColored} ${nodeLabel}`);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${statusGlyphColored} ${nodeLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaVerificationTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database schema verification.\n */\nexport function formatSchemaVerifyOutput(\n result: VerifyDatabaseSchemaResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatRed = createColorFormatter(useColor, red);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n // Render verification tree first\n const treeLines = renderSchemaVerificationTree(result.schema.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n\n // Add counts and timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n lines.push(\n `${formatDimText(` pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n\n // Blank line before summary\n lines.push('');\n\n // Summary line at the end: summary with status glyph\n if (result.ok) {\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n } else {\n const codeText = result.code ? ` (${result.code})` : '';\n lines.push(`${formatRed('✖')} ${result.summary}${codeText}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database schema verification.\n */\nexport function formatSchemaVerifyJson(result: VerifyDatabaseSchemaResult): string {\n return JSON.stringify(result, null, 2);\n}\n\n// ============================================================================\n// Sign Output Formatters\n// ============================================================================\n\n/**\n * Formats human-readable output for database sign.\n */\nexport function formatSignOutput(result: SignDatabaseResult, flags: GlobalFlags): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (result.ok) {\n // Main success message in white (not dimmed)\n lines.push(`${formatGreen('✔')} Database signed`);\n\n // Show from -> to hashes with clear labels\n const previousHash = result.marker.previous?.storageHash ?? 'none';\n const currentHash = result.contract.storageHash;\n\n lines.push(`${formatDimText(` from: ${previousHash}`)}`);\n lines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\n if (isVerbose(flags, 1)) {\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.marker.previous?.profileHash) {\n lines.push(\n `${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database sign.\n */\nexport function formatSignJson(result: SignDatabaseResult): string {\n return JSON.stringify(result, null, 2);\n}\n"],"mappings":";;;;;;;AAgDA,SAAgB,mBACd,QACA,OACQ;CACR,IAAI,MAAM,OACR,OAAO;CAGT,MAAM,QAAkB,CAAC;CAEzB,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,KAAK;CACxD,MAAM,eAAe,qBAAqB,UAAU,MAAM;CAC1D,MAAM,iBAAiB,SAAiB,UAAU,UAAU,IAAI;CAChE,MAAM,mBACJ,OAAO,SAAS,SACZ,kBAAkB,OAAO,QAAQ,SAAS,cAAc,kBACxD;CAEN,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,GAAG,OAAO,SAAS;CAClD,MAAM,KAAK,GAAG,cAAc,mBAAmB,kBAAkB,GAAG;CACpE,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAC9E,IAAI,OAAO,SAAS,aAClB,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAEhF,IAAI,OAAO,SAAS,UAAU,OAAO,UAAU,UAAU,OAAO,CAAC,GAC/D,MAAM,KACJ,GAAG,cAAc,kBAAkB,OAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,OAAO,OAAO,KAAK,QAAQ,OAAO,OAAO,OAAO,MAAM,GACpI;CAEF,IAAI,OAAO,SAAS;EAClB,MAAM,KAAK,EAAE;EACb,MAAM,KAAK,GAAG,aAAa,GAAG,EAAE,GAAG,OAAO,SAAS;CACrD;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,QAAQ,MAAM,GAAG,GAAG;EAC1E;CACF;CAEA,OAAO,MAAM,KAAK,IAAI;AACxB;;;;AAKA,SAAgB,eAAe,QAAoC;CACjE,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACvC"}
|
|
1
|
+
{"version":3,"file":"verify-DcOYZ1tH.mjs","names":[],"sources":["../src/utils/formatters/verify.ts"],"sourcesContent":["import type {\n CoreSchemaView,\n IntrospectSchemaResult,\n SchemaTreeNode,\n SchemaVerificationNode,\n SignDatabaseResult,\n VerifyDatabaseResult,\n VerifyDatabaseSchemaResult,\n} from '@prisma-next/framework-components/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { bold, cyan, dim, green, magenta, red, yellow } from 'colorette';\nimport type { GlobalFlags } from '../global-flags';\nimport { createColorFormatter, formatDim, isVerbose } from './helpers';\n\n// ============================================================================\n// Verify Output Formatters\n// ============================================================================\n\nexport interface DbVerifyCommandSuccessResult {\n readonly ok: true;\n readonly mode: 'full' | 'marker-only';\n readonly summary: string;\n readonly contract: VerifyDatabaseResult['contract'];\n readonly marker?: VerifyDatabaseResult['marker'];\n readonly target: VerifyDatabaseResult['target'];\n readonly missingCodecs?: VerifyDatabaseResult['missingCodecs'];\n readonly codecCoverageSkipped?: VerifyDatabaseResult['codecCoverageSkipped'];\n readonly schema?: {\n readonly summary: string;\n readonly counts: VerifyDatabaseSchemaResult['schema']['counts'];\n readonly strict: boolean;\n };\n readonly warning?: string;\n readonly meta?:\n | (NonNullable<VerifyDatabaseResult['meta']> & {\n readonly schemaVerification: 'performed' | 'skipped';\n })\n | {\n readonly schemaVerification: 'performed' | 'skipped';\n };\n readonly timings: {\n readonly total: number;\n };\n}\n\n/**\n * Formats human-readable output for database verify.\n */\nexport function formatVerifyOutput(\n result: DbVerifyCommandSuccessResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatYellow = createColorFormatter(useColor, yellow);\n const formatDimText = (text: string) => formatDim(useColor, text);\n const verificationMode =\n result.mode === 'full'\n ? `marker + schema${result.schema?.strict ? ' (strict)' : ' (tolerant)'}`\n : 'marker only (--marker-only)';\n\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n lines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n lines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.mode === 'full' && result.schema && isVerbose(flags, 1)) {\n lines.push(\n `${formatDimText(` schema: pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n if (result.warning) {\n lines.push('');\n lines.push(`${formatYellow('⚠')} ${result.warning}`);\n }\n\n if (isVerbose(flags, 1)) {\n if (result.codecCoverageSkipped) {\n lines.push(\n `${formatDimText(' Codec coverage check skipped (helper returned no supported types)')}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database verify.\n */\nexport function formatVerifyJson(result: DbVerifyCommandSuccessResult): string {\n const output = {\n ok: result.ok,\n summary: result.summary,\n mode: result.mode,\n contract: result.contract,\n ...ifDefined('marker', result.marker),\n target: result.target,\n ...ifDefined('missingCodecs', result.missingCodecs),\n ...ifDefined('codecCoverageSkipped', result.codecCoverageSkipped),\n ...ifDefined('schema', result.schema),\n ...ifDefined('warning', result.warning),\n ...ifDefined('meta', result.meta),\n timings: result.timings,\n };\n\n return JSON.stringify(output, null, 2);\n}\n\n/**\n * Formats JSON output for database introspection.\n */\nexport function formatIntrospectJson(result: IntrospectSchemaResult<unknown>): string {\n return JSON.stringify(result, null, 2);\n}\n\n/**\n * Renders a schema tree structure from CoreSchemaView.\n * Matches the style of renderSchemaVerificationTree for consistency.\n */\nfunction renderSchemaTree(\n node: SchemaTreeNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format node label with color based on kind (matching schema-verify style)\n let formattedLabel: string = node.label;\n\n if (useColor) {\n switch (node.kind) {\n case 'root':\n formattedLabel = bold(node.label);\n break;\n case 'entity': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.label.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n // Fallback: color entire label with cyan\n formattedLabel = cyan(node.label);\n }\n break;\n }\n case 'collection': {\n // \"columns\" grouping node - dim the label\n formattedLabel = dim(node.label);\n break;\n }\n case 'field': {\n // Parse column name format: \"columnName: typeDisplay (nullability)\"\n // Color code: column name (cyan), type (default), nullability (dim)\n const columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"typeDisplay (nullability)\"\n const typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2]) {\n const typeDisplay = typeMatch[1];\n const nullability = typeMatch[2];\n formattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.label;\n }\n break;\n }\n case 'index': {\n // Parse index/unique constraint/primary key formats\n // \"primary key: columnName\" -> dim \"primary key\", cyan columnName\n const pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n // \"unique name\" -> dim \"unique\", cyan \"name\"\n const uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n if (uniqueMatch?.[1]) {\n const name = uniqueMatch[1];\n formattedLabel = `${dim('unique')} ${cyan(name)}`;\n } else {\n // \"index name\" or \"unique index name\" -> dim label prefix, cyan name\n const indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n if (indexMatch?.[2]) {\n const indexPrefix = indexMatch[1] ? `${dim('unique')} ` : '';\n const name = indexMatch[2];\n formattedLabel = `${indexPrefix}${dim('index')} ${cyan(name)}`;\n } else {\n formattedLabel = dim(node.label);\n }\n }\n }\n break;\n }\n case 'dependency': {\n // Parse extension message formats similar to schema-verify\n // \"extensionName extension is enabled\" -> cyan extensionName, dim rest\n const extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire label with magenta\n formattedLabel = magenta(node.label);\n }\n break;\n }\n default:\n formattedLabel = node.label;\n break;\n }\n }\n\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(formattedLabel);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${formattedLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database introspection.\n */\nexport function formatIntrospectOutput(\n result: IntrospectSchemaResult<unknown>,\n schemaView: CoreSchemaView | undefined,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (schemaView) {\n // Render tree structure - root node is special (no tree characters)\n const treeLines = renderSchemaTree(schemaView.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n } else {\n // Fallback: print summary when toSchemaView is not available\n lines.push(`✔ ${result.summary}`);\n if (isVerbose(flags, 1)) {\n lines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n if (result.meta?.dbUrl) {\n lines.push(` Database: ${result.meta.dbUrl}`);\n }\n }\n }\n\n // Add timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Renders a schema verification tree structure from SchemaVerificationNode.\n * Similar to renderSchemaTree but for verification nodes with status-based colors and glyphs.\n */\nfunction renderSchemaVerificationTree(\n node: SchemaVerificationNode,\n flags: GlobalFlags,\n options: {\n readonly isLast: boolean;\n readonly prefix: string;\n readonly useColor: boolean;\n readonly formatDimText: (text: string) => string;\n readonly isRoot?: boolean;\n },\n): string[] {\n const { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n const lines: string[] = [];\n\n // Format status glyph and color based on status\n let statusGlyph = '';\n let statusColor: (text: string) => string = (text) => text;\n if (useColor) {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n statusColor = green;\n break;\n case 'warn':\n statusGlyph = '⚠';\n statusColor = (text) => (useColor ? yellow(text) : text);\n break;\n case 'fail':\n statusGlyph = '✖';\n statusColor = red;\n break;\n }\n } else {\n switch (node.status) {\n case 'pass':\n statusGlyph = '✔';\n break;\n case 'warn':\n statusGlyph = '⚠';\n break;\n case 'fail':\n statusGlyph = '✖';\n break;\n }\n }\n\n // Format node label with color based on kind\n // For column nodes, we need to parse the name to color code different parts\n let labelColor: (text: string) => string = (text) => text;\n let formattedLabel: string = node.name;\n\n if (useColor) {\n switch (node.kind) {\n case 'contract':\n case 'schema':\n labelColor = bold;\n formattedLabel = labelColor(node.name);\n break;\n case 'table': {\n // Parse \"table tableName\" format - color \"table\" dim, tableName cyan\n const tableMatch = node.name.match(/^table\\s+(.+)$/);\n if (tableMatch?.[1]) {\n const tableName = tableMatch[1];\n formattedLabel = `${dim('table')} ${cyan(tableName)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'columns':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'column': {\n // Parse column name format: \"columnName: contractType -> nativeType (nullability)\"\n // Color code: column name (cyan), contract type (default), native type (dim), nullability (dim)\n const columnMatch = node.name.match(/^([^:]+):\\s*(.+)$/);\n if (columnMatch?.[1] && columnMatch[2]) {\n const columnName = columnMatch[1];\n const rest = columnMatch[2];\n // Parse rest: \"contractType -> nativeType (nullability)\"\n // Match contract type (can contain /, @, etc.), arrow, native type, then nullability in parentheses\n const typeMatch = rest.match(/^([^\\s→]+)\\s*→\\s*([^\\s(]+)\\s*(\\([^)]+\\))$/);\n if (typeMatch?.[1] && typeMatch[2] && typeMatch[3]) {\n const contractType = typeMatch[1];\n const nativeType = typeMatch[2];\n const nullability = typeMatch[3];\n formattedLabel = `${cyan(columnName)}: ${contractType} → ${dim(nativeType)} ${dim(nullability)}`;\n } else {\n // Fallback if format doesn't match (e.g., no native type or no nullability)\n formattedLabel = `${cyan(columnName)}: ${rest}`;\n }\n } else {\n formattedLabel = node.name;\n }\n break;\n }\n case 'type':\n case 'nullability':\n labelColor = (text) => text; // Default color\n formattedLabel = labelColor(node.name);\n break;\n case 'primaryKey': {\n // Parse \"primary key: columnName\" format - color \"primary key\" dim, columnName cyan\n const pkMatch = node.name.match(/^primary key:\\s*(.+)$/);\n if (pkMatch?.[1]) {\n const columnNames = pkMatch[1];\n formattedLabel = `${dim('primary key')}: ${cyan(columnNames)}`;\n } else {\n formattedLabel = dim(node.name);\n }\n break;\n }\n case 'foreignKey':\n case 'unique':\n case 'index':\n labelColor = dim;\n formattedLabel = labelColor(node.name);\n break;\n case 'dependency': {\n // Parse specific extension message formats\n // \"database is postgres\" -> dim \"database is\", cyan \"postgres\"\n const dbMatch = node.name.match(/^database is\\s+(.+)$/);\n if (dbMatch?.[1]) {\n const dbName = dbMatch[1];\n formattedLabel = `${dim('database is')} ${cyan(dbName)}`;\n } else {\n // \"vector extension is enabled\" -> dim everything except extension name\n // Match pattern: \"extensionName extension is enabled\"\n const extMatch = node.name.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n if (extMatch?.[1] && extMatch[2]) {\n const extName = extMatch[1];\n const rest = extMatch[2];\n formattedLabel = `${cyan(extName)} ${dim(rest)}`;\n } else {\n // Fallback: color entire name with magenta\n labelColor = magenta;\n formattedLabel = labelColor(node.name);\n }\n }\n break;\n }\n default:\n formattedLabel = node.name;\n break;\n }\n } else {\n formattedLabel = node.name;\n }\n\n const statusGlyphColored = statusColor(statusGlyph);\n\n // Build the label with optional message for failure/warn nodes\n let nodeLabel = formattedLabel;\n if (\n (node.status === 'fail' || node.status === 'warn') &&\n node.message &&\n node.message.length > 0\n ) {\n // Always show message for failure/warn nodes - it provides crucial context\n // For parent nodes, the message summarizes child failures\n // For leaf nodes, the message explains the specific issue\n const messageText = formatDimText(`(${node.message})`);\n nodeLabel = `${formattedLabel} ${messageText}`;\n }\n\n // Root node renders without tree characters or | prefix\n // Root node renders without tree characters or prefix\n if (isRoot) {\n lines.push(`${statusGlyphColored} ${nodeLabel}`);\n } else {\n const treeChar = isLast ? '└' : '├';\n const treePrefix = `${formatDimText(treeChar)}─ `;\n lines.push(`${prefix}${treePrefix}${statusGlyphColored} ${nodeLabel}`);\n }\n\n // Render children if present\n if (node.children && node.children.length > 0) {\n const childPrefix = isRoot ? '' : `${prefix}${isLast ? ' ' : `${formatDimText('│')} `}`;\n for (let i = 0; i < node.children.length; i++) {\n const child = node.children[i];\n if (!child) continue;\n const isLastChild = i === node.children.length - 1;\n const childLines = renderSchemaVerificationTree(child, flags, {\n isLast: isLastChild,\n prefix: childPrefix,\n useColor,\n formatDimText,\n isRoot: false,\n });\n lines.push(...childLines);\n }\n }\n\n return lines;\n}\n\n/**\n * Formats human-readable output for database schema verification.\n */\nexport function formatSchemaVerifyOutput(\n result: VerifyDatabaseSchemaResult,\n flags: GlobalFlags,\n): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatRed = createColorFormatter(useColor, red);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n // Render verification tree first\n const treeLines = renderSchemaVerificationTree(result.schema.root, flags, {\n isLast: true,\n prefix: '',\n useColor,\n formatDimText,\n isRoot: true,\n });\n lines.push(...treeLines);\n\n // Add counts and timings in verbose mode\n if (isVerbose(flags, 1)) {\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n lines.push(\n `${formatDimText(` pass=${result.schema.counts.pass} warn=${result.schema.counts.warn} fail=${result.schema.counts.fail}`)}`,\n );\n }\n\n // Blank line before summary\n lines.push('');\n\n // Summary line at the end: summary with status glyph\n if (result.ok) {\n lines.push(`${formatGreen('✔')} ${result.summary}`);\n } else {\n const codeText = result.code ? ` (${result.code})` : '';\n lines.push(`${formatRed('✖')} ${result.summary}${codeText}`);\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database schema verification.\n */\nexport function formatSchemaVerifyJson(result: VerifyDatabaseSchemaResult): string {\n return JSON.stringify(result, null, 2);\n}\n\n// ============================================================================\n// Sign Output Formatters\n// ============================================================================\n\n/**\n * Formats human-readable output for database sign.\n */\nexport function formatSignOutput(result: SignDatabaseResult, flags: GlobalFlags): string {\n if (flags.quiet) {\n return '';\n }\n\n const lines: string[] = [];\n\n const useColor = flags.color !== false;\n const formatGreen = createColorFormatter(useColor, green);\n const formatDimText = (text: string) => formatDim(useColor, text);\n\n if (result.ok) {\n // Main success message in white (not dimmed)\n lines.push(`${formatGreen('✔')} Database signed`);\n\n // Show from -> to hashes with clear labels\n const previousHash = result.marker.previous?.storageHash ?? 'none';\n const currentHash = result.contract.storageHash;\n\n lines.push(`${formatDimText(` from: ${previousHash}`)}`);\n lines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\n if (isVerbose(flags, 1)) {\n if (result.contract.profileHash) {\n lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n }\n if (result.marker.previous?.profileHash) {\n lines.push(\n `${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`,\n );\n }\n lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n }\n }\n\n return lines.join('\\n');\n}\n\n/**\n * Formats JSON output for database sign.\n */\nexport function formatSignJson(result: SignDatabaseResult): string {\n return JSON.stringify(result, null, 2);\n}\n"],"mappings":";;;;;;;AAgDA,SAAgB,mBACd,QACA,OACQ;CACR,IAAI,MAAM,OACR,OAAO;CAGT,MAAM,QAAkB,CAAC;CAEzB,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,KAAK;CACxD,MAAM,eAAe,qBAAqB,UAAU,MAAM;CAC1D,MAAM,iBAAiB,SAAiB,UAAU,UAAU,IAAI;CAChE,MAAM,mBACJ,OAAO,SAAS,SACZ,kBAAkB,OAAO,QAAQ,SAAS,cAAc,kBACxD;CAEN,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,GAAG,OAAO,SAAS;CAClD,MAAM,KAAK,GAAG,cAAc,mBAAmB,kBAAkB,GAAG;CACpE,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAC9E,IAAI,OAAO,SAAS,aAClB,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;CAEhF,IAAI,OAAO,SAAS,UAAU,OAAO,UAAU,UAAU,OAAO,CAAC,GAC/D,MAAM,KACJ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vB,IAAI,OAAO,SAAS,aAClB,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;GAEhF,IAAI,OAAO,OAAO,UAAU,aAC1B,MAAM,KACJ,GAAG,cAAc,2BAA2B,OAAO,OAAO,SAAS,aAAa,GAClF;GAEF,MAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,GAAG,GAAG;EAC1E;CACF;CAEA,OAAO,MAAM,KAAK,IAAI;AACxB;;;;AAKA,SAAgB,eAAe,QAAoC;CACjE,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACvC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0-dev.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,16 +9,15 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@clack/prompts": "^1.4.0",
|
|
12
|
-
"@
|
|
13
|
-
"@prisma-next/
|
|
14
|
-
"@prisma-next/
|
|
15
|
-
"@prisma-next/
|
|
16
|
-
"@prisma-next/
|
|
17
|
-
"@prisma-next/
|
|
18
|
-
"@prisma-next/
|
|
19
|
-
"@prisma-next/
|
|
20
|
-
"@prisma-next/
|
|
21
|
-
"@prisma-next/utils": "0.12.0-dev.9",
|
|
12
|
+
"@prisma-next/config": "0.13.0-dev.1",
|
|
13
|
+
"@prisma-next/contract": "0.13.0-dev.1",
|
|
14
|
+
"@prisma-next/emitter": "0.13.0-dev.1",
|
|
15
|
+
"@prisma-next/errors": "0.13.0-dev.1",
|
|
16
|
+
"@prisma-next/framework-components": "0.13.0-dev.1",
|
|
17
|
+
"@prisma-next/migration-tools": "0.13.0-dev.1",
|
|
18
|
+
"@prisma-next/psl-printer": "0.13.0-dev.1",
|
|
19
|
+
"@prisma-next/cli-telemetry": "0.13.0-dev.1",
|
|
20
|
+
"@prisma-next/utils": "0.13.0-dev.1",
|
|
22
21
|
"arktype": "^2.2.0",
|
|
23
22
|
"c12": "^3.3.4",
|
|
24
23
|
"ci-info": "^4.3.1",
|
|
@@ -35,18 +34,18 @@
|
|
|
35
34
|
"wrap-ansi": "^10.0.0"
|
|
36
35
|
},
|
|
37
36
|
"devDependencies": {
|
|
38
|
-
"@prisma-next/sql-contract": "0.
|
|
39
|
-
"@prisma-next/sql-contract-emitter": "0.
|
|
40
|
-
"@prisma-next/sql-contract-ts": "0.
|
|
41
|
-
"@prisma-next/sql-operations": "0.
|
|
42
|
-
"@prisma-next/sql-runtime": "0.
|
|
43
|
-
"@prisma-next/test-utils": "0.
|
|
44
|
-
"@prisma-next/tsconfig": "0.
|
|
45
|
-
"@prisma-next/tsdown": "0.
|
|
46
|
-
"@types/node": "25.
|
|
47
|
-
"tsdown": "0.22.
|
|
37
|
+
"@prisma-next/sql-contract": "0.13.0-dev.1",
|
|
38
|
+
"@prisma-next/sql-contract-emitter": "0.13.0-dev.1",
|
|
39
|
+
"@prisma-next/sql-contract-ts": "0.13.0-dev.1",
|
|
40
|
+
"@prisma-next/sql-operations": "0.13.0-dev.1",
|
|
41
|
+
"@prisma-next/sql-runtime": "0.13.0-dev.1",
|
|
42
|
+
"@prisma-next/test-utils": "0.13.0-dev.1",
|
|
43
|
+
"@prisma-next/tsconfig": "0.13.0-dev.1",
|
|
44
|
+
"@prisma-next/tsdown": "0.13.0-dev.1",
|
|
45
|
+
"@types/node": "25.9.1",
|
|
46
|
+
"tsdown": "0.22.1",
|
|
48
47
|
"typescript": "5.9.3",
|
|
49
|
-
"vitest": "4.1.
|
|
48
|
+
"vitest": "4.1.8"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
52
51
|
"typescript": ">=5.9"
|
|
@@ -141,6 +140,10 @@
|
|
|
141
140
|
"types": "./dist/commands/ref.d.mts",
|
|
142
141
|
"import": "./dist/commands/ref.mjs"
|
|
143
142
|
},
|
|
143
|
+
"./commands/telemetry": {
|
|
144
|
+
"types": "./dist/commands/telemetry/index.d.mts",
|
|
145
|
+
"import": "./dist/commands/telemetry/index.mjs"
|
|
146
|
+
},
|
|
144
147
|
"./config-loader": {
|
|
145
148
|
"types": "./dist/config-loader.d.mts",
|
|
146
149
|
"import": "./dist/config-loader.mjs"
|
|
@@ -170,6 +173,7 @@
|
|
|
170
173
|
"lint": "biome check . --error-on-warnings",
|
|
171
174
|
"lint:fix": "biome check --write .",
|
|
172
175
|
"lint:fix:unsafe": "biome check --write --unsafe .",
|
|
176
|
+
"gallery": "tsx scripts/gallery.ts",
|
|
173
177
|
"record": "tsx scripts/record.ts",
|
|
174
178
|
"clean": "rm -rf dist dist-tsc dist-tsc-prod coverage .tmp-output"
|
|
175
179
|
}
|
package/src/cli.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { createMigrationPlanCommand } from './commands/migration-plan';
|
|
|
23
23
|
import { createMigrationShowCommand } from './commands/migration-show';
|
|
24
24
|
import { createMigrationStatusCommand } from './commands/migration-status';
|
|
25
25
|
import { createRefCommand } from './commands/ref';
|
|
26
|
+
import { createTelemetryCommand } from './commands/telemetry';
|
|
26
27
|
import { setCommandDescriptions } from './utils/command-helpers';
|
|
27
28
|
import { formatCommandHelp, formatRootHelp } from './utils/formatters/help';
|
|
28
29
|
import { parseGlobalFlags } from './utils/global-flags';
|
|
@@ -303,6 +304,9 @@ const migrateCommand = createMigrateCommand();
|
|
|
303
304
|
// Top-level ref command (replaces `migration ref`)
|
|
304
305
|
const refCommand = createRefCommand();
|
|
305
306
|
|
|
307
|
+
// Top-level telemetry command
|
|
308
|
+
const telemetryCommand = createTelemetryCommand();
|
|
309
|
+
|
|
306
310
|
// Top-level init command
|
|
307
311
|
const initCommand = createInitCommand();
|
|
308
312
|
|
|
@@ -317,6 +321,7 @@ program.addCommand(contractCommand);
|
|
|
317
321
|
program.addCommand(dbCommand);
|
|
318
322
|
program.addCommand(migrationCommand);
|
|
319
323
|
program.addCommand(refCommand);
|
|
324
|
+
program.addCommand(telemetryCommand);
|
|
320
325
|
|
|
321
326
|
// Test-only hidden command used by `cli-telemetry`'s `cli-e2e.test.ts`
|
|
322
327
|
// to verify that telemetry still lands when a CLI command crashes
|
|
@@ -53,7 +53,7 @@ async function executeContractInferCommand(
|
|
|
53
53
|
return inspectResult;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const { config, target, meta, pslContractAst } = inspectResult.value;
|
|
56
|
+
const { config, target, meta, pslContractAst, pslBlockDescriptors } = inspectResult.value;
|
|
57
57
|
|
|
58
58
|
if (!pslContractAst) {
|
|
59
59
|
return notOk(
|
|
@@ -65,7 +65,7 @@ async function executeContractInferCommand(
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
const outputPath = resolveContractInferOutputPath(options, config.contract?.output);
|
|
68
|
-
const pslContent = printPsl(pslContractAst);
|
|
68
|
+
const pslContent = printPsl(pslContractAst, { pslBlockDescriptors: pslBlockDescriptors });
|
|
69
69
|
|
|
70
70
|
if (existsSync(outputPath) && !flags.json && !flags.quiet) {
|
|
71
71
|
ui.stderr(`\u26A0 Overwriting existing file: ${relative(process.cwd(), outputPath)}`);
|
|
@@ -71,7 +71,12 @@ function mapDbUpdateFailure(failure: DbUpdateFailure): CliStructuredError {
|
|
|
71
71
|
return errorRunnerFailed(failure.summary, {
|
|
72
72
|
why: failure.why ?? 'Migration runner failed',
|
|
73
73
|
fix,
|
|
74
|
-
|
|
74
|
+
meta: {
|
|
75
|
+
...failure.meta,
|
|
76
|
+
...(failure.warnings && failure.warnings.length > 0
|
|
77
|
+
? { plannerWarnings: failure.warnings }
|
|
78
|
+
: {}),
|
|
79
|
+
},
|
|
75
80
|
});
|
|
76
81
|
}
|
|
77
82
|
|
|
@@ -236,6 +241,7 @@ async function executeDbUpdateCommand(
|
|
|
236
241
|
: undefined,
|
|
237
242
|
),
|
|
238
243
|
...ifDefined('perSpace', result.value.perSpace),
|
|
244
|
+
...ifDefined('warnings', result.value.warnings),
|
|
239
245
|
advancedRef: refAdvancementFields.advancedRef,
|
|
240
246
|
plannedAdvanceRef: refAdvancementFields.plannedAdvanceRef,
|
|
241
247
|
summary: result.value.summary,
|