@prisma/orm-toolchain 0.16.0
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-DcwUnadt-B6Qoh0ot.mjs +597 -0
- package/dist/migration-check-DcwUnadt-B6Qoh0ot.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-CE7cQLDq-B1jDVmqG.mjs +444 -0
- package/dist/migration-status-CE7cQLDq-B1jDVmqG.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-CfGSxH5b-BSjB3nZS.d.mts +192 -0
- package/dist/schemas-CfGSxH5b-BSjB3nZS.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 +122 -0
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { t as createContractEmitCommand } from "./contract-emit-0hSjbuxp-BBOKldTZ.mjs";
|
|
2
|
+
import { t as createFormatCommand } from "./format-ByDm2goZ-DKLyhNHo.mjs";
|
|
3
|
+
import { CliStructuredError } from "@prisma/orm-framework/errors/control";
|
|
4
|
+
import { join, resolve } from "pathe";
|
|
5
|
+
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
6
|
+
import { existsSync, unlinkSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { tmpdir } from "node:os";
|
|
8
|
+
import { pathToFileURL } from "node:url";
|
|
9
|
+
import { build } from "esbuild";
|
|
10
|
+
//#region ../../../1-framework/3-tooling/cli/dist/exports/index.mjs
|
|
11
|
+
function contractSourceError(code, message, options) {
|
|
12
|
+
const error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);
|
|
13
|
+
if (options?.cause !== void 0) error.cause = options.cause;
|
|
14
|
+
return error;
|
|
15
|
+
}
|
|
16
|
+
const DEFAULT_ALLOWLIST = [
|
|
17
|
+
"@internal/*",
|
|
18
|
+
"@prisma/orm-*",
|
|
19
|
+
"node:crypto"
|
|
20
|
+
];
|
|
21
|
+
function isAllowedImport(importPath, allowlist) {
|
|
22
|
+
for (const pattern of allowlist) if (pattern.endsWith("/*")) {
|
|
23
|
+
const prefix = pattern.slice(0, -2);
|
|
24
|
+
if (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;
|
|
25
|
+
} else if (pattern.endsWith("*")) {
|
|
26
|
+
const prefix = pattern.slice(0, -1);
|
|
27
|
+
if (importPath.startsWith(prefix)) return true;
|
|
28
|
+
} else if (importPath === pattern) return true;
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
function validatePurity(value, entryPath) {
|
|
32
|
+
if (typeof value !== "object" || value === null) return;
|
|
33
|
+
const path = /* @__PURE__ */ new WeakSet();
|
|
34
|
+
function check(value) {
|
|
35
|
+
if (value === null || typeof value !== "object") return;
|
|
36
|
+
if (path.has(value)) throw contractSourceError("CONTRACT.EXPORT_INVALID", "Contract export contains circular references", { meta: {
|
|
37
|
+
path: entryPath,
|
|
38
|
+
reason: "circular"
|
|
39
|
+
} });
|
|
40
|
+
path.add(value);
|
|
41
|
+
try {
|
|
42
|
+
for (const key in value) {
|
|
43
|
+
const descriptor = Object.getOwnPropertyDescriptor(value, key);
|
|
44
|
+
if (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError("CONTRACT.EXPORT_INVALID", `Contract export contains getter/setter at key "${key}"`, { meta: {
|
|
45
|
+
path: entryPath,
|
|
46
|
+
reason: "getter",
|
|
47
|
+
key
|
|
48
|
+
} });
|
|
49
|
+
if (descriptor && typeof descriptor.value === "function") throw contractSourceError("CONTRACT.EXPORT_INVALID", `Contract export contains function at key "${key}"`, { meta: {
|
|
50
|
+
path: entryPath,
|
|
51
|
+
reason: "function",
|
|
52
|
+
key
|
|
53
|
+
} });
|
|
54
|
+
check(value[key]);
|
|
55
|
+
}
|
|
56
|
+
} finally {
|
|
57
|
+
path.delete(value);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
check(value);
|
|
62
|
+
JSON.stringify(value);
|
|
63
|
+
} catch (error) {
|
|
64
|
+
if (error instanceof Error) {
|
|
65
|
+
if (error.message.includes("getter") || error.message.includes("circular")) throw error;
|
|
66
|
+
throw contractSourceError("CONTRACT.EXPORT_INVALID", `Contract export is not JSON-serializable: ${error.message}`, {
|
|
67
|
+
meta: {
|
|
68
|
+
path: entryPath,
|
|
69
|
+
reason: "not-json-serializable"
|
|
70
|
+
},
|
|
71
|
+
cause: error
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
throw contractSourceError("CONTRACT.EXPORT_INVALID", "Contract export is not JSON-serializable", { meta: {
|
|
75
|
+
path: entryPath,
|
|
76
|
+
reason: "not-json-serializable"
|
|
77
|
+
} });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function createImportAllowlistPlugin(allowlist, entryPath, collected) {
|
|
81
|
+
const entryAbs = resolve(entryPath);
|
|
82
|
+
function isFromEntry(importer) {
|
|
83
|
+
return importer === entryAbs || importer === entryPath || importer === "<stdin>";
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
name: "import-allowlist",
|
|
87
|
+
setup(build) {
|
|
88
|
+
build.onResolve({ filter: /.*/ }, (args) => {
|
|
89
|
+
if (args.kind === "entry-point") return;
|
|
90
|
+
if (args.path.startsWith(".") || args.path.startsWith("/")) return;
|
|
91
|
+
if (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {
|
|
92
|
+
collected.add(args.path);
|
|
93
|
+
return {
|
|
94
|
+
path: args.path,
|
|
95
|
+
external: true
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Loads a contract from a TypeScript file and returns it as Contract.
|
|
104
|
+
*
|
|
105
|
+
* **Responsibility: Parsing Only**
|
|
106
|
+
* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.
|
|
107
|
+
* The contract should already be normalized if it was built using the contract builder.
|
|
108
|
+
*
|
|
109
|
+
* Normalization must happen in the contract builder when the contract is created.
|
|
110
|
+
* This function only validates that the contract is JSON-serializable and returns it as-is.
|
|
111
|
+
*
|
|
112
|
+
* @param entryPath - Path to the TypeScript contract file
|
|
113
|
+
* @param options - Optional configuration (import allowlist)
|
|
114
|
+
* @returns The contract as Contract (should already be normalized)
|
|
115
|
+
* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,
|
|
116
|
+
* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`
|
|
117
|
+
*/
|
|
118
|
+
async function loadContractFromTs(entryPath, options) {
|
|
119
|
+
const allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;
|
|
120
|
+
if (!existsSync(entryPath)) throw new CliStructuredError("CLI.FILE_NOT_FOUND", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });
|
|
121
|
+
const tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);
|
|
122
|
+
const disallowedFromEntry = /* @__PURE__ */ new Set();
|
|
123
|
+
try {
|
|
124
|
+
const result = await build({
|
|
125
|
+
entryPoints: [entryPath],
|
|
126
|
+
bundle: true,
|
|
127
|
+
format: "esm",
|
|
128
|
+
platform: "node",
|
|
129
|
+
target: "es2022",
|
|
130
|
+
outfile: tempFile,
|
|
131
|
+
write: false,
|
|
132
|
+
metafile: true,
|
|
133
|
+
plugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],
|
|
134
|
+
logLevel: "error"
|
|
135
|
+
});
|
|
136
|
+
if (result.errors.length > 0) throw contractSourceError("CONTRACT.SOURCE_LOAD_FAILED", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join("\n")}`, { meta: {
|
|
137
|
+
path: entryPath,
|
|
138
|
+
stage: "bundle"
|
|
139
|
+
} });
|
|
140
|
+
if (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError("No output files generated from bundling");
|
|
141
|
+
if (disallowedFromEntry.size > 0) throw contractSourceError("CONTRACT.SOURCE_IMPORT_DISALLOWED", `Disallowed imports detected. Only imports matching the allowlist are permitted:\n Allowlist: ${allowlist.join(", ")}\n Disallowed imports: ${[...disallowedFromEntry].join(", ")}`, { meta: {
|
|
142
|
+
allowlist: [...allowlist],
|
|
143
|
+
disallowed: [...disallowedFromEntry]
|
|
144
|
+
} });
|
|
145
|
+
const bundleContent = result.outputFiles[0]?.text;
|
|
146
|
+
if (bundleContent === void 0) throw new InternalError("Bundle content is undefined");
|
|
147
|
+
writeFileSync(tempFile, bundleContent, "utf-8");
|
|
148
|
+
const module = await import(
|
|
149
|
+
/* @vite-ignore */
|
|
150
|
+
pathToFileURL(tempFile).href
|
|
151
|
+
);
|
|
152
|
+
unlinkSync(tempFile);
|
|
153
|
+
let contract;
|
|
154
|
+
if (module.default !== void 0) contract = module.default;
|
|
155
|
+
else if (module.contract !== void 0) contract = module.contract;
|
|
156
|
+
else throw new CliStructuredError("CONTRACT.MODULE_EXPORT_MISSING", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(", ") || "none"}`, { where: { path: entryPath } });
|
|
157
|
+
if (typeof contract !== "object" || contract === null) throw contractSourceError("CONTRACT.EXPORT_INVALID", `Contract export must be an object, got ${typeof contract}`, { meta: {
|
|
158
|
+
path: entryPath,
|
|
159
|
+
reason: "not-object"
|
|
160
|
+
} });
|
|
161
|
+
validatePurity(contract, entryPath);
|
|
162
|
+
return contract;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
try {
|
|
165
|
+
if (tempFile) unlinkSync(tempFile);
|
|
166
|
+
} catch {}
|
|
167
|
+
if (error instanceof Error) throw error;
|
|
168
|
+
throw contractSourceError("CONTRACT.SOURCE_LOAD_FAILED", `Failed to load contract from ${entryPath}: ${String(error)}`, {
|
|
169
|
+
meta: {
|
|
170
|
+
path: entryPath,
|
|
171
|
+
stage: "import"
|
|
172
|
+
},
|
|
173
|
+
cause: error
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
//#endregion
|
|
178
|
+
export { createContractEmitCommand, createFormatCommand, loadContractFromTs };
|
|
179
|
+
|
|
180
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.mjs"],"sourcesContent":["import { t as createContractEmitCommand } from \"../contract-emit-0hSjbuxp.mjs\";\nimport { t as createFormatCommand } from \"../format-ByDm2goZ.mjs\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { join, resolve } from \"pathe\";\nimport { existsSync, unlinkSync, writeFileSync } from \"node:fs\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { tmpdir } from \"node:os\";\nimport { pathToFileURL } from \"node:url\";\nimport { build } from \"esbuild\";\n//#region src/load-ts-contract.ts\nfunction contractSourceError(code, message, options) {\n\tconst error = new CliStructuredError(code, message, options?.meta !== void 0 ? { meta: options.meta } : void 0);\n\tif (options?.cause !== void 0) error.cause = options.cause;\n\treturn error;\n}\nconst DEFAULT_ALLOWLIST = [\n\t\"@internal/*\",\n\t\"@prisma/orm-*\",\n\t\"node:crypto\"\n];\nfunction isAllowedImport(importPath, allowlist) {\n\tfor (const pattern of allowlist) if (pattern.endsWith(\"/*\")) {\n\t\tconst prefix = pattern.slice(0, -2);\n\t\tif (importPath === prefix || importPath.startsWith(`${prefix}/`)) return true;\n\t} else if (pattern.endsWith(\"*\")) {\n\t\tconst prefix = pattern.slice(0, -1);\n\t\tif (importPath.startsWith(prefix)) return true;\n\t} else if (importPath === pattern) return true;\n\treturn false;\n}\nfunction validatePurity(value, entryPath) {\n\tif (typeof value !== \"object\" || value === null) return;\n\tconst path = /* @__PURE__ */ new WeakSet();\n\tfunction check(value) {\n\t\tif (value === null || typeof value !== \"object\") return;\n\t\tif (path.has(value)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export contains circular references\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"circular\"\n\t\t} });\n\t\tpath.add(value);\n\t\ttry {\n\t\t\tfor (const key in value) {\n\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(value, key);\n\t\t\t\tif (descriptor && (descriptor.get || descriptor.set)) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains getter/setter at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"getter\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tif (descriptor && typeof descriptor.value === \"function\") throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export contains function at key \"${key}\"`, { meta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"function\",\n\t\t\t\t\tkey\n\t\t\t\t} });\n\t\t\t\tcheck(value[key]);\n\t\t\t}\n\t\t} finally {\n\t\t\tpath.delete(value);\n\t\t}\n\t}\n\ttry {\n\t\tcheck(value);\n\t\tJSON.stringify(value);\n\t} catch (error) {\n\t\tif (error instanceof Error) {\n\t\t\tif (error.message.includes(\"getter\") || error.message.includes(\"circular\")) throw error;\n\t\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export is not JSON-serializable: ${error.message}`, {\n\t\t\t\tmeta: {\n\t\t\t\t\tpath: entryPath,\n\t\t\t\t\treason: \"not-json-serializable\"\n\t\t\t\t},\n\t\t\t\tcause: error\n\t\t\t});\n\t\t}\n\t\tthrow contractSourceError(\"CONTRACT.EXPORT_INVALID\", \"Contract export is not JSON-serializable\", { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-json-serializable\"\n\t\t} });\n\t}\n}\nfunction createImportAllowlistPlugin(allowlist, entryPath, collected) {\n\tconst entryAbs = resolve(entryPath);\n\tfunction isFromEntry(importer) {\n\t\treturn importer === entryAbs || importer === entryPath || importer === \"<stdin>\";\n\t}\n\treturn {\n\t\tname: \"import-allowlist\",\n\t\tsetup(build) {\n\t\t\tbuild.onResolve({ filter: /.*/ }, (args) => {\n\t\t\t\tif (args.kind === \"entry-point\") return;\n\t\t\t\tif (args.path.startsWith(\".\") || args.path.startsWith(\"/\")) return;\n\t\t\t\tif (isFromEntry(args.importer) && !isAllowedImport(args.path, allowlist)) {\n\t\t\t\t\tcollected.add(args.path);\n\t\t\t\t\treturn {\n\t\t\t\t\t\tpath: args.path,\n\t\t\t\t\t\texternal: true\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t};\n}\n/**\n* Loads a contract from a TypeScript file and returns it as Contract.\n*\n* **Responsibility: Parsing Only**\n* This function loads and parses a TypeScript contract file. It does NOT normalize the contract.\n* The contract should already be normalized if it was built using the contract builder.\n*\n* Normalization must happen in the contract builder when the contract is created.\n* This function only validates that the contract is JSON-serializable and returns it as-is.\n*\n* @param entryPath - Path to the TypeScript contract file\n* @param options - Optional configuration (import allowlist)\n* @returns The contract as Contract (should already be normalized)\n* @throws structured errors: `CLI.FILE_NOT_FOUND`, `CONTRACT.SOURCE_LOAD_FAILED`,\n* `CONTRACT.SOURCE_IMPORT_DISALLOWED`, `CONTRACT.MODULE_EXPORT_MISSING`, `CONTRACT.EXPORT_INVALID`\n*/\nasync function loadContractFromTs(entryPath, options) {\n\tconst allowlist = options?.allowlist ?? DEFAULT_ALLOWLIST;\n\tif (!existsSync(entryPath)) throw new CliStructuredError(\"CLI.FILE_NOT_FOUND\", `Contract file not found: ${entryPath}`, { where: { path: entryPath } });\n\tconst tempFile = join(tmpdir(), `prisma-next-contract-${Date.now()}-${Math.random().toString(36).slice(2)}.mjs`);\n\tconst disallowedFromEntry = /* @__PURE__ */ new Set();\n\ttry {\n\t\tconst result = await build({\n\t\t\tentryPoints: [entryPath],\n\t\t\tbundle: true,\n\t\t\tformat: \"esm\",\n\t\t\tplatform: \"node\",\n\t\t\ttarget: \"es2022\",\n\t\t\toutfile: tempFile,\n\t\t\twrite: false,\n\t\t\tmetafile: true,\n\t\t\tplugins: [createImportAllowlistPlugin(allowlist, entryPath, disallowedFromEntry)],\n\t\t\tlogLevel: \"error\"\n\t\t});\n\t\tif (result.errors.length > 0) throw contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to bundle contract file: ${result.errors.map((e) => e.text).join(\"\\n\")}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\tstage: \"bundle\"\n\t\t} });\n\t\tif (!result.outputFiles || result.outputFiles.length === 0) throw new InternalError(\"No output files generated from bundling\");\n\t\tif (disallowedFromEntry.size > 0) throw contractSourceError(\"CONTRACT.SOURCE_IMPORT_DISALLOWED\", `Disallowed imports detected. Only imports matching the allowlist are permitted:\\n Allowlist: ${allowlist.join(\", \")}\\n Disallowed imports: ${[...disallowedFromEntry].join(\", \")}`, { meta: {\n\t\t\tallowlist: [...allowlist],\n\t\t\tdisallowed: [...disallowedFromEntry]\n\t\t} });\n\t\tconst bundleContent = result.outputFiles[0]?.text;\n\t\tif (bundleContent === void 0) throw new InternalError(\"Bundle content is undefined\");\n\t\twriteFileSync(tempFile, bundleContent, \"utf-8\");\n\t\tconst module = await import(\n\t\t\t/* @vite-ignore */\n\t\t\tpathToFileURL(tempFile).href\n);\n\t\tunlinkSync(tempFile);\n\t\tlet contract;\n\t\tif (module.default !== void 0) contract = module.default;\n\t\telse if (module.contract !== void 0) contract = module.contract;\n\t\telse throw new CliStructuredError(\"CONTRACT.MODULE_EXPORT_MISSING\", `Contract file must export a contract as default export or named export 'contract'. Found exports: ${Object.keys(module).join(\", \") || \"none\"}`, { where: { path: entryPath } });\n\t\tif (typeof contract !== \"object\" || contract === null) throw contractSourceError(\"CONTRACT.EXPORT_INVALID\", `Contract export must be an object, got ${typeof contract}`, { meta: {\n\t\t\tpath: entryPath,\n\t\t\treason: \"not-object\"\n\t\t} });\n\t\tvalidatePurity(contract, entryPath);\n\t\treturn contract;\n\t} catch (error) {\n\t\ttry {\n\t\t\tif (tempFile) unlinkSync(tempFile);\n\t\t} catch {}\n\t\tif (error instanceof Error) throw error;\n\t\tthrow contractSourceError(\"CONTRACT.SOURCE_LOAD_FAILED\", `Failed to load contract from ${entryPath}: ${String(error)}`, {\n\t\t\tmeta: {\n\t\t\t\tpath: entryPath,\n\t\t\t\tstage: \"import\"\n\t\t\t},\n\t\t\tcause: error\n\t\t});\n\t}\n}\n//#endregion\nexport { createContractEmitCommand, createFormatCommand, loadContractFromTs };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":"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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/contract-infer.d.mts
|
|
3
|
+
//#region src/commands/contract-infer.d.ts
|
|
4
|
+
declare function createContractInferCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createContractInferCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__contract-infer.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__contract-infer.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/contract-infer.d.mts"],"mappings":";;;iBAEiB,8BAA8B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/db-init.d.mts
|
|
3
|
+
//#region src/commands/db-init.d.ts
|
|
4
|
+
declare function createDbInitCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createDbInitCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__db-init.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__db-init.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/db-init.d.mts"],"mappings":";;;iBAEiB,uBAAuB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/db-schema.d.mts
|
|
3
|
+
//#region src/commands/db-schema.d.ts
|
|
4
|
+
declare function createDbSchemaCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createDbSchemaCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__db-schema.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__db-schema.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/db-schema.d.mts"],"mappings":";;;iBAEiB,yBAAyB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/db-sign.d.mts
|
|
3
|
+
//#region src/commands/db-sign.d.ts
|
|
4
|
+
declare function createDbSignCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createDbSignCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__db-sign.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__db-sign.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/db-sign.d.mts"],"mappings":";;;iBAEiB,uBAAuB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/db-update.d.mts
|
|
3
|
+
//#region src/commands/db-update.d.ts
|
|
4
|
+
declare function createDbUpdateCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createDbUpdateCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__db-update.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__db-update.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/db-update.d.mts"],"mappings":";;;iBAEiB,yBAAyB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/db-verify.d.mts
|
|
3
|
+
//#region src/commands/db-verify.d.ts
|
|
4
|
+
declare function createDbVerifyCommand(): Command;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { createDbVerifyCommand };
|
|
7
|
+
//# sourceMappingURL=cli__commands__db-verify.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__db-verify.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/db-verify.d.mts"],"mappings":";;;iBAEiB,yBAAyB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { D as MigratePathDecision, k as PerSpaceExecutionEntry } from "./types-DZWEs4si-D8UlyJI0.mjs";
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/migrate.d.mts
|
|
4
|
+
//#region src/commands/migrate.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* One migration that will run in a `migrate --show` preview, in execution order.
|
|
7
|
+
*/
|
|
8
|
+
interface MigrateShowMigration {
|
|
9
|
+
readonly spaceId: string;
|
|
10
|
+
readonly dirName: string;
|
|
11
|
+
readonly migrationHash: string;
|
|
12
|
+
readonly from: string;
|
|
13
|
+
readonly to: string;
|
|
14
|
+
}
|
|
15
|
+
/** Result returned by `migrate --show`. Read-only; no writes performed. */
|
|
16
|
+
interface MigrateShowResult {
|
|
17
|
+
readonly ok: true;
|
|
18
|
+
readonly migrations: readonly MigrateShowMigration[];
|
|
19
|
+
readonly summary: string;
|
|
20
|
+
/**
|
|
21
|
+
* Pre-rendered Tier-3 graph tree for human output. Off-path migrations render
|
|
22
|
+
* dim; on-path migrations render in ordinary colours. Only present in human
|
|
23
|
+
* (non-JSON) mode.
|
|
24
|
+
*/
|
|
25
|
+
readonly graphOutput?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Name column width for the "Will run, in order:" list — globally aligned with
|
|
28
|
+
* every graph-tree section. Only present in human (non-JSON) mode.
|
|
29
|
+
*/
|
|
30
|
+
readonly runListDirNameWidth?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Left-pad offset (number of blank spaces) matching the graph's data-column
|
|
33
|
+
* offset (`globalMaxEdgeTreePrefixWidth`). Used to align list rows with graph
|
|
34
|
+
* rows so every `→` in the output (graph + list) lands at the same column.
|
|
35
|
+
* Only present in human (non-JSON) mode when multiple spaces are rendered.
|
|
36
|
+
*/
|
|
37
|
+
readonly runListLeftPad?: number;
|
|
38
|
+
}
|
|
39
|
+
interface MigrateResult {
|
|
40
|
+
readonly ok: boolean;
|
|
41
|
+
readonly migrationsApplied: number;
|
|
42
|
+
readonly migrationsTotal: number;
|
|
43
|
+
readonly markerHash: string;
|
|
44
|
+
readonly applied: readonly {
|
|
45
|
+
readonly spaceId: string;
|
|
46
|
+
readonly dirName: string;
|
|
47
|
+
readonly migrationHash: string;
|
|
48
|
+
readonly from: string;
|
|
49
|
+
readonly to: string;
|
|
50
|
+
readonly operationsExecuted: number;
|
|
51
|
+
}[];
|
|
52
|
+
readonly summary: string;
|
|
53
|
+
readonly perSpace: readonly PerSpaceExecutionEntry[];
|
|
54
|
+
readonly pathDecision?: MigratePathDecision;
|
|
55
|
+
readonly timings: {
|
|
56
|
+
readonly total: number;
|
|
57
|
+
};
|
|
58
|
+
readonly advancedRef?: {
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly hash: string;
|
|
61
|
+
} | null;
|
|
62
|
+
}
|
|
63
|
+
declare function createMigrateCommand(): Command;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { MigrateResult, MigrateShowMigration, MigrateShowResult, createMigrateCommand };
|
|
66
|
+
//# sourceMappingURL=cli__commands__migrate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__migrate.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migrate.d.mts"],"mappings":";;;;;;;UAMU;WACC;WACA;WACA;WACA;WACA;;;UAGD;WACC;WACA,qBAAqB;WACrB;;;;;;WAMA;;;;;WAKA;;;;;;;WAOA;;UAED;WACC;WACA;WACA;WACA;WACA;aACE;aACA;aACA;aACA;aACA;aACA;;WAEF;WACA,mBAAmB;WACnB,eAAe;WACf;aACE;;WAEF;aACE;aACA;;;iBAGI,wBAAwB"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { i as Refs } from "./refs-BNCUu58Y-BIso5Jfg.mjs";
|
|
2
|
+
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
3
|
+
import { t as CliStructuredError$1 } from "./types-DZWEs4si-D8UlyJI0.mjs";
|
|
4
|
+
import { f as migrationCheckResultSchema, n as MigrationCheckResult, t as CheckFailure } from "./schemas-CfGSxH5b-BSjB3nZS.mjs";
|
|
5
|
+
import { n as OnDiskMigrationPackage } from "./package-CfWiDNrr-ZR4HM_Iz.mjs";
|
|
6
|
+
import { c as ContractSpaceAggregate } from "./aggregate-BflrjWPO.mjs";
|
|
7
|
+
import "./package-N9PPdFV_.mjs";
|
|
8
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
9
|
+
import { Command } from "commander";
|
|
10
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/migration-check.d.mts
|
|
11
|
+
//#region src/commands/migration-check.d.ts
|
|
12
|
+
/**
|
|
13
|
+
* One contract space's on-disk state, resolved for the explicit graph
|
|
14
|
+
* checks `runMigrationCheck` runs per space: the space's migration
|
|
15
|
+
* packages, its user-authored refs, its induced graph, and the absolute
|
|
16
|
+
* `migrations/<space>/` + `migrations/<space>/refs/` directories the
|
|
17
|
+
* file-existence and dangling-ref `where` paths are derived from.
|
|
18
|
+
*/
|
|
19
|
+
interface CheckSpace {
|
|
20
|
+
readonly spaceId: string;
|
|
21
|
+
readonly packages: readonly OnDiskMigrationPackage[];
|
|
22
|
+
readonly refs: Refs;
|
|
23
|
+
readonly graph: MigrationGraph;
|
|
24
|
+
readonly migrationsDir: string;
|
|
25
|
+
readonly refsDir: string;
|
|
26
|
+
/** Migrations root the contract-snapshot store lives under — shared by every space. */
|
|
27
|
+
readonly projectMigrationsDir: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Project the loaded {@link ContractSpaceAggregate} into the
|
|
31
|
+
* {@link CheckSpace} rows the multi-space check iterates — one per on-disk
|
|
32
|
+
* contract-space directory, in the aggregate's `app`-first ordering. Mirrors
|
|
33
|
+
* `migration list`'s `migrationSpaceListEntriesFromAggregate`: space
|
|
34
|
+
* membership matches the on-disk directories, package / ref / graph data come
|
|
35
|
+
* from `aggregate.space(id)`.
|
|
36
|
+
*/
|
|
37
|
+
declare function enumerateCheckSpaces(aggregate: ContractSpaceAggregate, projectMigrationsDir: string): Promise<readonly CheckSpace[]>;
|
|
38
|
+
/**
|
|
39
|
+
* Inputs for {@link runMigrationCheck} — the multi-space policy core of
|
|
40
|
+
* the holistic (no-arg) `migration check`. Enumeration is supplied by the
|
|
41
|
+
* caller (the CLI shell builds it from {@link enumerateCheckSpaces}); the
|
|
42
|
+
* core does not touch config, flags, or streams.
|
|
43
|
+
*/
|
|
44
|
+
interface RunMigrationCheckInputs {
|
|
45
|
+
readonly spaces: readonly CheckSpace[];
|
|
46
|
+
readonly spaceFilter?: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Policy core of the holistic `migration check`: validates `--space`,
|
|
50
|
+
* narrows the pre-enumerated spaces, and runs the per-space explicit graph
|
|
51
|
+
* checks (file-existence, snapshot consistency, reachability, dangling
|
|
52
|
+
* refs), aggregating every failure into one {@link MigrationCheckResult}.
|
|
53
|
+
*
|
|
54
|
+
* `--space` validation mirrors `migration list`: an invalid id →
|
|
55
|
+
* {@link errorInvalidSpaceId}; an id with no on-disk space →
|
|
56
|
+
* {@link errorSpaceNotFound}. Both map to exit `PRECONDITION` at the shell.
|
|
57
|
+
* Aggregate-integrity violations (which already span every space) are folded
|
|
58
|
+
* in by the caller, not here.
|
|
59
|
+
*/
|
|
60
|
+
declare function runMigrationCheck(inputs: RunMigrationCheckInputs): Promise<Result<MigrationCheckResult, CliStructuredError$1>>;
|
|
61
|
+
declare function createMigrationCheckCommand(): Command;
|
|
62
|
+
//#endregion
|
|
63
|
+
export { type CheckFailure, CheckSpace, type MigrationCheckResult, RunMigrationCheckInputs, createMigrationCheckCommand, enumerateCheckSpaces, migrationCheckResultSchema, runMigrationCheck };
|
|
64
|
+
//# sourceMappingURL=cli__commands__migration-check.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__migration-check.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migration-check.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;UAgBU;WACC;WACA,mBAAmB;WACnB,MAAM;WACN,OAAO;WACP;WACA;;WAEA;;;;;;;;;;iBAUM,qBAAqB,WAAW,wBAAwB,+BAA+B,iBAAiB;;;;;;;UAO/G;WACC,iBAAiB;WACjB;;;;;;;;;;;;;;iBAcM,kBAAkB,QAAQ,0BAA0B,QAAQ,OAAO,sBAAsB;iBACzF,+BAA+B"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { t as migrationCheckResultSchema } from "./schemas-KhXMzNA_-CzZ7GFX_.mjs";
|
|
2
|
+
import { n as enumerateCheckSpaces, r as runMigrationCheck, t as createMigrationCheckCommand } from "./migration-check-DcwUnadt-B6Qoh0ot.mjs";
|
|
3
|
+
export { createMigrationCheckCommand, enumerateCheckSpaces, migrationCheckResultSchema, runMigrationCheck };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
2
|
+
import { t as CliStructuredError$1 } from "./types-DZWEs4si-D8UlyJI0.mjs";
|
|
3
|
+
import { o as MigrationSpaceGraphEntry } from "./schemas-CfGSxH5b-BSjB3nZS.mjs";
|
|
4
|
+
import { n as GlobalFlags, t as CommonCommandOptions } from "./global-flags-BpoOYtNZ-CHZD3fud.mjs";
|
|
5
|
+
import { n as TerminalUI } from "./terminal-ui-BN4QOsm5-Bf3pim46.mjs";
|
|
6
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/migration-graph.d.mts
|
|
9
|
+
//#region src/commands/migration-graph.d.ts
|
|
10
|
+
interface MigrationGraphOptions extends CommonCommandOptions {
|
|
11
|
+
readonly config?: string;
|
|
12
|
+
readonly dot?: boolean;
|
|
13
|
+
readonly space?: string;
|
|
14
|
+
readonly ascii?: boolean;
|
|
15
|
+
readonly legend?: boolean;
|
|
16
|
+
}
|
|
17
|
+
interface MigrationGraphTreeSection {
|
|
18
|
+
readonly space: string;
|
|
19
|
+
readonly tree: string;
|
|
20
|
+
readonly showHeading: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface MigrationGraphResult {
|
|
23
|
+
readonly ok: true;
|
|
24
|
+
/** App-space graph for the `--dot` Graphviz output. */
|
|
25
|
+
readonly graph: MigrationGraph;
|
|
26
|
+
/** Nested per-space contracts + migrations for `--json`. */
|
|
27
|
+
readonly spaces: readonly MigrationSpaceGraphEntry[];
|
|
28
|
+
readonly treeSections: readonly MigrationGraphTreeSection[];
|
|
29
|
+
readonly summary: string;
|
|
30
|
+
}
|
|
31
|
+
declare function formatMigrationGraphHumanOutput(result: MigrationGraphResult): string;
|
|
32
|
+
declare function executeMigrationGraphCommand(options: MigrationGraphOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<MigrationGraphResult, CliStructuredError$1>>;
|
|
33
|
+
declare function createMigrationGraphCommand(): Command;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { MigrationGraphResult, MigrationGraphTreeSection, createMigrationGraphCommand, executeMigrationGraphCommand, formatMigrationGraphHumanOutput };
|
|
36
|
+
//# sourceMappingURL=cli__commands__migration-graph.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__migration-graph.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migration-graph.d.mts"],"mappings":";;;;;;;;;UAQU,8BAA8B;WAC7B;WACA;WACA;WACA;WACA;;UAED;WACC;WACA;WACA;;UAED;WACC;;WAEA,OAAO;;WAEP,iBAAiB;WACjB,uBAAuB;WACvB;;iBAEM,gCAAgC,QAAQ;iBACxC,6BAA6B,SAAS,uBAAuB,OAAO,aAAa,IAAI,aAAa,QAAQ,OAAO,sBAAsB;iBACvI,+BAA+B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
2
|
+
import { t as CliStructuredError$1 } from "./types-DZWEs4si-D8UlyJI0.mjs";
|
|
3
|
+
import { r as MigrationListResult, s as MigrationSpaceListEntry } from "./schemas-CfGSxH5b-BSjB3nZS.mjs";
|
|
4
|
+
import { c as ContractSpaceAggregate, t as AggregateContractSpace } from "./aggregate-BflrjWPO.mjs";
|
|
5
|
+
import { n as GlobalFlags, t as CommonCommandOptions } from "./global-flags-BpoOYtNZ-CHZD3fud.mjs";
|
|
6
|
+
import { n as TerminalUI, t as GlyphMode } from "./terminal-ui-BN4QOsm5-Bf3pim46.mjs";
|
|
7
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
8
|
+
import { Command } from "commander";
|
|
9
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/migration-list.d.mts
|
|
10
|
+
//#region src/commands/migration-list.d.ts
|
|
11
|
+
/**
|
|
12
|
+
* Ref names decorating a space's destination contract hashes. The
|
|
13
|
+
* tolerant `space.refs` deliberately omits the structural `head.json`;
|
|
14
|
+
* for extension spaces the old enumerator surfaced it as a `head`
|
|
15
|
+
* decoration on the tip migration, so fold `space.headRef` back in to
|
|
16
|
+
* keep that output. The app space synthesises its head, so it carries
|
|
17
|
+
* no on-disk `head` ref to restore.
|
|
18
|
+
*/
|
|
19
|
+
declare function listRefsByContractHash(space: AggregateContractSpace): ReadonlyMap<string, readonly string[]>;
|
|
20
|
+
/**
|
|
21
|
+
* Project the loaded {@link ContractSpaceAggregate} into the render-ready
|
|
22
|
+
* {@link MigrationSpaceListEntry} rows `migration list` displays.
|
|
23
|
+
*
|
|
24
|
+
* Space membership matches the on-disk contract-space directories (not the
|
|
25
|
+
* aggregate's always-present synthesized app space when `migrations/app/`
|
|
26
|
+
* is absent); package and ref data come from `aggregate.space(id)`.
|
|
27
|
+
*/
|
|
28
|
+
declare function migrationSpaceListEntriesFromAggregate(aggregate: ContractSpaceAggregate, projectMigrationsDir: string): Promise<readonly MigrationSpaceListEntry[]>;
|
|
29
|
+
interface MigrationListOptions extends CommonCommandOptions {
|
|
30
|
+
readonly config?: string;
|
|
31
|
+
readonly space?: string;
|
|
32
|
+
readonly ascii?: boolean;
|
|
33
|
+
readonly legend?: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface MigrationListExecuteResult {
|
|
36
|
+
readonly list: MigrationListResult;
|
|
37
|
+
readonly liveContractHash: string;
|
|
38
|
+
readonly aggregate: ContractSpaceAggregate;
|
|
39
|
+
}
|
|
40
|
+
interface MigrationListHumanRenderOptions {
|
|
41
|
+
readonly glyphMode: GlyphMode;
|
|
42
|
+
readonly useColor: boolean;
|
|
43
|
+
readonly liveContractHash: string;
|
|
44
|
+
readonly graphForSpace: (spaceId: string) => MigrationGraph | undefined;
|
|
45
|
+
readonly appSpaceId?: string;
|
|
46
|
+
}
|
|
47
|
+
declare function renderMigrationListHumanOutput(result: MigrationListResult, options: MigrationListHumanRenderOptions): string;
|
|
48
|
+
/**
|
|
49
|
+
* Inputs for {@link runMigrationList} — the policy core of `migration list`
|
|
50
|
+
* that tests exercise directly.
|
|
51
|
+
*
|
|
52
|
+
* The core does not call `loadConfig`, parse CLI flags, render a styled
|
|
53
|
+
* header, or write to any stream. Enumeration is supplied by the caller
|
|
54
|
+
* (the CLI shell builds it from {@link migrationSpaceListEntriesFromAggregate}).
|
|
55
|
+
*/
|
|
56
|
+
interface RunMigrationListInputs {
|
|
57
|
+
readonly spaces: readonly MigrationSpaceListEntry[];
|
|
58
|
+
readonly spaceFilter?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Policy core of `migration list`: validates `--space`, narrows the
|
|
62
|
+
* pre-enumerated spaces, and assembles a {@link MigrationListResult}.
|
|
63
|
+
*
|
|
64
|
+
* - `migrations/` missing or contains no valid space directories →
|
|
65
|
+
* caller passes `spaces: []`; this synthesizes `[{ spaceId: APP_SPACE_ID, migrations: [] }]`.
|
|
66
|
+
* - `--space <id>` on an existing-but-empty space → `{ spaceId, migrations: [] }` in the input.
|
|
67
|
+
* - `--space <id>` on a non-existent (or reserved) space → `SPACE_NOT_FOUND`.
|
|
68
|
+
*/
|
|
69
|
+
declare function runMigrationList(inputs: RunMigrationListInputs): Result<MigrationListResult, CliStructuredError$1>;
|
|
70
|
+
/**
|
|
71
|
+
* CLI shell: loads config, resolves paths, prints the styled header on
|
|
72
|
+
* stderr (interactive mode only), and delegates to {@link runMigrationList}.
|
|
73
|
+
* Kept intentionally thin so the unit-testable surface lives in the core.
|
|
74
|
+
*/
|
|
75
|
+
declare function executeMigrationListCommand(options: MigrationListOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<MigrationListExecuteResult, CliStructuredError$1>>;
|
|
76
|
+
declare function createMigrationListCommand(): Command;
|
|
77
|
+
//#endregion
|
|
78
|
+
export { MigrationListExecuteResult, MigrationListHumanRenderOptions, RunMigrationListInputs, createMigrationListCommand, executeMigrationListCommand, listRefsByContractHash, migrationSpaceListEntriesFromAggregate, renderMigrationListHumanOutput, runMigrationList };
|
|
79
|
+
//# sourceMappingURL=cli__commands__migration-list.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__migration-list.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migration-list.d.mts"],"mappings":";;;;;;;;;;;;;;;;;;iBAiBiB,uBAAuB,OAAO,yBAAyB;;;;;;;;;iBASvD,uCAAuC,WAAW,wBAAwB,+BAA+B,iBAAiB;UACjI,6BAA6B;WAC5B;WACA;WACA;WACA;;UAED;WACC,MAAM;WACN;WACA,WAAW;;UAEZ;WACC,WAAW;WACX;WACA;WACA,gBAAgB,oBAAoB;WACpC;;iBAEM,+BAA+B,QAAQ,qBAAqB,SAAS;;;;;;;;;UAS5E;WACC,iBAAiB;WACjB;;;;;;;;;;;iBAWM,iBAAiB,QAAQ,yBAAyB,OAAO,qBAAqB;;;;;;iBAM9E,4BAA4B,SAAS,sBAAsB,OAAO,aAAa,IAAI,aAAa,QAAQ,OAAO,4BAA4B;iBAC3I,8BAA8B"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as renderMigrationListHumanOutput, i as migrationSpaceListEntriesFromAggregate, n as executeMigrationListCommand, o as runMigrationList, r as listRefsByContractHash, t as createMigrationListCommand } from "./migration-list-BFBeo1_X-c0kqYokL.mjs";
|
|
2
|
+
export { createMigrationListCommand, executeMigrationListCommand, listRefsByContractHash, migrationSpaceListEntriesFromAggregate, renderMigrationListHumanOutput, runMigrationList };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { t as CliStructuredError$1 } from "./types-DZWEs4si-D8UlyJI0.mjs";
|
|
2
|
+
import { i as MigrationLogResult } from "./schemas-CfGSxH5b-BSjB3nZS.mjs";
|
|
3
|
+
import { n as GlobalFlags, t as CommonCommandOptions } from "./global-flags-BpoOYtNZ-CHZD3fud.mjs";
|
|
4
|
+
import { n as TerminalUI } from "./terminal-ui-BN4QOsm5-Bf3pim46.mjs";
|
|
5
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
6
|
+
import { Command } from "commander";
|
|
7
|
+
import { LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
|
|
8
|
+
//#region ../../../1-framework/3-tooling/cli/dist/commands/migration-log.d.mts
|
|
9
|
+
//#region src/commands/migration-log.d.ts
|
|
10
|
+
interface MigrationLogOptions extends CommonCommandOptions {
|
|
11
|
+
readonly db?: string;
|
|
12
|
+
readonly config?: string;
|
|
13
|
+
readonly utc?: boolean;
|
|
14
|
+
readonly ascii?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare function executeMigrationLogCommand(options: MigrationLogOptions, flags: GlobalFlags, ui: TerminalUI): Promise<Result<readonly LedgerEntryRecord[], CliStructuredError$1>>;
|
|
17
|
+
declare function createMigrationLogCommand(): Command;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { type MigrationLogResult, createMigrationLogCommand, executeMigrationLogCommand };
|
|
20
|
+
//# sourceMappingURL=cli__commands__migration-log.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli__commands__migration-log.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/commands/migration-log.d.mts"],"mappings":";;;;;;;;;UAQU,4BAA4B;WAC3B;WACA;WACA;WACA;;iBAEM,2BAA2B,SAAS,qBAAqB,OAAO,aAAa,IAAI,aAAa,QAAQ,gBAAgB,qBAAqB;iBAC3I,6BAA6B"}
|