@prisma/orm-toolchain 8.0.0-rc.1-dev.5 → 8.0.0-rc.1-dev.7
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-B4mhR4Sk.mjs → aggregate-D53gnb7v.mjs} +8 -8
- package/dist/{aggregate-B4mhR4Sk.mjs.map → aggregate-D53gnb7v.mjs.map} +1 -1
- package/dist/bin__prisma-next.mjs +22 -22
- package/dist/bin__prisma-next.mjs.map +1 -1
- package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs +14 -0
- package/dist/caught-errors-D7Qznyrm-BzYooF6H.mjs.map +1 -0
- package/dist/{types-DZWEs4si-D8UlyJI0.d.mts → cli-errors-CDr3WcJP-NFry5GHb.d.mts} +8 -2
- package/dist/cli-errors-CDr3WcJP-NFry5GHb.d.mts.map +1 -0
- package/dist/cli.mjs +2 -2
- 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.d.mts +3 -12
- package/dist/cli__commands__migrate.d.mts.map +1 -1
- package/dist/cli__commands__migrate.mjs +1 -1
- package/dist/cli__commands__migration-check.d.mts +1 -57
- package/dist/cli__commands__migration-check.d.mts.map +1 -1
- package/dist/cli__commands__migration-check.mjs +2 -2
- package/dist/cli__commands__migration-graph.d.mts +1 -1
- package/dist/cli__commands__migration-graph.mjs +1 -1
- package/dist/cli__commands__migration-list.d.mts +4 -44
- package/dist/cli__commands__migration-list.d.mts.map +1 -1
- package/dist/cli__commands__migration-list.mjs +2 -2
- package/dist/cli__commands__migration-log.d.mts +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.d.mts +2 -47
- package/dist/cli__commands__migration-plan.d.mts.map +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.d.mts +1 -1
- package/dist/cli__commands__migration-status.mjs +1 -1
- package/dist/cli__commands__ref.d.mts +1 -28
- package/dist/cli__commands__ref.d.mts.map +1 -1
- package/dist/cli__commands__ref.mjs +2 -2
- package/dist/cli__commands__telemetry.mjs +1 -1
- package/dist/cli__control-api.d.mts +502 -2
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +18 -3
- package/dist/cli__migration-cli.mjs +3 -6
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/{client-75qrAPqf-7l0C0H_b.mjs → client-Y6qbDk7X-BzKLmBZo.mjs} +16 -12
- package/dist/client-Y6qbDk7X-BzKLmBZo.mjs.map +1 -0
- package/dist/{command-helpers-CAoXqAY9-DWUBcTXM.mjs → command-helpers-C4WpR-QE-DE494TSG.mjs} +30 -74
- package/dist/command-helpers-C4WpR-QE-DE494TSG.mjs.map +1 -0
- package/dist/config-loader.d.mts +2 -18
- package/dist/contract-at-errors-Dv1mxKYO-C29YB4RC.mjs +44 -0
- package/dist/contract-at-errors-Dv1mxKYO-C29YB4RC.mjs.map +1 -0
- package/dist/{contract-emit-B6odMoem-C87PBvmo.mjs → contract-emit-CTm2zfuG-7PV9SBY6.mjs} +12 -11
- package/dist/contract-emit-CTm2zfuG-7PV9SBY6.mjs.map +1 -0
- package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs → contract-emit-D8IXP9Qp-Df6NwXn8.mjs} +4 -4
- package/dist/{contract-emit-0hSjbuxp-BJLC-VgC.mjs.map → contract-emit-D8IXP9Qp-Df6NwXn8.mjs.map} +1 -1
- package/dist/{contract-infer-BnkqpftN-DwBzasOu.mjs → contract-infer-BwT7ngoo-Dx6aAwIN.mjs} +5 -5
- package/dist/contract-infer-BwT7ngoo-Dx6aAwIN.mjs.map +1 -0
- package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs +82 -0
- package/dist/contract-snapshot-resolution-SATuw0JW-CsYq7g_n.mjs.map +1 -0
- package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs → contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs} +3 -3
- package/dist/{contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map → contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs.map} +1 -1
- package/dist/{contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs → contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs} +7 -7
- package/dist/contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs.map +1 -0
- package/dist/{db-init-bd0_x2Q8.mjs → db-init-CBj_EWg3.mjs} +18 -32
- package/dist/db-init-CBj_EWg3.mjs.map +1 -0
- package/dist/{db-schema-CwgAWTqG.mjs → db-schema-BWpeh0Q_.mjs} +4 -4
- package/dist/{db-schema-CwgAWTqG.mjs.map → db-schema-BWpeh0Q_.mjs.map} +1 -1
- package/dist/{db-sign-vqiYfpjI.mjs → db-sign-DCb_DKtv.mjs} +13 -29
- package/dist/db-sign-DCb_DKtv.mjs.map +1 -0
- package/dist/{db-update-Br0diOCo.mjs → db-update-WX0KitcX.mjs} +29 -52
- package/dist/db-update-WX0KitcX.mjs.map +1 -0
- package/dist/{db-verify-CKPsRFrj-T7nSt7yT.mjs → db-verify-B8ax2Y_x-Bp4s5Ra6.mjs} +9 -6
- package/dist/db-verify-B8ax2Y_x-Bp4s5Ra6.mjs.map +1 -0
- package/dist/{errors-IpZm1Skp-BH495dRd.mjs → errors-Co-8oaiB-CB-6Uqki.mjs} +45 -53
- package/dist/errors-Co-8oaiB-CB-6Uqki.mjs.map +1 -0
- package/dist/{errors--qsXZUtL.d.mts → errors-NRmFpwR1.d.mts} +13 -9
- package/dist/errors-NRmFpwR1.d.mts.map +1 -0
- package/dist/{format-ByDm2goZ-BIRlFoo6.mjs → format-Bw3LVJ1v-BJ6lVFMA.mjs} +12 -9
- package/dist/format-Bw3LVJ1v-BJ6lVFMA.mjs.map +1 -0
- package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs → framework-components-3DdB31mk-BHyX-OlJ.mjs} +3 -3
- package/dist/{framework-components-CjshQKHA-Dlp6Leo5.mjs.map → framework-components-3DdB31mk-BHyX-OlJ.mjs.map} +1 -1
- package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs → graph-membership-BEmNEMtP-rz61CLM5.mjs} +3 -3
- package/dist/{graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map → graph-membership-BEmNEMtP-rz61CLM5.mjs.map} +1 -1
- package/dist/index-Df9igRvP.d.mts +18 -0
- package/dist/index-Df9igRvP.d.mts.map +1 -0
- package/dist/{init-BGm77aWc-jHVUn63W.mjs → init-CPB89WK2-DPZRZ9Ee.mjs} +4 -4
- package/dist/{init-BGm77aWc-jHVUn63W.mjs.map → init-CPB89WK2-DPZRZ9Ee.mjs.map} +1 -1
- package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs → inspect-live-schema-Da76TWOs-CAFqkhGb.mjs} +4 -4
- package/dist/{inspect-live-schema-CnwYTRZ0-P-6asJFl.mjs.map → inspect-live-schema-Da76TWOs-CAFqkhGb.mjs.map} +1 -1
- package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs +52 -0
- package/dist/invariants-BzYfO9IL-BXTvx0z9.mjs.map +1 -0
- package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs → invariants-C1WVUAH7-DlOBTTkM.mjs} +3 -3
- package/dist/{invariants-lXzy6txi-DAoP4nTE.mjs.map → invariants-C1WVUAH7-DlOBTTkM.mjs.map} +1 -1
- package/dist/{io-C8TdyBKt-DloEBi70.mjs → io-CHUUeHh0-CoCBe9eN.mjs} +8 -8
- package/dist/{io-C8TdyBKt-DloEBi70.mjs.map → io-CHUUeHh0-CoCBe9eN.mjs.map} +1 -1
- package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs +22 -0
- package/dist/legend-5iwwlLU2-CB8bdQKJ.mjs.map +1 -0
- package/dist/{migrate-BdVFDKF2.mjs → migrate-B-NAuO90.mjs} +90 -227
- package/dist/migrate-B-NAuO90.mjs.map +1 -0
- package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts +56 -0
- package/dist/migrate-show-60NNqVia-oGqMaVA9.d.mts.map +1 -0
- package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs +202 -0
- package/dist/migrate-show-B2LkXkoB-D1ZNl84C.mjs.map +1 -0
- package/dist/{migration-BuUmO7It.mjs → migration-DAJY-NmR.mjs} +3 -3
- package/dist/{migration-BuUmO7It.mjs.map → migration-DAJY-NmR.mjs.map} +1 -1
- package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs +254 -0
- package/dist/migration-check-BDjtAn7x-B0nEBR0k.mjs.map +1 -0
- package/dist/{migration-check-DcwUnadt-jamDqOmM.mjs → migration-check-DONPyXff-CGTUpLv-.mjs} +12 -254
- package/dist/migration-check-DONPyXff-CGTUpLv-.mjs.map +1 -0
- package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs → migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs} +4 -4
- package/dist/{migration-command-scaffold-BCuoeAki-DMy_5ztW.mjs.map → migration-command-scaffold-BPqXPCFV-Bls2Wwg7.mjs.map} +1 -1
- package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs → migration-graph-DDaOHo10-yJFAbKCu.mjs} +3 -3
- package/dist/{migration-graph-CBf9ORe7-B4xAF8GN.mjs.map → migration-graph-DDaOHo10-yJFAbKCu.mjs.map} +1 -1
- package/dist/{migration-graph-vmgkL3k4.mjs → migration-graph-Dn469b0l.mjs} +10 -19
- package/dist/migration-graph-Dn469b0l.mjs.map +1 -0
- package/dist/migration-graph-HKch1Xk4-DyWhXtjZ.mjs +35 -0
- package/dist/migration-graph-HKch1Xk4-DyWhXtjZ.mjs.map +1 -0
- package/dist/migration-list-C9OPCMt--C28yBgVr.mjs +102 -0
- package/dist/migration-list-C9OPCMt--C28yBgVr.mjs.map +1 -0
- package/dist/migration-list-jk4iCtmO.mjs +120 -0
- package/dist/migration-list-jk4iCtmO.mjs.map +1 -0
- package/dist/{migration-log-CS5IWcNq-DI7FTHCA.mjs → migration-log-DQzUBrm8-D3m9wcuf.mjs} +7 -7
- package/dist/migration-log-DQzUBrm8-D3m9wcuf.mjs.map +1 -0
- package/dist/migration-new-BkSY6m0t.mjs +50 -0
- package/dist/migration-new-BkSY6m0t.mjs.map +1 -0
- package/dist/{migration-new-GmW2anVb.mjs → migration-new-g98oB3nC-BcrkxAAt.mjs} +19 -58
- package/dist/migration-new-g98oB3nC-BcrkxAAt.mjs.map +1 -0
- package/dist/{migration-path-target-D3Sj55PI-BICblCuk.mjs → migration-path-target-BPYp3LNc-DsDdLU0J.mjs} +4 -4
- package/dist/migration-path-target-BPYp3LNc-DsDdLU0J.mjs.map +1 -0
- package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts +159 -0
- package/dist/migration-plan-BsOYRogP-CC1UFAbu.d.mts.map +1 -0
- package/dist/migration-plan-CjIYMJZy.mjs +172 -0
- package/dist/migration-plan-CjIYMJZy.mjs.map +1 -0
- package/dist/{migration-plan-q_L84PN1-ClkGgtVz.mjs → migration-plan-CwuZLXVE-DAJ-JUQT.mjs} +46 -185
- package/dist/migration-plan-CwuZLXVE-DAJ-JUQT.mjs.map +1 -0
- package/dist/{migration-show--pW4XhKs.mjs → migration-show-CW6EKtfw.mjs} +16 -12
- package/dist/migration-show-CW6EKtfw.mjs.map +1 -0
- package/dist/{migration-status-CE7cQLDq-P1x1-BsZ.mjs → migration-status-DSQcBhiN.mjs} +37 -68
- package/dist/migration-status-DSQcBhiN.mjs.map +1 -0
- package/dist/migration-tools.d.mts +5 -5
- package/dist/migration-tools.mjs +13 -13
- 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 +2 -2
- package/dist/migration-tools__errors.mjs +2 -2
- 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.d.mts +1 -1
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{project-import-root-CpwLCDLY-DkVwAnWj.mjs → project-import-root-C_bd0ooL-WkbJLnAA.mjs} +10 -8
- package/dist/project-import-root-C_bd0ooL-WkbJLnAA.mjs.map +1 -0
- package/dist/ref-DSAZime8.mjs +72 -0
- package/dist/ref-DSAZime8.mjs.map +1 -0
- package/dist/ref-advancement-DaZBzm7m-BZQtedYC.mjs +96 -0
- package/dist/ref-advancement-DaZBzm7m-BZQtedYC.mjs.map +1 -0
- package/dist/ref-eJjxzYTh-CNiyDL4p.mjs +109 -0
- package/dist/ref-eJjxzYTh-CNiyDL4p.mjs.map +1 -0
- package/dist/{ref-resolution-BjJBWPjX.mjs → ref-resolution-Ct2GMcNB.mjs} +2 -2
- package/dist/{ref-resolution-BjJBWPjX.mjs.map → ref-resolution-Ct2GMcNB.mjs.map} +1 -1
- package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs +16 -0
- package/dist/ref-resolution-_S4xTT2L-BE5zgO2W.mjs.map +1 -0
- package/dist/{refs-BDbB9BRB-D6Za3Q49.mjs → refs-B2BL8z3i-DGGFB7Mj.mjs} +6 -6
- package/dist/refs-B2BL8z3i-DGGFB7Mj.mjs.map +1 -0
- package/dist/refs-fQLFcMoq-UTlvnijY.mjs +47 -0
- package/dist/refs-fQLFcMoq-UTlvnijY.mjs.map +1 -0
- package/dist/{spaces-DxFj5y8l.d.mts → spaces-D5qtTlhj.d.mts} +2 -2
- package/dist/{spaces-DxFj5y8l.d.mts.map → spaces-D5qtTlhj.d.mts.map} +1 -1
- package/dist/{spaces-C27bA-xc.mjs → spaces-DxuvClN9.mjs} +7 -7
- package/dist/spaces-DxuvClN9.mjs.map +1 -0
- package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs → telemetry-DVBHDQd6-Ckn5oClN.mjs} +3 -3
- package/dist/{telemetry-CmbCa3Ld-CmE5zcIG.mjs.map → telemetry-DVBHDQd6-Ckn5oClN.mjs.map} +1 -1
- package/dist/{verify-DnVNjc5C-BGdsblBK.mjs → verify-C6L_hiJU-B4V3bqvG.mjs} +3 -3
- package/dist/{verify-DnVNjc5C-BGdsblBK.mjs.map → verify-C6L_hiJU-B4V3bqvG.mjs.map} +1 -1
- package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs → verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs} +4 -4
- package/dist/{verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map → verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.mjs +1 -1
- package/package.json +12 -12
- package/dist/client-75qrAPqf-7l0C0H_b.mjs.map +0 -1
- package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +0 -1
- package/dist/config-loader.d.mts.map +0 -1
- package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +0 -36
- package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +0 -1
- package/dist/contract-emit-B6odMoem-C87PBvmo.mjs.map +0 -1
- package/dist/contract-infer-BnkqpftN-DwBzasOu.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +0 -1
- package/dist/db-init-bd0_x2Q8.mjs.map +0 -1
- package/dist/db-sign-vqiYfpjI.mjs.map +0 -1
- package/dist/db-update-Br0diOCo.mjs.map +0 -1
- package/dist/db-verify-CKPsRFrj-T7nSt7yT.mjs.map +0 -1
- package/dist/errors--qsXZUtL.d.mts.map +0 -1
- package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +0 -1
- package/dist/format-ByDm2goZ-BIRlFoo6.mjs.map +0 -1
- package/dist/migrate-BdVFDKF2.mjs.map +0 -1
- package/dist/migration-check-DcwUnadt-jamDqOmM.mjs.map +0 -1
- package/dist/migration-graph-vmgkL3k4.mjs.map +0 -1
- package/dist/migration-list-BFBeo1_X-ckYMhETH.mjs +0 -228
- package/dist/migration-list-BFBeo1_X-ckYMhETH.mjs.map +0 -1
- package/dist/migration-log-CS5IWcNq-DI7FTHCA.mjs.map +0 -1
- package/dist/migration-new-GmW2anVb.mjs.map +0 -1
- package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +0 -1
- package/dist/migration-plan-q_L84PN1-ClkGgtVz.mjs.map +0 -1
- package/dist/migration-show--pW4XhKs.mjs.map +0 -1
- package/dist/migration-status-CE7cQLDq-P1x1-BsZ.mjs.map +0 -1
- package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +0 -1
- package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs +0 -57
- package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs.map +0 -1
- package/dist/ref-sHE8zOcm.mjs +0 -171
- package/dist/ref-sHE8zOcm.mjs.map +0 -1
- package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +0 -1
- package/dist/spaces-C27bA-xc.mjs.map +0 -1
- package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +0 -1
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./constants-CM-w38DQ-Cz_EXbOc.mjs";
|
|
3
|
-
import { r as findLatestMigration } from "./migration-graph-CBf9ORe7-B4xAF8GN.mjs";
|
|
4
|
-
import { $ as maskConnectionUrl, N as errorUnexpected, O as errorRuntime$1, Q as mapRefResolutionError, R as formatMigrationApplyCommandOutput, S as errorPathUnreachable, W as formatStyledHeader, Z as mapMigrationToolsError, at as resolveMigrationPaths, ct as setCommandExamples, d as errorContractValidationFailed, f as errorDatabaseConnectionRequired, h as errorFileNotFound, i as collectDeclaredInvariants, it as resolveContractPath, j as errorTargetMigrationNotSupported, m as errorDriverRequired, o as createTerminalUI, q as handleResult, r as addGlobalOptions, rt as requireLiveDatabase, st as setCommandDescriptions, t as CliStructuredError$1, tt as parseGlobalFlagsOrExit, ut as targetSupportsMigrations, y as errorMarkerMismatch } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
|
|
1
|
+
import { D as errorRunnerFailed, N as errorUnexpected, Q as maskConnectionUrl, R as formatMigrationApplyCommandOutput, S as errorPathUnreachable, W as formatStyledHeader, d as errorContractValidationFailed, et as parseGlobalFlagsOrExit, f as errorDatabaseConnectionRequired, h as errorFileNotFound, it as resolveMigrationPaths, j as errorTargetMigrationNotSupported, lt as targetSupportsMigrations, m as errorDriverRequired, o as createTerminalUI, ot as setCommandDescriptions, q as handleResult, r as addGlobalOptions, rt as resolveContractPath, st as setCommandExamples } from "./command-helpers-C4WpR-QE-DE494TSG.mjs";
|
|
5
2
|
import { r as loadConfig } from "./exports-CDX9kZuw.mjs";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { i as
|
|
12
|
-
import {
|
|
13
|
-
import { t as mapContractAtError } from "./contract-at-errors-BX7w-p19-SxA8eaV2.mjs";
|
|
3
|
+
import { a as readContractIR, t as advanceRefSafely } from "./ref-advancement-DaZBzm7m-BZQtedYC.mjs";
|
|
4
|
+
import { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from "./contract-space-aggregate-loader-C5r12INu-Db_pa3rX.mjs";
|
|
5
|
+
import { t as createControlClient } from "./client-Y6qbDk7X-BzKLmBZo.mjs";
|
|
6
|
+
import { t as mapContractAtError } from "./contract-at-errors-Dv1mxKYO-C29YB4RC.mjs";
|
|
7
|
+
import { t as resolveContractRef } from "./ref-resolution-_S4xTT2L-BE5zgO2W.mjs";
|
|
8
|
+
import { i as refuseUnknownInvariants, n as refuseMarkerOutsideGraph } from "./invariants-BzYfO9IL-BXTvx0z9.mjs";
|
|
9
|
+
import { t as listRefsByContractHash } from "./migration-list-C9OPCMt--C28yBgVr.mjs";
|
|
14
10
|
import { c as computeMaxDirNameWidth, d as highlightFromEdgeAnnotations, f as indentMigrationGraphTreeBlock, h as renderMigrationGraphCommand, i as buildMigrationGraphRows, r as buildGrid, s as computeLabelColumn, u as formatOnPathMigrationRow } from "./migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs";
|
|
15
|
-
import {
|
|
11
|
+
import { t as mapCaughtMigrationError } from "./caught-errors-D7Qznyrm-BzYooF6H.mjs";
|
|
12
|
+
import { t as executeMigrateShowPlan } from "./migrate-show-B2LkXkoB-D1ZNl84C.mjs";
|
|
16
13
|
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
17
14
|
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
18
15
|
import { readFile } from "node:fs/promises";
|
|
@@ -20,199 +17,52 @@ import { createControlStack } from "@prisma/orm-framework/components/control";
|
|
|
20
17
|
import { Command } from "commander";
|
|
21
18
|
//#region ../../../1-framework/3-tooling/cli/dist/commands/migrate.mjs
|
|
22
19
|
/**
|
|
23
|
-
* Read-only preview of the migration path `migrate` will take.
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
|
|
27
|
-
* the full marker including `invariants` (not just `storageHash`).
|
|
28
|
-
* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,
|
|
29
|
-
* which feeds `resolveRecordedPath()` with the same target hash, target invariants,
|
|
30
|
-
* and current marker as the real apply path uses.
|
|
31
|
-
*
|
|
32
|
-
* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No
|
|
33
|
-
* DB state is mutated.
|
|
20
|
+
* Read-only preview of the migration path `migrate` will take. Delegates the
|
|
21
|
+
* path computation to {@link executeMigrateShowPlan} (the control-api core)
|
|
22
|
+
* and keeps only the styled header plus the Tier-3 graph rendering here.
|
|
34
23
|
*/
|
|
35
24
|
async function executeMigrateShowCommand(options, flags, ui) {
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (!toResult.ok) return notOk(mapRefResolutionError(toResult.failure));
|
|
70
|
-
if (toResult.value.provenance.kind === "reserved-db") return notOk(errorDatabaseConnectionRequired({
|
|
71
|
-
why: "@db is not valid as a --to target; it names the live database state, not a target contract.",
|
|
72
|
-
commandName: "migrate --show"
|
|
73
|
-
}));
|
|
74
|
-
targetHash = toResult.value.hash;
|
|
75
|
-
if (toResult.value.provenance.kind === "ref") {
|
|
76
|
-
const refEntry = allRefs[toResult.value.provenance.refName];
|
|
77
|
-
if (refEntry) refInvariants = refEntry.invariants;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
if (!flags.json && !flags.quiet) {
|
|
81
|
-
const details = [{
|
|
82
|
-
label: "config",
|
|
83
|
-
value: configPath
|
|
84
|
-
}, {
|
|
85
|
-
label: "migrations",
|
|
86
|
-
value: migrationsRelative
|
|
87
|
-
}];
|
|
88
|
-
if (dbConnection && !hasExplicitFrom) details.push({
|
|
89
|
-
label: "database",
|
|
90
|
-
value: maskConnectionUrl(String(dbConnection))
|
|
91
|
-
});
|
|
92
|
-
if (options.from) details.push({
|
|
93
|
-
label: "from",
|
|
94
|
-
value: options.from
|
|
95
|
-
});
|
|
96
|
-
if (options.to) details.push({
|
|
97
|
-
label: "to",
|
|
98
|
-
value: options.to
|
|
99
|
-
});
|
|
100
|
-
const header = formatStyledHeader({
|
|
101
|
-
command: "migrate --show",
|
|
102
|
-
description: "Preview the migration path migrate will take (read-only)",
|
|
103
|
-
details,
|
|
104
|
-
flags
|
|
105
|
-
});
|
|
106
|
-
ui.stderr(header);
|
|
107
|
-
}
|
|
108
|
-
const markerBySpace = /* @__PURE__ */ new Map();
|
|
109
|
-
const allSpaces = [aggregate.app, ...aggregate.extensions];
|
|
110
|
-
if (hasExplicitFrom) if (options.from === "@db") {
|
|
111
|
-
const missingDb = requireLiveDatabase({
|
|
112
|
-
dbConnection,
|
|
113
|
-
hasDriver,
|
|
114
|
-
why: "@db resolves to the live database marker and requires a --db connection",
|
|
115
|
-
retryCommand: "prisma-next migrate --show --from @db --db $DATABASE_URL"
|
|
116
|
-
});
|
|
117
|
-
if (missingDb) return notOk(missingDb);
|
|
118
|
-
} else {
|
|
119
|
-
const fromResult = parseContractRef(options.from, {
|
|
120
|
-
graph: appGraph,
|
|
121
|
-
refs: allRefs,
|
|
122
|
-
contractHash
|
|
123
|
-
});
|
|
124
|
-
if (!fromResult.ok) return notOk(mapRefResolutionError(fromResult.failure));
|
|
125
|
-
if (fromResult.value.provenance.kind === "reserved-db") {
|
|
126
|
-
const missingDb = requireLiveDatabase({
|
|
127
|
-
dbConnection,
|
|
128
|
-
hasDriver,
|
|
129
|
-
why: "@db resolves to the live database marker and requires a --db connection"
|
|
130
|
-
});
|
|
131
|
-
if (missingDb) return notOk(missingDb);
|
|
132
|
-
} else {
|
|
133
|
-
const fromHash = fromResult.value.hash;
|
|
134
|
-
const offlineMarker = fromHash === "empty" ? null : {
|
|
135
|
-
storageHash: fromHash,
|
|
136
|
-
invariants: []
|
|
137
|
-
};
|
|
138
|
-
markerBySpace.set(aggregate.app.spaceId, offlineMarker);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const needsLiveMarker = !hasExplicitFrom || options.from === "@db";
|
|
142
|
-
if (needsLiveMarker) {
|
|
143
|
-
if (!dbConnection || !hasDriver) return notOk(errorDatabaseConnectionRequired({
|
|
144
|
-
why: "A database connection is required to read the live marker for migrate --show",
|
|
145
|
-
commandName: "migrate --show"
|
|
146
|
-
}));
|
|
147
|
-
const client = createControlClient({
|
|
148
|
-
family: config.family,
|
|
149
|
-
target: config.target,
|
|
150
|
-
adapter: config.adapter,
|
|
151
|
-
driver: config.driver,
|
|
152
|
-
extensions: config.extensions ?? []
|
|
153
|
-
});
|
|
154
|
-
try {
|
|
155
|
-
await client.connect(dbConnection);
|
|
156
|
-
const allMarkers = await client.readAllMarkers();
|
|
157
|
-
for (const space of allSpaces) {
|
|
158
|
-
const marker = allMarkers.get(space.spaceId);
|
|
159
|
-
markerBySpace.set(space.spaceId, marker ?? null);
|
|
160
|
-
}
|
|
161
|
-
} catch (error) {
|
|
162
|
-
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
163
|
-
if (MigrationToolsError.is(error)) return notOk(mapMigrationToolsError(error));
|
|
164
|
-
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read live DB marker: ${error instanceof Error ? error.message : String(error)}` }));
|
|
165
|
-
} finally {
|
|
166
|
-
await client.close();
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
const canonicalOrderSpaces = [...aggregate.extensions, aggregate.app];
|
|
170
|
-
const orderedMigrations = [];
|
|
171
|
-
for (const space of canonicalOrderSpaces) {
|
|
172
|
-
const isAppSpace = space.spaceId === aggregate.app.spaceId;
|
|
173
|
-
const headRef = requireHeadRef(space);
|
|
174
|
-
const outcome = planSpacePath({
|
|
175
|
-
space,
|
|
176
|
-
aggregate,
|
|
177
|
-
targetHash: isAppSpace ? targetHash : headRef.hash,
|
|
178
|
-
refInvariants: isAppSpace ? refInvariants : void 0,
|
|
179
|
-
liveMarker: markerBySpace.get(space.spaceId) ?? null
|
|
180
|
-
});
|
|
181
|
-
if (outcome.kind === "at-head") continue;
|
|
182
|
-
if (outcome.kind === "never-planned") return notOk(errorPathUnreachable({
|
|
183
|
-
code: "MIGRATION_PATH_NOT_FOUND",
|
|
184
|
-
summary: `No on-disk migrations for contract space "${outcome.spaceId}"`,
|
|
185
|
-
why: `migrate is replay-only: space "${outcome.spaceId}" has no on-disk migrations but its head ref targets "${outcome.targetHash}".`,
|
|
186
|
-
meta: {
|
|
187
|
-
spaceId: outcome.spaceId,
|
|
188
|
-
target: outcome.targetHash,
|
|
189
|
-
kind: "neverPlanned"
|
|
25
|
+
const planResult = await executeMigrateShowPlan({
|
|
26
|
+
...ifDefined("config", options.config),
|
|
27
|
+
...ifDefined("db", options.db),
|
|
28
|
+
...ifDefined("to", options.to),
|
|
29
|
+
...ifDefined("from", options.from),
|
|
30
|
+
onPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {
|
|
31
|
+
if (!flags.json && !flags.quiet) {
|
|
32
|
+
const details = [{
|
|
33
|
+
label: "config",
|
|
34
|
+
value: configPath
|
|
35
|
+
}, {
|
|
36
|
+
label: "migrations",
|
|
37
|
+
value: migrationsRelative
|
|
38
|
+
}];
|
|
39
|
+
if (dbConnection && !hasExplicitFrom) details.push({
|
|
40
|
+
label: "database",
|
|
41
|
+
value: maskConnectionUrl(String(dbConnection))
|
|
42
|
+
});
|
|
43
|
+
if (options.from) details.push({
|
|
44
|
+
label: "from",
|
|
45
|
+
value: options.from
|
|
46
|
+
});
|
|
47
|
+
if (options.to) details.push({
|
|
48
|
+
label: "to",
|
|
49
|
+
value: options.to
|
|
50
|
+
});
|
|
51
|
+
const header = formatStyledHeader({
|
|
52
|
+
command: "migrate --show",
|
|
53
|
+
description: "Preview the migration path migrate will take (read-only)",
|
|
54
|
+
details,
|
|
55
|
+
flags
|
|
56
|
+
});
|
|
57
|
+
ui.stderr(header);
|
|
190
58
|
}
|
|
191
|
-
}));
|
|
192
|
-
if (outcome.kind === "unreachable") {
|
|
193
|
-
const fromHash = outcome.liveMarker?.storageHash ?? "empty";
|
|
194
|
-
return notOk(errorPathUnreachable({
|
|
195
|
-
code: "MIGRATION_PATH_NOT_FOUND",
|
|
196
|
-
summary: `No migration path from ${fromHash.slice(0, 14)} to ${outcome.targetHash.slice(0, 14)} in space "${outcome.spaceId}".`,
|
|
197
|
-
why: `The migration graph has no path from the from-state to the target in space "${outcome.spaceId}".`,
|
|
198
|
-
meta: {
|
|
199
|
-
spaceId: outcome.spaceId,
|
|
200
|
-
from: fromHash,
|
|
201
|
-
to: outcome.targetHash
|
|
202
|
-
}
|
|
203
|
-
}));
|
|
204
59
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
to: edge.to
|
|
212
|
-
});
|
|
213
|
-
}
|
|
214
|
-
const count = orderedMigrations.length;
|
|
215
|
-
const summary = count === 0 ? "Already up to date — nothing to run" : `${count} migration${count === 1 ? "" : "s"} will run`;
|
|
60
|
+
});
|
|
61
|
+
if (!planResult.ok) return notOk(planResult.failure);
|
|
62
|
+
const plan = planResult.value;
|
|
63
|
+
const { aggregate, contractHash } = plan;
|
|
64
|
+
const orderedMigrations = plan.migrations;
|
|
65
|
+
const allSpaces = [aggregate.app, ...aggregate.extensions];
|
|
216
66
|
let graphOutput;
|
|
217
67
|
let runListDirNameWidth;
|
|
218
68
|
let runListLeftPad;
|
|
@@ -243,13 +93,13 @@ async function executeMigrateShowCommand(options, flags, ui) {
|
|
|
243
93
|
const showSpaceHeadings = allSpaces.length > 1;
|
|
244
94
|
const sections = [];
|
|
245
95
|
for (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {
|
|
246
|
-
const liveMarkerHash =
|
|
96
|
+
const liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);
|
|
247
97
|
const tree = renderMigrationGraphCommand({
|
|
248
98
|
grid,
|
|
249
99
|
rowModel,
|
|
250
100
|
contractHash,
|
|
251
101
|
isAppSpace: isApp,
|
|
252
|
-
...
|
|
102
|
+
...plan.usedLiveMarker ? { dbHash: liveMarkerHash } : {},
|
|
253
103
|
refsByHash: listRefsByContractHash(space),
|
|
254
104
|
edgeAnnotationsByHash: edgeAnnotations,
|
|
255
105
|
colorize,
|
|
@@ -266,7 +116,7 @@ async function executeMigrateShowCommand(options, flags, ui) {
|
|
|
266
116
|
return ok({
|
|
267
117
|
ok: true,
|
|
268
118
|
migrations: orderedMigrations,
|
|
269
|
-
summary,
|
|
119
|
+
summary: plan.summary,
|
|
270
120
|
...graphOutput !== void 0 ? { graphOutput } : {},
|
|
271
121
|
...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},
|
|
272
122
|
...runListLeftPad !== void 0 ? { runListLeftPad } : {}
|
|
@@ -293,10 +143,11 @@ function formatMigrateShowOutput(result, flags) {
|
|
|
293
143
|
}
|
|
294
144
|
function mapApplyFailure(failure) {
|
|
295
145
|
if (failure.code === "MIGRATION_PATH_NOT_FOUND") return errorPathUnreachable(failure);
|
|
296
|
-
return
|
|
146
|
+
return errorRunnerFailed(failure.summary, {
|
|
297
147
|
why: failure.why ?? "Migration runner failed",
|
|
298
148
|
fix: "Fix the issue and re-run `prisma-next migrate --to <contract>` — previously applied migrations are preserved.",
|
|
299
|
-
meta: failure.meta ?? {}
|
|
149
|
+
meta: failure.meta ?? {},
|
|
150
|
+
...ifDefined("cause", failure.cause)
|
|
300
151
|
});
|
|
301
152
|
}
|
|
302
153
|
async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
@@ -347,11 +198,11 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
|
347
198
|
let refName;
|
|
348
199
|
if (toArg) {
|
|
349
200
|
const refs = aggregate.app.refs;
|
|
350
|
-
const refResult =
|
|
201
|
+
const refResult = resolveContractRef(toArg, {
|
|
351
202
|
graph: aggregate.app.graph(),
|
|
352
203
|
refs
|
|
353
204
|
});
|
|
354
|
-
if (!refResult.ok) return notOk(
|
|
205
|
+
if (!refResult.ok) return notOk(refResult.failure);
|
|
355
206
|
if (refResult.value.provenance.kind === "ref") {
|
|
356
207
|
refName = refResult.value.provenance.refName;
|
|
357
208
|
const resolved = refs[refName];
|
|
@@ -397,17 +248,21 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
|
397
248
|
try {
|
|
398
249
|
await client.connect(dbConnection);
|
|
399
250
|
const appMarker = (await client.readAllMarkers()).get("app") ?? null;
|
|
400
|
-
if (appMarker !== null
|
|
251
|
+
if (appMarker !== null) {
|
|
252
|
+
const markerRefusal = refuseMarkerOutsideGraph({
|
|
253
|
+
markerHash: appMarker.storageHash,
|
|
254
|
+
graph: appGraph
|
|
255
|
+
});
|
|
256
|
+
if (markerRefusal) return notOk(markerRefusal);
|
|
257
|
+
}
|
|
401
258
|
if (refEntry && refEntry.invariants.length > 0) {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
declared: [...declared].sort()
|
|
410
|
-
})));
|
|
259
|
+
const invariantRefusal = refuseUnknownInvariants({
|
|
260
|
+
graph: appGraph,
|
|
261
|
+
markerInvariants: appMarker?.invariants ?? [],
|
|
262
|
+
refInvariants: refEntry.invariants,
|
|
263
|
+
...ifDefined("refName", toArg)
|
|
264
|
+
});
|
|
265
|
+
if (invariantRefusal) return notOk(invariantRefusal);
|
|
411
266
|
}
|
|
412
267
|
if (!flags.quiet && !flags.json) ui.step("Loading contract spaces…");
|
|
413
268
|
let applyContract = contractRaw;
|
|
@@ -434,15 +289,23 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
|
434
289
|
if (!applyResult.ok) return notOk(mapApplyFailure(applyResult.failure));
|
|
435
290
|
const { value } = applyResult;
|
|
436
291
|
let advancedRef = null;
|
|
437
|
-
if (options.advanceRef !== void 0)
|
|
292
|
+
if (options.advanceRef !== void 0) {
|
|
438
293
|
const contractIR = snapshotContractDts !== void 0 ? {
|
|
439
294
|
contract: snapshotContractJson,
|
|
440
295
|
contractDts: snapshotContractDts
|
|
441
296
|
} : await readContractIR(snapshotContractJson, contractPathAbsolute);
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
297
|
+
const advanced = await advanceRefSafely({
|
|
298
|
+
refsDir,
|
|
299
|
+
migrationsDir,
|
|
300
|
+
name: options.advanceRef,
|
|
301
|
+
hash: value.markerHash,
|
|
302
|
+
contractIR
|
|
303
|
+
});
|
|
304
|
+
if (!advanced.ok) return notOk(advanced.failure);
|
|
305
|
+
advancedRef = {
|
|
306
|
+
name: advanced.value.name,
|
|
307
|
+
hash: advanced.value.hash
|
|
308
|
+
};
|
|
446
309
|
}
|
|
447
310
|
return ok({
|
|
448
311
|
ok: true,
|
|
@@ -457,8 +320,8 @@ async function executeMigrateCommand(options, flags, ui, startTime) {
|
|
|
457
320
|
advancedRef
|
|
458
321
|
});
|
|
459
322
|
} catch (error) {
|
|
460
|
-
|
|
461
|
-
if (
|
|
323
|
+
const mapped = mapCaughtMigrationError(error);
|
|
324
|
+
if (mapped) return notOk(mapped);
|
|
462
325
|
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));
|
|
463
326
|
} finally {
|
|
464
327
|
await client.close();
|
|
@@ -497,4 +360,4 @@ function createMigrateCommand() {
|
|
|
497
360
|
//#endregion
|
|
498
361
|
export { createMigrateCommand as t };
|
|
499
362
|
|
|
500
|
-
//# sourceMappingURL=migrate-
|
|
363
|
+
//# sourceMappingURL=migrate-B-NAuO90.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-B-NAuO90.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migrate.mjs"],"sourcesContent":["import { A as formatStyledHeader, B as errorContractValidationFailed, S as formatMigrationApplyCommandOutput, U as errorDriverRequired, V as errorDatabaseConnectionRequired, W as errorFileNotFound, Z as errorPathUnreachable, _ as createTerminalUI, ct as errorUnexpected, f as targetSupportsMigrations, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, nt as errorRunnerFailed, o as resolveContractPath, ot as errorTargetMigrationNotSupported, s as resolveMigrationPaths, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"../command-helpers-C4WpR-QE.mjs\";\nimport { a as loadContractSpaceAggregateForCli, s as refuseContractSpaceIntegrity, u as toDeclaredExtensionsFromRaw } from \"../contract-space-aggregate-loader-C5r12INu.mjs\";\nimport { t as createControlClient } from \"../client-Y6qbDk7X.mjs\";\nimport { a as readContractIR, t as advanceRefSafely } from \"../ref-advancement-DaZBzm7m.mjs\";\nimport { t as mapCaughtMigrationError } from \"../caught-errors-D7Qznyrm.mjs\";\nimport { t as mapContractAtError } from \"../contract-at-errors-Dv1mxKYO.mjs\";\nimport { i as refuseMarkerOutsideGraph, n as refuseUnknownInvariants } from \"../invariants-BzYfO9IL.mjs\";\nimport { t as executeMigrateShowPlan } from \"../migrate-show-B2LkXkoB.mjs\";\nimport { t as listRefsByContractHash } from \"../migration-list-C9OPCMt-.mjs\";\nimport { t as resolveContractRef } from \"../ref-resolution-_S4xTT2L.mjs\";\nimport { d as highlightFromEdgeAnnotations, f as indentMigrationGraphTreeBlock, h as buildGrid, i as formatOnPathMigrationRow, m as buildMigrationGraphRows, n as computeMaxDirNameWidth, r as renderMigrationGraphCommand, t as computeLabelColumn } from \"../migration-graph-command-render-BKrg6BPv.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfig } from \"@internal/config-loader\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { readFile } from \"node:fs/promises\";\nimport { createControlStack } from \"@internal/framework-components/control\";\n//#region src/commands/migrate.ts\n/**\n* Read-only preview of the migration path `migrate` will take. Delegates the\n* path computation to {@link executeMigrateShowPlan} (the control-api core)\n* and keeps only the styled header plus the Tier-3 graph rendering here.\n*/\nasync function executeMigrateShowCommand(options, flags, ui) {\n\tconst planResult = await executeMigrateShowPlan({\n\t\t...ifDefined(\"config\", options.config),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"to\", options.to),\n\t\t...ifDefined(\"from\", options.from),\n\t\tonPreflightComplete: ({ configPath, migrationsRelative, dbConnection, hasExplicitFrom }) => {\n\t\t\tif (!flags.json && !flags.quiet) {\n\t\t\t\tconst details = [{\n\t\t\t\t\tlabel: \"config\",\n\t\t\t\t\tvalue: configPath\n\t\t\t\t}, {\n\t\t\t\t\tlabel: \"migrations\",\n\t\t\t\t\tvalue: migrationsRelative\n\t\t\t\t}];\n\t\t\t\tif (dbConnection && !hasExplicitFrom) details.push({\n\t\t\t\t\tlabel: \"database\",\n\t\t\t\t\tvalue: maskConnectionUrl(String(dbConnection))\n\t\t\t\t});\n\t\t\t\tif (options.from) details.push({\n\t\t\t\t\tlabel: \"from\",\n\t\t\t\t\tvalue: options.from\n\t\t\t\t});\n\t\t\t\tif (options.to) details.push({\n\t\t\t\t\tlabel: \"to\",\n\t\t\t\t\tvalue: options.to\n\t\t\t\t});\n\t\t\t\tconst header = formatStyledHeader({\n\t\t\t\t\tcommand: \"migrate --show\",\n\t\t\t\t\tdescription: \"Preview the migration path migrate will take (read-only)\",\n\t\t\t\t\tdetails,\n\t\t\t\t\tflags\n\t\t\t\t});\n\t\t\t\tui.stderr(header);\n\t\t\t}\n\t\t}\n\t});\n\tif (!planResult.ok) return notOk(planResult.failure);\n\tconst plan = planResult.value;\n\tconst { aggregate, contractHash } = plan;\n\tconst orderedMigrations = plan.migrations;\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tlet graphOutput;\n\tlet runListDirNameWidth;\n\tlet runListLeftPad;\n\tif (!flags.json) {\n\t\tconst onPathHashes = new Set(orderedMigrations.map((m) => m.migrationHash));\n\t\tconst colorize = flags.color !== false;\n\t\tconst spaceLayouts = allSpaces.map((space) => {\n\t\t\tconst isApp = space.spaceId === aggregate.app.spaceId;\n\t\t\tconst spaceGraph = space.graph();\n\t\t\tconst rowModel = buildMigrationGraphRows(spaceGraph, isApp ? { contractHash } : {});\n\t\t\tconst edgeAnnotations = /* @__PURE__ */ new Map();\n\t\t\tfor (const edge of spaceGraph.migrationByHash.values()) edgeAnnotations.set(edge.migrationHash, { pathHighlight: onPathHashes.has(edge.migrationHash) ? \"on-path\" : \"off-path\" });\n\t\t\treturn {\n\t\t\t\tspace,\n\t\t\t\tisApp,\n\t\t\t\tspaceGraph,\n\t\t\t\trowModel,\n\t\t\t\tgrid: buildGrid(rowModel, {}, highlightFromEdgeAnnotations(edgeAnnotations)),\n\t\t\t\tedgeAnnotations\n\t\t\t};\n\t\t});\n\t\tconst globalLabelColumn = spaceLayouts.length > 1 ? Math.max(...spaceLayouts.map(({ grid }) => computeLabelColumn(grid, \"unicode\"))) : void 0;\n\t\tconst globalMaxDirNameWidthFromLayouts = spaceLayouts.length > 1 ? Math.max(...spaceLayouts.map(({ rowModel }) => computeMaxDirNameWidth(rowModel))) : void 0;\n\t\tconst runListMaxFromMigrations = orderedMigrations.length > 0 ? Math.max(...orderedMigrations.map((m) => m.dirName.length)) : 0;\n\t\tconst globalMaxDirNameWidth = globalMaxDirNameWidthFromLayouts !== void 0 ? Math.max(globalMaxDirNameWidthFromLayouts, runListMaxFromMigrations) : void 0;\n\t\trunListDirNameWidth = globalMaxDirNameWidth ?? runListMaxFromMigrations;\n\t\trunListLeftPad = globalLabelColumn;\n\t\tconst showSpaceHeadings = allSpaces.length > 1;\n\t\tconst sections = [];\n\t\tfor (const { space, isApp, rowModel, grid, edgeAnnotations } of spaceLayouts) {\n\t\t\tconst liveMarkerHash = plan.renderMarkerHashBySpace.get(space.spaceId);\n\t\t\tconst tree = renderMigrationGraphCommand({\n\t\t\t\tgrid,\n\t\t\t\trowModel,\n\t\t\t\tcontractHash,\n\t\t\t\tisAppSpace: isApp,\n\t\t\t\t...plan.usedLiveMarker ? { dbHash: liveMarkerHash } : {},\n\t\t\t\trefsByHash: listRefsByContractHash(space),\n\t\t\t\tedgeAnnotationsByHash: edgeAnnotations,\n\t\t\t\tcolorize,\n\t\t\t\tglyphMode: \"unicode\",\n\t\t\t\t...globalLabelColumn !== void 0 ? { globalLabelColumn } : {},\n\t\t\t\t...globalMaxDirNameWidth !== void 0 ? { globalMaxDirNameWidth } : {}\n\t\t\t});\n\t\t\tif (tree.length === 0) continue;\n\t\t\tif (showSpaceHeadings) sections.push(`${space.spaceId}:\\n${indentMigrationGraphTreeBlock(tree, \" \")}`);\n\t\t\telse sections.push(tree);\n\t\t}\n\t\tgraphOutput = sections.join(\"\\n\\n\");\n\t}\n\treturn ok({\n\t\tok: true,\n\t\tmigrations: orderedMigrations,\n\t\tsummary: plan.summary,\n\t\t...graphOutput !== void 0 ? { graphOutput } : {},\n\t\t...runListDirNameWidth !== void 0 ? { runListDirNameWidth } : {},\n\t\t...runListLeftPad !== void 0 ? { runListLeftPad } : {}\n\t});\n}\nfunction formatMigrateShowOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst colorize = flags.color !== false;\n\tconst lines = [];\n\tif (result.graphOutput !== void 0 && result.graphOutput.length > 0) {\n\t\tlines.push(result.graphOutput);\n\t\tlines.push(\"\");\n\t}\n\tconst n = result.migrations.length;\n\tif (n > 0) {\n\t\tlines.push(`The following ${n} migration${n === 1 ? \"\" : \"s\"} will run:`);\n\t\tconst isMultiSpace = result.runListLeftPad !== void 0;\n\t\tconst gutter = result.runListLeftPad ?? 0;\n\t\tconst rawDirNameWidth = result.runListDirNameWidth ?? Math.max(...result.migrations.map((m) => m.dirName.length));\n\t\tconst listDirNameWidth = gutter + Math.max(rawDirNameWidth + 2, 25 - gutter) - (isMultiSpace ? 2 : 4);\n\t\tfor (const m of result.migrations) lines.push(` ${formatOnPathMigrationRow(m.dirName, m.from, m.to, listDirNameWidth, colorize, \"unicode\")}`);\n\t} else lines.push(result.summary);\n\treturn lines.join(\"\\n\");\n}\nfunction mapApplyFailure(failure) {\n\tif (failure.code === \"MIGRATION_PATH_NOT_FOUND\") return errorPathUnreachable(failure);\n\treturn errorRunnerFailed(failure.summary, {\n\t\twhy: failure.why ?? \"Migration runner failed\",\n\t\tfix: \"Fix the issue and re-run `prisma-next migrate --to <contract>` — previously applied migrations are preserved.\",\n\t\tmeta: failure.meta ?? {},\n\t\t...ifDefined(\"cause\", failure.cause)\n\t});\n}\nasync function executeMigrateCommand(options, flags, ui, startTime) {\n\tconst config = await loadConfig(options.config);\n\tconst { configPath, migrationsDir, appMigrationsRelative, refsDir } = resolveMigrationPaths(options.config, config);\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (!dbConnection) return notOk(errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for migrate (set db.connection in ${configPath}, or pass --db <url>)`,\n\t\tcommandName: \"migrate\"\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: \"Config.driver is required for migrate\" }));\n\tif (!targetSupportsMigrations(config.target)) return notOk(errorTargetMigrationNotSupported({ why: `Target \"${config.target.id}\" does not support migrations` }));\n\tconst toArg = options.to;\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tconst contractPathAbsolute = resolveContractPath(config);\n\tlet contractRaw;\n\tlet contractContent;\n\ttry {\n\t\tcontractContent = await readFile(contractPathAbsolute, \"utf-8\");\n\t} catch (error) {\n\t\tif (error instanceof Error && error.code === \"ENOENT\") return notOk(errorFileNotFound(contractPathAbsolute, {\n\t\t\twhy: `Contract file not found at ${contractPathAbsolute}`,\n\t\t\tfix: \"Run `prisma-next contract emit` to generate a valid contract.json, then retry.\"\n\t\t}));\n\t\treturn notOk(errorContractValidationFailed(`Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\ttry {\n\t\tcontractRaw = familyInstance.deserializeContract(JSON.parse(contractContent));\n\t} catch (error) {\n\t\treturn notOk(errorContractValidationFailed(`Contract at ${contractPathAbsolute} failed to deserialize: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst loadedAggregate = await loadContractSpaceAggregateForCli({\n\t\ttargetId: config.target.targetId,\n\t\tmigrationsDir,\n\t\tappContract: contractRaw,\n\t\textensions: config.extensions ?? [],\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loadedAggregate.ok) return notOk(loadedAggregate.failure);\n\tconst aggregate = loadedAggregate.value;\n\tconst integrityFailure = refuseContractSpaceIntegrity(aggregate, {\n\t\tdeclaredExtensions: toDeclaredExtensionsFromRaw(config.extensions ?? []),\n\t\tcheckContracts: true\n\t});\n\tif (integrityFailure) return notOk(integrityFailure);\n\tlet refEntry;\n\tlet refName;\n\tif (toArg) {\n\t\tconst refs = aggregate.app.refs;\n\t\tconst refResult = resolveContractRef(toArg, {\n\t\t\tgraph: aggregate.app.graph(),\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(refResult.failure);\n\t\tif (refResult.value.provenance.kind === \"ref\") {\n\t\t\trefName = refResult.value.provenance.refName;\n\t\t\tconst resolved = refs[refName];\n\t\t\tif (resolved) refEntry = resolved;\n\t\t} else refEntry = {\n\t\t\thash: refResult.value.hash,\n\t\t\tinvariants: []\n\t\t};\n\t}\n\tif (!flags.json && !flags.quiet) {\n\t\tconst details = [{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: configPath\n\t\t}, {\n\t\t\tlabel: \"migrations\",\n\t\t\tvalue: appMigrationsRelative\n\t\t}];\n\t\tif (typeof dbConnection === \"string\") details.push({\n\t\t\tlabel: \"database\",\n\t\t\tvalue: maskConnectionUrl(dbConnection)\n\t\t});\n\t\tif (toArg) details.push({\n\t\t\tlabel: \"to\",\n\t\t\tvalue: toArg\n\t\t});\n\t\tconst header = formatStyledHeader({\n\t\t\tcommand: \"migrate\",\n\t\t\tdescription: \"Apply planned migrations to advance the database\",\n\t\t\turl: \"https://pris.ly/migrate\",\n\t\t\tdetails,\n\t\t\tflags\n\t\t});\n\t\tui.stderr(header);\n\t}\n\tconst appGraph = aggregate.app.graph();\n\tconst client = createControlClient({\n\t\tfamily: config.family,\n\t\ttarget: config.target,\n\t\tadapter: config.adapter,\n\t\tdriver: config.driver,\n\t\textensions: config.extensions ?? []\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\tconst appMarker = (await client.readAllMarkers()).get(\"app\") ?? null;\n\t\tif (appMarker !== null) {\n\t\t\tconst markerRefusal = refuseMarkerOutsideGraph({\n\t\t\t\tmarkerHash: appMarker.storageHash,\n\t\t\t\tgraph: appGraph\n\t\t\t});\n\t\t\tif (markerRefusal) return notOk(markerRefusal);\n\t\t}\n\t\tif (refEntry && refEntry.invariants.length > 0) {\n\t\t\tconst invariantRefusal = refuseUnknownInvariants({\n\t\t\t\tgraph: appGraph,\n\t\t\t\tmarkerInvariants: appMarker?.invariants ?? [],\n\t\t\t\trefInvariants: refEntry.invariants,\n\t\t\t\t...ifDefined(\"refName\", toArg)\n\t\t\t});\n\t\t\tif (invariantRefusal) return notOk(invariantRefusal);\n\t\t}\n\t\tif (!flags.quiet && !flags.json) ui.step(\"Loading contract spaces…\");\n\t\tlet applyContract = contractRaw;\n\t\tlet snapshotContractJson = JSON.parse(contractContent);\n\t\tlet snapshotContractDts;\n\t\tif (toArg && refEntry) {\n\t\t\tconst targetHash = refEntry.hash;\n\t\t\tif (aggregate.app.packages.find((p) => p.metadata.to === targetHash)) try {\n\t\t\t\tconst at = await aggregate.app.contractAt(targetHash, refName !== void 0 ? { refName } : void 0);\n\t\t\t\tapplyContract = at.contract;\n\t\t\t\tsnapshotContractJson = at.contractJson;\n\t\t\t\tsnapshotContractDts = at.contractDts;\n\t\t\t} catch (error) {\n\t\t\t\treturn mapContractAtError(error, { artifactRole: \"to\" });\n\t\t\t}\n\t\t}\n\t\tconst applyResult = await client.migrate({\n\t\t\tcontract: applyContract,\n\t\t\tmigrationsDir,\n\t\t\t...ifDefined(\"refHash\", refEntry?.hash),\n\t\t\t...refEntry?.invariants ? { refInvariants: refEntry.invariants } : {},\n\t\t\t...refEntry !== void 0 ? ifDefined(\"refName\", toArg) : {}\n\t\t});\n\t\tif (!applyResult.ok) return notOk(mapApplyFailure(applyResult.failure));\n\t\tconst { value } = applyResult;\n\t\tlet advancedRef = null;\n\t\tif (options.advanceRef !== void 0) {\n\t\t\tconst contractIR = snapshotContractDts !== void 0 ? {\n\t\t\t\tcontract: snapshotContractJson,\n\t\t\t\tcontractDts: snapshotContractDts\n\t\t\t} : await readContractIR(snapshotContractJson, contractPathAbsolute);\n\t\t\tconst advanced = await advanceRefSafely({\n\t\t\t\trefsDir,\n\t\t\t\tmigrationsDir,\n\t\t\t\tname: options.advanceRef,\n\t\t\t\thash: value.markerHash,\n\t\t\t\tcontractIR\n\t\t\t});\n\t\t\tif (!advanced.ok) return notOk(advanced.failure);\n\t\t\tadvancedRef = {\n\t\t\t\tname: advanced.value.name,\n\t\t\t\thash: advanced.value.hash\n\t\t\t};\n\t\t}\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tmigrationsApplied: value.migrationsApplied,\n\t\t\tmigrationsTotal: value.perSpace.length,\n\t\t\tmarkerHash: value.markerHash,\n\t\t\tapplied: value.applied,\n\t\t\tsummary: value.summary,\n\t\t\tperSpace: value.perSpace,\n\t\t\t...ifDefined(\"pathDecision\", value.pathDecision),\n\t\t\ttimings: { total: Date.now() - startTime },\n\t\t\tadvancedRef\n\t\t});\n\t} catch (error) {\n\t\tconst mapped = mapCaughtMigrationError(error);\n\t\tif (mapped) return notOk(mapped);\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during migrate: ${error instanceof Error ? error.message : String(error)}` }));\n\t} finally {\n\t\tawait client.close();\n\t}\n}\nfunction createMigrateCommand() {\n\tconst command = new Command(\"migrate\");\n\tsetCommandDescriptions(command, \"Apply planned migrations to advance the database\", \"Walks every contract space (app + extensions) and applies pending\\non-disk migrations in canonical order (extensions alphabetically,\\nthen app). Graph-walks the on-disk migration graph for every space.\\nUse --to to target a specific contract (hash, ref name, migration dir).\\nUse --show for a read-only preview of the path that would run.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next migrate --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to production --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --to abc123 --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --db $DATABASE_URL\",\n\t\t\"prisma-next migrate --show --from @contract --to production\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--to <contract>\", \"Target contract reference (hash, prefix, ref name, migration dir name, <dir>^, or ./path)\").option(\"--advance-ref <name>\", \"Advance the named ref to the post-apply marker after success\").option(\"--show\", \"Preview the migration path without applying (read-only)\").option(\"--from <contract>\", \"From-state for --show preview (@contract, @db, hash, ref name, or migration dir)\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst startTime = Date.now();\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (options.show) {\n\t\t\tconst exitCode = handleResult(await executeMigrateShowCommand(options, flags, ui), flags, ui, (showResult) => {\n\t\t\t\tif (flags.json) ui.output(JSON.stringify(showResult, null, 2));\n\t\t\t\telse ui.output(formatMigrateShowOutput(showResult, flags));\n\t\t\t});\n\t\t\tprocess.exit(exitCode);\n\t\t\treturn;\n\t\t}\n\t\tconst exitCode = handleResult(await executeMigrateCommand(options, flags, ui, startTime), flags, ui, (migrateResult) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(migrateResult, null, 2));\n\t\t\telse if (!flags.quiet) ui.log(formatMigrationApplyCommandOutput(migrateResult, flags));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createMigrateCommand };\n\n//# source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AAI,CAAC,MAAM,OAAO,GAAG,IAAI,kCAAkC,eAAe,KAAK,CAAC;EACtF,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { t as CliStructuredError$1 } from "./cli-errors-CDr3WcJP-NFry5GHb.mjs";
|
|
2
|
+
import { c as ContractSpaceAggregate } from "./aggregate-BflrjWPO.mjs";
|
|
3
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
4
|
+
//#region ../../../1-framework/3-tooling/cli/dist/migrate-show-60NNqVia.d.mts
|
|
5
|
+
//#region src/control-api/operations/migrate-show.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* One migration that will run in a `migrate --show` preview, in execution order.
|
|
8
|
+
*/
|
|
9
|
+
interface MigrateShowMigration {
|
|
10
|
+
readonly spaceId: string;
|
|
11
|
+
readonly dirName: string;
|
|
12
|
+
readonly migrationHash: string;
|
|
13
|
+
readonly from: string;
|
|
14
|
+
readonly to: string;
|
|
15
|
+
}
|
|
16
|
+
interface ExecuteMigrateShowPlanOptions {
|
|
17
|
+
readonly config?: string;
|
|
18
|
+
readonly db?: string;
|
|
19
|
+
readonly to?: string;
|
|
20
|
+
readonly from?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Invoked once, after refs/aggregate/--to resolution succeeds and before any DB connection —
|
|
23
|
+
* exactly where the CLI renders its styled header today.
|
|
24
|
+
*/
|
|
25
|
+
readonly onPreflightComplete?: (ctx: {
|
|
26
|
+
readonly configPath: string;
|
|
27
|
+
readonly migrationsRelative: string;
|
|
28
|
+
readonly dbConnection: unknown | undefined;
|
|
29
|
+
readonly hasExplicitFrom: boolean;
|
|
30
|
+
}) => void;
|
|
31
|
+
}
|
|
32
|
+
interface MigrateShowPlanSuccess {
|
|
33
|
+
readonly aggregate: ContractSpaceAggregate;
|
|
34
|
+
readonly contractHash: string;
|
|
35
|
+
readonly migrations: readonly MigrateShowMigration[];
|
|
36
|
+
readonly summary: string;
|
|
37
|
+
/** Per-space render hash: live/override marker storageHash, pre-defaulted to the empty sentinel. */
|
|
38
|
+
readonly renderMarkerHashBySpace: ReadonlyMap<string, string>;
|
|
39
|
+
/** True when the live DB marker was read — gates the ★ db marker in the tree. */
|
|
40
|
+
readonly usedLiveMarker: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Computes the path through the SAME seam as `executeMigrate`:
|
|
44
|
+
* - `readAllMarkers()` for the from-state (when no `--from` is given), preserving
|
|
45
|
+
* the full marker including `invariants` (not just `storageHash`).
|
|
46
|
+
* - `planSpacePath()` (shared with `executeMigrate`) for per-space path selection,
|
|
47
|
+
* which feeds `resolveRecordedPath()` with the same target hash, target invariants,
|
|
48
|
+
* and current marker as the real apply path uses.
|
|
49
|
+
*
|
|
50
|
+
* Returns BEFORE any write boundary (`runMigration` / marker / DDL). No
|
|
51
|
+
* DB state is mutated.
|
|
52
|
+
*/
|
|
53
|
+
declare function executeMigrateShowPlan(options: ExecuteMigrateShowPlanOptions): Promise<Result<MigrateShowPlanSuccess, CliStructuredError$1>>;
|
|
54
|
+
//#endregion
|
|
55
|
+
export { executeMigrateShowPlan as i, MigrateShowMigration as n, MigrateShowPlanSuccess as r, ExecuteMigrateShowPlanOptions as t };
|
|
56
|
+
//# sourceMappingURL=migrate-show-60NNqVia-oGqMaVA9.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate-show-60NNqVia-oGqMaVA9.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/migrate-show-60NNqVia.d.mts"],"mappings":";;;;;;;;UAOU;WACC;WACA;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;WACA;;;;;WAKA,uBAAuB;aACrB;aACA;aACA;aACA;;;UAGH;WACC,WAAW;WACX;WACA,qBAAqB;WACrB;;WAEA,yBAAyB;;WAEzB;;;;;;;;;;;;;iBAaM,uBAAuB,SAAS,gCAAgC,QAAQ,OAAO,wBAAwB"}
|