@prisma/orm-toolchain 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (321) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +28 -0
  3. package/dist/aggregate-B4mhR4Sk.mjs +1012 -0
  4. package/dist/aggregate-B4mhR4Sk.mjs.map +1 -0
  5. package/dist/aggregate-BflrjWPO.d.mts +803 -0
  6. package/dist/aggregate-BflrjWPO.d.mts.map +1 -0
  7. package/dist/bin__prisma-next.mjs +800 -0
  8. package/dist/bin__prisma-next.mjs.map +1 -0
  9. package/dist/cli-telemetry.d.mts +367 -0
  10. package/dist/cli-telemetry.d.mts.map +1 -0
  11. package/dist/cli-telemetry.mjs +48 -0
  12. package/dist/cli-telemetry.mjs.map +1 -0
  13. package/dist/cli-telemetry__sender.d.mts +1 -0
  14. package/dist/cli-telemetry__sender.mjs +1 -0
  15. package/dist/cli.d.mts +31 -0
  16. package/dist/cli.d.mts.map +1 -0
  17. package/dist/cli.mjs +180 -0
  18. package/dist/cli.mjs.map +1 -0
  19. package/dist/cli__commands__contract-emit.d.mts +2 -0
  20. package/dist/cli__commands__contract-emit.mjs +2 -0
  21. package/dist/cli__commands__contract-infer.d.mts +7 -0
  22. package/dist/cli__commands__contract-infer.d.mts.map +1 -0
  23. package/dist/cli__commands__contract-infer.mjs +2 -0
  24. package/dist/cli__commands__db-init.d.mts +7 -0
  25. package/dist/cli__commands__db-init.d.mts.map +1 -0
  26. package/dist/cli__commands__db-init.mjs +2 -0
  27. package/dist/cli__commands__db-schema.d.mts +7 -0
  28. package/dist/cli__commands__db-schema.d.mts.map +1 -0
  29. package/dist/cli__commands__db-schema.mjs +2 -0
  30. package/dist/cli__commands__db-sign.d.mts +7 -0
  31. package/dist/cli__commands__db-sign.d.mts.map +1 -0
  32. package/dist/cli__commands__db-sign.mjs +2 -0
  33. package/dist/cli__commands__db-update.d.mts +7 -0
  34. package/dist/cli__commands__db-update.d.mts.map +1 -0
  35. package/dist/cli__commands__db-update.mjs +2 -0
  36. package/dist/cli__commands__db-verify.d.mts +7 -0
  37. package/dist/cli__commands__db-verify.d.mts.map +1 -0
  38. package/dist/cli__commands__db-verify.mjs +2 -0
  39. package/dist/cli__commands__migrate.d.mts +66 -0
  40. package/dist/cli__commands__migrate.d.mts.map +1 -0
  41. package/dist/cli__commands__migrate.mjs +2 -0
  42. package/dist/cli__commands__migration-check.d.mts +64 -0
  43. package/dist/cli__commands__migration-check.d.mts.map +1 -0
  44. package/dist/cli__commands__migration-check.mjs +3 -0
  45. package/dist/cli__commands__migration-graph.d.mts +36 -0
  46. package/dist/cli__commands__migration-graph.d.mts.map +1 -0
  47. package/dist/cli__commands__migration-graph.mjs +2 -0
  48. package/dist/cli__commands__migration-list.d.mts +79 -0
  49. package/dist/cli__commands__migration-list.d.mts.map +1 -0
  50. package/dist/cli__commands__migration-list.mjs +2 -0
  51. package/dist/cli__commands__migration-log.d.mts +20 -0
  52. package/dist/cli__commands__migration-log.d.mts.map +1 -0
  53. package/dist/cli__commands__migration-log.mjs +2 -0
  54. package/dist/cli__commands__migration-new.d.mts +7 -0
  55. package/dist/cli__commands__migration-new.d.mts.map +1 -0
  56. package/dist/cli__commands__migration-new.mjs +2 -0
  57. package/dist/cli__commands__migration-plan.d.mts +79 -0
  58. package/dist/cli__commands__migration-plan.d.mts.map +1 -0
  59. package/dist/cli__commands__migration-plan.mjs +2 -0
  60. package/dist/cli__commands__migration-show.d.mts +27 -0
  61. package/dist/cli__commands__migration-show.d.mts.map +1 -0
  62. package/dist/cli__commands__migration-show.mjs +2 -0
  63. package/dist/cli__commands__migration-status.d.mts +55 -0
  64. package/dist/cli__commands__migration-status.d.mts.map +1 -0
  65. package/dist/cli__commands__migration-status.mjs +3 -0
  66. package/dist/cli__commands__ref.d.mts +34 -0
  67. package/dist/cli__commands__ref.d.mts.map +1 -0
  68. package/dist/cli__commands__ref.mjs +2 -0
  69. package/dist/cli__commands__telemetry.d.mts +7 -0
  70. package/dist/cli__commands__telemetry.d.mts.map +1 -0
  71. package/dist/cli__commands__telemetry.mjs +2 -0
  72. package/dist/cli__config-types.d.mts +2 -0
  73. package/dist/cli__config-types.mjs +2 -0
  74. package/dist/cli__control-api.d.mts +141 -0
  75. package/dist/cli__control-api.d.mts.map +1 -0
  76. package/dist/cli__control-api.mjs +4 -0
  77. package/dist/cli__init-output.d.mts +37 -0
  78. package/dist/cli__init-output.d.mts.map +1 -0
  79. package/dist/cli__init-output.mjs +2 -0
  80. package/dist/cli__migration-cli.d.mts +79 -0
  81. package/dist/cli__migration-cli.d.mts.map +1 -0
  82. package/dist/cli__migration-cli.mjs +407 -0
  83. package/dist/cli__migration-cli.mjs.map +1 -0
  84. package/dist/client-75qrAPqf-DZAVUxFa.mjs +1606 -0
  85. package/dist/client-75qrAPqf-DZAVUxFa.mjs.map +1 -0
  86. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs +1671 -0
  87. package/dist/command-helpers-CAoXqAY9-DWUBcTXM.mjs.map +1 -0
  88. package/dist/config-loader.d.mts +18 -0
  89. package/dist/config-loader.d.mts.map +1 -0
  90. package/dist/config-loader.mjs +2 -0
  91. package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs +10 -0
  92. package/dist/constants-CM-w38DQ-Cz_EXbOc.mjs.map +1 -0
  93. package/dist/constants-Dkcn8Qu4.d.mts +10 -0
  94. package/dist/constants-Dkcn8Qu4.d.mts.map +1 -0
  95. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs +36 -0
  96. package/dist/contract-at-errors-BX7w-p19-SxA8eaV2.mjs.map +1 -0
  97. package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs +148 -0
  98. package/dist/contract-emit-0hSjbuxp-BBOKldTZ.mjs.map +1 -0
  99. package/dist/contract-emit-B65_UiFn.d.mts +7 -0
  100. package/dist/contract-emit-B65_UiFn.d.mts.map +1 -0
  101. package/dist/contract-emit-B6odMoem-CK3diBPk.mjs +359 -0
  102. package/dist/contract-emit-B6odMoem-CK3diBPk.mjs.map +1 -0
  103. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs +56 -0
  104. package/dist/contract-enrichment-DrMvvY2A-DxNGeF4d.mjs.map +1 -0
  105. package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs +73 -0
  106. package/dist/contract-infer-BnkqpftN-DVM2eKJ3.mjs.map +1 -0
  107. package/dist/contract-snapshot-store-CbqynbtE.d.mts +28 -0
  108. package/dist/contract-snapshot-store-CbqynbtE.d.mts.map +1 -0
  109. package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs +118 -0
  110. package/dist/contract-snapshot-store-sf5nP4mb-MLpG-ihh.mjs.map +1 -0
  111. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs +302 -0
  112. package/dist/contract-space-aggregate-loader-CFH-336b-BhAyRQEL.mjs.map +1 -0
  113. package/dist/db-init-Vbkb_TKZ.mjs +153 -0
  114. package/dist/db-init-Vbkb_TKZ.mjs.map +1 -0
  115. package/dist/db-schema-ClQCu3xY.mjs +47 -0
  116. package/dist/db-schema-ClQCu3xY.mjs.map +1 -0
  117. package/dist/db-sign-jjXDgQ1u.mjs +175 -0
  118. package/dist/db-sign-jjXDgQ1u.mjs.map +1 -0
  119. package/dist/db-update-BQlrqtDD.mjs +183 -0
  120. package/dist/db-update-BQlrqtDD.mjs.map +1 -0
  121. package/dist/db-verify-CKPsRFrj-3udprZQD.mjs +396 -0
  122. package/dist/db-verify-CKPsRFrj-3udprZQD.mjs.map +1 -0
  123. package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs +334 -0
  124. package/dist/domain-type-generation-DAn9y5d2-BgoT5uKI.mjs.map +1 -0
  125. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts +63 -0
  126. package/dist/domain-type-generation-PkAb39ob-Ct8AGqow.d.mts.map +1 -0
  127. package/dist/emitter.d.mts +75 -0
  128. package/dist/emitter.d.mts.map +1 -0
  129. package/dist/emitter.mjs +3 -0
  130. package/dist/emitter__domain-type-generation.d.mts +2 -0
  131. package/dist/emitter__domain-type-generation.mjs +2 -0
  132. package/dist/emitter__type-expression-safety.d.mts +6 -0
  133. package/dist/emitter__type-expression-safety.d.mts.map +1 -0
  134. package/dist/emitter__type-expression-safety.mjs +2 -0
  135. package/dist/errors--qsXZUtL.d.mts +72 -0
  136. package/dist/errors--qsXZUtL.d.mts.map +1 -0
  137. package/dist/errors-IpZm1Skp-BH495dRd.mjs +378 -0
  138. package/dist/errors-IpZm1Skp-BH495dRd.mjs.map +1 -0
  139. package/dist/exports-BN0vFTxG.mjs +276 -0
  140. package/dist/exports-BN0vFTxG.mjs.map +1 -0
  141. package/dist/exports-B_xhKZmC.mjs +1436 -0
  142. package/dist/exports-B_xhKZmC.mjs.map +1 -0
  143. package/dist/exports-D3-NwrMA-CadaBGQ3.mjs +154 -0
  144. package/dist/exports-D3-NwrMA-CadaBGQ3.mjs.map +1 -0
  145. package/dist/exports-Dl2aGAk7.mjs +119 -0
  146. package/dist/exports-Dl2aGAk7.mjs.map +1 -0
  147. package/dist/format-ByDm2goZ-DKLyhNHo.mjs +101 -0
  148. package/dist/format-ByDm2goZ-DKLyhNHo.mjs.map +1 -0
  149. package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs +58 -0
  150. package/dist/framework-components-CjshQKHA-Dlp6Leo5.mjs.map +1 -0
  151. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts +35 -0
  152. package/dist/global-flags-BpoOYtNZ-CHZD3fud.d.mts.map +1 -0
  153. package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts +28 -0
  154. package/dist/graph-bDjJ4GL9-BhFevsJS.d.mts.map +1 -0
  155. package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs +14 -0
  156. package/dist/graph-membership-DW6nnbyQ-Bp2KcVwR.mjs.map +1 -0
  157. package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs +64 -0
  158. package/dist/hash-DH8hl5Rq-BpM2t3Nu.mjs.map +1 -0
  159. package/dist/hash-XZYYKJ-i.d.mts +53 -0
  160. package/dist/hash-XZYYKJ-i.d.mts.map +1 -0
  161. package/dist/import-roots-B6CtsWXb.d.mts +119 -0
  162. package/dist/import-roots-B6CtsWXb.d.mts.map +1 -0
  163. package/dist/import-roots-NDOIEDVj.mjs +217 -0
  164. package/dist/import-roots-NDOIEDVj.mjs.map +1 -0
  165. package/dist/init-DHctXAI9-DSlaaYXN.mjs +2186 -0
  166. package/dist/init-DHctXAI9-DSlaaYXN.mjs.map +1 -0
  167. package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs +91 -0
  168. package/dist/inspect-live-schema-CnwYTRZ0-BErPHMni.mjs.map +1 -0
  169. package/dist/invariants-B5wLrgQS.d.mts +39 -0
  170. package/dist/invariants-B5wLrgQS.d.mts.map +1 -0
  171. package/dist/invariants-lXzy6txi-DAoP4nTE.mjs +57 -0
  172. package/dist/invariants-lXzy6txi-DAoP4nTE.mjs.map +1 -0
  173. package/dist/io-C8TdyBKt-DloEBi70.mjs +313 -0
  174. package/dist/io-C8TdyBKt-DloEBi70.mjs.map +1 -0
  175. package/dist/io-DYfeLJxR.d.mts +1 -0
  176. package/dist/io-sr4CO9_t-C3eV_kn-.d.mts +125 -0
  177. package/dist/io-sr4CO9_t-C3eV_kn-.d.mts.map +1 -0
  178. package/dist/ledger-origin-BGRN77Oy.d.mts +6 -0
  179. package/dist/ledger-origin-BGRN77Oy.d.mts.map +1 -0
  180. package/dist/ledger-origin-D7PN4Fon.mjs +9 -0
  181. package/dist/ledger-origin-D7PN4Fon.mjs.map +1 -0
  182. package/dist/metadata-2nbOAGsV-uYNeq2Cp.d.mts +2 -0
  183. package/dist/metadata-BtscDay2.d.mts +1 -0
  184. package/dist/migrate-Cb_iv264.mjs +500 -0
  185. package/dist/migrate-Cb_iv264.mjs.map +1 -0
  186. package/dist/migration-B2ljMJim.d.mts +155 -0
  187. package/dist/migration-B2ljMJim.d.mts.map +1 -0
  188. package/dist/migration-BuUmO7It.mjs +209 -0
  189. package/dist/migration-BuUmO7It.mjs.map +1 -0
  190. package/dist/migration-check-DcwUnadt-B6Qoh0ot.mjs +597 -0
  191. package/dist/migration-check-DcwUnadt-B6Qoh0ot.mjs.map +1 -0
  192. package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs +103 -0
  193. package/dist/migration-command-scaffold-BCuoeAki-B1pVGX8d.mjs.map +1 -0
  194. package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs +500 -0
  195. package/dist/migration-graph-CBf9ORe7-B4xAF8GN.mjs.map +1 -0
  196. package/dist/migration-graph-DkoCC0Qy.mjs +185 -0
  197. package/dist/migration-graph-DkoCC0Qy.mjs.map +1 -0
  198. package/dist/migration-graph-Dqndu0i5.d.mts +9 -0
  199. package/dist/migration-graph-Dqndu0i5.d.mts.map +1 -0
  200. package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs +1945 -0
  201. package/dist/migration-graph-command-render-BKrg6BPv-BP8Pfj4J.mjs.map +1 -0
  202. package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts +124 -0
  203. package/dist/migration-graph-tarTxJ99-BrGBANeE.d.mts.map +1 -0
  204. package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs +228 -0
  205. package/dist/migration-list-BFBeo1_X-c0kqYokL.mjs.map +1 -0
  206. package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs +220 -0
  207. package/dist/migration-log-CS5IWcNq-BQ-32Low.mjs.map +1 -0
  208. package/dist/migration-new-BurCjyaQ.mjs +168 -0
  209. package/dist/migration-new-BurCjyaQ.mjs.map +1 -0
  210. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs +38 -0
  211. package/dist/migration-path-target-D3Sj55PI-BICblCuk.mjs.map +1 -0
  212. package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs +759 -0
  213. package/dist/migration-plan-q_L84PN1-BWE0LTH6.mjs.map +1 -0
  214. package/dist/migration-show-Bx5I5aW9.mjs +171 -0
  215. package/dist/migration-show-Bx5I5aW9.mjs.map +1 -0
  216. package/dist/migration-status-CE7cQLDq-B1jDVmqG.mjs +444 -0
  217. package/dist/migration-status-CE7cQLDq-B1jDVmqG.mjs.map +1 -0
  218. package/dist/migration-tools.d.mts +23 -0
  219. package/dist/migration-tools.mjs +17 -0
  220. package/dist/migration-tools__aggregate.d.mts +2 -0
  221. package/dist/migration-tools__aggregate.mjs +2 -0
  222. package/dist/migration-tools__constants.d.mts +2 -0
  223. package/dist/migration-tools__constants.mjs +2 -0
  224. package/dist/migration-tools__contract-snapshot-store.d.mts +2 -0
  225. package/dist/migration-tools__contract-snapshot-store.mjs +2 -0
  226. package/dist/migration-tools__errors.d.mts +2 -0
  227. package/dist/migration-tools__errors.mjs +2 -0
  228. package/dist/migration-tools__graph.d.mts +2 -0
  229. package/dist/migration-tools__graph.mjs +1 -0
  230. package/dist/migration-tools__hash.d.mts +2 -0
  231. package/dist/migration-tools__hash.mjs +2 -0
  232. package/dist/migration-tools__invariants.d.mts +2 -0
  233. package/dist/migration-tools__invariants.mjs +2 -0
  234. package/dist/migration-tools__io.d.mts +3 -0
  235. package/dist/migration-tools__io.mjs +2 -0
  236. package/dist/migration-tools__ledger-origin.d.mts +2 -0
  237. package/dist/migration-tools__ledger-origin.mjs +2 -0
  238. package/dist/migration-tools__metadata.d.mts +3 -0
  239. package/dist/migration-tools__metadata.mjs +1 -0
  240. package/dist/migration-tools__migration-graph.d.mts +3 -0
  241. package/dist/migration-tools__migration-graph.mjs +3 -0
  242. package/dist/migration-tools__migration-ts.d.mts +2 -0
  243. package/dist/migration-tools__migration-ts.mjs +2 -0
  244. package/dist/migration-tools__migration.d.mts +2 -0
  245. package/dist/migration-tools__migration.mjs +2 -0
  246. package/dist/migration-tools__package.d.mts +3 -0
  247. package/dist/migration-tools__package.mjs +1 -0
  248. package/dist/migration-tools__ref-resolution.d.mts +2 -0
  249. package/dist/migration-tools__ref-resolution.mjs +2 -0
  250. package/dist/migration-tools__refs.d.mts +2 -0
  251. package/dist/migration-tools__refs.mjs +2 -0
  252. package/dist/migration-tools__spaces.d.mts +3 -0
  253. package/dist/migration-tools__spaces.mjs +3 -0
  254. package/dist/migration-ts-CNaAtK8C.d.mts +38 -0
  255. package/dist/migration-ts-CNaAtK8C.d.mts.map +1 -0
  256. package/dist/migration-ts-FyF55c4M.mjs +67 -0
  257. package/dist/migration-ts-FyF55c4M.mjs.map +1 -0
  258. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs +13 -0
  259. package/dist/op-schema-BSVHzEQN-DIWt28D8.mjs.map +1 -0
  260. package/dist/output-DWNYqZGc-D2sRgLAm.mjs +109 -0
  261. package/dist/output-DWNYqZGc-D2sRgLAm.mjs.map +1 -0
  262. package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts +21 -0
  263. package/dist/package-CfWiDNrr-ZR4HM_Iz.d.mts.map +1 -0
  264. package/dist/package-N9PPdFV_.d.mts +3 -0
  265. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs +43 -0
  266. package/dist/progress-adapter-CjAeTxY_-BXYSd1eY.mjs.map +1 -0
  267. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs +99 -0
  268. package/dist/project-import-root-CpwLCDLY-DkVwAnWj.mjs.map +1 -0
  269. package/dist/publish-surface.d.mts +3 -0
  270. package/dist/publish-surface.mjs +3 -0
  271. package/dist/publish-surface__import-roots.d.mts +2 -0
  272. package/dist/publish-surface__import-roots.mjs +2 -0
  273. package/dist/publish-surface__shells.d.mts +2 -0
  274. package/dist/publish-surface__shells.mjs +2 -0
  275. package/dist/quick-reference-mongo.md +114 -0
  276. package/dist/quick-reference-postgres.md +93 -0
  277. package/dist/readme-mongo.md +35 -0
  278. package/dist/readme-postgres.md +34 -0
  279. package/dist/ref-B6cTthTi.mjs +171 -0
  280. package/dist/ref-B6cTthTi.mjs.map +1 -0
  281. package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs +57 -0
  282. package/dist/ref-advancement-CSPMoQs3-fEipZrdu.mjs.map +1 -0
  283. package/dist/ref-resolution-BjJBWPjX.mjs +250 -0
  284. package/dist/ref-resolution-BjJBWPjX.mjs.map +1 -0
  285. package/dist/ref-resolution-COGOSL57.d.mts +127 -0
  286. package/dist/ref-resolution-COGOSL57.d.mts.map +1 -0
  287. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs +241 -0
  288. package/dist/refs-BDbB9BRB-D6Za3Q49.mjs.map +1 -0
  289. package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts +43 -0
  290. package/dist/refs-BNCUu58Y-BIso5Jfg.d.mts.map +1 -0
  291. package/dist/schemas-CfGSxH5b-BSjB3nZS.d.mts +192 -0
  292. package/dist/schemas-CfGSxH5b-BSjB3nZS.d.mts.map +1 -0
  293. package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs +112 -0
  294. package/dist/schemas-KhXMzNA_-CzZ7GFX_.mjs.map +1 -0
  295. package/dist/shells-BenrJHp2.mjs +602 -0
  296. package/dist/shells-BenrJHp2.mjs.map +1 -0
  297. package/dist/shells-COHV_Ozf.d.mts +135 -0
  298. package/dist/shells-COHV_Ozf.d.mts.map +1 -0
  299. package/dist/spaces-C27bA-xc.mjs +267 -0
  300. package/dist/spaces-C27bA-xc.mjs.map +1 -0
  301. package/dist/spaces-DxFj5y8l.d.mts +415 -0
  302. package/dist/spaces-DxFj5y8l.d.mts.map +1 -0
  303. package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs +120 -0
  304. package/dist/telemetry-CmbCa3Ld-CmE5zcIG.mjs.map +1 -0
  305. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts +133 -0
  306. package/dist/terminal-ui-BN4QOsm5-Bf3pim46.d.mts.map +1 -0
  307. package/dist/type-expression-safety-CgHTWypx.mjs +8 -0
  308. package/dist/type-expression-safety-CgHTWypx.mjs.map +1 -0
  309. package/dist/types-DZWEs4si-D8UlyJI0.d.mts +893 -0
  310. package/dist/types-DZWEs4si-D8UlyJI0.d.mts.map +1 -0
  311. package/dist/verify-DnVNjc5C-BGdsblBK.mjs +283 -0
  312. package/dist/verify-DnVNjc5C-BGdsblBK.mjs.map +1 -0
  313. package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs +252 -0
  314. package/dist/verify-contract-spaces-BZDcJsuA-De8v4Z4T.mjs.map +1 -0
  315. package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts +136 -0
  316. package/dist/verify-contract-spaces-Cc1u_wJo-BilPJS2S.d.mts.map +1 -0
  317. package/dist/vite-plugin-contract-emit.d.mts +54 -0
  318. package/dist/vite-plugin-contract-emit.d.mts.map +1 -0
  319. package/dist/vite-plugin-contract-emit.mjs +303 -0
  320. package/dist/vite-plugin-contract-emit.mjs.map +1 -0
  321. package/package.json +122 -0
@@ -0,0 +1,415 @@
1
+ import { t as MigrationOps } from "./package-CfWiDNrr-ZR4HM_Iz.mjs";
2
+ import { t as ContractSpaceHeadRecord } from "./verify-contract-spaces-Cc1u_wJo-BilPJS2S.mjs";
3
+ import { APP_SPACE_ID as APP_SPACE_ID$1, ContractSpace, ContractSpaceHeadRef, ContractSpaceHeadRef as ContractSpaceHeadRef$1 } from "@prisma/orm-framework/components/control";
4
+ import { PreserveEmptyPredicate, StorageSort } from "@prisma/orm-framework/contract/hashing";
5
+ import { Contract } from "@prisma/orm-framework/contract/types";
6
+ //#region ../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts
7
+ //#region src/assert-descriptor-self-consistency.d.ts
8
+ /**
9
+ * Inputs the helper needs to recompute the descriptor's storage hash and
10
+ * compare it to the published `headRef.hash`. Kept structural so the SQL
11
+ * family (and any future target family) can compose the check without
12
+ * coupling to its own descriptor types.
13
+ */
14
+ interface DescriptorSelfConsistencyInputs {
15
+ readonly extensionId: string;
16
+ readonly target: string;
17
+ readonly targetFamily: string;
18
+ /**
19
+ * Family-specific storage object. Typed as `unknown` so callers can
20
+ * pass their own narrow storage shape (e.g. `SqlStorage`) without an
21
+ * inline cast — the helper canonicalises through `JSON.stringify`
22
+ * inside {@link computeStorageHash} and only requires a plain
23
+ * record-shaped value at runtime.
24
+ */
25
+ readonly storage: unknown;
26
+ readonly headRefHash: string;
27
+ readonly shouldPreserveEmpty?: PreserveEmptyPredicate;
28
+ readonly sortStorage?: StorageSort;
29
+ }
30
+ /**
31
+ * Assert that an extension descriptor is self-consistent: the
32
+ * `headRef.hash` it publishes must match the canonical hash recomputed
33
+ * from its `contractSpace.contractJson`.
34
+ *
35
+ * Recomputes via {@link computeStorageHash} — the same canonical-JSON
36
+ * pipeline the descriptor's own emit pipeline produced the hash with —
37
+ * over `(target, targetFamily, storage)`. Mismatch indicates the
38
+ * extension author bumped `contractJson` without rerunning emit, leaving
39
+ * the descriptor's `headRef.hash` stale; the consumer-side helpers
40
+ * (drift detection, on-disk artefact emission, runner marker writes) all
41
+ * trust `headRef.hash` as the canonical identity, so a stale value would
42
+ * silently corrupt every downstream boundary.
43
+ *
44
+ * Synchronous, pure, no I/O. Throws
45
+ * `MIGRATION.DESCRIPTOR_HEAD_HASH_MISMATCH` on failure with both the
46
+ * recomputed and published hashes in `details` so callers can surface a
47
+ * clear remediation hint without re-deriving them.
48
+ */
49
+ declare function assertDescriptorSelfConsistency(inputs: DescriptorSelfConsistencyInputs): void;
50
+ //#endregion
51
+ //#region src/read-contract-space-head-ref.d.ts
52
+ /**
53
+ * Read the head ref (`hash` + `invariants`) for a contract space from
54
+ * `<projectMigrationsDir>/<spaceId>/refs/head.json`.
55
+ *
56
+ * Returns `null` when the file does not exist (first emit). Surfaces
57
+ * `MIGRATION.INVALID_JSON` / `MIGRATION.INVALID_REF_FILE` on a corrupt
58
+ * `refs/head.json` so callers can distinguish "no head ref on disk"
59
+ * (returns `null`) from "head ref present but unreadable" (throws).
60
+ *
61
+ * Validates the space id against `[a-z][a-z0-9_-]{0,63}` for the same
62
+ * filesystem-safety reasons as the rest of the per-space helpers. The
63
+ * helper is uniform across the app and extension spaces.
64
+ */
65
+ declare function readContractSpaceHeadRef(projectMigrationsDir: string, spaceId: string): Promise<ContractSpaceHeadRef$1 | null>;
66
+ //#endregion
67
+ //#region src/compute-extension-space-apply-path.d.ts
68
+ /**
69
+ * Outcome of {@link computeExtensionSpaceApplyPath} — a discriminated union
70
+ * mirroring {@link import('./migration-graph').FindPathOutcome} so callers
71
+ * can map structural / invariant failures to their preferred CLI envelope
72
+ * without re-running pathfinding.
73
+ */
74
+ type ExtensionSpaceApplyPathOutcome = {
75
+ readonly kind: 'ok';
76
+ readonly contractSpaceHeadRef: ContractSpaceHeadRef$1;
77
+ /**
78
+ * Sorted, deduplicated invariant ids covered by the walked path.
79
+ * Mirrors the on-disk `providedInvariants` summed across edges and
80
+ * canonicalised — what the runner stamps on the marker after apply.
81
+ */
82
+ readonly providedInvariants: readonly string[];
83
+ /**
84
+ * Path operations in apply order. Empty when the marker is already
85
+ * at the recorded head (no-op).
86
+ */
87
+ readonly pathOps: MigrationOps;
88
+ /**
89
+ * Migration directory names walked, in order. Mirrors `pathOps`'s
90
+ * structure but at the package granularity — useful for surfacing
91
+ * "applied N migration(s)" messages.
92
+ */
93
+ readonly walkedMigrationDirs: readonly string[];
94
+ } | {
95
+ readonly kind: 'unreachable';
96
+ readonly contractSpaceHeadRef: ContractSpaceHeadRef$1;
97
+ } | {
98
+ readonly kind: 'unsatisfiable';
99
+ readonly contractSpaceHeadRef: ContractSpaceHeadRef$1;
100
+ readonly missing: readonly string[];
101
+ readonly structuralPath: readonly {
102
+ readonly dirName: string;
103
+ readonly to: string;
104
+ }[];
105
+ } | {
106
+ readonly kind: 'contractSpaceHeadRefMissing';
107
+ };
108
+ /**
109
+ * Inputs to {@link computeExtensionSpaceApplyPath}. The helper is
110
+ * deliberately framework-neutral and consumes only on-disk state:
111
+ *
112
+ * - `projectMigrationsDir` is the project's top-level `migrations/` dir.
113
+ * - `spaceId` selects the per-space subdirectory under it.
114
+ * - `currentMarkerHash` / `currentMarkerInvariants` come from the live
115
+ * marker row keyed by `space = <spaceId>`. `null` hash = no marker yet
116
+ * (the pathfinder treats this as the empty-contract sentinel per ADR
117
+ * 208).
118
+ */
119
+ interface ComputeExtensionSpaceApplyPathInputs {
120
+ readonly projectMigrationsDir: string;
121
+ readonly spaceId: string;
122
+ readonly currentMarkerHash: string | null;
123
+ readonly currentMarkerInvariants: readonly string[];
124
+ }
125
+ /**
126
+ * Compute the apply path for an extension contract space — the shortest
127
+ * sequence of on-disk migration packages that walks the live marker
128
+ * forward to the on-disk head ref hash, covering every required
129
+ * invariant.
130
+ *
131
+ * Reads only on-disk artifacts (`migrations/<spaceId>/refs/head.json`
132
+ * and the per-space migration packages). **Does not import any
133
+ * extension descriptor module** — `db init` / `db update` must remain
134
+ * runnable without the descriptor source on disk.
135
+ *
136
+ * Behaviour:
137
+ * - Returns `{ kind: 'ok', pathOps: [], … }` when the marker is already
138
+ * at the recorded head and no required invariants are missing.
139
+ * - Returns `{ kind: 'unreachable' }` when the marker hash is not
140
+ * structurally connected to the recorded head in the graph.
141
+ * - Returns `{ kind: 'unsatisfiable', missing, … }` when the marker is
142
+ * reachable but no path covers the required invariants.
143
+ * - Returns `{ kind: 'contractSpaceHeadRefMissing' }` when the per-space
144
+ * `refs/head.json` is absent — the precheck verifier should already
145
+ * have rejected this case, but the helper is defensive so callers can
146
+ * surface a coherent error rather than throw.
147
+ */
148
+ declare function computeExtensionSpaceApplyPath(inputs: ComputeExtensionSpaceApplyPathInputs): Promise<ExtensionSpaceApplyPathOutcome>;
149
+ //#endregion
150
+ //#region src/concatenate-space-apply-inputs.d.ts
151
+ /**
152
+ * Per-space input the runner consumes when applying a migration.
153
+ *
154
+ * The shape is target-agnostic: callers (today the SQL family; later
155
+ * any other family) bind `TOp` to their own per-target operation type
156
+ * (e.g. `SqlMigrationPlanOperation<TTargetDetails>` for the SQL family)
157
+ * and the helper preserves it through the concatenation.
158
+ *
159
+ * - `migrationDirectory` is the on-disk migration directory for the
160
+ * space — `<projectRoot>/migrations/<space-id>` (uniform; the app
161
+ * subspaces under its own `<APP_SPACE_ID>/` directory).
162
+ * - `currentMarkerHash` and `currentMarkerInvariants` are the values
163
+ * read from the `prisma_contract.marker` row keyed by `space = <space-id>`
164
+ * (T1.1). `null` hash = no marker row yet.
165
+ * - `path` is the per-space operation list resolved from
166
+ * `findPathWithDecision(currentMarker, ref.hash, effectiveRequired)`
167
+ * per ADR 208, materialised against the on-disk migration packages.
168
+ *
169
+ * @see specs/framework-mechanism.spec.md § 4 — Runner.
170
+ */
171
+ interface SpaceApplyInput<TOp> {
172
+ readonly spaceId: string;
173
+ readonly migrationDirectory: string;
174
+ readonly currentMarkerHash: string | null;
175
+ readonly currentMarkerInvariants: readonly string[];
176
+ readonly path: readonly TOp[];
177
+ }
178
+ //#endregion
179
+ //#region src/contract-space-from-json.d.ts
180
+ /**
181
+ * Materialise a typed {@link ContractSpace} from the JSON artefacts a
182
+ * contract-space extension package emits to disk.
183
+ *
184
+ * Extension descriptors wire `contract.json`, per-migration
185
+ * `migration.json` / `ops.json`, and `refs/head.json` to the framework's
186
+ * typed surfaces. TypeScript widens JSON imports to a structural record
187
+ * that does not preserve readonly modifiers or branded scalars (e.g.
188
+ * `StorageHashBase<'abc123...'>`), so authoring the descriptor inline
189
+ * forces every wiring site to cast through `unknown`. This helper
190
+ * encapsulates the single narrowing point: descriptor sources stay
191
+ * cast-free, and the (necessary) coercion is colocated with the
192
+ * documentation explaining why it is safe.
193
+ *
194
+ * Safety: the JSON files passed here are produced by the framework's own
195
+ * emit pipeline (`prisma-next contract emit` and `MigrationCLI.run`)
196
+ * and re-validated downstream by the runner / verifier. The descriptor
197
+ * is a pass-through wiring layer — no descriptor consumer treats the
198
+ * narrowed types as a stronger guarantee than "these came from the
199
+ * canonical emit pipeline".
200
+ *
201
+ * The helper does not introspect or schema-validate the inputs; runtime
202
+ * validation is the responsibility of `family.deserializeContract`
203
+ * (codec-aware, invoked at control-stack construction) and the
204
+ * per-migration `readMigrationPackage` reader used when loading
205
+ * from disk. JSON-imported packages flow through the descriptor without
206
+ * a disk read, so the equivalent runtime guarantee comes from the emit
207
+ * pipeline that produced the JSON in the first place.
208
+ */
209
+ declare function contractSpaceFromJson<TContract extends Contract = Contract>(inputs: {
210
+ readonly contractJson: unknown;
211
+ readonly migrations: ReadonlyArray<{
212
+ readonly dirName: string;
213
+ readonly metadata: unknown;
214
+ readonly ops: unknown;
215
+ }>;
216
+ readonly headRef: ContractSpaceHeadRef;
217
+ }): ContractSpace<TContract>;
218
+ //#endregion
219
+ //#region src/emit-contract-space-artifacts.d.ts
220
+ /**
221
+ * Inputs for {@link emitContractSpaceArtifacts}.
222
+ *
223
+ * - `contract` is the canonical contract value the framework just emitted
224
+ * for the space; it is serialised through {@link canonicalizeJson}, so
225
+ * it must be a JSON-compatible value (objects / arrays / primitives).
226
+ * Typed as `unknown` rather than the SQL-family `Contract<SqlStorage>`
227
+ * to keep `migration-tools` framework-neutral; SQL-family callers pass
228
+ * their typed value through unchanged.
229
+ *
230
+ * - `contractDts` is the pre-rendered `.d.ts` text. Rendering happens in
231
+ * the SQL family (which owns the codec / typemap input the renderer
232
+ * needs), so this helper accepts the text verbatim and writes it out
233
+ * without further transformation.
234
+ *
235
+ * - `headRef` is the head reference for the space.
236
+ * `invariants` are sorted alphabetically before serialisation so two
237
+ * callers passing the same set in different orders produce
238
+ * byte-identical `refs/head.json`.
239
+ */
240
+ interface ContractSpaceArtifactInputs {
241
+ readonly contract: unknown;
242
+ readonly contractDts: string;
243
+ readonly headRef: ContractSpaceHeadRef$1;
244
+ }
245
+ /**
246
+ * Emit the per-space artifacts — the head contract snapshot (written into
247
+ * the migrations-root-wide `snapshots/` store, keyed by `headRef.hash`) and
248
+ * `refs/head.json` — under `<projectMigrationsDir>/<spaceId>/`.
249
+ *
250
+ * The head contract snapshot is write-if-absent (see
251
+ * {@link writeContractSnapshot}): a changed extension contract has a new
252
+ * hash, so it lands as a new store entry; an unchanged hash means identical
253
+ * canonical content already sits there. `refs/head.json` stays
254
+ * always-overwrite: the framework owns it, so running `migrate` twice with
255
+ * the same inputs is a no-op observably (idempotent), but the helper does
256
+ * not check pre-existing contents — re-emit always wins.
257
+ *
258
+ * Path layout matches the convention in
259
+ * [`spaceMigrationDirectory`](./space-layout.ts). The space id is
260
+ * validated against `[a-z][a-z0-9_-]{0,63}` via
261
+ * {@link assertValidSpaceId} for filesystem-safety reasons; the helper
262
+ * accepts every space uniformly (including the app space, default
263
+ * `'app'`).
264
+ *
265
+ * The migrations directory and space subdirectory are created if they
266
+ * do not yet exist (`mkdir { recursive: true }`).
267
+ */
268
+ declare function emitContractSpaceArtifacts(projectMigrationsDir: string, spaceId: string, inputs: ContractSpaceArtifactInputs): Promise<void>;
269
+ //#endregion
270
+ //#region src/gather-disk-contract-space-state.d.ts
271
+ /**
272
+ * Disk-side inputs to {@link import('./verify-contract-spaces').verifyContractSpaces}
273
+ * — gathered without touching the live database. The caller composes
274
+ * this with the marker rows it reads from the runtime to invoke the
275
+ * verifier.
276
+ */
277
+ interface DiskContractSpaceState {
278
+ /** Contract-space directory names observed under `<projectMigrationsDir>/`. */
279
+ readonly spaceDirsOnDisk: readonly string[];
280
+ /** Head-ref `(hash, invariants)` per extension space. */
281
+ readonly headRefsBySpace: ReadonlyMap<string, ContractSpaceHeadRecord>;
282
+ }
283
+ /**
284
+ * Read the on-disk state the per-space verifier needs:
285
+ *
286
+ * - The list of contract-space directories under
287
+ * `<projectMigrationsDir>/` (via
288
+ * {@link import('./verify-contract-spaces').listContractSpaceDirectories}).
289
+ * - The on-disk head ref `(hash, invariants)` for each declared extension space
290
+ * (via {@link readContractSpaceHeadRef}; missing on-disk artefacts are simply
291
+ * omitted — the verifier reports them as `declaredButUnmigrated`).
292
+ *
293
+ * Synchronous in spirit but async due to filesystem reads. Reads only
294
+ * the user's repo. **Does not import any extension descriptor module.**
295
+ *
296
+ * Composition convention: pure target-agnostic primitive in
297
+ * `1-framework`; the SQL family (and any future target family) wires
298
+ * it into its `dbInit` / `verify` flows alongside its own marker-row
299
+ * read before invoking `verifyContractSpaces`.
300
+ */
301
+ declare function gatherDiskContractSpaceState(args: {
302
+ readonly projectMigrationsDir: string;
303
+ /**
304
+ * Set of space ids the project declares: `'app'` plus each entry in
305
+ * `extensions` whose descriptor exposes a `contractSpace`. The
306
+ * helper reads on-disk head data only for the extension spaces.
307
+ */
308
+ readonly loadedSpaceIds: ReadonlySet<string>;
309
+ }): Promise<DiskContractSpaceState>;
310
+ //#endregion
311
+ //#region src/plan-all-spaces.d.ts
312
+ /**
313
+ * Per-space input for {@link planAllSpaces}. One entry per loaded
314
+ * contract space (the application's `'app'` plus each extension that
315
+ * exposes a `contractSpace`).
316
+ *
317
+ * - `priorContract` is `null` for a space that has never been emitted
318
+ * (no `migrations/<space-id>/contract.json` on disk yet); otherwise it
319
+ * is the canonical contract value emitted for that space.
320
+ * - `newContract` is the canonical contract value the planner is about
321
+ * to emit for that space — for app-space, the just-emitted root
322
+ * `contract.json`; for an extension space, the descriptor's
323
+ * `contractSpace.contractJson`.
324
+ */
325
+ interface SpacePlanInput<TContract> {
326
+ readonly spaceId: string;
327
+ readonly priorContract: TContract | null;
328
+ readonly newContract: TContract;
329
+ }
330
+ interface SpacePlanOutput<TPackage> {
331
+ readonly spaceId: string;
332
+ readonly migrationPackages: readonly TPackage[];
333
+ }
334
+ /**
335
+ * Iterate the per-space planner across a set of loaded contract spaces
336
+ * and return a deterministic shape regardless of declaration order.
337
+ *
338
+ * Behaviour:
339
+ *
340
+ * - The output is sorted alphabetically by `spaceId`. Two callers
341
+ * passing the same set of inputs in different orders observe
342
+ * byte-identical outputs.
343
+ * - The per-space planner (`planSpace`) is called exactly once per
344
+ * input, in alphabetical-by-spaceId order. Its return value is
345
+ * attached to the corresponding output entry verbatim.
346
+ * - Duplicate `spaceId`s in the input array throw
347
+ * `MIGRATION.DUPLICATE_SPACE_ID` before any `planSpace` call runs,
348
+ * keeping the planner pure when the input is malformed.
349
+ *
350
+ * The signature is generic over `TContract` and `TPackage` because the
351
+ * shape is framework-neutral (SQL family today, Mongo family
352
+ * eventually). Callers wire in whatever contract value and migration
353
+ * package shape their family already speaks.
354
+ *
355
+ * Synchronous: the underlying per-space planner (target's
356
+ * `MigrationPlanner.plan(...)`) is synchronous; callers that need to
357
+ * resolve async I/O (e.g. reading on-disk `contract.json` from disk)
358
+ * resolve it before calling `planAllSpaces` and pass the materialised
359
+ * inputs through.
360
+ */
361
+ declare function planAllSpaces<TContract, TPackage>(inputs: readonly SpacePlanInput<TContract>[], planSpace: (input: SpacePlanInput<TContract>) => readonly TPackage[]): readonly SpacePlanOutput<TPackage>[];
362
+ //#endregion
363
+ //#region src/space-layout.d.ts
364
+ /**
365
+ * Branded string carrying a compile-time guarantee that the value has
366
+ * been validated by {@link assertValidSpaceId}. Downstream filesystem
367
+ * helpers (e.g. {@link spaceMigrationDirectory}) accept this type to
368
+ * make "validated" tracking visible at the type level rather than
369
+ * relying purely on a runtime check.
370
+ */
371
+ type ValidSpaceId = string & {
372
+ readonly __brand: 'ValidSpaceId';
373
+ };
374
+ declare function isValidSpaceId(spaceId: string): spaceId is ValidSpaceId;
375
+ declare function assertValidSpaceId(spaceId: string): asserts spaceId is ValidSpaceId;
376
+ /**
377
+ * Resolve the migrations subdirectory for a given contract space.
378
+ *
379
+ * Every contract space — including the app space (default `'app'`) —
380
+ * lands under `<projectMigrationsDir>/<spaceId>/`. The space id is
381
+ * validated against {@link SPACE_ID_PATTERN} because it becomes a
382
+ * filesystem directory name verbatim.
383
+ *
384
+ * `projectMigrationsDir` is the project's top-level `migrations/`
385
+ * directory; the helper does not assume anything about its absolute /
386
+ * relative shape and is symmetric with `pathe.join`.
387
+ */
388
+ declare function spaceMigrationDirectory(projectMigrationsDir: string, spaceId: string): string;
389
+ /**
390
+ * Per-space subdirectory name reserved for the ref store
391
+ * (`migrations/<space>/<SPACE_REFS_DIRNAME>/*.json`). Single source of
392
+ * truth: every helper that composes a per-space refs path imports this
393
+ * constant, and the enumerator uses it (via
394
+ * {@link RESERVED_SPACE_SUBDIR_NAMES}) to exclude reserved names from
395
+ * the contract-space candidate list.
396
+ */
397
+ declare const SPACE_REFS_DIRNAME = "refs";
398
+ /**
399
+ * Names reserved under `migrations/` that must never be enumerated as a
400
+ * phantom contract space: `SPACE_REFS_DIRNAME` (e.g. a top-level
401
+ * `migrations/refs/` left in the wrong place) and
402
+ * `CONTRACT_SNAPSHOTS_DIRNAME` (the migrations-root-wide contract
403
+ * snapshot store, `migrations/snapshots/`).
404
+ */
405
+ declare const RESERVED_SPACE_SUBDIR_NAMES: ReadonlySet<string>;
406
+ /**
407
+ * Resolve the per-space refs directory for `spaceMigrationsDir`
408
+ * (typically the value returned by {@link spaceMigrationDirectory}).
409
+ * Composes the canonical {@link SPACE_REFS_DIRNAME} so callers do not
410
+ * hard-code the literal.
411
+ */
412
+ declare function spaceRefsDirectory(spaceMigrationsDir: string): string;
413
+ //#endregion
414
+ export { spaceMigrationDirectory as C, readContractSpaceHeadRef as S, contractSpaceFromJson as _, DescriptorSelfConsistencyInputs as a, isValidSpaceId as b, RESERVED_SPACE_SUBDIR_NAMES as c, SpacePlanInput as d, SpacePlanOutput as f, computeExtensionSpaceApplyPath as g, assertValidSpaceId as h, ContractSpaceHeadRef$1 as i, SPACE_REFS_DIRNAME as l, assertDescriptorSelfConsistency as m, ComputeExtensionSpaceApplyPathInputs as n, DiskContractSpaceState as o, ValidSpaceId as p, ContractSpaceArtifactInputs as r, ExtensionSpaceApplyPathOutcome as s, APP_SPACE_ID$1 as t, SpaceApplyInput as u, emitContractSpaceArtifacts as v, spaceRefsDirectory as w, planAllSpaces as x, gatherDiskContractSpaceState as y };
415
+ //# sourceMappingURL=spaces-DxFj5y8l.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spaces-DxFj5y8l.d.mts","names":[],"sources":["../../../../1-framework/3-tooling/migration/dist/exports/spaces.d.mts"],"mappings":";;;;;;;;;;;;;UAYU;WACC;WACA;WACA;;;;;;;;WAQA;WACA;WACA,sBAAsB;WACtB,cAAc;;;;;;;;;;;;;;;;;;;;;iBAqBR,gCAAgC,QAAQ;;;;;;;;;;;;;;;;iBAgBxC,yBAAyB,8BAA8B,kBAAkB,QAAQ;;;;;;;;;KAS7F;WACM;WACA,sBAAsB;;;;;;WAMtB;;;;;WAKA,SAAS;;;;;;WAMT;;WAEA;WACA,sBAAsB;;WAEtB;WACA,sBAAsB;WACtB;WACA;aACE;aACA;;;WAGF;;;;;;;;;;;;;UAaD;WACC;WACA;WACA;WACA;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBM,+BAA+B,QAAQ,uCAAuC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;UAuB7F,gBAAgB;WACf;WACA;WACA;WACA;WACA,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCT,sBAAsB,kBAAkB,WAAW,UAAU;WACnE;WACA,YAAY;aACV;aACA;aACA;;WAEF,SAAS;IAChB,cAAc;;;;;;;;;;;;;;;;;;;;;;;UAuBR;WACC;WACA;WACA,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBH,2BAA2B,8BAA8B,iBAAiB,QAAQ,8BAA8B;;;;;;;;;UASvH;;WAEC;;WAEA,iBAAiB,oBAAoB;;;;;;;;;;;;;;;;;;;;iBAoB/B,6BAA6B;WACnC;;;;;;WAMA,gBAAgB;IACvB,QAAQ;;;;;;;;;;;;;;;;UAgBF,eAAe;WACd;WACA,eAAe;WACf,aAAa;;UAEd,gBAAgB;WACf;WACA,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA6BtB,cAAc,WAAW,UAAU,iBAAiB,eAAe,cAAc,YAAY,OAAO,eAAe,wBAAwB,sBAAsB,gBAAgB;;;;;;;;;;KAU7L;WACM;;iBAEM,eAAe,kBAAkB,WAAW;iBAC5C,mBAAmB,0BAA0B,WAAW;;;;;;;;;;;;;iBAaxD,wBAAwB,8BAA8B;;;;;;;;;cASzD;;;;;;;;cAQA,6BAA6B;;;;;;;iBAO1B,mBAAmB"}
@@ -0,0 +1,120 @@
1
+ import { P as formatCommandHelp, Y as isCI$1, ct as setCommandExamples, et as parseGlobalFlags, o as createTerminalUI, r as addGlobalOptions, st as setCommandDescriptions, tt as parseGlobalFlagsOrExit } from "./command-helpers-CAoXqAY9-DWUBcTXM.mjs";
2
+ import { a as resolveGating, d as writeUserConfig, i as readUserConfig, u as userConfigPath } from "./exports-BN0vFTxG.mjs";
3
+ import { Command } from "commander";
4
+ //#region ../../../1-framework/3-tooling/cli/dist/telemetry-CmbCa3Ld.mjs
5
+ /**
6
+ * Resolves the same gate the runtime uses (CI check + `resolveGating`) and
7
+ * projects it into a user-facing status. Pure read: never mints, never
8
+ * writes. The `installationId` value itself is never surfaced — only its
9
+ * presence — so `status` discloses nothing identifying.
10
+ */
11
+ function resolveTelemetryStatus(inputs) {
12
+ const config = readUserConfig();
13
+ const configPath = userConfigPath();
14
+ const installationIdStored = typeof config.installationId === "string" && config.installationId.length > 0;
15
+ if (inputs.inCI) return {
16
+ enabled: false,
17
+ reason: "ci",
18
+ configPath,
19
+ installationIdStored
20
+ };
21
+ const gating = resolveGating({
22
+ env: inputs.env,
23
+ config
24
+ });
25
+ if (!gating.enabled) return {
26
+ enabled: false,
27
+ reason: gating.reason === "env-override" ? "env-opt-out" : "stored-opt-out",
28
+ configPath,
29
+ installationIdStored
30
+ };
31
+ return {
32
+ enabled: true,
33
+ reason: config.enableTelemetry === true ? "stored-opt-in" : "default-on",
34
+ configPath,
35
+ installationIdStored
36
+ };
37
+ }
38
+ const REASON_EXPLANATION = {
39
+ ci: "CI environment detected — telemetry is hard-disabled.",
40
+ "env-opt-out": "an environment opt-out is set (DO_NOT_TRACK / PRISMA_NEXT_DISABLE_TELEMETRY).",
41
+ "stored-opt-out": "\"enableTelemetry\": false is stored in your config.",
42
+ "stored-opt-in": "\"enableTelemetry\": true is stored in your config.",
43
+ "default-on": "no explicit choice is stored, so the opt-out default applies."
44
+ };
45
+ function formatTelemetryStatusLines(status) {
46
+ return [
47
+ `Telemetry is ${status.enabled ? "enabled" : "disabled"}: ${REASON_EXPLANATION[status.reason]}`,
48
+ `Config file: ${status.configPath}`,
49
+ `Installation ID: ${status.installationIdStored ? "stored" : "not stored"}`
50
+ ];
51
+ }
52
+ function createTelemetryStatusCommand() {
53
+ const command = new Command("status");
54
+ setCommandDescriptions(command, "Show whether anonymous CLI telemetry is enabled and why", "Reports whether telemetry is currently enabled or disabled and the reason\n(default-on, stored opt-out, environment opt-out, or CI), the path to your\nuser-level config file, and whether an installation ID has been stored.\nRead-only: never sends an event, never mints an ID, never writes anything.");
55
+ return addGlobalOptions(command).action((options) => {
56
+ const flags = parseGlobalFlagsOrExit(options);
57
+ const ui = createTerminalUI(flags);
58
+ const status = resolveTelemetryStatus({
59
+ env: process.env,
60
+ inCI: isCI$1()
61
+ });
62
+ if (flags.json) ui.output(JSON.stringify(status));
63
+ else for (const line of formatTelemetryStatusLines(status)) ui.output(line);
64
+ process.exit(0);
65
+ });
66
+ }
67
+ function createTelemetryEnableCommand() {
68
+ const command = new Command("enable");
69
+ setCommandDescriptions(command, "Enable anonymous CLI telemetry", "Stores \"enableTelemetry\": true in your user-level config and mints an\ninstallation ID if one is not already stored.");
70
+ return addGlobalOptions(command).action((options) => {
71
+ const flags = parseGlobalFlagsOrExit(options);
72
+ writeUserConfig({ enableTelemetry: true });
73
+ const ui = createTerminalUI(flags);
74
+ if (flags.json) ui.output(JSON.stringify({
75
+ enableTelemetry: true,
76
+ configPath: userConfigPath()
77
+ }));
78
+ else ui.output(`Telemetry enabled. Preference stored in ${userConfigPath()}.`);
79
+ process.exit(0);
80
+ });
81
+ }
82
+ function createTelemetryDisableCommand() {
83
+ const command = new Command("disable");
84
+ setCommandDescriptions(command, "Disable anonymous CLI telemetry", "Stores \"enableTelemetry\": false in your user-level config. No installation\nID is minted and no event is sent.");
85
+ return addGlobalOptions(command).action((options) => {
86
+ const flags = parseGlobalFlagsOrExit(options);
87
+ writeUserConfig({ enableTelemetry: false });
88
+ const ui = createTerminalUI(flags);
89
+ if (flags.json) ui.output(JSON.stringify({
90
+ enableTelemetry: false,
91
+ configPath: userConfigPath()
92
+ }));
93
+ else ui.output(`Telemetry disabled. Preference stored in ${userConfigPath()}.`);
94
+ process.exit(0);
95
+ });
96
+ }
97
+ function createTelemetryCommand() {
98
+ const command = new Command("telemetry");
99
+ setCommandDescriptions(command, "Inspect and change anonymous CLI telemetry", "Show telemetry status, or enable / disable anonymous CLI usage data.\nTelemetry is on by default (opt-out); see https://prisma-next.dev/docs/cli/telemetry\nfor what is collected and why.");
100
+ setCommandExamples(command, [
101
+ "prisma-next telemetry status",
102
+ "prisma-next telemetry disable",
103
+ "prisma-next telemetry enable"
104
+ ]);
105
+ command.configureHelp({
106
+ formatHelp: (cmd) => formatCommandHelp({
107
+ command: cmd,
108
+ flags: parseGlobalFlags({})
109
+ }),
110
+ subcommandDescription: () => ""
111
+ });
112
+ command.addCommand(createTelemetryStatusCommand());
113
+ command.addCommand(createTelemetryEnableCommand());
114
+ command.addCommand(createTelemetryDisableCommand());
115
+ return command;
116
+ }
117
+ //#endregion
118
+ export { createTelemetryCommand as t };
119
+
120
+ //# sourceMappingURL=telemetry-CmbCa3Ld-CmE5zcIG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry-CmbCa3Ld-CmE5zcIG.mjs","names":["isCI"],"sources":["../../../../1-framework/3-tooling/cli/dist/telemetry-CmbCa3Ld.mjs"],"sourcesContent":["import { D as isCI, O as formatCommandHelp, _ as createTerminalUI, g as parseGlobalFlagsOrExit, h as parseGlobalFlags, l as setCommandDescriptions, t as addGlobalOptions, u as setCommandExamples } from \"./command-helpers-CAoXqAY9.mjs\";\nimport { Command } from \"commander\";\nimport { readUserConfig, resolveGating, userConfigPath, writeUserConfig } from \"@internal/cli-telemetry\";\n//#region src/commands/telemetry/status.ts\n/**\n* Resolves the same gate the runtime uses (CI check + `resolveGating`) and\n* projects it into a user-facing status. Pure read: never mints, never\n* writes. The `installationId` value itself is never surfaced — only its\n* presence — so `status` discloses nothing identifying.\n*/\nfunction resolveTelemetryStatus(inputs) {\n\tconst config = readUserConfig();\n\tconst configPath = userConfigPath();\n\tconst installationIdStored = typeof config.installationId === \"string\" && config.installationId.length > 0;\n\tif (inputs.inCI) return {\n\t\tenabled: false,\n\t\treason: \"ci\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n\tconst gating = resolveGating({\n\t\tenv: inputs.env,\n\t\tconfig\n\t});\n\tif (!gating.enabled) return {\n\t\tenabled: false,\n\t\treason: gating.reason === \"env-override\" ? \"env-opt-out\" : \"stored-opt-out\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n\treturn {\n\t\tenabled: true,\n\t\treason: config.enableTelemetry === true ? \"stored-opt-in\" : \"default-on\",\n\t\tconfigPath,\n\t\tinstallationIdStored\n\t};\n}\nconst REASON_EXPLANATION = {\n\tci: \"CI environment detected — telemetry is hard-disabled.\",\n\t\"env-opt-out\": \"an environment opt-out is set (DO_NOT_TRACK / PRISMA_NEXT_DISABLE_TELEMETRY).\",\n\t\"stored-opt-out\": \"\\\"enableTelemetry\\\": false is stored in your config.\",\n\t\"stored-opt-in\": \"\\\"enableTelemetry\\\": true is stored in your config.\",\n\t\"default-on\": \"no explicit choice is stored, so the opt-out default applies.\"\n};\nfunction formatTelemetryStatusLines(status) {\n\treturn [\n\t\t`Telemetry is ${status.enabled ? \"enabled\" : \"disabled\"}: ${REASON_EXPLANATION[status.reason]}`,\n\t\t`Config file: ${status.configPath}`,\n\t\t`Installation ID: ${status.installationIdStored ? \"stored\" : \"not stored\"}`\n\t];\n}\n//#endregion\n//#region src/commands/telemetry/index.ts\nfunction createTelemetryStatusCommand() {\n\tconst command = new Command(\"status\");\n\tsetCommandDescriptions(command, \"Show whether anonymous CLI telemetry is enabled and why\", \"Reports whether telemetry is currently enabled or disabled and the reason\\n(default-on, stored opt-out, environment opt-out, or CI), the path to your\\nuser-level config file, and whether an installation ID has been stored.\\nRead-only: never sends an event, never mints an ID, never writes anything.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\tconst ui = createTerminalUI(flags);\n\t\tconst status = resolveTelemetryStatus({\n\t\t\tenv: process.env,\n\t\t\tinCI: isCI()\n\t\t});\n\t\tif (flags.json) ui.output(JSON.stringify(status));\n\t\telse for (const line of formatTelemetryStatusLines(status)) ui.output(line);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryEnableCommand() {\n\tconst command = new Command(\"enable\");\n\tsetCommandDescriptions(command, \"Enable anonymous CLI telemetry\", \"Stores \\\"enableTelemetry\\\": true in your user-level config and mints an\\ninstallation ID if one is not already stored.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\twriteUserConfig({ enableTelemetry: true });\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (flags.json) ui.output(JSON.stringify({\n\t\t\tenableTelemetry: true,\n\t\t\tconfigPath: userConfigPath()\n\t\t}));\n\t\telse ui.output(`Telemetry enabled. Preference stored in ${userConfigPath()}.`);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryDisableCommand() {\n\tconst command = new Command(\"disable\");\n\tsetCommandDescriptions(command, \"Disable anonymous CLI telemetry\", \"Stores \\\"enableTelemetry\\\": false in your user-level config. No installation\\nID is minted and no event is sent.\");\n\treturn addGlobalOptions(command).action((options) => {\n\t\tconst flags = parseGlobalFlagsOrExit(options);\n\t\twriteUserConfig({ enableTelemetry: false });\n\t\tconst ui = createTerminalUI(flags);\n\t\tif (flags.json) ui.output(JSON.stringify({\n\t\t\tenableTelemetry: false,\n\t\t\tconfigPath: userConfigPath()\n\t\t}));\n\t\telse ui.output(`Telemetry disabled. Preference stored in ${userConfigPath()}.`);\n\t\tprocess.exit(0);\n\t});\n}\nfunction createTelemetryCommand() {\n\tconst command = new Command(\"telemetry\");\n\tsetCommandDescriptions(command, \"Inspect and change anonymous CLI telemetry\", \"Show telemetry status, or enable / disable anonymous CLI usage data.\\nTelemetry is on by default (opt-out); see https://prisma-next.dev/docs/cli/telemetry\\nfor what is collected and why.\");\n\tsetCommandExamples(command, [\n\t\t\"prisma-next telemetry status\",\n\t\t\"prisma-next telemetry disable\",\n\t\t\"prisma-next telemetry enable\"\n\t]);\n\tcommand.configureHelp({\n\t\tformatHelp: (cmd) => formatCommandHelp({\n\t\t\tcommand: cmd,\n\t\t\tflags: parseGlobalFlags({})\n\t\t}),\n\t\tsubcommandDescription: () => \"\"\n\t});\n\tcommand.addCommand(createTelemetryStatusCommand());\n\tcommand.addCommand(createTelemetryEnableCommand());\n\tcommand.addCommand(createTelemetryDisableCommand());\n\treturn command;\n}\n//#endregion\nexport { createTelemetryCommand as t };\n\n//# sourceMappingURL=telemetry-CmbCa3Ld.mjs.map"],"mappings":";;;;;;;;;;AAUA,SAAS,uBAAuB,QAAQ;CACvC,MAAM,SAAS,eAAe;CAC9B,MAAM,aAAa,eAAe;CAClC,MAAM,uBAAuB,OAAO,OAAO,mBAAmB,YAAY,OAAO,eAAe,SAAS;CACzG,IAAI,OAAO,MAAM,OAAO;EACvB,SAAS;EACT,QAAQ;EACR;EACA;CACD;CACA,MAAM,SAAS,cAAc;EAC5B,KAAK,OAAO;EACZ;CACD,CAAC;CACD,IAAI,CAAC,OAAO,SAAS,OAAO;EAC3B,SAAS;EACT,QAAQ,OAAO,WAAW,iBAAiB,gBAAgB;EAC3D;EACA;CACD;CACA,OAAO;EACN,SAAS;EACT,QAAQ,OAAO,oBAAoB,OAAO,kBAAkB;EAC5D;EACA;CACD;AACD;AACA,MAAM,qBAAqB;CAC1B,IAAI;CACJ,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,cAAc;AACf;AACA,SAAS,2BAA2B,QAAQ;CAC3C,OAAO;EACN,gBAAgB,OAAO,UAAU,YAAY,WAAW,IAAI,mBAAmB,OAAO;EACtF,gBAAgB,OAAO;EACvB,oBAAoB,OAAO,uBAAuB,WAAW;CAC9D;AACD;AAGA,SAAS,+BAA+B;CACvC,MAAM,UAAU,IAAI,QAAQ,QAAQ;CACpC,uBAAuB,SAAS,2DAA2D,4SAA4S;CACvY,OAAO,iBAAiB,OAAO,CAAC,CAAC,QAAQ,YAAY;EACpD,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,MAAM,KAAK,iBAAiB,KAAK;EACjC,MAAM,SAAS,uBAAuB;GACrC,KAAK,QAAQ;GACb,MAAMA,OAAK;EACZ,CAAC;EACD,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU,MAAM,CAAC;OAC3C,KAAK,MAAM,QAAQ,2BAA2B,MAAM,GAAG,GAAG,OAAO,IAAI;EAC1E,QAAQ,KAAK,CAAC;CACf,CAAC;AACF;AACA,SAAS,+BAA+B;CACvC,MAAM,UAAU,IAAI,QAAQ,QAAQ;CACpC,uBAAuB,SAAS,kCAAkC,wHAAwH;CAC1L,OAAO,iBAAiB,OAAO,CAAC,CAAC,QAAQ,YAAY;EACpD,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,gBAAgB,EAAE,iBAAiB,KAAK,CAAC;EACzC,MAAM,KAAK,iBAAiB,KAAK;EACjC,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU;GACxC,iBAAiB;GACjB,YAAY,eAAe;EAC5B,CAAC,CAAC;OACG,GAAG,OAAO,2CAA2C,eAAe,EAAE,EAAE;EAC7E,QAAQ,KAAK,CAAC;CACf,CAAC;AACF;AACA,SAAS,gCAAgC;CACxC,MAAM,UAAU,IAAI,QAAQ,SAAS;CACrC,uBAAuB,SAAS,mCAAmC,kHAAkH;CACrL,OAAO,iBAAiB,OAAO,CAAC,CAAC,QAAQ,YAAY;EACpD,MAAM,QAAQ,uBAAuB,OAAO;EAC5C,gBAAgB,EAAE,iBAAiB,MAAM,CAAC;EAC1C,MAAM,KAAK,iBAAiB,KAAK;EACjC,IAAI,MAAM,MAAM,GAAG,OAAO,KAAK,UAAU;GACxC,iBAAiB;GACjB,YAAY,eAAe;EAC5B,CAAC,CAAC;OACG,GAAG,OAAO,4CAA4C,eAAe,EAAE,EAAE;EAC9E,QAAQ,KAAK,CAAC;CACf,CAAC;AACF;AACA,SAAS,yBAAyB;CACjC,MAAM,UAAU,IAAI,QAAQ,WAAW;CACvC,uBAAuB,SAAS,8CAA8C,4LAA4L;CAC1Q,mBAAmB,SAAS;EAC3B;EACA;EACA;CACD,CAAC;CACD,QAAQ,cAAc;EACrB,aAAa,QAAQ,kBAAkB;GACtC,SAAS;GACT,OAAO,iBAAiB,CAAC,CAAC;EAC3B,CAAC;EACD,6BAA6B;CAC9B,CAAC;CACD,QAAQ,WAAW,6BAA6B,CAAC;CACjD,QAAQ,WAAW,6BAA6B,CAAC;CACjD,QAAQ,WAAW,8BAA8B,CAAC;CAClD,OAAO;AACR"}