@prisma/orm-toolchain 8.0.0-rc.1-dev.45 → 8.0.0-rc.10

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 (327) hide show
  1. package/README.md +3 -7
  2. package/dist/{aggregate-BBsCbXgJ.mjs → aggregate-B4HKshLQ.mjs} +11 -11
  3. package/dist/aggregate-B4HKshLQ.mjs.map +1 -0
  4. package/dist/{aggregate-CA6bJ8UO.d.mts → aggregate-D_eX4zoo.d.mts} +5 -5
  5. package/dist/{aggregate-CA6bJ8UO.d.mts.map → aggregate-D_eX4zoo.d.mts.map} +1 -1
  6. package/dist/cli-telemetry.d.mts +27 -12
  7. package/dist/cli-telemetry.d.mts.map +1 -1
  8. package/dist/cli-telemetry.mjs +286 -9
  9. package/dist/cli-telemetry.mjs.map +1 -1
  10. package/dist/cli.d.mts +7 -13
  11. package/dist/cli.d.mts.map +1 -1
  12. package/dist/cli.mjs +4871 -567
  13. package/dist/cli.mjs.map +1 -1
  14. package/dist/cli__control-api.d.mts +314 -34
  15. package/dist/cli__control-api.d.mts.map +1 -1
  16. package/dist/cli__control-api.mjs +2 -19
  17. package/dist/cli__control-api__testing.d.mts +1 -1
  18. package/dist/cli__control-api__testing.mjs.map +1 -1
  19. package/dist/cli__init-output.d.mts +0 -1
  20. package/dist/cli__init-output.d.mts.map +1 -1
  21. package/dist/cli__init-output.mjs +1 -1
  22. package/dist/cli__migration-cli.mjs +10 -10
  23. package/dist/cli__migration-cli.mjs.map +1 -1
  24. package/dist/config-loader.d.mts +1 -1
  25. package/dist/config-loader.mjs +1 -1
  26. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs → contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs} +5 -5
  27. package/dist/{contract-snapshot-store-B0G1Fw_F-C4JjmWEA.mjs.map → contract-snapshot-store-qGrwlGmt-Cf2NFzRL.mjs.map} +1 -1
  28. package/dist/{cli-errors-iquUoY6O-BFboxglv.d.mts → db-verify-Yih5kWtB-B1kv76ec.d.mts} +84 -84
  29. package/dist/db-verify-Yih5kWtB-B1kv76ec.d.mts.map +1 -0
  30. package/dist/{domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs → domain-type-generation-CR9ECUau-DOlKbcaE.mjs} +20 -6
  31. package/dist/domain-type-generation-CR9ECUau-DOlKbcaE.mjs.map +1 -0
  32. package/dist/{domain-type-generation-PkAb39ob-Ct8AGqow.d.mts → domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts} +14 -3
  33. package/dist/domain-type-generation-X6-AaL1U-DHEoRf_y.d.mts.map +1 -0
  34. package/dist/emitter.d.mts +2 -2
  35. package/dist/emitter.mjs +2 -2
  36. package/dist/emitter__domain-type-generation.d.mts +2 -2
  37. package/dist/emitter__domain-type-generation.mjs +2 -2
  38. package/dist/{errors-KWM8yBAL.d.mts → errors-D59OCpoI.d.mts} +2 -2
  39. package/dist/{errors-KWM8yBAL.d.mts.map → errors-D59OCpoI.d.mts.map} +1 -1
  40. package/dist/{errors-CXbGUWGu-BQi6YS-H.mjs → errors-SoLLYLtw-DMxVbVs9.mjs} +10 -10
  41. package/dist/errors-SoLLYLtw-DMxVbVs9.mjs.map +1 -0
  42. package/dist/{exports-BZLNbtkY.mjs → exports-BXXeNWlj.mjs} +42 -36
  43. package/dist/exports-BXXeNWlj.mjs.map +1 -0
  44. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs +398 -0
  45. package/dist/exports-CE6OD63o-4Qpqr2W7.mjs.map +1 -0
  46. package/dist/{exports-B3xY_FHp.mjs → exports-CYa2di3d.mjs} +386 -26
  47. package/dist/exports-CYa2di3d.mjs.map +1 -0
  48. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs → graph-membership-DY1Onbc3-CwBd6wuB.mjs} +3 -3
  49. package/dist/{graph-membership-BViWUMpP-Cgu4Z2ox.mjs.map → graph-membership-DY1Onbc3-CwBd6wuB.mjs.map} +1 -1
  50. package/dist/{import-roots-B6CtsWXb.d.mts → import-roots-ARK1wjzc.d.mts} +4 -4
  51. package/dist/{import-roots-B6CtsWXb.d.mts.map → import-roots-ARK1wjzc.d.mts.map} +1 -1
  52. package/dist/{import-roots-NDOIEDVj.mjs → import-roots-BHOrDJbI.mjs} +13 -6
  53. package/dist/import-roots-BHOrDJbI.mjs.map +1 -0
  54. package/dist/{index-CnOyYxmv.d.mts → index-D217lbiW.d.mts} +8 -4
  55. package/dist/index-D217lbiW.d.mts.map +1 -0
  56. package/dist/{index-mCsi_ND5.d.mts → index-u5RdrumF.d.mts} +2 -11
  57. package/dist/index-u5RdrumF.d.mts.map +1 -0
  58. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs → invariants-Cww4bv0v-BEiFxmbX.mjs} +3 -3
  59. package/dist/{invariants-CTHy88OP-DJ-i5yTz.mjs.map → invariants-Cww4bv0v-BEiFxmbX.mjs.map} +1 -1
  60. package/dist/{io-635GlNx1-D94PxRc-.mjs → io-BmWQNxRP-DQqbcPsS.mjs} +5 -5
  61. package/dist/{io-635GlNx1-D94PxRc-.mjs.map → io-BmWQNxRP-DQqbcPsS.mjs.map} +1 -1
  62. package/dist/{migration-gubSSeMk.mjs → migration-B9w-7dKe.mjs} +3 -3
  63. package/dist/{migration-gubSSeMk.mjs.map → migration-B9w-7dKe.mjs.map} +1 -1
  64. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs → migration-graph-CW4bMmTz-B5xFtFVB.mjs} +3 -3
  65. package/dist/{migration-graph-_SJImD5V-D5RCc651.mjs.map → migration-graph-CW4bMmTz-B5xFtFVB.mjs.map} +1 -1
  66. package/dist/migration-tools.d.mts +5 -5
  67. package/dist/migration-tools.mjs +13 -13
  68. package/dist/migration-tools__aggregate.d.mts +1 -1
  69. package/dist/migration-tools__aggregate.mjs +1 -1
  70. package/dist/migration-tools__contract-snapshot-store.mjs +1 -1
  71. package/dist/migration-tools__errors.d.mts +1 -1
  72. package/dist/migration-tools__errors.mjs +1 -1
  73. package/dist/migration-tools__invariants.mjs +1 -1
  74. package/dist/migration-tools__io.mjs +1 -1
  75. package/dist/migration-tools__migration-graph.mjs +2 -2
  76. package/dist/migration-tools__migration-ts.mjs +1 -1
  77. package/dist/migration-tools__migration.mjs +1 -1
  78. package/dist/migration-tools__ref-resolution.d.mts +1 -1
  79. package/dist/migration-tools__ref-resolution.mjs +1 -1
  80. package/dist/migration-tools__refs.mjs +1 -1
  81. package/dist/migration-tools__spaces.d.mts +2 -2
  82. package/dist/migration-tools__spaces.mjs +2 -2
  83. package/dist/{migration-ts-BoHxxGvi.mjs → migration-ts-DdVm0rws.mjs} +2 -2
  84. package/dist/{migration-ts-BoHxxGvi.mjs.map → migration-ts-DdVm0rws.mjs.map} +1 -1
  85. package/dist/{output-DP3woAjV-BxCr9nHA.mjs → output-D83nTTpC-XlvN30yS.mjs} +5 -47
  86. package/dist/output-D83nTTpC-XlvN30yS.mjs.map +1 -0
  87. package/dist/publish-surface.d.mts +2 -2
  88. package/dist/publish-surface.mjs +2 -2
  89. package/dist/publish-surface__import-roots.d.mts +1 -1
  90. package/dist/publish-surface__import-roots.mjs +1 -1
  91. package/dist/publish-surface__shells.d.mts +1 -1
  92. package/dist/publish-surface__shells.mjs +1 -1
  93. package/dist/quick-reference-mongo.md +21 -18
  94. package/dist/quick-reference-postgres.md +20 -17
  95. package/dist/readme-mongo.md +7 -7
  96. package/dist/readme-postgres.md +7 -7
  97. package/dist/ref-DcqFmceq-QaUjgZeM.mjs +4789 -0
  98. package/dist/ref-DcqFmceq-QaUjgZeM.mjs.map +1 -0
  99. package/dist/{ref-resolution-sGcINe7o.mjs → ref-resolution-BWpwb8_b.mjs} +9 -2
  100. package/dist/ref-resolution-BWpwb8_b.mjs.map +1 -0
  101. package/dist/{ref-resolution-COGOSL57.d.mts → ref-resolution-CaHQJXE0.d.mts} +11 -1
  102. package/dist/ref-resolution-CaHQJXE0.d.mts.map +1 -0
  103. package/dist/{refs-WK86uYYp-B6EZkmmT.mjs → refs-BpSpzdYB-BcDelHGt.mjs} +9 -9
  104. package/dist/refs-BpSpzdYB-BcDelHGt.mjs.map +1 -0
  105. package/dist/{shells-BenrJHp2.mjs → shells-BIdFZwUY.mjs} +13 -19
  106. package/dist/shells-BIdFZwUY.mjs.map +1 -0
  107. package/dist/{shells-COHV_Ozf.d.mts → shells-CIUmT4u4.d.mts} +14 -20
  108. package/dist/shells-CIUmT4u4.d.mts.map +1 -0
  109. package/dist/{spaces-tWQi7CUv.d.mts → spaces-B20bgxF9.d.mts} +3 -3
  110. package/dist/{spaces-tWQi7CUv.d.mts.map → spaces-B20bgxF9.d.mts.map} +1 -1
  111. package/dist/{spaces-BG2w0P8d.mjs → spaces-BCZiAZQn.mjs} +8 -8
  112. package/dist/spaces-BCZiAZQn.mjs.map +1 -0
  113. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts} +3 -3
  114. package/dist/{verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map → verify-contract-spaces-C3PiFBk3-DfomYyOE.d.mts.map} +1 -1
  115. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs} +8 -8
  116. package/dist/{verify-contract-spaces-DhJTb0zM-_oh6W6lp.mjs.map → verify-contract-spaces-CrxvgpwD-D5LLXGci.mjs.map} +1 -1
  117. package/dist/vite-plugin-contract-emit.d.mts +3 -3
  118. package/dist/vite-plugin-contract-emit.mjs +10 -10
  119. package/dist/vite-plugin-contract-emit.mjs.map +1 -1
  120. package/package.json +16 -40
  121. package/dist/aggregate-BBsCbXgJ.mjs.map +0 -1
  122. package/dist/bin__prisma-next.mjs +0 -512
  123. package/dist/bin__prisma-next.mjs.map +0 -1
  124. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs +0 -14
  125. package/dist/caught-errors-BZo7zcRc-C-pIEasG.mjs.map +0 -1
  126. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs +0 -347
  127. package/dist/cli-errors-B4zTLaqQ-CXgjO9t4.mjs.map +0 -1
  128. package/dist/cli-errors-iquUoY6O-BFboxglv.d.mts.map +0 -1
  129. package/dist/cli__commands__contract-emit.d.mts +0 -2
  130. package/dist/cli__commands__contract-emit.mjs +0 -2
  131. package/dist/cli__commands__contract-infer.d.mts +0 -7
  132. package/dist/cli__commands__contract-infer.d.mts.map +0 -1
  133. package/dist/cli__commands__contract-infer.mjs +0 -2
  134. package/dist/cli__commands__db-init.d.mts +0 -7
  135. package/dist/cli__commands__db-init.d.mts.map +0 -1
  136. package/dist/cli__commands__db-init.mjs +0 -2
  137. package/dist/cli__commands__db-schema.d.mts +0 -7
  138. package/dist/cli__commands__db-schema.d.mts.map +0 -1
  139. package/dist/cli__commands__db-schema.mjs +0 -2
  140. package/dist/cli__commands__db-sign.d.mts +0 -7
  141. package/dist/cli__commands__db-sign.d.mts.map +0 -1
  142. package/dist/cli__commands__db-sign.mjs +0 -2
  143. package/dist/cli__commands__db-update.d.mts +0 -7
  144. package/dist/cli__commands__db-update.d.mts.map +0 -1
  145. package/dist/cli__commands__db-update.mjs +0 -2
  146. package/dist/cli__commands__db-verify.d.mts +0 -7
  147. package/dist/cli__commands__db-verify.d.mts.map +0 -1
  148. package/dist/cli__commands__db-verify.mjs +0 -2
  149. package/dist/cli__commands__migrate.d.mts +0 -57
  150. package/dist/cli__commands__migrate.d.mts.map +0 -1
  151. package/dist/cli__commands__migrate.mjs +0 -2
  152. package/dist/cli__commands__migration-check.d.mts +0 -8
  153. package/dist/cli__commands__migration-check.d.mts.map +0 -1
  154. package/dist/cli__commands__migration-check.mjs +0 -3
  155. package/dist/cli__commands__migration-graph.d.mts +0 -38
  156. package/dist/cli__commands__migration-graph.d.mts.map +0 -1
  157. package/dist/cli__commands__migration-graph.mjs +0 -2
  158. package/dist/cli__commands__migration-list.d.mts +0 -39
  159. package/dist/cli__commands__migration-list.d.mts.map +0 -1
  160. package/dist/cli__commands__migration-list.mjs +0 -2
  161. package/dist/cli__commands__migration-log.d.mts +0 -20
  162. package/dist/cli__commands__migration-log.d.mts.map +0 -1
  163. package/dist/cli__commands__migration-log.mjs +0 -2
  164. package/dist/cli__commands__migration-new.d.mts +0 -7
  165. package/dist/cli__commands__migration-new.d.mts.map +0 -1
  166. package/dist/cli__commands__migration-new.mjs +0 -2
  167. package/dist/cli__commands__migration-plan.d.mts +0 -34
  168. package/dist/cli__commands__migration-plan.d.mts.map +0 -1
  169. package/dist/cli__commands__migration-plan.mjs +0 -2
  170. package/dist/cli__commands__migration-show.d.mts +0 -27
  171. package/dist/cli__commands__migration-show.d.mts.map +0 -1
  172. package/dist/cli__commands__migration-show.mjs +0 -2
  173. package/dist/cli__commands__migration-status.d.mts +0 -55
  174. package/dist/cli__commands__migration-status.d.mts.map +0 -1
  175. package/dist/cli__commands__migration-status.mjs +0 -3
  176. package/dist/cli__commands__ref.d.mts +0 -7
  177. package/dist/cli__commands__ref.d.mts.map +0 -1
  178. package/dist/cli__commands__ref.mjs +0 -2
  179. package/dist/cli__commands__telemetry.d.mts +0 -7
  180. package/dist/cli__commands__telemetry.d.mts.map +0 -1
  181. package/dist/cli__commands__telemetry.mjs +0 -2
  182. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs +0 -1653
  183. package/dist/client-C6Qp5ujC-Dxb7r79B.mjs.map +0 -1
  184. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs +0 -295
  185. package/dist/code-templates-C-jirr19-DDQB0WGo.mjs.map +0 -1
  186. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs +0 -65
  187. package/dist/combine-verify-results-B87B_pMc-D4l22OqY.mjs.map +0 -1
  188. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs +0 -776
  189. package/dist/command-helpers-BCgwcqTe-lNCtppzM.mjs.map +0 -1
  190. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs +0 -44
  191. package/dist/contract-at-errors-BSoDI0Hw-BXeUNE3s.mjs.map +0 -1
  192. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs +0 -331
  193. package/dist/contract-emit-BG7KL4zk-_a0J310Z.mjs.map +0 -1
  194. package/dist/contract-emit-BkEj3siG-C8M-IyvS.mjs +0 -2
  195. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts +0 -7
  196. package/dist/contract-emit-CvwNE4R1-DEn1V1Zo.d.mts.map +0 -1
  197. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs +0 -154
  198. package/dist/contract-emit-GknCmgn_-BSWdFprC.mjs.map +0 -1
  199. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +0 -56
  200. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +0 -1
  201. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs +0 -74
  202. package/dist/contract-infer-BwIDGl7v-CZrdWXAr.mjs.map +0 -1
  203. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs +0 -82
  204. package/dist/contract-snapshot-resolution-De2VvOJn-DqIAV9cr.mjs.map +0 -1
  205. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs +0 -303
  206. package/dist/contract-space-aggregate-loader-fa04OIaL-B7LXHle3.mjs.map +0 -1
  207. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs +0 -109
  208. package/dist/db-init-BolXrKAI-CwG-zEDW.mjs.map +0 -1
  209. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs +0 -44
  210. package/dist/db-init-failure-B5cQML4A-5zr-99Ek.mjs.map +0 -1
  211. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs +0 -48
  212. package/dist/db-schema-DvdLBdEY-Dl6e1d_Y.mjs.map +0 -1
  213. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs +0 -172
  214. package/dist/db-sign-DCp4c8CA-B3tun-kh.mjs.map +0 -1
  215. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs +0 -171
  216. package/dist/db-update-CfayE8WE-CPhQyDaZ.mjs.map +0 -1
  217. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs +0 -358
  218. package/dist/db-verify-BN7IrOAL-kEzRNJUl.mjs.map +0 -1
  219. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +0 -1
  220. package/dist/domain-type-generation-bpSO3Y0L-jo2C7LlH.mjs.map +0 -1
  221. package/dist/errors-CXbGUWGu-BQi6YS-H.mjs.map +0 -1
  222. package/dist/exports-B3xY_FHp.mjs.map +0 -1
  223. package/dist/exports-BCLg4CiV-05kuwcb0.mjs +0 -160
  224. package/dist/exports-BCLg4CiV-05kuwcb0.mjs.map +0 -1
  225. package/dist/exports-BZLNbtkY.mjs.map +0 -1
  226. package/dist/exports-CqNUihkI.mjs +0 -276
  227. package/dist/exports-CqNUihkI.mjs.map +0 -1
  228. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs +0 -110
  229. package/dist/format-Ca7dUE6B-BMFqrc6D.mjs.map +0 -1
  230. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs +0 -60
  231. package/dist/framework-components-Bau7o1-J-DTp6AUoq.mjs.map +0 -1
  232. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +0 -35
  233. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +0 -1
  234. package/dist/import-roots-NDOIEDVj.mjs.map +0 -1
  235. package/dist/index-CnOyYxmv.d.mts.map +0 -1
  236. package/dist/index-mCsi_ND5.d.mts.map +0 -1
  237. package/dist/init-DC7zPKka-BSiUrPw3.mjs +0 -800
  238. package/dist/init-DC7zPKka-BSiUrPw3.mjs.map +0 -1
  239. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs +0 -95
  240. package/dist/inspect-live-schema-BPHXdvqW-DrzL2ZkQ.mjs.map +0 -1
  241. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs +0 -115
  242. package/dist/integrity-violation-to-check-failure-BmWMLAae-DqiC4_3p.mjs.map +0 -1
  243. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs +0 -53
  244. package/dist/invariants-Bltd8DyA-Cg_1Lu0q.mjs.map +0 -1
  245. package/dist/legend-DGv9e2_0-BtetgRz4.mjs +0 -22
  246. package/dist/legend-DGv9e2_0-BtetgRz4.mjs.map +0 -1
  247. package/dist/migrate-BXATUjYE-Do79Imf-.mjs +0 -343
  248. package/dist/migrate-BXATUjYE-Do79Imf-.mjs.map +0 -1
  249. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs +0 -96
  250. package/dist/migrate-failure-D4NvkoCk-0bttmQs2.mjs.map +0 -1
  251. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts +0 -63
  252. package/dist/migrate-show-B8UJ9dmb-C4RTPbDk.d.mts.map +0 -1
  253. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs +0 -199
  254. package/dist/migrate-show-C_9xR4Qt-B-Y0PGKw.mjs.map +0 -1
  255. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs +0 -358
  256. package/dist/migration-check-Bbdw7t-r-C2VTMK61.mjs.map +0 -1
  257. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs +0 -163
  258. package/dist/migration-check-DbHgYK7F-7mtYNVFu.mjs.map +0 -1
  259. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs +0 -121
  260. package/dist/migration-command-scaffold-SzjR2naH-Yi3-rNfX.mjs.map +0 -1
  261. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs +0 -35
  262. package/dist/migration-graph-B8WxW_tm-qGNf7jQh.mjs.map +0 -1
  263. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs +0 -144
  264. package/dist/migration-graph-BOwu76mF-kOTWFvfV.mjs.map +0 -1
  265. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs +0 -2127
  266. package/dist/migration-graph-command-render-h0VdTkSM-C3rPZEw1.mjs.map +0 -1
  267. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs +0 -69
  268. package/dist/migration-graph-sections-BBHPOFN--COKyUKQ4.mjs.map +0 -1
  269. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs +0 -130
  270. package/dist/migration-list-CKuYcMQq-CubZzE9i.mjs.map +0 -1
  271. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs +0 -102
  272. package/dist/migration-list-CY08bD8I-PoXuv94c.mjs.map +0 -1
  273. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs +0 -123
  274. package/dist/migration-log-CUbGla-9-BLIrWjwN.mjs.map +0 -1
  275. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs +0 -116
  276. package/dist/migration-log-table-eES9lPjv-BCFm8qJr.mjs.map +0 -1
  277. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs +0 -70
  278. package/dist/migration-new-ChvZjf5X-BFhEM0BF.mjs.map +0 -1
  279. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs +0 -130
  280. package/dist/migration-new-DXMvJdbB-BkrpDfcr.mjs.map +0 -1
  281. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs +0 -38
  282. package/dist/migration-path-target-JDWqF9kj-B7zoMq6X.mjs.map +0 -1
  283. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts +0 -164
  284. package/dist/migration-plan-BV9f5Xjq-DiyscOMc.d.mts.map +0 -1
  285. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs +0 -192
  286. package/dist/migration-plan-Bz1hOTHF-CFCtPuOv.mjs.map +0 -1
  287. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs +0 -621
  288. package/dist/migration-plan-Cfz0efEL-DMNFq5b2.mjs.map +0 -1
  289. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs +0 -178
  290. package/dist/migration-show-BGdR1xnT-Cg3M0FPh.mjs.map +0 -1
  291. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs +0 -427
  292. package/dist/migration-status-BIrAJ5af-D-_mMBUA.mjs.map +0 -1
  293. package/dist/output-DP3woAjV-BxCr9nHA.mjs.map +0 -1
  294. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +0 -43
  295. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +0 -1
  296. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs +0 -101
  297. package/dist/project-import-root-B4nM-VWX-D__g0hTb.mjs.map +0 -1
  298. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs +0 -1476
  299. package/dist/redact-secrets-DuKoiMax-Cfe2XVhc.mjs.map +0 -1
  300. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs +0 -95
  301. package/dist/ref-4x6BGSsd-ClaoZIQh.mjs.map +0 -1
  302. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs +0 -104
  303. package/dist/ref-WXLIR9Xm-12IUtoBU.mjs.map +0 -1
  304. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs +0 -96
  305. package/dist/ref-advancement-DaZBzm7m-WoqnFAyr.mjs.map +0 -1
  306. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs +0 -16
  307. package/dist/ref-resolution-BSN1amKm-C6-TTM2N.mjs.map +0 -1
  308. package/dist/ref-resolution-COGOSL57.d.mts.map +0 -1
  309. package/dist/ref-resolution-sGcINe7o.mjs.map +0 -1
  310. package/dist/refs-WK86uYYp-B6EZkmmT.mjs.map +0 -1
  311. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs +0 -47
  312. package/dist/refs-fQLFcMoq-aTBeUU9H.mjs.map +0 -1
  313. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts +0 -206
  314. package/dist/schemas-BGgjiKV0-Rh8RlMCl.d.mts.map +0 -1
  315. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs +0 -119
  316. package/dist/schemas-CYSD83Cu-Bff4PPoi.mjs.map +0 -1
  317. package/dist/shells-BenrJHp2.mjs.map +0 -1
  318. package/dist/shells-COHV_Ozf.d.mts.map +0 -1
  319. package/dist/spaces-BG2w0P8d.mjs.map +0 -1
  320. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs +0 -121
  321. package/dist/telemetry-BD52LETE-Cqeb7ebh.mjs.map +0 -1
  322. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +0 -133
  323. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +0 -1
  324. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs +0 -676
  325. package/dist/terminal-ui-Cqz4LVL7-B0mcVdLy.mjs.map +0 -1
  326. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs +0 -283
  327. package/dist/verify-Cogr_Fj9-D3lCWA6t.mjs.map +0 -1
@@ -1,18 +1,22 @@
1
- import { a as resolveGating, c as sanitizeCommanderResult, d as writeUserConfig, i as readUserConfig, l as senderModuleUrl, n as TELEMETRY_ENDPOINT_PATH, o as resolveTelemetryEndpoint, r as ensureInstallationId, s as runTelemetry, t as TELEMETRY_BACKEND_URL, u as userConfigPath } from "./exports-CqNUihkI.mjs";
2
- import "pathe";
3
- import "node:fs";
1
+ import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
2
+ import { ifDefined } from "@prisma/orm-framework/utils/defined";
4
3
  import { blindCast } from "@prisma/orm-framework/utils/casts";
4
+ import { dirname, join } from "pathe";
5
+ import { randomUUID } from "node:crypto";
6
+ import { fileURLToPath } from "node:url";
7
+ import { homedir } from "node:os";
8
+ import { fork } from "node:child_process";
5
9
  import "@vercel/detect-agent";
6
- //#region ../../../1-framework/3-tooling/cli-telemetry/dist/enrich-BKPD0fEi.mjs
10
+ //#region ../../../1-framework/3-tooling/cli-telemetry/dist/enrich-rd5g3THY.mjs
7
11
  const EMPTY_PROJECT_CONFIG = {
8
12
  databaseTarget: null,
9
13
  extensions: []
10
14
  };
11
15
  /**
12
- * Best-effort load of `prisma-next.config.*` from `projectRoot`,
16
+ * Best-effort load of `prisma.config.*` from `projectRoot`,
13
17
  * validated against the canonical `@internal/config` schema.
14
18
  * Returns `{ databaseTarget: null, extensions: [] }` on any failure
15
- * mode — missing config file (e.g. before `prisma-next init`), c12
19
+ * mode — missing config file (e.g. before `prisma orm init`), c12
16
20
  * throws while evaluating user TS, validator rejects a malformed
17
21
  * shape, etc. Telemetry is non-blocking and best-effort; an empty
18
22
  * result is the only downside of an unloadable or invalid config.
@@ -25,14 +29,19 @@ const EMPTY_PROJECT_CONFIG = {
25
29
  async function loadProjectConfig(projectRoot) {
26
30
  try {
27
31
  const { loadConfig } = await import("c12");
28
- const config = (await loadConfig({
29
- name: "prisma-next",
32
+ const load = (name) => loadConfig({
33
+ name,
30
34
  cwd: projectRoot,
31
35
  dotenv: false,
32
36
  rcFile: false,
33
37
  globalRc: false
34
- })).config ?? null;
38
+ });
39
+ let config = (await load("prisma")).config ?? null;
35
40
  if (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;
41
+ if (config["$prismaConfig"] === void 0) return EMPTY_PROJECT_CONFIG;
42
+ const orm = config["orm"];
43
+ if (orm === null || typeof orm !== "object" || Array.isArray(orm)) return EMPTY_PROJECT_CONFIG;
44
+ config = blindCast(orm);
36
45
  if ((await import("@prisma/orm-framework/config/config-validation")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;
37
46
  const validConfig = blindCast(config);
38
47
  return {
@@ -44,6 +53,274 @@ async function loadProjectConfig(projectRoot) {
44
53
  }
45
54
  }
46
55
  //#endregion
56
+ //#region ../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs
57
+ /**
58
+ * Production endpoint pinned to the deployed Prisma Compute backend.
59
+ * Compiled as a build-time constant; not user-configurable.
60
+ */
61
+ const TELEMETRY_BACKEND_URL = "https://cmpbfbsdp09hr3jf7pojjs5qs.ewr.prisma.build";
62
+ /**
63
+ * Path within the backend that accepts telemetry POSTs.
64
+ */
65
+ const TELEMETRY_ENDPOINT_PATH = "/events";
66
+ /**
67
+ * Resolve the full POST URL the sender targets. The
68
+ * `PRISMA_TELEMETRY_ENDPOINT` env var is an integration-testing
69
+ * affordance only — it lets the test suite spin up a mock HTTP server
70
+ * on an ephemeral port and point the spawned sender at it. The override
71
+ * is intentionally undocumented in user-facing material.
72
+ *
73
+ * Fail-open: a malformed override (typo in a dev shell, bad CI config)
74
+ * silently falls back to the production backend rather than throwing,
75
+ * matching the telemetry layer's broader silent-on-failure contract.
76
+ */
77
+ function resolveTelemetryEndpoint(env = process.env) {
78
+ const override = env["PRISMA_TELEMETRY_ENDPOINT"];
79
+ const base = override !== void 0 && override.length > 0 ? override : TELEMETRY_BACKEND_URL;
80
+ try {
81
+ return new URL(TELEMETRY_ENDPOINT_PATH, base).toString();
82
+ } catch {
83
+ return new URL(TELEMETRY_ENDPOINT_PATH, TELEMETRY_BACKEND_URL).toString();
84
+ }
85
+ }
86
+ /**
87
+ * A `PRISMA_DISABLE_TELEMETRY` value counts as an opt-out only if
88
+ * it parses as a truthy string. The set-but-falsy spellings (`''`,
89
+ * `'0'`, `'false'`) are intentionally treated as not-set so a parent
90
+ * shell that exports the variable to a benign value doesn't accidentally
91
+ * disable telemetry for child processes.
92
+ */
93
+ function isTruthyOptOut(raw) {
94
+ if (raw === void 0) return false;
95
+ const normalised = raw.trim().toLowerCase();
96
+ if (normalised === "") return false;
97
+ if (normalised === "0") return false;
98
+ if (normalised === "false") return false;
99
+ return true;
100
+ }
101
+ /**
102
+ * Pure-function resolution of the gating decision. Same input → same
103
+ * output; no I/O. The caller is responsible for reading the env and the
104
+ * user config.
105
+ *
106
+ * Decision order:
107
+ * 1. Env-var override (`PRISMA_DISABLE_TELEMETRY` truthy, its
108
+ * `PRISMA_NEXT_DISABLE_TELEMETRY` spelling from earlier releases, or
109
+ * `DO_NOT_TRACK=1`) → disabled. The env check runs first, so an
110
+ * opt-out env var wins over any stored or unset preference.
111
+ * 2. Stored `enableTelemetry === false` → disabled (`stored-opt-out`).
112
+ * 3. Stored `enableTelemetry === true` → enabled.
113
+ * 4. Stored `enableTelemetry === undefined` (file missing, or field
114
+ * not set) → ENABLED. This is the opt-out default: absence of an
115
+ * explicit choice means telemetry is on. This is the load-bearing,
116
+ * counter-intuitive branch — do not "fix" it to default-off.
117
+ *
118
+ * Telemetry is disabled only when an env override is active or
119
+ * `enableTelemetry` is explicitly `false`.
120
+ */
121
+ function resolveGating(inputs) {
122
+ if (isTruthyOptOut(inputs.env["PRISMA_DISABLE_TELEMETRY"]) || isTruthyOptOut(inputs.env["PRISMA_NEXT_DISABLE_TELEMETRY"]) || inputs.env["DO_NOT_TRACK"] === "1") return {
123
+ enabled: false,
124
+ reason: "env-override"
125
+ };
126
+ if (inputs.config.enableTelemetry === false) return {
127
+ enabled: false,
128
+ reason: "stored-opt-out"
129
+ };
130
+ return { enabled: true };
131
+ }
132
+ function flagNameFromLongName(longName) {
133
+ if (longName === null || !longName.startsWith("--")) return null;
134
+ const withoutPrefix = longName.slice(2);
135
+ return withoutPrefix.length > 0 ? withoutPrefix : null;
136
+ }
137
+ /**
138
+ * Project commander's parsed result into the wire-shape command and
139
+ * flag-name list. Pure; the only allowed inputs are the fields of
140
+ * `CommanderResultShape`.
141
+ *
142
+ * Sanitiser contract — no flag values, no positionals, no raw argv:
143
+ * - Drop the root program name (`commandPath[0]`); the wire ships
144
+ * `migration new`, not `prisma migration new`.
145
+ * - Emit only options whose Commander source is `cli`.
146
+ * - Emit the long user-facing flag spelling without the `--` prefix;
147
+ * never emit Commander's camelCase attribute names.
148
+ * - `positionalArgs` is accepted but never consumed; the field exists
149
+ * in the input type to make it obvious at the call site that
150
+ * positionals were deliberately excluded.
151
+ */
152
+ function sanitizeCommanderResult(input) {
153
+ return {
154
+ command: input.commandPath.slice(1).join(" "),
155
+ flags: input.options.flatMap((option) => {
156
+ if (option.source !== "cli") return [];
157
+ const flagName = flagNameFromLongName(option.longName);
158
+ return flagName === null ? [] : [flagName];
159
+ })
160
+ };
161
+ }
162
+ const APP_DIR = "prisma-8";
163
+ const FILE_NAME = "config.json";
164
+ /**
165
+ * Resolves the user-level config directory:
166
+ * - Windows: `%APPDATA%\prisma-8\` (fallback: `%USERPROFILE%\AppData\Roaming\prisma-8\`).
167
+ * - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-8/` if set, else
168
+ * `$HOME/.config/prisma-8/` per the XDG Base Directory Specification.
169
+ *
170
+ * The spec deliberately picks XDG over the macOS-native
171
+ * `~/Library/Preferences/` convention so the path resolution is
172
+ * test-overridable via `XDG_CONFIG_HOME` and matches the documented
173
+ * behaviour on all *nix platforms. We intentionally do not use
174
+ * `env-paths`: its macOS choice of `~/Library/Preferences` is for
175
+ * OS-managed plist preferences, not arbitrary JSON files. Apple documents
176
+ * that apps access that directory through system APIs such as
177
+ * `NSUserDefaults`, while cross-platform CLI and developer tools conventionally
178
+ * use `~/.config` on macOS too:
179
+ * https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/MacOSXDirectories/MacOSXDirectories.html
180
+ */
181
+ function configDir() {
182
+ if (process.platform === "win32") {
183
+ const appData = process.env["APPDATA"];
184
+ if (appData !== void 0 && appData.length > 0) return join(appData, APP_DIR);
185
+ return join(homedir(), "AppData", "Roaming", APP_DIR);
186
+ }
187
+ const xdg = process.env["XDG_CONFIG_HOME"];
188
+ if (xdg !== void 0 && xdg.length > 0) return join(xdg, APP_DIR);
189
+ return join(homedir(), ".config", APP_DIR);
190
+ }
191
+ /**
192
+ * Path to the user-level config file. Resolved per call so test
193
+ * harnesses can mutate `$XDG_CONFIG_HOME` between cases.
194
+ */
195
+ function userConfigPath() {
196
+ return join(configDir(), FILE_NAME);
197
+ }
198
+ /**
199
+ * Reads the user-level config. File-missing, unreadable, or malformed →
200
+ * `{}` (the absence of consent is the same answer in every error mode).
201
+ * Unknown fields from a future client are passed through verbatim.
202
+ */
203
+ function readUserConfig() {
204
+ const path = userConfigPath();
205
+ if (!existsSync(path)) return {};
206
+ try {
207
+ const raw = readFileSync(path, "utf-8");
208
+ const parsed = JSON.parse(raw);
209
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) return parsed;
210
+ return {};
211
+ } catch {
212
+ return {};
213
+ }
214
+ }
215
+ /**
216
+ * Merges `partial` into the current config and writes the result
217
+ * atomically (temp file + rename) so a crash mid-write never leaves a
218
+ * half-baked file readable on disk. Unknown fields already on disk are
219
+ * preserved.
220
+ *
221
+ * When `partial.enableTelemetry === true` and no `installationId` is
222
+ * stored yet, generates a v4 random UUID and persists both fields in
223
+ * the same write. An existing `installationId` is never rotated. This is
224
+ * the *explicit-consent* mint path: a `false` answer
225
+ * (`writeUserConfig({ enableTelemetry: false })`) writes no id, and a bare
226
+ * `writeUserConfig({ installationId })` mints nothing extra. The default-on
227
+ * first-send path mints its id separately via {@link ensureInstallationId},
228
+ * which records no consent answer.
229
+ */
230
+ function writeUserConfig(partial) {
231
+ const merged = {
232
+ ...readUserConfig(),
233
+ ...partial
234
+ };
235
+ if (partial.enableTelemetry === true && merged["installationId"] === void 0) merged["installationId"] = randomUUID();
236
+ const path = userConfigPath();
237
+ const dir = dirname(path);
238
+ if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
239
+ const tmpPath = `${path}.${process.pid}.tmp`;
240
+ writeFileSync(tmpPath, `${JSON.stringify(merged, null, 2)}\n`, "utf-8");
241
+ renameSync(tmpPath, path);
242
+ }
243
+ /**
244
+ * Returns the stored `installationId`, minting and persisting a fresh v4
245
+ * UUID when none exists yet. Crucially, this persists *only* the id —
246
+ * `enableTelemetry` is left untouched (stays `undefined` on a default-on
247
+ * first run), so the interactive `init` consent prompt is not wrongly
248
+ * suppressed and no explicit consent the user never gave is recorded.
249
+ *
250
+ * Used by the default-on first-run fire path: the gate has already
251
+ * resolved enabled, so this only ever runs when telemetry is on.
252
+ */
253
+ function ensureInstallationId() {
254
+ const existing = readUserConfig().installationId;
255
+ if (typeof existing === "string" && existing.length > 0) return existing;
256
+ const installationId = randomUUID();
257
+ writeUserConfig({ installationId });
258
+ return installationId;
259
+ }
260
+ function runTelemetry(inputs) {
261
+ const env = inputs.env ?? process.env;
262
+ if (inputs.isCI) return {
263
+ spawned: false,
264
+ reason: "ci"
265
+ };
266
+ const config = inputs.userConfig ?? readUserConfig();
267
+ if (!resolveGating({
268
+ env,
269
+ config
270
+ }).enabled) return {
271
+ spawned: false,
272
+ reason: "gated-off"
273
+ };
274
+ const sanitised = sanitizeCommanderResult(inputs.command);
275
+ if (typeof config.installationId !== "string" || config.installationId.length === 0) return {
276
+ spawned: false,
277
+ reason: "gated-off"
278
+ };
279
+ const payload = {
280
+ installationId: config.installationId,
281
+ version: inputs.version,
282
+ command: sanitised.command,
283
+ flags: sanitised.flags,
284
+ projectRoot: inputs.projectRoot,
285
+ endpoint: resolveTelemetryEndpoint(env),
286
+ ...ifDefined("databaseTarget", inputs.databaseTarget),
287
+ ...ifDefined("exitCode", inputs.exitCode)
288
+ };
289
+ try {
290
+ const child = fork(inputs.senderPath, [], {
291
+ detached: true,
292
+ stdio: [
293
+ "pipe",
294
+ "ignore",
295
+ "ignore",
296
+ "ipc"
297
+ ]
298
+ });
299
+ child.send(payload, (err) => {
300
+ if (err !== null && process.env["PRISMA_DEBUG"] === "1") process.stderr.write(`[cli-telemetry] parent send error: ${String(err)}\n`);
301
+ });
302
+ child.disconnect();
303
+ child.unref();
304
+ return { spawned: true };
305
+ } catch (err) {
306
+ if (process.env["PRISMA_DEBUG"] === "1") process.stderr.write(`[cli-telemetry] parent fork failed: ${String(err)}\n`);
307
+ return {
308
+ spawned: false,
309
+ reason: "fork-failed"
310
+ };
311
+ }
312
+ }
313
+ /**
314
+ * Resolve the path to the compiled sender entry relative to a consumer
315
+ * that has captured its own `import.meta.url`. The CLI's
316
+ * `tsdown`-emitted entry sits at `<package>/dist/sender.mjs`; the
317
+ * consumer asks `senderModuleUrl()` and forwards the result to
318
+ * `runTelemetry({ senderPath })`.
319
+ */
320
+ function senderModuleUrl(importMetaUrl) {
321
+ return fileURLToPath(new URL("./sender.mjs", importMetaUrl));
322
+ }
323
+ //#endregion
47
324
  export { TELEMETRY_BACKEND_URL, TELEMETRY_ENDPOINT_PATH, ensureInstallationId, loadProjectConfig, readUserConfig, resolveGating, resolveTelemetryEndpoint, runTelemetry, sanitizeCommanderResult, senderModuleUrl, userConfigPath, writeUserConfig };
48
325
 
49
326
  //# sourceMappingURL=cli-telemetry.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli-telemetry.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/enrich-BKPD0fEi.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { determineAgent } from \"@vercel/detect-agent\";\nimport { join } from \"pathe\";\n//#region src/enrich.ts\nconst EMPTY_PROJECT_CONFIG = {\n\tdatabaseTarget: null,\n\textensions: []\n};\n/**\n* Best-effort load of `prisma-next.config.*` from `projectRoot`,\n* validated against the canonical `@internal/config` schema.\n* Returns `{ databaseTarget: null, extensions: [] }` on any failure\n* mode — missing config file (e.g. before `prisma-next init`), c12\n* throws while evaluating user TS, validator rejects a malformed\n* shape, etc. Telemetry is non-blocking and best-effort; an empty\n* result is the only downside of an unloadable or invalid config.\n*\n* Both `c12` and `@internal/config/config-validation` are imported\n* lazily so the detached sender's cold-start cost is paid only when\n* telemetry actually fires, not on every fork even when gates\n* short-circuit before reaching this code path.\n*/\nasync function loadProjectConfig(projectRoot) {\n\ttry {\n\t\tconst { loadConfig } = await import(\"c12\");\n\t\tconst config = (await loadConfig({\n\t\t\tname: \"prisma-next\",\n\t\t\tcwd: projectRoot,\n\t\t\tdotenv: false,\n\t\t\trcFile: false,\n\t\t\tglobalRc: false\n\t\t})).config ?? null;\n\t\tif (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;\n\t\tif ((await import(\"@internal/config/config-validation\")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst validConfig = blindCast(config);\n\t\treturn {\n\t\t\tdatabaseTarget: validConfig.target.targetId,\n\t\t\textensions: (validConfig.extensions ?? []).map((pack) => pack.id)\n\t\t};\n\t} catch {\n\t\treturn EMPTY_PROJECT_CONFIG;\n\t}\n}\n/**\n* Identify the runtime the sender is running in. Same-runtime as the\n* parent is a correctness requirement: the parent forked us via\n* `child_process.fork`, which inherits the parent's runtime. Detection\n* keys on the runtime-specific version field rather than env vars so a\n* spoofed env can't lie about the actual interpreter.\n*/\nfunction resolveRuntime(versions) {\n\tif (versions.bun !== void 0) return {\n\t\tname: \"bun\",\n\t\tversion: versions.bun\n\t};\n\tif (versions.deno !== void 0) return {\n\t\tname: \"deno\",\n\t\tversion: versions.deno\n\t};\n\treturn {\n\t\tname: \"node\",\n\t\tversion: versions.node\n\t};\n}\n/**\n* Parse `npm_config_user_agent` into a `<pm>/<version>` token. The\n* value, when present, looks like\n* `\"pnpm/10.27.0 npm/? node/v24.13.0 darwin arm64\"` — we take the first\n* whitespace-separated token. Any failure → `null`.\n*/\nfunction parsePackageManager(userAgent) {\n\tif (userAgent === void 0) return null;\n\tconst first = userAgent.split(/\\s+/)[0];\n\tif (first === void 0 || first.length === 0) return null;\n\tif (!first.includes(\"/\")) return null;\n\treturn first;\n}\n/**\n* Read the user's project `package.json` and resolve a TypeScript\n* version from `devDependencies.typescript` (preferred) or\n* `dependencies.typescript`. Strips a leading `^` or `~` semver\n* prefix. Returns `null` on any failure mode — file missing,\n* unreadable, malformed JSON, key absent, not a string.\n*/\nfunction readTsVersionFromPackageJson(raw) {\n\tif (raw === null) return null;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst candidate = pickStringDep(parsed[\"devDependencies\"]) ?? pickStringDep(parsed[\"dependencies\"]);\n\tif (candidate === null) return null;\n\treturn candidate.replace(/^[\\^~]/, \"\");\n}\nfunction pickStringDep(deps) {\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tconst value = deps[\"typescript\"];\n\treturn typeof value === \"string\" ? value : null;\n}\n/**\n* Build the full backend event from the parent's payload, the\n* c12-loaded project-config slice, and the child's per-process\n* snapshot. Pure given a `projectConfig` + `EnrichEnvironment`.\n*/\nfunction buildTelemetryEvent(payload, projectConfig, env) {\n\tconst runtime = resolveRuntime(env.versions);\n\treturn {\n\t\tinstallationId: payload.installationId,\n\t\tversion: payload.version,\n\t\tcommand: payload.command,\n\t\tflags: payload.flags,\n\t\truntimeName: runtime.name,\n\t\truntimeVersion: runtime.version,\n\t\tos: env.platform,\n\t\tarch: env.arch,\n\t\tpackageManager: parsePackageManager(env.env[\"npm_config_user_agent\"]),\n\t\tdatabaseTarget: projectConfig.databaseTarget,\n\t\ttsVersion: readTsVersionFromPackageJson(env.readProjectPackageJson()),\n\t\tagent: env.agent,\n\t\textensions: projectConfig.extensions\n\t};\n}\n/**\n* Resolve the agent label for the telemetry event via\n* `@vercel/detect-agent`, collapsing its discriminated result to the\n* event's `string | null` shape. Any detection failure counts as\n* \"no agent\" — telemetry is best-effort and non-blocking.\n*/\nasync function resolveAgentLabel() {\n\ttry {\n\t\tconst result = await determineAgent();\n\t\treturn result.isAgent ? result.agent.name : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Convenience for the sender entry: build the event from the live\n* `process` plus a c12 load of `prisma-next.config.*` from\n* `payload.projectRoot` plus a real project-package.json reader,\n* swallowing any I/O errors in the file read.\n*\n* The parent's `payload.databaseTarget` (when present) wins over the\n* c12-derived value. The parent sets this for the first-`init` run,\n* where the config file does not exist on disk yet but the user has\n* just declared a target via the consent prompt; every other\n* invocation leaves it unset and the c12 load supplies the value.\n*/\nasync function buildTelemetryEventFromProcess(payload) {\n\tconst loadedConfig = await loadProjectConfig(payload.projectRoot);\n\treturn buildTelemetryEvent(payload, {\n\t\tdatabaseTarget: payload.databaseTarget ?? loadedConfig.databaseTarget,\n\t\textensions: loadedConfig.extensions\n\t}, {\n\t\tplatform: process.platform,\n\t\tarch: process.arch,\n\t\tversions: process.versions,\n\t\tenv: process.env,\n\t\tagent: await resolveAgentLabel(),\n\t\treadProjectPackageJson: () => {\n\t\t\ttry {\n\t\t\t\treturn readFileSync(join(payload.projectRoot, \"package.json\"), \"utf-8\");\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { loadProjectConfig as n, buildTelemetryEventFromProcess as t };\n\n//# sourceMappingURL=enrich-BKPD0fEi.mjs.map"],"mappings":";;;;;;AAKA,MAAM,uBAAuB;CAC5B,gBAAgB;CAChB,YAAY,CAAC;AACd;;;;;;;;;;;;;;;AAeA,eAAe,kBAAkB,aAAa;CAC7C,IAAI;EACH,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,MAAM,UAAU,MAAM,WAAW;GAChC,MAAM;GACN,KAAK;GACL,QAAQ;GACR,QAAQ;GACR,UAAU;EACX,CAAC,EAAA,CAAG,UAAU;EACd,IAAI,WAAW,QAAQ,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG,OAAO;EAChE,KAAK,MAAM,OAAO,kDAAA,CAAuC,oBAAoB,MAAM,CAAC,CAAC,SAAS,GAAG,OAAO;EACxG,MAAM,cAAc,UAAU,MAAM;EACpC,OAAO;GACN,gBAAgB,YAAY,OAAO;GACnC,aAAa,YAAY,cAAc,CAAC,EAAA,CAAG,KAAK,SAAS,KAAK,EAAE;EACjE;CACD,QAAQ;EACP,OAAO;CACR;AACD"}
1
+ {"version":3,"file":"cli-telemetry.mjs","names":[],"sources":["../../../../1-framework/3-tooling/cli-telemetry/dist/enrich-rd5g3THY.mjs","../../../../1-framework/3-tooling/cli-telemetry/dist/exports/index.mjs"],"sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { blindCast } from \"@internal/utils/casts\";\nimport { determineAgent } from \"@vercel/detect-agent\";\nimport { join } from \"pathe\";\n//#region src/enrich.ts\nconst EMPTY_PROJECT_CONFIG = {\n\tdatabaseTarget: null,\n\textensions: []\n};\n/**\n* Best-effort load of `prisma.config.*` from `projectRoot`,\n* validated against the canonical `@internal/config` schema.\n* Returns `{ databaseTarget: null, extensions: [] }` on any failure\n* mode — missing config file (e.g. before `prisma orm init`), c12\n* throws while evaluating user TS, validator rejects a malformed\n* shape, etc. Telemetry is non-blocking and best-effort; an empty\n* result is the only downside of an unloadable or invalid config.\n*\n* Both `c12` and `@internal/config/config-validation` are imported\n* lazily so the detached sender's cold-start cost is paid only when\n* telemetry actually fires, not on every fork even when gates\n* short-circuit before reaching this code path.\n*/\nasync function loadProjectConfig(projectRoot) {\n\ttry {\n\t\tconst { loadConfig } = await import(\"c12\");\n\t\tconst load = (name) => loadConfig({\n\t\t\tname,\n\t\t\tcwd: projectRoot,\n\t\t\tdotenv: false,\n\t\t\trcFile: false,\n\t\t\tglobalRc: false\n\t\t});\n\t\tlet config = (await load(\"prisma\")).config ?? null;\n\t\tif (config === null || Object.keys(config).length === 0) return EMPTY_PROJECT_CONFIG;\n\t\tif (config[\"$prismaConfig\"] === void 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst orm = config[\"orm\"];\n\t\tif (orm === null || typeof orm !== \"object\" || Array.isArray(orm)) return EMPTY_PROJECT_CONFIG;\n\t\tconfig = blindCast(orm);\n\t\tif ((await import(\"@internal/config/config-validation\")).collectConfigIssues(config).length > 0) return EMPTY_PROJECT_CONFIG;\n\t\tconst validConfig = blindCast(config);\n\t\treturn {\n\t\t\tdatabaseTarget: validConfig.target.targetId,\n\t\t\textensions: (validConfig.extensions ?? []).map((pack) => pack.id)\n\t\t};\n\t} catch {\n\t\treturn EMPTY_PROJECT_CONFIG;\n\t}\n}\n/**\n* Identify the runtime the sender is running in. Same-runtime as the\n* parent is a correctness requirement: the parent forked us via\n* `child_process.fork`, which inherits the parent's runtime. Detection\n* keys on the runtime-specific version field rather than env vars so a\n* spoofed env can't lie about the actual interpreter.\n*/\nfunction resolveRuntime(versions) {\n\tif (versions.bun !== void 0) return {\n\t\tname: \"bun\",\n\t\tversion: versions.bun\n\t};\n\tif (versions.deno !== void 0) return {\n\t\tname: \"deno\",\n\t\tversion: versions.deno\n\t};\n\treturn {\n\t\tname: \"node\",\n\t\tversion: versions.node\n\t};\n}\n/**\n* Parse `npm_config_user_agent` into a `<pm>/<version>` token. The\n* value, when present, looks like\n* `\"pnpm/10.27.0 npm/? node/v24.13.0 darwin arm64\"` — we take the first\n* whitespace-separated token. Any failure → `null`.\n*/\nfunction parsePackageManager(userAgent) {\n\tif (userAgent === void 0) return null;\n\tconst first = userAgent.split(/\\s+/)[0];\n\tif (first === void 0 || first.length === 0) return null;\n\tif (!first.includes(\"/\")) return null;\n\treturn first;\n}\n/**\n* Read the user's project `package.json` and resolve a TypeScript\n* version from `devDependencies.typescript` (preferred) or\n* `dependencies.typescript`. Strips a leading `^` or `~` semver\n* prefix. Returns `null` on any failure mode — file missing,\n* unreadable, malformed JSON, key absent, not a string.\n*/\nfunction readTsVersionFromPackageJson(raw) {\n\tif (raw === null) return null;\n\tlet parsed;\n\ttry {\n\t\tparsed = JSON.parse(raw);\n\t} catch {\n\t\treturn null;\n\t}\n\tconst candidate = pickStringDep(parsed[\"devDependencies\"]) ?? pickStringDep(parsed[\"dependencies\"]);\n\tif (candidate === null) return null;\n\treturn candidate.replace(/^[\\^~]/, \"\");\n}\nfunction pickStringDep(deps) {\n\tif (deps === null || typeof deps !== \"object\" || Array.isArray(deps)) return null;\n\tconst value = deps[\"typescript\"];\n\treturn typeof value === \"string\" ? value : null;\n}\n/**\n* Build the full backend event from the parent's payload, the\n* c12-loaded project-config slice, and the child's per-process\n* snapshot. Pure given a `projectConfig` + `EnrichEnvironment`.\n*/\nfunction buildTelemetryEvent(payload, projectConfig, env) {\n\tconst runtime = resolveRuntime(env.versions);\n\treturn {\n\t\tinstallationId: payload.installationId,\n\t\tversion: payload.version,\n\t\tcommand: payload.command,\n\t\tflags: payload.flags,\n\t\truntimeName: runtime.name,\n\t\truntimeVersion: runtime.version,\n\t\tos: env.platform,\n\t\tarch: env.arch,\n\t\tpackageManager: parsePackageManager(env.env[\"npm_config_user_agent\"]),\n\t\tdatabaseTarget: projectConfig.databaseTarget,\n\t\ttsVersion: readTsVersionFromPackageJson(env.readProjectPackageJson()),\n\t\tagent: env.agent,\n\t\textensions: projectConfig.extensions,\n\t\texitCode: payload.exitCode ?? null\n\t};\n}\n/**\n* Resolve the agent label for the telemetry event via\n* `@vercel/detect-agent`, collapsing its discriminated result to the\n* event's `string | null` shape. Any detection failure counts as\n* \"no agent\" — telemetry is best-effort and non-blocking.\n*/\nasync function resolveAgentLabel() {\n\ttry {\n\t\tconst result = await determineAgent();\n\t\treturn result.isAgent ? result.agent.name : null;\n\t} catch {\n\t\treturn null;\n\t}\n}\n/**\n* Convenience for the sender entry: build the event from the live\n* `process` plus a c12 load of `prisma.config.*` from\n* `payload.projectRoot` plus a real project-package.json reader,\n* swallowing any I/O errors in the file read.\n*\n* The parent's `payload.databaseTarget` (when present) wins over the\n* c12-derived value. The parent sets this for the first-`init` run,\n* where the config file does not exist on disk yet but the user has\n* just declared a target via the consent prompt; every other\n* invocation leaves it unset and the c12 load supplies the value.\n*/\nasync function buildTelemetryEventFromProcess(payload) {\n\tconst loadedConfig = await loadProjectConfig(payload.projectRoot);\n\treturn buildTelemetryEvent(payload, {\n\t\tdatabaseTarget: payload.databaseTarget ?? loadedConfig.databaseTarget,\n\t\textensions: loadedConfig.extensions\n\t}, {\n\t\tplatform: process.platform,\n\t\tarch: process.arch,\n\t\tversions: process.versions,\n\t\tenv: process.env,\n\t\tagent: await resolveAgentLabel(),\n\t\treadProjectPackageJson: () => {\n\t\t\ttry {\n\t\t\t\treturn readFileSync(join(payload.projectRoot, \"package.json\"), \"utf-8\");\n\t\t\t} catch {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t});\n}\n//#endregion\nexport { loadProjectConfig as n, buildTelemetryEventFromProcess as t };\n\n//# sourceMappingURL=enrich-rd5g3THY.mjs.map","import { n as loadProjectConfig } from \"../enrich-rd5g3THY.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_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_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_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_DISABLE_TELEMETRY` truthy, its\n* `PRISMA_NEXT_DISABLE_TELEMETRY` spelling from earlier releases, 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_DISABLE_TELEMETRY\"]) || 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 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-8\";\nconst FILE_NAME = \"config.json\";\n/**\n* Resolves the user-level config directory:\n* - Windows: `%APPDATA%\\prisma-8\\` (fallback: `%USERPROFILE%\\AppData\\Roaming\\prisma-8\\`).\n* - Unix (incl. macOS): `$XDG_CONFIG_HOME/prisma-8/` if set, else\n* `$HOME/.config/prisma-8/` 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\t...ifDefined(\"exitCode\", inputs.exitCode)\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_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_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":";;;;;;;;;;AAKA,MAAM,uBAAuB;CAC5B,gBAAgB;CAChB,YAAY,CAAC;AACd;;;;;;;;;;;;;;;AAeA,eAAe,kBAAkB,aAAa;CAC7C,IAAI;EACH,MAAM,EAAE,eAAe,MAAM,OAAO;EACpC,MAAM,QAAQ,SAAS,WAAW;GACjC;GACA,KAAK;GACL,QAAQ;GACR,QAAQ;GACR,UAAU;EACX,CAAC;EACD,IAAI,UAAU,MAAM,KAAK,QAAQ,EAAA,CAAG,UAAU;EAC9C,IAAI,WAAW,QAAQ,OAAO,KAAK,MAAM,CAAC,CAAC,WAAW,GAAG,OAAO;EAChE,IAAI,OAAO,qBAAqB,KAAK,GAAG,OAAO;EAC/C,MAAM,MAAM,OAAO;EACnB,IAAI,QAAQ,QAAQ,OAAO,QAAQ,YAAY,MAAM,QAAQ,GAAG,GAAG,OAAO;EAC1E,SAAS,UAAU,GAAG;EACtB,KAAK,MAAM,OAAO,kDAAA,CAAuC,oBAAoB,MAAM,CAAC,CAAC,SAAS,GAAG,OAAO;EACxG,MAAM,cAAc,UAAU,MAAM;EACpC,OAAO;GACN,gBAAgB,YAAY,OAAO;GACnC,aAAa,YAAY,cAAc,CAAC,EAAA,CAAG,KAAK,SAAS,KAAK,EAAE;EACjE;CACD,QAAQ;EACP,OAAO;CACR;AACD;;;;;;;ACnCA,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;;;;;;;;;;;;;;;;;;;;;AAqBA,SAAS,cAAc,QAAQ;CAC9B,IAAI,eAAe,OAAO,IAAI,2BAA2B,KAAK,eAAe,OAAO,IAAI,gCAAgC,KAAK,OAAO,IAAI,oBAAoB,KAAK,OAAO;EACvK,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,CAAC,CAAC,CAAC,KAAK,GAAG;EAC5C,OAAO,MAAM,QAAQ,SAAS,WAAW;GACxC,IAAI,OAAO,WAAW,OAAO,OAAO,CAAC;GACrC,MAAM,WAAW,qBAAqB,OAAO,QAAQ;GACrD,OAAO,aAAa,OAAO,CAAC,IAAI,CAAC,QAAQ;EAC1C,CAAC;CACF;AACD;AAGA,MAAM,UAAU;AAChB,MAAM,YAAY;;;;;;;;;;;;;;;;;;AAkBlB,SAAS,YAAY;CACpB,IAAI,QAAQ,aAAa,SAAS;EACjC,MAAM,UAAU,QAAQ,IAAI;EAC5B,IAAI,YAAY,KAAK,KAAK,QAAQ,SAAS,GAAG,OAAO,KAAK,SAAS,OAAO;EAC1E,OAAO,KAAK,QAAQ,GAAG,WAAW,WAAW,OAAO;CACrD;CACA,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,QAAQ,KAAK,KAAK,IAAI,SAAS,GAAG,OAAO,KAAK,KAAK,OAAO;CAC9D,OAAO,KAAK,QAAQ,GAAG,WAAW,OAAO;AAC1C;;;;;AAKA,SAAS,iBAAiB;CACzB,OAAO,KAAK,UAAU,GAAG,SAAS;AACnC;;;;;;AAMA,SAAS,iBAAiB;CACzB,MAAM,OAAO,eAAe;CAC5B,IAAI,CAAC,WAAW,IAAI,GAAG,OAAO,CAAC;CAC/B,IAAI;EACH,MAAM,MAAM,aAAa,MAAM,OAAO;EACtC,MAAM,SAAS,KAAK,MAAM,GAAG;EAC7B,IAAI,WAAW,QAAQ,OAAO,WAAW,YAAY,CAAC,MAAM,QAAQ,MAAM,GAAG,OAAO;EACpF,OAAO,CAAC;CACT,QAAQ;EACP,OAAO,CAAC;CACT;AACD;;;;;;;;;;;;;;;;AAgBA,SAAS,gBAAgB,SAAS;CACjC,MAAM,SAAS;EACd,GAAG,eAAe;EAClB,GAAG;CACJ;CACA,IAAI,QAAQ,oBAAoB,QAAQ,OAAO,sBAAsB,KAAK,GAAG,OAAO,oBAAoB,WAAW;CACnH,MAAM,OAAO,eAAe;CAC5B,MAAM,MAAM,QAAQ,IAAI;CACxB,IAAI,CAAC,WAAW,GAAG,GAAG,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;CACxD,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,IAAI;CACvC,cAAc,SAAS,GAAG,KAAK,UAAU,QAAQ,MAAM,CAAC,EAAE,KAAK,OAAO;CACtE,WAAW,SAAS,IAAI;AACzB;;;;;;;;;;;AAWA,SAAS,uBAAuB;CAC/B,MAAM,WAAW,eAAe,CAAC,CAAC;CAClC,IAAI,OAAO,aAAa,YAAY,SAAS,SAAS,GAAG,OAAO;CAChE,MAAM,iBAAiB,WAAW;CAClC,gBAAgB,EAAE,eAAe,CAAC;CAClC,OAAO;AACR;AAGA,SAAS,aAAa,QAAQ;CAC7B,MAAM,MAAM,OAAO,OAAO,QAAQ;CAClC,IAAI,OAAO,MAAM,OAAO;EACvB,SAAS;EACT,QAAQ;CACT;CACA,MAAM,SAAS,OAAO,cAAc,eAAe;CACnD,IAAI,CAAC,cAAc;EAClB;EACA;CACD,CAAC,CAAC,CAAC,SAAS,OAAO;EAClB,SAAS;EACT,QAAQ;CACT;CACA,MAAM,YAAY,wBAAwB,OAAO,OAAO;CACxD,IAAI,OAAO,OAAO,mBAAmB,YAAY,OAAO,eAAe,WAAW,GAAG,OAAO;EAC3F,SAAS;EACT,QAAQ;CACT;CACA,MAAM,UAAU;EACf,gBAAgB,OAAO;EACvB,SAAS,OAAO;EAChB,SAAS,UAAU;EACnB,OAAO,UAAU;EACjB,aAAa,OAAO;EACpB,UAAU,yBAAyB,GAAG;EACtC,GAAG,UAAU,kBAAkB,OAAO,cAAc;EACpD,GAAG,UAAU,YAAY,OAAO,QAAQ;CACzC;CACA,IAAI;EACH,MAAM,QAAQ,KAAK,OAAO,YAAY,CAAC,GAAG;GACzC,UAAU;GACV,OAAO;IACN;IACA;IACA;IACA;GACD;EACD,CAAC;EACD,MAAM,KAAK,UAAU,QAAQ;GAC5B,IAAI,QAAQ,QAAQ,QAAQ,IAAI,oBAAoB,KAAK,QAAQ,OAAO,MAAM,sCAAsC,OAAO,GAAG,EAAE,GAAG;EACpI,CAAC;EACD,MAAM,WAAW;EACjB,MAAM,MAAM;EACZ,OAAO,EAAE,SAAS,KAAK;CACxB,SAAS,KAAK;EACb,IAAI,QAAQ,IAAI,oBAAoB,KAAK,QAAQ,OAAO,MAAM,uCAAuC,OAAO,GAAG,EAAE,GAAG;EACpH,OAAO;GACN,SAAS;GACT,QAAQ;EACT;CACD;AACD;;;;;;;;AAQA,SAAS,gBAAgB,eAAe;CACvC,OAAO,cAAc,IAAI,IAAI,gBAAgB,aAAa,CAAC;AAC5D"}
package/dist/cli.d.mts CHANGED
@@ -1,12 +1,7 @@
1
- import { t as createContractEmitCommand } from "./contract-emit-CvwNE4R1-DEn1V1Zo.mjs";
2
- import { Command } from "commander";
3
- import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
4
1
  import { Contract } from "@prisma/orm-framework/contract/types";
5
2
  import { LoadedConfig } from "@prisma/cli-engine";
3
+ import { PrismaNextConfig } from "@prisma/orm-framework/config/config-types";
6
4
  //#region ../../../1-framework/3-tooling/cli/dist/exports/index.d.mts
7
- //#region src/commands/format.d.ts
8
- declare function createFormatCommand(): Command;
9
- //#endregion
10
5
  //#region src/load-ts-contract.d.ts
11
6
  interface LoadTsContractOptions {
12
7
  readonly allowlist?: ReadonlyArray<string>;
@@ -48,14 +43,13 @@ interface LoadOrmConfigOptions {
48
43
  readonly configPath?: string;
49
44
  }
50
45
  /**
51
- * Builds the engine's `Runtime.config` from `prisma-next.config.ts`.
46
+ * Builds the engine's `Runtime.config` from `prisma.config.ts`.
52
47
  *
53
- * The engine's own loader reads `prisma.config.ts` and the `$prismaConfig`
54
- * marker, which is not the file this bin reads, so the bin owns the load: the
48
+ * The engine ships its own synchronous loader, but the bin owns the load: the
55
49
  * ORM's c12 loader evaluates the module asynchronously and finalizes paths
56
- * against the config file's own directory. The whole result nests as the
57
- * single `orm` section the engine models one section per family, and
58
- * `contract`, `db`, `migrations` and the rest are subsections of it.
50
+ * against the config file's own directory. It reads the same shape the engine
51
+ * does defineConfig from `@prisma/cli-engine` with the whole Prisma ORM
52
+ * configuration nested as the single `orm` section.
59
53
  *
60
54
  * Only failures that prevent evaluation entirely are diagnostics here, and
61
55
  * they carry `section: null` so they fail exactly the commands that read
@@ -63,5 +57,5 @@ interface LoadOrmConfigOptions {
63
57
  */
64
58
  declare function loadOrmConfig(options: LoadOrmConfigOptions): Promise<LoadedConfig>;
65
59
  //#endregion
66
- export { type LoadOrmConfigOptions, type LoadTsContractOptions, createContractEmitCommand, createFormatCommand, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };
60
+ export { type LoadOrmConfigOptions, type LoadTsContractOptions, loadContractFromTs, loadOrmConfig, ormCommandFamily, ormConfigSection };
67
61
  //# sourceMappingURL=cli.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cli.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.d.mts"],"mappings":";;;;;;;iBAMiB,uBAAuB;;;UAG9B;WACC,YAAY;;;;;;;;;;;;;;;;;;iBAkBN,mBAAmB,mBAAmB,UAAU,wBAAwB,QAAQ;;;cAGnF,+CAA+C,cAAc;;;;;;;;cAQ7D,+CAA+C;;;UAGnD;;WAEC;;WAEA;;;;;;;;;;;;;;;;iBAgBM,cAAc,SAAS,uBAAuB,QAAQ"}
1
+ {"version":3,"file":"cli.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/cli/dist/exports/index.d.mts"],"mappings":";;;;;UAIU;WACC,YAAY;;;;;;;;;;;;;;;;;;iBAkBN,mBAAmB,mBAAmB,UAAU,wBAAwB,QAAQ;;;cAGnF,+CAA+C,cAAc;;;;;;;;cAQ7D,+CAA+C;;;UAGnD;;WAEC;;WAEA;;;;;;;;;;;;;;;iBAeM,cAAc,SAAS,uBAAuB,QAAQ"}