@nicia-ai/typegraph 0.46.2 → 0.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (294) hide show
  1. package/README.md +20 -1
  2. package/dist/backend/drizzle/indexes.cjs +9 -9
  3. package/dist/backend/drizzle/indexes.d.cts +1 -1
  4. package/dist/backend/drizzle/indexes.d.ts +1 -1
  5. package/dist/backend/drizzle/indexes.js +5 -5
  6. package/dist/backend/index.cjs +50 -49
  7. package/dist/backend/index.d.cts +3 -3
  8. package/dist/backend/index.d.ts +3 -3
  9. package/dist/backend/index.js +11 -10
  10. package/dist/backend/postgres/index.cjs +27 -26
  11. package/dist/backend/postgres/index.d.cts +6 -6
  12. package/dist/backend/postgres/index.d.ts +6 -6
  13. package/dist/backend/postgres/index.js +14 -13
  14. package/dist/backend/postgres/pglite-store.cjs +34 -33
  15. package/dist/backend/postgres/pglite-store.cjs.map +1 -1
  16. package/dist/backend/postgres/pglite-store.d.cts +8 -8
  17. package/dist/backend/postgres/pglite-store.d.ts +8 -8
  18. package/dist/backend/postgres/pglite-store.js +30 -29
  19. package/dist/backend/postgres/pglite-store.js.map +1 -1
  20. package/dist/backend/postgres/pglite.cjs +16 -15
  21. package/dist/backend/postgres/pglite.d.cts +3 -3
  22. package/dist/backend/postgres/pglite.d.ts +3 -3
  23. package/dist/backend/postgres/pglite.js +15 -14
  24. package/dist/backend/sqlite/index.cjs +24 -23
  25. package/dist/backend/sqlite/index.d.cts +6 -6
  26. package/dist/backend/sqlite/index.d.ts +6 -6
  27. package/dist/backend/sqlite/index.js +12 -11
  28. package/dist/backend/sqlite/libsql.cjs +19 -18
  29. package/dist/backend/sqlite/libsql.cjs.map +1 -1
  30. package/dist/backend/sqlite/libsql.d.cts +3 -3
  31. package/dist/backend/sqlite/libsql.d.ts +3 -3
  32. package/dist/backend/sqlite/libsql.js +14 -13
  33. package/dist/backend/sqlite/libsql.js.map +1 -1
  34. package/dist/backend/sqlite/local-store.cjs +35 -34
  35. package/dist/backend/sqlite/local-store.cjs.map +1 -1
  36. package/dist/backend/sqlite/local-store.d.cts +8 -8
  37. package/dist/backend/sqlite/local-store.d.ts +8 -8
  38. package/dist/backend/sqlite/local-store.js +31 -30
  39. package/dist/backend/sqlite/local-store.js.map +1 -1
  40. package/dist/backend/sqlite/local.cjs +17 -16
  41. package/dist/backend/sqlite/local.d.cts +3 -3
  42. package/dist/backend/sqlite/local.d.ts +3 -3
  43. package/dist/backend/sqlite/local.js +15 -14
  44. package/dist/{chunk-TCT66A7N.cjs → chunk-26YKDNUD.cjs} +10 -10
  45. package/dist/{chunk-TCT66A7N.cjs.map → chunk-26YKDNUD.cjs.map} +1 -1
  46. package/dist/{chunk-QOJ2L2AD.js → chunk-3DMMGT6S.js} +3 -3
  47. package/dist/{chunk-QOJ2L2AD.js.map → chunk-3DMMGT6S.js.map} +1 -1
  48. package/dist/{chunk-ANKOXPCC.cjs → chunk-3HGRTCDU.cjs} +6 -4
  49. package/dist/chunk-3HGRTCDU.cjs.map +1 -0
  50. package/dist/{chunk-QU7QLJA4.cjs → chunk-3U5ABFDW.cjs} +26 -26
  51. package/dist/{chunk-QU7QLJA4.cjs.map → chunk-3U5ABFDW.cjs.map} +1 -1
  52. package/dist/{chunk-5PDSCELM.cjs → chunk-425IZOQ5.cjs} +11 -164
  53. package/dist/chunk-425IZOQ5.cjs.map +1 -0
  54. package/dist/{chunk-S7WIRFNS.cjs → chunk-5FBRVORR.cjs} +12 -12
  55. package/dist/{chunk-S7WIRFNS.cjs.map → chunk-5FBRVORR.cjs.map} +1 -1
  56. package/dist/{chunk-GWXXHOLU.js → chunk-5FT3TLPK.js} +11 -11
  57. package/dist/{chunk-GWXXHOLU.js.map → chunk-5FT3TLPK.js.map} +1 -1
  58. package/dist/{chunk-S3G5VLSW.js → chunk-5UMTUOM5.js} +6 -6
  59. package/dist/{chunk-S3G5VLSW.js.map → chunk-5UMTUOM5.js.map} +1 -1
  60. package/dist/{chunk-RFDEYLIK.js → chunk-6FWSNSRE.js} +7 -7
  61. package/dist/{chunk-RFDEYLIK.js.map → chunk-6FWSNSRE.js.map} +1 -1
  62. package/dist/{chunk-F36KZDFX.cjs → chunk-6JVZSOHQ.cjs} +91 -91
  63. package/dist/{chunk-F36KZDFX.cjs.map → chunk-6JVZSOHQ.cjs.map} +1 -1
  64. package/dist/chunk-6KFLYYOC.cjs +161 -0
  65. package/dist/chunk-6KFLYYOC.cjs.map +1 -0
  66. package/dist/{chunk-D6GCNNMK.cjs → chunk-6NGW27EO.cjs} +10 -10
  67. package/dist/{chunk-D6GCNNMK.cjs.map → chunk-6NGW27EO.cjs.map} +1 -1
  68. package/dist/{chunk-WHS2Y43J.js → chunk-6SWPJEYN.js} +5 -5
  69. package/dist/{chunk-WHS2Y43J.js.map → chunk-6SWPJEYN.js.map} +1 -1
  70. package/dist/{chunk-7TKNK32B.js → chunk-7SQSZN2J.js} +5 -5
  71. package/dist/{chunk-7TKNK32B.js.map → chunk-7SQSZN2J.js.map} +1 -1
  72. package/dist/{chunk-BEB4OFZF.cjs → chunk-AMMWA76F.cjs} +51 -59
  73. package/dist/chunk-AMMWA76F.cjs.map +1 -0
  74. package/dist/{chunk-PYKF7UIL.cjs → chunk-AOSSQDVO.cjs} +13 -13
  75. package/dist/{chunk-PYKF7UIL.cjs.map → chunk-AOSSQDVO.cjs.map} +1 -1
  76. package/dist/{chunk-EDHV4CBU.js → chunk-AVGUJWVX.js} +30 -10
  77. package/dist/chunk-AVGUJWVX.js.map +1 -0
  78. package/dist/{chunk-C2ZP5YS6.cjs → chunk-BCQ76AXA.cjs} +258 -153
  79. package/dist/chunk-BCQ76AXA.cjs.map +1 -0
  80. package/dist/{chunk-WA64ZSCA.cjs → chunk-BFUOME67.cjs} +11 -11
  81. package/dist/{chunk-WA64ZSCA.cjs.map → chunk-BFUOME67.cjs.map} +1 -1
  82. package/dist/{chunk-C6KE2HSQ.cjs → chunk-BR7SHKGM.cjs} +1611 -1382
  83. package/dist/chunk-BR7SHKGM.cjs.map +1 -0
  84. package/dist/{chunk-FCIZNUW5.js → chunk-CHAOFCHV.js} +3 -3
  85. package/dist/{chunk-FCIZNUW5.js.map → chunk-CHAOFCHV.js.map} +1 -1
  86. package/dist/chunk-CICO5GXD.cjs +12 -0
  87. package/dist/{chunk-73MWKDFK.cjs.map → chunk-CICO5GXD.cjs.map} +1 -1
  88. package/dist/{chunk-SXWLLQ3D.js → chunk-D5R42W5D.js} +4 -4
  89. package/dist/{chunk-SXWLLQ3D.js.map → chunk-D5R42W5D.js.map} +1 -1
  90. package/dist/{chunk-YQ4JONWE.js → chunk-DJZTXBWY.js} +342 -113
  91. package/dist/chunk-DJZTXBWY.js.map +1 -0
  92. package/dist/{chunk-BZZI7B43.cjs → chunk-DO7SAMEK.cjs} +47 -47
  93. package/dist/{chunk-BZZI7B43.cjs.map → chunk-DO7SAMEK.cjs.map} +1 -1
  94. package/dist/{chunk-2ZWM2RFH.cjs → chunk-EDN4Y4ZG.cjs} +9 -9
  95. package/dist/{chunk-2ZWM2RFH.cjs.map → chunk-EDN4Y4ZG.cjs.map} +1 -1
  96. package/dist/{chunk-E4OSGBCM.cjs → chunk-EMIB2RXD.cjs} +131 -131
  97. package/dist/{chunk-E4OSGBCM.cjs.map → chunk-EMIB2RXD.cjs.map} +1 -1
  98. package/dist/{chunk-GWUWRZXW.js → chunk-EP4RUYD6.js} +3 -3
  99. package/dist/{chunk-GWUWRZXW.js.map → chunk-EP4RUYD6.js.map} +1 -1
  100. package/dist/{chunk-LHYSY6SE.js → chunk-FNOMT74T.js} +10 -8
  101. package/dist/chunk-FNOMT74T.js.map +1 -0
  102. package/dist/{chunk-ZBVZ7HXD.cjs → chunk-FQPEMEWX.cjs} +12 -12
  103. package/dist/{chunk-ZBVZ7HXD.cjs.map → chunk-FQPEMEWX.cjs.map} +1 -1
  104. package/dist/{chunk-LNIWCQR4.js → chunk-GLHXM7C4.js} +3 -3
  105. package/dist/{chunk-LNIWCQR4.js.map → chunk-GLHXM7C4.js.map} +1 -1
  106. package/dist/{chunk-6BD6ZBKT.cjs → chunk-GYEG3ZLZ.cjs} +10 -10
  107. package/dist/{chunk-6BD6ZBKT.cjs.map → chunk-GYEG3ZLZ.cjs.map} +1 -1
  108. package/dist/{chunk-XBHRKLZU.cjs → chunk-GYUJZARH.cjs} +4 -4
  109. package/dist/{chunk-XBHRKLZU.cjs.map → chunk-GYUJZARH.cjs.map} +1 -1
  110. package/dist/{chunk-A7NMUYEL.cjs → chunk-HDL2ARHX.cjs} +27 -27
  111. package/dist/{chunk-A7NMUYEL.cjs.map → chunk-HDL2ARHX.cjs.map} +1 -1
  112. package/dist/{chunk-5ZJOB5YS.js → chunk-HEV35TGT.js} +4 -4
  113. package/dist/{chunk-5ZJOB5YS.js.map → chunk-HEV35TGT.js.map} +1 -1
  114. package/dist/{chunk-UTVQPZPN.cjs → chunk-I4G3SQPF.cjs} +20 -20
  115. package/dist/{chunk-UTVQPZPN.cjs.map → chunk-I4G3SQPF.cjs.map} +1 -1
  116. package/dist/{chunk-JCNTKRAK.js → chunk-JONXFAPO.js} +5 -5
  117. package/dist/{chunk-JCNTKRAK.js.map → chunk-JONXFAPO.js.map} +1 -1
  118. package/dist/{chunk-GVAMRRZR.cjs → chunk-JR6SX5RH.cjs} +4 -4
  119. package/dist/{chunk-GVAMRRZR.cjs.map → chunk-JR6SX5RH.cjs.map} +1 -1
  120. package/dist/{chunk-N3QTGPC7.cjs → chunk-KABFHAL7.cjs} +100 -99
  121. package/dist/chunk-KABFHAL7.cjs.map +1 -0
  122. package/dist/{chunk-KXSMF6PL.js → chunk-KH7XW7VV.js} +20 -12
  123. package/dist/chunk-KH7XW7VV.js.map +1 -0
  124. package/dist/{chunk-EDJDDY6H.js → chunk-KKBDXCLQ.js} +4 -4
  125. package/dist/{chunk-EDJDDY6H.js.map → chunk-KKBDXCLQ.js.map} +1 -1
  126. package/dist/{chunk-ZHOAZD7Q.cjs → chunk-L3LQNR34.cjs} +161 -161
  127. package/dist/{chunk-ZHOAZD7Q.cjs.map → chunk-L3LQNR34.cjs.map} +1 -1
  128. package/dist/{chunk-IHRDX7K6.js → chunk-LEWHMOUY.js} +46 -56
  129. package/dist/chunk-LEWHMOUY.js.map +1 -0
  130. package/dist/{chunk-AF3TWL5C.cjs → chunk-LRQKXRXO.cjs} +4 -4
  131. package/dist/{chunk-AF3TWL5C.cjs.map → chunk-LRQKXRXO.cjs.map} +1 -1
  132. package/dist/{chunk-WYFB7BN3.js → chunk-M35DF33T.js} +143 -38
  133. package/dist/chunk-M35DF33T.js.map +1 -0
  134. package/dist/{chunk-32UETY6S.cjs → chunk-MFZR4QKM.cjs} +30 -28
  135. package/dist/chunk-MFZR4QKM.cjs.map +1 -0
  136. package/dist/chunk-MKJ4KXL5.cjs +12 -0
  137. package/dist/{chunk-6LAXM4J2.cjs.map → chunk-MKJ4KXL5.cjs.map} +1 -1
  138. package/dist/{chunk-KCH7WQA5.cjs → chunk-MRDBBHIZ.cjs} +48 -2
  139. package/dist/chunk-MRDBBHIZ.cjs.map +1 -0
  140. package/dist/{chunk-QPOQX2DI.cjs → chunk-MX4DHSQP.cjs} +1023 -360
  141. package/dist/chunk-MX4DHSQP.cjs.map +1 -0
  142. package/dist/{chunk-FXNHZFZV.js → chunk-MYKHJI2J.js} +3 -3
  143. package/dist/{chunk-FXNHZFZV.js.map → chunk-MYKHJI2J.js.map} +1 -1
  144. package/dist/{chunk-DSAWGCMP.js → chunk-NAZ2RA4L.js} +3 -3
  145. package/dist/{chunk-DSAWGCMP.js.map → chunk-NAZ2RA4L.js.map} +1 -1
  146. package/dist/{chunk-R7EWHKID.js → chunk-NG2RB5WL.js} +4 -145
  147. package/dist/chunk-NG2RB5WL.js.map +1 -0
  148. package/dist/{chunk-A2LJG5GM.js → chunk-NNQ6A3RM.js} +803 -143
  149. package/dist/chunk-NNQ6A3RM.js.map +1 -0
  150. package/dist/{chunk-72WUT4GG.js → chunk-NVY5CJFP.js} +4 -4
  151. package/dist/{chunk-72WUT4GG.js.map → chunk-NVY5CJFP.js.map} +1 -1
  152. package/dist/{chunk-ZIH42CRX.cjs → chunk-OI2GQ25X.cjs} +7 -7
  153. package/dist/{chunk-ZIH42CRX.cjs.map → chunk-OI2GQ25X.cjs.map} +1 -1
  154. package/dist/{chunk-A4R3H7RU.cjs → chunk-OIFSOPSR.cjs} +259 -238
  155. package/dist/chunk-OIFSOPSR.cjs.map +1 -0
  156. package/dist/{chunk-AU3IJNNP.js → chunk-OMZ37BM2.js} +5 -5
  157. package/dist/{chunk-AU3IJNNP.js.map → chunk-OMZ37BM2.js.map} +1 -1
  158. package/dist/{chunk-C4DYN2SD.cjs → chunk-OORXGFL5.cjs} +48 -48
  159. package/dist/{chunk-C4DYN2SD.cjs.map → chunk-OORXGFL5.cjs.map} +1 -1
  160. package/dist/{chunk-BRN3RGD2.js → chunk-OVI7IXYX.js} +3 -3
  161. package/dist/{chunk-BRN3RGD2.js.map → chunk-OVI7IXYX.js.map} +1 -1
  162. package/dist/{chunk-WMKEGJG4.js → chunk-P6YLZTRE.js} +3 -3
  163. package/dist/{chunk-WMKEGJG4.js.map → chunk-P6YLZTRE.js.map} +1 -1
  164. package/dist/{chunk-AT3MLMJV.js → chunk-QS3NQZVC.js} +82 -16
  165. package/dist/chunk-QS3NQZVC.js.map +1 -0
  166. package/dist/{chunk-EJSYWAEV.js → chunk-QTD6HX4O.js} +5 -5
  167. package/dist/{chunk-EJSYWAEV.js.map → chunk-QTD6HX4O.js.map} +1 -1
  168. package/dist/{chunk-JL5UEBWT.cjs → chunk-ROR5ZR6A.cjs} +45 -45
  169. package/dist/{chunk-JL5UEBWT.cjs.map → chunk-ROR5ZR6A.cjs.map} +1 -1
  170. package/dist/{chunk-FSLTU57P.js → chunk-SDBBMD4N.js} +3 -3
  171. package/dist/{chunk-FSLTU57P.js.map → chunk-SDBBMD4N.js.map} +1 -1
  172. package/dist/{chunk-WEJHA7AD.js → chunk-SE6EGQSD.js} +78 -16
  173. package/dist/chunk-SE6EGQSD.js.map +1 -0
  174. package/dist/{chunk-36LIJXWC.js → chunk-SHFBB23Q.js} +4 -4
  175. package/dist/{chunk-36LIJXWC.js.map → chunk-SHFBB23Q.js.map} +1 -1
  176. package/dist/{chunk-FA6Z7B5L.js → chunk-SHSSRCFR.js} +5 -3
  177. package/dist/chunk-SHSSRCFR.js.map +1 -0
  178. package/dist/{chunk-KOAI3KIV.cjs → chunk-TZEGUG6D.cjs} +4 -4
  179. package/dist/{chunk-KOAI3KIV.cjs.map → chunk-TZEGUG6D.cjs.map} +1 -1
  180. package/dist/{chunk-HNYLMPQQ.cjs → chunk-U5EDAVOJ.cjs} +140 -74
  181. package/dist/chunk-U5EDAVOJ.cjs.map +1 -0
  182. package/dist/{chunk-RHDOAQCT.cjs → chunk-UPAJHMW3.cjs} +122 -114
  183. package/dist/chunk-UPAJHMW3.cjs.map +1 -0
  184. package/dist/{chunk-BQM5P2NO.cjs → chunk-WGX7JH7E.cjs} +235 -170
  185. package/dist/chunk-WGX7JH7E.cjs.map +1 -0
  186. package/dist/{chunk-DYPRZ53S.cjs → chunk-WODMN3Q2.cjs} +27 -27
  187. package/dist/{chunk-DYPRZ53S.cjs.map → chunk-WODMN3Q2.cjs.map} +1 -1
  188. package/dist/{chunk-OZJCH7ZS.js → chunk-XVWOYKIK.js} +3 -3
  189. package/dist/{chunk-OZJCH7ZS.js.map → chunk-XVWOYKIK.js.map} +1 -1
  190. package/dist/chunk-XY5OMOJD.js +147 -0
  191. package/dist/chunk-XY5OMOJD.js.map +1 -0
  192. package/dist/{chunk-KA4L2NZ3.js → chunk-XYBQI6LE.js} +14 -14
  193. package/dist/{chunk-KA4L2NZ3.js.map → chunk-XYBQI6LE.js.map} +1 -1
  194. package/dist/{chunk-EAMVXR5B.js → chunk-ZDKTPBGV.js} +4 -4
  195. package/dist/{chunk-EAMVXR5B.js.map → chunk-ZDKTPBGV.js.map} +1 -1
  196. package/dist/{chunk-Z43KWLZF.js → chunk-ZHNXLS3C.js} +9 -8
  197. package/dist/chunk-ZHNXLS3C.js.map +1 -0
  198. package/dist/{chunk-62ZXBMSD.js → chunk-ZLONH2UD.js} +46 -3
  199. package/dist/chunk-ZLONH2UD.js.map +1 -0
  200. package/dist/core/index.cjs +28 -27
  201. package/dist/core/index.d.cts +4 -4
  202. package/dist/core/index.d.ts +4 -4
  203. package/dist/core/index.js +8 -7
  204. package/dist/{ddl-opIn8DfX.d.ts → ddl-CprnMXJ-.d.ts} +3 -3
  205. package/dist/{ddl-mE07h_EM.d.cts → ddl-DJA7Lci5.d.cts} +3 -3
  206. package/dist/graph-extension/index.cjs +20 -20
  207. package/dist/graph-extension/index.d.cts +4 -4
  208. package/dist/graph-extension/index.d.ts +4 -4
  209. package/dist/graph-extension/index.js +4 -4
  210. package/dist/graph-merge/index.cjs +3204 -635
  211. package/dist/graph-merge/index.cjs.map +1 -1
  212. package/dist/graph-merge/index.d.cts +502 -60
  213. package/dist/graph-merge/index.d.ts +502 -60
  214. package/dist/graph-merge/index.js +2979 -427
  215. package/dist/graph-merge/index.js.map +1 -1
  216. package/dist/{index-Deyu8IXL.d.ts → index-CHTv4XMZ.d.cts} +47 -3
  217. package/dist/{index-DrRS51Ld.d.cts → index-CzoJ3MUw.d.ts} +47 -3
  218. package/dist/index.cjs +229 -216
  219. package/dist/index.cjs.map +1 -1
  220. package/dist/index.d.cts +11 -11
  221. package/dist/index.d.ts +11 -11
  222. package/dist/index.js +35 -34
  223. package/dist/index.js.map +1 -1
  224. package/dist/indexes/index.cjs +13 -13
  225. package/dist/indexes/index.d.cts +4 -4
  226. package/dist/indexes/index.d.ts +4 -4
  227. package/dist/indexes/index.js +6 -6
  228. package/dist/interchange/index.cjs +53 -52
  229. package/dist/interchange/index.cjs.map +1 -1
  230. package/dist/interchange/index.d.cts +17 -13
  231. package/dist/interchange/index.d.ts +17 -13
  232. package/dist/interchange/index.js +17 -16
  233. package/dist/interchange/index.js.map +1 -1
  234. package/dist/{manager-DX983gJ0.d.ts → manager-B6sOQzcQ.d.ts} +2 -2
  235. package/dist/{manager-ptr3JLRP.d.cts → manager-DlY1vlla.d.cts} +2 -2
  236. package/dist/{materialize-indexes-CpXoggWU.d.ts → materialize-indexes-DQL4xcpf.d.ts} +1 -1
  237. package/dist/{materialize-indexes-BXz77YqO.d.cts → materialize-indexes-sskhp-c_.d.cts} +1 -1
  238. package/dist/{postgres-DwgEXSPI.d.cts → postgres-B6YOUcaK.d.ts} +1 -1
  239. package/dist/{postgres-QdOMHTBz.d.ts → postgres-BXy_nyMs.d.cts} +1 -1
  240. package/dist/profiler/index.d.cts +9 -9
  241. package/dist/profiler/index.d.ts +9 -9
  242. package/dist/provenance/index.cjs +43 -42
  243. package/dist/provenance/index.cjs.map +1 -1
  244. package/dist/provenance/index.d.cts +7 -7
  245. package/dist/provenance/index.d.ts +7 -7
  246. package/dist/provenance/index.js +10 -9
  247. package/dist/provenance/index.js.map +1 -1
  248. package/dist/schema/index.cjs +45 -44
  249. package/dist/schema/index.d.cts +6 -6
  250. package/dist/schema/index.d.ts +6 -6
  251. package/dist/schema/index.js +18 -17
  252. package/dist/{searchable-BrUh0pdc.d.cts → searchable-0Cn_lY8U.d.cts} +1 -1
  253. package/dist/{searchable-BOUuA83f.d.ts → searchable-D9gMiwcS.d.ts} +1 -1
  254. package/dist/{sqlite-BfYcV61E.d.cts → sqlite-ClXuBYAj.d.ts} +1 -1
  255. package/dist/{sqlite-DK40XVR1.d.ts → sqlite-DioSxaPe.d.cts} +1 -1
  256. package/dist/{store-Bo1psfVZ.d.ts → store-5j-w5onJ.d.ts} +120 -71
  257. package/dist/{store-FTqBpuJD.d.cts → store-CFedKGU5.d.cts} +120 -71
  258. package/dist/{temporal-CXewwLTB.d.cts → temporal-Ce1pG0S1.d.cts} +1 -1
  259. package/dist/{temporal-DPtn0HOu.d.ts → temporal-CjO9FH1l.d.ts} +1 -1
  260. package/dist/{types-CeT7xM4M.d.ts → types-BrdOFu48.d.ts} +1 -1
  261. package/dist/{types-Du78EvpN.d.ts → types-DKkMJZjR.d.cts} +32 -6
  262. package/dist/{types-Du78EvpN.d.cts → types-DKkMJZjR.d.ts} +32 -6
  263. package/dist/{types-XR1nHERK.d.cts → types-oj_OGAaZ.d.cts} +1 -1
  264. package/dist/{where-CMbFiWwp.d.ts → where-C8w2627G.d.ts} +1 -1
  265. package/dist/{where-CJsp-YUf.d.cts → where-D1wKCJ4Q.d.cts} +1 -1
  266. package/package.json +1 -1
  267. package/dist/chunk-32UETY6S.cjs.map +0 -1
  268. package/dist/chunk-5PDSCELM.cjs.map +0 -1
  269. package/dist/chunk-62ZXBMSD.js.map +0 -1
  270. package/dist/chunk-6LAXM4J2.cjs +0 -12
  271. package/dist/chunk-73MWKDFK.cjs +0 -12
  272. package/dist/chunk-A2LJG5GM.js.map +0 -1
  273. package/dist/chunk-A4R3H7RU.cjs.map +0 -1
  274. package/dist/chunk-ANKOXPCC.cjs.map +0 -1
  275. package/dist/chunk-AT3MLMJV.js.map +0 -1
  276. package/dist/chunk-BEB4OFZF.cjs.map +0 -1
  277. package/dist/chunk-BQM5P2NO.cjs.map +0 -1
  278. package/dist/chunk-C2ZP5YS6.cjs.map +0 -1
  279. package/dist/chunk-C6KE2HSQ.cjs.map +0 -1
  280. package/dist/chunk-EDHV4CBU.js.map +0 -1
  281. package/dist/chunk-FA6Z7B5L.js.map +0 -1
  282. package/dist/chunk-HNYLMPQQ.cjs.map +0 -1
  283. package/dist/chunk-IHRDX7K6.js.map +0 -1
  284. package/dist/chunk-KCH7WQA5.cjs.map +0 -1
  285. package/dist/chunk-KXSMF6PL.js.map +0 -1
  286. package/dist/chunk-LHYSY6SE.js.map +0 -1
  287. package/dist/chunk-N3QTGPC7.cjs.map +0 -1
  288. package/dist/chunk-QPOQX2DI.cjs.map +0 -1
  289. package/dist/chunk-R7EWHKID.js.map +0 -1
  290. package/dist/chunk-RHDOAQCT.cjs.map +0 -1
  291. package/dist/chunk-WEJHA7AD.js.map +0 -1
  292. package/dist/chunk-WYFB7BN3.js.map +0 -1
  293. package/dist/chunk-YQ4JONWE.js.map +0 -1
  294. package/dist/chunk-Z43KWLZF.js.map +0 -1
@@ -1,18 +1,18 @@
1
1
  'use strict';
2
2
 
3
- var chunk32UETY6S_cjs = require('./chunk-32UETY6S.cjs');
4
- var chunkQPOQX2DI_cjs = require('./chunk-QPOQX2DI.cjs');
5
- var chunkA4R3H7RU_cjs = require('./chunk-A4R3H7RU.cjs');
3
+ var chunkMFZR4QKM_cjs = require('./chunk-MFZR4QKM.cjs');
4
+ var chunkMX4DHSQP_cjs = require('./chunk-MX4DHSQP.cjs');
5
+ var chunkOIFSOPSR_cjs = require('./chunk-OIFSOPSR.cjs');
6
6
  var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
7
- var chunkQU7QLJA4_cjs = require('./chunk-QU7QLJA4.cjs');
8
- var chunkANKOXPCC_cjs = require('./chunk-ANKOXPCC.cjs');
9
- var chunkZBVZ7HXD_cjs = require('./chunk-ZBVZ7HXD.cjs');
10
- var chunk5PDSCELM_cjs = require('./chunk-5PDSCELM.cjs');
11
- var chunkZHOAZD7Q_cjs = require('./chunk-ZHOAZD7Q.cjs');
12
- var chunk2ZWM2RFH_cjs = require('./chunk-2ZWM2RFH.cjs');
7
+ var chunk3U5ABFDW_cjs = require('./chunk-3U5ABFDW.cjs');
8
+ var chunk3HGRTCDU_cjs = require('./chunk-3HGRTCDU.cjs');
9
+ var chunkFQPEMEWX_cjs = require('./chunk-FQPEMEWX.cjs');
10
+ var chunk425IZOQ5_cjs = require('./chunk-425IZOQ5.cjs');
11
+ var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
12
+ var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
13
13
  var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
14
- var chunkD6GCNNMK_cjs = require('./chunk-D6GCNNMK.cjs');
15
- var chunkKCH7WQA5_cjs = require('./chunk-KCH7WQA5.cjs');
14
+ var chunk6NGW27EO_cjs = require('./chunk-6NGW27EO.cjs');
15
+ var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
16
16
  var chunkA7J2YDDI_cjs = require('./chunk-A7J2YDDI.cjs');
17
17
  var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
18
18
 
@@ -21,8 +21,8 @@ function nullToUndefined(value) {
21
21
  return value === null ? void 0 : value;
22
22
  }
23
23
  function rowToNode(row) {
24
- const rawProps = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
25
- const props = chunkD6GCNNMK_cjs.filterReservedKeys(rawProps, chunkD6GCNNMK_cjs.RESERVED_NODE_KEYS);
24
+ const rawProps = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
25
+ const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_NODE_KEYS);
26
26
  return {
27
27
  kind: row.kind,
28
28
  id: row.id,
@@ -41,8 +41,8 @@ function rowToNodeMeta(row) {
41
41
  };
42
42
  }
43
43
  function rowToEdge(row) {
44
- const rawProps = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
45
- const props = chunkD6GCNNMK_cjs.filterReservedKeys(rawProps, chunkD6GCNNMK_cjs.RESERVED_EDGE_KEYS);
44
+ const rawProps = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
45
+ const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_EDGE_KEYS);
46
46
  return {
47
47
  id: row.id,
48
48
  kind: row.kind,
@@ -73,7 +73,7 @@ function nodeWriteNeedsConstraintFence(registry, kind, uniqueConstraints, operat
73
73
  return "nodeDisjointness";
74
74
  }
75
75
  const sharedScope = uniqueConstraints.some(
76
- (constraint) => chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(kind, constraint.scope, registry).length > 1
76
+ (constraint) => chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(kind, constraint.scope, registry).length > 1
77
77
  );
78
78
  return sharedScope ? "nodeUniquenessScope" : void 0;
79
79
  }
@@ -82,7 +82,7 @@ async function checkDisjointnessConstraint(ctx, kind, id) {
82
82
  for (const disjointKind of disjointKinds) {
83
83
  const existing = await ctx.backend.getNode(ctx.graphId, disjointKind, id);
84
84
  if (existing && !existing.deleted_at) {
85
- const error = chunkZBVZ7HXD_cjs.checkDisjointness(id, kind, [disjointKind], ctx.registry);
85
+ const error = chunkFQPEMEWX_cjs.checkDisjointness(id, kind, [disjointKind], ctx.registry);
86
86
  if (error) throw error;
87
87
  }
88
88
  }
@@ -99,7 +99,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
99
99
  fromKind,
100
100
  fromId
101
101
  });
102
- const error = chunkZBVZ7HXD_cjs.checkCardinality(
102
+ const error = chunkFQPEMEWX_cjs.checkCardinality(
103
103
  edgeKind,
104
104
  fromKind,
105
105
  fromId,
@@ -119,7 +119,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
119
119
  toKind,
120
120
  toId
121
121
  });
122
- const error = chunkZBVZ7HXD_cjs.checkUniqueEdge(
122
+ const error = chunkFQPEMEWX_cjs.checkUniqueEdge(
123
123
  edgeKind,
124
124
  fromKind,
125
125
  fromId,
@@ -141,7 +141,7 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
141
141
  fromId,
142
142
  activeOnly: true
143
143
  });
144
- const error = chunkZBVZ7HXD_cjs.checkCardinality(
144
+ const error = chunkFQPEMEWX_cjs.checkCardinality(
145
145
  edgeKind,
146
146
  fromKind,
147
147
  fromId,
@@ -155,6 +155,38 @@ async function checkCardinalityConstraint(ctx, edgeKind, cardinality, fromKind,
155
155
  }
156
156
  }
157
157
 
158
+ // src/store/validity-end.ts
159
+ function assertValidityEndMutation(input, context) {
160
+ if (input.validTo === void 0 || input.clearValidTo !== true) return;
161
+ throw new chunkMRDBBHIZ_cjs.ValidationError(
162
+ '"validTo" and "clearValidTo" are mutually exclusive',
163
+ {
164
+ ...context,
165
+ operation: "update",
166
+ issues: [
167
+ {
168
+ path: "clearValidTo",
169
+ message: 'Pass either "validTo" or "clearValidTo", not both'
170
+ }
171
+ ]
172
+ }
173
+ );
174
+ }
175
+ function validityEndAfterMutation(input, current) {
176
+ if (input.clearValidTo === true) return void 0;
177
+ return input.validTo ?? current;
178
+ }
179
+ function assertClearValidToSupported(backend, entityType) {
180
+ if (backend.capabilities.clearValidTo === true) return;
181
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
182
+ `This backend does not support clearing ${entityType} validTo`,
183
+ {
184
+ code: "CLEAR_VALID_TO_UNSUPPORTED",
185
+ entityType
186
+ }
187
+ );
188
+ }
189
+
158
190
  // src/store/operations/already-exists.ts
159
191
  var ENTITY_LABELS = {
160
192
  node: { title: "Node", article: "A node" },
@@ -162,7 +194,7 @@ var ENTITY_LABELS = {
162
194
  };
163
195
  function alreadyExistsError(entity, kind, id, detail, cause) {
164
196
  const label = ENTITY_LABELS[entity];
165
- return new chunkKCH7WQA5_cjs.ValidationError(
197
+ return new chunkMRDBBHIZ_cjs.ValidationError(
166
198
  `${label.title} already exists: ${detail}`,
167
199
  {
168
200
  entityType: entity,
@@ -172,7 +204,7 @@ function alreadyExistsError(entity, kind, id, detail, cause) {
172
204
  issues: [
173
205
  {
174
206
  path: "id",
175
- code: chunkKCH7WQA5_cjs.ENTITY_ALREADY_EXISTS_CODE,
207
+ code: chunkMRDBBHIZ_cjs.ENTITY_ALREADY_EXISTS_CODE,
176
208
  message: `${label.article} with this ID already exists`
177
209
  }
178
210
  ]
@@ -187,7 +219,7 @@ function createAlreadyExistsError(entity, kind, id) {
187
219
  return alreadyExistsError(entity, kind, id, `${kind}/${id}`, void 0);
188
220
  }
189
221
  function isDuplicateKeyInsertError(error, entity) {
190
- return error instanceof chunkKCH7WQA5_cjs.DatabaseOperationError && error.details.operation === "insert" && error.details.entity === entity && error.details.reason === "duplicate_key";
222
+ return error instanceof chunkMRDBBHIZ_cjs.DatabaseOperationError && error.details.operation === "insert" && error.details.entity === entity && error.details.reason === "duplicate_key";
191
223
  }
192
224
  function rethrowAsAlreadyExists(error, entity) {
193
225
  if (!isDuplicateKeyInsertError(error, entity)) throw error;
@@ -221,9 +253,9 @@ async function withAlreadyExistsTranslation(entity, run) {
221
253
 
222
254
  // src/store/operations/node-operations.ts
223
255
  function getNodeRegistration(graph, kind) {
224
- if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new chunkKCH7WQA5_cjs.KindNotFoundError(kind, "node");
256
+ if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new chunkMRDBBHIZ_cjs.KindNotFoundError(kind, "node");
225
257
  const registration = graph.nodes[kind];
226
- if (registration === void 0) throw new chunkKCH7WQA5_cjs.KindNotFoundError(kind, "node");
258
+ if (registration === void 0) throw new chunkMRDBBHIZ_cjs.KindNotFoundError(kind, "node");
227
259
  return registration;
228
260
  }
229
261
  function nodeFencesConstraintProbe(ctx, kind, operation) {
@@ -243,10 +275,10 @@ function nodeBatchFencesConstraintProbe(ctx, inputs, operation) {
243
275
  return void 0;
244
276
  }
245
277
  function buildNodeCacheKey(graphId, kind, id) {
246
- return chunkQPOQX2DI_cjs.encodeTupleKey([graphId, kind, id]);
278
+ return chunkMX4DHSQP_cjs.encodeTupleKey([graphId, kind, id]);
247
279
  }
248
280
  function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
249
- return chunkQPOQX2DI_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
281
+ return chunkMX4DHSQP_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
250
282
  }
251
283
  function buildInsertNodeParams(graphId, kind, id, props, validFrom, validTo) {
252
284
  const insertParams = {
@@ -277,7 +309,7 @@ function resolveConstraint(graph, kind, constraintName) {
277
309
  (candidate) => candidate.name === constraintName
278
310
  );
279
311
  if (constraint === void 0) {
280
- throw new chunkKCH7WQA5_cjs.NodeConstraintNotFoundError(constraintName, kind);
312
+ throw new chunkMRDBBHIZ_cjs.NodeConstraintNotFoundError(constraintName, kind);
281
313
  }
282
314
  return constraint;
283
315
  }
@@ -338,8 +370,8 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
338
370
  }
339
371
  function registerPendingUniqueEntries(kind, id, props, constraints) {
340
372
  for (const constraint of constraints) {
341
- if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, props)) continue;
342
- const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
373
+ if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, props)) continue;
374
+ const key = chunkFQPEMEWX_cjs.computeUniqueKey(
343
375
  props,
344
376
  constraint.fields,
345
377
  constraint.collation
@@ -352,7 +384,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
352
384
  );
353
385
  pendingUniqueOwners.set(concreteEntryKey, id);
354
386
  if (constraint.scope !== "kind") {
355
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
387
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
356
388
  kind,
357
389
  constraint.scope,
358
390
  registry
@@ -371,12 +403,12 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
371
403
  }
372
404
  function registerAppliedNodeUpdate(kind, id, oldProps, newProps, constraints) {
373
405
  for (const constraint of constraints) {
374
- const oldApplies = chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, oldProps);
375
- const newApplies = chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, newProps);
376
- const oldKey = oldApplies ? chunkZBVZ7HXD_cjs.computeUniqueKey(oldProps, constraint.fields, constraint.collation) : void 0;
377
- const newKey = newApplies ? chunkZBVZ7HXD_cjs.computeUniqueKey(newProps, constraint.fields, constraint.collation) : void 0;
406
+ const oldApplies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, oldProps);
407
+ const newApplies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, newProps);
408
+ const oldKey = oldApplies ? chunkFQPEMEWX_cjs.computeUniqueKey(oldProps, constraint.fields, constraint.collation) : void 0;
409
+ const newKey = newApplies ? chunkFQPEMEWX_cjs.computeUniqueKey(newProps, constraint.fields, constraint.collation) : void 0;
378
410
  if (oldKey === newKey) continue;
379
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
411
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
380
412
  kind,
381
413
  constraint.scope,
382
414
  registry
@@ -416,7 +448,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
416
448
  if (uniqueCache.has(cacheKey)) return;
417
449
  uniqueCache.set(cacheKey, row);
418
450
  }
419
- const validationBackend = chunkANKOXPCC_cjs.createBackendOverlay(backend, {
451
+ const validationBackend = chunk3HGRTCDU_cjs.createBackendOverlay(backend, {
420
452
  getNode: getNodeCached,
421
453
  checkUnique: checkUniqueCached
422
454
  });
@@ -433,16 +465,16 @@ function draftNodeCreate(ctx, input, id, options) {
433
465
  const kind = input.kind;
434
466
  const registration = getNodeRegistration(ctx.graph, kind);
435
467
  const nodeKind = registration.type;
436
- const validatedProps = options?.propsPreValidated === true ? input.props : chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, input.props, {
468
+ const validatedProps = options?.propsPreValidated === true ? input.props : chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, input.props, {
437
469
  kind,
438
470
  operation: "create"
439
471
  });
440
- const validFrom = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(
472
+ const validFrom = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
441
473
  input.validFrom,
442
474
  "validFrom"
443
475
  );
444
- const validTo = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
445
- chunk5PDSCELM_cjs.assertOrderedValidityWindow(`${kind} "${id}"`, validFrom, validTo);
476
+ const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
477
+ chunk425IZOQ5_cjs.assertOrderedValidityWindow(`${kind} "${id}"`, validFrom, validTo);
446
478
  return {
447
479
  kind,
448
480
  id,
@@ -466,8 +498,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend) {
466
498
  backend
467
499
  };
468
500
  await checkDisjointnessConstraint(constraintContext, kind, id);
469
- await chunk32UETY6S_cjs.checkUniquenessConstraints(
470
- chunk32UETY6S_cjs.createUniquenessContext(ctx.graphId, ctx.registry, backend),
501
+ await chunkMFZR4QKM_cjs.checkUniquenessConstraints(
502
+ chunkMFZR4QKM_cjs.createUniquenessContext(ctx.graphId, ctx.registry, backend),
471
503
  kind,
472
504
  id,
473
505
  validatedProps,
@@ -499,8 +531,8 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend, options) {
499
531
  );
500
532
  }
501
533
  async function finalizeNodeCreateBatch(ctx, preparedCreates, backend, lock) {
502
- await chunk32UETY6S_cjs.applyNodeInsertSideEffectsBatch(
503
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
534
+ await chunkMFZR4QKM_cjs.applyNodeInsertSideEffectsBatch(
535
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
504
536
  preparedCreates.map((prepared) => ({
505
537
  kind: prepared.kind,
506
538
  id: prepared.id,
@@ -515,8 +547,8 @@ function foldReferences(preparedCreates) {
515
547
  return preparedCreates.filter((prepared) => prepared.idProvided).map((prepared) => ({ kind: prepared.kind, id: prepared.id }));
516
548
  }
517
549
  async function finalizeNodeCreate(ctx, prepared, backend, lock) {
518
- await chunk32UETY6S_cjs.applyNodeInsertSideEffects(
519
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
550
+ await chunkMFZR4QKM_cjs.applyNodeInsertSideEffects(
551
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
520
552
  {
521
553
  kind: prepared.kind,
522
554
  id: prepared.id,
@@ -529,7 +561,7 @@ async function finalizeNodeCreate(ctx, prepared, backend, lock) {
529
561
  }
530
562
  function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
531
563
  const registration = getNodeRegistration(ctx.graph, kind);
532
- const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(
564
+ const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(
533
565
  registration.type.schema,
534
566
  { ...existingProps, ...inputProps },
535
567
  { kind, operation: "update", id }
@@ -537,7 +569,7 @@ function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
537
569
  return { registration, validatedProps };
538
570
  }
539
571
  function resolveNodeUpdateProps(ctx, existing, inputProps) {
540
- const existingProps = chunkANKOXPCC_cjs.rowPropsToObject(existing.props);
572
+ const existingProps = chunk3HGRTCDU_cjs.rowPropsToObject(existing.props);
541
573
  const { registration, validatedProps } = computeNodeUpdate(
542
574
  ctx,
543
575
  existing.kind,
@@ -562,23 +594,24 @@ function nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
562
594
  }
563
595
  async function performNodeUpdate(ctx, input, backend, lock, options) {
564
596
  const { kind, id } = input;
597
+ assertValidityEndMutation(input, { entityType: "node", kind, id });
565
598
  const existing = await backend.getNode(ctx.graphId, kind, id);
566
- if (!existing) throw new chunkKCH7WQA5_cjs.NodeNotFoundError(kind, id);
599
+ if (!existing) throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(kind, id);
567
600
  const { registration, validatedProps } = resolveNodeUpdateProps(
568
601
  ctx,
569
602
  existing,
570
603
  input.props
571
604
  );
572
605
  const nodeKind = registration.type;
573
- const validTo = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
574
- const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ? chunk5PDSCELM_cjs.nowIso() : void 0;
575
- const preservesLiveLowerBound = resurrectionInstant === void 0 && chunk5PDSCELM_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
576
- const statedValidFrom = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(
606
+ const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
607
+ const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ? chunk425IZOQ5_cjs.nowIso() : void 0;
608
+ const preservesLiveLowerBound = resurrectionInstant === void 0 && chunk425IZOQ5_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
609
+ const statedValidFrom = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
577
610
  input.validFrom,
578
611
  "validFrom"
579
612
  );
580
613
  const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
581
- const windowVerdict = chunk5PDSCELM_cjs.assertWritableValidityWindow(
614
+ const windowVerdict = chunk425IZOQ5_cjs.assertWritableValidityWindow(
582
615
  `${kind} "${id}"`,
583
616
  validFrom,
584
617
  resurrectionInstant === void 0 ? {
@@ -593,7 +626,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
593
626
  },
594
627
  validTo
595
628
  );
596
- const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
629
+ const writeContext = chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
597
630
  const effectiveValidFrom = validFrom ?? resurrectionInstant;
598
631
  const shared = {
599
632
  schema: nodeKind.schema,
@@ -601,6 +634,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
601
634
  uniqueConstraints: registration.unique ?? [],
602
635
  ...effectiveValidFrom !== void 0 && { validFrom: effectiveValidFrom },
603
636
  ...validTo !== void 0 && { validTo },
637
+ ...input.clearValidTo === true && { clearValidTo: true },
604
638
  // The bound the verdict above READ, carried into the UPDATE's own `WHERE`
605
639
  // so the row this writes is the row that was judged. The verdict hands over
606
640
  // the predicate rather than a flag, so both conditions that decide it — did
@@ -614,15 +648,15 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
614
648
  ...windowVerdict.storedLowerBoundFence
615
649
  };
616
650
  if (options?.clearDeleted) {
617
- const row2 = await chunk32UETY6S_cjs.applyNodeUpdate(
651
+ const row2 = await chunkMFZR4QKM_cjs.applyNodeUpdate(
618
652
  writeContext,
619
653
  { ...shared, existing, clearDeleted: true },
620
654
  backend
621
655
  );
622
656
  return rowToNode(row2);
623
657
  }
624
- if (!chunkANKOXPCC_cjs.isLiveNodeRow(existing)) throw new chunkKCH7WQA5_cjs.NodeNotFoundError(kind, id);
625
- const row = await chunk32UETY6S_cjs.applyNodeUpdate(
658
+ if (!chunk3HGRTCDU_cjs.isLiveNodeRow(existing)) throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(kind, id);
659
+ const row = await chunkMFZR4QKM_cjs.applyNodeUpdate(
626
660
  writeContext,
627
661
  { ...shared, existing },
628
662
  backend
@@ -646,15 +680,15 @@ async function performNodeUpdateWithResurrectionRecovery(ctx, input, target, loc
646
680
  }
647
681
  const current = await target.getNode(ctx.graphId, input.kind, input.id);
648
682
  if (current === void 0 || current.deleted_at !== void 0) {
649
- throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
683
+ throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(input.kind, input.id);
650
684
  }
651
685
  }
652
686
  }
653
- throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
687
+ throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(input.kind, input.id);
654
688
  }
655
689
  function nodeUpdateRaceError(input, error) {
656
690
  if (!isNodeUpdateNoRowError(error)) return error;
657
- return new chunkKCH7WQA5_cjs.DatabaseOperationError(
691
+ return new chunkMRDBBHIZ_cjs.DatabaseOperationError(
658
692
  `Node update for ${input.kind} "${input.id}" could not be applied to a stable row after ${NODE_UPDATE_ATTEMPTS} attempts: the row was removed and recreated between each read and its write. A concurrent writer is replacing this node faster than it can be read; serialize the writers, or retry.`,
659
693
  {
660
694
  operation: "update",
@@ -685,19 +719,19 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
685
719
  const groups = /* @__PURE__ */ new Map();
686
720
  for (const draft of drafts) {
687
721
  for (const constraint of draft.uniqueConstraints) {
688
- if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, draft.validatedProps)) continue;
689
- const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
722
+ if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, draft.validatedProps)) continue;
723
+ const key = chunkFQPEMEWX_cjs.computeUniqueKey(
690
724
  draft.validatedProps,
691
725
  constraint.fields,
692
726
  constraint.collation
693
727
  );
694
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
728
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
695
729
  draft.kind,
696
730
  constraint.scope,
697
731
  ctx.registry
698
732
  );
699
733
  for (const kindToCheck of kindsToCheck) {
700
- const groupKey = chunkQPOQX2DI_cjs.encodeTupleKey([kindToCheck, constraint.name]);
734
+ const groupKey = chunkMX4DHSQP_cjs.encodeTupleKey([kindToCheck, constraint.name]);
701
735
  const group = groups.get(groupKey) ?? {
702
736
  nodeKind: kindToCheck,
703
737
  constraintName: constraint.name,
@@ -737,7 +771,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
737
771
  seedUniqueRow
738
772
  } = createNodeBatchValidationBackend(ctx.graphId, ctx.registry, backend);
739
773
  const drafts = inputs.map(
740
- (input) => draftNodeCreate(ctx, input, input.id ?? chunkA4R3H7RU_cjs.generateId(), options)
774
+ (input) => draftNodeCreate(ctx, input, input.id ?? chunkOIFSOPSR_cjs.generateId(), options)
741
775
  );
742
776
  await primeBatchValidationCaches(ctx, drafts, backend, {
743
777
  seedNodeRow,
@@ -774,12 +808,12 @@ function partitionCreates(preparedCreates) {
774
808
  return { inserts, resurrections };
775
809
  }
776
810
  function isNodeUpdateNoRowError(error) {
777
- return error instanceof chunkKCH7WQA5_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "node" && error.details.reason === "no_row_returned";
811
+ return error instanceof chunkMRDBBHIZ_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "node" && error.details.reason === "no_row_returned";
778
812
  }
779
813
  async function resurrectPreparedNode(ctx, target, lock, prepared) {
780
814
  const current = await target.getNode(ctx.graphId, prepared.kind, prepared.id);
781
815
  if (current === void 0) {
782
- throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
816
+ throw new chunkMRDBBHIZ_cjs.DatabaseOperationError(
783
817
  `Node tombstone disappeared before resurrection: ${prepared.kind} ${prepared.id}`,
784
818
  { operation: "update", entity: "node" }
785
819
  );
@@ -788,8 +822,8 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
788
822
  throw createAlreadyExistsError("node", prepared.kind, prepared.id);
789
823
  }
790
824
  try {
791
- return await chunk32UETY6S_cjs.applyNodeUpdate(
792
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
825
+ return await chunkMFZR4QKM_cjs.applyNodeUpdate(
826
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
793
827
  {
794
828
  existing: current,
795
829
  clearDeleted: true,
@@ -863,10 +897,10 @@ async function batchCheckUniqueAcrossKinds(backend, graphId, constraintName, uni
863
897
  }
864
898
  async function executeNodeCreateInternal(ctx, input, backend, options) {
865
899
  const kind = input.kind;
866
- const id = input.id ?? chunkA4R3H7RU_cjs.generateId();
900
+ const id = input.id ?? chunkOIFSOPSR_cjs.generateId();
867
901
  const opContext = ctx.createOperationContext("create", "node", kind, id);
868
902
  const shouldReturnRow = options?.returnRow ?? true;
869
- return chunkQPOQX2DI_cjs.runHookedWriteOperation(
903
+ return chunkMX4DHSQP_cjs.runHookedWriteOperation(
870
904
  ctx,
871
905
  opContext,
872
906
  backend,
@@ -895,8 +929,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
895
929
  }
896
930
  const row = await withAlreadyExistsTranslation("node", async () => {
897
931
  if (shouldReturnRow) return target.insertNode(prepared.insertParams);
898
- await chunkA4R3H7RU_cjs.runInsertNoReturn(
899
- chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
932
+ await chunkOIFSOPSR_cjs.runInsertNoReturn(
933
+ chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
900
934
  prepared.insertParams
901
935
  );
902
936
  return;
@@ -919,7 +953,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
919
953
  ...options
920
954
  });
921
955
  if (!result) {
922
- throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
956
+ throw new chunkMRDBBHIZ_cjs.DatabaseOperationError(
923
957
  "Node create failed: expected created node row",
924
958
  { operation: "insert", entity: "node" }
925
959
  );
@@ -928,7 +962,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
928
962
  }
929
963
  async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
930
964
  if (inputs.length === 0) return;
931
- await chunkQPOQX2DI_cjs.runInWriteTransaction(
965
+ await chunkMX4DHSQP_cjs.runInWriteTransaction(
932
966
  ctx,
933
967
  backend,
934
968
  async (target, lock) => {
@@ -938,8 +972,8 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
938
972
  const partition = partitionCreates(preparedCreates);
939
973
  await withAlreadyExistsTranslation(
940
974
  "node",
941
- () => chunkA4R3H7RU_cjs.runInsertBatch(
942
- chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
975
+ () => chunkOIFSOPSR_cjs.runInsertBatch(
976
+ chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
943
977
  partition.inserts.map((prepared) => prepared.insertParams)
944
978
  )
945
979
  );
@@ -962,7 +996,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
962
996
  }
963
997
  async function executeNodeCreateBatch(ctx, inputs, backend, options) {
964
998
  if (inputs.length === 0) return [];
965
- return chunkQPOQX2DI_cjs.runInWriteTransaction(
999
+ return chunkMX4DHSQP_cjs.runInWriteTransaction(
966
1000
  ctx,
967
1001
  backend,
968
1002
  async (target, lock) => {
@@ -977,8 +1011,8 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
977
1011
  const partition = partitionCreates(preparedCreates);
978
1012
  const inserted = await withAlreadyExistsTranslation(
979
1013
  "node",
980
- () => chunkA4R3H7RU_cjs.runInsertBatchReturning(
981
- chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
1014
+ () => chunkOIFSOPSR_cjs.runInsertBatchReturning(
1015
+ chunkOIFSOPSR_cjs.nodeInsertDispatch(target),
982
1016
  partition.inserts.map((prepared) => prepared.insertParams)
983
1017
  )
984
1018
  );
@@ -991,13 +1025,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
991
1025
  await finalizeNodeCreateBatch(ctx, partition.inserts, target, lock);
992
1026
  const byReference = new Map(
993
1027
  [...inserted, ...resurrected].map((row) => [
994
- chunkQPOQX2DI_cjs.refKey({ kind: row.kind, id: row.id }),
1028
+ chunkMX4DHSQP_cjs.refKey({ kind: row.kind, id: row.id }),
995
1029
  row
996
1030
  ])
997
1031
  );
998
1032
  const rows = preparedCreates.map(
999
1033
  (prepared) => chunkN66HCGCY_cjs.requireDefined(
1000
- byReference.get(chunkQPOQX2DI_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
1034
+ byReference.get(chunkMX4DHSQP_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
1001
1035
  `Missing written row for ${prepared.kind} ${prepared.id}`
1002
1036
  )
1003
1037
  );
@@ -1022,15 +1056,29 @@ async function executeNodeUpdate(ctx, input, backend, options) {
1022
1056
  input.kind,
1023
1057
  input.id
1024
1058
  );
1025
- return chunkQPOQX2DI_cjs.runHookedWriteOperation(
1059
+ return chunkMX4DHSQP_cjs.runHookedWriteOperation(
1026
1060
  ctx,
1027
1061
  opContext,
1028
1062
  backend,
1029
1063
  async (target, lock) => {
1064
+ if (input.clearValidTo === true) {
1065
+ assertClearValidToSupported(backend, "node");
1066
+ }
1067
+ const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
1068
+ input.validTo,
1069
+ "validTo"
1070
+ );
1030
1071
  const identity = ctx.identity;
1031
- if (options?.clearDeleted && identity !== void 0) {
1072
+ if (identity !== void 0 && (options?.clearDeleted === true || input.validTo !== void 0)) {
1032
1073
  await identity.lock(target);
1033
1074
  }
1075
+ if (identity !== void 0 && validTo !== void 0) {
1076
+ await identity.requireValidityEndCompatible(
1077
+ target,
1078
+ { kind: input.kind, id: input.id },
1079
+ validTo
1080
+ );
1081
+ }
1034
1082
  const node = await performNodeUpdateWithResurrectionRecovery(
1035
1083
  ctx,
1036
1084
  input,
@@ -1059,19 +1107,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1059
1107
  const schema = registration.type.schema;
1060
1108
  const uniqueConstraints = registration.unique ?? [];
1061
1109
  if (!backend.capabilities.transactions) {
1062
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1110
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1063
1111
  "updateWhere() requires a transactional backend so validation and sidecars are atomic",
1064
1112
  { code: "SET_UPDATE_TRANSACTIONS_REQUIRED", kind }
1065
1113
  );
1066
1114
  }
1067
1115
  if (backend.updateNodeSet === void 0) {
1068
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1116
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1069
1117
  "This backend does not support set-based node updates",
1070
1118
  { code: "SET_UPDATE_UNSUPPORTED", kind }
1071
1119
  );
1072
1120
  }
1073
1121
  if (Object.keys(inputPatch).length === 0) {
1074
- throw new chunkKCH7WQA5_cjs.ValidationError("updateWhere() patch must not be empty", {
1122
+ throw new chunkMRDBBHIZ_cjs.ValidationError("updateWhere() patch must not be empty", {
1075
1123
  entityType: "node",
1076
1124
  kind,
1077
1125
  operation: "update",
@@ -1082,7 +1130,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1082
1130
  (property) => !Object.hasOwn(schema.shape, property)
1083
1131
  );
1084
1132
  if (unknownProperty !== void 0) {
1085
- throw new chunkKCH7WQA5_cjs.ValidationError(
1133
+ throw new chunkMRDBBHIZ_cjs.ValidationError(
1086
1134
  `Unknown ${kind} property in updateWhere() patch: ${unknownProperty}`,
1087
1135
  {
1088
1136
  entityType: "node",
@@ -1097,7 +1145,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1097
1145
  }
1098
1146
  );
1099
1147
  }
1100
- const parsedPatch = chunkQPOQX2DI_cjs.validateNodeProps(schema.partial(), inputPatch, {
1148
+ const parsedPatch = chunkMX4DHSQP_cjs.validateNodeProps(schema.partial(), inputPatch, {
1101
1149
  kind,
1102
1150
  operation: "update"
1103
1151
  });
@@ -1108,11 +1156,11 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1108
1156
  unsetProperties.push(property);
1109
1157
  continue;
1110
1158
  }
1111
- chunkD6GCNNMK_cjs.assertJsonValue(value, property, `Node "${kind}" updateWhere patch`);
1159
+ chunk6NGW27EO_cjs.assertJsonValue(value, property, `Node "${kind}" updateWhere patch`);
1112
1160
  patch[property] = value;
1113
1161
  }
1114
1162
  if (Object.keys(patch).length === 0 && unsetProperties.length === 0) {
1115
- throw new chunkKCH7WQA5_cjs.ValidationError(
1163
+ throw new chunkMRDBBHIZ_cjs.ValidationError(
1116
1164
  "updateWhere() patch has no recognized properties",
1117
1165
  {
1118
1166
  entityType: "node",
@@ -1125,19 +1173,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1125
1173
  );
1126
1174
  }
1127
1175
  if (uniqueConstraints.length > 0 && (backend.hardDeleteUniquesByNodeIds === void 0 || backend.insertUniqueBatch === void 0 || backend.checkUniqueBatch === void 0)) {
1128
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1176
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1129
1177
  "updateWhere() requires batched uniqueness sidecar operations for constrained nodes",
1130
1178
  { code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
1131
1179
  );
1132
1180
  }
1133
1181
  if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (backend.upsertFulltext === void 0 || backend.deleteFulltext === void 0 || backend.upsertFulltextBatch === void 0 || backend.deleteFulltextBatch === void 0)) {
1134
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1182
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1135
1183
  "updateWhere() requires batched fulltext sidecar operations for searchable nodes",
1136
1184
  { code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
1137
1185
  );
1138
1186
  }
1139
- if (chunk32UETY6S_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
1140
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1187
+ if (chunkMFZR4QKM_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
1188
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1141
1189
  "updateWhere() requires batched vector sidecar operations for embedded nodes",
1142
1190
  { code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
1143
1191
  );
@@ -1145,32 +1193,32 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1145
1193
  const hookContext = ctx.createBulkOperationContext("updateWhere", kind);
1146
1194
  return ctx.withBulkOperationHooks(
1147
1195
  hookContext,
1148
- () => chunkQPOQX2DI_cjs.runInWriteTransaction(
1196
+ () => chunkMX4DHSQP_cjs.runInWriteTransaction(
1149
1197
  ctx,
1150
1198
  backend,
1151
1199
  async (target, lock) => {
1152
1200
  const updateNodeSet = target.updateNodeSet;
1153
1201
  if (updateNodeSet === void 0) {
1154
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1202
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1155
1203
  "The transaction backend does not support set-based node updates",
1156
1204
  { code: "SET_UPDATE_UNSUPPORTED", kind }
1157
1205
  );
1158
1206
  }
1159
1207
  const hardDeleteUniquesByNodeIds = target.hardDeleteUniquesByNodeIds;
1160
1208
  if (uniqueConstraints.length > 0 && (hardDeleteUniquesByNodeIds === void 0 || target.insertUniqueBatch === void 0 || target.checkUniqueBatch === void 0)) {
1161
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1209
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1162
1210
  "The transaction backend lacks batched uniqueness operations",
1163
1211
  { code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
1164
1212
  );
1165
1213
  }
1166
1214
  if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (target.upsertFulltext === void 0 || target.deleteFulltext === void 0 || target.upsertFulltextBatch === void 0 || target.deleteFulltextBatch === void 0)) {
1167
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1215
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1168
1216
  "The transaction backend lacks batched fulltext operations",
1169
1217
  { code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
1170
1218
  );
1171
1219
  }
1172
- if (chunk32UETY6S_cjs.getEmbeddingFields(schema).length > 0 && (target.upsertEmbedding === void 0 || target.deleteEmbedding === void 0 || target.upsertEmbeddingBatch === void 0 || target.deleteEmbeddingBatch === void 0)) {
1173
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1220
+ if (chunkMFZR4QKM_cjs.getEmbeddingFields(schema).length > 0 && (target.upsertEmbedding === void 0 || target.deleteEmbedding === void 0 || target.upsertEmbeddingBatch === void 0 || target.deleteEmbeddingBatch === void 0)) {
1221
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1174
1222
  "The transaction backend lacks batched vector operations",
1175
1223
  { code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
1176
1224
  );
@@ -1185,14 +1233,14 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1185
1233
  });
1186
1234
  if (result.affectedCount === 0) return { affectedCount: 0 };
1187
1235
  const sidecarItems = result.rows.map((row) => {
1188
- const props = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
1189
- const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(schema, props, {
1236
+ const props = chunk3HGRTCDU_cjs.rowPropsToObject(row.props);
1237
+ const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(schema, props, {
1190
1238
  kind,
1191
1239
  operation: "update",
1192
1240
  id: row.id
1193
1241
  });
1194
1242
  if (!chunkPWLJ77UV_cjs.canonicalEqual(validatedProps, props)) {
1195
- throw new chunkKCH7WQA5_cjs.ValidationError(
1243
+ throw new chunkMRDBBHIZ_cjs.ValidationError(
1196
1244
  `Set update would persist a non-canonical ${kind} row`,
1197
1245
  {
1198
1246
  entityType: "node",
@@ -1221,15 +1269,15 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1221
1269
  for (const constraint of uniqueConstraints) {
1222
1270
  const keyToId = /* @__PURE__ */ new Map();
1223
1271
  for (const item of sidecarItems) {
1224
- if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, item.props)) continue;
1225
- const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
1272
+ if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, item.props)) continue;
1273
+ const key = chunkFQPEMEWX_cjs.computeUniqueKey(
1226
1274
  item.props,
1227
1275
  constraint.fields,
1228
1276
  constraint.collation
1229
1277
  );
1230
1278
  const priorId = keyToId.get(key);
1231
1279
  if (priorId !== void 0 && priorId !== item.id) {
1232
- throw new chunkKCH7WQA5_cjs.UniquenessError({
1280
+ throw new chunkMRDBBHIZ_cjs.UniquenessError({
1233
1281
  constraintName: constraint.name,
1234
1282
  kind,
1235
1283
  existingId: priorId,
@@ -1241,7 +1289,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1241
1289
  }
1242
1290
  const keys = [...keyToId.keys()];
1243
1291
  if (keys.length === 0) continue;
1244
- for (const kindToCheck of chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
1292
+ for (const kindToCheck of chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
1245
1293
  kind,
1246
1294
  constraint.scope,
1247
1295
  ctx.registry
@@ -1258,7 +1306,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1258
1306
  if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
1259
1307
  continue;
1260
1308
  }
1261
- throw new chunkKCH7WQA5_cjs.UniquenessError({
1309
+ throw new chunkMRDBBHIZ_cjs.UniquenessError({
1262
1310
  constraintName: constraint.name,
1263
1311
  kind: kindToCheck,
1264
1312
  existingId: existing.node_id,
@@ -1274,8 +1322,8 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1274
1322
  nodeIds: result.rows.map((row) => row.id)
1275
1323
  });
1276
1324
  }
1277
- await chunk32UETY6S_cjs.applyNodeInsertSideEffectsBatch(
1278
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1325
+ await chunkMFZR4QKM_cjs.applyNodeInsertSideEffectsBatch(
1326
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1279
1327
  sidecarItems,
1280
1328
  target
1281
1329
  );
@@ -1292,14 +1340,28 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
1292
1340
  );
1293
1341
  }
1294
1342
  async function executeNodeUpsertUpdate(ctx, input, backend, options) {
1295
- return chunkQPOQX2DI_cjs.runInWriteTransaction(
1343
+ if (input.clearValidTo === true) {
1344
+ assertClearValidToSupported(backend, "node");
1345
+ }
1346
+ return chunkMX4DHSQP_cjs.runInWriteTransaction(
1296
1347
  ctx,
1297
1348
  backend,
1298
1349
  async (target, lock) => {
1350
+ const validTo = chunk425IZOQ5_cjs.validateOptionalCanonicalIsoDate(
1351
+ input.validTo,
1352
+ "validTo"
1353
+ );
1299
1354
  const identity = ctx.identity;
1300
- if (options?.clearDeleted && identity !== void 0) {
1355
+ if (identity !== void 0 && (options?.clearDeleted === true || input.validTo !== void 0)) {
1301
1356
  await identity.lock(target);
1302
1357
  }
1358
+ if (identity !== void 0 && validTo !== void 0) {
1359
+ await identity.requireValidityEndCompatible(
1360
+ target,
1361
+ { kind: input.kind, id: input.id },
1362
+ validTo
1363
+ );
1364
+ }
1303
1365
  const node = await performNodeUpdateWithResurrectionRecovery(
1304
1366
  ctx,
1305
1367
  input,
@@ -1327,7 +1389,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
1327
1389
  const gate = await backend.getNode(ctx.graphId, kind, id);
1328
1390
  if (!gate || gate.deleted_at) return;
1329
1391
  const opContext = ctx.createOperationContext("delete", "node", kind, id);
1330
- return chunkQPOQX2DI_cjs.runHookedWriteOperation(
1392
+ return chunkMX4DHSQP_cjs.runHookedWriteOperation(
1331
1393
  ctx,
1332
1394
  opContext,
1333
1395
  backend,
@@ -1336,9 +1398,9 @@ async function executeNodeDelete(ctx, kind, id, backend) {
1336
1398
  if (identity !== void 0) await identity.lock(target);
1337
1399
  const registration = getNodeRegistration(ctx.graph, kind);
1338
1400
  const preflight = await target.getNode(ctx.graphId, kind, id);
1339
- if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) return;
1340
- await chunk32UETY6S_cjs.applyNodeSoftDelete(
1341
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1401
+ if (!preflight || !chunk3HGRTCDU_cjs.isLiveNodeRow(preflight)) return;
1402
+ await chunkMFZR4QKM_cjs.applyNodeSoftDelete(
1403
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1342
1404
  {
1343
1405
  existing: preflight,
1344
1406
  schema: registration.type.schema,
@@ -1354,14 +1416,14 @@ async function executeNodeDelete(ctx, kind, id, backend) {
1354
1416
  );
1355
1417
  }
1356
1418
  async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
1357
- await chunkQPOQX2DI_cjs.runInWriteTransaction(
1419
+ await chunkMX4DHSQP_cjs.runInWriteTransaction(
1358
1420
  ctx,
1359
1421
  backend,
1360
1422
  async (target, lock) => {
1361
1423
  const identity = ctx.identity;
1362
1424
  if (identity !== void 0) await identity.lock(target);
1363
1425
  const registration = getNodeRegistration(ctx.graph, kind);
1364
- const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(
1426
+ const writeContext = chunkMFZR4QKM_cjs.createNodeWriteContext(
1365
1427
  ctx.graphId,
1366
1428
  ctx.registry,
1367
1429
  lock
@@ -1369,8 +1431,8 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
1369
1431
  let affectedCount = 0;
1370
1432
  for (const id of ids) {
1371
1433
  const preflight = await target.getNode(ctx.graphId, kind, id);
1372
- if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) continue;
1373
- await chunk32UETY6S_cjs.applyNodeSoftDelete(
1434
+ if (!preflight || !chunk3HGRTCDU_cjs.isLiveNodeRow(preflight)) continue;
1435
+ await chunkMFZR4QKM_cjs.applyNodeSoftDelete(
1374
1436
  writeContext,
1375
1437
  {
1376
1438
  existing: preflight,
@@ -1394,7 +1456,7 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
1394
1456
  const gate = await backend.getNode(ctx.graphId, kind, id);
1395
1457
  if (!gate) return;
1396
1458
  const opContext = ctx.createOperationContext("delete", "node", kind, id);
1397
- return chunkQPOQX2DI_cjs.runHookedWriteOperation(
1459
+ return chunkMX4DHSQP_cjs.runHookedWriteOperation(
1398
1460
  ctx,
1399
1461
  opContext,
1400
1462
  backend,
@@ -1402,8 +1464,8 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
1402
1464
  const identity = ctx.identity;
1403
1465
  if (identity !== void 0) await identity.lock(target);
1404
1466
  const registration = getNodeRegistration(ctx.graph, kind);
1405
- await chunk32UETY6S_cjs.applyNodeHardDelete(
1406
- chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1467
+ await chunkMFZR4QKM_cjs.applyNodeHardDelete(
1468
+ chunkMFZR4QKM_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
1407
1469
  {
1408
1470
  kind,
1409
1471
  id,
@@ -1422,12 +1484,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
1422
1484
  const ifExists = options?.ifExists ?? "return";
1423
1485
  const registration = getNodeRegistration(ctx.graph, kind);
1424
1486
  const nodeKind = registration.type;
1425
- const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
1487
+ const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, props, {
1426
1488
  kind,
1427
1489
  operation: "create"
1428
1490
  });
1429
1491
  const constraint = resolveConstraint(ctx.graph, kind, constraintName);
1430
- if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) {
1492
+ if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps)) {
1431
1493
  const node = await executeNodeCreate(
1432
1494
  ctx,
1433
1495
  { kind, props: validatedProps },
@@ -1436,12 +1498,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
1436
1498
  );
1437
1499
  return { node, action: "created" };
1438
1500
  }
1439
- const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
1501
+ const key = chunkFQPEMEWX_cjs.computeUniqueKey(
1440
1502
  validatedProps,
1441
1503
  constraint.fields,
1442
1504
  constraint.collation
1443
1505
  );
1444
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
1506
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
1445
1507
  kind,
1446
1508
  constraint.scope,
1447
1509
  ctx.registry
@@ -1498,25 +1560,25 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
1498
1560
  try {
1499
1561
  return await attempt();
1500
1562
  } catch (error) {
1501
- if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
1563
+ if (!(error instanceof chunkMRDBBHIZ_cjs.UniquenessError)) throw error;
1502
1564
  return attempt();
1503
1565
  }
1504
1566
  }
1505
1567
  async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
1506
1568
  const registration = getNodeRegistration(ctx.graph, kind);
1507
1569
  const nodeKind = registration.type;
1508
- const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
1570
+ const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, props, {
1509
1571
  kind,
1510
1572
  operation: "create"
1511
1573
  });
1512
1574
  const constraint = resolveConstraint(ctx.graph, kind, constraintName);
1513
- if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) return void 0;
1514
- const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
1575
+ if (!chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps)) return void 0;
1576
+ const key = chunkFQPEMEWX_cjs.computeUniqueKey(
1515
1577
  validatedProps,
1516
1578
  constraint.fields,
1517
1579
  constraint.collation
1518
1580
  );
1519
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
1581
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
1520
1582
  kind,
1521
1583
  constraint.scope,
1522
1584
  ctx.registry
@@ -1542,12 +1604,12 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
1542
1604
  function validateAndComputeKeys(nodeKind, kind, constraint, items) {
1543
1605
  const validated = [];
1544
1606
  for (const item of items) {
1545
- const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, item.props, {
1607
+ const validatedProps = chunkMX4DHSQP_cjs.validateNodeProps(nodeKind.schema, item.props, {
1546
1608
  kind,
1547
1609
  operation: "create"
1548
1610
  });
1549
- const applies = chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps);
1550
- const key = applies ? chunkZBVZ7HXD_cjs.computeUniqueKey(
1611
+ const applies = chunkFQPEMEWX_cjs.checkWherePredicate(constraint, validatedProps);
1612
+ const key = applies ? chunkFQPEMEWX_cjs.computeUniqueKey(
1551
1613
  validatedProps,
1552
1614
  constraint.fields,
1553
1615
  constraint.collation
@@ -1570,7 +1632,7 @@ async function executeNodeBulkFindByConstraint(ctx, kind, constraintName, items,
1570
1632
  const constraint = resolveConstraint(ctx.graph, kind, constraintName);
1571
1633
  const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
1572
1634
  const uniqueKeys = collectUniqueKeys(validated);
1573
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
1635
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
1574
1636
  kind,
1575
1637
  constraint.scope,
1576
1638
  ctx.registry
@@ -1620,10 +1682,10 @@ function resolveNodeIndex(graph, kind, indexName) {
1620
1682
  (candidate) => candidate.entity === "node" && candidate.kind === kind && candidate.name === indexName
1621
1683
  );
1622
1684
  if (declaration?.entity !== "node") {
1623
- throw new chunkKCH7WQA5_cjs.NodeIndexNotFoundError(indexName, kind);
1685
+ throw new chunkMRDBBHIZ_cjs.NodeIndexNotFoundError(indexName, kind);
1624
1686
  }
1625
1687
  if (declaration.method !== void 0) {
1626
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1688
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1627
1689
  `bulkFindByIndex cannot probe index "${indexName}" (method "${declaration.method}"): only btree indexes serve equality probes.`,
1628
1690
  { indexName, kind, method: declaration.method }
1629
1691
  );
@@ -1661,7 +1723,7 @@ function validateIndexProbeValue(value, valueType, pointer, kind) {
1661
1723
  }
1662
1724
  }
1663
1725
  function indexProbeTypeError(pointer, kind, expected, value) {
1664
- return new chunkKCH7WQA5_cjs.ValidationError(
1726
+ return new chunkMRDBBHIZ_cjs.ValidationError(
1665
1727
  `Index probe value for "${pointer}" on node kind "${kind}" has an incompatible type`,
1666
1728
  {
1667
1729
  entityType: "node",
@@ -1695,7 +1757,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
1695
1757
  if (items.length === 0) return [];
1696
1758
  const index = resolveNodeIndex(ctx.graph, kind, indexName);
1697
1759
  if (index.fields.length === 0) {
1698
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1760
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1699
1761
  `bulkFindByIndex requires an index with at least one prop-based field on index "${indexName}" (node kind "${kind}")`,
1700
1762
  { indexName, kind },
1701
1763
  {
@@ -1704,7 +1766,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
1704
1766
  );
1705
1767
  }
1706
1768
  if (index.fieldValueTypes.includes("date")) {
1707
- throw new chunkKCH7WQA5_cjs.ConfigurationError(
1769
+ throw new chunkMRDBBHIZ_cjs.ConfigurationError(
1708
1770
  `bulkFindByIndex does not support date-typed key fields on index "${indexName}" (node kind "${kind}")`,
1709
1771
  { indexName, kind },
1710
1772
  {
@@ -1714,7 +1776,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
1714
1776
  }
1715
1777
  const limitPerInput = options?.limitPerInput;
1716
1778
  if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
1717
- throw new chunkKCH7WQA5_cjs.ValidationError(
1779
+ throw new chunkMRDBBHIZ_cjs.ValidationError(
1718
1780
  "bulkFindByIndex limitPerInput must be a positive integer",
1719
1781
  {
1720
1782
  entityType: "node",
@@ -1729,7 +1791,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
1729
1791
  }
1730
1792
  );
1731
1793
  }
1732
- const adapter = chunkZHOAZD7Q_cjs.getDialect(backend.dialect);
1794
+ const adapter = chunkL3LQNR34_cjs.getDialect(backend.dialect);
1733
1795
  const probes = items.map(
1734
1796
  (item) => index.fields.map((pointer, position) => {
1735
1797
  const value = chunkA7J2YDDI_cjs.resolveJsonPointer(item.props, pointer);
@@ -1756,47 +1818,47 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
1756
1818
  }
1757
1819
  groupToInputs[existing]?.push(inputIndex);
1758
1820
  }
1759
- const schema = backend.tableNames ? chunkQU7QLJA4_cjs.createSqlSchema(backend.tableNames) : chunkQU7QLJA4_cjs.DEFAULT_SQL_SCHEMA;
1821
+ const schema = backend.tableNames ? chunk3U5ABFDW_cjs.createSqlSchema(backend.tableNames) : chunk3U5ABFDW_cjs.DEFAULT_SQL_SCHEMA;
1760
1822
  const compileContext = {
1761
1823
  dialect: backend.dialect,
1762
- propsColumn: chunk2ZWM2RFH_cjs.sql.raw(`"props"`),
1763
- systemColumn: (column) => chunk2ZWM2RFH_cjs.sql.raw(`"${column}"`)
1824
+ propsColumn: chunkEDN4Y4ZG_cjs.sql.raw(`"props"`),
1825
+ systemColumn: (column) => chunkEDN4Y4ZG_cjs.sql.raw(`"${column}"`)
1764
1826
  };
1765
- const fieldKeys = chunkZHOAZD7Q_cjs.compileNodeIndexFieldKeys(index, compileContext);
1827
+ const fieldKeys = chunkL3LQNR34_cjs.compileNodeIndexFieldKeys(index, compileContext);
1766
1828
  const groupPredicates = groupProbes.map(
1767
- (probe) => chunk2ZWM2RFH_cjs.sql`(${chunk2ZWM2RFH_cjs.sql.join(
1829
+ (probe) => chunkEDN4Y4ZG_cjs.sql`(${chunkEDN4Y4ZG_cjs.sql.join(
1768
1830
  fieldKeys.map((fieldKey, position) => {
1769
1831
  const value = probe[position];
1770
1832
  if (value === void 0 || value === null) {
1771
- return chunk2ZWM2RFH_cjs.sql`${fieldKey} IS NULL`;
1833
+ return chunkEDN4Y4ZG_cjs.sql`${fieldKey} IS NULL`;
1772
1834
  }
1773
1835
  return adapter.nullSafeEquals(
1774
1836
  fieldKey,
1775
- chunk2ZWM2RFH_cjs.sql`${coerceIndexProbeBind(value, adapter)}`
1837
+ chunkEDN4Y4ZG_cjs.sql`${coerceIndexProbeBind(value, adapter)}`
1776
1838
  );
1777
1839
  }),
1778
- chunk2ZWM2RFH_cjs.sql` AND `
1840
+ chunkEDN4Y4ZG_cjs.sql` AND `
1779
1841
  )})`
1780
1842
  );
1781
1843
  const caseBranches = groupPredicates.map(
1782
- (predicate, group) => chunk2ZWM2RFH_cjs.sql`WHEN ${predicate} THEN ${chunk2ZWM2RFH_cjs.sql.raw(String(group))}`
1844
+ (predicate, group) => chunkEDN4Y4ZG_cjs.sql`WHEN ${predicate} THEN ${chunkEDN4Y4ZG_cjs.sql.raw(String(group))}`
1783
1845
  );
1784
- const probeIndexExpr = chunk2ZWM2RFH_cjs.sql`CASE ${chunk2ZWM2RFH_cjs.sql.join(caseBranches, chunk2ZWM2RFH_cjs.sql` `)} ELSE NULL END`;
1846
+ const probeIndexExpr = chunkEDN4Y4ZG_cjs.sql`CASE ${chunkEDN4Y4ZG_cjs.sql.join(caseBranches, chunkEDN4Y4ZG_cjs.sql` `)} ELSE NULL END`;
1785
1847
  const conditions = [
1786
- chunk2ZWM2RFH_cjs.sql`"graph_id" = ${ctx.graphId}`,
1787
- chunk2ZWM2RFH_cjs.sql`"kind" = ${kind}`,
1788
- chunk2ZWM2RFH_cjs.sql`"deleted_at" IS NULL`
1848
+ chunkEDN4Y4ZG_cjs.sql`"graph_id" = ${ctx.graphId}`,
1849
+ chunkEDN4Y4ZG_cjs.sql`"kind" = ${kind}`,
1850
+ chunkEDN4Y4ZG_cjs.sql`"deleted_at" IS NULL`
1789
1851
  ];
1790
1852
  if (index.where !== void 0) {
1791
- conditions.push(chunkZHOAZD7Q_cjs.compileIndexWhere(compileContext, index.where));
1853
+ conditions.push(chunkL3LQNR34_cjs.compileIndexWhere(compileContext, index.where));
1792
1854
  }
1793
- conditions.push(chunk2ZWM2RFH_cjs.sql`(${chunk2ZWM2RFH_cjs.sql.join(groupPredicates, chunk2ZWM2RFH_cjs.sql` OR `)})`);
1794
- const whereClause = chunk2ZWM2RFH_cjs.sql.join(conditions, chunk2ZWM2RFH_cjs.sql` AND `);
1795
- const probedSelect = chunk2ZWM2RFH_cjs.sql`SELECT "id", ${probeIndexExpr} AS probe_idx FROM ${schema.nodesTable} WHERE ${whereClause}`;
1855
+ conditions.push(chunkEDN4Y4ZG_cjs.sql`(${chunkEDN4Y4ZG_cjs.sql.join(groupPredicates, chunkEDN4Y4ZG_cjs.sql` OR `)})`);
1856
+ const whereClause = chunkEDN4Y4ZG_cjs.sql.join(conditions, chunkEDN4Y4ZG_cjs.sql` AND `);
1857
+ const probedSelect = chunkEDN4Y4ZG_cjs.sql`SELECT "id", ${probeIndexExpr} AS probe_idx FROM ${schema.nodesTable} WHERE ${whereClause}`;
1796
1858
  const capInSql = limitPerInput !== void 0 && backend.capabilities.windowFunctions;
1797
- const query = capInSql ? chunk2ZWM2RFH_cjs.sql`SELECT "id", probe_idx FROM (SELECT "id", probe_idx, ROW_NUMBER() OVER (PARTITION BY probe_idx ORDER BY "id") AS probe_rank FROM (${probedSelect}) AS probed) AS ranked WHERE probe_rank <= ${limitPerInput} ORDER BY probe_idx, "id"` : chunk2ZWM2RFH_cjs.sql`${probedSelect} ORDER BY probe_idx, "id"`;
1859
+ const query = capInSql ? chunkEDN4Y4ZG_cjs.sql`SELECT "id", probe_idx FROM (SELECT "id", probe_idx, ROW_NUMBER() OVER (PARTITION BY probe_idx ORDER BY "id") AS probe_rank FROM (${probedSelect}) AS probed) AS ranked WHERE probe_rank <= ${limitPerInput} ORDER BY probe_idx, "id"` : chunkEDN4Y4ZG_cjs.sql`${probedSelect} ORDER BY probe_idx, "id"`;
1798
1860
  const rawMatches = await backend.execute(
1799
- chunk2ZWM2RFH_cjs.asCompiledRowsSql(query)
1861
+ chunkEDN4Y4ZG_cjs.asCompiledRowsSql(query)
1800
1862
  );
1801
1863
  const matches = limitPerInput !== void 0 && !capInSql ? capMatchesPerGroup(rawMatches, limitPerInput) : rawMatches;
1802
1864
  const nodesById = await hydrateNodesById(
@@ -1829,7 +1891,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
1829
1891
  return capped;
1830
1892
  }
1831
1893
  async function hydrateNodesById(backend, graphId, kind, ids) {
1832
- const rowsById = await chunkA4R3H7RU_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
1894
+ const rowsById = await chunkOIFSOPSR_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
1833
1895
  const nodesById = /* @__PURE__ */ new Map();
1834
1896
  for (const [id, row] of rowsById) {
1835
1897
  if (row.deleted_at !== void 0) continue;
@@ -1845,7 +1907,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
1845
1907
  const constraint = resolveConstraint(ctx.graph, kind, constraintName);
1846
1908
  const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
1847
1909
  const uniqueKeys = collectUniqueKeys(validated);
1848
- const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
1910
+ const kindsToCheck = chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
1849
1911
  kind,
1850
1912
  constraint.scope,
1851
1913
  ctx.registry
@@ -1948,11 +2010,13 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
1948
2010
  try {
1949
2011
  return await attempt();
1950
2012
  } catch (error) {
1951
- if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
2013
+ if (!(error instanceof chunkMRDBBHIZ_cjs.UniquenessError)) throw error;
1952
2014
  return attempt();
1953
2015
  }
1954
2016
  }
1955
2017
 
2018
+ exports.assertClearValidToSupported = assertClearValidToSupported;
2019
+ exports.assertValidityEndMutation = assertValidityEndMutation;
1956
2020
  exports.checkCardinalityConstraint = checkCardinalityConstraint;
1957
2021
  exports.createNodeBatchValidationBackend = createNodeBatchValidationBackend;
1958
2022
  exports.edgeWriteNeedsConstraintFence = edgeWriteNeedsConstraintFence;
@@ -1976,6 +2040,7 @@ exports.rowToEdge = rowToEdge;
1976
2040
  exports.rowToEdgeMeta = rowToEdgeMeta;
1977
2041
  exports.rowToNode = rowToNode;
1978
2042
  exports.rowToNodeMeta = rowToNodeMeta;
2043
+ exports.validityEndAfterMutation = validityEndAfterMutation;
1979
2044
  exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
1980
- //# sourceMappingURL=chunk-BQM5P2NO.cjs.map
1981
- //# sourceMappingURL=chunk-BQM5P2NO.cjs.map
2045
+ //# sourceMappingURL=chunk-WGX7JH7E.cjs.map
2046
+ //# sourceMappingURL=chunk-WGX7JH7E.cjs.map