@prisma/orm-toolchain 0.16.0-dev.36

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-CcG-fB8r-CDs5C9vt.mjs +597 -0
  191. package/dist/migration-check-CcG-fB8r-CDs5C9vt.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-CFlzlRmu-DewBN8Ys.mjs +444 -0
  217. package/dist/migration-status-CFlzlRmu-DewBN8Ys.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-CeGMYFYX-h3OcU__O.d.mts +192 -0
  292. package/dist/schemas-CeGMYFYX-h3OcU__O.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 +127 -0
@@ -0,0 +1,893 @@
1
+ import "./ref-resolution-COGOSL57.mjs";
2
+ import { CliStructuredError as CliStructuredError$1 } from "@prisma/orm-framework/errors/control";
3
+ import { Result } from "@prisma/orm-framework/utils/result";
4
+ import { ControlAdapterDescriptor, ControlDriverDescriptor, ControlDriverInstance, ControlExtensionDescriptor, ControlFamilyDescriptor, ControlFamilyInstance, ControlTargetDescriptor, CoreSchemaView, MigrationPlanOperation, MigrationPlannerConflict, OperationPreview, SignDatabaseResult, VerifyDatabaseResult, VerifyDatabaseSchemaResult } from "@prisma/orm-framework/components/control";
5
+ import "@prisma/orm-framework/errors/execution";
6
+ import "@prisma/orm-framework/errors/migration";
7
+ import { TargetBoundComponentDescriptor } from "@prisma/orm-framework/components/components";
8
+ import { ContractSourceDiagnostics, ContractSourceProvider } from "@prisma/orm-framework/config/config-types";
9
+ import { Contract, ContractMarkerRecord, LedgerEntryRecord } from "@prisma/orm-framework/contract/types";
10
+ import { AuthoringPslBlockDescriptorNamespace } from "@prisma/orm-framework/components/authoring";
11
+ import { PslDocumentAst } from "@prisma/orm-framework/components/psl-ast";
12
+ //#region ../../../1-framework/3-tooling/cli/dist/types-DZWEs4si.d.mts
13
+ //#region src/control-api/operations/db-verify.d.ts
14
+ /**
15
+ * Inputs for the aggregate `db verify` operation.
16
+ *
17
+ * Loader → verifier pipeline. The loader (sole descriptor-import
18
+ * boundary) builds a {@link import('@prisma/orm-toolchain/migration-tools/aggregate').ContractSpaceAggregate};
19
+ * the aggregate verifier bundles `markerCheck` + per-space `schemaCheck`
20
+ * (each contract space verified against the full schema; extras stripped to its own view).
21
+ * `mode: 'strict' | 'lenient'` maps directly to the user facing `--strict` flag.
22
+ */
23
+ interface ExecuteDbVerifyOptions<TFamilyId extends string, TTargetId extends string> {
24
+ readonly driver: ControlDriverInstance<TFamilyId, TTargetId>;
25
+ readonly familyInstance: ControlFamilyInstance<TFamilyId, unknown>;
26
+ readonly contract: Contract;
27
+ readonly migrationsDir: string;
28
+ readonly targetId: TTargetId;
29
+ readonly extensions: ReadonlyArray<ControlExtensionDescriptor<TFamilyId, TTargetId>>;
30
+ readonly frameworkComponents: ReadonlyArray<TargetBoundComponentDescriptor<TFamilyId, TTargetId>>;
31
+ readonly mode: 'strict' | 'lenient';
32
+ readonly skipSchema: boolean;
33
+ readonly skipMarker: boolean;
34
+ readonly onProgress?: OnControlProgress;
35
+ }
36
+ /**
37
+ * Result of the aggregate verify operation.
38
+ *
39
+ * Marker-check failures are surfaced as a {@link CliStructuredError}
40
+ * (same envelope code `5002` the legacy `runContractSpaceVerifierMarkerCheck`
41
+ * emitted, so downstream tooling and integration tests assert on the
42
+ * same shape).
43
+ *
44
+ * On success, the per-space verify results are returned for the CLI to
45
+ * render. When `skipSchema` is true (`--marker-only`), the schema map
46
+ * is empty.
47
+ */
48
+ interface ExecuteDbVerifySuccess {
49
+ readonly schemaResults: ReadonlyMap<string, VerifyDatabaseSchemaResult>;
50
+ /**
51
+ * Live element names no contract space declares, deduplicated and reported
52
+ * once for the whole database (never per space). Strict mode fails on a
53
+ * non-empty list; lenient mode surfaces it informationally.
54
+ */
55
+ readonly unclaimed: readonly string[];
56
+ readonly spaceOrder: readonly string[];
57
+ readonly appSpaceId: string;
58
+ }
59
+ type ExecuteDbVerifyResult = Result<ExecuteDbVerifySuccess, CliStructuredError$1>;
60
+ /**
61
+ * Loader → verifier pipeline shared by `db verify` modes (`full`,
62
+ * `marker-only`, `schema-only`).
63
+ *
64
+ * 1. **Load**: build a {@link import('@prisma/orm-toolchain/migration-tools/aggregate').ContractSpaceAggregate}
65
+ * from descriptors + on-disk on-disk artefacts. Layout / drift /
66
+ * integrity / disjointness violations short-circuit with a
67
+ * structured CLI error.
68
+ * 2. **Read DB state**: marker rows + (when `skipSchema` is `false`)
69
+ * schema introspection.
70
+ * 3. **Verify**: {@link verifyMigration} returns per-space `markerCheck` +
71
+ * per-space `schemaCheck` (each contract space verified against the full schema,
72
+ * then scoped to its own contract space). Marker mismatches map to
73
+ * `CliStructuredError` (code `5002`) so callers (CLI command) can render
74
+ * and exit. Verify results are returned to the caller verbatim.
75
+ */
76
+ declare function executeDbVerify<TFamilyId extends string, TTargetId extends string>(options: ExecuteDbVerifyOptions<TFamilyId, TTargetId>): Promise<ExecuteDbVerifyResult>;
77
+ //#endregion
78
+ //#region src/control-api/types.d.ts
79
+ /**
80
+ * Options for creating a control client.
81
+ *
82
+ * Note: This is NOT the same as CLI config. There's no `contract` field,
83
+ * no file paths. The client is config-agnostic.
84
+ *
85
+ * The descriptor types use permissive `any` because family-specific descriptors
86
+ * (e.g., SqlFamilyDescriptor) have more specific `create` method signatures that
87
+ * are not compatible with the base ControlFamilyDescriptor type due to TypeScript
88
+ * variance rules. The client implementation casts these internally.
89
+ */
90
+ interface ControlClientOptions {
91
+ readonly family: ControlFamilyDescriptor<any, any>;
92
+ readonly target: ControlTargetDescriptor<any, any, any>;
93
+ readonly adapter: ControlAdapterDescriptor<any, any, any>;
94
+ /** Optional - control client can be created without driver for offline operations */
95
+ readonly driver?: ControlDriverDescriptor<any, any, any, any>;
96
+ readonly extensions?: ReadonlyArray<ControlExtensionDescriptor<any, any, any>>;
97
+ /**
98
+ * Optional default connection for auto-connect.
99
+ * When provided, operations will auto-connect if not already connected.
100
+ * The type is driver-specific (e.g., string URL for Postgres).
101
+ */
102
+ readonly connection?: unknown;
103
+ }
104
+ /**
105
+ * Action names for control-api operations that can emit progress events.
106
+ */
107
+ type ControlActionName = 'dbInit' | 'dbUpdate' | 'dbVerify' | 'migrate' | 'verify' | 'schemaVerify' | 'sign' | 'introspect' | 'emit';
108
+ /**
109
+ * Progress event emitted during control-api operation execution.
110
+ *
111
+ * Events model operation progress using a span-based model:
112
+ * - `spanStart`: Begin a timed segment (supports nesting via parentSpanId)
113
+ * - `spanEnd`: Complete a timed segment
114
+ *
115
+ * All operation-specific progress (e.g., per-migration-operation) is modeled
116
+ * as nested spans rather than special event types.
117
+ *
118
+ * Events are delivered via an optional `onProgress` callback to avoid polluting
119
+ * return types. If the callback is absent, operations emit no events (zero overhead).
120
+ */
121
+ type ControlProgressEvent = {
122
+ readonly action: ControlActionName;
123
+ readonly kind: 'spanStart';
124
+ readonly spanId: string;
125
+ readonly parentSpanId?: string;
126
+ readonly label: string;
127
+ } | {
128
+ readonly action: ControlActionName;
129
+ readonly kind: 'spanEnd';
130
+ readonly spanId: string;
131
+ readonly outcome: 'ok' | 'skipped' | 'error';
132
+ };
133
+ /**
134
+ * Callback function for receiving progress events during control-api operations.
135
+ *
136
+ * @param event - The progress event emitted by the operation
137
+ */
138
+ type OnControlProgress = (event: ControlProgressEvent) => void;
139
+ /**
140
+ * Options for the verify operation.
141
+ */
142
+ interface VerifyOptions {
143
+ /** Contract or unvalidated JSON - validated at runtime via familyInstance.deserializeContract() */
144
+ readonly contract: unknown;
145
+ /**
146
+ * Database connection. If provided, verify will connect before executing.
147
+ * If omitted, the client must already be connected.
148
+ * The type is driver-specific (e.g., string URL for Postgres).
149
+ */
150
+ readonly connection?: unknown;
151
+ /** Optional progress callback for observing operation progress */
152
+ readonly onProgress?: OnControlProgress;
153
+ }
154
+ /**
155
+ * Options for the schemaVerify operation.
156
+ */
157
+ interface SchemaVerifyOptions {
158
+ /** Contract or unvalidated JSON - validated at runtime via familyInstance.deserializeContract() */
159
+ readonly contract: unknown;
160
+ /**
161
+ * Whether to use strict mode for schema verification.
162
+ * In strict mode, extra tables/columns are reported as issues.
163
+ * Default: false (tolerant mode - allows superset)
164
+ */
165
+ readonly strict?: boolean;
166
+ /**
167
+ * Database connection. If provided, schemaVerify will connect before executing.
168
+ * If omitted, the client must already be connected.
169
+ * The type is driver-specific (e.g., string URL for Postgres).
170
+ */
171
+ readonly connection?: unknown;
172
+ /** Optional progress callback for observing operation progress */
173
+ readonly onProgress?: OnControlProgress;
174
+ }
175
+ /**
176
+ * Options for the sign operation.
177
+ */
178
+ interface SignOptions {
179
+ /** Contract or unvalidated JSON - validated at runtime via familyInstance.deserializeContract() */
180
+ readonly contract: unknown;
181
+ /**
182
+ * Path to the contract file (for metadata in the result).
183
+ */
184
+ readonly contractPath?: string;
185
+ /**
186
+ * Path to the config file (for metadata in the result).
187
+ */
188
+ readonly configPath?: string;
189
+ /**
190
+ * Database connection. If provided, sign will connect before executing.
191
+ * If omitted, the client must already be connected.
192
+ * The type is driver-specific (e.g., string URL for Postgres).
193
+ */
194
+ readonly connection?: unknown;
195
+ /** Optional progress callback for observing operation progress */
196
+ readonly onProgress?: OnControlProgress;
197
+ }
198
+ /**
199
+ * Options for the dbInit operation.
200
+ */
201
+ interface DbInitOptions {
202
+ /** Contract or unvalidated JSON - validated at runtime via familyInstance.deserializeContract() */
203
+ readonly contract: unknown;
204
+ /**
205
+ * Mode for the dbInit operation.
206
+ * - 'plan': Returns planned operations without applying
207
+ * - 'apply': Applies operations and writes marker
208
+ */
209
+ readonly mode: 'plan' | 'apply';
210
+ /**
211
+ * Database connection. If provided, dbInit will connect before executing.
212
+ * If omitted, the client must already be connected.
213
+ * The type is driver-specific (e.g., string URL for Postgres).
214
+ */
215
+ readonly connection?: unknown;
216
+ /**
217
+ * On-disk migrations directory. Always required — every `db init`
218
+ * routes through the per-space flow, which reads on-disk
219
+ * `refs/head.json` and extension destination contracts from this
220
+ * root.
221
+ */
222
+ readonly migrationsDir: string;
223
+ /** Optional progress callback for observing operation progress */
224
+ readonly onProgress?: OnControlProgress;
225
+ }
226
+ /**
227
+ * Options for the dbUpdate operation.
228
+ */
229
+ interface DbUpdateOptions {
230
+ /** Contract or unvalidated JSON - validated at runtime via familyInstance.deserializeContract() */
231
+ readonly contract: unknown;
232
+ /**
233
+ * Mode for the dbUpdate operation.
234
+ * - 'plan': Returns planned operations without applying
235
+ * - 'apply': Applies operations and writes marker/ledger
236
+ */
237
+ readonly mode: 'plan' | 'apply';
238
+ /**
239
+ * Database connection. If provided, dbUpdate will connect before executing.
240
+ * If omitted, the client must already be connected.
241
+ * The type is driver-specific (e.g., string URL for Postgres).
242
+ */
243
+ readonly connection?: unknown;
244
+ /**
245
+ * When true, allows applying plans that contain destructive operations
246
+ * (e.g., DROP TABLE, DROP COLUMN, ALTER TYPE).
247
+ * When false (default), the operation returns a failure if the plan
248
+ * includes destructive operations, prompting the user to confirm interactively
249
+ * or re-run with -y/--yes.
250
+ */
251
+ readonly acceptDataLoss?: boolean;
252
+ /**
253
+ * On-disk migrations directory. Always required — every `db update`
254
+ * routes through the per-space flow, which reads on-disk
255
+ * `refs/head.json` and extension destination contracts from this
256
+ * root.
257
+ */
258
+ readonly migrationsDir: string;
259
+ /** Optional progress callback for observing operation progress */
260
+ readonly onProgress?: OnControlProgress;
261
+ }
262
+ /**
263
+ * Options for the dbVerify operation.
264
+ *
265
+ * Drives the loader → aggregate-verifier pipeline. `strict` maps to
266
+ * `verifyMigration({ mode: 'strict' | 'lenient' })`; `skipSchema`
267
+ * mirrors the `--marker-only` CLI flag and short-circuits the schema
268
+ * portion of the verifier.
269
+ */
270
+ interface DbVerifyOptions {
271
+ /**
272
+ * Already-deserialized contract. Callers cross the family
273
+ * `deserializeContract` seam at the read site (TML-2536) and pass the
274
+ * hydrated value through unchanged; this op no longer re-runs the
275
+ * SerializerBase pipeline.
276
+ */
277
+ readonly contract: Contract;
278
+ readonly migrationsDir: string;
279
+ readonly strict: boolean;
280
+ readonly skipSchema: boolean;
281
+ readonly skipMarker: boolean;
282
+ readonly connection?: unknown;
283
+ readonly onProgress?: OnControlProgress;
284
+ }
285
+ /**
286
+ * Options for the introspect operation.
287
+ */
288
+ interface IntrospectOptions {
289
+ /**
290
+ * Optional schema name to introspect.
291
+ */
292
+ readonly schema?: string;
293
+ /**
294
+ * Database connection. If provided, introspect will connect before executing.
295
+ * If omitted, the client must already be connected.
296
+ * The type is driver-specific (e.g., string URL for Postgres).
297
+ */
298
+ readonly connection?: unknown;
299
+ /** Optional progress callback for observing operation progress */
300
+ readonly onProgress?: OnControlProgress;
301
+ }
302
+ /**
303
+ * Contract configuration for emit operation.
304
+ */
305
+ interface EmitContractConfig {
306
+ /**
307
+ * Contract source provider.
308
+ */
309
+ readonly source: ContractSourceProvider;
310
+ /**
311
+ * Output path for contract.json.
312
+ * The .d.ts types file will be colocated (e.g., contract.json → contract.d.ts).
313
+ */
314
+ readonly output: string;
315
+ }
316
+ /**
317
+ * Options for the emit operation.
318
+ */
319
+ interface EmitOptions {
320
+ /**
321
+ * Contract configuration containing source, output, and types paths.
322
+ */
323
+ readonly contractConfig: EmitContractConfig;
324
+ /** Optional progress callback for observing operation progress */
325
+ readonly onProgress?: OnControlProgress;
326
+ }
327
+ /**
328
+ * Per-space breakdown of an aggregate plan / apply.
329
+ *
330
+ * Surfaces the canonical schedule shape — extensions alphabetically,
331
+ * then app — together with the operations attributed to each space and,
332
+ * when the run was applied, the resulting per-space marker hash.
333
+ *
334
+ * Every space involved in a run is observable in the success summary,
335
+ * including its post-apply marker — the per-space marker is visible
336
+ * to the user instead of being collapsed into a single ambiguous
337
+ * top-level hash.
338
+ */
339
+ interface PerSpaceExecutionEntry {
340
+ readonly spaceId: string;
341
+ /** `'app'` for the application's contract space; `'extension'` for any extension space. */
342
+ readonly kind: 'app' | 'extension';
343
+ /**
344
+ * Operations attributed to this space (display ops). In `mode: 'plan'`
345
+ * this is the planned set; in `mode: 'apply'` it is the same set
346
+ * (every op was executed in order, the runner does not skip).
347
+ */
348
+ readonly operations: ReadonlyArray<{
349
+ readonly id: string;
350
+ readonly label: string;
351
+ readonly operationClass: string;
352
+ }>;
353
+ /**
354
+ * Post-apply marker hash for this space. Present only when the run
355
+ * was applied (i.e. `mode: 'apply'` and the runner returned ok).
356
+ * Equals the per-space plan's `destination.storageHash`.
357
+ */
358
+ readonly marker?: {
359
+ readonly storageHash: string;
360
+ };
361
+ }
362
+ /**
363
+ * Successful dbInit result.
364
+ */
365
+ interface DbInitSuccess {
366
+ readonly mode: 'plan' | 'apply';
367
+ readonly plan: {
368
+ readonly operations: ReadonlyArray<{
369
+ readonly id: string;
370
+ readonly label: string;
371
+ readonly operationClass: string;
372
+ }>;
373
+ /**
374
+ * Family-agnostic textual preview of the planned operations, e.g.
375
+ * `language: 'sql'` for SQL families and `language: 'mongodb-shell'`
376
+ * for the Mongo family. Replaces the previous `sql?: readonly string[]`
377
+ * field; consumers that previously read `plan.sql` should read
378
+ * `plan.preview?.statements.map((s) => s.text)`.
379
+ */
380
+ readonly preview?: OperationPreview;
381
+ };
382
+ readonly destination: {
383
+ readonly storageHash: string;
384
+ readonly profileHash?: string;
385
+ };
386
+ readonly execution?: {
387
+ readonly operationsPlanned: number;
388
+ readonly operationsExecuted: number;
389
+ };
390
+ readonly marker?: {
391
+ readonly storageHash: string;
392
+ readonly profileHash?: string;
393
+ };
394
+ /**
395
+ * Per-space breakdown in canonical schedule order (extensions
396
+ * alphabetically, then app). Present whenever the aggregate flow
397
+ * produced one — both `mode: 'plan'` and `mode: 'apply'`.
398
+ *
399
+ * See {@link PerSpaceExecutionEntry}.
400
+ */
401
+ readonly perSpace?: ReadonlyArray<PerSpaceExecutionEntry>;
402
+ readonly summary: string;
403
+ readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
404
+ }
405
+ /**
406
+ * Failure codes for dbInit operation.
407
+ */
408
+ type DbInitFailureCode = 'PLANNING_FAILED' | 'MIGRATION.MARKER_ORIGIN_MISMATCH' | 'RUNNER_FAILED';
409
+ /**
410
+ * Failure details for dbInit operation.
411
+ */
412
+ interface DbInitFailure {
413
+ readonly code: DbInitFailureCode;
414
+ readonly summary: string;
415
+ readonly why: string | undefined;
416
+ readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
417
+ readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
418
+ readonly meta: Record<string, unknown> | undefined;
419
+ readonly marker?: {
420
+ readonly storageHash?: string;
421
+ readonly profileHash?: string;
422
+ };
423
+ readonly destination?: {
424
+ readonly storageHash: string;
425
+ readonly profileHash?: string | undefined;
426
+ };
427
+ }
428
+ /**
429
+ * Result type for dbInit operation.
430
+ * Uses Result pattern: success returns DbInitSuccess, failure returns DbInitFailure.
431
+ */
432
+ type DbInitResult = Result<DbInitSuccess, DbInitFailure>;
433
+ /**
434
+ * Successful dbUpdate result.
435
+ */
436
+ interface DbUpdateSuccess {
437
+ readonly mode: 'plan' | 'apply';
438
+ readonly plan: {
439
+ readonly operations: ReadonlyArray<{
440
+ readonly id: string;
441
+ readonly label: string;
442
+ readonly operationClass: string;
443
+ }>;
444
+ /**
445
+ * Family-agnostic textual preview of the planned operations, e.g.
446
+ * `language: 'sql'` for SQL families and `language: 'mongodb-shell'`
447
+ * for the Mongo family. Replaces the previous `sql?: readonly string[]`
448
+ * field; consumers that previously read `plan.sql` should read
449
+ * `plan.preview?.statements.map((s) => s.text)`.
450
+ */
451
+ readonly preview?: OperationPreview;
452
+ };
453
+ readonly destination: {
454
+ readonly storageHash: string;
455
+ readonly profileHash?: string;
456
+ };
457
+ readonly execution?: {
458
+ readonly operationsPlanned: number;
459
+ readonly operationsExecuted: number;
460
+ };
461
+ readonly marker?: {
462
+ readonly storageHash: string;
463
+ readonly profileHash?: string;
464
+ };
465
+ /**
466
+ * Per-space breakdown in canonical schedule order (extensions
467
+ * alphabetically, then app). See {@link PerSpaceExecutionEntry}.
468
+ */
469
+ readonly perSpace?: ReadonlyArray<PerSpaceExecutionEntry>;
470
+ readonly summary: string;
471
+ readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
472
+ }
473
+ /**
474
+ * Failure codes for dbUpdate operation.
475
+ */
476
+ type DbUpdateFailureCode = 'PLANNING_FAILED' | 'RUNNER_FAILED' | 'DESTRUCTIVE_CHANGES';
477
+ /**
478
+ * Failure details for dbUpdate operation.
479
+ */
480
+ interface DbUpdateFailure {
481
+ readonly code: DbUpdateFailureCode;
482
+ readonly summary: string;
483
+ readonly why: string | undefined;
484
+ readonly conflicts: ReadonlyArray<MigrationPlannerConflict> | undefined;
485
+ readonly warnings?: ReadonlyArray<MigrationPlannerConflict>;
486
+ readonly meta: Record<string, unknown> | undefined;
487
+ }
488
+ /**
489
+ * Result type for dbUpdate operation.
490
+ * Uses Result pattern: success returns DbUpdateSuccess, failure returns DbUpdateFailure.
491
+ */
492
+ type DbUpdateResult = Result<DbUpdateSuccess, DbUpdateFailure>;
493
+ /**
494
+ * Successful emit result.
495
+ * Contains the hashes and paths of emitted files.
496
+ */
497
+ interface EmitSuccess {
498
+ /** Storage hash of the emitted contract */
499
+ readonly storageHash: string;
500
+ /** Execution hash of the emitted contract (if execution section exists) */
501
+ readonly executionHash?: string;
502
+ /** Profile hash of the emitted contract (target-specific) */
503
+ readonly profileHash: string;
504
+ /** The emitted contract as JSON string */
505
+ readonly contractJson: string;
506
+ /** The emitted contract TypeScript declarations */
507
+ readonly contractDts: string;
508
+ }
509
+ /**
510
+ * Failure codes for emit operation.
511
+ */
512
+ type EmitFailureCode = 'CONTRACT_SOURCE_INVALID' | 'CONTRACT_VALIDATION_FAILED' | 'EMIT_FAILED';
513
+ /**
514
+ * Failure details for emit operation.
515
+ */
516
+ interface EmitFailure {
517
+ readonly code: EmitFailureCode;
518
+ readonly summary: string;
519
+ readonly why: string | undefined;
520
+ readonly meta: Record<string, unknown> | undefined;
521
+ readonly diagnostics?: ContractSourceDiagnostics;
522
+ }
523
+ /**
524
+ * Result type for emit operation.
525
+ * Uses Result pattern: success returns EmitSuccess, failure returns EmitFailure.
526
+ */
527
+ type EmitResult = Result<EmitSuccess, EmitFailure>;
528
+ /**
529
+ * Options for the aggregate-walking `migrate` operation.
530
+ *
531
+ * The control-api operation is responsible for: loading the
532
+ * contract-space aggregate, reading per-space marker rows from the
533
+ * live database, plotting per-space paths via `resolveRecordedPath`
534
+ * (replay-only — no synth, no introspection), and dispatching
535
+ * through the shared `runMigration` primitive. The CLI command
536
+ * just resolves the descriptor surface (config, refs, contract
537
+ * envelope, app-space migration packages) and hands the inputs in.
538
+ */
539
+ interface MigrateOptions {
540
+ /** Already-validated app contract (the canonical "where we are heading" hash). */
541
+ readonly contract: unknown;
542
+ /** Migrations root directory (`migrations/` under the project). */
543
+ readonly migrationsDir: string;
544
+ /**
545
+ * Optional app-space ref override. When provided, the app space's
546
+ * graph-walk targets this hash instead of `contract.storage.storageHash`.
547
+ * Extension spaces always walk to their own `headRef.hash`.
548
+ */
549
+ readonly refHash?: string;
550
+ /**
551
+ * Required invariants on the user-supplied app-space ref. Threaded
552
+ * into the graph-walk's `required` calculation so the planner picks
553
+ * an invariant-bearing path. Ignored when `refHash` is absent.
554
+ */
555
+ readonly refInvariants?: readonly string[];
556
+ /**
557
+ * Resolved name of the user-supplied app-space ref (the literal the
558
+ * user passed to `--ref`). Decorates `pathDecision.refName` and any
559
+ * `MIGRATION.NO_INVARIANT_PATH` envelope raised during graph-walk.
560
+ * Ignored when `refHash` is absent.
561
+ */
562
+ readonly refName?: string;
563
+ /**
564
+ * Database connection. If provided, migrate will connect before executing.
565
+ * If omitted, the client must already be connected.
566
+ */
567
+ readonly connection?: unknown;
568
+ /** Optional progress callback for observing operation progress */
569
+ readonly onProgress?: OnControlProgress;
570
+ }
571
+ /**
572
+ * Record of a successfully applied per-space migration. One entry per
573
+ * contract space that had pending migrations — empty `applied` means
574
+ * every space was already at its head.
575
+ */
576
+ /**
577
+ * One entry per authored migration package applied. Preserves the
578
+ * `migrationsApplied` count semantics (each entry is one migration
579
+ * directory) so `applied.length === migrationsApplied`.
580
+ *
581
+ * Per-space aggregate detail (markers, ops grouped by space) lives
582
+ * on `perSpace[]`; this list is the per-edge view.
583
+ */
584
+ interface MigrateRanEntry {
585
+ readonly spaceId: string;
586
+ readonly dirName: string;
587
+ readonly migrationHash: string;
588
+ readonly from: string;
589
+ readonly to: string;
590
+ readonly operationsExecuted: number;
591
+ }
592
+ /**
593
+ * Successful migrate result. Carries both the top-level fields
594
+ * (`markerHash` is the **app space's** post-migrate marker) and the
595
+ * per-space breakdown (`perSpace` — markers / operations in canonical
596
+ * schedule order).
597
+ */
598
+ /**
599
+ * Path-decision summary for the **app space** post-migrate. Surfaced
600
+ * at the top level (and consumed by the cli-journeys suite, which
601
+ * inspects `requiredInvariants`/`satisfiedInvariants`/
602
+ * `selectedPath` to validate invariant routing).
603
+ *
604
+ * Per-space path decisions for extension spaces are not surfaced —
605
+ * extensions own their own ref/invariant control.
606
+ */
607
+ interface MigratePathDecision {
608
+ readonly fromHash: string;
609
+ readonly toHash: string;
610
+ readonly alternativeCount: number;
611
+ readonly tieBreakReasons: readonly string[];
612
+ readonly refName?: string;
613
+ readonly requiredInvariants: readonly string[];
614
+ readonly satisfiedInvariants: readonly string[];
615
+ readonly selectedPath: readonly {
616
+ readonly dirName: string;
617
+ readonly migrationHash: string;
618
+ readonly from: string;
619
+ readonly to: string;
620
+ readonly invariants: readonly string[];
621
+ }[];
622
+ }
623
+ interface MigrateSuccess {
624
+ readonly migrationsApplied: number;
625
+ readonly markerHash: string;
626
+ readonly applied: readonly MigrateRanEntry[];
627
+ readonly summary: string;
628
+ /**
629
+ * Per-space breakdown in canonical schedule order (extensions
630
+ * alphabetically, then app). See {@link PerSpaceExecutionEntry}.
631
+ * Always present for the aggregate-walking operation.
632
+ */
633
+ readonly perSpace: ReadonlyArray<PerSpaceExecutionEntry>;
634
+ /**
635
+ * Path-decision data for the app space. Present whenever the
636
+ * graph-walk strategy ran for the app (i.e. always for the
637
+ * aggregate-walking migrate path). Absent only for the no-op
638
+ * "Already up to date" early return when the app has no plan.
639
+ */
640
+ readonly pathDecision?: MigratePathDecision;
641
+ }
642
+ /**
643
+ * Failure codes for migrate operation.
644
+ */
645
+ type MigrateFailureCode = 'RUNNER_FAILED' | 'MIGRATION_PATH_NOT_FOUND';
646
+ /**
647
+ * Failure details for migrate operation.
648
+ */
649
+ interface MigrateFailure {
650
+ readonly code: MigrateFailureCode;
651
+ readonly summary: string;
652
+ readonly why: string | undefined;
653
+ readonly meta: Record<string, unknown> | undefined;
654
+ }
655
+ /**
656
+ * Result type for migrate operation.
657
+ */
658
+ type MigrateResult = Result<MigrateSuccess, MigrateFailure>;
659
+ /**
660
+ * Options for the standalone executeContractEmit function.
661
+ *
662
+ * `executeContractEmit` is the canonical publication path for both the
663
+ * `prisma-next contract emit` CLI command and the `@internal/vite-plugin-contract-emit`
664
+ * Vite plugin. Do not duplicate the load → emit → publish dance elsewhere; if a
665
+ * caller needs additional behavior, extend this options shape and update the
666
+ * single implementation rather than building a parallel publication path.
667
+ *
668
+ * Concurrent calls for the same output JSON path are serialized per-output via
669
+ * a FIFO queue; concurrent calls for distinct outputs run in parallel.
670
+ */
671
+ interface ContractEmitOptions {
672
+ /** Path to the prisma-next.config.ts file */
673
+ readonly configPath: string;
674
+ /**
675
+ * Directory to write contract artifacts into. When set, `contract.json` and
676
+ * `contract.d.ts` are written inside this directory, taking precedence over
677
+ * any output path from the loaded config. The value must be an absolute path;
678
+ * resolution against cwd is the caller's responsibility.
679
+ */
680
+ readonly outputPath?: string;
681
+ /** Optional AbortSignal for cancelling the in-flight emit */
682
+ readonly signal?: AbortSignal;
683
+ /** Optional progress callback for observing source-resolution and emit spans */
684
+ readonly onProgress?: OnControlProgress;
685
+ }
686
+ /**
687
+ * Result from the standalone executeContractEmit function.
688
+ *
689
+ * Always describes the bytes that were just published to disk. Failures throw
690
+ * (config / source-resolution / emit / publish) — callers do not need to
691
+ * branch on a result discriminator.
692
+ */
693
+ interface ContractEmitResult {
694
+ /** Hash of the storage contract (schema-level) */
695
+ readonly storageHash: string;
696
+ /** Hash of the execution contract (if execution section exists) */
697
+ readonly executionHash?: string;
698
+ /** Hash of the profile (target+extensions) */
699
+ readonly profileHash: string;
700
+ /** Paths to the emitted files */
701
+ readonly files: {
702
+ /** Path to the emitted contract.json file */
703
+ readonly json: string;
704
+ /** Path to the emitted contract.d.ts file */
705
+ readonly dts: string;
706
+ };
707
+ /**
708
+ * Warning surfaced by `validateContractDeps` after a successful publication.
709
+ * Callers (CLI, Vite plugin) decide how to render this; the operation does
710
+ * not write to stderr itself. Undefined when no warning was raised.
711
+ */
712
+ readonly validationWarning?: string;
713
+ }
714
+ /**
715
+ * Programmatic control client for Prisma Next operations.
716
+ *
717
+ * Lifecycle: `connect(connection)` before operations, `close()` when done.
718
+ * Both `init()` and `connect()` are auto-called by operations if needed,
719
+ * but `connect()` requires a connection so must be called explicitly first
720
+ * unless a default connection was provided in options.
721
+ *
722
+ * @see README.md "Programmatic Control API" section for usage examples
723
+ */
724
+ interface ControlClient {
725
+ /**
726
+ * Initializes the client by creating the control plane stack,
727
+ * family instance, and validating framework components.
728
+ *
729
+ * Idempotent (safe to call multiple times).
730
+ * Called automatically by `connect()` if not already initialized.
731
+ */
732
+ init(): void;
733
+ /**
734
+ * Establishes a database connection.
735
+ * Auto-calls `init()` if not already initialized.
736
+ * Must be called before any database operations unless a default connection
737
+ * was provided in options.
738
+ *
739
+ * @param connection - Driver-specific connection input (e.g., URL string for Postgres).
740
+ * If omitted, uses the default connection from options (if provided).
741
+ * @throws If connection fails, already connected, driver is not configured,
742
+ * or no connection provided and no default connection in options.
743
+ */
744
+ connect(connection?: unknown): Promise<void>;
745
+ /**
746
+ * Closes the database connection.
747
+ * Idempotent (safe to call multiple times).
748
+ * After close(), can call `connect()` again with same or different URL.
749
+ */
750
+ close(): Promise<void>;
751
+ /**
752
+ * Verifies database marker matches the contract.
753
+ * Compares storageHash and profileHash.
754
+ *
755
+ * @returns Structured result (ok: false for mismatch, not throwing)
756
+ * @throws If not connected or infrastructure failure
757
+ */
758
+ verify(options: VerifyOptions): Promise<VerifyDatabaseResult>;
759
+ /**
760
+ * Verifies database schema satisfies the contract requirements.
761
+ *
762
+ * @param options.strict - If true, extra tables/columns are issues. Default: false
763
+ * @returns Structured result with schema issues
764
+ * @throws If not connected or infrastructure failure
765
+ */
766
+ schemaVerify(options: SchemaVerifyOptions): Promise<VerifyDatabaseSchemaResult>;
767
+ /**
768
+ * Signs the database with a contract signature.
769
+ * Writes or updates the signature if schema verification passes.
770
+ * Idempotent (no-op if signature already matches).
771
+ *
772
+ * @returns Structured result
773
+ * @throws If not connected or infrastructure failure
774
+ */
775
+ sign(options: SignOptions): Promise<SignDatabaseResult>;
776
+ /**
777
+ * Initializes database schema from contract.
778
+ * Uses additive-only policy (no destructive changes).
779
+ *
780
+ * @param options.mode - 'plan' to preview, 'apply' to execute
781
+ * @returns Result pattern: Ok with planned/executed operations, NotOk with failure details
782
+ * @throws If not connected, target doesn't support migrations, or infrastructure failure
783
+ */
784
+ dbInit(options: DbInitOptions): Promise<DbInitResult>;
785
+ /**
786
+ * Updates a database schema to match the current contract.
787
+ * Creates the signature table if it does not exist. No preconditions required.
788
+ * Allows additive, widening, and destructive operation classes.
789
+ *
790
+ * @param options.mode - 'plan' to preview, 'apply' to execute
791
+ * @returns Result pattern: Ok with planned/executed operations, NotOk with failure details
792
+ * @throws If not connected, target doesn't support migrations, or infrastructure failure
793
+ */
794
+ dbUpdate(options: DbUpdateOptions): Promise<DbUpdateResult>;
795
+ /**
796
+ * Verifies the database against every contract space (app + extensions).
797
+ *
798
+ * Loader → aggregate-verifier pipeline:
799
+ * - The loader catches layout / drift / disjointness violations.
800
+ * - The aggregate verifier surfaces marker-vs-on-disk drift and orphan
801
+ * markers, and (unless `skipSchema` is true) per-space schema
802
+ * verification with pre-projection (closes F23).
803
+ *
804
+ * @returns Result pattern: per-space verify results on success;
805
+ * structured CLI error on marker / loader failure.
806
+ * @throws If not connected or infrastructure failure
807
+ */
808
+ dbVerify(options: DbVerifyOptions): Promise<ExecuteDbVerifyResult>;
809
+ /**
810
+ * Reads the contract marker from the database.
811
+ * Returns null if no marker exists (fresh database).
812
+ *
813
+ * @throws If not connected or infrastructure failure
814
+ */
815
+ readMarker(): Promise<ContractMarkerRecord | null>;
816
+ /**
817
+ * Reads every marker row (one per contract space). Used by the
818
+ * per-space verifier to detect orphan marker rows and marker-vs-on-disk
819
+ * drift after a database connection has been established.
820
+ */
821
+ readAllMarkers(): Promise<ReadonlyMap<string, ContractMarkerRecord>>;
822
+ /**
823
+ * Reads the per-migration ledger journal for `space` in apply order.
824
+ * Returns an empty array when the ledger store does not yet exist or
825
+ * has no rows for that space.
826
+ */
827
+ readLedger(space?: string): Promise<readonly LedgerEntryRecord[]>;
828
+ /**
829
+ * Advances the database along the migration graph to the target contract.
830
+ * Each migration runs in its own transaction with full execution checks.
831
+ * Resume-safe: re-running after failure picks up from the last run migration.
832
+ *
833
+ * @param options.contract - The target contract to migrate to
834
+ * @param options.migrationsDir - Root migrations directory (`migrations/` under the project)
835
+ * @param options.refHash - Optional app-space ref override hash
836
+ * @param options.refInvariants - Required invariants on the user-supplied ref
837
+ * @param options.refName - Resolved name of the user-supplied app-space ref
838
+ * @returns Result pattern: Ok with migration details, NotOk with failure details
839
+ * @throws If not connected, target doesn't support migrations, or infrastructure failure
840
+ */
841
+ migrate(options: MigrateOptions): Promise<MigrateResult>;
842
+ /**
843
+ * Introspects the database schema.
844
+ *
845
+ * @returns Raw schema IR
846
+ * @throws If not connected or infrastructure failure
847
+ */
848
+ introspect(options?: IntrospectOptions): Promise<unknown>;
849
+ /**
850
+ * Converts a schema IR to a schema view for CLI tree rendering.
851
+ * Delegates to the family instance's toSchemaView method.
852
+ *
853
+ * @param schemaIR - The schema IR from introspect()
854
+ * @returns CoreSchemaView if the family supports it, undefined otherwise
855
+ */
856
+ toSchemaView(schemaIR: unknown): CoreSchemaView | undefined;
857
+ /**
858
+ * Infers a PSL contract AST from an introspected schema IR.
859
+ * Delegates to the family instance's inferPslContract method.
860
+ *
861
+ * @param schemaIR - The schema IR from introspect()
862
+ * @returns PslDocumentAst if the family supports the capability, undefined otherwise
863
+ */
864
+ inferPslContract(schemaIR: unknown): PslDocumentAst | undefined;
865
+ /**
866
+ * Returns the assembled PSL block descriptors from the control stack — the full
867
+ * set of extension-contributed top-level block descriptors. The CLI's
868
+ * `contract infer` command threads these through to `printPsl` so
869
+ * extension-contributed blocks in the inferred AST round-trip back to PSL
870
+ * source. Forces `init()` so the stack is built before access.
871
+ */
872
+ getPslBlockDescriptors(): AuthoringPslBlockDescriptorNamespace;
873
+ /**
874
+ * Renders a textual preview of a migration plan's operations for the CLI's
875
+ * "DDL preview" output. Delegates to the family instance's
876
+ * `toOperationPreview` method.
877
+ *
878
+ * @param operations - The migration plan operations to render
879
+ * @returns OperationPreview if the family supports the capability, undefined otherwise
880
+ */
881
+ toOperationPreview(operations: readonly MigrationPlanOperation[]): OperationPreview | undefined;
882
+ /**
883
+ * Emits the contract to JSON and TypeScript declarations.
884
+ * This is an offline operation that does NOT require a database connection.
885
+ * Uses `init()` to create the stack but does NOT call `connect()`.
886
+ *
887
+ * @returns Result pattern: Ok with emit details, NotOk with failure details
888
+ */
889
+ emit(options: EmitOptions): Promise<EmitResult>;
890
+ }
891
+ //#endregion
892
+ export { SchemaVerifyOptions as A, EmitSuccess as C, MigratePathDecision as D, IntrospectOptions as E, VerifyOptions as M, executeDbVerify as N, OnControlProgress as O, EmitResult as S, ExecuteDbVerifyResult as T, DbUpdateSuccess as _, ControlClient as a, EmitFailureCode as b, DbInitFailure as c, DbInitResult as d, DbInitSuccess as f, DbUpdateResult as g, DbUpdateOptions as h, ControlActionName as i, SignOptions as j, PerSpaceExecutionEntry as k, DbInitFailureCode as l, DbUpdateFailureCode as m, ContractEmitOptions as n, ControlClientOptions as o, DbUpdateFailure as p, ContractEmitResult as r, ControlProgressEvent as s, CliStructuredError$1 as t, DbInitOptions as u, EmitContractConfig as v, ExecuteDbVerifyOptions as w, EmitOptions as x, EmitFailure as y };
893
+ //# sourceMappingURL=types-DZWEs4si-D8UlyJI0.d.mts.map