@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
|
@@ -0,0 +1,803 @@
|
|
|
1
|
+
import { i as Refs, r as RefLoadProblem } from "./refs-BNCUu58Y-BIso5Jfg.mjs";
|
|
2
|
+
import { n as MigrationGraph } from "./graph-bDjJ4GL9-BhFevsJS.mjs";
|
|
3
|
+
import { n as OnDiskMigrationPackage } from "./package-CfWiDNrr-ZR4HM_Iz.mjs";
|
|
4
|
+
import { t as ContractSpaceHeadRecord } from "./verify-contract-spaces-Cc1u_wJo-BilPJS2S.mjs";
|
|
5
|
+
import { t as PackageLoadProblem } from "./io-sr4CO9_t-C3eV_kn-.mjs";
|
|
6
|
+
import { t as PathDecision } from "./migration-graph-tarTxJ99-BrGBANeE.mjs";
|
|
7
|
+
import { Result } from "@prisma/orm-framework/utils/result";
|
|
8
|
+
import { ControlAdapterInstance, ControlFamilyInstance, DiffSubjectGranularity, MigrationOperationPolicy, MigrationPlan, MigrationPlanOperation, MigrationPlannerConflict, SchemaDiffIssue, SchemaEntityCoordinate, SchemaOwnership, TargetMigrationsCapability, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
|
|
9
|
+
import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
|
|
10
|
+
import { Contract, StorageNamespace } from "@prisma/orm-framework/contract/types";
|
|
11
|
+
//#region ../../../1-framework/3-tooling/migration/dist/exports/aggregate.d.mts
|
|
12
|
+
//#region src/integrity-violation.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* Every structural problem the migration model can carry.
|
|
15
|
+
*
|
|
16
|
+
* Violations come in three groups:
|
|
17
|
+
*
|
|
18
|
+
* - **Recoverable**: the package or space is retained in the model;
|
|
19
|
+
* the violation is surfaced for policy (report, refuse, or ignore
|
|
20
|
+
* depending on the command).
|
|
21
|
+
* - **Config/contract-dependent**: produced only when the matching
|
|
22
|
+
* `IntegrityQueryOptions` opt is set (declaredExtensions /
|
|
23
|
+
* checkContracts). The model is built without them; they surface
|
|
24
|
+
* when the caller explicitly asks for the broader integrity view.
|
|
25
|
+
* - **Unloadable**: the package is omitted from the model entirely
|
|
26
|
+
* (its on-disk content cannot be parsed into an `OnDiskMigrationPackage`).
|
|
27
|
+
*
|
|
28
|
+
* `checkIntegrity()` on `ContractSpaceAggregate` returns the full set —
|
|
29
|
+
* all violations across all spaces — never bailing at the first hit.
|
|
30
|
+
*/
|
|
31
|
+
type IntegrityViolation = {
|
|
32
|
+
readonly kind: 'sameSourceAndTarget';
|
|
33
|
+
readonly spaceId: string;
|
|
34
|
+
readonly dirName: string;
|
|
35
|
+
readonly hash: string;
|
|
36
|
+
} | {
|
|
37
|
+
readonly kind: 'hashMismatch';
|
|
38
|
+
readonly spaceId: string;
|
|
39
|
+
readonly dirName: string;
|
|
40
|
+
readonly stored: string;
|
|
41
|
+
readonly computed: string;
|
|
42
|
+
} | {
|
|
43
|
+
readonly kind: 'providedInvariantsMismatch';
|
|
44
|
+
readonly spaceId: string;
|
|
45
|
+
readonly dirName: string;
|
|
46
|
+
} | {
|
|
47
|
+
readonly kind: 'headRefMissing';
|
|
48
|
+
readonly spaceId: string;
|
|
49
|
+
} | {
|
|
50
|
+
readonly kind: 'headRefNotInGraph';
|
|
51
|
+
readonly spaceId: string;
|
|
52
|
+
readonly hash: string;
|
|
53
|
+
} | {
|
|
54
|
+
readonly kind: 'duplicateMigrationHash';
|
|
55
|
+
readonly spaceId: string;
|
|
56
|
+
readonly migrationHash: string;
|
|
57
|
+
readonly dirNames: readonly string[];
|
|
58
|
+
} | {
|
|
59
|
+
readonly kind: 'refUnreadable';
|
|
60
|
+
readonly spaceId: string;
|
|
61
|
+
readonly refName: string;
|
|
62
|
+
readonly detail: string;
|
|
63
|
+
} | {
|
|
64
|
+
readonly kind: 'orphanSpaceDir';
|
|
65
|
+
readonly spaceId: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly kind: 'declaredButUnmigrated';
|
|
68
|
+
readonly spaceId: string;
|
|
69
|
+
} | {
|
|
70
|
+
readonly kind: 'targetMismatch';
|
|
71
|
+
readonly spaceId: string;
|
|
72
|
+
readonly expected: string;
|
|
73
|
+
readonly actual: string;
|
|
74
|
+
} | {
|
|
75
|
+
readonly kind: 'disjointness';
|
|
76
|
+
readonly element: string;
|
|
77
|
+
readonly claimedBy: readonly string[];
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: 'contractUnreadable';
|
|
80
|
+
readonly spaceId: string;
|
|
81
|
+
readonly detail: string;
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: 'packageUnloadable';
|
|
84
|
+
readonly spaceId: string;
|
|
85
|
+
readonly dirName: string;
|
|
86
|
+
readonly detail: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* One declared extension entry, drawn from `Config.extensions`.
|
|
90
|
+
*
|
|
91
|
+
* The integrity layer needs only:
|
|
92
|
+
*
|
|
93
|
+
* - `id` — the space id (also the directory name under `migrations/`),
|
|
94
|
+
* used for the layout-drift checks (`orphanSpaceDir` /
|
|
95
|
+
* `declaredButUnmigrated`).
|
|
96
|
+
* - `targetId` — the target the declaring extension was configured for.
|
|
97
|
+
*
|
|
98
|
+
* Typed structurally so the migration-tools layer stays framework-neutral.
|
|
99
|
+
*/
|
|
100
|
+
interface DeclaredExtensionEntry {
|
|
101
|
+
readonly id: string;
|
|
102
|
+
readonly targetId: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Options controlling which config/contract-dependent violation checks
|
|
106
|
+
* `checkIntegrity()` runs.
|
|
107
|
+
*
|
|
108
|
+
* Both opts default to disabled: a caller without the app contract or
|
|
109
|
+
* declared extensions still gets the structurally-derivable violations
|
|
110
|
+
* (hashMismatch, providedInvariantsMismatch, headRefMissing,
|
|
111
|
+
* headRefNotInGraph, refUnreadable, sameSourceAndTarget, packageUnloadable).
|
|
112
|
+
*/
|
|
113
|
+
interface IntegrityQueryOptions {
|
|
114
|
+
/**
|
|
115
|
+
* When provided, enables layout-drift checks: `orphanSpaceDir`
|
|
116
|
+
* (a directory exists on disk for an extension not in the list) and
|
|
117
|
+
* `declaredButUnmigrated` (an extension in the list has no on-disk dir).
|
|
118
|
+
*/
|
|
119
|
+
readonly declaredExtensions?: readonly DeclaredExtensionEntry[];
|
|
120
|
+
/**
|
|
121
|
+
* When true, enables contract/disjointness/target checks:
|
|
122
|
+
* `contractUnreadable`, `targetMismatch`, `disjointness`.
|
|
123
|
+
*/
|
|
124
|
+
readonly checkContracts?: boolean;
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
//#region src/aggregate/types.d.ts
|
|
128
|
+
interface ContractAtOptions {
|
|
129
|
+
readonly refName?: string;
|
|
130
|
+
}
|
|
131
|
+
type ContractAtResult = {
|
|
132
|
+
readonly provenance: 'ref';
|
|
133
|
+
readonly hash: string;
|
|
134
|
+
readonly contractJson: unknown;
|
|
135
|
+
readonly contractDts: string;
|
|
136
|
+
readonly contract: Contract;
|
|
137
|
+
} | {
|
|
138
|
+
readonly provenance: 'graph-node';
|
|
139
|
+
readonly hash: string;
|
|
140
|
+
readonly contractJson: unknown;
|
|
141
|
+
readonly contractDts: string;
|
|
142
|
+
readonly contract: Contract;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* One contract space — app or extension — as the aggregate holds it.
|
|
146
|
+
* Every space in a {@link ContractSpaceAggregate} has the same shape.
|
|
147
|
+
*
|
|
148
|
+
* A value of this type is a tolerant snapshot of one space's on-disk state, not a
|
|
149
|
+
* validated value: `packages` is the raw migration-package list as read
|
|
150
|
+
* from disk (a hash- or invariants-mismatched package is retained here;
|
|
151
|
+
* a genuinely unparseable one is omitted), and integrity is judged
|
|
152
|
+
* separately by {@link ContractSpaceAggregate.checkIntegrity}.
|
|
153
|
+
*
|
|
154
|
+
* - `spaceId`: `'app'` for the application, otherwise the extension's
|
|
155
|
+
* id (validated against `[a-z][a-z0-9_-]{0,63}`).
|
|
156
|
+
* - `packages`: raw on-disk migration packages, as read; never
|
|
157
|
+
* integrity-validated at load.
|
|
158
|
+
* - `refs`: the user-authored refs under `migrations/<spaceId>/refs/*.json`.
|
|
159
|
+
* - `headRef`: the system head ref read from
|
|
160
|
+
* `migrations/<spaceId>/refs/head.json`, or `null` when absent
|
|
161
|
+
* (represented as a `headRefMissing` violation, never fatal). The app
|
|
162
|
+
* space's head ref is always synthesised from its live contract's
|
|
163
|
+
* storage hash, so it is never `null`.
|
|
164
|
+
* - `graph()`: the migration graph this space's packages induce —
|
|
165
|
+
* lazily reconstructed on first call and memoised. Pure structure: a
|
|
166
|
+
* `from === to` self-edge is represented, not rejected.
|
|
167
|
+
* - `contract()`: the deserialized contract for this space — lazily
|
|
168
|
+
* produced on first call and memoised. For the app it is the live
|
|
169
|
+
* contract the caller supplied; for an extension it is the contract
|
|
170
|
+
* snapshot store entry keyed by the space's head ref hash, run through
|
|
171
|
+
* the family's `deserializeContract`. Throws if the store entry is
|
|
172
|
+
* missing or undeserializable (surfaced as `contractUnreadable` by
|
|
173
|
+
* `checkIntegrity` under `checkContracts`); callers gate before
|
|
174
|
+
* querying it.
|
|
175
|
+
* - `contractAt(hash, opts?)`: materializes the contract at an arbitrary
|
|
176
|
+
* graph node — when `opts.refName` is set, resolve the ref's pointer
|
|
177
|
+
* and read the contract snapshot store entry keyed by the pointer's
|
|
178
|
+
* hash; else find the package whose `metadata.to === hash` and read
|
|
179
|
+
* the contract snapshot store entry keyed by that hash. Lazy per
|
|
180
|
+
* `(hash, refName?)` memoisation; throws typed {@link MigrationToolsError}
|
|
181
|
+
* values compatible with CLI mappers.
|
|
182
|
+
*/
|
|
183
|
+
interface AggregateContractSpace {
|
|
184
|
+
readonly spaceId: string;
|
|
185
|
+
readonly packages: readonly OnDiskMigrationPackage[];
|
|
186
|
+
readonly refs: Refs;
|
|
187
|
+
readonly headRef: ContractSpaceHeadRecord | null;
|
|
188
|
+
graph(): MigrationGraph;
|
|
189
|
+
contract(): Contract;
|
|
190
|
+
contractAt(hash: string, opts?: ContractAtOptions): Promise<ContractAtResult>;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Tolerant, queryable snapshot of a project's on-disk migration state:
|
|
194
|
+
* the app contract space plus every extension contract space, each a
|
|
195
|
+
* {@link AggregateContractSpace}.
|
|
196
|
+
*
|
|
197
|
+
* Produced once per CLI invocation by `loadContractSpaceAggregate`.
|
|
198
|
+
* Building the aggregate never throws on disk content; every consumer
|
|
199
|
+
* obtains spaces / packages / refs / graphs from this one value rather
|
|
200
|
+
* than re-deriving them from disk.
|
|
201
|
+
*
|
|
202
|
+
* - `targetId`: the app contract's target; every space is expected to
|
|
203
|
+
* share it (a mismatch surfaces as a `targetMismatch` violation under
|
|
204
|
+
* `checkContracts`).
|
|
205
|
+
* - `app` / `extensions`: retained as fields for the existing planner /
|
|
206
|
+
* verifier / runner consumers. `extensions` is sorted alphabetically
|
|
207
|
+
* by `spaceId` (the apply-ordering convention).
|
|
208
|
+
* - `listSpaces()` / `hasSpace()` / `space()` / `spaces()`: the query
|
|
209
|
+
* surface the read commands consume — `app` first, then extension ids
|
|
210
|
+
* lex-ascending.
|
|
211
|
+
* - `declaresEntity(coordinate)` / `declaringSpaces(coordinate)`: ownership
|
|
212
|
+
* queries — does any contract space declare a storage entity at this
|
|
213
|
+
* coordinate (namespace, entity kind, and name), and which spaces do? The verifier's
|
|
214
|
+
* unclaimed-elements pass asks these of the diff's extra findings; the
|
|
215
|
+
* migration planner asks `declaresEntity` per live extra node to decide
|
|
216
|
+
* whether some space owns it (the aggregate satisfies the framework
|
|
217
|
+
* {@link SchemaOwnership} oracle). The passive aggregate answers both; it
|
|
218
|
+
* runs no diff.
|
|
219
|
+
* - `checkIntegrity()`: judges the loaded model and returns every
|
|
220
|
+
* violation (never bailing at the first). Config/contract-dependent
|
|
221
|
+
* checks run only when the matching {@link IntegrityQueryOptions} opt
|
|
222
|
+
* is set.
|
|
223
|
+
*/
|
|
224
|
+
interface ContractSpaceAggregate extends SchemaOwnership {
|
|
225
|
+
readonly targetId: string;
|
|
226
|
+
readonly app: AggregateContractSpace;
|
|
227
|
+
readonly extensions: readonly AggregateContractSpace[];
|
|
228
|
+
listSpaces(): readonly string[];
|
|
229
|
+
hasSpace(id: string): boolean;
|
|
230
|
+
space(id: string): AggregateContractSpace | undefined;
|
|
231
|
+
spaces(): readonly AggregateContractSpace[];
|
|
232
|
+
declaresEntity(coordinate: SchemaEntityCoordinate): boolean;
|
|
233
|
+
declaringSpaces(coordinate: SchemaEntityCoordinate): readonly string[];
|
|
234
|
+
checkIntegrity(opts?: IntegrityQueryOptions): readonly IntegrityViolation[];
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region src/aggregate/aggregate.d.ts
|
|
238
|
+
/**
|
|
239
|
+
* Resolve a contract space's head ref, asserting it is present. The apply/verify
|
|
240
|
+
* engine only runs after `checkIntegrity` has refused on `headRefMissing`,
|
|
241
|
+
* so a space reaching the planner / verifier without a head ref is a
|
|
242
|
+
* programming error (the integrity gate was skipped), not a user-facing
|
|
243
|
+
* state. The app space's head ref is always synthesised, so this only
|
|
244
|
+
* ever guards an ungated extension space.
|
|
245
|
+
*/
|
|
246
|
+
declare function requireHeadRef(space: AggregateContractSpace): ContractSpaceHeadRecord;
|
|
247
|
+
/**
|
|
248
|
+
* Build a {@link AggregateContractSpace} with lazily-memoised `graph()`,
|
|
249
|
+
* `contract()`, and `contractAt()` facets.
|
|
250
|
+
*
|
|
251
|
+
* `graph()` reconstructs the migration graph from `packages` on first
|
|
252
|
+
* call and caches it. `contract()` calls `resolveContract` on first call
|
|
253
|
+
* and caches the result; a throwing `resolveContract` (e.g. a missing or
|
|
254
|
+
* undeserializable on-disk contract) re-throws on each call rather than
|
|
255
|
+
* caching a value — `checkIntegrity` surfaces that as `contractUnreadable`.
|
|
256
|
+
* `contractAt()` materializes the contract at an arbitrary graph node with
|
|
257
|
+
* the same resolution order as plan-time ref resolution: the ref's pointer
|
|
258
|
+
* plus the store entry keyed by the pointer's hash first (when
|
|
259
|
+
* `opts.refName` is set), else the contract snapshot store entry keyed by
|
|
260
|
+
* the matching package's `to` hash.
|
|
261
|
+
*/
|
|
262
|
+
declare function createAggregateContractSpace(args: {
|
|
263
|
+
readonly spaceId: string;
|
|
264
|
+
readonly packages: readonly OnDiskMigrationPackage[];
|
|
265
|
+
readonly refs: Refs;
|
|
266
|
+
readonly headRef: ContractSpaceHeadRecord | null;
|
|
267
|
+
readonly refsDir: string;
|
|
268
|
+
readonly migrationsDir: string;
|
|
269
|
+
readonly resolveContract: () => Contract;
|
|
270
|
+
readonly deserializeContract: (raw: unknown) => Contract;
|
|
271
|
+
}): AggregateContractSpace;
|
|
272
|
+
/**
|
|
273
|
+
* Collect the union of every namespace declared across all contract spaces of an
|
|
274
|
+
* aggregate (app + extensions) and return a minimal object with the shape
|
|
275
|
+
* `{ storage: { namespaces } }` suitable for passing to
|
|
276
|
+
* `familyInstance.introspect`.
|
|
277
|
+
*
|
|
278
|
+
* Callers invoke this after the integrity gate (`buildContractSpaceAggregate`
|
|
279
|
+
* with `checkContracts: true`), so every `space.contract()` call is safe —
|
|
280
|
+
* no try/catch is needed here.
|
|
281
|
+
*/
|
|
282
|
+
declare function collectAggregateNamespaces(aggregate: ContractSpaceAggregate): {
|
|
283
|
+
readonly storage: {
|
|
284
|
+
readonly namespaces: Readonly<Record<string, StorageNamespace>>;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Assemble a {@link ContractSpaceAggregate} value from its contract spaces and a
|
|
289
|
+
* `checkIntegrity` implementation. The query methods (`listSpaces` /
|
|
290
|
+
* `hasSpace` / `space` / `spaces`) are derived here so every aggregate —
|
|
291
|
+
* loader-built or test-built — shares one query surface: `app` first,
|
|
292
|
+
* then `extensions` in the order supplied (the loader sorts them
|
|
293
|
+
* lex-ascending by `spaceId`).
|
|
294
|
+
*/
|
|
295
|
+
declare function createContractSpaceAggregate(args: {
|
|
296
|
+
readonly targetId: string;
|
|
297
|
+
readonly app: AggregateContractSpace;
|
|
298
|
+
readonly extensions: readonly AggregateContractSpace[];
|
|
299
|
+
readonly checkIntegrity: (opts?: IntegrityQueryOptions) => readonly IntegrityViolation[];
|
|
300
|
+
}): ContractSpaceAggregate;
|
|
301
|
+
//#endregion
|
|
302
|
+
//#region src/aggregate/all-external.d.ts
|
|
303
|
+
/**
|
|
304
|
+
* True when every storage element the contract declares resolves to the
|
|
305
|
+
* `external` control policy (ADR 224) — element-level `control` first, the
|
|
306
|
+
* contract's `defaultControlPolicy` otherwise. A contract with no storage
|
|
307
|
+
* elements is vacuously all-external.
|
|
308
|
+
*
|
|
309
|
+
* This is the precondition for advancing a contract space's marker without
|
|
310
|
+
* any migrations (the declared-state resolution the db-init aggregate
|
|
311
|
+
* planner and `migrate` share): only when nothing in the space is
|
|
312
|
+
* Prisma-Next-managed can the storage structure be correct without a
|
|
313
|
+
* migration having produced it. Any space that declares a managed element
|
|
314
|
+
* but ships no migration graph is an authoring bug and must fail loudly.
|
|
315
|
+
*/
|
|
316
|
+
declare function allStorageElementsExternal(contract: Contract): boolean;
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/aggregate/check-integrity.d.ts
|
|
319
|
+
/**
|
|
320
|
+
* One space's load-time facts that `checkIntegrity` judges: the loaded
|
|
321
|
+
* contract space, the load-time problems `readMigrationsDir` surfaced for it, and
|
|
322
|
+
* whether it is the app space (the app head ref is synthesised, so the
|
|
323
|
+
* head-ref checks are skipped for it).
|
|
324
|
+
*/
|
|
325
|
+
interface IntegritySpaceState {
|
|
326
|
+
readonly space: AggregateContractSpace;
|
|
327
|
+
readonly problems: readonly PackageLoadProblem[];
|
|
328
|
+
/** Per-ref problems: a user ref `*.json` that exists but is unparseable. */
|
|
329
|
+
readonly refProblems: readonly RefLoadProblem[];
|
|
330
|
+
/**
|
|
331
|
+
* The space's `refs/head.json` problem when it exists but is unparseable.
|
|
332
|
+
* `null` means the head ref was read cleanly or is genuinely absent —
|
|
333
|
+
* the absent case is judged `headRefMissing`, the corrupt case here is
|
|
334
|
+
* judged `refUnreadable` (and suppresses `headRefMissing`).
|
|
335
|
+
*
|
|
336
|
+
* Always `null` for the app space — the app head ref is synthesised from
|
|
337
|
+
* the live contract, so there is no on-disk `head.json` to read or fail on.
|
|
338
|
+
*/
|
|
339
|
+
readonly headRefProblem: RefLoadProblem | null;
|
|
340
|
+
readonly isApp: boolean;
|
|
341
|
+
}
|
|
342
|
+
interface IntegrityComputationInput {
|
|
343
|
+
readonly targetId: string;
|
|
344
|
+
readonly spaces: readonly IntegritySpaceState[];
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* Walk the loaded model and return **every** integrity violation — never
|
|
348
|
+
* bailing at the first. Structurally-derivable violations (load-time
|
|
349
|
+
* problems, self-edges, missing / unreachable head refs) are always
|
|
350
|
+
* produced; layout-drift checks require `declaredExtensions`, and
|
|
351
|
+
* contract / target / disjointness checks require `checkContracts`.
|
|
352
|
+
*/
|
|
353
|
+
declare function computeIntegrityViolations(input: IntegrityComputationInput, opts?: IntegrityQueryOptions): readonly IntegrityViolation[];
|
|
354
|
+
declare function loadProblemToViolation(spaceId: string, problem: PackageLoadProblem): IntegrityViolation;
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region src/aggregate/marker-types.d.ts
|
|
357
|
+
/**
|
|
358
|
+
* Structural shape the aggregate planner / verifier accept for marker
|
|
359
|
+
* rows. Mirrors `family.readAllMarkers(...)` outputs across SQL and
|
|
360
|
+
* Mongo families: a `(storageHash, invariants)` pair plus an optional
|
|
361
|
+
* `profileHash` the verifier uses to align the marker with the
|
|
362
|
+
* destination contract's profile envelope.
|
|
363
|
+
*
|
|
364
|
+
* Typed structurally so `migration-tools` stays framework-neutral; SQL
|
|
365
|
+
* and Mongo families pass their typed `ContractMarkerRecord` through
|
|
366
|
+
* unchanged.
|
|
367
|
+
*/
|
|
368
|
+
interface ContractMarkerRecordLike {
|
|
369
|
+
readonly storageHash: string;
|
|
370
|
+
readonly invariants: readonly string[];
|
|
371
|
+
readonly profileHash?: string;
|
|
372
|
+
}
|
|
373
|
+
//#endregion
|
|
374
|
+
//#region src/aggregate/planner-types.d.ts
|
|
375
|
+
/**
|
|
376
|
+
* Caller-provided policy for {@link planMigration}. Today this carries
|
|
377
|
+
* just one knob:
|
|
378
|
+
*
|
|
379
|
+
* - `ignoreGraphFor`: `Set<spaceId>`. For listed contract spaces, the planner
|
|
380
|
+
* forces **`planFromDiff`** (fabricate a plan from a diff against the
|
|
381
|
+
* contract IR via `familyInstance.createPlanner(...).plan(...)`)
|
|
382
|
+
* regardless of whether a graph is available. The CLI's daily-driver
|
|
383
|
+
* `db init` / `db update` pipelines pass `new Set([aggregate.app.spaceId])`
|
|
384
|
+
* to keep today's app-space behaviour: the user's authored
|
|
385
|
+
* `migrations/` directory is **not** walked for the app space, the
|
|
386
|
+
* plan is fabricated on the fly. Extension spaces are walked.
|
|
387
|
+
*
|
|
388
|
+
* Listing a contract space here whose `headRef.invariants` is non-empty is
|
|
389
|
+
* a `policyConflict` — a diff-fabricated plan cannot satisfy authored
|
|
390
|
+
* invariants.
|
|
391
|
+
*/
|
|
392
|
+
interface CallerPolicy {
|
|
393
|
+
readonly ignoreGraphFor: ReadonlySet<string>;
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Snapshot of the live database state the planner needs to drive
|
|
397
|
+
* strategy selection.
|
|
398
|
+
*
|
|
399
|
+
* - `markersBySpaceId`: per-space marker rows. Absent entry = no
|
|
400
|
+
* marker yet (greenfield space). The planner treats the marker's
|
|
401
|
+
* `storageHash` as the recorded-path resolution's `from` node, falling
|
|
402
|
+
* back to {@link import('../constants').EMPTY_CONTRACT_HASH} when absent.
|
|
403
|
+
* - `schemaIntrospection`: the family's full live schema IR. Fed into
|
|
404
|
+
* `planFromDiff` in full; the aggregate itself is handed to the planner as
|
|
405
|
+
* an ownership oracle, which the planner asks per live extra node whether
|
|
406
|
+
* any space owns it — no schema is pruned up front, and the planner never
|
|
407
|
+
* drops a node a sibling space owns.
|
|
408
|
+
*
|
|
409
|
+
* Callers (CLI commands) gather this via the family's
|
|
410
|
+
* `readAllMarkers` + `introspect` calls before invoking the planner.
|
|
411
|
+
* The planner itself does not touch the database.
|
|
412
|
+
*/
|
|
413
|
+
interface AggregateCurrentDBState {
|
|
414
|
+
readonly markersBySpaceId: ReadonlyMap<string, ContractMarkerRecordLike | null>;
|
|
415
|
+
readonly schemaIntrospection: unknown;
|
|
416
|
+
}
|
|
417
|
+
/**
|
|
418
|
+
* Inputs to {@link planMigration}.
|
|
419
|
+
*
|
|
420
|
+
* The planner is target-agnostic but family-aware: per-space
|
|
421
|
+
* `planFromDiff` delegates to the family's `createPlanner(adapter).plan(...)`,
|
|
422
|
+
* which is why `adapter`, `migrations` (the
|
|
423
|
+
* `TargetMigrationsCapability`), and `frameworkComponents` are all
|
|
424
|
+
* threaded through. (`frameworkComponents` is passed verbatim into
|
|
425
|
+
* `planner.plan(...)` per ADR 212; the planner does not interpret it.)
|
|
426
|
+
*
|
|
427
|
+
* The planner does **not** receive a `targetId` separately —
|
|
428
|
+
* it reads `aggregate.targetId` and stamps it onto every emitted
|
|
429
|
+
* `MigrationPlan` from construction. No placeholder, no patch step.
|
|
430
|
+
*/
|
|
431
|
+
interface PlannerInput<TFamilyId extends string, TTargetId extends string> {
|
|
432
|
+
readonly aggregate: ContractSpaceAggregate;
|
|
433
|
+
readonly currentDBState: AggregateCurrentDBState;
|
|
434
|
+
readonly adapter: ControlAdapterInstance<TFamilyId, TTargetId>;
|
|
435
|
+
readonly migrations: TargetMigrationsCapability<TFamilyId, TTargetId, ControlFamilyInstance<TFamilyId, unknown>>;
|
|
436
|
+
readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
|
|
437
|
+
readonly callerPolicy: CallerPolicy;
|
|
438
|
+
readonly operationPolicy: MigrationOperationPolicy;
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Per-space output of the planner. The runner ingests this
|
|
442
|
+
* shape directly via a thin `toRunnerInput` adapter at the CLI.
|
|
443
|
+
*
|
|
444
|
+
* - `plan`: ready-to-execute `MigrationPlan` with `targetId` already
|
|
445
|
+
* set from `aggregate.targetId`.
|
|
446
|
+
* - `displayOps`: same operation list, surfaced separately so plan-mode
|
|
447
|
+
* output can render without touching the runner-bound `plan`.
|
|
448
|
+
* - `destinationContract`: the typed contract value the runner uses
|
|
449
|
+
* for post-apply verification. For the app space, the user's
|
|
450
|
+
* contract; for extension spaces, the on-disk `contract.json`.
|
|
451
|
+
* - `strategy`: which operation produced this plan — `'resolve-recorded-path'`
|
|
452
|
+
* (walked a recorded migration path), `'plan-from-diff'` (fabricated a
|
|
453
|
+
* plan from a state diff), or `'declared-state'` (the space ships no
|
|
454
|
+
* migration packages at all; the aggregate declares the no-op directly
|
|
455
|
+
* without invoking either). Surfaced for diagnostics; not consumed by
|
|
456
|
+
* the runner.
|
|
457
|
+
*/
|
|
458
|
+
/**
|
|
459
|
+
* Per-edge metadata for the chain assembled by resolving a contract
|
|
460
|
+
* space's recorded migration path. Lets `migrate` surface a per-migration
|
|
461
|
+
* `applied[]` entry (preserving the `migrationsApplied` count semantics)
|
|
462
|
+
* without re-walking the graph.
|
|
463
|
+
*
|
|
464
|
+
* `plan-from-diff`/`declared-state` plans leave this absent — they don't
|
|
465
|
+
* have authored edges to surface (a single fabricated edge is used
|
|
466
|
+
* instead, see {@link import('./fabricated-migration-edge').buildFabricatedMigrationEdge}).
|
|
467
|
+
*/
|
|
468
|
+
interface AggregateMigrationEdgeRef {
|
|
469
|
+
readonly migrationHash: string;
|
|
470
|
+
readonly dirName: string;
|
|
471
|
+
readonly from: string;
|
|
472
|
+
readonly to: string;
|
|
473
|
+
readonly operationCount: number;
|
|
474
|
+
/**
|
|
475
|
+
* Contract IR JSON of the edge's destination state, threaded from the
|
|
476
|
+
* bundle's snapshot store entry (`resolveRecordedPath`) or the space's
|
|
477
|
+
* destination contract (`planFromDiff`). Runners persist it as the
|
|
478
|
+
* edge's ledger-linked contract row so database tooling can render
|
|
479
|
+
* model-level diffs per applied migration; an edge's *before* state is
|
|
480
|
+
* the previous row's snapshot by chain construction. Absent when the
|
|
481
|
+
* source bundle's snapshot store entry cannot be resolved.
|
|
482
|
+
*/
|
|
483
|
+
readonly destinationContractJson?: unknown;
|
|
484
|
+
}
|
|
485
|
+
interface PerSpacePlan {
|
|
486
|
+
readonly plan: MigrationPlan;
|
|
487
|
+
readonly displayOps: readonly MigrationPlanOperation[];
|
|
488
|
+
readonly destinationContract: Contract;
|
|
489
|
+
readonly strategy: 'resolve-recorded-path' | 'plan-from-diff' | 'declared-state';
|
|
490
|
+
readonly warnings?: readonly MigrationPlannerConflict[];
|
|
491
|
+
/**
|
|
492
|
+
* Per-edge breakdown of the chain. `resolve-recorded-path` plans carry
|
|
493
|
+
* one entry per authored edge; `plan-from-diff` and `declared-state`
|
|
494
|
+
* plans carry a single fabricated edge.
|
|
495
|
+
*/
|
|
496
|
+
readonly migrationEdges: readonly AggregateMigrationEdgeRef[];
|
|
497
|
+
/**
|
|
498
|
+
* Path decision data used to select the chain (alternative count,
|
|
499
|
+
* tie-break reasons, required/satisfied invariants, per-edge
|
|
500
|
+
* invariants). Populated by `resolveRecordedPath`; absent for
|
|
501
|
+
* `plan-from-diff`/`declared-state` plans.
|
|
502
|
+
*
|
|
503
|
+
* `migrate` surfaces this for the app space as
|
|
504
|
+
* `MigrateSuccess.pathDecision` (back-compat with single-
|
|
505
|
+
* space callers).
|
|
506
|
+
*/
|
|
507
|
+
readonly pathDecision?: PathDecision;
|
|
508
|
+
}
|
|
509
|
+
interface PlannerSuccess {
|
|
510
|
+
readonly perSpace: ReadonlyMap<string, PerSpacePlan>;
|
|
511
|
+
/**
|
|
512
|
+
* `applyOrder` is the order the runner must walk per-space inputs.
|
|
513
|
+
* Mirrors the existing `concatenateSpaceApplyInputs` convention:
|
|
514
|
+
* extensions alphabetically by `spaceId`, then the app. Tests assert
|
|
515
|
+
* on `MigrationRunnerFailure.failingSpace`, which is positional in
|
|
516
|
+
* the runner's input array — preserving the literal ordering keeps
|
|
517
|
+
* `failingSpace` attribution byte-for-byte.
|
|
518
|
+
*/
|
|
519
|
+
readonly applyOrder: readonly string[];
|
|
520
|
+
}
|
|
521
|
+
/**
|
|
522
|
+
* Discriminated failure variants for {@link planMigration}. Each
|
|
523
|
+
* variant short-circuits the plan; per-space errors carry the
|
|
524
|
+
* `spaceId` so the CLI can surface a precise envelope.
|
|
525
|
+
*/
|
|
526
|
+
type PlannerError = {
|
|
527
|
+
readonly kind: 'extensionPathUnreachable';
|
|
528
|
+
readonly spaceId: string;
|
|
529
|
+
readonly target: string;
|
|
530
|
+
} | {
|
|
531
|
+
readonly kind: 'extensionPathUnsatisfiable';
|
|
532
|
+
readonly spaceId: string;
|
|
533
|
+
readonly missingInvariants: readonly string[];
|
|
534
|
+
} | {
|
|
535
|
+
readonly kind: 'planFromDiffFailed';
|
|
536
|
+
readonly spaceId: string;
|
|
537
|
+
readonly conflicts: readonly MigrationPlannerConflict[];
|
|
538
|
+
} | {
|
|
539
|
+
readonly kind: 'policyConflict';
|
|
540
|
+
readonly spaceId: string;
|
|
541
|
+
readonly detail: string;
|
|
542
|
+
};
|
|
543
|
+
type PlannerOutput = Result<PlannerSuccess, PlannerError>;
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region src/aggregate/fabricated-migration-edge.d.ts
|
|
546
|
+
declare function buildFabricatedMigrationEdge(args: {
|
|
547
|
+
readonly currentMarkerStorageHash: string | null | undefined;
|
|
548
|
+
readonly destinationStorageHash: string;
|
|
549
|
+
readonly operationCount: number;
|
|
550
|
+
readonly destinationContractJson?: unknown;
|
|
551
|
+
}): AggregateMigrationEdgeRef;
|
|
552
|
+
//#endregion
|
|
553
|
+
//#region src/aggregate/loader.d.ts
|
|
554
|
+
/**
|
|
555
|
+
* Inputs for {@link loadContractSpaceAggregate}.
|
|
556
|
+
*
|
|
557
|
+
* Construction reads migration **state** from disk (`migrations/<space>/`
|
|
558
|
+
* packages + refs + head refs). The app's *live* contract is not a disk
|
|
559
|
+
* artifact — in Prisma Next it is always compiled from the project's
|
|
560
|
+
* central contract, so the caller always has it and threads it in as
|
|
561
|
+
* `appContract`. `deserializeContract` is held and called lazily only for
|
|
562
|
+
* the extension contracts resolved from the contract snapshot store,
|
|
563
|
+
* keyed by each extension space's head ref hash.
|
|
564
|
+
*/
|
|
565
|
+
interface LoadAggregateInput {
|
|
566
|
+
readonly migrationsDir: string;
|
|
567
|
+
readonly deserializeContract: (raw: unknown) => Contract;
|
|
568
|
+
readonly appContract: Contract;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Build a tolerant, queryable {@link ContractSpaceAggregate} from on-disk
|
|
572
|
+
* migration state plus the caller's live app contract.
|
|
573
|
+
*
|
|
574
|
+
* Building **never throws on disk content**: a hash- or
|
|
575
|
+
* invariants-mismatched package is retained, an unparseable package is
|
|
576
|
+
* omitted, a missing extension head ref leaves `headRef: null`, and an
|
|
577
|
+
* unreadable on-disk contract defers its failure to `space.contract()`.
|
|
578
|
+
* Every such problem is judged by {@link ContractSpaceAggregate.checkIntegrity}
|
|
579
|
+
* rather than aborting the load. The only rejections are catastrophic I/O
|
|
580
|
+
* (a `migrations/` that exists but is unreadable for reasons other than
|
|
581
|
+
* absence).
|
|
582
|
+
*
|
|
583
|
+
* The app space's head ref is synthesised from the live contract's
|
|
584
|
+
* storage hash (the app contract is authored independently of the
|
|
585
|
+
* migration graph), and `app.contract()` returns the supplied contract.
|
|
586
|
+
* Extension spaces read their contract, refs, and head ref from disk.
|
|
587
|
+
*/
|
|
588
|
+
declare function loadContractSpaceAggregate(input: LoadAggregateInput): Promise<ContractSpaceAggregate>;
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region src/aggregate/planner.d.ts
|
|
591
|
+
/**
|
|
592
|
+
* Plan a migration across every contract space of a {@link ContractSpaceAggregate}.
|
|
593
|
+
*
|
|
594
|
+
* Per-space operation selection, in order; first match wins:
|
|
595
|
+
*
|
|
596
|
+
* 1. If `callerPolicy.ignoreGraphFor.has(space.spaceId)`:
|
|
597
|
+
* - If `space.headRef.invariants` is empty → `planFromDiff`.
|
|
598
|
+
* - Else → `policyConflict` (a diff-fabricated plan cannot satisfy
|
|
599
|
+
* authored invariants).
|
|
600
|
+
* 2. Else if `space.graph()` is non-empty AND `resolveRecordedPath`
|
|
601
|
+
* succeeds → its result.
|
|
602
|
+
* 3. Else if `space.graph()` is non-empty but unresolvable →
|
|
603
|
+
* `extensionPathUnreachable` / `extensionPathUnsatisfiable`.
|
|
604
|
+
* 4. Else (empty graph — the space ships no migration packages at all,
|
|
605
|
+
* e.g. an all-external extension space like Supabase's `auth`/`storage`)
|
|
606
|
+
* if `space.headRef.invariants` is empty → declare the no-op state
|
|
607
|
+
* directly (zero ops, destination = head ref) without invoking the
|
|
608
|
+
* family planner.
|
|
609
|
+
* 5. Else → `extensionPathUnsatisfiable` (an empty graph cannot satisfy
|
|
610
|
+
* non-empty invariants).
|
|
611
|
+
*
|
|
612
|
+
* Output `applyOrder` is `[...aggregate.extensions.map(spaceId), aggregate.app.spaceId]`
|
|
613
|
+
* — extensions alphabetical, then app — matching today's
|
|
614
|
+
* `concatenateSpaceApplyInputs` ordering. This preserves
|
|
615
|
+
* `MigrationRunnerFailure.failingSpace` attribution byte-for-byte.
|
|
616
|
+
*
|
|
617
|
+
* Every emitted `MigrationPlan` has `targetId = aggregate.targetId`.
|
|
618
|
+
* No placeholder cast; no patch step.
|
|
619
|
+
*/
|
|
620
|
+
declare function planMigration<TFamilyId extends string, TTargetId extends string>(input: PlannerInput<TFamilyId, TTargetId>): Promise<PlannerOutput>;
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/aggregate/strategies/resolve-recorded-path.d.ts
|
|
623
|
+
/**
|
|
624
|
+
* Outcome variants for resolving a contract space's recorded migration
|
|
625
|
+
* path. Mirrors
|
|
626
|
+
* {@link import('../../compute-extension-space-apply-path').ExtensionSpaceApplyPathOutcome}
|
|
627
|
+
* but operates against the contract space's lazily-reconstructed `graph()`
|
|
628
|
+
* instead of re-reading from disk. The aggregate planner converts
|
|
629
|
+
* these into {@link import('../planner-types').PlannerError}
|
|
630
|
+
* variants.
|
|
631
|
+
*/
|
|
632
|
+
type ResolveRecordedPathOutcome = {
|
|
633
|
+
readonly kind: 'ok';
|
|
634
|
+
readonly result: PerSpacePlan;
|
|
635
|
+
} | {
|
|
636
|
+
readonly kind: 'unreachable';
|
|
637
|
+
} | {
|
|
638
|
+
readonly kind: 'unsatisfiable';
|
|
639
|
+
readonly missing: readonly string[];
|
|
640
|
+
};
|
|
641
|
+
interface ResolveRecordedPathInputs {
|
|
642
|
+
readonly aggregateTargetId: string;
|
|
643
|
+
readonly space: AggregateContractSpace;
|
|
644
|
+
readonly currentMarker: ContractMarkerRecordLike | null;
|
|
645
|
+
/**
|
|
646
|
+
* Optional ref name to decorate the resulting `PathDecision`. Used by
|
|
647
|
+
* `migrate` to surface the user-supplied `--to <name>` in
|
|
648
|
+
* structured-progress events and invariant-path error envelopes. The
|
|
649
|
+
* strategy itself does not interpret it.
|
|
650
|
+
*/
|
|
651
|
+
readonly refName?: string;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Resolve a contract space's hydrated migration graph to the path from the
|
|
655
|
+
* live marker to `space.headRef.hash`, covering every required invariant.
|
|
656
|
+
*
|
|
657
|
+
* Pure synchronous function — no I/O. The aggregate's loader has
|
|
658
|
+
* already integrity-checked every package and reconstructed the graph;
|
|
659
|
+
* this resolves the path by looking up ops by `migrationHash` and
|
|
660
|
+
* assembles a `MigrationPlan` with `targetId` set from the aggregate (no
|
|
661
|
+
* placeholder cast).
|
|
662
|
+
*
|
|
663
|
+
* Required invariants are computed as `headRef.invariants \ marker.invariants`
|
|
664
|
+
* — the marker already declares some invariants satisfied; the path
|
|
665
|
+
* only needs to provide the remainder. Mirrors today's
|
|
666
|
+
* `computeExtensionSpaceApplyPath` semantics.
|
|
667
|
+
*/
|
|
668
|
+
declare function resolveRecordedPath(input: ResolveRecordedPathInputs): ResolveRecordedPathOutcome;
|
|
669
|
+
//#endregion
|
|
670
|
+
//#region src/aggregate/unclaimed-elements.d.ts
|
|
671
|
+
/**
|
|
672
|
+
* Classifies a diff issue's subject granularity on demand — the injected
|
|
673
|
+
* capability a contract space's family/target instance provides (via
|
|
674
|
+
* `hasSchemaSubjectClassifier`). This module never imports family node
|
|
675
|
+
* classes and never reads a classification off the node or the issue;
|
|
676
|
+
* absent entirely for families that classify nothing.
|
|
677
|
+
*/
|
|
678
|
+
type SchemaSubjectClassifier = (issue: SchemaDiffIssue) => DiffSubjectGranularity | undefined;
|
|
679
|
+
/**
|
|
680
|
+
* Classifies a diff issue's subject storage `entityKind` on demand — the
|
|
681
|
+
* sibling injected capability (`hasSchemaSubjectClassifier`'s
|
|
682
|
+
* `classifyEntityKind`) that resolves the same per-family vocabulary the
|
|
683
|
+
* contract storage's `entries` dictionary uses. This module never hardcodes
|
|
684
|
+
* a family entity kind; absent for families that classify nothing.
|
|
685
|
+
*/
|
|
686
|
+
type SchemaEntityKindClassifier = (issue: SchemaDiffIssue) => string | undefined;
|
|
687
|
+
//#endregion
|
|
688
|
+
//#region src/aggregate/verifier.d.ts
|
|
689
|
+
/**
|
|
690
|
+
* Caller policy for the verifier. Today's only knob is
|
|
691
|
+
* `mode`: `strict` treats unclaimed elements (live tables declared by
|
|
692
|
+
* no contract space) as errors; `lenient` treats them as
|
|
693
|
+
* informational. Maps directly to `db verify --strict`.
|
|
694
|
+
*/
|
|
695
|
+
interface VerifierInput {
|
|
696
|
+
readonly aggregate: ContractSpaceAggregate;
|
|
697
|
+
readonly markersBySpaceId: ReadonlyMap<string, ContractMarkerRecordLike | null>;
|
|
698
|
+
readonly schemaIntrospection: unknown;
|
|
699
|
+
readonly mode: 'strict' | 'lenient';
|
|
700
|
+
/**
|
|
701
|
+
* Caller-supplied per-space schema verifier. The CLI wires this to the
|
|
702
|
+
* family's `verifySchema`, run against the **full** introspected schema. The
|
|
703
|
+
* verifier then produces two outputs from the per-space results: each space's
|
|
704
|
+
* contract-satisfaction view (extras stripped) and one deduplicated list of
|
|
705
|
+
* live elements no contract space declares. It touches no storage shape.
|
|
706
|
+
*/
|
|
707
|
+
readonly verifySchemaForSpace: (schema: unknown, space: AggregateContractSpace, mode: 'strict' | 'lenient') => VerifyDatabaseSchemaResult;
|
|
708
|
+
/**
|
|
709
|
+
* Classifies a diff issue's subject granularity on demand — the injected
|
|
710
|
+
* capability the caller reads off the family instance (via
|
|
711
|
+
* `hasSchemaSubjectClassifier`) when it has one. Absent for families that
|
|
712
|
+
* classify nothing; the unclaimed-elements sweep falls back to path shape
|
|
713
|
+
* in that case. Never stamped onto the issue or the node.
|
|
714
|
+
*/
|
|
715
|
+
readonly classifySubjectGranularity?: SchemaSubjectClassifier;
|
|
716
|
+
/**
|
|
717
|
+
* Classifies a diff issue's subject storage `entityKind` on demand — the
|
|
718
|
+
* sibling injected capability read off the family instance alongside
|
|
719
|
+
* `classifySubjectGranularity`. Absent for families that classify
|
|
720
|
+
* nothing; the unclaimed-elements sweep falls back to a placeholder in
|
|
721
|
+
* that case. Never stamped onto the issue or the node.
|
|
722
|
+
*/
|
|
723
|
+
readonly classifyEntityKind?: SchemaEntityKindClassifier;
|
|
724
|
+
}
|
|
725
|
+
/**
|
|
726
|
+
* Marker-check result per contract space. Mirrors the four cases the
|
|
727
|
+
* `verifyContractSpaces` primitive surfaces today, plus an `'absent'`
|
|
728
|
+
* case for greenfield spaces (no marker row written yet — `db init`
|
|
729
|
+
* not run).
|
|
730
|
+
*/
|
|
731
|
+
type MarkerCheckResult = {
|
|
732
|
+
readonly kind: 'ok';
|
|
733
|
+
} | {
|
|
734
|
+
readonly kind: 'absent';
|
|
735
|
+
} | {
|
|
736
|
+
readonly kind: 'hashMismatch';
|
|
737
|
+
readonly markerHash: string;
|
|
738
|
+
readonly expected: string;
|
|
739
|
+
} | {
|
|
740
|
+
readonly kind: 'missingInvariants';
|
|
741
|
+
readonly missing: readonly string[];
|
|
742
|
+
};
|
|
743
|
+
interface MarkerCheckSection {
|
|
744
|
+
readonly perSpace: ReadonlyMap<string, MarkerCheckResult>;
|
|
745
|
+
readonly orphanMarkers: readonly {
|
|
746
|
+
readonly spaceId: string;
|
|
747
|
+
readonly row: ContractMarkerRecordLike;
|
|
748
|
+
}[];
|
|
749
|
+
}
|
|
750
|
+
interface SchemaCheckSection {
|
|
751
|
+
/**
|
|
752
|
+
* Per contract space, its contract-satisfaction view: the space's
|
|
753
|
+
* declared nodes only, each pass/fail by whether a missing/mismatch issue
|
|
754
|
+
* concerns it. Extras are stripped; the space's verdict is missing/mismatch
|
|
755
|
+
* only.
|
|
756
|
+
*/
|
|
757
|
+
readonly perSpace: ReadonlyMap<string, VerifyDatabaseSchemaResult>;
|
|
758
|
+
/**
|
|
759
|
+
* One deduplicated, sorted list of live element names no contract
|
|
760
|
+
* space declares (built from the diffs' extra findings, filtered by the
|
|
761
|
+
* passive aggregate's ownership query). Reported once for the whole database,
|
|
762
|
+
* not per space. Strict callers fail on a non-empty list; lenient callers show
|
|
763
|
+
* it informationally.
|
|
764
|
+
*/
|
|
765
|
+
readonly unclaimed: readonly string[];
|
|
766
|
+
}
|
|
767
|
+
interface VerifierSuccess {
|
|
768
|
+
readonly markerCheck: MarkerCheckSection;
|
|
769
|
+
readonly schemaCheck: SchemaCheckSection;
|
|
770
|
+
}
|
|
771
|
+
type VerifierError = {
|
|
772
|
+
readonly kind: 'introspectionFailure';
|
|
773
|
+
readonly detail: string;
|
|
774
|
+
};
|
|
775
|
+
type VerifierOutput = Result<VerifierSuccess, VerifierError>;
|
|
776
|
+
/**
|
|
777
|
+
* Verify a {@link ContractSpaceAggregate} against the live database
|
|
778
|
+
* state. Bundles two checks:
|
|
779
|
+
*
|
|
780
|
+
* - `markerCheck` per contract space: compare the live marker row against the
|
|
781
|
+
* space's `headRef.hash` + `headRef.invariants`. Absence is a
|
|
782
|
+
* distinct kind, not an error (callers — `db verify` strict vs
|
|
783
|
+
* `db init` precondition — choose how to interpret it).
|
|
784
|
+
* - `schemaCheck`: two distinct outputs from the per-space diffs.
|
|
785
|
+
* `perSpace` — each space verified against the **full**
|
|
786
|
+
* introspected schema, then its extras stripped, leaving the space's
|
|
787
|
+
* declared nodes (its contract-satisfaction view; verdict is
|
|
788
|
+
* missing/mismatch only). `unclaimed` — the extras gathered
|
|
789
|
+
* across every space, deduplicated, and filtered to the names no contract
|
|
790
|
+
* space declares (via the passive aggregate's ownership query); reported
|
|
791
|
+
* once for the database. No schema is pruned before verifying.
|
|
792
|
+
*
|
|
793
|
+
* `markerCheck.orphanMarkers` lists every marker row whose `space` is
|
|
794
|
+
* not a contract space of the aggregate. `db verify` callers reject orphans;
|
|
795
|
+
* future tooling may not.
|
|
796
|
+
*
|
|
797
|
+
* Pure synchronous function; no I/O. The caller (CLI) gathers
|
|
798
|
+
* `markersBySpaceId` and `schemaIntrospection` ahead of the call.
|
|
799
|
+
*/
|
|
800
|
+
declare function verifyMigration(input: VerifierInput): VerifierOutput;
|
|
801
|
+
//#endregion
|
|
802
|
+
export { buildFabricatedMigrationEdge as A, verifyMigration as B, ResolveRecordedPathOutcome as C, VerifierOutput as D, VerifierInput as E, loadContractSpaceAggregate as F, loadProblemToViolation as I, planMigration as L, computeIntegrityViolations as M, createAggregateContractSpace as N, VerifierSuccess as O, createContractSpaceAggregate as P, requireHeadRef as R, ResolveRecordedPathInputs as S, VerifierError as T, PerSpacePlan as _, ContractAtOptions as a, PlannerOutput as b, ContractSpaceAggregate as c, IntegrityQueryOptions as d, IntegritySpaceState as f, MarkerCheckSection as g, MarkerCheckResult as h, CallerPolicy as i, collectAggregateNamespaces as j, allStorageElementsExternal as k, DeclaredExtensionEntry as l, LoadAggregateInput as m, AggregateCurrentDBState as n, ContractAtResult as o, IntegrityViolation as p, AggregateMigrationEdgeRef as r, ContractMarkerRecordLike as s, AggregateContractSpace as t, IntegrityComputationInput as u, PlannerError as v, SchemaCheckSection as w, PlannerSuccess as x, PlannerInput as y, resolveRecordedPath as z };
|
|
803
|
+
//# sourceMappingURL=aggregate-BflrjWPO.d.mts.map
|