@prisma/orm-toolchain 8.0.0-rc.1-dev.23 → 8.0.0-rc.1-dev.24

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 (235) hide show
  1. package/dist/{aggregate-D53gnb7v.mjs → aggregate-BKbHUHLA.mjs} +7 -7
  2. package/dist/{aggregate-D53gnb7v.mjs.map → aggregate-BKbHUHLA.mjs.map} +1 -1
  3. package/dist/{aggregate-BflrjWPO.d.mts → aggregate-CA6bJ8UO.d.mts} +3 -3
  4. package/dist/{aggregate-BflrjWPO.d.mts.map → aggregate-CA6bJ8UO.d.mts.map} +1 -1
  5. package/dist/bin__prisma-next.mjs +31 -26
  6. package/dist/bin__prisma-next.mjs.map +1 -1
  7. package/dist/{caught-errors-D7Qznyrm-DaZubR00.mjs → caught-errors-nYuTn3NK-DkD-ZrDr.mjs} +3 -3
  8. package/dist/caught-errors-nYuTn3NK-DkD-ZrDr.mjs.map +1 -0
  9. package/dist/{cli-errors-BKPhkBSf-Ca-ymb6S.d.mts → cli-errors-C7vbvQuK-DLpSxz4U.d.mts} +15 -7
  10. package/dist/{cli-errors-BKPhkBSf-Ca-ymb6S.d.mts.map → cli-errors-C7vbvQuK-DLpSxz4U.d.mts.map} +1 -1
  11. package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs +235 -0
  12. package/dist/cli-errors-kU09RUaz-CUkQ9XuM.mjs.map +1 -0
  13. package/dist/cli-telemetry.mjs +2 -2
  14. package/dist/cli.d.mts +38 -2
  15. package/dist/cli.d.mts.map +1 -1
  16. package/dist/cli.mjs +358 -5
  17. package/dist/cli.mjs.map +1 -1
  18. package/dist/cli__commands__contract-emit.d.mts +1 -1
  19. package/dist/cli__commands__contract-emit.mjs +1 -1
  20. package/dist/cli__commands__contract-infer.mjs +1 -1
  21. package/dist/cli__commands__db-init.mjs +1 -1
  22. package/dist/cli__commands__db-schema.mjs +1 -1
  23. package/dist/cli__commands__db-sign.mjs +1 -1
  24. package/dist/cli__commands__db-update.mjs +1 -1
  25. package/dist/cli__commands__db-verify.mjs +1 -1
  26. package/dist/cli__commands__migrate.d.mts +2 -2
  27. package/dist/cli__commands__migrate.mjs +1 -1
  28. package/dist/cli__commands__migration-check.mjs +1 -1
  29. package/dist/cli__commands__migration-graph.d.mts +1 -1
  30. package/dist/cli__commands__migration-graph.mjs +1 -1
  31. package/dist/cli__commands__migration-list.d.mts +2 -2
  32. package/dist/cli__commands__migration-list.mjs +1 -1
  33. package/dist/cli__commands__migration-log.d.mts +1 -1
  34. package/dist/cli__commands__migration-log.mjs +1 -1
  35. package/dist/cli__commands__migration-new.mjs +1 -1
  36. package/dist/cli__commands__migration-plan.d.mts +1 -1
  37. package/dist/cli__commands__migration-plan.mjs +1 -1
  38. package/dist/cli__commands__migration-show.mjs +1 -1
  39. package/dist/cli__commands__migration-status.d.mts +1 -1
  40. package/dist/cli__commands__migration-status.mjs +1 -1
  41. package/dist/cli__commands__ref.mjs +1 -1
  42. package/dist/cli__commands__telemetry.mjs +1 -1
  43. package/dist/cli__control-api.d.mts +25 -18
  44. package/dist/cli__control-api.d.mts.map +1 -1
  45. package/dist/cli__control-api.mjs +16 -16
  46. package/dist/cli__control-api__testing.d.mts +1 -1
  47. package/dist/cli__control-api__testing.mjs +1 -1
  48. package/dist/cli__migration-cli.mjs +4 -4
  49. package/dist/{client-BNAEJZ76-ld7eOxpZ.mjs → client-milNsAnF-B92uF3yv.mjs} +11 -11
  50. package/dist/client-milNsAnF-B92uF3yv.mjs.map +1 -0
  51. package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs +765 -0
  52. package/dist/command-helpers-bGYd7Aab-BNSzfbHK.mjs.map +1 -0
  53. package/dist/config-loader.d.mts +1 -1
  54. package/dist/config-loader.mjs +1 -1
  55. package/dist/{contract-at-errors-Dv1mxKYO-D4xfRBW5.mjs → contract-at-errors-BTeDEXm4-BAIDia2-.mjs} +3 -3
  56. package/dist/contract-at-errors-BTeDEXm4-BAIDia2-.mjs.map +1 -0
  57. package/dist/{contract-emit-DT0JKUZT-BYE7WZPc.mjs → contract-emit-Bdf4DAR4-lKqkbfZT.mjs} +8 -46
  58. package/dist/contract-emit-Bdf4DAR4-lKqkbfZT.mjs.map +1 -0
  59. package/dist/{contract-emit-DFu7h-Zl-7DBgYNv7.mjs → contract-emit-Ci-8sP-b-QzQXK2xQ.mjs} +26 -16
  60. package/dist/contract-emit-Ci-8sP-b-QzQXK2xQ.mjs.map +1 -0
  61. package/dist/{contract-emit-B65_UiFn.d.mts → contract-emit-CvwNE4R1-DEn1V1Zo.d.mts} +2 -2
  62. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +1 -0
  63. package/dist/contract-emit-E6m8HE42-Bfiodzf_.mjs +2 -0
  64. package/dist/{contract-infer-C_b7E71m-D2UO-X-k.mjs → contract-infer-hhyMJiwS-BJ5cYC9P.mjs} +7 -6
  65. package/dist/contract-infer-hhyMJiwS-BJ5cYC9P.mjs.map +1 -0
  66. package/dist/{contract-snapshot-resolution-SATuw0JW-DpTZJd1x.mjs → contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs} +7 -7
  67. package/dist/contract-snapshot-resolution-CyvX0DPz-BBQI_70j.mjs.map +1 -0
  68. package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs} +2 -2
  69. package/dist/{contract-snapshot-store-C9-J6OBn-ByElY0EC.mjs.map → contract-snapshot-store-C9-J6OBn-kpuB2oCK.mjs.map} +1 -1
  70. package/dist/{contract-space-aggregate-loader-C5r12INu-DfE0nmtZ.mjs → contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs} +7 -6
  71. package/dist/contract-space-aggregate-loader-DOzo1sk9-CCPCubsg.mjs.map +1 -0
  72. package/dist/{db-init-Cqjw5Flp.mjs → db-init-3CbSYxRI-BlTkWh8n.mjs} +10 -8
  73. package/dist/db-init-3CbSYxRI-BlTkWh8n.mjs.map +1 -0
  74. package/dist/{db-schema-CRGCFKlH.mjs → db-schema-BVLbe3EL-WLnbuo77.mjs} +6 -5
  75. package/dist/db-schema-BVLbe3EL-WLnbuo77.mjs.map +1 -0
  76. package/dist/{db-sign-BPQduGHb.mjs → db-sign-Cdw2RmoG-C-X5UheR.mjs} +12 -10
  77. package/dist/db-sign-Cdw2RmoG-C-X5UheR.mjs.map +1 -0
  78. package/dist/{db-update-DuEk-ra5.mjs → db-update-BHOdo8PV-BVBNKrJc.mjs} +11 -9
  79. package/dist/db-update-BHOdo8PV-BVBNKrJc.mjs.map +1 -0
  80. package/dist/{db-verify-DPH4lonK-pteoYVnK.mjs → db-verify-C9P9oNCs-gieY7hV2.mjs} +13 -11
  81. package/dist/db-verify-C9P9oNCs-gieY7hV2.mjs.map +1 -0
  82. package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs} +2 -2
  83. package/dist/{domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs.map → domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map} +1 -1
  84. package/dist/emitter.d.mts +1 -1
  85. package/dist/emitter.mjs +2 -2
  86. package/dist/emitter__domain-type-generation.mjs +1 -1
  87. package/dist/{exports-BCLg4CiV-okAfZydo.mjs → exports-BCLg4CiV-05kuwcb0.mjs} +4 -4
  88. package/dist/{exports-BCLg4CiV-okAfZydo.mjs.map → exports-BCLg4CiV-05kuwcb0.mjs.map} +1 -1
  89. package/dist/{exports-DVoyX2LM.mjs → exports-BZLNbtkY.mjs} +54 -12
  90. package/dist/exports-BZLNbtkY.mjs.map +1 -0
  91. package/dist/{exports-BN0vFTxG.mjs → exports-CqNUihkI.mjs} +2 -2
  92. package/dist/{exports-BN0vFTxG.mjs.map → exports-CqNUihkI.mjs.map} +1 -1
  93. package/dist/{exports-DAA3XD4a.mjs → exports-DaxzMVtq.mjs} +3 -3
  94. package/dist/{exports-DAA3XD4a.mjs.map → exports-DaxzMVtq.mjs.map} +1 -1
  95. package/dist/{format-DyVeO1z5-D1lnTJaz.mjs → format-Ddhz7xFW-Bo1nhay8.mjs} +18 -11
  96. package/dist/format-Ddhz7xFW-Bo1nhay8.mjs.map +1 -0
  97. package/dist/{framework-components-ioeTnj2Z-yyQtaVWk.mjs → framework-components-Cruf6BPK-CaQvMI3T.mjs} +3 -3
  98. package/dist/framework-components-Cruf6BPK-CaQvMI3T.mjs.map +1 -0
  99. package/dist/{index-Deu3DQZI.d.mts → index-mCsi_ND5.d.mts} +4 -2
  100. package/dist/index-mCsi_ND5.d.mts.map +1 -0
  101. package/dist/{init-BwYYd10C-CJq9i42m.mjs → init-BbmawfZx-DCylULYh.mjs} +23 -8
  102. package/dist/init-BbmawfZx-DCylULYh.mjs.map +1 -0
  103. package/dist/{inspect-live-schema-CXH4ZGHT-BfUdyZme.mjs → inspect-live-schema-BEQun_1x-CZpCgg8A.mjs} +7 -6
  104. package/dist/inspect-live-schema-BEQun_1x-CZpCgg8A.mjs.map +1 -0
  105. package/dist/{invariants-BzYfO9IL-BPDPDIr0.mjs → invariants-D5TNnX5E-rjPoJGFq.mjs} +4 -3
  106. package/dist/invariants-D5TNnX5E-rjPoJGFq.mjs.map +1 -0
  107. package/dist/{io-CHUUeHh0-CoCBe9eN.mjs → io-CHUUeHh0-CbyTkKP6.mjs} +2 -2
  108. package/dist/{io-CHUUeHh0-CoCBe9eN.mjs.map → io-CHUUeHh0-CbyTkKP6.mjs.map} +1 -1
  109. package/dist/{legend-5iwwlLU2-Bit8enjF.mjs → legend-BBtAETiW-BHqTbUjx.mjs} +3 -3
  110. package/dist/legend-BBtAETiW-BHqTbUjx.mjs.map +1 -0
  111. package/dist/{migrate-Bfsw18KQ.mjs → migrate-B-hpVTxi-DJzFYT2w.mjs} +32 -16
  112. package/dist/migrate-B-hpVTxi-DJzFYT2w.mjs.map +1 -0
  113. package/dist/{migrate-show-CO5OiR3J-DE4NIjvW.mjs → migrate-show-CUymfnbM-BbpcO2FY.mjs} +9 -23
  114. package/dist/migrate-show-CUymfnbM-BbpcO2FY.mjs.map +1 -0
  115. package/dist/{migrate-show-Cu3k9mZm-B-nCgvK1.d.mts → migrate-show-g71Z4vJw-ocdTvf70.d.mts} +10 -5
  116. package/dist/migrate-show-g71Z4vJw-ocdTvf70.d.mts.map +1 -0
  117. package/dist/{migration-DAJY-NmR.mjs → migration-_C5W2uXF.mjs} +2 -2
  118. package/dist/{migration-DAJY-NmR.mjs.map → migration-_C5W2uXF.mjs.map} +1 -1
  119. package/dist/{migration-check-DONPyXff-KpD0q3Zh.mjs → migration-check-DHYPMUFe-Cni_ZUzB.mjs} +33 -30
  120. package/dist/migration-check-DHYPMUFe-Cni_ZUzB.mjs.map +1 -0
  121. package/dist/{migration-check-BfOnfgyY-DII6Ty5m.mjs → migration-check-zgqYe3SB-B6LI6wY7.mjs} +9 -8
  122. package/dist/migration-check-zgqYe3SB-B6LI6wY7.mjs.map +1 -0
  123. package/dist/{migration-command-scaffold-CGcbYM2B-C3B8S3c-.mjs → migration-command-scaffold-DsT7ke7B-D3u913Po.mjs} +7 -6
  124. package/dist/migration-command-scaffold-DsT7ke7B-D3u913Po.mjs.map +1 -0
  125. package/dist/{migration-graph-HKch1Xk4-DD-3zdSg.mjs → migration-graph-CChCjts3-ERrIm5aT.mjs} +3 -3
  126. package/dist/{migration-graph-HKch1Xk4-DD-3zdSg.mjs.map → migration-graph-CChCjts3-ERrIm5aT.mjs.map} +1 -1
  127. package/dist/{migration-graph-BHiSuhBR.mjs → migration-graph-Dm9gU0oE-DxPD_SNA.mjs} +10 -9
  128. package/dist/migration-graph-Dm9gU0oE-DxPD_SNA.mjs.map +1 -0
  129. package/dist/{migration-list-C9OPCMt--BBm2c7tN.mjs → migration-list-Bkase_ZM-D-bErpSr.mjs} +4 -4
  130. package/dist/migration-list-Bkase_ZM-D-bErpSr.mjs.map +1 -0
  131. package/dist/{migration-list-BkTNEeOK.mjs → migration-list-DDGUTC8Y-B_X7rkez.mjs} +9 -8
  132. package/dist/migration-list-DDGUTC8Y-B_X7rkez.mjs.map +1 -0
  133. package/dist/{migration-log-CqrwQXER-cqf2INDN.mjs → migration-log-Cft50PRu-DcnHdxT4.mjs} +9 -7
  134. package/dist/migration-log-Cft50PRu-DcnHdxT4.mjs.map +1 -0
  135. package/dist/{migration-new-NuMfcbH8.mjs → migration-new-D9GHbYwF-C8D22HXG.mjs} +25 -5
  136. package/dist/migration-new-D9GHbYwF-C8D22HXG.mjs.map +1 -0
  137. package/dist/{migration-new-Cjhe_MIE-CIovsuXK.mjs → migration-new-RorO1I8r-Ch8NQ4GQ.mjs} +19 -27
  138. package/dist/migration-new-RorO1I8r-Ch8NQ4GQ.mjs.map +1 -0
  139. package/dist/{migration-path-target-BPYp3LNc-DjdEIQsZ.mjs → migration-path-target-DhGt62Mi-dm4TU1hJ.mjs} +4 -4
  140. package/dist/migration-path-target-DhGt62Mi-dm4TU1hJ.mjs.map +1 -0
  141. package/dist/{migration-plan-D81XmVwy.mjs → migration-plan-BOhasCLr-GJWYoOA8.mjs} +25 -5
  142. package/dist/migration-plan-BOhasCLr-GJWYoOA8.mjs.map +1 -0
  143. package/dist/{migration-plan-DE7-vtqT-jgtSH4Lw.mjs → migration-plan-DrCTzrXH-CDJbdiC6.mjs} +29 -37
  144. package/dist/migration-plan-DrCTzrXH-CDJbdiC6.mjs.map +1 -0
  145. package/dist/{migration-plan-DvBJhxXg-B5aHAOtu.d.mts → migration-plan-t2e_8yD2-w5Ffa0V_.d.mts} +10 -5
  146. package/dist/migration-plan-t2e_8yD2-w5Ffa0V_.d.mts.map +1 -0
  147. package/dist/{migration-show-DEsLJ6-a.mjs → migration-show-DRARjIbv-1p6EE_Uw.mjs} +13 -11
  148. package/dist/migration-show-DRARjIbv-1p6EE_Uw.mjs.map +1 -0
  149. package/dist/{migration-status-DfLM3VqL.mjs → migration-status-Yh0eOQJN-YpcPDpNh.mjs} +14 -12
  150. package/dist/migration-status-Yh0eOQJN-YpcPDpNh.mjs.map +1 -0
  151. package/dist/migration-tools.d.mts +2 -2
  152. package/dist/migration-tools.mjs +8 -8
  153. package/dist/migration-tools__aggregate.d.mts +1 -1
  154. package/dist/migration-tools__aggregate.mjs +1 -1
  155. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  156. package/dist/migration-tools__io.mjs +1 -1
  157. package/dist/migration-tools__migration-ts.mjs +1 -1
  158. package/dist/migration-tools__migration.mjs +1 -1
  159. package/dist/migration-tools__spaces.d.mts +1 -1
  160. package/dist/migration-tools__spaces.mjs +2 -2
  161. package/dist/{migration-ts-FyF55c4M.mjs → migration-ts-BoHxxGvi.mjs} +2 -2
  162. package/dist/{migration-ts-FyF55c4M.mjs.map → migration-ts-BoHxxGvi.mjs.map} +1 -1
  163. package/dist/{project-import-root-C_bd0ooL-CusfluWF.mjs → project-import-root--e8xli8Z-Bfrvrv67.mjs} +3 -3
  164. package/dist/project-import-root--e8xli8Z-Bfrvrv67.mjs.map +1 -0
  165. package/dist/{ref-DrAvdDhN-q1ccuI03.mjs → ref-BQcl8Ksv-BYZY0Ktb.mjs} +12 -28
  166. package/dist/ref-BQcl8Ksv-BYZY0Ktb.mjs.map +1 -0
  167. package/dist/{ref-D6JzE8nq.mjs → ref-Cu7Zc1Hv-_R4MnDfr.mjs} +30 -7
  168. package/dist/ref-Cu7Zc1Hv-_R4MnDfr.mjs.map +1 -0
  169. package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs} +3 -3
  170. package/dist/{ref-advancement-DaZBzm7m-BZQtedYC.mjs.map → ref-advancement-DaZBzm7m-Deq5Cs7O.mjs.map} +1 -1
  171. package/dist/{ref-resolution-_S4xTT2L-JfNjZU9d.mjs → ref-resolution-BYCRg72z-DFhwf-XR.mjs} +3 -3
  172. package/dist/ref-resolution-BYCRg72z-DFhwf-XR.mjs.map +1 -0
  173. package/dist/{spaces-DxuvClN9.mjs → spaces-DBTCE3Js.mjs} +6 -6
  174. package/dist/{spaces-DxuvClN9.mjs.map → spaces-DBTCE3Js.mjs.map} +1 -1
  175. package/dist/{spaces-D5qtTlhj.d.mts → spaces-tWQi7CUv.d.mts} +2 -2
  176. package/dist/{spaces-D5qtTlhj.d.mts.map → spaces-tWQi7CUv.d.mts.map} +1 -1
  177. package/dist/{telemetry-DVBHDQd6-CWNTFnMO.mjs → telemetry-Dh6e0ams-BsjGN3tQ.mjs} +5 -4
  178. package/dist/telemetry-Dh6e0ams-BsjGN3tQ.mjs.map +1 -0
  179. package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs +645 -0
  180. package/dist/terminal-ui-ypPE9cN6-ilMBkmwT.mjs.map +1 -0
  181. package/dist/{verify-C6L_hiJU-MX67LFfI.mjs → verify-DBsKxZrK-eDPxNiSS.mjs} +3 -3
  182. package/dist/verify-DBsKxZrK-eDPxNiSS.mjs.map +1 -0
  183. package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs} +2 -2
  184. package/dist/{verify-contract-spaces-WvjSiWcB-zGhaCnfs.mjs.map → verify-contract-spaces-WvjSiWcB-DZPPCwWO.mjs.map} +1 -1
  185. package/dist/vite-plugin-contract-emit.mjs +13 -3
  186. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  187. package/package.json +13 -12
  188. package/dist/caught-errors-D7Qznyrm-DaZubR00.mjs.map +0 -1
  189. package/dist/client-BNAEJZ76-ld7eOxpZ.mjs.map +0 -1
  190. package/dist/command-helpers-C4WpR-QE-DNllqff1.mjs +0 -1627
  191. package/dist/command-helpers-C4WpR-QE-DNllqff1.mjs.map +0 -1
  192. package/dist/contract-at-errors-Dv1mxKYO-D4xfRBW5.mjs.map +0 -1
  193. package/dist/contract-emit-B65_UiFn.d.mts.map +0 -1
  194. package/dist/contract-emit-DFu7h-Zl-7DBgYNv7.mjs.map +0 -1
  195. package/dist/contract-emit-DT0JKUZT-BYE7WZPc.mjs.map +0 -1
  196. package/dist/contract-infer-C_b7E71m-D2UO-X-k.mjs.map +0 -1
  197. package/dist/contract-snapshot-resolution-SATuw0JW-DpTZJd1x.mjs.map +0 -1
  198. package/dist/contract-space-aggregate-loader-C5r12INu-DfE0nmtZ.mjs.map +0 -1
  199. package/dist/db-init-Cqjw5Flp.mjs.map +0 -1
  200. package/dist/db-schema-CRGCFKlH.mjs.map +0 -1
  201. package/dist/db-sign-BPQduGHb.mjs.map +0 -1
  202. package/dist/db-update-DuEk-ra5.mjs.map +0 -1
  203. package/dist/db-verify-DPH4lonK-pteoYVnK.mjs.map +0 -1
  204. package/dist/exports-DVoyX2LM.mjs.map +0 -1
  205. package/dist/format-DyVeO1z5-D1lnTJaz.mjs.map +0 -1
  206. package/dist/framework-components-ioeTnj2Z-yyQtaVWk.mjs.map +0 -1
  207. package/dist/index-Deu3DQZI.d.mts.map +0 -1
  208. package/dist/init-BwYYd10C-CJq9i42m.mjs.map +0 -1
  209. package/dist/inspect-live-schema-CXH4ZGHT-BfUdyZme.mjs.map +0 -1
  210. package/dist/invariants-BzYfO9IL-BPDPDIr0.mjs.map +0 -1
  211. package/dist/legend-5iwwlLU2-Bit8enjF.mjs.map +0 -1
  212. package/dist/migrate-Bfsw18KQ.mjs.map +0 -1
  213. package/dist/migrate-show-CO5OiR3J-DE4NIjvW.mjs.map +0 -1
  214. package/dist/migrate-show-Cu3k9mZm-B-nCgvK1.d.mts.map +0 -1
  215. package/dist/migration-check-BfOnfgyY-DII6Ty5m.mjs.map +0 -1
  216. package/dist/migration-check-DONPyXff-KpD0q3Zh.mjs.map +0 -1
  217. package/dist/migration-command-scaffold-CGcbYM2B-C3B8S3c-.mjs.map +0 -1
  218. package/dist/migration-graph-BHiSuhBR.mjs.map +0 -1
  219. package/dist/migration-list-BkTNEeOK.mjs.map +0 -1
  220. package/dist/migration-list-C9OPCMt--BBm2c7tN.mjs.map +0 -1
  221. package/dist/migration-log-CqrwQXER-cqf2INDN.mjs.map +0 -1
  222. package/dist/migration-new-Cjhe_MIE-CIovsuXK.mjs.map +0 -1
  223. package/dist/migration-new-NuMfcbH8.mjs.map +0 -1
  224. package/dist/migration-path-target-BPYp3LNc-DjdEIQsZ.mjs.map +0 -1
  225. package/dist/migration-plan-D81XmVwy.mjs.map +0 -1
  226. package/dist/migration-plan-DE7-vtqT-jgtSH4Lw.mjs.map +0 -1
  227. package/dist/migration-plan-DvBJhxXg-B5aHAOtu.d.mts.map +0 -1
  228. package/dist/migration-show-DEsLJ6-a.mjs.map +0 -1
  229. package/dist/migration-status-DfLM3VqL.mjs.map +0 -1
  230. package/dist/project-import-root-C_bd0ooL-CusfluWF.mjs.map +0 -1
  231. package/dist/ref-D6JzE8nq.mjs.map +0 -1
  232. package/dist/ref-DrAvdDhN-q1ccuI03.mjs.map +0 -1
  233. package/dist/ref-resolution-_S4xTT2L-JfNjZU9d.mjs.map +0 -1
  234. package/dist/telemetry-DVBHDQd6-CWNTFnMO.mjs.map +0 -1
  235. package/dist/verify-C6L_hiJU-MX67LFfI.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-bpSO3Y0L.mjs"],"sourcesContent":["import { isSafeTypeExpression } from \"./type-expression-safety.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { renderImports, tsStringLiteral } from \"@internal/ts-render\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/emitter-errors.ts\nfunction emitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/domain-type-generation.ts\nfunction serializeValue(value) {\n\tif (value === null) return \"null\";\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (Array.isArray(value)) return `readonly [${value.map((v) => serializeValue(v)).join(\", \")}]`;\n\tif (typeof value === \"object\") {\n\t\tconst entries = [];\n\t\tfor (const [k, v] of Object.entries(value)) entries.push(`readonly ${serializeObjectKey(k)}: ${serializeValue(v)}`);\n\t\treturn `{ ${entries.join(\"; \")} }`;\n\t}\n\treturn \"unknown\";\n}\nfunction serializeObjectKey(key) {\n\tif (/^[$A-Z_a-z][$\\w]*$/.test(key)) return key;\n\treturn serializeValue(key);\n}\nfunction serializeNamespaceId(value) {\n\treturn `${serializeValue(value)} & NamespaceId`;\n}\nfunction serializeCrossReference(ref) {\n\treturn `{ readonly namespace: ${serializeNamespaceId(String(ref.namespace))}; readonly model: ${serializeValue(ref.model)}${ref.space !== void 0 ? `; readonly space: ${serializeValue(ref.space)}` : \"\"} }`;\n}\nfunction generateRootsType(roots) {\n\tif (!roots || Object.keys(roots).length === 0) return \"Record<string, never>\";\n\treturn `{ ${Object.entries(roots).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${serializeCrossReference(value)}`).join(\"; \")} }`;\n}\nfunction contractFieldModifierSuffix(field) {\n\treturn (field.many === true ? \"; readonly many: true\" : \"\") + (field.dict === true ? \"; readonly dict: true\" : \"\");\n}\nfunction generateModelFieldEntry(fieldName, field) {\n\tconst mods = contractFieldModifierSuffix(field);\n\tconst { nullable, type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${mods} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"valueObject\"; readonly name: ${serializeValue(type.name)} }${mods} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${serializeValue(type)}${mods} }`;\n}\nfunction generateModelFieldsType(fields) {\n\tconst fieldEntries = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) fieldEntries.push(generateModelFieldEntry(fieldName, field));\n\treturn fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n}\nfunction generateModelRelationsType(relations) {\n\tconst relationEntries = [];\n\tfor (const [relName, rel] of Object.entries(relations)) {\n\t\tif (typeof rel !== \"object\" || rel === null) continue;\n\t\tconst relObj = rel;\n\t\tconst toRef = relObj[\"to\"];\n\t\tif (toRef !== null && typeof toRef === \"object\" && \"space\" in toRef && toRef.space !== void 0) {\n\t\t\trelationEntries.push(`readonly ${serializeObjectKey(relName)}: never`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parts = [];\n\t\tif (toRef) parts.push(`readonly to: ${serializeCrossReference(blindCast(toRef))}`);\n\t\tif (relObj[\"cardinality\"]) parts.push(`readonly cardinality: ${serializeValue(relObj[\"cardinality\"])}`);\n\t\tconst on = relObj[\"on\"];\n\t\tif (on && (!on.localFields || !on.targetFields)) throw emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relName}\" has an \"on\" block but is missing localFields or targetFields`, { meta: { relation: relName } });\n\t\tif (on?.localFields && on.targetFields) {\n\t\t\tconst localFields = on.localFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tconst targetFields = on.targetFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tparts.push(`readonly on: { readonly localFields: readonly [${localFields}]; readonly targetFields: readonly [${targetFields}] }`);\n\t\t}\n\t\tif (relObj[\"cardinality\"] === \"N:M\") {\n\t\t\tconst { through } = blindCast(relObj);\n\t\t\tconst table = serializeValue(through.table);\n\t\t\tconst namespaceId = serializeValue(through.namespaceId);\n\t\t\tconst parentColumns = through.parentColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst childColumns = through.childColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst targetColumns = through.targetColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tparts.push(`readonly through: { readonly table: ${table}; readonly namespaceId: ${namespaceId}; readonly parentColumns: readonly [${parentColumns}]; readonly childColumns: readonly [${childColumns}]; readonly targetColumns: readonly [${targetColumns}] }`);\n\t\t}\n\t\tif (parts.length > 0) relationEntries.push(`readonly ${serializeObjectKey(relName)}: { ${parts.join(\"; \")} }`);\n\t}\n\tif (relationEntries.length === 0) return \"Record<string, never>\";\n\treturn `{ ${relationEntries.join(\"; \")} }`;\n}\nfunction generateModelsType(models, generateModelStorage) {\n\tif (!models || Object.keys(models).length === 0) return \"Record<string, never>\";\n\tconst modelTypes = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tconst fieldsType = generateModelFieldsType(model.fields);\n\t\tconst relationsType = generateModelRelationsType(model.relations);\n\t\tconst storageType = generateModelStorage(modelName, model);\n\t\tconst modelParts = [\n\t\t\t`readonly fields: ${fieldsType}`,\n\t\t\t`readonly relations: ${relationsType}`,\n\t\t\t`readonly storage: ${storageType}`\n\t\t];\n\t\tif (model.owner) modelParts.push(`readonly owner: ${serializeValue(model.owner)}`);\n\t\tif (model.discriminator) modelParts.push(`readonly discriminator: ${serializeValue(model.discriminator)}`);\n\t\tif (model.variants) modelParts.push(`readonly variants: ${serializeValue(model.variants)}`);\n\t\tif (model.base) modelParts.push(`readonly base: ${serializeCrossReference(model.base)}`);\n\t\tmodelTypes.push(`readonly ${serializeObjectKey(modelName)}: { ${modelParts.join(\"; \")} }`);\n\t}\n\treturn `{ ${modelTypes.join(\"; \")} }`;\n}\nfunction deduplicateImports(imports) {\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const imp of imports) {\n\t\tconst key = `${imp.package}::${imp.named}`;\n\t\tif (!seenKeys.has(key)) {\n\t\t\tseenKeys.add(key);\n\t\t\tresult.push(imp);\n\t\t}\n\t}\n\treturn result;\n}\nfunction generateImportLines(imports, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst rendered = renderImports(imports.map((imp) => ({\n\t\tmoduleSpecifier: resolveImportSpecifier(imp.package),\n\t\tsymbol: imp.named,\n\t\talias: imp.alias,\n\t\ttypeOnly: true\n\t})));\n\treturn rendered === \"\" ? [] : rendered.split(\"\\n\");\n}\nfunction generateCodecTypeIntersection(imports, named) {\n\treturn imports.filter((imp) => imp.named === named).map((imp) => imp.alias).join(\" & \") || \"Record<string, never>\";\n}\nfunction serializeExecutionType(execution) {\n\tconst parts = [\"readonly executionHash: ExecutionHash\"];\n\tfor (const [key, value] of Object.entries(execution)) {\n\t\tif (key === \"executionHash\") continue;\n\t\tparts.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\nfunction generateHashTypeAliases(hashes) {\n\tconst executionHashType = hashes.executionHash ? `ExecutionHashBase<${serializeValue(hashes.executionHash)}>` : \"ExecutionHashBase<string>\";\n\treturn [\n\t\t`export type StorageHash = StorageHashBase<${serializeValue(hashes.storageHash)}>;`,\n\t\t`export type ExecutionHash = ${executionHashType};`,\n\t\t`export type ProfileHash = ProfileHashBase<${serializeValue(hashes.profileHash)}>;`\n\t].join(\"\\n\");\n}\nfunction applyModifiers(base, field) {\n\tlet result = base;\n\tif (field.many === true) result = `ReadonlyArray<${result}>`;\n\tif (field.dict === true) result = `Readonly<Record<string, ${result}>>`;\n\tif (field.nullable) result = `${result} | null`;\n\treturn result;\n}\n/**\n* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by\n* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not\n* a generic serializer. `side`: `output` = read type, `input` = create/update type.\n*\n* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when\n* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value\n* isn't literal-expressible. A caller that needs column and field types to agree shares this so both\n* compute the union identically.\n*/\nfunction renderValueSetType(values, codecId, side, codecLookup) {\n\tif (values.length === 0 || codecLookup?.renderValueLiteralFor === void 0) return void 0;\n\tconst literals = [];\n\tfor (const value of values) {\n\t\tconst lit = codecLookup.renderValueLiteralFor(codecId, value, side);\n\t\tif (lit === void 0 || !isSafeTypeExpression(lit)) return void 0;\n\t\tliterals.push(lit);\n\t}\n\treturn literals.join(\" | \");\n}\nfunction resolveFieldType(field, codecLookup, resolvedTypeParams, resolvedValueSet) {\n\tconst { type } = field;\n\tswitch (type.kind) {\n\t\tcase \"scalar\": {\n\t\t\tif (resolvedValueSet) {\n\t\t\t\tconst output = renderValueSetType(resolvedValueSet.encodedValues, resolvedValueSet.codecId, \"output\", codecLookup);\n\t\t\t\tconst input = renderValueSetType(resolvedValueSet.encodedValues, resolvedValueSet.codecId, \"input\", codecLookup);\n\t\t\t\tif (output !== void 0 && input !== void 0) return {\n\t\t\t\t\toutput: applyModifiers(output, field),\n\t\t\t\t\tinput: applyModifiers(input, field)\n\t\t\t\t};\n\t\t\t}\n\t\t\tlet outputResolved;\n\t\t\tlet inputResolved;\n\t\t\tconst effectiveTypeParams = (type.typeParams && Object.keys(type.typeParams).length > 0 ? type.typeParams : void 0) ?? resolvedTypeParams;\n\t\t\tif (codecLookup && effectiveTypeParams && Object.keys(effectiveTypeParams).length > 0) {\n\t\t\t\tconst rendered = codecLookup.renderOutputTypeFor(type.codecId, effectiveTypeParams);\n\t\t\t\tif (rendered && isSafeTypeExpression(rendered)) outputResolved = rendered;\n\t\t\t\tconst renderedInput = codecLookup.renderInputTypeFor?.(type.codecId, effectiveTypeParams);\n\t\t\t\tif (renderedInput && isSafeTypeExpression(renderedInput)) inputResolved = renderedInput;\n\t\t\t}\n\t\t\tconst codecAccessor = `CodecTypes[${serializeValue(type.codecId)}]`;\n\t\t\treturn {\n\t\t\t\toutput: applyModifiers(outputResolved ?? `${codecAccessor}[\"output\"]`, field),\n\t\t\t\tinput: applyModifiers(inputResolved ?? `${codecAccessor}[\"input\"]`, field)\n\t\t\t};\n\t\t}\n\t\tcase \"valueObject\": return {\n\t\t\toutput: applyModifiers(`${type.name}Output`, field),\n\t\t\tinput: applyModifiers(`${type.name}Input`, field)\n\t\t};\n\t\tcase \"union\": {\n\t\t\tconst outputMembers = type.members.map((m) => m.kind === \"scalar\" ? `CodecTypes[${serializeValue(m.codecId)}][\"output\"]` : `${m.name}Output`);\n\t\t\tconst inputMembers = type.members.map((m) => m.kind === \"scalar\" ? `CodecTypes[${serializeValue(m.codecId)}][\"input\"]` : `${m.name}Input`);\n\t\t\treturn {\n\t\t\t\toutput: applyModifiers(outputMembers.join(\" | \"), field),\n\t\t\t\tinput: applyModifiers(inputMembers.join(\" | \"), field)\n\t\t\t};\n\t\t}\n\t\tdefault: return {\n\t\t\toutput: applyModifiers(\"unknown\", field),\n\t\t\tinput: applyModifiers(\"unknown\", field)\n\t\t};\n\t}\n}\nfunction generateFieldResolvedType(field, codecLookup, side = \"output\") {\n\treturn resolveFieldType(field, codecLookup)[side];\n}\nfunction generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams, resolveFieldValueSet) {\n\tif (!models || Object.keys(models).length === 0) return {\n\t\toutput: \"Record<string, never>\",\n\t\tinput: \"Record<string, never>\"\n\t};\n\tconst outputModelEntries = [];\n\tconst inputModelEntries = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tif (!model) continue;\n\t\tconst outputFieldEntries = [];\n\t\tconst inputFieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(model.fields)) {\n\t\t\tconst resolvedTypeParams = (field.type.kind === \"scalar\" && field.type.typeParams && Object.keys(field.type.typeParams).length > 0 ? field.type.typeParams : void 0) ?? resolveFieldTypeParams?.(modelName, fieldName, model);\n\t\t\tconst resolvedValueSet = resolveFieldValueSet?.(modelName, fieldName, model);\n\t\t\tconst resolved = resolveFieldType(field, codecLookup, resolvedTypeParams, resolvedValueSet);\n\t\t\tconst key = `readonly ${serializeObjectKey(fieldName)}`;\n\t\t\toutputFieldEntries.push(`${key}: ${resolved.output}`);\n\t\t\tinputFieldEntries.push(`${key}: ${resolved.input}`);\n\t\t}\n\t\tconst outputFields = outputFieldEntries.length > 0 ? `{ ${outputFieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tconst inputFields = inputFieldEntries.length > 0 ? `{ ${inputFieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tconst modelKey = `readonly ${serializeObjectKey(modelName)}`;\n\t\toutputModelEntries.push(`${modelKey}: ${outputFields}`);\n\t\tinputModelEntries.push(`${modelKey}: ${inputFields}`);\n\t}\n\treturn {\n\t\toutput: `{ ${outputModelEntries.join(\"; \")} }`,\n\t\tinput: `{ ${inputModelEntries.join(\"; \")} }`\n\t};\n}\nfunction generateFieldTypesMapsByNamespace(namespaceModels, codecLookup, resolveFieldTypeParams, resolveFieldValueSet) {\n\tif (namespaceModels.length === 0) return {\n\t\toutput: \"Record<string, never>\",\n\t\tinput: \"Record<string, never>\"\n\t};\n\tconst outputNamespaceEntries = [];\n\tconst inputNamespaceEntries = [];\n\tfor (const [nsId, models] of namespaceModels) {\n\t\tconst inner = generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams, resolveFieldValueSet);\n\t\tconst nsKey = `readonly ${serializeObjectKey(nsId)}`;\n\t\toutputNamespaceEntries.push(`${nsKey}: ${inner.output}`);\n\t\tinputNamespaceEntries.push(`${nsKey}: ${inner.input}`);\n\t}\n\treturn {\n\t\toutput: `{ ${outputNamespaceEntries.join(\"; \")} }`,\n\t\tinput: `{ ${inputNamespaceEntries.join(\"; \")} }`\n\t};\n}\nfunction generateFieldOutputTypesMap(models, codecLookup, resolveFieldTypeParams) {\n\treturn generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams).output;\n}\nfunction generateFieldInputTypesMap(models, codecLookup, resolveFieldTypeParams) {\n\treturn generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams).input;\n}\nfunction generateValueObjectType(_voName, vo, _valueObjects, side = \"output\", codecLookup) {\n\treturn resolveValueObjectType(_voName, vo, _valueObjects, codecLookup)[side];\n}\nfunction resolveValueObjectType(_voName, vo, _valueObjects, codecLookup) {\n\tconst outputEntries = [];\n\tconst inputEntries = [];\n\tfor (const [fieldName, field] of Object.entries(vo.fields)) {\n\t\tconst resolved = resolveFieldType(field, codecLookup);\n\t\tconst key = `readonly ${serializeObjectKey(fieldName)}`;\n\t\toutputEntries.push(`${key}: ${resolved.output}`);\n\t\tinputEntries.push(`${key}: ${resolved.input}`);\n\t}\n\tconst empty = \"Record<string, never>\";\n\treturn {\n\t\toutput: outputEntries.length > 0 ? `{ ${outputEntries.join(\"; \")} }` : empty,\n\t\tinput: inputEntries.length > 0 ? `{ ${inputEntries.join(\"; \")} }` : empty\n\t};\n}\nfunction generateContractFieldDescriptor(fieldName, field) {\n\tconst mods = [];\n\tif (field.many === true) mods.push(\"; readonly many: true\");\n\tif (field.dict === true) mods.push(\"; readonly dict: true\");\n\tconst modStr = mods.join(\"\");\n\tconst { type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${modStr} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"valueObject\"; readonly name: ${serializeValue(type.name)} }${modStr} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${serializeValue(type)}${modStr} }`;\n}\nfunction generateValueObjectsDescriptorType(valueObjects) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"Record<string, never>\";\n\tconst voEntries = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst fieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(vo.fields)) fieldEntries.push(generateContractFieldDescriptor(fieldName, field));\n\t\tconst fieldsType = fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tvoEntries.push(`readonly ${serializeObjectKey(voName)}: { readonly fields: ${fieldsType} }`);\n\t}\n\treturn `{ ${voEntries.join(\"; \")} }`;\n}\nfunction generateValueObjectTypeAliases(valueObjects, codecLookup) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"\";\n\tconst aliases = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst resolved = resolveValueObjectType(voName, vo, valueObjects, codecLookup);\n\t\taliases.push(`export type ${voName}Output = ${resolved.output};`);\n\t\taliases.push(`export type ${voName}Input = ${resolved.input};`);\n\t}\n\treturn aliases.join(\"\\n\");\n}\n//#endregion\nexport { serializeExecutionType as C, emitterError as D, serializeValue as E, serializeCrossReference as S, serializeObjectKey as T, generateValueObjectTypeAliases as _, generateFieldInputTypesMap as a, resolveFieldType as b, generateFieldTypesMapsByNamespace as c, generateModelFieldEntry as d, generateModelFieldsType as f, generateValueObjectType as g, generateRootsType as h, generateContractFieldDescriptor as i, generateHashTypeAliases as l, generateModelsType as m, generateBothFieldTypesMaps as n, generateFieldOutputTypesMap as o, generateModelRelationsType as p, generateCodecTypeIntersection as r, generateFieldResolvedType as s, deduplicateImports as t, generateImportLines as u, generateValueObjectsDescriptorType as v, serializeNamespaceId as w, resolveValueObjectType as x, renderValueSetType as y };\n\n//# sourceMappingURL=domain-type-generation-bpSO3Y0L.mjs.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,UAAU,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AAI;AACzB"}
1
+ {"version":3,"file":"domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/domain-type-generation-bpSO3Y0L.mjs"],"sourcesContent":["import { isSafeTypeExpression } from \"./type-expression-safety.mjs\";\nimport { structuredError } from \"@internal/utils/structured-error\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { renderImports, tsStringLiteral } from \"@internal/ts-render\";\nimport { blindCast } from \"@internal/utils/casts\";\n//#region src/emitter-errors.ts\nfunction emitterError(code, message, options) {\n\treturn structuredError(code, message, options);\n}\n//#endregion\n//#region src/domain-type-generation.ts\nfunction serializeValue(value) {\n\tif (value === null) return \"null\";\n\tif (value === void 0) return \"undefined\";\n\tif (typeof value === \"string\") return tsStringLiteral(value);\n\tif (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n\tif (typeof value === \"bigint\") return `${value}n`;\n\tif (Array.isArray(value)) return `readonly [${value.map((v) => serializeValue(v)).join(\", \")}]`;\n\tif (typeof value === \"object\") {\n\t\tconst entries = [];\n\t\tfor (const [k, v] of Object.entries(value)) entries.push(`readonly ${serializeObjectKey(k)}: ${serializeValue(v)}`);\n\t\treturn `{ ${entries.join(\"; \")} }`;\n\t}\n\treturn \"unknown\";\n}\nfunction serializeObjectKey(key) {\n\tif (/^[$A-Z_a-z][$\\w]*$/.test(key)) return key;\n\treturn serializeValue(key);\n}\nfunction serializeNamespaceId(value) {\n\treturn `${serializeValue(value)} & NamespaceId`;\n}\nfunction serializeCrossReference(ref) {\n\treturn `{ readonly namespace: ${serializeNamespaceId(String(ref.namespace))}; readonly model: ${serializeValue(ref.model)}${ref.space !== void 0 ? `; readonly space: ${serializeValue(ref.space)}` : \"\"} }`;\n}\nfunction generateRootsType(roots) {\n\tif (!roots || Object.keys(roots).length === 0) return \"Record<string, never>\";\n\treturn `{ ${Object.entries(roots).map(([key, value]) => `readonly ${serializeObjectKey(key)}: ${serializeCrossReference(value)}`).join(\"; \")} }`;\n}\nfunction contractFieldModifierSuffix(field) {\n\treturn (field.many === true ? \"; readonly many: true\" : \"\") + (field.dict === true ? \"; readonly dict: true\" : \"\");\n}\nfunction generateModelFieldEntry(fieldName, field) {\n\tconst mods = contractFieldModifierSuffix(field);\n\tconst { nullable, type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${mods} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: { readonly kind: \"valueObject\"; readonly name: ${serializeValue(type.name)} }${mods} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${nullable}; readonly type: ${serializeValue(type)}${mods} }`;\n}\nfunction generateModelFieldsType(fields) {\n\tconst fieldEntries = [];\n\tfor (const [fieldName, field] of Object.entries(fields)) fieldEntries.push(generateModelFieldEntry(fieldName, field));\n\treturn fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n}\nfunction generateModelRelationsType(relations) {\n\tconst relationEntries = [];\n\tfor (const [relName, rel] of Object.entries(relations)) {\n\t\tif (typeof rel !== \"object\" || rel === null) continue;\n\t\tconst relObj = rel;\n\t\tconst toRef = relObj[\"to\"];\n\t\tif (toRef !== null && typeof toRef === \"object\" && \"space\" in toRef && toRef.space !== void 0) {\n\t\t\trelationEntries.push(`readonly ${serializeObjectKey(relName)}: never`);\n\t\t\tcontinue;\n\t\t}\n\t\tconst parts = [];\n\t\tif (toRef) parts.push(`readonly to: ${serializeCrossReference(blindCast(toRef))}`);\n\t\tif (relObj[\"cardinality\"]) parts.push(`readonly cardinality: ${serializeValue(relObj[\"cardinality\"])}`);\n\t\tconst on = relObj[\"on\"];\n\t\tif (on && (!on.localFields || !on.targetFields)) throw emitterError(\"CONTRACT.RELATION_INVALID\", `Relation \"${relName}\" has an \"on\" block but is missing localFields or targetFields`, { meta: { relation: relName } });\n\t\tif (on?.localFields && on.targetFields) {\n\t\t\tconst localFields = on.localFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tconst targetFields = on.targetFields.map((f) => serializeValue(f)).join(\", \");\n\t\t\tparts.push(`readonly on: { readonly localFields: readonly [${localFields}]; readonly targetFields: readonly [${targetFields}] }`);\n\t\t}\n\t\tif (relObj[\"cardinality\"] === \"N:M\") {\n\t\t\tconst { through } = blindCast(relObj);\n\t\t\tconst table = serializeValue(through.table);\n\t\t\tconst namespaceId = serializeValue(through.namespaceId);\n\t\t\tconst parentColumns = through.parentColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst childColumns = through.childColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tconst targetColumns = through.targetColumns.map((c) => serializeValue(c)).join(\", \");\n\t\t\tparts.push(`readonly through: { readonly table: ${table}; readonly namespaceId: ${namespaceId}; readonly parentColumns: readonly [${parentColumns}]; readonly childColumns: readonly [${childColumns}]; readonly targetColumns: readonly [${targetColumns}] }`);\n\t\t}\n\t\tif (parts.length > 0) relationEntries.push(`readonly ${serializeObjectKey(relName)}: { ${parts.join(\"; \")} }`);\n\t}\n\tif (relationEntries.length === 0) return \"Record<string, never>\";\n\treturn `{ ${relationEntries.join(\"; \")} }`;\n}\nfunction generateModelsType(models, generateModelStorage) {\n\tif (!models || Object.keys(models).length === 0) return \"Record<string, never>\";\n\tconst modelTypes = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tconst fieldsType = generateModelFieldsType(model.fields);\n\t\tconst relationsType = generateModelRelationsType(model.relations);\n\t\tconst storageType = generateModelStorage(modelName, model);\n\t\tconst modelParts = [\n\t\t\t`readonly fields: ${fieldsType}`,\n\t\t\t`readonly relations: ${relationsType}`,\n\t\t\t`readonly storage: ${storageType}`\n\t\t];\n\t\tif (model.owner) modelParts.push(`readonly owner: ${serializeValue(model.owner)}`);\n\t\tif (model.discriminator) modelParts.push(`readonly discriminator: ${serializeValue(model.discriminator)}`);\n\t\tif (model.variants) modelParts.push(`readonly variants: ${serializeValue(model.variants)}`);\n\t\tif (model.base) modelParts.push(`readonly base: ${serializeCrossReference(model.base)}`);\n\t\tmodelTypes.push(`readonly ${serializeObjectKey(modelName)}: { ${modelParts.join(\"; \")} }`);\n\t}\n\treturn `{ ${modelTypes.join(\"; \")} }`;\n}\nfunction deduplicateImports(imports) {\n\tconst seenKeys = /* @__PURE__ */ new Set();\n\tconst result = [];\n\tfor (const imp of imports) {\n\t\tconst key = `${imp.package}::${imp.named}`;\n\t\tif (!seenKeys.has(key)) {\n\t\t\tseenKeys.add(key);\n\t\t\tresult.push(imp);\n\t\t}\n\t}\n\treturn result;\n}\nfunction generateImportLines(imports, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst rendered = renderImports(imports.map((imp) => ({\n\t\tmoduleSpecifier: resolveImportSpecifier(imp.package),\n\t\tsymbol: imp.named,\n\t\talias: imp.alias,\n\t\ttypeOnly: true\n\t})));\n\treturn rendered === \"\" ? [] : rendered.split(\"\\n\");\n}\nfunction generateCodecTypeIntersection(imports, named) {\n\treturn imports.filter((imp) => imp.named === named).map((imp) => imp.alias).join(\" & \") || \"Record<string, never>\";\n}\nfunction serializeExecutionType(execution) {\n\tconst parts = [\"readonly executionHash: ExecutionHash\"];\n\tfor (const [key, value] of Object.entries(execution)) {\n\t\tif (key === \"executionHash\") continue;\n\t\tparts.push(`readonly ${serializeObjectKey(key)}: ${serializeValue(value)}`);\n\t}\n\treturn `{ ${parts.join(\"; \")} }`;\n}\nfunction generateHashTypeAliases(hashes) {\n\tconst executionHashType = hashes.executionHash ? `ExecutionHashBase<${serializeValue(hashes.executionHash)}>` : \"ExecutionHashBase<string>\";\n\treturn [\n\t\t`export type StorageHash = StorageHashBase<${serializeValue(hashes.storageHash)}>;`,\n\t\t`export type ExecutionHash = ${executionHashType};`,\n\t\t`export type ProfileHash = ProfileHashBase<${serializeValue(hashes.profileHash)}>;`\n\t].join(\"\\n\");\n}\nfunction applyModifiers(base, field) {\n\tlet result = base;\n\tif (field.many === true) result = `ReadonlyArray<${result}>`;\n\tif (field.dict === true) result = `Readonly<Record<string, ${result}>>`;\n\tif (field.nullable) result = `${result} | null`;\n\treturn result;\n}\n/**\n* Renders a value set (a field/column's permitted values, codec-encoded) into a TS literal union by\n* routing **each** value through the codec's `renderValueLiteral` — the seam owned by the codec, not\n* a generic serializer. `side`: `output` = read type, `input` = create/update type.\n*\n* Returns `undefined` — signalling the caller to fall back to the codec's full output type — when\n* the lookup is absent, has no `renderValueLiteralFor`, the value set is empty, or **any** value\n* isn't literal-expressible. A caller that needs column and field types to agree shares this so both\n* compute the union identically.\n*/\nfunction renderValueSetType(values, codecId, side, codecLookup) {\n\tif (values.length === 0 || codecLookup?.renderValueLiteralFor === void 0) return void 0;\n\tconst literals = [];\n\tfor (const value of values) {\n\t\tconst lit = codecLookup.renderValueLiteralFor(codecId, value, side);\n\t\tif (lit === void 0 || !isSafeTypeExpression(lit)) return void 0;\n\t\tliterals.push(lit);\n\t}\n\treturn literals.join(\" | \");\n}\nfunction resolveFieldType(field, codecLookup, resolvedTypeParams, resolvedValueSet) {\n\tconst { type } = field;\n\tswitch (type.kind) {\n\t\tcase \"scalar\": {\n\t\t\tif (resolvedValueSet) {\n\t\t\t\tconst output = renderValueSetType(resolvedValueSet.encodedValues, resolvedValueSet.codecId, \"output\", codecLookup);\n\t\t\t\tconst input = renderValueSetType(resolvedValueSet.encodedValues, resolvedValueSet.codecId, \"input\", codecLookup);\n\t\t\t\tif (output !== void 0 && input !== void 0) return {\n\t\t\t\t\toutput: applyModifiers(output, field),\n\t\t\t\t\tinput: applyModifiers(input, field)\n\t\t\t\t};\n\t\t\t}\n\t\t\tlet outputResolved;\n\t\t\tlet inputResolved;\n\t\t\tconst effectiveTypeParams = (type.typeParams && Object.keys(type.typeParams).length > 0 ? type.typeParams : void 0) ?? resolvedTypeParams;\n\t\t\tif (codecLookup && effectiveTypeParams && Object.keys(effectiveTypeParams).length > 0) {\n\t\t\t\tconst rendered = codecLookup.renderOutputTypeFor(type.codecId, effectiveTypeParams);\n\t\t\t\tif (rendered && isSafeTypeExpression(rendered)) outputResolved = rendered;\n\t\t\t\tconst renderedInput = codecLookup.renderInputTypeFor?.(type.codecId, effectiveTypeParams);\n\t\t\t\tif (renderedInput && isSafeTypeExpression(renderedInput)) inputResolved = renderedInput;\n\t\t\t}\n\t\t\tconst codecAccessor = `CodecTypes[${serializeValue(type.codecId)}]`;\n\t\t\treturn {\n\t\t\t\toutput: applyModifiers(outputResolved ?? `${codecAccessor}[\"output\"]`, field),\n\t\t\t\tinput: applyModifiers(inputResolved ?? `${codecAccessor}[\"input\"]`, field)\n\t\t\t};\n\t\t}\n\t\tcase \"valueObject\": return {\n\t\t\toutput: applyModifiers(`${type.name}Output`, field),\n\t\t\tinput: applyModifiers(`${type.name}Input`, field)\n\t\t};\n\t\tcase \"union\": {\n\t\t\tconst outputMembers = type.members.map((m) => m.kind === \"scalar\" ? `CodecTypes[${serializeValue(m.codecId)}][\"output\"]` : `${m.name}Output`);\n\t\t\tconst inputMembers = type.members.map((m) => m.kind === \"scalar\" ? `CodecTypes[${serializeValue(m.codecId)}][\"input\"]` : `${m.name}Input`);\n\t\t\treturn {\n\t\t\t\toutput: applyModifiers(outputMembers.join(\" | \"), field),\n\t\t\t\tinput: applyModifiers(inputMembers.join(\" | \"), field)\n\t\t\t};\n\t\t}\n\t\tdefault: return {\n\t\t\toutput: applyModifiers(\"unknown\", field),\n\t\t\tinput: applyModifiers(\"unknown\", field)\n\t\t};\n\t}\n}\nfunction generateFieldResolvedType(field, codecLookup, side = \"output\") {\n\treturn resolveFieldType(field, codecLookup)[side];\n}\nfunction generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams, resolveFieldValueSet) {\n\tif (!models || Object.keys(models).length === 0) return {\n\t\toutput: \"Record<string, never>\",\n\t\tinput: \"Record<string, never>\"\n\t};\n\tconst outputModelEntries = [];\n\tconst inputModelEntries = [];\n\tfor (const [modelName, model] of Object.entries(models).sort(([a], [b]) => a.localeCompare(b))) {\n\t\tif (!model) continue;\n\t\tconst outputFieldEntries = [];\n\t\tconst inputFieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(model.fields)) {\n\t\t\tconst resolvedTypeParams = (field.type.kind === \"scalar\" && field.type.typeParams && Object.keys(field.type.typeParams).length > 0 ? field.type.typeParams : void 0) ?? resolveFieldTypeParams?.(modelName, fieldName, model);\n\t\t\tconst resolvedValueSet = resolveFieldValueSet?.(modelName, fieldName, model);\n\t\t\tconst resolved = resolveFieldType(field, codecLookup, resolvedTypeParams, resolvedValueSet);\n\t\t\tconst key = `readonly ${serializeObjectKey(fieldName)}`;\n\t\t\toutputFieldEntries.push(`${key}: ${resolved.output}`);\n\t\t\tinputFieldEntries.push(`${key}: ${resolved.input}`);\n\t\t}\n\t\tconst outputFields = outputFieldEntries.length > 0 ? `{ ${outputFieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tconst inputFields = inputFieldEntries.length > 0 ? `{ ${inputFieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tconst modelKey = `readonly ${serializeObjectKey(modelName)}`;\n\t\toutputModelEntries.push(`${modelKey}: ${outputFields}`);\n\t\tinputModelEntries.push(`${modelKey}: ${inputFields}`);\n\t}\n\treturn {\n\t\toutput: `{ ${outputModelEntries.join(\"; \")} }`,\n\t\tinput: `{ ${inputModelEntries.join(\"; \")} }`\n\t};\n}\nfunction generateFieldTypesMapsByNamespace(namespaceModels, codecLookup, resolveFieldTypeParams, resolveFieldValueSet) {\n\tif (namespaceModels.length === 0) return {\n\t\toutput: \"Record<string, never>\",\n\t\tinput: \"Record<string, never>\"\n\t};\n\tconst outputNamespaceEntries = [];\n\tconst inputNamespaceEntries = [];\n\tfor (const [nsId, models] of namespaceModels) {\n\t\tconst inner = generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams, resolveFieldValueSet);\n\t\tconst nsKey = `readonly ${serializeObjectKey(nsId)}`;\n\t\toutputNamespaceEntries.push(`${nsKey}: ${inner.output}`);\n\t\tinputNamespaceEntries.push(`${nsKey}: ${inner.input}`);\n\t}\n\treturn {\n\t\toutput: `{ ${outputNamespaceEntries.join(\"; \")} }`,\n\t\tinput: `{ ${inputNamespaceEntries.join(\"; \")} }`\n\t};\n}\nfunction generateFieldOutputTypesMap(models, codecLookup, resolveFieldTypeParams) {\n\treturn generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams).output;\n}\nfunction generateFieldInputTypesMap(models, codecLookup, resolveFieldTypeParams) {\n\treturn generateBothFieldTypesMaps(models, codecLookup, resolveFieldTypeParams).input;\n}\nfunction generateValueObjectType(_voName, vo, _valueObjects, side = \"output\", codecLookup) {\n\treturn resolveValueObjectType(_voName, vo, _valueObjects, codecLookup)[side];\n}\nfunction resolveValueObjectType(_voName, vo, _valueObjects, codecLookup) {\n\tconst outputEntries = [];\n\tconst inputEntries = [];\n\tfor (const [fieldName, field] of Object.entries(vo.fields)) {\n\t\tconst resolved = resolveFieldType(field, codecLookup);\n\t\tconst key = `readonly ${serializeObjectKey(fieldName)}`;\n\t\toutputEntries.push(`${key}: ${resolved.output}`);\n\t\tinputEntries.push(`${key}: ${resolved.input}`);\n\t}\n\tconst empty = \"Record<string, never>\";\n\treturn {\n\t\toutput: outputEntries.length > 0 ? `{ ${outputEntries.join(\"; \")} }` : empty,\n\t\tinput: inputEntries.length > 0 ? `{ ${inputEntries.join(\"; \")} }` : empty\n\t};\n}\nfunction generateContractFieldDescriptor(fieldName, field) {\n\tconst mods = [];\n\tif (field.many === true) mods.push(\"; readonly many: true\");\n\tif (field.dict === true) mods.push(\"; readonly dict: true\");\n\tconst modStr = mods.join(\"\");\n\tconst { type } = field;\n\tif (type.kind === \"scalar\") {\n\t\tconst typeParamsSpec = type.typeParams && Object.keys(type.typeParams).length > 0 ? `; readonly typeParams: ${serializeValue(type.typeParams)}` : \"\";\n\t\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"scalar\"; readonly codecId: ${serializeValue(type.codecId)}${typeParamsSpec} }${modStr} }`;\n\t}\n\tif (type.kind === \"valueObject\") return `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: { readonly kind: \"valueObject\"; readonly name: ${serializeValue(type.name)} }${modStr} }`;\n\treturn `readonly ${serializeObjectKey(fieldName)}: { readonly nullable: ${field.nullable}; readonly type: ${serializeValue(type)}${modStr} }`;\n}\nfunction generateValueObjectsDescriptorType(valueObjects) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"Record<string, never>\";\n\tconst voEntries = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst fieldEntries = [];\n\t\tfor (const [fieldName, field] of Object.entries(vo.fields)) fieldEntries.push(generateContractFieldDescriptor(fieldName, field));\n\t\tconst fieldsType = fieldEntries.length > 0 ? `{ ${fieldEntries.join(\"; \")} }` : \"Record<string, never>\";\n\t\tvoEntries.push(`readonly ${serializeObjectKey(voName)}: { readonly fields: ${fieldsType} }`);\n\t}\n\treturn `{ ${voEntries.join(\"; \")} }`;\n}\nfunction generateValueObjectTypeAliases(valueObjects, codecLookup) {\n\tif (!valueObjects || Object.keys(valueObjects).length === 0) return \"\";\n\tconst aliases = [];\n\tfor (const [voName, vo] of Object.entries(valueObjects)) {\n\t\tconst resolved = resolveValueObjectType(voName, vo, valueObjects, codecLookup);\n\t\taliases.push(`export type ${voName}Output = ${resolved.output};`);\n\t\taliases.push(`export type ${voName}Input = ${resolved.input};`);\n\t}\n\treturn aliases.join(\"\\n\");\n}\n//#endregion\nexport { serializeExecutionType as C, emitterError as D, serializeValue as E, serializeCrossReference as S, serializeObjectKey as T, generateValueObjectTypeAliases as _, generateFieldInputTypesMap as a, resolveFieldType as b, generateFieldTypesMapsByNamespace as c, generateModelFieldEntry as d, generateModelFieldsType as f, generateValueObjectType as g, generateRootsType as h, generateContractFieldDescriptor as i, generateHashTypeAliases as l, generateModelsType as m, generateBothFieldTypesMaps as n, generateFieldOutputTypesMap as o, generateModelRelationsType as p, generateCodecTypeIntersection as r, generateFieldResolvedType as s, deduplicateImports as t, generateImportLines as u, generateValueObjectsDescriptorType as v, serializeNamespaceId as w, resolveValueObjectType as x, renderValueSetType as y };\n\n//# sourceMappingURL=domain-type-generation-bpSO3Y0L.mjs.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,MAAM,SAAS,SAAS;CAC7C,OAAO,gBAAgB,MAAM,SAAS,OAAO;AAC9C;AAGA,SAAS,eAAe,OAAO;CAC9B,IAAI,UAAU,MAAM,OAAO;CAC3B,IAAI,UAAU,KAAK,GAAG,OAAO;CAC7B,IAAI,OAAO,UAAU,UAAU,OAAO,gBAAgB,KAAK;CAC3D,IAAI,OAAO,UAAU,YAAY,OAAO,UAAU,WAAW,OAAO,OAAO,KAAK;CAChF,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM;CAC/C,IAAI,MAAM,QAAQ,KAAK,GAAG,OAAO,aAAa,MAAM,KAAK,MAAM,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;CAC7F,IAAI,OAAO,UAAU,UAAU;EAC9B,MAAM,UAAU,CAAC;EACjB,KAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,KAAK,GAAG,QAAQ,KAAK,YAAY,mBAAmB,CAAC,EAAE,IAAI,eAAe,CAAC,GAAG;EAClH,OAAO,KAAK,QAAQ,KAAK,IAAI,EAAE;CAChC;CACA,OAAO;AACR;AACA,SAAS,mBAAmB,KAAK;CAChC,IAAI,qBAAqB,KAAK,GAAG,GAAG,OAAO;CAC3C,OAAO,eAAe,GAAG;AAC1B;AACA,SA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MAAM,aAAa,aAAa,SAAS,IAAI,KAAK,aAAa,KAAK,IAAI,EAAE,MAAM;EAChF,UAAU,KAAK,YAAY,mBAAmB,MAAM,EAAE,uBAAuB,WAAW,GAAG;CAC5F;CACA,OAAO,KAAK,UAAU,KAAK,IAAI,EAAE;AAClC;AACA,SAAS,+BAA+B,cAAc,aAAa;CAClE,IAAI,CAAC,gBAAgB,OAAO,KAAK,YAAY,CAAC,CAAC,WAAW,GAAG,OAAO;CACpE,MAAM,UAAU,CAAC;CACjB,KAAK,MAAM,CAAC,QAAQ,OAAO,OAAO,QAAQ,YAAY,GAAG;EACxD,MAAM,WAAW,uBAAuB,QAAQ,IAAI,cAAc,WAAW;EAC7E,QAAQ,KAAK,eAAe,OAAO,WAAW,SAAS,OAAO,EAAE;EAChE,QAAQ,KAAK,eAAe,OAAO,UAAU,SAAS,MAAM,EAAE;CAC/D;CACA,OAAO,QAAQ,KAAK,IAAI;AACzB"}
@@ -1,7 +1,7 @@
1
1
  import { A as serializeValue, _ as generateModelRelationsType, a as deduplicateImports, k as serializeObjectKey, m as generateImportLines, p as generateHashTypeAliases, s as generateCodecTypeIntersection, u as generateFieldOutputTypesMap, y as generateRootsType } from "./domain-type-generation-PkAb39ob-Ct8AGqow.mjs";
2
- import { PreserveEmptyPredicate, SerializeContract, StorageSort } from "@prisma/orm-framework/contract/hashing";
3
2
  import { AggregateDescriptor } from "@prisma/orm-framework/components/components";
4
3
  import { EmissionSpi, GenerateContractTypesOptions, ImportSpecifierResolver, TypesImportSpec } from "@prisma/orm-framework/components/emission";
4
+ import { PreserveEmptyPredicate, SerializeContract, StorageSort } from "@prisma/orm-framework/contract/hashing";
5
5
  import { Contract } from "@prisma/orm-framework/contract/types";
6
6
  import { AnyCodecDescriptor, CodecLookup } from "@prisma/orm-framework/components/codec";
7
7
  //#region ../../../1-framework/3-tooling/emitter/dist/index-uXQjRiyo.d.mts
package/dist/emitter.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { D as serializeValue, E as serializeObjectKey, d as generateImportLines, g as generateRootsType, i as generateCodecTypeIntersection, m as generateModelRelationsType, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases } from "./domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs";
2
- import { n as generateContractDts, r as getEmittedArtifactPaths, t as emit } from "./exports-BCLg4CiV-okAfZydo.mjs";
1
+ import { D as serializeValue, E as serializeObjectKey, d as generateImportLines, g as generateRootsType, i as generateCodecTypeIntersection, m as generateModelRelationsType, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases } from "./domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs";
2
+ import { n as generateContractDts, r as getEmittedArtifactPaths, t as emit } from "./exports-BCLg4CiV-05kuwcb0.mjs";
3
3
  export { deduplicateImports, emit, generateCodecTypeIntersection, generateContractDts, generateFieldOutputTypesMap, generateHashTypeAliases, generateImportLines, generateModelRelationsType, generateRootsType, getEmittedArtifactPaths, serializeObjectKey, serializeValue };
@@ -1,2 +1,2 @@
1
- import { C as serializeCrossReference, D as serializeValue, E as serializeObjectKey, S as resolveValueObjectType, T as serializeNamespaceId, _ as generateValueObjectType, a as generateContractFieldDescriptor, b as renderValueSetType, c as generateFieldResolvedType, d as generateImportLines, f as generateModelFieldEntry, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, m as generateModelRelationsType, o as generateFieldInputTypesMap, p as generateModelFieldsType, r as generateBothFieldTypesMaps, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeExecutionType, x as resolveFieldType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs";
1
+ import { C as serializeCrossReference, D as serializeValue, E as serializeObjectKey, S as resolveValueObjectType, T as serializeNamespaceId, _ as generateValueObjectType, a as generateContractFieldDescriptor, b as renderValueSetType, c as generateFieldResolvedType, d as generateImportLines, f as generateModelFieldEntry, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, m as generateModelRelationsType, o as generateFieldInputTypesMap, p as generateModelFieldsType, r as generateBothFieldTypesMaps, s as generateFieldOutputTypesMap, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeExecutionType, x as resolveFieldType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs";
2
2
  export { deduplicateImports, generateBothFieldTypesMaps, generateCodecTypeIntersection, generateContractFieldDescriptor, generateFieldInputTypesMap, generateFieldOutputTypesMap, generateFieldResolvedType, generateFieldTypesMapsByNamespace, generateHashTypeAliases, generateImportLines, generateModelFieldEntry, generateModelFieldsType, generateModelRelationsType, generateModelsType, generateRootsType, generateValueObjectType, generateValueObjectTypeAliases, generateValueObjectsDescriptorType, renderValueSetType, resolveFieldType, resolveValueObjectType, serializeCrossReference, serializeExecutionType, serializeNamespaceId, serializeObjectKey, serializeValue };
@@ -1,10 +1,10 @@
1
- import { D as serializeValue, E as serializeObjectKey, d as generateImportLines, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, n as emitterError, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeExecutionType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-bpSO3Y0L-Cdauqrnc.mjs";
1
+ import { D as serializeValue, E as serializeObjectKey, d as generateImportLines, g as generateRootsType, h as generateModelsType, i as generateCodecTypeIntersection, l as generateFieldTypesMapsByNamespace, n as emitterError, t as deduplicateImports, u as generateHashTypeAliases, v as generateValueObjectTypeAliases, w as serializeExecutionType, y as generateValueObjectsDescriptorType } from "./domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs";
2
2
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
3
+ import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
3
4
  import { blindCast } from "@prisma/orm-framework/utils/casts";
4
- import { InternalError } from "@prisma/orm-framework/utils/internal-error";
5
5
  import { canonicalizeContractToObject } from "@prisma/orm-framework/contract/hashing";
6
- import { keepInternalSpecifiers } from "@prisma/orm-framework/components/emission";
7
6
  import { format } from "prettier";
7
+ import { InternalError } from "@prisma/orm-framework/utils/internal-error";
8
8
  //#region ../../../1-framework/3-tooling/emitter/dist/exports-BCLg4CiV.mjs
9
9
  const JSON_EXTENSION = ".json";
10
10
  function getEmittedArtifactPaths(outputJsonPath) {
@@ -157,4 +157,4 @@ async function emit(contract, stack, targetFamily, options) {
157
157
  //#endregion
158
158
  export { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };
159
159
 
160
- //# sourceMappingURL=exports-BCLg4CiV-okAfZydo.mjs.map
160
+ //# sourceMappingURL=exports-BCLg4CiV-05kuwcb0.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports-BCLg4CiV-okAfZydo.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/exports-BCLg4CiV.mjs"],"sourcesContent":["import { C as serializeExecutionType, D as emitterError, E as serializeValue, T as serializeObjectKey, _ as generateValueObjectTypeAliases, c as generateFieldTypesMapsByNamespace, h as generateRootsType, l as generateHashTypeAliases, m as generateModelsType, r as generateCodecTypeIntersection, t as deduplicateImports, u as generateImportLines, v as generateValueObjectsDescriptorType } from \"./domain-type-generation-bpSO3Y0L.mjs\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { canonicalizeContractToObject } from \"@internal/contract/hashing\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { format } from \"prettier\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/artifact-paths.ts\nconst JSON_EXTENSION = \".json\";\nfunction getEmittedArtifactPaths(outputJsonPath) {\n\tif (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError(\"CONFIG.VALIDATION_FAILED\", \"Contract output path must end with .json\", { meta: {\n\t\tfield: \"contract.output\",\n\t\toutputJsonPath\n\t} });\n\treturn {\n\t\tjsonPath: outputJsonPath,\n\t\tdtsPath: `${outputJsonPath.slice(0, -5)}.d.ts`\n\t};\n}\n//#endregion\n//#region src/generate-contract-dts.ts\nfunction generateEnumBlockType(enums) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst membersType = `readonly [${entry.members.map((m) => `{ readonly name: ${serializeValue(m.name)}; readonly value: ${serializeValue(m.value)} }`).join(\", \")}]`;\n\t\treturn `readonly ${serializeObjectKey(name)}: { readonly codecId: ${serializeValue(entry.codecId)}; readonly members: ${membersType} }`;\n\t}).join(\"; \")} }`;\n}\nfunction generateContractDts(contract, emitter, codecTypeImports, hashes, options, codecLookup, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst allImports = [...codecTypeImports];\n\tif (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);\n\tconst importLines = generateImportLines(deduplicateImports(allImports), resolveImportSpecifier);\n\tconst familyImportLines = emitter.getFamilyImports(resolveImportSpecifier);\n\tconst hashAliases = generateHashTypeAliases(hashes);\n\tconst codecTypes = generateCodecTypeIntersection(codecTypeImports, \"CodecTypes\");\n\tconst familyTypeAliases = emitter.getFamilyTypeAliases(options);\n\tconst typeMapsExpr = emitter.getTypeMapsExpression();\n\tconst storageType = emitter.generateStorageType(contract, \"StorageHash\");\n\tconst namespaceEntries = Object.entries(contract.domain.namespaces);\n\tif (namespaceEntries.length === 0) throw emitterError(\"CONTRACT.NAMESPACE_INVALID\", \"domain has no namespaces\", { meta: { reason: \"no-domain-namespaces\" } });\n\tfor (const [nsId, ns] of namespaceEntries) if (ns === void 0) throw new InternalError(`domain namespace \"${nsId}\" is not present on the contract`);\n\tconst rootsType = generateRootsType(contract.roots);\n\tconst flatValueObjects = {};\n\tfor (const [, ns] of namespaceEntries) for (const [voName, vo] of Object.entries(blindCast(ns.valueObjects ?? {}))) if (!(voName in flatValueObjects)) flatValueObjects[voName] = vo;\n\tconst valueObjects = Object.keys(flatValueObjects).length > 0 ? flatValueObjects : void 0;\n\tconst valueObjectTypeAliases = generateValueObjectTypeAliases(valueObjects, codecLookup);\n\tconst valueObjectsDescriptor = generateValueObjectsDescriptorType(valueObjects);\n\tconst domainNamespacesType = namespaceEntries.map(([nsId, ns]) => {\n\t\tconst nsModels = ns.models;\n\t\tconst nsModelsType = generateModelsType(nsModels, (name, model) => emitter.generateModelStorageType(name, model));\n\t\tconst nsValueObjects = blindCast(ns.valueObjects);\n\t\tconst nsValueObjectsDescriptor = nsValueObjects !== void 0 && Object.keys(nsValueObjects).length > 0 ? generateValueObjectsDescriptorType(nsValueObjects) : void 0;\n\t\tconst nsEnums = blindCast(ns.enum);\n\t\treturn [\n\t\t\tnsId,\n\t\t\tnsModelsType,\n\t\t\tnsValueObjectsDescriptor,\n\t\t\tnsEnums !== void 0 && Object.keys(nsEnums).length > 0 ? generateEnumBlockType(nsEnums) : void 0\n\t\t];\n\t}).map(([nsId, nsModelsType, nsValueObjectsDescriptor, nsEnumBlock]) => {\n\t\tconst voLine = nsValueObjectsDescriptor !== void 0 ? `\\n readonly valueObjects: ${nsValueObjectsDescriptor};` : \"\";\n\t\tconst enumLine = nsEnumBlock !== void 0 ? `\\n readonly enum: ${nsEnumBlock};` : \"\";\n\t\treturn ` readonly ${serializeObjectKey(nsId)}: {\\n readonly models: ${nsModelsType};${voLine}${enumLine}\\n }`;\n\t}).join(\";\\n\");\n\tconst executionClause = contract.execution !== void 0 ? `\\n readonly execution: ${serializeExecutionType(contract.execution)};` : \"\";\n\tconst resolveFieldTypeParams = emitter.resolveFieldTypeParams ? (modelName, fieldName, model) => emitter.resolveFieldTypeParams?.(modelName, fieldName, model, contract) : void 0;\n\tconst resolveFieldValueSet = emitter.resolveFieldValueSet ? (modelName, fieldName, model) => emitter.resolveFieldValueSet?.(modelName, fieldName, model, contract) : void 0;\n\tconst fieldTypesMaps = generateFieldTypesMapsByNamespace(namespaceEntries.map(([nsId, ns]) => [nsId, ns.models]), codecLookup, resolveFieldTypeParams, resolveFieldValueSet);\n\tconst extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);\n\tconst contractWrapper = emitter.getContractWrapper(\"ContractBase\", \"TypeMaps\");\n\treturn `// ⚠️ GENERATED FILE - DO NOT EDIT\n// This file is automatically generated by 'prisma-next contract emit'.\n// To regenerate, run: prisma-next contract emit\n${importLines.join(\"\\n\")}\n\n${familyImportLines.join(\"\\n\")}\nimport type {\n Contract as ContractType,\n ExecutionHashBase,\n NamespaceId,\n ProfileHashBase,\n StorageHashBase,\n} from '${resolveImportSpecifier(\"@internal/contract/types\")}';\n\n${hashAliases}\n\nexport type CodecTypes = ${codecTypes};\n${familyTypeAliases}\n${valueObjectTypeAliases}\nexport type FieldOutputTypes = ${fieldTypesMaps.output};\nexport type FieldInputTypes = ${fieldTypesMaps.input};\n${extraTypeExports ? `${extraTypeExports}\\n` : \"\"}export type TypeMaps = ${typeMapsExpr};\n\ntype ContractBase = Omit<\n ContractType<${storageType}>,\n 'roots' | 'domain'\n> & {\n readonly target: ${serializeValue(contract.target)};\n readonly targetFamily: ${serializeValue(contract.targetFamily)};\n readonly roots: ${rootsType};\n readonly domain: {\n readonly namespaces: {\n${domainNamespacesType};\n };\n };\n readonly capabilities: ${serializeValue(contract.capabilities)};\n readonly extensions: ${serializeValue(contract.extensions)};${executionClause}\n readonly meta: ${serializeValue(contract.meta)};\n ${valueObjects ? `readonly valueObjects: ${valueObjectsDescriptor};` : \"\"}\n readonly profileHash: ProfileHash;\n};\n\n${contractWrapper}\n`;\n}\n//#endregion\n//#region src/emit.ts\nconst SCHEMA_VERSION = \"1\";\nasync function emit(contract, stack, targetFamily, options) {\n\tif (options.outputJsonPath !== void 0) getEmittedArtifactPaths(options.outputJsonPath);\n\tconst { codecTypeImports, queryOperationTypeImports, aggregateDescriptors, codecDescriptors } = stack;\n\tconst { storageHash } = contract.storage;\n\tconst executionHash = contract.execution?.executionHash;\n\tconst { profileHash } = contract;\n\tconst canonicalized = canonicalizeContractToObject(contract, {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: options.serializeContract,\n\t\t...ifDefined(\"shouldPreserveEmpty\", options.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", options.sortStorage)\n\t});\n\tconst contractJsonString = JSON.stringify({\n\t\t...canonicalized,\n\t\t_generated: {\n\t\t\twarning: \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\tmessage: \"This file is automatically generated by \\\"prisma-next contract emit\\\".\",\n\t\t\tregenerate: \"To regenerate, run: prisma-next contract emit\"\n\t\t}\n\t}, null, 2);\n\tconst generateOptions = {\n\t\t...ifDefined(\"queryOperationTypeImports\", queryOperationTypeImports),\n\t\t...ifDefined(\"aggregateDescriptors\", aggregateDescriptors),\n\t\t...ifDefined(\"codecDescriptors\", codecDescriptors)\n\t};\n\tconst contractTypeHashes = {\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n\treturn {\n\t\tcontractJson: contractJsonString,\n\t\tcontractDts: await format(generateContractDts(contract, targetFamily, codecTypeImports ?? [], contractTypeHashes, generateOptions, stack.codecLookup, options.resolveImportSpecifier ?? keepInternalSpecifiers), {\n\t\t\tparser: \"typescript\",\n\t\t\tsingleQuote: true,\n\t\t\tsemi: true,\n\t\t\tprintWidth: 100\n\t\t}),\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n}\n//#endregion\nexport { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };\n\n//# sourceMappingURL=exports-BCLg4CiV.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,iBAAiB;AACvB,SAAS,wBAAwB,gBAAgB;CAChD,IAAI,CAAC,eAAe,SAAS,cAAc,GAAG,MAAM,aAAa,4BAA4B,4CAA4C,EAAE,MAAM;EAChJ,OAAO;EACP;CACD,EAAE,CAAC;CACH,OAAO;EACN,UAAU;EACV,SAAS,GAAG,e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AA6B,UAAU;EAC5D,eAAe;EACf,mBAAmB,QAAQ;EAC3B,GAAG,UAAU,uBAAuB,QAAQ,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;CACD,MAAM,qBAAqB,KAAK,UAAU;EACzC,GAAG;EACH,YAAY;GACX,SAAS;GACT,SAAS;GACT,YAAY;EACb;CACD,GAAG,MAAM,CAAC;CACV,MAAM,kBAAkB;EACvB,GAAG,UAAU,6BAA6B,yBAAyB;EACnE,GAAG,UAAU,wBAAwB,oBAAoB;EACzD,GAAG,UAAU,oBAAoB,gBAAgB;CAClD;CACA,MAAM,qBAAqB;EAC1B;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;CACA,OAAO;EACN,cAAc;EACd,aAAa,MAAM,OAAO,oBAAoB,UAAU,cAAc,oBAAoB,CAAC,GAAG,oBAAoB,iBAAiB,MAAM,aAAa,QAAQ,0BAA0B,sBAAsB,GAAG;GAChN,QAAQ;GACR,aAAa;GACb,MAAM;GACN,YAAY;EACb,CAAC;EACD;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;AACD"}
1
+ {"version":3,"file":"exports-BCLg4CiV-05kuwcb0.mjs","names":[],"sources":["../../../../1-framework/3-tooling/emitter/dist/exports-BCLg4CiV.mjs"],"sourcesContent":["import { C as serializeExecutionType, D as emitterError, E as serializeValue, T as serializeObjectKey, _ as generateValueObjectTypeAliases, c as generateFieldTypesMapsByNamespace, h as generateRootsType, l as generateHashTypeAliases, m as generateModelsType, r as generateCodecTypeIntersection, t as deduplicateImports, u as generateImportLines, v as generateValueObjectsDescriptorType } from \"./domain-type-generation-bpSO3Y0L.mjs\";\nimport { keepInternalSpecifiers } from \"@internal/framework-components/emission\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { canonicalizeContractToObject } from \"@internal/contract/hashing\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { format } from \"prettier\";\nimport { InternalError } from \"@internal/utils/internal-error\";\n//#region src/artifact-paths.ts\nconst JSON_EXTENSION = \".json\";\nfunction getEmittedArtifactPaths(outputJsonPath) {\n\tif (!outputJsonPath.endsWith(JSON_EXTENSION)) throw emitterError(\"CONFIG.VALIDATION_FAILED\", \"Contract output path must end with .json\", { meta: {\n\t\tfield: \"contract.output\",\n\t\toutputJsonPath\n\t} });\n\treturn {\n\t\tjsonPath: outputJsonPath,\n\t\tdtsPath: `${outputJsonPath.slice(0, -5)}.d.ts`\n\t};\n}\n//#endregion\n//#region src/generate-contract-dts.ts\nfunction generateEnumBlockType(enums) {\n\treturn `{ ${Object.entries(enums).map(([name, entry]) => {\n\t\tconst membersType = `readonly [${entry.members.map((m) => `{ readonly name: ${serializeValue(m.name)}; readonly value: ${serializeValue(m.value)} }`).join(\", \")}]`;\n\t\treturn `readonly ${serializeObjectKey(name)}: { readonly codecId: ${serializeValue(entry.codecId)}; readonly members: ${membersType} }`;\n\t}).join(\"; \")} }`;\n}\nfunction generateContractDts(contract, emitter, codecTypeImports, hashes, options, codecLookup, resolveImportSpecifier = keepInternalSpecifiers) {\n\tconst allImports = [...codecTypeImports];\n\tif (options?.queryOperationTypeImports) allImports.push(...options.queryOperationTypeImports);\n\tconst importLines = generateImportLines(deduplicateImports(allImports), resolveImportSpecifier);\n\tconst familyImportLines = emitter.getFamilyImports(resolveImportSpecifier);\n\tconst hashAliases = generateHashTypeAliases(hashes);\n\tconst codecTypes = generateCodecTypeIntersection(codecTypeImports, \"CodecTypes\");\n\tconst familyTypeAliases = emitter.getFamilyTypeAliases(options);\n\tconst typeMapsExpr = emitter.getTypeMapsExpression();\n\tconst storageType = emitter.generateStorageType(contract, \"StorageHash\");\n\tconst namespaceEntries = Object.entries(contract.domain.namespaces);\n\tif (namespaceEntries.length === 0) throw emitterError(\"CONTRACT.NAMESPACE_INVALID\", \"domain has no namespaces\", { meta: { reason: \"no-domain-namespaces\" } });\n\tfor (const [nsId, ns] of namespaceEntries) if (ns === void 0) throw new InternalError(`domain namespace \"${nsId}\" is not present on the contract`);\n\tconst rootsType = generateRootsType(contract.roots);\n\tconst flatValueObjects = {};\n\tfor (const [, ns] of namespaceEntries) for (const [voName, vo] of Object.entries(blindCast(ns.valueObjects ?? {}))) if (!(voName in flatValueObjects)) flatValueObjects[voName] = vo;\n\tconst valueObjects = Object.keys(flatValueObjects).length > 0 ? flatValueObjects : void 0;\n\tconst valueObjectTypeAliases = generateValueObjectTypeAliases(valueObjects, codecLookup);\n\tconst valueObjectsDescriptor = generateValueObjectsDescriptorType(valueObjects);\n\tconst domainNamespacesType = namespaceEntries.map(([nsId, ns]) => {\n\t\tconst nsModels = ns.models;\n\t\tconst nsModelsType = generateModelsType(nsModels, (name, model) => emitter.generateModelStorageType(name, model));\n\t\tconst nsValueObjects = blindCast(ns.valueObjects);\n\t\tconst nsValueObjectsDescriptor = nsValueObjects !== void 0 && Object.keys(nsValueObjects).length > 0 ? generateValueObjectsDescriptorType(nsValueObjects) : void 0;\n\t\tconst nsEnums = blindCast(ns.enum);\n\t\treturn [\n\t\t\tnsId,\n\t\t\tnsModelsType,\n\t\t\tnsValueObjectsDescriptor,\n\t\t\tnsEnums !== void 0 && Object.keys(nsEnums).length > 0 ? generateEnumBlockType(nsEnums) : void 0\n\t\t];\n\t}).map(([nsId, nsModelsType, nsValueObjectsDescriptor, nsEnumBlock]) => {\n\t\tconst voLine = nsValueObjectsDescriptor !== void 0 ? `\\n readonly valueObjects: ${nsValueObjectsDescriptor};` : \"\";\n\t\tconst enumLine = nsEnumBlock !== void 0 ? `\\n readonly enum: ${nsEnumBlock};` : \"\";\n\t\treturn ` readonly ${serializeObjectKey(nsId)}: {\\n readonly models: ${nsModelsType};${voLine}${enumLine}\\n }`;\n\t}).join(\";\\n\");\n\tconst executionClause = contract.execution !== void 0 ? `\\n readonly execution: ${serializeExecutionType(contract.execution)};` : \"\";\n\tconst resolveFieldTypeParams = emitter.resolveFieldTypeParams ? (modelName, fieldName, model) => emitter.resolveFieldTypeParams?.(modelName, fieldName, model, contract) : void 0;\n\tconst resolveFieldValueSet = emitter.resolveFieldValueSet ? (modelName, fieldName, model) => emitter.resolveFieldValueSet?.(modelName, fieldName, model, contract) : void 0;\n\tconst fieldTypesMaps = generateFieldTypesMapsByNamespace(namespaceEntries.map(([nsId, ns]) => [nsId, ns.models]), codecLookup, resolveFieldTypeParams, resolveFieldValueSet);\n\tconst extraTypeExports = emitter.getStorageTypeExports?.(contract, codecLookup);\n\tconst contractWrapper = emitter.getContractWrapper(\"ContractBase\", \"TypeMaps\");\n\treturn `// ⚠️ GENERATED FILE - DO NOT EDIT\n// This file is automatically generated by 'prisma-next contract emit'.\n// To regenerate, run: prisma-next contract emit\n${importLines.join(\"\\n\")}\n\n${familyImportLines.join(\"\\n\")}\nimport type {\n Contract as ContractType,\n ExecutionHashBase,\n NamespaceId,\n ProfileHashBase,\n StorageHashBase,\n} from '${resolveImportSpecifier(\"@internal/contract/types\")}';\n\n${hashAliases}\n\nexport type CodecTypes = ${codecTypes};\n${familyTypeAliases}\n${valueObjectTypeAliases}\nexport type FieldOutputTypes = ${fieldTypesMaps.output};\nexport type FieldInputTypes = ${fieldTypesMaps.input};\n${extraTypeExports ? `${extraTypeExports}\\n` : \"\"}export type TypeMaps = ${typeMapsExpr};\n\ntype ContractBase = Omit<\n ContractType<${storageType}>,\n 'roots' | 'domain'\n> & {\n readonly target: ${serializeValue(contract.target)};\n readonly targetFamily: ${serializeValue(contract.targetFamily)};\n readonly roots: ${rootsType};\n readonly domain: {\n readonly namespaces: {\n${domainNamespacesType};\n };\n };\n readonly capabilities: ${serializeValue(contract.capabilities)};\n readonly extensions: ${serializeValue(contract.extensions)};${executionClause}\n readonly meta: ${serializeValue(contract.meta)};\n ${valueObjects ? `readonly valueObjects: ${valueObjectsDescriptor};` : \"\"}\n readonly profileHash: ProfileHash;\n};\n\n${contractWrapper}\n`;\n}\n//#endregion\n//#region src/emit.ts\nconst SCHEMA_VERSION = \"1\";\nasync function emit(contract, stack, targetFamily, options) {\n\tif (options.outputJsonPath !== void 0) getEmittedArtifactPaths(options.outputJsonPath);\n\tconst { codecTypeImports, queryOperationTypeImports, aggregateDescriptors, codecDescriptors } = stack;\n\tconst { storageHash } = contract.storage;\n\tconst executionHash = contract.execution?.executionHash;\n\tconst { profileHash } = contract;\n\tconst canonicalized = canonicalizeContractToObject(contract, {\n\t\tschemaVersion: SCHEMA_VERSION,\n\t\tserializeContract: options.serializeContract,\n\t\t...ifDefined(\"shouldPreserveEmpty\", options.shouldPreserveEmpty),\n\t\t...ifDefined(\"sortStorage\", options.sortStorage)\n\t});\n\tconst contractJsonString = JSON.stringify({\n\t\t...canonicalized,\n\t\t_generated: {\n\t\t\twarning: \"⚠️ GENERATED FILE - DO NOT EDIT\",\n\t\t\tmessage: \"This file is automatically generated by \\\"prisma-next contract emit\\\".\",\n\t\t\tregenerate: \"To regenerate, run: prisma-next contract emit\"\n\t\t}\n\t}, null, 2);\n\tconst generateOptions = {\n\t\t...ifDefined(\"queryOperationTypeImports\", queryOperationTypeImports),\n\t\t...ifDefined(\"aggregateDescriptors\", aggregateDescriptors),\n\t\t...ifDefined(\"codecDescriptors\", codecDescriptors)\n\t};\n\tconst contractTypeHashes = {\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n\treturn {\n\t\tcontractJson: contractJsonString,\n\t\tcontractDts: await format(generateContractDts(contract, targetFamily, codecTypeImports ?? [], contractTypeHashes, generateOptions, stack.codecLookup, options.resolveImportSpecifier ?? keepInternalSpecifiers), {\n\t\t\tparser: \"typescript\",\n\t\t\tsingleQuote: true,\n\t\t\tsemi: true,\n\t\t\tprintWidth: 100\n\t\t}),\n\t\tstorageHash,\n\t\t...ifDefined(\"executionHash\", executionHash),\n\t\tprofileHash\n\t};\n}\n//#endregion\nexport { generateContractDts as n, getEmittedArtifactPaths as r, emit as t };\n\n//# sourceMappingURL=exports-BCLg4CiV.mjs.map"],"mappings":";;;;;;;;AAQA,MAAM,iBAAiB;AACv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B,QAAQ,cAAc;CACrF,MAAM,EAAE,kBAAkB,2BAA2B,sBAAsB,qBAAqB;CAChG,MAAM,EAAE,gBAAgB,SAAS;CACjC,MAAM,gBAAgB,SAAS,WAAW;CAC1C,MAAM,EAAE,gBAAgB;CACxB,MAAM,gBAAgB,6BAA6B,UAAU;EAC5D,eAAe;EACf,mBAAmB,QAAQ;EAC3B,GAAG,UAAU,uBAAuB,QAAQ,mBAAmB;EAC/D,GAAG,UAAU,eAAe,QAAQ,WAAW;CAChD,CAAC;CACD,MAAM,qBAAqB,KAAK,UAAU;EACzC,GAAG;EACH,YAAY;GACX,SAAS;GACT,SAAS;GACT,YAAY;EACb;CACD,GAAG,MAAM,CAAC;CACV,MAAM,kBAAkB;EACvB,GAAG,UAAU,6BAA6B,yBAAyB;EACnE,GAAG,UAAU,wBAAwB,oBAAoB;EACzD,GAAG,UAAU,oBAAoB,gBAAgB;CAClD;CACA,MAAM,qBAAqB;EAC1B;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;CACA,OAAO;EACN,cAAc;EACd,aAAa,MAAM,OAAO,oBAAoB,UAAU,cAAc,oBAAoB,CAAC,GAAG,oBAAoB,iBAAiB,MAAM,aAAa,QAAQ,0BAA0B,sBAAsB,GAAG;GAChN,QAAQ;GACR,aAAa;GACb,MAAM;GACN,YAAY;EACb,CAAC;EACD;EACA,GAAG,UAAU,iBAAiB,aAAa;EAC3C;CACD;AACD"}
@@ -1,14 +1,35 @@
1
- import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-okAfZydo.mjs";
1
+ import { r as getEmittedArtifactPaths } from "./exports-BCLg4CiV-05kuwcb0.mjs";
2
+ import "node:module";
2
3
  import { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from "@prisma/orm-framework/errors/control";
3
4
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
- import { notOk, ok } from "@prisma/orm-framework/utils/result";
5
5
  import { dirname, join, resolve } from "pathe";
6
- import { access } from "node:fs/promises";
6
+ import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
7
7
  import { blindCast } from "@prisma/orm-framework/utils/casts";
8
+ import { access } from "node:fs/promises";
9
+ import { notOk, ok } from "@prisma/orm-framework/utils/result";
8
10
  import { hasCurrentConfigFormatVersion, normalizeContractConfig } from "@prisma/orm-framework/config/config-types";
9
11
  import { collectConfigIssues } from "@prisma/orm-framework/config/config-validation";
10
- import { isStructuredError } from "@prisma/orm-framework/utils/structured-error";
12
+ //#region \0rolldown/runtime.js
13
+ var __defProp = Object.defineProperty;
14
+ var __exportAll = (all, no_symbols) => {
15
+ let target = {};
16
+ for (var name in all) __defProp(target, name, {
17
+ get: all[name],
18
+ enumerable: true
19
+ });
20
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
21
+ return target;
22
+ };
23
+ //#endregion
11
24
  //#region ../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs
25
+ var exports_exports = /* @__PURE__ */ __exportAll({
26
+ finalizeConfig: () => finalizeConfig,
27
+ findNearestConfigPathForFile: () => findNearestConfigPathForFile,
28
+ loadConfig: () => loadConfig,
29
+ loadConfigForFile: () => loadConfigForFile,
30
+ loadConfigForSections: () => loadConfigForSections,
31
+ requireConfigSections: () => requireConfigSections
32
+ });
12
33
  function finalizeContractSource(source, configDir) {
13
34
  const resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));
14
35
  if (resolvedInputs === void 0) return source;
@@ -26,11 +47,24 @@ function finalizeContractConfig(contract, configDir) {
26
47
  output: resolve(configDir, normalized.output)
27
48
  };
28
49
  }
50
+ const DEFAULT_MIGRATIONS_DIR = "migrations";
51
+ /**
52
+ * Resolves the migrations directory against `configDir`, which is what `migrations.dir` is
53
+ * documented to be relative to. The default is applied here too, so no caller re-derives it
54
+ * against a different base — a command run from one directory with `--config` naming a project in
55
+ * another would otherwise read the wrong `migrations/`.
56
+ */
57
+ function finalizeMigrationsConfig(migrations, configDir) {
58
+ return {
59
+ ...migrations,
60
+ dir: resolve(configDir, migrations?.dir ?? DEFAULT_MIGRATIONS_DIR)
61
+ };
62
+ }
29
63
  function finalizeConfig(config, configDir) {
30
- if (!config.contract) return config;
31
64
  return {
32
65
  ...config,
33
- contract: finalizeContractConfig(config.contract, configDir)
66
+ ...config.contract ? { contract: finalizeContractConfig(config.contract, configDir) } : void 0,
67
+ migrations: finalizeMigrationsConfig(config.migrations, configDir)
34
68
  };
35
69
  }
36
70
  const CONFIG_FILENAME = "prisma-next.config.ts";
@@ -61,6 +95,7 @@ function collectArtifactCollisionDiagnostics(contract) {
61
95
  emittedArtifactPaths = getEmittedArtifactPaths(output);
62
96
  } catch (error) {
63
97
  return [errorConfigValidation("contract.output", {
98
+ /* v8 ignore next -- getEmittedArtifactPaths only ever throws an Error */
64
99
  why: error instanceof Error ? error.message : String(error),
65
100
  section: "contract"
66
101
  })];
@@ -78,7 +113,11 @@ function buildLoadedConfig(rawConfig, configDir) {
78
113
  why: issue.message,
79
114
  section: issue.section
80
115
  }));
81
- const config = blindCast(rawConfig);
116
+ const raw = blindCast(rawConfig);
117
+ const config = issues.some((issue) => issue.section === "migrations") ? raw : {
118
+ ...raw,
119
+ migrations: finalizeMigrationsConfig(raw.migrations, configDir)
120
+ };
82
121
  if (config.contract === void 0 || issues.some((issue) => issue.section === "contract")) return {
83
122
  config,
84
123
  diagnostics
@@ -118,8 +157,8 @@ function toConfigLoadFailure(error, configPath) {
118
157
  * fail the load: they are returned as section-tagged diagnostics so commands
119
158
  * fail only on the sections they read (via {@link requireConfigSections}).
120
159
  */
121
- async function loadConfig(configPath) {
122
- const cwd = process.cwd();
160
+ async function loadConfig(configPath, options) {
161
+ const cwd = options?.cwd ?? process.cwd();
123
162
  const resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;
124
163
  const configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;
125
164
  let result;
@@ -134,8 +173,11 @@ async function loadConfig(configPath) {
134
173
  }
135
174
  if (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));
136
175
  if (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));
176
+ /* v8 ignore next -- c12 always returns layers for a config it evaluated */
137
177
  const [requestedLayer] = result.layers ?? [];
138
- if (!hasCurrentConfigFormatVersion(requestedLayer?.config)) return notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));
178
+ if (!hasCurrentConfigFormatVersion(requestedLayer?.config))
179
+ /* v8 ignore next -- a config that evaluated always carries its resolved path */
180
+ return notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));
139
181
  /* v8 ignore next -- @preserve */
140
182
  const loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;
141
183
  return ok(buildLoadedConfig(result.config, loadedConfigDir));
@@ -168,6 +210,6 @@ async function loadConfigForFile(filePath) {
168
210
  return loadConfig(configPath);
169
211
  }
170
212
  //#endregion
171
- export { loadConfigForSections as a, loadConfigForFile as i, findNearestConfigPathForFile as n, requireConfigSections as o, loadConfig as r, finalizeConfig as t };
213
+ export { loadConfigForFile as a, loadConfig as i, finalizeConfig as n, loadConfigForSections as o, findNearestConfigPathForFile as r, requireConfigSections as s, exports_exports as t };
172
214
 
173
- //# sourceMappingURL=exports-DVoyX2LM.mjs.map
215
+ //# sourceMappingURL=exports-BZLNbtkY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exports-BZLNbtkY.mjs","names":[],"sources":["../../../../1-framework/3-tooling/config-loader/dist/exports/index.mjs"],"sourcesContent":["import { hasCurrentConfigFormatVersion, normalizeContractConfig } from \"@internal/config/config-types\";\nimport { dirname, join, resolve } from \"pathe\";\nimport { access } from \"node:fs/promises\";\nimport { collectConfigIssues } from \"@internal/config/config-validation\";\nimport { getEmittedArtifactPaths } from \"@internal/emitter\";\nimport { CliStructuredError, errorConfigEvaluationFailed, errorConfigFileNotFound, errorConfigValidation, errorConfigVersionMarkerMissing } from \"@internal/errors/control\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { notOk, ok } from \"@internal/utils/result\";\nimport { isStructuredError } from \"@internal/utils/structured-error\";\n//#region src/finalize-config.ts\nfunction finalizeContractSource(source, configDir) {\n\tconst resolvedInputs = source.inputs?.map((input) => resolve(configDir, input));\n\tif (resolvedInputs === void 0) return source;\n\treturn {\n\t\t...source,\n\t\tinputs: resolvedInputs\n\t};\n}\n/** Normalizes a contract section and resolves its paths against `configDir`. */\nfunction finalizeContractConfig(contract, configDir) {\n\tconst normalized = normalizeContractConfig(contract);\n\treturn {\n\t\t...normalized,\n\t\tsource: finalizeContractSource(normalized.source, configDir),\n\t\toutput: resolve(configDir, normalized.output)\n\t};\n}\nconst DEFAULT_MIGRATIONS_DIR = \"migrations\";\n/**\n* Resolves the migrations directory against `configDir`, which is what `migrations.dir` is\n* documented to be relative to. The default is applied here too, so no caller re-derives it\n* against a different base — a command run from one directory with `--config` naming a project in\n* another would otherwise read the wrong `migrations/`.\n*/\nfunction finalizeMigrationsConfig(migrations, configDir) {\n\treturn {\n\t\t...migrations,\n\t\tdir: resolve(configDir, migrations?.dir ?? DEFAULT_MIGRATIONS_DIR)\n\t};\n}\nfunction finalizeConfig(config, configDir) {\n\treturn {\n\t\t...config,\n\t\t...config.contract ? { contract: finalizeContractConfig(config.contract, configDir) } : void 0,\n\t\tmigrations: finalizeMigrationsConfig(config.migrations, configDir)\n\t};\n}\n//#endregion\n//#region src/load.ts\nconst CONFIG_FILENAME = \"prisma-next.config.ts\";\nasync function findNearestConfigPathForFile(filePath) {\n\tlet current = dirname(resolve(process.cwd(), filePath));\n\twhile (true) {\n\t\tconst candidate = join(current, CONFIG_FILENAME);\n\t\tif (await fileExists(candidate)) return candidate;\n\t\tconst parent = dirname(current);\n\t\tif (parent === current) return;\n\t\tcurrent = parent;\n\t}\n}\nasync function fileExists(path) {\n\ttry {\n\t\tawait access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\nfunction collectArtifactCollisionDiagnostics(contract) {\n\tconst inputs = contract.source.inputs;\n\tconst output = contract.output;\n\tif (inputs === void 0 || output === void 0) return [];\n\tlet emittedArtifactPaths;\n\ttry {\n\t\temittedArtifactPaths = getEmittedArtifactPaths(output);\n\t} catch (error) {\n\t\treturn [errorConfigValidation(\"contract.output\", {\n\t\t\t/* v8 ignore next -- getEmittedArtifactPaths only ever throws an Error */\n\t\t\twhy: error instanceof Error ? error.message : String(error),\n\t\t\tsection: \"contract\"\n\t\t})];\n\t}\n\tconst emittedPaths = /* @__PURE__ */ new Set([emittedArtifactPaths.jsonPath, emittedArtifactPaths.dtsPath]);\n\tif (inputs.some((input) => emittedPaths.has(input))) return [errorConfigValidation(\"contract.source.inputs[]\", {\n\t\twhy: \"Config.contract.source.inputs must not include emitted artifact paths derived from contract.output\",\n\t\tsection: \"contract\"\n\t})];\n\treturn [];\n}\nfunction buildLoadedConfig(rawConfig, configDir) {\n\tconst issues = collectConfigIssues(rawConfig);\n\tconst diagnostics = issues.map((issue) => errorConfigValidation(issue.field, {\n\t\twhy: issue.message,\n\t\tsection: issue.section\n\t}));\n\tconst raw = blindCast(rawConfig);\n\tconst config = issues.some((issue) => issue.section === \"migrations\") ? raw : {\n\t\t...raw,\n\t\tmigrations: finalizeMigrationsConfig(raw.migrations, configDir)\n\t};\n\tif (config.contract === void 0 || issues.some((issue) => issue.section === \"contract\")) return {\n\t\tconfig,\n\t\tdiagnostics\n\t};\n\tconst contract = finalizeContractConfig(config.contract, configDir);\n\tdiagnostics.push(...collectArtifactCollisionDiagnostics(contract));\n\treturn {\n\t\tconfig: {\n\t\t\t...config,\n\t\t\tcontract\n\t\t},\n\t\tdiagnostics\n\t};\n}\nfunction toConfigLoadFailure(error, configPath) {\n\tif (CliStructuredError.is(error)) return error;\n\tconst resolvedPath = configPath ? resolve(process.cwd(), configPath) : void 0;\n\tif (isStructuredError(error)) return new CliStructuredError(error.code, error.message, {\n\t\t...ifDefined(\"why\", error.why),\n\t\t...ifDefined(\"fix\", error.fix),\n\t\t...ifDefined(\"where\", error.where),\n\t\t...ifDefined(\"meta\", error.meta),\n\t\tcause: error\n\t});\n\tif (error instanceof Error) return errorConfigEvaluationFailed(resolvedPath, {\n\t\twhy: error.message,\n\t\tcause: error\n\t});\n\treturn errorConfigEvaluationFailed(resolvedPath, { why: String(error) });\n}\n/**\n* Loads and finalizes the Prisma Next config.\n*\n* Failures that prevent evaluation entirely — missing file, module that does\n* not evaluate (`CONFIG.FILE_NOT_FOUND`, `CONFIG.EVALUATION_FAILED`) — are the\n* `Result` failure. Structural problems inside an evaluated config do not\n* fail the load: they are returned as section-tagged diagnostics so commands\n* fail only on the sections they read (via {@link requireConfigSections}).\n*/\nasync function loadConfig(configPath, options) {\n\tconst cwd = options?.cwd ?? process.cwd();\n\tconst resolvedConfigPath = configPath ? resolve(cwd, configPath) : void 0;\n\tconst configCwd = resolvedConfigPath ? dirname(resolvedConfigPath) : cwd;\n\tlet result;\n\ttry {\n\t\tresult = await (await import(\"c12\")).loadConfig({\n\t\t\tname: \"prisma-next\",\n\t\t\t...ifDefined(\"configFile\", resolvedConfigPath),\n\t\t\tcwd: configCwd\n\t\t});\n\t} catch (error) {\n\t\treturn notOk(toConfigLoadFailure(error, configPath));\n\t}\n\tif (resolvedConfigPath && result.configFile !== resolvedConfigPath) return notOk(errorConfigFileNotFound(resolvedConfigPath));\n\tif (!result.config || Object.keys(result.config).length === 0) return notOk(errorConfigFileNotFound(result.configFile || resolvedConfigPath || configPath));\n\t/* v8 ignore next -- c12 always returns layers for a config it evaluated */\n\tconst [requestedLayer] = result.layers ?? [];\n\tif (!hasCurrentConfigFormatVersion(requestedLayer?.config))\n /* v8 ignore next -- a config that evaluated always carries its resolved path */\n\treturn notOk(errorConfigVersionMarkerMissing(result.configFile ?? resolvedConfigPath));\n\t/* v8 ignore next -- @preserve */\n\tconst loadedConfigDir = result.configFile ? dirname(result.configFile) : configCwd;\n\treturn ok(buildLoadedConfig(result.config, loadedConfigDir));\n}\n/**\n* Narrows a {@link LoadedConfig} to the sections a command reads. Fails with\n* the first diagnostic concerning a required section; diagnostics on other\n* sections are ignored so unrelated commands keep working.\n*/\nfunction requireConfigSections(loaded, sections) {\n\tconst blocking = loaded.diagnostics.find((diagnostic) => {\n\t\tconst section = diagnostic.meta?.[\"section\"];\n\t\treturn typeof section !== \"string\" || sections.some((required) => required === section);\n\t});\n\treturn blocking ? notOk(blocking) : ok(loaded.config);\n}\n/**\n* Convenience composition of {@link loadConfig} and\n* {@link requireConfigSections} for commands that read a fixed set of\n* sections and have no use for diagnostics outside them.\n*/\nasync function loadConfigForSections(configPath, sections) {\n\tconst loaded = await loadConfig(configPath);\n\tif (!loaded.ok) return loaded;\n\treturn requireConfigSections(loaded.value, sections);\n}\nasync function loadConfigForFile(filePath) {\n\tconst configPath = await findNearestConfigPathForFile(filePath);\n\tif (configPath === void 0) return notOk(errorConfigFileNotFound(join(dirname(resolve(process.cwd(), filePath)), CONFIG_FILENAME)));\n\treturn loadConfig(configPath);\n}\n//#endregion\nexport { finalizeConfig, findNearestConfigPathForFile, loadConfig, loadConfigForFile, loadConfigForSections, requireConfigSections };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,uBAAuB,QAAQ,WAAW;CAClD,MAAM,iBAAiB,OAAO,QAAQ,KAAK,UAAU,QAAQ,WAAW,KAAK,CAAC;CAC9E,IAAI,mBAAmB,KAAK,GAAG,OAAO;CACtC,OAAO;EACN,GAAG;EACH,QAAQ;CACT;AACD;;AAEA,SAAS,uBAAuB,UAAU,WAAW;CACpD,MAAM,aAAa,wBAAwB,QAAQ;CACnD,OAAO;EACN,GAAG;EACH,QAAQ,uBAAuB,WAAW,QAAQ,SAAS;EAC3D,QAAQ,QAAQ,WAAW,WAAW,MAAM;CAC7C;AACD;AACA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C,MAAM,aAAa,MAAM,6BAA6B,QAAQ;CAC9D,IAAI,eAAe,KAAK,GAAG,OAAO,MAAM,wBAAwB,KAAK,QAAQ,QAAQ,QAAQ,IAAI,GAAG,QAAQ,CAAC,GAAG,eAAe,CAAC,CAAC;CACjI,OAAO,WAAW,UAAU;AAC7B"}
@@ -1,7 +1,7 @@
1
1
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
2
2
  import { dirname, join } from "pathe";
3
- import { randomUUID } from "node:crypto";
4
3
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
4
+ import { randomUUID } from "node:crypto";
5
5
  import { homedir } from "node:os";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { fork } from "node:child_process";
@@ -273,4 +273,4 @@ function senderModuleUrl(importMetaUrl) {
273
273
  //#endregion
274
274
  export { resolveGating as a, sanitizeCommanderResult as c, writeUserConfig as d, readUserConfig as i, senderModuleUrl as l, TELEMETRY_ENDPOINT_PATH as n, resolveTelemetryEndpoint as o, ensureInstallationId as r, runTelemetry as s, TELEMETRY_BACKEND_URL as t, userConfigPath as u };
275
275
 
276
- //# sourceMappingURL=exports-BN0vFTxG.mjs.map
276
+ //# sourceMappingURL=exports-CqNUihkI.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"exports-BN0vFTxG.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs"],"sourcesContent":["import { n as loadProjectConfig } from \"../enrich-BKPD0fEi.mjs\";\nimport { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"pathe\";\nimport { fork } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { randomUUID } from \"node:crypto\";\nimport { homedir } from \"node:os\";\n//#region src/endpoint.ts\n/**\n* Production endpoint pinned to the deployed Prisma Compute backend.\n* Compiled as a build-time constant; not user-configurable.\n*/\nconst TELEMETRY_BACKEND_URL = \"https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build\";\n/**\n* Path within the backend that accepts telemetry POSTs.\n*/\nconst TELEMETRY_ENDPOINT_PATH = \"/events\";\n/**\n* Resolve the full POST URL the sender targets. The\n* `PRISMA_NEXT_TELEMETRY_ENDPOINT` env var is an integration-testing\n* affordance only — it lets the test suite spin up a mock HTTP server\n* on an ephemeral port and point the spawned sender at it. The override\n* is intentionally undocumented in user-facing material.\n*\n* Fail-open: a malformed override (typo in a dev shell, bad CI config)\n* silently falls back to the production backend rather than throwing,\n* matching the telemetry layer's broader silent-on-failure contract.\n*/\nfunction resolveTelemetryEndpoint(env = process.env) {\n\tconst override = env[\"PRISMA_NEXT_TELEMETRY_ENDPOINT\"];\n\tconst base = override !== void 0 && override.length > 0 ? override : TELEMETRY_BACKEND_URL;\n\ttry {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, base).toString();\n\t} catch {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, TELEMETRY_BACKEND_URL).toString();\n\t}\n}\n//#endregion\n//#region src/gating.ts\n/**\n* A `PRISMA_NEXT_DISABLE_TELEMETRY` value counts as an opt-out only if\n* it parses as a truthy string. The set-but-falsy spellings (`''`,\n* `'0'`, `'false'`) are intentionally treated as not-set so a parent\n* shell that exports the variable to a benign value doesn't accidentally\n* disable telemetry for child processes.\n*/\nfunction isTruthyOptOut(raw) {\n\tif (raw === void 0) return false;\n\tconst normalised = raw.trim().toLowerCase();\n\tif (normalised === \"\") return false;\n\tif (normalised === \"0\") return false;\n\tif (normalised === \"false\") return false;\n\treturn true;\n}\n/**\n* Pure-function resolution of the gating decision. Same input → same\n* output; no I/O. The caller is responsible for reading the env and the\n* user config.\n*\n* Decision order:\n* 1. Env-var override (`PRISMA_NEXT_DISABLE_TELEMETRY` truthy, or\n* `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an\n* opt-out env var wins over any stored or unset preference.\n* 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).\n* 3. Stored `enableTelemetry === true` → enabled.\n* 4. Stored `enableTelemetry === undefined` (file missing, or field\n* not set) → ENABLED. This is the opt-out default: absence of an\n* explicit choice means telemetry is on. This is the load-bearing,\n* counter-intuitive branch — do not \"fix\" it to default-off.\n*\n* Telemetry is disabled only when an env override is active or\n* `enableTelemetry` is explicitly `false`.\n*/\nfunction resolveGating(inputs) {\n\tif (isTruthyOptOut(inputs.env[\"PRISMA_NEXT_DISABLE_TELEMETRY\"]) || inputs.env[\"DO_NOT_TRACK\"] === \"1\") return {\n\t\tenabled: false,\n\t\treason: \"env-override\"\n\t};\n\tif (inputs.config.enableTelemetry === false) return {\n\t\tenabled: false,\n\t\treason: \"stored-opt-out\"\n\t};\n\treturn { enabled: true };\n}\n//#endregion\n//#region src/sanitize.ts\nfunction flagNameFromLongName(longName) {\n\tif (longName === null || !longName.startsWith(\"--\")) return null;\n\tconst withoutPrefix = longName.slice(2);\n\treturn withoutPrefix.length > 0 ? withoutPrefix : null;\n}\n/**\n* Project commander's parsed result into the wire-shape command and\n* flag-name list. Pure; the only allowed inputs are the fields of\n* `CommanderResultShape`.\n*\n* Sanitiser contract — no flag values, no positionals, no raw argv:\n* - Drop the root program name (`commandPath[0]`); the wire ships\n* `migration new`, not `prisma-next migration new`.\n* - Emit only options whose Commander source is `cli`.\n* - Emit the long user-facing flag spelling without the `--` prefix;\n* never emit Commander's camelCase attribute names.\n* - `positionalArgs` is accepted but never consumed; the field exists\n* in the input type to make it obvious at the call site that\n* positionals were deliberately excluded.\n*/\nfunction sanitizeCommanderResult(input) {\n\treturn {\n\t\tcommand: input.commandPath.slice(1).join(\" \"),\n\t\tflags: input.options.flatMap((option) => {\n\t\t\tif (option.source !== \"cli\") return [];\n\t\t\tconst flagName = flagNameFromLongName(option.longName);\n\t\t\treturn flagName === null ? [] : [flagName];\n\t\t})\n\t};\n}\n//#endregion\n//#region src/user-config.ts\nconst APP_DIR = \"prisma-next\";\nconst FILE_NAME = \"config.json\";\n/**\n* Resolves the user-level config directory:\n* - Windows: `%APPDATA%\\prisma-next\\` (fallback: `%USERPROFILE%\\AppData\\Roaming\\prisma-next\\`).\n* - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-next/` if set, else\n* `$HOME/.config/prisma-next/` per the XDG Base Directory Specification.\n*\n* The spec deliberately picks XDG over the macOS-native\n* `~/Library/Preferences/` convention so the path resolution is\n* test-overridable via `XDG_CONFIG_HOME` and matches the documented\n* behaviour on all *nix platforms. We intentionally do not use\n* `env-paths`: its macOS choice of `~/Library/Preferences` is for\n* OS-managed plist preferences, not arbitrary JSON files. Apple documents\n* that apps access that directory through system APIs such as\n* `NSUserDefaults`, while cross-platform CLI and developer tools conventionally\n* use `~/.config` on macOS too:\n* https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html\n*/\nfunction configDir() {\n\tif (process.platform === \"win32\") {\n\t\tconst appData = process.env[\"APPDATA\"];\n\t\tif (appData !== void 0 && appData.length > 0) return join(appData, APP_DIR);\n\t\treturn join(homedir(), \"AppData\", \"Roaming\", APP_DIR);\n\t}\n\tconst xdg = process.env[\"XDG_CONFIG_HOME\"];\n\tif (xdg !== void 0 && xdg.length > 0) return join(xdg, APP_DIR);\n\treturn join(homedir(), \".config\", APP_DIR);\n}\n/**\n* Path to the user-level config file. Resolved per call so test\n* harnesses can mutate `$XDG_CONFIG_HOME` between cases.\n*/\nfunction userConfigPath() {\n\treturn join(configDir(), FILE_NAME);\n}\n/**\n* Reads the user-level config. File-missing, unreadable, or malformed →\n* `{}` (the absence of consent is the same answer in every error mode).\n* Unknown fields from a future client are passed through verbatim.\n*/\nfunction readUserConfig() {\n\tconst path = userConfigPath();\n\tif (!existsSync(path)) return {};\n\ttry {\n\t\tconst raw = readFileSync(path, \"utf-8\");\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)) return parsed;\n\t\treturn {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n/**\n* Merges `partial` into the current config and writes the result\n* atomically (temp file + rename) so a crash mid-write never leaves a\n* half-baked file readable on disk. Unknown fields already on disk are\n* preserved.\n*\n* When `partial.enableTelemetry === true` and no `installationId` is\n* stored yet, generates a v4 random UUID and persists both fields in\n* the same write. An existing `installationId` is never rotated. This is\n* the *explicit-consent* mint path: a `false` answer\n* (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare\n* `writeUserConfig({ installationId })` mints nothing extra. The default-on\n* first-send path mints its id separately via {@link ensureInstallationId},\n* which records no consent answer.\n*/\nfunction writeUserConfig(partial) {\n\tconst merged = {\n\t\t...readUserConfig(),\n\t\t...partial\n\t};\n\tif (partial.enableTelemetry === true && merged[\"installationId\"] === void 0) merged[\"installationId\"] = randomUUID();\n\tconst path = userConfigPath();\n\tconst dir = dirname(path);\n\tif (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\tconst tmpPath = `${path}.${process.pid}.tmp`;\n\twriteFileSync(tmpPath, `${JSON.stringify(merged, null, 2)}\\n`, \"utf-8\");\n\trenameSync(tmpPath, path);\n}\n/**\n* Returns the stored `installationId`, minting and persisting a fresh v4\n* UUID when none exists yet. Crucially, this persists *only* the id —\n* `enableTelemetry` is left untouched (stays `undefined` on a default-on\n* first run), so the interactive `init` consent prompt is not wrongly\n* suppressed and no explicit consent the user never gave is recorded.\n*\n* Used by the default-on first-run fire path: the gate has already\n* resolved enabled, so this only ever runs when telemetry is on.\n*/\nfunction ensureInstallationId() {\n\tconst existing = readUserConfig().installationId;\n\tif (typeof existing === \"string\" && existing.length > 0) return existing;\n\tconst installationId = randomUUID();\n\twriteUserConfig({ installationId });\n\treturn installationId;\n}\n//#endregion\n//#region src/spawn.ts\nfunction runTelemetry(inputs) {\n\tconst env = inputs.env ?? process.env;\n\tif (inputs.isCI) return {\n\t\tspawned: false,\n\t\treason: \"ci\"\n\t};\n\tconst config = inputs.userConfig ?? readUserConfig();\n\tif (!resolveGating({\n\t\tenv,\n\t\tconfig\n\t}).enabled) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst sanitised = sanitizeCommanderResult(inputs.command);\n\tif (typeof config.installationId !== \"string\" || config.installationId.length === 0) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst payload = {\n\t\tinstallationId: config.installationId,\n\t\tversion: inputs.version,\n\t\tcommand: sanitised.command,\n\t\tflags: sanitised.flags,\n\t\tprojectRoot: inputs.projectRoot,\n\t\tendpoint: resolveTelemetryEndpoint(env),\n\t\t...ifDefined(\"databaseTarget\", inputs.databaseTarget)\n\t};\n\ttry {\n\t\tconst child = fork(inputs.senderPath, [], {\n\t\t\tdetached: true,\n\t\t\tstdio: [\n\t\t\t\t\"pipe\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ipc\"\n\t\t\t]\n\t\t});\n\t\tchild.send(payload, (err) => {\n\t\t\tif (err !== null && process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent send error: ${String(err)}\\n`);\n\t\t});\n\t\tchild.disconnect();\n\t\tchild.unref();\n\t\treturn { spawned: true };\n\t} catch (err) {\n\t\tif (process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent fork failed: ${String(err)}\\n`);\n\t\treturn {\n\t\t\tspawned: false,\n\t\t\treason: \"fork-failed\"\n\t\t};\n\t}\n}\n/**\n* Resolve the path to the compiled sender entry relative to a consumer\n* that has captured its own `import.meta.url`. The CLI's\n* `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the\n* consumer asks `senderModuleUrl()` and forwards the result to\n* `runTelemetry({ senderPath })`.\n*/\nfunction senderModuleUrl(importMetaUrl) {\n\treturn fileURLToPath(new URL(\"./sender.mjs\", importMetaUrl));\n}\n//#endregion\nexport { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,MAAM,wBAAwB;;;;AAI9B,MAAM,0BAA0B;;;;;;;;;;;;AAYhC,SAAS,yBAAyB,MAAM,QAAQ,KAAK;CACpD,MAAM,WAAW,IAAI;CACrB,MAAM,OAAO,aAAa,KAAK,KAAK,SAAS,SAAS,IAAI,WAAW;CACrE,IAAI;EACH,OAAO,IAAI,IAAI,yBAAyB,IAAI,CAAC,CAAC,SAAS;CACxD,QAAQ;EACP,OAAO,IAAI,IAAI,yBAAyB,qBAAqB,CAAC,CAAC,SAAS;CACzE;AACD;;;;;;;;AAUA,SAAS,eAAe,KAAK;CAC5B,IAAI,QAAQ,KAAK,GAAG,OAAO;CAC3B,MAAM,aAAa,IAAI,KAAK,CAAC,CAAC,YAAY;CAC1C,IAAI,eAAe,IAAI,OAAO;CAC9B,IAAI,eAAe,KAAK,OAAO;CAC/B,IAAI,eAAe,SAAS,OAAO;CACnC,OAAO;AACR;;;;;;;;;;;;;;;;;;;;AAoBA,SAAS,cAAc,QAAQ;CAC9B,IAAI,eAAe,OAAO,IAAI,gCAAgC,KAAK,OAAO,IAAI,oBAAoB,KAAK,OAAO;EAC7G,SAAS;EACT,QAAQ;CACT;CACA,IAAI,OAAO,OAAO,oBAAoB,OAAO,OAAO;EACnD,SAAS;EACT,QAAQ;CACT;CACA,OAAO,EAAE,SAAS,KAAK;AACxB;AAGA,SAAS,qBAAqB,UAAU;CACvC,IAAI,aAAa,QAAQ,CAAC,SAAS,WAAW,IAAI,GAAG,OAAO;CAC5D,MAAM,gBAAgB,SAAS,MAAM,CAAC;CACtC,OAAO,cAAc,SAAS,IAAI,gBAAgB;AACnD;;;;;;;;;;;;;;;;AAgBA,SAAS,wBAAwB,OAAO;CACvC,OAAO;EACN,SAAS,MAAM,YAAY,MAAM,CA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KAAK,QAAQ,OAAO,MAAM,sCAAsC,OAAO,GAAG,EAAE,GAAG;EACzI,CAAC;EACD,MAAM,WAAW;EACjB,MAAM,MAAM;EACZ,OAAO,EAAE,SAAS,KAAK;CACxB,SAAS,KAAK;EACb,IAAI,QAAQ,IAAI,yBAAyB,KAAK,QAAQ,OAAO,MAAM,uCAAuC,OAAO,GAAG,EAAE,GAAG;EACzH,OAAO;GACN,SAAS;GACT,QAAQ;EACT;CACD;AACD;;;;;;;;AAQA,SAAS,gBAAgB,eAAe;CACvC,OAAO,cAAc,IAAI,IAAI,gBAAgB,aAAa,CAAC;AAC5D"}
1
+ {"version":3,"file":"exports-CqNUihkI.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs"],"sourcesContent":["import { n as loadProjectConfig } from \"../enrich-BKPD0fEi.mjs\";\nimport { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"pathe\";\nimport { fork } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { randomUUID } from \"node:crypto\";\nimport { homedir } from \"node:os\";\n//#region src/endpoint.ts\n/**\n* Production endpoint pinned to the deployed Prisma Compute backend.\n* Compiled as a build-time constant; not user-configurable.\n*/\nconst TELEMETRY_BACKEND_URL = \"https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build\";\n/**\n* Path within the backend that accepts telemetry POSTs.\n*/\nconst TELEMETRY_ENDPOINT_PATH = \"/events\";\n/**\n* Resolve the full POST URL the sender targets. The\n* `PRISMA_NEXT_TELEMETRY_ENDPOINT` env var is an integration-testing\n* affordance only — it lets the test suite spin up a mock HTTP server\n* on an ephemeral port and point the spawned sender at it. The override\n* is intentionally undocumented in user-facing material.\n*\n* Fail-open: a malformed override (typo in a dev shell, bad CI config)\n* silently falls back to the production backend rather than throwing,\n* matching the telemetry layer's broader silent-on-failure contract.\n*/\nfunction resolveTelemetryEndpoint(env = process.env) {\n\tconst override = env[\"PRISMA_NEXT_TELEMETRY_ENDPOINT\"];\n\tconst base = override !== void 0 && override.length > 0 ? override : TELEMETRY_BACKEND_URL;\n\ttry {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, base).toString();\n\t} catch {\n\t\treturn new URL(TELEMETRY_ENDPOINT_PATH, TELEMETRY_BACKEND_URL).toString();\n\t}\n}\n//#endregion\n//#region src/gating.ts\n/**\n* A `PRISMA_NEXT_DISABLE_TELEMETRY` value counts as an opt-out only if\n* it parses as a truthy string. The set-but-falsy spellings (`''`,\n* `'0'`, `'false'`) are intentionally treated as not-set so a parent\n* shell that exports the variable to a benign value doesn't accidentally\n* disable telemetry for child processes.\n*/\nfunction isTruthyOptOut(raw) {\n\tif (raw === void 0) return false;\n\tconst normalised = raw.trim().toLowerCase();\n\tif (normalised === \"\") return false;\n\tif (normalised === \"0\") return false;\n\tif (normalised === \"false\") return false;\n\treturn true;\n}\n/**\n* Pure-function resolution of the gating decision. Same input → same\n* output; no I/O. The caller is responsible for reading the env and the\n* user config.\n*\n* Decision order:\n* 1. Env-var override (`PRISMA_NEXT_DISABLE_TELEMETRY` truthy, or\n* `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an\n* opt-out env var wins over any stored or unset preference.\n* 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).\n* 3. Stored `enableTelemetry === true` → enabled.\n* 4. Stored `enableTelemetry === undefined` (file missing, or field\n* not set) → ENABLED. This is the opt-out default: absence of an\n* explicit choice means telemetry is on. This is the load-bearing,\n* counter-intuitive branch — do not \"fix\" it to default-off.\n*\n* Telemetry is disabled only when an env override is active or\n* `enableTelemetry` is explicitly `false`.\n*/\nfunction resolveGating(inputs) {\n\tif (isTruthyOptOut(inputs.env[\"PRISMA_NEXT_DISABLE_TELEMETRY\"]) || inputs.env[\"DO_NOT_TRACK\"] === \"1\") return {\n\t\tenabled: false,\n\t\treason: \"env-override\"\n\t};\n\tif (inputs.config.enableTelemetry === false) return {\n\t\tenabled: false,\n\t\treason: \"stored-opt-out\"\n\t};\n\treturn { enabled: true };\n}\n//#endregion\n//#region src/sanitize.ts\nfunction flagNameFromLongName(longName) {\n\tif (longName === null || !longName.startsWith(\"--\")) return null;\n\tconst withoutPrefix = longName.slice(2);\n\treturn withoutPrefix.length > 0 ? withoutPrefix : null;\n}\n/**\n* Project commander's parsed result into the wire-shape command and\n* flag-name list. Pure; the only allowed inputs are the fields of\n* `CommanderResultShape`.\n*\n* Sanitiser contract — no flag values, no positionals, no raw argv:\n* - Drop the root program name (`commandPath[0]`); the wire ships\n* `migration new`, not `prisma-next migration new`.\n* - Emit only options whose Commander source is `cli`.\n* - Emit the long user-facing flag spelling without the `--` prefix;\n* never emit Commander's camelCase attribute names.\n* - `positionalArgs` is accepted but never consumed; the field exists\n* in the input type to make it obvious at the call site that\n* positionals were deliberately excluded.\n*/\nfunction sanitizeCommanderResult(input) {\n\treturn {\n\t\tcommand: input.commandPath.slice(1).join(\" \"),\n\t\tflags: input.options.flatMap((option) => {\n\t\t\tif (option.source !== \"cli\") return [];\n\t\t\tconst flagName = flagNameFromLongName(option.longName);\n\t\t\treturn flagName === null ? [] : [flagName];\n\t\t})\n\t};\n}\n//#endregion\n//#region src/user-config.ts\nconst APP_DIR = \"prisma-next\";\nconst FILE_NAME = \"config.json\";\n/**\n* Resolves the user-level config directory:\n* - Windows: `%APPDATA%\\prisma-next\\` (fallback: `%USERPROFILE%\\AppData\\Roaming\\prisma-next\\`).\n* - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-next/` if set, else\n* `$HOME/.config/prisma-next/` per the XDG Base Directory Specification.\n*\n* The spec deliberately picks XDG over the macOS-native\n* `~/Library/Preferences/` convention so the path resolution is\n* test-overridable via `XDG_CONFIG_HOME` and matches the documented\n* behaviour on all *nix platforms. We intentionally do not use\n* `env-paths`: its macOS choice of `~/Library/Preferences` is for\n* OS-managed plist preferences, not arbitrary JSON files. Apple documents\n* that apps access that directory through system APIs such as\n* `NSUserDefaults`, while cross-platform CLI and developer tools conventionally\n* use `~/.config` on macOS too:\n* https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html\n*/\nfunction configDir() {\n\tif (process.platform === \"win32\") {\n\t\tconst appData = process.env[\"APPDATA\"];\n\t\tif (appData !== void 0 && appData.length > 0) return join(appData, APP_DIR);\n\t\treturn join(homedir(), \"AppData\", \"Roaming\", APP_DIR);\n\t}\n\tconst xdg = process.env[\"XDG_CONFIG_HOME\"];\n\tif (xdg !== void 0 && xdg.length > 0) return join(xdg, APP_DIR);\n\treturn join(homedir(), \".config\", APP_DIR);\n}\n/**\n* Path to the user-level config file. Resolved per call so test\n* harnesses can mutate `$XDG_CONFIG_HOME` between cases.\n*/\nfunction userConfigPath() {\n\treturn join(configDir(), FILE_NAME);\n}\n/**\n* Reads the user-level config. File-missing, unreadable, or malformed →\n* `{}` (the absence of consent is the same answer in every error mode).\n* Unknown fields from a future client are passed through verbatim.\n*/\nfunction readUserConfig() {\n\tconst path = userConfigPath();\n\tif (!existsSync(path)) return {};\n\ttry {\n\t\tconst raw = readFileSync(path, \"utf-8\");\n\t\tconst parsed = JSON.parse(raw);\n\t\tif (parsed !== null && typeof parsed === \"object\" && !Array.isArray(parsed)) return parsed;\n\t\treturn {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n/**\n* Merges `partial` into the current config and writes the result\n* atomically (temp file + rename) so a crash mid-write never leaves a\n* half-baked file readable on disk. Unknown fields already on disk are\n* preserved.\n*\n* When `partial.enableTelemetry === true` and no `installationId` is\n* stored yet, generates a v4 random UUID and persists both fields in\n* the same write. An existing `installationId` is never rotated. This is\n* the *explicit-consent* mint path: a `false` answer\n* (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare\n* `writeUserConfig({ installationId })` mints nothing extra. The default-on\n* first-send path mints its id separately via {@link ensureInstallationId},\n* which records no consent answer.\n*/\nfunction writeUserConfig(partial) {\n\tconst merged = {\n\t\t...readUserConfig(),\n\t\t...partial\n\t};\n\tif (partial.enableTelemetry === true && merged[\"installationId\"] === void 0) merged[\"installationId\"] = randomUUID();\n\tconst path = userConfigPath();\n\tconst dir = dirname(path);\n\tif (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\tconst tmpPath = `${path}.${process.pid}.tmp`;\n\twriteFileSync(tmpPath, `${JSON.stringify(merged, null, 2)}\\n`, \"utf-8\");\n\trenameSync(tmpPath, path);\n}\n/**\n* Returns the stored `installationId`, minting and persisting a fresh v4\n* UUID when none exists yet. Crucially, this persists *only* the id —\n* `enableTelemetry` is left untouched (stays `undefined` on a default-on\n* first run), so the interactive `init` consent prompt is not wrongly\n* suppressed and no explicit consent the user never gave is recorded.\n*\n* Used by the default-on first-run fire path: the gate has already\n* resolved enabled, so this only ever runs when telemetry is on.\n*/\nfunction ensureInstallationId() {\n\tconst existing = readUserConfig().installationId;\n\tif (typeof existing === \"string\" && existing.length > 0) return existing;\n\tconst installationId = randomUUID();\n\twriteUserConfig({ installationId });\n\treturn installationId;\n}\n//#endregion\n//#region src/spawn.ts\nfunction runTelemetry(inputs) {\n\tconst env = inputs.env ?? process.env;\n\tif (inputs.isCI) return {\n\t\tspawned: false,\n\t\treason: \"ci\"\n\t};\n\tconst config = inputs.userConfig ?? readUserConfig();\n\tif (!resolveGating({\n\t\tenv,\n\t\tconfig\n\t}).enabled) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst sanitised = sanitizeCommanderResult(inputs.command);\n\tif (typeof config.installationId !== \"string\" || config.installationId.length === 0) return {\n\t\tspawned: false,\n\t\treason: \"gated-off\"\n\t};\n\tconst payload = {\n\t\tinstallationId: config.installationId,\n\t\tversion: inputs.version,\n\t\tcommand: sanitised.command,\n\t\tflags: sanitised.flags,\n\t\tprojectRoot: inputs.projectRoot,\n\t\tendpoint: resolveTelemetryEndpoint(env),\n\t\t...ifDefined(\"databaseTarget\", inputs.databaseTarget)\n\t};\n\ttry {\n\t\tconst child = fork(inputs.senderPath, [], {\n\t\t\tdetached: true,\n\t\t\tstdio: [\n\t\t\t\t\"pipe\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ignore\",\n\t\t\t\t\"ipc\"\n\t\t\t]\n\t\t});\n\t\tchild.send(payload, (err) => {\n\t\t\tif (err !== null && process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent send error: ${String(err)}\\n`);\n\t\t});\n\t\tchild.disconnect();\n\t\tchild.unref();\n\t\treturn { spawned: true };\n\t} catch (err) {\n\t\tif (process.env[\"PRISMA_NEXT_DEBUG\"] === \"1\") process.stderr.write(`[cli-telemetry] parent fork failed: ${String(err)}\\n`);\n\t\treturn {\n\t\t\tspawned: false,\n\t\t\treason: \"fork-failed\"\n\t\t};\n\t}\n}\n/**\n* Resolve the path to the compiled sender entry relative to a consumer\n* that has captured its own `import.meta.url`. The CLI's\n* `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the\n* consumer asks `senderModuleUrl()` and forwards the result to\n* `runTelemetry({ senderPath })`.\n*/\nfunction senderModuleUrl(importMetaUrl) {\n\treturn fileURLToPath(new URL(\"./sender.mjs\", importMetaUrl));\n}\n//#endregion\nexport { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };\n\n//# sourceMappingURL=index.mjs.map"],"mappings":";;;;;;;;;;;;AAaA,MAAM,wBAAwB;;;;AAI9B,MAAM,0BAA0B;;;;;;;;;;;;AAYhC,SAAS,yBAAyB,MAAM,QAAQ,KAAK;CACpD,MAAM,WAAW,IAAI;CACrB,MAAM,OAAO,aAAa,KAAK,KAAK,SAAS,SAAS,IAAI,WAAW;CACrE,IAAI;EACH,OAAO,IAAI,IAAI,yBAAyB,IAAI,CAAC,CAAC,SAAS;CACxD,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,8 @@
1
- import { n as findNearestConfigPathForFile, o as requireConfigSections, r as loadConfig } from "./exports-DVoyX2LM.mjs";
1
+ import { i as loadConfig, r as findNearestConfigPathForFile, s as requireConfigSections } from "./exports-BZLNbtkY.mjs";
2
2
  import { CliStructuredError } from "@prisma/orm-framework/errors/control";
3
3
  import { join } from "pathe";
4
- import { createControlStack } from "@prisma/orm-framework/components/control";
5
4
  import { InternalError } from "@prisma/orm-framework/utils/internal-error";
5
+ import { createControlStack } from "@prisma/orm-framework/components/control";
6
6
  import { format } from "@prisma/orm-framework/psl-parser/format";
7
7
  import { fileURLToPath, pathToFileURL } from "node:url";
8
8
  import { CompletionItemKind, DiagnosticSeverity, DidChangeWatchedFilesNotification, DocumentDiagnosticReportKind, FoldingRangeKind, InsertTextFormat, RegistrationRequest, SemanticTokenModifiers, SemanticTokenTypes, TextDocumentSyncKind, TextDocuments } from "vscode-languageserver";
@@ -1445,4 +1445,4 @@ function startServer() {
1445
1445
  //#endregion
1446
1446
  export { startServer };
1447
1447
 
1448
- //# sourceMappingURL=exports-DAA3XD4a.mjs.map
1448
+ //# sourceMappingURL=exports-DaxzMVtq.mjs.map