@prisma/orm-toolchain 8.0.0-rc.1-dev.44 → 8.0.0-rc.1-dev.46
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/README.md +3 -3
- package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-CPZB020V.mjs} +9 -9
- package/dist/{aggregate-BBsCbXgJ.mjs.map → aggregate-CPZB020V.mjs.map} +1 -1
- package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-DLUJLq5Y.d.mts} +3 -3
- package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-DLUJLq5Y.d.mts.map} +1 -1
- package/dist/cli-telemetry.d.mts +19 -5
- package/dist/cli-telemetry.d.mts.map +1 -1
- package/dist/cli-telemetry.mjs +287 -8
- package/dist/cli-telemetry.mjs.map +1 -1
- package/dist/cli.d.mts +11 -13
- package/dist/cli.d.mts.map +1 -1
- package/dist/cli.mjs +5382 -1095
- package/dist/cli.mjs.map +1 -1
- package/dist/cli__control-api.d.mts +298 -27
- package/dist/cli__control-api.d.mts.map +1 -1
- package/dist/cli__control-api.mjs +2 -19
- package/dist/cli__control-api__testing.d.mts +1 -1
- package/dist/cli__control-api__testing.mjs.map +1 -1
- package/dist/cli__init-output.d.mts +0 -1
- package/dist/cli__init-output.d.mts.map +1 -1
- package/dist/cli__init-output.mjs +1 -1
- package/dist/cli__migration-cli.mjs +9 -9
- package/dist/cli__migration-cli.mjs.map +1 -1
- package/dist/config-loader.d.mts +1 -1
- package/dist/config-loader.mjs +1 -1
- package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs} +4 -4
- package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map} +1 -1
- package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-BwgNK50T-DGvKgFCK.d.mts} +81 -81
- package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +1 -0
- package/dist/emitter.d.mts +1 -1
- package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-CXbGUWGu-CstQHPh6.mjs} +2 -2
- package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs.map → errors-CXbGUWGu-CstQHPh6.mjs.map} +1 -1
- package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
- package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
- package/dist/{exports-B3xY_FHp.mjs → exports-8ZUN43ve.mjs} +6 -6
- package/dist/exports-8ZUN43ve.mjs.map +1 -0
- package/dist/{exports-BZLNbtkY.mjs → exports-BZaG8_w_.mjs} +64 -36
- package/dist/exports-BZaG8_w_.mjs.map +1 -0
- package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-BViWUMpP-C4lYYJdU.mjs} +2 -2
- package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-BViWUMpP-C4lYYJdU.mjs.map} +1 -1
- package/dist/{import-roots-NDOIEDVj.mjs → import-roots-CNFBPAT1.mjs} +10 -3
- package/dist/{import-roots-NDOIEDVj.mjs.map → import-roots-CNFBPAT1.mjs.map} +1 -1
- package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-CfoYgejL.d.mts} +2 -2
- package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-CfoYgejL.d.mts.map} +1 -1
- package/dist/{index-mCsi_ND5.d.mts → index-DRs7L6N0.d.mts} +11 -3
- package/dist/index-DRs7L6N0.d.mts.map +1 -0
- package/dist/{index-CnOyYxmv.d.mts → index-Dgwl8Tzs.d.mts} +2 -2
- package/dist/{index-CnOyYxmv.d.mts.map → index-Dgwl8Tzs.d.mts.map} +1 -1
- package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-CTHy88OP-CYI2a8IO.mjs} +2 -2
- package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-CTHy88OP-CYI2a8IO.mjs.map} +1 -1
- package/dist/{io-635GlNx1-D94PxRc-.mjs → io-635GlNx1-D3zrw2qu.mjs} +4 -4
- package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-635GlNx1-D3zrw2qu.mjs.map} +1 -1
- package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-_SJImD5V-BURyY1KM.mjs} +2 -2
- package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-_SJImD5V-BURyY1KM.mjs.map} +1 -1
- package/dist/{migration-gubSSeMk.mjs → migration-hspPIEeV.mjs} +4 -4
- package/dist/{migration-gubSSeMk.mjs.map → migration-hspPIEeV.mjs.map} +1 -1
- package/dist/migration-tools.d.mts +4 -4
- package/dist/migration-tools.mjs +13 -13
- package/dist/migration-tools__aggregate.d.mts +1 -1
- package/dist/migration-tools__aggregate.mjs +1 -1
- package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
- package/dist/migration-tools__errors.d.mts +1 -1
- package/dist/migration-tools__errors.mjs +1 -1
- package/dist/migration-tools__invariants.mjs +1 -1
- package/dist/migration-tools__io.mjs +1 -1
- package/dist/migration-tools__migration-graph.mjs +2 -2
- package/dist/migration-tools__migration-ts.mjs +1 -1
- package/dist/migration-tools__migration.mjs +1 -1
- package/dist/migration-tools__ref-resolution.mjs +1 -1
- package/dist/migration-tools__refs.mjs +1 -1
- package/dist/migration-tools__spaces.d.mts +2 -2
- package/dist/migration-tools__spaces.mjs +2 -2
- package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
- package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
- package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-CovTDY14-CUoAqLML.mjs} +3 -45
- package/dist/output-CovTDY14-CUoAqLML.mjs.map +1 -0
- package/dist/publish-surface.d.mts +2 -2
- package/dist/publish-surface.mjs +2 -2
- package/dist/publish-surface__import-roots.d.mts +1 -1
- package/dist/publish-surface__import-roots.mjs +1 -1
- package/dist/publish-surface__shells.d.mts +1 -1
- package/dist/publish-surface__shells.mjs +1 -1
- package/dist/quick-reference-mongo.md +12 -9
- package/dist/quick-reference-postgres.md +12 -9
- package/dist/readme-mongo.md +2 -2
- package/dist/readme-postgres.md +2 -2
- package/dist/ref-h6InR6dO-rGfl18Jv.mjs +4686 -0
- package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +1 -0
- package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-HeNBXW53.mjs} +2 -2
- package/dist/{ref-resolution-sGcINe7o.mjs.map → ref-resolution-HeNBXW53.mjs.map} +1 -1
- package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-WK86uYYp-gM8tvWQP.mjs} +2 -2
- package/dist/{refs-WK86uYYp-B6EZkmmT.mjs.map → refs-WK86uYYp-gM8tvWQP.mjs.map} +1 -1
- package/dist/{shells-BenrJHp2.mjs → shells-C4HbRAr5.mjs} +13 -14
- package/dist/shells-C4HbRAr5.mjs.map +1 -0
- package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
- package/dist/shells-CIUmT4u4.d.mts.map +1 -0
- package/dist/{spaces-BG2w0P8d.mjs → spaces-4qMOAYE9.mjs} +7 -7
- package/dist/{spaces-BG2w0P8d.mjs.map → spaces-4qMOAYE9.mjs.map} +1 -1
- package/dist/{spaces-tWQi7CUv.d.mts → spaces-Dj65JrwZ.d.mts} +2 -2
- package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-Dj65JrwZ.d.mts.map} +1 -1
- package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
- package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
- package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs} +4 -4
- package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map} +1 -1
- package/dist/vite-plugin-contract-emit.d.mts +2 -2
- package/dist/vite-plugin-contract-emit.mjs +5 -5
- package/dist/vite-plugin-contract-emit.mjs.map +1 -1
- package/package.json +14 -38
- package/dist/bin__prisma-next.mjs +0 -512
- package/dist/bin__prisma-next.mjs.map +0 -1
- package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
- package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
- package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
- package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
- package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
- package/dist/cli__commands__contract-emit.d.mts +0 -2
- package/dist/cli__commands__contract-emit.mjs +0 -2
- package/dist/cli__commands__contract-infer.d.mts +0 -7
- package/dist/cli__commands__contract-infer.d.mts.map +0 -1
- package/dist/cli__commands__contract-infer.mjs +0 -2
- package/dist/cli__commands__db-init.d.mts +0 -7
- package/dist/cli__commands__db-init.d.mts.map +0 -1
- package/dist/cli__commands__db-init.mjs +0 -2
- package/dist/cli__commands__db-schema.d.mts +0 -7
- package/dist/cli__commands__db-schema.d.mts.map +0 -1
- package/dist/cli__commands__db-schema.mjs +0 -2
- package/dist/cli__commands__db-sign.d.mts +0 -7
- package/dist/cli__commands__db-sign.d.mts.map +0 -1
- package/dist/cli__commands__db-sign.mjs +0 -2
- package/dist/cli__commands__db-update.d.mts +0 -7
- package/dist/cli__commands__db-update.d.mts.map +0 -1
- package/dist/cli__commands__db-update.mjs +0 -2
- package/dist/cli__commands__db-verify.d.mts +0 -7
- package/dist/cli__commands__db-verify.d.mts.map +0 -1
- package/dist/cli__commands__db-verify.mjs +0 -2
- package/dist/cli__commands__migrate.d.mts +0 -57
- package/dist/cli__commands__migrate.d.mts.map +0 -1
- package/dist/cli__commands__migrate.mjs +0 -2
- package/dist/cli__commands__migration-check.d.mts +0 -8
- package/dist/cli__commands__migration-check.d.mts.map +0 -1
- package/dist/cli__commands__migration-check.mjs +0 -3
- package/dist/cli__commands__migration-graph.d.mts +0 -38
- package/dist/cli__commands__migration-graph.d.mts.map +0 -1
- package/dist/cli__commands__migration-graph.mjs +0 -2
- package/dist/cli__commands__migration-list.d.mts +0 -39
- package/dist/cli__commands__migration-list.d.mts.map +0 -1
- package/dist/cli__commands__migration-list.mjs +0 -2
- package/dist/cli__commands__migration-log.d.mts +0 -20
- package/dist/cli__commands__migration-log.d.mts.map +0 -1
- package/dist/cli__commands__migration-log.mjs +0 -2
- package/dist/cli__commands__migration-new.d.mts +0 -7
- package/dist/cli__commands__migration-new.d.mts.map +0 -1
- package/dist/cli__commands__migration-new.mjs +0 -2
- package/dist/cli__commands__migration-plan.d.mts +0 -34
- package/dist/cli__commands__migration-plan.d.mts.map +0 -1
- package/dist/cli__commands__migration-plan.mjs +0 -2
- package/dist/cli__commands__migration-show.d.mts +0 -27
- package/dist/cli__commands__migration-show.d.mts.map +0 -1
- package/dist/cli__commands__migration-show.mjs +0 -2
- package/dist/cli__commands__migration-status.d.mts +0 -55
- package/dist/cli__commands__migration-status.d.mts.map +0 -1
- package/dist/cli__commands__migration-status.mjs +0 -3
- package/dist/cli__commands__ref.d.mts +0 -7
- package/dist/cli__commands__ref.d.mts.map +0 -1
- package/dist/cli__commands__ref.mjs +0 -2
- package/dist/cli__commands__telemetry.d.mts +0 -7
- package/dist/cli__commands__telemetry.d.mts.map +0 -1
- package/dist/cli__commands__telemetry.mjs +0 -2
- package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
- package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
- package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs +0 -295
- package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs.map +0 -1
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
- package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
- package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
- package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
- package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
- package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
- package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
- package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
- package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
- package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
- package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
- package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
- package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
- package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
- package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
- package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
- package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
- package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
- package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
- package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
- package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
- package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
- package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
- package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
- package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
- package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
- package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
- package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
- package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
- package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
- package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
- package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
- package/dist/exports-B3xY_FHp.mjs.map +0 -1
- package/dist/exports-BZLNbtkY.mjs.map +0 -1
- package/dist/exports-CqNUihkI.mjs +0 -276
- package/dist/exports-CqNUihkI.mjs.map +0 -1
- package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
- package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
- package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
- package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
- package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
- package/dist/index-mCsi_ND5.d.mts.map +0 -1
- package/dist/init-B86mXFNC-C2HAUCRn.mjs +0 -800
- package/dist/init-B86mXFNC-C2HAUCRn.mjs.map +0 -1
- package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
- package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
- package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
- package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
- package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
- package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
- package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
- package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
- package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
- package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
- package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
- package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
- package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
- package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
- package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
- package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
- package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
- package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
- package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
- package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
- package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
- package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
- package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
- package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
- package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
- package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
- package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
- package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
- package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
- package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
- package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
- package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
- package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
- package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
- package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
- package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
- package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
- package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
- package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
- package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
- package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
- package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
- package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
- package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
- package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
- package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
- package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
- package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
- package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
- package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
- package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
- package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
- package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
- package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
- package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
- package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
- package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs +0 -1476
- package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map +0 -1
- package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
- package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
- package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
- package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
- package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
- package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
- package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
- package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
- package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
- package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
- package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
- package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
- package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
- package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
- package/dist/shells-BenrJHp2.mjs.map +0 -1
- package/dist/shells-COHV_Ozf.d.mts.map +0 -1
- package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
- package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
- package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
- package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
- package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
- package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
- package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-C6Qp5ujC-Dxb7r79B.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/client-C6Qp5ujC.mjs"],"sourcesContent":["import { t as CliStructuredError$1 } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { t as assertFrameworkComponentsCompatible } from \"./framework-components-Bau7o1-J.mjs\";\nimport { t as enrichContract } from \"./contract-enrichment-DrMvvY2A.mjs\";\nimport { n as buildContractSpaceAggregate } from \"./contract-space-aggregate-loader-fa04OIaL.mjs\";\nimport { emit } from \"@internal/emitter\";\nimport { CliStructuredError } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { APP_SPACE_ID, createControlStack, hasMigrations, hasOperationPreview, hasPslContractInfer, hasSchemaSubjectClassifier, hasSchemaView } from \"@internal/framework-components/control\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { InternalError } from \"@internal/utils/internal-error\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { allStorageElementsExternal, buildFabricatedMigrationEdge, collectAggregateNamespaces, planMigration, requireHeadRef, resolveRecordedPath, verifyMigration } from \"@internal/migration-tools/aggregate\";\nimport { EMPTY_CONTRACT_HASH } from \"@internal/migration-tools/constants\";\nimport { errorNoInvariantPath } from \"@internal/migration-tools/errors\";\nimport { createHash } from \"node:crypto\";\nimport { canonicalizeJson } from \"@internal/framework-components/utils\";\nimport { findPathWithDecision } from \"@internal/migration-tools/migration-graph\";\n//#region src/control-api/operations/migration-helpers.ts\n/**\n* Strips operation objects to their public shape (id, label, operationClass).\n* Used at the API boundary to avoid leaking internal fields (precheck, execute, postcheck, etc.).\n*/\nfunction stripOperations(operations) {\n\treturn operations.map((op) => ({\n\t\tid: op.id,\n\t\tlabel: op.label,\n\t\toperationClass: op.operationClass\n\t}));\n}\n//#endregion\n//#region src/control-api/operations/plan-identity.ts\n/**\n* Content identity of a `db update` plan: what it does (the ordered display\n* operations) and where it lands (the destination storage hash). A\n* `DESTRUCTIVE_CHANGES` refusal names the refused plan by this hash, and the\n* apply that carries the consent back recomputes it to prove it is still\n* applying the plan that was consented to.\n*/\nfunction computePlanHash(plan) {\n\tconst canonical = canonicalizeJson({\n\t\toperations: plan.operations,\n\t\tdestination: { storageHash: plan.destination.storageHash }\n\t});\n\treturn createHash(\"sha256\").update(canonical).digest(\"hex\");\n}\n//#endregion\n//#region src/control-api/operations/run-migration.ts\n/**\n* Span id emitted via `onProgress` for the run phase. Stable\n* identifier consumed by the structured-output renderer and by tests.\n*/\nconst RUN_SPAN_ID = \"apply\";\n/**\n* Runner-driving tail shared by every run caller — `db init`,\n* `db update`, and `migrate`. Consumes already-resolved per-space\n* plans (the planner-vs-replay distinction is owned by the caller) and\n* dispatches them to the runner in canonical order.\n*\n* Marker advancement is part of the runner's per-space transaction\n* (the SQL family runner writes the marker as the last step of each\n* space's transaction), so this primitive does not advance markers\n* separately — by the time `execute` returns ok, every\n* space's marker has been advanced to its plan's destination.\n*\n* Span emission (`spanStart 'apply'` / `spanEnd 'apply'`) is owned here\n* so callers don't have to duplicate it; the `action` field on each\n* progress event is taken from the caller's `action` argument.\n*/\nasync function runMigration(inputs) {\n\tconst { aggregate, perSpacePlans, applyOrder, driver, familyInstance, migrations, frameworkComponents, policy, action, onProgress } = inputs;\n\tconst orderedResolutions = collectOrdered(applyOrder, perSpacePlans);\n\tconst runner = migrations.createRunner(familyInstance);\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: RUN_SPAN_ID,\n\t\tlabel: progressLabelForAction(action)\n\t});\n\tconst perSpaceOptions = orderedResolutions.map((r) => ({\n\t\tspace: r.spaceId,\n\t\tplan: r.entry.plan,\n\t\tdriver,\n\t\tdestinationContract: r.entry.destinationContract,\n\t\tpolicy,\n\t\tframeworkComponents,\n\t\tmigrationEdges: r.entry.migrationEdges,\n\t\tstrictVerification: false\n\t}));\n\tconst runnerResult = await runner.execute({\n\t\tdriver,\n\t\tperSpaceOptions\n\t});\n\tif (!runnerResult.ok) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: RUN_SPAN_ID,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\treturn notOk({\n\t\t\tsummary: runnerResult.failure.summary,\n\t\t\t...ifDefined(\"why\", runnerResult.failure.why),\n\t\t\tmeta: {\n\t\t\t\t...runnerResult.failure.meta ?? {},\n\t\t\t\tfailingSpace: runnerResult.failure.failingSpace,\n\t\t\t\trunnerErrorCode: runnerResult.failure.code\n\t\t\t},\n\t\t\tcause: runnerResult.failure\n\t\t});\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: RUN_SPAN_ID,\n\t\toutcome: \"ok\"\n\t});\n\treturn ok({\n\t\torderedResolutions,\n\t\ttotalOpsPlanned: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsPlanned, 0),\n\t\ttotalOpsExecuted: runnerResult.value.perSpaceResults.reduce((sum, r) => sum + r.value.operationsExecuted, 0),\n\t\tperSpace: buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: true })\n\t});\n}\n/**\n* Project the planner's per-space resolutions into the\n* `PerSpaceExecutionEntry[]` shape the CLI surfaces.\n*\n* `includeMarkers` is `true` for apply-mode (each space's marker is\n* the `destination.storageHash` of its plan, which the runner\n* advances as the last step of each space's transaction) and `false`\n* for plan-mode (no marker has been written yet).\n*\n* Exported alongside {@link runMigration} so plan-mode callers can\n* assemble the same per-space block without going through the runner.\n*/\nfunction buildPerSpaceBreakdown(orderedResolutions, appSpaceId, options) {\n\treturn orderedResolutions.map((r) => {\n\t\tconst operations = r.entry.displayOps.map((op) => ({\n\t\t\tid: op.id,\n\t\t\tlabel: op.label,\n\t\t\toperationClass: op.operationClass\n\t\t}));\n\t\tconst base = {\n\t\t\tspaceId: r.spaceId,\n\t\t\tkind: r.spaceId === appSpaceId ? \"app\" : \"extension\",\n\t\t\toperations\n\t\t};\n\t\tif (!options.includeMarkers) return base;\n\t\treturn {\n\t\t\t...base,\n\t\t\tmarker: { storageHash: r.entry.plan.destination.storageHash }\n\t\t};\n\t});\n}\n/**\n* Materialise the `applyOrder` ordering into resolved per-space\n* entries. Throws if the planner output is missing a contract space listed\n* in `applyOrder` — a wiring bug that should never reach runtime.\n*\n* Exported so callers building their own success envelopes after a\n* plan-mode dispatch can replay the same ordering.\n*/\nfunction collectOrdered(applyOrder, perSpace) {\n\treturn applyOrder.map((spaceId) => {\n\t\tconst entry = perSpace.get(spaceId);\n\t\tif (!entry) throw new InternalError(`planner output missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n}\n/**\n* Action-appropriate label for the `spanStart` event the run\n* primitive emits. `runMigration` is shared by `db init`, `db update`,\n* and `migrate`; the span label tracks the user-visible action\n* so structured-progress output reads naturally for each surface.\n*/\nfunction progressLabelForAction(action) {\n\tswitch (action) {\n\t\tcase \"dbInit\": return \"Initialising database across spaces\";\n\t\tcase \"dbUpdate\": return \"Updating database across spaces\";\n\t\tcase \"migrate\": return \"Running migration plan across spaces\";\n\t}\n}\n//#endregion\n//#region src/control-api/operations/db-run.ts\n/**\n* Span IDs emitted via `onProgress` during the run flow.\n* Stable identifiers consumed by the structured-output renderer and by\n* tests asserting on span ids. The `apply` span itself is owned by\n* the {@link runMigration} primitive — only the introspect / plan\n* spans are emitted directly here.\n*/\nconst SPAN_IDS$1 = {\n\tintrospect: \"introspect\",\n\tplan: \"plan\"\n};\n/**\n* Loader → planner → runner pipeline shared by `db init` and `db update`.\n*\n* The pipeline:\n*\n* 1. **Load**: build a {@link ContractSpaceAggregate} from the descriptor\n* set + on-disk on-disk artefacts. Any layout / drift / disjointness /\n* integrity violation short-circuits with a structured error.\n* 2. **Read DB state**: marker rows (`familyInstance.readAllMarkers`)\n* + introspected schema (`familyInstance.introspect`).\n* 3. **Plan**: {@link planMigration} chooses `resolveRecordedPath` vs\n* `planFromDiff` per space according to `callerPolicy.ignoreGraphFor`.\n* The app space is forced through `planFromDiff` (today's daily-driver\n* behaviour); every extension space walks its on-disk graph via\n* `resolveRecordedPath`.\n* 4. **Apply** (when `mode === 'apply'`): every per-space `MigrationPlan`\n* feeds into the runner's `execute` — one outer\n* transaction across every space; failure on any space rolls back\n* every space's writes.\n*/\nasync function executeRun(options) {\n\tconst { driver, adapter, familyInstance, contract, mode, migrations, frameworkComponents, migrationsDir, extensions, targetId, policy, action, onProgress } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tif (mode === \"apply\") {\n\t\tconst orphanMarkerError = detectOrphanMarkers(aggregate, markerRows);\n\t\tif (orphanMarkerError !== null) throw orphanMarkerError;\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\tconst schemaIR = await familyInstance.introspect({\n\t\tdriver,\n\t\tcontract: collectAggregateNamespaces(aggregate)\n\t});\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS$1.introspect,\n\t\toutcome: \"ok\"\n\t});\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS$1.plan,\n\t\tlabel: \"Planning migration\"\n\t});\n\tconst planResult = await planMigration({\n\t\taggregate,\n\t\tcurrentDBState: {\n\t\t\tmarkersBySpaceId: markerRows,\n\t\t\tschemaIntrospection: schemaIR\n\t\t},\n\t\tadapter,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tcallerPolicy: { ignoreGraphFor: /* @__PURE__ */ new Set([aggregate.app.spaceId]) },\n\t\toperationPolicy: policy\n\t});\n\tif (!planResult.ok) {\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS$1.plan,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\treturn mapPlannerError(planResult.failure);\n\t}\n\tonProgress?.({\n\t\taction,\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS$1.plan,\n\t\toutcome: \"ok\"\n\t});\n\tconst orderedResolutions = collectOrdered(planResult.value.applyOrder, planResult.value.perSpace);\n\tconst plannerWarnings = aggregatePlannerWarnings(orderedResolutions);\n\tconst appResolution = orderedResolutions.find((r) => r.spaceId === aggregate.app.spaceId);\n\tif (!appResolution) throw new InternalError(\"Aggregate planner returned no plan for the app space — the planner is supposed to always emit one.\");\n\tconst appPlan = appResolution.entry.plan;\n\tif (mode === \"plan\") {\n\t\tconst aggregateOps = orderedResolutions.flatMap((r) => r.entry.displayOps);\n\t\tconst preview = hasOperationPreview(familyInstance) ? familyInstance.toOperationPreview(aggregateOps) : void 0;\n\t\tconst perSpace = buildPerSpaceBreakdown(orderedResolutions, aggregate.app.spaceId, { includeMarkers: false });\n\t\tconst summary = `Planned ${aggregateOps.length} operation(s) across ${orderedResolutions.length} space(s)`;\n\t\treturn wrapPlanResult({\n\t\t\toperations: aggregateOps,\n\t\t\tdestination: appPlan.destination,\n\t\t\tpreview,\n\t\t\tperSpace,\n\t\t\tsummary,\n\t\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t\t});\n\t}\n\tif (options.consentedPlanHash !== void 0) {\n\t\tconst planHash = computePlanHash({\n\t\t\toperations: stripOperations(orderedResolutions.flatMap((r) => r.entry.displayOps)),\n\t\t\tdestination: appPlan.destination\n\t\t});\n\t\tif (planHash !== options.consentedPlanHash) return notOk({\n\t\t\tcode: \"CONSENT_PLAN_MISMATCH\",\n\t\t\tsummary: \"The plan changed between consent and apply\",\n\t\t\twhy: \"The plan recomputed for the consented apply is not the plan that was consented to, so applying it could destroy something nobody agreed to.\",\n\t\t\tconflicts: void 0,\n\t\t\tmeta: void 0,\n\t\t\tconsentPlanMismatch: {\n\t\t\t\tconsentedPlanHash: options.consentedPlanHash,\n\t\t\t\tplanHash\n\t\t\t},\n\t\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t\t});\n\t}\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans: planResult.value.perSpace,\n\t\tapplyOrder: planResult.value.applyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy,\n\t\taction,\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) return buildRunnerFailure({\n\t\tsummary: applied.failure.summary,\n\t\t...ifDefined(\"why\", applied.failure.why),\n\t\tmeta: applied.failure.meta,\n\t\t...ifDefined(\"warnings\", plannerWarnings),\n\t\t...ifDefined(\"cause\", applied.failure.cause)\n\t});\n\tconst aggregateOps = applied.value.orderedResolutions.flatMap((r) => r.entry.displayOps);\n\tconst summary = action === \"dbInit\" ? `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), database signed` : applied.value.totalOpsExecuted === 0 ? `Database already matches contract across ${applied.value.orderedResolutions.length} space(s), signature updated` : `Applied ${applied.value.totalOpsExecuted} operation(s) across ${applied.value.orderedResolutions.length} space(s), signature updated`;\n\treturn wrapApplyResult({\n\t\toperations: aggregateOps,\n\t\tdestination: appPlan.destination,\n\t\toperationsPlanned: applied.value.totalOpsPlanned,\n\t\toperationsExecuted: applied.value.totalOpsExecuted,\n\t\tperSpace: applied.value.perSpace,\n\t\tsummary,\n\t\t...ifDefined(\"warnings\", plannerWarnings)\n\t});\n}\nfunction aggregatePlannerWarnings(orderedResolutions) {\n\tconst warnings = orderedResolutions.flatMap((r) => r.entry.warnings ?? []);\n\treturn warnings.length > 0 ? warnings : void 0;\n}\n/**\n* Compare the live `_prisma_marker` rows against the aggregate's\n* declared contract spaces. Any marker row whose `space` is not a space of\n* the aggregate is an \"orphan\" — typically a marker left behind by\n* an extension that was removed from `extensions` without first\n* cleaning up its on-disk migrations / database tables.\n*\n* Returns a {@link CliStructuredError} envelope (code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION`, `kind: 'orphanMarker'`) for the\n* first orphan it finds, or `null`\n* when every marker row maps to a declared contract space. Mirrors the M2\n* `runContractSpaceVerifierMarkerCheck` envelope so downstream\n* tooling (integration tests, JSON consumers) keeps asserting on the\n* same shape.\n*/\nfunction detectOrphanMarkers(aggregate, markerRows) {\n\tconst aggregateSpaceIds = /* @__PURE__ */ new Set([aggregate.app.spaceId, ...aggregate.extensions.map((m) => m.spaceId)]);\n\tconst orphans = [];\n\tfor (const [spaceId, row] of markerRows) if (row !== null && row !== void 0 && !aggregateSpaceIds.has(spaceId)) orphans.push(spaceId);\n\tif (orphans.length === 0) return null;\n\torphans.sort((a, b) => a.localeCompare(b));\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", orphans.length === 1 ? `Orphan contract-space marker detected for \"${orphans[0]}\"` : `Orphan contract-space markers detected for ${orphans.length} spaces`, {\n\t\twhy: `The database has \\`_prisma_marker\\` rows for spaces (${orphans.map((s) => `\"${s}\"`).join(\", \")}) that are not declared in the project's \\`extensions\\`. The aggregate pipeline refuses to advance markers it cannot account for.`,\n\t\tfix: \"Either re-declare the missing extension(s) in `extensions` (so the aggregate owns them again), or remove the orphan marker row(s) from `_prisma_marker` once you have confirmed the corresponding tables can be safely retired.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations: orphans.map((spaceId) => ({\n\t\t\tkind: \"orphanMarker\",\n\t\t\tspaceId\n\t\t})) }\n\t});\n}\nfunction mapPlannerError(error) {\n\tif (error.kind === \"planFromDiffFailed\") return blindCast(notOk({\n\t\tcode: \"PLANNING_FAILED\",\n\t\tsummary: \"Migration planning failed due to conflicts\",\n\t\tconflicts: error.conflicts,\n\t\twhy: void 0,\n\t\tmeta: void 0\n\t}));\n\tif (error.kind === \"extensionPathUnreachable\") return buildRunnerFailure({\n\t\tsummary: `Cannot resolve apply path for extension space \"${error.spaceId}\"`,\n\t\twhy: `No path in the on-disk migration graph for extension space \"${error.spaceId}\" reaches the on-disk head ref hash \"${error.target}\".`,\n\t\tmeta: {\n\t\t\tspaceId: error.spaceId,\n\t\t\ttarget: error.target\n\t\t}\n\t});\n\tif (error.kind === \"extensionPathUnsatisfiable\") return buildRunnerFailure({\n\t\tsummary: `Cannot resolve apply path for extension space \"${error.spaceId}\"`,\n\t\twhy: `On-disk migration graph for extension space \"${error.spaceId}\" reaches the on-disk head ref but does not cover required invariants: ${error.missingInvariants.join(\", \")}.`,\n\t\tmeta: {\n\t\t\tspaceId: error.spaceId,\n\t\t\tmissingInvariants: error.missingInvariants\n\t\t}\n\t});\n\treturn buildRunnerFailure({\n\t\tsummary: `Aggregate planner policy conflict for space \"${error.spaceId}\"`,\n\t\twhy: error.detail,\n\t\tmeta: { spaceId: error.spaceId }\n\t});\n}\nfunction wrapPlanResult(args) {\n\treturn ok({\n\t\tmode: \"plan\",\n\t\tplan: {\n\t\t\toperations: stripOperations(args.operations),\n\t\t\t...ifDefined(\"preview\", args.preview)\n\t\t},\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary,\n\t\t...ifDefined(\"warnings\", args.warnings)\n\t});\n}\nfunction wrapApplyResult(args) {\n\treturn ok({\n\t\tmode: \"apply\",\n\t\tplan: { operations: stripOperations(args.operations) },\n\t\tdestination: {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\t...ifDefined(\"profileHash\", args.destination.profileHash)\n\t\t},\n\t\texecution: {\n\t\t\toperationsPlanned: args.operationsPlanned,\n\t\t\toperationsExecuted: args.operationsExecuted\n\t\t},\n\t\tmarker: args.destination.profileHash ? {\n\t\t\tstorageHash: args.destination.storageHash,\n\t\t\tprofileHash: args.destination.profileHash\n\t\t} : { storageHash: args.destination.storageHash },\n\t\tperSpace: args.perSpace,\n\t\tsummary: args.summary,\n\t\t...ifDefined(\"warnings\", args.warnings)\n\t});\n}\nfunction buildRunnerFailure(args) {\n\treturn blindCast(notOk({\n\t\tcode: \"RUNNER_FAILED\",\n\t\tsummary: args.summary,\n\t\twhy: args.why,\n\t\tmeta: args.meta,\n\t\tconflicts: void 0,\n\t\t...ifDefined(\"warnings\", args.warnings),\n\t\t...ifDefined(\"cause\", args.cause)\n\t}));\n}\n//#endregion\n//#region src/control-api/operations/db-init.ts\n/**\n* Execute `db init` against the configured contract.\n*\n* Routes through the loader → planner → runner pipeline (sub-spec\n* \"Commit-by-commit § Commit 4\"). Always additive-only; destructive\n* changes belong to `db update`.\n*/\nasync function executeDbInit(options) {\n\treturn await executeRun({\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmode: options.mode,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: { allowedOperationClasses: [\"additive\"] },\n\t\taction: \"dbInit\",\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-update.ts\nconst DB_UPDATE_POLICY = { allowedOperationClasses: [\n\t\"additive\",\n\t\"widening\",\n\t\"destructive\"\n] };\n/**\n* Execute `db update` against the configured contract.\n*\n* Routes through the loader → planner → runner pipeline. Destructive\n* operations require either `acceptDataLoss: true` or a prior\n* `mode: 'plan'` invocation that surfaces the destructive ops; the\n* confirmation gate is implemented here so the lower-level applier\n* remains policy-agnostic.\n*/\nasync function executeDbUpdate(options) {\n\tconst sharedInputs = {\n\t\tdriver: options.driver,\n\t\tadapter: options.adapter,\n\t\tfamilyInstance: options.familyInstance,\n\t\tcontract: options.contract,\n\t\tmigrations: options.migrations,\n\t\tframeworkComponents: options.frameworkComponents,\n\t\tmigrationsDir: options.migrationsDir,\n\t\ttargetId: options.targetId,\n\t\textensions: options.extensions ?? [],\n\t\tpolicy: DB_UPDATE_POLICY,\n\t\taction: \"dbUpdate\",\n\t\t...ifDefined(\"onProgress\", options.onProgress)\n\t};\n\tif (options.mode === \"apply\" && !options.acceptDataLoss && options.consent === void 0) {\n\t\tconst refusal = await guardDestructiveChanges(sharedInputs);\n\t\tif (refusal !== null) return refusal;\n\t}\n\treturn await executeRun({\n\t\t...sharedInputs,\n\t\tmode: options.mode,\n\t\t...ifDefined(\"consentedPlanHash\", options.consent?.planHash)\n\t});\n}\n/**\n* Pre-plan once when running `db update apply` without `acceptDataLoss`.\n* Surfaces destructive operations across every space; if any are\n* planned, returns a `DESTRUCTIVE_CHANGES` failure that the CLI shows\n* as a confirmation prompt. Returns `null` when the apply is safe to\n* run.\n*/\nasync function guardDestructiveChanges(sharedInputs) {\n\tconst planResult = await executeRun({\n\t\t...sharedInputs,\n\t\tmode: \"plan\"\n\t});\n\tif (!planResult.ok) return planResult;\n\tconst destructiveOps = planResult.value.plan.operations.filter((op) => op.operationClass === \"destructive\").map((op) => ({\n\t\tid: op.id,\n\t\tlabel: op.label\n\t}));\n\tif (destructiveOps.length === 0) return null;\n\tconst databaseName = await sharedInputs.driver.databaseName?.();\n\treturn notOk({\n\t\tcode: \"DESTRUCTIVE_CHANGES\",\n\t\tsummary: `Planned ${destructiveOps.length} destructive operation(s) that require confirmation`,\n\t\twhy: \"Destructive operations require explicit consent, which the caller has not given\",\n\t\tconflicts: void 0,\n\t\tmeta: void 0,\n\t\tdestructiveChanges: {\n\t\t\tdestructiveOperations: destructiveOps,\n\t\t\tdatabaseName,\n\t\t\tplanHash: computePlanHash({\n\t\t\t\toperations: planResult.value.plan.operations,\n\t\t\t\tdestination: planResult.value.destination\n\t\t\t})\n\t\t},\n\t\t...ifDefined(\"warnings\", planResult.value.warnings)\n\t});\n}\n//#endregion\n//#region src/control-api/operations/db-verify.ts\n/**\n* Span IDs emitted via `onProgress` during the aggregate verify flow.\n* Mirrors the span identifiers used by the legacy precheck / marker-check\n* helpers so structured-output renderers and progress tests keep working.\n*/\nconst SPAN_IDS = {\n\tintrospect: \"introspect\",\n\tverify: \"verify\"\n};\n/**\n* Loader → verifier pipeline shared by `db verify` modes (`full`,\n* `marker-only`, `schema-only`).\n*\n* 1. **Load**: build a {@link import('@internal/migration-tools/aggregate').ContractSpaceAggregate}\n* from descriptors + on-disk on-disk artefacts. Layout / drift /\n* integrity / disjointness violations short-circuit with a\n* structured CLI error.\n* 2. **Read DB state**: marker rows + (when `skipSchema` is `false`)\n* schema introspection.\n* 3. **Verify**: {@link verifyMigration} returns per-space `markerCheck` +\n* per-space `schemaCheck` (each contract space verified against the full schema,\n* then scoped to its own contract space). Marker drift is returned as the\n* success value's `markerDrift` envelope for callers to settle as a\n* finding. Verify results are returned to the caller verbatim.\n*/\nasync function executeDbVerify(options) {\n\tconst { driver, familyInstance, onProgress, skipSchema, skipMarker } = options;\n\tconst loaded = await buildContractSpaceAggregate(buildLoadInputs(options));\n\tif (!loaded.ok) return notOk(loaded.failure);\n\tconst aggregate = loaded.value;\n\tconst markersBySpaceId = await familyInstance.readAllMarkers({ driver });\n\tconst schemaIntrospection = skipSchema ? null : await runIntrospection({\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tonProgress,\n\t\tcontract: collectAggregateNamespaces(aggregate)\n\t});\n\tconst classifySubjectGranularity = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifySubjectGranularity(issue) : void 0;\n\tconst classifyEntityKind = hasSchemaSubjectClassifier(familyInstance) ? (issue) => familyInstance.classifyEntityKind(issue) : void 0;\n\temitVerifySpan(onProgress, \"spanStart\");\n\treturn finaliseVerifyResult({\n\t\tverifyResult: verifyMigration({\n\t\t\taggregate,\n\t\t\tmarkersBySpaceId,\n\t\t\tschemaIntrospection,\n\t\t\tmode: options.mode,\n\t\t\tverifySchemaForSpace: createPerSpaceVerifier(options),\n\t\t\t...ifDefined(\"classifySubjectGranularity\", classifySubjectGranularity),\n\t\t\t...ifDefined(\"classifyEntityKind\", classifyEntityKind)\n\t\t}),\n\t\taggregate,\n\t\tskipMarker,\n\t\tonProgress\n\t});\n}\nfunction buildLoadInputs(options) {\n\treturn {\n\t\ttargetId: options.targetId,\n\t\tmigrationsDir: options.migrationsDir,\n\t\tappContract: options.contract,\n\t\textensions: options.extensions,\n\t\tdeserializeContract: (json) => options.familyInstance.deserializeContract(json)\n\t};\n}\nasync function runIntrospection(args) {\n\tconst { driver, familyInstance, onProgress, contract } = args;\n\tonProgress?.({\n\t\taction: \"dbVerify\",\n\t\tkind: \"spanStart\",\n\t\tspanId: SPAN_IDS.introspect,\n\t\tlabel: \"Introspecting database schema\"\n\t});\n\ttry {\n\t\tconst result = await familyInstance.introspect({\n\t\t\tdriver,\n\t\t\tcontract\n\t\t});\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"ok\"\n\t\t});\n\t\treturn result;\n\t} catch (error) {\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanEnd\",\n\t\t\tspanId: SPAN_IDS.introspect,\n\t\t\toutcome: \"error\"\n\t\t});\n\t\tthrow error;\n\t}\n}\n/**\n* Build the per-space schema callback handed to the aggregate verifier.\n* When `skipSchema` is true the callback short-circuits with a synthetic\n* `ok` result so the verifier still runs the (cheap) schemaCheck loop\n* without invoking the family's verification path.\n*/\nfunction createPerSpaceVerifier(options) {\n\tconst { skipSchema, familyInstance, frameworkComponents } = options;\n\treturn (schema, space, verifyMode) => {\n\t\tif (skipSchema) return buildSkippedSchemaResult(space);\n\t\treturn familyInstance.verifySchema({\n\t\t\tcontract: space.contract(),\n\t\t\tschema,\n\t\t\tstrict: verifyMode === \"strict\",\n\t\t\tframeworkComponents\n\t\t});\n\t};\n}\nfunction emitVerifySpan(onProgress, kind) {\n\tif (kind === \"spanStart\") {\n\t\tonProgress?.({\n\t\t\taction: \"dbVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: SPAN_IDS.verify,\n\t\t\tlabel: \"Verifying contract spaces\"\n\t\t});\n\t\treturn;\n\t}\n\tonProgress?.({\n\t\taction: \"dbVerify\",\n\t\tkind: \"spanEnd\",\n\t\tspanId: SPAN_IDS.verify,\n\t\toutcome: kind === \"spanEndOk\" ? \"ok\" : \"error\"\n\t});\n}\n/**\n* Map an {@link VerifierOutput} to the operation's\n* {@link ExecuteDbVerifyResult}, applying the `skipMarker` policy used\n* by the CLI's `--schema-only` mode.\n*/\nfunction finaliseVerifyResult(args) {\n\tconst { verifyResult, aggregate, skipMarker, onProgress } = args;\n\tif (!verifyResult.ok) {\n\t\temitVerifySpan(onProgress, \"spanEndError\");\n\t\treturn notOk(new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", \"Aggregate verifier introspection failed\", {\n\t\t\twhy: verifyResult.failure.detail,\n\t\t\tfix: \"Check database connectivity and the introspection tooling.\",\n\t\t\tdocsUrl: \"https://pris.ly/contract-spaces\"\n\t\t}));\n\t}\n\tconst markerDrift = skipMarker ? null : mapMarkerCheckFailures(aggregate.app.spaceId, verifyResult.value.markerCheck);\n\temitVerifySpan(onProgress, markerDrift === null ? \"spanEndOk\" : \"spanEndError\");\n\treturn ok({\n\t\tschemaResults: verifyResult.value.schemaCheck.perSpace,\n\t\tunclaimed: verifyResult.value.schemaCheck.unclaimed,\n\t\tspaceOrder: [aggregate.app.spaceId, ...aggregate.extensions.map((e) => e.spaceId)],\n\t\tappSpaceId: aggregate.app.spaceId,\n\t\tmarkerDrift\n\t});\n}\nfunction buildSkippedSchemaResult(space) {\n\tconst contract = space.contract();\n\tconst headRef = requireHeadRef(space);\n\tconst profileHash = castAs(contract).profileHash;\n\treturn {\n\t\tok: true,\n\t\tsummary: \"Schema verification skipped\",\n\t\tcontract: {\n\t\t\tstorageHash: headRef.hash,\n\t\t\t...profileHash ? { profileHash } : {}\n\t\t},\n\t\ttarget: { expected: contract.target },\n\t\tschema: { issues: [] },\n\t\ttimings: { total: 0 }\n\t};\n}\n/**\n* Translate per-space marker check failures and orphan markers into a\n* single CLI structured error envelope. Preserves the legacy code\n* `MIGRATION.CONTRACT_SPACE_VIOLATION` (was emitted by\n* `runContractSpaceVerifierMarkerCheck`).\n*/\nfunction mapMarkerCheckFailures(appSpaceId, section) {\n\tconst violations = [];\n\tfor (const [spaceId, result] of section.perSpace) {\n\t\tif (result.kind === \"ok\" || result.kind === \"absent\") continue;\n\t\tif (result.kind === \"hashMismatch\") {\n\t\t\tviolations.push({\n\t\t\t\tkind: \"hashMismatch\",\n\t\t\t\tspaceId,\n\t\t\t\tremediation: spaceId === appSpaceId ? \"Run `prisma-next db update` to advance the marker, or roll the database back to the recorded hash.\" : `Apply on-disk migrations under \\`migrations/${spaceId}/\\` to advance the marker, or remove the conflicting marker row.`\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tif (result.kind === \"missingInvariants\") violations.push({\n\t\t\tkind: \"invariantsMismatch\",\n\t\t\tspaceId,\n\t\t\tremediation: `Re-apply the migrations under \\`migrations/${spaceId}/\\` so the marker carries invariants: ${result.missing.join(\", \")}.`\n\t\t});\n\t}\n\tfor (const orphan of section.orphanMarkers) violations.push({\n\t\tkind: \"orphanMarker\",\n\t\tspaceId: orphan.spaceId,\n\t\tremediation: `Add the corresponding extension to \\`extensions\\` in \\`prisma-next.config.ts\\`, or delete the orphan marker row for \"${orphan.spaceId}\".`\n\t});\n\tif (violations.length === 0) return null;\n\tconst lines = violations.map((v) => `- [${v.kind}] ${v.spaceId}: ${v.remediation}`);\n\treturn new CliStructuredError$1(\"MIGRATION.CONTRACT_SPACE_VIOLATION\", violations.length === 1 ? \"Contract-space verifier found a violation\" : `Contract-space verifier found violations (${violations.length})`, {\n\t\twhy: `The on-disk \\`migrations/\\` directory, the \\`extensions\\` declaration, and the live database marker rows are not in agreement.\\n${lines.join(\"\\n\")}`,\n\t\tfix: violations[0]?.remediation ?? \"Review and reconcile the violations listed above.\",\n\t\tdocsUrl: \"https://pris.ly/contract-spaces\",\n\t\tmeta: { violations }\n\t});\n}\n//#endregion\n//#region src/control-api/operations/migrate.ts\n/**\n* Apply pending migrations across every contract space (app +\n* extensions). Replay-only: graph-walk against the on-disk graph for\n* every contract space; no synth, no introspection.\n*\n* Pipeline:\n*\n* 1. Load aggregate from disk (loader hydrates extension graphs;\n* caller provides app-space packages).\n* 2. Read live marker rows per space (`familyInstance.readAllMarkers`).\n* 3. Per space: `resolveRecordedPath` plots the path from the live\n* marker to `space.headRef.hash` (or `refHash` for the app\n* space when provided). An empty-graph space whose elements are ALL\n* externally managed resolves declaratively (marker to head, zero\n* ops), mirroring the db-init aggregate planner: such a space ships\n* no DDL and has nothing to author. Every other empty-graph space\n* fails loudly — \"never planned\" is a user-error condition for\n* replay.\n* 4. Hand off to {@link runMigration} (the runner-driving tail\n* shared with `db init` / `db update`). Marker advancement is\n* inside the per-space transaction.\n*\n* Encodes the replay-only contract: the app contract space must have an\n* authored migration graph on disk before this operation can advance it.\n*/\nasync function executeMigrate(options) {\n\tconst { driver, familyInstance, contract, migrations, frameworkComponents, migrationsDir, extensions, targetId, refHash, refInvariants, refName, onProgress } = options;\n\tconst loaded = await buildContractSpaceAggregate({\n\t\ttargetId,\n\t\tmigrationsDir,\n\t\tappContract: contract,\n\t\textensions,\n\t\tdeserializeContract: (json) => familyInstance.deserializeContract(json)\n\t});\n\tif (!loaded.ok) throw loaded.failure;\n\tconst aggregate = loaded.value;\n\tconst markerRows = await familyInstance.readAllMarkers({ driver });\n\tconst allSpaces = [aggregate.app, ...aggregate.extensions];\n\tconst perSpacePlans = /* @__PURE__ */ new Map();\n\tconst atHeadResolutions = /* @__PURE__ */ new Map();\n\tfor (const space of allSpaces) {\n\t\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\t\tconst headRef = requireHeadRef(space);\n\t\tconst spaceTargetHash = isAppSpace && refHash !== void 0 ? refHash : headRef.hash;\n\t\tconst outcome = planSpacePath({\n\t\t\tspace,\n\t\t\taggregate,\n\t\t\ttargetHash: spaceTargetHash,\n\t\t\trefInvariants: isAppSpace && refHash !== void 0 ? refInvariants : void 0,\n\t\t\tliveMarker: markerRows.get(space.spaceId) ?? null,\n\t\t\t...isAppSpace ? { refName } : {}\n\t\t});\n\t\tif (outcome.kind === \"at-head\") {\n\t\t\tatHeadResolutions.set(space.spaceId, outcome.plan);\n\t\t\tcontinue;\n\t\t}\n\t\tif (outcome.kind === \"never-planned\") return notOk(buildNeverPlannedFailure(outcome.spaceId, outcome.targetHash));\n\t\tif (outcome.kind === \"unreachable\") return notOk(buildPathNotFoundFailure(outcome.spaceId, outcome.liveMarker, outcome.targetHash));\n\t\tif (outcome.kind === \"unsatisfiable\") {\n\t\t\tconst structural = findPathWithDecision(outcome.targetSpace.graph(), outcome.liveHash, spaceTargetHash, { required: /* @__PURE__ */ new Set() });\n\t\t\tconst structuralPath = structural.kind === \"ok\" ? structural.decision.selectedPath.map((edge) => ({\n\t\t\t\tdirName: edge.dirName,\n\t\t\t\tmigrationHash: edge.migrationHash,\n\t\t\t\tfrom: edge.from,\n\t\t\t\tto: edge.to,\n\t\t\t\tinvariants: edge.invariants\n\t\t\t})) : [];\n\t\t\tthrow errorNoInvariantPath({\n\t\t\t\t...outcome.refName !== void 0 ? { refName: outcome.refName } : {},\n\t\t\t\trequired: outcome.targetInvariants,\n\t\t\t\tmissing: outcome.missing,\n\t\t\t\tstructuralPath\n\t\t\t});\n\t\t}\n\t\tperSpacePlans.set(space.spaceId, outcome.plan);\n\t}\n\tconst canonicalOrder = [...aggregate.extensions.map((m) => m.spaceId), aggregate.app.spaceId];\n\tconst applyOrder = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId));\n\tif (!applyOrder.some((spaceId) => {\n\t\tconst entry = perSpacePlans.get(spaceId);\n\t\treturn entry !== void 0 && planRequiresExecution(entry);\n\t})) {\n\t\tconst ordered = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || atHeadResolutions.has(spaceId)).map((spaceId) => {\n\t\t\tconst entry = perSpacePlans.get(spaceId) ?? atHeadResolutions.get(spaceId);\n\t\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\t\treturn {\n\t\t\t\tspaceId,\n\t\t\t\tentry\n\t\t\t};\n\t\t});\n\t\tconst perSpace = buildPerSpaceBreakdown(ordered, aggregate.app.spaceId, { includeMarkers: true });\n\t\tconst totalSpaces = ordered.length;\n\t\treturn ok(buildSuccess({\n\t\t\taggregate,\n\t\t\torderedResolutions: ordered,\n\t\t\tperSpace,\n\t\t\ttotalOpsExecuted: 0,\n\t\t\tsummary: totalSpaces === 0 ? \"Already up to date — no contract spaces are loaded\" : totalSpaces === 1 ? \"Already up to date\" : `Already up to date across ${totalSpaces} space(s)`\n\t\t}));\n\t}\n\tconst applied = await runMigration({\n\t\taggregate,\n\t\tperSpacePlans,\n\t\tapplyOrder,\n\t\tdriver,\n\t\tfamilyInstance,\n\t\tmigrations,\n\t\tframeworkComponents,\n\t\tpolicy: { allowedOperationClasses: [\n\t\t\t\"additive\",\n\t\t\t\"widening\",\n\t\t\t\"destructive\",\n\t\t\t\"data\"\n\t\t] },\n\t\taction: \"migrate\",\n\t\t...ifDefined(\"onProgress\", onProgress)\n\t});\n\tif (!applied.ok) return notOk({\n\t\tcode: \"RUNNER_FAILED\",\n\t\tsummary: applied.failure.summary,\n\t\twhy: applied.failure.why,\n\t\tmeta: applied.failure.meta,\n\t\t...ifDefined(\"cause\", applied.failure.cause)\n\t});\n\tconst orderedAll = canonicalOrder.filter((spaceId) => perSpacePlans.has(spaceId) || atHeadResolutions.has(spaceId)).map((spaceId) => {\n\t\tif (perSpacePlans.has(spaceId)) {\n\t\t\tconst fromRunner = applied.value.orderedResolutions.find((r) => r.spaceId === spaceId);\n\t\t\tif (fromRunner !== void 0) return fromRunner;\n\t\t}\n\t\tconst entry = atHeadResolutions.get(spaceId);\n\t\tif (entry === void 0) throw new InternalError(`Unreachable: missing per-space plan for \"${spaceId}\"`);\n\t\treturn {\n\t\t\tspaceId,\n\t\t\tentry\n\t\t};\n\t});\n\tconst perSpaceAll = buildPerSpaceBreakdown(orderedAll, aggregate.app.spaceId, { includeMarkers: true });\n\tconst summary = `Applied ${applied.value.orderedResolutions.reduce((sum, r) => sum + r.entry.migrationEdges.length, 0)} migration(s) (${applied.value.totalOpsExecuted} operation(s)) across ${orderedAll.length} contract space(s)`;\n\treturn ok(buildSuccess({\n\t\taggregate,\n\t\torderedResolutions: orderedAll,\n\t\tperSpace: perSpaceAll,\n\t\ttotalOpsExecuted: applied.value.totalOpsExecuted,\n\t\tsummary\n\t}));\n}\n/**\n* Compute the graph-walk path for one contract space.\n*\n* Encapsulates the invariant-correct input assembly that both\n* `executeMigrate` and `executeMigrateShowCommand` must use:\n* - `currentMarker` carries the full live marker including `invariants`\n* (not a stripped `{ storageHash, invariants: [] }` shell).\n* - `targetInvariants` uses the caller-supplied `refInvariants` when a\n* `--to` ref was resolved (not always the file head ref's invariants).\n*\n* Both callers map the returned `SpacePathOutcome` to their own error\n* representation; the path-compute logic is shared and identical.\n*\n* @internal Exported for `executeMigrateShowCommand`.\n*/\nfunction planSpacePath({ space, aggregate, targetHash, refInvariants, liveMarker, refName }) {\n\tconst isAppSpace = space.spaceId === aggregate.app.spaceId;\n\tconst headRef = requireHeadRef(space);\n\tif (space.graph().nodes.size === 0) {\n\t\tconst liveHash = liveMarker?.storageHash;\n\t\tif (targetHash === liveHash || liveHash === void 0 && targetHash === EMPTY_CONTRACT_HASH) return {\n\t\t\tkind: \"at-head\",\n\t\t\tplan: buildAtHeadResolution({\n\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\tspace,\n\t\t\t\ttargetHash,\n\t\t\t\tliveMarker\n\t\t\t})\n\t\t};\n\t\tif (!isAppSpace && allStorageElementsExternal(space.contract())) {\n\t\t\tif (headRef.invariants.length > 0) return {\n\t\t\t\tkind: \"unsatisfiable\",\n\t\t\t\tspaceId: space.spaceId,\n\t\t\t\tisAppSpace,\n\t\t\t\tmissing: [...headRef.invariants].sort(),\n\t\t\t\ttargetInvariants: headRef.invariants,\n\t\t\t\ttargetSpace: space,\n\t\t\t\tliveHash: liveHash ?? EMPTY_CONTRACT_HASH,\n\t\t\t\trefName: void 0\n\t\t\t};\n\t\t\treturn {\n\t\t\t\tkind: \"ok\",\n\t\t\t\tplan: buildAtHeadResolution({\n\t\t\t\t\taggregateTargetId: aggregate.targetId,\n\t\t\t\t\tspace,\n\t\t\t\t\ttargetHash,\n\t\t\t\t\tliveMarker\n\t\t\t\t})\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\tkind: \"never-planned\",\n\t\t\tspaceId: space.spaceId,\n\t\t\ttargetHash\n\t\t};\n\t}\n\tconst targetInvariants = isAppSpace && refInvariants !== void 0 ? refInvariants : headRef.invariants;\n\tconst targetSpace = targetHash === headRef.hash && targetInvariants === headRef.invariants ? space : {\n\t\t...space,\n\t\theadRef: {\n\t\t\thash: targetHash,\n\t\t\tinvariants: targetInvariants\n\t\t}\n\t};\n\tconst walked = resolveRecordedPath({\n\t\taggregateTargetId: aggregate.targetId,\n\t\tspace: targetSpace,\n\t\tcurrentMarker: liveMarker,\n\t\t...isAppSpace && refName !== void 0 ? { refName } : {}\n\t});\n\tif (walked.kind === \"unreachable\") return {\n\t\tkind: \"unreachable\",\n\t\tspaceId: space.spaceId,\n\t\tliveMarker,\n\t\ttargetHash\n\t};\n\tif (walked.kind === \"unsatisfiable\") {\n\t\tconst liveHash = liveMarker?.storageHash ?? EMPTY_CONTRACT_HASH;\n\t\treturn {\n\t\t\tkind: \"unsatisfiable\",\n\t\t\tspaceId: space.spaceId,\n\t\t\tisAppSpace,\n\t\t\tmissing: walked.missing,\n\t\t\ttargetInvariants,\n\t\t\ttargetSpace,\n\t\t\tliveHash,\n\t\t\trefName\n\t\t};\n\t}\n\treturn {\n\t\tkind: \"ok\",\n\t\tplan: walked.result\n\t};\n}\n/**\n* Build a zero-op {@link PerSpacePlan} for an empty-graph space —\n* either one whose live marker already matches the target (at-head), or\n* an all-external extension space whose marker must advance to the head\n* ref with no DDL (declared-state). Lets the apply pipeline thread the\n* space through `perSpacePlans` -> `applyOrder` -> the success\n* envelope's `perSpace[]` block so the result reflects every loaded\n* space, even when there is nothing to execute.\n*/\nfunction buildAtHeadResolution(args) {\n\tconst { aggregateTargetId, space, targetHash, liveMarker } = args;\n\treturn {\n\t\tplan: {\n\t\t\ttargetId: aggregateTargetId,\n\t\t\tspaceId: space.spaceId,\n\t\t\torigin: liveMarker === null ? null : { storageHash: liveMarker.storageHash },\n\t\t\tdestination: { storageHash: targetHash },\n\t\t\toperations: [],\n\t\t\tprovidedInvariants: []\n\t\t},\n\t\tdisplayOps: [],\n\t\tdestinationContract: space.contract(),\n\t\tstrategy: \"declared-state\",\n\t\tmigrationEdges: [buildFabricatedMigrationEdge({\n\t\t\tcurrentMarkerStorageHash: liveMarker?.storageHash,\n\t\t\tdestinationStorageHash: targetHash,\n\t\t\toperationCount: 0\n\t\t})]\n\t};\n}\n/**\n* A plan needs the runner when it executes operations or advances the\n* space's marker (a declared-state resolution has zero operations but a\n* destination hash the live marker doesn't carry yet).\n*/\nfunction planRequiresExecution(entry) {\n\tif (entry.plan.operations.length > 0) return true;\n\treturn entry.plan.origin?.storageHash !== entry.plan.destination.storageHash;\n}\nfunction buildSuccess(args) {\n\tconst appResolution = args.orderedResolutions.find((r) => r.spaceId === args.aggregate.app.spaceId);\n\tconst appMarkerHash = appResolution?.entry.plan.destination.storageHash ?? requireHeadRef(args.aggregate.app).hash;\n\tconst applied = args.orderedResolutions.flatMap((r) => {\n\t\treturn r.entry.migrationEdges.map((edge) => ({\n\t\t\tspaceId: r.spaceId,\n\t\t\tdirName: edge.dirName,\n\t\t\tmigrationHash: edge.migrationHash,\n\t\t\tfrom: edge.from,\n\t\t\tto: edge.to,\n\t\t\toperationsExecuted: edge.operationCount\n\t\t}));\n\t});\n\tconst appPlan = appResolution?.entry;\n\tconst pathDecision = appPlan?.pathDecision ? {\n\t\tfromHash: appPlan.pathDecision.fromHash,\n\t\ttoHash: appPlan.pathDecision.toHash,\n\t\talternativeCount: appPlan.pathDecision.alternativeCount,\n\t\ttieBreakReasons: appPlan.pathDecision.tieBreakReasons,\n\t\t...appPlan.pathDecision.refName !== void 0 ? { refName: appPlan.pathDecision.refName } : {},\n\t\trequiredInvariants: appPlan.pathDecision.requiredInvariants ?? [],\n\t\tsatisfiedInvariants: appPlan.pathDecision.satisfiedInvariants ?? [],\n\t\tselectedPath: appPlan.pathDecision.selectedPath.map((entry) => ({\n\t\t\tdirName: entry.dirName,\n\t\t\tmigrationHash: entry.migrationHash,\n\t\t\tfrom: entry.from,\n\t\t\tto: entry.to,\n\t\t\tinvariants: entry.invariants\n\t\t}))\n\t} : void 0;\n\treturn {\n\t\tmigrationsApplied: applied.length,\n\t\tmarkerHash: appMarkerHash,\n\t\tapplied,\n\t\tsummary: args.summary,\n\t\tperSpace: args.perSpace,\n\t\t...pathDecision !== void 0 ? { pathDecision } : {}\n\t};\n}\n/**\n* Build the `neverPlanned` failure raised when a contract space that\n* declares managed storage elements has no on-disk migration graph but\n* migrate was asked to reach a target hash. All-external spaces never reach\n* this: they resolve declaratively (marker advances to the head ref with\n* zero operations). The `why` states only the condition; the recovery\n* sequence is composed by `errorPathUnreachable`'s `fix`.\n*\n* @internal Exported for testing only.\n*/\nfunction buildNeverPlannedFailure(spaceId, targetHash) {\n\treturn {\n\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\tsummary: `No on-disk migrations for contract space \"${spaceId}\"`,\n\t\twhy: `migrate is replay-only: a contract space that declares managed storage elements must have an authored migration graph on disk. Space \"${spaceId}\" has no migrations under \\`migrations/${spaceId}/\\` but its head ref targets \"${targetHash}\".`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\ttarget: targetHash,\n\t\t\tkind: \"neverPlanned\"\n\t\t}\n\t};\n}\n/**\n* Build the `pathUnreachable` failure raised when an emitted contract has no\n* on-disk migration edge from the current marker to the target. The `why`\n* states only the condition (no edge between the two named states, and migrate\n* replays edges rather than inventing them); the recovery sequence — plan the\n* edge, then re-apply — is composed by `errorPathUnreachable`'s `fix`, so the\n* two read as one non-redundant plan-then-apply story.\n*\n* @internal Exported for testing only.\n*/\nfunction buildPathNotFoundFailure(spaceId, marker, targetHash) {\n\tconst fromHash = marker?.storageHash ?? \"<empty>\";\n\treturn {\n\t\tcode: \"MIGRATION_PATH_NOT_FOUND\",\n\t\tsummary: spaceId === \"app\" ? \"Current contract has no planned migration path\" : `Current contract has no planned migration path for contract space \"${spaceId}\"`,\n\t\twhy: `No migration edge connects the current state \"${fromHash}\" to the target \"${targetHash}\" in contract space \"${spaceId}\". The on-disk migration graph does not join the two, and migrate replays existing edges — it never invents one.`,\n\t\tmeta: {\n\t\t\tspaceId,\n\t\t\tfromHash,\n\t\t\ttargetHash,\n\t\t\tkind: \"pathUnreachable\"\n\t\t}\n\t};\n}\n//#endregion\n//#region src/control-api/client.ts\n/**\n* Creates a programmatic control client for Prisma Next operations.\n*\n* The client accepts framework component descriptors at creation time,\n* manages driver lifecycle via connect()/close(), and exposes domain\n* operations that delegate to the existing family instance methods.\n*\n* @see {@link ControlClient} for the client interface\n* @see README.md \"Programmatic Control API\" section for usage examples\n*/\nfunction createControlClient(options) {\n\treturn new ControlClientImpl(options);\n}\n/**\n* Implementation of ControlClient.\n* Manages initialization and connection state, delegates operations to family instance.\n*/\nvar ControlClientImpl = class {\n\toptions;\n\tstack = null;\n\tdriver = null;\n\tfamilyInstance = null;\n\tframeworkComponents = null;\n\tinitialized = false;\n\tdefaultConnection;\n\tconstructor(options) {\n\t\tthis.options = options;\n\t\tthis.defaultConnection = options.connection;\n\t}\n\tinit() {\n\t\tif (this.initialized) return;\n\t\tthis.stack = createControlStack({\n\t\t\tfamily: this.options.family,\n\t\t\ttarget: this.options.target,\n\t\t\tadapter: this.options.adapter,\n\t\t\tdriver: this.options.driver,\n\t\t\textensions: this.options.extensions\n\t\t});\n\t\tthis.familyInstance = this.options.family.create(this.stack);\n\t\tconst rawComponents = [\n\t\t\tthis.options.target,\n\t\t\tthis.options.adapter,\n\t\t\t...this.options.extensions ?? []\n\t\t];\n\t\tthis.frameworkComponents = assertFrameworkComponentsCompatible(this.options.family.familyId, this.options.target.targetId, rawComponents);\n\t\tthis.initialized = true;\n\t}\n\tasync connect(connection) {\n\t\tthis.init();\n\t\tif (this.driver) throw new CliStructuredError(\"DRIVER.ALREADY_CONNECTED\", \"Already connected. Call close() before reconnecting.\");\n\t\tconst resolvedConnection = connection ?? this.defaultConnection;\n\t\tif (resolvedConnection === void 0) throw new CliStructuredError(\"CONFIG.DB_CONNECTION_REQUIRED\", \"No connection provided. Pass a connection to connect() or provide a default connection when creating the client.\");\n\t\tif (!this.stack?.driver) throw new CliStructuredError(\"CONFIG.DRIVER_REQUIRED\", \"Driver is not configured. Pass a driver descriptor when creating the control client to enable database operations.\");\n\t\tthis.driver = await this.stack.driver.create(resolvedConnection);\n\t}\n\tasync close() {\n\t\tif (this.driver) {\n\t\t\tawait this.driver.close();\n\t\t\tthis.driver = null;\n\t\t}\n\t}\n\t/**\n\t* Construct the control adapter once for a migration operation and return\n\t* it, mirroring how the runtime plane builds the execution adapter once in\n\t* `createExecutionStack`. Only `dbInit` / `dbUpdate` need it (it lowers the\n\t* planner's DDL); read-only operations never build it. The descriptor is\n\t* optional on the stack — targets without migrations omit it.\n\t*/\n\tbuildControlAdapter() {\n\t\tthis.init();\n\t\tif (!this.stack?.adapter) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" requires an adapter for migrations`);\n\t\treturn this.stack.adapter.create(this.stack);\n\t}\n\tasync ensureConnected() {\n\t\tthis.init();\n\t\tif (!this.driver && this.defaultConnection !== void 0) await this.connect(this.defaultConnection);\n\t\tif (!this.driver || !this.familyInstance || !this.frameworkComponents) throw new CliStructuredError(\"DRIVER.NOT_CONNECTED\", \"Not connected. Call connect(connection) first.\");\n\t\treturn {\n\t\t\tdriver: this.driver,\n\t\t\tfamilyInstance: this.familyInstance,\n\t\t\tframeworkComponents: this.frameworkComponents\n\t\t};\n\t}\n\tasync connectWithProgress(connection, action, onProgress) {\n\t\tif (connection === void 0) return;\n\t\tonProgress?.({\n\t\t\taction,\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"connect\",\n\t\t\tlabel: \"Connecting to database...\"\n\t\t});\n\t\ttry {\n\t\t\tawait this.connect(connection);\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction,\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"connect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync verify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"verify\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"verify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"verify\",\n\t\t\tlabel: \"Verifying database marker...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.verify({\n\t\t\t\tdriver,\n\t\t\t\tcontract,\n\t\t\t\texpectedTargetId: this.options.target.targetId,\n\t\t\t\tcontractPath: \"\"\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"verify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"verify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync schemaVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"schemaVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"schemaVerify\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"schemaVerify\",\n\t\t\tlabel: \"Verifying database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst schema = await familyInstance.introspect({\n\t\t\t\tdriver,\n\t\t\t\tcontract\n\t\t\t});\n\t\t\tconst result = familyInstance.verifySchema({\n\t\t\t\tcontract,\n\t\t\t\tschema,\n\t\t\t\tstrict: options.strict ?? false,\n\t\t\t\tframeworkComponents\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: result.ok ? \"ok\" : \"error\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"schemaVerify\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"schemaVerify\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync sign(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"sign\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"sign\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"sign\",\n\t\t\tlabel: \"Signing database...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.sign({\n\t\t\t\tdriver,\n\t\t\t\tcontract,\n\t\t\t\tcontractPath: options.contractPath ?? \"\",\n\t\t\t\t...ifDefined(\"configPath\", options.configPath)\n\t\t\t});\n\t\t\tonProgress?.({\n\t\t\t\taction: \"sign\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"sign\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"sign\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"sign\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\tasync dbInit(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbInit\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeDbInit({\n\t\t\tdriver,\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbUpdate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbUpdate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tconst adapter = this.buildControlAdapter();\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeDbUpdate({\n\t\t\tdriver,\n\t\t\tadapter,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmode: options.mode,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\t...ifDefined(\"acceptDataLoss\", options.acceptDataLoss),\n\t\t\t...ifDefined(\"consent\", options.consent),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync dbVerify(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"dbVerify\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\treturn executeDbVerify({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract: options.contract,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\tframeworkComponents,\n\t\t\tmode: options.strict ? \"strict\" : \"lenient\",\n\t\t\tskipSchema: options.skipSchema,\n\t\t\tskipMarker: options.skipMarker,\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync readMarker() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readMarker({\n\t\t\tdriver,\n\t\t\tspace: APP_SPACE_ID\n\t\t});\n\t}\n\tasync readAllMarkers() {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readAllMarkers({ driver });\n\t}\n\t/** Reads the per-migration journal; omit `space` to return every space. */\n\tasync readLedger(space) {\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\treturn familyInstance.readLedger({\n\t\t\tdriver,\n\t\t\t...ifDefined(\"space\", space)\n\t\t});\n\t}\n\tasync migrate(options) {\n\t\tconst { onProgress } = options;\n\t\tawait this.connectWithProgress(options.connection, \"migrate\", onProgress);\n\t\tconst { driver, familyInstance, frameworkComponents } = await this.ensureConnected();\n\t\tif (!hasMigrations(this.options.target)) throw new CliStructuredError(\"MIGRATION.TARGET_UNSUPPORTED\", `Target \"${this.options.target.targetId}\" does not support migrations`);\n\t\tlet contract;\n\t\ttry {\n\t\t\tcontract = familyInstance.deserializeContract(options.contract);\n\t\t} catch (error) {\n\t\t\tthrow structuredError(\"CONTRACT.VALIDATION_FAILED\", error instanceof Error ? error.message : String(error), { cause: error });\n\t\t}\n\t\treturn executeMigrate({\n\t\t\tdriver,\n\t\t\tfamilyInstance,\n\t\t\tcontract,\n\t\t\tmigrations: this.options.target.migrations,\n\t\t\tframeworkComponents,\n\t\t\tmigrationsDir: options.migrationsDir,\n\t\t\textensions: this.options.extensions ?? [],\n\t\t\ttargetId: this.options.target.targetId,\n\t\t\t...ifDefined(\"refHash\", options.refHash),\n\t\t\t...ifDefined(\"refInvariants\", options.refInvariants),\n\t\t\t...ifDefined(\"refName\", options.refName),\n\t\t\t...ifDefined(\"onProgress\", onProgress)\n\t\t});\n\t}\n\tasync introspect(options) {\n\t\tconst onProgress = options?.onProgress;\n\t\tawait this.connectWithProgress(options?.connection, \"introspect\", onProgress);\n\t\tconst { driver, familyInstance } = await this.ensureConnected();\n\t\toptions?.schema;\n\t\tonProgress?.({\n\t\t\taction: \"introspect\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"introspect\",\n\t\t\tlabel: \"Introspecting database schema...\"\n\t\t});\n\t\ttry {\n\t\t\tconst result = await familyInstance.introspect({ driver });\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn result;\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"introspect\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"introspect\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tthrow error;\n\t\t}\n\t}\n\ttoSchemaView(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasSchemaView(this.familyInstance)) return this.familyInstance.toSchemaView(schemaIR);\n\t}\n\tinferPslContract(schemaIR) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasPslContractInfer(this.familyInstance)) return this.familyInstance.inferPslContract(schemaIR);\n\t}\n\tgetPslBlockDescriptors() {\n\t\tthis.init();\n\t\treturn this.stack.authoringContributions.pslBlockDescriptors;\n\t}\n\ttoOperationPreview(operations) {\n\t\tthis.init();\n\t\tif (this.familyInstance && hasOperationPreview(this.familyInstance)) return this.familyInstance.toOperationPreview(operations);\n\t}\n\tasync emit(options) {\n\t\tconst { onProgress, contractConfig } = options;\n\t\tthis.init();\n\t\tif (!this.familyInstance) throw new InternalError(\"Family instance was not initialized. This is a bug.\");\n\t\tlet contractRaw;\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"resolveSource\",\n\t\t\tlabel: \"Resolving contract source...\"\n\t\t});\n\t\ttry {\n\t\t\tconst stack = this.stack;\n\t\t\tconst sourceContext = {\n\t\t\t\tcomposedExtensions: stack.extensions.map((p) => p.id),\n\t\t\t\tcomposedExtensionContracts: stack.extensionContracts,\n\t\t\t\tauthoringContributions: stack.authoringContributions,\n\t\t\t\tcodecLookup: stack.codecLookup,\n\t\t\t\tcontrolMutationDefaults: stack.controlMutationDefaults,\n\t\t\t\tresolvedInputs: contractConfig.source.inputs ?? [],\n\t\t\t\tcapabilities: stack.capabilities\n\t\t\t};\n\t\t\tconst providerResult = await contractConfig.source.load(sourceContext);\n\t\t\tif (!providerResult.ok) {\n\t\t\t\tonProgress?.({\n\t\t\t\t\taction: \"emit\",\n\t\t\t\t\tkind: \"spanEnd\",\n\t\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\t\toutcome: \"error\"\n\t\t\t\t});\n\t\t\t\treturn notOk({\n\t\t\t\t\tcode: \"CONTRACT_SOURCE_INVALID\",\n\t\t\t\t\tsummary: providerResult.failure.summary,\n\t\t\t\t\twhy: providerResult.failure.summary,\n\t\t\t\t\tmeta: providerResult.failure.meta,\n\t\t\t\t\tdiagnostics: providerResult.failure\n\t\t\t\t});\n\t\t\t}\n\t\t\tcontractRaw = providerResult.value;\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"resolveSource\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treturn notOk({\n\t\t\t\tcode: \"CONTRACT_SOURCE_INVALID\",\n\t\t\t\tsummary: \"Failed to resolve contract source\",\n\t\t\t\twhy: message,\n\t\t\t\tdiagnostics: {\n\t\t\t\t\tsummary: \"Contract source provider threw an exception\",\n\t\t\t\t\tdiagnostics: [{\n\t\t\t\t\t\tcode: \"PROVIDER_THROW\",\n\t\t\t\t\t\tmessage\n\t\t\t\t\t}]\n\t\t\t\t},\n\t\t\t\tmeta: void 0\n\t\t\t});\n\t\t}\n\t\tonProgress?.({\n\t\t\taction: \"emit\",\n\t\t\tkind: \"spanStart\",\n\t\t\tspanId: \"emit\",\n\t\t\tlabel: \"Emitting contract...\"\n\t\t});\n\t\ttry {\n\t\t\tconst enrichedIR = enrichContract(contractRaw, this.frameworkComponents ?? []);\n\t\t\tconst rawContractJson = this.options.target.contractSerializer.serializeContract(enrichedIR);\n\t\t\tlet deserializedContract;\n\t\t\ttry {\n\t\t\t\tdeserializedContract = this.familyInstance.deserializeContract(rawContractJson);\n\t\t\t} catch (error) {\n\t\t\t\tonProgress?.({\n\t\t\t\t\taction: \"emit\",\n\t\t\t\t\tkind: \"spanEnd\",\n\t\t\t\t\tspanId: \"emit\",\n\t\t\t\t\toutcome: \"error\"\n\t\t\t\t});\n\t\t\t\treturn notOk({\n\t\t\t\t\tcode: \"CONTRACT_VALIDATION_FAILED\",\n\t\t\t\t\tsummary: \"Contract validation failed\",\n\t\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\t\tmeta: void 0\n\t\t\t\t});\n\t\t\t}\n\t\t\tconst result = await emit(deserializedContract, this.stack, this.options.family.emission, { serializeContract: (contract) => this.options.target.contractSerializer.serializeContract(contract) });\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"ok\"\n\t\t\t});\n\t\t\treturn ok({\n\t\t\t\tstorageHash: result.storageHash,\n\t\t\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t\t\tprofileHash: result.profileHash,\n\t\t\t\tcontractJson: result.contractJson,\n\t\t\t\tcontractDts: result.contractDts\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tonProgress?.({\n\t\t\t\taction: \"emit\",\n\t\t\t\tkind: \"spanEnd\",\n\t\t\t\tspanId: \"emit\",\n\t\t\t\toutcome: \"error\"\n\t\t\t});\n\t\t\treturn notOk({\n\t\t\t\tcode: \"EMIT_FAILED\",\n\t\t\t\tsummary: \"Failed to emit contract\",\n\t\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\t\tmeta: void 0\n\t\t\t});\n\t\t}\n\t}\n};\n//#endregion\nexport { executeDbInit as a, executeDbUpdate as i, planSpacePath as n, executeDbVerify as r, createControlClient as t };\n\n//# sourceMappingURL=client-C6Qp5ujC.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAuBA,SAAS,gBAAgB,YAAY;CACpC,OAAO,WAAW,KAAK,QAAQ;EAC9B,IAAI,GAAG;EACP,OAAO,GAAG;EACV,gBAAgB,GAAG;CACpB,EAAE;AACH;;;;;;;;AAUA,SAAS,gBAAgB,MAAM;CAC9B,MAAM,YAAY,iBAAiB;EAClC,YAAY,KAAK;EACjB,aAAa,EAAE,aAAa,KAAK,YAAY,YAAY;CAC1D,CAAC;CACD,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,SAAS,CAAC,CAAC,OAAO,KAAK;AAC3D;;;;;AAOA,MAAM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0 @@
|
|
|
1
|
-
import { i as createScaffoldSpecifierResolver } from "./import-roots-NDOIEDVj.mjs";
|
|
2
|
-
import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
|
|
3
|
-
import { DEFAULT_CONTRACT_SOURCE_DIR } from "@prisma/orm-framework/config/config-types";
|
|
4
|
-
//#region ../../../1-framework/3-tooling/cli/dist/code-templates-D_sGnEF6.mjs
|
|
5
|
-
var version = "8.0.0-rc.1-dev.44";
|
|
6
|
-
/**
|
|
7
|
-
* The resolver a scaffold for `target` is written against.
|
|
8
|
-
*
|
|
9
|
-
* A scaffold is always on the facade root: `init` writes an application around
|
|
10
|
-
* one database package, and the workspace names are not published, so a project
|
|
11
|
-
* scaffolded against them could not install (ADR 242). Both the files `init`
|
|
12
|
-
* writes and the dependency it adds go through this, so they cannot disagree.
|
|
13
|
-
*/
|
|
14
|
-
function scaffoldSpecifierResolverFor(target) {
|
|
15
|
-
return createScaffoldSpecifierResolver({
|
|
16
|
-
mode: "facade",
|
|
17
|
-
facade: target === "postgres" ? "@prisma/orm-postgres" : "@prisma/orm-mongo"
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* The package name a scaffolded project depends on and imports from, for the
|
|
22
|
-
* import root it is being scaffolded against.
|
|
23
|
-
*
|
|
24
|
-
* Every specifier the scaffold writes derives from this one, and `init` builds
|
|
25
|
-
* a single resolver and hands it to both the file templates and the dependency
|
|
26
|
-
* it installs — so the two cannot disagree. The one caller that deliberately
|
|
27
|
-
* does not thread a resolver is the re-init cleanup in `inputs.ts`, which
|
|
28
|
-
* inspects a manifest an earlier run wrote rather than writing one.
|
|
29
|
-
*
|
|
30
|
-
* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`
|
|
31
|
-
* in the publish-surface package, which rejects the roots a facade-shaped
|
|
32
|
-
* scaffold cannot express. (Named without its scope on purpose: JSDoc survives
|
|
33
|
-
* into the published bundle, where an internal package name would trip the
|
|
34
|
-
* shell tarball checks.)
|
|
35
|
-
*/
|
|
36
|
-
function targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
37
|
-
return resolveImportSpecifier(target === "postgres" ? "@internal/postgres" : "@internal/mongo");
|
|
38
|
-
}
|
|
39
|
-
/** One entrypoint of the scaffolded project's target package. */
|
|
40
|
-
function targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
41
|
-
return resolveImportSpecifier(`${target === "postgres" ? "@internal/postgres" : "@internal/mongo"}/${subpath}`);
|
|
42
|
-
}
|
|
43
|
-
function targetLabel(target) {
|
|
44
|
-
return target === "postgres" ? "PostgreSQL" : "MongoDB";
|
|
45
|
-
}
|
|
46
|
-
function defaultSchemaPath(authoring) {
|
|
47
|
-
if (authoring === "typescript") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;
|
|
48
|
-
return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;
|
|
49
|
-
}
|
|
50
|
-
function starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
51
|
-
if (authoring === "typescript") {
|
|
52
|
-
const builder = targetEntrypoint(target, "contract-builder", resolveImportSpecifier);
|
|
53
|
-
return target === "mongo" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);
|
|
54
|
-
}
|
|
55
|
-
return target === "mongo" ? starterSchemaPslMongo() : starterSchemaPslPostgres();
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Renders a short authoring-appropriate schema sample (FR5.1) for embedding
|
|
59
|
-
* in `prisma-next.md`. Returns a complete fenced markdown code block.
|
|
60
|
-
*
|
|
61
|
-
* The sample intentionally shows just one model: it's illustrative, not
|
|
62
|
-
* a substitute for the full scaffolded contract file. The TS samples use
|
|
63
|
-
* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading
|
|
64
|
-
* the doc and the file side-by-side sees the same structure.
|
|
65
|
-
*/
|
|
66
|
-
function schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
67
|
-
if (authoring === "typescript") {
|
|
68
|
-
const builder = targetEntrypoint(target, "contract-builder", resolveImportSpecifier);
|
|
69
|
-
return target === "mongo" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);
|
|
70
|
-
}
|
|
71
|
-
return target === "mongo" ? schemaSamplePslMongo() : schemaSamplePslPostgres();
|
|
72
|
-
}
|
|
73
|
-
function schemaSamplePslPostgres() {
|
|
74
|
-
return `\`\`\`prisma
|
|
75
|
-
model User {
|
|
76
|
-
id Int @id @default(autoincrement())
|
|
77
|
-
email String @unique
|
|
78
|
-
username String?
|
|
79
|
-
name String?
|
|
80
|
-
}
|
|
81
|
-
\`\`\``;
|
|
82
|
-
}
|
|
83
|
-
function schemaSamplePslMongo() {
|
|
84
|
-
return `\`\`\`prisma
|
|
85
|
-
model User {
|
|
86
|
-
id ObjectId @id @map("_id")
|
|
87
|
-
email String @unique
|
|
88
|
-
username String?
|
|
89
|
-
name String?
|
|
90
|
-
@@map("users")
|
|
91
|
-
}
|
|
92
|
-
\`\`\``;
|
|
93
|
-
}
|
|
94
|
-
function schemaSampleTsPostgres(builder) {
|
|
95
|
-
return `\`\`\`typescript
|
|
96
|
-
import { defineContract } from '${builder}';
|
|
97
|
-
|
|
98
|
-
export const contract = defineContract(
|
|
99
|
-
{},
|
|
100
|
-
({ field, model }) => ({
|
|
101
|
-
models: {
|
|
102
|
-
User: model('User', {
|
|
103
|
-
fields: {
|
|
104
|
-
id: field.id.uuidv7String(),
|
|
105
|
-
email: field.text().unique(),
|
|
106
|
-
username: field.text().optional(),
|
|
107
|
-
name: field.text().optional(),
|
|
108
|
-
},
|
|
109
|
-
}),
|
|
110
|
-
},
|
|
111
|
-
}),
|
|
112
|
-
);
|
|
113
|
-
\`\`\``;
|
|
114
|
-
}
|
|
115
|
-
function schemaSampleTsMongo(builder) {
|
|
116
|
-
return `\`\`\`typescript
|
|
117
|
-
import { defineContract } from '${builder}';
|
|
118
|
-
|
|
119
|
-
export const contract = defineContract(
|
|
120
|
-
{},
|
|
121
|
-
({ field, model }) => ({
|
|
122
|
-
models: {
|
|
123
|
-
User: model('User', {
|
|
124
|
-
collection: 'users',
|
|
125
|
-
fields: {
|
|
126
|
-
_id: field.objectId(),
|
|
127
|
-
email: field.string(),
|
|
128
|
-
username: field.string().optional(),
|
|
129
|
-
name: field.string().optional(),
|
|
130
|
-
},
|
|
131
|
-
}),
|
|
132
|
-
},
|
|
133
|
-
}),
|
|
134
|
-
);
|
|
135
|
-
\`\`\``;
|
|
136
|
-
}
|
|
137
|
-
function starterSchemaPslPostgres() {
|
|
138
|
-
return `// use prisma-next
|
|
139
|
-
|
|
140
|
-
model User {
|
|
141
|
-
id Int @id @default(autoincrement())
|
|
142
|
-
email String @unique
|
|
143
|
-
username String?
|
|
144
|
-
name String?
|
|
145
|
-
posts Post[]
|
|
146
|
-
createdAt DateTime @default(now())
|
|
147
|
-
updatedAt temporal.updatedAt()
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
model Post {
|
|
151
|
-
id Int @id @default(autoincrement())
|
|
152
|
-
title String
|
|
153
|
-
content String?
|
|
154
|
-
author User @relation(fields: [authorId], references: [id])
|
|
155
|
-
authorId Int
|
|
156
|
-
createdAt DateTime @default(now())
|
|
157
|
-
updatedAt temporal.updatedAt()
|
|
158
|
-
}
|
|
159
|
-
`;
|
|
160
|
-
}
|
|
161
|
-
function starterSchemaPslMongo() {
|
|
162
|
-
return `// use prisma-next
|
|
163
|
-
|
|
164
|
-
model User {
|
|
165
|
-
id ObjectId @id @map("_id")
|
|
166
|
-
email String @unique
|
|
167
|
-
username String?
|
|
168
|
-
name String?
|
|
169
|
-
posts Post[]
|
|
170
|
-
@@map("users")
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
model Post {
|
|
174
|
-
id ObjectId @id @map("_id")
|
|
175
|
-
title String
|
|
176
|
-
content String?
|
|
177
|
-
author User @relation(fields: [authorId], references: [id])
|
|
178
|
-
authorId ObjectId
|
|
179
|
-
@@map("posts")
|
|
180
|
-
}
|
|
181
|
-
`;
|
|
182
|
-
}
|
|
183
|
-
function starterSchemaTsPostgres(builder) {
|
|
184
|
-
return `import { defineContract } from '${builder}';
|
|
185
|
-
|
|
186
|
-
export const contract = defineContract(
|
|
187
|
-
{},
|
|
188
|
-
({ field, model, rel }) => ({
|
|
189
|
-
models: {
|
|
190
|
-
User: model('User', {
|
|
191
|
-
fields: {
|
|
192
|
-
id: field.id.uuidv7String(),
|
|
193
|
-
email: field.text().unique(),
|
|
194
|
-
username: field.text().optional(),
|
|
195
|
-
name: field.text().optional(),
|
|
196
|
-
createdAt: field.temporal.createdAt(),
|
|
197
|
-
updatedAt: field.temporal.updatedAt(),
|
|
198
|
-
},
|
|
199
|
-
relations: {
|
|
200
|
-
posts: rel.hasMany('Post', { by: 'authorId' }),
|
|
201
|
-
},
|
|
202
|
-
}),
|
|
203
|
-
|
|
204
|
-
Post: model('Post', {
|
|
205
|
-
fields: {
|
|
206
|
-
id: field.id.uuidv7String(),
|
|
207
|
-
title: field.text(),
|
|
208
|
-
content: field.text().optional(),
|
|
209
|
-
authorId: field.uuidString(),
|
|
210
|
-
createdAt: field.temporal.createdAt(),
|
|
211
|
-
updatedAt: field.temporal.updatedAt(),
|
|
212
|
-
},
|
|
213
|
-
relations: {
|
|
214
|
-
author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),
|
|
215
|
-
},
|
|
216
|
-
}),
|
|
217
|
-
},
|
|
218
|
-
}),
|
|
219
|
-
);
|
|
220
|
-
`;
|
|
221
|
-
}
|
|
222
|
-
function starterSchemaTsMongo(builder) {
|
|
223
|
-
return `import { defineContract } from '${builder}';
|
|
224
|
-
|
|
225
|
-
export const contract = defineContract(
|
|
226
|
-
{},
|
|
227
|
-
({ field, model, rel }) => ({
|
|
228
|
-
models: {
|
|
229
|
-
User: model('User', {
|
|
230
|
-
collection: 'users',
|
|
231
|
-
fields: {
|
|
232
|
-
_id: field.objectId(),
|
|
233
|
-
email: field.string(),
|
|
234
|
-
username: field.string().optional(),
|
|
235
|
-
name: field.string().optional(),
|
|
236
|
-
},
|
|
237
|
-
relations: {
|
|
238
|
-
posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),
|
|
239
|
-
},
|
|
240
|
-
}),
|
|
241
|
-
|
|
242
|
-
Post: model('Post', {
|
|
243
|
-
collection: 'posts',
|
|
244
|
-
fields: {
|
|
245
|
-
_id: field.objectId(),
|
|
246
|
-
title: field.string(),
|
|
247
|
-
content: field.string().optional(),
|
|
248
|
-
authorId: field.objectId(),
|
|
249
|
-
},
|
|
250
|
-
relations: {
|
|
251
|
-
author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),
|
|
252
|
-
},
|
|
253
|
-
}),
|
|
254
|
-
},
|
|
255
|
-
}),
|
|
256
|
-
);
|
|
257
|
-
`;
|
|
258
|
-
}
|
|
259
|
-
function configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
260
|
-
return `import 'dotenv/config';
|
|
261
|
-
import { defineConfig } from '${targetEntrypoint(target, "config", resolveImportSpecifier)}';
|
|
262
|
-
|
|
263
|
-
export default defineConfig({
|
|
264
|
-
contract: ${JSON.stringify(contractPath)},
|
|
265
|
-
db: {
|
|
266
|
-
connection: process.env['DATABASE_URL']!,
|
|
267
|
-
},
|
|
268
|
-
});
|
|
269
|
-
`;
|
|
270
|
-
}
|
|
271
|
-
function dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {
|
|
272
|
-
const runtime = targetEntrypoint(target, "runtime", resolveImportSpecifier);
|
|
273
|
-
if (target === "postgres") return `import postgres from '${runtime}';
|
|
274
|
-
import type { Contract } from './contract.d';
|
|
275
|
-
import contractJson from './contract.json' with { type: 'json' };
|
|
276
|
-
|
|
277
|
-
export const db = postgres<Contract>({
|
|
278
|
-
contractJson,
|
|
279
|
-
url: process.env['DATABASE_URL']!,
|
|
280
|
-
});
|
|
281
|
-
`;
|
|
282
|
-
return `import mongo from '${runtime}';
|
|
283
|
-
import type { Contract } from './contract.d';
|
|
284
|
-
import contractJson from './contract.json' with { type: 'json' };
|
|
285
|
-
|
|
286
|
-
export const db = mongo<Contract>({
|
|
287
|
-
contractJson,
|
|
288
|
-
url: process.env['DATABASE_URL']!,
|
|
289
|
-
});
|
|
290
|
-
`;
|
|
291
|
-
}
|
|
292
|
-
//#endregion
|
|
293
|
-
export { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t, version as u };
|
|
294
|
-
|
|
295
|
-
//# sourceMappingURL=code-templates-D_sGnEF6-DRLPzlq8.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"code-templates-D_sGnEF6-DRLPzlq8.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/code-templates-D_sGnEF6.mjs"],"sourcesContent":["import { createScaffoldSpecifierResolver } from \"@internal/publish-surface/import-roots\";\nimport { DEFAULT_CONTRACT_SOURCE_DIR } from \"@internal/config/config-types\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\n//#region package.json\nvar version = \"8.0.0-rc.1-dev.44\";\n//#endregion\n//#region src/commands/init/templates/code-templates.ts\n/**\n* The resolver a scaffold for `target` is written against.\n*\n* A scaffold is always on the facade root: `init` writes an application around\n* one database package, and the workspace names are not published, so a project\n* scaffolded against them could not install (ADR 242). Both the files `init`\n* writes and the dependency it adds go through this, so they cannot disagree.\n*/\nfunction scaffoldSpecifierResolverFor(target) {\n\treturn createScaffoldSpecifierResolver({\n\t\tmode: \"facade\",\n\t\tfacade: target === \"postgres\" ? \"@prisma/orm-postgres\" : \"@prisma/orm-mongo\"\n\t});\n}\n/**\n* The package name a scaffolded project depends on and imports from, for the\n* import root it is being scaffolded against.\n*\n* Every specifier the scaffold writes derives from this one, and `init` builds\n* a single resolver and hands it to both the file templates and the dependency\n* it installs — so the two cannot disagree. The one caller that deliberately\n* does not thread a resolver is the re-init cleanup in `inputs.ts`, which\n* inspects a manifest an earlier run wrote rather than writing one.\n*\n* Resolvers for scaffolding should come from `createScaffoldSpecifierResolver`\n* in the publish-surface package, which rejects the roots a facade-shaped\n* scaffold cannot express. (Named without its scope on purpose: JSDoc survives\n* into the published bundle, where an internal package name would trip the\n* shell tarball checks.)\n*/\nfunction targetPackageName(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\");\n}\n/** One entrypoint of the scaffolded project's target package. */\nfunction targetEntrypoint(target, subpath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn resolveImportSpecifier(`${target === \"postgres\" ? \"@internal/postgres\" : \"@internal/mongo\"}/${subpath}`);\n}\nfunction targetLabel(target) {\n\treturn target === \"postgres\" ? \"PostgreSQL\" : \"MongoDB\";\n}\nfunction defaultSchemaPath(authoring) {\n\tif (authoring === \"typescript\") return `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.ts`;\n\treturn `${DEFAULT_CONTRACT_SOURCE_DIR}/contract.prisma`;\n}\nfunction starterSchema(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? starterSchemaTsMongo(builder) : starterSchemaTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? starterSchemaPslMongo() : starterSchemaPslPostgres();\n}\n/**\n* Renders a short authoring-appropriate schema sample (FR5.1) for embedding\n* in `prisma-next.md`. Returns a complete fenced markdown code block.\n*\n* The sample intentionally shows just one model: it's illustrative, not\n* a substitute for the full scaffolded contract file. The TS samples use\n* the same outer shape as `starterSchemaTs*` (FR5.3) so a user reading\n* the doc and the file side-by-side sees the same structure.\n*/\nfunction schemaSample(target, authoring, resolveImportSpecifier = keepInternalSpecifiers) {\n\tif (authoring === \"typescript\") {\n\t\tconst builder = targetEntrypoint(target, \"contract-builder\", resolveImportSpecifier);\n\t\treturn target === \"mongo\" ? schemaSampleTsMongo(builder) : schemaSampleTsPostgres(builder);\n\t}\n\treturn target === \"mongo\" ? schemaSamplePslMongo() : schemaSamplePslPostgres();\n}\nfunction schemaSamplePslPostgres() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n}\n\\`\\`\\``;\n}\nfunction schemaSamplePslMongo() {\n\treturn `\\`\\`\\`prisma\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n @@map(\"users\")\n}\n\\`\\`\\``;\n}\nfunction schemaSampleTsPostgres(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction schemaSampleTsMongo(builder) {\n\treturn `\\`\\`\\`typescript\nimport { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n }),\n },\n }),\n);\n\\`\\`\\``;\n}\nfunction starterSchemaPslPostgres() {\n\treturn `// use prisma-next\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n username String?\n name String?\n posts Post[]\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n createdAt DateTime @default(now())\n updatedAt temporal.updatedAt()\n}\n`;\n}\nfunction starterSchemaPslMongo() {\n\treturn `// use prisma-next\n\nmodel User {\n id ObjectId @id @map(\"_id\")\n email String @unique\n username String?\n name String?\n posts Post[]\n @@map(\"users\")\n}\n\nmodel Post {\n id ObjectId @id @map(\"_id\")\n title String\n content String?\n author User @relation(fields: [authorId], references: [id])\n authorId ObjectId\n @@map(\"posts\")\n}\n`;\n}\nfunction starterSchemaTsPostgres(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n fields: {\n id: field.id.uuidv7String(),\n email: field.text().unique(),\n username: field.text().optional(),\n name: field.text().optional(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n posts: rel.hasMany('Post', { by: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n fields: {\n id: field.id.uuidv7String(),\n title: field.text(),\n content: field.text().optional(),\n authorId: field.uuidString(),\n createdAt: field.temporal.createdAt(),\n updatedAt: field.temporal.updatedAt(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: 'id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction starterSchemaTsMongo(builder) {\n\treturn `import { defineContract } from '${builder}';\n\nexport const contract = defineContract(\n {},\n ({ field, model, rel }) => ({\n models: {\n User: model('User', {\n collection: 'users',\n fields: {\n _id: field.objectId(),\n email: field.string(),\n username: field.string().optional(),\n name: field.string().optional(),\n },\n relations: {\n posts: rel.hasMany('Post', { from: '_id', to: 'authorId' }),\n },\n }),\n\n Post: model('Post', {\n collection: 'posts',\n fields: {\n _id: field.objectId(),\n title: field.string(),\n content: field.string().optional(),\n authorId: field.objectId(),\n },\n relations: {\n author: rel.belongsTo('User', { from: 'authorId', to: '_id' }),\n },\n }),\n },\n }),\n);\n`;\n}\nfunction configFile(target, contractPath, resolveImportSpecifier = keepInternalSpecifiers) {\n\treturn `import 'dotenv/config';\nimport { defineConfig } from '${targetEntrypoint(target, \"config\", resolveImportSpecifier)}';\n\nexport default defineConfig({\n contract: ${JSON.stringify(contractPath)},\n db: {\n connection: process.env['DATABASE_URL']!,\n },\n});\n`;\n}\nfunction dbFile(target, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst runtime = targetEntrypoint(target, \"runtime\", resolveImportSpecifier);\n\tif (target === \"postgres\") return `import postgres from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = postgres<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n\treturn `import mongo from '${runtime}';\nimport type { Contract } from './contract.d';\nimport contractJson from './contract.json' with { type: 'json' };\n\nexport const db = mongo<Contract>({\n contractJson,\n url: process.env['DATABASE_URL']!,\n});\n`;\n}\n//#endregion\nexport { schemaSample as a, targetLabel as c, scaffoldSpecifierResolverFor as i, targetPackageName as l, dbFile as n, starterSchema as o, defaultSchemaPath as r, targetEntrypoint as s, configFile as t, version as u };\n\n//# sourceMappingURL=code-templates-D_sGnEF6.mjs.map"],"mappings":";;;;AAIA,IAAI,UAAU;;;;;;;;;AAWd,SAAS,6BAA6B,QAAQ;CAC7C,OAAO,gCAAgC;EACtC,MAAM;EACN,QAAQ,WAAW,aAAa,yBAAyB;CAC1D,CAAC;AACF;;;;;;;;;;;;;;;;;AAiBA,SAAS,kBAAkB,QAAQ,yBAAyB,wBAAwB;CACnF,OAAO,uBAAuB,WAAW,aAAa,uBAAuB,iBAAiB;AAC/F;;AAEA,SAAS,iBAAiB,QAAQ,SAAS,yBAAyB,wBAAwB;CAC3F,OAAO,uBAAuB,GAAG,WAAW,aAAa,uBAAuB,kBAAkB,GAAG,SAAS;AAC/G;AACA,SAAS,YAAY,QAAQ;CAC5B,OAAO,WAAW,aAAa,eAAe;AAC/C;AACA,SAAS,kBAAkB,WAAW;CACrC,IAAI,cAAc,cAAc,OAAO,GAAG,4BAA4B;CACtE,OAAO,GAAG,4BAA4B;AACvC;AACA,SAAS,cAAc,QAAQ,WAAW,yBAAyB,wBAAwB;CAC1F,IAAI,cAAc,cAAc;EAC/B,MAAM,UAAU,iBAAiB,QAAQ,oBAAoB,s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,OAAO,yBAAyB,QAAQ;;;;;;;;;CASnE,OAAO,sBAAsB,QAAQ;;;;;;;;;AAStC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { InternalError } from "@prisma/orm-framework/utils/internal-error";
|
|
2
|
-
//#region ../../../1-framework/3-tooling/cli/dist/combine-verify-results-B87B_pMc.mjs
|
|
3
|
-
/**
|
|
4
|
-
* Collapse the aggregate verifier's per-space contract-satisfaction results
|
|
5
|
-
* into a single {@link VerifyDatabaseSchemaResult} for the CLI display
|
|
6
|
-
* surface, and carry the deduplicated unclaimed-elements list alongside it.
|
|
7
|
-
* Concatenates the issue lists across spaces; uses the app space's result as
|
|
8
|
-
* the structural envelope (storage hash, target). Extras are already
|
|
9
|
-
* stripped from each per-space result, so nothing here duplicates an
|
|
10
|
-
* unclaimed element per space.
|
|
11
|
-
*
|
|
12
|
-
* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails
|
|
13
|
-
* the combined verdict (`ok: false`); in lenient mode it is carried for
|
|
14
|
-
* informational rendering only. The list itself is returned unchanged for the
|
|
15
|
-
* renderer.
|
|
16
|
-
*
|
|
17
|
-
* **Summary policy.** Preserve the per-family phrasing whenever the
|
|
18
|
-
* combined `ok` flag agrees with the app space's `ok` flag — this is
|
|
19
|
-
* the common case (single-family deployments, single-app deployments)
|
|
20
|
-
* and the family's "satisfies / does not satisfy contract" phrasing
|
|
21
|
-
* stays user-visible. When the app passes but an extension fails (or
|
|
22
|
-
* vice versa) the app's summary contradicts the envelope, so fall back
|
|
23
|
-
* to the first failing space's summary. This keeps family phrasing
|
|
24
|
-
* intact and the envelope internally consistent (`ok: false` ↔ failure
|
|
25
|
-
* summary).
|
|
26
|
-
*/
|
|
27
|
-
function combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {
|
|
28
|
-
const appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;
|
|
29
|
-
if (appResult === void 0) throw new InternalError("Aggregate verifier returned no per-space verify results — this is a wiring bug.");
|
|
30
|
-
let okAll = true;
|
|
31
|
-
let firstFailure;
|
|
32
|
-
let issues = [];
|
|
33
|
-
let warningIssues = [];
|
|
34
|
-
for (const [, result] of perSpace) {
|
|
35
|
-
if (!result.ok) {
|
|
36
|
-
okAll = false;
|
|
37
|
-
if (firstFailure === void 0) firstFailure = result;
|
|
38
|
-
}
|
|
39
|
-
issues = [...issues, ...result.schema.issues];
|
|
40
|
-
warningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];
|
|
41
|
-
}
|
|
42
|
-
const unclaimedFails = strict && unclaimed.length > 0;
|
|
43
|
-
const ok = okAll && !unclaimedFails;
|
|
44
|
-
const summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? "" : "s"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;
|
|
45
|
-
return {
|
|
46
|
-
result: {
|
|
47
|
-
ok,
|
|
48
|
-
...ok ? {} : { code: appResult.code ?? "CONTRACT.MARKER_REQUIRED" },
|
|
49
|
-
summary,
|
|
50
|
-
contract: appResult.contract,
|
|
51
|
-
target: appResult.target,
|
|
52
|
-
schema: {
|
|
53
|
-
issues,
|
|
54
|
-
warnings: { issues: warningIssues }
|
|
55
|
-
},
|
|
56
|
-
meta: { strict },
|
|
57
|
-
timings: { total: 0 }
|
|
58
|
-
},
|
|
59
|
-
unclaimed
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { combineVerifyResults as t };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=combine-verify-results-B87B_pMc-D4l22OqY.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"combine-verify-results-B87B_pMc-D4l22OqY.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/combine-verify-results-B87B_pMc.mjs"],"sourcesContent":["import { InternalError } from \"@internal/utils/internal-error\";\n//#region src/utils/combine-verify-results.ts\n/**\n* Collapse the aggregate verifier's per-space contract-satisfaction results\n* into a single {@link VerifyDatabaseSchemaResult} for the CLI display\n* surface, and carry the deduplicated unclaimed-elements list alongside it.\n* Concatenates the issue lists across spaces; uses the app space's result as\n* the structural envelope (storage hash, target). Extras are already\n* stripped from each per-space result, so nothing here duplicates an\n* unclaimed element per space.\n*\n* **Unclaimed disposition.** In strict mode a non-empty `unclaimed` list fails\n* the combined verdict (`ok: false`); in lenient mode it is carried for\n* informational rendering only. The list itself is returned unchanged for the\n* renderer.\n*\n* **Summary policy.** Preserve the per-family phrasing whenever the\n* combined `ok` flag agrees with the app space's `ok` flag — this is\n* the common case (single-family deployments, single-app deployments)\n* and the family's \"satisfies / does not satisfy contract\" phrasing\n* stays user-visible. When the app passes but an extension fails (or\n* vice versa) the app's summary contradicts the envelope, so fall back\n* to the first failing space's summary. This keeps family phrasing\n* intact and the envelope internally consistent (`ok: false` ↔ failure\n* summary).\n*/\nfunction combineVerifyResults(perSpace, appSpaceId, strict, unclaimed) {\n\tconst appResult = perSpace.get(appSpaceId) ?? perSpace.values().next().value;\n\tif (appResult === void 0) throw new InternalError(\"Aggregate verifier returned no per-space verify results — this is a wiring bug.\");\n\tlet okAll = true;\n\tlet firstFailure;\n\tlet issues = [];\n\tlet warningIssues = [];\n\tfor (const [, result] of perSpace) {\n\t\tif (!result.ok) {\n\t\t\tokAll = false;\n\t\t\tif (firstFailure === void 0) firstFailure = result;\n\t\t}\n\t\tissues = [...issues, ...result.schema.issues];\n\t\twarningIssues = [...warningIssues, ...result.schema.warnings?.issues ?? []];\n\t}\n\tconst unclaimedFails = strict && unclaimed.length > 0;\n\tconst ok = okAll && !unclaimedFails;\n\tconst summary = okAll ? unclaimedFails ? `Database schema has ${unclaimed.length} unclaimed element${unclaimed.length === 1 ? \"\" : \"s\"} (not in any contract)` : appResult.summary : appResult.ok ? firstFailure?.summary ?? appResult.summary : appResult.summary;\n\treturn {\n\t\tresult: {\n\t\t\tok,\n\t\t\t...ok ? {} : { code: appResult.code ?? \"CONTRACT.MARKER_REQUIRED\" },\n\t\t\tsummary,\n\t\t\tcontract: appResult.contract,\n\t\t\ttarget: appResult.target,\n\t\t\tschema: {\n\t\t\t\tissues,\n\t\t\t\twarnings: { issues: warningIssues }\n\t\t\t},\n\t\t\tmeta: { strict },\n\t\t\ttimings: { total: 0 }\n\t\t},\n\t\tunclaimed\n\t};\n}\n//#endregion\nexport { combineVerifyResults as t };\n\n//# sourceMappingURL=combine-verify-results-B87B_pMc.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,SAAS,qBAAqB,UAAU,YAAY,QAAQ,WAAW;CACtE,MAAM,YAAY,SAAS,IAAI,UAAU,KAAK,SAAS,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC;CACvE,IAAI,cAAc,KAAK,GAAG,MAAM,IAAI,cAAc,iFAAiF;CACnI,IAAI,QAAQ;CACZ,IAAI;CACJ,IAAI,SAAS,CAAC;CACd,IAAI,gBAAgB,CAAC;CACrB,KAAK,MAAM,GAAG,WAAW,UAAU;EAClC,IAAI,CAAC,OAAO,IAAI;GACf,QAAQ;GACR,IAAI,iBAAiB,KAAK,GAAG,eAAe;EAC7C;EACA,SAAS,CAAC,GAAG,QAAQ,GAAG,OAAO,OAAO,MAAM;EAC5C,gBAAgB,CAAC,GAAG,eAAe,GAAG,OAAO,OAAO,UAAU,UAAU,CAAC,CAAC;CAC3E;CACA,MAAM,iBAAiB,UAAU,UAAU,SAAS;CACpD,MAAM,KAAK,SAAS,CAAC;CACrB,MAAM,UAAU,QAAQ,iBAAiB,uBAAuB,UAAU,OAAO,oBAAoB,UAAU,WAAW,IAAI,KAAK,IAAI,0BAA0B,UAAU,UAAU,UAAU,KAAK,cAAc,WAAW,UAAU,UAAU,UAAU;CAC3P,OAAO;EACN,QAAQ;GACP;GACA,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,UAAU,QAAQ,2BAA2B;GAClE;GACA,UAAU,UAAU;GACpB,QAAQ,UAAU;GAClB,QAAQ;IACP;IACA,UAAU,EAAE,QAAQ,cAAc;GACnC;GACA,MAAM,EAAE,OAAO;GACf,SAAS,EAAE,OAAO,EAAE;EACrB;EACA;CACD;AACD"}
|