@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.
Files changed (303) hide show
  1. package/README.md +3 -3
  2. package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-CPZB020V.mjs} +9 -9
  3. package/dist/{aggregate-BBsCbXgJ.mjs.map → aggregate-CPZB020V.mjs.map} +1 -1
  4. package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-DLUJLq5Y.d.mts} +3 -3
  5. package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-DLUJLq5Y.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +19 -5
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +287 -8
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +11 -13
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +5382 -1095
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +298 -27
  15. package/dist/cli__control-api.d.mts.map +1 -1
  16. package/dist/cli__control-api.mjs +2 -19
  17. package/dist/cli__control-api__testing.d.mts +1 -1
  18. package/dist/cli__control-api__testing.mjs.map +1 -1
  19. package/dist/cli__init-output.d.mts +0 -1
  20. package/dist/cli__init-output.d.mts.map +1 -1
  21. package/dist/cli__init-output.mjs +1 -1
  22. package/dist/cli__migration-cli.mjs +9 -9
  23. package/dist/cli__migration-cli.mjs.map +1 -1
  24. package/dist/config-loader.d.mts +1 -1
  25. package/dist/config-loader.mjs +1 -1
  26. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs} +4 -4
  27. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-B0G1Fw_F-CHc4QfKb.mjs.map} +1 -1
  28. package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-BwgNK50T-DGvKgFCK.d.mts} +81 -81
  29. package/dist/db-verify-BwgNK50T-DGvKgFCK.d.mts.map +1 -0
  30. package/dist/emitter.d.mts +1 -1
  31. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-CXbGUWGu-CstQHPh6.mjs} +2 -2
  32. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs.map → errors-CXbGUWGu-CstQHPh6.mjs.map} +1 -1
  33. package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
  34. package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
  35. package/dist/{exports-B3xY_FHp.mjs → exports-8ZUN43ve.mjs} +6 -6
  36. package/dist/exports-8ZUN43ve.mjs.map +1 -0
  37. package/dist/{exports-BZLNbtkY.mjs → exports-BZaG8_w_.mjs} +64 -36
  38. package/dist/exports-BZaG8_w_.mjs.map +1 -0
  39. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-BViWUMpP-C4lYYJdU.mjs} +2 -2
  40. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-BViWUMpP-C4lYYJdU.mjs.map} +1 -1
  41. package/dist/{import-roots-NDOIEDVj.mjs → import-roots-CNFBPAT1.mjs} +10 -3
  42. package/dist/{import-roots-NDOIEDVj.mjs.map → import-roots-CNFBPAT1.mjs.map} +1 -1
  43. package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-CfoYgejL.d.mts} +2 -2
  44. package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-CfoYgejL.d.mts.map} +1 -1
  45. package/dist/{index-mCsi_ND5.d.mts → index-DRs7L6N0.d.mts} +11 -3
  46. package/dist/index-DRs7L6N0.d.mts.map +1 -0
  47. package/dist/{index-CnOyYxmv.d.mts → index-Dgwl8Tzs.d.mts} +2 -2
  48. package/dist/{index-CnOyYxmv.d.mts.map → index-Dgwl8Tzs.d.mts.map} +1 -1
  49. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-CTHy88OP-CYI2a8IO.mjs} +2 -2
  50. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-CTHy88OP-CYI2a8IO.mjs.map} +1 -1
  51. package/dist/{io-635GlNx1-D94PxRc-.mjs → io-635GlNx1-D3zrw2qu.mjs} +4 -4
  52. package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-635GlNx1-D3zrw2qu.mjs.map} +1 -1
  53. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-_SJImD5V-BURyY1KM.mjs} +2 -2
  54. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-_SJImD5V-BURyY1KM.mjs.map} +1 -1
  55. package/dist/{migration-gubSSeMk.mjs → migration-hspPIEeV.mjs} +4 -4
  56. package/dist/{migration-gubSSeMk.mjs.map → migration-hspPIEeV.mjs.map} +1 -1
  57. package/dist/migration-tools.d.mts +4 -4
  58. package/dist/migration-tools.mjs +13 -13
  59. package/dist/migration-tools__aggregate.d.mts +1 -1
  60. package/dist/migration-tools__aggregate.mjs +1 -1
  61. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  62. package/dist/migration-tools__errors.d.mts +1 -1
  63. package/dist/migration-tools__errors.mjs +1 -1
  64. package/dist/migration-tools__invariants.mjs +1 -1
  65. package/dist/migration-tools__io.mjs +1 -1
  66. package/dist/migration-tools__migration-graph.mjs +2 -2
  67. package/dist/migration-tools__migration-ts.mjs +1 -1
  68. package/dist/migration-tools__migration.mjs +1 -1
  69. package/dist/migration-tools__ref-resolution.mjs +1 -1
  70. package/dist/migration-tools__refs.mjs +1 -1
  71. package/dist/migration-tools__spaces.d.mts +2 -2
  72. package/dist/migration-tools__spaces.mjs +2 -2
  73. package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
  74. package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
  75. package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-CovTDY14-CUoAqLML.mjs} +3 -45
  76. package/dist/output-CovTDY14-CUoAqLML.mjs.map +1 -0
  77. package/dist/publish-surface.d.mts +2 -2
  78. package/dist/publish-surface.mjs +2 -2
  79. package/dist/publish-surface__import-roots.d.mts +1 -1
  80. package/dist/publish-surface__import-roots.mjs +1 -1
  81. package/dist/publish-surface__shells.d.mts +1 -1
  82. package/dist/publish-surface__shells.mjs +1 -1
  83. package/dist/quick-reference-mongo.md +12 -9
  84. package/dist/quick-reference-postgres.md +12 -9
  85. package/dist/readme-mongo.md +2 -2
  86. package/dist/readme-postgres.md +2 -2
  87. package/dist/ref-h6InR6dO-rGfl18Jv.mjs +4686 -0
  88. package/dist/ref-h6InR6dO-rGfl18Jv.mjs.map +1 -0
  89. package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-HeNBXW53.mjs} +2 -2
  90. package/dist/{ref-resolution-sGcINe7o.mjs.map → ref-resolution-HeNBXW53.mjs.map} +1 -1
  91. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-WK86uYYp-gM8tvWQP.mjs} +2 -2
  92. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs.map → refs-WK86uYYp-gM8tvWQP.mjs.map} +1 -1
  93. package/dist/{shells-BenrJHp2.mjs → shells-C4HbRAr5.mjs} +13 -14
  94. package/dist/shells-C4HbRAr5.mjs.map +1 -0
  95. package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
  96. package/dist/shells-CIUmT4u4.d.mts.map +1 -0
  97. package/dist/{spaces-BG2w0P8d.mjs → spaces-4qMOAYE9.mjs} +7 -7
  98. package/dist/{spaces-BG2w0P8d.mjs.map → spaces-4qMOAYE9.mjs.map} +1 -1
  99. package/dist/{spaces-tWQi7CUv.d.mts → spaces-Dj65JrwZ.d.mts} +2 -2
  100. package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-Dj65JrwZ.d.mts.map} +1 -1
  101. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
  102. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
  103. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs} +4 -4
  104. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-DhJTb0zM-B62maCfE.mjs.map} +1 -1
  105. package/dist/vite-plugin-contract-emit.d.mts +2 -2
  106. package/dist/vite-plugin-contract-emit.mjs +5 -5
  107. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  108. package/package.json +14 -38
  109. package/dist/bin__prisma-next.mjs +0 -512
  110. package/dist/bin__prisma-next.mjs.map +0 -1
  111. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
  112. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
  113. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
  114. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
  115. package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
  116. package/dist/cli__commands__contract-emit.d.mts +0 -2
  117. package/dist/cli__commands__contract-emit.mjs +0 -2
  118. package/dist/cli__commands__contract-infer.d.mts +0 -7
  119. package/dist/cli__commands__contract-infer.d.mts.map +0 -1
  120. package/dist/cli__commands__contract-infer.mjs +0 -2
  121. package/dist/cli__commands__db-init.d.mts +0 -7
  122. package/dist/cli__commands__db-init.d.mts.map +0 -1
  123. package/dist/cli__commands__db-init.mjs +0 -2
  124. package/dist/cli__commands__db-schema.d.mts +0 -7
  125. package/dist/cli__commands__db-schema.d.mts.map +0 -1
  126. package/dist/cli__commands__db-schema.mjs +0 -2
  127. package/dist/cli__commands__db-sign.d.mts +0 -7
  128. package/dist/cli__commands__db-sign.d.mts.map +0 -1
  129. package/dist/cli__commands__db-sign.mjs +0 -2
  130. package/dist/cli__commands__db-update.d.mts +0 -7
  131. package/dist/cli__commands__db-update.d.mts.map +0 -1
  132. package/dist/cli__commands__db-update.mjs +0 -2
  133. package/dist/cli__commands__db-verify.d.mts +0 -7
  134. package/dist/cli__commands__db-verify.d.mts.map +0 -1
  135. package/dist/cli__commands__db-verify.mjs +0 -2
  136. package/dist/cli__commands__migrate.d.mts +0 -57
  137. package/dist/cli__commands__migrate.d.mts.map +0 -1
  138. package/dist/cli__commands__migrate.mjs +0 -2
  139. package/dist/cli__commands__migration-check.d.mts +0 -8
  140. package/dist/cli__commands__migration-check.d.mts.map +0 -1
  141. package/dist/cli__commands__migration-check.mjs +0 -3
  142. package/dist/cli__commands__migration-graph.d.mts +0 -38
  143. package/dist/cli__commands__migration-graph.d.mts.map +0 -1
  144. package/dist/cli__commands__migration-graph.mjs +0 -2
  145. package/dist/cli__commands__migration-list.d.mts +0 -39
  146. package/dist/cli__commands__migration-list.d.mts.map +0 -1
  147. package/dist/cli__commands__migration-list.mjs +0 -2
  148. package/dist/cli__commands__migration-log.d.mts +0 -20
  149. package/dist/cli__commands__migration-log.d.mts.map +0 -1
  150. package/dist/cli__commands__migration-log.mjs +0 -2
  151. package/dist/cli__commands__migration-new.d.mts +0 -7
  152. package/dist/cli__commands__migration-new.d.mts.map +0 -1
  153. package/dist/cli__commands__migration-new.mjs +0 -2
  154. package/dist/cli__commands__migration-plan.d.mts +0 -34
  155. package/dist/cli__commands__migration-plan.d.mts.map +0 -1
  156. package/dist/cli__commands__migration-plan.mjs +0 -2
  157. package/dist/cli__commands__migration-show.d.mts +0 -27
  158. package/dist/cli__commands__migration-show.d.mts.map +0 -1
  159. package/dist/cli__commands__migration-show.mjs +0 -2
  160. package/dist/cli__commands__migration-status.d.mts +0 -55
  161. package/dist/cli__commands__migration-status.d.mts.map +0 -1
  162. package/dist/cli__commands__migration-status.mjs +0 -3
  163. package/dist/cli__commands__ref.d.mts +0 -7
  164. package/dist/cli__commands__ref.d.mts.map +0 -1
  165. package/dist/cli__commands__ref.mjs +0 -2
  166. package/dist/cli__commands__telemetry.d.mts +0 -7
  167. package/dist/cli__commands__telemetry.d.mts.map +0 -1
  168. package/dist/cli__commands__telemetry.mjs +0 -2
  169. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
  170. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
  171. package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs +0 -295
  172. package/dist/code-templates-D_sGnEF6-DRLPzlq8.mjs.map +0 -1
  173. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
  174. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
  175. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
  176. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
  177. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
  178. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
  179. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
  180. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
  181. package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
  182. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
  183. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
  184. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
  185. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
  186. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
  187. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
  188. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
  189. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
  190. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
  191. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
  192. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
  193. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
  194. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
  195. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
  196. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
  197. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
  198. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
  199. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
  200. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
  201. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
  202. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
  203. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
  204. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
  205. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
  206. package/dist/exports-B3xY_FHp.mjs.map +0 -1
  207. package/dist/exports-BZLNbtkY.mjs.map +0 -1
  208. package/dist/exports-CqNUihkI.mjs +0 -276
  209. package/dist/exports-CqNUihkI.mjs.map +0 -1
  210. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
  211. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
  212. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
  213. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
  214. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
  215. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
  216. package/dist/index-mCsi_ND5.d.mts.map +0 -1
  217. package/dist/init-B86mXFNC-C2HAUCRn.mjs +0 -800
  218. package/dist/init-B86mXFNC-C2HAUCRn.mjs.map +0 -1
  219. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
  220. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
  221. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
  222. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
  223. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
  224. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
  225. package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
  226. package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
  227. package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
  228. package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
  229. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
  230. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
  231. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
  232. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
  233. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
  234. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
  235. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
  236. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
  237. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
  238. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
  239. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
  240. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
  241. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
  242. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
  243. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
  244. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
  245. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
  246. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
  247. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
  248. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
  249. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
  250. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
  251. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
  252. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
  253. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
  254. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
  255. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
  256. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
  257. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
  258. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
  259. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
  260. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
  261. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
  262. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
  263. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
  264. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
  265. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
  266. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
  267. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
  268. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
  269. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
  270. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
  271. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
  272. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
  273. package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
  274. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
  275. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
  276. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
  277. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
  278. package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs +0 -1476
  279. package/dist/redact-secrets-ojVi2cpy-CLyiSDk5.mjs.map +0 -1
  280. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
  281. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
  282. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
  283. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
  284. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
  285. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
  286. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
  287. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
  288. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
  289. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
  290. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
  291. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
  292. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
  293. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
  294. package/dist/shells-BenrJHp2.mjs.map +0 -1
  295. package/dist/shells-COHV_Ozf.d.mts.map +0 -1
  296. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
  297. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
  298. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
  299. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
  300. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
  301. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
  302. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
  303. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
@@ -1,154 +0,0 @@
1
- import { o as loadConfigForSections } from "./exports-BZLNbtkY.mjs";
2
- import { F as errorUnexpected, t as CliStructuredError$1 } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
3
- import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
4
- import { n as executeContractEmit } from "./contract-emit-BG7KL4zk-_a0J310Z.mjs";
5
- import { p as isVerbose, r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
6
- import { b as setCommandExamples, c as formatSuccessMessage, m as parseGlobalFlagsOrExit, s as formatStyledHeader, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-BCgwcqTe-lNCtppzM.mjs";
7
- import { t as createProgressAdapter } from "./progress-adapter-CjAeTxY_-BXYSd1eY.mjs";
8
- import { errorContractConfigMissing } from "@prisma/orm-framework/errors/control";
9
- import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
- import { dirname, join, relative, resolve } from "pathe";
11
- import { notOk, ok } from "@prisma/orm-framework/utils/result";
12
- import { Command } from "commander";
13
- //#region ../../../1-framework/3-tooling/cli/dist/contract-emit-GknCmgn_.mjs
14
- /**
15
- * Formats human-readable output for contract emit.
16
- */
17
- function formatEmitOutput(result, flags) {
18
- if (flags.quiet) return "";
19
- const lines = [];
20
- const jsonPath = relative(process.cwd(), result.files.json);
21
- const dtsPath = relative(process.cwd(), result.files.dts);
22
- lines.push(`✔ Emitted contract.json → ${jsonPath}`);
23
- lines.push(`✔ Emitted contract.d.ts → ${dtsPath}`);
24
- lines.push(` storageHash: ${result.storageHash}`);
25
- if (result.executionHash) lines.push(` executionHash: ${result.executionHash}`);
26
- if (result.profileHash) lines.push(` profileHash: ${result.profileHash}`);
27
- if (isVerbose(flags, 1)) lines.push(` Total time: ${result.timings.total}ms`);
28
- return lines.join("\n");
29
- }
30
- /**
31
- * Formats JSON output for contract emit.
32
- */
33
- function formatEmitJson(result) {
34
- const output = {
35
- ok: true,
36
- storageHash: result.storageHash,
37
- ...ifDefined("executionHash", result.executionHash),
38
- ...result.profileHash ? { profileHash: result.profileHash } : {},
39
- outDir: result.outDir,
40
- files: result.files,
41
- timings: result.timings
42
- };
43
- return JSON.stringify(output, null, 2);
44
- }
45
- /**
46
- * Loads the config once, for both the styled header's display paths and the
47
- * emit itself — `executeContractEmit` takes the loaded config rather than
48
- * reading it a second time.
49
- */
50
- async function resolveEmitContext(configOption, outputPath) {
51
- const displayConfigPath = configOption ? relative(process.cwd(), resolve(configOption)) : "prisma-next.config.ts";
52
- const configResult = await loadConfigForSections(configOption, [
53
- "contract",
54
- "family",
55
- "target",
56
- "adapter",
57
- "extensions"
58
- ]);
59
- if (!configResult.ok) return configResult;
60
- const config = configResult.value;
61
- const effectiveJsonPath = outputPath !== void 0 ? join(outputPath, "contract.json") : config.contract?.output;
62
- if (!effectiveJsonPath) return notOk(errorContractConfigMissing({ why: "Config.contract.output is required for emit. Define it in your config: contract: { source: ..., output: ... }" }));
63
- try {
64
- const { jsonPath: outputJsonPath, dtsPath: outputDtsPath } = getEmittedArtifactPaths(effectiveJsonPath);
65
- return ok({
66
- config,
67
- displayConfigPath,
68
- outputJsonPath,
69
- outputDtsPath
70
- });
71
- } catch (error) {
72
- return notOk(errorContractConfigMissing({ why: error instanceof Error ? error.message : String(error) }));
73
- }
74
- }
75
- async function executeContractEmitCommand(options, flags, ui, startTime) {
76
- const outputPath = options.outputPath !== void 0 ? resolve(options.outputPath) : void 0;
77
- const emitContextResult = await resolveEmitContext(options.config, outputPath);
78
- if (!emitContextResult.ok) return emitContextResult;
79
- const { config, displayConfigPath, outputJsonPath, outputDtsPath } = emitContextResult.value;
80
- if (!flags.json && !flags.quiet) ui.stderr(formatStyledHeader({
81
- command: "contract emit",
82
- description: "Emit your contract artifacts",
83
- url: "https://pris.ly/contract-emit",
84
- details: [
85
- {
86
- label: "config",
87
- value: displayConfigPath
88
- },
89
- {
90
- label: "contract",
91
- value: relative(process.cwd(), outputJsonPath)
92
- },
93
- {
94
- label: "types",
95
- value: relative(process.cwd(), outputDtsPath)
96
- }
97
- ],
98
- flags
99
- }));
100
- const onProgress = createProgressAdapter({
101
- ui,
102
- flags
103
- });
104
- const configPath = options.config ? resolve(options.config) : "prisma-next.config.ts";
105
- let result;
106
- try {
107
- result = await executeContractEmit({
108
- config,
109
- cwd: process.cwd(),
110
- configPath,
111
- onProgress,
112
- ...ifDefined("outputPath", outputPath)
113
- });
114
- } catch (error) {
115
- if (CliStructuredError$1.is(error)) return notOk(error);
116
- return notOk(errorUnexpected("Unexpected error during contract emit", { why: error instanceof Error ? error.message : String(error) }));
117
- }
118
- if (result.validationWarning) ui.warn(result.validationWarning);
119
- return ok({
120
- storageHash: result.storageHash,
121
- ...ifDefined("executionHash", result.executionHash),
122
- profileHash: result.profileHash,
123
- outDir: dirname(result.files.json),
124
- files: result.files,
125
- timings: { total: Date.now() - startTime }
126
- });
127
- }
128
- function createContractEmitCommand() {
129
- const command = new Command("emit");
130
- setCommandDescriptions(command, "Emit your contract artifacts", "Reads your contract source (TypeScript or Prisma schema) and emits contract.json and\ncontract.d.ts. The contract.json contains the canonical contract structure, and\ncontract.d.ts provides TypeScript types for type-safe query building.");
131
- setCommandExamples(command, [
132
- "prisma-next contract emit",
133
- "prisma-next contract emit --config ./custom-config.ts",
134
- "prisma-next contract emit --output-path ./generated"
135
- ]);
136
- addGlobalOptions(command).option("--config <path>", "Path to prisma-next.config.ts").option("--output-path <dir>", "Directory to write contract.json and contract.d.ts into").action(async (options) => {
137
- const flags = parseGlobalFlagsOrExit(options);
138
- const ui = createTerminalUI(flags);
139
- const exitCode = handleResult(await executeContractEmitCommand(options, flags, ui, Date.now()), flags, ui, (emitResult) => {
140
- if (flags.json) ui.output(formatEmitJson(emitResult));
141
- else {
142
- const output = formatEmitOutput(emitResult, flags);
143
- if (output) ui.log(output);
144
- if (!flags.quiet) ui.success(formatSuccessMessage(flags));
145
- }
146
- });
147
- process.exit(exitCode);
148
- });
149
- return command;
150
- }
151
- //#endregion
152
- export { createContractEmitCommand as t };
153
-
154
- //# sourceMappingURL=contract-emit-GknCmgn_-BSWdFprC.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-emit-GknCmgn_-BSWdFprC.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-emit-GknCmgn_.mjs"],"sourcesContent":["import { P as errorUnexpected, t as CliStructuredError$1 } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { t as executeContractEmit } from \"./contract-emit-BG7KL4zk.mjs\";\nimport { h as isVerbose, t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { C as formatSuccessMessage, S as formatStyledHeader, _ as parseGlobalFlagsOrExit, d as setCommandExamples, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-BCgwcqTe.mjs\";\nimport { t as createProgressAdapter } from \"./progress-adapter-CjAeTxY_.mjs\";\nimport { Command } from \"commander\";\nimport { loadConfigForSections } from \"@internal/config-loader\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { errorContractConfigMissing } from \"@internal/errors/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { dirname, join, relative, resolve } from \"pathe\";\n//#region src/utils/formatters/emit.ts\n/**\n* Formats human-readable output for contract emit.\n*/\nfunction formatEmitOutput(result, flags) {\n\tif (flags.quiet) return \"\";\n\tconst lines = [];\n\tconst jsonPath = relative(process.cwd(), result.files.json);\n\tconst dtsPath = relative(process.cwd(), result.files.dts);\n\tlines.push(`✔ Emitted contract.json → ${jsonPath}`);\n\tlines.push(`✔ Emitted contract.d.ts → ${dtsPath}`);\n\tlines.push(` storageHash: ${result.storageHash}`);\n\tif (result.executionHash) lines.push(` executionHash: ${result.executionHash}`);\n\tif (result.profileHash) lines.push(` profileHash: ${result.profileHash}`);\n\tif (isVerbose(flags, 1)) lines.push(` Total time: ${result.timings.total}ms`);\n\treturn lines.join(\"\\n\");\n}\n/**\n* Formats JSON output for contract emit.\n*/\nfunction formatEmitJson(result) {\n\tconst output = {\n\t\tok: true,\n\t\tstorageHash: result.storageHash,\n\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\t...result.profileHash ? { profileHash: result.profileHash } : {},\n\t\toutDir: result.outDir,\n\t\tfiles: result.files,\n\t\ttimings: result.timings\n\t};\n\treturn JSON.stringify(output, null, 2);\n}\n//#endregion\n//#region src/commands/contract-emit.ts\n/**\n* Loads the config once, for both the styled header's display paths and the\n* emit itself — `executeContractEmit` takes the loaded config rather than\n* reading it a second time.\n*/\nasync function resolveEmitContext(configOption, outputPath) {\n\tconst displayConfigPath = configOption ? relative(process.cwd(), resolve(configOption)) : \"prisma-next.config.ts\";\n\tconst configResult = await loadConfigForSections(configOption, [\n\t\t\"contract\",\n\t\t\"family\",\n\t\t\"target\",\n\t\t\"adapter\",\n\t\t\"extensions\"\n\t]);\n\tif (!configResult.ok) return configResult;\n\tconst config = configResult.value;\n\tconst effectiveJsonPath = outputPath !== void 0 ? join(outputPath, \"contract.json\") : config.contract?.output;\n\tif (!effectiveJsonPath) return notOk(errorContractConfigMissing({ why: \"Config.contract.output is required for emit. Define it in your config: contract: { source: ..., output: ... }\" }));\n\ttry {\n\t\tconst { jsonPath: outputJsonPath, dtsPath: outputDtsPath } = getEmittedArtifactPaths(effectiveJsonPath);\n\t\treturn ok({\n\t\t\tconfig,\n\t\t\tdisplayConfigPath,\n\t\t\toutputJsonPath,\n\t\t\toutputDtsPath\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(errorContractConfigMissing({ why: error instanceof Error ? error.message : String(error) }));\n\t}\n}\nasync function executeContractEmitCommand(options, flags, ui, startTime) {\n\tconst outputPath = options.outputPath !== void 0 ? resolve(options.outputPath) : void 0;\n\tconst emitContextResult = await resolveEmitContext(options.config, outputPath);\n\tif (!emitContextResult.ok) return emitContextResult;\n\tconst { config, displayConfigPath, outputJsonPath, outputDtsPath } = emitContextResult.value;\n\tif (!flags.json && !flags.quiet) ui.stderr(formatStyledHeader({\n\t\tcommand: \"contract emit\",\n\t\tdescription: \"Emit your contract artifacts\",\n\t\turl: \"https://pris.ly/contract-emit\",\n\t\tdetails: [\n\t\t\t{\n\t\t\t\tlabel: \"config\",\n\t\t\t\tvalue: displayConfigPath\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"contract\",\n\t\t\t\tvalue: relative(process.cwd(), outputJsonPath)\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: \"types\",\n\t\t\t\tvalue: relative(process.cwd(), outputDtsPath)\n\t\t\t}\n\t\t],\n\t\tflags\n\t}));\n\tconst onProgress = createProgressAdapter({\n\t\tui,\n\t\tflags\n\t});\n\tconst configPath = options.config ? resolve(options.config) : \"prisma-next.config.ts\";\n\tlet result;\n\ttry {\n\t\tresult = await executeContractEmit({\n\t\t\tconfig,\n\t\t\tcwd: process.cwd(),\n\t\t\tconfigPath,\n\t\t\tonProgress,\n\t\t\t...ifDefined(\"outputPath\", outputPath)\n\t\t});\n\t} catch (error) {\n\t\tif (CliStructuredError$1.is(error)) return notOk(error);\n\t\treturn notOk(errorUnexpected(\"Unexpected error during contract emit\", { why: error instanceof Error ? error.message : String(error) }));\n\t}\n\tif (result.validationWarning) ui.warn(result.validationWarning);\n\treturn ok({\n\t\tstorageHash: result.storageHash,\n\t\t...ifDefined(\"executionHash\", result.executionHash),\n\t\tprofileHash: result.profileHash,\n\t\toutDir: dirname(result.files.json),\n\t\tfiles: result.files,\n\t\ttimings: { total: Date.now() - startTime }\n\t});\n}\nfunction createContractEmitCommand() {\n\tconst command = new Command(\"emit\");\n\tsetCommandDescriptions(command, \"Emit your contract artifacts\", \"Reads your contract source (TypeScript or Prisma schema) and emits contract.json and\\ncontract.d.ts. The contract.json contains the canonical contract structure, and\\ncontract.d.ts provides TypeScript types for type-safe query building.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next contract emit\",\n\t\t\"prisma-next contract emit --config ./custom-config.ts\",\n\t\t\"prisma-next contract emit --output-path ./generated\"\n\t]);\n\taddGlobalOptions(command).option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--output-path <dir>\", \"Directory to write contract.json and contract.d.ts into\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst exitCode = handleResult(await executeContractEmitCommand(options, flags, ui, Date.now()), flags, ui, (emitResult) => {\n\t\t\tif (flags.json) ui.output(formatEmitJson(emitResult));\n\t\t\telse {\n\t\t\t\tconst output = formatEmitOutput(emitResult, flags);\n\t\t\t\tif (output) ui.log(output);\n\t\t\t\tif (!flags.quiet) ui.success(formatSuccessMessage(flags));\n\t\t\t}\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//#endregion\nexport { createContractEmitCommand as t };\n\n//# sourceMappingURL=contract-emit-GknCmgn_.mjs.map"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAS,iBAAiB,QAAQ,OAAO;CACxC,IAAI,MAAM,OAAO,OAAO;CACxB,MAAM,QAAQ,CAAC;CACf,MAAM,WAAW,SAAS,QAAQ,IAAI,GAAG,OAAO,MAAM,IAAI;CAC1D,MAAM,UAAU,SAAS,QAAQ,IAAI,GAAG,OAAO,MAAM,GAAG;CACxD,MAAM,KAAK,6BAA6B,UAAU;CAClD,MAAM,KAAK,6BAA6B,SAAS;CACjD,MAAM,KAAK,kBAAkB,OAAO,aAAa;CACjD,IAAI,OAAO,eAAe,MAAM,KAAK,oBAAoB,OAAO,eAAe;CAC/E,IAAI,OAAO,aAAa,MAAM,KAAK,kBAAkB,OAAO,aAAa;CACzE,IAAI,UAAU,OAAO,CAAC,GAAG,MAAM,KAAK,iBAAiB,OAAO,QAAQ,MAAM,GAAG;CAC7E,OAAO,MAAM,KAAK,IAAI;AACvB;;;;AAIA,SAAS,eAAe,QAAQ;CAC/B,MAAM,SAAS;EACd,IAAI;EACJ,aAAa,OAAO;EACpB,GAAG,UAAU,iBAAiB,OAAO,aAAa;EAClD,GAAG,OAAO,cAAc,EAAE,aAAa,OAAO,YAAY,IAAI,CAAC;EAC/D,QAAQ,OAAO;EACf,OAAO,OAAO;EACd,SAAS,OAAO;CACjB;CACA,OAAO,KAAK,UAAU,QAAQ,MAAM,CAAC;AACtC;;;;;;AAQA,eAAe,mBAAmB,cAAc,YAAY;CAC3D,MAAM,oBAAoB,eAAe,SAAS,QAAQ,IAAI,GAAG,QAAQ,YAAY,CAAC,IAAI;CAC1F,MAAM,eAAe,MAAM,sBAAsB,cAAc;EAC9D;EACA;EACA;EACA;EACA;CACD,CAAC;CACD,IAA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/orm-framework/components/components";
2
- //#region ../../../1-framework/3-tooling/cli/dist/contract-enrichment-DrMvvY2A.mjs
3
- function isPlainObject(value) {
4
- return typeof value === "object" && value !== null && !Array.isArray(value);
5
- }
6
- function sortDeep(value) {
7
- if (Array.isArray(value)) return value.map(sortDeep);
8
- if (!isPlainObject(value)) return value;
9
- const entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));
10
- const next = {};
11
- for (const [key, child] of entries) next[key] = sortDeep(child);
12
- return next;
13
- }
14
- function sortDeepTyped(value) {
15
- return sortDeep(value);
16
- }
17
- function extractExtensionPackMeta(component) {
18
- const { kind, id, version, capabilities, types } = component;
19
- const base = {
20
- kind,
21
- id,
22
- familyId: component.familyId,
23
- targetId: component.targetId,
24
- version
25
- };
26
- if (capabilities) base["capabilities"] = capabilities;
27
- if (types) if (types.codecTypes) {
28
- const { controlPlaneHooks: _, codecDescriptors: _cd, ...cleanedCodecTypes } = types.codecTypes;
29
- base["types"] = {
30
- ...types,
31
- codecTypes: cleanedCodecTypes
32
- };
33
- } else base["types"] = types;
34
- return base;
35
- }
36
- /**
37
- * Enriches a raw contract with framework-derived metadata: capabilities from all component descriptors and extension pack metadata from extension descriptors. Produces deterministically sorted output.
38
- */
39
- function enrichContract(ir, components) {
40
- const mergedCapabilities = mergeCapabilityMatrices(ir.capabilities, components);
41
- const extensionsMeta = {};
42
- for (const component of components) if (component.kind === "extension") extensionsMeta[component.id] = extractExtensionPackMeta(component);
43
- const extensions = Object.keys(extensionsMeta).length > 0 ? {
44
- ...ir.extensions,
45
- ...extensionsMeta
46
- } : ir.extensions;
47
- return {
48
- ...ir,
49
- capabilities: sortDeepTyped(mergedCapabilities),
50
- extensions: sortDeepTyped(extensions)
51
- };
52
- }
53
- //#endregion
54
- export { enrichContract as t };
55
-
56
- //# sourceMappingURL=contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-enrichment-DrMvvY2A-DxNGeF4d.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-enrichment-DrMvvY2A.mjs"],"sourcesContent":["import { mergeCapabilityMatrices } from \"@internal/framework-components/components\";\n//#region src/control-api/contract-enrichment.ts\nfunction isPlainObject(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\nfunction sortDeep(value) {\n\tif (Array.isArray(value)) return value.map(sortDeep);\n\tif (!isPlainObject(value)) return value;\n\tconst entries = Object.entries(value).sort(([a], [b]) => a.localeCompare(b));\n\tconst next = {};\n\tfor (const [key, child] of entries) next[key] = sortDeep(child);\n\treturn next;\n}\nfunction sortDeepTyped(value) {\n\treturn sortDeep(value);\n}\nfunction extractExtensionPackMeta(component) {\n\tconst { kind, id, version, capabilities, types } = component;\n\tconst base = {\n\t\tkind,\n\t\tid,\n\t\tfamilyId: component.familyId,\n\t\ttargetId: component.targetId,\n\t\tversion\n\t};\n\tif (capabilities) base[\"capabilities\"] = capabilities;\n\tif (types) if (types.codecTypes) {\n\t\tconst { controlPlaneHooks: _, codecDescriptors: _cd, ...cleanedCodecTypes } = types.codecTypes;\n\t\tbase[\"types\"] = {\n\t\t\t...types,\n\t\t\tcodecTypes: cleanedCodecTypes\n\t\t};\n\t} else base[\"types\"] = types;\n\treturn base;\n}\n/**\n* Enriches a raw contract with framework-derived metadata: capabilities from all component descriptors and extension pack metadata from extension descriptors. Produces deterministically sorted output.\n*/\nfunction enrichContract(ir, components) {\n\tconst mergedCapabilities = mergeCapabilityMatrices(ir.capabilities, components);\n\tconst extensionsMeta = {};\n\tfor (const component of components) if (component.kind === \"extension\") extensionsMeta[component.id] = extractExtensionPackMeta(component);\n\tconst extensions = Object.keys(extensionsMeta).length > 0 ? {\n\t\t...ir.extensions,\n\t\t...extensionsMeta\n\t} : ir.extensions;\n\treturn {\n\t\t...ir,\n\t\tcapabilities: sortDeepTyped(mergedCapabilities),\n\t\textensions: sortDeepTyped(extensions)\n\t};\n}\n//#endregion\nexport { enrichContract as t };\n\n//# s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G;EACH,cAAc,cAAc,kBAAkB;EAC9C,YAAY,cAAc,UAAU;CACrC;AACD"}
@@ -1,74 +0,0 @@
1
- import { r as createTerminalUI } from "./terminal-ui-Cqz4LVL7-B0mcVdLy.mjs";
2
- import { b as setCommandExamples, m as parseGlobalFlagsOrExit, t as addGlobalOptions, u as handleResult, y as setCommandDescriptions } from "./command-helpers-BCgwcqTe-lNCtppzM.mjs";
3
- import { t as inspectLiveSchema } from "./inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs";
4
- import { errorRuntime } from "@prisma/orm-framework/errors/execution";
5
- import { dirname, relative, resolve } from "pathe";
6
- import { existsSync, mkdirSync, writeFileSync } from "node:fs";
7
- import { notOk, ok } from "@prisma/orm-framework/utils/result";
8
- import { Command } from "commander";
9
- import { printPsl } from "@prisma/orm-framework/psl-printer";
10
- //#region ../../../1-framework/3-tooling/cli/dist/contract-infer-BwIDGl7v.mjs
11
- /**
12
- * Resolves the output path for the inferred PSL contract.
13
- *
14
- * Priority:
15
- * 1. --output <path> flag (resolved relative to cwd)
16
- * 2. contract.prisma next to config.contract.output
17
- * 3. Canonical default: contract.prisma in the config directory
18
- */
19
- function resolveContractInferOutputPath(options, contractOutput) {
20
- const configDir = options.config ? dirname(resolve(process.cwd(), options.config)) : process.cwd();
21
- if (options.output) return resolve(process.cwd(), options.output);
22
- if (contractOutput) return resolve(dirname(resolve(configDir, contractOutput)), "contract.prisma");
23
- return resolve(configDir, "contract.prisma");
24
- }
25
- async function executeContractInferCommand(options, flags, ui, startTime) {
26
- const inspectResult = await inspectLiveSchema(options, flags, ui, startTime, {
27
- commandName: "contract infer",
28
- description: "Infer a PSL contract from the live database schema",
29
- url: "https://pris.ly/contract-infer"
30
- });
31
- if (!inspectResult.ok) return inspectResult;
32
- const { config, target, meta, pslContractAst, pslBlockDescriptors } = inspectResult.value;
33
- if (!pslContractAst) return notOk(errorRuntime("CONTRACT.INFER_UNSUPPORTED", "contract infer is not supported for this family", {
34
- why: "The configured family does not implement the PslContractInferCapable capability, so an inferred PSL contract cannot be produced from the live database schema.",
35
- fix: "Use a family that supports contract inference (e.g. SQL/Postgres)."
36
- }));
37
- const outputPath = resolveContractInferOutputPath(options, config.contract?.output);
38
- const pslContent = printPsl(pslContractAst, { pslBlockDescriptors });
39
- if (existsSync(outputPath) && !flags.json && !flags.quiet) ui.stderr(`\u26A0 Overwriting existing file: ${relative(process.cwd(), outputPath)}`);
40
- mkdirSync(dirname(outputPath), { recursive: true });
41
- writeFileSync(outputPath, pslContent, "utf-8");
42
- const pslPath = relative(process.cwd(), outputPath);
43
- if (!flags.json && !flags.quiet) ui.stderr(`\u2714 Contract written to ${pslPath}`);
44
- return ok({
45
- ok: true,
46
- summary: "Contract inferred successfully",
47
- target,
48
- psl: { path: pslPath },
49
- meta,
50
- timings: { total: Date.now() - startTime }
51
- });
52
- }
53
- function createContractInferCommand() {
54
- const command = new Command("infer");
55
- setCommandDescriptions(command, "Infer a PSL contract from the live database schema", "Reads the live database schema and writes an inferred PSL contract to disk.\nThis command stops at `contract.prisma`; follow it with `contract emit` and\n`db sign` as separate steps.");
56
- setCommandExamples(command, [
57
- "prisma-next contract infer --db $DATABASE_URL",
58
- "prisma-next contract infer --db $DATABASE_URL --output ./src/prisma/contract.prisma",
59
- "prisma-next contract infer --db $DATABASE_URL --json"
60
- ]);
61
- addGlobalOptions(command).option("--db <url>", "Database connection string").option("--config <path>", "Path to prisma-next.config.ts").option("--output <path>", "Write the inferred PSL contract to the specified path").action(async (options) => {
62
- const flags = parseGlobalFlagsOrExit(options);
63
- const ui = createTerminalUI(flags);
64
- const exitCode = handleResult(await executeContractInferCommand(options, flags, ui, Date.now()), flags, ui, (value) => {
65
- if (flags.json) ui.output(JSON.stringify(value, null, 2));
66
- });
67
- process.exit(exitCode);
68
- });
69
- return command;
70
- }
71
- //#endregion
72
- export { createContractInferCommand as t };
73
-
74
- //# sourceMappingURL=contract-infer-BwIDGl7v-CZrdWXAr.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-infer-BwIDGl7v-CZrdWXAr.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-infer-BwIDGl7v.mjs"],"sourcesContent":["import { t as createTerminalUI } from \"./terminal-ui-Cqz4LVL7.mjs\";\nimport { _ as parseGlobalFlagsOrExit, d as setCommandExamples, t as addGlobalOptions, u as setCommandDescriptions, v as handleResult } from \"./command-helpers-BCgwcqTe.mjs\";\nimport { t as inspectLiveSchema } from \"./inspect-live-schema-BPHXdvqW.mjs\";\nimport { Command } from \"commander\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { dirname, relative, resolve } from \"pathe\";\nimport { errorRuntime } from \"@internal/errors/execution\";\nimport { existsSync, mkdirSync, writeFileSync } from \"node:fs\";\nimport { printPsl } from \"@internal/psl-printer\";\n//#region src/commands/contract-infer-paths.ts\n/**\n* Resolves the output path for the inferred PSL contract.\n*\n* Priority:\n* 1. --output <path> flag (resolved relative to cwd)\n* 2. contract.prisma next to config.contract.output\n* 3. Canonical default: contract.prisma in the config directory\n*/\nfunction resolveContractInferOutputPath(options, contractOutput) {\n\tconst configDir = options.config ? dirname(resolve(process.cwd(), options.config)) : process.cwd();\n\tif (options.output) return resolve(process.cwd(), options.output);\n\tif (contractOutput) return resolve(dirname(resolve(configDir, contractOutput)), \"contract.prisma\");\n\treturn resolve(configDir, \"contract.prisma\");\n}\n//#endregion\n//#region src/commands/contract-infer.ts\nasync function executeContractInferCommand(options, flags, ui, startTime) {\n\tconst inspectResult = await inspectLiveSchema(options, flags, ui, startTime, {\n\t\tcommandName: \"contract infer\",\n\t\tdescription: \"Infer a PSL contract from the live database schema\",\n\t\turl: \"https://pris.ly/contract-infer\"\n\t});\n\tif (!inspectResult.ok) return inspectResult;\n\tconst { config, target, meta, pslContractAst, pslBlockDescriptors } = inspectResult.value;\n\tif (!pslContractAst) return notOk(errorRuntime(\"CONTRACT.INFER_UNSUPPORTED\", \"contract infer is not supported for this family\", {\n\t\twhy: \"The configured family does not implement the PslContractInferCapable capability, so an inferred PSL contract cannot be produced from the live database schema.\",\n\t\tfix: \"Use a family that supports contract inference (e.g. SQL/Postgres).\"\n\t}));\n\tconst outputPath = resolveContractInferOutputPath(options, config.contract?.output);\n\tconst pslContent = printPsl(pslContractAst, { pslBlockDescriptors });\n\tif (existsSync(outputPath) && !flags.json && !flags.quiet) ui.stderr(`\\u26A0 Overwriting existing file: ${relative(process.cwd(), outputPath)}`);\n\tmkdirSync(dirname(outputPath), { recursive: true });\n\twriteFileSync(outputPath, pslContent, \"utf-8\");\n\tconst pslPath = relative(process.cwd(), outputPath);\n\tif (!flags.json && !flags.quiet) ui.stderr(`\\u2714 Contract written to ${pslPath}`);\n\treturn ok({\n\t\tok: true,\n\t\tsummary: \"Contract inferred successfully\",\n\t\ttarget,\n\t\tpsl: { path: pslPath },\n\t\tmeta,\n\t\ttimings: { total: Date.now() - startTime }\n\t});\n}\nfunction createContractInferCommand() {\n\tconst command = new Command(\"infer\");\n\tsetCommandDescriptions(command, \"Infer a PSL contract from the live database schema\", \"Reads the live database schema and writes an inferred PSL contract to disk.\\nThis command stops at `contract.prisma`; follow it with `contract emit` and\\n`db sign` as separate steps.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next contract infer --db $DATABASE_URL\",\n\t\t\"prisma-next contract infer --db $DATABASE_URL --output ./src/prisma/contract.prisma\",\n\t\t\"prisma-next contract infer --db $DATABASE_URL --json\"\n\t]);\n\taddGlobalOptions(command).option(\"--db <url>\", \"Database connection string\").option(\"--config <path>\", \"Path to prisma-next.config.ts\").option(\"--output <path>\", \"Write the inferred PSL contract to the specified path\").action(async (options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst exitCode = handleResult(await executeContractInferCommand(options, flags, ui, Date.now()), flags, ui, (value) => {\n\t\t\tif (flags.json) ui.output(JSON.stringify(value, null, 2));\n\t\t});\n\t\tprocess.exit(exitCode);\n\t});\n\treturn command;\n}\n//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AAG;EACT,IAAI;EACJ,SAAS;EACT;EACA,KAAK,EAAE,MAAM,QAAQ;EACrB;EACA,SAAS,EAAE,OAAO,KAAK,IAAI,IAAI,UAAU;CAC1C,CAAC;AACF;AACA,SAAS,6BAA6B;CACrC,MAAM,UAAU,IAAI,QAAQ,OAAO;CACnC,uBAAuB,SAAS,sDAAsD,wLAAwL;CAC9Q,mBAAmB,SAAS;EAC3B;EACA;EACA;CACD,CAAC;CACD,iBAAiB,OAAO,CAAC,CAAC,OAAO,cAAc,4BAA4B,CAAC,CAAC,OAAO,mBAAmB,+BAA+B,CAAC,CAAC,OAAO,mBAAmB,uDAAuD,CAAC,CAAC,OAAO,OAAO,YAAY;EACpP,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,WAAW,aAAa,MAAM,4BAA4B,SAAS,OAAO,IAAI,KAAK,IAAI,CAAC,GAAG,OAAO,KAAK,UAAU;GACtH,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;EACzD,CAAC;EACD,QAAQ,KAAK,QAAQ;CACtB,CAAC;CACD,OAAO;AACR"}
@@ -1,82 +0,0 @@
1
- import { A as errorRuntime$1, F as errorUnexpected, I as mapRefResolutionError, p as errorFileNotFound, t as CliStructuredError$1 } from "./cli-errors-B4zTLaqQ-CXgjO9t4.mjs";
2
- import { i as errorContractDeserializationFailed, t as MigrationToolsError } from "./errors-CXbGUWGu-BQi6YS-H.mjs";
3
- import { r as readContractSnapshotJson, t as contractSnapshotDir } from "./contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs";
4
- import { r as buildReadAggregate } from "./contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs";
5
- import { n as parseContractRef } from "./ref-resolution-sGcINe7o.mjs";
6
- import { join } from "pathe";
7
- import { blindCast, castAs } from "@prisma/orm-framework/utils/casts";
8
- import { readFile } from "node:fs/promises";
9
- import { notOk, ok } from "@prisma/orm-framework/utils/result";
10
- //#region ../../../1-framework/3-tooling/cli/dist/contract-snapshot-resolution-De2VvOJn.mjs
11
- /**
12
- * Resolves a user-supplied contract reference to an on-disk contract JSON (snapshot store or emitted contract), shared by db sign and db update --to.
13
- */
14
- function isEnoent(error) {
15
- return error instanceof Error && "code" in error && error.code === "ENOENT";
16
- }
17
- async function resolveContractRefToSnapshot(options) {
18
- try {
19
- const loaded = await buildReadAggregate(options.config, { migrationsDir: options.migrationsDir });
20
- if (!loaded.ok) return notOk(loaded.failure);
21
- const graph = loaded.value.aggregate.app.graph();
22
- const bundles = loaded.value.aggregate.app.packages;
23
- const refs = loaded.value.aggregate.app.refs;
24
- const refResult = parseContractRef(options.refInput, {
25
- graph,
26
- refs
27
- });
28
- if (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));
29
- const targetHash = refResult.value.hash;
30
- if (bundles.find((p) => p.metadata.to === targetHash)) return ok({
31
- hash: targetHash,
32
- contractJson: blindCast(await readContractSnapshotJson(options.migrationsDir, targetHash)),
33
- contractJsonPath: join(contractSnapshotDir(options.migrationsDir, targetHash), "contract.json"),
34
- source: "snapshot"
35
- });
36
- if (!options.fallbackToEmitted) return notOk(errorUnexpected(`No migration bundle found for ${options.missingBundleFlag} "${options.refInput}" (resolved hash: ${targetHash})`, {
37
- why: `The ref resolved successfully but no on-disk migration package has a destination (\`to\`) hash matching ${targetHash}.`,
38
- fix: "Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations."
39
- }));
40
- let defaultRaw;
41
- try {
42
- defaultRaw = await readFile(options.contractPathAbsolute, "utf-8");
43
- } catch (error) {
44
- if (isEnoent(error)) return notOk(errorFileNotFound(options.contractPathAbsolute, {
45
- why: `Contract file not found at ${options.contractPathAbsolute}`,
46
- fix: "Run `prisma-next contract emit` first to generate the contract",
47
- cause: error
48
- }));
49
- return notOk(errorUnexpected(error instanceof Error ? error.message : String(error), {
50
- why: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`,
51
- cause: error
52
- }));
53
- }
54
- let parsed;
55
- try {
56
- parsed = castAs(JSON.parse(defaultRaw));
57
- } catch (error) {
58
- return notOk(errorContractDeserializationFailed(options.contractPathAbsolute, error instanceof Error ? error.message : String(error), { cause: error }));
59
- }
60
- if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) return notOk(errorContractDeserializationFailed(options.contractPathAbsolute, `expected a JSON object, got ${parsed === null ? "null" : Array.isArray(parsed) ? "an array" : `a ${typeof parsed}`}`));
61
- const defaultContract = blindCast(parsed);
62
- const storage = defaultContract["storage"];
63
- if ((storage !== null && typeof storage === "object" ? blindCast(storage)["storageHash"] : void 0) === targetHash) return ok({
64
- hash: targetHash,
65
- contractJson: defaultContract,
66
- contractJsonPath: options.contractPathAbsolute,
67
- source: "emitted"
68
- });
69
- return notOk(errorRuntime$1("MIGRATION.SNAPSHOT_MISSING", `No contract file found for hash "${targetHash}"`, {
70
- why: `Resolved contract reference "${options.refInput}" to hash "${targetHash}" but no migration produces that hash and the emitted contract does not match.`,
71
- fix: "Ensure the target contract exists on disk — either as a migration endpoint or as the emitted contract.json."
72
- }));
73
- } catch (error) {
74
- if (MigrationToolsError.is(error)) return notOk(error);
75
- if (CliStructuredError$1.is(error)) return notOk(error);
76
- throw error;
77
- }
78
- }
79
- //#endregion
80
- export { resolveContractRefToSnapshot as t };
81
-
82
- //# sourceMappingURL=contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs","names":["errorRuntime","CliStructuredError"],"sources":["../../../../1-framework/3-tooling/cli/dist/contract-snapshot-resolution-De2VvOJn.mjs"],"sourcesContent":["import { F as mapRefResolutionError, P as errorUnexpected, f as errorFileNotFound, k as errorRuntime, t as CliStructuredError } from \"./cli-errors-B4zTLaqQ.mjs\";\nimport { r as buildReadAggregate } from \"./contract-space-aggregate-loader-fa04OIaL.mjs\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { join } from \"pathe\";\nimport { readFile } from \"node:fs/promises\";\nimport { blindCast, castAs } from \"@internal/utils/casts\";\nimport { MigrationToolsError, errorContractDeserializationFailed } from \"@internal/migration-tools/errors\";\nimport { contractSnapshotDir, readContractSnapshotJson } from \"@internal/migration-tools/contract-snapshot-store\";\nimport { parseContractRef } from \"@internal/migration-tools/ref-resolution\";\n//#region src/control-api/operations/contract-snapshot-resolution.ts\n/**\n* Resolves a user-supplied contract reference to an on-disk contract JSON (snapshot store or emitted contract), shared by db sign and db update --to.\n*/\nfunction isEnoent(error) {\n\treturn error instanceof Error && \"code\" in error && error.code === \"ENOENT\";\n}\nasync function resolveContractRefToSnapshot(options) {\n\ttry {\n\t\tconst loaded = await buildReadAggregate(options.config, { migrationsDir: options.migrationsDir });\n\t\tif (!loaded.ok) return notOk(loaded.failure);\n\t\tconst graph = loaded.value.aggregate.app.graph();\n\t\tconst bundles = loaded.value.aggregate.app.packages;\n\t\tconst refs = loaded.value.aggregate.app.refs;\n\t\tconst refResult = parseContractRef(options.refInput, {\n\t\t\tgraph,\n\t\t\trefs\n\t\t});\n\t\tif (!refResult.ok) return notOk(mapRefResolutionError(refResult.failure));\n\t\tconst targetHash = refResult.value.hash;\n\t\tif (bundles.find((p) => p.metadata.to === targetHash)) return ok({\n\t\t\thash: targetHash,\n\t\t\tcontractJson: blindCast(await readContractSnapshotJson(options.migrationsDir, targetHash)),\n\t\t\tcontractJsonPath: join(contractSnapshotDir(options.migrationsDir, targetHash), \"contract.json\"),\n\t\t\tsource: \"snapshot\"\n\t\t});\n\t\tif (!options.fallbackToEmitted) return notOk(errorUnexpected(`No migration bundle found for ${options.missingBundleFlag} \"${options.refInput}\" (resolved hash: ${targetHash})`, {\n\t\t\twhy: `The ref resolved successfully but no on-disk migration package has a destination (\\`to\\`) hash matching ${targetHash}.`,\n\t\t\tfix: \"Provide a ref or hash that corresponds to an existing migration package, or run `migration list` to see available migrations.\"\n\t\t}));\n\t\tlet defaultRaw;\n\t\ttry {\n\t\t\tdefaultRaw = await readFile(options.contractPathAbsolute, \"utf-8\");\n\t\t} catch (error) {\n\t\t\tif (isEnoent(error)) return notOk(errorFileNotFound(options.contractPathAbsolute, {\n\t\t\t\twhy: `Contract file not found at ${options.contractPathAbsolute}`,\n\t\t\t\tfix: \"Run `prisma-next contract emit` first to generate the contract\",\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t\treturn notOk(errorUnexpected(error instanceof Error ? error.message : String(error), {\n\t\t\t\twhy: `Failed to read contract file: ${error instanceof Error ? error.message : String(error)}`,\n\t\t\t\tcause: error\n\t\t\t}));\n\t\t}\n\t\tlet parsed;\n\t\ttry {\n\t\t\tparsed = castAs(JSON.parse(defaultRaw));\n\t\t} catch (error) {\n\t\t\treturn notOk(errorContractDeserializationFailed(options.contractPathAbsolute, error instanceof Error ? error.message : String(error), { cause: error }));\n\t\t}\n\t\tif (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) return notOk(errorContractDeserializationFailed(options.contractPathAbsolute, `expected a JSON object, got ${parsed === null ? \"null\" : Array.isArray(parsed) ? \"an array\" : `a ${typeof parsed}`}`));\n\t\tconst defaultContract = blindCast(parsed);\n\t\tconst storage = defaultContract[\"storage\"];\n\t\tif ((storage !== null && typeof storage === \"object\" ? blindCast(storage)[\"storageHash\"] : void 0) === targetHash) return ok({\n\t\t\thash: targetHash,\n\t\t\tcontractJson: defaultContract,\n\t\t\tcontractJsonPath: options.contractPathAbsolute,\n\t\t\tsource: \"emitted\"\n\t\t});\n\t\treturn notOk(errorRuntime(\"MIGRATION.SNAPSHOT_MISSING\", `No contract file found for hash \"${targetHash}\"`, {\n\t\t\twhy: `Resolved contract reference \"${options.refInput}\" to hash \"${targetHash}\" but no migration produces that hash and the emitted contract does not match.`,\n\t\t\tfix: \"Ensure the target contract exists on disk — either as a migration endpoint or as the emitted contract.json.\"\n\t\t}));\n\t} catch (error) {\n\t\tif (MigrationToolsError.is(error)) return notOk(error);\n\t\tif (CliStructuredError.is(error)) return notOk(error);\n\t\tthrow error;\n\t}\n}\n//#endregion\nexport { resolveContractRefToSnapshot as t };\n\n//# sourceMappingURL=contract-snapshot-resolution-De2VvOJn.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,SAAS,OAAO;CACxB,OAAO,iBAAiB,SAAS,UAAU,SAAS,MAAM,SAAS;AACpE;AACA,eAAe,6BAA6B,SAAS;CACpD,IAAI;EACH,MAAM,SAAS,MAAM,mBAAmB,QAAQ,QAAQ,EAAE,eAAe,QAAQ,cAAc,CAAC;EAChG,IAAI,CAAC,OAAO,IAAI,OAAO,MAAM,OAAO,OAAO;EAC3C,MAAM,QAAQ,OAAO,MAAM,UAAU,IAAI,MAAM;EAC/C,MAAM,UAAU,OAAO,MAAM,UAAU,IAAI;EAC3C,MAAM,OAAO,OAAO,MAAM,UAAU,IAAI;EACxC,MAAM,YAAY,iBAAiB,QAAQ,UAAU;GACpD;GACA;EACD,CAAC;EACD,IAAI,CAAC,UAAU,IAAI,OAAO,MAAM,sBAAsB,UAAU,OAAO,CAAC;EACxE,MAAM,aAAa,UAAU,MAAM;EACnC,IAAI,QAAQ,MAAM,MAAM,EAAE,SAAS,OAAO,UAAU,GAAG,OAAO,GAAG;GAChE,MAAM;GACN,cAAc,UAAU,MAAM,yBAAyB,QAAQ,eAAe,UAAU,CAAC;GACzF,kBAAkB,KAAK,oBAAoB,QAAQ,eAAe,UAAU,GAAG,eAAe;GAC9F,QAAQ;EACT,CAAC;EACD,IAAI,CAAC,QAAQ,mBAAmB,OAAO,MAAM,gBAAgB,iCAAiC,QAAQ,kBAAkB,IAAI,QAAQ,SAAS,oBAAoB,WAAW,IAAI;GAC/K,KAAK,2GAA2G,WAAW;GAC3H,KAAK;EACN,CAAC,CAAC;EACF,IAAI;EACJ,IAAI;GACH,aAAa,MAAM,SAAS,QAAQ,sBAAsB,OAAO;EAClE,SAAS,OAAO;GACf,IAAI,SAAS,KAAK,GAAG,OAAO,MAAM,kBAA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