@prisma/orm-toolchain 8.0.0-rc.1-dev.28 → 8.0.0-rc.1-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/dist/{aggregate-BKbHUHLA.mjs → aggregate-BBsCbXgJ.mjs} +8 -8
- package/dist/{aggregate-BKbHUHLA.mjs.map → aggregate-BBsCbXgJ.mjs.map} +1 -1
- package/dist/bin__prisma-next.mjs +25 -25
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/cli.d.mts +2 -2
- package/dist/cli.mjs +257 -93
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__commands__contract-emit.mjs +1 -1
- package/dist/cli__commands__contract-infer.mjs +1 -1
- package/dist/cli__commands__db-init.mjs +1 -1
- package/dist/cli__commands__db-schema.mjs +1 -1
- package/dist/cli__commands__db-sign.mjs +1 -1
- package/dist/cli__commands__db-update.mjs +1 -1
- package/dist/cli__commands__db-verify.mjs +1 -1
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.mjs +1 -1
- package/dist/cli__commands__migration-graph.d.mts.map +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.mjs +1 -1
- package/dist/cli__commands__migration-log.mjs +1 -1
- package/dist/cli__commands__migration-new.mjs +1 -1
- package/dist/cli__commands__migration-plan.mjs +1 -1
- package/dist/cli__commands__migration-show.mjs +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.mjs +1 -1
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +14 -13
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +15 -15
- package/dist/cli__migration-cli.mjs +2 -2
- package/dist/{client-CaIWFVnh-PVaTEvdx.mjs → client-C4Gh4PBz-BMUlBcuE.mjs} +6 -6
- package/dist/{client-CaIWFVnh-PVaTEvdx.mjs.map → client-C4Gh4PBz-BMUlBcuE.mjs.map} +1 -1
- package/dist/{command-helpers-DutQjYgy-CDfFwtAa.mjs → command-helpers-Dw3LDEu_-B4AETH4D.mjs} +4 -4
- package/dist/{command-helpers-DutQjYgy-CDfFwtAa.mjs.map → command-helpers-Dw3LDEu_-B4AETH4D.mjs.map} +1 -1
- package/dist/{contract-at-errors-BsQiGdZC-BY8u2is4.mjs → contract-at-errors-BsQiGdZC-D8l9-WWt.mjs} +2 -2
- package/dist/{contract-at-errors-BsQiGdZC-BY8u2is4.mjs.map → contract-at-errors-BsQiGdZC-D8l9-WWt.mjs.map} +1 -1
- package/dist/{contract-emit-BJDLPMxp-qaGmQUQr.mjs → contract-emit-CIdgw3Kq-BcfYaUfn.mjs} +4 -4
- package/dist/{contract-emit-BJDLPMxp-qaGmQUQr.mjs.map → contract-emit-CIdgw3Kq-BcfYaUfn.mjs.map} +1 -1
- package/dist/{contract-infer-B929dnCJ-KkT9frLY.mjs → contract-infer-xOEwVWds-CE5gw1PF.mjs} +5 -5
- package/dist/{contract-infer-B929dnCJ-KkT9frLY.mjs.map → contract-infer-xOEwVWds-CE5gw1PF.mjs.map} +1 -1
- package/dist/{contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs → contract-snapshot-resolution-BnH6_mw7-BrzAsS93.mjs} +6 -6
- package/dist/{contract-snapshot-resolution-D2f9kGs0-BenF4tbi.mjs.map → contract-snapshot-resolution-BnH6_mw7-BrzAsS93.mjs.map} +1 -1
- package/dist/{contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs → contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs} +3 -3
- package/dist/{contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs.map → contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs → contract-space-aggregate-loader-1wG1OiDk-D75luh5-.mjs} +5 -5
- package/dist/{contract-space-aggregate-loader-sF0OJ6oz-jRjdZoyZ.mjs.map → contract-space-aggregate-loader-1wG1OiDk-D75luh5-.mjs.map} +1 -1
- package/dist/{db-init-CU_x-p2M-_6oEFLiG.mjs → db-init-CEk9Utl4-vGmJajwZ.mjs} +6 -6
- package/dist/{db-init-CU_x-p2M-_6oEFLiG.mjs.map → db-init-CEk9Utl4-vGmJajwZ.mjs.map} +1 -1
- package/dist/{db-schema-BKAn8UrM-DP4k7BAB.mjs → db-schema-D_PJvBI3-BTnfCqbX.mjs} +6 -6
- package/dist/{db-schema-BKAn8UrM-DP4k7BAB.mjs.map → db-schema-D_PJvBI3-BTnfCqbX.mjs.map} +1 -1
- package/dist/{db-sign-BQF-jVXg-D467Bhpj.mjs → db-sign-Bparnnii-Yd5pb4VF.mjs} +7 -7
- package/dist/{db-sign-BQF-jVXg-D467Bhpj.mjs.map → db-sign-Bparnnii-Yd5pb4VF.mjs.map} +1 -1
- package/dist/{db-update-B0_Q4ykE-CT9vcaMu.mjs → db-update-CsKZyDYp-B8Zl7W4k.mjs} +7 -7
- package/dist/{db-update-B0_Q4ykE-CT9vcaMu.mjs.map → db-update-CsKZyDYp-B8Zl7W4k.mjs.map} +1 -1
- package/dist/{db-verify-C0DJc8z6-f3gZeEMD.mjs → db-verify-B33E7HXH-D87fiNt3.mjs} +6 -6
- package/dist/{db-verify-C0DJc8z6-f3gZeEMD.mjs.map → db-verify-B33E7HXH-D87fiNt3.mjs.map} +1 -1
- package/dist/{errors-Co-8oaiB-CB-6Uqki.mjs → errors-CXbGUWGu-BQi6YS-H.mjs} +51 -2
- package/dist/errors-CXbGUWGu-BQi6YS-H.mjs.map +1 -0
- package/dist/{errors-NRmFpwR1.d.mts → errors-KWM8yBAL.d.mts} +3 -1
- package/dist/errors-KWM8yBAL.d.mts.map +1 -0
- package/dist/{format-SYdHyutg-IqXk-tDV.mjs → format-CYdgHub4-Cs6VcFje.mjs} +4 -4
- package/dist/{format-SYdHyutg-IqXk-tDV.mjs.map → format-CYdgHub4-Cs6VcFje.mjs.map} +1 -1
- package/dist/{graph-membership-BEmNEMtP-rz61CLM5.mjs → graph-membership-BViWUMpP-Cgu4Z2ox.mjs} +3 -3
- package/dist/{graph-membership-BEmNEMtP-rz61CLM5.mjs.map → graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map} +1 -1
- package/dist/{init-DXx66xTA-BkK1aEw0.mjs → init-CrypFQwk-XiyERkdi.mjs} +3 -3
- package/dist/{init-DXx66xTA-BkK1aEw0.mjs.map → init-CrypFQwk-XiyERkdi.mjs.map} +1 -1
- package/dist/{inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs → inspect-live-schema-BAiaX0n9-DBQFEsMC.mjs} +4 -4
- package/dist/{inspect-live-schema-D8d7aI6a-_Q_4S5wm.mjs.map → inspect-live-schema-BAiaX0n9-DBQFEsMC.mjs.map} +1 -1
- package/dist/{invariants-C1WVUAH7-DlOBTTkM.mjs → invariants-CTHy88OP-DJ-i5yTz.mjs} +3 -3
- package/dist/{invariants-C1WVUAH7-DlOBTTkM.mjs.map → invariants-CTHy88OP-DJ-i5yTz.mjs.map} +1 -1
- package/dist/{invariants-TW5CizTS-BsIpi4h4.mjs → invariants-CsxL0lbZ-B9Hfpj2R.mjs} +6 -6
- package/dist/{invariants-TW5CizTS-BsIpi4h4.mjs.map → invariants-CsxL0lbZ-B9Hfpj2R.mjs.map} +1 -1
- package/dist/{io-CHUUeHh0-CbyTkKP6.mjs → io-635GlNx1-D94PxRc-.mjs} +5 -5
- package/dist/{io-CHUUeHh0-CbyTkKP6.mjs.map → io-635GlNx1-D94PxRc-.mjs.map} +1 -1
- package/dist/{migrate-vNMZJk7M-DKogRyOh.mjs → migrate-DYx_CSbN-BuQ0lk-0.mjs} +13 -13
- package/dist/{migrate-vNMZJk7M-DKogRyOh.mjs.map → migrate-DYx_CSbN-BuQ0lk-0.mjs.map} +1 -1
- package/dist/{migrate-show-C-fdCznr-BH88FGVn.mjs → migrate-show-CPZEq35I-DeL3WVjs.mjs} +9 -9
- package/dist/{migrate-show-C-fdCznr-BH88FGVn.mjs.map → migrate-show-CPZEq35I-DeL3WVjs.mjs.map} +1 -1
- package/dist/{migration-check-C-2GTAGq-Duc0P6Uo.mjs → migration-check-BUAcSrvA-DSS5Yvco.mjs} +9 -9
- package/dist/{migration-check-C-2GTAGq-Duc0P6Uo.mjs.map → migration-check-BUAcSrvA-DSS5Yvco.mjs.map} +1 -1
- package/dist/{migration-check-DATj3HSn-Del6ZSln.mjs → migration-check-D0ABv6pO-BCJRf3lE.mjs} +6 -6
- package/dist/{migration-check-DATj3HSn-Del6ZSln.mjs.map → migration-check-D0ABv6pO-BCJRf3lE.mjs.map} +1 -1
- package/dist/{migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs → migration-command-scaffold-CIMPoR6f-Ba-S9gXa.mjs} +4 -4
- package/dist/{migration-command-scaffold-BezR8GWB-BZFB2PC-.mjs.map → migration-command-scaffold-CIMPoR6f-Ba-S9gXa.mjs.map} +1 -1
- package/dist/{migration-graph-B1mg_jel-HVG6FLD0.mjs → migration-graph-BsGstA5L-BQiNbrkP.mjs} +9 -9
- package/dist/{migration-graph-B1mg_jel-HVG6FLD0.mjs.map → migration-graph-BsGstA5L-BQiNbrkP.mjs.map} +1 -1
- package/dist/{migration-graph-BtP1Va3T-CMOZgqVW.mjs → migration-graph-BtP1Va3T-C8PpuaYw.mjs} +2 -2
- package/dist/{migration-graph-BtP1Va3T-CMOZgqVW.mjs.map → migration-graph-BtP1Va3T-C8PpuaYw.mjs.map} +1 -1
- package/dist/{migration-graph-DDaOHo10-yJFAbKCu.mjs → migration-graph-_SJImD5V-D5RCc651.mjs} +3 -3
- package/dist/{migration-graph-DDaOHo10-yJFAbKCu.mjs.map → migration-graph-_SJImD5V-D5RCc651.mjs.map} +1 -1
- package/dist/{migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs → migration-graph-command-render-CgdHruiZ-B6V4gmUe.mjs} +321 -153
- package/dist/migration-graph-command-render-CgdHruiZ-B6V4gmUe.mjs.map +1 -0
- package/dist/{migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs → migration-graph-sections-CceYWPCP-LqImOaK1.mjs} +6 -4
- package/dist/migration-graph-sections-CceYWPCP-LqImOaK1.mjs.map +1 -0
- package/dist/{migration-_C5W2uXF.mjs → migration-gubSSeMk.mjs} +3 -3
- package/dist/{migration-_C5W2uXF.mjs.map → migration-gubSSeMk.mjs.map} +1 -1
- package/dist/{migration-list-AKRIIovW-Cr39jOaI.mjs → migration-list-AKRIIovW-BN-Zrwk0.mjs} +3 -3
- package/dist/{migration-list-AKRIIovW-Cr39jOaI.mjs.map → migration-list-AKRIIovW-BN-Zrwk0.mjs.map} +1 -1
- package/dist/{migration-list-RSlyGyvD-KKmZtdY1.mjs → migration-list-BiVyonwG-CdMbBV5Z.mjs} +7 -7
- package/dist/{migration-list-RSlyGyvD-KKmZtdY1.mjs.map → migration-list-BiVyonwG-CdMbBV5Z.mjs.map} +1 -1
- package/dist/{migration-log-CBfOcyPC-DTqCL1cs.mjs → migration-log-Z3-L172x-CvQTNJvI.mjs} +7 -7
- package/dist/{migration-log-CBfOcyPC-DTqCL1cs.mjs.map → migration-log-Z3-L172x-CvQTNJvI.mjs.map} +1 -1
- package/dist/{migration-log-table-C0dSMG9T-BhBYrdka.mjs → migration-log-table-JR7fFVbE-DR2mom6h.mjs} +4 -4
- package/dist/{migration-log-table-C0dSMG9T-BhBYrdka.mjs.map → migration-log-table-JR7fFVbE-DR2mom6h.mjs.map} +1 -1
- package/dist/{migration-new-1LYliIXy-BK_Xz0Z6.mjs → migration-new-DDnQd7Ql-1WT_J_zf.mjs} +5 -5
- package/dist/{migration-new-1LYliIXy-BK_Xz0Z6.mjs.map → migration-new-DDnQd7Ql-1WT_J_zf.mjs.map} +1 -1
- package/dist/{migration-new-DcPO4tiw-Bew7S-bj.mjs → migration-new-ZlgxFcbH-CxlZs2hr.mjs} +8 -8
- package/dist/{migration-new-DcPO4tiw-Bew7S-bj.mjs.map → migration-new-ZlgxFcbH-CxlZs2hr.mjs.map} +1 -1
- package/dist/{migration-plan-B0z2Qpa5-6b1SJSsb.mjs → migration-plan-CROSunPS-B66Rh_6T.mjs} +5 -5
- package/dist/{migration-plan-B0z2Qpa5-6b1SJSsb.mjs.map → migration-plan-CROSunPS-B66Rh_6T.mjs.map} +1 -1
- package/dist/{migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs → migration-plan-DiLJTAep-2B463CwW.mjs} +14 -14
- package/dist/{migration-plan-Cb7s5Ifx-Bwa2O0Ov.mjs.map → migration-plan-DiLJTAep-2B463CwW.mjs.map} +1 -1
- package/dist/{migration-show-BRy1GVBE-NuwoczhZ.mjs → migration-show-mJD52S2d-DiD-rCBB.mjs} +7 -7
- package/dist/{migration-show-BRy1GVBE-NuwoczhZ.mjs.map → migration-show-mJD52S2d-DiD-rCBB.mjs.map} +1 -1
- package/dist/{migration-status-Dob4onB1-0YkQF25g.mjs → migration-status-Df6EwEun-CbrQHa3S.mjs} +11 -11
- package/dist/{migration-status-Dob4onB1-0YkQF25g.mjs.map → migration-status-Df6EwEun-CbrQHa3S.mjs.map} +1 -1
- package/dist/migration-tools.d.mts +1 -1
- package/dist/migration-tools.mjs +12 -12
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
- package/dist/migration-tools__errors.d.mts +1 -1
- package/dist/migration-tools__errors.mjs +1 -1
- package/dist/migration-tools__invariants.mjs +1 -1
- package/dist/migration-tools__io.mjs +1 -1
- package/dist/migration-tools__migration-graph.mjs +2 -2
- package/dist/migration-tools__migration.mjs +1 -1
- package/dist/migration-tools__ref-resolution.mjs +1 -1
- package/dist/migration-tools__refs.mjs +1 -1
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{ref-B643Z0CS-CoJgdv7h.mjs → ref-Cycefq_T-DQE5AM66.mjs} +5 -5
- package/dist/{ref-B643Z0CS-CoJgdv7h.mjs.map → ref-Cycefq_T-DQE5AM66.mjs.map} +1 -1
- package/dist/{ref-D9J4TNYz-Dk7HCAoq.mjs → ref-DftuSibc-CasZ6LgA.mjs} +10 -10
- package/dist/{ref-D9J4TNYz-Dk7HCAoq.mjs.map → ref-DftuSibc-CasZ6LgA.mjs.map} +1 -1
- package/dist/{ref-advancement-DaZBzm7m-Deq5Cs7O.mjs → ref-advancement-DaZBzm7m-WoqnFAyr.mjs} +4 -4
- package/dist/{ref-advancement-DaZBzm7m-Deq5Cs7O.mjs.map → ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map} +1 -1
- package/dist/{ref-resolution-Bi4lpxM8-BX-7sl0f.mjs → ref-resolution-Bi4lpxM8-BbfL_yv8.mjs} +2 -2
- package/dist/{ref-resolution-Bi4lpxM8-BX-7sl0f.mjs.map → ref-resolution-Bi4lpxM8-BbfL_yv8.mjs.map} +1 -1
- package/dist/{ref-resolution-Ct2GMcNB.mjs → ref-resolution-sGcINe7o.mjs} +2 -2
- package/dist/{ref-resolution-Ct2GMcNB.mjs.map → ref-resolution-sGcINe7o.mjs.map} +1 -1
- package/dist/{refs-B2BL8z3i-DGGFB7Mj.mjs → refs-WK86uYYp-B6EZkmmT.mjs} +19 -3
- package/dist/refs-WK86uYYp-B6EZkmmT.mjs.map +1 -0
- package/dist/{refs-fQLFcMoq-UTlvnijY.mjs → refs-fQLFcMoq-aTBeUU9H.mjs} +4 -4
- package/dist/{refs-fQLFcMoq-UTlvnijY.mjs.map → refs-fQLFcMoq-aTBeUU9H.mjs.map} +1 -1
- package/dist/{spaces-DBTCE3Js.mjs → spaces-BG2w0P8d.mjs} +6 -6
- package/dist/{spaces-DBTCE3Js.mjs.map → spaces-BG2w0P8d.mjs.map} +1 -1
- package/dist/{telemetry-DFEbk6sD-BYEW2bCJ.mjs → telemetry-LP1Suxsf-CY1l7lD0.mjs} +4 -4
- package/dist/{telemetry-DFEbk6sD-BYEW2bCJ.mjs.map → telemetry-LP1Suxsf-CY1l7lD0.mjs.map} +1 -1
- package/dist/{terminal-ui-DQNCDg2u-B3PFqjB8.mjs → terminal-ui-JJKxvT0q-CPDEJqqU.mjs} +35 -11
- package/dist/terminal-ui-JJKxvT0q-CPDEJqqU.mjs.map +1 -0
- package/dist/{verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs → verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs} +4 -4
- package/dist/{verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map → verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map} +1 -1
- package/dist/{verify-TphNCyMu-h8vrnbud.mjs → verify-wUSBDQwh-Bv3NV9WG.mjs} +3 -3
- package/dist/{verify-TphNCyMu-h8vrnbud.mjs.map → verify-wUSBDQwh-Bv3NV9WG.mjs.map} +1 -1
- package/package.json +13 -13
- package/dist/errors-Co-8oaiB-CB-6Uqki.mjs.map +0 -1
- package/dist/errors-NRmFpwR1.d.mts.map +0 -1
- package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs.map +0 -1
- package/dist/migration-graph-sections-BVqyqBHg-DAwWjIIf.mjs.map +0 -1
- package/dist/refs-B2BL8z3i-DGGFB7Mj.mjs.map +0 -1
- package/dist/terminal-ui-DQNCDg2u-B3PFqjB8.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-
|
|
1
|
+
{"version":3,"file":"telemetry-LP1Suxsf-CY1l7lD0.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/telemetry-LP1Suxsf.mjs"],"sourcesContent":["import { t as createTerminalUI } from \"./terminal-ui-JJKxvT0q.mjs\";\nimport { _ as parseGlobalFlagsOrExit, b as formatCommandHelp, d as setCommandExamples, g as parseGlobalFlags, t as addGlobalOptions, u as setCommandDescriptions, y as isCI } from \"./command-helpers-Dw3LDEu_.mjs\";\nimport { Command } from \"commander\";\nimport { readUserConfig, resolveGating, userConfigPath, writeUserConfig } from \"@internal/cli-telemetry\";\n//#region src/commands/telemetry/status.ts\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*/\nfunction resolveTelemetryStatus(inputs) {\n\tconst config = readUserConfig();\n\tconst configPath = userConfigPath();\n\tconst installationIdStored = typeof config.installationId === \"string\" && config.installationId.length > 0;\n\tif (inputs.inCI) return {\n\t\tenabled: false,\n\t\treason: \"ci\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n\tconst gating = resolveGating({\n\t\tenv: inputs.env,\n\t\tconfig\n\t});\n\tif (!gating.enabled) return {\n\t\tenabled: false,\n\t\treason: gating.reason === \"env-override\" ? \"env-opt-out\" : \"stored-opt-out\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n\treturn {\n\t\tenabled: true,\n\t\treason: config.enableTelemetry === true ? \"stored-opt-in\" : \"default-on\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n}\nconst REASON_EXPLANATION = {\n\tci: \"CI environment detected — telemetry is hard-disabled.\",\n\t\"env-opt-out\": \"an environment opt-out is set (DO_NOT_TRACK / PRISMA_NEXT_DISABLE_TELEMETRY).\",\n\t\"stored-opt-out\": \"\\\"enableTelemetry\\\": false is stored in your config.\",\n\t\"stored-opt-in\": \"\\\"enableTelemetry\\\": true is stored in your config.\",\n\t\"default-on\": \"no explicit choice is stored, so the opt-out default applies.\"\n};\nfunction formatTelemetryStatusLines(status) {\n\treturn [\n\t\t`Telemetry is ${status.enabled ? \"enabled\" : \"disabled\"}: ${REASON_EXPLANATION[status.reason]}`,\n\t\t`Config file: ${status.configPath}`,\n\t\t`Installation ID: ${status.installationIdStored ? \"stored\" : \"not stored\"}`\n\t];\n}\n//#endregion\n//#region src/commands/telemetry/index.ts\nfunction createTelemetryStatusCommand() {\n\tconst command = new Command(\"status\");\n\tsetCommandDescriptions(command, \"Show whether anonymous CLI telemetry is enabled and why\", \"Reports whether telemetry is currently enabled or disabled and the reason\\n(default-on, stored opt-out, environment opt-out, or CI), the path to your\\nuser-level config file, and whether an installation ID has been stored.\\nRead-only: never sends an event, never mints an ID, never writes anything.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst status = resolveTelemetryStatus({\n\t\t\tenv: process.env,\n\t\t\tinCI: isCI()\n\t\t});\n\t\tif (flags.json) ui.output(JSON.stringify(status));\n\t\telse for (const line of formatTelemetryStatusLines(status)) ui.output(line);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryEnableCommand() {\n\tconst command = new Command(\"enable\");\n\tsetCommandDescriptions(command, \"Enable anonymous CLI telemetry\", \"Stores \\\"enableTelemetry\\\": true in your user-level config and mints an\\ninstallation ID if one is not already stored.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\twriteUserConfig({ enableTelemetry: true });\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (flags.json) ui.output(JSON.stringify({\n\t\t\tenableTelemetry: true,\n\t\t\tconfigPath: userConfigPath()\n\t\t}));\n\t\telse ui.output(`Telemetry enabled. Preference stored in ${userConfigPath()}.`);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryDisableCommand() {\n\tconst command = new Command(\"disable\");\n\tsetCommandDescriptions(command, \"Disable anonymous CLI telemetry\", \"Stores \\\"enableTelemetry\\\": false in your user-level config. No installation\\nID is minted and no event is sent.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\twriteUserConfig({ enableTelemetry: false });\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (flags.json) ui.output(JSON.stringify({\n\t\t\tenableTelemetry: false,\n\t\t\tconfigPath: userConfigPath()\n\t\t}));\n\t\telse ui.output(`Telemetry disabled. Preference stored in ${userConfigPath()}.`);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryCommand() {\n\tconst command = new Command(\"telemetry\");\n\tsetCommandDescriptions(command, \"Inspect and change anonymous CLI telemetry\", \"Show telemetry status, or enable / disable anonymous CLI usage data.\\nTelemetry is on by default (opt-out); see https://prisma-next.dev/docs/cli/telemetry\\nfor what is collected and why.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next telemetry status\",\n\t\t\"prisma-next telemetry disable\",\n\t\t\"prisma-next telemetry enable\"\n\t]);\n\tcommand.configureHelp({\n\t\tformatHelp: (cmd) => formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t}),\n\t\tsubcommandDescription: () => \"\"\n\t});\n\tcommand.addCommand(createTelemetryStatusCommand());\n\tcommand.addCommand(createTelemetryEnableCommand());\n\tcommand.addCommand(createTelemetryDisableCommand());\n\treturn command;\n}\n//#endregion\nexport { createTelemetryCommand as t };\n\n//# sourceMappingURL=telemetry-LP1Suxsf.mjs.map"],"mappings":";;;;;;;;;;;AAWA,SAAS,uBAAuB,QAAQ;CACvC,MAAM,SAAS,eAAe;CAC9B,MAAM,aAAa,eAAe;CAClC,MAAM,uBAAuB,OAAO,OAAO,mBAAmB,YAAY,OAAO,eAAe,SAAS;CACzG,IAAI,OAAO,MAAM,OAAO;EACvB,SAAS;EACT,QAAQ;EACR;EACA;CACD;CACA,MAAM,SAAS,cAAc;EAC5B,KAAK,OAAO;EACZ;CACD,CAAC;CACD,IAAI,CAAC,OAAO,SAAS,OAAO;EAC3B,SAAS;EACT,QAAQ,OAAO,WAAW,iBAAiB,gBAAgB;EAC3D;EACA;CACD;CACA,OAAO;EACN,SAAS;EACT,QAAQ,OAAO,oBAAoB,OAAO,kBAAkB;EAC5D;EACA;CACD;AACD;AACA,MAAM,qBAAqB;CAC1B,IAAI;CACJ,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,cAAc;AACf;AACA,SAAS,2BAA2B,QAAQ;CAC3C,OAAO;EACN,gBAAgB,OAAO,UAAU,YAAY,WAA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AAiB,KAAK;EACjC,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU;GACxC,iBAAiB;GACjB,YAAY,eAAe;EAC5B,CAAC,CAAC;OACG,GAAG,OAAO,4CAA4C,eAAe,EAAE,EAAE;EAC9E,QAAQ,KAAK,CAAC;CACf,CAAC;AACF;AACA,SAAS,yBAAyB;CACjC,MAAM,UAAU,IAAI,QAAQ,WAAW;CACvC,uBAAuB,SAAS,8CAA8C,4LAA4L;CAC1Q,mBAAmB,SAAS;EAC3B;EACA;EACA;CACD,CAAC;CACD,QAAQ,cAAc;EACrB,aAAa,QAAQ,kBAAkB;GACtC,SAAS;GACT,OAAO,iBAAiB,CAAC,CAAC;EAC3B,CAAC;EACD,6BAA6B;CAC9B,CAAC;CACD,QAAQ,WAAW,6BAA6B,CAAC;CACjD,QAAQ,WAAW,6BAA6B,CAAC;CACjD,QAAQ,WAAW,8BAA8B,CAAC;CAClD,OAAO;AACR"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
1
2
|
import { blindCast } from "@prisma/orm-framework/utils/casts";
|
|
2
3
|
import { bold, cyan, dim, green, red, yellow } from "colorette";
|
|
3
4
|
import * as clack from "@clack/prompts";
|
|
4
|
-
//#region ../../../1-framework/3-tooling/cli/dist/terminal-ui-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/terminal-ui-JJKxvT0q.mjs
|
|
5
6
|
/**
|
|
6
7
|
* Checks if verbose output is enabled at the specified level.
|
|
7
8
|
*/
|
|
@@ -22,6 +23,15 @@ function formatDim(useColor, text) {
|
|
|
22
23
|
return useColor ? dim(text) : text;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
26
|
+
* The binary this package installs. Next-action commands are authored with a
|
|
27
|
+
* `{bin}` placeholder and rendered against this name, so no library-layer
|
|
28
|
+
* error hardcodes it.
|
|
29
|
+
*
|
|
30
|
+
* `test/output.next-actions.test.ts` asserts this stays equal to the sole key
|
|
31
|
+
* of the package manifest's `bin` map.
|
|
32
|
+
*/
|
|
33
|
+
const BIN_NAME = "prisma-next";
|
|
34
|
+
/**
|
|
25
35
|
* Render a single statement of an `OperationPreview` for the human-readable
|
|
26
36
|
* preview block. SQL statements get a trailing `;` if missing so the rendered
|
|
27
37
|
* preview is byte-identical to the legacy `string[]`-based renderer for SQL
|
|
@@ -171,13 +181,6 @@ function formatMigrationApplyCommandOutput(result, flags) {
|
|
|
171
181
|
}
|
|
172
182
|
return lines.join("\n");
|
|
173
183
|
}
|
|
174
|
-
/**
|
|
175
|
-
* The lines `migration show` puts on stdout: metadata, the operation tree, and
|
|
176
|
-
* the statement preview.
|
|
177
|
-
*/
|
|
178
|
-
function renderMigrationShowLines(space, options) {
|
|
179
|
-
return formatSpaceShowBlock(space, options.colorize);
|
|
180
|
-
}
|
|
181
184
|
function formatSpaceShowBlock(space, useColor) {
|
|
182
185
|
const formatGreen = createColorFormatter(useColor, green);
|
|
183
186
|
const formatYellow = createColorFormatter(useColor, yellow);
|
|
@@ -257,6 +260,27 @@ function formatMigrationApplyOutput(result, flags) {
|
|
|
257
260
|
function formatMigrationJson(result) {
|
|
258
261
|
return JSON.stringify(result, null, 2);
|
|
259
262
|
}
|
|
263
|
+
const BIN_PLACEHOLDER = "{bin}";
|
|
264
|
+
/**
|
|
265
|
+
* Rewrite the `{bin}` placeholder in every next-action command to `binName`.
|
|
266
|
+
*
|
|
267
|
+
* Library-layer error factories cannot know which binary the user invoked, so
|
|
268
|
+
* they write `{bin} ref set <name> <hash>`. Every surface that renders or
|
|
269
|
+
* serializes an envelope resolves the placeholder first, so a consumer only
|
|
270
|
+
* ever sees a command that is runnable as written.
|
|
271
|
+
*/
|
|
272
|
+
function resolveBinPlaceholder(envelope, binName) {
|
|
273
|
+
const substitute = (command) => command.replaceAll(BIN_PLACEHOLDER, binName);
|
|
274
|
+
const resolved = envelope.nextActions.map((action) => ({
|
|
275
|
+
...action,
|
|
276
|
+
...ifDefined("command", action.command?.replaceAll(BIN_PLACEHOLDER, binName)),
|
|
277
|
+
...ifDefined("commands", action.commands?.map(substitute))
|
|
278
|
+
}));
|
|
279
|
+
return {
|
|
280
|
+
...envelope,
|
|
281
|
+
nextActions: resolved
|
|
282
|
+
};
|
|
283
|
+
}
|
|
260
284
|
/**
|
|
261
285
|
* The display label for a schema-diff issue in the shared error envelope,
|
|
262
286
|
* derived from which sides are present: expected-only is a missing object,
|
|
@@ -323,7 +347,7 @@ function formatErrorOutput(error, flags) {
|
|
|
323
347
|
* Formats error output as JSON.
|
|
324
348
|
*/
|
|
325
349
|
function formatErrorJson(error) {
|
|
326
|
-
return JSON.stringify(error, null, 2);
|
|
350
|
+
return JSON.stringify(resolveBinPlaceholder(error, BIN_NAME), null, 2);
|
|
327
351
|
}
|
|
328
352
|
function localeString(env) {
|
|
329
353
|
return env["LC_ALL"] ?? env["LC_CTYPE"] ?? env["LANG"] ?? "";
|
|
@@ -647,6 +671,6 @@ function createTerminalUI(flags, runtime) {
|
|
|
647
671
|
});
|
|
648
672
|
}
|
|
649
673
|
//#endregion
|
|
650
|
-
export {
|
|
674
|
+
export { formatErrorJson as a, formatMigrationApplyOutput as c, formatMigrationShowOutput as d, installShutdownHandlers as f, formatDim as i, formatMigrationJson as l, previewBlockHeader as m, createColorFormatter as n, formatErrorOutput as o, isVerbose as p, createTerminalUI as r, formatMigrationApplyCommandOutput as s, BIN_NAME as t, formatMigrationPlanOutput as u };
|
|
651
675
|
|
|
652
|
-
//# sourceMappingURL=terminal-ui-
|
|
676
|
+
//# sourceMappingURL=terminal-ui-JJKxvT0q-CPDEJqqU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal-ui-JJKxvT0q-CPDEJqqU.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/terminal-ui-JJKxvT0q.mjs"],"sourcesContent":["import { ifDefined } from \"@internal/utils/defined\";\nimport { bold, cyan, dim, green, red, yellow } from \"colorette\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport * as clack from \"@clack/prompts\";\n//#region src/utils/formatters/helpers.ts\n/**\n* Checks if verbose output is enabled at the specified level.\n*/\nfunction isVerbose(flags, level) {\n\treturn (flags.verbose ?? 0) >= level;\n}\n/**\n* Creates a color-aware formatter function.\n* Returns a function that applies the color only if colors are enabled.\n*/\nfunction createColorFormatter(useColor, colorFn) {\n\treturn useColor ? colorFn : (text) => text;\n}\n/**\n* Formats text with dim styling if colors are enabled.\n*/\nfunction formatDim(useColor, text) {\n\treturn useColor ? dim(text) : text;\n}\n//#endregion\n//#region src/utils/bin-name.ts\n/**\n* The binary this package installs. Next-action commands are authored with a\n* `{bin}` placeholder and rendered against this name, so no library-layer\n* error hardcodes it.\n*\n* `test/output.next-actions.test.ts` asserts this stays equal to the sole key\n* of the package manifest's `bin` map.\n*/\nconst BIN_NAME = \"prisma-next\";\n//#endregion\n//#region src/utils/formatters/migrations.ts\n/**\n* Render a single statement of an `OperationPreview` for the human-readable\n* preview block. SQL statements get a trailing `;` if missing so the rendered\n* preview is byte-identical to the legacy `string[]`-based renderer for SQL\n* targets. Other languages (`'mongodb-shell'`) render verbatim.\n*/\nfunction renderPreviewStatement(text, language) {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return void 0;\n\tif (language === \"sql\") return trimmed.endsWith(\";\") ? trimmed : `${trimmed};`;\n\treturn trimmed;\n}\n/**\n* Choose the header label for a preview block. SQL-only previews keep the\n* legacy `DDL preview` label so the rendered output is byte-identical to the\n* pre-aggregate SQL CLI; previews from any other family — or a mix that\n* includes any non-SQL language — use the family-agnostic `Operation preview`\n* label.\n*\n* An empty `statements` array deliberately renders as `Operation preview`\n* rather than `DDL preview`: `Array.prototype.every` is vacuously true for\n* empty arrays, but we have no evidence the preview is SQL-only when no\n* statements are present, so the family-agnostic label is the safer default.\n*/\nfunction previewBlockHeader(preview) {\n\treturn preview.statements.length > 0 && preview.statements.every((s) => s.language === \"sql\") ? \"DDL preview\" : \"Operation preview\";\n}\nfunction formatPlannerWarningsBlock(warnings, useColor) {\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [\"\", \"Warnings:\"];\n\tfor (const warning of warnings) lines.push(` ${formatDimText(`- ${warning.summary}`)}`);\n\treturn lines;\n}\n/**\n* Render the shared per-space execution block consumed by the `db init`\n* / `db update` / `migrate` summaries. Always shows: space\n* label (`Extension space: <id>` or `App space`) → per-op lines under\n* each space → per-space marker hash (when known).\n*\n* `mode` controls the marker label phrasing — `'apply'` shows\n* `marker → <hash>` (post-apply), `'plan'` omits the marker line\n* entirely (no marker has been written yet).\n*/\nfunction formatPerSpaceBlock(perSpace, mode, useColor) {\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatCyan = createColorFormatter(useColor, cyan);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tfor (let s = 0; s < perSpace.length; s++) {\n\t\tconst space = perSpace[s];\n\t\tif (s > 0) lines.push(\"\");\n\t\tconst header = space.kind === \"app\" ? formatCyan(\"App space\") : formatCyan(`Extension space: ${space.spaceId}`);\n\t\tlines.push(header);\n\t\tif (space.operations.length === 0) lines.push(` ${formatDimText(\"(no operations)\")}`);\n\t\telse for (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(` ${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (mode === \"apply\" && space.marker) lines.push(` ${formatDimText(`marker: ${space.marker.storageHash}`)}`);\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in plan mode.\n*/\nfunction formatMigrationPlanOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst operationCount = result.plan?.operations.length ?? 0;\n\tconst spaceCount = result.perSpace?.length ?? 0;\n\tif (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\telse lines.push(`${formatGreen(\"✔\")} Planned ${operationCount} operation(s)`);\n\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tif (result.perSpace && result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"plan\", useColor));\n\t\tif (result.perSpace.some((s) => s.operations.some((op) => op.operationClass === \"destructive\"))) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t} else if (result.plan?.operations && result.plan.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < result.plan.operations.length; i++) {\n\t\t\tconst op = result.plan.operations[i];\n\t\t\tif (!op) continue;\n\t\t\tconst treeChar = i === result.plan.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (result.plan.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (result.plan?.destination) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(`Destination hash: ${result.plan.destination.storageHash}`)}`);\n\t}\n\tif (result.plannedAdvanceRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Would advance ref \"${result.plannedAdvanceRef.name}\" → ${result.plannedAdvanceRef.hash}`));\n\t}\n\tconst preview = result.plan?.preview;\n\tif (preview) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(preview))}`);\n\t\tif (preview.statements.length === 0) lines.push(`${formatDimText(\"No operations.\")}`);\n\t\telse {\n\t\t\tlines.push(\"\");\n\t\t\tfor (const statement of preview.statements) {\n\t\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\t\tif (rendered) lines.push(rendered);\n\t\t\t}\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(`Total time: ${result.timings.total}ms`)}`);\n\tlines.push(\"\");\n\tlines.push(`${formatDimText(\"This is a dry run. No changes were applied.\")}`);\n\tlines.push(`${formatDimText(\"Run without --dry-run to apply changes.\")}`);\n\treturn lines.join(\"\\n\");\n}\nfunction formatMigrationApplyCommandOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tif (result.perSpace.length > 0) {\n\t\tlines.push(\"\");\n\t\tfor (const line of formatPerSpaceBlock(result.perSpace, \"apply\", useColor)) lines.push(line);\n\t}\n\tif (result.advancedRef) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\tlines.push(\"\");\n\tlines.push(formatDimText(\"Next: prisma-next migration status\"));\n\tif (isVerbose(flags, 1) && result.timings) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatDimText(`Total time: ${result.timings.total}ms`));\n\t}\n\treturn lines.join(\"\\n\");\n}\nfunction formatSpaceShowBlock(space, useColor) {\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst lines = [];\n\tlines.push(`${formatGreen(\"✔\")} ${space.name}`);\n\tlines.push(`${formatDimText(` from: ${space.fromContract ?? \"(baseline)\"}`)}`);\n\tlines.push(`${formatDimText(` to: ${space.toContract}`)}`);\n\tlines.push(`${formatDimText(` hash: ${space.hash}`)}`);\n\tlines.push(`${formatDimText(` created: ${space.createdAt}`)}`);\n\tlines.push(\"\");\n\tlines.push(`${space.operations.length} operation(s)`);\n\tif (space.operations.length > 0) {\n\t\tlines.push(`${formatDimText(\"│\")}`);\n\t\tfor (let i = 0; i < space.operations.length; i++) {\n\t\t\tconst op = space.operations[i];\n\t\t\tconst treeChar = i === space.operations.length - 1 ? \"└\" : \"├\";\n\t\t\tconst destructiveMarker = op.operationClass === \"destructive\" ? ` ${formatYellow(\"(destructive)\")}` : \"\";\n\t\t\tlines.push(`${formatDimText(treeChar)}─ ${op.label}${destructiveMarker}`);\n\t\t}\n\t\tif (space.operations.some((op) => op.operationClass === \"destructive\")) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(`${formatYellow(\"⚠\")} This migration contains destructive operations that may cause data loss.`);\n\t\t}\n\t}\n\tif (space.preview.statements.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatDimText(previewBlockHeader(space.preview))}`);\n\t\tlines.push(\"\");\n\t\tfor (const statement of space.preview.statements) {\n\t\t\tconst rendered = renderPreviewStatement(statement.text, statement.language);\n\t\t\tif (rendered) lines.push(rendered);\n\t\t}\n\t}\n\treturn lines;\n}\nfunction formatMigrationShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst useColor = flags.color !== false;\n\treturn formatSpaceShowBlock(result.migration, useColor).join(\"\\n\");\n}\n/**\n* Formats human-readable output for migration commands (db init, db update) in apply mode.\n*/\nfunction formatMigrationApplyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tconst executed = result.execution?.operationsExecuted ?? 0;\n\t\tconst spaceCount = result.perSpace?.length ?? 0;\n\t\tif (executed === 0) {\n\t\t\tconst acrossClause = spaceCount > 0 ? ` across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}` : \"\";\n\t\t\tlines.push(`${formatGreen(\"✔\")} Database already matches contract${acrossClause}`);\n\t\t} else if (spaceCount > 0) lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s) across ${spaceCount} contract space${spaceCount === 1 ? \"\" : \"s\"}`);\n\t\telse lines.push(`${formatGreen(\"✔\")} Applied ${executed} operation(s)`);\n\t\tif (result.warnings && result.warnings.length > 0) lines.push(...formatPlannerWarningsBlock(result.warnings, useColor));\n\t\tif (result.perSpace && result.perSpace.length > 0) {\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(...formatPerSpaceBlock(result.perSpace, \"apply\", useColor));\n\t\t\tlines.push(\"\");\n\t\t\tlines.push(formatDimText(`Run 'prisma-next migration status' to confirm ${spaceCount === 1 ? \"the space is\" : \"all spaces are\"} up to date.`));\n\t\t} else if (result.marker) {\n\t\t\tlines.push(`${formatDimText(` App-space marker: ${result.marker.storageHash}`)}`);\n\t\t\tif (result.marker.profileHash) lines.push(`${formatDimText(` Profile hash: ${result.marker.profileHash}`)}`);\n\t\t}\n\t\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\tif (result.advancedRef) lines.push(formatDimText(`Advanced ref \"${result.advancedRef.name}\" → ${result.advancedRef.hash}`));\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for migration commands (db init, db update).\n*/\nfunction formatMigrationJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\n//#region src/utils/formatters/errors.ts\nconst BIN_PLACEHOLDER = \"{bin}\";\n/**\n* Rewrite the `{bin}` placeholder in every next-action command to `binName`.\n*\n* Library-layer error factories cannot know which binary the user invoked, so\n* they write `{bin} ref set <name> <hash>`. Every surface that renders or\n* serializes an envelope resolves the placeholder first, so a consumer only\n* ever sees a command that is runnable as written.\n*/\nfunction resolveBinPlaceholder(envelope, binName) {\n\tconst substitute = (command) => command.replaceAll(BIN_PLACEHOLDER, binName);\n\tconst resolved = envelope.nextActions.map((action) => ({\n\t\t...action,\n\t\t...ifDefined(\"command\", action.command?.replaceAll(BIN_PLACEHOLDER, binName)),\n\t\t...ifDefined(\"commands\", action.commands?.map(substitute))\n\t}));\n\treturn {\n\t\t...envelope,\n\t\tnextActions: resolved\n\t};\n}\n/**\n* The display label for a schema-diff issue in the shared error envelope,\n* derived from which sides are present: expected-only is a missing object,\n* actual-only an extra one, both a mismatch. `undefined` when the entry is not\n* a schema-diff issue (it carries neither side) so the caller can fall through\n* to its generic label.\n*/\nfunction schemaDiffIssueLabel(issue) {\n\tconst hasExpected = issue.expected !== void 0;\n\tconst hasActual = issue.actual !== void 0;\n\tif (hasExpected && hasActual) return \"mismatch\";\n\tif (hasExpected) return \"missing\";\n\tif (hasActual) return \"extra\";\n}\n/**\n* Formats error output for human-readable display.\n*/\nfunction formatErrorOutput(error, flags) {\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tlines.push(`${formatRed(\"✖\")} ${error.summary} (${error.code})`);\n\tif (error.why) lines.push(`${formatDimText(` Why: ${error.why}`)}`);\n\tif (error.fix) lines.push(`${formatDimText(` Fix: ${error.fix}`)}`);\n\tif (error.where?.path) {\n\t\tconst whereLine = error.where.line ? `${error.where.path}:${error.where.line}` : error.where.path;\n\t\tlines.push(`${formatDimText(` Where: ${whereLine}`)}`);\n\t}\n\tif (error.meta?.[\"conflicts\"]) {\n\t\tconst conflicts = error.meta[\"conflicts\"];\n\t\tif (conflicts.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? conflicts.length : Math.min(3, conflicts.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Conflicts:\" : ` Conflicts (showing ${maxToShow} of ${conflicts.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const conflict of conflicts.slice(0, maxToShow)) lines.push(`${formatDimText(` - [${conflict.kind}] ${conflict.summary}`)}`);\n\t\t\tif (!isVerbose(flags, 1) && conflicts.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all conflicts\")}`);\n\t\t}\n\t}\n\tif (error.meta?.[\"issues\"]) {\n\t\tconst issues = error.meta[\"issues\"];\n\t\tif (issues.length > 0) {\n\t\t\tconst maxToShow = isVerbose(flags, 1) ? issues.length : Math.min(3, issues.length);\n\t\t\tconst header = isVerbose(flags, 1) ? \" Issues:\" : ` Issues (showing ${maxToShow} of ${issues.length}):`;\n\t\t\tlines.push(`${formatDimText(header)}`);\n\t\t\tfor (const issue of issues.slice(0, maxToShow)) {\n\t\t\t\tconst label = issue.kind ?? schemaDiffIssueLabel(issue) ?? \"issue\";\n\t\t\t\tconst message = issue.message ?? issue.path?.join(\"/\") ?? \"\";\n\t\t\t\tlines.push(`${formatDimText(` - [${label}] ${message}`)}`);\n\t\t\t}\n\t\t\tif (!isVerbose(flags, 1) && issues.length > maxToShow) lines.push(`${formatDimText(\" Re-run with -v/--verbose to see all issues\")}`);\n\t\t}\n\t}\n\tif (error.docsUrl && isVerbose(flags, 1)) lines.push(formatDimText(error.docsUrl));\n\tconst plannerWarnings = error.meta?.[\"plannerWarnings\"];\n\tif (Array.isArray(plannerWarnings) && plannerWarnings.length > 0) {\n\t\tconst typedWarnings = blindCast(plannerWarnings);\n\t\tlines.push(...formatPlannerWarningsBlock(typedWarnings, useColor));\n\t}\n\tif (isVerbose(flags, 2) && error.meta) lines.push(`${formatDimText(` Meta: ${JSON.stringify(error.meta, null, 2)}`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats error output as JSON.\n*/\nfunction formatErrorJson(error) {\n\treturn JSON.stringify(resolveBinPlaceholder(error, BIN_NAME), null, 2);\n}\n//#endregion\n//#region src/utils/glyph-mode.ts\nfunction localeString(env) {\n\treturn env[\"LC_ALL\"] ?? env[\"LC_CTYPE\"] ?? env[\"LANG\"] ?? \"\";\n}\nfunction isUtf8Locale(env) {\n\tconst locale = localeString(env);\n\tif (locale.length === 0) return false;\n\treturn /UTF-8|utf8/i.test(locale);\n}\nfunction detectGlyphMode(input) {\n\tif (!input.isTTY) return \"ascii\";\n\tif (!isUtf8Locale(input.env)) return \"ascii\";\n\treturn \"unicode\";\n}\n//#endregion\n//#region src/utils/shutdown.ts\nfunction createShutdownHandler(options) {\n\tconst exit = options?.exit ?? ((code) => process.exit(code));\n\tconst gracePeriodMs = options?.gracePeriodMs ?? 3e3;\n\tconst controller = new AbortController();\n\tlet shuttingDown = false;\n\tlet graceTimer;\n\tconst onSignal = () => {\n\t\tif (shuttingDown) {\n\t\t\texit(130);\n\t\t\treturn;\n\t\t}\n\t\tshuttingDown = true;\n\t\tcontroller.abort();\n\t\tgraceTimer = setTimeout(() => exit(130), gracePeriodMs);\n\t\tgraceTimer.unref();\n\t};\n\treturn {\n\t\tsignal: controller.signal,\n\t\tisShuttingDown: () => shuttingDown,\n\t\tonSignal,\n\t\tclearGraceTimer: () => {\n\t\t\tif (graceTimer !== void 0) {\n\t\t\t\tclearTimeout(graceTimer);\n\t\t\t\tgraceTimer = void 0;\n\t\t\t}\n\t\t}\n\t};\n}\nconst globalHandler = createShutdownHandler();\n/**\n* The global AbortSignal. Pass this to any async operation that should\n* be cancellable on Ctrl+C (e.g., DB queries, long-running emit).\n*/\nconst shutdownSignal = globalHandler.signal;\n/**\n* Installs SIGINT and SIGTERM handlers. Call once at CLI startup.\n*\n* - First signal: aborts the controller, starts a 3s grace timer.\n* - Second signal: force-exits immediately.\n*/\nlet installed = false;\nfunction installShutdownHandlers() {\n\tif (installed) return;\n\tinstalled = true;\n\tprocess.on(\"SIGINT\", globalHandler.onSignal);\n\tprocess.on(\"SIGTERM\", globalHandler.onSignal);\n}\n//#endregion\n//#region src/utils/terminal-ui.ts\n/**\n* Composable CLI output abstraction.\n*\n* Follows the Unix convention of separating data from decoration:\n* - **stdout** — data output only (`ui.output()`). This is what scripts and pipes capture.\n* - **stderr** — all decoration (spinners, logs, notes, intro/outro). Visible in terminal, invisible in pipes.\n*\n* Rules:\n* 1. All methods except `output()` and `error()` write to stderr only in interactive mode.\n* 2. `output(data)` always writes to stdout — if a command calls it, there is data to emit.\n* 3. `error()` always writes to stderr — errors matter even when piped.\n* 4. Decoration is suppressed when piped unless `--format pretty` was explicit (`forcePretty`).\n* 5. Never write data to stderr — decoration methods are for human context only.\n* 6. Never write decoration to stdout — it breaks pipes, `$(...)` captures, and `> file` redirects.\n*/\nvar TerminalUI = class TerminalUI {\n\t/**\n\t* True when stdout is a TTY (interactive terminal).\n\t* False when piped (e.g., `prisma-next db verify | jq`).\n\t*/\n\tisInteractive;\n\t/**\n\t* Whether color output is enabled.\n\t*/\n\tuseColor;\n\t/**\n\t* When true, decoration methods write even on non-TTY stdout\n\t* (explicit `--format pretty`).\n\t*/\n\tforcePretty;\n\t/**\n\t* Whether stdout is a TTY — used for migration-list graph glyph detection.\n\t*/\n\tstdoutIsTTY;\n\t/**\n\t* Process environment snapshot for locale-aware glyph detection.\n\t*/\n\tenv;\n\tstatic stderrOpts = { output: process.stderr };\n\tconstructor(options) {\n\t\tthis.isInteractive = options?.interactive ?? !!process.stdout.isTTY;\n\t\tthis.forcePretty = options?.forcePretty ?? false;\n\t\tthis.useColor = options?.color ?? (this.isInteractive || this.forcePretty);\n\t\tthis.stdoutIsTTY = options?.stdoutIsTTY ?? !!process.stdout.isTTY;\n\t\tthis.env = options?.env ?? process.env;\n\t}\n\tget isTTY() {\n\t\treturn this.stdoutIsTTY;\n\t}\n\t/**\n\t* Resolve glyph mode for migration list/tree output. `--ascii` forces ASCII;\n\t* otherwise delegates to the pure {@link detectGlyphMode} helper.\n\t*/\n\tresolveGlyphMode(forceAscii) {\n\t\tif (forceAscii) return \"ascii\";\n\t\treturn detectGlyphMode(this.glyphModeInput());\n\t}\n\tglyphModeInput() {\n\t\treturn {\n\t\t\tisTTY: this.stdoutIsTTY,\n\t\t\tenv: this.env\n\t\t};\n\t}\n\tget shouldDecorate() {\n\t\treturn this.isInteractive || this.forcePretty;\n\t}\n\t/**\n\t* Log a message line to stderr. No-op when piped unless forcePretty.\n\t*/\n\tlog(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.message(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a success message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tsuccess(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.success(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a warning message to stderr. No-op when piped unless forcePretty.\n\t*/\n\twarn(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.warn(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an error message to stderr. Always writes (errors matter even in pipes).\n\t*/\n\terror(message) {\n\t\tclack.log.error(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log an info message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tinfo(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.info(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Log a step message to stderr. No-op when piped unless forcePretty.\n\t*/\n\tstep(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.log.step(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display a note box on stderr. No-op when piped unless forcePretty.\n\t*/\n\tnote(message, title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.note(message, title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display intro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\tintro(title) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.intro(title, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Display outro banner on stderr. No-op when piped unless forcePretty.\n\t*/\n\toutro(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tclack.outro(message, TerminalUI.stderrOpts);\n\t}\n\t/**\n\t* Create a Clack spinner on stderr with a 100ms delay threshold.\n\t* The spinner only appears if the operation takes longer than the threshold,\n\t* avoiding flicker for fast operations. Returns a no-op spinner when not decorating.\n\t*/\n\tspinner(delayMs = 100) {\n\t\tconst noop = {\n\t\t\tstart: () => {},\n\t\t\tstop: () => {},\n\t\t\tcancel: () => {},\n\t\t\terror: () => {},\n\t\t\tmessage: () => {},\n\t\t\tclear: () => {},\n\t\t\tget isCancelled() {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t};\n\t\tif (!this.shouldDecorate) return noop;\n\t\tlet inner;\n\t\tlet timer;\n\t\tlet pendingMsg;\n\t\tlet settled = false;\n\t\tconst ensureCleared = () => {\n\t\t\tif (timer !== void 0) {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t};\n\t\tconst onAbort = () => {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(\"Interrupted\");\n\t\t\t}\n\t\t};\n\t\tif (!shutdownSignal.aborted) shutdownSignal.addEventListener(\"abort\", onAbort, { once: true });\n\t\treturn {\n\t\t\tstart(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\ttimer = setTimeout(() => {\n\t\t\t\t\tif (!settled) {\n\t\t\t\t\t\tinner = clack.spinner(TerminalUI.stderrOpts);\n\t\t\t\t\t\tinner.start(pendingMsg);\n\t\t\t\t\t}\n\t\t\t\t}, delayMs);\n\t\t\t},\n\t\t\tstop(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.stop(msg);\n\t\t\t},\n\t\t\tcancel(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.cancel(msg);\n\t\t\t},\n\t\t\terror(msg) {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.error(msg);\n\t\t\t},\n\t\t\tmessage(msg) {\n\t\t\t\tpendingMsg = msg;\n\t\t\t\tif (inner) inner.message(msg);\n\t\t\t},\n\t\t\tclear() {\n\t\t\t\tsettled = true;\n\t\t\t\tensureCleared();\n\t\t\t\tif (inner) inner.clear();\n\t\t\t},\n\t\t\tget isCancelled() {\n\t\t\t\treturn inner?.isCancelled ?? false;\n\t\t\t}\n\t\t};\n\t}\n\t/**\n\t* Prompt for yes/no confirmation on stderr. Returns true if confirmed.\n\t* In non-interactive mode or when cancelled (Ctrl-C), returns false.\n\t*/\n\tasync confirm(message) {\n\t\tif (!this.isInteractive) return false;\n\t\tconst result = await clack.confirm({\n\t\t\tmessage,\n\t\t\t...TerminalUI.stderrOpts\n\t\t});\n\t\tif (clack.isCancel(result)) return false;\n\t\treturn result;\n\t}\n\t/**\n\t* Write a raw line to stderr. No-op when piped unless forcePretty.\n\t* Use for decoration that doesn't fit Clack's log format (e.g. styled headers).\n\t*/\n\tstderr(message) {\n\t\tif (!this.shouldDecorate) return;\n\t\tprocess.stderr.write(`${message}\\n`);\n\t}\n\t/**\n\t* Write machine-readable data to stdout.\n\t* Always writes — if a command calls output(), there is data to emit.\n\t*\n\t* This is what scripts and pipes capture: `prisma-next db verify --json | jq .ok`\n\t*/\n\toutput(data) {\n\t\tprocess.stdout.write(`${data}\\n`);\n\t}\n\tgreen(text) {\n\t\treturn this.useColor ? green(text) : text;\n\t}\n\tred(text) {\n\t\treturn this.useColor ? red(text) : text;\n\t}\n\tcyan(text) {\n\t\treturn this.useColor ? cyan(text) : text;\n\t}\n\tdim(text) {\n\t\treturn this.useColor ? dim(text) : text;\n\t}\n\tbold(text) {\n\t\treturn this.useColor ? bold(text) : text;\n\t}\n\tyellow(text) {\n\t\treturn this.useColor ? yellow(text) : text;\n\t}\n};\nfunction createTerminalUI(flags, runtime) {\n\treturn new TerminalUI({\n\t\tcolor: flags.color,\n\t\tinteractive: flags.interactive,\n\t\tforcePretty: flags.format === \"pretty\" && flags.explicitFormat,\n\t\tstdoutIsTTY: runtime?.isTTY,\n\t\tenv: runtime?.env\n\t});\n}\n//#endregion\nexport { formatMigrationApplyCommandOutput as a, formatMigrationPlanOutput as c, BIN_NAME as d, createColorFormatter as f, formatErrorOutput as i, formatMigrationShowOutput as l, isVerbose as m, installShutdownHandlers as n, formatMigrationApplyOutput as o, formatDim as p, formatErrorJson as r, formatMigrationJson as s, createTerminalUI as t, previewBlockHeader as u };\n\n//# sourceMappingURL=terminal-ui-JJKxvT0q.mjs.map"],"mappings":";;;;;;;;AAQA,SAAS,UAAU,OAAO,OAAO;CAChC,QAAQ,MAAM,WAAW,MAAM;AAChC;;;;;AAKA,SAAS,qBAAqB,UAAU,SAAS;CAChD,OAAO,WAAW,WAAW,SAAS;AACvC;;;;AAIA,SAAS,UAAU,UAAU,MAAM;CAClC,OAAO,WAAW,IAAI,IAAI,IAAI;AAC/B;;;;;;;;;AAWA,MAAM,WAAW;;;;;;;AASjB,SAAS,uBAAuB,MAAM,UAAU;CAC/C,MAAM,UAAU,KAAK,KAAK;CAC1B,IAAI,CAAC,SAAS,OAAO,KAAK;CAC1B,IAAI,aAAa,OAAO,OAAO,QAAQ,SAAS,GAAG,IAAI,UAAU,GAAG,QAAQ;CAC5E,OAAO;AACR;;;;;;;;;;;;;AAaA,SAAS,mBAAmB,SAAS;CACpC,OAAO,QAAQ,WAAW,SAAS,KAAK,QAAQ,WAAW,OAAO,MAAM,EAAE,aAAa,KAAK,IAAI,gBAAgB;AACjH;AACA,SAAS,2BAA2B,UAAU,UAAU;CACvD,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,MAAM,QAAQ,CAAC,IAAI,WAAW;CAC9B,KAAK,MAAM,WAAW,UAAU,MAAM,KAAK,KAAK,cAAc,KAAK,Q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, y as errorInvalidRefFile } from "./errors-
|
|
2
|
-
import { t as MANIFEST_FILE } from "./io-
|
|
1
|
+
import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
|
|
2
|
+
import { t as MANIFEST_FILE } from "./io-635GlNx1-D94PxRc-.mjs";
|
|
3
3
|
import { join } from "pathe";
|
|
4
4
|
import { readFile, readdir, stat } from "node:fs/promises";
|
|
5
5
|
import { APP_SPACE_ID as APP_SPACE_ID$1, CONTRACT_SNAPSHOTS_DIRNAME } from "@prisma/orm-framework/components/control";
|
|
6
|
-
//#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-
|
|
6
|
+
//#region ../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-DhJTb0zM.mjs
|
|
7
7
|
/**
|
|
8
8
|
* Pattern a contract-space identifier must match. The constraint is
|
|
9
9
|
* filesystem-friendly: lowercase letters / digits / hyphen / underscore,
|
|
@@ -249,4 +249,4 @@ function verifyContractSpaces(inputs) {
|
|
|
249
249
|
//#endregion
|
|
250
250
|
export { isValidSpaceId as a, spaceMigrationDirectory as c, assertValidSpaceId as i, spaceRefsDirectory as l, RESERVED_SPACE_SUBDIR_NAMES as n, listContractSpaceDirectories as o, SPACE_REFS_DIRNAME as r, readContractSpaceHeadRef as s, APP_SPACE_ID$1 as t, verifyContractSpaces as u };
|
|
251
251
|
|
|
252
|
-
//# sourceMappingURL=verify-contract-spaces-
|
|
252
|
+
//# sourceMappingURL=verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs","names":["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-WvjSiWcB.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-Co-8oaiB.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-CHUUeHh0.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`prisma-next migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`prisma-next db update\\` to advance the database, or \\`prisma-next migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`prisma-next db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-WvjSiWcB.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;;;;;;;;;;;;;;AAcA,eAAe,yBAAyB,sBAAsB,SAAS;CACtE,mBAAmB,OAAO;CAC1B,MAAM,WAAW,KAAK,mBAAmB,wBAAwB,sBAAsB,OAAO,CAAC,GAAG,WAAW;CAC7G,IAAI;CACJ,IAAI;EACH,MAAM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A,kBAAkB,CAAC,GAAG,OAAO,UAAU,CAAC,CAAC,KAAK;GAC9C,aAAa,yBAAyB,QAAQ,2BAA2B,QAAQ,KAAK,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;EAC3H,CAAC;CACF;CACA,KAAK,MAAM,OAAO,CAAC,GAAG,OAAO,eAAe,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,GAAG,GAAG,WAAW,KAAK;EACxG,MAAM;EACN,SAAS;EACT,aAAa,qCAAqC,KAAK,cAAc,GAAG,EAAE;CAC3E,CAAC;CACD,KAAK,MAAM,SAAS,CAAC,GAAG,OAAO,kBAAkB,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,KAAK,GAAG,WAAW,KAAK;EACrH,MAAM;EACN,SAAS;EACT,aAAa,gCAAgC,MAAM;CACpD,CAAC;CACD,IAAI,WAAW,WAAW,GAAG,OAAO,EAAE,IAAI,KAAK;CAC/C,MAAM,YAAY;EACjB,uBAAuB;EACvB,cAAc;EACd,gBAAgB;EAChB,cAAc;EACd,oBAAoB;CACrB;CACA,WAAW,MAAM,GAAG,MAAM;EACzB,MAAM,IAAI,UAAU,EAAE,QAAQ,UAAU,EAAE;EAC1C,IAAI,MAAM,GAAG,OAAO;EACpB,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC;CACD,OAAO;EACN,IAAI;EACJ;CACD;AACD"}
|
|
1
|
+
{"version":3,"file":"verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs","names":["APP_SPACE_ID"],"sources":["../../../../1-framework/3-tooling/migration/dist/verify-contract-spaces-DhJTb0zM.mjs"],"sourcesContent":["import { C as errorInvalidSpaceId, g as errorInvalidJson, y as errorInvalidRefFile } from \"./errors-CXbGUWGu.mjs\";\nimport { t as MANIFEST_FILE } from \"./io-635GlNx1.mjs\";\nimport { join } from \"pathe\";\nimport { readFile, readdir, stat } from \"node:fs/promises\";\nimport { APP_SPACE_ID, CONTRACT_SNAPSHOTS_DIRNAME } from \"@internal/framework-components/control\";\n//#region src/space-layout.ts\n/**\n* Pattern a contract-space identifier must match. The constraint is\n* filesystem-friendly: lowercase letters / digits / hyphen / underscore,\n* starts with a letter, max 64 characters.\n*/\nconst SPACE_ID_PATTERN = /^[a-z][a-z0-9_-]{0,63}$/;\nfunction isValidSpaceId(spaceId) {\n\treturn SPACE_ID_PATTERN.test(spaceId);\n}\nfunction assertValidSpaceId(spaceId) {\n\tif (!isValidSpaceId(spaceId)) throw errorInvalidSpaceId(spaceId);\n}\n/**\n* Resolve the migrations subdirectory for a given contract space.\n*\n* Every contract space — including the app space (default `'app'`) —\n* lands under `<projectMigrationsDir>/<spaceId>/`. The space id is\n* validated against {@link SPACE_ID_PATTERN} because it becomes a\n* filesystem directory name verbatim.\n*\n* `projectMigrationsDir` is the project's top-level `migrations/`\n* directory; the helper does not assume anything about its absolute /\n* relative shape and is symmetric with `pathe.join`.\n*/\nfunction spaceMigrationDirectory(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\treturn join(projectMigrationsDir, spaceId);\n}\n/**\n* Per-space subdirectory name reserved for the ref store\n* (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of\n* truth: every helper that composes a per-space refs path imports this\n* constant, and the enumerator uses it (via\n* {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from\n* the contract-space candidate list.\n*/\nconst SPACE_REFS_DIRNAME = \"refs\";\n/**\n* Names reserved under `migrations/` that must never be enumerated as a\n* phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level\n* `migrations/refs/` left in the wrong place) and\n* `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract\n* snapshot store, `migrations/snapshots/`).\n*/\nconst RESERVED_SPACE_SUBDIR_NAMES = /* @__PURE__ */ new Set([SPACE_REFS_DIRNAME, CONTRACT_SNAPSHOTS_DIRNAME]);\n/**\n* Resolve the per-space refs directory for `spaceMigrationsDir`\n* (typically the value returned by {@link spaceMigrationDirectory}).\n* Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not\n* hard-code the literal.\n*/\nfunction spaceRefsDirectory(spaceMigrationsDir) {\n\treturn join(spaceMigrationsDir, SPACE_REFS_DIRNAME);\n}\n//#endregion\n//#region src/read-contract-space-head-ref.ts\nfunction hasErrnoCode$1(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* Read the head ref (`hash` + `invariants`) for a contract space from\n* `<projectMigrationsDir>/<spaceId>/refs/head.json`.\n*\n* Returns `null` when the file does not exist (first emit). Surfaces\n* `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt\n* `refs/head.json` so callers can distinguish \"no head ref on disk\"\n* (returns `null`) from \"head ref present but unreadable\" (throws).\n*\n* Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same\n* filesystem-safety reasons as the rest of the per-space helpers. The\n* helper is uniform across the app and extension spaces.\n*/\nasync function readContractSpaceHeadRef(projectMigrationsDir, spaceId) {\n\tassertValidSpaceId(spaceId);\n\tconst filePath = join(spaceRefsDirectory(spaceMigrationDirectory(projectMigrationsDir, spaceId)), \"head.json\");\n\tlet raw;\n\ttry {\n\t\traw = await readFile(filePath, \"utf-8\");\n\t} catch (error) {\n\t\tif (hasErrnoCode$1(error, \"ENOENT\")) return null;\n\t\tthrow error;\n\t}\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch (e) {\n\t\tthrow errorInvalidJson(filePath, e instanceof Error ? e.message : String(e));\n\t}\n\tif (typeof parsed !== \"object\" || parsed === null) throw errorInvalidRefFile(filePath, \"expected an object\");\n\tconst obj = parsed;\n\tif (typeof obj.hash !== \"string\") throw errorInvalidRefFile(filePath, \"expected an object with a string `hash` field\");\n\tif (!Array.isArray(obj.invariants) || obj.invariants.some((value) => typeof value !== \"string\")) throw errorInvalidRefFile(filePath, \"expected an object with an `invariants` array of strings\");\n\treturn {\n\t\thash: obj.hash,\n\t\tinvariants: obj.invariants\n\t};\n}\n//#endregion\n//#region src/verify-contract-spaces.ts\nfunction hasErrnoCode(error, code) {\n\treturn error instanceof Error && error.code === code;\n}\n/**\n* List the per-space subdirectories under\n* `<projectRoot>/migrations/`. Returns space-id directory names (sorted\n* alphabetically) — i.e. any non-dot-prefixed, non-reserved\n* ({@link RESERVED_SPACE_SUBDIR_NAMES}) subdirectory whose root does\n* **not** contain a `migration.json` manifest. The manifest is the\n* structural marker of a user-authored migration directory (see\n* `readMigrationsDir` in `./io`); directory names themselves belong to\n* the user and are not part of the contract. The reserved-name filter\n* keeps `migrations/snapshots/` (the contract snapshot store) from ever\n* being enumerated as a phantom contract space.\n*\n* Returns `[]` if the migrations directory does not exist (greenfield\n* project).\n*\n* Reads only the user's repo. **No descriptor import.** The caller\n* (verifier) feeds the result into {@link verifyContractSpaces} alongside\n* the loaded-space set and the marker rows.\n*/\nasync function listContractSpaceDirectories(projectMigrationsDir) {\n\tlet entries;\n\ttry {\n\t\tentries = (await readdir(projectMigrationsDir, { withFileTypes: true })).map((d) => ({\n\t\t\tname: d.name,\n\t\t\tisDirectory: d.isDirectory()\n\t\t}));\n\t} catch (error) {\n\t\tif (hasErrnoCode(error, \"ENOENT\")) return [];\n\t\tthrow error;\n\t}\n\tconst namedCandidates = entries.filter((e) => e.isDirectory).map((e) => e.name).filter((name) => !name.startsWith(\".\")).filter((name) => !RESERVED_SPACE_SUBDIR_NAMES.has(name)).sort();\n\treturn (await Promise.all(namedCandidates.map(async (name) => {\n\t\ttry {\n\t\t\tawait stat(join(projectMigrationsDir, name, MANIFEST_FILE));\n\t\t\treturn {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: true\n\t\t\t};\n\t\t} catch (error) {\n\t\t\tif (hasErrnoCode(error, \"ENOENT\")) return {\n\t\t\t\tname,\n\t\t\t\tisMigrationDir: false\n\t\t\t};\n\t\t\tthrow error;\n\t\t}\n\t}))).filter((c) => !c.isMigrationDir).map((c) => c.name);\n}\n/**\n* Pure structural verifier for the per-space mechanism. Aggregates the\n* three orphan / missing checks plus per-space hash and invariant\n* comparison.\n*\n* Algorithm:\n*\n* - For every extension space declared in `loadedSpaces` (`'app'`\n* excluded — the per-space verifier is scoped to extension spaces;\n* the app is verified through the aggregate path):\n* - If no contract-space dir on disk → `declaredButUnmigrated`.\n* - Else if `markerRowsBySpace` lacks an entry → no violation here;\n* the live-DB compare done outside this helper is where the\n* absence shows up.\n* - Else compare marker hash / invariants vs. on-disk head hash /\n* invariants → `hashMismatch` / `invariantsMismatch` on drift.\n* - For every contract-space dir on disk that is not in `loadedSpaces` →\n* `orphanSpaceDir`.\n* - For every marker row whose `space` is not in `loadedSpaces` →\n* `orphanMarker`. The app-space marker is always loaded (`'app'` is\n* in `loadedSpaces` by definition).\n*\n* Output is deterministic: violations are sorted first by `kind`\n* (`declaredButUnmigrated` → `orphanMarker` → `orphanSpaceDir` →\n* `hashMismatch` → `invariantsMismatch`) then by `spaceId`. Two callers\n* passing equivalent inputs see byte-identical violation lists.\n*\n* Synchronous, pure, no I/O. **Does not import the extension descriptor**\n* (the inputs are pre-resolved by the caller); the verifier reads only\n* the user repo, not `node_modules`.\n*/\nfunction verifyContractSpaces(inputs) {\n\tconst violations = [];\n\tfor (const spaceId of [...inputs.loadedSpaces].sort()) {\n\t\tif (spaceId === APP_SPACE_ID) continue;\n\t\tif (!inputs.spaceDirsOnDisk.includes(spaceId)) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"declaredButUnmigrated\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: `Extension '${spaceId}' is declared in extensions but has not been emitted; run \\`prisma-next migrate\\`.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst head = inputs.headRefsBySpace.get(spaceId);\n\t\tconst marker = inputs.markerRowsBySpace.get(spaceId);\n\t\tif (!head || !marker) continue;\n\t\tif (head.hash !== marker.hash) {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tpriorHeadHash: head.hash,\n\t\t\t\tmarkerHash: marker.hash,\n\t\t\t\tremediation: `Marker row for space '${spaceId}' is keyed at ${marker.hash}, but the on-disk ${join(\"migrations\", spaceId, \"contract.json\")} resolves to ${head.hash}. Run \\`prisma-next db update\\` to advance the database, or \\`prisma-next migrate\\` if the descriptor was bumped without re-emitting.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst onDiskInvariants = [...head.invariants].sort();\n\t\tconst markerInvariants = new Set(marker.invariants);\n\t\tconst missing = onDiskInvariants.filter((id) => !markerInvariants.has(id));\n\t\tif (missing.length > 0) violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tonDiskInvariants,\n\t\t\tmarkerInvariants: [...marker.invariants].sort(),\n\t\t\tremediation: `Marker row for space '${spaceId}' is missing invariants [${missing.map((s) => JSON.stringify(s)).join(\", \")}]. Run \\`prisma-next db update\\` to apply the corresponding data-transform migrations.`\n\t\t});\n\t}\n\tfor (const dir of [...inputs.spaceDirsOnDisk].sort()) if (!inputs.loadedSpaces.has(dir)) violations.push({\n\t\tkind: \"orphanSpaceDir\",\n\t\tspaceId: dir,\n\t\tremediation: `Orphan contract-space directory \\`${join(\"migrations\", dir)}/\\` for an extension not in extensions; remove the directory or re-add the extension.`\n\t});\n\tfor (const space of [...inputs.markerRowsBySpace.keys()].sort()) if (!inputs.loadedSpaces.has(space)) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: space,\n\t\tremediation: `Orphan marker row for space '${space}' (no longer in extensions); remediation: manually delete the row from \\`prisma_contract.marker\\`.`\n\t});\n\tif (violations.length === 0) return { ok: true };\n\tconst kindOrder = {\n\t\tdeclaredButUnmigrated: 0,\n\t\torphanMarker: 1,\n\t\torphanSpaceDir: 2,\n\t\thashMismatch: 3,\n\t\tinvariantsMismatch: 4\n\t};\n\tviolations.sort((a, b) => {\n\t\tconst k = kindOrder[a.kind] - kindOrder[b.kind];\n\t\tif (k !== 0) return k;\n\t\tif (a.spaceId < b.spaceId) return -1;\n\t\tif (a.spaceId > b.spaceId) return 1;\n\t\treturn 0;\n\t});\n\treturn {\n\t\tok: false,\n\t\tviolations\n\t};\n}\n//#endregion\nexport { RESERVED_SPACE_SUBDIR_NAMES as a, isValidSpaceId as c, APP_SPACE_ID as i, spaceMigrationDirectory as l, verifyContractSpaces as n, SPACE_REFS_DIRNAME as o, readContractSpaceHeadRef as r, assertValidSpaceId as s, listContractSpaceDirectories as t, spaceRefsDirectory as u };\n\n//# sourceMappingURL=verify-contract-spaces-DhJTb0zM.mjs.map"],"mappings":";;;;;;;;;;;AAWA,MAAM,mBAAmB;AACzB,SAAS,eAAe,SAAS;CAChC,OAAO,iBAAiB,KAAK,OAAO;AACrC;AACA,SAAS,mBAAmB,SAAS;CACpC,IAAI,CAAC,eAAe,OAAO,GAAG,MAAM,oBAAoB,OAAO;AAChE;;;;;;;;;;;;;AAaA,SAAS,wBAAwB,sBAAsB,SAAS;CAC/D,mBAAmB,OAAO;CAC1B,OAAO,KAAK,sBAAsB,OAAO;AAC1C;;;;;;;;;AASA,MAAM,qBAAqB;;;;;;;;AAQ3B,MAAM,8CAA8C,IAAI,IAAI,CAAC,oBAAoB,0BAA0B,CAAC;;;;;;;AAO5G,SAAS,mBAAmB,oBAAoB;CAC/C,OAAO,KAAK,oBAAoB,kBAAkB;AACnD;AAGA,SAAS,eAAe,OAAO,MAAM;CACpC,OAAO,iBAAiB,SAAS,MAAM,SAAS;AACjD;;;;;;;;;;;;;;AAcA,eAAe,yBAAyB,sBAAsB,SAAS;CACtE,mBAAmB,OAAO;CAC1B,MAAM,WAAW,KAAK,mBAAmB,wBAAwB,sBAAsB,OAAO,CAAC,GAAG,WAAW;CAC7G,IAAI;CACJ,IAAI;EACH,MAAM,MAAM,SAAS,UAAU,O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G,OAAO,UAAU,CAAC,CAAC,KAAK;GAC9C,aAAa,yBAAyB,QAAQ,2BAA2B,QAAQ,KAAK,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;EAC3H,CAAC;CACF;CACA,KAAK,MAAM,OAAO,CAAC,GAAG,OAAO,eAAe,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,GAAG,GAAG,WAAW,KAAK;EACxG,MAAM;EACN,SAAS;EACT,aAAa,qCAAqC,KAAK,cAAc,GAAG,EAAE;CAC3E,CAAC;CACD,KAAK,MAAM,SAAS,CAAC,GAAG,OAAO,kBAAkB,KAAK,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,CAAC,OAAO,aAAa,IAAI,KAAK,GAAG,WAAW,KAAK;EACrH,MAAM;EACN,SAAS;EACT,aAAa,gCAAgC,MAAM;CACpD,CAAC;CACD,IAAI,WAAW,WAAW,GAAG,OAAO,EAAE,IAAI,KAAK;CAC/C,MAAM,YAAY;EACjB,uBAAuB;EACvB,cAAc;EACd,gBAAgB;EAChB,cAAc;EACd,oBAAoB;CACrB;CACA,WAAW,MAAM,GAAG,MAAM;EACzB,MAAM,IAAI,UAAU,EAAE,QAAQ,UAAU,EAAE;EAC1C,IAAI,MAAM,GAAG,OAAO;EACpB,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,IAAI,EAAE,UAAU,EAAE,SAAS,OAAO;EAClC,OAAO;CACR,CAAC;CACD,OAAO;EACN,IAAI;EACJ;CACD;AACD"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as formatDim, n as createColorFormatter, p as isVerbose } from "./terminal-ui-JJKxvT0q-CPDEJqqU.mjs";
|
|
2
2
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
3
3
|
import { issueOutcome } from "@prisma/orm-framework/components/control";
|
|
4
4
|
import { bold, cyan, dim, green, magenta, red, yellow } from "colorette";
|
|
5
|
-
//#region ../../../1-framework/3-tooling/cli/dist/verify-
|
|
5
|
+
//#region ../../../1-framework/3-tooling/cli/dist/verify-wUSBDQwh.mjs
|
|
6
6
|
/** Human-readable label for each outcome, prefixed onto an issue's message for display. */
|
|
7
7
|
const OUTCOME_LABEL = {
|
|
8
8
|
"not-found": "missing",
|
|
@@ -280,4 +280,4 @@ function formatSignJson(result) {
|
|
|
280
280
|
//#endregion
|
|
281
281
|
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 };
|
|
282
282
|
|
|
283
|
-
//# sourceMappingURL=verify-
|
|
283
|
+
//# sourceMappingURL=verify-wUSBDQwh-Bv3NV9WG.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-TphNCyMu-h8vrnbud.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/verify-TphNCyMu.mjs"],"sourcesContent":["import { d as createColorFormatter, f as formatDim, p as isVerbose } from \"./terminal-ui-DQNCDg2u.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { bold, cyan, dim, green, magenta, red, yellow } from \"colorette\";\n//#region src/utils/formatters/verify.ts\n/** Human-readable label for each outcome, prefixed onto an issue's message for display. */\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/**\n* The issue's display text: its own path, prefixed with a human label for\n* why it's flagged. Turning the presence-derived outcome (and the path) into\n* prose is this formatter's job, not the differ's — the differ's issue is\n* data (`path` + nodes), not prose.\n*/\nfunction formatIssueMessage(issue) {\n\treturn `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n}\n/**\n* Formats human-readable output for database verify.\n*/\nfunction formatVerifyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst verificationMode = result.mode === \"full\" ? `marker + schema${result.schema?.strict ? \" (strict)\" : \" (tolerant)\"}` : \"marker only (--marker-only)\";\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tlines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n\tlines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\tif (result.schema?.warnings && result.schema.warnings.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of result.schema.warnings) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (result.unclaimed && result.unclaimed.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of result.unclaimed) lines.push(` ${formatYellow(\"⚠\")} ${name}`);\n\t}\n\tif (result.warning) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatYellow(\"⚠\")} ${result.warning}`);\n\t}\n\tif (isVerbose(flags, 1)) {\n\t\tif (result.codecCoverageSkipped) lines.push(`${formatDimText(\" Codec coverage check skipped (helper returned no supported types)\")}`);\n\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database verify.\n*/\nfunction formatVerifyJson(result) {\n\tconst output = {\n\t\tok: result.ok,\n\t\tsummary: result.summary,\n\t\tmode: result.mode,\n\t\tcontract: result.contract,\n\t\t...ifDefined(\"marker\", result.marker),\n\t\ttarget: result.target,\n\t\t...ifDefined(\"missingCodecs\", result.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", result.codecCoverageSkipped),\n\t\t...ifDefined(\"schema\", result.schema),\n\t\tunclaimed: result.unclaimed ?? [],\n\t\t...ifDefined(\"warning\", result.warning),\n\t\t...ifDefined(\"meta\", result.meta),\n\t\ttimings: result.timings\n\t};\n\treturn JSON.stringify(output, null, 2);\n}\n/**\n* Formats JSON output for database introspection.\n*/\nfunction formatIntrospectJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n/**\n* Renders a schema tree structure from CoreSchemaView.\n* Status-glyph tree styling shared with the retired verification-tree renderer.\n*/\nfunction renderSchemaTree(node, flags, options) {\n\tconst { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n\tconst lines = [];\n\tlet formattedLabel = node.label;\n\tif (useColor) switch (node.kind) {\n\t\tcase \"root\":\n\t\t\tformattedLabel = bold(node.label);\n\t\t\tbreak;\n\t\tcase \"entity\": {\n\t\t\tconst tableMatch = node.label.match(/^table\\s+(.+)$/);\n\t\t\tif (tableMatch?.[1]) {\n\t\t\t\tconst tableName = tableMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"table\")} ${cyan(tableName)}`;\n\t\t\t} else formattedLabel = cyan(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"collection\":\n\t\t\tformattedLabel = dim(node.label);\n\t\t\tbreak;\n\t\tcase \"field\": {\n\t\t\tconst columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n\t\t\tif (columnMatch?.[1] && columnMatch[2]) {\n\t\t\t\tconst columnName = columnMatch[1];\n\t\t\t\tconst rest = columnMatch[2];\n\t\t\t\tconst typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n\t\t\t\tif (typeMatch?.[1] && typeMatch[2]) {\n\t\t\t\t\tconst typeDisplay = typeMatch[1];\n\t\t\t\t\tconst nullability = typeMatch[2];\n\t\t\t\t\tformattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n\t\t\t\t} else formattedLabel = `${cyan(columnName)}: ${rest}`;\n\t\t\t} else formattedLabel = node.label;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"index\": {\n\t\t\tconst pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n\t\t\tif (pkMatch?.[1]) {\n\t\t\t\tconst columnNames = pkMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"primary key\")}: ${cyan(columnNames)}`;\n\t\t\t} else {\n\t\t\t\tconst uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n\t\t\t\tif (uniqueMatch?.[1]) {\n\t\t\t\t\tconst name = uniqueMatch[1];\n\t\t\t\t\tformattedLabel = `${dim(\"unique\")} ${cyan(name)}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n\t\t\t\t\tif (indexMatch?.[2]) {\n\t\t\t\t\t\tconst indexPrefix = indexMatch[1] ? `${dim(\"unique\")} ` : \"\";\n\t\t\t\t\t\tconst name = indexMatch[2];\n\t\t\t\t\t\tformattedLabel = `${indexPrefix}${dim(\"index\")} ${cyan(name)}`;\n\t\t\t\t\t} else formattedLabel = dim(node.label);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"dependency\": {\n\t\t\tconst extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n\t\t\tif (extMatch?.[1] && extMatch[2]) {\n\t\t\t\tconst extName = extMatch[1];\n\t\t\t\tconst rest = extMatch[2];\n\t\t\t\tformattedLabel = `${cyan(extName)} ${dim(rest)}`;\n\t\t\t} else formattedLabel = magenta(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tformattedLabel = node.label;\n\t\t\tbreak;\n\t}\n\tif (isRoot) lines.push(formattedLabel);\n\telse {\n\t\tconst treePrefix = `${formatDimText(isLast ? \"└\" : \"├\")}─ `;\n\t\tlines.push(`${prefix}${treePrefix}${formattedLabel}`);\n\t}\n\tif (node.children && node.children.length > 0) {\n\t\tconst childPrefix = isRoot ? \"\" : `${prefix}${isLast ? \" \" : `${formatDimText(\"│\")} `}`;\n\t\tfor (let i = 0; i < node.children.length; i++) {\n\t\t\tconst child = node.children[i];\n\t\t\tif (!child) continue;\n\t\t\tconst childLines = renderSchemaTree(child, flags, {\n\t\t\t\tisLast: i === node.children.length - 1,\n\t\t\t\tprefix: childPrefix,\n\t\t\t\tuseColor,\n\t\t\t\tformatDimText,\n\t\t\t\tisRoot: false\n\t\t\t});\n\t\t\tlines.push(...childLines);\n\t\t}\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for database introspection.\n*/\nfunction formatIntrospectOutput(result, schemaView, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (schemaView) {\n\t\tconst treeLines = renderSchemaTree(schemaView.root, flags, {\n\t\t\tisLast: true,\n\t\t\tprefix: \"\",\n\t\t\tuseColor,\n\t\t\tformatDimText,\n\t\t\tisRoot: true\n\t\t});\n\t\tlines.push(...treeLines);\n\t} else {\n\t\tlines.push(`✔ ${result.summary}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tlines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n\t\t\tif (result.meta?.dbUrl) lines.push(` Database: ${result.meta.dbUrl}`);\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats human-readable output for database schema verification.\n*/\nfunction formatSchemaVerifyOutput(result, flags, unclaimed = []) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst issueMessages = result.schema.issues.map(formatIssueMessage);\n\tif (issueMessages.length > 0) {\n\t\tlines.push(formatRed(\"Schema issues:\"));\n\t\tfor (const message of issueMessages) lines.push(` ${formatRed(\"✖\")} ${message}`);\n\t}\n\tconst warningMessages = (result.schema.warnings?.issues ?? []).map(formatIssueMessage);\n\tif (warningMessages.length > 0) {\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of warningMessages) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (unclaimed.length > 0) {\n\t\tconst strict = result.meta?.strict ?? false;\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push((strict ? formatRed : formatYellow)(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of unclaimed) lines.push(` ${(strict ? formatRed : formatYellow)(strict ? \"✖\" : \"⚠\")} ${name}`);\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\tif (lines.length > 0) lines.push(\"\");\n\tif (result.ok) lines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\telse {\n\t\tconst codeText = result.code ? ` (${result.code})` : \"\";\n\t\tlines.push(`${formatRed(\"✖\")} ${result.summary}${codeText}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database schema verification. The unclaimed-elements\n* list is a top-level field alongside the combined result, reported once for\n* the whole database.\n*/\nfunction formatSchemaVerifyJson(result, unclaimed = []) {\n\treturn JSON.stringify({\n\t\t...result,\n\t\tunclaimed\n\t}, null, 2);\n}\n/**\n* Formats human-readable output for database sign.\n*/\nfunction formatSignOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tlines.push(`${formatGreen(\"✔\")} Database signed`);\n\t\tconst previousHash = result.marker.previous?.storageHash ?? \"none\";\n\t\tconst currentHash = result.contract.storageHash;\n\t\tlines.push(`${formatDimText(` from: ${previousHash}`)}`);\n\t\tlines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\t\t\tif (result.marker.previous?.profileHash) lines.push(`${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`);\n\t\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database sign.\n*/\nfunction formatSignJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\nexport { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };\n\n//# sourceMappingURL=verify-TphNCyMu.mjs.map"],"mappings":";;;;;;AAMA,MAAM,gBAAgB;CACrB,aAAa;CACb,gBAAgB;CAChB,aAAa;AACd;;;;;;;AAOA,SAAS,mBAAmB,OAAO;CAClC,OAAO,GAAG,cAAc,aAAa,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,GAAG;AACrE;;;;AAIA,SAAS,mBAAmB,QAAQ,OAAO;CAC1C,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,QAAQ,CAAC;CACf,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,KAAK;CACxD,MAAM,eAAe,qBAAqB,UAAU,MAAM;CAC1D,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,MAAM,mBAAmB,OAAO,SAAS,SAAS,kBAAkB,OAAO,QAAQ,SAAS,cAAc,kBAAkB;CAC5H,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,GAAG,OAAO,SAAS;CAClD,MAAM,KAAK,GAAG,cAAc,mBAAmB,kBAA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B,QAAQ,OAAO;CACxC,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,QAAQ,CAAC;CACf,MAAM,WAAW,MAAM,UAAU;CACjC,MAAM,cAAc,qBAAqB,UAAU,KAAK;CACxD,MAAM,iBAAiB,SAAS,UAAU,UAAU,IAAI;CACxD,IAAI,OAAO,IAAI;EACd,MAAM,KAAK,GAAG,YAAY,GAAG,EAAE,iBAAiB;EAChD,MAAM,eAAe,OAAO,OAAO,UAAU,eAAe;EAC5D,MAAM,cAAc,OAAO,SAAS;EACpC,MAAM,KAAK,GAAG,cAAc,WAAW,cAAc,GAAG;EACxD,MAAM,KAAK,GAAG,cAAc,WAAW,aAAa,GAAG;EACvD,IAAI,UAAU,OAAO,CAAC,GAAG;GACxB,IAAI,OAAO,SAAS,aAAa,MAAM,KAAK,GAAG,cAAc,kBAAkB,OAAO,SAAS,aAAa,GAAG;GAC/G,IAAI,OAAO,OAAO,UAAU,aAAa,MAAM,KAAK,GAAG,cAAc,2BAA2B,OAAO,OAAO,SAAS,aAAa,GAAG;GACvI,MAAM,KAAK,GAAG,cAAc,iBAAiB,OAAO,QAAQ,MAAM,GAAG,GAAG;EACzE;CACD;CACA,OAAO,MAAM,KAAK,IAAI;AACvB;;;;AAIA,SAAS,eAAe,QAAQ;CAC/B,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACtC"}
|
|
1
|
+
{"version":3,"file":"verify-wUSBDQwh-Bv3NV9WG.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/verify-wUSBDQwh.mjs"],"sourcesContent":["import { f as createColorFormatter, m as isVerbose, p as formatDim } from \"./terminal-ui-JJKxvT0q.mjs\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { issueOutcome } from \"@internal/framework-components/control\";\nimport { bold, cyan, dim, green, magenta, red, yellow } from \"colorette\";\n//#region src/utils/formatters/verify.ts\n/** Human-readable label for each outcome, prefixed onto an issue's message for display. */\nconst OUTCOME_LABEL = {\n\t\"not-found\": \"missing\",\n\t\"not-expected\": \"extra\",\n\t\"not-equal\": \"mismatch\"\n};\n/**\n* The issue's display text: its own path, prefixed with a human label for\n* why it's flagged. Turning the presence-derived outcome (and the path) into\n* prose is this formatter's job, not the differ's — the differ's issue is\n* data (`path` + nodes), not prose.\n*/\nfunction formatIssueMessage(issue) {\n\treturn `${OUTCOME_LABEL[issueOutcome(issue)]}: ${issue.path.join(\"/\")}`;\n}\n/**\n* Formats human-readable output for database verify.\n*/\nfunction formatVerifyOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst verificationMode = result.mode === \"full\" ? `marker + schema${result.schema?.strict ? \" (strict)\" : \" (tolerant)\"}` : \"marker only (--marker-only)\";\n\tlines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\tlines.push(`${formatDimText(` verification: ${verificationMode}`)}`);\n\tlines.push(`${formatDimText(` storageHash: ${result.contract.storageHash}`)}`);\n\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\tif (result.schema?.warnings && result.schema.warnings.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of result.schema.warnings) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (result.unclaimed && result.unclaimed.length > 0) {\n\t\tlines.push(\"\");\n\t\tlines.push(formatYellow(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of result.unclaimed) lines.push(` ${formatYellow(\"⚠\")} ${name}`);\n\t}\n\tif (result.warning) {\n\t\tlines.push(\"\");\n\t\tlines.push(`${formatYellow(\"⚠\")} ${result.warning}`);\n\t}\n\tif (isVerbose(flags, 1)) {\n\t\tif (result.codecCoverageSkipped) lines.push(`${formatDimText(\" Codec coverage check skipped (helper returned no supported types)\")}`);\n\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database verify.\n*/\nfunction formatVerifyJson(result) {\n\tconst output = {\n\t\tok: result.ok,\n\t\tsummary: result.summary,\n\t\tmode: result.mode,\n\t\tcontract: result.contract,\n\t\t...ifDefined(\"marker\", result.marker),\n\t\ttarget: result.target,\n\t\t...ifDefined(\"missingCodecs\", result.missingCodecs),\n\t\t...ifDefined(\"codecCoverageSkipped\", result.codecCoverageSkipped),\n\t\t...ifDefined(\"schema\", result.schema),\n\t\tunclaimed: result.unclaimed ?? [],\n\t\t...ifDefined(\"warning\", result.warning),\n\t\t...ifDefined(\"meta\", result.meta),\n\t\ttimings: result.timings\n\t};\n\treturn JSON.stringify(output, null, 2);\n}\n/**\n* Formats JSON output for database introspection.\n*/\nfunction formatIntrospectJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n/**\n* Renders a schema tree structure from CoreSchemaView.\n* Status-glyph tree styling shared with the retired verification-tree renderer.\n*/\nfunction renderSchemaTree(node, flags, options) {\n\tconst { isLast, prefix, useColor, formatDimText, isRoot = false } = options;\n\tconst lines = [];\n\tlet formattedLabel = node.label;\n\tif (useColor) switch (node.kind) {\n\t\tcase \"root\":\n\t\t\tformattedLabel = bold(node.label);\n\t\t\tbreak;\n\t\tcase \"entity\": {\n\t\t\tconst tableMatch = node.label.match(/^table\\s+(.+)$/);\n\t\t\tif (tableMatch?.[1]) {\n\t\t\t\tconst tableName = tableMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"table\")} ${cyan(tableName)}`;\n\t\t\t} else formattedLabel = cyan(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"collection\":\n\t\t\tformattedLabel = dim(node.label);\n\t\t\tbreak;\n\t\tcase \"field\": {\n\t\t\tconst columnMatch = node.label.match(/^([^:]+):\\s*(.+)$/);\n\t\t\tif (columnMatch?.[1] && columnMatch[2]) {\n\t\t\t\tconst columnName = columnMatch[1];\n\t\t\t\tconst rest = columnMatch[2];\n\t\t\t\tconst typeMatch = rest.match(/^([^\\s(]+)\\s*(\\([^)]+\\))$/);\n\t\t\t\tif (typeMatch?.[1] && typeMatch[2]) {\n\t\t\t\t\tconst typeDisplay = typeMatch[1];\n\t\t\t\t\tconst nullability = typeMatch[2];\n\t\t\t\t\tformattedLabel = `${cyan(columnName)}: ${typeDisplay} ${dim(nullability)}`;\n\t\t\t\t} else formattedLabel = `${cyan(columnName)}: ${rest}`;\n\t\t\t} else formattedLabel = node.label;\n\t\t\tbreak;\n\t\t}\n\t\tcase \"index\": {\n\t\t\tconst pkMatch = node.label.match(/^primary key:\\s*(.+)$/);\n\t\t\tif (pkMatch?.[1]) {\n\t\t\t\tconst columnNames = pkMatch[1];\n\t\t\t\tformattedLabel = `${dim(\"primary key\")}: ${cyan(columnNames)}`;\n\t\t\t} else {\n\t\t\t\tconst uniqueMatch = node.label.match(/^unique\\s+(.+)$/);\n\t\t\t\tif (uniqueMatch?.[1]) {\n\t\t\t\t\tconst name = uniqueMatch[1];\n\t\t\t\t\tformattedLabel = `${dim(\"unique\")} ${cyan(name)}`;\n\t\t\t\t} else {\n\t\t\t\t\tconst indexMatch = node.label.match(/^(unique\\s+)?index\\s+(.+)$/);\n\t\t\t\t\tif (indexMatch?.[2]) {\n\t\t\t\t\t\tconst indexPrefix = indexMatch[1] ? `${dim(\"unique\")} ` : \"\";\n\t\t\t\t\t\tconst name = indexMatch[2];\n\t\t\t\t\t\tformattedLabel = `${indexPrefix}${dim(\"index\")} ${cyan(name)}`;\n\t\t\t\t\t} else formattedLabel = dim(node.label);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"dependency\": {\n\t\t\tconst extMatch = node.label.match(/^([^\\s]+)\\s+(extension is enabled)$/);\n\t\t\tif (extMatch?.[1] && extMatch[2]) {\n\t\t\t\tconst extName = extMatch[1];\n\t\t\t\tconst rest = extMatch[2];\n\t\t\t\tformattedLabel = `${cyan(extName)} ${dim(rest)}`;\n\t\t\t} else formattedLabel = magenta(node.label);\n\t\t\tbreak;\n\t\t}\n\t\tdefault:\n\t\t\tformattedLabel = node.label;\n\t\t\tbreak;\n\t}\n\tif (isRoot) lines.push(formattedLabel);\n\telse {\n\t\tconst treePrefix = `${formatDimText(isLast ? \"└\" : \"├\")}─ `;\n\t\tlines.push(`${prefix}${treePrefix}${formattedLabel}`);\n\t}\n\tif (node.children && node.children.length > 0) {\n\t\tconst childPrefix = isRoot ? \"\" : `${prefix}${isLast ? \" \" : `${formatDimText(\"│\")} `}`;\n\t\tfor (let i = 0; i < node.children.length; i++) {\n\t\t\tconst child = node.children[i];\n\t\t\tif (!child) continue;\n\t\t\tconst childLines = renderSchemaTree(child, flags, {\n\t\t\t\tisLast: i === node.children.length - 1,\n\t\t\t\tprefix: childPrefix,\n\t\t\t\tuseColor,\n\t\t\t\tformatDimText,\n\t\t\t\tisRoot: false\n\t\t\t});\n\t\t\tlines.push(...childLines);\n\t\t}\n\t}\n\treturn lines;\n}\n/**\n* Formats human-readable output for database introspection.\n*/\nfunction formatIntrospectOutput(result, schemaView, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (schemaView) {\n\t\tconst treeLines = renderSchemaTree(schemaView.root, flags, {\n\t\t\tisLast: true,\n\t\t\tprefix: \"\",\n\t\t\tuseColor,\n\t\t\tformatDimText,\n\t\t\tisRoot: true\n\t\t});\n\t\tlines.push(...treeLines);\n\t} else {\n\t\tlines.push(`✔ ${result.summary}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tlines.push(` Target: ${result.target.familyId}/${result.target.id}`);\n\t\t\tif (result.meta?.dbUrl) lines.push(` Database: ${result.meta.dbUrl}`);\n\t\t}\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats human-readable output for database schema verification.\n*/\nfunction formatSchemaVerifyOutput(result, flags, unclaimed = []) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatRed = createColorFormatter(useColor, red);\n\tconst formatYellow = createColorFormatter(useColor, yellow);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tconst issueMessages = result.schema.issues.map(formatIssueMessage);\n\tif (issueMessages.length > 0) {\n\t\tlines.push(formatRed(\"Schema issues:\"));\n\t\tfor (const message of issueMessages) lines.push(` ${formatRed(\"✖\")} ${message}`);\n\t}\n\tconst warningMessages = (result.schema.warnings?.issues ?? []).map(formatIssueMessage);\n\tif (warningMessages.length > 0) {\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push(formatYellow(\"Schema warnings:\"));\n\t\tfor (const message of warningMessages) lines.push(` ${formatYellow(\"⚠\")} ${message}`);\n\t}\n\tif (unclaimed.length > 0) {\n\t\tconst strict = result.meta?.strict ?? false;\n\t\tif (lines.length > 0) lines.push(\"\");\n\t\tlines.push((strict ? formatRed : formatYellow)(\"Unclaimed elements (declared by no contract):\"));\n\t\tfor (const name of unclaimed) lines.push(` ${(strict ? formatRed : formatYellow)(strict ? \"✖\" : \"⚠\")} ${name}`);\n\t}\n\tif (isVerbose(flags, 1)) lines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\tif (lines.length > 0) lines.push(\"\");\n\tif (result.ok) lines.push(`${formatGreen(\"✔\")} ${result.summary}`);\n\telse {\n\t\tconst codeText = result.code ? ` (${result.code})` : \"\";\n\t\tlines.push(`${formatRed(\"✖\")} ${result.summary}${codeText}`);\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database schema verification. The unclaimed-elements\n* list is a top-level field alongside the combined result, reported once for\n* the whole database.\n*/\nfunction formatSchemaVerifyJson(result, unclaimed = []) {\n\treturn JSON.stringify({\n\t\t...result,\n\t\tunclaimed\n\t}, null, 2);\n}\n/**\n* Formats human-readable output for database sign.\n*/\nfunction formatSignOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst useColor = flags.color !== false;\n\tconst formatGreen = createColorFormatter(useColor, green);\n\tconst formatDimText = (text) => formatDim(useColor, text);\n\tif (result.ok) {\n\t\tlines.push(`${formatGreen(\"✔\")} Database signed`);\n\t\tconst previousHash = result.marker.previous?.storageHash ?? \"none\";\n\t\tconst currentHash = result.contract.storageHash;\n\t\tlines.push(`${formatDimText(` from: ${previousHash}`)}`);\n\t\tlines.push(`${formatDimText(` to: ${currentHash}`)}`);\n\t\tif (isVerbose(flags, 1)) {\n\t\t\tif (result.contract.profileHash) lines.push(`${formatDimText(` profileHash: ${result.contract.profileHash}`)}`);\n\t\t\tif (result.marker.previous?.profileHash) lines.push(`${formatDimText(` previous profileHash: ${result.marker.previous.profileHash}`)}`);\n\t\t\tlines.push(`${formatDimText(` Total time: ${result.timings.total}ms`)}`);\n\t\t}\n\t}\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for database sign.\n*/\nfunction formatSignJson(result) {\n\treturn JSON.stringify(result, null, 2);\n}\n//#endregion\nexport { formatSignJson as a, formatVerifyOutput as c, formatSchemaVerifyOutput as i, formatIntrospectOutput as n, formatSignOutput as o, formatSchemaVerifyJson as r, formatVerifyJson as s, formatIntrospectJson as t };\n\n//# sourceMappingURL=verify-wUSBDQwh.mjs.map"],"mappings":";;;;;;AAMA,MAAM,gBAAgB;CACrB,aAAa;CACb,gBAAgB;CAChB,aAAa;AACd;;;;;;;AAOA,SAAS,mBAAmB,OAAO;CAClC,OAAO,GAAG,cAAc,aAAa,KAAK,GAAG,IAAI,MAAM,KAAK,KAAK,GAAG;AACrE;;;;AAIA,SAAS,mBAAmB,QAAQ,OAAO;CAC1C,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,QAAQ,CAAC;CACf,MAA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|
2
2
|
"name": "@prisma/orm-toolchain",
|
|
3
|
-
"version": "8.0.0-rc.1-dev.
|
|
3
|
+
"version": "8.0.0-rc.1-dev.30",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@clack/prompts": "^1.7.0",
|
|
16
|
-
"@prisma/cli-engine": "0.0.
|
|
17
|
-
"@prisma/orm-framework": "8.0.0-rc.1-dev.
|
|
16
|
+
"@prisma/cli-engine": "0.0.8",
|
|
17
|
+
"@prisma/orm-framework": "8.0.0-rc.1-dev.30",
|
|
18
18
|
"@vercel/detect-agent": "^1.2.4",
|
|
19
19
|
"arktype": "^2.2.2",
|
|
20
20
|
"c12": "^3.3.4",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"wrap-ansi": "^10.0.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@internal/cli": "8.0.0-rc.1-dev.
|
|
39
|
-
"@internal/cli-telemetry": "8.0.0-rc.1-dev.
|
|
40
|
-
"@internal/config-loader": "8.0.0-rc.1-dev.
|
|
41
|
-
"@internal/emitter": "8.0.0-rc.1-dev.
|
|
42
|
-
"@internal/language-server": "8.0.0-rc.1-dev.
|
|
43
|
-
"@internal/migration-tools": "8.0.0-rc.1-dev.
|
|
44
|
-
"@internal/publish-surface": "8.0.0-rc.1-dev.
|
|
45
|
-
"@repo/tsconfig": "8.0.0-rc.1-dev.
|
|
46
|
-
"@repo/tsdown": "8.0.0-rc.1-dev.
|
|
47
|
-
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.
|
|
38
|
+
"@internal/cli": "8.0.0-rc.1-dev.30",
|
|
39
|
+
"@internal/cli-telemetry": "8.0.0-rc.1-dev.30",
|
|
40
|
+
"@internal/config-loader": "8.0.0-rc.1-dev.30",
|
|
41
|
+
"@internal/emitter": "8.0.0-rc.1-dev.30",
|
|
42
|
+
"@internal/language-server": "8.0.0-rc.1-dev.30",
|
|
43
|
+
"@internal/migration-tools": "8.0.0-rc.1-dev.30",
|
|
44
|
+
"@internal/publish-surface": "8.0.0-rc.1-dev.30",
|
|
45
|
+
"@repo/tsconfig": "8.0.0-rc.1-dev.30",
|
|
46
|
+
"@repo/tsdown": "8.0.0-rc.1-dev.30",
|
|
47
|
+
"@internal/vite-plugin-contract-emit": "8.0.0-rc.1-dev.30",
|
|
48
48
|
"tsdown": "0.22.14",
|
|
49
49
|
"typescript": "5.9.3"
|
|
50
50
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-Co-8oaiB-CB-6Uqki.mjs","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/errors-Co-8oaiB.mjs"],"sourcesContent":["import { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { dirname, relative } from \"pathe\";\n//#region src/errors.ts\n/**\n* Build the canonical \"re-emit this package\" remediation hint.\n*\n* Every on-disk migration package ships its own `migration.ts` author-time\n* file. Running it regenerates `migration.json` and `ops.json` with the\n* correct hash + metadata, so it is the right primitive whenever a single\n* package's on-disk artifacts are missing, malformed, or otherwise corrupt.\n* Pointing users at `migration plan` would emit a *new* package rather than\n* heal the broken one.\n*/\nfunction reemitHint(dir, fallback) {\n\tconst reemit = `Re-emit the package by running \\`node \"${relative(process.cwd(), dir)}/migration.ts\"\\``;\n\treturn fallback ? `${reemit}, ${fallback}` : `${reemit}.`;\n}\n/**\n* Structured error for migration tooling operations.\n*\n* Follows the NAMESPACE.SUBCODE convention from ADR 027. All codes live under\n* the MIGRATION namespace. These are tooling-time errors (file I/O, hash\n* verification, migration history reconstruction), distinct from the runtime\n* MIGRATION.* codes for apply-time failures (PRECHECK_FAILED, POSTCHECK_FAILED,\n* etc.).\n*\n* Fields:\n* - code: Stable machine-readable code (MIGRATION.SUBCODE)\n* - category: Always 'MIGRATION'\n* - why: Explains the cause in plain language\n* - fix: Actionable remediation step\n* - meta: Machine-readable structured data for agents\n*/\nvar MigrationToolsError = class extends CliStructuredError {\n\tcategory;\n\tconstructor(code, summary, options) {\n\t\tsuper(code, summary, options);\n\t\tthis.category = \"MIGRATION\";\n\t}\n\tstatic is(error) {\n\t\treturn CliStructuredError.is(error) && \"category\" in error && error.category === \"MIGRATION\" && error.code.startsWith(\"MIGRATION.\");\n\t}\n};\nfunction errorDirectoryExists(dir) {\n\treturn new MigrationToolsError(\"MIGRATION.DIR_EXISTS\", \"Migration directory already exists\", {\n\t\twhy: `The directory \"${dir}\" already exists. Each migration must have a unique directory.`,\n\t\tfix: \"Use --name to pick a different name, or delete the existing directory and re-run.\",\n\t\tmeta: { dir }\n\t});\n}\nfunction errorMissingFile(file, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.FILE_MISSING\", `Missing ${file}`, {\n\t\twhy: `Expected \"${file}\" in \"${dir}\" but the file does not exist.`,\n\t\tfix: reemitHint(dir, \"or delete the directory if the migration is unwanted and the source TypeScript is gone.\"),\n\t\tmeta: {\n\t\t\tfile,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorInvalidJson(filePath, parseError) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_JSON\", \"Invalid JSON in migration file\", {\n\t\twhy: `Failed to parse \"${filePath}\": ${parseError}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tparseError\n\t\t}\n\t});\n}\nfunction errorInvalidManifest(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_MANIFEST\", \"Invalid migration manifest\", {\n\t\twhy: `Migration manifest at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorDescribeMissingEndContract() {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", \"Migration.describe(): provide endContractJson or override describe() — a migration needs a destination contract hash.\", {\n\t\twhy: \"Migration.describe() was called on a migration that carries no endContractJson and does not override describe(), so no destination contract hash can be derived.\",\n\t\tfix: \"Set endContractJson on the migration, or override describe() to return the { from, to } metadata explicitly.\",\n\t\tmeta: { reason: \"missing-end-contract\" }\n\t});\n}\nfunction errorDescribeInvalidMetadata(summary) {\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIBE_INVALID\", `describe() returned invalid metadata: ${summary}`, {\n\t\twhy: `The migration's describe() returned metadata that failed schema validation: ${summary}.`,\n\t\tfix: \"Ensure describe() returns { from: string | null, to: string } with valid contract hashes.\",\n\t\tmeta: {\n\t\t\treason: \"invalid-metadata\",\n\t\t\tsummary\n\t\t}\n\t});\n}\nfunction errorOperationsNotArray() {\n\treturn new MigrationToolsError(\"MIGRATION.PLAN_NOT_ARRAY\", \"operations must be an array\", {\n\t\twhy: \"The migration instance's `operations` getter returned a non-array value.\",\n\t\tfix: \"Ensure the `operations` getter returns an array of migration operations.\",\n\t\tmeta: {}\n\t});\n}\nfunction errorSpaceHeadRefMissing(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.CHECK_HEAD_REF_MISSING\", `Contract space \"${spaceId}\" has no head ref; its contract cannot be resolved from the snapshot store without one.`, {\n\t\twhy: `Contract space \"${spaceId}\" declares no refs/head.json, so there is no hash to resolve its contract against the snapshot store.`,\n\t\tfix: \"Re-emit the contract-space migrations and head-ref artifacts (the extension's contract-space build), or restore refs/head.json from version control.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorInvalidOperationEntry(index, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_OPERATION_ENTRY\", \"Migration operation entry is malformed\", {\n\t\twhy: `Operation at index ${index} returned by the migration class failed schema validation: ${reason}.`,\n\t\tfix: \"Update the migration class so each entry of `operations` carries `id` (string), `label` (string), and `operationClass` (one of 'additive' | 'widening' | 'destructive' | 'data').\",\n\t\tmeta: {\n\t\t\tindex,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidSlug(slug) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_NAME\", \"Invalid migration name\", {\n\t\twhy: `The slug \"${slug}\" contains no valid characters after sanitization (only a-z, 0-9 are kept).`,\n\t\tfix: \"Provide a name with at least one alphanumeric character, e.g. --name add_users.\",\n\t\tmeta: { slug }\n\t});\n}\nfunction errorInvalidDestName(destName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_DEST_NAME\", \"Invalid copy destination name\", {\n\t\twhy: `The destination name \"${destName}\" must be a single path segment (no \"..\" or directory separators).`,\n\t\tfix: \"Use a simple file name such as \\\"contract.json\\\" for each destination in the copy list.\",\n\t\tmeta: { destName }\n\t});\n}\nfunction errorInvalidSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_SPACE_ID\", \"Invalid contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" does not match the required pattern /^[a-z][a-z0-9_-]{0,63}$/. Space ids are used as filesystem directory names under \\`migrations/\\`, so the pattern is conservative on purpose.`,\n\t\tfix: \"Pick a lowercase identifier that begins with a letter and contains only lowercase letters, digits, hyphens, or underscores; max 64 characters total.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorDescriptorHeadHashMismatch(args) {\n\tconst { extensionId, recomputedHash, headRefHash } = args;\n\treturn new MigrationToolsError(\"MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH\", \"Extension descriptor's headRef.hash does not match its contractJson\", {\n\t\twhy: `Extension \"${extensionId}\" publishes a \\`contractSpace\\` whose \\`headRef.hash\\` (${headRefHash}) does not match the canonical hash recomputed from \\`contractSpace.contractJson\\` (${recomputedHash}). This means the extension descriptor was published with stale \\`headRef.hash\\` — typically because the contract was bumped without rerunning the extension's emit pipeline.`,\n\t\tfix: \"Re-run the extension authoring pipeline so `contractJson.storage.storageHash` and `headRef.hash` agree, then republish the extension. If you are the extension author and you intentionally bumped `contractJson`, recompute and update `headRef.hash` (and refresh any on-disk migration metadata that derives from it).\",\n\t\tmeta: {\n\t\t\textensionId,\n\t\t\trecomputedHash,\n\t\t\theadRefHash\n\t\t}\n\t});\n}\nfunction errorDuplicateSpaceId(spaceId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_SPACE_ID\", \"Duplicate contract space identifier\", {\n\t\twhy: `The space id \"${spaceId}\" appears more than once in the per-space planner input. Each space id must be unique across the inputs (the per-space planner emits one output entry per id).`,\n\t\tfix: \"Deduplicate the inputs before passing them to `planAllSpaces` — typically by checking your `extensions` declaration for repeated entries.\",\n\t\tmeta: { spaceId }\n\t});\n}\nfunction errorAmbiguousTarget(branchTips, context) {\n\tconst divergenceInfo = context ? `\\nDivergence point: ${context.divergencePoint}\\nBranches:\\n${context.branches.map((b) => ` → ${b.tip} (${b.edges.length} edge(s): ${b.edges.map((e) => e.dirName).join(\" → \") || \"direct\"})`).join(\"\\n\")}` : \"\";\n\treturn new MigrationToolsError(\"MIGRATION.AMBIGUOUS_TARGET\", \"Ambiguous migration target\", {\n\t\twhy: `The migration history has diverged into multiple branches: ${branchTips.join(\", \")}. This typically happens when two developers plan migrations from the same starting point.${divergenceInfo}`,\n\t\tfix: \"Use `ref set <name> <hash>` to target a specific branch, delete one of the conflicting migration directories and re-run `migration plan`, or use --from <hash> to explicitly select a starting point.\",\n\t\tmeta: {\n\t\t\tbranchTips,\n\t\t\t...context ? {\n\t\t\t\tdivergencePoint: context.divergencePoint,\n\t\t\t\tbranches: context.branches\n\t\t\t} : {}\n\t\t}\n\t});\n}\nfunction errorNoInitialMigration(nodes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_INITIAL_MIGRATION\", \"No initial migration found\", {\n\t\twhy: `No migration starts from the empty contract state (known hashes: ${nodes.join(\", \")}). At least one migration must originate from the empty state.`,\n\t\tfix: \"Inspect the migrations directory for corrupted migration.json files. At least one migration must start from the empty contract hash.\",\n\t\tmeta: { nodes }\n\t});\n}\nfunction errorInvalidRefFile(filePath, reason) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_FILE\", \"Invalid ref file\", {\n\t\twhy: `Ref file at \"${filePath}\" is invalid: ${reason}`,\n\t\tfix: \"Ensure the ref file contains valid JSON with { \\\"hash\\\": \\\"<64 hex chars>\\\", \\\"invariants\\\": [\\\"...\\\"] }.\",\n\t\tmeta: {\n\t\t\tpath: filePath,\n\t\t\treason\n\t\t}\n\t});\n}\nfunction errorInvalidRefName(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_NAME\", \"Invalid ref name\", {\n\t\twhy: `Ref name \"${refName}\" is invalid. Names must be lowercase alphanumeric with hyphens or forward slashes (no \".\" or \"..\" segments).`,\n\t\tfix: `Use a valid ref name (e.g., \"staging\", \"envs/production\").`,\n\t\tmeta: { refName }\n\t});\n}\nfunction errorNoTarget(reachableHashes) {\n\treturn new MigrationToolsError(\"MIGRATION.NO_TARGET\", \"No migration target could be resolved\", {\n\t\twhy: `The migration history contains cycles and no target can be resolved automatically (reachable hashes: ${reachableHashes.join(\", \")}). This typically happens after rollback migrations (e.g., C1→C2→C1).`,\n\t\tfix: \"Use --from <hash> to specify the planning origin explicitly.\",\n\t\tmeta: { reachableHashes }\n\t});\n}\nfunction errorInvalidRefValue(value) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_REF_VALUE\", \"Invalid ref value\", {\n\t\twhy: `Ref value \"${value}\" is not a valid contract hash. Values must be a 64-character hex digest or \"empty\".`,\n\t\tfix: \"Use a valid storage hash from `prisma-next contract emit` output or an existing migration.\",\n\t\tmeta: { value }\n\t});\n}\nfunction errorInvalidInvariantId(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.INVALID_INVARIANT_ID\", \"Invalid invariantId\", {\n\t\twhy: `invariantId ${JSON.stringify(invariantId)} is invalid. Ids must be non-empty and contain no whitespace or control characters (including Unicode whitespace like NBSP); other content (kebab-case, camelCase, namespaced, Unicode letters) is allowed.`,\n\t\tfix: \"Pick an invariantId without spaces, tabs, newlines, or control characters — e.g. \\\"backfill-user-phone\\\", \\\"users/backfill-phone\\\", or \\\"BackfillUserPhone\\\".\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorDuplicateInvariantInEdge(invariantId) {\n\treturn new MigrationToolsError(\"MIGRATION.DUPLICATE_INVARIANT_IN_EDGE\", \"Duplicate invariantId on a single migration\", {\n\t\twhy: `invariantId \"${invariantId}\" is declared by more than one dataTransform on the same migration. The marker stores invariants as a set and the routing layer treats them as edge-level, so two ops cannot share a routing identity.`,\n\t\tfix: \"Rename one of the conflicting dataTransform invariantIds, or drop invariantId on the op that does not need to be routing-visible.\",\n\t\tmeta: { invariantId }\n\t});\n}\nfunction errorProvidedInvariantsMismatch(filePath, stored, derived) {\n\tconst storedSet = new Set(stored);\n\tconst derivedSet = new Set(derived);\n\tconst missing = [...derivedSet].filter((id) => !storedSet.has(id));\n\tconst extra = [...storedSet].filter((id) => !derivedSet.has(id));\n\treturn new MigrationToolsError(\"MIGRATION.PROVIDED_INVARIANTS_MISMATCH\", \"providedInvariants on migration.json disagrees with ops.json\", {\n\t\twhy: missing.length === 0 && extra.length === 0 ? `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the canonical value derived from ops.json is ${JSON.stringify(derived)} — same ids, different order. Canonical providedInvariants is sorted ascending.` : `migration.json at \"${filePath}\" stores providedInvariants ${JSON.stringify(stored)}, but the value derived from ops.json is ${JSON.stringify(derived)}. The manifest copy was likely hand-edited without re-emitting.`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tstored,\n\t\t\tderived,\n\t\t\tdifference: {\n\t\t\t\tmissing,\n\t\t\t\textra\n\t\t\t}\n\t\t}\n\t});\n}\nfunction errorNoInvariantPath(args) {\n\tconst { refName, required, missing, structuralPath } = args;\n\tconst refClause = refName ? `Ref \"${refName}\"` : \"Target\";\n\tconst missingList = missing.map((id) => JSON.stringify(id)).join(\", \");\n\treturn new MigrationToolsError(\"MIGRATION.NO_INVARIANT_PATH\", \"No path covers the required invariants\", {\n\t\twhy: `${refClause} requires invariants the reachable path doesn't cover. required=[${required.map((id) => JSON.stringify(id)).join(\", \")}], missing=[${missingList}].`,\n\t\tfix: \"Add a migration on the path that runs `dataTransform({ invariantId: \\\"<id>\\\", … })` for each missing invariant, or retarget the ref to a hash whose path already provides them.\",\n\t\tmeta: {\n\t\t\trequired,\n\t\t\tmissing,\n\t\t\tstructuralPath,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorUnknownInvariant(args) {\n\tconst { refName, unknown, declared } = args;\n\treturn new MigrationToolsError(\"MIGRATION.UNKNOWN_INVARIANT\", \"Ref declares invariants no migration in the graph provides\", {\n\t\twhy: `${refName ? `Ref \"${refName}\" declares` : \"Declares\"} invariants no migration in the graph provides. unknown=[${unknown.map((id) => JSON.stringify(id)).join(\", \")}].`,\n\t\tfix: \"Either the ref has a typo, or the declaring migration has not been authored/attested yet. Re-check the ref file and the migrations directory.\",\n\t\tmeta: {\n\t\t\tunknown,\n\t\t\tdeclared,\n\t\t\t...ifDefined(\"refName\", refName)\n\t\t}\n\t});\n}\nfunction errorMigrationHashMismatch(dir, storedHash, computedHash) {\n\treturn new MigrationToolsError(\"MIGRATION.HASH_MISMATCH\", \"Migration package is corrupt\", {\n\t\twhy: `Stored migrationHash \"${storedHash}\" does not match the recomputed hash \"${computedHash}\" for \"${relative(process.cwd(), dir)}\". The migration.json or ops.json has been edited or partially written since emit.`,\n\t\tfix: reemitHint(dir, \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tdir,\n\t\t\tstoredHash,\n\t\t\tcomputedHash\n\t\t}\n\t});\n}\n/**\n* A ref name that resolves to nothing: no pointer file named `refName`\n* exists, and the hash being resolved (the `contractAt` argument, used as a\n* fallback when the pointer is absent) is not a node in the migration graph\n* either. There is no contract to materialize.\n*/\nfunction errorRefNotResolvable(refName) {\n\treturn new MigrationToolsError(\"MIGRATION.REF_NOT_RESOLVABLE\", `Ref \"${refName}\" is not resolvable`, {\n\t\twhy: `Ref \"${refName}\" has no pointer file, and the hash being resolved is not a node in the migration graph either — there is nothing to materialize a contract from.`,\n\t\tfix: `Create the ref with \"prisma-next ref set ${refName} <hash>\" (or advance it via \"prisma-next db update --advance-ref ${refName}\"), or pass a hash that is a node in the migration graph.`,\n\t\tmeta: {\n\t\t\trefName,\n\t\t\tidentifier: refName\n\t\t}\n\t});\n}\nfunction errorBundleNotFoundForGraphNode(hash, explicitLabel) {\n\treturn new MigrationToolsError(\"MIGRATION.BUNDLE_NOT_FOUND_FOR_GRAPH_NODE\", explicitLabel ? `No migration bundle found for reference \"${explicitLabel}\" (resolved hash: ${hash})` : `No migration bundle found for graph node ${hash}`, {\n\t\twhy: `The hash ${hash} is a graph node but no on-disk migration package has a destination (\\`to\\`) hash matching it.`,\n\t\tfix: \"Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations.\",\n\t\tmeta: {\n\t\t\thash,\n\t\t\t...explicitLabel ? { explicitLabel } : {}\n\t\t}\n\t});\n}\nfunction errorContractDeserializationFailed(filePath, message, options) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_DESERIALIZATION_FAILED\", \"Contract failed to deserialize\", {\n\t\twhy: `Contract at \"${filePath}\" failed to deserialize: ${message}`,\n\t\tfix: reemitHint(dirname(filePath), \"or restore the directory from version control.\"),\n\t\tmeta: {\n\t\t\tfilePath,\n\t\t\tmessage\n\t\t},\n\t\t...ifDefined(\"cause\", options?.cause)\n\t});\n}\nfunction errorHashNotInGraph(hash, graph) {\n\tconst reachableHashes = [...graph.nodes].sort();\n\tconst reachableList = reachableHashes.length > 0 ? reachableHashes.join(\", \") : \"(none)\";\n\treturn new MigrationToolsError(\"MIGRATION.HASH_NOT_IN_GRAPH\", `Hash \"${hash}\" is not a node in the migration graph`, {\n\t\twhy: `The migration graph contains nodes ${reachableList}; \"${hash}\" isn't one of them.`,\n\t\tfix: `Pass a hash that's the from-or-to of an on-disk migration bundle, use --from with a graph-node hash, or run \"prisma-next migration plan\" to introduce it.`,\n\t\tmeta: {\n\t\t\thash,\n\t\t\treachableHashes\n\t\t}\n\t});\n}\nfunction errorContractSnapshotMissing(storageHash, expectedPath) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_MISSING\", \"Contract snapshot is missing\", {\n\t\twhy: `Expected a contract snapshot for ${storageHash} at \"${expectedPath}\" but the file does not exist.`,\n\t\tfix: \"Re-emit the contract snapshot by re-running the command that authored the migration referencing this hash (`prisma-next migration plan` for app-space migrations; the extension's contract-space build for extension spaces), or restore migrations/snapshots/ from version control.\",\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\texpectedPath\n\t\t}\n\t});\n}\nfunction errorContractSnapshotHashMismatch(storageHash, actualHash, dir) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_SNAPSHOT_HASH_MISMATCH\", \"Contract snapshot hash mismatch\", {\n\t\twhy: `The contract JSON's inner storage.storageHash (\"${actualHash}\") does not match the requested storage hash (\"${storageHash}\") for snapshot directory \"${dir}\".`,\n\t\tfix: \"Pass a contractJson whose storage.storageHash equals the storageHash argument passed to writeContractSnapshot — the two must agree by construction.\",\n\t\tmeta: {\n\t\t\tstorageHash,\n\t\t\tactualHash,\n\t\t\tdir\n\t\t}\n\t});\n}\nfunction errorMigrationContractViewMissing(className, accessor, jsonField) {\n\treturn new MigrationToolsError(\"MIGRATION.CONTRACT_VIEW_MISSING\", `${className}.${accessor} requires ${jsonField}`, {\n\t\twhy: `${className}.${accessor} was read, but this instance has no ${jsonField} to build the view from.`,\n\t\tfix: `Set ${jsonField} to the migration's committed contract JSON, or avoid reading ${accessor} on a migration that overrides describe() and carries no contract.`,\n\t\tmeta: {\n\t\t\tclassName,\n\t\t\taccessor,\n\t\t\tjsonField\n\t\t}\n\t});\n}\n//#endregion\nexport { errorOperationsNotArray as A, errorInvalidSpaceId as C, errorNoInitialMigration as D, errorMissingFile as E, errorRefNotResolvable as M, errorSpaceHeadRefMissing as N, errorNoInvariantPath as O, errorUnknownInvariant as P, errorInvalidSlug as S, errorMigrationHashMismatch as T, errorInvalidManifest as _, errorContractSnapshotHashMismatch as a, errorInvalidRefName as b, errorDescribeMissingEndContract as c, errorDuplicateInvariantInEdge as d, errorDuplicateSpaceId as f, errorInvalidJson as g, errorInvalidInvariantId as h, errorContractDeserializationFailed as i, errorProvidedInvariantsMismatch as j, errorNoTarget as k, errorDescriptorHeadHashMismatch as l, errorInvalidDestName as m, errorAmbiguousTarget as n, errorContractSnapshotMissing as o, errorHashNotInGraph as p, errorBundleNotFoundForGraphNode as r, errorDescribeInvalidMetadata as s, MigrationToolsError as t, errorDirectoryExists as u, errorInvalidOperationEntry as v, errorMigrationContractViewMissing as w, errorInvalidRefValue as x, errorInvalidRefFile as y };\n\n//# sourceMappingURL=errors-Co-8oaiB.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,WAAW,KAAK,UAAU;CAClC,MAAM,SAAS,0CAA0C,SAAS,QAAQ,IAAI,GAAG,GAAG,EAAE;CACtF,OAAO,WAAW,GAAG,OAAO,IAAI,aAAa,GAAG,OAAO;AACxD;;;;;;;;;;;;;;;;;AAiBA,IAAI,sBAAsB,cAAc,mBAAmB;CAC1D;CACA,YAAY,MAAM,SAAS,SAAS;EACnC,MAAM,MAAM,SAAS,OAAO;EAC5B,KAAK,WAAW;CACjB;CACA,OAAO,GAAG,OAAO;EAChB,OAAO,mBAAmB,GAAG,KAAK,KAAK,cAAc,SAAS,MAAM,aAAa,eAAe,MAAM,KAAK,WAAW,YAAY;CACnI;AACD;AACA,SAAS,qBAAqB,KAAK;CAClC,OAAO,IAAI,oBAAoB,wBAAwB,sCAAsC;EAC5F,KAAK,kBAAkB,IAAI;EAC3B,KAAK;EACL,MAAM,EAAE,IAAI;CACb,CAAC;AACF;AACA,SAAS,i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AAM,OAAO;CACzC,MAAM,kBAAkB,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,KAAK;CAC9C,MAAM,gBAAgB,gBAAgB,SAAS,IAAI,gBAAgB,KAAK,IAAI,IAAI;CAChF,OAAO,IAAI,oBAAoB,+BAA+B,SAAS,KAAK,yCAAyC;EACpH,KAAK,sCAAsC,cAAc,KAAK,KAAK;EACnE,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,6BAA6B,aAAa,cAAc;CAChE,OAAO,IAAI,oBAAoB,uCAAuC,gCAAgC;EACrG,KAAK,oCAAoC,YAAY,OAAO,aAAa;EACzE,KAAK;EACL,MAAM;GACL;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,kCAAkC,aAAa,YAAY,KAAK;CACxE,OAAO,IAAI,oBAAoB,6CAA6C,mCAAmC;EAC9G,KAAK,mDAAmD,WAAW,iDAAiD,YAAY,6BAA6B,IAAI;EACjK,KAAK;EACL,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF;AACA,SAAS,kCAAkC,WAAW,UAAU,WAAW;CAC1E,OAAO,IAAI,oBAAoB,mCAAmC,GAAG,UAAU,GAAG,SAAS,YAAY,aAAa;EACnH,KAAK,GAAG,UAAU,GAAG,SAAS,sCAAsC,UAAU;EAC9E,KAAK,OAAO,UAAU,gEAAgE,SAAS;EAC/F,MAAM;GACL;GACA;GACA;EACD;CACD,CAAC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-NRmFpwR1.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/errors.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;;cAkBc,4BAA4B;WAC/B;WACA;WACA;WACA;EACT,YAAY,6BAA6B,iBAAiB;aAC/C;aACA;aACA,OAAO;aACP;;SAEJ,GAAG,iBAAiB,SAAS;;iBAErB,iBAAiB,kBAAkB,qBAAqB;iBACxD,gCAAgC;WACtC;WACA;WACA;IACP;iBACa,oBAAoB,kBAAkB;;;;;;;;;;;;UAY7C;WACC;WACA;WACA;WACA;WACA;;iBAEM,qBAAqB;WAC3B;WACA;WACA;WACA,yBAAyB;IAChC;iBACa,sBAAsB;WAC5B;WACA;WACA;IACP;iBACa,mCAAmC,kBAAkB,iBAAiB;WAC5E;IACP;iBACa,6BAA6B,qBAAqB,uBAAuB;iBACzE,kCAAkC,qBAAqB,oBAAoB,cAAc"}
|