@prisma/orm-framework 8.0.0-rc.2-dev.3 → 8.0.0-rc.20-dev.1

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 (354) hide show
  1. package/README.md +1 -5
  2. package/dist/{apply-specifier-default-control-policy-CAxiXxKg.d.mts → apply-specifier-default-control-policy-Dlz0iwnK.d.mts} +2 -2
  3. package/dist/apply-specifier-default-control-policy-Dlz0iwnK.d.mts.map +1 -0
  4. package/dist/{assertions-Cz-GWH8P.mjs → assertions-Dw1lZz_Q.mjs} +2 -2
  5. package/dist/{assertions-Cz-GWH8P.mjs.map → assertions-Dw1lZz_Q.mjs.map} +1 -1
  6. package/dist/authoring-CNUti739.mjs +764 -0
  7. package/dist/authoring-CNUti739.mjs.map +1 -0
  8. package/dist/authoring-CjwinhU5.d.mts +206 -0
  9. package/dist/authoring-CjwinhU5.d.mts.map +1 -0
  10. package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts +515 -0
  11. package/dist/binder-D_4RBHbt-BJ6VKwEZ.d.mts.map +1 -0
  12. package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts → canonicalization-CyrrXGmj-CeKUkht1.d.mts} +3 -3
  13. package/dist/{canonicalization-DFpB09nP-4OdB2nsy.d.mts.map → canonicalization-CyrrXGmj-CeKUkht1.d.mts.map} +1 -1
  14. package/dist/{hashing-utils-DQgS3nOe.mjs → canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs} +23 -3
  15. package/dist/canonicalization-path-match-D88xLEq6-BFQC39ZG.mjs.map +1 -0
  16. package/dist/{utils-DMAM0unR.mjs → canonicalize-json-ZPawceQR-Dua1VNEB.mjs} +2 -2
  17. package/dist/canonicalize-json-ZPawceQR-Dua1VNEB.mjs.map +1 -0
  18. package/dist/codec-B4ypaota.d.mts +289 -0
  19. package/dist/codec-B4ypaota.d.mts.map +1 -0
  20. package/dist/codec-Do8tfXqk.mjs +457 -0
  21. package/dist/codec-Do8tfXqk.mjs.map +1 -0
  22. package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs +93 -0
  23. package/dist/codec-descriptor-D0oY-hgs-C5e11ola.mjs.map +1 -0
  24. package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs +22 -0
  25. package/dist/codec-types-BXLUbk-Y-DpGfKGK0.mjs.map +1 -0
  26. package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts +384 -0
  27. package/dist/codec-types-CPgEZoIq-BL9hisr8.d.mts.map +1 -0
  28. package/dist/{components-dZRz3T5y.mjs → components-BaV9iCkq.mjs} +34 -3
  29. package/dist/components-BaV9iCkq.mjs.map +1 -0
  30. package/dist/components-CRBcIta_.d.mts +86 -0
  31. package/dist/components-CRBcIta_.d.mts.map +1 -0
  32. package/dist/components.d.mts +19 -17
  33. package/dist/components.mjs +16 -12
  34. package/dist/components__authoring.d.mts +4 -3
  35. package/dist/components__authoring.mjs +3 -2
  36. package/dist/components__codec.d.mts +3 -3
  37. package/dist/components__codec.mjs +6 -4
  38. package/dist/components__components.d.mts +6 -4
  39. package/dist/components__components.mjs +4 -3
  40. package/dist/components__control.d.mts +5 -4
  41. package/dist/components__control.mjs +3 -2
  42. package/dist/components__emission.d.mts +4 -4
  43. package/dist/components__execution.d.mts +1 -1
  44. package/dist/components__ir.d.mts +1 -1
  45. package/dist/components__ir.mjs +2 -1
  46. package/dist/components__psl-ast.d.mts +4 -4
  47. package/dist/components__psl-ast.mjs +2 -2
  48. package/dist/components__runtime.d.mts +3 -2
  49. package/dist/components__runtime.mjs +2 -2
  50. package/dist/components__utils.mjs +1 -1
  51. package/dist/{config-types-CW4PDwMC.d.mts → config-types-BTFT7QfJ.d.mts} +73 -41
  52. package/dist/config-types-BTFT7QfJ.d.mts.map +1 -0
  53. package/dist/config-types-D0mYyP62.mjs +61 -0
  54. package/dist/config-types-D0mYyP62.mjs.map +1 -0
  55. package/dist/config.d.mts +2 -3
  56. package/dist/config.mjs +2 -3
  57. package/dist/config__config-types.d.mts +2 -2
  58. package/dist/config__config-types.mjs +2 -2
  59. package/dist/contract-authoring.d.mts +152 -17
  60. package/dist/contract-authoring.d.mts.map +1 -1
  61. package/dist/contract-authoring.mjs +190 -9
  62. package/dist/contract-authoring.mjs.map +1 -1
  63. package/dist/{contract-types-CkdMH7F7-9EHXSwbH.d.mts → contract-types-DEIEpzU_-DvAVuBr5.d.mts} +14 -8
  64. package/dist/contract-types-DEIEpzU_-DvAVuBr5.d.mts.map +1 -0
  65. package/dist/{contract-validation-error-DEiWp_EI-CRwtUgRw.mjs → contract-validation-error-CAnTGhkt-DSnujRaK.mjs} +6 -3
  66. package/dist/contract-validation-error-CAnTGhkt-DSnujRaK.mjs.map +1 -0
  67. package/dist/{contract-validation-error-R7cMoK04.d.mts → contract-validation-error-D1QAeOh5.d.mts} +4 -2
  68. package/dist/contract-validation-error-D1QAeOh5.d.mts.map +1 -0
  69. package/dist/contract.d.mts +13 -12
  70. package/dist/contract.mjs +9 -9
  71. package/dist/contract__apply-specifier-default-control-policy.d.mts +1 -1
  72. package/dist/contract__contract-validation-error.d.mts +1 -1
  73. package/dist/contract__contract-validation-error.mjs +1 -1
  74. package/dist/contract__default-namespace.mjs +1 -1
  75. package/dist/contract__enum-accessor.d.mts +2 -2
  76. package/dist/contract__enum-accessor.mjs +1 -1
  77. package/dist/contract__hashing-utils.d.mts +2 -2
  78. package/dist/contract__hashing-utils.mjs +2 -3
  79. package/dist/contract__hashing.d.mts +3 -3
  80. package/dist/contract__hashing.mjs +2 -2
  81. package/dist/contract__resolve-domain-model.d.mts +1 -1
  82. package/dist/contract__types.d.mts +5 -5
  83. package/dist/contract__types.mjs +3 -3
  84. package/dist/contract__validate-domain.d.mts +1 -1
  85. package/dist/contract__validate-domain.mjs +1 -1
  86. package/dist/contract__validate-once.d.mts +2 -0
  87. package/dist/contract__validate-once.mjs +2 -0
  88. package/dist/{control-ql9N9u4f-r3Vv41kZ.d.mts → control-B5ezUWD2-BIAYxeSk.d.mts} +34 -6
  89. package/dist/control-B5ezUWD2-BIAYxeSk.d.mts.map +1 -0
  90. package/dist/{control-DLEm6u5m.mjs → control-DMJqhnwU.mjs} +309 -36
  91. package/dist/control-DMJqhnwU.mjs.map +1 -0
  92. package/dist/control-DrDTlxCS.d.mts +1 -0
  93. package/dist/{control-BD96JZi8-NUhO5Kkw.mjs → control-KsXr4fYD-D2Ows0NI.mjs} +70 -24
  94. package/dist/control-KsXr4fYD-D2Ows0NI.mjs.map +1 -0
  95. package/dist/{control-BF8qzdnM.d.mts → control-s5ECUABR.d.mts} +635 -156
  96. package/dist/control-s5ECUABR.d.mts.map +1 -0
  97. package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs +275 -0
  98. package/dist/data-type-V6mcDhcG-DVQAPOQT.mjs.map +1 -0
  99. package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs +459 -0
  100. package/dist/declarations-BgUAq1RG-Dz_-EI1Q.mjs.map +1 -0
  101. package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs → default-namespace-D4vCwkXg-BEZbN38y.mjs} +2 -2
  102. package/dist/{default-namespace-D4vCwkXg-lzVN7gSc.mjs.map → default-namespace-D4vCwkXg-BEZbN38y.mjs.map} +1 -1
  103. package/dist/{dist-Dqbo77p7.mjs → dist-D1f6xr7F.mjs} +51 -24
  104. package/dist/dist-D1f6xr7F.mjs.map +1 -0
  105. package/dist/{domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts → domain-envelope-CN721GnP-4huRt7Wc.d.mts} +27 -13
  106. package/dist/domain-envelope-CN721GnP-4huRt7Wc.d.mts.map +1 -0
  107. package/dist/emission-BtJvV97M.d.mts +2 -0
  108. package/dist/{emission-types-DLXP34Ki-CFms3VrX.d.mts → emission-types-B-jKEbjI-D7BW8Gk1.d.mts} +17 -16
  109. package/dist/emission-types-B-jKEbjI-D7BW8Gk1.d.mts.map +1 -0
  110. package/dist/enum-accessor-2OZgavDX.d.mts +104 -0
  111. package/dist/enum-accessor-2OZgavDX.d.mts.map +1 -0
  112. package/dist/enum-accessor-B-A2wNok.mjs +122 -0
  113. package/dist/enum-accessor-B-A2wNok.mjs.map +1 -0
  114. package/dist/errors.d.mts +5 -4
  115. package/dist/errors.mjs +4 -4
  116. package/dist/errors__control.d.mts +3 -2
  117. package/dist/errors__control.mjs +2 -2
  118. package/dist/errors__execution.d.mts +2 -2
  119. package/dist/errors__execution.mjs +2 -2
  120. package/dist/errors__migration.d.mts +2 -2
  121. package/dist/errors__migration.mjs +2 -2
  122. package/dist/execution-CjX5CCTb.d.mts +76 -0
  123. package/dist/execution-CjX5CCTb.d.mts.map +1 -0
  124. package/dist/{execution-CSnQT8EX.d.mts → execution-lMPVFj5o.d.mts} +2 -2
  125. package/dist/{execution-CSnQT8EX.d.mts.map → execution-lMPVFj5o.d.mts.map} +1 -1
  126. package/dist/execution-vfY4d-SZ.mjs +138 -0
  127. package/dist/execution-vfY4d-SZ.mjs.map +1 -0
  128. package/dist/{declarations-DR6To8_k-BFwkCGeP.mjs → expressions-CMQzbnHk-BL2zN0Iv.mjs} +199 -350
  129. package/dist/expressions-CMQzbnHk-BL2zN0Iv.mjs.map +1 -0
  130. package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts +1096 -0
  131. package/dist/framework-authoring-DDxddXZm-uZYdhoE0.d.mts.map +1 -0
  132. package/dist/{framework-components-hZ2tO-KH-CdRXBOYd.d.mts → framework-components-DKoQnPdB-lax1COaf.d.mts} +28 -91
  133. package/dist/framework-components-DKoQnPdB-lax1COaf.d.mts.map +1 -0
  134. package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs +271 -0
  135. package/dist/generator-functions-CXbQfvYu-BIFU1Ryx.mjs.map +1 -0
  136. package/dist/{hash-content-DwEUh-Rx.d.mts → hash-content-Bde14N2-.d.mts} +2 -2
  137. package/dist/{hash-content-DwEUh-Rx.d.mts.map → hash-content-Bde14N2-.d.mts.map} +1 -1
  138. package/dist/{hash-content-Bugg_nZn.mjs → hash-content-Bdl-HSfq.mjs} +2 -2
  139. package/dist/hash-content-Bdl-HSfq.mjs.map +1 -0
  140. package/dist/{hashing-BtIZVNYX.mjs → hashing-CLRfNAxh.mjs} +28 -9
  141. package/dist/hashing-CLRfNAxh.mjs.map +1 -0
  142. package/dist/hashing-D-DHz0zl.d.mts +36 -0
  143. package/dist/hashing-D-DHz0zl.d.mts.map +1 -0
  144. package/dist/{hashing-utils-qKu59RSC.d.mts → hashing-utils-DiGHKd3b.d.mts} +4 -3
  145. package/dist/{hashing-utils-qKu59RSC.d.mts.map → hashing-utils-DiGHKd3b.d.mts.map} +1 -1
  146. package/dist/ids.d.mts +90 -13
  147. package/dist/ids.d.mts.map +1 -1
  148. package/dist/ids.mjs +45 -59
  149. package/dist/ids.mjs.map +1 -1
  150. package/dist/ids__runtime.d.mts +1 -1
  151. package/dist/ids__runtime.mjs +1 -1
  152. package/dist/{index-CDk9yEbw.d.mts → index-MU-ksXsh.d.mts} +23 -6
  153. package/dist/index-MU-ksXsh.d.mts.map +1 -0
  154. package/dist/{internal-error-kK8QvlDE.d.mts → internal-error-2fJ9fcZX.d.mts} +2 -2
  155. package/dist/{internal-error-kK8QvlDE.d.mts.map → internal-error-2fJ9fcZX.d.mts.map} +1 -1
  156. package/dist/{internal-error-BIc-ehme-ouBQPoEL.mjs → internal-error-ChGYPVpq-DhUD05u0.mjs} +3 -3
  157. package/dist/internal-error-ChGYPVpq-DhUD05u0.mjs.map +1 -0
  158. package/dist/{ir-BvE7L9FK.d.mts → ir-LV4tXsw3.d.mts} +6 -5
  159. package/dist/{ir-BvE7L9FK.d.mts.map → ir-LV4tXsw3.d.mts.map} +1 -1
  160. package/dist/{ir-ChmSSAhX.mjs → ir-uDGU9vaj.mjs} +7 -53
  161. package/dist/ir-uDGU9vaj.mjs.map +1 -0
  162. package/dist/{migration-BvrgDZXw.d.mts → migration-Dluwnqe9.d.mts} +20 -3
  163. package/dist/migration-Dluwnqe9.d.mts.map +1 -0
  164. package/dist/{migration-C57VKLUY.mjs → migration-uC-bSKA4.mjs} +30 -4
  165. package/dist/migration-uC-bSKA4.mjs.map +1 -0
  166. package/dist/namespace-VUH2dgnS-By5y75h9.mjs +53 -0
  167. package/dist/namespace-VUH2dgnS-By5y75h9.mjs.map +1 -0
  168. package/dist/operations.mjs +1 -1
  169. package/dist/{parse-GbZGfMUj-BFSrD2AN.mjs → parse-bZgfjovA-BNgYhylT.mjs} +311 -55
  170. package/dist/parse-bZgfjovA-BNgYhylT.mjs.map +1 -0
  171. package/dist/{parse-0ZJjj_2N-DhQpSVmQ.d.mts → parse-djL5wker-B610mXG4.d.mts} +181 -52
  172. package/dist/parse-djL5wker-B610mXG4.d.mts.map +1 -0
  173. package/dist/psl-ast-COcYtLlz.d.mts +2 -0
  174. package/dist/psl-ast-CyvE6CR-.mjs +116 -0
  175. package/dist/psl-ast-CyvE6CR-.mjs.map +1 -0
  176. package/dist/{psl-ast-CWJQF8LA-Vr5JNPdn.d.mts → psl-ast-rY25o3Ze-ClLY3CYt.d.mts} +10 -40
  177. package/dist/psl-ast-rY25o3Ze-ClLY3CYt.d.mts.map +1 -0
  178. package/dist/psl-parser.d.mts +415 -101
  179. package/dist/psl-parser.d.mts.map +1 -1
  180. package/dist/psl-parser.mjs +2451 -537
  181. package/dist/psl-parser.mjs.map +1 -1
  182. package/dist/psl-parser__format.d.mts +8 -2
  183. package/dist/psl-parser__format.d.mts.map +1 -1
  184. package/dist/psl-parser__format.mjs +65 -34
  185. package/dist/psl-parser__format.mjs.map +1 -1
  186. package/dist/psl-parser__interpret.d.mts +98 -10
  187. package/dist/psl-parser__interpret.d.mts.map +1 -1
  188. package/dist/psl-parser__interpret.mjs +393 -2
  189. package/dist/psl-parser__interpret.mjs.map +1 -1
  190. package/dist/psl-parser__syntax.d.mts +3 -3
  191. package/dist/psl-parser__syntax.mjs +4 -43
  192. package/dist/psl-parser__tokenizer.d.mts +1 -1
  193. package/dist/psl-parser__tokenizer.mjs +1 -1
  194. package/dist/psl-printer.d.mts +7 -17
  195. package/dist/psl-printer.d.mts.map +1 -1
  196. package/dist/psl-printer.mjs +35 -104
  197. package/dist/psl-printer.mjs.map +1 -1
  198. package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs +74 -0
  199. package/dist/resolve-codec-qqMjZrmn-Cok8elAo.mjs.map +1 -0
  200. package/dist/{resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts → resolve-domain-model-BNr1glea-BLuR-phK.d.mts} +3 -3
  201. package/dist/resolve-domain-model-BNr1glea-BLuR-phK.d.mts.map +1 -0
  202. package/dist/{result-CBZ8X9mU.mjs → result-8OXF26MN.mjs} +14 -3
  203. package/dist/{result-CBZ8X9mU.mjs.map → result-8OXF26MN.mjs.map} +1 -1
  204. package/dist/{result-Bpupv5vO.d.mts → result-BYCOANWy.d.mts} +4 -2
  205. package/dist/result-BYCOANWy.d.mts.map +1 -0
  206. package/dist/runtime-B-YYuWy2.d.mts +899 -0
  207. package/dist/runtime-B-YYuWy2.d.mts.map +1 -0
  208. package/dist/runtime-DSYSc98Y.mjs +1059 -0
  209. package/dist/runtime-DSYSc98Y.mjs.map +1 -0
  210. package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts +19 -0
  211. package/dist/runtime-error-CO4MA3Px-YW5SCUcH.d.mts.map +1 -0
  212. package/dist/{structured-error-CgiSMpdU.mjs → structured-error-BXbihKQ-.mjs} +3 -3
  213. package/dist/{structured-error-CgiSMpdU.mjs.map → structured-error-BXbihKQ-.mjs.map} +1 -1
  214. package/dist/{structured-error-BsNT4Hun.d.mts → structured-error-Cc7AIRsp.d.mts} +19 -5
  215. package/dist/structured-error-Cc7AIRsp.d.mts.map +1 -0
  216. package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts +18 -0
  217. package/dist/suppress-idle-connection-errors-CKrTbp5P.d.mts.map +1 -0
  218. package/dist/suppress-idle-connection-errors-DzApeUb3.mjs +22 -0
  219. package/dist/suppress-idle-connection-errors-DzApeUb3.mjs.map +1 -0
  220. package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs +1276 -0
  221. package/dist/temporal-presets-5TK1pTYJ-DmhrnMP1.mjs.map +1 -0
  222. package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts +258 -0
  223. package/dist/temporal-presets-BuMqk7h8-DZSuu4Z_.d.mts.map +1 -0
  224. package/dist/text-C3TTEtgd.mjs +35 -0
  225. package/dist/text-C3TTEtgd.mjs.map +1 -0
  226. package/dist/text-C8_-rheN.d.mts +15 -0
  227. package/dist/text-C8_-rheN.d.mts.map +1 -0
  228. package/dist/{tokenizer-1hAHZzmp-QGPORvmA.mjs → tokenizer-C-GTKKjR-B1vOzJy0.mjs} +54 -10
  229. package/dist/tokenizer-C-GTKKjR-B1vOzJy0.mjs.map +1 -0
  230. package/dist/{tokenizer-DcYI0Xrq-C-nNE9mE.d.mts → tokenizer-i8RaVWVa-7fRwlCPP.d.mts} +9 -4
  231. package/dist/tokenizer-i8RaVWVa-7fRwlCPP.d.mts.map +1 -0
  232. package/dist/ts-render.d.mts +2 -2
  233. package/dist/ts-render.mjs +2 -2
  234. package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs +261 -0
  235. package/dist/type-constructor-calls-BLf-HsFy-D_jbIqj8.mjs.map +1 -0
  236. package/dist/{types-BnH4zYvN.mjs → types-B8ULzMAX.mjs} +36 -3
  237. package/dist/types-B8ULzMAX.mjs.map +1 -0
  238. package/dist/types-GNXJ7xW2.d.mts +131 -0
  239. package/dist/types-GNXJ7xW2.d.mts.map +1 -0
  240. package/dist/{types-import-spec-3mjbVBhI-DQI6BvKU.d.mts → types-import-spec-DQjfX-gM-zVncuzs0.d.mts} +6 -6
  241. package/dist/types-import-spec-DQjfX-gM-zVncuzs0.d.mts.map +1 -0
  242. package/dist/utils.d.mts +7 -5
  243. package/dist/utils.mjs +9 -7
  244. package/dist/utils__assertions.mjs +1 -1
  245. package/dist/utils__hash-content.d.mts +1 -1
  246. package/dist/utils__hash-content.mjs +1 -1
  247. package/dist/utils__internal-error.d.mts +1 -1
  248. package/dist/utils__internal-error.mjs +1 -1
  249. package/dist/utils__result.d.mts +2 -2
  250. package/dist/utils__result.mjs +2 -2
  251. package/dist/utils__structured-error.d.mts +2 -2
  252. package/dist/utils__structured-error.mjs +1 -1
  253. package/dist/utils__suppress-idle-connection-errors.d.mts +2 -0
  254. package/dist/utils__suppress-idle-connection-errors.mjs +2 -0
  255. package/dist/utils__text.d.mts +2 -0
  256. package/dist/utils__text.mjs +2 -0
  257. package/dist/{validate-domain-BNBs-TVv.d.mts → validate-domain-B5kmlBFB.d.mts} +10 -6
  258. package/dist/validate-domain-B5kmlBFB.d.mts.map +1 -0
  259. package/dist/{validate-domain-BkvFlY3B.mjs → validate-domain-CbXHDYpF.mjs} +43 -22
  260. package/dist/validate-domain-CbXHDYpF.mjs.map +1 -0
  261. package/dist/validate-once-D-IwXHYP.mjs +42 -0
  262. package/dist/validate-once-D-IwXHYP.mjs.map +1 -0
  263. package/dist/validate-once-gfCOHsDh.d.mts +16 -0
  264. package/dist/validate-once-gfCOHsDh.d.mts.map +1 -0
  265. package/package.json +24 -20
  266. package/dist/apply-specifier-default-control-policy-CAxiXxKg.d.mts.map +0 -1
  267. package/dist/authoring-B2H-9qCv.d.mts +0 -1
  268. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs +0 -25
  269. package/dist/canonicalization-path-match-CNgHuwM_-CCPBeUuk.mjs.map +0 -1
  270. package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs +0 -120
  271. package/dist/capabilities-BCEONw9w-C-lo3rF8.mjs.map +0 -1
  272. package/dist/codec-Cd0QcxAx.mjs +0 -63
  273. package/dist/codec-Cd0QcxAx.mjs.map +0 -1
  274. package/dist/codec-Ce07W3Mz.d.mts +0 -112
  275. package/dist/codec-Ce07W3Mz.d.mts.map +0 -1
  276. package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts +0 -223
  277. package/dist/codec-types-D6VRj2RE-BLElXc-O.d.mts.map +0 -1
  278. package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs +0 -30
  279. package/dist/codec-types-DcNvNeY1-BO6kUiH0.mjs.map +0 -1
  280. package/dist/components-CGA_WwEG.d.mts +0 -50
  281. package/dist/components-CGA_WwEG.d.mts.map +0 -1
  282. package/dist/components-dZRz3T5y.mjs.map +0 -1
  283. package/dist/config-types-BqhNxw0z.mjs +0 -67
  284. package/dist/config-types-BqhNxw0z.mjs.map +0 -1
  285. package/dist/config-types-CW4PDwMC.d.mts.map +0 -1
  286. package/dist/config-validation-DPt5hwQx.mjs +0 -168
  287. package/dist/config-validation-DPt5hwQx.mjs.map +0 -1
  288. package/dist/config-validation-Wiqew2J9.d.mts +0 -21
  289. package/dist/config-validation-Wiqew2J9.d.mts.map +0 -1
  290. package/dist/config__config-validation.d.mts +0 -2
  291. package/dist/config__config-validation.mjs +0 -2
  292. package/dist/contract-types-CkdMH7F7-9EHXSwbH.d.mts.map +0 -1
  293. package/dist/contract-validation-error-DEiWp_EI-CRwtUgRw.mjs.map +0 -1
  294. package/dist/contract-validation-error-R7cMoK04.d.mts.map +0 -1
  295. package/dist/control-BD96JZi8-NUhO5Kkw.mjs.map +0 -1
  296. package/dist/control-BF8qzdnM.d.mts.map +0 -1
  297. package/dist/control-DLEm6u5m.mjs.map +0 -1
  298. package/dist/control-ql9N9u4f-r3Vv41kZ.d.mts.map +0 -1
  299. package/dist/declarations-DR6To8_k-BFwkCGeP.mjs.map +0 -1
  300. package/dist/dist-Dqbo77p7.mjs.map +0 -1
  301. package/dist/domain-envelope-D6Wn9AmZ-BqZKTT9U.d.mts.map +0 -1
  302. package/dist/emission-CmUO03gQ.d.mts +0 -2
  303. package/dist/emission-types-DLXP34Ki-CFms3VrX.d.mts.map +0 -1
  304. package/dist/enum-accessor-Db5DaTNX.mjs +0 -35
  305. package/dist/enum-accessor-Db5DaTNX.mjs.map +0 -1
  306. package/dist/enum-accessor-PH5vjghI.d.mts +0 -85
  307. package/dist/enum-accessor-PH5vjghI.d.mts.map +0 -1
  308. package/dist/execution-Crk6IfTs.mjs +0 -218
  309. package/dist/execution-Crk6IfTs.mjs.map +0 -1
  310. package/dist/execution-Cyl2dXxX.d.mts +0 -115
  311. package/dist/execution-Cyl2dXxX.d.mts.map +0 -1
  312. package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts +0 -777
  313. package/dist/framework-authoring-BhctBwih-DQ_6noDM.d.mts.map +0 -1
  314. package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs +0 -698
  315. package/dist/framework-authoring-CDEvlouU-DKklu-fL.mjs.map +0 -1
  316. package/dist/framework-components-hZ2tO-KH-CdRXBOYd.d.mts.map +0 -1
  317. package/dist/hash-content-Bugg_nZn.mjs.map +0 -1
  318. package/dist/hashing-BtIZVNYX.mjs.map +0 -1
  319. package/dist/hashing-CccSPELN.d.mts +0 -25
  320. package/dist/hashing-CccSPELN.d.mts.map +0 -1
  321. package/dist/hashing-utils-DQgS3nOe.mjs.map +0 -1
  322. package/dist/index-CDk9yEbw.d.mts.map +0 -1
  323. package/dist/internal-error-BIc-ehme-ouBQPoEL.mjs.map +0 -1
  324. package/dist/ir-ChmSSAhX.mjs.map +0 -1
  325. package/dist/migration-BvrgDZXw.d.mts.map +0 -1
  326. package/dist/migration-C57VKLUY.mjs.map +0 -1
  327. package/dist/parse-0ZJjj_2N-DhQpSVmQ.d.mts.map +0 -1
  328. package/dist/parse-GbZGfMUj-BFSrD2AN.mjs.map +0 -1
  329. package/dist/psl-ast-BXZoFQBk.d.mts +0 -37
  330. package/dist/psl-ast-BXZoFQBk.d.mts.map +0 -1
  331. package/dist/psl-ast-CWJQF8LA-Vr5JNPdn.d.mts.map +0 -1
  332. package/dist/psl-ast-DUCvVXbB.mjs +0 -239
  333. package/dist/psl-ast-DUCvVXbB.mjs.map +0 -1
  334. package/dist/psl-parser__syntax.mjs.map +0 -1
  335. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs +0 -59
  336. package/dist/resolve-codec-BZF8TZh_-D-xORT9Q.mjs.map +0 -1
  337. package/dist/resolve-domain-model-BVSb5wS5-C6Yq0dsD.d.mts.map +0 -1
  338. package/dist/result-Bpupv5vO.d.mts.map +0 -1
  339. package/dist/runtime-BqzioOmU.mjs +0 -670
  340. package/dist/runtime-BqzioOmU.mjs.map +0 -1
  341. package/dist/runtime-Cuxw8obj.d.mts +0 -1038
  342. package/dist/runtime-Cuxw8obj.d.mts.map +0 -1
  343. package/dist/structured-error-BsNT4Hun.d.mts.map +0 -1
  344. package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts +0 -125
  345. package/dist/symbol-table-CZ7EVCTL-CR-ncCpD.d.mts.map +0 -1
  346. package/dist/tokenizer-1hAHZzmp-QGPORvmA.mjs.map +0 -1
  347. package/dist/tokenizer-DcYI0Xrq-C-nNE9mE.d.mts.map +0 -1
  348. package/dist/types-BnH4zYvN.mjs.map +0 -1
  349. package/dist/types-ByeQhU9p.d.mts +0 -17
  350. package/dist/types-ByeQhU9p.d.mts.map +0 -1
  351. package/dist/types-import-spec-3mjbVBhI-DQI6BvKU.d.mts.map +0 -1
  352. package/dist/utils-DMAM0unR.mjs.map +0 -1
  353. package/dist/validate-domain-BNBs-TVv.d.mts.map +0 -1
  354. package/dist/validate-domain-BkvFlY3B.mjs.map +0 -1
@@ -1,19 +1,25 @@
1
- import { t as InternalError } from "./internal-error-BIc-ehme-ouBQPoEL.mjs";
2
- import { n as UNSPECIFIED_PSL_NAMESPACE_ID } from "./psl-ast-DUCvVXbB.mjs";
3
- import { k as createSyntaxTree, o as DocumentAst } from "./declarations-DR6To8_k-BFwkCGeP.mjs";
4
- import { n as isTerminatedStringLiteral, t as Tokenizer } from "./tokenizer-1hAHZzmp-QGPORvmA.mjs";
5
- //#region ../../../1-framework/2-authoring/psl-parser/dist/parse-GbZGfMUj.mjs
1
+ import { t as InternalError } from "./internal-error-ChGYPVpq-DhUD05u0.mjs";
2
+ import { r as UNSPECIFIED_PSL_NAMESPACE_ID } from "./psl-ast-CyvE6CR-.mjs";
3
+ import { r as isTerminatedStringLiteral, t as Tokenizer } from "./tokenizer-C-GTKKjR-B1vOzJy0.mjs";
4
+ import { v as createSyntaxTree } from "./expressions-CMQzbnHk-BL2zN0Iv.mjs";
5
+ import { r as DocumentAst } from "./declarations-BgUAq1RG-Dz_-EI1Q.mjs";
6
+ //#region ../../../1-framework/2-authoring/psl-parser/dist/parse-bZgfjovA.mjs
6
7
  const CARRIAGE_RETURN = 13;
7
8
  const LINE_FEED = 10;
8
9
  var SourceFile = class {
10
+ #filename;
9
11
  #text;
10
12
  #lineStarts;
11
- constructor(text) {
13
+ constructor(filename, text) {
14
+ this.#filename = filename;
12
15
  this.#text = text;
13
16
  const lineStarts = [0];
14
17
  for (let offset = 0; offset < text.length; offset++) if (text.charCodeAt(offset) === LINE_FEED) lineStarts.push(offset + 1);
15
18
  this.#lineStarts = lineStarts;
16
19
  }
20
+ get filename() {
21
+ return this.#filename;
22
+ }
17
23
  get text() {
18
24
  return this.#text;
19
25
  }
@@ -52,6 +58,26 @@ var SourceFile = class {
52
58
  const lineEnd = this.#lineEndAt(line);
53
59
  return clamp(lineStart + position.character, lineStart, lineEnd);
54
60
  }
61
+ offsetToPslPosition(offset) {
62
+ const position = this.positionAt(offset);
63
+ return {
64
+ offset,
65
+ line: position.line + 1,
66
+ column: position.character + 1
67
+ };
68
+ }
69
+ rangeToPslSpan(range) {
70
+ return {
71
+ start: this.offsetToPslPosition(this.offsetAt(range.start)),
72
+ end: this.offsetToPslPosition(this.offsetAt(range.end))
73
+ };
74
+ }
75
+ pslSpanToRange(span) {
76
+ return {
77
+ start: this.positionAt(span.start.offset),
78
+ end: this.positionAt(span.end.offset)
79
+ };
80
+ }
55
81
  #lineStartAt(line) {
56
82
  return this.#lineStarts[line] ?? 0;
57
83
  }
@@ -70,6 +96,37 @@ var SourceFile = class {
70
96
  return low;
71
97
  }
72
98
  };
99
+ var PslSources = class PslSources {
100
+ #sourcesByRoot = /* @__PURE__ */ new Map();
101
+ constructor(entries) {
102
+ for (const [root, sourceFile] of entries) this.#sourcesByRoot.set(root, sourceFile);
103
+ }
104
+ /**
105
+ * A new registry uniting this one with `others` — e.g. the per-document
106
+ * `PslSources` registries `parse()` returns for each member of a
107
+ * multi-file schema, united into the one registry `buildSymbolTable` and
108
+ * the interpreters expect.
109
+ */
110
+ merge(...others) {
111
+ return new PslSources([...this.#sourcesByRoot, ...others.flatMap((other) => [...other.#sourcesByRoot])]);
112
+ }
113
+ sourceFileNamed(filename) {
114
+ let match;
115
+ for (const sourceFile of this.#sourcesByRoot.values()) {
116
+ if (sourceFile.filename !== filename) continue;
117
+ if (match !== void 0 && match.text !== sourceFile.text) throw new InternalError(`Ambiguous PSL diagnostic filename "${filename}": registered sources have different text`);
118
+ match = sourceFile;
119
+ }
120
+ if (match === void 0) throw new InternalError(`No SourceFile registered for PSL diagnostic filename "${filename}"`);
121
+ return match;
122
+ }
123
+ sourceFileFor(node) {
124
+ const root = node.root();
125
+ const sourceFile = this.#sourcesByRoot.get(root);
126
+ if (sourceFile === void 0) throw new InternalError("No SourceFile registered for PSL syntax root");
127
+ return sourceFile;
128
+ }
129
+ };
73
130
  function clamp(value, min, max) {
74
131
  if (value < min) return min;
75
132
  if (value > max) return max;
@@ -120,7 +177,7 @@ const TRIVIA_KINDS = /* @__PURE__ */ new Set([
120
177
  "Comment"
121
178
  ]);
122
179
  /**
123
- * The fault-tolerant parser substrate the grammars drive. Trivia is flushed
180
+ * The fault-tolerant parser substrate the parse functions below drive. Trivia is flushed
124
181
  * into the enclosing open node, so every child node spans exactly its first
125
182
  * through last significant token.
126
183
  */
@@ -131,9 +188,9 @@ var Cursor = class {
131
188
  #diagnostics = [];
132
189
  #offset = 0;
133
190
  #depth = 0;
134
- constructor(source) {
191
+ constructor(filename, source) {
135
192
  this.#tokenizer = new Tokenizer(source);
136
- this.#sourceFile = new SourceFile(source);
193
+ this.#sourceFile = new SourceFile(filename, source);
137
194
  }
138
195
  get diagnostics() {
139
196
  return this.#diagnostics;
@@ -159,6 +216,24 @@ var Cursor = class {
159
216
  rawIndex++;
160
217
  }
161
218
  }
219
+ newlineBefore(ahead = 0) {
220
+ let rawIndex = 0;
221
+ let remaining = ahead;
222
+ let newline = false;
223
+ for (;;) {
224
+ const token = this.#tokenizer.peek(rawIndex);
225
+ if (token.kind === "Eof") return newline;
226
+ if (TRIVIA_KINDS.has(token.kind)) {
227
+ if (token.kind === "Newline") newline = true;
228
+ rawIndex++;
229
+ continue;
230
+ }
231
+ if (remaining === 0) return newline;
232
+ remaining--;
233
+ newline = false;
234
+ rawIndex++;
235
+ }
236
+ }
162
237
  /** Span of the significant token `lookahead` positions ahead (`mark(0)` = the next). */
163
238
  mark(lookahead = 0) {
164
239
  let rawIndex = 0;
@@ -226,6 +301,7 @@ var Cursor = class {
226
301
  const start = mark.offset;
227
302
  const end = start + mark.length;
228
303
  this.#diagnostics.push({
304
+ filename: this.#sourceFile.filename,
229
305
  code,
230
306
  message,
231
307
  range: {
@@ -248,10 +324,15 @@ function parseIdentifier(cursor) {
248
324
  * recognised expression, leaving recovery to the caller.
249
325
  */
250
326
  function parseExpression(cursor) {
251
- return parseStringLiteralExpr(cursor) ?? parseNumberLiteralExpr(cursor) ?? parseArrayLiteral(cursor) ?? parseObjectLiteralExpr(cursor) ?? parseFunctionCall(cursor) ?? parseBooleanLiteralExpr(cursor) ?? parseIdentifierExpr(cursor);
327
+ return parseStringLiteralExpr(cursor) ?? parseNumberLiteralExpr(cursor) ?? parseArrayLiteral(cursor) ?? parseObjectLiteralExpr(cursor) ?? parseTaggedLiteral(cursor) ?? parseFunctionCall(cursor) ?? parsePathExpr(cursor) ?? parseBooleanLiteralExpr(cursor) ?? parseIdentifierExpr(cursor);
252
328
  }
329
+ /** A string literal outside a tagged literal, where a backtick string is refused. */
253
330
  function parseStringLiteralExpr(cursor) {
254
331
  if (cursor.peekKind() !== "StringLiteral") return void 0;
332
+ if (cursor.peekToken().text.startsWith("`")) cursor.diagnostic("PSL_BACKTICK_STRING_REQUIRES_TAG", "A backtick string must follow a tag, as in tag`...`.", cursor.mark());
333
+ return parseStringLiteral(cursor);
334
+ }
335
+ function parseStringLiteral(cursor) {
255
336
  const stringMark = cursor.mark();
256
337
  const text = cursor.peekToken().text;
257
338
  cursor.startNode("StringLiteralExpr");
@@ -287,15 +368,36 @@ function parseQualifiedName(cursor) {
287
368
  */
288
369
  function parseQualifiedSegments(cursor, separator) {
289
370
  let seen = 0;
290
- while (cursor.peekKind() === separator) {
371
+ while (cursor.peekKind() === separator && !cursor.newlineBefore()) {
291
372
  seen++;
292
373
  const separatorMark = cursor.mark();
293
374
  cursor.bump();
294
375
  if (seen > 1) cursor.diagnostic("PSL_INVALID_QUALIFIED_NAME", "Qualified name has too many segments", separatorMark);
295
- if (cursor.peekKind() === "Ident") parseIdentifier(cursor);
296
- else cursor.diagnostic("PSL_INVALID_QUALIFIED_NAME", "Qualified name is missing a name after the separator", cursor.mark());
376
+ if (cursor.peekKind() === "Ident" && !cursor.newlineBefore()) parseIdentifier(cursor);
377
+ else reportMissingSegment(cursor);
297
378
  }
298
379
  }
380
+ function reportMissingSegment(cursor) {
381
+ cursor.diagnostic("PSL_INVALID_QUALIFIED_NAME", "Qualified name is missing a name after the separator", cursor.markAfterLastToken());
382
+ }
383
+ /**
384
+ * Whether the next tokens open a tagged literal: a bare `Ident` or a
385
+ * namespace-qualified `Ident.Ident`, then a string. Trivia may sit anywhere
386
+ * between them. Bounded like {@link isCallAhead}.
387
+ */
388
+ function isTaggedLiteralAhead(cursor) {
389
+ if (cursor.peekKind() !== "Ident") return false;
390
+ if (cursor.peekKind(1) === "StringLiteral") return true;
391
+ return cursor.peekKind(1) === "Dot" && cursor.peekKind(2) === "Ident" && cursor.peekKind(3) === "StringLiteral";
392
+ }
393
+ /** Parses `` tag`body` ``, `tag"body"`, or `tag'body'`: a qualified name, then a string literal. */
394
+ function parseTaggedLiteral(cursor) {
395
+ if (!isTaggedLiteralAhead(cursor)) return void 0;
396
+ cursor.startNode("TaggedLiteral");
397
+ parseQualifiedName(cursor);
398
+ parseStringLiteral(cursor);
399
+ return cursor.finishNode();
400
+ }
299
401
  function parseBooleanLiteralExpr(cursor) {
300
402
  if (cursor.peekKind() !== "Ident") return void 0;
301
403
  const text = cursor.peekToken().text;
@@ -353,29 +455,78 @@ function parseObjectField(cursor) {
353
455
  return cursor.finishNode();
354
456
  }
355
457
  /**
356
- * Whether the next tokens open a call: a bare `Ident(` or a namespace-qualified
357
- * `Ident.Ident(`. The lookahead is deliberately bounded so a bare dotted
358
- * reference like `a.b` is not mistaken for a call, rather than scanning an
359
- * unbounded dotted chain ahead to find the paren.
458
+ * The dotted chain `Ident ('.' Ident)*` at the cursor, which stays on one line. `length` counts its
459
+ * significant tokens: 1 for `a`, 3 for `a.b`, 5 for `a.b.c`; 0 when no `Ident` is next.
460
+ * `trailingDot` marks a chain that ends in a `.` with no name after it, as in `auth.`.
461
+ */
462
+ function dottedChain(cursor) {
463
+ if (cursor.peekKind() !== "Ident") return {
464
+ length: 0,
465
+ trailingDot: false
466
+ };
467
+ let length = 1;
468
+ while (cursor.peekKind(length) === "Dot" && !cursor.newlineBefore(length)) {
469
+ if (cursor.peekKind(length + 1) !== "Ident" || cursor.newlineBefore(length + 1)) return {
470
+ length,
471
+ trailingDot: true
472
+ };
473
+ length += 2;
474
+ }
475
+ return {
476
+ length,
477
+ trailingDot: false
478
+ };
479
+ }
480
+ /**
481
+ * Whether the next tokens open a call: a dotted chain followed by `(`, such as
482
+ * `autoincrement(`, `temporal.updatedAt(` or `address.geo.lat(`. A dotted chain
483
+ * with no `(` after it, like `a.b`, is a path, not a call.
360
484
  */
361
485
  function isCallAhead(cursor) {
362
- if (cursor.peekKind() !== "Ident") return false;
363
- if (cursor.peekKind(1) === "LParen") return true;
364
- return cursor.peekKind(1) === "Dot" && cursor.peekKind(2) === "Ident" && cursor.peekKind(3) === "LParen";
486
+ const chain = dottedChain(cursor);
487
+ return chain.length > 0 && !chain.trailingDot && cursor.peekKind(chain.length) === "LParen";
365
488
  }
366
489
  /**
367
- * Parses a function/constructor call — bare `autoincrement()` or qualified
368
- * `temporal.updatedAt()`. Returns `undefined` unless {@link isCallAhead}
369
- * confirms a trailing `(`, so the `parseExpression` chain falls through to the
370
- * boolean and bare-identifier forms.
490
+ * Parses a function/constructor call — bare `autoincrement()` or dotted
491
+ * `address.city(sort: Asc)`. A dotted callee is a `PathExpr`, the node the same
492
+ * chain gets without the call, so `address.city` has one shape whether or not
493
+ * it is called; a bare callee is a `QualifiedName`. Returns `undefined` unless
494
+ * {@link isCallAhead} confirms a trailing `(`, so the `parseExpression` chain
495
+ * falls through to the path, boolean and bare-identifier forms.
371
496
  */
372
497
  function parseFunctionCall(cursor) {
373
498
  if (!isCallAhead(cursor)) return void 0;
499
+ const chain = dottedChain(cursor);
374
500
  cursor.startNode("FunctionCall");
375
- parseQualifiedName(cursor);
501
+ if (chain.length > 1) parsePath(cursor, chain);
502
+ else parseQualifiedName(cursor);
376
503
  if (cursor.peekKind() === "LParen") parseParenArgs(cursor);
377
504
  return cursor.finishNode();
378
505
  }
506
+ /**
507
+ * Parses a member path `Ident ('.' Ident)+` that is neither a call nor the tag
508
+ * of a tagged literal, such as `address.city` in `@@index([address.city])`. A
509
+ * path that ends in a `.` keeps the dot and reports the missing name, as in
510
+ * `auth.` while the member is still being typed.
511
+ */
512
+ function parsePathExpr(cursor) {
513
+ const chain = dottedChain(cursor);
514
+ if (chain.length < 3 && !chain.trailingDot) return void 0;
515
+ return parsePath(cursor, chain);
516
+ }
517
+ function parsePath(cursor, chain) {
518
+ cursor.startNode("PathExpr");
519
+ parseIdentifier(cursor);
520
+ for (let consumed = 1; consumed < chain.length; consumed += 2) {
521
+ cursor.bump();
522
+ parseIdentifier(cursor);
523
+ }
524
+ if (chain.trailingDot) {
525
+ cursor.bump();
526
+ reportMissingSegment(cursor);
527
+ }
528
+ return cursor.finishNode();
529
+ }
379
530
  /** Parses a parenthesised, comma-separated `AttributeArg` list into the currently open node. */
380
531
  function parseParenArgs(cursor) {
381
532
  cursor.bump();
@@ -405,52 +556,91 @@ function parseAttributeArgList(cursor) {
405
556
  parseParenArgs(cursor);
406
557
  return cursor.finishNode();
407
558
  }
559
+ const LIST_CLOSERS = {
560
+ AttributeArgList: "RParen",
561
+ FunctionCall: "RParen",
562
+ ArrayLiteral: "RBracket",
563
+ ObjectLiteralExpr: "RBrace"
564
+ };
565
+ function isUnclosed(node) {
566
+ const closer = LIST_CLOSERS[node.kind];
567
+ if (closer === void 0) return node.children.some((child) => child.type === "node" && isUnclosed(child));
568
+ const last = node.children.at(-1);
569
+ return last?.type !== "token" || last.kind !== closer;
570
+ }
571
+ function consumeLeftover(cursor, code, place, diagnosticsBefore) {
572
+ const kind = cursor.peekKind();
573
+ if (kind === "Eof" || kind === "RBrace" || cursor.newlineBefore()) return false;
574
+ if (cursor.diagnostics.length === diagnosticsBefore) cursor.diagnostic(code, `Unexpected "${cursor.peekToken().text}" in ${place}`, cursor.mark());
575
+ cursor.recoverToSyncPoint();
576
+ return true;
577
+ }
408
578
  function parseAttribute(cursor) {
409
579
  const isBlockAttribute = cursor.peekKind() === "DoubleAt";
410
580
  const attributeMark = cursor.mark();
581
+ const diagnosticsBefore = cursor.diagnostics.length;
411
582
  cursor.startNode(isBlockAttribute ? "ModelAttribute" : "FieldAttribute");
412
583
  cursor.bump();
413
584
  if (cursor.peekKind() === "Ident") parseQualifiedName(cursor);
414
585
  else cursor.diagnostic("PSL_INVALID_ATTRIBUTE_SYNTAX", "Attribute name expected", attributeMark);
415
- if (cursor.peekKind() === "LParen") parseAttributeArgList(cursor);
586
+ if (cursor.peekKind() === "LParen" && isUnclosed(parseAttributeArgList(cursor))) consumeLeftover(cursor, "PSL_INVALID_ATTRIBUTE_SYNTAX", "attribute arguments", diagnosticsBefore);
416
587
  return cursor.finishNode();
417
588
  }
418
589
  /**
419
- * A type annotation: `QualifiedName (argList)? ([])? (?)?`, e.g.
420
- * `pgvector.Vector(1536)[]?`. When the field has no type, no node is emitted —
421
- * a missing type is the absence of a `TypeAnnotation`, not a zero-width one.
590
+ * A type annotation: `QualifiedName (argList)? (?)? ([])? (?)?`, e.g.
591
+ * `pgvector.Vector(1536)?[]?`. The two `?` positions are distinct axes: a `?`
592
+ * before `[]` makes the list elements nullable; a `?` after `[]` makes the
593
+ * list itself nullable. Without a `[]`, a single `?` is the field-level
594
+ * optional (`Foo?`), so a second `?` (`Foo??`) is malformed. When the field
595
+ * has no type, no node is emitted — a missing type is the absence of a
596
+ * `TypeAnnotation`, not a zero-width one.
422
597
  */
423
- function parseTypeAnnotation(cursor) {
598
+ function parseTypeAnnotation(cursor, memberCode) {
424
599
  const kind = cursor.peekKind();
425
600
  if (kind !== "Ident" && kind !== "LBracket" && kind !== "Question") return;
426
601
  cursor.startNode("TypeAnnotation");
427
602
  if (cursor.peekKind() === "Ident") {
428
603
  parseQualifiedName(cursor);
429
- if (cursor.peekKind() === "LParen") parseAttributeArgList(cursor);
604
+ const diagnosticsBefore = cursor.diagnostics.length;
605
+ if (cursor.peekKind() === "LParen" && isUnclosed(parseAttributeArgList(cursor)) && consumeLeftover(cursor, memberCode, "type arguments", diagnosticsBefore)) {
606
+ cursor.finishNode();
607
+ return;
608
+ }
430
609
  }
610
+ const hasLeadingQuestion = cursor.peekKind() === "Question";
611
+ if (hasLeadingQuestion) cursor.bump();
612
+ let isListType = false;
431
613
  if (cursor.peekKind() === "LBracket") {
614
+ isListType = true;
432
615
  cursor.bump();
433
616
  if (cursor.peekKind() === "RBracket") cursor.bump();
434
617
  }
435
- if (cursor.peekKind() === "Question") cursor.bump();
618
+ let trailingAllowed = isListType || !hasLeadingQuestion;
619
+ while (cursor.peekKind() === "Question") {
620
+ if (!trailingAllowed) cursor.diagnostic(memberCode, "Unexpected \"?\"; a type may be optional (`Foo?`), a list (`Foo[]`), have nullable elements (`Foo?[]`), or both (`Foo?[]?`)", cursor.mark());
621
+ cursor.bump();
622
+ trailingAllowed = false;
623
+ }
436
624
  cursor.finishNode();
437
625
  }
438
626
  /**
439
627
  * Parses a full PSL document. Never throws — malformed input yields diagnostics
440
628
  * and a recovered tree, not an exception.
441
629
  */
442
- function parse(source) {
443
- const cursor = new Cursor(source);
444
- const root = createSyntaxTree(parseDocument(cursor));
630
+ function parse(source, filename, options = {}) {
631
+ const cursor = new Cursor(filename, source);
632
+ const root = createSyntaxTree(parseDocument(cursor, options));
633
+ const document = DocumentAst.cast(root) ?? new DocumentAst(root);
634
+ const sources = new PslSources([[document.syntax, cursor.sourceFile]]);
445
635
  return {
446
- document: DocumentAst.cast(root) ?? new DocumentAst(root),
636
+ document,
447
637
  diagnostics: cursor.diagnostics,
448
- sourceFile: cursor.sourceFile
638
+ sources
449
639
  };
450
640
  }
451
- function parseDocument(cursor) {
641
+ function parseDocument(cursor, options) {
452
642
  cursor.startNode("Document");
453
- while (cursor.peekKind() !== "Eof") parseDeclaration(cursor, false);
643
+ while (cursor.peekKind() !== "Eof") parseDeclaration(cursor, false, options);
454
644
  cursor.flushTrivia();
455
645
  return cursor.finishNode();
456
646
  }
@@ -460,6 +650,15 @@ const RESERVED_BLOCK_KEYWORDS = /* @__PURE__ */ new Set([
460
650
  "type",
461
651
  "types"
462
652
  ]);
653
+ const MIXIN_KEYWORD = "mixin";
654
+ const KEYWORDS_WITHOUT_MIXINS = /* @__PURE__ */ new Set([
655
+ "namespace",
656
+ "types",
657
+ MIXIN_KEYWORD
658
+ ]);
659
+ function isMixinHeaderAhead(cursor) {
660
+ return cursor.peekKind() === "Ident" && cursor.peekKind(1) === "Ident" && cursor.peekToken(1).text === MIXIN_KEYWORD;
661
+ }
463
662
  function keywordIs(cursor, keyword) {
464
663
  return cursor.peekKind() === "Ident" && cursor.peekToken().text === keyword;
465
664
  }
@@ -469,12 +668,16 @@ function keywordIs(cursor, keyword) {
469
668
  * Recovery runs via the `if (!node)` tail rather than as a `??` arm, because it
470
669
  * appends raw tokens to the open parent instead of returning a child node.
471
670
  */
472
- function parseDeclaration(cursor, insideNamespace) {
671
+ function parseDeclaration(cursor, insideNamespace, options) {
672
+ if (isMixinHeaderAhead(cursor)) {
673
+ parseMixinDeclaration(cursor, options);
674
+ return;
675
+ }
473
676
  const name = cursor.peekKind(1) === "Ident" ? cursor.peekToken(1).text : "";
474
677
  if (insideNamespace && keywordIs(cursor, "namespace")) cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", `Recursive "namespace ${name}" block is not allowed; namespace blocks may not nest`, cursor.mark());
475
678
  else if (insideNamespace && keywordIs(cursor, "types")) cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", "`types` blocks must be declared at the document top level, not inside a namespace block", cursor.mark());
476
679
  else if (keywordIs(cursor, "namespace") && name === "__unspecified__") cursor.diagnostic("PSL_INVALID_NAMESPACE_BLOCK", `Namespace name "${UNSPECIFIED_PSL_NAMESPACE_ID}" is reserved for the parser-synthesised bucket for top-level declarations`, cursor.mark(1));
477
- if (!(parseModel(cursor) ?? parseNamespace(cursor) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor))) parseUnsupportedTopLevel(cursor);
680
+ if (!(parseModel(cursor) ?? parseNamespace(cursor, options) ?? parseCompositeType(cursor) ?? parseTypesBlock(cursor) ?? parseGenericBlock(cursor, options))) parseUnsupportedTopLevel(cursor);
478
681
  }
479
682
  /**
480
683
  * Reports only the first missing piece — a missing name suppresses the
@@ -497,13 +700,36 @@ function parseModel(cursor) {
497
700
  if (!keywordIs(cursor, "model")) return void 0;
498
701
  return parseBlock(cursor, "ModelDeclaration", true, parseModelMember);
499
702
  }
703
+ function parseMixinDeclaration(cursor, options) {
704
+ const keyword = cursor.peekToken().text;
705
+ const keywordMark = cursor.mark();
706
+ const mixinMark = cursor.mark(1);
707
+ cursor.startNode("MixinDeclaration");
708
+ cursor.bump();
709
+ cursor.bump();
710
+ const hasName = cursor.peekKind() === "Ident" && (!cursor.newlineBefore() || cursor.peekKind(1) === "LBrace");
711
+ if (hasName) parseIdentifier(cursor);
712
+ const hasBody = cursor.peekKind() === "LBrace";
713
+ if (KEYWORDS_WITHOUT_MIXINS.has(keyword)) cursor.diagnostic("PSL_INVALID_DECLARATION", `A mixin cannot be declared for "${keyword}"`, keywordMark);
714
+ else if (!hasName) cursor.diagnostic("PSL_INVALID_DECLARATION", `Expected a mixin name after "${MIXIN_KEYWORD}"`, mixinMark);
715
+ else if (!hasBody) cursor.diagnostic("PSL_INVALID_DECLARATION", `Expected "{" to open the "${keyword} ${MIXIN_KEYWORD}" block`, cursor.markAfterLastToken());
716
+ if (hasBody) parseBlockBody(cursor, mixinMemberParser(keyword, options));
717
+ else cursor.recoverToSyncPoint();
718
+ return cursor.finishNode();
719
+ }
720
+ function mixinMemberParser(keyword, options) {
721
+ if (keyword === "namespace") return (inner) => parseDeclaration(inner, true, options);
722
+ if (keyword === "types") return parseNamedTypeMember;
723
+ if (keyword === "model" || keyword === "type") return parseModelMember;
724
+ return genericBlockMemberParser(keyword, options);
725
+ }
500
726
  /**
501
727
  * Excluding the reserved keywords keeps a malformed reserved block (e.g. `model
502
728
  * {` with no name) routed to its dedicated parser. The generic keyword set is
503
729
  * open, so a bare identifier with no brace (e.g. `oops`) is read as an unfinished
504
730
  * custom declaration rather than unsupported content.
505
731
  */
506
- function parseGenericBlock(cursor) {
732
+ function parseGenericBlock(cursor, options) {
507
733
  if (cursor.peekKind() !== "Ident") return void 0;
508
734
  const keyword = cursor.peekToken().text;
509
735
  if (RESERVED_BLOCK_KEYWORDS.has(keyword)) return void 0;
@@ -511,16 +737,16 @@ function parseGenericBlock(cursor) {
511
737
  cursor.startNode("GenericBlockDeclaration");
512
738
  cursor.bump();
513
739
  if (hasName) parseIdentifier(cursor);
514
- if (cursor.peekKind() === "LBrace") parseBlockBody(cursor, parseKeyValueMember);
740
+ if (cursor.peekKind() === "LBrace") parseBlockBody(cursor, genericBlockMemberParser(keyword, options));
515
741
  else {
516
742
  cursor.diagnostic("PSL_INVALID_DECLARATION", `Expected "{" to open the "${keyword}" block`, cursor.markAfterLastToken());
517
743
  cursor.recoverToSyncPoint();
518
744
  }
519
745
  return cursor.finishNode();
520
746
  }
521
- function parseNamespace(cursor) {
747
+ function parseNamespace(cursor, options) {
522
748
  if (!keywordIs(cursor, "namespace")) return void 0;
523
- return parseBlock(cursor, "Namespace", true, (inner) => parseDeclaration(inner, true));
749
+ return parseBlock(cursor, "Namespace", true, (inner) => parseDeclaration(inner, true, options));
524
750
  }
525
751
  function parseCompositeType(cursor) {
526
752
  if (!keywordIs(cursor, "type")) return void 0;
@@ -558,19 +784,44 @@ function parseBlockAttribute(cursor) {
558
784
  if (cursor.peekKind() !== "DoubleAt") return void 0;
559
785
  return parseAttribute(cursor);
560
786
  }
787
+ function parseMixinInclusion(cursor, memberCode) {
788
+ if (cursor.peekKind() !== "Plus") return void 0;
789
+ const plusMark = cursor.mark();
790
+ cursor.startNode("MixinInclusion");
791
+ cursor.bump();
792
+ if (cursor.peekKind() === "Ident" && !cursor.newlineBefore()) parseQualifiedName(cursor);
793
+ else {
794
+ cursor.diagnostic(memberCode, "Expected a mixin name after \"+\"", plusMark);
795
+ cursor.recoverToSyncPoint();
796
+ }
797
+ return cursor.finishNode();
798
+ }
561
799
  function parseModelMember(cursor) {
562
- if (!(parseBlockAttribute(cursor) ?? parseField(cursor))) invalidMember(cursor, "PSL_INVALID_MODEL_MEMBER", `Invalid model member declaration "${cursor.peekToken().text}"`);
800
+ if (!(parseMixinInclusion(cursor, "PSL_INVALID_MODEL_MEMBER") ?? parseBlockAttribute(cursor) ?? parseField(cursor))) invalidMember(cursor, "PSL_INVALID_MODEL_MEMBER", `Invalid model member declaration "${cursor.peekToken().text}"`);
563
801
  }
564
802
  function parseNamedTypeMember(cursor) {
565
803
  if (!parseNamedType(cursor)) invalidMember(cursor, "PSL_INVALID_TYPES_MEMBER", `Invalid types declaration "${cursor.peekToken().text}"`);
566
804
  }
567
805
  /**
806
+ * A generic block reads `key = value` entries and bare keys; in an `enum` block those may carry `@`
807
+ * attributes (`USER @map("user")`). In the `prisma-7` grammar, a `view` body is read like a model
808
+ * body. Each interpreter decides whether it accepts the block and its members.
809
+ */
810
+ function genericBlockMemberParser(keyword, options) {
811
+ if (keyword === "view" && options.grammar === "prisma-7") return parseModelMember;
812
+ if (keyword === "enum") return parseEnumMember;
813
+ return parseKeyValueMember;
814
+ }
815
+ /**
568
816
  * A generic-block member is either a `@@`-block attribute or a `key = value`
569
817
  * entry. The block-attribute alternative is purely syntactic — it does not judge
570
818
  * whether the attribute is valid for the block's kind.
571
819
  */
572
820
  function parseKeyValueMember(cursor) {
573
- if (!(parseBlockAttribute(cursor) ?? parseKeyValue(cursor))) invalidMember(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER", "Invalid block entry");
821
+ if (!(parseMixinInclusion(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER") ?? parseBlockAttribute(cursor) ?? parseKeyValue(cursor))) invalidMember(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER", "Invalid block entry");
822
+ }
823
+ function parseEnumMember(cursor) {
824
+ if (!(parseMixinInclusion(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER") ?? parseBlockAttribute(cursor) ?? parseKeyValue(cursor, { memberAttributes: true }))) invalidMember(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER", "Invalid block entry");
574
825
  }
575
826
  function invalidMember(cursor, code, message) {
576
827
  cursor.diagnostic(code, message, cursor.mark());
@@ -584,7 +835,7 @@ function parseField(cursor) {
584
835
  const nameText = cursor.peekToken().text;
585
836
  parseIdentifier(cursor);
586
837
  if (cursor.peekKind() !== "Ident") cursor.diagnostic("PSL_INVALID_MODEL_MEMBER", `Expected a type after field "${nameText}"`, nameMark);
587
- parseTypeAnnotation(cursor);
838
+ parseTypeAnnotation(cursor, "PSL_INVALID_MODEL_MEMBER");
588
839
  while (cursor.peekKind() === "At") parseAttribute(cursor);
589
840
  return cursor.finishNode();
590
841
  }
@@ -596,26 +847,31 @@ function parseNamedType(cursor) {
596
847
  parseIdentifier(cursor);
597
848
  if (cursor.peekKind() === "Equals") cursor.bump();
598
849
  else cursor.diagnostic("PSL_INVALID_TYPES_MEMBER", `Expected "=" after "${nameText}"`, nameMark);
599
- parseTypeAnnotation(cursor);
850
+ parseTypeAnnotation(cursor, "PSL_INVALID_TYPES_MEMBER");
600
851
  while (cursor.peekKind() === "At") parseAttribute(cursor);
601
852
  return cursor.finishNode();
602
853
  }
603
854
  /**
604
855
  * A generic-block entry is either `key = value` or a bare `key` (committing a
605
- * `KeyValuePair` carrying only the key). A `key =` with no following expression
606
- * is flagged.
856
+ * `KeyValuePair` carrying only the key). With `memberAttributes` (enum blocks) any number of `@`
857
+ * attributes may follow, as in `USER @map("user")`. A `key =` with no following expression is
858
+ * flagged.
607
859
  */
608
- function parseKeyValue(cursor) {
860
+ function parseKeyValue(cursor, options = { memberAttributes: false }) {
609
861
  if (cursor.peekKind() !== "Ident") return void 0;
610
862
  cursor.startNode("KeyValuePair");
611
863
  parseIdentifier(cursor);
612
864
  if (cursor.peekKind() === "Equals") {
613
865
  cursor.bump();
614
- if (!parseExpression(cursor)) cursor.diagnostic("PSL_INVALID_EXTENSION_BLOCK_MEMBER", "Expected a value after \"=\"", cursor.mark());
866
+ const diagnosticsBefore = cursor.diagnostics.length;
867
+ const value = parseExpression(cursor);
868
+ if (!value) cursor.diagnostic("PSL_INVALID_EXTENSION_BLOCK_MEMBER", "Expected a value after \"=\"", cursor.mark());
869
+ if (!value || isUnclosed(value)) consumeLeftover(cursor, "PSL_INVALID_EXTENSION_BLOCK_MEMBER", "the entry value", diagnosticsBefore);
615
870
  }
871
+ while (options.memberAttributes && cursor.peekKind() === "At") parseAttribute(cursor);
616
872
  return cursor.finishNode();
617
873
  }
618
874
  //#endregion
619
- export { parse as a, greenToken as i, SourceFile as n, greenNode as r, GreenNodeBuilder as t };
875
+ export { greenToken as a, greenNode as i, PslSources as n, parse as o, SourceFile as r, GreenNodeBuilder as t };
620
876
 
621
- //# sourceMappingURL=parse-GbZGfMUj-BFSrD2AN.mjs.map
877
+ //# sourceMappingURL=parse-bZgfjovA-BNgYhylT.mjs.map