@prisma/orm-toolchain 0.16.0-dev.36
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/LICENSE +201 -0
- package/README.md +28 -0
- package/dist/aggregate-B4mhR4Sk.mjs +1012 -0
- package/dist/aggregate-B4mhR4Sk.mjs.map +1 -0
- package/dist/aggregate-BflrjWPO.d.mts +803 -0
- package/dist/aggregate-BflrjWPO.d.mts.map +1 -0
- package/dist/bin__prisma-next.mjs +800 -0
- package/dist/bin__prisma-next.mjs.map +1 -0
- package/dist/cli-telemetry.d.mts +367 -0
- package/dist/cli-telemetry.d.mts.map +1 -0
- package/dist/cli-telemetry.mjs +48 -0
- package/dist/cli-telemetry.mjs.map +1 -0
- package/dist/cli-telemetry__sender.d.mts +1 -0
- package/dist/cli-telemetry__sender.mjs +1 -0
- package/dist/cli.d.mts +31 -0
- package/dist/cli.d.mts.map +1 -0
- package/dist/cli.mjs +180 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/cli__commands__contract-emit.d.mts +2 -0
- package/dist/cli__commands__contract-emit.mjs +2 -0
- package/dist/cli__commands__contract-infer.d.mts +7 -0
- package/dist/cli__commands__contract-infer.d.mts.map +1 -0
- package/dist/cli__commands__contract-infer.mjs +2 -0
- package/dist/cli__commands__db-init.d.mts +7 -0
- package/dist/cli__commands__db-init.d.mts.map +1 -0
- package/dist/cli__commands__db-init.mjs +2 -0
- package/dist/cli__commands__db-schema.d.mts +7 -0
- package/dist/cli__commands__db-schema.d.mts.map +1 -0
- package/dist/cli__commands__db-schema.mjs +2 -0
- package/dist/cli__commands__db-sign.d.mts +7 -0
- package/dist/cli__commands__db-sign.d.mts.map +1 -0
- package/dist/cli__commands__db-sign.mjs +2 -0
- package/dist/cli__commands__db-update.d.mts +7 -0
- package/dist/cli__commands__db-update.d.mts.map +1 -0
- package/dist/cli__commands__db-update.mjs +2 -0
- package/dist/cli__commands__db-verify.d.mts +7 -0
- package/dist/cli__commands__db-verify.d.mts.map +1 -0
- package/dist/cli__commands__db-verify.mjs +2 -0
- package/dist/cli__commands__migrate.d.mts +66 -0
- package/dist/cli__commands__migrate.d.mts.map +1 -0
- package/dist/cli__commands__migrate.mjs +2 -0
- package/dist/cli__commands__migration-check.d.mts +64 -0
- package/dist/cli__commands__migration-check.d.mts.map +1 -0
- package/dist/cli__commands__migration-check.mjs +3 -0
- package/dist/cli__commands__migration-graph.d.mts +36 -0
- package/dist/cli__commands__migration-graph.d.mts.map +1 -0
- package/dist/cli__commands__migration-graph.mjs +2 -0
- package/dist/cli__commands__migration-list.d.mts +79 -0
- package/dist/cli__commands__migration-list.d.mts.map +1 -0
- package/dist/cli__commands__migration-list.mjs +2 -0
- package/dist/cli__commands__migration-log.d.mts +20 -0
- package/dist/cli__commands__migration-log.d.mts.map +1 -0
- package/dist/cli__commands__migration-log.mjs +2 -0
- package/dist/cli__commands__migration-new.d.mts +7 -0
- package/dist/cli__commands__migration-new.d.mts.map +1 -0
- package/dist/cli__commands__migration-new.mjs +2 -0
- package/dist/cli__commands__migration-plan.d.mts +79 -0
- package/dist/cli__commands__migration-plan.d.mts.map +1 -0
- package/dist/cli__commands__migration-plan.mjs +2 -0
- package/dist/cli__commands__migration-show.d.mts +27 -0
- package/dist/cli__commands__migration-show.d.mts.map +1 -0
- package/dist/cli__commands__migration-show.mjs +2 -0
- package/dist/cli__commands__migration-status.d.mts +55 -0
- package/dist/cli__commands__migration-status.d.mts.map +1 -0
- package/dist/cli__commands__migration-status.mjs +3 -0
- package/dist/cli__commands__ref.d.mts +34 -0
- package/dist/cli__commands__ref.d.mts.map +1 -0
- package/dist/cli__commands__ref.mjs +2 -0
- package/dist/cli__commands__telemetry.d.mts +7 -0
- package/dist/cli__commands__telemetry.d.mts.map +1 -0
- package/dist/cli__commands__telemetry.mjs +2 -0
- package/dist/cli__config-types.d.mts +2 -0
- package/dist/cli__config-types.mjs +2 -0
- package/dist/cli__control-api.d.mts +141 -0
- package/dist/cli__control-api.d.mts.map +1 -0
- package/dist/cli__control-api.mjs +4 -0
- package/dist/cli__init-output.d.mts +37 -0
- package/dist/cli__init-output.d.mts.map +1 -0
- package/dist/cli__init-output.mjs +2 -0
- package/dist/cli__migration-cli.d.mts +79 -0
- package/dist/cli__migration-cli.d.mts.map +1 -0
- package/dist/cli__migration-cli.mjs +407 -0
- package/dist/cli__migration-cli.mjs.map +1 -0
- package/dist/client-75qrAPqf-DZAVUxFa.mjs +1606 -0
- package/dist/client-75qrAPqf-DZAVUxFa.mjs.map +1 -0
- package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs +1671 -0
- package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +1 -0
- package/dist/config-loader.d.mts +18 -0
- package/dist/config-loader.d.mts.map +1 -0
- package/dist/config-loader.mjs +2 -0
- package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs +10 -0
- package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs.map +1 -0
- package/dist/constants-Dkcn8Qu4.d.mts +10 -0
- package/dist/constants-Dkcn8Qu4.d.mts.map +1 -0
- package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +36 -0
- package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +1 -0
- package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs +148 -0
- package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs.map +1 -0
- package/dist/contract-emit-B65_UiFn.d.mts +7 -0
- package/dist/contract-emit-B65_UiFn.d.mts.map +1 -0
- package/dist/contract-emit-B6odMoem-CK3diBPk.mjs +359 -0
- package/dist/contract-emit-B6odMoem-CK3diBPk.mjs.map +1 -0
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +56 -0
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +1 -0
- package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs +73 -0
- package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs.map +1 -0
- package/dist/contract-snapshot-store-CbqynbtE.d.mts +28 -0
- package/dist/contract-snapshot-store-CbqynbtE.d.mts.map +1 -0
- package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs +118 -0
- package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map +1 -0
- package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs +302 -0
- package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +1 -0
- package/dist/db-init-Vbkb_TKZ.mjs +153 -0
- package/dist/db-init-Vbkb_TKZ.mjs.map +1 -0
- package/dist/db-schema-ClQCu3xY.mjs +47 -0
- package/dist/db-schema-ClQCu3xY.mjs.map +1 -0
- package/dist/db-sign-jjXDgQ1u.mjs +175 -0
- package/dist/db-sign-jjXDgQ1u.mjs.map +1 -0
- package/dist/db-update-BQlrqtDD.mjs +183 -0
- package/dist/db-update-BQlrqtDD.mjs.map +1 -0
- package/dist/db-verify-CKPsRFrj-3udprZQD.mjs +396 -0
- package/dist/db-verify-CKPsRFrj-3udprZQD.mjs.map +1 -0
- package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs +334 -0
- package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs.map +1 -0
- package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts +63 -0
- package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +1 -0
- package/dist/emitter.d.mts +75 -0
- package/dist/emitter.d.mts.map +1 -0
- package/dist/emitter.mjs +3 -0
- package/dist/emitter__domain-type-generation.d.mts +2 -0
- package/dist/emitter__domain-type-generation.mjs +2 -0
- package/dist/emitter__type-expression-safety.d.mts +6 -0
- package/dist/emitter__type-expression-safety.d.mts.map +1 -0
- package/dist/emitter__type-expression-safety.mjs +2 -0
- package/dist/errors--qsXZUtL.d.mts +72 -0
- package/dist/errors--qsXZUtL.d.mts.map +1 -0
- package/dist/errors-IpZm1Skp-BH495dRd.mjs +378 -0
- package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +1 -0
- package/dist/exports-BN0vFTxG.mjs +276 -0
- package/dist/exports-BN0vFTxG.mjs.map +1 -0
- package/dist/exports-B_xhKZmC.mjs +1436 -0
- package/dist/exports-B_xhKZmC.mjs.map +1 -0
- package/dist/exports-D3-NwrMA-CadaBGQ3.mjs +154 -0
- package/dist/exports-D3-NwrMA-CadaBGQ3.mjs.map +1 -0
- package/dist/exports-Dl2aGAk7.mjs +119 -0
- package/dist/exports-Dl2aGAk7.mjs.map +1 -0
- package/dist/format-ByDm2goZ-DKLyhNHo.mjs +101 -0
- package/dist/format-ByDm2goZ-DKLyhNHo.mjs.map +1 -0
- package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs +58 -0
- package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs.map +1 -0
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +35 -0
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +1 -0
- package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts +28 -0
- package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts.map +1 -0
- package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs +14 -0
- package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map +1 -0
- package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs +64 -0
- package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs.map +1 -0
- package/dist/hash-XZYYKJ-i.d.mts +53 -0
- package/dist/hash-XZYYKJ-i.d.mts.map +1 -0
- package/dist/import-roots-B6CtsWXb.d.mts +119 -0
- package/dist/import-roots-B6CtsWXb.d.mts.map +1 -0
- package/dist/import-roots-NDOIEDVj.mjs +217 -0
- package/dist/import-roots-NDOIEDVj.mjs.map +1 -0
- package/dist/init-DHctXAI9-DSlaaYXN.mjs +2186 -0
- package/dist/init-DHctXAI9-DSlaaYXN.mjs.map +1 -0
- package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs +91 -0
- package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs.map +1 -0
- package/dist/invariants-B5wLrgQS.d.mts +39 -0
- package/dist/invariants-B5wLrgQS.d.mts.map +1 -0
- package/dist/invariants-lXzy6txi-DAoP4nTE.mjs +57 -0
- package/dist/invariants-lXzy6txi-DAoP4nTE.mjs.map +1 -0
- package/dist/io-C8TdyBKt-DloEBi70.mjs +313 -0
- package/dist/io-C8TdyBKt-DloEBi70.mjs.map +1 -0
- package/dist/io-DYfeLJxR.d.mts +1 -0
- package/dist/io-sr4CO9_t-C3eV_kn-.d.mts +125 -0
- package/dist/io-sr4CO9_t-C3eV_kn-.d.mts.map +1 -0
- package/dist/ledger-origin-BGRN77Oy.d.mts +6 -0
- package/dist/ledger-origin-BGRN77Oy.d.mts.map +1 -0
- package/dist/ledger-origin-D7PN4Fon.mjs +9 -0
- package/dist/ledger-origin-D7PN4Fon.mjs.map +1 -0
- package/dist/metadata-2nbOAGsV-uYNeq2Cp.d.mts +2 -0
- package/dist/metadata-BtscDay2.d.mts +1 -0
- package/dist/migrate-Cb_iv264.mjs +500 -0
- package/dist/migrate-Cb_iv264.mjs.map +1 -0
- package/dist/migration-B2ljMJim.d.mts +155 -0
- package/dist/migration-B2ljMJim.d.mts.map +1 -0
- package/dist/migration-BuUmO7It.mjs +209 -0
- package/dist/migration-BuUmO7It.mjs.map +1 -0
- package/dist/migration-check-CcG-fB8r-CDs5C9vt.mjs +597 -0
- package/dist/migration-check-CcG-fB8r-CDs5C9vt.mjs.map +1 -0
- package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs +103 -0
- package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs.map +1 -0
- package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs +500 -0
- package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs.map +1 -0
- package/dist/migration-graph-DkoCC0Qy.mjs +185 -0
- package/dist/migration-graph-DkoCC0Qy.mjs.map +1 -0
- package/dist/migration-graph-Dqndu0i5.d.mts +9 -0
- package/dist/migration-graph-Dqndu0i5.d.mts.map +1 -0
- package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs +1945 -0
- package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs.map +1 -0
- package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts +124 -0
- package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts.map +1 -0
- package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs +228 -0
- package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs.map +1 -0
- package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs +220 -0
- package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs.map +1 -0
- package/dist/migration-new-BurCjyaQ.mjs +168 -0
- package/dist/migration-new-BurCjyaQ.mjs.map +1 -0
- package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs +38 -0
- package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +1 -0
- package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs +759 -0
- package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs.map +1 -0
- package/dist/migration-show-Bx5I5aW9.mjs +171 -0
- package/dist/migration-show-Bx5I5aW9.mjs.map +1 -0
- package/dist/migration-status-CFlzlRmu-DewBN8Ys.mjs +444 -0
- package/dist/migration-status-CFlzlRmu-DewBN8Ys.mjs.map +1 -0
- package/dist/migration-tools.d.mts +23 -0
- package/dist/migration-tools.mjs +17 -0
- package/dist/migration-tools__aggregate.d.mts +2 -0
- package/dist/migration-tools__aggregate.mjs +2 -0
- package/dist/migration-tools__constants.d.mts +2 -0
- package/dist/migration-tools__constants.mjs +2 -0
- package/dist/migration-tools__contract-snapshot-store.d.mts +2 -0
- package/dist/migration-tools__contract-snapshot-store.mjs +2 -0
- package/dist/migration-tools__errors.d.mts +2 -0
- package/dist/migration-tools__errors.mjs +2 -0
- package/dist/migration-tools__graph.d.mts +2 -0
- package/dist/migration-tools__graph.mjs +1 -0
- package/dist/migration-tools__hash.d.mts +2 -0
- package/dist/migration-tools__hash.mjs +2 -0
- package/dist/migration-tools__invariants.d.mts +2 -0
- package/dist/migration-tools__invariants.mjs +2 -0
- package/dist/migration-tools__io.d.mts +3 -0
- package/dist/migration-tools__io.mjs +2 -0
- package/dist/migration-tools__ledger-origin.d.mts +2 -0
- package/dist/migration-tools__ledger-origin.mjs +2 -0
- package/dist/migration-tools__metadata.d.mts +3 -0
- package/dist/migration-tools__metadata.mjs +1 -0
- package/dist/migration-tools__migration-graph.d.mts +3 -0
- package/dist/migration-tools__migration-graph.mjs +3 -0
- package/dist/migration-tools__migration-ts.d.mts +2 -0
- package/dist/migration-tools__migration-ts.mjs +2 -0
- package/dist/migration-tools__migration.d.mts +2 -0
- package/dist/migration-tools__migration.mjs +2 -0
- package/dist/migration-tools__package.d.mts +3 -0
- package/dist/migration-tools__package.mjs +1 -0
- package/dist/migration-tools__ref-resolution.d.mts +2 -0
- package/dist/migration-tools__ref-resolution.mjs +2 -0
- package/dist/migration-tools__refs.d.mts +2 -0
- package/dist/migration-tools__refs.mjs +2 -0
- package/dist/migration-tools__spaces.d.mts +3 -0
- package/dist/migration-tools__spaces.mjs +3 -0
- package/dist/migration-ts-CNaAtK8C.d.mts +38 -0
- package/dist/migration-ts-CNaAtK8C.d.mts.map +1 -0
- package/dist/migration-ts-FyF55c4M.mjs +67 -0
- package/dist/migration-ts-FyF55c4M.mjs.map +1 -0
- package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs +13 -0
- package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs.map +1 -0
- package/dist/output-DWNYqZGc-D2sRgLAm.mjs +109 -0
- package/dist/output-DWNYqZGc-D2sRgLAm.mjs.map +1 -0
- package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts +21 -0
- package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts.map +1 -0
- package/dist/package-N9PPdFV_.d.mts +3 -0
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +43 -0
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +1 -0
- package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs +99 -0
- package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +1 -0
- package/dist/publish-surface.d.mts +3 -0
- package/dist/publish-surface.mjs +3 -0
- package/dist/publish-surface__import-roots.d.mts +2 -0
- package/dist/publish-surface__import-roots.mjs +2 -0
- package/dist/publish-surface__shells.d.mts +2 -0
- package/dist/publish-surface__shells.mjs +2 -0
- package/dist/quick-reference-mongo.md +114 -0
- package/dist/quick-reference-postgres.md +93 -0
- package/dist/readme-mongo.md +35 -0
- package/dist/readme-postgres.md +34 -0
- package/dist/ref-B6cTthTi.mjs +171 -0
- package/dist/ref-B6cTthTi.mjs.map +1 -0
- package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs +57 -0
- package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs.map +1 -0
- package/dist/ref-resolution-BjJBWPjX.mjs +250 -0
- package/dist/ref-resolution-BjJBWPjX.mjs.map +1 -0
- package/dist/ref-resolution-COGOSL57.d.mts +127 -0
- package/dist/ref-resolution-COGOSL57.d.mts.map +1 -0
- package/dist/refs-BDbB9BRB-D6Za3Q49.mjs +241 -0
- package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +1 -0
- package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts +43 -0
- package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts.map +1 -0
- package/dist/schemas-CeGMYFYX-h3OcU__O.d.mts +192 -0
- package/dist/schemas-CeGMYFYX-h3OcU__O.d.mts.map +1 -0
- package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs +112 -0
- package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs.map +1 -0
- package/dist/shells-BenrJHp2.mjs +602 -0
- package/dist/shells-BenrJHp2.mjs.map +1 -0
- package/dist/shells-COHV_Ozf.d.mts +135 -0
- package/dist/shells-COHV_Ozf.d.mts.map +1 -0
- package/dist/spaces-C27bA-xc.mjs +267 -0
- package/dist/spaces-C27bA-xc.mjs.map +1 -0
- package/dist/spaces-DxFj5y8l.d.mts +415 -0
- package/dist/spaces-DxFj5y8l.d.mts.map +1 -0
- package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs +120 -0
- package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs.map +1 -0
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +133 -0
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +1 -0
- package/dist/type-expression-safety-CgHTWypx.mjs +8 -0
- package/dist/type-expression-safety-CgHTWypx.mjs.map +1 -0
- package/dist/types-DZWEs4si-D8UlyJI0.d.mts +893 -0
- package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +1 -0
- package/dist/verify-DnVNjc5C-BGdsblBK.mjs +283 -0
- package/dist/verify-DnVNjc5C-BGdsblBK.mjs.map +1 -0
- package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs +252 -0
- package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map +1 -0
- package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts +136 -0
- package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map +1 -0
- package/dist/vite-plugin-contract-emit.d.mts +54 -0
- package/dist/vite-plugin-contract-emit.d.mts.map +1 -0
- package/dist/vite-plugin-contract-emit.mjs +303 -0
- package/dist/vite-plugin-contract-emit.mjs.map +1 -0
- package/package.json +127 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { $ as maskConnectionUrl, M as errorTargetMismatch, N as errorUnexpected, O as errorRuntime$1, W as formatStyledHeader, at as resolveMigrationPaths, b as errorMarkerMissing, ct as setCommandExamples, d as errorContractValidationFailed, f as errorDatabaseConnectionRequired, g as errorHashMismatch, h as errorFileNotFound, it as resolveContractPath, m as errorDriverRequired, o as createTerminalUI, q as handleResult, r as addGlobalOptions, st as setCommandDescriptions, t as CliStructuredError$1, tt as parseGlobalFlagsOrExit } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
|
|
2
|
+
import { r as loadConfig } from "./exports-Dl2aGAk7.mjs";
|
|
3
|
+
import { t as createProgressAdapter } from "./progress-adapter-CjAeTxY_-BXYSd1eY.mjs";
|
|
4
|
+
import { t as createControlClient } from "./client-75qrAPqf-DZAVUxFa.mjs";
|
|
5
|
+
import { c as formatVerifyOutput, i as formatSchemaVerifyOutput, r as formatSchemaVerifyJson, s as formatVerifyJson } from "./verify-DnVNjc5C-BGdsblBK.mjs";
|
|
6
|
+
import { ifDefined } from "@prisma/orm-framework/utils/defined";
|
|
7
|
+
import { notOk, ok } from "@prisma/orm-framework/utils/result";
|
|
8
|
+
import { relative, resolve } from "pathe";
|
|
9
|
+
import { readFile } from "node:fs/promises";
|
|
10
|
+
import { VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack } from "@prisma/orm-framework/components/control";
|
|
11
|
+
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
12
|
+
import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
|
|
13
|
+
import { Command } from "commander";
|
|
14
|
+
//#region ../../../1-framework/3-tooling/cli/dist/db-verify-CKPsRFrj.mjs
|
|
15
|
+
/**
|
|
16
|
+
* Collapse the aggregate verifier's per-space contract-satisfaction results
|
|
17
|
+
* into a single {@link VerifyDatabaseSchemaResult} for the CLI display
|
|
18
|
+
* surface, and carry the deduplicated unclaimed-elements list alongside it.
|
|
19
|
+
* Concatenates the issue lists across spaces; uses the app space's result as
|
|
20
|
+
* the structural envelope (storage hash, target). Extras are already
|
|
21
|
+
* stripped from each per-space result, so nothing here duplicates an
|
|
22
|
+
* unclaimed element per space.
|
|
23
|
+
*
|
|
24
|
+
* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails
|
|
25
|
+
* the combined verdict (`ok: false`); in lenient mode it is carried for
|
|
26
|
+
* informational rendering only. The list itself is returned unchanged for the
|
|
27
|
+
* renderer.
|
|
28
|
+
*
|
|
29
|
+
* **Summary policy.** Preserve the per-family phrasing whenever the
|
|
30
|
+
* combined `ok` flag agrees with the app space's `ok` flag — this is
|
|
31
|
+
* the common case (single-family deployments, single-app deployments)
|
|
32
|
+
* and the family's "satisfies / does not satisfy contract" phrasing
|
|
33
|
+
* stays user-visible. When the app passes but an extension fails (or
|
|
34
|
+
* vice versa) the app's summary contradicts the envelope, so fall back
|
|
35
|
+
* to the first failing space's summary. This keeps family phrasing
|
|
36
|
+
* intact and the envelope internally consistent (`ok: false` ↔ failure
|
|
37
|
+
* summary).
|
|
38
|
+
*/
|
|
39
|
+
function combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {
|
|
40
|
+
const appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;
|
|
41
|
+
if (appResult === void 0) throw new InternalError("Aggregate verifier returned no per-space verify results — this is a wiring bug.");
|
|
42
|
+
let okAll = true;
|
|
43
|
+
let firstFailure;
|
|
44
|
+
let issues = [];
|
|
45
|
+
let warningIssues = [];
|
|
46
|
+
for (const [, result] of perSpace) {
|
|
47
|
+
if (!result.ok) {
|
|
48
|
+
okAll = false;
|
|
49
|
+
if (firstFailure === void 0) firstFailure = result;
|
|
50
|
+
}
|
|
51
|
+
issues = [...issues, ...result.schema.issues];
|
|
52
|
+
warningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];
|
|
53
|
+
}
|
|
54
|
+
const unclaimedFails = strict && unclaimed.length > 0;
|
|
55
|
+
const ok = okAll && !unclaimedFails;
|
|
56
|
+
const summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? "" : "s"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;
|
|
57
|
+
return {
|
|
58
|
+
result: {
|
|
59
|
+
ok,
|
|
60
|
+
...ok ? {} : { code: appResult.code ?? "CONTRACT.MARKER_REQUIRED" },
|
|
61
|
+
summary,
|
|
62
|
+
contract: appResult.contract,
|
|
63
|
+
target: appResult.target,
|
|
64
|
+
schema: {
|
|
65
|
+
issues,
|
|
66
|
+
warnings: { issues: warningIssues }
|
|
67
|
+
},
|
|
68
|
+
meta: { strict },
|
|
69
|
+
timings: { total: 0 }
|
|
70
|
+
},
|
|
71
|
+
unclaimed
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Maps a VerifyDatabaseResult failure to a CliStructuredError.
|
|
76
|
+
*/
|
|
77
|
+
function mapVerifyFailure(verifyResult) {
|
|
78
|
+
if (!verifyResult.ok && verifyResult.code) {
|
|
79
|
+
if (verifyResult.code === VERIFY_CODE_MARKER_MISSING) return errorMarkerMissing();
|
|
80
|
+
if (verifyResult.code === VERIFY_CODE_HASH_MISMATCH) {
|
|
81
|
+
const storageMatch = verifyResult.marker?.storageHash === verifyResult.contract.storageHash;
|
|
82
|
+
const profileMatch = !verifyResult.contract.profileHash || verifyResult.marker?.profileHash === verifyResult.contract.profileHash;
|
|
83
|
+
if (!storageMatch) return errorHashMismatch({
|
|
84
|
+
why: "Contract storageHash does not match database marker",
|
|
85
|
+
expected: verifyResult.contract.storageHash,
|
|
86
|
+
...ifDefined("actual", verifyResult.marker?.storageHash)
|
|
87
|
+
});
|
|
88
|
+
return errorHashMismatch({
|
|
89
|
+
why: profileMatch ? "Contract hash does not match database marker" : "Contract profileHash does not match database marker",
|
|
90
|
+
...ifDefined("expected", verifyResult.contract.profileHash),
|
|
91
|
+
...ifDefined("actual", verifyResult.marker?.profileHash)
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (verifyResult.code === VERIFY_CODE_TARGET_MISMATCH) return errorTargetMismatch(verifyResult.target.expected, verifyResult.target.actual ?? "unknown");
|
|
95
|
+
}
|
|
96
|
+
return errorRuntime$1(verifyResult.summary);
|
|
97
|
+
}
|
|
98
|
+
function errorInvalidVerifyMode(options) {
|
|
99
|
+
return new CliStructuredError$1("CLI.INVALID_VERIFY_MODE", "Invalid verify mode", {
|
|
100
|
+
why: options.why,
|
|
101
|
+
fix: options.fix,
|
|
102
|
+
docsUrl: "https://pris.ly/db-verify"
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function resolveDbVerifyMode(options) {
|
|
106
|
+
if (options.markerOnly && options.schemaOnly) return notOk(errorInvalidVerifyMode({
|
|
107
|
+
why: "`--marker-only` and `--schema-only` cannot be used together",
|
|
108
|
+
fix: "Choose one mode: omit both to check the marker and schema, use `--marker-only` to check only the marker, or use `--schema-only` to check only the live schema."
|
|
109
|
+
}));
|
|
110
|
+
if (options.markerOnly && options.strict) return notOk(errorInvalidVerifyMode({
|
|
111
|
+
why: "`--strict` requires schema verification, but `--marker-only` skips it",
|
|
112
|
+
fix: "Remove `--strict`, or use `db verify` / `db verify --schema-only` when you want to check the live schema in strict mode."
|
|
113
|
+
}));
|
|
114
|
+
if (options.schemaOnly) return ok("schema-only");
|
|
115
|
+
if (options.markerOnly) return ok("marker-only");
|
|
116
|
+
return ok("full");
|
|
117
|
+
}
|
|
118
|
+
function formatDbVerifyModeLabel(mode, strict) {
|
|
119
|
+
if (mode === "marker-only") return "marker only";
|
|
120
|
+
if (mode === "schema-only") return `schema only (${strict ? "strict" : "tolerant"})`;
|
|
121
|
+
return `full (marker + schema, ${strict ? "strict" : "tolerant"})`;
|
|
122
|
+
}
|
|
123
|
+
function formatDbVerifyInvocation(mode, strict) {
|
|
124
|
+
const args = ["db verify"];
|
|
125
|
+
if (mode === "marker-only") args.push("--marker-only");
|
|
126
|
+
if (mode === "schema-only") args.push("--schema-only");
|
|
127
|
+
if (strict) args.push("--strict");
|
|
128
|
+
return args.join(" ");
|
|
129
|
+
}
|
|
130
|
+
function createDbVerifyConnectionRequiredError(options) {
|
|
131
|
+
const invocation = formatDbVerifyInvocation(options.mode, options.strict);
|
|
132
|
+
return errorDatabaseConnectionRequired({
|
|
133
|
+
why: `Database connection is required for ${invocation} (set db.connection in ${options.configPath}, or pass --db <url>)`,
|
|
134
|
+
retryCommand: `prisma-next ${invocation} --db <url>`
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
function renderVerifyHeader(paths, options, mode, flags, ui) {
|
|
138
|
+
if (flags.json || flags.quiet) return;
|
|
139
|
+
const description = mode === "schema-only" ? "Check whether the live database schema matches your contract" : mode === "marker-only" ? "Check whether the database marker matches your contract" : "Check whether the database marker and live schema match your contract";
|
|
140
|
+
const details = [
|
|
141
|
+
{
|
|
142
|
+
label: "config",
|
|
143
|
+
value: paths.configPath
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
label: "contract",
|
|
147
|
+
value: paths.contractPath
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: "mode",
|
|
151
|
+
value: formatDbVerifyModeLabel(mode, options.strict ?? false)
|
|
152
|
+
}
|
|
153
|
+
];
|
|
154
|
+
if (options.db) details.push({
|
|
155
|
+
label: "database",
|
|
156
|
+
value: maskConnectionUrl(options.db)
|
|
157
|
+
});
|
|
158
|
+
ui.stderr(formatStyledHeader({
|
|
159
|
+
command: "db verify",
|
|
160
|
+
description,
|
|
161
|
+
url: "https://pris.ly/db-verify",
|
|
162
|
+
details,
|
|
163
|
+
flags
|
|
164
|
+
}));
|
|
165
|
+
}
|
|
166
|
+
async function resolveVerifyPaths(options) {
|
|
167
|
+
const config = await loadConfig(options.config);
|
|
168
|
+
const configPath = options.config ? relative(process.cwd(), resolve(options.config)) : "prisma-next.config.ts";
|
|
169
|
+
const contractPathAbsolute = resolveContractPath(config);
|
|
170
|
+
return {
|
|
171
|
+
config,
|
|
172
|
+
configPath,
|
|
173
|
+
contractPathAbsolute,
|
|
174
|
+
contractPath: relative(process.cwd(), contractPathAbsolute)
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
async function resolveVerifySetup(paths, options, mode) {
|
|
178
|
+
const { config, configPath, contractPathAbsolute, contractPath } = paths;
|
|
179
|
+
let contractJsonContent;
|
|
180
|
+
try {
|
|
181
|
+
contractJsonContent = await readFile(contractPathAbsolute, "utf-8");
|
|
182
|
+
} catch (error) {
|
|
183
|
+
if (error instanceof Error && error.code === "ENOENT") return notOk(errorFileNotFound(contractPathAbsolute, {
|
|
184
|
+
why: `Contract file not found at ${contractPathAbsolute}`,
|
|
185
|
+
fix: `Run \`prisma-next contract emit\` to generate ${contractPath}, or update \`config.contract.output\` in ${configPath}`
|
|
186
|
+
}));
|
|
187
|
+
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` }));
|
|
188
|
+
}
|
|
189
|
+
const stack = createControlStack(config);
|
|
190
|
+
const familyInstance = config.family.create(stack);
|
|
191
|
+
let contractJson;
|
|
192
|
+
try {
|
|
193
|
+
contractJson = familyInstance.deserializeContract(JSON.parse(contractJsonContent));
|
|
194
|
+
} catch (error) {
|
|
195
|
+
if (isStructuredError(error) && error.code === "CONTRACT.VALIDATION_FAILED") return notOk(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPathAbsolute } }));
|
|
196
|
+
return notOk(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));
|
|
197
|
+
}
|
|
198
|
+
const dbConnection = options.db ?? config.db?.connection;
|
|
199
|
+
if (typeof dbConnection !== "string" || dbConnection.length === 0) return notOk(createDbVerifyConnectionRequiredError({
|
|
200
|
+
configPath,
|
|
201
|
+
mode,
|
|
202
|
+
strict: options.strict ?? false
|
|
203
|
+
}));
|
|
204
|
+
if (!config.driver) return notOk(errorDriverRequired({ why: `Config.driver is required for ${formatDbVerifyInvocation(mode, options.strict ?? false)}` }));
|
|
205
|
+
return ok({
|
|
206
|
+
...paths,
|
|
207
|
+
contractJson,
|
|
208
|
+
dbConnection
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function createVerifyClient(setup) {
|
|
212
|
+
return createControlClient({
|
|
213
|
+
family: setup.config.family,
|
|
214
|
+
target: setup.config.target,
|
|
215
|
+
adapter: setup.config.adapter,
|
|
216
|
+
driver: setup.config.driver,
|
|
217
|
+
extensions: setup.config.extensions ?? []
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
function wrapVerifyError(error, contractPathAbsolute, modeLabel) {
|
|
221
|
+
if (CliStructuredError$1.is(error)) return notOk(error);
|
|
222
|
+
if (isStructuredError(error) && error.code === "CONTRACT.VALIDATION_FAILED") return notOk(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPathAbsolute } }));
|
|
223
|
+
return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during ${modeLabel}: ${error instanceof Error ? error.message : String(error)}` }));
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Executes the db verify command and returns a structured Result.
|
|
227
|
+
*/
|
|
228
|
+
async function executeDbVerifyCommand(options, flags, ui, mode) {
|
|
229
|
+
const startTime = Date.now();
|
|
230
|
+
const paths = await resolveVerifyPaths(options);
|
|
231
|
+
renderVerifyHeader(paths, options, mode, flags, ui);
|
|
232
|
+
const setupResult = await resolveVerifySetup(paths, options, mode);
|
|
233
|
+
if (!setupResult.ok) return setupResult;
|
|
234
|
+
const { contractJson, dbConnection, contractPathAbsolute } = setupResult.value;
|
|
235
|
+
const { migrationsDir } = resolveMigrationPaths(options.config, setupResult.value.config);
|
|
236
|
+
const client = createVerifyClient(setupResult.value);
|
|
237
|
+
const onProgress = createProgressAdapter({
|
|
238
|
+
ui,
|
|
239
|
+
flags
|
|
240
|
+
});
|
|
241
|
+
try {
|
|
242
|
+
const verifyResult = await client.verify({
|
|
243
|
+
contract: contractJson,
|
|
244
|
+
connection: dbConnection,
|
|
245
|
+
onProgress
|
|
246
|
+
});
|
|
247
|
+
if (!verifyResult.ok) return notOk(mapVerifyFailure(verifyResult));
|
|
248
|
+
const aggregateResult = await client.dbVerify({
|
|
249
|
+
contract: contractJson,
|
|
250
|
+
migrationsDir,
|
|
251
|
+
strict: options.strict ?? false,
|
|
252
|
+
skipSchema: mode === "marker-only",
|
|
253
|
+
skipMarker: false,
|
|
254
|
+
onProgress
|
|
255
|
+
});
|
|
256
|
+
if (!aggregateResult.ok) return notOk(aggregateResult.failure);
|
|
257
|
+
if (mode === "marker-only") return ok({
|
|
258
|
+
ok: true,
|
|
259
|
+
mode: "marker-only",
|
|
260
|
+
summary: "Database marker matches contract",
|
|
261
|
+
contract: verifyResult.contract,
|
|
262
|
+
marker: verifyResult.marker,
|
|
263
|
+
target: verifyResult.target,
|
|
264
|
+
...ifDefined("missingCodecs", verifyResult.missingCodecs),
|
|
265
|
+
...ifDefined("codecCoverageSkipped", verifyResult.codecCoverageSkipped),
|
|
266
|
+
warning: "Schema verification skipped because --marker-only was provided",
|
|
267
|
+
meta: {
|
|
268
|
+
...verifyResult.meta ?? {},
|
|
269
|
+
schemaVerification: "skipped"
|
|
270
|
+
},
|
|
271
|
+
timings: { total: Date.now() - startTime }
|
|
272
|
+
});
|
|
273
|
+
const combined = combineVerifyResults(aggregateResult.value.schemaResults, aggregateResult.value.appSpaceId, options.strict ?? false, aggregateResult.value.unclaimed);
|
|
274
|
+
if (!combined.result.ok) return notOk(combined);
|
|
275
|
+
return ok({
|
|
276
|
+
ok: true,
|
|
277
|
+
mode: "full",
|
|
278
|
+
summary: "Database marker and schema match contract",
|
|
279
|
+
contract: verifyResult.contract,
|
|
280
|
+
marker: verifyResult.marker,
|
|
281
|
+
target: verifyResult.target,
|
|
282
|
+
...ifDefined("missingCodecs", verifyResult.missingCodecs),
|
|
283
|
+
...ifDefined("codecCoverageSkipped", verifyResult.codecCoverageSkipped),
|
|
284
|
+
schema: {
|
|
285
|
+
summary: combined.result.summary,
|
|
286
|
+
strict: combined.result.meta?.strict ?? false,
|
|
287
|
+
warnings: (combined.result.schema.warnings?.issues ?? []).map((issue) => issue.path.join("/"))
|
|
288
|
+
},
|
|
289
|
+
unclaimed: combined.unclaimed,
|
|
290
|
+
meta: {
|
|
291
|
+
...verifyResult.meta ?? {},
|
|
292
|
+
schemaVerification: "performed"
|
|
293
|
+
},
|
|
294
|
+
timings: { total: Date.now() - startTime }
|
|
295
|
+
});
|
|
296
|
+
} catch (error) {
|
|
297
|
+
return wrapVerifyError(error, contractPathAbsolute, "db verify");
|
|
298
|
+
} finally {
|
|
299
|
+
await client.close();
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
async function executeDbSchemaOnlyVerifyCommand(options, flags, ui) {
|
|
303
|
+
const paths = await resolveVerifyPaths(options);
|
|
304
|
+
renderVerifyHeader(paths, options, "schema-only", flags, ui);
|
|
305
|
+
const setupResult = await resolveVerifySetup(paths, options, "schema-only");
|
|
306
|
+
if (!setupResult.ok) return setupResult;
|
|
307
|
+
const { contractJson, dbConnection, contractPathAbsolute } = setupResult.value;
|
|
308
|
+
const { migrationsDir } = resolveMigrationPaths(options.config, setupResult.value.config);
|
|
309
|
+
const client = createVerifyClient(setupResult.value);
|
|
310
|
+
const onProgress = createProgressAdapter({
|
|
311
|
+
ui,
|
|
312
|
+
flags
|
|
313
|
+
});
|
|
314
|
+
try {
|
|
315
|
+
await client.connect(dbConnection);
|
|
316
|
+
const aggregateResult = await client.dbVerify({
|
|
317
|
+
contract: contractJson,
|
|
318
|
+
migrationsDir,
|
|
319
|
+
strict: options.strict ?? false,
|
|
320
|
+
skipSchema: false,
|
|
321
|
+
skipMarker: true,
|
|
322
|
+
onProgress
|
|
323
|
+
});
|
|
324
|
+
if (!aggregateResult.ok) return notOk(aggregateResult.failure);
|
|
325
|
+
return ok(combineVerifyResults(aggregateResult.value.schemaResults, aggregateResult.value.appSpaceId, options.strict ?? false, aggregateResult.value.unclaimed));
|
|
326
|
+
} catch (error) {
|
|
327
|
+
return wrapVerifyError(error, contractPathAbsolute, "db verify --schema-only");
|
|
328
|
+
} finally {
|
|
329
|
+
await client.close();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function createDbVerifyCommand() {
|
|
333
|
+
const command = new Command("verify");
|
|
334
|
+
setCommandDescriptions(command, "Check whether the database marker and live schema match your contract", "Verifies the database marker first, then checks the database schema matches your contract.\nUse `--marker-only` for marker-only verification, `--schema-only` to skip marker checks and\ninspect only the live schema, and `--strict` to fail if the database includes elements\nnot present in the contract.");
|
|
335
|
+
setCommandExamples(command, [
|
|
336
|
+
"prisma-next db verify --db $DATABASE_URL",
|
|
337
|
+
"prisma-next db verify --db $DATABASE_URL --strict",
|
|
338
|
+
"prisma-next db verify --db $DATABASE_URL --schema-only",
|
|
339
|
+
"prisma-next db verify --db $DATABASE_URL --schema-only --strict",
|
|
340
|
+
"prisma-next db verify --db $DATABASE_URL --marker-only",
|
|
341
|
+
"prisma-next db verify --db $DATABASE_URL --json"
|
|
342
|
+
]);
|
|
343
|
+
addGlobalOptions(command).option("--db <url>", "Database connection string").option("--config <path>", "Path to prisma-next.config.ts").option("--marker-only", "Skip schema verification and only check the database marker").option("--schema-only", "Skip marker verification and only check whether the live schema satisfies the contract").option("--strict", "Strict mode: schema elements not present in the contract are considered an error", false).action(async (options) => {
|
|
344
|
+
const flags = parseGlobalFlagsOrExit(options);
|
|
345
|
+
const ui = createTerminalUI(flags);
|
|
346
|
+
const modeResult = resolveDbVerifyMode(options);
|
|
347
|
+
if (!modeResult.ok) {
|
|
348
|
+
const exitCode = handleResult(modeResult, flags, ui);
|
|
349
|
+
process.exit(exitCode);
|
|
350
|
+
}
|
|
351
|
+
const mode = modeResult.value;
|
|
352
|
+
if (mode === "schema-only") {
|
|
353
|
+
const result = await executeDbSchemaOnlyVerifyCommand(options, flags, ui);
|
|
354
|
+
const exitCode = handleResult(result, flags, ui, (combined) => {
|
|
355
|
+
if (flags.json) ui.output(formatSchemaVerifyJson(combined.result, combined.unclaimed));
|
|
356
|
+
else {
|
|
357
|
+
const renderFlags = combined.result.ok ? flags : {
|
|
358
|
+
...flags,
|
|
359
|
+
quiet: false
|
|
360
|
+
};
|
|
361
|
+
const output = formatSchemaVerifyOutput(combined.result, renderFlags, combined.unclaimed);
|
|
362
|
+
if (output) ui.log(output);
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
if (result.ok && !result.value.result.ok) process.exit(1);
|
|
366
|
+
process.exit(exitCode);
|
|
367
|
+
}
|
|
368
|
+
const result = await executeDbVerifyCommand(options, flags, ui, mode);
|
|
369
|
+
if (result.ok) {
|
|
370
|
+
if (flags.json) ui.output(formatVerifyJson(result.value));
|
|
371
|
+
else {
|
|
372
|
+
const output = formatVerifyOutput(result.value, flags);
|
|
373
|
+
if (output) ui.log(output);
|
|
374
|
+
}
|
|
375
|
+
process.exit(0);
|
|
376
|
+
}
|
|
377
|
+
if (CliStructuredError$1.is(result.failure)) {
|
|
378
|
+
const exitCode = handleResult(result, flags, ui);
|
|
379
|
+
process.exit(exitCode);
|
|
380
|
+
}
|
|
381
|
+
if (flags.json) ui.output(formatSchemaVerifyJson(result.failure.result, result.failure.unclaimed));
|
|
382
|
+
else {
|
|
383
|
+
const output = formatSchemaVerifyOutput(result.failure.result, {
|
|
384
|
+
...flags,
|
|
385
|
+
quiet: false
|
|
386
|
+
}, result.failure.unclaimed);
|
|
387
|
+
if (output) ui.log(output);
|
|
388
|
+
}
|
|
389
|
+
process.exit(1);
|
|
390
|
+
});
|
|
391
|
+
return command;
|
|
392
|
+
}
|
|
393
|
+
//#endregion
|
|
394
|
+
export { createDbVerifyCommand as t };
|
|
395
|
+
|
|
396
|
+
//# sourceMappingURL=db-verify-CKPsRFrj-3udprZQD.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"db-verify-CKPsRFrj-3udprZQD.mjs","names":["errorRuntime","CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/db-verify-CKPsRFrj.mjs"],"sourcesContent":["import { A as formatStyledHeader, B as errorContractValidationFailed, F as CliStructuredError, G as errorHashMismatch, U as errorDriverRequired, V as errorDatabaseConnectionRequired, W as errorFileNotFound, Y as errorMarkerMissing, _ as createTerminalUI, ct as errorUnexpected, g as parseGlobalFlagsOrExit, i as maskConnectionUrl, l as setCommandDescriptions, o as resolveContractPath, rt as errorRuntime, s as resolveMigrationPaths, st as errorTargetMismatch, t as addGlobalOptions, u as setCommandExamples, y as handleResult } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { t as createProgressAdapter } from \"./progress-adapter-CjAeTxY_.mjs\";\nimport { t as createControlClient } from \"./client-75qrAPqf.mjs\";\nimport { c as formatVerifyOutput, i as formatSchemaVerifyOutput, r as formatSchemaVerifyJson, s as formatVerifyJson } from \"./verify-DnVNjc5C.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 { relative, resolve } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { VERIFY_CODE_HASH_MISMATCH, VERIFY_CODE_MARKER_MISSING, VERIFY_CODE_TARGET_MISMATCH, createControlStack } from \"@internal/framework-components/control\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\n//#region src/utils/combine-verify-results.ts\n/**\n* Collapse the aggregate verifier's per-space contract-satisfaction results\n* into a single {@link VerifyDatabaseSchemaResult} for the CLI display\n* surface, and carry the deduplicated unclaimed-elements list alongside it.\n* Concatenates the issue lists across spaces; uses the app space's result as\n* the structural envelope (storage hash, target). Extras are already\n* stripped from each per-space result, so nothing here duplicates an\n* unclaimed element per space.\n*\n* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails\n* the combined verdict (`ok: false`); in lenient mode it is carried for\n* informational rendering only. The list itself is returned unchanged for the\n* renderer.\n*\n* **Summary policy.** Preserve the per-family phrasing whenever the\n* combined `ok` flag agrees with the app space's `ok` flag — this is\n* the common case (single-family deployments, single-app deployments)\n* and the family's \"satisfies / does not satisfy contract\" phrasing\n* stays user-visible. When the app passes but an extension fails (or\n* vice versa) the app's summary contradicts the envelope, so fall back\n* to the first failing space's summary. This keeps family phrasing\n* intact and the envelope internally consistent (`ok: false` ↔ failure\n* summary).\n*/\nfunction combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {\n\tconst appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;\n\tif (appResult === void 0) throw new InternalError(\"Aggregate verifier returned no per-space verify results — this is a wiring bug.\");\n\tlet okAll = true;\n\tlet firstFailure;\n\tlet issues = [];\n\tlet warningIssues = [];\n\tfor (const [, result] of perSpace) {\n\t\tif (!result.ok) {\n\t\t\tokAll = false;\n\t\t\tif (firstFailure === void 0) firstFailure = result;\n\t\t}\n\t\tissues = [...issues, ...result.schema.issues];\n\t\twarningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];\n\t}\n\tconst unclaimedFails = strict && unclaimed.length > 0;\n\tconst ok = okAll && !unclaimedFails;\n\tconst summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? \"\" : \"s\"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;\n\treturn {\n\t\tresult: {\n\t\t\tok,\n\t\t\t...ok ? {} : { code: appResult.code ?? \"CONTRACT.MARKER_REQUIRED\" },\n\t\t\tsummary,\n\t\t\tcontract: appResult.contract,\n\t\t\ttarget: appResult.target,\n\t\t\tschema: {\n\t\t\t\tissues,\n\t\t\t\twarnings: { issues: warningIssues }\n\t\t\t},\n\t\t\tmeta: { strict },\n\t\t\ttimings: { total: 0 }\n\t\t},\n\t\tunclaimed\n\t};\n}\n//#endregion\n//#region src/commands/db-verify.ts\n/**\n* Maps a VerifyDatabaseResult failure to a CliStructuredError.\n*/\nfunction mapVerifyFailure(verifyResult) {\n\tif (!verifyResult.ok && verifyResult.code) {\n\t\tif (verifyResult.code === VERIFY_CODE_MARKER_MISSING) return errorMarkerMissing();\n\t\tif (verifyResult.code === VERIFY_CODE_HASH_MISMATCH) {\n\t\t\tconst storageMatch = verifyResult.marker?.storageHash === verifyResult.contract.storageHash;\n\t\t\tconst profileMatch = !verifyResult.contract.profileHash || verifyResult.marker?.profileHash === verifyResult.contract.profileHash;\n\t\t\tif (!storageMatch) return errorHashMismatch({\n\t\t\t\twhy: \"Contract storageHash does not match database marker\",\n\t\t\t\texpected: verifyResult.contract.storageHash,\n\t\t\t\t...ifDefined(\"actual\", verifyResult.marker?.storageHash)\n\t\t\t});\n\t\t\treturn errorHashMismatch({\n\t\t\t\twhy: profileMatch ? \"Contract hash does not match database marker\" : \"Contract profileHash does not match database marker\",\n\t\t\t\t...ifDefined(\"expected\", verifyResult.contract.profileHash),\n\t\t\t\t...ifDefined(\"actual\", verifyResult.marker?.profileHash)\n\t\t\t});\n\t\t}\n\t\tif (verifyResult.code === VERIFY_CODE_TARGET_MISMATCH) return errorTargetMismatch(verifyResult.target.expected, verifyResult.target.actual ?? \"unknown\");\n\t}\n\treturn errorRuntime(verifyResult.summary);\n}\nfunction errorInvalidVerifyMode(options) {\n\treturn new CliStructuredError(\"CLI.INVALID_VERIFY_MODE\", \"Invalid verify mode\", {\n\t\twhy: options.why,\n\t\tfix: options.fix,\n\t\tdocsUrl: \"https://pris.ly/db-verify\"\n\t});\n}\nfunction resolveDbVerifyMode(options) {\n\tif (options.markerOnly && options.schemaOnly) return notOk(errorInvalidVerifyMode({\n\t\twhy: \"`--marker-only` and `--schema-only` cannot be used together\",\n\t\tfix: \"Choose one mode: omit both to check the marker and schema, use `--marker-only` to check only the marker, or use `--schema-only` to check only the live schema.\"\n\t}));\n\tif (options.markerOnly && options.strict) return notOk(errorInvalidVerifyMode({\n\t\twhy: \"`--strict` requires schema verification, but `--marker-only` skips it\",\n\t\tfix: \"Remove `--strict`, or use `db verify` / `db verify --schema-only` when you want to check the live schema in strict mode.\"\n\t}));\n\tif (options.schemaOnly) return ok(\"schema-only\");\n\tif (options.markerOnly) return ok(\"marker-only\");\n\treturn ok(\"full\");\n}\nfunction formatDbVerifyModeLabel(mode, strict) {\n\tif (mode === \"marker-only\") return \"marker only\";\n\tif (mode === \"schema-only\") return `schema only (${strict ? \"strict\" : \"tolerant\"})`;\n\treturn `full (marker + schema, ${strict ? \"strict\" : \"tolerant\"})`;\n}\nfunction formatDbVerifyInvocation(mode, strict) {\n\tconst args = [\"db verify\"];\n\tif (mode === \"marker-only\") args.push(\"--marker-only\");\n\tif (mode === \"schema-only\") args.push(\"--schema-only\");\n\tif (strict) args.push(\"--strict\");\n\treturn args.join(\" \");\n}\nfunction createDbVerifyConnectionRequiredError(options) {\n\tconst invocation = formatDbVerifyInvocation(options.mode, options.strict);\n\treturn errorDatabaseConnectionRequired({\n\t\twhy: `Database connection is required for ${invocation} (set db.connection in ${options.configPath}, or pass --db <url>)`,\n\t\tretryCommand: `prisma-next ${invocation} --db <url>`\n\t});\n}\nfunction renderVerifyHeader(paths, options, mode, flags, ui) {\n\tif (flags.json || flags.quiet) return;\n\tconst description = mode === \"schema-only\" ? \"Check whether the live database schema matches your contract\" : mode === \"marker-only\" ? \"Check whether the database marker matches your contract\" : \"Check whether the database marker and live schema match your contract\";\n\tconst details = [\n\t\t{\n\t\t\tlabel: \"config\",\n\t\t\tvalue: paths.configPath\n\t\t},\n\t\t{\n\t\t\tlabel: \"contract\",\n\t\t\tvalue: paths.contractPath\n\t\t},\n\t\t{\n\t\t\tlabel: \"mode\",\n\t\t\tvalue: formatDbVerifyModeLabel(mode, options.strict ?? false)\n\t\t}\n\t];\n\tif (options.db) details.push({\n\t\tlabel: \"database\",\n\t\tvalue: maskConnectionUrl(options.db)\n\t});\n\tui.stderr(formatStyledHeader({\n\t\tcommand: \"db verify\",\n\t\tdescription,\n\t\turl: \"https://pris.ly/db-verify\",\n\t\tdetails,\n\t\tflags\n\t}));\n}\nasync function resolveVerifyPaths(options) {\n\tconst config = await loadConfig(options.config);\n\tconst configPath = options.config ? relative(process.cwd(), resolve(options.config)) : \"prisma-next.config.ts\";\n\tconst contractPathAbsolute = resolveContractPath(config);\n\treturn {\n\t\tconfig,\n\t\tconfigPath,\n\t\tcontractPathAbsolute,\n\t\tcontractPath: relative(process.cwd(), contractPathAbsolute)\n\t};\n}\nasync function resolveVerifySetup(paths, options, mode) {\n\tconst { config, configPath, contractPathAbsolute, contractPath } = paths;\n\tlet contractJsonContent;\n\ttry {\n\t\tcontractJsonContent = 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 ${contractPath}, or update \\`config.contract.output\\` in ${configPath}`\n\t\t}));\n\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}` }));\n\t}\n\tconst stack = createControlStack(config);\n\tconst familyInstance = config.family.create(stack);\n\tlet contractJson;\n\ttry {\n\t\tcontractJson = familyInstance.deserializeContract(JSON.parse(contractJsonContent));\n\t} catch (error) {\n\t\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPathAbsolute } }));\n\t\treturn notOk(errorContractValidationFailed(`Contract JSON is invalid: ${error instanceof Error ? error.message : String(error)}`, { where: { path: contractPathAbsolute } }));\n\t}\n\tconst dbConnection = options.db ?? config.db?.connection;\n\tif (typeof dbConnection !== \"string\" || dbConnection.length === 0) return notOk(createDbVerifyConnectionRequiredError({\n\t\tconfigPath,\n\t\tmode,\n\t\tstrict: options.strict ?? false\n\t}));\n\tif (!config.driver) return notOk(errorDriverRequired({ why: `Config.driver is required for ${formatDbVerifyInvocation(mode, options.strict ?? false)}` }));\n\treturn ok({\n\t\t...paths,\n\t\tcontractJson,\n\t\tdbConnection\n\t});\n}\nfunction createVerifyClient(setup) {\n\treturn createControlClient({\n\t\tfamily: setup.config.family,\n\t\ttarget: setup.config.target,\n\t\tadapter: setup.config.adapter,\n\t\tdriver: setup.config.driver,\n\t\textensions: setup.config.extensions ?? []\n\t});\n}\nfunction wrapVerifyError(error, contractPathAbsolute, modeLabel) {\n\tif (CliStructuredError.is(error)) return notOk(error);\n\tif (isStructuredError(error) && error.code === \"CONTRACT.VALIDATION_FAILED\") return notOk(errorContractValidationFailed(`Contract validation failed: ${error.message}`, { where: { path: contractPathAbsolute } }));\n\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), { why: `Unexpected error during ${modeLabel}: ${error instanceof Error ? error.message : String(error)}` }));\n}\n/**\n* Executes the db verify command and returns a structured Result.\n*/\nasync function executeDbVerifyCommand(options, flags, ui, mode) {\n\tconst startTime = Date.now();\n\tconst paths = await resolveVerifyPaths(options);\n\trenderVerifyHeader(paths, options, mode, flags, ui);\n\tconst setupResult = await resolveVerifySetup(paths, options, mode);\n\tif (!setupResult.ok) return setupResult;\n\tconst { contractJson, dbConnection, contractPathAbsolute } = setupResult.value;\n\tconst { migrationsDir } = resolveMigrationPaths(options.config, setupResult.value.config);\n\tconst client = createVerifyClient(setupResult.value);\n\tconst onProgress = createProgressAdapter({\n\t\tui,\n\t\tflags\n\t});\n\ttry {\n\t\tconst verifyResult = await client.verify({\n\t\t\tcontract: contractJson,\n\t\t\tconnection: dbConnection,\n\t\t\tonProgress\n\t\t});\n\t\tif (!verifyResult.ok) return notOk(mapVerifyFailure(verifyResult));\n\t\tconst aggregateResult = await client.dbVerify({\n\t\t\tcontract: contractJson,\n\t\t\tmigrationsDir,\n\t\t\tstrict: options.strict ?? false,\n\t\t\tskipSchema: mode === \"marker-only\",\n\t\t\tskipMarker: false,\n\t\t\tonProgress\n\t\t});\n\t\tif (!aggregateResult.ok) return notOk(aggregateResult.failure);\n\t\tif (mode === \"marker-only\") return ok({\n\t\t\tok: true,\n\t\t\tmode: \"marker-only\",\n\t\t\tsummary: \"Database marker matches contract\",\n\t\t\tcontract: verifyResult.contract,\n\t\t\tmarker: verifyResult.marker,\n\t\t\ttarget: verifyResult.target,\n\t\t\t...ifDefined(\"missingCodecs\", verifyResult.missingCodecs),\n\t\t\t...ifDefined(\"codecCoverageSkipped\", verifyResult.codecCoverageSkipped),\n\t\t\twarning: \"Schema verification skipped because --marker-only was provided\",\n\t\t\tmeta: {\n\t\t\t\t...verifyResult.meta ?? {},\n\t\t\t\tschemaVerification: \"skipped\"\n\t\t\t},\n\t\t\ttimings: { total: Date.now() - startTime }\n\t\t});\n\t\tconst combined = combineVerifyResults(aggregateResult.value.schemaResults, aggregateResult.value.appSpaceId, options.strict ?? false, aggregateResult.value.unclaimed);\n\t\tif (!combined.result.ok) return notOk(combined);\n\t\treturn ok({\n\t\t\tok: true,\n\t\t\tmode: \"full\",\n\t\t\tsummary: \"Database marker and schema match contract\",\n\t\t\tcontract: verifyResult.contract,\n\t\t\tmarker: verifyResult.marker,\n\t\t\ttarget: verifyResult.target,\n\t\t\t...ifDefined(\"missingCodecs\", verifyResult.missingCodecs),\n\t\t\t...ifDefined(\"codecCoverageSkipped\", verifyResult.codecCoverageSkipped),\n\t\t\tschema: {\n\t\t\t\tsummary: combined.result.summary,\n\t\t\t\tstrict: combined.result.meta?.strict ?? false,\n\t\t\t\twarnings: (combined.result.schema.warnings?.issues ?? []).map((issue) => issue.path.join(\"/\"))\n\t\t\t},\n\t\t\tunclaimed: combined.unclaimed,\n\t\t\tmeta: {\n\t\t\t\t...verifyResult.meta ?? {},\n\t\t\t\tschemaVerification: \"performed\"\n\t\t\t},\n\t\t\ttimings: { total: Date.now() - startTime }\n\t\t});\n\t} catch (error) {\n\t\treturn wrapVerifyError(error, contractPathAbsolute, \"db verify\");\n\t} finally {\n\t\tawait client.close();\n\t}\n}\nasync function executeDbSchemaOnlyVerifyCommand(options, flags, ui) {\n\tconst paths = await resolveVerifyPaths(options);\n\trenderVerifyHeader(paths, options, \"schema-only\", flags, ui);\n\tconst setupResult = await resolveVerifySetup(paths, options, \"schema-only\");\n\tif (!setupResult.ok) return setupResult;\n\tconst { contractJson, dbConnection, contractPathAbsolute } = setupResult.value;\n\tconst { migrationsDir } = resolveMigrationPaths(options.config, setupResult.value.config);\n\tconst client = createVerifyClient(setupResult.value);\n\tconst onProgress = createProgressAdapter({\n\t\tui,\n\t\tflags\n\t});\n\ttry {\n\t\tawait client.connect(dbConnection);\n\t\tconst aggregateResult = await client.dbVerify({\n\t\t\tcontract: contractJson,\n\t\t\tmigrationsDir,\n\t\t\tstrict: options.strict ?? false,\n\t\t\tskipSchema: false,\n\t\t\tskipMarker: true,\n\t\t\tonProgress\n\t\t});\n\t\tif (!aggregateResult.ok) return notOk(aggregateResult.failure);\n\t\treturn ok(combineVerifyResults(aggregateResult.value.schemaResults, aggregateResult.value.appSpaceId, options.strict ?? false, aggregateResult.value.unclaimed));\n\t} catch (error) {\n\t\treturn wrapVerifyError(error, contractPathAbsolute, \"db verify --schema-only\");\n\t} finally {\n\t\tawait client.close();\n\t}\n}\nfunction createDbVerifyCommand() {\n\tconst command = new Command(\"verify\");\n\tsetCommandDescriptions(command, \"Check whether the database marker and live schema match your contract\", \"Verifies the database marker first, then checks the database schema matches your contract.\\nUse `--marker-only` for marker-only verification, `--schema-only` to skip marker checks and\\ninspect only the live schema, and `--strict` to fail if the database includes elements\\nnot present in the contract.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next db verify --db $DATABASE_URL\",\n\t\t\"prisma-next db verify --db $DATABASE_URL --strict\",\n\t\t\"prisma-next db verify --db $DATABASE_URL --schema-only\",\n\t\t\"prisma-next db verify --db $DATABASE_URL --schema-only --strict\",\n\t\t\"prisma-next db verify --db $DATABASE_URL --marker-only\",\n\t\t\"prisma-next db verify --db $DATABASE_URL --json\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--marker-only\", \"Skip schema verification and only check the database marker\").option(\"--schema-only\", \"Skip marker verification and only check whether the live schema satisfies the contract\").option(\"--strict\", \"Strict mode: schema elements not present in the contract are considered an error\", false).action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst modeResult = resolveDbVerifyMode(options);\n\t\tif (!modeResult.ok) {\n\t\t\tconst exitCode = handleResult(modeResult, flags, ui);\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t\tconst mode = modeResult.value;\n\t\tif (mode === \"schema-only\") {\n\t\t\tconst result = await executeDbSchemaOnlyVerifyCommand(options, flags, ui);\n\t\t\tconst exitCode = handleResult(result, flags, ui, (combined) => {\n\t\t\t\tif (flags.json) ui.output(formatSchemaVerifyJson(combined.result, combined.unclaimed));\n\t\t\t\telse {\n\t\t\t\t\tconst renderFlags = combined.result.ok ? flags : {\n\t\t\t\t\t\t...flags,\n\t\t\t\t\t\tquiet: false\n\t\t\t\t\t};\n\t\t\t\t\tconst output = formatSchemaVerifyOutput(combined.result, renderFlags, combined.unclaimed);\n\t\t\t\t\tif (output) ui.log(output);\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (result.ok && !result.value.result.ok) process.exit(1);\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t\tconst result = await executeDbVerifyCommand(options, flags, ui, mode);\n\t\tif (result.ok) {\n\t\t\tif (flags.json) ui.output(formatVerifyJson(result.value));\n\t\t\telse {\n\t\t\t\tconst output = formatVerifyOutput(result.value, flags);\n\t\t\t\tif (output) ui.log(output);\n\t\t\t}\n\t\t\tprocess.exit(0);\n\t\t}\n\t\tif (CliStructuredError.is(result.failure)) {\n\t\t\tconst exitCode = handleResult(result, flags, ui);\n\t\t\tprocess.exit(exitCode);\n\t\t}\n\t\tif (flags.json) ui.output(formatSchemaVerifyJson(result.failure.result, result.failure.unclaimed));\n\t\telse {\n\t\t\tconst output = formatSchemaVerifyOutput(result.failure.result, {\n\t\t\t\t...flags,\n\t\t\t\tquiet: false\n\t\t\t}, result.failure.unclaimed);\n\t\t\tif (output) ui.log(output);\n\t\t}\n\t\tprocess.exit(1);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createDbVerifyCommand as t };\n\n//# sourceMappingURL=db-verify-CKPsRFrj.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,qBAAqB,UAAU,YAAY,QAAQ,WAAW;CACtE,MAAM,YAAY,SAAS,IAAI,UAAU,KAAK,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;CACvE,IAAI,cAAc,KAAK,GAAG,MAAM,IAAI,cAAc,iFAAiF;CACnI,IAAI,QAAQ;CACZ,IAAI;CACJ,IAAI,SAAS,CAAC;CACd,IAAI,gBAAgB,CAAC;CACrB,KAAK,MAAM,GAAG,WAAW,UAAU;EAClC,IAAI,CAAC,OAAO,IAAI;GACf,QAAQ;GACR,IAAI,iBAAiB,KAAK,GAAG,eAAe;EAC7C;EACA,SAAS,CAAC,GAAG,QAAQ,GAAG,OAAO,OAAO,MAAM;EAC5C,gBAAgB,CAAC,GAAG,eAAe,GAAG,OAAO,OAAO,UAAU,UAAU,CAAC,CAAC;CAC3E;CACA,MAAM,iBAAiB,UAAU,UAAU,SAAS;CACpD,MAAM,KAAK,SAAS,CAAC;CACrB,MAAM,UAAU,QAAQ,iBAAiB,uBAAuB,UAAU,OAAO,oBAAoB,UAAU,WAAW,IAAI,KAAK,IAAI,0BAA0B,UAAU,UAAU,UAAU,KAAK,cAAc,WAAW,UAAU,UAAU,UAAU;CAC3P,OAAO;EACN,QAAQ;GACP;GACA,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,UAAU,QAAQ,2BAA2B;GAClE;GACA,UAAU,UAAU;GACpB,QAAQ,UAAU;GAClB,QAAQ;IACP;IACA,UAAU,EAAE,QAAQ,cAAc;GACnC;GACA,MAAM,EAAE,OAAO;GACf,SAAS,EAAE,OAAO,EAAE;EACrB;EACA;CACD;AACD;;;;AAMA,SAA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